query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Create an image file name
private File createImageFile(String imgDir) throws IOException { String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); String imageFileName = imgDir + File.separator + timeStamp + "_"; File storageDir = Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_PICTURES); return File.createTempFile( imageFileName, /* prefix */ ".jpg", /* suffix */ storageDir /* directory */ ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private File createImageFileName() throws IOException {\n String timestamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n //there are two types of SimpleDateFormat and Date()\n String prepend = \"JPEG_\" + timestamp + \"_\";\n File imageFile = File.createTempFile(prepend, \".jpg\", mImageFolder);\n mImageFileName = imageFile.getAbsolutePath();\n return imageFile;\n\n }", "public void createNewImageFile(){\n fillNewImage();\n\n try {\n ImageIO.write(newImage, imageFileType, new File(k + \"_Colored_\" + fileName.substring(0,fileName.length() - 4) + \".\" + imageFileType));\n } catch (IOException e){\n e.printStackTrace();\n }\n \n }", "private static File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = JPEG_FILE_PREFIX + timeStamp + \"_\";\n File albumF = getAlbumDir();\n File imageF = File.createTempFile(imageFileName, JPEG_FILE_SUFFIX, albumF);\n return imageF;\n }", "private static File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = JPEG_FILE_PREFIX + timeStamp + \"_\";\n File albumF = getAlbumDir();\n File imageF = File.createTempFile(imageFileName, JPEG_FILE_SUFFIX, albumF);\n return imageF;\n }", "private File createImageFile() throws IOException {\n // Create an image file name\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"MAZE_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = JPEG_FILE_PREFIX + timeStamp + \"_\";\n File albumF = getAlbumDir();\n File imageF = File.createTempFile(imageFileName, JPEG_FILE_SUFFIX, albumF);\n return imageF;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\")\n .format(new Date());\n String imageFileName = JPEG_FILE_PREFIX + timeStamp + \"_\";\n File albumF = getAlbumDir();\n File imageF = File.createTempFile(imageFileName, JPEG_FILE_SUFFIX,\n albumF);\n return imageF;\n }", "private File createImageFile() throws IOException{\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\"+timeStamp;\n File image = File.createTempFile(imageFileName, \".jpg\", this.savePath);\n \n return image;\n }", "private File createImageFile() throws IOException {\n // Create an image file name\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n return File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n }", "private File createImageFile() throws IOException{\n @SuppressLint(\"SimpleDateFormat\")\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"img_\"+timeStamp+\"_\";\n File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);\n return File.createTempFile(imageFileName,\".jpg\",storageDir);\n }", "private File createImageFile() throws IOException {\n @SuppressLint({\"NewApi\", \"LocalSuppress\"}) String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\", Locale.getDefault()).format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_PICTURES);\n return File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n }", "public String createImageName(File imageFile)\n\t{\n\t\tString name = imageFile.getAbsolutePath();\n\t\t\n\t\t// remove the initial part of the path that is common among all images so that only the relative path within the image folder remains\n\t\t// also remove the file's extension\n\t\tname = name.substring(imageFolder.getAbsolutePath().length() + 1, name.lastIndexOf('.'));\t\t\n\t\treturn name;\n\t}", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(getString(R.string.day_format)).format(new Date());\n String imageFileName = getString(R.string.image_file_prefix) + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(imageFileName, getString(R.string.image_file_format),\n storageDir\n );\n\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\", Locale.US).format(new Date());\n String imageFileName = \"perfil_\" + timeStamp + \"_\";\n String outputPath = PATH;\n File storageDir = new File(outputPath);\n if(!storageDir.exists())storageDir.mkdirs();\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = \"file:\" + image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException\n {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_PICTURES);\n File imageFile = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n return imageFile;\n }", "private String createFileName(){\n \t\n \tString state = Environment.getExternalStorageState();\n \tif(state.equals(Environment.MEDIA_MOUNTED)){ \t\t\n \t\tFile folder = new File(Environment.getExternalStorageDirectory() + \"/ArtCameraPro\");\n \t\tboolean success = true;\n \t\tif (!folder.exists()) {\n \t\t success = folder.mkdir();\n \t\t} \n \t\tString sFileName = Environment.getExternalStorageDirectory() + \"/ArtCameraPro\" + File.separator + System.currentTimeMillis() + \".jpg\";\n \t\treturn sFileName;\n \t\t\n \t}\n \treturn \"\";\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n return image;\n }", "private static File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = MyApplication.getContext().getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n return image;\n }", "public static String createFotoFileName(String prefix) {\n return prefix + \"_\" + DateUtil.getCurrentDateTimeAsString(\"yyyyMMdd_hhmmss\") + \".jpg\";\n }", "private File createImageFile() throws IOException {\n // Create an image file name\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);\n File imageFile = File.createTempFile(imageFileName, \".jpg\", storageDir);\n return imageFile;\n }", "private File createImageFile() throws IOException {\n // Create an image file name\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getContext().getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp;\n\n String folderName = context.getString(R.string.app_name).toLowerCase();\n\n File path = new File(ContextCompat.getExternalFilesDirs(getActivity(), null)[0]\n .getAbsolutePath() + \"/\" + folderName);\n\n //make sure folder exists\n path.mkdirs();\n\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n path /* directory */\n );\n\n return image;\n }", "private File createImageFile() throws IOException {\n // Create an image file name\n String timeStamp = new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\n String mFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File mFile = File.createTempFile(mFileName, \".jpg\", storageDir);\n return mFile;\n }", "@SuppressLint(\"SimpleDateFormat\")\n public static File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = JPEG_FILE_PREFIX + timeStamp + JPEG_FILE_SUFFIX;\n String nameAlbum = Environment.getExternalStorageDirectory().getAbsolutePath() + \"/\" + nameDir;// getString(R.string.app_name);\n File albumF = new File(nameAlbum);\n if (!albumF.exists()) {\n albumF.mkdirs();\n File noMedia = new File(albumF, \".nomedia\");\n noMedia.createNewFile();\n }\n\n File imageF = new File(albumF, imageFileName);\n imageF.createNewFile();\n return imageF;\n }", "private String generateFilename() {\n UUID uuid = UUID.randomUUID();\n return uuid.toString();\n }", "private File createImageFile() throws IOException\n {\n String timeStamp = new SimpleDateFormat(\"yyyymmddHHmmss\").format(new Date());\n String imageFileName = timeStamp;\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n userCacheDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n return image;\n }", "private File createImageFile() {\n\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\", Locale.getDefault()).format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n\n File storageDir = Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_PICTURES + APP_PICTURE_DIRECTORY);\n storageDir.mkdirs();\n\n File imageFile = null;\n\n try {\n imageFile = File.createTempFile(\n imageFileName, /* prefix */\n FILE_SUFFIX_JPG, /* suffix */\n storageDir /* directory */\n );\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return imageFile;\n }", "private File createImageFile() {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = new File(Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_DCIM), \"GIS\");\n File image = null;\n\n if(!storageDir.exists()){\n\n storageDir.mkdirs();\n\n }\n try {\n image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n }catch (Exception e){\n\n e.printStackTrace();\n\n }\n // Save a file: path for use with ACTION_VIEW intents\n\n return image;\n }", "private String beautiplyFileNameGenerator() {\r\n\t\t// /randomvalue between 0 to 9\r\n\t\tString name = \"beautiply\" + new Random().nextInt(9) + \".png\";\r\n\r\n\t\treturn name;\r\n\t}", "private void createImage (String image_name, int filename){\n\n\t\tString image_folder = getLevelImagePatternFolder();\n\t\t\n\t\tString resource = filename+\".png\";\n\t\tImageIcon ii = new ImageIcon(this.getClass().getResource(image_folder + resource));\n images.put(image_name, ii.getImage());\n\t}", "public File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_PICTURES);\n File imageFile = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n return imageFile;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n String z = image.getAbsolutePath();\n return image;\n }", "public String createImageName(String empName) {\n StringBuilder iN = new StringBuilder();\n\n String[] fnLn = empName.split(\" \");\n iN.append(fnLn[0]);\n iN.append(fnLn[fnLn.length-1].substring(0, 1));\n return iN.toString().trim();\n }", "public File createImageFile() {\n // the public picture director\n File picturesDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); // To get pictures directory from android system\n\n // timestamp makes unique name.\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat sdf = new SimpleDateFormat(\"yyyyMMdd_HHmmss\");\n String timestamp = sdf.format(new Date());\n\n // put together the directory and the timestamp to make a unique image location.\n File imageFile = new File(picturesDirectory, timestamp + \".jpg\");\n\n return imageFile;\n }", "public File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = mContext.getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n return File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n }", "private File createImageFile() throws IOException {\n // Create an image file name\n String timeStamp = new SimpleDateFormat ( \"yyyyMMdd_HHmmss\" ).format ( new Date () );\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir ( Environment.DIRECTORY_PICTURES );\n File image = File.createTempFile (\n imageFileName , /* prefix */\n \".jpg\" , /* suffix */\n storageDir /* directory */\n );\n\n // luu file: su dung ACTION_VIEW\n pathToFile = image.getAbsolutePath ();\n return image;\n }", "public File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getActivity().getFilesDir();\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n return image;\n }", "protected File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n strAbsolutePath = image.getAbsolutePath();\n Log.e(\"XpathX\", image.getAbsolutePath());\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\n String mFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File mFile = File.createTempFile(mFileName, \".jpg\", storageDir);\n pictureFilePath = mFile.getAbsolutePath();\n return mFile;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"1mind_\" + timeStamp + \".png\";\n File photo = new File(Environment.getExternalStorageDirectory(), imageFileName);\n mCurrentPhotoPath = photo.getAbsolutePath();\n return photo;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\r\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\r\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\r\n File image = File.createTempFile(\r\n imageFileName, // prefix //\r\n \".jpg\", // suffix //\r\n storageDir // directory //\r\n );\r\n\r\n // Save a file: path for use with ACTION_VIEW intents\r\n mPath = image.getAbsolutePath();\r\n return image;\r\n }", "private File createImageFile() throws IOException {\n String imageFileName = new SimpleDateFormat(\"yyyyMMdd-HHmmss\", Locale.ENGLISH).format(new Date());\n String storageDir = Environment.getExternalStorageDirectory() + \"/DokuChat\";\n File dir = new File(storageDir);\n if (!dir.exists())\n dir.mkdir();\n\n image = new File(storageDir + \"/\" + imageFileName + \".jpg\");\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n pictureImagePath = image.getAbsolutePath();\n return image;\n\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new java.util.Date());\n String imageFileName = \"WILDLIFE_JPEG_\" + timeStamp + \"_\";\n File storageDir = Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n //Todo:Este sera el nombre que tendra el archivo\n String imageFileName = \"IMAGE_\" + timeStamp + \"_\";\n //Todo:Ruta donde se almacenara la imagen\n File storageDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);\n\n //Todo:El tipo de archivo que se almacenara en el directorio\n File image = File.createTempFile(imageFileName,\".jpg\",storageDirectory);\n //Todo: mImageFileLocation sera el valor que se\n mImageFileLocation = image.getAbsolutePath();\n\n return image;\n }", "private File createImageFile() throws IOException\r\n {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\r\n String imageFileName = \"MYAPPTEMP_\" + timeStamp + \"_\";\r\n File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);\r\n File image = File.createTempFile(imageFileName, /* prefix */\r\n \".jpg\", /* suffix */\r\n storageDir /* directory */\r\n );\r\n\r\n return image;\r\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n pictureImagePath = image.getAbsolutePath();\n return image;\n }", "public abstract String getImageSuffix();", "private File createImageFile() {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n //File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File storageDir = new File(utils.getSentImagesDirectory());\n\n File image = null;\n try {\n image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n // Save a file: path for use with ACTION_VIEW intents\n //LOG.info(\"test place3\");\n try {\n imageFilePath = image.getAbsolutePath();\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n //LOG.info(\"test place4\");\n if (image == null) {\n LOG.info(\"image file is null\");\n } else {\n LOG.info(\"image file is not null path is:\" + imageFilePath);\n }\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getActivity().getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".png\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n currentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, // prefix\n \".jpg\", // suffix\n storageDir // directory\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = \"file:\" + image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = SettingsHelper.getPrivateImageFolder(this);\n if (!storageDir.exists()) {\n storageDir.mkdirs();\n }\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n imageUri = Uri.fromFile(image);\n return image;\n }", "private Image createImage(String image_file) {\n\t\tImage img = new Image(image_file);\n\t\treturn img;\n\t}", "public File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\", Locale.US).format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = new File(getPhotoLocation());\n File image = File.createTempFile(\n imageFileName,\n \".jpg\",\n storageDir\n );\n\n setCurrentPhotoFile(image.getAbsolutePath());\n return image;\n }", "private File createImageFile() throws IOException\n {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"Picko_JPEG\" + timeStamp + \"_\";\n File storageDir = new File(Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_DOCUMENTS),\"Whatsapp\");\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n String mCurrentPhotoPath = \"file:\" + image.getAbsolutePath();\n return image;\n\n\n }", "public static File createImageFile(Context context, String name) throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\r\n String imageFileName = name + \"_\" + timeStamp + \"_\";\r\n File storageDir = context.getExternalFilesDir(Environment.DIRECTORY_PICTURES);\r\n File image = File.createTempFile(\r\n imageFileName, /* prefix */\r\n \".jpg\", /* suffix */\r\n storageDir /* directory */\r\n );\r\n return image;\r\n }", "public abstract String createFilename(Entity entity);", "private File createImageFile() throws IOException {\n // Create an image file name\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n //The directory where to save the file image\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n //The actual image file\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n // Save a file: path for use with ACTION_VIEW intents\n mPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format( new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\" ;\n File storageDir = Environment.getExternalStoragePublicDirectory(Environment. DIRECTORY_PICTURES);\n File image = File. createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private static File createImageFile(Activity activity) throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = activity.getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n currentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n currentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n currentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n currentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n currentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n currentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n// File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n currentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n// File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n currentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n currentPhotoPath = image.getAbsolutePath();\n savePhotoPathToSharedPrefs();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n //galleryAddPic();\n return image;\n }", "private File createImageFile() throws IOException {\n Date d = new Date();\n String nameDate = new SimpleDateFormat(\"ddMMyyyy_HHmmss\").format(d);\n this.date = new SimpleDateFormat(\"dd/MM/yyyy\").format(d);\n String imageFileName = \"JPEG_\" + nameDate + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = \"file:\" + image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\r\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\r\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\r\n File image = File.createTempFile(\r\n imageFileName, /* prefix */\r\n \".jpg\", /* suffix */\r\n storageDir /* directory */\r\n );\r\n\r\n // Save a file: path for use with ACTION_VIEW intents\r\n mCurrentPhotoPath = image.getAbsolutePath();\r\n return image;\r\n\r\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n photosPaths.add(mCurrentPhotoPath);\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp;\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n currentPhotoPath = image.getAbsolutePath();\n return image;\n }", "public abstract FileName createName(String absolutePath, FileType fileType);", "public String getPhotoFileName() {\n return \"IMG_\" + getId().toString() + \".jpg\";\n }", "private File createImageFile() throws IOException {\n // Create an image file name\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n currentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = activity.getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n // Create an image file name\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(imageFileName, \".jpg\", storageDir);\n\n // Save a file: path for use with ACTION_VIEW intents\n this.currentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n currentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\", Locale.ENGLISH).format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = new File(Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_DCIM), \"Camera\");\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = \"file:\" + image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName,\n \".jpg\",\n storageDir\n );\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "public static File createImageFile(Context ctx) throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = ctx.getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(imageFileName, \".jpg\", storageDir);\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = imageFileName + \"camera.jpg\";\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n //This is the directory in which the file will be created. This is the default location of Camera photos\n File storageDir = new File(Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_DCIM), \"Camera\");\n image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n // Save a file: path for using again\n cameraFilePath = \"file://\" + image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n //This is the directory in which the file will be created. This is the default location of Camera photos\n File storageDir = new File(Environment.getExternalStorageDirectory(), getString(R.string.app_name));\n if (!storageDir.exists()){\n storageDir.mkdir();\n }\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n // Save a file: path for using again\n cameraFilePath = \"file://\" + image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n// File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n\n // Save a file: path for use with ACTION_VIEW intents\n mCurrentPhotoPath = image.getAbsolutePath();\n return image;\n }" ]
[ "0.7782615", "0.7292824", "0.6992056", "0.6992056", "0.6943564", "0.6911284", "0.68938434", "0.686538", "0.68592805", "0.68590325", "0.68580544", "0.68443614", "0.67711073", "0.67546785", "0.6751638", "0.6737171", "0.6726197", "0.67170936", "0.67068315", "0.6706409", "0.6694521", "0.6692518", "0.66892946", "0.6658789", "0.66203934", "0.66164696", "0.6615736", "0.6610864", "0.66096437", "0.6604602", "0.66028416", "0.6600987", "0.65886337", "0.6579357", "0.6576186", "0.65653497", "0.65549564", "0.65421396", "0.65305394", "0.6530493", "0.6523718", "0.6517966", "0.65117127", "0.6505747", "0.6493113", "0.64924705", "0.6475854", "0.6471266", "0.6448684", "0.6419626", "0.64166796", "0.6413514", "0.640042", "0.63892233", "0.6379753", "0.6375813", "0.6375534", "0.6367382", "0.63566", "0.6355329", "0.6345687", "0.6332988", "0.6329631", "0.6329631", "0.6329631", "0.6329631", "0.6329631", "0.63276523", "0.63276523", "0.6326054", "0.6324831", "0.6323436", "0.63181776", "0.6311542", "0.63093704", "0.63077575", "0.630525", "0.6300038", "0.6297278", "0.6296964", "0.6294874", "0.6292948", "0.6289597", "0.62894386", "0.6282458", "0.6281662", "0.62706375", "0.6261314", "0.6258569", "0.62572557", "0.6256673", "0.62541807", "0.6251297", "0.6251297", "0.6251297", "0.6251297", "0.6251297", "0.6251297", "0.6251297", "0.6251297" ]
0.6665624
23
TODO Autogenerated method stub
@Override public String getApp() { throw new UnsupportedOperationException("Not supported yet."); }
{ "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
if (entityGroup == null) throw new IllegalStateException( "Entity group has not been set yet."); if (entityGroup == null) throw new DatastoreFailureException( "Transaction has no entity group set.");
Key getEntityGroup() { return entityGroup; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected synchronized <T extends Group> T persistNewGroup(T group) throws DataBackendException\n {\n try\n {\n \t\n ((TorqueAbstractSecurityEntity)group).save();\n }\n catch (Exception e)\n {\n throw new DataBackendException(\"Adding Group '\" + group.getName() + \"' failed\", e);\n }\n\n return group;\n }", "public void testNewEntity_Boom() throws DataBaseNotReadyException {\n // Verify that our test database is set-up as expected.\n // Access test-person , test-event and test-job.\n // Verify that such items exist in the database\n // and that the test-person has yet no allocations.\n Person p = Manager.getPersonCollection().findEntity(3);\n assertNotNull(\"Bad test data?\", p);\n Event e = Manager.getEventCollection().findEntity(4);\n assertNotNull(\"Bad test data?\", e);\n Job j1 = Manager.getJobCollection().findEntity(1);\n assertNotNull(\"Bad test data?\", j1);\n Job j2 = Manager.getJobCollection().findEntity(2);\n assertNotNull(\"Bad test data?\", j2);\n\n Allocation testItem1 = allocationCollection.newEntity(p, e, j1, \"USER\");\n\n // Here is the statement that should throw the exception:\n System.out.println(\"### testNewEntity_Boom() Exception is expected!\");\n Allocation testItem2 = allocationCollection.newEntity(p, e, j2, \"USER\");\n\n }", "@Override\n @Test(groups = {\"Entity Manager access\"})\n public void testEntityManager00() throws Exception {\n super.testEntityManager00();\n }", "public void testGetAllStates_PersistenceException() throws Exception {\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").getAllStates();\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "public EntityTransactionException() {\r\n\t\tsuper();\r\n\t}", "private static void validateEntity(KindGroup entity) throws ValidationException {\n\t Validator.validateStringField(\"code\", entity.getCode(), 10, true);\n\t Validator.validateStringField(\"description\", entity.getDescription(), 75,true);\n\t Validator.validateBooleanField(\"isStandard\", entity.isStandard(), true);\n }", "public void validate() throws org.apache.thrift.TException {\n if (entity != null) {\r\n entity.validate();\r\n }\r\n }", "public EntityAlreadyExistsException() {\n\t\tsuper(\"exception.entity.already.exists\");\n\t}", "protected abstract EntityBase createEntity() throws Exception;", "@Test(timeout = 4000)\n public void test034() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.mutatesDataOrStructure((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Override\n protected void preconditions(Object entity) throws Exception {\n }", "public void errorWhenCommitting();", "public void a(GroupEntity groupEntity) {\n ((b) ((b) ((b) ((b) ((b) new b(this).b(\"申请加群\")).a(\"确认加入该群?\").a(false)).b(false)).a((CharSequence) \"取消\", (OnClickListener) new d(this))).b((CharSequence) \"申请\", (OnClickListener) new e(this, groupEntity))).c();\n }", "@Override\n\tpublic void saveOrUpdate(Group group) throws ServiceException {\n\n\t}", "@Test(timeout = 4000)\n public void test322() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef(\"]1\");\n // Undeclared exception!\n try { \n xmlEntityRef0.fieldset();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Transactional\n void persistEntities(ConfigGroupEntity configGroupEntity) throws AmbariException {\n ClusterEntity clusterEntity = clusterDAO.findById(cluster.getClusterId());\n configGroupEntity.setClusterEntity(clusterEntity);\n configGroupEntity.setTimestamp(System.currentTimeMillis());\n configGroupDAO.create(configGroupEntity);\n\n configGroupId = configGroupEntity.getGroupId();\n\n persistConfigMapping(clusterEntity, configGroupEntity, m_configurations);\n replaceHostMappings(m_hosts);\n }", "public void testupdateAddress_PersistenceException() throws Exception {\r\n try {\r\n Address address = this.getAddress();\r\n address.setCreationDate(new Date());\r\n address.setId(1);\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").updateAddress(address, false);\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "public void testRetrieveAddresses_PersistenceException() throws Exception {\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").retrieveAddresses(new long[]{1});\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "@Test\n public void checkValidEntity() {\n cleanEntity0();\n entity0 = EntityUtil.getSampleRole();\n final Set<ConstraintViolation<Object>> cv = PersistenceValidation.validate(entity0);\n assertTrue(cv.isEmpty());\n }", "public void testupdateAddresses_PersistenceException() throws Exception {\r\n try {\r\n Address address = this.getAddress();\r\n address.setCreationDate(new Date());\r\n address.setId(1);\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").updateAddresses(new Address[]{address}, false);\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "public void testGetAllCountries_PersistenceException() throws Exception {\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").getAllCountries();\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "public void testassociate_PersistenceException() throws Exception {\r\n Address address = this.getAddress();\r\n address.setId(1);\r\n address.setCreationDate(new Date());\r\n address.setModificationDate(new Date());\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").associate(address, 1, false);\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "@Override\n\tpublic synchronized void renameGroup(Group group, String name) throws DataBackendException, UnknownEntityException\n {\n if (checkExists(group))\n {\n group.setName(name);\n\n try\n {\n TorqueAbstractSecurityEntity g = (TorqueAbstractSecurityEntity)group;\n g.setNew(false);\n g.save();\n }\n catch (Exception e)\n {\n throw new DataBackendException(\"Renaming Group '\" + group.getName() + \"' failed\", e);\n }\n }\n else\n {\n throw new UnknownEntityException(\"Unknown group '\" + group.getName() + \"'\");\n }\n }", "@Test(expected = RuntimeException.class)\r\n \tpublic void testCommit() throws ESException {\n \t\tlocalProject.commit();\r\n \t\tfail(\"Should not be able to commit an unshared Project!\");\r\n \t}", "private void initData() throws Exception {\n runTX(new Callable<Void>() {\n @Override\n public Void call() throws Exception {\n createOrganizationRoles(dm);\n createPaymentTypes(dm);\n createUserRoles(dm);\n supplier = Organizations.createOrganization(dm,\n OrganizationRoleType.SUPPLIER);\n UserGroup defaultGroupSup = new UserGroup();\n defaultGroupSup.setOrganization(supplier);\n defaultGroupSup.setIsDefault(true);\n defaultGroupSup.setName(\"default\");\n dm.persist(defaultGroupSup);\n technologyProvider = Organizations.createOrganization(dm,\n OrganizationRoleType.TECHNOLOGY_PROVIDER);\n UserGroup defaultGroupTP = new UserGroup();\n defaultGroupTP.setOrganization(technologyProvider);\n defaultGroupTP.setIsDefault(true);\n defaultGroupTP.setName(\"default\");\n dm.persist(defaultGroupTP);\n tpAndSup = Organizations.createOrganization(dm,\n OrganizationRoleType.TECHNOLOGY_PROVIDER,\n OrganizationRoleType.SUPPLIER);\n supplierAdminUser = Organizations.createUserForOrg(dm, supplier,\n true, \"admin\");\n supplier2 = Organizations.createOrganization(dm,\n OrganizationRoleType.SUPPLIER);\n UserGroup defaultGroup = new UserGroup();\n defaultGroup.setOrganization(supplier2);\n defaultGroup.setIsDefault(true);\n defaultGroup.setName(\"default\");\n dm.persist(defaultGroup);\n UserGroup defaultGroupTpAndSp = new UserGroup();\n defaultGroupTpAndSp.setOrganization(tpAndSup);\n defaultGroupTpAndSp.setIsDefault(true);\n defaultGroupTpAndSp.setName(\"default\");\n dm.persist(defaultGroupTpAndSp);\n Organizations.createUserForOrg(dm, supplier2, true, \"admin\");\n customer = Organizations.createCustomer(dm, supplier);\n UserGroup defaultGroup1 = new UserGroup();\n defaultGroup1.setOrganization(customer);\n defaultGroup1.setIsDefault(true);\n defaultGroup1.setName(\"default\");\n dm.persist(defaultGroup1);\n customer2 = Organizations.createCustomer(dm, supplier2);\n customerUser = Organizations.createUserForOrg(dm, customer,\n true, \"admin\");\n OrganizationReference onBehalf = new OrganizationReference(\n supplier, customer,\n OrganizationReferenceType.ON_BEHALF_ACTING);\n dm.persist(onBehalf);\n onBehalf = new OrganizationReference(supplier, supplier2,\n OrganizationReferenceType.ON_BEHALF_ACTING);\n dm.persist(onBehalf);\n onBehalf = new OrganizationReference(supplier,\n technologyProvider,\n OrganizationReferenceType.ON_BEHALF_ACTING);\n dm.persist(onBehalf);\n onBehalf = new OrganizationReference(supplier, tpAndSup,\n OrganizationReferenceType.ON_BEHALF_ACTING);\n dm.persist(onBehalf);\n return null;\n }\n });\n }", "public void setGroup(String group) throws InvalidIDException {\r\n\t\tif (group == null) { return; }\r\n\r\n\t\tif (Arrays.binarySearch(Projects.GROUPS, group) < 0) {\r\n\t\t\tthrow new InvalidIDException(\"Attempt to insert an invalid group.\");\r\n\t\t}\r\n\r\n\t\tif (this.groups == null) { this.groups = new HashSet(); }\r\n\t\r\n\t\tthis.groups.add(group);\r\n\t}", "@Test(timeout = 4000)\n public void test131() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef(\"/\");\n // Undeclared exception!\n try { \n xmlEntityRef0.h3((Object) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "public void testRetrieveAddress_PersistenceException() throws Exception {\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").retrieveAddress(1);\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "public void testGetAllAddresses_PersistenceException() throws Exception {\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").getAllAddresses();\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "@Override\n @Test(groups = {\"Entity Factory access\"})\n public void testEntityFactory00() throws Exception {\n super.testEntityFactory00();\n }", "@Test(timeout = 4000)\n public void test158() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef((String) null);\n // Undeclared exception!\n try { \n xmlEntityRef0.del();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Transactional(onUnits = {})\n public void assertNoEntityHasBeenPersisted() {\n checkState(!storedEntities.isEmpty(), \"no entities to check\");\n for (TestEntity storedEntity : storedEntities) {\n assertNull(\"At least one entity which should NOT have been persisted was found in the DB. \" + tasks,\n emProvider.get()\n .find(TestEntity.class, storedEntity.getId()));\n }\n }", "@Test(timeout = 4000)\n public void test032() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.ownerDotComponent((DBObject) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test032() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.ownerDotComponent((DBObject) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public void test_CreateContest_Failure4_PersistenceException()\r\n throws Exception {\r\n try {\r\n initContext();\r\n\r\n entityManager.enablePersistenceException(true);\r\n\r\n Contest contest = createContestForTest();\r\n\r\n beanUnderTest.createContest(contest);\r\n\r\n fail(\"ContestManagementException is expected.\");\r\n } catch (ContestManagementException e) {\r\n // success\r\n }\r\n }", "@Test(expected = TermsOfUsePersistenceException.class)\r\n public void test_getTermsOfUse_PersistenceError() throws Exception {\r\n instance = new ProjectTermsOfUseDaoImpl(TestsHelper.getConfig(TestsHelper.CONFIG_INVALID));\r\n\r\n instance.getTermsOfUse(1, 1, null);\r\n }", "@Test(timeout = 4000)\n public void test013() throws Throwable {\n NameSpec nameSpec0 = NameSpec.NEVER;\n // Undeclared exception!\n try { \n SQLUtil.ukSpec((DBUniqueConstraint) null, nameSpec0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "protected void validateEntity() {\n super.validateEntity();\n }", "@Test(timeout = 4000)\n public void test030() throws Throwable {\n NameSpec nameSpec0 = NameSpec.NEVER;\n // Undeclared exception!\n try { \n SQLUtil.pkSpec((DBPrimaryKeyConstraint) null, nameSpec0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public ConceptPersistException( Exception cause )\r\n {\r\n super( cause );\r\n }", "@Test\n /**\n * Do not allow delete of record in parent table that will cause orphan records in child tables of the database.\n */\n void dataIntegrityViolationExceptionThrownWhenDelete() {\n }", "public void testAddAddress_PersistenceException()\r\n throws Exception {\r\n try {\r\n Address address = this.getAddress();\r\n address.getCountry().setId(10);\r\n this.dao.addAddress(address, false);\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "@Test(timeout = 4000)\n public void test048() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.addRequiredCondition((String) null, (StringBuilder) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test035() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.mutatesStructure((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public void test_updateContest_Failure3() throws Exception {\r\n try {\r\n initContext();\r\n\r\n Contest contest = createContestForTest();\r\n beanUnderTest.createContest(contest);\r\n\r\n entityManager.enableTransactionException(true);\r\n\r\n contest.setName(\"sss\");\r\n beanUnderTest.updateContest(contest, 1, \"2\", true);\r\n\r\n fail(\"ContestManagementException is expected.\");\r\n } catch (ContestManagementException e) {\r\n // success\r\n }\r\n }", "public GroupNotFoundException(String groupName) {\n super(\"The group (\" + groupName + \") could not be found\");\n }", "@Override\n public void validateEntity() {\n if ((Strings.isNullOrEmpty(this.getIdentity()) &&\n Strings.isNullOrEmpty(this.getFileSystemPath())) ||\n Strings.isNullOrEmpty(this.getSourceId())) {\n throw new IllegalArgumentException(\n \"Either the Entity Id or file system path used\" +\n \" to generate the id must be present along with the source id\");\n }\n }", "@Override\n public void verify(@NotNull LedgerTransaction tx) throws IllegalArgumentException {\n }", "@Test\n public void deleteEmpleadoTest() {\n \n try{ \n EmpleadoEntity entity = data.get(3);\n empleadoLogic.deleteEmpleado(entity.getId());\n EmpleadoEntity deleted = em.find(EmpleadoEntity.class, entity.getId());\n Assert.assertNull(deleted);\n \n }catch(BusinessLogicException b){\n Assert.fail();\n }\n }", "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testUpdateSecretGroupMetadataNoOptions() throws Throwable {\n // construct the service\n constructClientService();\n\n server.enqueue(new MockResponse());\n\n // Invoke operation with null options model (negative test)\n secretsManagerService.updateSecretGroupMetadata(null).execute();\n }", "@Override\n public void validate() throws ValidationExceptions {\n ValidationExceptions errors = null;\n if (getState().getState() == EEntityState.Unknown) {\n errors = ValidationExceptions.add(new ValidationException(\n String.format(\"Entity State is Unknown : [id=%s]\",\n getKey().toString())), errors);\n }\n errors = validate(errors);\n\n if (errors != null) {\n getState().setError(errors);\n throw errors;\n }\n }", "void commit() throws StorageException, ValidationException, KeyValueStoreException;", "@Test(expected = DataIntegrityViolationException.class)\n public void testInsertNullDepartmentName() throws Exception {\n Department insertDepartment = new Department(null);\n departmentDao.addDepartment(insertDepartment);\n\n }", "public void test_CreateContest_Failure2_EntityAlreadyExistsException()\r\n throws Exception {\r\n try {\r\n initContext();\r\n\r\n Contest contest = createContestForTest();\r\n\r\n beanUnderTest.createContest(contest);\r\n\r\n // Persist it again.\r\n beanUnderTest.createContest(contest);\r\n\r\n fail(\"EntityAlreadyExistsException is expected.\");\r\n } catch (EntityAlreadyExistsException e) {\r\n // success\r\n }\r\n }", "@Override\n\t\t\t\tpublic void doFail() {\n\t\t\t\t}", "@Test(timeout = 4000)\n public void test049() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.addRequiredCondition(\"\", (StringBuilder) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "private void ensureEntityValue(IEntity entity) {\n entity.setPrimaryKey(entity.getPrimaryKey());\n }", "@Test\n public void test124() throws Throwable {\n Form form0 = new Form(\",\");\n DynamicSelectModel dynamicSelectModel0 = new DynamicSelectModel();\n ElExpression elExpression0 = new ElExpression(\",\");\n // Undeclared exception!\n try {\n FormElement formElement0 = form0.checkboxGroup(\",\", (ISelectModel) dynamicSelectModel0, elExpression0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Override\n public boolean shouldRollForwardExistingJob(Key entityGroup) {\n return shouldApply();\n }", "public void commitEntity();", "@Before\n\tpublic void before() throws InterruptedException, BBoxDBException {\n\t\tfinal BBoxDB bboxdbConnection = connectToServer();\n\t\tEnvironmentHelper.recreateDistributionGroup(bboxdbConnection, DISTRIBUTION_GROUP);\n\t\t\n\t\tfinal String indexGroupName = IndexedTupleUpdateHelper.IDX_DGROUP_PREFIX + DISTRIBUTION_GROUP;\n\t\tfinal EmptyResultFuture resultDelete = bboxdbConnection.deleteDistributionGroup(indexGroupName);\n\t\tresultDelete.waitForCompletion();\n\t\tAssert.assertFalse(resultDelete.isFailed());\n\t\t\n\t\tbboxdbConnection.createTable(TABLENAME, TupleStoreConfigurationBuilder.create().build());\n\t\t\n\t\tdisconnect(bboxdbConnection);\n\t}", "@Test(timeout = 4000)\n public void test070() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.mutatesDataOrStructure((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Override\n public void validate(StudentiEntity entity){\n List<String> errorMessages = new ArrayList<>();\n if(entity.getID() < 0) errorMessages.add(\"Invalid ID\");\n if(entity.getNume().equals(\"\")) errorMessages.add(\"Invalid name\");\n if(entity.getEmail().equals(\"\")) errorMessages.add(\"Invalid email\");\n if(entity.getGrupa() < 0) errorMessages.add(\"Invalid grupa\");\n\n if(errorMessages.size() > 0) throw new ValidationException(errorMessages);\n }", "@Test(timeout = 4000)\n public void test133() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef(\"|htZ2!p@2G\");\n // Undeclared exception!\n try { \n xmlEntityRef0.h3();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "private final void validateBeforeTransactionSave() throws NSValidation.ValidationException {\n \n }", "@Test(timeout = 4000)\n public void test038() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.executeUpdate(\"--DAN-438-tmp\", (Connection) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test(expected = DataAcessException.class)\n\t public void testSaveExcep() throws DataAcessException{\n\t \tUsers user = BaseData.getUsers();\n\t\tdoThrow(RuntimeException.class).when(entityManager).persist(user);\n\t\tuserDao.save(user);\n\t }", "@Test(expected = DataAcessException.class)\n\t public void testDeleteEntityExcep() throws DataAcessException {\n\t\t\tUsers user = BaseData.getUsers();\n\t\t\tdoThrow(RuntimeException.class).when(entityManager).remove(entityManager.getReference(Users.class,\n\t \t \t\tuser.getLoginName()));\n\t\t\tuserDao.delete(user.getLoginName(),user);\n\t}", "@Test\n public void testStateMatchingExceptionThrown() throws Exception {\n service.loadFiles();\n \n Order newOrder = new Order();\n newOrder.setCustomerName(\"Jake\");\n newOrder.setState(\"MN\");\n newOrder.setProductType(\"Wood\");\n newOrder.setArea(new BigDecimal(\"233\"));\n\n boolean correctExceptionThrown = false;\n try {\n service.calculateNewOrderDataInput(newOrder);\n } catch (FlooringValidationException e) {\n correctExceptionThrown = true;\n }\n\n Assert.assertTrue(\"Must Match State\", correctExceptionThrown);\n\n }", "@Test(timeout = 4000)\n public void test124() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String[] stringArray0 = new String[5];\n DBForeignKeyConstraint dBForeignKeyConstraint0 = new DBForeignKeyConstraint(\"creaGe unique index\", false, defaultDBTable0, stringArray0, defaultDBTable0, stringArray0);\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n // Undeclared exception!\n try { \n SQLUtil.renderAddForeignKey(dBForeignKeyConstraint0, nameSpec0, (PrintWriter) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "TransactionContext setException(Exception exception);", "public void testRemoveAddress_PersistenceException() throws Exception {\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").removeAddress(1, false);\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "public ChunkIdDBSource(DataSource ds, int groupID) throws BlockingException {\n\t\tthis.ds = ds;\n\t\tthis.groupID = groupID;\n\n\t\ttry {\n\t\t\tconn = ds.getConnection();\n\t\t\t// check to see if there is any data on the table for this group.\n\t\t\tPreparedStatement stmt = conn.prepareStatement(CHECK_SQL);\n\t\t\tstmt.setInt(1, groupID);\n\t\t\tResultSet rs = stmt.executeQuery();\n\t\t\tif (rs.next() && rs.getInt(1) > 0)\n\t\t\t\texists = true;\n\n\t\t\trs.close();\n\t\t\tstmt.close();\n\t\t\tconn.close();\n\t\t} catch (SQLException ex) {\n\t\t\tthrow new BlockingException(ex.toString());\n\t\t}\n\t}", "@Test\n public void testProductMatchingExceptionThrown() throws Exception {\n service.loadFiles(); \n\n Order newOrder = new Order();\n newOrder.setCustomerName(\"Jake\");\n newOrder.setState(\"OH\");\n newOrder.setProductType(\"Reptile\");\n newOrder.setArea(new BigDecimal(\"233\"));\n\n boolean correctExceptionThrown = false;\n try {\n service.calculateNewOrderDataInput(newOrder);\n } catch (FlooringValidationException e) {\n correctExceptionThrown = true;\n }\n\n Assert.assertTrue(\"Must Match Products\", correctExceptionThrown);\n\n }", "@Override\n public void testOneRequiredGroup() {\n }", "@Override\n public void testOneRequiredGroup() {\n }", "@Override\n\tpublic void test00500Add_Validate_ExistingRecord() throws Exception\n\t{\n\t}", "public void beginTransaction() throws Exception;", "@Before\r\n\tpublic void setUp() throws Exception {\r\n\t\tdbme = new DBManagerException(dbme.getMessage());\r\n\t}", "int insert(SbGroupDetail record);", "protected abstract boolean commitTxn(Txn txn) throws PersistException;", "public void test_updateContest_Failure4() throws Exception {\r\n try {\r\n initContext();\r\n\r\n Contest contest = createContestForTest();\r\n beanUnderTest.createContest(contest);\r\n\r\n entityManager.enablePersistenceException(true);\r\n\r\n contest.setName(\"sss\");\r\n beanUnderTest.updateContest(contest, 1, \"2\", true);\r\n\r\n fail(\"ContestManagementException is expected.\");\r\n } catch (ContestManagementException e) {\r\n // success\r\n }\r\n }", "@Test\n public void test004() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef((String) null);\n // Undeclared exception!\n try {\n Component component0 = xmlEntityRef0.tr();\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Tr component can be added only to a TableBlock.\n //\n }\n }", "public void testupdateAddress_EntityNotFoundException() throws Exception {\r\n try {\r\n Address address = this.getAddress();\r\n address.setCreationDate(new Date());\r\n address.setId(1);\r\n this.dao.updateAddress(address, false);\r\n fail(\"EntityNotFoundException expected\");\r\n } catch (EntityNotFoundException e) {\r\n //good\r\n }\r\n }", "@Test(timeout = 4000)\n public void test033() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.mutatesStructure((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test037() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.mutatesDataOrStructure((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public DataAccessLayerException() {\n }", "@Test(timeout = 4000)\n public void test104() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef(\"B$\");\n // Undeclared exception!\n try { \n xmlEntityRef0.legend((Object) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "public void setGroup(entity.Group value);", "@Test(timeout = 4000)\n public void test068() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.ownerDotComponent((DBObject) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public void test_UpdateContestStatus_Failure3() throws Exception {\r\n try {\r\n initContext();\r\n\r\n ContestStatus status = new ContestStatus();\r\n status.setDescription(\"description\");\r\n status.setName(\"Name\");\r\n status.setContestStatusId(10L);\r\n status.setStatusId(1L);\r\n beanUnderTest.addContestStatus(status);\r\n\r\n entityManager.enableTransactionException(true);\r\n\r\n status.setName(\"sss\");\r\n beanUnderTest.updateContestStatus(status);\r\n\r\n fail(\"ContestManagementException is expected.\");\r\n } catch (ContestManagementException e) {\r\n // success\r\n }\r\n }", "@Test(expected = TermsOfUsePersistenceException.class)\r\n public void test_createProjectRoleTermsOfUse_PersistenceError() throws Exception {\r\n instance = new ProjectTermsOfUseDaoImpl(TestsHelper.getConfig(TestsHelper.CONFIG_INVALID));\r\n\r\n instance.createProjectRoleTermsOfUse(projectId, resourceRoleId, termsOfUseId, sortOrder, groupIndex);\r\n }", "public void testSearchAddresses_PersistenceException() throws Exception {\r\n try {\r\n this.dao.searchAddresses(new EqualToFilter(\"address_id\", new Long(1)));\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "public void testdeassociate_PersistenceException() throws Exception {\r\n Address address = this.getAddress();\r\n address.setId(1);\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").deassociate(address, 1, false);\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "@Override\n\tpublic synchronized void removeGroup(Group group) throws DataBackendException, UnknownEntityException\n {\n try\n {\n ((TorqueAbstractSecurityEntity)group).delete();\n }\n catch (TorqueException e)\n {\n throw new DataBackendException(\"Removing Group '\" + group.getName() + \"' failed\", e);\n }\n }", "@Test\n void getAllClientIdWithAccess_throwingGroupCheck_stillWorks() {\n when(groupsConnection.isMemberOfGroup(any(), any())).thenThrow(new RuntimeException(\"blah\"));\n AuthenticatedRegistrarAccessor registrarAccessor =\n new AuthenticatedRegistrarAccessor(\n USER, ADMIN_CLIENT_ID, SUPPORT_GROUP, lazyGroupsConnection);\n\n verify(groupsConnection).isMemberOfGroup(\"[email protected]\", SUPPORT_GROUP.get());\n assertThat(registrarAccessor.getAllClientIdWithRoles())\n .containsExactly(CLIENT_ID_WITH_CONTACT, OWNER);\n verify(lazyGroupsConnection).get();\n }", "@Test(timeout = 4000)\n public void test373() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef(\"&!a0Q!<8UDk+%_*<Z'\");\n // Undeclared exception!\n try { \n xmlEntityRef0.h2((Object) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Test(expected = EntityNotFoundException.class)\n\tpublic void testDeleteEntityNotFoundException() {\n\t\t\n\t\tLong id = 4L;\n\t\tString cpr = \"271190-0000\";\n\t\tint kr = 100;\n\t\tString dato = \"01-01-2001\";\n\t\tString type = \"type2\";\n\n\t\tYdelse y = new Ydelse(id, cpr, kr, dato, type);\n\t\t\n\t\tdoReturn(null).when(entityManager).getReference(y.getClass(), y.getId());\n\t\t\n\t\tydelseService.delete(y.getClass(), id);\n\t}", "public void test_AddDocumentToContest_Failure4() throws Exception {\r\n try {\r\n initContext();\r\n\r\n entityManager.enableTransactionException(true);\r\n beanUnderTest.addDocumentToContest(1, 1);\r\n\r\n fail(\"ContestManagementException is expected.\");\r\n } catch (ContestManagementException e) {\r\n // success\r\n }\r\n }", "public void testRemoveAddresses_PersistenceException() throws Exception {\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").removeAddresses(new long[]{1}, false);\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }" ]
[ "0.59761435", "0.59398794", "0.57846844", "0.56157917", "0.5591375", "0.5562604", "0.5538773", "0.5522099", "0.5483439", "0.54484737", "0.5441527", "0.54407156", "0.54394764", "0.54313236", "0.5411377", "0.53724074", "0.5365516", "0.53332984", "0.5332204", "0.5323311", "0.52941567", "0.5280725", "0.52802736", "0.5278363", "0.52757096", "0.5269485", "0.52580494", "0.5250335", "0.5248667", "0.52349746", "0.5232375", "0.5231851", "0.52315754", "0.52315754", "0.522882", "0.52287847", "0.52278435", "0.5221825", "0.52193207", "0.52175003", "0.52173823", "0.521673", "0.5216327", "0.52151203", "0.52085155", "0.5179159", "0.51641786", "0.51576144", "0.51526153", "0.5149473", "0.5145948", "0.5145361", "0.51430434", "0.51422805", "0.5142058", "0.5141466", "0.5140439", "0.5138517", "0.5136833", "0.51357114", "0.51249236", "0.51244247", "0.51201504", "0.511977", "0.5111761", "0.51113075", "0.51062906", "0.5101592", "0.50973475", "0.50971866", "0.5090999", "0.5087083", "0.5085293", "0.5083513", "0.5080365", "0.5080365", "0.5077587", "0.5071218", "0.5069551", "0.5069487", "0.50675845", "0.5066856", "0.5059772", "0.5058168", "0.50577843", "0.50561965", "0.50531363", "0.5052641", "0.5046891", "0.5046584", "0.50425005", "0.5042276", "0.5036923", "0.50353277", "0.5034763", "0.5031891", "0.502944", "0.50273395", "0.50244504", "0.5023748" ]
0.5543093
6
Implementation of the svg::SVGTextElement W3C IDL interface Implementation of the svg::SVGLocatable W3C IDL interface The element which established the current viewport. Often, the nearest ancestor svg element. Null if the current element is the outermost svg element.
public final OMSVGElement getNearestViewportElement() { return (OMSVGElement)convert(((SVGTextElement)ot).getNearestViewportElement()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Nullable\n protected String location() {\n String location = null;\n\n if (parent != null) {\n ItemPresentation itemPresentation = parent.getPresentation();\n\n if (itemPresentation instanceof Parent) {\n Parent parentPresentation = (Parent) itemPresentation;\n location = parentPresentation.getLocatedPresentableText();\n }\n }\n\n return location;\n }", "public final OMSVGElement getFarthestViewportElement() {\n return (OMSVGElement)convert(((SVGTextElement)ot).getFarthestViewportElement());\n }", "public abstract Node getBoundingNode();", "@DISPID(-2147417100)\n @PropGet\n ms.html.IHTMLElement offsetParent();", "public SVGElement getUsedFromElement()\n {\n int elementHandle = _getUsedFromElement(\n getNativeSVGProxyHandle(),\n getHandle());\n if (M2GObject.checkHandle(elementHandle))\n {\n return M2GSVGElement.buildElement(elementHandle, iDocument);\n }\n return null;\n }", "@DISPID(-2147417080)\n @PropGet\n ms.html.IHTMLElement parentTextEdit();", "public Position getTextPosition()\n {\n int hpos = getComponent().getHorizontalTextPosition();\n int vpos = getComponent().getVerticalTextPosition();\n return Position.get(hpos, vpos);\n }", "public String getText(final String elementLocator);", "@DISPID(1033)\n @PropGet\n ms.html.ISVGSVGElement ownerSVGElement();", "public String getLocatorCurrent() {\n\t\treturn null;\r\n\t}", "public String getParentElement() {\n return ROOT_NO_ELEMENT_DEFAULT;\n }", "public Rectangle2D.Double getTextBounds() {\n\t\t\n\t\tdouble txtPinX = _parent.getTxtPinX();\n\t\tdouble txtPinY = _parent.getTxtPinY();\n\t\t\n\t\tdouble txtLocPinX = _parent.getTxtLocPinX();\n\t\tdouble txtLocPinY = _parent.getTxtLocPinY();\n\t\t\n\t\tdouble txtWidth = _parent.getTxtWidth();\n\t\tdouble txtHeight = _parent.getTxtHeight();\n\t\t\n\t\tdouble x = txtPinX - txtLocPinX;\n\t\tdouble y = txtPinY - txtLocPinY;\n\t\t\n\t\treturn new Rectangle2D.Double(x, y, txtWidth, txtHeight);\n\t}", "public int indexOf() { return _parent!=null? _parent.indexOfChild(this) : -1; }", "public Point2D.Double getTextCenter() {\n\t\treturn new Point2D.Double(_parent.getTxtLocPinX(), _parent.getTxtLocPinY());\n\t}", "@Override\r\n public Element findElement()\r\n {\n return null;\r\n }", "public javax.accessibility.AccessibleText getAccessibleText() {\n \n if (disposed)\n return null;\n \n try {\n XAccessibleText unoAccessibleText = (XAccessibleText)\n UnoRuntime.queryInterface(XAccessibleText.class, unoAccessibleContext);\n return (unoAccessibleText != null) ? \n new AccessibleTextImpl(unoAccessibleText) : null;\n } catch (com.sun.star.uno.RuntimeException e) {\n return null;\n }\n }", "protected double addTextElement(Element parent, double x, double y, String text,\n float fontSize, String anchor, String weight, String fill) {\n Element newText = svgDocument.createElementNS(svgNS, SVGConstants.SVG_TEXT_TAG);\n newText.setTextContent(text);\n newText.setAttributeNS(null, SVGConstants.SVG_X_ATTRIBUTE, String.valueOf(x));\n newText.setAttributeNS(null, SVGConstants.SVG_Y_ATTRIBUTE, String.valueOf(y));\n newText.setAttributeNS(null, SVGConstants.SVG_FONT_FAMILY_ATTRIBUTE, \"Eurostile\");\n newText.setAttributeNS(null, SVGConstants.SVG_FONT_SIZE_ATTRIBUTE, fontSize + \"px\");\n newText.setAttributeNS(null, SVGConstants.SVG_FONT_WEIGHT_ATTRIBUTE, weight);\n newText.setAttributeNS(null, SVGConstants.SVG_TEXT_ANCHOR_ATTRIBUTE, anchor);\n newText.setAttributeNS(null, SVGConstants.SVG_FILL_ATTRIBUTE, fill);\n parent.appendChild(newText);\n \n return getTextLength(text, fontSize);\n }", "private float drawTextUsingCurrentVertLoc ( \r\n\t String text,\r\n\t Graphics2D g2\r\n\t )\r\n\t{\n\t\tif ( ( text == null ) || text.equals ( \"\" ) )\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\tif ( horizontalLocationOfRelation <= 0 )\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\tTextLayout tl = new TextLayout( text, SYMBOL_FONT, FONT_RENDER_CTXT );\r\n\t\tRectangle2D.Float bound = ( Rectangle2D.Float ) tl.getBounds ( );\r\n\r\n\t\tfloat xAdjustment = bound.width / 2.0f;\r\n\r\n\t\t//int yAdjustment = ( int ) ( bound.height / 2.0f );\r\n\t\ttl.draw ( \r\n\t\t g2,\r\n\t\t horizontalLocationOfRelation + xAdjustment,\r\n\t\t currentVertLocationOfSymbol - WORM_LINE_THICKNESS - 1 - SYMBOL_LINE_LENGTH\r\n\t\t );\r\n\r\n\t\t//tl.draw(g2, 100.0f, 100.0f);\r\n\t\t//return bound.height;\r\n\t\ttl = new TextLayout( text, NUMBER_FONT, FONT_RENDER_CTXT );\r\n\t\tbound = ( Rectangle2D.Float ) tl.getBounds ( );\r\n\r\n\t\t//Util.info(\"bound = \" + bound);\r\n\t\treturn bound.width;\r\n\t}", "public Node getSVGNode() {\n\t\tif (browser != null) {\n\t\t\tNodeList nodes = browser.getWebEngine().getDocument().getElementsByTagName(\"svg\");\n\t\t\tif ( nodes.getLength() > 0 )\n\t\t\t\treturn nodes.item(0);\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t}", "@DISPID(-2147418104)\n @PropGet\n ms.html.IHTMLElement parentElement();", "public RMFont getFont() { return getParent()!=null? getParent().getFont() : null; }", "@Override\n\tpublic final Element getDocumentElement() {\n\t\treturn LocalDom.nodeFor(getDocumentElement0());\n\t}", "public org.apache.xmlbeans.XmlString xgetText()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TEXT$18, 0);\n return target;\n }\n }", "public interface IText extends ISinglePoint {\n\n /**\n * Defines whether the text rotation is relative to the screen or geographic\n * north\n * \n * @author sgilbert\n * \n */\n public static enum TextRotation {\n SCREEN_RELATIVE, NORTH_RELATIVE\n }\n\n /**\n * Defines the text justification options\n * \n * @author sgilbert\n * \n */\n public static enum TextJustification {\n LEFT_JUSTIFY, CENTER, RIGHT_JUSTIFY\n }\n\n /**\n * Defines available font styles\n * \n * @author sgilbert\n * \n */\n public static enum FontStyle {\n REGULAR, BOLD, ITALIC, BOLD_ITALIC\n }\n\n public static enum DisplayType {\n NORMAL, BOX, UNDERLINE, OVERLINE\n }\n\n /**\n * Gets the text to draw\n * \n * @return Array of text strings\n */\n public String[] getString();\n\n /**\n * Gets the name of the font to use\n * \n * @return font name\n */\n public String getFontName();\n\n /**\n * Gets the size of the font\n * \n * @return font size\n */\n public float getFontSize();\n\n /**\n * Gets the font style to use\n * \n * @return font style\n */\n public FontStyle getStyle();\n\n /**\n * Gets the lat/lon refernce position for the text display\n * \n * @return lat/lon coordinate\n */\n public Coordinate getPosition();\n\n /**\n * Gets the color to use for the text\n * \n * @return text color\n */\n public Color getTextColor();\n\n /**\n * Gets the specified justification\n * \n * @return the text justification\n */\n public TextJustification getJustification();\n\n /**\n * Gets the rotation angle to use\n * \n * @return rotation angle\n */\n public double getRotation();\n\n /**\n * Gets how the rotation angle is applied\n * \n * @return the rotation relativity\n */\n public TextRotation getRotationRelativity();\n\n /**\n * Determines whether the text should be displayed with an outline box\n * \n * @return true, if outline box should be displayed\n */\n public DisplayType getDisplayType();\n\n /**\n * Determines whether text background should be masked out.\n * \n * @return true, if background is to be masked\n */\n public Boolean maskText();\n\n /**\n * Gets the offset in the x direction for the text location. The offset is\n * specified in half-characters.\n * \n * @return The x direction offset\n */\n public int getXOffset();\n\n /**\n * Gets the offset in the y direction for the text location. The offset is\n * specified in half-characters.\n * \n * @return The y direction offset\n */\n public int getYOffset();\n\n public Boolean getHide();\n\n public Boolean getAuto();\n\n public int getIthw();\n\n public int getIwidth();\n\n}", "public org.apache.xmlbeans.XmlString xgetText()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TEXT$0, 0);\n return target;\n }\n }", "@DISPID(-2147417083)\n @PropGet\n java.lang.String outerText();", "ElementText createElementText();", "public String getText() {\n if (_lastTag == null)\n return null;\n return _lastTag.getChildText();\n }", "public String getTextInCurrentElement() throws ParseException {\n int lessThan = html.lastIndexOf(\"<\", position);\n if (lessThan == -1) {\n throw new ParseException(\"Cannot find text in current element\", position);\n }\n position = lessThan;\n String tag = findCurrentTag(html, position);\n return getTextInNextElement(tag);\n }", "CoreElement coreGetParentElement();", "public Point getLocationInParentWindow() {\n return this.mLocationInParentWindow;\n }", "public Locator getDocumentLocator() { return this.locator; }", "@objid (\"808c085c-1dec-11e2-8cad-001ec947c8cc\")\n @Override\n public IEditableText getEditableText() {\n for (GmNodeModel child : getChildren()) {\n if (child.getEditableText() != null) {\n return child.getEditableText();\n }\n }\n return super.getEditableText();\n }", "public abstract Positionable findPositionForWindow(int y, int x);", "public Locator getLocator() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String getInnerText() {\n\t\treturn null;\r\n\t}", "public String getXpath() { \n\t\treturn getXpathElement().getValue();\n\t}", "public AccessibleElement getParent();", "public StringDt getXpathElement() { \n\t\tif (myXpath == null) {\n\t\t\tmyXpath = new StringDt();\n\t\t}\n\t\treturn myXpath;\n\t}", "public void verifyTopLevelNavigatorItemIsDisplayed(String tagName, String text) {\n\t\tWebElement locator = findElement(By.xpath(\"//\" + tagName + \"[contains(text(),'\" + text + \"')]\"));\n moveToElement(locator);\t\n Assert.assertTrue(isElementPresent(locator));\n\t}", "@Override\n\tpublic String getInnerText() {\n\t\treturn null;\n\t}", "public Point getLabelPosition();", "public int getTextPosition() {\r\n return TextPosition;\r\n }", "public interface Text extends TextualElement {\r\n\r\n}", "Elem getPointedElem();", "public String getMatchingElementXPath()\n\t{\n\t\treturn this.matchingElementXPath;\n\t}", "Element getElement(Position pos);", "public edu.jhu.hlt.concrete.TextSpan getTextSpan() {\n return this.textSpan;\n }", "static String getElementText(Element e) {\n if (e.getChildNodes().getLength() == 1) {\n Text elementText = (Text) e.getFirstChild();\n return elementText.getNodeValue();\n }\n else\n return \"\";\n }", "protected double addTextElement(Element parent, double x, double y, String text,\n float fontSize, String anchor, String weight) {\n return addTextElement(parent, x, y, text, fontSize, anchor, weight, \"#000000\");\n }", "@Override\n public String getTextAlign() {\n return graphicsEnvironmentImpl.getTextAlign(canvas);\n }", "public String getRootElement() {\n int index = mRootElementCombo.getSelectionIndex();\n if (index >= 0) {\n return mRootElementCombo.getItem(index);\n }\n return null;\n }", "@Override\r\n\tpublic void findElement() {\n\t\t\r\n\t}", "public Element getElement() {\n if (view != null) {\n return view.getElement();\n }\n return editor.getDocument().getDefaultRootElement();\n }", "@PublicAtsApi\n public String getRootElementXPath() {\n\n return this.root.getUniquePath();\n }", "public String getText() {\n // element.getTextContent() breaks in jdk 1.4, so is implemented manually\n return getTextContent(element, new StringBuffer()).toString();\n }", "protected Text getWorkspaceRootText() {\r\n\t\treturn workspaceRootText;\r\n\t}", "public MobileElement scrollToExact(String arg0)\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}", "java.lang.String getParent();", "java.lang.String getParent();", "@Override\r\n public Collection<String> getTextElements(final File file, final String parentXPath, final String elementName) throws IOException, SAXException, ParserConfigurationException, TransformerException, XPathExpressionException {\r\n final Set<String> textElems = new HashSet<String>();\r\n final XPathXmlParser parser = new XPathXmlParser();\r\n\r\n final NodeList nodes = parser.getNodes(parser.parseXmlFile(file, false, false), parentXPath);\r\n if (nodes != null) {\r\n for (int i = 0; i < nodes.getLength(); i++) {\r\n // Get element\r\n final Element shipmentPortionElement = (Element)nodes.item(i);\r\n final NodeList childNodes = shipmentPortionElement.getChildNodes();\r\n if(childNodes != null) {\r\n for(int j = 0; j < childNodes.getLength(); j++) {\r\n if(childNodes.item(j).getNodeName().indexOf(elementName) >= 0) {\r\n String text = childNodes.item(j).getTextContent().trim();\r\n textElems.add(text);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return textElems;\r\n }", "public OMSVGSVGElement getDocumentRoot() {\n \t\treturn svg;\n \t}", "@Override\n\tpublic Vector3d getPosition() {\n\t\tVector3f pos = this.getChild(NON_LINES_NAME).getLocalTranslation();\n\t\treturn new Vector3d(pos.x, pos.y, pos.z);\n\t}", "public T caseAbstractTopLevelElement(AbstractTopLevelElement object) {\n\t\treturn null;\n\t}", "public org.landxml.schema.landXML11.IntersectionDocument.Intersection getIntersection()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.IntersectionDocument.Intersection target = null;\r\n target = (org.landxml.schema.landXML11.IntersectionDocument.Intersection)get_store().find_element_user(INTERSECTION$0, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target;\r\n }\r\n }", "public StaveGlyph getStave()\n {\n if(parent != null) return parent.getStave();\n else return null;\n }", "public final ShapeView getParentView()\n {\n ShapeParent ancestor = getShapeParent();\n \n while (ancestor != null)\n {\n if (ancestor instanceof ShapeView)\n {\n return (ShapeView) ancestor;\n }\n \n ancestor = ancestor.getShapeParent();\n }\n \n return null;\n }", "public String getXPath();", "public SymbolicElement<T> getAnchor();", "public String getText() {\n // declaring local variables\n String returnValue = \"VALUE\";\n\n if (isStubbed()) {\n log(\"=== This checkbox's locator is currently stubbed out. Returning value '\" + returnValue + \"' ===\");\n } else {\n // If a locator for this checkbox was given\n if(labelLocator != null) {\n returnValue = new Text(labelLocator).getText();\n } else {\n returnValue = getWebElement().getText();\n\n if (returnValue.isEmpty()) {\n // getting the web element with the default timeout and then get its parent which has the label associated\n // with the check box\n returnValue = getWebElement().findElement(By.xpath(\"../label\")).getText();\n }\n }\n }\n\n return returnValue;\n }", "@Override\r\n\t\tpublic String getTextContent() throws DOMException\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "RealLocalizable getPosition();", "public void assertText(final String elementLocator, final String text);", "public Cell containingCell() {\n return new Cell(x / NBROFSUBCELLINCELL, y / NBROFSUBCELLINCELL);\n }", "public Vector2 getAbsolutePosition() {\n Vector2 screenPos = new Vector2(this.position.x, this.position.y);\n for(UIElement element = this.parent; element != null; element = element.parent) {\n screenPos.add(element.position);\n }\n return screenPos;\n }", "int getPosition(Object elementID) throws Exception;", "public VRL getParentLocation()\n {\n \tif (this.getVRL()==null)\n \t\treturn null; \n \t\n \treturn this._nodeVRL.getParent();\n }", "public Cell containingCell() {\n return new Cell(x() / SUBCELL_COUNT, y() / SUBCELL_COUNT);\n }", "public interface HasLabelPositionable extends HasElement {\n\n /**\n * Attribute name that contains the selected label position value.\n */\n String LABEL_POSITION_ATTRIBUTE = \"data-label-position\";\n /**\n * Attribute name that contains details of the label for easy styling.\n */\n String LABEL_POSITION_DETAILS_ATTRIBUTE = \"data-label-position-details\";\n\n /**\n * Sets the label position to a new one.\n * @param position A position to use. Setting {@code null} will reset it to the default setting.\n */\n default void setLabelPosition(LabelPosition position) {\n if(position == null || position == LabelPosition.DEFAULT) {\n this.getElement().removeAttribute(LABEL_POSITION_ATTRIBUTE);\n this.getElement().removeAttribute(LABEL_POSITION_DETAILS_ATTRIBUTE);\n }\n else {\n this.getElement().setAttribute(LABEL_POSITION_ATTRIBUTE, position.name());\n this.getElement().setAttribute(LABEL_POSITION_DETAILS_ATTRIBUTE, position.getPositionData());\n }\n }\n\n /**\n * Returns current label position, if it has been set.\n * @return A {@link LabelPosition}.\n */\n default LabelPosition getLabelPosition() {\n if(this.getElement().hasAttribute(LABEL_POSITION_ATTRIBUTE))\n return LabelPosition.valueOf(this.getElement().getAttribute(LABEL_POSITION_ATTRIBUTE));\n else return LabelPosition.DEFAULT;\n }\n\n}", "public IVirtualBookRef currentVirtualBook() {\n\t\tif (currentElement >= 0 && currentElement < size()) {\n\t\t\treturn get(currentElement);\n\t\t}\n\t\treturn null;\n\t}", "@JsProperty\n Element getParentElement();", "public android.renderscript.Element getSubElement(int index) { throw new RuntimeException(\"Stub!\"); }", "public int hitTestPosition(float x, float y) {\n return mTextContainer.hitTestPosition(x, y);\n }", "public abstract Rect getRectForNodeHighlight();", "public Location getElement(){\n\t\t\treturn element;\n\t\t}", "DiagramElement getDiagramElement();", "@Override\r\n public Point getRelatedSceneLocation() {\r\n return getLocationPoint(locationRatio);\r\n }", "@Override\n public Object getSubElement(int index)\n {\n return null;\n }", "private String getHongbaoText(AccessibilityNodeInfo node) {\n String content;\n try {\n AccessibilityNodeInfo i = node.getParent().getChild(0);\n content = i.getText().toString();\n } catch (NullPointerException npe) {\n return null;\n }\n return content;\n }", "public static String getXPathValue(FuzzyXMLElement element,String xpath){\r\n\t\ttry {\r\n\t\t\tString value = (String)XPath.getValue(element,xpath);\r\n\t\t\treturn value.trim();\r\n\t\t} catch(Exception ex){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "@Override\n public final String getRaw(){\n return getDocument().getTextCache(this, () -> {\n /// Raw text is adding up raw text of each child.\n StringBuilder builder = new StringBuilder();\n\n for (Span span: this){\n builder.append(span.getRaw());\n }\n return builder.toString();\n });\n }", "public java.lang.String getIntersectingRoadwayRef()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(INTERSECTINGROADWAYREF$20);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "public int getEndOffset(int childViewIndex);", "public PsiElement findPsiElement() {\n final String filePath = myLocation == null ? null : FileUtil.toSystemIndependentName(myLocation.getFile());\n final VirtualFile vFile = filePath == null ? null : LocalFileSystem.getInstance().findFileByPath(filePath);\n final PsiFile psiFile = vFile == null ? null : PsiManager.getInstance(myProject).findFile(vFile);\n if (psiFile != null) {\n final int offset = DartAnalysisServerService.getInstance(myProject).getConvertedOffset(vFile, myLocation.getOffset());\n final PsiElement elementAtOffset = psiFile.findElementAt(offset);\n if (elementAtOffset != null) {\n final DartComponentName componentName = PsiTreeUtil.getParentOfType(elementAtOffset, DartComponentName.class);\n if (componentName != null) {\n return componentName;\n }\n if (elementAtOffset.getParent() instanceof DartId && elementAtOffset.getTextRange().getStartOffset() == offset) {\n return elementAtOffset; // example in WEB-25478 (https://github.com/flutter/flutter-intellij/issues/385#issuecomment-278826063)\n }\n }\n }\n return null;\n }", "public String toLocalPath() {\n\n String parentPath = parent.toLocalPath();\n return StringUtils.isBlank(parentPath)\n ? element.getElement()\n : new StringBuilder()\n .append(parentPath)\n .append('.')\n .append(element.getElement())\n .toString();\n }", "@Override\n\tpublic final Element getViewportElement() {\n\t\treturn isCSS1Compat() ? getDocumentElement() : getBody();\n\t}", "abstract protected UiElementNode getRootNode();", "public int locationOf(E elem) {\r\n\t\tInteger tentativeLoc = this.locations.get(elem);\r\n\t\tif (tentativeLoc == null){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn this.locations.get(elem);\r\n\t}", "org.apache.xmlbeans.XmlInt xgetAnchorOffset();", "public static AbstractSpan activeSpan() {\n return get().activeSpan();\n }" ]
[ "0.5601204", "0.5319242", "0.51924396", "0.51696086", "0.5144264", "0.51090336", "0.5032273", "0.49457353", "0.48995095", "0.48883379", "0.48695743", "0.48230976", "0.47947916", "0.47810772", "0.47603387", "0.47385773", "0.47033244", "0.46668258", "0.4661567", "0.46509266", "0.46293214", "0.46216604", "0.461242", "0.45958763", "0.45914122", "0.45846486", "0.45835814", "0.4581776", "0.45813677", "0.4547781", "0.4526659", "0.45167434", "0.45158613", "0.45119148", "0.4505719", "0.4504442", "0.44783136", "0.447697", "0.44751436", "0.4469662", "0.44603926", "0.4446612", "0.4445832", "0.44451696", "0.4443084", "0.44408566", "0.44359455", "0.4435744", "0.44180784", "0.44171634", "0.4409635", "0.43973422", "0.43957168", "0.4387056", "0.43821624", "0.4379151", "0.4366002", "0.43623912", "0.43537462", "0.43537462", "0.43387187", "0.4328411", "0.43270648", "0.43166476", "0.43142807", "0.4307091", "0.43057165", "0.43017444", "0.42974254", "0.4295249", "0.4290852", "0.42887205", "0.428572", "0.42840248", "0.42697522", "0.4265186", "0.42635486", "0.42633623", "0.42615938", "0.42578518", "0.42543972", "0.42525414", "0.42507038", "0.42496136", "0.4245205", "0.42407495", "0.42360514", "0.42341378", "0.4222038", "0.4221838", "0.4218649", "0.42162374", "0.4214163", "0.421211", "0.42102182", "0.420847", "0.42061472", "0.42053133", "0.4191845", "0.41902396" ]
0.59612095
0
The farthest ancestor svg element. Null if the current element is the outermost svg element.
public final OMSVGElement getFarthestViewportElement() { return (OMSVGElement)convert(((SVGTextElement)ot).getFarthestViewportElement()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private SchemaComponent findOutermostParentElement(){\n SchemaComponent element = null;\n //go up the tree and look for the last instance of <element>\n\tSchemaComponent sc = getParent();\n while(sc != null){\n if(sc instanceof Element){\n element = sc;\n }\n\t sc = sc.getParent();\n }\n return element;\n }", "public String getParentElement() {\n return ROOT_NO_ELEMENT_DEFAULT;\n }", "public FObj findNearestAncestorFObj() {\n FONode par = parent;\n while (par != null && !(par instanceof FObj)) {\n par = par.parent;\n }\n return (FObj) par;\n }", "public final ShapeView getParentView()\n {\n ShapeParent ancestor = getShapeParent();\n \n while (ancestor != null)\n {\n if (ancestor instanceof ShapeView)\n {\n return (ShapeView) ancestor;\n }\n \n ancestor = ancestor.getShapeParent();\n }\n \n return null;\n }", "@Override\r\n\t\tpublic Node getLastChild()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public Loop getRoot() {\n\t\tfor (Loop lp : parent.keySet()) {\n\t\t\tif (parent.get(lp)==null) return lp;\n\t\t}\n\t\treturn null;\n\t}", "private HtmlElement getRoot()\n\t{\n\t\treturn getBaseRootElement( ROOT_BY );\n\t}", "public XMLPath getParent() {\r\n return this.parent == null ? null : this.parent.get();\r\n }", "public Dog findOldest() {\r\n\t\tif (root == null)\r\n\t\t\treturn null;\r\n\t\t\r\n\t\treturn root.findOldest();\r\n\t}", "public Integer getRoot(){\n\t\tif(root != null) {\n\t\t\treturn root.element;\n\t\t}\n\t\treturn null;\n\t}", "public SVGElementModel getRoot() {\n \t\treturn store.getRootItems().get(0);\n \t}", "public Dog findYoungest() {\r\n\t\tif (root == null)\r\n\t\t\treturn null;\r\n\t\t\r\n\t\treturn root.findYoungest();\r\n\t}", "public RMShape getRootShape() { return _parent!=null? _parent.getRootShape() : this; }", "@JsProperty\n Element getParentElement();", "public double getLowestParentY() {\n\t\t/* Aucun parent => aucune contrainte en y vers le haut */\n\t\tif (parentEdges == null)\n\t\t\treturn Double.MIN_VALUE;\n\t\t\n\t\tdouble maxY = Double.MIN_VALUE;\n\t\tfor (int i = 0; i < parentEdges.size(); i++) {\n\t\t\t/*\n\t\t\t * Recherche de l'extrémité la plus haute de l'arête (la plus basse étant le noeud\n\t\t\t * courant)\n\t\t\t */\n\t\t\tEdge currentEdge = parentEdges.elementAt(i);\n\t\t\tdouble y1 = currentEdge.getSource().getShape().getY();\n\t\t\tdouble y2 = currentEdge.getDestination().getShape().getY();\n\t\t\tdouble y = (y1 < y2) ? y1 : y2;\n\t\t\t\n\t\t\t/* Recherche de l'extrémité la plus basse parmi toutes les extrémités hautes */\n\t\t\tif (y > maxY)\n\t\t\t\tmaxY = y;\n\t\t}\n\t\t\n\t\treturn maxY;\n\t}", "CoreElement coreGetParentElement();", "public RMShape getAncestor(int anIndex) { return anIndex==0? getParent() : getParent().getAncestor(anIndex-1); }", "public XMLElement getParent()\n/* */ {\n/* 323 */ return this.parent;\n/* */ }", "public String getRootElement() {\n int index = mRootElementCombo.getSelectionIndex();\n if (index >= 0) {\n return mRootElementCombo.getItem(index);\n }\n return null;\n }", "public Figure getFigure() {\n\t\treturn _parentFigure;\n\t}", "public @Nullable\n JFrame getOuterFrame() {\n if (null == outerFrame) {\n outerFrame = searchForOuterFrame();\n }\n return outerFrame;\n }", "private Rectangle getParentBounds() {\n final var bounds = mParentBounds;\n\n return bounds == null\n ? mParentBounds = calculateBounds( getParent() )\n : bounds;\n }", "public Object getRoot() {\n\t\treturn null;\n\t}", "public int returnGraphRoot() {\n\t\tfor(int i = 0; i < sc.getInitPos().size(); i++) {\r\n\t\t\tfor(int j = 0; j < sc.getInitPos().size(); j++) {\r\n\t\t\t\tif(graph[i][j]) {\r\n\t\t\t\t\t//means i -> j\r\n\t\t\t\t\t// therefore we need to see if i has a parent\r\n\t\t\t\t\tboolean hasPred = true;\r\n\t\t\t\t\tint pred = -1;\r\n\t\t\t\t\twhile(hasPred) {\r\n\t\t\t\t\t\tfor(int k = 0; k < sc.getInitPos().size(); k++) {\r\n\t\t\t\t\t\t\tif(graph[k][i]) {\r\n\t\t\t\t\t\t\t\t//k is a parent of i\r\n\t\t\t\t\t\t\t\tpred = k;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(pred == -1) {\r\n\t\t\t\t\t\t\t//i has no predecessor\r\n\t\t\t\t\t\t\thasPred = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\ti = pred;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//TODO: remove i from graph\r\n\t\t\t\t\treturn i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "protected Rectangle getSelectedElementFigureArea()\n {\n boolean anchored = false;\n\n // Use figures since they may be sized differently during dynamics\n // accumulate as unzoomed.\n Rectangle r = null;\n\n // Go through the list of selected widget figures, union the bounds.\n Iterator<FrameEltSelnFig<?>> iter = selection.getSelectedFigures();\n\n while (iter.hasNext()) {\n FrameEltSelnFig<?> fig = iter.next();\n\n if (fig instanceof GraphicalWidget<?>) {\n GraphicalWidget<?> gw = (GraphicalWidget<?>) fig;\n IWidget w = gw.getModel();\n SimpleWidgetGroup wg = w.getParentGroup();\n\n if (wg != null) {\n r = unionBounds(r, getGroupFigureBounds(wg));\n anchored = anchored || (w instanceof ChildWidget);\n }\n else {\n r = unionBounds(r, gw.getBounds());\n }\n }\n else if (fig instanceof FrameEltGroupHalo) {\n Rectangle haloBds = fig.getBounds(); // this is zoomed!\n double scale = frameUI.getZoom();\n\n double right = (haloBds.x + haloBds.width) / scale;\n double bottom = (haloBds.y + haloBds.height) / scale;\n double left = haloBds.x / scale;\n double top = haloBds.y / scale;\n\n haloBds =\n PrecisionUtilities.getDraw2DRectangle(left,\n top,\n right - left,\n bottom - top);\n\n r = unionBounds(r, haloBds);\n }\n }\n\n setTopLeftAnchored(anchored);\n\n return r;\n }", "public Object getParent()\n {\n return traversalStack.get(traversalStack.size() - 2);\n }", "Id getLastDefinedParent() {\n for (Commit c : Lists.reverse(commits)) {\n if (c.isSaved()) {\n return c.id;\n }\n }\n\n throw new IllegalStateException(\"Unable to determine last defined parent.\");\n }", "public Subset getLeftMostElement() {\n\t\tSubset res = this;\n\t\twhile(res.left != res) {\n\t\t\tres = res.left;\n\t\t}\n\t\treturn res;\n\t}", "public SVGElement getUsedFromElement()\n {\n int elementHandle = _getUsedFromElement(\n getNativeSVGProxyHandle(),\n getHandle());\n if (M2GObject.checkHandle(elementHandle))\n {\n return M2GSVGElement.buildElement(elementHandle, iDocument);\n }\n return null;\n }", "@Override\n public Object getRoot() {\n if (this.getParent() == null) {\n return this;\n }\n return this.getParent().getRoot();\n }", "public TreeNode getParent() {\n\t\treturn null;\n\t}", "protected final XmlAntTask getRoot() {\n\t\tXmlAntTask tmp1 = parent;\n\t\tXmlAntTask tmp2 = this;\n\t\twhile (tmp1 != null) {\n\t\t\ttmp2 = tmp1;\n\t\t\ttmp1 = tmp2.getParent();\n\t\t}\n\t\treturn tmp2;\n\t}", "public Object getParent(Object element) {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic Object getParent(Object element) {\n\t\treturn null;\r\n\t}", "public RTWElementRef lastAsElement();", "DefaultNamedTreeNode<T> getLastChild()\r\n {\r\n NamedTreeNode<T> last = null;\r\n for(NamedTreeNode<T> n:this) {\r\n last = n;\r\n }\r\n return (DefaultNamedTreeNode<T>)last;\r\n }", "public Object getParent(Object element) {\n\t\treturn null;\n\t}", "public int getAbsoluteX() {\r\n return getAbsoluteLeft() - getParent().getAbsoluteLeft();\r\n }", "@JsProperty\n Node getLastChild();", "public UIElement getCommonParent(UIElement first, UIElement second) {\n if (first == second) {\n return first;\n }\n Set<UIElement> trace = new HashSet<>();\n for (UIElement e = first; e != null; e = e.getParent()) {\n trace.add(e);\n }\n for (UIElement e = second; e != null; e = e.getParent()) {\n if (trace.contains(e)) {\n return e;\n }\n }\n return null;\n }", "public E getLast()// you finish (part of HW#4)\n\t{\n\t\t// If the tree is empty, return null\n\t\t// FIND THE RIGHT-MOST RIGHT CHILD\n\t\t// WHEN you can't go RIGHT anymore, return the node's data to last Item\n\t\tif (root == null)\n\t\t\treturn null;\n\t\tBinaryNode<E> iteratorNode = root;\n\t\twhile (iteratorNode.hasRightChild())\n\t\t\titeratorNode = iteratorNode.getRightChild();\n\t\treturn iteratorNode.getData();\n\t}", "public JDialog getAncestor() {\n return ancestor;\n }", "public Integer getParent(Integer e){\n\t\ttry{\n\t\t\treturn searchNodeRef(e).father.element;\n\t\t} catch (Exception exc) {\n\t\t\treturn null;\n\t\t}\n\t}", "public Integer largest() {\n if (root != null) {\n return root.largest();\n }\n return null;\n }", "public final int getAbsoluteX() {\n assert (parent != null);\n if (parent == this) {\n return x;\n }\n if ((parent instanceof TWindow)\n && !(parent instanceof TMenu)\n && !(parent instanceof TDesktop)\n ) {\n // Widgets on a TWindow have (0,0) as their top-left, but this is\n // actually the TWindow's (1,1).\n return parent.getAbsoluteX() + x + 1;\n }\n return parent.getAbsoluteX() + x;\n }", "public DialogueNode getRoot() {\n\t\treturn root;\n\t}", "public String getParent() {\n int index = filename.lastIndexOf(separatorChar);\n\n if (index > 0) {\n return filename.substring(0, index);\n } else {\n return null;\n }\n\n }", "public Node getLast() {\r\n\t\treturn getNode(this.size());\r\n\t}", "CoreParentNode coreGetParent();", "private static String recoverParent(BabelSynset bs) throws IOException {\n\t\tif(bs.getEdges(BabelPointer.ANY_HYPERNYM).size() == 0) {\n\t\t\tif(bs.getEdges(BabelPointer.DERIVATIONALLY_RELATED).size() > 0) {\n\t\t\t\tString tag = bs.getEdges(BabelPointer.DERIVATIONALLY_RELATED).get(0).getTarget();\n\t\t\t\tif(tag != null) \n\t\t\t\t\treturn tag;\n\t\t\t}\n\t\t}\n\t\treturn findHighParent_A(bs);\n\t}", "public final ShapeParent getShapeParent()\n {\n return parent;\n }", "@Override\r\n\t\tpublic Node getParentNode()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public Scope getOuterMostEnclosingScope() {\n\t\tScope s = this;\n\t\twhile (s.getEnclosingScope() != null) {\n\t\t\ts = s.getEnclosingScope();\n\t\t}\n\t\treturn s;\n\t}", "@Override\r\n\tpublic Tag getParent() {\n\t\treturn null;\r\n\t}", "public String getRoot() {\n\t\treturn null;\n\t}", "public Ent getParent(){\n\t\treturn (Ent)bound.getParent();\n\t}", "public String getRootElem() {\n\t\treturn mRootElem;\n\t}", "@Override\n public MElementContainer<MUIElement> getParent()\n {\n return null;\n }", "@Override\r\n public FileName getRoot() {\r\n FileName root = this;\r\n while (root.getParent() != null) {\r\n root = root.getParent();\r\n }\r\n\r\n return root;\r\n }", "public DefaultMutableTreeNode getRoot()\n {\n return root;\n }", "private TreeNode getOnlyChild() {\n return templateRoot.getChildren().get(0);\n }", "public Region getRoot() {\r\n return root;\r\n }", "public int ancestor(int v, int w) {\n Paths sapComponents = sap(v, w);\n return sapComponents == null ? NO_ANCESTOR : sapComponents.ancestor();\n }", "public Element getDocument() {\n\t\t\n\t\tElement retval = getRoot();\n\t\t\n\t\tList<Element> children;\n\t\t\n\t\tif ( retval.getName().equals(\"ROOT\") && (children = retval.getAllChildren()).size() > 0 )\n\t\t\tretval = children.get(0);\n\t\t\n\t\treturn retval;\n\n\t}", "private TypeBodyImpl getApparentType() {\n TypeBodyImpl enclosingType = getEnclosingTypeBody();\n while (enclosingType != null) {\n TypeBodyImpl superType = enclosingType;\n while (superType != null) {\n if (superType == method.getEnclosingTypeBody()) {\n // We've found the method on a superclass\n return enclosingType;\n }\n superType = superType.getSupertype() == null ? null : superType.getSupertype().getTypeBody();\n }\n // Not found on this type, so try the enclosing type\n enclosingType = enclosingType.getEnclosingTypeBody();\n }\n return null;\n }", "public TreeNode largest() {\n\t\tif(root == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tTreeNode current = root; \n\t\t\twhile(current.getRightChild() != null) {\n\t\t\t\tcurrent = current.getRightChild();\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t}", "public int topElement() {\n\t\tif(isEmpty()){\n\t\t\tthrow new AssertionError();\n\t\t}\n\t\telse {\n\t\t\treturn heap.get(0).element;\n\t\t\n\t\t}\n\t}", "public TopoDS_Shape Ancestor( TopoDS_Edge E) {\n TopoDS_Shape ret = new TopoDS_Shape(OCCwrapJavaJNI.BRepAlgo_NormalProjection_Ancestor(swigCPtr, this, TopoDS_Edge.getCPtr(E), E), true);\n return ret;\n }", "Location getTop() {\n // -\n if(!isEmpty())\n return top.getLocation();\n return null;\n }", "@Override\n\tpublic T getRootElements() {\n\t\treturn null;\n\t}", "public Jode first() {\n return children().first();\n }", "public AVLNode getRoot() {\n return root;\n }", "public VRL getParentLocation()\n {\n \tif (this.getVRL()==null)\n \t\treturn null; \n \t\n \treturn this._nodeVRL.getParent();\n }", "public ILocation top()\n {\n EmptyStackException ex = new EmptyStackException();\n if (top <= 0)\n {\n throw ex;\n }\n else\n {\n return stack.get(top - 1);\n }\n }", "public PhyloTreeNode getOverallRoot() {\n return overallRoot;\n }", "public Point getMaxPoint() {\r\n int maximumX = children.get(0).getShapeEndingPoint().getX();\r\n int maximumY = children.get(0).getShapeEndingPoint().getY();\r\n for(IShape shape: children) {\r\n if(shape.getShapeEndingPoint().getX() > maximumX) {\r\n maximumX = shape.getShapeEndingPoint().getX();\r\n }\r\n if(shape.getShapeEndingPoint().getY() > maximumY) {\r\n maximumY = shape.getShapeEndingPoint().getY();\r\n }\r\n }\r\n maxPoint = new Point(maximumX,maximumY);\r\n return maxPoint;\r\n }", "public TreeNode<T> getMaxElement(){\n TreeNode<T> t = this;\n while(t.right != null){\n t = t.right;\n }\n return t;\n }", "public AnyType findMin() {\n if (isEmpty())\n throw new UnderflowException();\n return root.element;\n }", "public String getRoot();", "@Pure\n public QuadTreeNode<D> getUpperLeftChild() {\n QuadTreeNode<D>[] _children = this.children;\n QuadTreeNode<D> _get = null;\n if (_children!=null) {\n _get=_children[1];\n }\n return _get;\n }", "public RMShape getAncestorInCommon(RMShape aShape)\n{\n // If shape is our descendant, return this shape\n if(isDescendant(aShape))\n return this;\n \n // Iterate up shape's ancestors until one has this shape as descendant\n for(RMShape shape=aShape; shape!=null; shape=shape.getParent())\n if(shape.isDescendant(this))\n return shape;\n \n // Return null since common ancestor not found\n return null;\n}", "public Object getRoot() {\n\t\treturn _adaptee;\n\t}", "public View getTopView() {\n\t\tint topViewIndex = getChildCount() - 1;\n\t\treturn getChildAt(topViewIndex);\n\t}", "public XMLDocument endElement() {\r\n return this.endElement(null);\r\n }", "public AnyType findMin() {\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new UnderflowException();\r\n\t\treturn findMin(root).element;\r\n\t}", "public TreeNode<T> getMinElement(){\n TreeNode<T> t = this;\n while(t.left != null){\n t = t.left;\n }\n return t;\n }", "public int getParent();", "public final OMSVGElement getNearestViewportElement() {\n return (OMSVGElement)convert(((SVGTextElement)ot).getNearestViewportElement());\n }", "public Node getRoot() {\r\n\r\n\t\treturn root;\r\n\t}", "public int minElement() {\n\t\tNode min=root;\n\t\tint out=-1;\n\t\twhile(min!=null) {\n\t\t\tout=min.data;\n\t\t\tmin=min.left;\n\t\t}\n\t\treturn out;\n\t}", "@DISPID(-2147418104)\n @PropGet\n ms.html.IHTMLElement parentElement();", "public Node getRoot() {\n return root;\n }", "public TreeNode smallest() {\n\t\tif(root == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tTreeNode current = root; \n\t\t\twhile(current.getLeftChild() != null) {\n\t\t\t\tcurrent = current.getLeftChild();\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t}", "public Node getSVGNode() {\n\t\tif (browser != null) {\n\t\t\tNodeList nodes = browser.getWebEngine().getDocument().getElementsByTagName(\"svg\");\n\t\t\tif ( nodes.getLength() > 0 )\n\t\t\t\treturn nodes.item(0);\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t}", "@Override\n public Node getParentNode() {\n return null;\n }", "public double getHighestChildY() {\n\t\t/* Aucun enfant => aucune contrainte en y vers le bas */\n\t\tif (childrenEdges == null)\n\t\t\treturn Double.MAX_VALUE;\n\t\t\n\t\tdouble minY = Double.MAX_VALUE;\n\t\tfor (int i = 0; i < childrenEdges.size(); i++) {\n\t\t\t/*\n\t\t\t * Recherche de l'extrémité la plus basse de l'arête (la plus haute étant le noeud\n\t\t\t * courant)\n\t\t\t */\n\t\t\tEdge currentEdge = childrenEdges.elementAt(i);\n\t\t\tdouble y1 = currentEdge.getSource().getShape().getY();\n\t\t\tdouble y2 = currentEdge.getDestination().getShape().getY();\n\t\t\tdouble y = (y1 > y2) ? y1 : y2;\n\t\t\t\n\t\t\t/* Recherche de l'extrémité la plus haute parmi toutes les extrémités basses */\n\t\t\tif (y < minY)\n\t\t\t\tminY = y;\n\t\t}\n\t\t\n\t\treturn minY;\n\t}", "public abstract Node getBoundingNode();", "public E getLast(){\n return tail.getPrevious().getElement();\n }", "public Reference getRootRef() {\n return this.rootRef;\n }", "public AVLNode findMin() {\n\t\tif (this.empty()) {\n\t\t\treturn null;\n\t\t}\n\t\tAVLNode min = (AVLNode) this.root;\n\t\twhile (min.getLeft().getHeight() != -1) {\n\t\t\tmin = (AVLNode) min.getLeft();\n\t\t}\n\t\treturn min;\n\t}" ]
[ "0.6970886", "0.66346854", "0.63631237", "0.6230701", "0.6139486", "0.6099411", "0.6061338", "0.6032201", "0.6016518", "0.60084605", "0.5966504", "0.5950595", "0.58796877", "0.5858923", "0.5855055", "0.5832898", "0.5795298", "0.5772505", "0.5756241", "0.57374746", "0.5735318", "0.57181394", "0.5704676", "0.56987727", "0.56849015", "0.5668956", "0.56661165", "0.5652636", "0.56516933", "0.5609468", "0.5607001", "0.5604323", "0.5597086", "0.5592849", "0.5591258", "0.5585321", "0.5580825", "0.5570549", "0.55470943", "0.55379003", "0.5501386", "0.54915494", "0.5475626", "0.5452859", "0.5447289", "0.5441137", "0.543188", "0.5431861", "0.5427059", "0.54240906", "0.54239905", "0.5415326", "0.54116315", "0.5405472", "0.5404094", "0.54039794", "0.5403122", "0.5403048", "0.5401634", "0.53977865", "0.5395131", "0.53939766", "0.53912985", "0.53881955", "0.53840333", "0.5368031", "0.53666484", "0.5365704", "0.5361828", "0.53583395", "0.53560483", "0.5352483", "0.5351163", "0.53389406", "0.53362393", "0.5332502", "0.53283226", "0.53181165", "0.53110933", "0.53046757", "0.5301858", "0.5296135", "0.5285297", "0.52842176", "0.5280514", "0.5278555", "0.5272302", "0.5263483", "0.5260219", "0.52524245", "0.5248568", "0.5245781", "0.5242691", "0.52419776", "0.5239321", "0.52388155", "0.5238165", "0.52343607", "0.52338934", "0.5233797" ]
0.5774893
17
Construct a new SwitchPreference with default style options.
public GallerySwitchPreference(Context context) { this(context, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public SwitchPreference(final Context context, final AttributeSet attrs, final int defStyle) {\n super(context, attrs, defStyle);\n }", "public CustomSwitchPreference(Context context, AttributeSet attrs) {\n super(context, attrs);\n }", "public SwitchPreference(final Context context, final AttributeSet attrs) {\n super(context, attrs);\n }", "public SwitchPreference(final Context context) {\n super(context, null);\n }", "void setDefaultPreference(String preferenceName, String value) throws OntimizeJEERuntimeException;", "public MyPreference(Context context, AttributeSet attrs) {\r\n super(context, attrs);\r\n this.context = context;\r\n// setWidgetLayoutResource(R.layout.preference_widget_mypreference);\r\n }", "public Builder(String optionSwitch, SwitchType switchType) {\n this.shortSwitches = new HashSet<String>();\n longSwitches = new HashSet<String>();\n switch (switchType) {\n case SHORT_SWITCH:\n shortSwitches.add(optionSwitch);\n break;\n case LONG_SWITCH:\n longSwitches.add(optionSwitch);\n break;\n default:\n throw new IllegalArgumentException(\"Unknown switchType: \" + switchType);\n }\n }", "public GallerySwitchPreference(Context context, AttributeSet attrs) {\n super(context, attrs);\n\n mResources = context.getResources();\n }", "public Builder(Set<String> optionSwitches, SwitchType switchType) {\n this.shortSwitches = new HashSet<String>();\n longSwitches = new HashSet<String>();\n switch (switchType) {\n case SHORT_SWITCH:\n shortSwitches.addAll(optionSwitches);\n break;\n case LONG_SWITCH:\n longSwitches.addAll(optionSwitches);\n break;\n default:\n throw new IllegalArgumentException(\"Unknown switchType: \" + switchType);\n }\n }", "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 PreferenceBean createPreferenceBean()\n {\n return new PreferenceBean();\n }", "PreferenceDefaultValueAttribute getDefaultValue();", "String getDefaultPreference(String preferenceName) throws OntimizeJEERuntimeException;", "public SimpleStyle() {\n\t\t// set default values\n\t\tthis.foregroundColor = -1;\n\t\t// others are null: VM DONE\n\t}", "public SwitchYardSettingsPropertyPage() {\n super();\n noDefaultAndApplyButton();\n }", "public LED()\n {\n this(defaultPin);\n }", "public static Style getDefault() { return Style.SHAPE; }", "Object getPreference(String prefKey, Object defaultValue);", "STYLE createSTYLE();", "private Style createDefaultStyle() {\n Rule rule = createRule(LINE_COLOUR, FILL_COLOUR); //utilizamos las definiciones anteriores\n\n FeatureTypeStyle fts = sf.createFeatureTypeStyle();\n fts.rules().add(rule);\n\n Style style = sf.createStyle();\n style.featureTypeStyles().add(fts);\n return style;\n}", "public BuiltInStyle(int xfind, int sn)\r\n/* 10: */ {\r\n/* 11:46 */ super(Type.STYLE);\r\n/* 12: */ \r\n/* 13:48 */ this.xfIndex = xfind;\r\n/* 14:49 */ this.styleNumber = sn;\r\n/* 15: */ }", "private void createSwitches() {\n \t\tswitches = new Point[4];\n \t\tswitches[0] = new Point(centreMin, centreMin);\n \t\tswitches[1] = new Point(centreMin, centreMax-1);\n \t\tswitches[2] = new Point(centreMax-1, centreMin);\n \t\tswitches[3] = new Point(centreMax-1, centreMax-1);\n \t}", "public Builder(String shortSwitch) {\n this.shortSwitches = new HashSet<String>();\n this.shortSwitches.add(shortSwitch);\n longSwitches = new HashSet<String>();\n }", "SoftSwitches(SoftSwitch softswitch) {\n this.softswitch = softswitch;\n }", "public abstract TC createStyle();", "public void setDefaultStyleString(String defaultStyleString) {\n/* 564 */ getCOSObject().setString(COSName.DS, defaultStyleString);\n/* */ }", "protected ViewLayoutState createDefaultChild(View v) {\n return new SimpleViewLayoutState(v); // only handle preferred spans\n }", "private WidgetConfiguration setStyling(Item item, WidgetConfiguration defaultConfig) {\n\t\tWidgetConfiguration newConfig = new WidgetConfiguration(\n\t\t\t\tdefaultConfig.getFont(), defaultConfig.getColor(), new Dimension(defaultConfig.getWidth(), defaultConfig.getHeight()));\n\n\t\t//go through all properties, visit and set found formatting\n\t\tfor (StyleProperty prop : item.getProperties()) {\n\t\t\tprop.accept(new StyleVisitor<Void, Void>() {\n\t\t\t\t@Override\n\t\t\t\tpublic Void visit(Height h, Void ctx2) {\n\t\t\t\t\tnewConfig.setHeight(h.getHeightVal());\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic Void visit(Width w, Void ctx2) {\n\t\t\t\t\tnewConfig.setWidth(w.getWidthVal());\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic Void visit(FontName fn, Void ctx2) {\n\t\t\t\t\tnewConfig.setFontName(fn.getName());\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic Void visit(FontSize fs, Void ctx2) {\n\t\t\t\t\tnewConfig.setFontSize(fs.getSize());\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic Void visit(FontColor fc, Void ctx2) {\n\t\t\t\t\tnewConfig.setFontColor(fc.getColor());\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t},\n\t\t\tnull);\n\t\t}\n\t\t//return new configuration to style the question\n\t\treturn newConfig;\n\t}", "private void setStyleToDefault() {\n // enable syntax highlighting\n commandTextField.enableSyntaxHighlighting();\n }", "private DefaultSetting getSampleDefaultSetting() {\n DefaultSetting setting = new DefaultSetting(\"\",\n \"\",\n 5,\n Token.DIGIT,\n \"d\",\n 1,\n true,\n true,\n true);\n\n return setting;\n }", "@VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)\n public void bindPreferenceExtra(RadioButtonPreference pref,\n String key, CandidateInfo info, String defaultKey, String systemDefaultKey) {\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\t//requestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\taddPreferencesFromResource(R.xml.setting_preference);\n\t}", "public static void initDefaults(IPreferenceStore store) {\n \t\t\n \t\tif (fgInitialized)\n \t\t\treturn;\n \t\t\t\n \t\tfgInitialized= true;\n \t\t\n \t\tFont font= JFaceResources.getTextFont();\n \t\tif (font != null) {\n \t\t\tFontData[] data= font.getFontData();\n \t\t\tif (data != null && data.length > 0)\n \t\t\t\tPreferenceConverter.setDefault(store, JFaceResources.TEXT_FONT, data[0]);\n \t\t}\n \t\t\n \t\tDisplay display= Display.getDefault();\n \t\tColor color= display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);\n \t\tPreferenceConverter.setDefault(store, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, color.getRGB());\n \t\tstore.setDefault(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT, true);\n \t\t\n \t\tcolor= display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);\n \t\tPreferenceConverter.setDefault(store, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, color.getRGB());\n \t\tstore.setDefault(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, true);\n \t}", "private PaletteSwitch() {\n \n propertySupport = new PropertyChangeSupport( this );\n }", "private static DiscussionParam createSimple() {\n\t\treturn new DiscussionParam.DiscussionParamBuilder()\n\t\t.addDiscussionOption(DiscussionOptionEnum.DEFAULT)\n\t\t.setLocale(Locale.getDefault()).build();\n\t}", "@SuppressWarnings(\"deprecation\")\n\tprivate void setupSimplePreferencesScreen() {\n\t\tif (!isSimplePreferences(this)) {\n\t\t\treturn;\n\t\t}\n\n\t\taddPreferencesFromResource(R.xml.pref_blank);\n\n\t\t// Add 'filters' preferences.\n\t\tPreferenceCategory fakeHeader = new PreferenceCategory(this);\n\n\t\t// Add 'appearance' preferences.\n\t\tfakeHeader = new PreferenceCategory(this);\n\t\tfakeHeader.setTitle(R.string.appearance);\n\t\tgetPreferenceScreen().addPreference(fakeHeader);\n\t\taddPreferencesFromResource(R.xml.pref_appearance);\n\n\t\t// Add 'text color' preferences.\n\t\tfakeHeader = new PreferenceCategory(this);\n\t\tfakeHeader.setTitle(R.string.text_color);\n\t\tgetPreferenceScreen().addPreference(fakeHeader);\n\t\taddPreferencesFromResource(R.xml.pref_textcolor);\n\n\t\t// Add 'info' preferences.\n\t\tfakeHeader = new PreferenceCategory(this);\n\t\tfakeHeader.setTitle(R.string.information);\n\t\tgetPreferenceScreen().addPreference(fakeHeader);\n\t\taddPreferencesFromResource(R.xml.pref_info);\n\n\t\t// Add others\n\t\tsetupOpenSourceInfoPreference(this, findPreference(getString(R.string.pref_info_open_source)));\n\t\tsetupVersionPref(this, findPreference(getString(R.string.pref_version)));\n\n\t}", "public S create() {\n\t\tS style = createDefault();\n\t\tint id = nextID();\n\t\tstyle.setId(id);\n\t\taddStyle(style);\n\t\treturn style;\n\t}", "public JpSetting() {\n initComponents();\n fillThongtin();\n }", "public DefaultSharedPreferenceService(SharedPreferences sharedPreferences) {\n mSharedPreferences = checkNotNull(sharedPreferences);\n }", "public CustomView(Context c, AttributeSet as, int default_style){\n super(c, as, default_style);\n init();\n }", "public MultiSelectListPreference( Context context, AttributeSet attrs )\n {\n super( context, attrs );\n \n TypedArray a = context\n .obtainStyledAttributes( attrs, R.styleable.MultiSelectListPreference );\n String delimiter = a.getString( R.styleable.MultiSelectListPreference_delimiter );\n String separator = a.getString( R.styleable.MultiSelectListPreference_separator );\n a.recycle();\n \n mDelimiter = TextUtils.isEmpty( delimiter ) ? DEFAULT_DELIMITER : delimiter;\n mSeparator = TextUtils.isEmpty( separator ) ? DEFAULT_SEPARATOR : separator;\n }", "public Stub(int style) {\n\t\t\tthis(\"\", null, style, null, null);\n\t\t}", "public void setStartPointEndingStyle(String style) {\n/* 713 */ String actualStyle = (style == null) ? \"None\" : style;\n/* 714 */ COSBase base = getCOSObject().getDictionaryObject(COSName.LE);\n/* */ \n/* 716 */ if (!(base instanceof COSArray) || ((COSArray)base).size() == 0) {\n/* */ \n/* 718 */ COSArray array = new COSArray();\n/* 719 */ array.add((COSBase)COSName.getPDFName(actualStyle));\n/* 720 */ array.add((COSBase)COSName.getPDFName(\"None\"));\n/* 721 */ getCOSObject().setItem(COSName.LE, (COSBase)array);\n/* */ }\n/* */ else {\n/* */ \n/* 725 */ COSArray array = (COSArray)base;\n/* 726 */ array.setName(0, actualStyle);\n/* */ } \n/* */ }", "public void setDefault(VisualStyle style, Object c) {\n \t\tif ((style == null) || (c == null))\n \t\t\treturn;\n \n \t\tif (isNodeProp()) {\n \t\t\tNodeAppearanceCalculator nodeCalc = style.getNodeAppearanceCalculator();\n \t\t\tNodeAppearance na = nodeCalc.getDefaultAppearance();\n \t\t\tna.set(this, c);\n \t\t\tnodeCalc.setDefaultAppearance(na);\n \t\t} else {\n \t\t\tEdgeAppearanceCalculator edgeCalc = style.getEdgeAppearanceCalculator();\n \t\t\tEdgeAppearance ea = edgeCalc.getDefaultAppearance();\n \t\t\tea.set(this, c);\n \t\t\tedgeCalc.setDefaultAppearance(ea);\n \t\t}\n \t}", "public static IntegerPreference create(String category, String key, String name, String desc, Integer defaultValue)\n\t{\n\t\treturn new IntegerPreference(category,key,name,desc,defaultValue,true);\n\t}", "public interface PreferenceHelper {\r\n // Preference Name\r\n String PREFERENCE_NAME = \"Embedded_Downloads_preference\";\r\n // Preference mode\r\n int PRIVATE_MODE = 0;\r\n String INITIAL_START = \"initial_start\";\r\n String WALLET_ADDRESS = \"wallet_address\";\r\n String WALLET_NAME = \"wallet_name\";\r\n String TRANSACTION_WALLET_ADDRESS = \"transaction_wallet_address\";\r\n String WALLET_POSITION =\"wallet_position\";\r\n String CALL_TRANSACTION_STATUS = \"call_transaction_status\";\r\n String CALL_INCOMING = \"call_incoming\";\r\n String CALL_OUTGOING = \"call_outgoing\";\r\n}", "public boolean isNewIsDefaultStyle()\r\n {\r\n return myNewIsDefaultStyle;\r\n }", "@Override\n\tprotected Control createContents(final Composite parent) {\n\t\tfinal Composite composite = new Composite(parent, SWT.NONE);\n\t\tcomposite.setLayout(new GridLayout());\n\n\t\t// Get the preference store\n\t\tfinal IPreferenceStore preferenceStore = getPreferenceStore();\n\n\t\tfinal Label lblRandomRules = new Label(composite, SWT.NONE);\n\t\tlblRandomRules.setText(Messages.getString(\"PasswordPolicyPreferences.RulesLabel\")); //$NON-NLS-1$\n\n\t\tfinal Composite composite_1 = new Composite(composite, SWT.NONE);\n\t\tfinal GridLayout gridLayout = new GridLayout();\n\t\tgridLayout.marginHeight = 0;\n\t\tgridLayout.marginWidth = 0;\n\t\tgridLayout.numColumns = 2;\n\t\tcomposite_1.setLayout(gridLayout);\n\n\t\tfinal Label lblDefaultLength = new Label(composite_1, SWT.NONE);\n\t\tlblDefaultLength.setText(Messages.getString(\"PasswordPolicyPreferences.PasswordLength\")); //$NON-NLS-1$\n\n\t\tspiLength = new Spinner(composite_1, SWT.BORDER);\n\t\tspiLength.setSelection(preferenceStore.getInt(DEFAULT_PASSWORD_LENGTH));\n\n\t\tbtnUseLowercase = new Button(composite, SWT.CHECK);\n\t\tbtnUseLowercase.setText(Messages.getString(\"PasswordPolicyPreferences.Lowercase\")); //$NON-NLS-1$\n\t\tbtnUseLowercase.setSelection(preferenceStore.getBoolean(USE_LOWERCASE_LETTERS));\n\n\t\tbtnUserUppercase = new Button(composite, SWT.CHECK);\n\t\tbtnUserUppercase.setText(Messages.getString(\"PasswordPolicyPreferences.Uppercase\")); //$NON-NLS-1$\n\t\tbtnUserUppercase.setSelection(preferenceStore.getBoolean(USE_UPPERCASE_LETTERS));\n\n\t\tbtnUseDigits = new Button(composite, SWT.CHECK);\n\t\tbtnUseDigits.setText(Messages.getString(\"PasswordPolicyPreferences.Digits\")); //$NON-NLS-1$\n\t\tbtnUseDigits.setSelection(preferenceStore.getBoolean(USE_DIGITS));\n\n\t\tbtnUseSymbols = new Button(composite, SWT.CHECK);\n\t\tbtnUseSymbols.setText(Messages.getString(\"PasswordPolicyPreferences.Symbols\")); //$NON-NLS-1$\n\t\tbtnUseSymbols.setSelection(preferenceStore.getBoolean(USE_SYMBOLS));\n\n\t\tbtnUseEaseToRead = new Button(composite, SWT.CHECK);\n\t\tbtnUseEaseToRead.setText(Messages.getString(\"PasswordPolicyPreferences.EasyToRead\")); //$NON-NLS-1$\n\t\tbtnUseEaseToRead.setSelection(preferenceStore.getBoolean(USE_EASY_TO_READ));\n\n\t\tbtnUseHexOnly = new Button(composite, SWT.CHECK);\n\t\tbtnUseHexOnly.setEnabled(false);\n\t\tbtnUseHexOnly.setText(Messages.getString(\"PasswordPolicyPreferences.HexOnly\")); //$NON-NLS-1$\n\t\tbtnUseHexOnly.setSelection(preferenceStore.getBoolean(USE_HEX_ONLY));\n\n\t\treturn composite;\n\t}", "protected void installDefaults() {\n\t\tColor bg = this.controlPanel.getBackground();\n\t\tif (bg == null || bg instanceof UIResource) {\n\t\t\tthis.controlPanel.setBackground(FlamingoUtilities.getColor(\n\t\t\t\t\tColor.lightGray, \"ControlPanel.background\",\n\t\t\t\t\t\"Panel.background\"));\n\t\t}\n\n\t\tBorder b = this.controlPanel.getBorder();\n\t\tif (b == null || b instanceof UIResource) {\n\t\t\tBorder toSet = UIManager.getBorder(\"ControlPanel.border\");\n\t\t\tif (toSet == null)\n\t\t\t\tnew BorderUIResource.EmptyBorderUIResource(1, 2, 1, 2);\n\t\t\tthis.controlPanel.setBorder(toSet);\n\t\t}\n\t\t\n\t\tFont font = this.controlPanel.getFont();\n if (font == null || font instanceof UIResource) {\n Font toSet = UIManager.getFont(\"Panel.font\");\n this.controlPanel.setFont(toSet);\n }\n\t}", "private BluetoothSettings() {\n }", "private void changeUIdefaults() {\n\t\tUIManager.put(\"TaskPaneContainer.useGradient\", Boolean.FALSE);\n\t\tUIManager.put(\"TaskPaneContainer.background\",\n\t\t\t\tColors.LightGray.color(0.5f));\n\n\t\t// setting taskpane defaults\n\t\tUIManager.put(\"TaskPane.font\", new FontUIResource(new Font(\"Verdana\",\n\t\t\t\tFont.BOLD, 16)));\n\t\tUIManager.put(\"TaskPane.titleBackgroundGradientStart\",\n\t\t\t\tColors.White.color());\n\t\tUIManager.put(\"TaskPane.titleBackgroundGradientEnd\",\n\t\t\t\tColors.LightBlue.color());\n\t}", "public static void setupDialogSkinsDefaults()\n\t{\n\n\t\tif(! dialogSkins.containsKey(\"default\"))\n\t\t\taddDialogSkin(\"default\", new StandardDialogSkin());\n\n\t\tif(! dialogSkins.containsKey(\"hand-held\"))\n\t\t\taddDialogSkin(\"hand-held\", new HandHeldDialogSkin());\n\n\t\thaveDialogSkinsDefaults = true;\n\t}", "private void setupSimplePreferencesScreen() {\n if (!isSimplePreferences(this)) {\n return;\n }\n\n addPreferencesFromResource(R.xml.pref_empty);\n\n addHeader(R.string.pref_header_game);\n addPreferencesFromResource(R.xml.pref_game);\n this.gameModeSettingsPreferenceScreen = getPreferenceScreen();\n\n addHeader(R.string.pref_header_other);\n addPreferencesFromResource(R.xml.pref_other);\n\n Preference key_game_mode_summary = findPreference(getResources().getString(R.string.key_game_mode_summary));\n this.key_game_mode_summary = key_game_mode_summary;\n\n Preference useCodePreference = findPreference(getResources().getString(R.string.key_use_code));\n this.useCodePreference = useCodePreference;\n useCodePreference.setOnPreferenceChangeListener(USE_CODE_PREFERENCE_LISTENER);\n\n Preference customWidthPreference = findPreference(getResources().getString(R.string.key_custom_maze_width));\n customWidthPreference.setSummary(String.valueOf(getCustomMazeWidth()));\n this.customWidthPreference = customWidthPreference;\n customWidthPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n @Override\n public boolean onPreferenceChange(Preference preference, Object value) {\n try {\n int width = Math.min(Math.max(Integer.parseInt(value.toString()), getResources().getInteger(R.integer.min_custom_maze_size)), getResources().getInteger(R.integer.max_custom_maze_size));\n synchronized (SettingsActivity.class) {\n SettingsActivity.customMazeWidth = width;\n }\n preference.setSummary(String.valueOf(width));\n } catch (NumberFormatException e) {\n }\n return true;\n }\n });\n Preference customHeightPreference = findPreference(getResources().getString(R.string.key_custom_maze_height));\n customHeightPreference.setSummary(String.valueOf(getCustomMazeHeight()));\n this.customHeightPreference = customHeightPreference;\n customHeightPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n @Override\n public boolean onPreferenceChange(Preference preference, Object value) {\n try {\n int height = Math.min(Math.max(Integer.parseInt(value.toString()), getResources().getInteger(R.integer.min_custom_maze_size)), getResources().getInteger(R.integer.max_custom_maze_size));\n synchronized (SettingsActivity.class) {\n SettingsActivity.customMazeHeight = height;\n }\n preference.setSummary(String.valueOf(height));\n } catch (NumberFormatException e) {\n }\n return true;\n }\n });\n Preference customCreatePreference = findPreference(getResources().getString(R.string.key_custom_maze_create));\n this.customCreatePreference = customCreatePreference;\n customCreatePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n Maze2D.GeneratedMaze maze = generateCustomMaze(SettingsActivity.this);\n synchronized (SettingsActivity.class) {\n SettingsActivity.loadSeedMaze = maze;\n }\n if (maze != null) {\n SettingsActivity.this.finish();\n }\n return true;\n }\n });\n Preference customSolvePreference = findPreference(getResources().getString(R.string.key_custom_maze_solve));\n this.customSolvePreference = customSolvePreference;\n customSolvePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n synchronized (SettingsActivity.class) {\n SettingsActivity.showSolution = true;\n }\n SettingsActivity.this.finish();\n return true;\n }\n });\n Preference regularCreatePreference = findPreference(getResources().getString(R.string.key_maze_create));\n this.regularCreatePreference = regularCreatePreference;\n regularCreatePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n if (MainActivity.getGameMode() == GameMode.REGULAR) {\n synchronized (SettingsActivity.class) {\n SettingsActivity.newRegularMaze = true;\n }\n } else {\n synchronized (SettingsActivity.class) {\n SettingsActivity.newFillMaze = true;\n }\n }\n SettingsActivity.this.finish();\n return true;\n }\n });\n\n ListPreference algorithmPreference = (ListPreference) findPreference(getResources().getString(R.string.key_algorithm));\n this.algorithmPreference = algorithmPreference;\n\n // Bind the summaries of EditText/List/Dialog/Ringtone preferences to\n // their values. When their values change, their summaries are updated\n // to reflect the new value, per the Android Design guidelines.\n ListPreference gameModePreference = (ListPreference) findPreference(getResources().getString(R.string.key_game_mode));\n this.gamePreference = gameModePreference;\n bindPreferenceSummaryToValue(gameModePreference);\n String[] names = GameMode.getNames(this);\n gameModePreference.setEntries(names);\n gameModePreference.setEntryValues(names);\n GameMode gameMode = MainActivity.getGameMode();\n if (gameMode != null) {\n gameModePreference.setValueIndex(gameMode.getID());\n }\n\n bindPreferenceSummaryToValue(algorithmPreference);\n names = MazeAlgorithm.getNames(this, true);\n algorithmPreference.setEntries(names);\n algorithmPreference.setEntryValues(names);\n MazeAlgorithm algorithm = MainActivity.getAlgorithm();\n if (algorithm != null) {\n algorithmPreference.setDefaultValue(algorithm.getLocalName(this));\n }\n\n SwitchPreference showTracerPreference = (SwitchPreference) findPreference(getResources().getString(R.string.key_show_tracer));\n showTracerPreference.setOnPreferenceChangeListener(TOGGLE_TRACER_PREFERENCE_LISTENER);\n showTracerPreference.setDefaultValue(MainActivity.toggleTracer());\n\n SwitchPreference squareCellsPreference = (SwitchPreference) findPreference(getResources().getString(R.string.key_square_cells));\n squareCellsPreference.setOnPreferenceChangeListener(SQUARE_CELLS_PREFERENCE_LISTENER);\n squareCellsPreference.setDefaultValue(MainActivity.squareCells());\n\n Preference recalibratePreference = findPreference(getResources().getString(R.string.key_recalibrate));\n recalibratePreference.setOnPreferenceClickListener(RECALIBRATE_PREFERENCE_LISTENER);\n\n Preference defaultTiltPreference = findPreference(getResources().getString(R.string.key_default_tilt));\n defaultTiltPreference.setOnPreferenceClickListener(DEFAULT_TILT_PREFERENCE_LISTENER);\n\n prepareGameModeGUI(MainActivity.getGameMode());\n }", "public ToggleButton()\n {\n this(true);\n }", "@StyleDefaults(ELEMENT_ID)\n public static void initializeDefaultStyles(Styles styles, Attributes attrs) {\n styles.getSelector(meid, null).set(\"setReadfieldPreferredWidth\", 50, false);\n styles.getSelector(meid, null).set(\"setHeadlineHAlignment\", HAlignment.Center, false);\n styles.getSelector(meid, null).set(\"setReadfieldimagewidth\", 0f, false);\n styles.getSelector(meid, null).set(\"setReadfieldimageheight\", 0f, false);\n }", "public LayoutParams generateDefaultLayoutParams() {\n return new LayoutParams();\n }", "public Object getDefault(VisualStyle style) {\n \t\tif (style == null)\n \t\t\treturn null;\n \n \t\tAppearance a = null;\n \n \t\tif (isNodeProp())\n \t\t\ta = style.getNodeAppearanceCalculator().getDefaultAppearance();\n \t\telse\n \t\t\ta = style.getEdgeAppearanceCalculator().getDefaultAppearance();\n \n \t\treturn a.get(this);\n \t}", "public PreferencesDialog() {\r\n\t\tWindow window;\r\n\t\t// if is mac\r\n\t\tif (SystemInfo.isMac()) {\r\n\t\t\twindow = new JFrame(ResourceManager.getString(\"preferences.title\"));\r\n\t\t\t// dispose this dialog if presse close button\r\n\t\t\t((JFrame) window).setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\r\n\t\t\t// no resizable\r\n\t\t\t((JFrame) window).setResizable(false);\r\n\t\t} else {\r\n\t\t\twindow = new JDialog(MainWindow.getInstance(), ResourceManager.getString(\"preferences.title\"), true);\r\n\t\t\t// dispose this dialog if presse close button\r\n\t\t\t((JDialog) window).setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);\r\n\t\t\t// no resizable\r\n\t\t\t((JDialog) window).setResizable(false);\r\n\t\t}\r\n\r\n\t\t// set dialog icon\r\n\t\twindow.setIconImage(ResourceManager.getIcon(\"/icons/16x16/preferences.png\").getImage());\r\n\t\t// contruct dialog UI\r\n\t\tinitComponents(window);\r\n\t\twindow.setMinimumSize(new Dimension(300, 300));\r\n\t\t// adjust window preferred size\r\n\t\twindow.pack();\r\n\t\t// center of screen\r\n\t\twindow.setLocationRelativeTo(null);\r\n\t\t// show\r\n\t\twindow.setVisible(true);\r\n\t}", "protected TemplatePreferencePage() {\n \t\tsuper();\n \n \t\tsetDescription(TemplatesMessages.TemplatePreferencePage_message);\n \t}", "public Setting() {\n\t}", "private void initDefaults() {\n _nodeFadeSourceColor = _defNodeFadeSourceColor;\n _nodeFadeDestinationColor = _defNodeFadeDestinationColor;\n\n _nodeStrokeSourceColor = _defNodeStrokeSourceColor;\n _nodeStrokeDestinationColor = _defNodeStrokeDestinationColor;\n\n _nodeStrokeSourceWidth = _defNodeStrokeSourceWidth;\n _nodeStrokeDestinationWidth = _defNodeStrokeDestinationWidth;\n\n _supportEdgeFadeSourceColor = _defSupportEdgeFadeSourceColor;\n _supportEdgeFadeDestinationColor = _defSupportEdgeFadeDestinationColor;\n\n _refuteEdgeFadeSourceColor = _defRefuteEdgeFadeSourceColor;\n _refuteEdgeFadeDestinationColor = _defRefuteEdgeFadeDestinationColor;\n\n _edgeStrokeSourceWidth = _defEdgeStrokeSourceWidth;\n _edgeStrokeDestinationWidth = _defEdgeStrokeDestinationWidth;\n\n _curvedLines = _defCurvedLines;\n\n _manualBackgroundColor = _defManualBackgroundColor;\n\n _realTimeSliderResponse = _defRealTimeSliderResponse;\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(\n\t\t\t\t\t\tSettingActivity.this);\n\t\t\t\tbuilder.setTitle(\"归属地查询风格\");\n\t\t\t\tbuilder.setSingleChoiceItems(MGApplication.bgNames,\n\t\t\t\t\t\tsharedPreferences.getInt(\n\t\t\t\t\t\t\t\tMobileGuard.SHOW_LOCATION_WHICHSTYLE, 0),\n\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\t\tEditor editor = sharedPreferences.edit();\n\t\t\t\t\t\t\t\teditor.putInt(\n\t\t\t\t\t\t\t\t\t\tMobileGuard.SHOW_LOCATION_WHICHSTYLE,\n\t\t\t\t\t\t\t\t\t\twhich);\n\t\t\t\t\t\t\t\teditor.commit();\n\t\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\tbuilder.show();\n\t\t\t}", "@attribute(value = \"\", required = false, defaultValue=\"NONE\")\r\n\tpublic void setStyle(String style) {\r\n\t\t// dummy function for comment\r\n\t}", "private void setupSimplePreferencesScreen() {\n\n addPreferencesFromResource(R.xml.pref_weight);\n\n final Activity activity = getActivity();\n\n CustomPreferenceCategory fakeHeader = new CustomPreferenceCategory(activity);\n fakeHeader = new CustomPreferenceCategory(activity);\n fakeHeader.setTitle(R.string.pref_header_about);\n getPreferenceScreen().addPreference(fakeHeader);\n addPreferencesFromResource(R.xml.pref_about);\n\n // Bind the summaries of EditText/List/Dialog/Ringtone preferences to\n // their values. When their values change, their summaries are updated\n // to reflect the new value, per the Android Design guidelines.\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_units_key)));\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_plate_style_key)));\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_bar_weight_key)));\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_formula_key)));\n\n Preference aboutButton = (Preference)findPreference(getString(R.string.pref_about_button));\n aboutButton.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n AboutDialog aboutDialog = new AboutDialog();\n aboutDialog.show(getFragmentManager(), \"AboutDialog\");\n return true;\n }\n });\n\n Preference rateButton = (Preference)findPreference(getString(R.string.pref_rate_button));\n rateButton .setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n Uri uri = Uri.parse(\"market://details?id=\" + activity.getPackageName());\n Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);\n try {\n startActivity(goToMarket);\n } catch (ActivityNotFoundException e) {\n startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(\"http://play.google.com/store/apps/details?id=\" + activity.getPackageName())));\n }\n return true;\n }\n });\n\n final RepCheckPreferenceFragment repCheckPreferenceFragment = this;\n\n Preference resetButton = (Preference)findPreference(getString(R.string.pref_reset_button));\n resetButton.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n DialogFragment saveAsNewDialog = ConfirmResetDialog.newInstance(new ResetResponseHandler(repCheckPreferenceFragment));\n saveAsNewDialog.show(activity.getFragmentManager(), \"RenameSetDialog\");\n return true;\n }\n });\n }", "public ReadPolicyStatDefaultSetting() {\n\t\tsuper();\n\t}", "public GroupChatPreferencePanel() {\n // Build the UI\n createUI();\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v =inflater.inflate(R.layout.configuration_fragment, container, false);\n\n\n Switch interruptor=(Switch)v.findViewById(R.id.cinemaModeConfiguration);\n\n Switch interruptor2=(Switch)v.findViewById(R.id.lightModeConfiguration);\n\n SharedPreferences datos=((MainActivity) getActivity()).getDatos();\n boolean preferencias=datos.getBoolean(\"CinemaMode\",false);\n interruptor.setChecked(preferencias);\n\n\n\n boolean preferenciasLuz = datos.getBoolean(\"LightMode\",false);\n interruptor2.setChecked(preferenciasLuz);\n\n\n return v;\n }", "private Default()\n {}", "public OptionPane() {\n\t\t\n\t\tinit();\n\t}", "public RightPrioritizeSwitch() {\n\t\t// Use requires() here to declare subsystem dependencies\n\t\t// eg. requires(chassis);\t\t\n\t\ttimer = new Timer();\n\t\tdelay = new Timer();\n\t\tcrossLine = new CrossAutoLine();\n\t\tturnTowardsSwitchOrScale = new RotateDrivetrainWithGyroPID(90, false);\n\t\tdriveToScale = new DriveStraightToPositionPID(323.6);\n\t\tdriveToSwitch = new DriveStraightToPositionPID(168);\n\t\tapproachScale = new DriveStraightToPositionPID(44);\n\t\tapproachSwitch = new DriveStraightToPositionPID(-42);\n\t\tlaunchCubeSwitch = new AutomaticShoot(false);\n\t\tlaunchCubeScale = new AutomaticShoot(true);\n\t}", "@Override\n\tprotected void performDefaults() {\n\t\t// Get the preference store\n\t\tfinal IPreferenceStore preferenceStore = getPreferenceStore();\n\n\t\tspiLength.setSelection(preferenceStore.getDefaultInt(DEFAULT_PASSWORD_LENGTH));\n\t\tbtnUseLowercase.setSelection(preferenceStore.getDefaultBoolean(USE_LOWERCASE_LETTERS));\n\t\tbtnUserUppercase.setSelection(preferenceStore.getDefaultBoolean(USE_UPPERCASE_LETTERS));\n\t\tbtnUseDigits.setSelection(preferenceStore.getDefaultBoolean(USE_DIGITS));\n\t\tbtnUseSymbols.setSelection(preferenceStore.getDefaultBoolean(USE_SYMBOLS));\n\t\tbtnUseEaseToRead.setSelection(preferenceStore.getDefaultBoolean(USE_EASY_TO_READ));\n\t\tbtnUseHexOnly.setSelection(preferenceStore.getDefaultBoolean(USE_HEX_ONLY));\n\n\t}", "private void setPreferences(String sw, boolean checked) {\n SharedPreferences sp = getActivity().getSharedPreferences(SETTINGS, Context.MODE_PRIVATE );\n SharedPreferences.Editor editor = sp.edit();\n editor.putBoolean(sw,checked);\n editor.apply();\n\n }", "public void setPreference() {\n prefs = Preferences.userRoot().node(this.getClass().getName());\n String ID1 = \"Test1\";\n String ID2 = \"Test2\";\n String ID3 = \"Test3\";\n// First we will get the values\n// Define a boolean value\n System.out.println(prefs.getBoolean(ID1, true));\n// Define a string with default \"Hello World\n System.out.println(prefs.get(ID2, \"Hello World\"));\n// Define a integer with default 50\n System.out.println(prefs.getInt(ID3, 50));\n// Now set the values\n prefs.putBoolean(ID1, false);\n prefs.put(ID2, \"Hello Europa\");\n prefs.putInt(ID3, 45);\n\t\t\n prefs.remove(ID1);// Delete the preference settings for the first value\n }", "public static PreferencesView createPreferencesView() {\n // Retrieve application preferences and attach them to their view\n // (This instance must be instanciated after dependencies)\n final LinkedHashMap<String, JPanel> panels = new LinkedHashMap<String, JPanel>(2);\n panels.put(\"General settings\", new PreferencePanel());\n\n final PreferencesView preferencesView = new PreferencesView(getFrame(), Preferences.getInstance(), panels);\n preferencesView.init();\n\n return preferencesView;\n }", "public Button addExplicitStyle(String name, String value){\n if(this.explicitStyle==null){\n this.explicitStyle = name + \":\" + value + \";\";\n }else{\n this.explicitStyle += name + \":\" + value + \";\";\n }\n return this;\n }", "@Override // com.android.settings.dashboard.DashboardFragment\n public List<AbstractPreferenceController> createPreferenceControllers(Context context) {\n WifiManager wifiManager = (WifiManager) getSystemService(\"wifi\");\n ArrayList arrayList = new ArrayList();\n this.mWifiWakeupPreferenceController = new WifiWakeupPreferenceController(context);\n this.mUseOpenWifiPreferenceController = new UseOpenWifiPreferenceController(context);\n arrayList.add(new WifiP2pPreferenceController(context, getSettingsLifecycle(), wifiManager));\n arrayList.add(new OPIntelligentlySelectBestWifiPreferenceController(context, getSettingsLifecycle()));\n arrayList.add(new OPWifiScanAlwaysAvailablePreferenceController(context, getSettingsLifecycle(), this.mWifiWakeupPreferenceController));\n arrayList.add(new OPPasspointPreferenceController(context, getSettingsLifecycle()));\n arrayList.add(new OPWapiCertManagePreferenceController(context));\n arrayList.add(new OPWifiInfoPreferenceController(context, getSettingsLifecycle(), wifiManager));\n return arrayList;\n }", "AdminPreference getDefaultAdminPreference();", "public static PageControl initDefaults(PageControl pc, \n int defaultSortAttr) {\n if (pc == null) {\n pc = new PageControl();\n }\n else {\n pc = (PageControl) pc.clone();\n }\n \n if (pc.getSortattribute() == SortAttribute.DEFAULT) {\n pc.setSortattribute(defaultSortAttr);\n }\n if (pc.getSortorder() == SORT_UNSORTED) {\n pc.setSortorder(SORT_ASC);\n }\n\n return pc;\n }", "public GAClusteringConfigurationDialog() {}", "void setStyle(String style);", "public static FlatGeneratorSettings getDefaultSettings() {\n final List<FlatLayer> layers = Lists.newArrayListWithCapacity(3);\n layers.add(new FlatLayer(BlockTypes.BEDROCK, 1));\n layers.add(new FlatLayer(BlockTypes.DIRT, 2));\n layers.add(new FlatLayer(BlockTypes.GRASS, 1));\n return new FlatGeneratorSettings(BiomeTypes.PLAINS, layers);\n }", "public void setDefaultSettings() {\n boolean shouldRecord = sharedPreferences.getBoolean(record,true);\n if (shouldRecord) {\n radioOption.check(R.id.radioRecord);\n radioOptionButton = (RadioButton)findViewById(R.id.radioRecord);\n radioOptionButton.setEnabled(true);\n } else {\n radioOption.check(R.id.radioRecognize);\n radioOptionButton = (RadioButton)findViewById(R.id.radioRecognize);\n radioOptionButton.setEnabled(true);\n }\n\n // Set timer to previous value set by user\n int minuteValue = sharedPreferences.getInt(minuteTime, 0)/60000;\n minutePicker.setValue(minuteValue);\n\n int secondValue = sharedPreferences.getInt(secondTime, 5000)/1000;\n secondPicker.setValue(secondValue);\n }", "public PreferenceManager(String prefFileName, Map<String, Object> defaults) {\n\t\tthis.prefFileName = prefFileName;\n\t\tthis.defaults = defaults;\n\t\tinternal = new Properties();\n\t}", "public PacManUiBuilder withDefaultButtons() {\n defaultButtons = true;\n buttons.put(START_CAPTION, null);\n buttons.put(STOP_CAPTION, null);\n return this;\n }", "public BackupDialogPreference(Context context, AttributeSet attrs) {\n super(context, attrs);\n this.mContext = context;\n }", "protected GUIBooleanParameter(BooleanParameter parameter, SettingsPane sp) {\n\t\tsuper(parameter, sp);\n\t}", "public OpenShift2PreferencePage() {\n\t\tsuper(\"JBoss Tools\", \"OpenShift 2\");\n\t}", "static void setDefaults() {\n \n setDefault(FEATURE_POLICY_PERSISTENCE_PROPERTY, true);\n setDefault(FEATURE_ENRICHER_PERSISTENCE_PROPERTY, true);\n setDefault(FEATURE_FEED_PERSISTENCE_PROPERTY, true);\n setDefault(FEATURE_FEED_REGISTRATION_PROPERTY, false);\n setDefault(FEATURE_CATALOG_PERSISTENCE_PROPERTY, true);\n setDefault(FEATURE_DEFAULT_STANDBY_IS_HOT_PROPERTY, false);\n setDefault(FEATURE_USE_BROOKLYN_LIVE_OBJECTS_DATAGRID_STORAGE, false);\n setDefault(FEATURE_RENAME_THREADS, false);\n setDefault(FEATURE_BACKWARDS_COMPATIBILITY_INFER_CATALOG_ITEM_ON_REBIND, true);\n setDefault(FEATURE_AUTO_FIX_CATALOG_REF_ON_REBIND, false);\n setDefault(FEATURE_SSH_ASYNC_EXEC, false);\n setDefault(FEATURE_VALIDATE_LOCATION_SSH_KEYS, true);\n }", "public static Option getDefaultOption (int optionNumber, int udpPort) {\n\t\treturn new Option (udpPort, URI_PORT);\n\t}", "public Preferences(BlueJ bluej) {\r\n this.bluej = bluej;\r\n myPanel = new JPanel();\r\n myPanel.add(new JLabel(\"Favorite Colour\"));\r\n color = new JTextField(40);\r\n myPanel.add(color);\r\n // Load the default value\r\n loadValues();\r\n }", "SettingType createSettingType();", "public static Option getDefaultOption (int optionNumber, String ipAddress) {\n\t\treturn new Option (ipAddress, URI_HOST);\n\t}", "public static Spring constant(int pref) {\n return constant(pref, pref, pref);\n }", "private MapOptions initDefaultMapOptions()\n\t{\n\t\tMapOptions options = new MapOptions();\n\t\toptions.removeDefaultControls();\n\t\toptions.setNumZoomLevels(16);\n\t\toptions.setDisplayProjection(new Projection(\"EPSG:4326\"));\n\t\treturn options;\n\t}", "public Settings loadDefault() {\n return new Settings();\n }", "protected abstract S createDefault();", "@Override\n\tprotected void initDefaultCommand() {\n\t\tfor(int i=0; i<10; i++){\n\t\t\tlimSwitches[i]= new DigitalInput(i);\n\t\t}\n\t\t\n\t\tlowerLeft.setInverted(true);\n\t\tintakeMotor.setInverted(true);\n\t\t\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n addPreferencesFromResource(R.xml.framework_setting);\n SharedPreferences sharedPreferences = this.getPreferenceManager().getSharedPreferences();\n String preference_smartbar_default_type = getResources().getString(R.string.preference_smartbar_default_type);\n final ListPreference listPreference = (ListPreference) findPreference(preference_smartbar_default_type);\n //修改Smartbar类型\n String smart_type = sharedPreferences.getString(preference_smartbar_default_type, null);\n int index = listPreference.findIndexOfValue(String.valueOf(smart_type));\n if (index != -1) {\n CharSequence[] entries = listPreference.getEntries();\n listPreference.setTitle(entries[index]);\n }\n if (listPreference != null) {\n listPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n @Override\n public boolean onPreferenceChange(Preference preference, Object newValue) {\n int index = listPreference.findIndexOfValue(newValue.toString());\n CharSequence[] entries = listPreference.getEntries();\n listPreference.setTitle(entries[index]);\n return true;\n }\n });\n }\n }", "public Builder() {\n\t\t\tsuper(Defaults.NAME);\n\t\t}", "private void setDefaultConfiguration(){\n\t\tthis.setProperty(\"DefaultNodeCapacity\", \"5\");\n\t\tthis.setProperty(\"ReplicaNumber\", \"3\");\n\t\tthis.setProperty(\"JobReattemptTimes\", \"2\");\n\t\tthis.setProperty(\"ReducerCount\", \"3\");\n\t}" ]
[ "0.6754267", "0.6140522", "0.6102623", "0.60844016", "0.5660776", "0.5469244", "0.5406934", "0.5226984", "0.5196258", "0.5070369", "0.5058577", "0.5039442", "0.50280255", "0.4983084", "0.49534202", "0.49392402", "0.4908784", "0.48878023", "0.48089457", "0.48057204", "0.47941086", "0.4732308", "0.47271836", "0.47108448", "0.47100082", "0.46848541", "0.4632326", "0.46029454", "0.45916933", "0.45856348", "0.45601648", "0.4559852", "0.45597863", "0.45595318", "0.45463637", "0.45388502", "0.45279336", "0.45133144", "0.45034182", "0.44874418", "0.4485489", "0.4465845", "0.44635266", "0.44593716", "0.44573414", "0.44568273", "0.44472563", "0.44467545", "0.4444632", "0.44284874", "0.44219273", "0.4421416", "0.44082108", "0.44057694", "0.43996343", "0.43977198", "0.43911693", "0.43901315", "0.43898782", "0.43827784", "0.43812692", "0.4378744", "0.43764737", "0.43712878", "0.43667883", "0.4362867", "0.4361397", "0.43607497", "0.4352678", "0.4351729", "0.43512204", "0.43492258", "0.4340035", "0.43362388", "0.4322877", "0.43224862", "0.43153143", "0.4313289", "0.4303096", "0.42999342", "0.42986408", "0.4294255", "0.42877698", "0.42876974", "0.42819118", "0.4279974", "0.42782012", "0.42737025", "0.42683393", "0.42574257", "0.42532054", "0.42428905", "0.4238034", "0.42371106", "0.42355317", "0.42313123", "0.42235023", "0.42174068", "0.42168885", "0.42098993" ]
0.53707755
7
Construct a new SwitchPreference with the given style options.
public GallerySwitchPreference(Context context, AttributeSet attrs) { super(context, attrs); mResources = context.getResources(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public SwitchPreference(final Context context, final AttributeSet attrs, final int defStyle) {\n super(context, attrs, defStyle);\n }", "public CustomSwitchPreference(Context context, AttributeSet attrs) {\n super(context, attrs);\n }", "public SwitchPreference(final Context context, final AttributeSet attrs) {\n super(context, attrs);\n }", "public SwitchPreference(final Context context) {\n super(context, null);\n }", "public Builder(String optionSwitch, SwitchType switchType) {\n this.shortSwitches = new HashSet<String>();\n longSwitches = new HashSet<String>();\n switch (switchType) {\n case SHORT_SWITCH:\n shortSwitches.add(optionSwitch);\n break;\n case LONG_SWITCH:\n longSwitches.add(optionSwitch);\n break;\n default:\n throw new IllegalArgumentException(\"Unknown switchType: \" + switchType);\n }\n }", "STYLE createSTYLE();", "public abstract TC createStyle();", "public Builder(Set<String> optionSwitches, SwitchType switchType) {\n this.shortSwitches = new HashSet<String>();\n longSwitches = new HashSet<String>();\n switch (switchType) {\n case SHORT_SWITCH:\n shortSwitches.addAll(optionSwitches);\n break;\n case LONG_SWITCH:\n longSwitches.addAll(optionSwitches);\n break;\n default:\n throw new IllegalArgumentException(\"Unknown switchType: \" + switchType);\n }\n }", "void setStyle(String style);", "public MyPreference(Context context, AttributeSet attrs) {\r\n super(context, attrs);\r\n this.context = context;\r\n// setWidgetLayoutResource(R.layout.preference_widget_mypreference);\r\n }", "public GallerySwitchPreference(Context context) {\n this(context, null);\n }", "public Stub(int style) {\n\t\t\tthis(\"\", null, style, null, null);\n\t\t}", "public void setStartPointEndingStyle(String style) {\n/* 713 */ String actualStyle = (style == null) ? \"None\" : style;\n/* 714 */ COSBase base = getCOSObject().getDictionaryObject(COSName.LE);\n/* */ \n/* 716 */ if (!(base instanceof COSArray) || ((COSArray)base).size() == 0) {\n/* */ \n/* 718 */ COSArray array = new COSArray();\n/* 719 */ array.add((COSBase)COSName.getPDFName(actualStyle));\n/* 720 */ array.add((COSBase)COSName.getPDFName(\"None\"));\n/* 721 */ getCOSObject().setItem(COSName.LE, (COSBase)array);\n/* */ }\n/* */ else {\n/* */ \n/* 725 */ COSArray array = (COSArray)base;\n/* 726 */ array.setName(0, actualStyle);\n/* */ } \n/* */ }", "public StylePanel(Composite parent, int style)\n\t{\n\t\tsuper(parent, style);\n\n\t\tinit();\n\t}", "public PreferenceBean createPreferenceBean()\n {\n return new PreferenceBean();\n }", "public void setStyle(String style) {\r\n this.style = style;\r\n }", "public void setStyle(String style) {\r\n this.style = style;\r\n }", "private void createSwitches() {\n \t\tswitches = new Point[4];\n \t\tswitches[0] = new Point(centreMin, centreMin);\n \t\tswitches[1] = new Point(centreMin, centreMax-1);\n \t\tswitches[2] = new Point(centreMax-1, centreMin);\n \t\tswitches[3] = new Point(centreMax-1, centreMax-1);\n \t}", "private ComponentComposite(Composite parent, int style) {\n\t\tsuper(parent, style);\n\t\tcreateControls();\n\t}", "public S create() {\n\t\tS style = createDefault();\n\t\tint id = nextID();\n\t\tstyle.setId(id);\n\t\taddStyle(style);\n\t\treturn style;\n\t}", "public Properties(long lengthMs, String style, String taskId) {\n super();\n _length = lengthMs;\n _styleClass = \"gantt-border\";\n _taskId = taskId;\n\n //If task is unassigned, do not show!\n if (!style.equals(\"#000000\")) {\n _style = \"-fx-background-color:\" + style;\n } else {\n _taskId = \"\";\n _length = 0;\n _style = \"-fx-background-color: transparent;\";\n }\n }", "public void setStyle(String st){\n style = st;\n }", "public BuiltInStyle(int xfind, int sn)\r\n/* 10: */ {\r\n/* 11:46 */ super(Type.STYLE);\r\n/* 12: */ \r\n/* 13:48 */ this.xfIndex = xfind;\r\n/* 14:49 */ this.styleNumber = sn;\r\n/* 15: */ }", "public void setStyle(String style) {\n this.style = style;\n }", "@attribute(value = \"\", required = false, defaultValue=\"NONE\")\r\n\tpublic void setStyle(String style) {\r\n\t\t// dummy function for comment\r\n\t}", "protected ScriptStyle(int val, String s)\r\n/* 10: */ {\r\n/* 11: 54 */ this.value = val;\r\n/* 12: 55 */ this.string = s;\r\n/* 13: */ \r\n/* 14: 57 */ ScriptStyle[] oldstyles = styles;\r\n/* 15: 58 */ styles = new ScriptStyle[oldstyles.length + 1];\r\n/* 16: 59 */ System.arraycopy(oldstyles, 0, styles, 0, oldstyles.length);\r\n/* 17: 60 */ styles[oldstyles.length] = this;\r\n/* 18: */ }", "private synchronized void initStyle(InstanceWaypoint context) {\n \t\tif (styleInitialized) {\n \t\t\treturn;\n \t\t}\n \t\telse {\n \t\t\tstyleInitialized = true;\n \t\t}\n \t\t\n \t\t//check if there is a Rule from the Rulestyle-Page and apply to the instancemarker on the map\n \t\tRule honoredRule = honorRules(context);\n \t\tfillStyle(honoredRule, context);\n \t\tstrokeStyle(honoredRule, context);\t\n \n \t}", "public void setDwStyle(org.sirius.client.win32.core.types.Dword dwStyle) {\n this.dwStyle = dwStyle;\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(\n\t\t\t\t\t\tSettingActivity.this);\n\t\t\t\tbuilder.setTitle(\"归属地查询风格\");\n\t\t\t\tbuilder.setSingleChoiceItems(MGApplication.bgNames,\n\t\t\t\t\t\tsharedPreferences.getInt(\n\t\t\t\t\t\t\t\tMobileGuard.SHOW_LOCATION_WHICHSTYLE, 0),\n\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\t\tEditor editor = sharedPreferences.edit();\n\t\t\t\t\t\t\t\teditor.putInt(\n\t\t\t\t\t\t\t\t\t\tMobileGuard.SHOW_LOCATION_WHICHSTYLE,\n\t\t\t\t\t\t\t\t\t\twhich);\n\t\t\t\t\t\t\t\teditor.commit();\n\t\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\tbuilder.show();\n\t\t\t}", "public void setStylePanel(StylePanel stylePanel);", "public Builder(String shortSwitch) {\n this.shortSwitches = new HashSet<String>();\n this.shortSwitches.add(shortSwitch);\n longSwitches = new HashSet<String>();\n }", "public Slider( final Composite parent, final int style ) {\n \tsuper( parent, checkStyle (style) );\n \tincrement = 1;\n maximum = 100;\n minimum = 0;\n pageIncrement = 10;\n selection = 0;\n thumb = 10;\n }", "public Sash (Composite parent, int style) {\n\tsuper (parent, checkStyle (style));\n}", "public Sash (Composite parent, int style) {\n\tsuper (parent, checkStyle (style));\n}", "public Style createSelectBoxStyle() {\n \t \tStroke stroke = styleFactory.createStroke(\n \t \t\t\tfilterFactory.literal(Color.BLUE),\n \t \t\t\tfilterFactory.literal(1),\n \tnull,\n \tnull,\n \tnull,\n \tnew float[] { 5, 2 },\n \tnull,\n \tnull,\n \tnull\n\t\t);\n\t\t//Cria um Symbolizer para linha.\n\t\tPolygonSymbolizer polygonSymbolizer = styleFactory.createPolygonSymbolizer(stroke, null, null);\n\t\t//Regra para um estilo de fei��o.\n\t\tRule rulePoly = styleFactory.createRule();\n\t\t\n\t\t//Adiciona o PointSymbolizer na regra.\n\t\t//rulePoly.setName(\"Polygon\"); \n\t\t//ruleLine.setFilter(filterFactory.equals(filterFactory.property(\"geom\"), filterFactory.literal(false)));\n\t\trulePoly.symbolizers().add(polygonSymbolizer); \n\t\t\t \n\t\t//Adiciona uma ou N regras em uma estilo de uma determinada fei��o.\n\t\tFeatureTypeStyle ftsPoly = styleFactory.createFeatureTypeStyle(new Rule[]{rulePoly});\n\t\t \n\t\t//Cria o estilo (SLD).\n\t\tStyle style = styleFactory.createStyle();\n\t\tstyle.featureTypeStyles().add(ftsPoly);\n\t\t \n\t\treturn style;\n }", "public TimePickerBuilder setStyleResId(int styleResId) {\n this.styleResId = styleResId;\n return this;\n }", "public abstract LcpConfigOption create(final int[] data);", "@Override\n\tprotected TextAttribute createTextAttribute(String[] stylePrefs) {\n\t\tint fontModifier = SWT.NORMAL;\n\t\tif (Boolean.valueOf(stylePrefs[2]).booleanValue()) { // bold\n\t\t\tfontModifier |= SWT.BOLD;\n\t\t}\n\t\tif (Boolean.valueOf(stylePrefs[3]).booleanValue()) { // italic\n\t\t\tfontModifier |= SWT.ITALIC;\n\t\t}\n\t\tif (Boolean.valueOf(stylePrefs[4]).booleanValue()) { // strikethrough\n\t\t\tfontModifier |= TextAttribute.STRIKETHROUGH;\n\t\t}\n\t\tif (Boolean.valueOf(stylePrefs[5]).booleanValue()) { // underline\n\t\t\tfontModifier |= TextAttribute.UNDERLINE;\n\t\t}\n\t\treturn new TextAttribute(EditorUtility.getColor(ColorHelper.toRGB(stylePrefs[0])),\n\t\t\t\tEditorUtility.getColor(ColorHelper.toRGB(stylePrefs[1])), fontModifier);\n\t}", "private void setPreferences(String sw, boolean checked) {\n SharedPreferences sp = getActivity().getSharedPreferences(SETTINGS, Context.MODE_PRIVATE );\n SharedPreferences.Editor editor = sp.edit();\n editor.putBoolean(sw,checked);\n editor.apply();\n\n }", "public static StyleStyle warp(final ODPackage pkg, final Element styleElem) {\r\n final StyleStyle generic = new StyleStyle(pkg, styleElem);\r\n loadDescs();\r\n final Map<String, StyleDesc<?>> map = family2Desc.get(pkg.getVersion());\r\n if (map.containsKey(generic.getFamily())) {\r\n final StyleDesc<?> styleClass = map.get(generic.getFamily());\r\n return styleClass.create(pkg, styleElem);\r\n } else\r\n return generic;\r\n }", "public Encoding setStyle(String value) {\n\t\tstyle = value;\n\t\treturn this;\n\t}", "public void setEndPointEndingStyle(String style) {\n/* 752 */ String actualStyle = (style == null) ? \"None\" : style;\n/* 753 */ COSBase base = getCOSObject().getDictionaryObject(COSName.LE);\n/* */ \n/* 755 */ if (!(base instanceof COSArray) || ((COSArray)base).size() < 2) {\n/* */ \n/* 757 */ COSArray array = new COSArray();\n/* 758 */ array.add((COSBase)COSName.getPDFName(\"None\"));\n/* 759 */ array.add((COSBase)COSName.getPDFName(actualStyle));\n/* 760 */ getCOSObject().setItem(COSName.LE, (COSBase)array);\n/* */ }\n/* */ else {\n/* */ \n/* 764 */ COSArray array = (COSArray)base;\n/* 765 */ array.setName(1, actualStyle);\n/* */ } \n/* */ }", "public Customer(char[] prefs){\n\t\tpreferences = new ArrayList<Color>();\n\t\tfor (int i=0; i<=prefs.length-1; i= i+2) {\n\t\t\tpreferences.add(new Color(Character.getNumericValue(prefs[i]),prefs[i+1]));\n\t\t}\n\t}", "@Override\n\tprotected Control createContents(final Composite parent) {\n\t\tfinal Composite composite = new Composite(parent, SWT.NONE);\n\t\tcomposite.setLayout(new GridLayout());\n\n\t\t// Get the preference store\n\t\tfinal IPreferenceStore preferenceStore = getPreferenceStore();\n\n\t\tfinal Label lblRandomRules = new Label(composite, SWT.NONE);\n\t\tlblRandomRules.setText(Messages.getString(\"PasswordPolicyPreferences.RulesLabel\")); //$NON-NLS-1$\n\n\t\tfinal Composite composite_1 = new Composite(composite, SWT.NONE);\n\t\tfinal GridLayout gridLayout = new GridLayout();\n\t\tgridLayout.marginHeight = 0;\n\t\tgridLayout.marginWidth = 0;\n\t\tgridLayout.numColumns = 2;\n\t\tcomposite_1.setLayout(gridLayout);\n\n\t\tfinal Label lblDefaultLength = new Label(composite_1, SWT.NONE);\n\t\tlblDefaultLength.setText(Messages.getString(\"PasswordPolicyPreferences.PasswordLength\")); //$NON-NLS-1$\n\n\t\tspiLength = new Spinner(composite_1, SWT.BORDER);\n\t\tspiLength.setSelection(preferenceStore.getInt(DEFAULT_PASSWORD_LENGTH));\n\n\t\tbtnUseLowercase = new Button(composite, SWT.CHECK);\n\t\tbtnUseLowercase.setText(Messages.getString(\"PasswordPolicyPreferences.Lowercase\")); //$NON-NLS-1$\n\t\tbtnUseLowercase.setSelection(preferenceStore.getBoolean(USE_LOWERCASE_LETTERS));\n\n\t\tbtnUserUppercase = new Button(composite, SWT.CHECK);\n\t\tbtnUserUppercase.setText(Messages.getString(\"PasswordPolicyPreferences.Uppercase\")); //$NON-NLS-1$\n\t\tbtnUserUppercase.setSelection(preferenceStore.getBoolean(USE_UPPERCASE_LETTERS));\n\n\t\tbtnUseDigits = new Button(composite, SWT.CHECK);\n\t\tbtnUseDigits.setText(Messages.getString(\"PasswordPolicyPreferences.Digits\")); //$NON-NLS-1$\n\t\tbtnUseDigits.setSelection(preferenceStore.getBoolean(USE_DIGITS));\n\n\t\tbtnUseSymbols = new Button(composite, SWT.CHECK);\n\t\tbtnUseSymbols.setText(Messages.getString(\"PasswordPolicyPreferences.Symbols\")); //$NON-NLS-1$\n\t\tbtnUseSymbols.setSelection(preferenceStore.getBoolean(USE_SYMBOLS));\n\n\t\tbtnUseEaseToRead = new Button(composite, SWT.CHECK);\n\t\tbtnUseEaseToRead.setText(Messages.getString(\"PasswordPolicyPreferences.EasyToRead\")); //$NON-NLS-1$\n\t\tbtnUseEaseToRead.setSelection(preferenceStore.getBoolean(USE_EASY_TO_READ));\n\n\t\tbtnUseHexOnly = new Button(composite, SWT.CHECK);\n\t\tbtnUseHexOnly.setEnabled(false);\n\t\tbtnUseHexOnly.setText(Messages.getString(\"PasswordPolicyPreferences.HexOnly\")); //$NON-NLS-1$\n\t\tbtnUseHexOnly.setSelection(preferenceStore.getBoolean(USE_HEX_ONLY));\n\n\t\treturn composite;\n\t}", "public static Style get(SoState state)\n { return Style.fromValue(SoInt32Element.get(classStackIndexMap.get(SoPickStyleElement.class), state)); }", "@Override // com.android.settings.dashboard.DashboardFragment\n public List<AbstractPreferenceController> createPreferenceControllers(Context context) {\n WifiManager wifiManager = (WifiManager) getSystemService(\"wifi\");\n ArrayList arrayList = new ArrayList();\n this.mWifiWakeupPreferenceController = new WifiWakeupPreferenceController(context);\n this.mUseOpenWifiPreferenceController = new UseOpenWifiPreferenceController(context);\n arrayList.add(new WifiP2pPreferenceController(context, getSettingsLifecycle(), wifiManager));\n arrayList.add(new OPIntelligentlySelectBestWifiPreferenceController(context, getSettingsLifecycle()));\n arrayList.add(new OPWifiScanAlwaysAvailablePreferenceController(context, getSettingsLifecycle(), this.mWifiWakeupPreferenceController));\n arrayList.add(new OPPasspointPreferenceController(context, getSettingsLifecycle()));\n arrayList.add(new OPWapiCertManagePreferenceController(context));\n arrayList.add(new OPWifiInfoPreferenceController(context, getSettingsLifecycle(), wifiManager));\n return arrayList;\n }", "public Stub(String label, int style) {\n\t\t\tthis(label, null, style, null, null);\n\t\t}", "SettingType createSettingType();", "@Override\n\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\tEditor editor = sharedPreferences.edit();\n\t\t\t\t\t\t\t\teditor.putInt(\n\t\t\t\t\t\t\t\t\t\tMobileGuard.SHOW_LOCATION_WHICHSTYLE,\n\t\t\t\t\t\t\t\t\t\twhich);\n\t\t\t\t\t\t\t\teditor.commit();\n\t\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t\t}", "private Style createSelectedStyle(Set<FeatureId> IDs) {\n Rule selectedRule = createRule(SELECTED_COLOUR, SELECTED_COLOUR);\n selectedRule.setFilter(ff.id(IDs));\n\n Rule otherRule = createRule(LINE_COLOUR, FILL_COLOUR);\n otherRule.setElseFilter(true);\n\n FeatureTypeStyle fts = sf.createFeatureTypeStyle();\n fts.rules().add(selectedRule);\n fts.rules().add(otherRule);\n\n Style style = sf.createStyle();\n style.featureTypeStyles().add(fts);\n return style;\n}", "public void setBoardStyle(BoardStyle style) {\n\t\tboardStyle = style;\n\t}", "SoftSwitches(SoftSwitch softswitch) {\n this.softswitch = softswitch;\n }", "public static SettingsDialogFragment newInstance(boolean playSound, boolean drawOne, \n\t\t\tboolean backgroundGreen) { \n\t\tSettingsDialogFragment f = new SettingsDialogFragment(); \n\t\t// Supply \"autoCheck\" and \"autoHelp\" input as arguments \n\t\tBundle args = new Bundle(); \n\t\targs.putBoolean(\"play_sound\", playSound); \n\t\targs.putBoolean(\"draw_one\", drawOne); \n\t\targs.putBoolean(\"background_green\", backgroundGreen); \n\t\tf.setArguments(args); \n\t\treturn f; \n\t}", "@NonNull\n public static StyleResourceValueImpl copyOf(@NonNull StyleResourceValue style) {\n StyleResourceValueImpl copy = new StyleResourceValueImpl(\n style.getNamespace(),\n style.getName(),\n style.getParentStyleName(),\n style.getLibraryName());\n for (StyleItemResourceValue item : style.getDefinedItems()) {\n copy.addItem(item);\n }\n return copy;\n }", "public interface PreferenceHelper {\r\n // Preference Name\r\n String PREFERENCE_NAME = \"Embedded_Downloads_preference\";\r\n // Preference mode\r\n int PRIVATE_MODE = 0;\r\n String INITIAL_START = \"initial_start\";\r\n String WALLET_ADDRESS = \"wallet_address\";\r\n String WALLET_NAME = \"wallet_name\";\r\n String TRANSACTION_WALLET_ADDRESS = \"transaction_wallet_address\";\r\n String WALLET_POSITION =\"wallet_position\";\r\n String CALL_TRANSACTION_STATUS = \"call_transaction_status\";\r\n String CALL_INCOMING = \"call_incoming\";\r\n String CALL_OUTGOING = \"call_outgoing\";\r\n}", "public /* synthetic */ boolean lambda$bindButton$9$NavBarTuner(Preference preference, String str, ListPreference listPreference, ListPreference listPreference2, Preference preference2) {\n EditText editText = new EditText(getContext());\n Builder negativeButton = new Builder(getContext()).setTitle(preference2.getTitle()).setView(editText).setNegativeButton(17039360, null);\n $$Lambda$NavBarTuner$oFwpdLrZA2BGC8nFWvjJ8NeCnQE r0 = new OnClickListener(editText, preference, str, listPreference, listPreference2) {\n public final /* synthetic */ EditText f$1;\n public final /* synthetic */ Preference f$2;\n public final /* synthetic */ String f$3;\n public final /* synthetic */ ListPreference f$4;\n public final /* synthetic */ ListPreference f$5;\n\n {\n this.f$1 = r2;\n this.f$2 = r3;\n this.f$3 = r4;\n this.f$4 = r5;\n this.f$5 = r6;\n }\n\n public final void onClick(DialogInterface dialogInterface, int i) {\n NavBarTuner.this.lambda$bindButton$8$NavBarTuner(this.f$1, this.f$2, this.f$3, this.f$4, this.f$5, dialogInterface, i);\n }\n };\n negativeButton.setPositiveButton(17039370, r0).show();\n return true;\n }", "public void createPingOptions(PingOptions options) {\n\t}", "@Override\n public void initStyle() {\n\t// NOTE THAT EACH CLASS SHOULD CORRESPOND TO\n\t// A STYLE CLASS SPECIFIED IN THIS APPLICATION'S\n\t// CSS FILE\n \n // FOR CHANGING THE ITEMS INSIDE THE EDIT TOOLBAR\n editToolbarPane.getStyleClass().add(CLASS_EDITTOOLBAR_PANE);\n \n mapNameLabel.getStyleClass().add(CLASS_MAPNAME_LABEL);\n mapName.getStyleClass().add(CLASS_MAPNAME_TEXTFIELD);\n backgroundColorLabel.getStyleClass().add(CLASS_LABEL);\n borderColorLabel.getStyleClass().add(CLASS_LABEL);\n borderThicknessLabel.getStyleClass().add(CLASS_LABEL);\n zoomLabel.getStyleClass().add(CLASS_MAPNAME_LABEL);\n borderThicknessSlider.getStyleClass().add(CLASS_BORDER_SLIDER);\n mapZoomingSlider.getStyleClass().add(CLASS_ZOOM_SLIDER);\n buttonBox.getStyleClass().add(CLASS_PADDING);\n // FIRST THE WORKSPACE PANE\n workspace.getStyleClass().add(CLASS_BORDERED_PANE);\n }", "public TextController createStyle(ControllerCore genCode) {\n\t\tstyleTXT = new TextController(\"style\", getParentController(controlItemSCSCLC), genCode) {\n\t\t\t@Override\n\t\t\tpublic void initialize() {\n\t\t\t\tsetLinkedController(style$1LBL);\n\t\t\t\tsetProperty(\"style\");\n\t\t\t\tsuper.initialize();\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void createControl() {\n\t\t\t\tsuper.createControl();\n\t\t\t\tif (isValid()) {\n\t\t\t\t\tif (null != fieldBindManager)\n\t\t\t\t\t\tfieldBindManager = new XjcFieldBindingManager(this);\n\t\t\t\t\tgetControl().addFocusListener(new XjcFocusListener(this));\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn styleTXT;\n\t}", "public static void set(SoState state, Style style)\n { SoInt32Element.set(classStackIndexMap.get(SoPickStyleElement.class), state, style.getValue()); }", "public final synchronized void setStyle(int style){\n this.style = style;\n\n if (isLoggedIn()){\n sendCommand(\"$set style \"+style);\n filterLine(\"Style \"+style+\" set.\");\n }\n }", "private void setupSimplePreferencesScreen() {\n\n addPreferencesFromResource(R.xml.pref_weight);\n\n final Activity activity = getActivity();\n\n CustomPreferenceCategory fakeHeader = new CustomPreferenceCategory(activity);\n fakeHeader = new CustomPreferenceCategory(activity);\n fakeHeader.setTitle(R.string.pref_header_about);\n getPreferenceScreen().addPreference(fakeHeader);\n addPreferencesFromResource(R.xml.pref_about);\n\n // Bind the summaries of EditText/List/Dialog/Ringtone preferences to\n // their values. When their values change, their summaries are updated\n // to reflect the new value, per the Android Design guidelines.\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_units_key)));\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_plate_style_key)));\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_bar_weight_key)));\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_formula_key)));\n\n Preference aboutButton = (Preference)findPreference(getString(R.string.pref_about_button));\n aboutButton.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n AboutDialog aboutDialog = new AboutDialog();\n aboutDialog.show(getFragmentManager(), \"AboutDialog\");\n return true;\n }\n });\n\n Preference rateButton = (Preference)findPreference(getString(R.string.pref_rate_button));\n rateButton .setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n Uri uri = Uri.parse(\"market://details?id=\" + activity.getPackageName());\n Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);\n try {\n startActivity(goToMarket);\n } catch (ActivityNotFoundException e) {\n startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(\"http://play.google.com/store/apps/details?id=\" + activity.getPackageName())));\n }\n return true;\n }\n });\n\n final RepCheckPreferenceFragment repCheckPreferenceFragment = this;\n\n Preference resetButton = (Preference)findPreference(getString(R.string.pref_reset_button));\n resetButton.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n DialogFragment saveAsNewDialog = ConfirmResetDialog.newInstance(new ResetResponseHandler(repCheckPreferenceFragment));\n saveAsNewDialog.show(activity.getFragmentManager(), \"RenameSetDialog\");\n return true;\n }\n });\n }", "public KettlePropertiesFileDialog( Shell parent, int style ) {\n super( parent, style );\n props = PropsUI.getInstance();\n kettleProperties = null;\n }", "public CommonPopWindow setAnimationStyle(@StyleRes int animationStyle) {\n/* 207 */ this.mAnimationStyle = animationStyle;\n/* 208 */ return this;\n/* */ }", "public GUIPenStyle (List<GUITurtle> turtles, GUITurtleAreaBGInterface guiTurtleArea) {\n super(turtles, guiTurtleArea);\n setTextResources(ResourceBundle.getBundle(\"resources.guitext.PenStyle\"));\n displayInfo = getTextResources().getString(\"penstyle\");\n }", "public static PreferencesView createPreferencesView() {\n // Retrieve application preferences and attach them to their view\n // (This instance must be instanciated after dependencies)\n final LinkedHashMap<String, JPanel> panels = new LinkedHashMap<String, JPanel>(2);\n panels.put(\"General settings\", new PreferencePanel());\n\n final PreferencesView preferencesView = new PreferencesView(getFrame(), Preferences.getInstance(), panels);\n preferencesView.init();\n\n return preferencesView;\n }", "protected void fillStyleRange(StyleRange style)\n\t{\n\t\tRGB rgbForeground = cpForeground.getEffectiveColor();\n\t\tRGB rgbBackground = cpBackground.getEffectiveColor();\n\t\tRGB rgbUnderline = cpUnderline.getEffectiveColor();\n\t\tRGB rgbStrikethrough = cpStrikethrough.getEffectiveColor();\n\t\tRGB rgbBorder = cpBorder.getEffectiveColor();\n\n\t\tif(rgbBackground == null)\n\t\t{\n\t\t\trgbBackground = new RGB(255, 255, 255);\n\t\t}\n\n\t\tstyle.foreground = getColor(rgbForeground);\n\t\tstyle.background = getColor(rgbBackground);\n\t\t\n\t\tstyle.fontStyle = 0\n\t\t\t\t| (cbBold.getSelection() ? SWT.BOLD : 0)\n\t\t\t\t| (cbItalic.getSelection() ? SWT.ITALIC : 0);\n\t\t\n\t\tstyle.underline = cpUnderline.isChecked();\n\t\tstyle.underlineColor = getColor(rgbUnderline);\n\t\t\n\t\tstyle.strikeout = cpStrikethrough.isChecked();\n\t\tstyle.strikeoutColor = getColor(rgbStrikethrough);\n\t\t\n\t\tstyle.borderStyle = cpBorder.isChecked() ? SWT.BORDER_SOLID : SWT.NONE;\n\t\tstyle.borderColor = getColor(rgbBorder);\n\t}", "@Override\r\n\tprotected ToolBarManager createToolBarManager(int style) {\r\n\t\tToolBarManager toolBarManager = new ToolBarManager(style);\r\n\t\treturn toolBarManager;\r\n\t}", "Builder withPriority(int priority);", "public /* synthetic */ void lambda$onBindViewHolder$0$OPCustomShapePreference$ChooseStyleAdapter(int i, OPCustomItemEntity oPCustomItemEntity, OPCustomItemEntityViewHolder oPCustomItemEntityViewHolder, View view) {\n OPCustomShapePreference.this.mSelectedIndex = i;\n OPCustomShapePreference.this.changeAdaptive(oPCustomItemEntity.index);\n if (OPCustomShapePreference.this.mCurrentVH != null) {\n if (OPCustomShapePreference.this.mCurrentVH.imageViewMask != null) {\n OPCustomShapePreference.this.mCurrentVH.imageViewMask.setVisibility(4);\n }\n if (OPCustomShapePreference.this.mCurrentVH.imageView != null) {\n OPCustomShapePreference.this.mCurrentVH.imageView.setSelected(false);\n }\n if (OPCustomShapePreference.this.mCurrentVH.textView != null) {\n OPCustomShapePreference.this.mCurrentVH.textView.setSelected(false);\n }\n }\n oPCustomItemEntityViewHolder.imageViewMask.setVisibility(0);\n oPCustomItemEntityViewHolder.imageView.setSelected(true);\n oPCustomItemEntityViewHolder.textView.setSelected(true);\n OPCustomShapePreference.this.mCurrentVH = oPCustomItemEntityViewHolder;\n int i2 = 0;\n while (i2 < OPCustomShapePreference.this.mItemEntities.size()) {\n ((OPCustomItemEntity) OPCustomShapePreference.this.mItemEntities.get(i2)).selected = i == i2;\n i2++;\n }\n }", "public SettingsController(){\n SharedPreferences prefs = MainActivity.context.getSharedPreferences(MY_PREFERENCES, MODE_PRIVATE);\n backgroundMusicOn = prefs.getBoolean(MUSIC_PREFERENCES, true);\n soundEffectsOn= prefs.getBoolean(SOUND_EFFECTS_PREFERENCES, true);\n deckSkin=prefs.getString(DECK_SKIN_PREFERENCES, \"back1\");\n animationSpeed=prefs.getInt(ANIMATION_SPEED_PREFERENCES,ANIMATION_MEDIUM);\n }", "public Stub(int style, ActionRunnable runnable) {\n\t\t\tthis(\"\", null, style, null, runnable);\n\t\t}", "public Style createSnapPointStyle() {\n Graphic gr = styleFactory.createDefaultGraphic();\n Mark mark;\n \n Graphic gr2 = styleFactory.createDefaultGraphic();\n Mark mark2;\n \n // criar o ponto\n mark = styleFactory.getCircleMark();\n mark.setStroke(styleFactory.createStroke(filterFactory.literal(new Color(0,255,204)), filterFactory.literal(1)));\n mark.setFill(styleFactory.createFill(filterFactory.literal(new Color(0,255,204,50)))); \n gr.graphicalSymbols().clear();\n gr.graphicalSymbols().add(mark);\n gr.setSize(filterFactory.literal(30)); \n PointSymbolizer pointSymbolizer = styleFactory.createPointSymbolizer(gr, null);\n \t\n \n mark2 = styleFactory.getCircleMark();\n //mark2.setStroke(styleFactory.createStroke(filterFactory.literal(Color.RED), filterFactory.literal(1)));\n mark2.setFill(styleFactory.createFill(filterFactory.literal(Color.GRAY))); \n gr2.graphicalSymbols().clear();\n gr2.graphicalSymbols().add(mark2);\n gr2.setSize(filterFactory.literal(5)); \n PointSymbolizer pointSymbolizer2 = styleFactory.createPointSymbolizer(gr2, null);\n \n //Regra para um estilo de fei��o.\n Rule rule = styleFactory.createRule();\n \n //Adiciona o PointSymbolizer na regra.\n //rule.setName(\"Point\"); \n //rule.setFilter(filterFactory.equals(filterFactory.property(\"selected\"), filterFactory.literal(false))); \n rule.symbolizers().add(pointSymbolizer); \n rule.symbolizers().add(pointSymbolizer2);\n \n \n //Adiciona uma ou N regras em uma estilo de uma determinada fei��o.\n FeatureTypeStyle fts = styleFactory.createFeatureTypeStyle(new Rule[]{rule});\n \n //Cria o estilo (SLD).\n Style style = styleFactory.createStyle();\n style.featureTypeStyles().add(fts);\n \n return style;\n }", "protected FromToOption createOption() {\n return new FromToOption();\n }", "public GroupChatPreferencePanel() {\n // Build the UI\n createUI();\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 MultiSelectListPreference( Context context, AttributeSet attrs )\n {\n super( context, attrs );\n \n TypedArray a = context\n .obtainStyledAttributes( attrs, R.styleable.MultiSelectListPreference );\n String delimiter = a.getString( R.styleable.MultiSelectListPreference_delimiter );\n String separator = a.getString( R.styleable.MultiSelectListPreference_separator );\n a.recycle();\n \n mDelimiter = TextUtils.isEmpty( delimiter ) ? DEFAULT_DELIMITER : delimiter;\n mSeparator = TextUtils.isEmpty( separator ) ? DEFAULT_SEPARATOR : separator;\n }", "public void setStyle(String style) {\n this.style = style == null ? null : style.trim();\n }", "public void setStyle(String style) {\n this.style = style == null ? null : style.trim();\n }", "public void setStyle(String style) {\n this.style = style == null ? null : style.trim();\n }", "public Oscilloscope(Composite parent, int style) {\n\t\tthis(1, null, parent, style);\n\t}", "public Dialog(Window owner, Modality modality, StageStyle style) {\n\t\tthis(owner, modality, style, null);\n\t}", "public interface TeaserOverlaySettings {\n\n /**\n * @cm.template.api\n */\n boolean isEnabled();\n\n CMSettings getStyle();\n\n /**\n * @cm.template.api\n */\n int getPositionX();\n\n /**\n * @cm.template.api\n */\n int getPositionY();\n\n /**\n * @cm.template.api\n */\n int getWidth();\n}", "public short createPenIndirect(int style, short width, long colour)\n\t\t\tthrows IOException {\n\t\taddRecord(META_CREATEPENINDIRECT, 5);\n\t\t/* There seems to be a padding word between width and colour */\n\t\tRandomAccessStreamUtils.writeU16(out, style);\n\t\tRandomAccessStreamUtils.writeS16(out, width);\n\t\tRandomAccessStreamUtils.writeS16(out, (short) 0);\n\t\tRandomAccessStreamUtils.writeS32(out, colour);\n\t\treturn allocObject();\n\t}", "public MyScreenShotDialog(Shell parent, int style) {\r\n super(parent, style);\r\n }", "public Button addExplicitStyle(String name, String value){\n if(this.explicitStyle==null){\n this.explicitStyle = name + \":\" + value + \";\";\n }else{\n this.explicitStyle += name + \":\" + value + \";\";\n }\n return this;\n }", "private void createThemeDialog() {\n\n\t\tAlertDialog.Builder alb = new AlertDialog.Builder(this);\n\t\talb.setTitle(getString(R.string.choose_theme));\n\t\talb.setCancelable(true);\n\n\t\tString[] items;\n\t\tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {\n\t\t\titems = new String[]{getString(R.string.light), getString(R.string.dark),\n\t\t\t\t\tgetString(R.string.time), getString(R.string.system)};\n\t\t} else {\n\t\t\titems = new String[]{getString(R.string.light), getString(R.string.dark),\n\t\t\t\t\tgetString(R.string.time)};\n\t\t}\n\n\t\tAtomicInteger newTheme = new AtomicInteger(currentTheme);\n\n\t\talb.setSingleChoiceItems(items, currentTheme, (dialog, which) -> newTheme.set(which));\n\n\t\talb.setPositiveButton(getString(R.string.set_theme), (dialog, which) -> {\n\t\t\tcurrentTheme = newTheme.get();\n\t\t\tchangeTheme();\n\t\t});\n\n\t\talb.show();\n\t}", "@Generated\n @Selector(\"configurationWithTextStyle:\")\n public static native UIImageSymbolConfiguration configurationWithTextStyle(@NotNull String textStyle);", "OPTION createOPTION();", "public Builder(Set<String> shortSwitches) {\n this.shortSwitches = new HashSet<String>();\n this.shortSwitches.addAll(shortSwitches);\n longSwitches = new HashSet<String>();\n }", "private void setupSimplePreferencesScreen() {\n if (!isSimplePreferences(this)) {\n return;\n }\n\n addPreferencesFromResource(R.xml.pref_empty);\n\n addHeader(R.string.pref_header_game);\n addPreferencesFromResource(R.xml.pref_game);\n this.gameModeSettingsPreferenceScreen = getPreferenceScreen();\n\n addHeader(R.string.pref_header_other);\n addPreferencesFromResource(R.xml.pref_other);\n\n Preference key_game_mode_summary = findPreference(getResources().getString(R.string.key_game_mode_summary));\n this.key_game_mode_summary = key_game_mode_summary;\n\n Preference useCodePreference = findPreference(getResources().getString(R.string.key_use_code));\n this.useCodePreference = useCodePreference;\n useCodePreference.setOnPreferenceChangeListener(USE_CODE_PREFERENCE_LISTENER);\n\n Preference customWidthPreference = findPreference(getResources().getString(R.string.key_custom_maze_width));\n customWidthPreference.setSummary(String.valueOf(getCustomMazeWidth()));\n this.customWidthPreference = customWidthPreference;\n customWidthPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n @Override\n public boolean onPreferenceChange(Preference preference, Object value) {\n try {\n int width = Math.min(Math.max(Integer.parseInt(value.toString()), getResources().getInteger(R.integer.min_custom_maze_size)), getResources().getInteger(R.integer.max_custom_maze_size));\n synchronized (SettingsActivity.class) {\n SettingsActivity.customMazeWidth = width;\n }\n preference.setSummary(String.valueOf(width));\n } catch (NumberFormatException e) {\n }\n return true;\n }\n });\n Preference customHeightPreference = findPreference(getResources().getString(R.string.key_custom_maze_height));\n customHeightPreference.setSummary(String.valueOf(getCustomMazeHeight()));\n this.customHeightPreference = customHeightPreference;\n customHeightPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n @Override\n public boolean onPreferenceChange(Preference preference, Object value) {\n try {\n int height = Math.min(Math.max(Integer.parseInt(value.toString()), getResources().getInteger(R.integer.min_custom_maze_size)), getResources().getInteger(R.integer.max_custom_maze_size));\n synchronized (SettingsActivity.class) {\n SettingsActivity.customMazeHeight = height;\n }\n preference.setSummary(String.valueOf(height));\n } catch (NumberFormatException e) {\n }\n return true;\n }\n });\n Preference customCreatePreference = findPreference(getResources().getString(R.string.key_custom_maze_create));\n this.customCreatePreference = customCreatePreference;\n customCreatePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n Maze2D.GeneratedMaze maze = generateCustomMaze(SettingsActivity.this);\n synchronized (SettingsActivity.class) {\n SettingsActivity.loadSeedMaze = maze;\n }\n if (maze != null) {\n SettingsActivity.this.finish();\n }\n return true;\n }\n });\n Preference customSolvePreference = findPreference(getResources().getString(R.string.key_custom_maze_solve));\n this.customSolvePreference = customSolvePreference;\n customSolvePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n synchronized (SettingsActivity.class) {\n SettingsActivity.showSolution = true;\n }\n SettingsActivity.this.finish();\n return true;\n }\n });\n Preference regularCreatePreference = findPreference(getResources().getString(R.string.key_maze_create));\n this.regularCreatePreference = regularCreatePreference;\n regularCreatePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n if (MainActivity.getGameMode() == GameMode.REGULAR) {\n synchronized (SettingsActivity.class) {\n SettingsActivity.newRegularMaze = true;\n }\n } else {\n synchronized (SettingsActivity.class) {\n SettingsActivity.newFillMaze = true;\n }\n }\n SettingsActivity.this.finish();\n return true;\n }\n });\n\n ListPreference algorithmPreference = (ListPreference) findPreference(getResources().getString(R.string.key_algorithm));\n this.algorithmPreference = algorithmPreference;\n\n // Bind the summaries of EditText/List/Dialog/Ringtone preferences to\n // their values. When their values change, their summaries are updated\n // to reflect the new value, per the Android Design guidelines.\n ListPreference gameModePreference = (ListPreference) findPreference(getResources().getString(R.string.key_game_mode));\n this.gamePreference = gameModePreference;\n bindPreferenceSummaryToValue(gameModePreference);\n String[] names = GameMode.getNames(this);\n gameModePreference.setEntries(names);\n gameModePreference.setEntryValues(names);\n GameMode gameMode = MainActivity.getGameMode();\n if (gameMode != null) {\n gameModePreference.setValueIndex(gameMode.getID());\n }\n\n bindPreferenceSummaryToValue(algorithmPreference);\n names = MazeAlgorithm.getNames(this, true);\n algorithmPreference.setEntries(names);\n algorithmPreference.setEntryValues(names);\n MazeAlgorithm algorithm = MainActivity.getAlgorithm();\n if (algorithm != null) {\n algorithmPreference.setDefaultValue(algorithm.getLocalName(this));\n }\n\n SwitchPreference showTracerPreference = (SwitchPreference) findPreference(getResources().getString(R.string.key_show_tracer));\n showTracerPreference.setOnPreferenceChangeListener(TOGGLE_TRACER_PREFERENCE_LISTENER);\n showTracerPreference.setDefaultValue(MainActivity.toggleTracer());\n\n SwitchPreference squareCellsPreference = (SwitchPreference) findPreference(getResources().getString(R.string.key_square_cells));\n squareCellsPreference.setOnPreferenceChangeListener(SQUARE_CELLS_PREFERENCE_LISTENER);\n squareCellsPreference.setDefaultValue(MainActivity.squareCells());\n\n Preference recalibratePreference = findPreference(getResources().getString(R.string.key_recalibrate));\n recalibratePreference.setOnPreferenceClickListener(RECALIBRATE_PREFERENCE_LISTENER);\n\n Preference defaultTiltPreference = findPreference(getResources().getString(R.string.key_default_tilt));\n defaultTiltPreference.setOnPreferenceClickListener(DEFAULT_TILT_PREFERENCE_LISTENER);\n\n prepareGameModeGUI(MainActivity.getGameMode());\n }", "@Override\n\tprotected void setValidityStyle() {\n\t\tif (parameter.getStatus() == ParameterStatus.INVALID) {\n\t\t\tcheckBox.setStyle(Constants.BASE_CHECKBOX_STYLE + Constants.INVALID_PARAMETER_STYLE);\n\t\t\tcheckBox.setTooltip(tooltip);\n\t\t\ttooltip.setText(parameter.getStatus().getDetails());\n\t\t} else if (parameter.getStatus() == ParameterStatus.WARNING \n\t\t\t\t|| parameter.getStatus() == ParameterStatus.WARNING_RESET) {\n\t\t\tcheckBox.setStyle(Constants.BASE_CHECKBOX_STYLE + Constants.WARNING_PARAMETER_STYLE);\n\t\t\tcheckBox.setTooltip(tooltip);\n\t\t\ttooltip.setText(parameter.getStatus().getDetails());\n\t\t} else {\n\t\t\tcheckBox.setStyle(Constants.BASE_CHECKBOX_STYLE + Constants.VALID_PARAMETER_STYLE);\n\t\t\tcheckBox.setTooltip(null);\n\t\t}\n\t}", "private void createRowForNewStyleButton(Composite section)\n {\n buttonNewStyle = toolkit.createButton(section, \"New Style...\", SWT.PUSH); //$NON-NLS-1$\n buttonGridData(buttonNewStyle, SWT.TOP);\n buttonNewStyle.addSelectionListener(new SelectionListener()\n {\n public void widgetDefaultSelected(SelectionEvent e)\n {\n }\n\n public void widgetSelected(SelectionEvent e)\n {\n NewStylePopup dialog = new NewStylePopup(getShell(), documentFile, browser);\n if (dialog.open() == Dialog.OK)\n {\n if (dialog.getStyleInput() != null && dialog.getStyleInput().length() > 0)\n {\n // if the first field is not set\n if (valueToRecognizeReq == null)\n {\n valueToRecognizeReq = new Style(dialog.getStyleInput(), dialog.getRegexInput());\n reqIdComponent.setValueText(valueToRecognizeReq.getText());\n }\n else\n {\n tree.add(new Style(dialog.getStyleInput(), dialog.getRegexInput()));\n listFormat.refresh();\n }\n controller.removeDocumentType();\n updateWizard();\n }\n }\n }\n });\n }", "private PaletteSwitch() {\n \n propertySupport = new PropertyChangeSupport( this );\n }", "interface WithCntkSettings {\n /**\n * Specifies cntkSettings.\n * @param cntkSettings the cntkSettings parameter value\n * @return the next definition stage\n */\n WithCreate withCntkSettings(CNTKsettings cntkSettings);\n }", "public Group(Composite parent, int style) {\n super(parent, checkStyle(style));\n }", "protected TemplatePreferencePage() {\n \t\tsuper();\n \n \t\tsetDescription(TemplatesMessages.TemplatePreferencePage_message);\n \t}", "public void configure(T aView) { aView.setText(\"ToggleButton\"); aView.setPadding(2,2,2,2); }", "@SuppressWarnings(\"deprecation\")\n\tprivate void setupSimplePreferencesScreen() {\n\t\tif (!isSimplePreferences(this)) {\n\t\t\treturn;\n\t\t}\n\n\t\taddPreferencesFromResource(R.xml.pref_blank);\n\n\t\t// Add 'filters' preferences.\n\t\tPreferenceCategory fakeHeader = new PreferenceCategory(this);\n\n\t\t// Add 'appearance' preferences.\n\t\tfakeHeader = new PreferenceCategory(this);\n\t\tfakeHeader.setTitle(R.string.appearance);\n\t\tgetPreferenceScreen().addPreference(fakeHeader);\n\t\taddPreferencesFromResource(R.xml.pref_appearance);\n\n\t\t// Add 'text color' preferences.\n\t\tfakeHeader = new PreferenceCategory(this);\n\t\tfakeHeader.setTitle(R.string.text_color);\n\t\tgetPreferenceScreen().addPreference(fakeHeader);\n\t\taddPreferencesFromResource(R.xml.pref_textcolor);\n\n\t\t// Add 'info' preferences.\n\t\tfakeHeader = new PreferenceCategory(this);\n\t\tfakeHeader.setTitle(R.string.information);\n\t\tgetPreferenceScreen().addPreference(fakeHeader);\n\t\taddPreferencesFromResource(R.xml.pref_info);\n\n\t\t// Add others\n\t\tsetupOpenSourceInfoPreference(this, findPreference(getString(R.string.pref_info_open_source)));\n\t\tsetupVersionPref(this, findPreference(getString(R.string.pref_version)));\n\n\t}", "public interface Option {\n\n String DEFAULT_PREFIX = \"<span style='color:red;'>\";\n\n String DEFAULT_SUFFIX = \"</span>\";\n\n String DEFAULT_REPLACEMENT = \"*\";\n\n Option DECORATE = new DecorateOption(DEFAULT_PREFIX, DEFAULT_SUFFIX);\n\n Option REPLACE = new ReplaceOption(DEFAULT_REPLACEMENT);\n\n Option REMOVE = new RemoveOption();\n\n String getPrefix();\n\n String getReplacement();\n\n String getSuffix();\n\n Option prefix(String prefix);\n\n Option replacement(String replacement);\n\n Option suffix(String suffix);\n\n Option cloneOption();\n}" ]
[ "0.6184603", "0.559966", "0.55519927", "0.55332327", "0.5436978", "0.5360573", "0.52788156", "0.5248872", "0.5077765", "0.50500596", "0.4928918", "0.4888306", "0.48646456", "0.483549", "0.47149357", "0.46972573", "0.46972573", "0.4688216", "0.46856034", "0.46601498", "0.46561298", "0.46532646", "0.46474466", "0.46418256", "0.46287793", "0.45704418", "0.45500654", "0.45495173", "0.4505088", "0.447873", "0.44766855", "0.44763833", "0.44482934", "0.44482934", "0.4426703", "0.44162953", "0.44089475", "0.43574622", "0.4345954", "0.4341551", "0.43331265", "0.4327734", "0.4316858", "0.4310205", "0.43089268", "0.43049756", "0.43037087", "0.4301779", "0.42966762", "0.42862535", "0.4256209", "0.42383566", "0.4225558", "0.42192405", "0.42130834", "0.4201664", "0.41983217", "0.41775033", "0.41773546", "0.41677934", "0.4165166", "0.4162284", "0.41340312", "0.4131695", "0.413099", "0.4123666", "0.41235468", "0.41142592", "0.41131744", "0.4103583", "0.41026068", "0.40981728", "0.40976208", "0.40851495", "0.40739614", "0.40730754", "0.40717775", "0.4071177", "0.4071177", "0.4071177", "0.4066001", "0.40629825", "0.4061902", "0.40582502", "0.40466744", "0.40406778", "0.40155372", "0.40104875", "0.4006652", "0.40042624", "0.40006232", "0.39962777", "0.3987393", "0.39781922", "0.39734033", "0.39694935", "0.39684954", "0.39595103", "0.39578468", "0.3954511" ]
0.47753647
14
An action that will be executed in a feedback workflow or on finish hook
@SkylarkModule( name = "feedback.action", doc = "An action that will be executed in a feedback workflow or on_finish hook", category = SkylarkModuleCategory.TOP_LEVEL_TYPE, documented = false) public interface Action { void run(SkylarkContext<?> context) throws ValidationException, RepoException; String getName(); /** Returns a key-value ist of the options the action was instantiated with. */ ImmutableSetMultimap<String, String> describe(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void act() {\n\t\tmyAction.embodiment();\n\t}", "@Override\n\tpublic void action() {\n\t\tSystem.out.println(\"action now!\");\n\t}", "public void action() {\n action.action();\n }", "@Override\r\n\tpublic void action() {\n\t\t\r\n\t}", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "public void actionSuccessful() {\n System.out.println(\"Action performed successfully!\");\n }", "@Override\n\tpublic void action() {\n\n\t}", "public void act() \r\n {\r\n // Add your action code here.\r\n }", "public void act() \r\n {\r\n // Add your action code here.\r\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "@Override\r\n\tpublic void execute(ActionContext ctx) {\n\t\t\r\n\t}", "public void actionOffered();", "public void doInitialAction(){}", "void actionCompleted(ActionLookupData actionLookupData);", "@Override\n protected void doAct() {\n }", "@Override\n public void action() {\n System.out.println(\"do some thing...\");\n }", "public void performAction() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "@Override\r\n\tpublic Message doAction() {\n\t\treturn null;\r\n\t}", "public void doAction(){}", "public void act() \n {\n // Add your action code here.\n tempoUp();\n }", "protected void takeAction() {\n lastAction = System.currentTimeMillis();\n }", "@Override\n public void action() {\n System.out.println(\"Matchmaker Behaviour\");\n addBehaviour(new RequestToMatchMakerBehaviour());\n\n }", "public void executeAction( String actionInfo );", "@Override\n\tpublic void step(int actionType) {\n\n\t}", "public abstract void onAction();", "public void action() {\n }", "public QFeedback<S> takedAction();", "@Override\n\tprotected void compute() {\n\t\tSystem.out.println(\"This is an action\");\n\t}", "public void handleAction(Action action){\n\t\tSystem.out.println(action.getActionType().getName() + \" : \" + action.getValue());\n\t\tDroneClientMain.runCommand(\"python george_helper.py \" + action.getActionType().getName().toLowerCase() + \" \" + action.getValue());\n\t}", "void noteActionEvaluationStarted(ActionLookupData actionLookupData, Action action);", "public void doActionAfter(DefaultInstanceActionCmd actionModel) {\n persistenceInstance(actionModel);\n }", "interface Action {\n /**\n * Executes the action. Called upon state entry or exit by an automaton.\n */\n void execute();\n }", "@Override\r\n\tpublic void act() {\n\t\tausgeben();\r\n\t}", "public void run() {\n long startTime = 0;\n if (action.getClass().getName().contains(\"TooAction\")) {\n startTime = System.currentTimeMillis();\n LOG.log(Level.WARNING, \"Sending a ToO alert...\");\n }\n\n action.doTriggerAction(change, handback);\n\n // Record the end time and warn if it took too long.\n if (startTime != 0) {\n long curTime = System.currentTimeMillis();\n LOG.log(Level.WARNING, \"Sent ToO alert\");\n\n long elapsed = curTime - startTime;\n if (elapsed > 5000) {\n LOG.log(Level.WARNING, \"Long delay sending ToO alert: \" + elapsed);\n }\n }\n\n }", "public interface IActionCallBack {\n\n /**\n *\n * @param action action\n * @return will be execute this action\n */\n boolean onPreExecute(IAction action);\n\n /**\n *\n * @param action\n * @param result\n */\n void onExecuteDone(IAction action, ActionResult result);\n\n void onExecuteCancel(IAction action);\n\n}", "public void act() {\n\t}", "@Override\n\t\t\tpublic void dealWithCustomAction(Context context, UMessage msg)\n\t\t\t{\n\t\t\t}", "public abstract void action();", "public abstract void action();", "public abstract void action();", "public abstract void action();", "void onCompleteActionWithSuccess(SmartEvent smartEvent);", "@Override\n\tpublic void doExecute(Runnable action) {\n\t\t\n\t}", "private void entryAction() {\n\t}", "@Override\n\tpublic void onActionStart(int action) {\n\t\t\n\t}", "@Override\n public void act() {\n }", "public void performAction();", "protected abstract void actionExecuted(SUT system, State state, Action action);", "void determineNextAction();", "abstract public void performAction();", "public void dispatchSubmit(Action action) {\n this.handler.sendMessage(this.handler.obtainMessage(1, action));\n }", "@Override\n public void onSupportActionModeFinished(ActionMode mode) {\n }", "@Override\n\tpublic void afterAction(String method, HttpServletRequest request, HttpServletResponse response) {\n\t}", "public void run(IAction action) {\n\t\tMessageDialog.openInformation(window.getShell(), \"AccTrace\",\n\t\t\t\t\"Hello, Eclipse world\");\n\t}", "public interface DebugAction {\n void run(Context context, Callback callback);\n\n String getLabel();\n\n public interface Callback {\n void done(boolean success, String message);\n }\n}", "@Override\n\tpublic void postProcessAction(GwtEvent e) {\n\t\t\n\t}", "public void createAction() {\n }", "public void act() \n {\n // Add your action code here.\n klawisze();\n stawiaj();\n pobierzJablka();\n }", "@Override\n\tpublic void action() {\n\t\tACLMessage msgRx = myAgent.receive();\n\t\tif (msgRx != null && msgRx.getPerformative() == ACLMessage.REQUEST) {\n\t\t\tContentManager contentManager = myAgent.getContentManager();\n\t\t\tSystem.out.println(\"RECEIVED = \" + msgRx.getContent());\n\t\t\tmsgRx.setLanguage(\"fipa-sl\");\n\t\t\tmsgRx.setOntology(\"blocks-ontology\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tContentElementList elementList = (ContentElementList) contentManager\n\t\t\t\t\t\t.extractContent(msgRx);\n\n\t\t\t\tIterator elementIterator = elementList.iterator();\n\n\t\t\t\twhile (elementIterator.hasNext()) {\n\t\t\t\t\tAction action = (Action) elementIterator.next();\n\t\t\t\t\t((Environment) myAgent).getWorld().getActionList().add((Executable) (action.getAction()));\n//\t\t\t\t\t((Executable) (action.getAction()))\n//\t\t\t\t\t\t\t.execute((Environment) myAgent);\n\t\t\t\t}\n\n\t\t\t} catch (UngroundedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (CodecException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (OntologyException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else {\n\t\t\tblock();\n\t\t}\n\t\t\n\t}", "public void processAction(CIDAction action);", "protected abstract String endActionString();", "protected abstract void after();", "public String action() { \n return \"Player capped.\";\n }", "@Override\r\n\tpublic void visit(SimpleAction action)\r\n\t{\n\t\t\r\n\t}", "public void initiateAction() {\r\n\t\t// TODO Auto-generated method stub\t\r\n\t}", "public void action() {\n store.readNextArrival();\n Employee employee = (Employee)this.getActor();\n checkout = store.firstUnmannedCheckout();\n checkout.setCashier(employee);\n checkout.setOpen(true);\n int quittingTime = employee.getQuittingTime();\n Event event = new ShiftCompletedEvent(quittingTime, employee, checkout);\n store.getEventList().addEvent(event);\n \n System.out.printf(\"Time %d: Cashier %d arrives (Speed %d, quitting time %d, checkout %d)\\n\",\n time,\n employee.getId(),\n employee.getSpeed(),\n employee.getQuittingTime(),\n checkout.getIndex());\n }", "public void setAction(String action) { this.action = action; }", "protected void runAfterStep() {}", "private void exitAction() {\n\t}", "void onCompleteActionWithError(SmartEvent smartEvent);", "public void executeAction()\n\t{\t\t\n\t\tthis.getUser().setHealth(this.getUser().getHealth()+HEALTH);\n\t}", "String getOnAction();", "@Override\n\tpublic void doAction(String action) {\n\t\tthis.action = action;\n\t\t\n\t\tthis.gameController.pause();\n\t}", "public void act()\n {\n trackTime();\n showScore();\n \n }", "Action execute(Context context);", "public void act() \r\n {\r\n // Add your action code here.\r\n tembak();\r\n gerakKiri();\r\n gerakKanan();\r\n \r\n \r\n \r\n }", "public void performSubmit(Action action) {\n performSubmit(action, true);\n }", "@Override\n public void onResult(final AIResponse result) {\n DobbyLog.i(\"Action: \" + result.getResult().getAction());\n }", "public void action(BotInstance bot, Message message);", "public void act();", "@Override\n\tpublic void newAction() {\n\t\t\n\t}", "public void act() \r\n {\n }", "public void act() \r\n {\n }", "public void act() \r\n {\n }", "public void action(){\n turn.sendMsg(turn.getController().getTurnOwner().getName()+\"'s turn!\");\n if(turn.getPlayer().isDown()){\n turn.setPhase(new RecoveryPhase());\n }else {\n turn.setPhase(new StarsPhase());\n }\n }", "void actionProcessed(Action action, ActionResult res, int round);", "private void m43014d() {\n Intent intent = new Intent(\"com.tonyodev.fetch.action_done\");\n intent.putExtra(\"com.tonyodev.fetch.extra_id\", this.f40230a);\n this.f40237h.mo5314a(intent);\n }", "public void action() {\n MessageTemplate template = MessageTemplate.MatchPerformative(CommunicationHelper.GUI_MESSAGE);\n ACLMessage msg = myAgent.receive(template);\n\n if (msg != null) {\n\n /*-------- DISPLAYING MESSAGE -------*/\n try {\n\n String message = (String) msg.getContentObject();\n\n // TODO temporary\n if (message.equals(\"DistributorAgent - NEXT_SIMSTEP\")) {\n \tguiAgent.nextAutoSimStep();\n // wykorzystywane do sim GOD\n // startuje timer, zeby ten zrobil nextSimstep i statystyki\n // zaraz potem timer trzeba zatrzymac\n }\n\n guiAgent.displayMessage(message);\n\n } catch (UnreadableException e) {\n logger.error(this.guiAgent.getLocalName() + \" - UnreadableException \" + e.getMessage());\n }\n } else {\n\n block();\n }\n }", "public void act() \n {\n // Add your action code here.\n MyWorld world = (MyWorld) getWorld();\n jefe = world.comprobarJefe();\n \n \n explotar();\n \n if(jefe)\n {\n girarHaciaEnemigo();\n movimientoPegadoAJefe();\n }\n }", "@Override\n\tpublic void setAction() {\n\t}", "private void checkAction() {\n if (action == Consts.CREATE_ACTION) {\n createAction();\n } else {\n updateAction(getArguments().getString(\"taskId\"));\n }\n }" ]
[ "0.7197444", "0.6927678", "0.6811029", "0.6797606", "0.6751418", "0.6751418", "0.6751418", "0.6661283", "0.6653257", "0.65965325", "0.65965325", "0.6543253", "0.6543253", "0.6543253", "0.6543253", "0.6543253", "0.6543253", "0.6543253", "0.6543253", "0.65342146", "0.650719", "0.64731735", "0.64671826", "0.63755757", "0.6367441", "0.63495255", "0.63461596", "0.6340967", "0.634083", "0.631809", "0.63147914", "0.6300837", "0.6300246", "0.6297738", "0.6286914", "0.6275479", "0.62683743", "0.6258972", "0.6243712", "0.62431186", "0.620736", "0.6187002", "0.61645937", "0.6123652", "0.61232555", "0.61149645", "0.6108404", "0.6108404", "0.6108404", "0.6108404", "0.609477", "0.6080192", "0.60677344", "0.60661906", "0.6065537", "0.604476", "0.60348743", "0.60323757", "0.60101956", "0.60048497", "0.5971097", "0.5964979", "0.59631634", "0.5957338", "0.5956126", "0.5952982", "0.59373605", "0.59235793", "0.5919802", "0.59177226", "0.5906333", "0.5905918", "0.58911663", "0.5877054", "0.587547", "0.58691746", "0.5867439", "0.5859829", "0.58518064", "0.5851511", "0.5847062", "0.58411556", "0.5826772", "0.58211803", "0.5820942", "0.58144605", "0.5811214", "0.58092636", "0.57979894", "0.5790752", "0.5784735", "0.5784735", "0.5784735", "0.57798856", "0.5774435", "0.5769655", "0.57636297", "0.5763591", "0.57483685", "0.5741956" ]
0.73044837
0
Returns a keyvalue ist of the options the action was instantiated with.
ImmutableSetMultimap<String, String> describe();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Object get(String key) {\n return options.get(key);\n }", "String getOptionsOrThrow(\n String key);", "String getOptionsOrThrow(\n String key);", "String getOptionsOrThrow(\n String key);", "@NonNull\n\t\tMap<String, String> getOptions();", "public Hashtable<String, Object> getOptions() {\n return options;\n }", "Map getOptions();", "java.util.Map<String, String>\n getOptionsMap();", "java.util.Map<String, String>\n getOptionsMap();", "java.util.Map<String, String>\n getOptionsMap();", "public abstract String[] getOptions();", "public abstract Options getOptions();", "public String getOptions() {\n return this.options;\n }", "@Override\n\n public String getOptionsOrThrow(\n String key) {\n if (key == null) { throw new NullPointerException(); }\n java.util.Map<String, String> map =\n internalGetOptions().getMap();\n if (!map.containsKey(key)) {\n throw new IllegalArgumentException();\n }\n return map.get(key);\n }", "@Override\n\n public String getOptionsOrThrow(\n String key) {\n if (key == null) { throw new NullPointerException(); }\n java.util.Map<String, String> map =\n internalGetOptions().getMap();\n if (!map.containsKey(key)) {\n throw new IllegalArgumentException();\n }\n return map.get(key);\n }", "@Override\n\n public String getOptionsOrThrow(\n String key) {\n if (key == null) { throw new NullPointerException(); }\n java.util.Map<String, String> map =\n internalGetOptions().getMap();\n if (!map.containsKey(key)) {\n throw new IllegalArgumentException();\n }\n return map.get(key);\n }", "@Override\n\n public String getOptionsOrThrow(\n String key) {\n if (key == null) { throw new NullPointerException(); }\n java.util.Map<String, String> map =\n internalGetOptions().getMap();\n if (!map.containsKey(key)) {\n throw new IllegalArgumentException();\n }\n return map.get(key);\n }", "@Override\n\n public String getOptionsOrThrow(\n String key) {\n if (key == null) { throw new NullPointerException(); }\n java.util.Map<String, String> map =\n internalGetOptions().getMap();\n if (!map.containsKey(key)) {\n throw new IllegalArgumentException();\n }\n return map.get(key);\n }", "@Override\n\n public String getOptionsOrThrow(\n String key) {\n if (key == null) { throw new NullPointerException(); }\n java.util.Map<String, String> map =\n internalGetOptions().getMap();\n if (!map.containsKey(key)) {\n throw new IllegalArgumentException();\n }\n return map.get(key);\n }", "@Override\n\n public java.util.Map<String, String> getOptionsMap() {\n return internalGetOptions().getMap();\n }", "@Override\n\n public java.util.Map<String, String> getOptionsMap() {\n return internalGetOptions().getMap();\n }", "@Override\n\n public java.util.Map<String, String> getOptionsMap() {\n return internalGetOptions().getMap();\n }", "public String[][] getOptions() {\r\n return options;\r\n }", "public Options getOptions() {\n return options;\n }", "public Collection getOptions() {\n return options;\n\n }", "@Override\n\n public java.util.Map<String, String> getOptionsMap() {\n return internalGetOptions().getMap();\n }", "@Override\n\n public java.util.Map<String, String> getOptionsMap() {\n return internalGetOptions().getMap();\n }", "@Override\n\n public java.util.Map<String, String> getOptionsMap() {\n return internalGetOptions().getMap();\n }", "public String[] getOptions() {\n\t\tString[] EvaluatorOptions = new String[0];\n\t\tString[] SearchOptions = new String[0];\n\t\tint current = 0;\n\n//\t\tif (m_ASEvaluator instanceof OptionHandler) {\n//\t\t\tEvaluatorOptions = ((OptionHandler) m_ASEvaluator).getOptions();\n//\t\t}\n//\n//\t\tif (m_ASSearch instanceof OptionHandler) {\n//\t\t\tSearchOptions = ((OptionHandler) m_ASSearch).getOptions();\n//\t\t}\n\n\t\tString[] setOptions = new String[10];\n//\t\tsetOptions[current++] = \"-E\";\n//\t\tsetOptions[current++] = getEvaluator().getClass().getName() + \" \"\n//\t\t\t\t+ Utils.joinOptions(EvaluatorOptions);\n//\n//\t\tsetOptions[current++] = \"-S\";\n//\t\tsetOptions[current++] = getSearch().getClass().getName() + \" \"\n//\t\t\t\t+ Utils.joinOptions(SearchOptions);\n//\t\t\n\t\t setOptions[current++] = \"-k\";\n\t\t setOptions[current++] = \"\" + getK();\n\t\t setOptions[current++] = \"-p\";\n\t\t setOptions[current++] = \"\" + getminF_Correlation();\n\n\t\twhile (current < setOptions.length) {\n\t\t\tsetOptions[current++] = \"\";\n\t\t}\n\n\t\treturn setOptions;\n\t}", "public String getOption()\r\n {\r\n return ((COSString)option.getObject( 0 ) ).getString();\r\n }", "String getOption();", "public String getOptionsAsString() {\n\t\tStringBuilder buf = new StringBuilder();\n\t\tfor (int i = 0; i <propertyKeys.size(); i++) {\n\t\t\tString key = propertyKeys.get(i);\n\t\t\tif (!runtimeKeys.get(i))\n buf.append(key + \" : \" + getOption(key)).append(\"\\r\\n\");\n\t\t}\n\t\tfor (int i = 0; i <propertyKeys.size(); i++) {\n\t\t\tString key = propertyKeys.get(i);\n\t\t\tif (runtimeKeys.get(i))\n buf.append(\"* \" + key + \" : \" + getOption(key)).append(\"\\r\\n\");\n\t\t}\n\t\treturn buf.toString();\n\t}", "public List getOptions() {\n\t\treturn currentOption;\n\t}", "public Object getOption(String key) {\n\t\tint index = propertyKeys.indexOf(key);\n\t\tif (index == -1)\n throw new IllegalArgumentException(\"Unknown option \" + key);\n\t\treturn currentOption.get(index);\n\t}", "@Override\n\tpublic Properties getOptions() {\n\t\treturn options;\n\t}", "public com.coda.www.efinance.schemas.elementmaster.elementmaster_6_0.webservice.GetRequestGetOptions getGetOptions() {\r\n return getOptions;\r\n }", "@java.lang.Override\n public java.lang.String getOptionsOrThrow(java.lang.String key) {\n if (key == null) {\n throw new NullPointerException(\"map key\");\n }\n java.util.Map<java.lang.String, java.lang.String> map = internalGetOptions().getMap();\n if (!map.containsKey(key)) {\n throw new java.lang.IllegalArgumentException();\n }\n return map.get(key);\n }", "@java.lang.Override\n public java.lang.String getOptionsOrThrow(java.lang.String key) {\n if (key == null) {\n throw new NullPointerException(\"map key\");\n }\n java.util.Map<java.lang.String, java.lang.String> map = internalGetOptions().getMap();\n if (!map.containsKey(key)) {\n throw new java.lang.IllegalArgumentException();\n }\n return map.get(key);\n }", "@java.lang.Override\n public java.util.Map<java.lang.String, java.lang.String> getOptionsMap() {\n return internalGetOptions().getMap();\n }", "go.micro.runtime.RuntimeOuterClass.ListOptions getOptions();", "@java.lang.Override\n public java.util.Map<java.lang.String, java.lang.String> getOptionsMap() {\n return internalGetOptions().getMap();\n }", "public OptionsHandle getOptionsHandle() {\r\n\t\tOptionsHandle myOps = new OptionsHandle(this, 2);\r\n\t\tmyOps.addStringOption(\"dna\", \"atgc\",\r\n\t\t\t\t\"Alphabet used by the sequence.\");\r\n\t\tmyOps.addIntOption(\"order\", 0, \"Order of Markov Model\");\r\n\r\n\t\treturn myOps;\r\n\t}", "@Override\n\tpublic IKeyword option() { return option; }", "public GbossValueSet getOptions() {\n return BigrGbossData.getValueSetAlphabetized(ArtsConstants.VALUE_SET_PROCEDURE_HIERARCHY);\n }", "@Override\n\n public String getOptionsOrDefault(\n String key,\n String defaultValue) {\n if (key == null) { throw new NullPointerException(); }\n java.util.Map<String, String> map =\n internalGetOptions().getMap();\n return map.containsKey(key) ? map.get(key) : defaultValue;\n }", "@Override\n\n public String getOptionsOrDefault(\n String key,\n String defaultValue) {\n if (key == null) { throw new NullPointerException(); }\n java.util.Map<String, String> map =\n internalGetOptions().getMap();\n return map.containsKey(key) ? map.get(key) : defaultValue;\n }", "@Override\n\n public String getOptionsOrDefault(\n String key,\n String defaultValue) {\n if (key == null) { throw new NullPointerException(); }\n java.util.Map<String, String> map =\n internalGetOptions().getMap();\n return map.containsKey(key) ? map.get(key) : defaultValue;\n }", "@Override\n public String[] getOptions() {\n\n Vector<String> result = new Vector<String>();\n\n result.add(\"-K\");\n result.add(\"\" + m_kBEPPConstant);\n\n if (getL()) {\n result.add(\"-L\");\n }\n\n if (getUnbiasedEstimate()) {\n result.add(\"-U\");\n }\n\n if (getB()) {\n result.add(\"-B\");\n }\n\n result.add(\"-Ba\");\n result.add(\"\" + m_bagInstanceMultiplier);\n\n result.add(\"-M\");\n result.add(\"\" + m_SplitMethod);\n\n result.add(\"-A\");\n result.add(\"\" + m_AttributesToSplit);\n\n result.add(\"-An\");\n result.add(\"\" + m_AttributeSplitChoices);\n\n Collections.addAll(result, super.getOptions());\n\n return result.toArray(new String[result.size()]);\n }", "public DeleteTOptions getOptions() {\n return this.options;\n }", "public Options getOptions(String optionsName);", "@JsonGetter(\"parameters\")\n public ActionParameters getActionValues() {\n return new ActionParameters()\n .setTarget(getTarget() != null ? getTarget() : getName())\n .setValue(getValue())\n .setLabel(getLabel())\n .setServerAction(getServerAction())\n .setTargetAction(getTargetAction());\n }", "public int getOptions() {\n\t\treturn this.options;\n\t}", "@Override\n\n public String getOptionsOrDefault(\n String key,\n String defaultValue) {\n if (key == null) { throw new NullPointerException(); }\n java.util.Map<String, String> map =\n internalGetOptions().getMap();\n return map.containsKey(key) ? map.get(key) : defaultValue;\n }", "@Override\n\n public String getOptionsOrDefault(\n String key,\n String defaultValue) {\n if (key == null) { throw new NullPointerException(); }\n java.util.Map<String, String> map =\n internalGetOptions().getMap();\n return map.containsKey(key) ? map.get(key) : defaultValue;\n }", "@Override\n\n public String getOptionsOrDefault(\n String key,\n String defaultValue) {\n if (key == null) { throw new NullPointerException(); }\n java.util.Map<String, String> map =\n internalGetOptions().getMap();\n return map.containsKey(key) ? map.get(key) : defaultValue;\n }", "public FreeTOptions getOptions() {\n return this.options;\n }", "public Iterator getOptions() {\n synchronized (options) {\n return Collections.unmodifiableList(new ArrayList(options)).iterator();\n }\n }", "public static Options getOptions() {\n return OPTIONS;\n }", "public short getOptions()\n {\n return field_1_options;\n }", "public ArrayList<String> getOptionValues() {\n return optionValues;\n }", "private static Options getOptions() {\n\t\tOptions options = new Options();\n\t\toptions.addOption(OptGenMode, \"generate\", false,\n\t\t\t\t\"generate private key sharing\");\n\t\toptions.addOption(\"h\", \"help\", false, \"Print help.\");\n\t\toptions.addOption(OptionBuilder.withType(Integer.class)\n\t\t\t\t.withLongOpt(\"shares\")\n\t\t\t\t.withDescription(\"number of shares to generate\").hasArg()\n\t\t\t\t.withArgName(\"int\").create(OptShares));\n\t\toptions.addOption(OptionBuilder.withType(Integer.class)\n\t\t\t\t.withLongOpt(\"threshold\")\n\t\t\t\t.withDescription(\"number of requires shares\").hasArg()\n\t\t\t\t.withArgName(\"int\").create(OptThreshold));\n\t\treturn options;\n\n\t}", "public String[] getOptions() {\n return m_Classifier.getOptions();\n }", "@Override\n\tpublic String[] getOptions() {\n\t\treturn null;\n\t}", "@Nullable\n/* */ public Options getOptions() {\n/* 67 */ return this.options;\n/* */ }", "public List<Opt> getOptions() {\n\t\treturn options;\n\t}", "public static ApplicationOptions getOptions (){\n\t\treturn _applicationOptions;\n\t}", "private static Options getOptions() {\n Option inputOption = Option.builder(\"i\")\n .longOpt(\"input\")\n .hasArg()\n .argName(\"input file\")\n .required()\n .desc(\"The JSON input filename\")\n .build();\n Option outputOption = Option.builder(\"o\")\n .longOpt(\"output\")\n .hasArg()\n .argName(\"output file\")\n .required()\n .desc(\"The Drupal output filename\")\n .build();\n Option configOption = Option.builder(\"c\")\n .longOpt(\"config\")\n .hasArg()\n .argName(\"properties file\")\n .required()\n .desc(\"The properties file for containing Google credentials\")\n .build();\n Option helpOption = Option.builder(\"h\")\n .longOpt(\"help\")\n .desc(\"Print this message\")\n .build();\n\n Options options = new Options();\n options.addOption(inputOption);\n options.addOption(outputOption);\n options.addOption(configOption);\n options.addOption(helpOption);\n\n return options;\n }", "public static OptionValues getInitialOptions() {\n return Graal.getRequiredCapability(OptionValues.class);\n }", "@SuppressWarnings(\"rawtypes\")\n\tpublic abstract Enumeration listOptions();", "public String getExtraOptions() {\n return this.extraOptions;\n }", "@Override\n\tpublic String[] getOptions() {\n\t\tVector<String> result = new Vector<String>();\n\n\t\tresult.add(\"-populationSize\");\n\t\tresult.add(\"\" + populationSize);\n\n\t\tresult.add(\"-initialMaxDepth\");\n\t\tresult.add(\"\" + maxDepth);\n\n\t\tCollections.addAll(result, super.getOptions());\n\n\t\treturn result.toArray(new String[result.size()]);\n\t}", "public CreateUpdateOptions options() {\n return this.innerProperties() == null ? null : this.innerProperties().options();\n }", "protected Component getOptionsPanel() {\n return _options;\n }", "public MountTOptions getOptions() {\n return this.options;\n }", "String getOptionsOrDefault(\n String key,\n String defaultValue);", "String getOptionsOrDefault(\n String key,\n String defaultValue);", "String getOptionsOrDefault(\n String key,\n String defaultValue);", "public CreateFileTOptions getOptions() {\n return this.options;\n }", "public int getOption() {\n return option;\n }", "public int getOption() {\n return option;\n }", "public T getSelectedValueOption() {\r\n return selectedValueOption;\r\n }", "public Preferences getActionPreferences() {\n return actionPrefs;\n }", "public Options getActiveOpts() {\n return activeOpts;\n }", "public LsOptions getOptions() {\n return options;\n }", "public List<String> getOptionsNames();", "public String getOptionName()\n {\n return optionName;\n }", "public Collection<String> getOptions() {\n return options==null? Collections.emptyList() : Arrays.asList(options);\n }", "public Set<String> getOptions() {\n return options;\n }", "public synchronized Iterator<String> getAllOptions() {\n\t\tSet<String> names = optionTable.keySet();\n\t\tIterator<String> itr = names.iterator();\n\t\treturn itr;\n\t}", "public LinkedList<String> getActionArgs() {\n\t\treturn actionArgs;\n\t}", "public String[] getOptions() {\n return argv;\n }", "protected String getExtraOptionsParameter() {\n if (extraOptions != null && extraOptions.length() != 0) {\n return extraOptions;\n } else {\n return null;\n }\n }", "@Override\n\tabstract protected List<String> getOptionsList();", "public String getOptionAsString(String key) {\n\t\treturn getOption(key).toString();\n\t}", "public String getOptionSelection(){\r\n\t\treturn optionSelection;\r\n\t}", "go.micro.runtime.RuntimeOuterClass.CreateOptions getOptions();", "@GET\n @Path(\"/\" + AggregatorOptionListContainer.OPTIONS)\n @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })\n @ApiOperation(value = \"Get options over aggregator conext.\", httpMethod = \"GET\", response = AggregatorOptionListContainer.class)\n @ApiResponses(value = {\n @ApiResponse(code = 200, message = \"OK (Response containing a list of all available options)\")\n })\n public AggregatorOptionListContainer getGETOptions() {\n return getOptions();\n }", "@Override\n public String[] getOptions() {\n List<String> options = new ArrayList<String>();\n\n for (String opt : getJobOptionsOnly()) {\n options.add(opt);\n }\n\n return options.toArray(new String[options.size()]);\n }", "public String getOptionText() {\n return option;\n }", "OPTION createOPTION();", "public IOptionsContainer getContainer();" ]
[ "0.6788512", "0.6733759", "0.6733759", "0.6733759", "0.6658895", "0.6652058", "0.66038376", "0.6470387", "0.6470387", "0.6470387", "0.64567673", "0.6455768", "0.6330727", "0.62662834", "0.62662834", "0.62662834", "0.6237033", "0.6237033", "0.6237033", "0.6178986", "0.6178986", "0.6178986", "0.61775583", "0.6152338", "0.6122071", "0.6111656", "0.6111656", "0.6111656", "0.60922307", "0.6015204", "0.6007793", "0.59926265", "0.5978783", "0.59753156", "0.59273714", "0.5919995", "0.58569944", "0.5832555", "0.5823281", "0.581905", "0.5805922", "0.58007735", "0.5794436", "0.5781245", "0.5780349", "0.5780349", "0.5780349", "0.57770514", "0.5762877", "0.57588893", "0.57561475", "0.57491255", "0.5733075", "0.5733075", "0.5733075", "0.57210964", "0.5712598", "0.57091683", "0.564829", "0.56408215", "0.56182736", "0.55969644", "0.559116", "0.55787146", "0.557127", "0.5569166", "0.5529903", "0.55238974", "0.5523038", "0.55226874", "0.5499569", "0.5497674", "0.5490302", "0.54902256", "0.5488271", "0.5488271", "0.5488271", "0.54655564", "0.5457996", "0.5457996", "0.54095715", "0.5384556", "0.5381837", "0.5380507", "0.53761476", "0.53667885", "0.5364664", "0.5356277", "0.53428817", "0.53291297", "0.5324631", "0.53201777", "0.53131515", "0.5303247", "0.5291859", "0.527999", "0.52736443", "0.5259969", "0.5246419", "0.5239218", "0.5234474" ]
0.0
-1
/ JADX WARNING: Code restructure failed: missing block: B:2:0x0011, code lost: r1 = (a.b.k.r) r1; / Code decompiled incorrectly, please refer to instructions dump.
public void onNestedScrollAccepted(android.view.View r1, android.view.View r2, int r3) { /* r0 = this; a.f.k.h r1 = r0.B r1.f320a = r3 int r1 = r0.getActionBarHideOffset() r0.m = r1 r0.h() androidx.appcompat.widget.ActionBarOverlayLayout$d r1 = r0.v if (r1 == 0) goto L_0x001d a.b.k.r r1 = (a.b.k.r) r1 a.b.o.g r2 = r1.u if (r2 == 0) goto L_0x001d r2.a() r2 = 0 r1.u = r2 L_0x001d: return */ throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.widget.ActionBarOverlayLayout.onNestedScrollAccepted(android.view.View, android.view.View, int):void"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private p000a.p001a.p002a.p003a.C0916s m1655b(p000a.p001a.p002a.p003a.p022i.p024b.C0112x r7, p000a.p001a.p002a.p003a.p034n.C0157e r8) {\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/293907205.run(Unknown Source)\n*/\n /*\n r6 = this;\n r0 = r7.m321a();\n r7 = r7.m322b();\n r1 = 0;\n r2 = r1;\n L_0x000a:\n r3 = r6.f1533u;\n r3 = r3 + 1;\n r6.f1533u = r3;\n r0.m2803e();\n r3 = r0.mo2010a();\n if (r3 != 0) goto L_0x0032;\n L_0x0019:\n r7 = r6.f1513a;\n r8 = \"Cannot retry non-repeatable request\";\n r7.m260a(r8);\n if (r2 == 0) goto L_0x002a;\n L_0x0022:\n r7 = new a.a.a.a.b.m;\n r8 = \"Cannot retry request with a non-repeatable request entity. The cause lists the reason the original request failed.\";\n r7.<init>(r8, r2);\n throw r7;\n L_0x002a:\n r7 = new a.a.a.a.b.m;\n r8 = \"Cannot retry request with a non-repeatable request entity.\";\n r7.<init>(r8);\n throw r7;\n L_0x0032:\n r2 = r6.f1529q;\t Catch:{ IOException -> 0x0086 }\n r2 = r2.mo1932c();\t Catch:{ IOException -> 0x0086 }\n if (r2 != 0) goto L_0x0057;\t Catch:{ IOException -> 0x0086 }\n L_0x003a:\n r2 = r7.mo15e();\t Catch:{ IOException -> 0x0086 }\n if (r2 != 0) goto L_0x004f;\t Catch:{ IOException -> 0x0086 }\n L_0x0040:\n r2 = r6.f1513a;\t Catch:{ IOException -> 0x0086 }\n r3 = \"Reopening the direct connection.\";\t Catch:{ IOException -> 0x0086 }\n r2.m260a(r3);\t Catch:{ IOException -> 0x0086 }\n r2 = r6.f1529q;\t Catch:{ IOException -> 0x0086 }\n r3 = r6.f1528p;\t Catch:{ IOException -> 0x0086 }\n r2.mo2023a(r7, r8, r3);\t Catch:{ IOException -> 0x0086 }\n goto L_0x0057;\t Catch:{ IOException -> 0x0086 }\n L_0x004f:\n r2 = r6.f1513a;\t Catch:{ IOException -> 0x0086 }\n r3 = \"Proxied connection. Need to start over.\";\t Catch:{ IOException -> 0x0086 }\n r2.m260a(r3);\t Catch:{ IOException -> 0x0086 }\n goto L_0x0085;\t Catch:{ IOException -> 0x0086 }\n L_0x0057:\n r2 = r6.f1513a;\t Catch:{ IOException -> 0x0086 }\n r2 = r2.m262a();\t Catch:{ IOException -> 0x0086 }\n if (r2 == 0) goto L_0x007c;\t Catch:{ IOException -> 0x0086 }\n L_0x005f:\n r2 = r6.f1513a;\t Catch:{ IOException -> 0x0086 }\n r3 = new java.lang.StringBuilder;\t Catch:{ IOException -> 0x0086 }\n r3.<init>();\t Catch:{ IOException -> 0x0086 }\n r4 = \"Attempt \";\t Catch:{ IOException -> 0x0086 }\n r3.append(r4);\t Catch:{ IOException -> 0x0086 }\n r4 = r6.f1533u;\t Catch:{ IOException -> 0x0086 }\n r3.append(r4);\t Catch:{ IOException -> 0x0086 }\n r4 = \" to execute request\";\t Catch:{ IOException -> 0x0086 }\n r3.append(r4);\t Catch:{ IOException -> 0x0086 }\n r3 = r3.toString();\t Catch:{ IOException -> 0x0086 }\n r2.m260a(r3);\t Catch:{ IOException -> 0x0086 }\n L_0x007c:\n r2 = r6.f1518f;\t Catch:{ IOException -> 0x0086 }\n r3 = r6.f1529q;\t Catch:{ IOException -> 0x0086 }\n r2 = r2.m464a(r0, r3, r8);\t Catch:{ IOException -> 0x0086 }\n r1 = r2;\n L_0x0085:\n return r1;\n L_0x0086:\n r2 = move-exception;\n r3 = r6.f1513a;\n r4 = \"Closing the connection.\";\n r3.m260a(r4);\n r3 = r6.f1529q;\t Catch:{ IOException -> 0x0093 }\n r3.close();\t Catch:{ IOException -> 0x0093 }\n L_0x0093:\n r3 = r6.f1520h;\n r4 = r0.m2802d();\n r3 = r3.retryRequest(r2, r4, r8);\n if (r3 == 0) goto L_0x010a;\n L_0x009f:\n r3 = r6.f1513a;\n r3 = r3.m270d();\n if (r3 == 0) goto L_0x00d9;\n L_0x00a7:\n r3 = r6.f1513a;\n r4 = new java.lang.StringBuilder;\n r4.<init>();\n r5 = \"I/O exception (\";\n r4.append(r5);\n r5 = r2.getClass();\n r5 = r5.getName();\n r4.append(r5);\n r5 = \") caught when processing request to \";\n r4.append(r5);\n r4.append(r7);\n r5 = \": \";\n r4.append(r5);\n r5 = r2.getMessage();\n r4.append(r5);\n r4 = r4.toString();\n r3.m269d(r4);\n L_0x00d9:\n r3 = r6.f1513a;\n r3 = r3.m262a();\n if (r3 == 0) goto L_0x00ea;\n L_0x00e1:\n r3 = r6.f1513a;\n r4 = r2.getMessage();\n r3.m261a(r4, r2);\n L_0x00ea:\n r3 = r6.f1513a;\n r3 = r3.m270d();\n if (r3 == 0) goto L_0x000a;\n L_0x00f2:\n r3 = r6.f1513a;\n r4 = new java.lang.StringBuilder;\n r4.<init>();\n r5 = \"Retrying request to \";\n r4.append(r5);\n r4.append(r7);\n r4 = r4.toString();\n r3.m269d(r4);\n goto L_0x000a;\n L_0x010a:\n r8 = r2 instanceof p000a.p001a.p002a.p003a.C0176z;\n if (r8 == 0) goto L_0x0134;\n L_0x010e:\n r8 = new a.a.a.a.z;\n r0 = new java.lang.StringBuilder;\n r0.<init>();\n r7 = r7.mo10a();\n r7 = r7.m474e();\n r0.append(r7);\n r7 = \" failed to respond\";\n r0.append(r7);\n r7 = r0.toString();\n r8.<init>(r7);\n r7 = r2.getStackTrace();\n r8.setStackTrace(r7);\n throw r8;\n L_0x0134:\n throw r2;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: a.a.a.a.i.b.p.b(a.a.a.a.i.b.x, a.a.a.a.n.e):a.a.a.a.s\");\n }", "private final void zzR(Object var1_1, zzha var2_2) {\n block94: {\n var3_3 = this;\n var4_4 = var1_1;\n var5_5 = var2_2;\n var6_6 = this.zzh;\n if (var6_6 != 0) break block94;\n var7_7 = this.zzc;\n var6_6 = ((int[])var7_7).length;\n var8_8 = zzja.zzb;\n var9_9 = 1048575;\n var10_10 = 1.469367E-39f;\n var11_11 = var9_9;\n var13_13 = 0;\n for (var12_12 = 0; var12_12 < var6_6; var12_12 += 3) {\n block95: {\n var14_14 = var3_3.zzA(var12_12);\n var15_15 = var3_3.zzc;\n var16_16 = var15_15[var12_12];\n var17_17 = zzja.zzC(var14_14);\n var18_18 = 17;\n var19_19 = 1;\n if (var17_17 <= var18_18) {\n var20_20 = var3_3.zzc;\n var21_21 = var12_12 + 2;\n var18_18 = var20_20[var21_21];\n if ((var21_21 = var18_18 & var9_9) != var11_11) {\n var22_22 = var21_21;\n var13_13 = var8_8.getInt(var4_4, var22_22);\n var11_11 = var21_21;\n }\n var18_18 >>>= 20;\n var18_18 = var19_19 << var18_18;\n } else {\n var18_18 = 0;\n var20_20 = null;\n }\n var24_23 = var14_14 &= var9_9;\n switch (var17_17) lbl-1000:\n // 56 sources\n\n {\n default: {\n var17_17 = 0;\n break block95;\n }\n case 68: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var26_24 = var8_8.getObject(var4_4, var24_23);\n var27_25 = var3_3.zzv(var12_12);\n var5_5.zzs(var16_16, var26_24, var27_25);\n ** GOTO lbl-1000\n }\n case 67: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var24_23 = zzja.zzG(var4_4, var24_23);\n var5_5.zzq(var16_16, var24_23);\n ** GOTO lbl-1000\n }\n case 66: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var9_9 = zzja.zzF(var4_4, var24_23);\n var5_5.zzp(var16_16, var9_9);\n ** GOTO lbl-1000\n }\n case 65: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var24_23 = zzja.zzG(var4_4, var24_23);\n var5_5.zzd(var16_16, var24_23);\n ** GOTO lbl-1000\n }\n case 64: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var9_9 = zzja.zzF(var4_4, var24_23);\n var5_5.zzb(var16_16, var9_9);\n ** GOTO lbl-1000\n }\n case 63: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var9_9 = zzja.zzF(var4_4, var24_23);\n var5_5.zzg(var16_16, var9_9);\n ** GOTO lbl-1000\n }\n case 62: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var9_9 = zzja.zzF(var4_4, var24_23);\n var5_5.zzo(var16_16, var9_9);\n ** GOTO lbl-1000\n }\n case 61: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var26_24 = (zzgs)var8_8.getObject(var4_4, var24_23);\n var5_5.zzn(var16_16, (zzgs)var26_24);\n ** GOTO lbl-1000\n }\n case 60: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var26_24 = var8_8.getObject(var4_4, var24_23);\n var27_25 = var3_3.zzv(var12_12);\n var5_5.zzr(var16_16, var26_24, var27_25);\n ** GOTO lbl-1000\n }\n case 59: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var26_24 = var8_8.getObject(var4_4, var24_23);\n zzja.zzT(var16_16, var26_24, var5_5);\n ** GOTO lbl-1000\n }\n case 58: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var9_9 = (int)zzja.zzH(var4_4, var24_23);\n var5_5.zzl(var16_16, (boolean)var9_9);\n ** GOTO lbl-1000\n }\n case 57: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var9_9 = zzja.zzF(var4_4, var24_23);\n var5_5.zzk(var16_16, var9_9);\n ** GOTO lbl-1000\n }\n case 56: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var24_23 = zzja.zzG(var4_4, var24_23);\n var5_5.zzj(var16_16, var24_23);\n ** GOTO lbl-1000\n }\n case 55: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var9_9 = zzja.zzF(var4_4, var24_23);\n var5_5.zzi(var16_16, var9_9);\n ** GOTO lbl-1000\n }\n case 54: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var24_23 = zzja.zzG(var4_4, var24_23);\n var5_5.zzh(var16_16, var24_23);\n ** GOTO lbl-1000\n }\n case 53: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var24_23 = zzja.zzG(var4_4, var24_23);\n var5_5.zzc(var16_16, var24_23);\n ** GOTO lbl-1000\n }\n case 52: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var10_10 = zzja.zzE(var4_4, var24_23);\n var5_5.zze(var16_16, var10_10);\n ** GOTO lbl-1000\n }\n case 51: {\n var14_14 = (int)var3_3.zzM(var4_4, var16_16, var12_12);\n if (var14_14 == 0) ** GOTO lbl-1000\n var28_26 = zzja.zzD(var4_4, var24_23);\n var5_5.zzf(var16_16, var28_26);\n ** GOTO lbl-1000\n }\n case 50: {\n var26_24 = var8_8.getObject(var4_4, var24_23);\n var3_3.zzS(var5_5, var16_16, var26_24, var12_12);\n ** GOTO lbl-1000\n }\n case 49: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n var27_25 = var3_3.zzv(var12_12);\n zzjk.zzaa(var14_14, (List)var26_24, var5_5, var27_25);\n ** GOTO lbl-1000\n }\n case 48: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzN(var14_14, (List)var26_24, var5_5, (boolean)var19_19);\n ** GOTO lbl-1000\n }\n case 47: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzS(var14_14, (List)var26_24, var5_5, (boolean)var19_19);\n ** GOTO lbl-1000\n }\n case 46: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzP(var14_14, (List)var26_24, var5_5, (boolean)var19_19);\n ** GOTO lbl-1000\n }\n case 45: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzU(var14_14, (List)var26_24, var5_5, (boolean)var19_19);\n ** GOTO lbl-1000\n }\n case 44: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzV(var14_14, (List)var26_24, var5_5, (boolean)var19_19);\n ** GOTO lbl-1000\n }\n case 43: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzR(var14_14, (List)var26_24, var5_5, (boolean)var19_19);\n ** GOTO lbl-1000\n }\n case 42: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzW(var14_14, (List)var26_24, var5_5, (boolean)var19_19);\n ** GOTO lbl-1000\n }\n case 41: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzT(var14_14, (List)var26_24, var5_5, (boolean)var19_19);\n ** GOTO lbl-1000\n }\n case 40: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzO(var14_14, (List)var26_24, var5_5, (boolean)var19_19);\n ** GOTO lbl-1000\n }\n case 39: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzQ(var14_14, (List)var26_24, var5_5, (boolean)var19_19);\n ** GOTO lbl-1000\n }\n case 38: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzM(var14_14, (List)var26_24, var5_5, (boolean)var19_19);\n ** GOTO lbl-1000\n }\n case 37: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzL(var14_14, (List)var26_24, var5_5, (boolean)var19_19);\n ** GOTO lbl-1000\n }\n case 36: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzK(var14_14, (List)var26_24, var5_5, (boolean)var19_19);\n ** GOTO lbl-1000\n }\n case 35: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzJ(var14_14, (List)var26_24, var5_5, (boolean)var19_19);\n ** GOTO lbl-1000\n }\n case 34: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n var16_16 = 0;\n var15_15 = null;\n zzjk.zzN(var14_14, (List)var26_24, var5_5, false);\n ** GOTO lbl290\n }\n case 33: {\n var16_16 = 0;\n var15_15 = null;\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzS(var14_14, (List)var26_24, var5_5, false);\n ** GOTO lbl290\n }\n case 32: {\n var16_16 = 0;\n var15_15 = null;\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzP(var14_14, (List)var26_24, var5_5, false);\n ** GOTO lbl290\n }\n case 31: {\n var16_16 = 0;\n var15_15 = null;\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzU(var14_14, (List)var26_24, var5_5, false);\n ** GOTO lbl290\n }\n case 30: {\n var16_16 = 0;\n var15_15 = null;\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzV(var14_14, (List)var26_24, var5_5, false);\n ** GOTO lbl290\n }\n case 29: {\n var16_16 = 0;\n var15_15 = null;\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzR(var14_14, (List)var26_24, var5_5, false);\nlbl290:\n // 6 sources\n\n var17_17 = 0;\n break block95;\n }\n case 28: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzY(var14_14, (List)var26_24, var5_5);\n ** GOTO lbl-1000\n }\n case 27: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n var27_25 = var3_3.zzv(var12_12);\n zzjk.zzZ(var14_14, (List)var26_24, var5_5, var27_25);\n ** GOTO lbl-1000\n }\n case 26: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzX(var14_14, (List)var26_24, var5_5);\n ** GOTO lbl-1000\n }\n case 25: {\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n var17_17 = 0;\n zzjk.zzW(var14_14, (List)var26_24, var5_5, false);\n break block95;\n }\n case 24: {\n var17_17 = 0;\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzT(var14_14, (List)var26_24, var5_5, false);\n break block95;\n }\n case 23: {\n var17_17 = 0;\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzO(var14_14, (List)var26_24, var5_5, false);\n break block95;\n }\n case 22: {\n var17_17 = 0;\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzQ(var14_14, (List)var26_24, var5_5, false);\n break block95;\n }\n case 21: {\n var17_17 = 0;\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzM(var14_14, (List)var26_24, var5_5, false);\n break block95;\n }\n case 20: {\n var17_17 = 0;\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzL(var14_14, (List)var26_24, var5_5, false);\n break block95;\n }\n case 19: {\n var17_17 = 0;\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzK(var14_14, (List)var26_24, var5_5, false);\n break block95;\n }\n case 18: {\n var17_17 = 0;\n var30_27 = var3_3.zzc;\n var14_14 = var30_27[var12_12];\n var26_24 = (List)var8_8.getObject(var4_4, var24_23);\n zzjk.zzJ(var14_14, (List)var26_24, var5_5, false);\n break block95;\n }\n case 17: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var26_24 = var8_8.getObject(var4_4, var24_23);\n var27_25 = var3_3.zzv(var12_12);\n var5_5.zzs(var16_16, var26_24, var27_25);\n }\n break block95;\n }\n case 16: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var24_23 = var8_8.getLong(var4_4, var24_23);\n var5_5.zzq(var16_16, var24_23);\n }\n break block95;\n }\n case 15: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var9_9 = var8_8.getInt(var4_4, var24_23);\n var5_5.zzp(var16_16, var9_9);\n }\n break block95;\n }\n case 14: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var24_23 = var8_8.getLong(var4_4, var24_23);\n var5_5.zzd(var16_16, var24_23);\n }\n break block95;\n }\n case 13: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var9_9 = var8_8.getInt(var4_4, var24_23);\n var5_5.zzb(var16_16, var9_9);\n }\n break block95;\n }\n case 12: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var9_9 = var8_8.getInt(var4_4, var24_23);\n var5_5.zzg(var16_16, var9_9);\n }\n break block95;\n }\n case 11: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var9_9 = var8_8.getInt(var4_4, var24_23);\n var5_5.zzo(var16_16, var9_9);\n }\n break block95;\n }\n case 10: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var26_24 = (zzgs)var8_8.getObject(var4_4, var24_23);\n var5_5.zzn(var16_16, (zzgs)var26_24);\n }\n break block95;\n }\n case 9: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var26_24 = var8_8.getObject(var4_4, var24_23);\n var27_25 = var3_3.zzv(var12_12);\n var5_5.zzr(var16_16, var26_24, var27_25);\n }\n break block95;\n }\n case 8: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var26_24 = var8_8.getObject(var4_4, var24_23);\n zzja.zzT(var16_16, var26_24, var5_5);\n }\n break block95;\n }\n case 7: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var9_9 = (int)zzkh.zzh(var4_4, var24_23);\n var5_5.zzl(var16_16, (boolean)var9_9);\n }\n break block95;\n }\n case 6: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var9_9 = var8_8.getInt(var4_4, var24_23);\n var5_5.zzk(var16_16, var9_9);\n }\n break block95;\n }\n case 5: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var24_23 = var8_8.getLong(var4_4, var24_23);\n var5_5.zzj(var16_16, var24_23);\n }\n break block95;\n }\n case 4: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var9_9 = var8_8.getInt(var4_4, var24_23);\n var5_5.zzi(var16_16, var9_9);\n }\n break block95;\n }\n case 3: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var24_23 = var8_8.getLong(var4_4, var24_23);\n var5_5.zzh(var16_16, var24_23);\n }\n break block95;\n }\n case 2: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var24_23 = var8_8.getLong(var4_4, var24_23);\n var5_5.zzc(var16_16, var24_23);\n }\n break block95;\n }\n case 1: {\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var10_10 = zzkh.zzj(var4_4, var24_23);\n var5_5.zze(var16_16, var10_10);\n }\n break block95;\n }\n case 0: \n }\n var17_17 = 0;\n var14_14 = var13_13 & var18_18;\n if (var14_14 != 0) {\n var28_26 = zzkh.zzl(var4_4, var24_23);\n var5_5.zzf(var16_16, var28_26);\n }\n }\n var9_9 = 1048575;\n var10_10 = 1.469367E-39f;\n }\n var7_7 = var3_3.zzn;\n var4_4 = var7_7.zzd(var4_4);\n var7_7.zzi(var4_4, var5_5);\n return;\n }\n this.zzo.zzb(var1_1);\n throw null;\n }", "static void m13383b() {\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 r0 = com.foursquare.internal.data.db.C1916a.getDatabase();\t Catch:{ Exception -> 0x000a }\n r1 = \"battery_watcher\";\t Catch:{ Exception -> 0x000a }\n r2 = 0;\t Catch:{ Exception -> 0x000a }\n r0.delete(r1, r2, r2);\t Catch:{ Exception -> 0x000a }\n L_0x000a:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.foursquare.pilgrim.e.b():void\");\n }", "public void a() {\n block8 : {\n block9 : {\n var1_1 = this.f();\n var2_2 = false;\n if (var1_1) break block8;\n this.j.c();\n var6_3 = this.k;\n var7_4 = this.b;\n var8_5 = (l)var6_3;\n var9_6 = var8_5.a(var7_4);\n if (var9_6 != null) break block9;\n this.a(false);\n var2_2 = true;\n ** GOTO lbl30\n }\n if (var9_6 != n.b) ** GOTO lbl26\n this.a(this.g);\n var11_7 = this.k;\n var12_8 = this.b;\n var13_9 = (l)var11_7;\n try {\n block10 : {\n var2_2 = var13_9.a(var12_8).d();\n break block10;\nlbl26: // 1 sources:\n var10_10 = var9_6.d();\n var2_2 = false;\n if (!var10_10) {\n this.b();\n }\n }\n this.j.g();\n }\n finally {\n this.j.d();\n }\n }\n if ((var3_12 = this.c) == null) return;\n if (var2_2) {\n var4_13 = var3_12.iterator();\n while (var4_13.hasNext()) {\n ((d)var4_13.next()).a(this.b);\n }\n }\n e.a(this.h, this.j, this.c);\n }\n\n /*\n * Exception decompiling\n */\n public final void a(ListenableWorker.a var1_1) {\n // This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.\n // org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [4[TRYBLOCK]], but top level block is 10[WHILELOOP]\n // org.benf.cfr.reader.b.a.a.j.a(Op04StructuredStatement.java:432)\n // org.benf.cfr.reader.b.a.a.j.d(Op04StructuredStatement.java:484)\n // org.benf.cfr.reader.b.a.a.i.a(Op03SimpleStatement.java:607)\n // org.benf.cfr.reader.b.f.a(CodeAnalyser.java:692)\n // org.benf.cfr.reader.b.f.a(CodeAnalyser.java:182)\n // org.benf.cfr.reader.b.f.a(CodeAnalyser.java:127)\n // org.benf.cfr.reader.entities.attributes.f.c(AttributeCode.java:96)\n // org.benf.cfr.reader.entities.g.p(Method.java:396)\n // org.benf.cfr.reader.entities.d.e(ClassFile.java:890)\n // org.benf.cfr.reader.entities.d.b(ClassFile.java:792)\n // org.benf.cfr.reader.b.a(Driver.java:128)\n // org.benf.cfr.reader.a.a(CfrDriverImpl.java:63)\n // com.njlabs.showjava.decompilers.JavaExtractionWorker.decompileWithCFR(JavaExtractionWorker.kt:61)\n // com.njlabs.showjava.decompilers.JavaExtractionWorker.doWork(JavaExtractionWorker.kt:130)\n // com.njlabs.showjava.decompilers.BaseDecompiler.withAttempt(BaseDecompiler.kt:108)\n // com.njlabs.showjava.workers.DecompilerWorker$b.run(DecompilerWorker.kt:118)\n // java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)\n // java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)\n // java.lang.Thread.run(Thread.java:919)\n throw new IllegalStateException(\"Decompilation failed\");\n }\n\n public final void a(String string) {\n LinkedList linkedList = new LinkedList();\n linkedList.add((Object)string);\n while (!linkedList.isEmpty()) {\n String string2 = (String)linkedList.remove();\n if (((l)this.k).a(string2) != n.f) {\n k k2 = this.k;\n n n2 = n.d;\n String[] arrstring = new String[]{string2};\n ((l)k2).a(n2, arrstring);\n }\n linkedList.addAll((Collection)((a.i.r.p.c)this.l).a(string2));\n }\n }\n\n /*\n * Enabled aggressive block sorting\n * Enabled unnecessary exception pruning\n * Enabled aggressive exception aggregation\n */\n public final void a(boolean bl) {\n this.j.c();\n k k2 = this.j.k();\n l l2 = (l)k2;\n List list = l2.a();\n ArrayList arrayList = (ArrayList)list;\n boolean bl2 = arrayList.isEmpty();\n if (bl2) {\n f.a(this.a, RescheduleReceiver.class, false);\n }\n this.j.g();\n this.p.c((Object)bl);\n return;\n finally {\n this.j.d();\n }\n }\n\n public final void b() {\n this.j.c();\n k k2 = this.k;\n n n2 = n.a;\n String[] arrstring = new String[]{this.b};\n l l2 = (l)k2;\n l2.a(n2, arrstring);\n k k3 = this.k;\n String string = this.b;\n long l3 = System.currentTimeMillis();\n l l4 = (l)k3;\n l4.b(string, l3);\n k k4 = this.k;\n String string2 = this.b;\n l l5 = (l)k4;\n try {\n l5.a(string2, -1L);\n this.j.g();\n return;\n }\n finally {\n this.j.d();\n this.a(true);\n }\n }\n\n public final void c() {\n this.j.c();\n k k2 = this.k;\n String string = this.b;\n long l2 = System.currentTimeMillis();\n l l3 = (l)k2;\n l3.b(string, l2);\n k k3 = this.k;\n n n2 = n.a;\n String[] arrstring = new String[]{this.b};\n l l4 = (l)k3;\n l4.a(n2, arrstring);\n k k4 = this.k;\n String string2 = this.b;\n l l5 = (l)k4;\n l5.f(string2);\n k k5 = this.k;\n String string3 = this.b;\n l l6 = (l)k5;\n try {\n l6.a(string3, -1L);\n this.j.g();\n return;\n }\n finally {\n this.j.d();\n this.a(false);\n }\n }\n\n public final void d() {\n k k2 = this.k;\n String string = this.b;\n n n2 = ((l)k2).a(string);\n if (n2 == n.b) {\n h h2 = h.a();\n String string2 = s;\n Object[] arrobject = new Object[]{this.b};\n h2.a(string2, String.format((String)\"Status for %s is RUNNING;not doing any work and rescheduling for later execution\", (Object[])arrobject), new Throwable[0]);\n this.a(true);\n return;\n }\n h h4 = h.a();\n String string3 = s;\n Object[] arrobject = new Object[]{this.b, n2};\n h4.a(string3, String.format((String)\"Status for %s is %s; not doing any work\", (Object[])arrobject), new Throwable[0]);\n this.a(false);\n }\n\n public void e() {\n this.j.c();\n this.a(this.b);\n a.i.e e2 = ((ListenableWorker.a.a)this.g).a;\n k k2 = this.k;\n String string = this.b;\n l l2 = (l)k2;\n try {\n l2.a(string, e2);\n this.j.g();\n return;\n }\n finally {\n this.j.d();\n this.a(false);\n }\n }\n\n public final boolean f() {\n if (this.r) {\n h h2 = h.a();\n String string = s;\n Object[] arrobject = new Object[]{this.o};\n h2.a(string, String.format((String)\"Work interrupted for %s\", (Object[])arrobject), new Throwable[0]);\n k k2 = this.k;\n String string2 = this.b;\n n n2 = ((l)k2).a(string2);\n if (n2 == null) {\n this.a(false);\n return true;\n }\n this.a(true ^ n2.d());\n return true;\n }\n return false;\n }\n\n /*\n * Loose catch block\n * Enabled aggressive block sorting\n * Enabled unnecessary exception pruning\n * Enabled aggressive exception aggregation\n * Lifted jumps to return sites\n */\n public void run() {\n int n2;\n block42 : {\n block41 : {\n i i2;\n Cursor cursor;\n block48 : {\n block46 : {\n ListenableWorker listenableWorker;\n block47 : {\n a.i.e e2;\n block44 : {\n g g2;\n block45 : {\n block40 : {\n boolean bl;\n Iterator iterator;\n j j2;\n StringBuilder stringBuilder;\n block43 : {\n a.i.r.p.n n3 = this.m;\n String string = this.b;\n o o2 = (o)n3;\n if (o2 == null) throw null;\n n2 = 1;\n i i3 = i.a((String)\"SELECT DISTINCT tag FROM worktag WHERE work_spec_id=?\", (int)n2);\n if (string == null) {\n i3.bindNull(n2);\n } else {\n i3.bindString(n2, string);\n }\n o2.a.b();\n Cursor cursor2 = a.f.l.a.a(o2.a, (a.g.a.e)i3, false);\n ArrayList arrayList = new ArrayList(cursor2.getCount());\n while (cursor2.moveToNext()) {\n arrayList.add((Object)cursor2.getString(0));\n }\n this.n = arrayList;\n stringBuilder = new StringBuilder(\"Work [ id=\");\n stringBuilder.append(this.b);\n stringBuilder.append(\", tags={ \");\n iterator = arrayList.iterator();\n bl = true;\n break block43;\n finally {\n cursor2.close();\n i3.b();\n }\n }\n while (iterator.hasNext()) {\n String string = (String)iterator.next();\n if (bl) {\n bl = false;\n } else {\n stringBuilder.append(\", \");\n }\n stringBuilder.append(string);\n }\n stringBuilder.append(\" } ]\");\n this.o = stringBuilder.toString();\n if (this.f()) {\n return;\n }\n this.j.c();\n k k2 = this.k;\n String string = this.b;\n l l2 = (l)k2;\n this.e = j2 = l2.d(string);\n if (j2 == null) {\n h h2 = h.a();\n String string2 = s;\n Object[] arrobject = new Object[n2];\n arrobject[0] = this.b;\n h2.b(string2, String.format((String)\"Didn't find WorkSpec for id %s\", (Object[])arrobject), new Throwable[0]);\n this.a(false);\n return;\n }\n if (j2.b != n.a) {\n this.d();\n this.j.g();\n h h4 = h.a();\n String string3 = s;\n Object[] arrobject = new Object[n2];\n arrobject[0] = this.e.c;\n h4.a(string3, String.format((String)\"%s is not in ENQUEUED state. Nothing more to do.\", (Object[])arrobject), new Throwable[0]);\n return;\n }\n if (j2.d() || this.e.c()) {\n long l3 = System.currentTimeMillis();\n boolean bl2 = this.e.n == 0L;\n if (!bl2 && l3 < this.e.a()) {\n h h5 = h.a();\n String string4 = s;\n Object[] arrobject = new Object[n2];\n arrobject[0] = this.e.c;\n h5.a(string4, String.format((String)\"Delaying execution for %s because it is being executed before schedule.\", (Object[])arrobject), new Throwable[0]);\n this.a((boolean)n2);\n return;\n }\n }\n this.j.g();\n if (!this.e.d()) break block40;\n e2 = this.e.e;\n break block44;\n }\n g2 = g.a(this.e.d);\n if (g2 != null) break block45;\n h h6 = h.a();\n String string = s;\n Object[] arrobject = new Object[n2];\n arrobject[0] = this.e.d;\n h6.b(string, String.format((String)\"Could not create Input Merger %s\", (Object[])arrobject), new Throwable[0]);\n break block46;\n }\n ArrayList arrayList = new ArrayList();\n arrayList.add((Object)this.e.e);\n k k3 = this.k;\n String string = this.b;\n l l4 = (l)k3;\n if (l4 == null) throw null;\n i2 = i.a((String)\"SELECT output FROM workspec WHERE id IN (SELECT prerequisite_id FROM dependency WHERE work_spec_id=?)\", (int)n2);\n if (string == null) {\n i2.bindNull(n2);\n } else {\n i2.bindString(n2, string);\n }\n l4.a.b();\n cursor = a.f.l.a.a(l4.a, (a.g.a.e)i2, false);\n ArrayList arrayList2 = new ArrayList(cursor.getCount());\n while (cursor.moveToNext()) {\n arrayList2.add((Object)a.i.e.b(cursor.getBlob(0)));\n }\n arrayList.addAll((Collection)arrayList2);\n e2 = g2.a((List<a.i.e>)arrayList);\n }\n a.i.e e3 = e2;\n UUID uUID = UUID.fromString((String)this.b);\n List<String> list = this.n;\n WorkerParameters.a a2 = this.d;\n int n5 = this.e.k;\n a.i.b b2 = this.h;\n WorkerParameters workerParameters = new WorkerParameters(uUID, e3, list, a2, n5, b2.a, this.i, b2.c);\n if (this.f == null) {\n this.f = this.h.c.a(this.a, this.e.c, workerParameters);\n }\n if ((listenableWorker = this.f) != null) break block47;\n h h7 = h.a();\n String string = s;\n Object[] arrobject = new Object[n2];\n arrobject[0] = this.e.c;\n h7.b(string, String.format((String)\"Could not create Worker %s\", (Object[])arrobject), new Throwable[0]);\n break block46;\n }\n if (!listenableWorker.isUsed()) break block48;\n h h8 = h.a();\n String string = s;\n Object[] arrobject = new Object[n2];\n arrobject[0] = this.e.c;\n h8.b(string, String.format((String)\"Received an already-used Worker %s; WorkerFactory should return new instances\", (Object[])arrobject), new Throwable[0]);\n }\n this.e();\n return;\n }\n this.f.setUsed();\n this.j.c();\n k k4 = this.k;\n String string = this.b;\n l l5 = (l)k4;\n if (l5.a(string) != n.a) break block41;\n k k5 = this.k;\n n n7 = n.b;\n String[] arrstring = new String[n2];\n arrstring[0] = this.b;\n l l6 = (l)k5;\n l6.a(n7, arrstring);\n k k6 = this.k;\n String string5 = this.b;\n l l7 = (l)k6;\n try {\n l7.e(string5);\n break block42;\n }\n finally {\n cursor.close();\n i2.b();\n }\n catch (Throwable throwable) {\n throw throwable;\n }\n finally {\n this.j.d();\n }\n }\n n2 = 0;\n }\n this.j.g();\n if (n2 != 0) {\n if (this.f()) {\n return;\n }\n c c2 = new c();\n ((a.i.r.q.m.b)this.i).c.execute((Runnable)new a.i.r.k(this, c2));\n c2.a((Runnable)new a.i.r.l(this, c2, this.o), ((a.i.r.q.m.b)this.i).a);\n return;\n }\n this.d();\n return;\n finally {\n this.j.d();\n }\n }\n\n public static class a {\n public Context a;\n public ListenableWorker b;\n public a.i.r.q.m.a c;\n public a.i.b d;\n public WorkDatabase e;\n public String f;\n public List<d> g;\n public WorkerParameters.a h = new WorkerParameters.a();\n\n public a(Context context, a.i.b b2, a.i.r.q.m.a a2, WorkDatabase workDatabase, String string) {\n this.a = context.getApplicationContext();\n this.c = a2;\n this.d = b2;\n this.e = workDatabase;\n this.f = string;\n }\n }\n\n}", "public long mo915b() {\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 = -1;\n r2 = r4.f18088d;\t Catch:{ NumberFormatException -> 0x000e }\n if (r2 == 0) goto L_0x000d;\t Catch:{ NumberFormatException -> 0x000e }\n L_0x0006:\n r2 = r4.f18088d;\t Catch:{ NumberFormatException -> 0x000e }\n r2 = java.lang.Long.parseLong(r2);\t Catch:{ NumberFormatException -> 0x000e }\n r0 = r2;\n L_0x000d:\n return r0;\n L_0x000e:\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: okhttp3.c.b.b():long\");\n }", "protected void method_2241() {\r\n // $FF: Couldn't be decompiled\r\n }", "@Override // X.AnonymousClass0PN\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public void A0D() {\n /*\n r5 = this;\n super.A0D()\n X.08d r0 = r5.A05\n X.0OQ r4 = r0.A04()\n X.0Rk r3 = r4.A00() // Catch:{ all -> 0x003d }\n X.0BK r2 = r4.A04 // Catch:{ all -> 0x0036 }\n java.lang.String r1 = \"DELETE FROM receipt_device\"\n java.lang.String r0 = \"CLEAR_TABLE_RECEIPT_DEVICE\"\n r2.A0C(r1, r0) // Catch:{ all -> 0x0036 }\n X.08m r1 = r5.A03 // Catch:{ all -> 0x0036 }\n java.lang.String r0 = \"receipt_device_migration_complete\"\n r1.A02(r0) // Catch:{ all -> 0x0036 }\n java.lang.String r0 = \"migration_receipt_device_index\"\n r1.A02(r0) // Catch:{ all -> 0x0036 }\n java.lang.String r0 = \"migration_receipt_device_retry\"\n r1.A02(r0) // Catch:{ all -> 0x0036 }\n r3.A00() // Catch:{ all -> 0x0036 }\n r3.close()\n r4.close()\n java.lang.String r0 = \"ReceiptDeviceStore/ReceiptDeviceDatabaseMigration/resetMigration/done\"\n com.whatsapp.util.Log.i(r0)\n return\n L_0x0036:\n r0 = move-exception\n throw r0 // Catch:{ all -> 0x0038 }\n L_0x0038:\n r0 = move-exception\n r3.close() // Catch:{ all -> 0x003c }\n L_0x003c:\n throw r0\n L_0x003d:\n r0 = move-exception\n throw r0 // Catch:{ all -> 0x003f }\n L_0x003f:\n r0 = move-exception\n r4.close() // Catch:{ all -> 0x0043 }\n L_0x0043:\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: X.C43661yk.A0D():void\");\n }", "private final com.google.android.p306h.p307a.p308a.C5685v m26927b(com.google.protobuf.nano.a r7) {\n /*\n r6 = this;\n L_0x0000:\n r0 = r7.a();\n switch(r0) {\n case 0: goto L_0x000d;\n case 8: goto L_0x000e;\n case 18: goto L_0x0043;\n case 24: goto L_0x0054;\n case 32: goto L_0x005f;\n case 42: goto L_0x006a;\n default: goto L_0x0007;\n };\n L_0x0007:\n r0 = super.m4918a(r7, r0);\n if (r0 != 0) goto L_0x0000;\n L_0x000d:\n return r6;\n L_0x000e:\n r1 = r7.o();\n r2 = r7.i();\t Catch:{ IllegalArgumentException -> 0x0034 }\n switch(r2) {\n case 0: goto L_0x003c;\n case 1: goto L_0x003c;\n case 2: goto L_0x003c;\n case 3: goto L_0x003c;\n case 4: goto L_0x003c;\n case 5: goto L_0x003c;\n case 101: goto L_0x003c;\n case 102: goto L_0x003c;\n case 103: goto L_0x003c;\n case 104: goto L_0x003c;\n case 105: goto L_0x003c;\n case 106: goto L_0x003c;\n case 107: goto L_0x003c;\n case 108: goto L_0x003c;\n case 201: goto L_0x003c;\n case 202: goto L_0x003c;\n case 203: goto L_0x003c;\n case 204: goto L_0x003c;\n case 205: goto L_0x003c;\n case 206: goto L_0x003c;\n case 207: goto L_0x003c;\n case 208: goto L_0x003c;\n case 209: goto L_0x003c;\n case 301: goto L_0x003c;\n case 302: goto L_0x003c;\n case 303: goto L_0x003c;\n case 304: goto L_0x003c;\n case 305: goto L_0x003c;\n case 306: goto L_0x003c;\n case 307: goto L_0x003c;\n case 401: goto L_0x003c;\n case 402: goto L_0x003c;\n case 403: goto L_0x003c;\n case 404: goto L_0x003c;\n case 501: goto L_0x003c;\n case 502: goto L_0x003c;\n case 503: goto L_0x003c;\n case 504: goto L_0x003c;\n case 601: goto L_0x003c;\n case 602: goto L_0x003c;\n case 603: goto L_0x003c;\n case 604: goto L_0x003c;\n case 605: goto L_0x003c;\n case 606: goto L_0x003c;\n case 607: goto L_0x003c;\n case 608: goto L_0x003c;\n case 609: goto L_0x003c;\n case 610: goto L_0x003c;\n case 611: goto L_0x003c;\n case 612: goto L_0x003c;\n case 613: goto L_0x003c;\n case 614: goto L_0x003c;\n case 615: goto L_0x003c;\n case 616: goto L_0x003c;\n case 617: goto L_0x003c;\n case 618: goto L_0x003c;\n case 619: goto L_0x003c;\n case 620: goto L_0x003c;\n case 621: goto L_0x003c;\n case 622: goto L_0x003c;\n case 623: goto L_0x003c;\n case 624: goto L_0x003c;\n case 625: goto L_0x003c;\n case 626: goto L_0x003c;\n case 627: goto L_0x003c;\n case 628: goto L_0x003c;\n case 629: goto L_0x003c;\n case 630: goto L_0x003c;\n case 631: goto L_0x003c;\n case 632: goto L_0x003c;\n case 633: goto L_0x003c;\n case 634: goto L_0x003c;\n case 635: goto L_0x003c;\n case 636: goto L_0x003c;\n case 637: goto L_0x003c;\n case 638: goto L_0x003c;\n case 639: goto L_0x003c;\n case 640: goto L_0x003c;\n case 641: goto L_0x003c;\n case 701: goto L_0x003c;\n case 702: goto L_0x003c;\n case 703: goto L_0x003c;\n case 704: goto L_0x003c;\n case 705: goto L_0x003c;\n case 706: goto L_0x003c;\n case 707: goto L_0x003c;\n case 708: goto L_0x003c;\n case 709: goto L_0x003c;\n case 710: goto L_0x003c;\n case 711: goto L_0x003c;\n case 712: goto L_0x003c;\n case 713: goto L_0x003c;\n case 714: goto L_0x003c;\n case 715: goto L_0x003c;\n case 716: goto L_0x003c;\n case 717: goto L_0x003c;\n case 718: goto L_0x003c;\n case 719: goto L_0x003c;\n case 720: goto L_0x003c;\n case 721: goto L_0x003c;\n case 722: goto L_0x003c;\n case 801: goto L_0x003c;\n case 802: goto L_0x003c;\n case 803: goto L_0x003c;\n case 901: goto L_0x003c;\n case 902: goto L_0x003c;\n case 903: goto L_0x003c;\n case 904: goto L_0x003c;\n case 905: goto L_0x003c;\n case 906: goto L_0x003c;\n case 907: goto L_0x003c;\n case 908: goto L_0x003c;\n case 909: goto L_0x003c;\n case 910: goto L_0x003c;\n case 911: goto L_0x003c;\n case 912: goto L_0x003c;\n case 1001: goto L_0x003c;\n case 1002: goto L_0x003c;\n case 1003: goto L_0x003c;\n case 1004: goto L_0x003c;\n case 1005: goto L_0x003c;\n case 1006: goto L_0x003c;\n case 1101: goto L_0x003c;\n case 1102: goto L_0x003c;\n case 1201: goto L_0x003c;\n case 1301: goto L_0x003c;\n case 1302: goto L_0x003c;\n case 1303: goto L_0x003c;\n case 1304: goto L_0x003c;\n case 1305: goto L_0x003c;\n case 1306: goto L_0x003c;\n case 1307: goto L_0x003c;\n case 1308: goto L_0x003c;\n case 1309: goto L_0x003c;\n case 1310: goto L_0x003c;\n case 1311: goto L_0x003c;\n case 1312: goto L_0x003c;\n case 1313: goto L_0x003c;\n case 1314: goto L_0x003c;\n case 1315: goto L_0x003c;\n case 1316: goto L_0x003c;\n case 1317: goto L_0x003c;\n case 1318: goto L_0x003c;\n case 1319: goto L_0x003c;\n case 1320: goto L_0x003c;\n case 1321: goto L_0x003c;\n case 1322: goto L_0x003c;\n case 1323: goto L_0x003c;\n case 1324: goto L_0x003c;\n case 1325: goto L_0x003c;\n case 1326: goto L_0x003c;\n case 1327: goto L_0x003c;\n case 1328: goto L_0x003c;\n case 1329: goto L_0x003c;\n case 1330: goto L_0x003c;\n case 1331: goto L_0x003c;\n case 1332: goto L_0x003c;\n case 1333: goto L_0x003c;\n case 1334: goto L_0x003c;\n case 1335: goto L_0x003c;\n case 1336: goto L_0x003c;\n case 1337: goto L_0x003c;\n case 1338: goto L_0x003c;\n case 1339: goto L_0x003c;\n case 1340: goto L_0x003c;\n case 1341: goto L_0x003c;\n case 1342: goto L_0x003c;\n case 1343: goto L_0x003c;\n case 1344: goto L_0x003c;\n case 1345: goto L_0x003c;\n case 1346: goto L_0x003c;\n case 1347: goto L_0x003c;\n case 1401: goto L_0x003c;\n case 1402: goto L_0x003c;\n case 1403: goto L_0x003c;\n case 1404: goto L_0x003c;\n case 1405: goto L_0x003c;\n case 1406: goto L_0x003c;\n case 1407: goto L_0x003c;\n case 1408: goto L_0x003c;\n case 1409: goto L_0x003c;\n case 1410: goto L_0x003c;\n case 1411: goto L_0x003c;\n case 1412: goto L_0x003c;\n case 1413: goto L_0x003c;\n case 1414: goto L_0x003c;\n case 1415: goto L_0x003c;\n case 1416: goto L_0x003c;\n case 1417: goto L_0x003c;\n case 1418: goto L_0x003c;\n case 1419: goto L_0x003c;\n case 1420: goto L_0x003c;\n case 1421: goto L_0x003c;\n case 1422: goto L_0x003c;\n case 1423: goto L_0x003c;\n case 1424: goto L_0x003c;\n case 1425: goto L_0x003c;\n case 1426: goto L_0x003c;\n case 1427: goto L_0x003c;\n case 1601: goto L_0x003c;\n case 1602: goto L_0x003c;\n case 1603: goto L_0x003c;\n case 1604: goto L_0x003c;\n case 1605: goto L_0x003c;\n case 1606: goto L_0x003c;\n case 1607: goto L_0x003c;\n case 1608: goto L_0x003c;\n case 1609: goto L_0x003c;\n case 1610: goto L_0x003c;\n case 1611: goto L_0x003c;\n case 1612: goto L_0x003c;\n case 1613: goto L_0x003c;\n case 1614: goto L_0x003c;\n case 1615: goto L_0x003c;\n case 1616: goto L_0x003c;\n case 1617: goto L_0x003c;\n case 1618: goto L_0x003c;\n case 1619: goto L_0x003c;\n case 1620: goto L_0x003c;\n case 1621: goto L_0x003c;\n case 1622: goto L_0x003c;\n case 1623: goto L_0x003c;\n case 1624: goto L_0x003c;\n case 1625: goto L_0x003c;\n case 1626: goto L_0x003c;\n case 1627: goto L_0x003c;\n case 1628: goto L_0x003c;\n case 1629: goto L_0x003c;\n case 1630: goto L_0x003c;\n case 1631: goto L_0x003c;\n case 1632: goto L_0x003c;\n case 1633: goto L_0x003c;\n case 1634: goto L_0x003c;\n case 1635: goto L_0x003c;\n case 1636: goto L_0x003c;\n case 1637: goto L_0x003c;\n case 1638: goto L_0x003c;\n case 1639: goto L_0x003c;\n case 1640: goto L_0x003c;\n case 1641: goto L_0x003c;\n case 1642: goto L_0x003c;\n case 1643: goto L_0x003c;\n case 1644: goto L_0x003c;\n case 1645: goto L_0x003c;\n case 1646: goto L_0x003c;\n case 1647: goto L_0x003c;\n case 1648: goto L_0x003c;\n case 1649: goto L_0x003c;\n case 1650: goto L_0x003c;\n case 1651: goto L_0x003c;\n case 1652: goto L_0x003c;\n case 1653: goto L_0x003c;\n case 1654: goto L_0x003c;\n case 1655: goto L_0x003c;\n case 1656: goto L_0x003c;\n case 1657: goto L_0x003c;\n case 1658: goto L_0x003c;\n case 1659: goto L_0x003c;\n case 1660: goto L_0x003c;\n case 1801: goto L_0x003c;\n case 1802: goto L_0x003c;\n case 1803: goto L_0x003c;\n case 1804: goto L_0x003c;\n case 1805: goto L_0x003c;\n case 1806: goto L_0x003c;\n case 1807: goto L_0x003c;\n case 1808: goto L_0x003c;\n case 1809: goto L_0x003c;\n case 1810: goto L_0x003c;\n case 1811: goto L_0x003c;\n case 1812: goto L_0x003c;\n case 1813: goto L_0x003c;\n case 1814: goto L_0x003c;\n case 1815: goto L_0x003c;\n case 1816: goto L_0x003c;\n case 1817: goto L_0x003c;\n case 1901: goto L_0x003c;\n case 1902: goto L_0x003c;\n case 1903: goto L_0x003c;\n case 1904: goto L_0x003c;\n case 1905: goto L_0x003c;\n case 1906: goto L_0x003c;\n case 1907: goto L_0x003c;\n case 1908: goto L_0x003c;\n case 1909: goto L_0x003c;\n case 2001: goto L_0x003c;\n case 2101: goto L_0x003c;\n case 2102: goto L_0x003c;\n case 2103: goto L_0x003c;\n case 2104: goto L_0x003c;\n case 2105: goto L_0x003c;\n case 2106: goto L_0x003c;\n case 2107: goto L_0x003c;\n case 2108: goto L_0x003c;\n case 2109: goto L_0x003c;\n case 2110: goto L_0x003c;\n case 2111: goto L_0x003c;\n case 2112: goto L_0x003c;\n case 2113: goto L_0x003c;\n case 2114: goto L_0x003c;\n case 2115: goto L_0x003c;\n case 2116: goto L_0x003c;\n case 2117: goto L_0x003c;\n case 2118: goto L_0x003c;\n case 2119: goto L_0x003c;\n case 2120: goto L_0x003c;\n case 2121: goto L_0x003c;\n case 2122: goto L_0x003c;\n case 2123: goto L_0x003c;\n case 2124: goto L_0x003c;\n case 2201: goto L_0x003c;\n case 2202: goto L_0x003c;\n case 2203: goto L_0x003c;\n case 2204: goto L_0x003c;\n case 2205: goto L_0x003c;\n case 2206: goto L_0x003c;\n case 2207: goto L_0x003c;\n case 2208: goto L_0x003c;\n case 2209: goto L_0x003c;\n case 2210: goto L_0x003c;\n case 2211: goto L_0x003c;\n case 2212: goto L_0x003c;\n case 2213: goto L_0x003c;\n case 2214: goto L_0x003c;\n case 2215: goto L_0x003c;\n case 2301: goto L_0x003c;\n case 2302: goto L_0x003c;\n case 2303: goto L_0x003c;\n case 2304: goto L_0x003c;\n case 2401: goto L_0x003c;\n case 2402: goto L_0x003c;\n case 2501: goto L_0x003c;\n case 2502: goto L_0x003c;\n case 2503: goto L_0x003c;\n case 2504: goto L_0x003c;\n case 2505: goto L_0x003c;\n case 2506: goto L_0x003c;\n case 2507: goto L_0x003c;\n case 2508: goto L_0x003c;\n case 2509: goto L_0x003c;\n case 2510: goto L_0x003c;\n case 2511: goto L_0x003c;\n case 2512: goto L_0x003c;\n case 2513: goto L_0x003c;\n case 2514: goto L_0x003c;\n case 2515: goto L_0x003c;\n case 2516: goto L_0x003c;\n case 2517: goto L_0x003c;\n case 2518: goto L_0x003c;\n case 2519: goto L_0x003c;\n case 2601: goto L_0x003c;\n case 2602: goto L_0x003c;\n case 2701: goto L_0x003c;\n case 2702: goto L_0x003c;\n case 2703: goto L_0x003c;\n case 2704: goto L_0x003c;\n case 2705: goto L_0x003c;\n case 2706: goto L_0x003c;\n case 2707: goto L_0x003c;\n case 2801: goto L_0x003c;\n case 2802: goto L_0x003c;\n case 2803: goto L_0x003c;\n case 2804: goto L_0x003c;\n case 2805: goto L_0x003c;\n case 2806: goto L_0x003c;\n case 2807: goto L_0x003c;\n case 2808: goto L_0x003c;\n case 2809: goto L_0x003c;\n case 2810: goto L_0x003c;\n case 2811: goto L_0x003c;\n case 2812: goto L_0x003c;\n case 2813: goto L_0x003c;\n case 2814: goto L_0x003c;\n case 2815: goto L_0x003c;\n case 2816: goto L_0x003c;\n case 2817: goto L_0x003c;\n case 2818: goto L_0x003c;\n case 2819: goto L_0x003c;\n case 2820: goto L_0x003c;\n case 2821: goto L_0x003c;\n case 2822: goto L_0x003c;\n case 2823: goto L_0x003c;\n case 2824: goto L_0x003c;\n case 2825: goto L_0x003c;\n case 2826: goto L_0x003c;\n case 2901: goto L_0x003c;\n case 2902: goto L_0x003c;\n case 2903: goto L_0x003c;\n case 2904: goto L_0x003c;\n case 2905: goto L_0x003c;\n case 2906: goto L_0x003c;\n case 2907: goto L_0x003c;\n case 3001: goto L_0x003c;\n case 3002: goto L_0x003c;\n case 3003: goto L_0x003c;\n case 3004: goto L_0x003c;\n case 3005: goto L_0x003c;\n default: goto L_0x0019;\n };\t Catch:{ IllegalArgumentException -> 0x0034 }\n L_0x0019:\n r3 = new java.lang.IllegalArgumentException;\t Catch:{ IllegalArgumentException -> 0x0034 }\n r4 = 41;\n r5 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x0034 }\n r5.<init>(r4);\t Catch:{ IllegalArgumentException -> 0x0034 }\n r2 = r5.append(r2);\t Catch:{ IllegalArgumentException -> 0x0034 }\n r4 = \" is not a valid enum EventType\";\n r2 = r2.append(r4);\t Catch:{ IllegalArgumentException -> 0x0034 }\n r2 = r2.toString();\t Catch:{ IllegalArgumentException -> 0x0034 }\n r3.<init>(r2);\t Catch:{ IllegalArgumentException -> 0x0034 }\n throw r3;\t Catch:{ IllegalArgumentException -> 0x0034 }\n L_0x0034:\n r2 = move-exception;\n r7.e(r1);\n r6.m4918a(r7, r0);\n goto L_0x0000;\n L_0x003c:\n r2 = java.lang.Integer.valueOf(r2);\t Catch:{ IllegalArgumentException -> 0x0034 }\n r6.f28837a = r2;\t Catch:{ IllegalArgumentException -> 0x0034 }\n goto L_0x0000;\n L_0x0043:\n r0 = r6.f28838b;\n if (r0 != 0) goto L_0x004e;\n L_0x0047:\n r0 = new com.google.android.h.a.a.u;\n r0.<init>();\n r6.f28838b = r0;\n L_0x004e:\n r0 = r6.f28838b;\n r7.a(r0);\n goto L_0x0000;\n L_0x0054:\n r0 = r7.j();\n r0 = java.lang.Long.valueOf(r0);\n r6.f28839c = r0;\n goto L_0x0000;\n L_0x005f:\n r0 = r7.j();\n r0 = java.lang.Long.valueOf(r0);\n r6.f28840d = r0;\n goto L_0x0000;\n L_0x006a:\n r0 = r6.f28841e;\n if (r0 != 0) goto L_0x0075;\n L_0x006e:\n r0 = new com.google.android.h.a.a.o;\n r0.<init>();\n r6.f28841e = r0;\n L_0x0075:\n r0 = r6.f28841e;\n r7.a(r0);\n goto L_0x0000;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.h.a.a.v.b(com.google.protobuf.nano.a):com.google.android.h.a.a.v\");\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 }", "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 void a() {\n block25 : {\n block24 : {\n block22 : {\n var17_1 = a.a;\n var3_2 = this.c.i();\n var4_3 = var3_2.a().a();\n this.d = new w();\n this.e = new y.f.h.D(this.d);\n this.h = M.a(new Object[this.b.e()]);\n this.i = M.b(new Object[this.b.g()]);\n var5_4 = this.b.o();\n while (var5_4.f()) {\n var6_5 = var5_4.e();\n if (var17_1 == 0) {\n if (var6_5.c() <= this.l) {\n var7_6 = this.d.d();\n this.h.a(var6_5, var7_6);\n }\n var5_4.g();\n if (var17_1 == 0) continue;\n }\n break block22;\n }\n this.j = M.b(new Object[this.b.g()]);\n this.k = M.b(new Object[this.b.g()]);\n this.a(this.j, this.k);\n }\n var2_8 = this.b.o();\n block3 : do {\n v0 = var2_8.f();\n block4 : while (v0 != 0) {\n var5_4 = var2_8.e();\n if (var5_4.c() != 0) {\n var1_9 = var5_4.l();\n var6_5 = var1_9.a();\n var7_6 = (y.c.q)this.j.b(var6_5);\n var1_9.b();\n while (var1_9.f()) {\n var8_10 = var1_9.a();\n var9_11 = (y.c.q)this.j.b(var8_10);\n var10_12 = (y.c.q)this.k.b(var8_10);\n var11_13 = this.a((y.c.q)var7_6, (y.c.q)var9_11);\n v0 = var5_4.c();\n if (var17_1 != 0) continue block4;\n if (v0 > this.l) {\n this.h.a(var5_4, var11_13);\n }\n var7_6 = (y.c.q)this.j.b(var8_10);\n var12_14 /* !! */ = this.d.a((y.c.q)var9_11, (y.c.q)var10_12);\n this.i.a(var8_10, var12_14 /* !! */ );\n if (var8_10 == var6_5) break;\n var1_9.b();\n if (var17_1 == 0) continue;\n }\n }\n var2_8.g();\n if (var17_1 == 0) continue block3;\n }\n break block3;\n break;\n } while (true);\n var1_9 = this.b.p();\n while (var1_9.f()) {\n var5_4 = var1_9.a();\n v1 = this;\n if (var17_1 == 0) {\n block23 : {\n if (v1.c.n((y.c.d)var5_4)) {\n this.e.m((y.c.d)this.i.b(var5_4));\n if (var17_1 == 0) break block23;\n }\n this.e.e((y.c.d)this.i.b(var5_4));\n }\n var6_5 = this.c.h((y.c.d)var5_4);\n this.e.b((y.c.d)this.i.b(var5_4), (y.c.d)this.i.b(var6_5));\n var1_9.g();\n if (var17_1 == 0) continue;\n }\n break block24;\n }\n v1 = this;\n }\n var5_4 = v1.e.m();\n this.d.a(\"y.layout.orthogonal.general.NodeSplitter.NODE_FACES\", (y.c.c)var5_4);\n var6_5 = this.e.m();\n this.d.a(\"y.layout.orthogonal.ring.FixedSizeNodeSplitter#NODE_SIZE\", (y.c.c)var6_5);\n this.m = this.e.g().t();\n this.d.a(\"y.layout.orthogonal.ring.FixedSizeNodeSplitter#NODE_SIZE\", new c((r)var6_5, this.m));\n try {\n this.e.l();\n var7_6 = (y.c.d)this.i.b(var4_3);\n this.e.b(this.e.i((y.c.d)var7_6));\n var8_10 = this.e.h();\n while (var8_10.f()) {\n var5_4.a(var8_10.a(), false);\n var8_10.g();\n if (var17_1 == 0) {\n if (var17_1 == 0) continue;\n }\n break block25;\n }\n var8_10 = this.b.o();\n while (var8_10.f()) {\n var9_11 = var8_10.e();\n if (var17_1 != 0) break;\n if (var9_11.c() <= this.l) ** GOTO lbl-1000\n var10_12 = (y.c.d)this.h.b(var9_11);\n var11_13 = this.e.i((y.c.d)var10_12);\n this.h.a(var9_11, var11_13);\n var5_4.a((p)var11_13, true);\n var12_14 /* !! */ = (y.c.d)this.b.p((y.c.q)var9_11);\n var14_15 = this.b.q((y.c.q)var9_11);\n var16_16 = new Dimension((int)var12_14 /* !! */ , (int)var14_15);\n var6_5.a((p)var11_13, var16_16);\n if (var17_1 != 0) lbl-1000: // 2 sources:\n {\n var10_12 = this.b.r((y.c.q)var9_11);\n if (var10_12.a > 0.0 || var10_12.b > 0.0) {\n var11_13 = (y.c.q)this.h.b(var9_11);\n this.m.a(var11_13, this.b.r((y.c.q)var9_11));\n }\n }\n var8_10.g();\n if (var17_1 == 0) continue;\n break;\n }\n }\n catch (Exception var7_7) {\n System.err.println(\"Internal Error in Face calculation !\");\n var7_7.printStackTrace(System.err);\n }\n }\n var7_6 = this.e.h();\n block9 : do {\n if (var7_6.f() == false) return;\n var8_10 = (p)var7_6.d();\n if (var5_4.d(var8_10)) {\n var9_11 = var8_10.a();\n while (var9_11.f()) {\n var10_12 = var9_11.a();\n this.e.m(this.e.h((y.c.d)var10_12));\n this.e.e((y.c.d)var10_12);\n var9_11.g();\n if (var17_1 != 0) continue block9;\n if (var17_1 == 0) continue;\n }\n }\n var7_6.g();\n } while (var17_1 == 0);\n }", "private final com.google.wireless.android.finsky.dfe.p515h.p516a.ae m35733b(com.google.protobuf.nano.C7213a r7) {\n /*\n r6 = this;\n L_0x0000:\n r0 = r7.m33550a();\n switch(r0) {\n case 0: goto L_0x000d;\n case 10: goto L_0x000e;\n case 18: goto L_0x001f;\n case 26: goto L_0x002c;\n case 34: goto L_0x0039;\n case 42: goto L_0x004a;\n case 50: goto L_0x0057;\n case 56: goto L_0x0064;\n case 64: goto L_0x00a3;\n case 72: goto L_0x00b1;\n case 82: goto L_0x00bf;\n default: goto L_0x0007;\n };\n L_0x0007:\n r0 = super.a(r7, r0);\n if (r0 != 0) goto L_0x0000;\n L_0x000d:\n return r6;\n L_0x000e:\n r0 = r6.f38026c;\n if (r0 != 0) goto L_0x0019;\n L_0x0012:\n r0 = new com.google.android.finsky.cv.a.bd;\n r0.<init>();\n r6.f38026c = r0;\n L_0x0019:\n r0 = r6.f38026c;\n r7.m33552a(r0);\n goto L_0x0000;\n L_0x001f:\n r0 = r7.m33564f();\n r6.f38027d = r0;\n r0 = r6.f38025b;\n r0 = r0 | 1;\n r6.f38025b = r0;\n goto L_0x0000;\n L_0x002c:\n r0 = r7.m33564f();\n r6.f38028e = r0;\n r0 = r6.f38025b;\n r0 = r0 | 2;\n r6.f38025b = r0;\n goto L_0x0000;\n L_0x0039:\n r0 = r6.f38029f;\n if (r0 != 0) goto L_0x0044;\n L_0x003d:\n r0 = new com.google.android.finsky.cv.a.ax;\n r0.<init>();\n r6.f38029f = r0;\n L_0x0044:\n r0 = r6.f38029f;\n r7.m33552a(r0);\n goto L_0x0000;\n L_0x004a:\n r0 = r7.m33564f();\n r6.f38030g = r0;\n r0 = r6.f38025b;\n r0 = r0 | 4;\n r6.f38025b = r0;\n goto L_0x0000;\n L_0x0057:\n r0 = r7.m33564f();\n r6.f38031h = r0;\n r0 = r6.f38025b;\n r0 = r0 | 8;\n r6.f38025b = r0;\n goto L_0x0000;\n L_0x0064:\n r1 = r6.f38025b;\n r1 = r1 | 16;\n r6.f38025b = r1;\n r1 = r7.m33573o();\n r2 = r7.m33567i();\t Catch:{ IllegalArgumentException -> 0x0090 }\n switch(r2) {\n case 0: goto L_0x0099;\n case 1: goto L_0x0099;\n case 2: goto L_0x0099;\n case 3: goto L_0x0099;\n case 4: goto L_0x0099;\n default: goto L_0x0075;\n };\t Catch:{ IllegalArgumentException -> 0x0090 }\n L_0x0075:\n r3 = new java.lang.IllegalArgumentException;\t Catch:{ IllegalArgumentException -> 0x0090 }\n r4 = 36;\n r5 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x0090 }\n r5.<init>(r4);\t Catch:{ IllegalArgumentException -> 0x0090 }\n r2 = r5.append(r2);\t Catch:{ IllegalArgumentException -> 0x0090 }\n r4 = \" is not a valid enum Type\";\n r2 = r2.append(r4);\t Catch:{ IllegalArgumentException -> 0x0090 }\n r2 = r2.toString();\t Catch:{ IllegalArgumentException -> 0x0090 }\n r3.<init>(r2);\t Catch:{ IllegalArgumentException -> 0x0090 }\n throw r3;\t Catch:{ IllegalArgumentException -> 0x0090 }\n L_0x0090:\n r2 = move-exception;\n r7.m33562e(r1);\n r6.a(r7, r0);\n goto L_0x0000;\n L_0x0099:\n r6.f38032i = r2;\t Catch:{ IllegalArgumentException -> 0x0090 }\n r2 = r6.f38025b;\t Catch:{ IllegalArgumentException -> 0x0090 }\n r2 = r2 | 16;\n r6.f38025b = r2;\t Catch:{ IllegalArgumentException -> 0x0090 }\n goto L_0x0000;\n L_0x00a3:\n r0 = r7.m33563e();\n r6.f38033j = r0;\n r0 = r6.f38025b;\n r0 = r0 | 32;\n r6.f38025b = r0;\n goto L_0x0000;\n L_0x00b1:\n r0 = r7.m33563e();\n r6.f38034k = r0;\n r0 = r6.f38025b;\n r0 = r0 | 64;\n r6.f38025b = r0;\n goto L_0x0000;\n L_0x00bf:\n r0 = r6.f38035l;\n if (r0 != 0) goto L_0x00ca;\n L_0x00c3:\n r0 = new com.google.android.finsky.cv.a.cv;\n r0.<init>();\n r6.f38035l = r0;\n L_0x00ca:\n r0 = r6.f38035l;\n r7.m33552a(r0);\n goto L_0x0000;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.wireless.android.finsky.dfe.h.a.ae.b(com.google.protobuf.nano.a):com.google.wireless.android.finsky.dfe.h.a.ae\");\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 }", "protected int b(i var1_1, y.c.q var2_2, y.c.q var3_3, h var4_4, h var5_5, int var6_6, ArrayList var7_7, ArrayList var8_8, h var9_9, h var10_10) {\n block26 : {\n block25 : {\n var24_11 = o.p;\n this.c = var6_6;\n this.d = var2_2;\n this.e = var3_3;\n this.n = var1_1.h();\n this.o = var1_1.f();\n this.h = var1_1;\n this.i = new int[this.n];\n this.j = new int[this.n];\n this.k = new int[this.o];\n this.l = new int[this.o];\n this.m = new int[this.n];\n this.b = new Object[this.o];\n this.t = new int[this.n];\n this.r = new d[this.n];\n this.s = new d[this.n];\n this.f = var4_4;\n this.a = new a[this.n];\n this.q = new ArrayList<E>(var1_1.f());\n this.p = new I(this.o);\n var11_12 = 0;\n block0 : do {\n v0 = var11_12;\n block1 : while (v0 < var7_7.size()) {\n var12_15 = (a)var7_7.get(var11_12);\n v1 /* !! */ = var12_15.b();\n if (var24_11) break block25;\n var13_17 = v1 /* !! */ ;\n while (var13_17.f()) {\n var14_20 = var13_17.a();\n var15_23 = var14_20.b();\n this.a[var14_20.b()] = var12_15;\n this.i[var15_23] = var12_15.a();\n v0 = this.i[var15_23];\n if (var24_11) continue block1;\n if (v0 < 0) {\n throw new B(\"found negative capacity\");\n }\n var13_17.g();\n if (!var24_11) continue;\n }\n ++var11_12;\n if (!var24_11) continue block0;\n }\n break block0;\n break;\n } while (true);\n v1 /* !! */ = var11_13 = this.h.p();\n }\n while (var11_13.f()) {\n var12_15 = var11_13.a();\n this.r[var12_15.b()] = (d)var10_10.b(var12_15);\n this.s[var12_15.b()] = (d)var9_9.b(var12_15);\n var11_13.g();\n if (!var24_11) {\n if (!var24_11) continue;\n }\n break block26;\n }\n this.g = new u[this.o];\n }\n var11_13 = var1_1.o();\n while (var11_13.f()) {\n var12_15 = var11_13.e();\n v2 = this;\n if (!var24_11) {\n v2.g[var12_15.d()] = new u((y.c.q)var12_15, var12_15.d());\n var11_13.g();\n if (!var24_11) continue;\n }\n ** GOTO lbl65\n }\n block5 : do {\n v2 = this;\nlbl65: // 2 sources:\n var11_14 = var13_18 = v2.a();\n var12_16 = 0;\n var14_21 = 0;\n block6 : do {\n v3 = var14_21;\n v4 = var8_8.size();\n block7 : while (v3 < v4) {\n v5 = var8_8.get(var14_21);\n do {\n var15_24 = (ArrayList)v5;\n var16_26 = false;\n var17_27 = 0;\n var18_28 = 0;\n v6 = 0;\n if (!var24_11) {\n for (var19_29 = v1574606; var19_29 < var15_24.size(); ++var19_29) {\n block28 : {\n block27 : {\n var20_30 = (a)var15_24.get(var19_29);\n v3 = this.m[var20_30.b[0].b()];\n v4 = 1;\n if (var24_11) continue block7;\n if (v3 != v4 || this.m[var20_30.b[1].b()] != 1) continue;\n ++var12_16;\n var21_31 = this.s[var20_30.b[0].b()];\n var22_32 = 0;\n while (this.m[var21_31.b()] == 1) {\n var22_32 += var4_4.a(this.a[var21_31.b()].b(var21_31));\n var21_31 = this.s[var21_31.b()];\n if (!var24_11) {\n if (!var24_11) continue;\n }\n break block27;\n }\n var22_32 += var4_4.a(this.a[var21_31.b()].b(var21_31));\n }\n var23_33 = 0;\n var21_31 = this.s[var20_30.b[1].b()];\n while (this.m[var21_31.b()] == 1) {\n var23_33 += var4_4.a(this.a[var21_31.b()].b(var21_31));\n var21_31 = this.s[var21_31.b()];\n if (!var24_11) {\n if (!var24_11) continue;\n }\n break block28;\n }\n var23_33 += var4_4.a(this.a[var21_31.b()].b(var21_31));\n }\n if (var23_33 > 400 || var22_32 > 400) {\n block29 : {\n if (var23_33 < var22_32) {\n this.a(var20_30);\n if (!var24_11) break block29;\n }\n this.b(var20_30);\n }\n var16_26 = true;\n }\n var18_28 += var23_33;\n var17_27 += var22_32;\n if (!var24_11) continue;\n }\n if (!var16_26) {\n for (var19_29 = 0; var19_29 < var15_24.size(); ++var19_29) {\n var20_30 = (a)var15_24.get(var19_29);\n v3 = this.m[var20_30.b[0].b()];\n v4 = 1;\n if (var24_11) continue block7;\n if (v3 != v4 || this.m[var20_30.b[1].b()] != 1) continue;\n if (var18_28 < var17_27) {\n this.a(var20_30);\n if (!var24_11) continue;\n }\n this.b(var20_30);\n if (!var24_11) continue;\n }\n }\n ++var14_21;\n if (!var24_11) continue block6;\n }\n ** GOTO lbl133\n v6 = var12_16;\nlbl133: // 2 sources:\n if (v6 > 0) continue block5;\n v5 = this.h.p();\n } while (var24_11);\n }\n break;\n } while (true);\n break;\n } while (true);\n var13_19 = v5;\n while (var13_19.f()) {\n var14_22 = var13_19.a();\n v7 = var14_22.b();\n if (var24_11 != false) return v7;\n var15_25 = v7;\n var5_5.a((Object)var14_22, this.m[var15_25]);\n var13_19.g();\n if (!var24_11) continue;\n }\n v7 = var11_14;\n return v7;\n }", "public void c() {\n /*\n r4 = this;\n com.shopee.app.data.store.o r0 = r4.f16997c\n boolean r0 = r0.c()\n r1 = 1\n r2 = 0\n if (r0 == 0) goto L_0x000c\n L_0x000a:\n r0 = 0\n goto L_0x0023\n L_0x000c:\n com.shopee.app.data.store.o r0 = r4.f16997c\n boolean r0 = r0.a()\n if (r0 != 0) goto L_0x001c\n com.shopee.app.data.store.o r0 = r4.f16997c\n int r0 = r0.b()\n r2 = r0\n goto L_0x000a\n L_0x001c:\n com.shopee.app.data.store.o r0 = r4.f16997c\n int r2 = r0.e()\n r0 = 1\n L_0x0023:\n boolean r3 = r4.f16998d\n if (r3 == 0) goto L_0x0032\n if (r0 == 0) goto L_0x003a\n com.shopee.app.network.d.c.d r0 = new com.shopee.app.network.d.c.d\n r0.<init>()\n r0.a(r2, r1)\n goto L_0x003a\n L_0x0032:\n com.shopee.app.network.d.c.d r1 = new com.shopee.app.network.d.c.d\n r1.<init>()\n r1.a(r2, r0)\n L_0x003a:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.shopee.app.d.c.f.m.c():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 }", "public final synchronized void mo5320b() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r6 = this;\n monitor-enter(r6);\n r0 = r6.f24853c;\t Catch:{ all -> 0x004c }\n r1 = 0;\t Catch:{ all -> 0x004c }\n r2 = 0;\t Catch:{ all -> 0x004c }\n if (r0 == 0) goto L_0x0046;\t Catch:{ all -> 0x004c }\n L_0x0007:\n r0 = r6.f24851a;\t Catch:{ all -> 0x004c }\n if (r0 != 0) goto L_0x0013;\t Catch:{ all -> 0x004c }\n L_0x000b:\n r0 = r6.f24854d;\t Catch:{ all -> 0x004c }\n r3 = r6.f24853c;\t Catch:{ all -> 0x004c }\n r0.deleteFile(r3);\t Catch:{ all -> 0x004c }\n goto L_0x0046;\t Catch:{ all -> 0x004c }\n L_0x0013:\n r0 = com.google.android.m4b.maps.cg.bx.m23058b();\t Catch:{ all -> 0x004c }\n r3 = r6.f24854d;\t Catch:{ IOException -> 0x0032, all -> 0x002f }\n r4 = r6.f24853c;\t Catch:{ IOException -> 0x0032, all -> 0x002f }\n r3 = r3.openFileOutput(r4, r1);\t Catch:{ IOException -> 0x0032, all -> 0x002f }\n r4 = r6.f24851a;\t Catch:{ IOException -> 0x0033 }\n r4 = r4.m20837d();\t Catch:{ IOException -> 0x0033 }\n r3.write(r4);\t Catch:{ IOException -> 0x0033 }\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x004c }\n L_0x002b:\n com.google.android.m4b.maps.ap.C4655c.m20770a(r3);\t Catch:{ all -> 0x004c }\n goto L_0x0046;\n L_0x002f:\n r1 = move-exception;\n r3 = r2;\n goto L_0x003f;\n L_0x0032:\n r3 = r2;\n L_0x0033:\n r4 = r6.f24854d;\t Catch:{ all -> 0x003e }\n r5 = r6.f24853c;\t Catch:{ all -> 0x003e }\n r4.deleteFile(r5);\t Catch:{ all -> 0x003e }\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x004c }\n goto L_0x002b;\t Catch:{ all -> 0x004c }\n L_0x003e:\n r1 = move-exception;\t Catch:{ all -> 0x004c }\n L_0x003f:\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x004c }\n com.google.android.m4b.maps.ap.C4655c.m20770a(r3);\t Catch:{ all -> 0x004c }\n throw r1;\t Catch:{ all -> 0x004c }\n L_0x0046:\n r6.f24851a = r2;\t Catch:{ all -> 0x004c }\n r6.f24852b = r1;\t Catch:{ all -> 0x004c }\n monitor-exit(r6);\n return;\n L_0x004c:\n r0 = move-exception;\n monitor-exit(r6);\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.m4b.maps.cg.q.b():void\");\n }", "private void m25427g() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r2 = this;\n r0 = r2.f19111m;\n if (r0 == 0) goto L_0x000f;\n L_0x0004:\n r0 = r2.f19104f;\t Catch:{ Exception -> 0x000f }\n r0 = android.support.v4.content.C0396d.m1465a(r0);\t Catch:{ Exception -> 0x000f }\n r1 = r2.f19111m;\t Catch:{ Exception -> 0x000f }\n r0.m1468a(r1);\t Catch:{ Exception -> 0x000f }\n L_0x000f:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.ads.internal.adapters.w.g():void\");\n }", "private synchronized void m29549c() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r6 = this;\n monitor-enter(r6);\n r0 = r6.f24853c;\t Catch:{ all -> 0x0050 }\n if (r0 == 0) goto L_0x004b;\t Catch:{ all -> 0x0050 }\n L_0x0005:\n r0 = com.google.android.m4b.maps.cg.bx.m23056a();\t Catch:{ all -> 0x0050 }\n r1 = 0;\n r2 = r6.f24854d;\t Catch:{ IOException -> 0x0035, all -> 0x0030 }\n r3 = r6.f24853c;\t Catch:{ IOException -> 0x0035, all -> 0x0030 }\n r2 = r2.openFileInput(r3);\t Catch:{ IOException -> 0x0035, all -> 0x0030 }\n if (r2 == 0) goto L_0x0027;\n L_0x0014:\n r3 = new com.google.android.m4b.maps.ar.a;\t Catch:{ IOException -> 0x0036 }\n r4 = com.google.android.m4b.maps.de.af.f19891a;\t Catch:{ IOException -> 0x0036 }\n r3.<init>(r4);\t Catch:{ IOException -> 0x0036 }\n r6.f24851a = r3;\t Catch:{ IOException -> 0x0036 }\n r3 = r6.f24851a;\t Catch:{ IOException -> 0x0036 }\n r4 = com.google.android.m4b.maps.ap.C4655c.m20771a(r2);\t Catch:{ IOException -> 0x0036 }\n r3.m20819a(r4);\t Catch:{ IOException -> 0x0036 }\n goto L_0x0029;\t Catch:{ IOException -> 0x0036 }\n L_0x0027:\n r6.f24851a = r1;\t Catch:{ IOException -> 0x0036 }\n L_0x0029:\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x0050 }\n L_0x002c:\n com.google.android.m4b.maps.ap.C4655c.m20773b(r2);\t Catch:{ all -> 0x0050 }\n goto L_0x004b;\n L_0x0030:\n r2 = move-exception;\n r5 = r2;\n r2 = r1;\n r1 = r5;\n goto L_0x0044;\n L_0x0035:\n r2 = r1;\n L_0x0036:\n r6.f24851a = r1;\t Catch:{ all -> 0x0043 }\n r1 = r6.f24854d;\t Catch:{ all -> 0x0043 }\n r3 = r6.f24853c;\t Catch:{ all -> 0x0043 }\n r1.deleteFile(r3);\t Catch:{ all -> 0x0043 }\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x0050 }\n goto L_0x002c;\t Catch:{ all -> 0x0050 }\n L_0x0043:\n r1 = move-exception;\t Catch:{ all -> 0x0050 }\n L_0x0044:\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x0050 }\n com.google.android.m4b.maps.ap.C4655c.m20773b(r2);\t Catch:{ all -> 0x0050 }\n throw r1;\t Catch:{ all -> 0x0050 }\n L_0x004b:\n r0 = 1;\t Catch:{ all -> 0x0050 }\n r6.f24852b = r0;\t Catch:{ all -> 0x0050 }\n monitor-exit(r6);\n return;\n L_0x0050:\n r0 = move-exception;\n monitor-exit(r6);\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.m4b.maps.cg.q.c():void\");\n }", "protected void method_2145() {\r\n // $FF: Couldn't be decompiled\r\n }", "@androidx.annotation.Nullable\n /* renamed from: j */\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public final p005b.p096l.p097a.p151d.p152a.p154b.C3474b mo14822j(java.lang.String r9) {\n /*\n r8 = this;\n java.io.File r0 = new java.io.File\n java.io.File r1 = r8.mo14820g()\n r0.<init>(r1, r9)\n boolean r1 = r0.exists()\n r2 = 3\n r3 = 6\n r4 = 1\n r5 = 0\n r6 = 0\n if (r1 != 0) goto L_0x0022\n b.l.a.d.a.e.f r0 = f6563c\n java.lang.Object[] r1 = new java.lang.Object[r4]\n r1[r5] = r9\n java.lang.String r9 = \"Pack not found with pack name: %s\"\n r0.mo14884b(r2, r9, r1)\n L_0x001f:\n r9 = r6\n goto L_0x0093\n L_0x0022:\n java.io.File r1 = new java.io.File\n b.l.a.d.a.b.o1 r7 = r8.f6567b\n int r7 = r7.mo14797a()\n java.lang.String r7 = java.lang.String.valueOf(r7)\n r1.<init>(r0, r7)\n boolean r0 = r1.exists()\n r7 = 2\n if (r0 != 0) goto L_0x0050\n b.l.a.d.a.e.f r0 = f6563c\n java.lang.Object[] r1 = new java.lang.Object[r7]\n r1[r5] = r9\n b.l.a.d.a.b.o1 r9 = r8.f6567b\n int r9 = r9.mo14797a()\n java.lang.Integer r9 = java.lang.Integer.valueOf(r9)\n r1[r4] = r9\n java.lang.String r9 = \"Pack not found with pack name: %s app version: %s\"\n r0.mo14884b(r2, r9, r1)\n goto L_0x001f\n L_0x0050:\n java.io.File[] r0 = r1.listFiles()\n if (r0 == 0) goto L_0x007b\n int r1 = r0.length\n if (r1 != 0) goto L_0x005a\n goto L_0x007b\n L_0x005a:\n if (r1 <= r4) goto L_0x0074\n b.l.a.d.a.e.f r0 = f6563c\n java.lang.Object[] r1 = new java.lang.Object[r7]\n r1[r5] = r9\n b.l.a.d.a.b.o1 r9 = r8.f6567b\n int r9 = r9.mo14797a()\n java.lang.Integer r9 = java.lang.Integer.valueOf(r9)\n r1[r4] = r9\n java.lang.String r9 = \"Multiple pack versions found for pack name: %s app version: %s\"\n r0.mo14884b(r3, r9, r1)\n goto L_0x001f\n L_0x0074:\n r9 = r0[r5]\n java.lang.String r9 = r9.getCanonicalPath()\n goto L_0x0093\n L_0x007b:\n b.l.a.d.a.e.f r0 = f6563c\n java.lang.Object[] r1 = new java.lang.Object[r7]\n r1[r5] = r9\n b.l.a.d.a.b.o1 r9 = r8.f6567b\n int r9 = r9.mo14797a()\n java.lang.Integer r9 = java.lang.Integer.valueOf(r9)\n r1[r4] = r9\n java.lang.String r9 = \"No pack version found for pack name: %s app version: %s\"\n r0.mo14884b(r2, r9, r1)\n goto L_0x001f\n L_0x0093:\n if (r9 != 0) goto L_0x0096\n return r6\n L_0x0096:\n java.io.File r0 = new java.io.File\n java.lang.String r1 = \"assets\"\n r0.<init>(r9, r1)\n boolean r1 = r0.isDirectory()\n if (r1 != 0) goto L_0x00af\n b.l.a.d.a.e.f r9 = f6563c\n java.lang.Object[] r1 = new java.lang.Object[r4]\n r1[r5] = r0\n java.lang.String r0 = \"Failed to find assets directory: %s\"\n r9.mo14884b(r3, r0, r1)\n return r6\n L_0x00af:\n java.lang.String r0 = r0.getCanonicalPath()\n b.l.a.d.a.b.w r1 = new b.l.a.d.a.b.w\n r1.<init>(r5, r9, r0)\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p005b.p096l.p097a.p151d.p152a.p154b.C3544t.mo14822j(java.lang.String):b.l.a.d.a.b.b\");\n }", "public final void mo56977b() {\n /*\n r2 = this;\n com.ss.android.ugc.aweme.common.e r0 = r2.f67572c\n com.ss.android.ugc.aweme.feed.ui.masklayer2.a.i r0 = (com.p280ss.android.ugc.aweme.feed.p1238ui.masklayer2.p1239a.C28951i) r0\n if (r0 == 0) goto L_0x001a\n com.ss.android.ugc.aweme.common.a r1 = r2.f67571b\n com.ss.android.ugc.aweme.feed.ui.masklayer2.a.d r1 = (com.p280ss.android.ugc.aweme.feed.p1238ui.masklayer2.p1239a.C28944d) r1\n if (r1 == 0) goto L_0x0014\n java.lang.Object r1 = r1.getData()\n java.lang.String r1 = (java.lang.String) r1\n if (r1 != 0) goto L_0x0016\n L_0x0014:\n java.lang.String r1 = \"\"\n L_0x0016:\n r0.mo74240a(r1)\n return\n L_0x001a:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.p280ss.android.ugc.aweme.feed.p1238ui.masklayer2.p1239a.C28946e.mo56977b():void\");\n }", "private final com.google.android.finsky.verifier.p259a.p260a.C4709m m21920b(com.google.protobuf.nano.a r7) {\n /*\n r6 = this;\n L_0x0000:\n r0 = r7.a();\n switch(r0) {\n case 0: goto L_0x000d;\n case 10: goto L_0x000e;\n case 16: goto L_0x0015;\n case 26: goto L_0x0046;\n case 34: goto L_0x0053;\n default: goto L_0x0007;\n };\n L_0x0007:\n r0 = super.m4918a(r7, r0);\n if (r0 != 0) goto L_0x0000;\n L_0x000d:\n return r6;\n L_0x000e:\n r0 = r7.f();\n r6.f24221c = r0;\n goto L_0x0000;\n L_0x0015:\n r1 = r7.o();\n r2 = r7.i();\t Catch:{ IllegalArgumentException -> 0x003b }\n switch(r2) {\n case 0: goto L_0x0043;\n case 1: goto L_0x0020;\n case 2: goto L_0x0043;\n default: goto L_0x0020;\n };\t Catch:{ IllegalArgumentException -> 0x003b }\n L_0x0020:\n r3 = new java.lang.IllegalArgumentException;\t Catch:{ IllegalArgumentException -> 0x003b }\n r4 = 44;\n r5 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x003b }\n r5.<init>(r4);\t Catch:{ IllegalArgumentException -> 0x003b }\n r2 = r5.append(r2);\t Catch:{ IllegalArgumentException -> 0x003b }\n r4 = \" is not a valid enum ResourceType\";\n r2 = r2.append(r4);\t Catch:{ IllegalArgumentException -> 0x003b }\n r2 = r2.toString();\t Catch:{ IllegalArgumentException -> 0x003b }\n r3.<init>(r2);\t Catch:{ IllegalArgumentException -> 0x003b }\n throw r3;\t Catch:{ IllegalArgumentException -> 0x003b }\n L_0x003b:\n r2 = move-exception;\n r7.e(r1);\n r6.m4918a(r7, r0);\n goto L_0x0000;\n L_0x0043:\n r6.f24222d = r2;\t Catch:{ IllegalArgumentException -> 0x003b }\n goto L_0x0000;\n L_0x0046:\n r0 = r7.g();\n r6.f24223e = r0;\n r0 = r6.f24220b;\n r0 = r0 | 1;\n r6.f24220b = r0;\n goto L_0x0000;\n L_0x0053:\n r0 = r7.f();\n r6.f24224f = r0;\n r0 = r6.f24220b;\n r0 = r0 | 2;\n r6.f24220b = r0;\n goto L_0x0000;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.finsky.verifier.a.a.m.b(com.google.protobuf.nano.a):com.google.android.finsky.verifier.a.a.m\");\n }", "protected void method_2247() {\r\n // $FF: Couldn't be decompiled\r\n }", "private final com.google.wireless.android.finsky.dfe.p505c.p506a.ec m35437b(com.google.protobuf.nano.C7213a r8) {\n /*\n r7 = this;\n r1 = 0;\n L_0x0001:\n r0 = r8.m33550a();\n switch(r0) {\n case 0: goto L_0x000e;\n case 8: goto L_0x000f;\n case 16: goto L_0x004c;\n case 26: goto L_0x006f;\n case 34: goto L_0x007c;\n default: goto L_0x0008;\n };\n L_0x0008:\n r0 = super.a(r8, r0);\n if (r0 != 0) goto L_0x0001;\n L_0x000e:\n return r7;\n L_0x000f:\n r2 = r7.f37533a;\n r2 = r2 | 1;\n r7.f37533a = r2;\n r2 = r8.m33573o();\n r3 = r8.m33567i();\t Catch:{ IllegalArgumentException -> 0x003b }\n switch(r3) {\n case 0: goto L_0x0043;\n case 1: goto L_0x0043;\n default: goto L_0x0020;\n };\t Catch:{ IllegalArgumentException -> 0x003b }\n L_0x0020:\n r4 = new java.lang.IllegalArgumentException;\t Catch:{ IllegalArgumentException -> 0x003b }\n r5 = 42;\n r6 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x003b }\n r6.<init>(r5);\t Catch:{ IllegalArgumentException -> 0x003b }\n r3 = r6.append(r3);\t Catch:{ IllegalArgumentException -> 0x003b }\n r5 = \" is not a valid enum ResultCode\";\n r3 = r3.append(r5);\t Catch:{ IllegalArgumentException -> 0x003b }\n r3 = r3.toString();\t Catch:{ IllegalArgumentException -> 0x003b }\n r4.<init>(r3);\t Catch:{ IllegalArgumentException -> 0x003b }\n throw r4;\t Catch:{ IllegalArgumentException -> 0x003b }\n L_0x003b:\n r3 = move-exception;\n r8.m33562e(r2);\n r7.a(r8, r0);\n goto L_0x0001;\n L_0x0043:\n r7.f37534b = r3;\t Catch:{ IllegalArgumentException -> 0x003b }\n r3 = r7.f37533a;\t Catch:{ IllegalArgumentException -> 0x003b }\n r3 = r3 | 1;\n r7.f37533a = r3;\t Catch:{ IllegalArgumentException -> 0x003b }\n goto L_0x0001;\n L_0x004c:\n r2 = r7.f37533a;\n r2 = r2 | 2;\n r7.f37533a = r2;\n r2 = r8.m33573o();\n r3 = r8.m33560d();\t Catch:{ IllegalArgumentException -> 0x0067 }\n r3 = com.google.wireless.android.finsky.dfe.p505c.p506a.dp.m35391a(r3);\t Catch:{ IllegalArgumentException -> 0x0067 }\n r7.f37535c = r3;\t Catch:{ IllegalArgumentException -> 0x0067 }\n r3 = r7.f37533a;\t Catch:{ IllegalArgumentException -> 0x0067 }\n r3 = r3 | 2;\n r7.f37533a = r3;\t Catch:{ IllegalArgumentException -> 0x0067 }\n goto L_0x0001;\n L_0x0067:\n r3 = move-exception;\n r8.m33562e(r2);\n r7.a(r8, r0);\n goto L_0x0001;\n L_0x006f:\n r0 = r8.m33565g();\n r7.f37536d = r0;\n r0 = r7.f37533a;\n r0 = r0 | 4;\n r7.f37533a = r0;\n goto L_0x0001;\n L_0x007c:\n r0 = 34;\n r2 = com.google.protobuf.nano.C7222l.m33624a(r8, r0);\n r0 = r7.f37537e;\n if (r0 != 0) goto L_0x00a8;\n L_0x0086:\n r0 = r1;\n L_0x0087:\n r2 = r2 + r0;\n r2 = new com.google.wireless.android.finsky.dfe.p505c.p506a.ed[r2];\n if (r0 == 0) goto L_0x0091;\n L_0x008c:\n r3 = r7.f37537e;\n java.lang.System.arraycopy(r3, r1, r2, r1, r0);\n L_0x0091:\n r3 = r2.length;\n r3 = r3 + -1;\n if (r0 >= r3) goto L_0x00ac;\n L_0x0096:\n r3 = new com.google.wireless.android.finsky.dfe.c.a.ed;\n r3.<init>();\n r2[r0] = r3;\n r3 = r2[r0];\n r8.m33552a(r3);\n r8.m33550a();\n r0 = r0 + 1;\n goto L_0x0091;\n L_0x00a8:\n r0 = r7.f37537e;\n r0 = r0.length;\n goto L_0x0087;\n L_0x00ac:\n r3 = new com.google.wireless.android.finsky.dfe.c.a.ed;\n r3.<init>();\n r2[r0] = r3;\n r0 = r2[r0];\n r8.m33552a(r0);\n r7.f37537e = r2;\n goto L_0x0001;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.wireless.android.finsky.dfe.c.a.ec.b(com.google.protobuf.nano.a):com.google.wireless.android.finsky.dfe.c.a.ec\");\n }", "private void method_7083() {\r\n // $FF: Couldn't be decompiled\r\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 }", "public void method_2139() {\r\n // $FF: Couldn't be decompiled\r\n }", "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 }", "TACBlock optimise(TACBlock code);", "private boolean m2248a(java.lang.String r3, com.onesignal.La.C0596a r4) {\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/318857719.run(Unknown Source)\n*/\n /*\n r2 = this;\n r0 = 0;\n r1 = 1;\n java.lang.Float.parseFloat(r3);\t Catch:{ Throwable -> 0x0007 }\n r3 = 1;\n goto L_0x0008;\n L_0x0007:\n r3 = 0;\n L_0x0008:\n if (r3 != 0) goto L_0x0017;\n L_0x000a:\n r3 = com.onesignal.sa.C0650i.ERROR;\n r1 = \"Missing Google Project number!\\nPlease enter a Google Project number / Sender ID on under App Settings > Android > Configuration on the OneSignal dashboard.\";\n com.onesignal.sa.m1656a(r3, r1);\n r3 = 0;\n r1 = -6;\n r4.mo1392a(r3, r1);\n return r0;\n L_0x0017:\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.onesignal.Pa.a(java.lang.String, com.onesignal.La$a):boolean\");\n }", "private void b044904490449щ0449щ() {\n /*\n r7 = this;\n r0 = new rrrrrr.ccrcrc;\n r1 = new java.lang.StringBuilder;\n r1.<init>();\n r2 = r7.bнн043Dннн;\n r2 = com.immersion.aws.analytics.ImmrAnalytics.b044C044C044C044Cьь(r2);\n r2 = r2.getFilesDir();\n r1 = r1.append(r2);\n r2 = java.io.File.separator;\n r1 = r1.append(r2);\n L_0x001b:\n r2 = 1;\n switch(r2) {\n case 0: goto L_0x001b;\n case 1: goto L_0x0024;\n default: goto L_0x001f;\n };\n L_0x001f:\n r2 = 0;\n switch(r2) {\n case 0: goto L_0x0024;\n case 1: goto L_0x001b;\n default: goto L_0x0023;\n };\n L_0x0023:\n goto L_0x001f;\n L_0x0024:\n r2 = \"3HC4C-01.txt\";\n r1 = r1.append(r2);\n r1 = r1.toString();\n r0.<init>(r1);\n r0.load();\n L_0x0034:\n r1 = r0.size();\n if (r1 <= 0) goto L_0x007a;\n L_0x003a:\n r1 = r0.peek();\n r2 = new rrrrrr.rcccrr;\n r2.<init>();\n r3 = r7.bнн043Dннн;\n r3 = com.immersion.aws.analytics.ImmrAnalytics.b044Cь044C044Cьь(r3);\n monitor-enter(r3);\n r4 = r7.bнн043Dннн;\t Catch:{ all -> 0x0074 }\n r4 = com.immersion.aws.analytics.ImmrAnalytics.bь044C044C044Cьь(r4);\t Catch:{ all -> 0x0074 }\n r4 = r4.bЛ041B041BЛ041BЛ;\t Catch:{ all -> 0x0074 }\n r5 = r7.bнн043Dннн;\t Catch:{ all -> 0x0074 }\n r5 = com.immersion.aws.analytics.ImmrAnalytics.bь044C044C044Cьь(r5);\t Catch:{ all -> 0x0074 }\n r5 = r5.b041B041B041BЛ041BЛ;\t Catch:{ all -> 0x0074 }\n r6 = r7.bнн043Dннн;\t Catch:{ all -> 0x0074 }\n r6 = com.immersion.aws.analytics.ImmrAnalytics.bь044C044C044Cьь(r6);\t Catch:{ all -> 0x0074 }\n r6 = r6.bЛЛЛ041B041BЛ;\t Catch:{ all -> 0x0074 }\n monitor-exit(r3);\t Catch:{ all -> 0x0074 }\n r1 = r2.sendHttpRequestFromCache(r4, r5, r6, r1);\n if (r1 == 0) goto L_0x0077;\n L_0x0069:\n if (r4 == 0) goto L_0x0077;\n L_0x006b:\n if (r5 == 0) goto L_0x0077;\n L_0x006d:\n r0.remove();\n r0.save();\n goto L_0x0034;\n L_0x0074:\n r0 = move-exception;\n monitor-exit(r3);\t Catch:{ all -> 0x0074 }\n throw r0;\n L_0x0077:\n r0.save();\n L_0x007a:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: rrrrrr.cccccr.b044904490449щ0449щ():void\");\n }", "static void method_1148() {\r\n // $FF: Couldn't be decompiled\r\n }", "public com.google.cX a(com.google.cM r5) {\n /*\n r4 = this;\n r0 = 0;\n r1 = com.google.bA.b;\n r2 = com.google.cM.k();\n if (r5 != r2) goto L_0x000a;\n L_0x0009:\n return r4;\n L_0x000a:\n r2 = r4.h;\n if (r2 != 0) goto L_0x003f;\n L_0x000e:\n r2 = com.google.cM.a(r5);\n r2 = r2.isEmpty();\n if (r2 != 0) goto L_0x0079;\n L_0x0018:\n r2 = r4.g;\n r2 = r2.isEmpty();\n if (r2 == 0) goto L_0x002e;\n L_0x0020:\n r2 = com.google.cM.a(r5);\n r4.g = r2;\n r2 = r4.f;\n r2 = r2 & -2;\n r4.f = r2;\n if (r1 == 0) goto L_0x003a;\n L_0x002e:\n r4.j();\n r2 = r4.g;\n r3 = com.google.cM.a(r5);\n r2.addAll(r3);\n L_0x003a:\n r4.g();\n if (r1 == 0) goto L_0x0079;\n L_0x003f:\n r2 = com.google.cM.a(r5);\n r2 = r2.isEmpty();\n if (r2 != 0) goto L_0x0079;\n L_0x0049:\n r2 = r4.h;\n r2 = r2.i();\n if (r2 == 0) goto L_0x0070;\n L_0x0051:\n r2 = r4.h;\n r2.b();\n r4.h = r0;\n r2 = com.google.cM.a(r5);\n r4.g = r2;\n r2 = r4.f;\n r2 = r2 & -2;\n r4.f = r2;\n r2 = com.google.bL.d;\n if (r2 == 0) goto L_0x006c;\n L_0x0068:\n r0 = r4.b();\n L_0x006c:\n r4.h = r0;\n if (r1 == 0) goto L_0x0079;\n L_0x0070:\n r0 = r4.h;\n r1 = com.google.cM.a(r5);\n r0.a(r1);\n L_0x0079:\n r4.a(r5);\n r0 = r5.getUnknownFields();\n r4.a(r0);\n goto L_0x0009;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.cX.a(com.google.cM):com.google.cX\");\n }", "protected void method_2045(class_1045 param1) {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_2537() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_2537() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_28() {\r\n // $FF: Couldn't be decompiled\r\n }", "public synchronized void m6495a(int r6, int r7) throws fr.pcsoft.wdjava.geo.C0918i {\n /* JADX: method processing error */\n/*\nError: jadx.core.utils.exceptions.JadxRuntimeException: Exception block dominator not found, method:fr.pcsoft.wdjava.geo.a.b.a(int, int):void. bs: [B:13:0x001d, B:18:0x0027, B:23:0x0031, B:28:0x003a, B:44:0x005d, B:55:0x006c, B:64:0x0079]\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:86)\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/70807318.run(Unknown Source)\n*/\n /*\n r5 = this;\n r4 = 2;\n r1 = 0;\n r0 = 1;\n monitor-enter(r5);\n r5.m6487e();\t Catch:{ all -> 0x0053 }\n switch(r6) {\n case 2: goto L_0x0089;\n case 3: goto L_0x000a;\n case 4: goto L_0x0013;\n default: goto L_0x000a;\n };\t Catch:{ all -> 0x0053 }\n L_0x000a:\n r0 = f2486z;\t Catch:{ all -> 0x0053 }\n r1 = 3;\t Catch:{ all -> 0x0053 }\n r0 = r0[r1];\t Catch:{ all -> 0x0053 }\n r5.f2488b = r0;\t Catch:{ all -> 0x0053 }\n L_0x0011:\n monitor-exit(r5);\n return;\n L_0x0013:\n r3 = new android.location.Criteria;\t Catch:{ all -> 0x0053 }\n r3.<init>();\t Catch:{ all -> 0x0053 }\n r2 = r7 & 2;\n if (r2 != r4) goto L_0x0058;\n L_0x001c:\n r2 = 1;\n r3.setAccuracy(r2);\t Catch:{ i -> 0x0056 }\n L_0x0020:\n r2 = r7 & 128;\n r4 = 128; // 0x80 float:1.794E-43 double:6.32E-322;\n if (r2 != r4) goto L_0x0065;\n L_0x0026:\n r2 = 3;\n r3.setPowerRequirement(r2);\t Catch:{ i -> 0x0063 }\n L_0x002a:\n r2 = r7 & 8;\n r4 = 8;\n if (r2 != r4) goto L_0x007f;\n L_0x0030:\n r2 = r0;\n L_0x0031:\n r3.setAltitudeRequired(r2);\t Catch:{ i -> 0x0081 }\n r2 = r7 & 4;\n r4 = 4;\n if (r2 != r4) goto L_0x0083;\n L_0x0039:\n r2 = r0;\n L_0x003a:\n r3.setAltitudeRequired(r2);\t Catch:{ i -> 0x0085 }\n r2 = r7 & 16;\n r4 = 16;\n if (r2 != r4) goto L_0x0087;\n L_0x0043:\n r3.setAltitudeRequired(r0);\t Catch:{ all -> 0x0053 }\n r0 = 0;\t Catch:{ all -> 0x0053 }\n r0 = r5.m6485a(r0);\t Catch:{ all -> 0x0053 }\n r1 = 1;\t Catch:{ all -> 0x0053 }\n r0 = r0.getBestProvider(r3, r1);\t Catch:{ all -> 0x0053 }\n r5.f2488b = r0;\t Catch:{ all -> 0x0053 }\n goto L_0x0011;\n L_0x0053:\n r0 = move-exception;\n monitor-exit(r5);\n throw r0;\n L_0x0056:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0053 }\n L_0x0058:\n r2 = r7 & 1;\n if (r2 != r0) goto L_0x0020;\n L_0x005c:\n r2 = 2;\n r3.setAccuracy(r2);\t Catch:{ i -> 0x0061 }\n goto L_0x0020;\n L_0x0061:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0053 }\n L_0x0063:\n r0 = move-exception;\t Catch:{ all -> 0x0053 }\n throw r0;\t Catch:{ all -> 0x0053 }\n L_0x0065:\n r2 = r7 & 64;\n r4 = 64;\n if (r2 != r4) goto L_0x0072;\n L_0x006b:\n r2 = 2;\n r3.setPowerRequirement(r2);\t Catch:{ i -> 0x0070 }\n goto L_0x002a;\n L_0x0070:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0053 }\n L_0x0072:\n r2 = r7 & 32;\n r4 = 32;\n if (r2 != r4) goto L_0x002a;\n L_0x0078:\n r2 = 1;\n r3.setPowerRequirement(r2);\t Catch:{ i -> 0x007d }\n goto L_0x002a;\n L_0x007d:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0053 }\n L_0x007f:\n r2 = r1;\t Catch:{ all -> 0x0053 }\n goto L_0x0031;\t Catch:{ all -> 0x0053 }\n L_0x0081:\n r0 = move-exception;\t Catch:{ all -> 0x0053 }\n throw r0;\t Catch:{ all -> 0x0053 }\n L_0x0083:\n r2 = r1;\t Catch:{ all -> 0x0053 }\n goto L_0x003a;\t Catch:{ all -> 0x0053 }\n L_0x0085:\n r0 = move-exception;\t Catch:{ all -> 0x0053 }\n throw r0;\t Catch:{ all -> 0x0053 }\n L_0x0087:\n r0 = r1;\t Catch:{ all -> 0x0053 }\n goto L_0x0043;\t Catch:{ all -> 0x0053 }\n L_0x0089:\n r0 = f2486z;\t Catch:{ all -> 0x0053 }\n r1 = 2;\t Catch:{ all -> 0x0053 }\n r0 = r0[r1];\t Catch:{ all -> 0x0053 }\n r5.f2488b = r0;\t Catch:{ all -> 0x0053 }\n goto L_0x0011;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: fr.pcsoft.wdjava.geo.a.b.a(int, int):void\");\n }", "public void method_7081() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_6338() {\r\n // $FF: Couldn't be decompiled\r\n }", "private void method_7082(class_1293 param1) {\r\n // $FF: Couldn't be decompiled\r\n }", "public final synchronized com.google.android.m4b.maps.bu.C4910a m21843a(java.lang.String r10) {\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/79094208.run(Unknown Source)\n*/\n /*\n r9 = this;\n monitor-enter(r9);\n r0 = r9.f17909e;\t Catch:{ all -> 0x0056 }\n r1 = 0;\n if (r0 != 0) goto L_0x0008;\n L_0x0006:\n monitor-exit(r9);\n return r1;\n L_0x0008:\n r0 = r9.f17907c;\t Catch:{ all -> 0x0056 }\n r2 = com.google.android.m4b.maps.az.C4733b.m21060a(r10);\t Catch:{ all -> 0x0056 }\n r0 = r0.m21933a(r2, r1);\t Catch:{ all -> 0x0056 }\n if (r0 == 0) goto L_0x0054;\t Catch:{ all -> 0x0056 }\n L_0x0014:\n r2 = r0.length;\t Catch:{ all -> 0x0056 }\n r3 = 9;\t Catch:{ all -> 0x0056 }\n if (r2 <= r3) goto L_0x0054;\t Catch:{ all -> 0x0056 }\n L_0x0019:\n r2 = 0;\t Catch:{ all -> 0x0056 }\n r2 = r0[r2];\t Catch:{ all -> 0x0056 }\n r4 = 1;\t Catch:{ all -> 0x0056 }\n if (r2 == r4) goto L_0x0020;\t Catch:{ all -> 0x0056 }\n L_0x001f:\n goto L_0x0054;\t Catch:{ all -> 0x0056 }\n L_0x0020:\n r5 = com.google.android.m4b.maps.bs.C4891e.m21914c(r0, r4);\t Catch:{ all -> 0x0056 }\n r2 = new com.google.android.m4b.maps.ar.a;\t Catch:{ all -> 0x0056 }\n r7 = com.google.android.m4b.maps.de.C5350x.f20104b;\t Catch:{ all -> 0x0056 }\n r2.<init>(r7);\t Catch:{ all -> 0x0056 }\n r7 = new java.io.ByteArrayInputStream;\t Catch:{ IOException -> 0x0052 }\n r8 = r0.length;\t Catch:{ IOException -> 0x0052 }\n r8 = r8 - r3;\t Catch:{ IOException -> 0x0052 }\n r7.<init>(r0, r3, r8);\t Catch:{ IOException -> 0x0052 }\n r2.m20818a(r7);\t Catch:{ IOException -> 0x0052 }\n r0 = 2;\n r0 = r2.m20843h(r0);\t Catch:{ all -> 0x0056 }\n r10 = r10.equals(r0);\t Catch:{ all -> 0x0056 }\n if (r10 != 0) goto L_0x0042;\n L_0x0040:\n monitor-exit(r9);\n return r1;\n L_0x0042:\n r10 = new com.google.android.m4b.maps.bu.a;\t Catch:{ all -> 0x0056 }\n r10.<init>();\t Catch:{ all -> 0x0056 }\n r10.m22018a(r4);\t Catch:{ all -> 0x0056 }\n r10.m22020a(r2);\t Catch:{ all -> 0x0056 }\n r10.m22016a(r5);\t Catch:{ all -> 0x0056 }\n monitor-exit(r9);\n return r10;\n L_0x0052:\n monitor-exit(r9);\n return r1;\n L_0x0054:\n monitor-exit(r9);\n return r1;\n L_0x0056:\n r10 = move-exception;\n monitor-exit(r9);\n throw r10;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.m4b.maps.bs.b.a(java.lang.String):com.google.android.m4b.maps.bu.a\");\n }", "private final com.google.android.play.p179a.p352a.C6210u m28673b(com.google.protobuf.nano.a r7) {\n /*\n r6 = this;\n L_0x0000:\n r0 = r7.a();\n switch(r0) {\n case 0: goto L_0x000d;\n case 10: goto L_0x000e;\n case 16: goto L_0x001b;\n case 26: goto L_0x0058;\n case 34: goto L_0x0065;\n case 42: goto L_0x0072;\n default: goto L_0x0007;\n };\n L_0x0007:\n r0 = super.m4918a(r7, r0);\n if (r0 != 0) goto L_0x0000;\n L_0x000d:\n return r6;\n L_0x000e:\n r0 = r7.f();\n r6.f31049b = r0;\n r0 = r6.f31048a;\n r0 = r0 | 1;\n r6.f31048a = r0;\n goto L_0x0000;\n L_0x001b:\n r1 = r6.f31048a;\n r1 = r1 | 2;\n r6.f31048a = r1;\n r1 = r7.o();\n r2 = r7.i();\t Catch:{ IllegalArgumentException -> 0x0047 }\n switch(r2) {\n case 0: goto L_0x004f;\n case 1: goto L_0x004f;\n case 2: goto L_0x004f;\n case 3: goto L_0x004f;\n case 4: goto L_0x004f;\n case 5: goto L_0x004f;\n case 6: goto L_0x004f;\n default: goto L_0x002c;\n };\t Catch:{ IllegalArgumentException -> 0x0047 }\n L_0x002c:\n r3 = new java.lang.IllegalArgumentException;\t Catch:{ IllegalArgumentException -> 0x0047 }\n r4 = 38;\n r5 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x0047 }\n r5.<init>(r4);\t Catch:{ IllegalArgumentException -> 0x0047 }\n r2 = r5.append(r2);\t Catch:{ IllegalArgumentException -> 0x0047 }\n r4 = \" is not a valid enum OsType\";\n r2 = r2.append(r4);\t Catch:{ IllegalArgumentException -> 0x0047 }\n r2 = r2.toString();\t Catch:{ IllegalArgumentException -> 0x0047 }\n r3.<init>(r2);\t Catch:{ IllegalArgumentException -> 0x0047 }\n throw r3;\t Catch:{ IllegalArgumentException -> 0x0047 }\n L_0x0047:\n r2 = move-exception;\n r7.e(r1);\n r6.m4918a(r7, r0);\n goto L_0x0000;\n L_0x004f:\n r6.f31050c = r2;\t Catch:{ IllegalArgumentException -> 0x0047 }\n r2 = r6.f31048a;\t Catch:{ IllegalArgumentException -> 0x0047 }\n r2 = r2 | 2;\n r6.f31048a = r2;\t Catch:{ IllegalArgumentException -> 0x0047 }\n goto L_0x0000;\n L_0x0058:\n r0 = r7.f();\n r6.f31051d = r0;\n r0 = r6.f31048a;\n r0 = r0 | 4;\n r6.f31048a = r0;\n goto L_0x0000;\n L_0x0065:\n r0 = r7.f();\n r6.f31052e = r0;\n r0 = r6.f31048a;\n r0 = r0 | 8;\n r6.f31048a = r0;\n goto L_0x0000;\n L_0x0072:\n r0 = r7.f();\n r6.f31053f = r0;\n r0 = r6.f31048a;\n r0 = r0 | 16;\n r6.f31048a = r0;\n goto L_0x0000;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.play.a.a.u.b(com.google.protobuf.nano.a):com.google.android.play.a.a.u\");\n }", "AnonymousClass2(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.2.<init>(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.2.<init>(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }", "public void state(final JFormatter f) {\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 // com.strobel.assembler.metadata.MethodBodyParseException: An error occurred while parsing the bytecode of method 'com/sun/codemodel/JTryBlock.state:(Lcom/sun/codemodel/JFormatter;)V'.\n // at com.strobel.assembler.metadata.MethodReader.readBody(MethodReader.java:65)\n // at com.strobel.assembler.metadata.MethodDefinition.tryLoadBody(MethodDefinition.java:722)\n // at com.strobel.assembler.metadata.MethodDefinition.getBody(MethodDefinition.java:83)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:202)\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 // Caused by: java.lang.ArrayIndexOutOfBoundsException: -1\n // at java.util.ArrayList.elementData(Unknown Source)\n // at java.util.ArrayList.get(Unknown Source)\n // at com.strobel.assembler.ir.ConstantPool.get(ConstantPool.java:80)\n // at com.strobel.assembler.metadata.ClassFileReader$Scope.lookupConstant(ClassFileReader.java:1313)\n // at com.strobel.assembler.metadata.MethodReader.readBodyCore(MethodReader.java:286)\n // at com.strobel.assembler.metadata.MethodReader.readBody(MethodReader.java:62)\n // ... 16 more\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "@org.jetbrains.annotations.NotNull\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public static /* synthetic */ com.bitcoin.mwallet.core.models.p009tx.slputxo.SlpUtxoSelection copy$default(com.bitcoin.mwallet.core.models.p009tx.slputxo.SlpUtxoSelection r4, com.bitcoin.mwallet.core.models.slp.Slp r5, java.util.List<kotlin.ULong> r6, com.bitcoin.bitcoink.p008tx.Satoshis r7, com.bitcoin.bitcoink.p008tx.Satoshis r8, java.util.List<com.bitcoin.mwallet.core.models.p009tx.utxo.Utxo> r9, com.bitcoin.mwallet.core.models.p009tx.slputxo.SlpUtxoSelection.Error r10, int r11, java.lang.Object r12) {\n /*\n r12 = r11 & 1\n if (r12 == 0) goto L_0x0006\n com.bitcoin.mwallet.core.models.slp.Slp r5 = r4.token\n L_0x0006:\n r12 = r11 & 2\n if (r12 == 0) goto L_0x000c\n java.util.List<kotlin.ULong> r6 = r4.quantities\n L_0x000c:\n r12 = r6\n r6 = r11 & 4\n if (r6 == 0) goto L_0x0013\n com.bitcoin.bitcoink.tx.Satoshis r7 = r4.fee\n L_0x0013:\n r0 = r7\n r6 = r11 & 8\n if (r6 == 0) goto L_0x001a\n com.bitcoin.bitcoink.tx.Satoshis r8 = r4.change\n L_0x001a:\n r1 = r8\n r6 = r11 & 16\n if (r6 == 0) goto L_0x0021\n java.util.List<com.bitcoin.mwallet.core.models.tx.utxo.Utxo> r9 = r4.utxos\n L_0x0021:\n r2 = r9\n r6 = r11 & 32\n if (r6 == 0) goto L_0x0028\n com.bitcoin.mwallet.core.models.tx.slputxo.SlpUtxoSelection$Error r10 = r4.error\n L_0x0028:\n r3 = r10\n r6 = r4\n r7 = r5\n r8 = r12\n r9 = r0\n r10 = r1\n r11 = r2\n r12 = r3\n com.bitcoin.mwallet.core.models.tx.slputxo.SlpUtxoSelection r4 = r6.copy(r7, r8, r9, r10, r11, r12)\n return r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.bitcoin.mwallet.core.models.p009tx.slputxo.SlpUtxoSelection.copy$default(com.bitcoin.mwallet.core.models.tx.slputxo.SlpUtxoSelection, com.bitcoin.mwallet.core.models.slp.Slp, java.util.List, com.bitcoin.bitcoink.tx.Satoshis, com.bitcoin.bitcoink.tx.Satoshis, java.util.List, com.bitcoin.mwallet.core.models.tx.slputxo.SlpUtxoSelection$Error, int, java.lang.Object):com.bitcoin.mwallet.core.models.tx.slputxo.SlpUtxoSelection\");\n }", "public void a(IBlockAccess paramard, BlockPosition paramdt)\r\n/* 119: */ {\r\n/* 120:148 */ bdv localbdv = e(paramard, paramdt);\r\n/* 121:149 */ if (localbdv != null)\r\n/* 122: */ {\r\n/* 123:150 */ Block localbec = localbdv.b();\r\n/* 124:151 */ BlockType localatr = localbec.getType();\r\n/* 125:152 */ if ((localatr == this) || (localatr.getMaterial() == Material.air)) {\r\n/* 126:153 */ return;\r\n/* 127: */ }\r\n/* 128:156 */ float f = localbdv.a(0.0F);\r\n/* 129:157 */ if (localbdv.d()) {\r\n/* 130:158 */ f = 1.0F - f;\r\n/* 131: */ }\r\n/* 132:160 */ localatr.a(paramard, paramdt);\r\n/* 133:161 */ if ((localatr == BlockList.J) || (localatr == BlockList.F)) {\r\n/* 134:162 */ f = 0.0F;\r\n/* 135: */ }\r\n/* 136:164 */ EnumDirection localej = localbdv.e();\r\n/* 137:165 */ this.B = (localatr.z() - localej.g() * f);\r\n/* 138:166 */ this.C = (localatr.B() - localej.h() * f);\r\n/* 139:167 */ this.D = (localatr.D() - localej.i() * f);\r\n/* 140:168 */ this.E = (localatr.A() - localej.g() * f);\r\n/* 141:169 */ this.F = (localatr.C() - localej.h() * f);\r\n/* 142:170 */ this.G = (localatr.E() - localej.i() * f);\r\n/* 143: */ }\r\n/* 144: */ }", "private final void asB() {\n /*\n r6 = this;\n r0 = r6.cxs;\n r1 = r6.asp();\n r1 = r1.cCg;\n r2 = \"binding.depositAmountEdit\";\n kotlin.jvm.internal.i.e(r1, r2);\n r2 = r0 instanceof com.iqoption.core.microservices.billing.response.deposit.cashboxitem.d;\n r3 = 0;\n r4 = 1;\n if (r2 == 0) goto L_0x002b;\n L_0x0013:\n r2 = r0;\n r2 = (com.iqoption.core.microservices.billing.response.deposit.cashboxitem.d) r2;\n r2 = r2.aaH();\n if (r2 == 0) goto L_0x0027;\n L_0x001c:\n r2 = r2.aaT();\n if (r2 == 0) goto L_0x0027;\n L_0x0022:\n r2 = r2.size();\n goto L_0x0028;\n L_0x0027:\n r2 = 0;\n L_0x0028:\n if (r2 != 0) goto L_0x002b;\n L_0x002a:\n goto L_0x0040;\n L_0x002b:\n if (r0 == 0) goto L_0x0032;\n L_0x002d:\n r2 = r0.ZL();\n goto L_0x0033;\n L_0x0032:\n r2 = 0;\n L_0x0033:\n r5 = com.iqoption.core.microservices.billing.response.deposit.cashboxitem.CashboxItemType.USER_CARD;\n if (r2 != r5) goto L_0x0038;\n L_0x0037:\n goto L_0x0040;\n L_0x0038:\n r2 = r6.aoJ();\n if (r2 == 0) goto L_0x003f;\n L_0x003e:\n goto L_0x0040;\n L_0x003f:\n r4 = 0;\n L_0x0040:\n r2 = \"binding.depositPresetsList\";\n if (r4 == 0) goto L_0x0053;\n L_0x0044:\n r0 = r6.asp();\n r0 = r0.cCr;\n kotlin.jvm.internal.i.e(r0, r2);\n r0 = (android.view.View) r0;\n com.iqoption.core.ext.a.ak(r0);\n goto L_0x006b;\n L_0x0053:\n r3 = r6.asp();\n r3 = r3.cCr;\n kotlin.jvm.internal.i.e(r3, r2);\n r3 = (android.view.View) r3;\n com.iqoption.core.ext.a.al(r3);\n r2 = new com.iqoption.deposit.light.perform.c$s;\n r2.<init>(r6, r0);\n r2 = (android.view.View.OnFocusChangeListener) r2;\n r1.setOnFocusChangeListener(r2);\n L_0x006b:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.iqoption.deposit.light.perform.c.asB():void\");\n }", "public static int m22557b(java.lang.String r1) {\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 r0 = com.google.android.gms.internal.measurement.dr.m11788a(r1);\t Catch:{ zzyn -> 0x0005 }\n goto L_0x000c;\n L_0x0005:\n r0 = com.google.android.gms.internal.measurement.zzvo.f10281a;\n r1 = r1.getBytes(r0);\n r0 = r1.length;\n L_0x000c:\n r1 = m22576g(r0);\n r1 = r1 + r0;\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.measurement.zzut.b(java.lang.String):int\");\n }", "static void method_2226() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2141() {\r\n // $FF: Couldn't be decompiled\r\n }", "AnonymousClass1(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.1.<init>(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.1.<init>(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }", "protected void method_2246(class_1045 param1) {\r\n // $FF: Couldn't be decompiled\r\n }", "public int c(Block parambec)\r\n/* 119: */ {\r\n/* 120:131 */ return 0;\r\n/* 121: */ }", "public void method_2046() {\r\n // $FF: Couldn't be decompiled\r\n }", "private synchronized void m3985g() {\n /*\n r8 = this;\n monitor-enter(r8);\n r2 = java.lang.Thread.currentThread();\t Catch:{ all -> 0x0063 }\n r3 = r8.f2114f;\t Catch:{ all -> 0x0063 }\n r3 = r3.mo1186c();\t Catch:{ all -> 0x0063 }\n r2 = r2.equals(r3);\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x0021;\n L_0x0011:\n r2 = r8.f2114f;\t Catch:{ all -> 0x0063 }\n r2 = r2.mo1185b();\t Catch:{ all -> 0x0063 }\n r3 = new com.google.analytics.tracking.android.aa;\t Catch:{ all -> 0x0063 }\n r3.<init>(r8);\t Catch:{ all -> 0x0063 }\n r2.add(r3);\t Catch:{ all -> 0x0063 }\n L_0x001f:\n monitor-exit(r8);\n return;\n L_0x0021:\n r2 = r8.f2122n;\t Catch:{ all -> 0x0063 }\n if (r2 == 0) goto L_0x0028;\n L_0x0025:\n r8.m3999d();\t Catch:{ all -> 0x0063 }\n L_0x0028:\n r2 = com.google.analytics.tracking.android.ab.f1966a;\t Catch:{ all -> 0x0063 }\n r3 = r8.f2110b;\t Catch:{ all -> 0x0063 }\n r3 = r3.ordinal();\t Catch:{ all -> 0x0063 }\n r2 = r2[r3];\t Catch:{ all -> 0x0063 }\n switch(r2) {\n case 1: goto L_0x0036;\n case 2: goto L_0x006e;\n case 3: goto L_0x00aa;\n default: goto L_0x0035;\n };\t Catch:{ all -> 0x0063 }\n L_0x0035:\n goto L_0x001f;\n L_0x0036:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.isEmpty();\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x0066;\n L_0x003e:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.poll();\t Catch:{ all -> 0x0063 }\n r0 = r2;\n r0 = (com.google.analytics.tracking.android.af) r0;\t Catch:{ all -> 0x0063 }\n r7 = r0;\n r2 = \"Sending hit to store\";\n com.google.analytics.tracking.android.av.m3818e(r2);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2112d;\t Catch:{ all -> 0x0063 }\n r3 = r7.m3743a();\t Catch:{ all -> 0x0063 }\n r4 = r7.m3744b();\t Catch:{ all -> 0x0063 }\n r6 = r7.m3745c();\t Catch:{ all -> 0x0063 }\n r7 = r7.m3746d();\t Catch:{ all -> 0x0063 }\n r2.mo1197a(r3, r4, r6, r7);\t Catch:{ all -> 0x0063 }\n goto L_0x0036;\n L_0x0063:\n r2 = move-exception;\n monitor-exit(r8);\n throw r2;\n L_0x0066:\n r2 = r8.f2121m;\t Catch:{ all -> 0x0063 }\n if (r2 == 0) goto L_0x001f;\n L_0x006a:\n r8.m3987h();\t Catch:{ all -> 0x0063 }\n goto L_0x001f;\n L_0x006e:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.isEmpty();\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x00a0;\n L_0x0076:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.peek();\t Catch:{ all -> 0x0063 }\n r0 = r2;\n r0 = (com.google.analytics.tracking.android.af) r0;\t Catch:{ all -> 0x0063 }\n r7 = r0;\n r2 = \"Sending hit to service\";\n com.google.analytics.tracking.android.av.m3818e(r2);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2111c;\t Catch:{ all -> 0x0063 }\n r3 = r7.m3743a();\t Catch:{ all -> 0x0063 }\n r4 = r7.m3744b();\t Catch:{ all -> 0x0063 }\n r6 = r7.m3745c();\t Catch:{ all -> 0x0063 }\n r7 = r7.m3746d();\t Catch:{ all -> 0x0063 }\n r2.mo1204a(r3, r4, r6, r7);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2.poll();\t Catch:{ all -> 0x0063 }\n goto L_0x006e;\n L_0x00a0:\n r2 = r8.f2123o;\t Catch:{ all -> 0x0063 }\n r2 = r2.mo1198a();\t Catch:{ all -> 0x0063 }\n r8.f2109a = r2;\t Catch:{ all -> 0x0063 }\n goto L_0x001f;\n L_0x00aa:\n r2 = \"Need to reconnect\";\n com.google.analytics.tracking.android.av.m3818e(r2);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.isEmpty();\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x001f;\n L_0x00b7:\n r8.m3991j();\t Catch:{ all -> 0x0063 }\n goto L_0x001f;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.analytics.tracking.android.y.g():void\");\n }", "public boolean mo3969a() {\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 r4 = this;\n r0 = r4.f19005h;\n if (r0 != 0) goto L_0x0011;\n L_0x0004:\n r0 = r4.f19004g;\n if (r0 == 0) goto L_0x000f;\n L_0x0008:\n r0 = r4.f19004g;\n r1 = com.facebook.ads.C1700b.f5123e;\n r0.mo1313a(r4, r1);\n L_0x000f:\n r0 = 0;\n return r0;\n L_0x0011:\n r0 = new android.content.Intent;\n r1 = r4.f19002e;\n r2 = com.facebook.ads.AudienceNetworkActivity.class;\n r0.<init>(r1, r2);\n r1 = \"predefinedOrientationKey\";\n r2 = r4.m25306b();\n r0.putExtra(r1, r2);\n r1 = \"uniqueId\";\n r2 = r4.f18999b;\n r0.putExtra(r1, r2);\n r1 = \"placementId\";\n r2 = r4.f19000c;\n r0.putExtra(r1, r2);\n r1 = \"requestTime\";\n r2 = r4.f19001d;\n r0.putExtra(r1, r2);\n r1 = \"viewType\";\n r2 = r4.f19009l;\n r0.putExtra(r1, r2);\n r1 = \"useCache\";\n r2 = r4.f19010m;\n r0.putExtra(r1, r2);\n r1 = r4.f19008k;\n if (r1 == 0) goto L_0x0052;\n L_0x004a:\n r1 = \"ad_data_bundle\";\n r2 = r4.f19008k;\n r0.putExtra(r1, r2);\n goto L_0x005b;\n L_0x0052:\n r1 = r4.f19006i;\n if (r1 == 0) goto L_0x005b;\n L_0x0056:\n r1 = r4.f19006i;\n r1.m18953a(r0);\n L_0x005b:\n r1 = 268435456; // 0x10000000 float:2.5243549E-29 double:1.32624737E-315;\n r0.addFlags(r1);\n r1 = r4.f19002e;\t Catch:{ ActivityNotFoundException -> 0x0066 }\n r1.startActivity(r0);\t Catch:{ ActivityNotFoundException -> 0x0066 }\n goto L_0x0072;\n L_0x0066:\n r1 = r4.f19002e;\n r2 = com.facebook.ads.InterstitialAdActivity.class;\n r0.setClass(r1, r2);\n r1 = r4.f19002e;\n r1.startActivity(r0);\n L_0x0072:\n r0 = 1;\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.ads.internal.adapters.k.a():boolean\");\n }", "public static boolean m19464a(java.lang.String r3, int[] r4) {\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 r0 = android.text.TextUtils.isEmpty(r3);\n r1 = 0;\n if (r0 == 0) goto L_0x0008;\n L_0x0007:\n return r1;\n L_0x0008:\n r0 = r4.length;\n r2 = 2;\n if (r0 == r2) goto L_0x000d;\n L_0x000c:\n return r1;\n L_0x000d:\n r0 = \"x\";\n r3 = r3.split(r0);\n r0 = r3.length;\n if (r0 == r2) goto L_0x0017;\n L_0x0016:\n return r1;\n L_0x0017:\n r0 = r3[r1];\t Catch:{ NumberFormatException -> 0x0029 }\n r0 = java.lang.Integer.parseInt(r0);\t Catch:{ NumberFormatException -> 0x0029 }\n r4[r1] = r0;\t Catch:{ NumberFormatException -> 0x0029 }\n r0 = 1;\t Catch:{ NumberFormatException -> 0x0029 }\n r3 = r3[r0];\t Catch:{ NumberFormatException -> 0x0029 }\n r3 = java.lang.Integer.parseInt(r3);\t Catch:{ NumberFormatException -> 0x0029 }\n r4[r0] = r3;\t Catch:{ NumberFormatException -> 0x0029 }\n return r0;\n L_0x0029:\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.arp.a(java.lang.String, int[]):boolean\");\n }", "public void method_2113() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected final /* synthetic */ java.lang.Object run() {\n /*\n r4 = this;\n r0 = 1;\n r1 = 0;\n r2 = com.tencent.mm.plugin.appbrand.b.c.this;\n r2 = r2.chu();\n r3 = com.tencent.mm.plugin.appbrand.b.c.this;\n r3 = r3.iKh;\n if (r2 != r3) goto L_0x0022;\n L_0x000e:\n r2 = com.tencent.mm.plugin.appbrand.b.c.this;\n r2 = r2.iKh;\n r2 = r2.iKy;\n r2 = r2 & 1;\n if (r2 <= 0) goto L_0x0020;\n L_0x0018:\n r2 = r0;\n L_0x0019:\n if (r2 == 0) goto L_0x0022;\n L_0x001b:\n r0 = java.lang.Boolean.valueOf(r0);\n return r0;\n L_0x0020:\n r2 = r1;\n goto L_0x0019;\n L_0x0022:\n r0 = r1;\n goto L_0x001b;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.mm.plugin.appbrand.b.c.5.run():java.lang.Object\");\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 }", "private final void m710e() {\n /*\n r12 = this;\n akn r0 = r12.f531p\n akl r0 = r0.f601d\n if (r0 == 0) goto L_0x0155\n boolean r1 = r0.f580d\n r2 = -9223372036854775807(0x8000000000000001, double:-4.9E-324)\n if (r1 == 0) goto L_0x0017\n aws r1 = r0.f577a\n long r4 = r1.mo1486c()\n r8 = r4\n goto L_0x0019\n L_0x0017:\n r8 = r2\n L_0x0019:\n int r1 = (r8 > r2 ? 1 : (r8 == r2 ? 0 : -1))\n if (r1 != 0) goto L_0x0122\n ajf r1 = r12.f528m\n akn r2 = r12.f531p\n akl r2 = r2.f602e\n akx r3 = r1.f445c\n r4 = 0\n if (r3 == 0) goto L_0x008a\n boolean r3 = r3.mo486w()\n if (r3 != 0) goto L_0x008a\n akx r3 = r1.f445c\n boolean r3 = r3.mo485v()\n if (r3 == 0) goto L_0x0037\n goto L_0x0042\n L_0x0037:\n if (r0 != r2) goto L_0x008a\n akx r2 = r1.f445c\n boolean r2 = r2.mo359g()\n if (r2 == 0) goto L_0x0042\n goto L_0x008a\n L_0x0042:\n bkr r2 = r1.f446d\n long r2 = r2.mo379b()\n boolean r5 = r1.f447e\n if (r5 == 0) goto L_0x0068\n blf r5 = r1.f443a\n long r5 = r5.mo379b()\n int r7 = (r2 > r5 ? 1 : (r2 == r5 ? 0 : -1))\n if (r7 >= 0) goto L_0x005c\n blf r2 = r1.f443a\n r2.mo2109d()\n goto L_0x0096\n L_0x005c:\n r1.f447e = r4\n boolean r5 = r1.f448f\n if (r5 == 0) goto L_0x0068\n blf r5 = r1.f443a\n r5.mo2107a()\n L_0x0068:\n blf r5 = r1.f443a\n r5.mo2108a(r2)\n bkr r2 = r1.f446d\n akq r2 = r2.mo376Q()\n blf r3 = r1.f443a\n akq r3 = r3.f4280a\n boolean r3 = r2.equals(r3)\n if (r3 != 0) goto L_0x0096\n blf r3 = r1.f443a\n r3.mo378a(r2)\n aje r3 = r1.f444b\n ake r3 = (p000.ake) r3\n r3.m694a(r2, r4)\n goto L_0x0096\n L_0x008a:\n r2 = 1\n r1.f447e = r2\n boolean r2 = r1.f448f\n if (r2 == 0) goto L_0x0096\n blf r2 = r1.f443a\n r2.mo2107a()\n L_0x0096:\n long r1 = r1.mo379b()\n r12.f513D = r1\n long r0 = r0.mo440b(r1)\n akp r2 = r12.f533r\n long r2 = r2.f623m\n java.util.ArrayList r5 = r12.f530o\n boolean r5 = r5.isEmpty()\n if (r5 != 0) goto L_0x011d\n akp r5 = r12.f533r\n awt r5 = r5.f612b\n boolean r5 = r5.mo1504a()\n if (r5 != 0) goto L_0x011d\n akp r5 = r12.f533r\n long r6 = r5.f613c\n int r8 = (r6 > r2 ? 1 : (r6 == r2 ? 0 : -1))\n if (r8 != 0) goto L_0x00c5\n boolean r6 = r12.f515F\n if (r6 == 0) goto L_0x00c5\n r6 = -1\n long r2 = r2 + r6\n L_0x00c5:\n r12.f515F = r4\n alh r4 = r5.f611a\n awt r5 = r5.f612b\n java.lang.Object r5 = r5.f2566a\n int r4 = r4.mo525a(r5)\n int r5 = r12.f514E\n r6 = 0\n if (r5 <= 0) goto L_0x00e1\n java.util.ArrayList r7 = r12.f530o\n int r5 = r5 + -1\n java.lang.Object r5 = r7.get(r5)\n akb r5 = (p000.akb) r5\n goto L_0x00e3\n L_0x00e1:\n L_0x00e2:\n r5 = r6\n L_0x00e3:\n if (r5 != 0) goto L_0x00e6\n goto L_0x0109\n L_0x00e6:\n int r5 = r5.f502a\n if (r4 >= 0) goto L_0x00eb\n L_0x00ea:\n goto L_0x00f4\n L_0x00eb:\n if (r4 != 0) goto L_0x0109\n r7 = 0\n int r5 = (r2 > r7 ? 1 : (r2 == r7 ? 0 : -1))\n if (r5 >= 0) goto L_0x0109\n goto L_0x00ea\n L_0x00f4:\n int r5 = r12.f514E\n int r5 = r5 + -1\n r12.f514E = r5\n if (r5 <= 0) goto L_0x0108\n java.util.ArrayList r7 = r12.f530o\n int r5 = r5 + -1\n java.lang.Object r5 = r7.get(r5)\n akb r5 = (p000.akb) r5\n goto L_0x00e3\n L_0x0108:\n goto L_0x00e2\n L_0x0109:\n int r2 = r12.f514E\n java.util.ArrayList r3 = r12.f530o\n int r3 = r3.size()\n if (r2 >= r3) goto L_0x011d\n java.util.ArrayList r2 = r12.f530o\n int r3 = r12.f514E\n java.lang.Object r2 = r2.get(r3)\n akb r2 = (p000.akb) r2\n L_0x011d:\n akp r2 = r12.f533r\n r2.f623m = r0\n goto L_0x0140\n L_0x0122:\n r12.m691a(r8)\n akp r0 = r12.f533r\n long r0 = r0.f623m\n int r2 = (r8 > r0 ? 1 : (r8 == r0 ? 0 : -1))\n if (r2 == 0) goto L_0x0140\n akp r0 = r12.f533r\n awt r7 = r0.f612b\n long r10 = r0.f614d\n r6 = r12\n akp r0 = r6.m686a(r7, r8, r10)\n r12.f533r = r0\n akc r0 = r12.f529n\n r1 = 4\n r0.mo409b(r1)\n L_0x0140:\n akn r0 = r12.f531p\n akl r0 = r0.f603f\n akp r1 = r12.f533r\n long r2 = r0.mo442c()\n r1.f621k = r2\n akp r0 = r12.f533r\n long r1 = r12.m719n()\n r0.f622l = r1\n return\n L_0x0155:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p000.ake.m710e():void\");\n }", "final com.google.bV a(java.util.Map r14) {\n /*\n r13_this = this;\n r6 = f;\n if (r14 == 0) goto L_0x013c;\n L_0x0004:\n r0 = com.google.fm.TRY_HARDER;\n r0 = r14.containsKey(r0);\n if (r0 == 0) goto L_0x013c;\n L_0x000c:\n r0 = 1;\n r2 = r0;\n L_0x000e:\n if (r14 == 0) goto L_0x0140;\n L_0x0010:\n r0 = com.google.fm.PURE_BARCODE;\n r0 = r14.containsKey(r0);\n if (r0 == 0) goto L_0x0140;\n L_0x0018:\n r0 = 1;\n L_0x0019:\n r1 = r13.b;\n r7 = r1.f();\n r1 = r13.b;\n r8 = r1.b();\n r1 = r7 * 3;\n r1 = r1 / 228;\n r3 = 3;\n if (r1 < r3) goto L_0x002e;\n L_0x002c:\n if (r2 == 0) goto L_0x002f;\n L_0x002e:\n r1 = 3;\n L_0x002f:\n r2 = 0;\n r3 = 5;\n r9 = new int[r3];\n r4 = r1 + -1;\n r5 = r1;\n L_0x0036:\n if (r4 >= r7) goto L_0x0127;\n L_0x0038:\n if (r2 != 0) goto L_0x0127;\n L_0x003a:\n r1 = 0;\n r3 = 0;\n r9[r1] = r3;\n r1 = 1;\n r3 = 0;\n r9[r1] = r3;\n r1 = 2;\n r3 = 0;\n r9[r1] = r3;\n r1 = 3;\n r3 = 0;\n r9[r1] = r3;\n r1 = 4;\n r3 = 0;\n r9[r1] = r3;\n r1 = 0;\n r3 = 0;\n L_0x0050:\n if (r3 >= r8) goto L_0x010d;\n L_0x0052:\n r10 = r13.b;\n r10 = r10.a(r3, r4);\n if (r10 == 0) goto L_0x0069;\n L_0x005a:\n r10 = r1 & 1;\n r11 = 1;\n if (r10 != r11) goto L_0x0061;\n L_0x005f:\n r1 = r1 + 1;\n L_0x0061:\n r10 = r9[r1];\n r10 = r10 + 1;\n r9[r1] = r10;\n if (r6 == 0) goto L_0x0109;\n L_0x0069:\n r10 = r1 & 1;\n if (r10 != 0) goto L_0x0103;\n L_0x006d:\n r10 = 4;\n if (r1 != r10) goto L_0x00f9;\n L_0x0070:\n r1 = a(r9);\n if (r1 == 0) goto L_0x015f;\n L_0x0076:\n r1 = r13.a(r9, r4, r3, r0);\n if (r1 == 0) goto L_0x0159;\n L_0x007c:\n r5 = 2;\n r1 = r13.a;\n if (r1 == 0) goto L_0x0156;\n L_0x0081:\n r1 = r13.b();\n if (r6 == 0) goto L_0x00c2;\n L_0x0087:\n r2 = r13.c();\n r10 = 2;\n r10 = r9[r10];\n if (r2 <= r10) goto L_0x0152;\n L_0x0090:\n r3 = 2;\n r3 = r9[r3];\n r2 = r2 - r3;\n r2 = r2 - r5;\n r3 = r4 + r2;\n r2 = r8 + -1;\n L_0x0099:\n if (r6 == 0) goto L_0x014e;\n L_0x009b:\n r4 = r5;\n r12 = r3;\n r3 = r1;\n r1 = r2;\n r2 = r12;\n L_0x00a0:\n r5 = 0;\n r10 = 2;\n r10 = r9[r10];\n r9[r5] = r10;\n r5 = 1;\n r10 = 3;\n r10 = r9[r10];\n r9[r5] = r10;\n r5 = 2;\n r10 = 4;\n r10 = r9[r10];\n r9[r5] = r10;\n r5 = 3;\n r10 = 1;\n r9[r5] = r10;\n r5 = 4;\n r10 = 0;\n r9[r5] = r10;\n r5 = 3;\n if (r6 == 0) goto L_0x0147;\n L_0x00bd:\n r5 = r4;\n r4 = r2;\n r12 = r3;\n r3 = r1;\n r1 = r12;\n L_0x00c2:\n r2 = 0;\n r10 = 0;\n r11 = 0;\n r9[r10] = r11;\n r10 = 1;\n r11 = 0;\n r9[r10] = r11;\n r10 = 2;\n r11 = 0;\n r9[r10] = r11;\n r10 = 3;\n r11 = 0;\n r9[r10] = r11;\n r10 = 4;\n r11 = 0;\n r9[r10] = r11;\n if (r6 == 0) goto L_0x0143;\n L_0x00d9:\n r2 = 0;\n r10 = 2;\n r10 = r9[r10];\n r9[r2] = r10;\n r2 = 1;\n r10 = 3;\n r10 = r9[r10];\n r9[r2] = r10;\n r2 = 2;\n r10 = 4;\n r10 = r9[r10];\n r9[r2] = r10;\n r2 = 3;\n r10 = 1;\n r9[r2] = r10;\n r2 = 4;\n r10 = 0;\n r9[r2] = r10;\n r2 = 3;\n if (r6 == 0) goto L_0x0143;\n L_0x00f6:\n r12 = r2;\n r2 = r1;\n r1 = r12;\n L_0x00f9:\n r1 = r1 + 1;\n r10 = r9[r1];\n r10 = r10 + 1;\n r9[r1] = r10;\n if (r6 == 0) goto L_0x0109;\n L_0x0103:\n r10 = r9[r1];\n r10 = r10 + 1;\n r9[r1] = r10;\n L_0x0109:\n r3 = r3 + 1;\n if (r6 == 0) goto L_0x0050;\n L_0x010d:\n r1 = a(r9);\n if (r1 == 0) goto L_0x0124;\n L_0x0113:\n r1 = r13.a(r9, r4, r8, r0);\n if (r1 == 0) goto L_0x0124;\n L_0x0119:\n r1 = 0;\n r5 = r9[r1];\n r1 = r13.a;\n if (r1 == 0) goto L_0x0124;\n L_0x0120:\n r2 = r13.b();\n L_0x0124:\n r4 = r4 + r5;\n if (r6 == 0) goto L_0x0036;\n L_0x0127:\n r0 = r13.a();\n com.google.bm.a(r0);\n r1 = new com.google.bV;\n r1.<init>(r0);\n r0 = com.google.gC.a;\n if (r0 == 0) goto L_0x013b;\n L_0x0137:\n r0 = r6 + 1;\n f = r0;\n L_0x013b:\n return r1;\n L_0x013c:\n r0 = 0;\n r2 = r0;\n goto L_0x000e;\n L_0x0140:\n r0 = 0;\n goto L_0x0019;\n L_0x0143:\n r12 = r2;\n r2 = r1;\n r1 = r12;\n goto L_0x0109;\n L_0x0147:\n r12 = r1;\n r1 = r5;\n r5 = r4;\n r4 = r2;\n r2 = r3;\n r3 = r12;\n goto L_0x0109;\n L_0x014e:\n r4 = r3;\n r3 = r2;\n goto L_0x00c2;\n L_0x0152:\n r2 = r3;\n r3 = r4;\n goto L_0x0099;\n L_0x0156:\n r1 = r2;\n goto L_0x0087;\n L_0x0159:\n r1 = r3;\n r3 = r2;\n r2 = r4;\n r4 = r5;\n goto L_0x00a0;\n L_0x015f:\n r1 = r2;\n goto L_0x00d9;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.bj.a(java.util.Map):com.google.bV\");\n }", "public static void m5812a(java.lang.String r0, java.lang.String r1, java.lang.String r2) {\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 r2 = new com.crashlytics.android.answers.AddToCartEvent;\n r2.<init>();\n r2.putItemType(r0);\n r0 = java.lang.Long.parseLong(r1);\t Catch:{ Exception -> 0x0013 }\n r0 = java.math.BigDecimal.valueOf(r0);\t Catch:{ Exception -> 0x0013 }\n r2.putItemPrice(r0);\t Catch:{ Exception -> 0x0013 }\n L_0x0013:\n r0 = java.util.Locale.getDefault();\n r0 = java.util.Currency.getInstance(r0);\n r2.putCurrency(r0);\n r0 = com.crashlytics.android.answers.Answers.getInstance();\n r0.logAddToCart(r2);\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.cuvora.carinfo.helpers.d.a(java.lang.String, java.lang.String, java.lang.String):void\");\n }", "protected static android.graphics.Bitmap m6543a(int r1, int r2) {\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/79094208.run(Unknown Source)\n*/\n /*\n r0 = android.graphics.Bitmap.Config.ARGB_8888;\t Catch:{ OutOfMemoryError -> 0x0007 }\n r0 = android.graphics.Bitmap.createBitmap(r1, r2, r0);\t Catch:{ OutOfMemoryError -> 0x0007 }\n return r0;\n L_0x0007:\n java.lang.System.gc();\n r0 = android.graphics.Bitmap.Config.ARGB_8888;\n r1 = android.graphics.Bitmap.createBitmap(r1, r2, r0);\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.shimmer.ShimmerFrameLayout.a(int, int):android.graphics.Bitmap\");\n }", "private boolean method_2253(class_1033 param1) {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_7086() {\r\n // $FF: Couldn't be decompiled\r\n }", "AnonymousClass3(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.3.<init>(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.3.<init>(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }", "private static void m13381a(long r3, float 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.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 r0 = com.foursquare.internal.data.db.C1916a.getDatabase();\n r0.beginTransaction();\t Catch:{ Exception -> 0x001f }\n r1 = \"INSERT INTO battery_watcher (timestamp, level) VALUES (?, ?)\";\t Catch:{ Exception -> 0x001f }\n r1 = r0.compileStatement(r1);\t Catch:{ Exception -> 0x001f }\n r2 = 1;\t Catch:{ Exception -> 0x001f }\n r1.bindLong(r2, r3);\t Catch:{ Exception -> 0x001f }\n r3 = 2;\t Catch:{ Exception -> 0x001f }\n r4 = (double) r5;\t Catch:{ Exception -> 0x001f }\n r1.bindDouble(r3, r4);\t Catch:{ Exception -> 0x001f }\n r1.execute();\t Catch:{ Exception -> 0x001f }\n r0.setTransactionSuccessful();\t Catch:{ Exception -> 0x001f }\n goto L_0x0026;\n L_0x001d:\n r3 = move-exception;\n goto L_0x002a;\n L_0x001f:\n r3 = f10646a;\t Catch:{ all -> 0x001d }\n r4 = \"Issue adding location to battery history\";\t Catch:{ all -> 0x001d }\n com.foursquare.internal.util.FsLog.m6807d(r3, r4);\t Catch:{ all -> 0x001d }\n L_0x0026:\n r0.endTransaction();\n return;\n L_0x002a:\n r0.endTransaction();\n throw r3;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.foursquare.pilgrim.e.a(long, float):void\");\n }", "private c b(c blk, int i) {\n/* 585 */ int w = blk.g;\n/* 586 */ int h = blk.h;\n/* */ \n/* */ \n/* 589 */ if (blk.a() != 4) {\n/* 590 */ if (this.j == null || this.j.a() != 4) {\n/* 591 */ this.j = (c)new d();\n/* */ }\n/* 593 */ this.j.g = w;\n/* 594 */ this.j.h = h;\n/* 595 */ this.j.e = blk.e;\n/* 596 */ this.j.f = blk.f;\n/* 597 */ blk = this.j;\n/* */ } \n/* */ \n/* */ \n/* 601 */ float[] outdata = (float[])blk.b();\n/* */ \n/* */ \n/* 604 */ if (outdata == null || outdata.length < w * h) {\n/* 605 */ outdata = new float[h * w];\n/* 606 */ blk.a(outdata);\n/* */ } \n/* */ \n/* */ \n/* 610 */ if (i >= 0 && i <= 2) {\n/* */ int j;\n/* */ \n/* */ \n/* 614 */ if (this.m == null)\n/* 615 */ this.m = new e(); \n/* 616 */ if (this.n == null)\n/* 617 */ this.n = new e(); \n/* 618 */ if (this.o == null)\n/* 619 */ this.o = new e(); \n/* 620 */ this.o.g = blk.g;\n/* 621 */ this.o.h = blk.h;\n/* 622 */ this.o.e = blk.e;\n/* 623 */ this.o.f = blk.f;\n/* */ \n/* */ \n/* 626 */ this.m = (e)this.e.getInternCompData((c)this.m, 0);\n/* 627 */ int[] data0 = (int[])this.m.b();\n/* 628 */ this.n = (e)this.e.getInternCompData((c)this.n, 1);\n/* 629 */ int[] data1 = (int[])this.n.b();\n/* 630 */ this.o = (e)this.e.getInternCompData((c)this.o, 2);\n/* 631 */ int[] data2 = (int[])this.o.b();\n/* */ \n/* */ \n/* 634 */ blk.k = (this.m.k || this.n.k || this.o.k);\n/* */ \n/* 636 */ blk.i = 0;\n/* 637 */ blk.j = w;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 642 */ int k = w * h - 1;\n/* 643 */ int k0 = this.m.i + (h - 1) * this.m.j + w - 1;\n/* 644 */ int k1 = this.n.i + (h - 1) * this.n.j + w - 1;\n/* 645 */ int k2 = this.o.i + (h - 1) * this.o.j + w - 1;\n/* */ \n/* 647 */ switch (i) {\n/* */ \n/* */ case 0:\n/* 650 */ for (j = h - 1; j >= 0; j--) {\n/* 651 */ for (int mink = k - w; k > mink; k--, k0--, k1--, k2--) {\n/* 652 */ outdata[k] = 0.299F * data0[k0] + 0.587F * data1[k1] + 0.114F * data2[k2];\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 658 */ k0 -= this.m.j - w;\n/* 659 */ k1 -= this.n.j - w;\n/* 660 */ k2 -= this.o.j - w;\n/* */ } \n/* */ break;\n/* */ \n/* */ \n/* */ case 1:\n/* 666 */ for (j = h - 1; j >= 0; j--) {\n/* 667 */ for (int mink = k - w; k > mink; k--, k0--, k1--, k2--) {\n/* 668 */ outdata[k] = -0.16875F * data0[k0] - 0.33126F * data1[k1] + 0.5F * data2[k2];\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 674 */ k0 -= this.m.j - w;\n/* 675 */ k1 -= this.n.j - w;\n/* 676 */ k2 -= this.o.j - w;\n/* */ } \n/* */ break;\n/* */ \n/* */ \n/* */ case 2:\n/* 682 */ for (j = h - 1; j >= 0; j--) {\n/* 683 */ for (int mink = k - w; k > mink; k--, k0--, k1--, k2--) {\n/* 684 */ outdata[k] = 0.5F * data0[k0] - 0.41869F * data1[k1] - 0.08131F * data2[k2];\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 690 */ k0 -= this.m.j - w;\n/* 691 */ k1 -= this.n.j - w;\n/* 692 */ k2 -= this.o.j - w;\n/* */ } \n/* */ break;\n/* */ } \n/* */ } else {\n/* 697 */ if (i >= 3) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 702 */ e indb = new e(blk.e, blk.f, w, h);\n/* */ \n/* */ \n/* */ \n/* */ \n/* 707 */ this.e.getInternCompData((c)indb, i);\n/* 708 */ int[] indata = (int[])indb.b();\n/* */ \n/* */ \n/* 711 */ int k = w * h - 1;\n/* 712 */ int k0 = indb.i + (h - 1) * indb.j + w - 1;\n/* 713 */ for (int j = h - 1; j >= 0; j--) {\n/* 714 */ for (int mink = k - w; k > mink; k--, k0--) {\n/* 715 */ outdata[k] = indata[k0];\n/* */ }\n/* */ \n/* 718 */ k0 += indb.g - w;\n/* */ } \n/* */ \n/* */ \n/* 722 */ blk.k = indb.k;\n/* 723 */ blk.i = 0;\n/* 724 */ blk.j = w;\n/* 725 */ return blk;\n/* */ } \n/* */ \n/* */ \n/* 729 */ throw new IllegalArgumentException();\n/* */ } \n/* 731 */ return blk;\n/* */ }", "public final int mo11683a(com.google.android.gms.internal.ads.bci r11, com.google.android.gms.internal.ads.bcn r12) {\n /*\n r10 = this;\n L_0x0000:\n int r12 = r10.f3925e\n r0 = -1\n r1 = 1\n r2 = 0\n switch(r12) {\n case 0: goto L_0x00b2;\n case 1: goto L_0x0044;\n case 2: goto L_0x000e;\n default: goto L_0x0008;\n }\n L_0x0008:\n java.lang.IllegalStateException r11 = new java.lang.IllegalStateException\n r11.<init>()\n throw r11\n L_0x000e:\n int r12 = r10.f3928h\n if (r12 <= 0) goto L_0x0031\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n r12.mo12047a()\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n byte[] r12 = r12.f4559a\n r0 = 3\n r11.mo11675b(r12, r2, r0)\n com.google.android.gms.internal.ads.bcq r12 = r10.f3924d\n com.google.android.gms.internal.ads.bkh r3 = r10.f3923c\n r12.mo11681a(r3, r0)\n int r12 = r10.f3929i\n int r12 = r12 + r0\n r10.f3929i = r12\n int r12 = r10.f3928h\n int r12 = r12 - r1\n r10.f3928h = r12\n goto L_0x000e\n L_0x0031:\n int r11 = r10.f3929i\n if (r11 <= 0) goto L_0x0041\n com.google.android.gms.internal.ads.bcq r3 = r10.f3924d\n long r4 = r10.f3927g\n r6 = 1\n int r7 = r10.f3929i\n r8 = 0\n r9 = 0\n r3.mo11680a(r4, r6, r7, r8, r9)\n L_0x0041:\n r10.f3925e = r1\n return r2\n L_0x0044:\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n r12.mo12047a()\n int r12 = r10.f3926f\n if (r12 != 0) goto L_0x006a\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n byte[] r12 = r12.f4559a\n r3 = 5\n boolean r12 = r11.mo11672a(r12, r2, r3, r1)\n if (r12 != 0) goto L_0x005a\n L_0x0058:\n r1 = 0\n goto L_0x008d\n L_0x005a:\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n long r3 = r12.mo12063j()\n r5 = 1000(0x3e8, double:4.94E-321)\n long r3 = r3 * r5\n r5 = 45\n long r3 = r3 / r5\n r10.f3927g = r3\n goto L_0x0083\n L_0x006a:\n int r12 = r10.f3926f\n if (r12 != r1) goto L_0x0097\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n byte[] r12 = r12.f4559a\n r3 = 9\n boolean r12 = r11.mo11672a(r12, r2, r3, r1)\n if (r12 != 0) goto L_0x007b\n goto L_0x0058\n L_0x007b:\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n long r3 = r12.mo12066m()\n r10.f3927g = r3\n L_0x0083:\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n int r12 = r12.mo12059f()\n r10.f3928h = r12\n r10.f3929i = r2\n L_0x008d:\n if (r1 == 0) goto L_0x0094\n r12 = 2\n r10.f3925e = r12\n goto L_0x0000\n L_0x0094:\n r10.f3925e = r2\n return r0\n L_0x0097:\n com.google.android.gms.internal.ads.bad r11 = new com.google.android.gms.internal.ads.bad\n int r12 = r10.f3926f\n r0 = 39\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>(r0)\n java.lang.String r0 = \"Unsupported version number: \"\n r1.append(r0)\n r1.append(r12)\n java.lang.String r12 = r1.toString()\n r11.<init>((java.lang.String) r12)\n throw r11\n L_0x00b2:\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n r12.mo12047a()\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n byte[] r12 = r12.f4559a\n r3 = 8\n boolean r12 = r11.mo11672a(r12, r2, r3, r1)\n if (r12 == 0) goto L_0x00df\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n int r12 = r12.mo12065l()\n int r2 = f3921a\n if (r12 != r2) goto L_0x00d7\n com.google.android.gms.internal.ads.bkh r12 = r10.f3923c\n int r12 = r12.mo12059f()\n r10.f3926f = r12\n r2 = 1\n goto L_0x00df\n L_0x00d7:\n java.io.IOException r11 = new java.io.IOException\n java.lang.String r12 = \"Input not RawCC\"\n r11.<init>(r12)\n throw r11\n L_0x00df:\n if (r2 == 0) goto L_0x00e5\n r10.f3925e = r1\n goto L_0x0000\n L_0x00e5:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.ads.bef.mo11683a(com.google.android.gms.internal.ads.bci, com.google.android.gms.internal.ads.bcn):int\");\n }", "public static void m5820b(java.lang.String r3, java.lang.String r4, java.lang.String 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.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 r0 = new com.crashlytics.android.answers.StartCheckoutEvent;\n r0.<init>();\n r1 = java.util.Locale.getDefault();\n r1 = java.util.Currency.getInstance(r1);\n r0.putCurrency(r1);\n r1 = 1;\n r0.putItemCount(r1);\n r1 = java.lang.Long.parseLong(r3);\t Catch:{ Exception -> 0x001f }\n r3 = java.math.BigDecimal.valueOf(r1);\t Catch:{ Exception -> 0x001f }\n r0.putTotalPrice(r3);\t Catch:{ Exception -> 0x001f }\n L_0x001f:\n r3 = \"type\";\n r0.putCustomAttribute(r3, r4);\n r3 = \"cta\";\n r0.putCustomAttribute(r3, r5);\n r3 = com.crashlytics.android.answers.Answers.getInstance();\n r3.logStartCheckout(r0);\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.cuvora.carinfo.helpers.d.b(java.lang.String, java.lang.String, java.lang.String):void\");\n }", "public void run() {\n /*\n r8 = this;\n r1 = com.umeng.commonsdk.proguard.b.b;\t Catch:{ Throwable -> 0x00c9 }\n monitor-enter(r1);\t Catch:{ Throwable -> 0x00c9 }\n r0 = r8.a;\t Catch:{ all -> 0x00c6 }\n if (r0 == 0) goto L_0x00c4;\n L_0x0009:\n r0 = r8.b;\t Catch:{ all -> 0x00c6 }\n if (r0 == 0) goto L_0x00c4;\n L_0x000d:\n r0 = com.umeng.commonsdk.proguard.b.a;\t Catch:{ all -> 0x00c6 }\n if (r0 != 0) goto L_0x00c4;\n L_0x0013:\n r0 = 1;\n com.umeng.commonsdk.proguard.b.a = r0;\t Catch:{ all -> 0x00c6 }\n r0 = \"walle-crash\";\n r2 = 1;\n r2 = new java.lang.Object[r2];\t Catch:{ all -> 0x00c6 }\n r3 = 0;\n r4 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00c6 }\n r4.<init>();\t Catch:{ all -> 0x00c6 }\n r5 = \"report thread is \";\n r4 = r4.append(r5);\t Catch:{ all -> 0x00c6 }\n r5 = com.umeng.commonsdk.proguard.b.a;\t Catch:{ all -> 0x00c6 }\n r4 = r4.append(r5);\t Catch:{ all -> 0x00c6 }\n r4 = r4.toString();\t Catch:{ all -> 0x00c6 }\n r2[r3] = r4;\t Catch:{ all -> 0x00c6 }\n com.umeng.commonsdk.statistics.common.e.a(r0, r2);\t Catch:{ all -> 0x00c6 }\n r0 = r8.b;\t Catch:{ all -> 0x00c6 }\n r0 = com.umeng.commonsdk.proguard.c.a(r0);\t Catch:{ all -> 0x00c6 }\n r2 = android.text.TextUtils.isEmpty(r0);\t Catch:{ all -> 0x00c6 }\n if (r2 != 0) goto L_0x00c4;\n L_0x0045:\n r2 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00c6 }\n r2.<init>();\t Catch:{ all -> 0x00c6 }\n r3 = r8.a;\t Catch:{ all -> 0x00c6 }\n r3 = r3.getFilesDir();\t Catch:{ all -> 0x00c6 }\n r2 = r2.append(r3);\t Catch:{ all -> 0x00c6 }\n r3 = \"/\";\n r2 = r2.append(r3);\t Catch:{ all -> 0x00c6 }\n r3 = \"stateless\";\n r2 = r2.append(r3);\t Catch:{ all -> 0x00c6 }\n r3 = \"/\";\n r2 = r2.append(r3);\t Catch:{ all -> 0x00c6 }\n r3 = \"umpx_internal\";\n r3 = r3.getBytes();\t Catch:{ all -> 0x00c6 }\n r4 = 0;\n r3 = android.util.Base64.encodeToString(r3, r4);\t Catch:{ all -> 0x00c6 }\n r2 = r2.append(r3);\t Catch:{ all -> 0x00c6 }\n r2 = r2.toString();\t Catch:{ all -> 0x00c6 }\n r3 = r8.a;\t Catch:{ all -> 0x00c6 }\n r4 = 10;\n com.umeng.commonsdk.stateless.f.a(r3, r2, r4);\t Catch:{ all -> 0x00c6 }\n r2 = new com.umeng.commonsdk.stateless.UMSLEnvelopeBuild;\t Catch:{ all -> 0x00c6 }\n r2.<init>();\t Catch:{ all -> 0x00c6 }\n r3 = r8.a;\t Catch:{ all -> 0x00c6 }\n r3 = r2.buildSLBaseHeader(r3);\t Catch:{ all -> 0x00c6 }\n r4 = new org.json.JSONObject;\t Catch:{ JSONException -> 0x00cb }\n r4.<init>();\t Catch:{ JSONException -> 0x00cb }\n r5 = \"content\";\n r4.put(r5, r0);\t Catch:{ JSONException -> 0x00cb }\n r0 = \"ts\";\n r6 = java.lang.System.currentTimeMillis();\t Catch:{ JSONException -> 0x00cb }\n r4.put(r0, r6);\t Catch:{ JSONException -> 0x00cb }\n r0 = new org.json.JSONObject;\t Catch:{ JSONException -> 0x00cb }\n r0.<init>();\t Catch:{ JSONException -> 0x00cb }\n r5 = \"crash\";\n r0.put(r5, r4);\t Catch:{ JSONException -> 0x00cb }\n r4 = new org.json.JSONObject;\t Catch:{ JSONException -> 0x00cb }\n r4.<init>();\t Catch:{ JSONException -> 0x00cb }\n r5 = \"tp\";\n r4.put(r5, r0);\t Catch:{ JSONException -> 0x00cb }\n r0 = r8.a;\t Catch:{ JSONException -> 0x00cb }\n r5 = \"umpx_internal\";\n r0 = r2.buildSLEnvelope(r0, r3, r4, r5);\t Catch:{ JSONException -> 0x00cb }\n if (r0 == 0) goto L_0x00c4;\n L_0x00bc:\n r2 = \"exception\";\n r0 = r0.has(r2);\t Catch:{ JSONException -> 0x00cb }\n if (r0 != 0) goto L_0x00c4;\n L_0x00c4:\n monitor-exit(r1);\t Catch:{ all -> 0x00c6 }\n L_0x00c5:\n return;\n L_0x00c6:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ all -> 0x00c6 }\n throw r0;\t Catch:{ Throwable -> 0x00c9 }\n L_0x00c9:\n r0 = move-exception;\n goto L_0x00c5;\n L_0x00cb:\n r0 = move-exception;\n goto L_0x00c4;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.umeng.commonsdk.proguard.bb.run():void\");\n }", "private void bщ04490449щ0449щ(rrrrrr.rcccrr r6) {\n /*\n r5 = this;\n r4 = 0;\n r0 = r6.getJsonData();\t Catch:{ Exception -> 0x0056 }\n r1 = new rrrrrr.ccrcrc;\t Catch:{ Exception -> 0x0056 }\n r2 = new java.lang.StringBuilder;\t Catch:{ Exception -> 0x0056 }\n r2.<init>();\t Catch:{ Exception -> 0x0056 }\n r3 = r5.bнн043Dннн;\t Catch:{ Exception -> 0x0056 }\n r3 = com.immersion.aws.analytics.ImmrAnalytics.b044C044C044C044Cьь(r3);\t Catch:{ Exception -> 0x0056 }\n r3 = r3.getFilesDir();\t Catch:{ Exception -> 0x0056 }\n r2 = r2.append(r3);\t Catch:{ Exception -> 0x0056 }\n r3 = java.io.File.separator;\t Catch:{ Exception -> 0x0056 }\n r2 = r2.append(r3);\t Catch:{ Exception -> 0x0056 }\n r3 = \"3HC4C-01.txt\";\n r2 = r2.append(r3);\t Catch:{ Exception -> 0x0056 }\n r2 = r2.toString();\t Catch:{ Exception -> 0x0056 }\n r1.<init>(r2);\t Catch:{ Exception -> 0x0056 }\n r2 = bЗ04170417ЗЗЗ;\n r3 = bЗЗЗ0417ЗЗ;\n r3 = r3 + r2;\n r2 = r2 * r3;\n r3 = b04170417З0417ЗЗ;\n r2 = r2 % r3;\n switch(r2) {\n case 0: goto L_0x0041;\n default: goto L_0x0039;\n };\n L_0x0039:\n r2 = 38;\n bЗ04170417ЗЗЗ = r2;\n r2 = 29;\n b041704170417ЗЗЗ = r2;\n L_0x0041:\n r1.load();\t Catch:{ Exception -> 0x0056 }\n L_0x0044:\n switch(r4) {\n case 0: goto L_0x004b;\n case 1: goto L_0x0044;\n default: goto L_0x0047;\n };\t Catch:{ Exception -> 0x0056 }\n L_0x0047:\n switch(r4) {\n case 0: goto L_0x004b;\n case 1: goto L_0x0044;\n default: goto L_0x004a;\n };\t Catch:{ Exception -> 0x0056 }\n L_0x004a:\n goto L_0x0047;\n L_0x004b:\n r0 = r0.toString();\t Catch:{ Exception -> 0x0056 }\n r1.push(r0);\t Catch:{ Exception -> 0x0056 }\n r1.save();\t Catch:{ Exception -> 0x0056 }\n L_0x0055:\n return;\n L_0x0056:\n r0 = move-exception;\n goto L_0x0055;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: rrrrrr.cccccr.bщ04490449щ0449щ(rrrrrr.rcccrr):void\");\n }", "public void method_2197() {\r\n // $FF: Couldn't be decompiled\r\n }", "public final synchronized java.lang.String m92g(java.lang.String r5) {\n /*\n r4 = this;\n r1 = 1;\n r0 = 0;\n monitor-enter(r4);\n if (r5 == 0) goto L_0x002c;\n L_0x0005:\n r2 = r5.trim();\t Catch:{ all -> 0x0037 }\n r2 = r2.length();\t Catch:{ all -> 0x0037 }\n if (r2 <= 0) goto L_0x002c;\n L_0x000f:\n if (r0 == 0) goto L_0x002e;\n L_0x0011:\n r0 = \"key should not be empty %s\";\n r1 = 1;\n r1 = new java.lang.Object[r1];\t Catch:{ all -> 0x0037 }\n r2 = 0;\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0037 }\n r3.<init>();\t Catch:{ all -> 0x0037 }\n r3 = r3.append(r5);\t Catch:{ all -> 0x0037 }\n r3 = r3.toString();\t Catch:{ all -> 0x0037 }\n r1[r2] = r3;\t Catch:{ all -> 0x0037 }\n com.tencent.bugly.legu.proguard.C0073w.m524d(r0, r1);\t Catch:{ all -> 0x0037 }\n r0 = 0;\n L_0x002a:\n monitor-exit(r4);\n return r0;\n L_0x002c:\n r0 = r1;\n goto L_0x000f;\n L_0x002e:\n r0 = r4.f112Y;\t Catch:{ all -> 0x0037 }\n r0 = r0.get(r5);\t Catch:{ all -> 0x0037 }\n r0 = (java.lang.String) r0;\t Catch:{ all -> 0x0037 }\n goto L_0x002a;\n L_0x0037:\n r0 = move-exception;\n monitor-exit(r4);\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.bugly.legu.crashreport.common.info.a.g(java.lang.String):java.lang.String\");\n }", "public boolean mo9310a(java.lang.Exception r4) {\n /*\n r3 = this;\n java.lang.Object r0 = r3.f8650a\n monitor-enter(r0)\n boolean r1 = r3.f8651b // Catch:{ all -> 0x002c }\n r2 = 0\n if (r1 == 0) goto L_0x000a\n monitor-exit(r0) // Catch:{ all -> 0x002c }\n return r2\n L_0x000a:\n r1 = 1\n r3.f8651b = r1 // Catch:{ all -> 0x002c }\n r3.f8654e = r4 // Catch:{ all -> 0x002c }\n r3.f8655f = r2 // Catch:{ all -> 0x002c }\n java.lang.Object r4 = r3.f8650a // Catch:{ all -> 0x002c }\n r4.notifyAll() // Catch:{ all -> 0x002c }\n r3.m11250m() // Catch:{ all -> 0x002c }\n boolean r4 = r3.f8655f // Catch:{ all -> 0x002c }\n if (r4 != 0) goto L_0x002a\n bolts.n$q r4 = m11249l() // Catch:{ all -> 0x002c }\n if (r4 == 0) goto L_0x002a\n bolts.p r4 = new bolts.p // Catch:{ all -> 0x002c }\n r4.<init>(r3) // Catch:{ all -> 0x002c }\n r3.f8656g = r4 // Catch:{ all -> 0x002c }\n L_0x002a:\n monitor-exit(r0) // Catch:{ all -> 0x002c }\n return r1\n L_0x002c:\n r4 = move-exception\n monitor-exit(r0) // Catch:{ all -> 0x002c }\n throw r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: bolts.C2177n.mo9310a(java.lang.Exception):boolean\");\n }", "static /* synthetic */ void m201-wrap5(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap5(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap5(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }", "public final void m15744a(com.p111d.p112a.p114b.C5301g r9) {\n /*\n r8 = this;\n r0 = r8.f17783i;\n r1 = r8.f17781g;\n r2 = 0;\n r3 = 1;\n if (r1 == 0) goto L_0x0010;\n L_0x0008:\n r4 = r0.m4038b();\n if (r4 == 0) goto L_0x0010;\n L_0x000e:\n r4 = r3;\n goto L_0x0011;\n L_0x0010:\n r4 = r2;\n L_0x0011:\n r5 = -1;\n L_0x0012:\n r5 = r5 + r3;\n r6 = 16;\n if (r5 < r6) goto L_0x0029;\n L_0x0017:\n r0 = r0.m4032a();\n if (r0 == 0) goto L_0x0148;\n L_0x001d:\n if (r1 == 0) goto L_0x0027;\n L_0x001f:\n r4 = r0.m4038b();\n if (r4 == 0) goto L_0x0027;\n L_0x0025:\n r4 = r3;\n goto L_0x0028;\n L_0x0027:\n r4 = r2;\n L_0x0028:\n r5 = r2;\n L_0x0029:\n r6 = r0.m4031a(r5);\n if (r6 == 0) goto L_0x0148;\n L_0x002f:\n if (r4 == 0) goto L_0x0043;\n L_0x0031:\n r7 = r0.m4039c(r5);\n if (r7 == 0) goto L_0x003a;\n L_0x0037:\n r9.writeObjectId(r7);\n L_0x003a:\n r7 = r0.m4040d(r5);\n if (r7 == 0) goto L_0x0043;\n L_0x0040:\n r9.writeTypeId(r7);\n L_0x0043:\n r7 = com.p111d.p112a.p121c.p138m.C6523u.C15401.f4807a;\n r6 = r6.ordinal();\n r6 = r7[r6];\n switch(r6) {\n case 1: goto L_0x0143;\n case 2: goto L_0x013e;\n case 3: goto L_0x0139;\n case 4: goto L_0x0134;\n case 5: goto L_0x011e;\n case 6: goto L_0x0108;\n case 7: goto L_0x00c5;\n case 8: goto L_0x0074;\n case 9: goto L_0x0070;\n case 10: goto L_0x006c;\n case 11: goto L_0x0068;\n case 12: goto L_0x0056;\n default: goto L_0x004e;\n };\n L_0x004e:\n r9 = new java.lang.RuntimeException;\n r0 = \"Internal error: should never end up through this code path\";\n r9.<init>(r0);\n throw r9;\n L_0x0056:\n r6 = r0.m4037b(r5);\n r7 = r6 instanceof com.p111d.p112a.p121c.p138m.C5378q;\n if (r7 == 0) goto L_0x0064;\n L_0x005e:\n r6 = (com.p111d.p112a.p121c.p138m.C5378q) r6;\n r6.m11598a(r9);\n goto L_0x0012;\n L_0x0064:\n r9.writeObject(r6);\n goto L_0x0012;\n L_0x0068:\n r9.writeNull();\n goto L_0x0012;\n L_0x006c:\n r9.writeBoolean(r2);\n goto L_0x0012;\n L_0x0070:\n r9.writeBoolean(r3);\n goto L_0x0012;\n L_0x0074:\n r6 = r0.m4037b(r5);\n r7 = r6 instanceof java.lang.Double;\n if (r7 == 0) goto L_0x0086;\n L_0x007c:\n r6 = (java.lang.Double) r6;\n r6 = r6.doubleValue();\n r9.writeNumber(r6);\n goto L_0x0012;\n L_0x0086:\n r7 = r6 instanceof java.math.BigDecimal;\n if (r7 == 0) goto L_0x0090;\n L_0x008a:\n r6 = (java.math.BigDecimal) r6;\n r9.writeNumber(r6);\n goto L_0x0012;\n L_0x0090:\n r7 = r6 instanceof java.lang.Float;\n if (r7 == 0) goto L_0x009f;\n L_0x0094:\n r6 = (java.lang.Float) r6;\n r6 = r6.floatValue();\n r9.writeNumber(r6);\n goto L_0x0012;\n L_0x009f:\n if (r6 != 0) goto L_0x00a2;\n L_0x00a1:\n goto L_0x0068;\n L_0x00a2:\n r7 = r6 instanceof java.lang.String;\n if (r7 == 0) goto L_0x00ad;\n L_0x00a6:\n r6 = (java.lang.String) r6;\n r9.writeNumber(r6);\n goto L_0x0012;\n L_0x00ad:\n r0 = new com.d.a.b.f;\n r1 = \"Unrecognized value type for VALUE_NUMBER_FLOAT: %s, can not serialize\";\n r3 = new java.lang.Object[r3];\n r4 = r6.getClass();\n r4 = r4.getName();\n r3[r2] = r4;\n r1 = java.lang.String.format(r1, r3);\n r0.<init>(r1, r9);\n throw r0;\n L_0x00c5:\n r6 = r0.m4037b(r5);\n r7 = r6 instanceof java.lang.Integer;\n if (r7 == 0) goto L_0x00d8;\n L_0x00cd:\n r6 = (java.lang.Integer) r6;\n r6 = r6.intValue();\n L_0x00d3:\n r9.writeNumber(r6);\n goto L_0x0012;\n L_0x00d8:\n r7 = r6 instanceof java.math.BigInteger;\n if (r7 == 0) goto L_0x00e3;\n L_0x00dc:\n r6 = (java.math.BigInteger) r6;\n r9.writeNumber(r6);\n goto L_0x0012;\n L_0x00e3:\n r7 = r6 instanceof java.lang.Long;\n if (r7 == 0) goto L_0x00f2;\n L_0x00e7:\n r6 = (java.lang.Long) r6;\n r6 = r6.longValue();\n r9.writeNumber(r6);\n goto L_0x0012;\n L_0x00f2:\n r7 = r6 instanceof java.lang.Short;\n if (r7 == 0) goto L_0x0101;\n L_0x00f6:\n r6 = (java.lang.Short) r6;\n r6 = r6.shortValue();\n r9.writeNumber(r6);\n goto L_0x0012;\n L_0x0101:\n r6 = (java.lang.Number) r6;\n r6 = r6.intValue();\n goto L_0x00d3;\n L_0x0108:\n r6 = r0.m4037b(r5);\n r7 = r6 instanceof com.p111d.p112a.p114b.C1382p;\n if (r7 == 0) goto L_0x0117;\n L_0x0110:\n r6 = (com.p111d.p112a.p114b.C1382p) r6;\n r9.writeString(r6);\n goto L_0x0012;\n L_0x0117:\n r6 = (java.lang.String) r6;\n r9.writeString(r6);\n goto L_0x0012;\n L_0x011e:\n r6 = r0.m4037b(r5);\n r7 = r6 instanceof com.p111d.p112a.p114b.C1382p;\n if (r7 == 0) goto L_0x012d;\n L_0x0126:\n r6 = (com.p111d.p112a.p114b.C1382p) r6;\n r9.writeFieldName(r6);\n goto L_0x0012;\n L_0x012d:\n r6 = (java.lang.String) r6;\n r9.writeFieldName(r6);\n goto L_0x0012;\n L_0x0134:\n r9.writeEndArray();\n goto L_0x0012;\n L_0x0139:\n r9.writeStartArray();\n goto L_0x0012;\n L_0x013e:\n r9.writeEndObject();\n goto L_0x0012;\n L_0x0143:\n r9.writeStartObject();\n goto L_0x0012;\n L_0x0148:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.d.a.c.m.u.a(com.d.a.b.g):void\");\n }", "private void m1654a(p000a.p001a.p002a.p003a.p022i.p024b.C0112x r7, p000a.p001a.p002a.p003a.p034n.C0157e r8) {\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/293907205.run(Unknown Source)\n*/\n /*\n r6 = this;\n r0 = r7.m322b();\n r7 = r7.m321a();\n r1 = 0;\n L_0x0009:\n r2 = \"http.request\";\n r8.mo160a(r2, r7);\n r1 = r1 + 1;\n r2 = r6.f1529q;\t Catch:{ IOException -> 0x002f }\n r2 = r2.mo1932c();\t Catch:{ IOException -> 0x002f }\n if (r2 != 0) goto L_0x0020;\t Catch:{ IOException -> 0x002f }\n L_0x0018:\n r2 = r6.f1529q;\t Catch:{ IOException -> 0x002f }\n r3 = r6.f1528p;\t Catch:{ IOException -> 0x002f }\n r2.mo2023a(r0, r8, r3);\t Catch:{ IOException -> 0x002f }\n goto L_0x002b;\t Catch:{ IOException -> 0x002f }\n L_0x0020:\n r2 = r6.f1529q;\t Catch:{ IOException -> 0x002f }\n r3 = r6.f1528p;\t Catch:{ IOException -> 0x002f }\n r3 = p000a.p001a.p002a.p003a.p032l.C0150c.m428a(r3);\t Catch:{ IOException -> 0x002f }\n r2.mo1931b(r3);\t Catch:{ IOException -> 0x002f }\n L_0x002b:\n r6.m1660a(r0, r8);\t Catch:{ IOException -> 0x002f }\n return;\n L_0x002f:\n r2 = move-exception;\n r3 = r6.f1529q;\t Catch:{ IOException -> 0x0035 }\n r3.close();\t Catch:{ IOException -> 0x0035 }\n L_0x0035:\n r3 = r6.f1520h;\n r3 = r3.retryRequest(r2, r1, r8);\n if (r3 == 0) goto L_0x00a0;\n L_0x003d:\n r3 = r6.f1513a;\n r3 = r3.m270d();\n if (r3 == 0) goto L_0x0009;\n L_0x0045:\n r3 = r6.f1513a;\n r4 = new java.lang.StringBuilder;\n r4.<init>();\n r5 = \"I/O exception (\";\n r4.append(r5);\n r5 = r2.getClass();\n r5 = r5.getName();\n r4.append(r5);\n r5 = \") caught when connecting to \";\n r4.append(r5);\n r4.append(r0);\n r5 = \": \";\n r4.append(r5);\n r5 = r2.getMessage();\n r4.append(r5);\n r4 = r4.toString();\n r3.m269d(r4);\n r3 = r6.f1513a;\n r3 = r3.m262a();\n if (r3 == 0) goto L_0x0088;\n L_0x007f:\n r3 = r6.f1513a;\n r4 = r2.getMessage();\n r3.m261a(r4, r2);\n L_0x0088:\n r2 = r6.f1513a;\n r3 = new java.lang.StringBuilder;\n r3.<init>();\n r4 = \"Retrying connect to \";\n r3.append(r4);\n r3.append(r0);\n r3 = r3.toString();\n r2.m269d(r3);\n goto L_0x0009;\n L_0x00a0:\n throw r2;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: a.a.a.a.i.b.p.a(a.a.a.a.i.b.x, a.a.a.a.n.e):void\");\n }", "public int method_7084(String param1) {\r\n // $FF: Couldn't be decompiled\r\n }", "private static void m13385d() {\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 r0 = java.lang.System.currentTimeMillis();\t Catch:{ Exception -> 0x0024 }\n r2 = java.util.concurrent.TimeUnit.DAYS;\t Catch:{ Exception -> 0x0024 }\n r3 = 1;\t Catch:{ Exception -> 0x0024 }\n r2 = r2.toMillis(r3);\t Catch:{ Exception -> 0x0024 }\n r4 = 0;\t Catch:{ Exception -> 0x0024 }\n r4 = r0 - r2;\t Catch:{ Exception -> 0x0024 }\n r0 = com.foursquare.internal.data.db.C1916a.getDatabase();\t Catch:{ Exception -> 0x0024 }\n r1 = \"battery_watcher\";\t Catch:{ Exception -> 0x0024 }\n r2 = \"timestamp < ?\";\t Catch:{ Exception -> 0x0024 }\n r3 = 1;\t Catch:{ Exception -> 0x0024 }\n r3 = new java.lang.String[r3];\t Catch:{ Exception -> 0x0024 }\n r6 = 0;\t Catch:{ Exception -> 0x0024 }\n r4 = java.lang.String.valueOf(r4);\t Catch:{ Exception -> 0x0024 }\n r3[r6] = r4;\t Catch:{ Exception -> 0x0024 }\n r0.delete(r1, r2, r3);\t Catch:{ Exception -> 0x0024 }\n L_0x0024:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.foursquare.pilgrim.e.d():void\");\n }", "public com.google.cr a(com.google.ca r5) {\n /*\n r4 = this;\n r0 = 0;\n r1 = com.google.bA.b;\n r2 = com.google.ca.d();\n if (r5 != r2) goto L_0x000a;\n L_0x0009:\n return r4;\n L_0x000a:\n r2 = r4.f;\n if (r2 != 0) goto L_0x003f;\n L_0x000e:\n r2 = com.google.ca.b(r5);\n r2 = r2.isEmpty();\n if (r2 != 0) goto L_0x0079;\n L_0x0018:\n r2 = r4.g;\n r2 = r2.isEmpty();\n if (r2 == 0) goto L_0x002e;\n L_0x0020:\n r2 = com.google.ca.b(r5);\n r4.g = r2;\n r2 = r4.h;\n r2 = r2 & -2;\n r4.h = r2;\n if (r1 == 0) goto L_0x003a;\n L_0x002e:\n r4.d();\n r2 = r4.g;\n r3 = com.google.ca.b(r5);\n r2.addAll(r3);\n L_0x003a:\n r4.g();\n if (r1 == 0) goto L_0x0079;\n L_0x003f:\n r2 = com.google.ca.b(r5);\n r2 = r2.isEmpty();\n if (r2 != 0) goto L_0x0079;\n L_0x0049:\n r2 = r4.f;\n r2 = r2.i();\n if (r2 == 0) goto L_0x0070;\n L_0x0051:\n r2 = r4.f;\n r2.b();\n r4.f = r0;\n r2 = com.google.ca.b(r5);\n r4.g = r2;\n r2 = r4.h;\n r2 = r2 & -2;\n r4.h = r2;\n r2 = com.google.bL.d;\n if (r2 == 0) goto L_0x006c;\n L_0x0068:\n r0 = r4.k();\n L_0x006c:\n r4.f = r0;\n if (r1 == 0) goto L_0x0079;\n L_0x0070:\n r0 = r4.f;\n r1 = com.google.ca.b(r5);\n r0.a(r1);\n L_0x0079:\n r4.a(r5);\n r0 = r5.getUnknownFields();\n r4.a(r0);\n goto L_0x0009;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.cr.a(com.google.ca):com.google.cr\");\n }", "private final boolean e() {\n /*\n r15 = this;\n r2 = 0\n r1 = 0\n dtd r0 = r15.m // Catch:{ all -> 0x008e }\n if (r0 != 0) goto L_0x000d\n dtd r0 = new dtd // Catch:{ all -> 0x008e }\n r0.<init>() // Catch:{ all -> 0x008e }\n r15.m = r0 // Catch:{ all -> 0x008e }\n L_0x000d:\n int r0 = r15.k // Catch:{ all -> 0x008e }\n dtd r3 = r15.m // Catch:{ all -> 0x008e }\n int r3 = r3.a // Catch:{ all -> 0x008e }\n int r0 = r0 - r3\n if (r0 <= 0) goto L_0x039e\n dvk r3 = r15.g // Catch:{ all -> 0x008e }\n if (r3 == 0) goto L_0x0356\n byte[] r3 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 == 0) goto L_0x0025\n int r3 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r4.length // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 != r4) goto L_0x0032\n L_0x0025:\n r3 = 2097152(0x200000, float:2.938736E-39)\n int r3 = java.lang.Math.min(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r3 = new byte[r3] // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r15.h = r3 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 0\n r15.i = r3 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0032:\n byte[] r3 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.length // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3 - r4\n int r6 = java.lang.Math.min(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r7 = r15.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r8 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r9 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n boolean r0 = r7.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != 0) goto L_0x00ac\n r0 = 1\n L_0x0047:\n java.lang.String r3 = \"GzipInflatingBuffer is closed\"\n defpackage.cld.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 0\n r0 = 1\n r5 = r3\n L_0x004f:\n if (r0 == 0) goto L_0x02ef\n int r3 = r6 - r5\n if (r3 <= 0) goto L_0x02ef\n dvm r0 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.ordinal() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n switch(r0) {\n case 0: goto L_0x00ae;\n case 1: goto L_0x0148;\n case 2: goto L_0x0171;\n case 3: goto L_0x01d7;\n case 4: goto L_0x01fc;\n case 5: goto L_0x0221;\n case 6: goto L_0x0256;\n case 7: goto L_0x0289;\n case 8: goto L_0x02a2;\n case 9: goto L_0x02e9;\n default: goto L_0x005e;\n } // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x005e:\n java.lang.AssertionError r0 = new java.lang.AssertionError // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r3 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = java.lang.String.valueOf(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r4 = java.lang.String.valueOf(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r4.length() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r4 + 15\n java.lang.StringBuilder r5 = new java.lang.StringBuilder // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r5.<init>(r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r4 = \"Invalid state: \"\n java.lang.StringBuilder r4 = r5.append(r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.StringBuilder r3 = r4.append(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = r3.toString() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0087:\n r0 = move-exception\n java.lang.RuntimeException r3 = new java.lang.RuntimeException // Catch:{ all -> 0x008e }\n r3.<init>(r0) // Catch:{ all -> 0x008e }\n throw r3 // Catch:{ all -> 0x008e }\n L_0x008e:\n r0 = move-exception\n if (r2 <= 0) goto L_0x00ab\n dxe r3 = r15.a\n r3.a(r2)\n dxh r3 = r15.j\n dxh r4 = defpackage.dxh.BODY\n if (r3 != r4) goto L_0x00ab\n dvk r3 = r15.g\n if (r3 == 0) goto L_0x03c9\n dzo r2 = r15.d\n long r4 = (long) r1\n r2.d(r4)\n int r2 = r15.r\n int r1 = r1 + r2\n r15.r = r1\n L_0x00ab:\n throw r0\n L_0x00ac:\n r0 = 0\n goto L_0x0047\n L_0x00ae:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 10\n if (r0 >= r3) goto L_0x00ba\n r0 = 0\n goto L_0x004f\n L_0x00ba:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.c() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 35615(0x8b1f, float:4.9907E-41)\n if (r0 == r3) goto L_0x00d4\n java.util.zip.ZipException r0 = new java.util.zip.ZipException // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = \"Not in GZIP format\"\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x00cd:\n r0 = move-exception\n java.lang.RuntimeException r3 = new java.lang.RuntimeException // Catch:{ all -> 0x008e }\n r3.<init>(r0) // Catch:{ all -> 0x008e }\n throw r3 // Catch:{ all -> 0x008e }\n L_0x00d4:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 8\n if (r0 == r3) goto L_0x00e6\n java.util.zip.ZipException r0 = new java.util.zip.ZipException // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = \"Unsupported compression method\"\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x00e6:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.j = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvl r4 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 6\n dvk r3 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r10 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r10.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3 - r10\n if (r3 <= 0) goto L_0x03d9\n r0 = 6\n int r0 = java.lang.Math.min(r3, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r3 = r3.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r10 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r10 = r10.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r11 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r11 = r11.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.update(r10, r11, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n defpackage.dvk.a(r3, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = 6 - r0\n r3 = r0\n L_0x0118:\n if (r3 <= 0) goto L_0x013b\n r0 = 512(0x200, float:7.175E-43)\n byte[] r10 = new byte[r0] // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 0\n L_0x011f:\n if (r0 >= r3) goto L_0x013b\n int r11 = r3 - r0\n r12 = 512(0x200, float:7.175E-43)\n int r11 = java.lang.Math.min(r11, r12) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r12 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r12 = r12.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r13 = 0\n r12.a(r10, r13, r11) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r12 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r12 = r12.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r13 = 0\n r12.update(r10, r13, r11) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 + r11\n goto L_0x011f\n L_0x013b:\n dvk r0 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 6\n defpackage.dvk.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.HEADER_EXTRA_LEN // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0148:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 4\n r3 = 4\n if (r0 == r3) goto L_0x0156\n dvm r0 = defpackage.dvm.HEADER_NAME // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0156:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 2\n if (r0 >= r3) goto L_0x0162\n r0 = 0\n goto L_0x004f\n L_0x0162:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.c() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.k = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.HEADER_EXTRA // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0171:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r7.k // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 >= r3) goto L_0x017e\n r0 = 0\n goto L_0x004f\n L_0x017e:\n dvl r10 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r7.k // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r0 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 - r3\n if (r0 <= 0) goto L_0x03d6\n int r0 = java.lang.Math.min(r0, r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r3 = r3.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r11 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r11 = r11.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r12 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r12 = r12.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.update(r11, r12, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n defpackage.dvk.a(r3, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r4 - r0\n r3 = r0\n L_0x01a8:\n if (r3 <= 0) goto L_0x01cb\n r0 = 512(0x200, float:7.175E-43)\n byte[] r11 = new byte[r0] // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 0\n L_0x01af:\n if (r0 >= r3) goto L_0x01cb\n int r12 = r3 - r0\n r13 = 512(0x200, float:7.175E-43)\n int r12 = java.lang.Math.min(r12, r13) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r13 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r13 = r13.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r14 = 0\n r13.a(r11, r14, r12) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r13 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r13 = r13.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r14 = 0\n r13.update(r11, r14, r12) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 + r12\n goto L_0x01af\n L_0x01cb:\n dvk r0 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n defpackage.dvk.b(r0, r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.HEADER_NAME // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x01d7:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 8\n r3 = 8\n if (r0 != r3) goto L_0x01f5\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x01e1:\n int r3 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 <= 0) goto L_0x01f3\n int r3 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 != 0) goto L_0x01e1\n r0 = 1\n L_0x01ee:\n if (r0 != 0) goto L_0x01f5\n r0 = 0\n goto L_0x004f\n L_0x01f3:\n r0 = 0\n goto L_0x01ee\n L_0x01f5:\n dvm r0 = defpackage.dvm.HEADER_COMMENT // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x01fc:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 16\n r3 = 16\n if (r0 != r3) goto L_0x021a\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0206:\n int r3 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 <= 0) goto L_0x0218\n int r3 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 != 0) goto L_0x0206\n r0 = 1\n L_0x0213:\n if (r0 != 0) goto L_0x021a\n r0 = 0\n goto L_0x004f\n L_0x0218:\n r0 = 0\n goto L_0x0213\n L_0x021a:\n dvm r0 = defpackage.dvm.HEADER_CRC // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0221:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 2\n r3 = 2\n if (r0 != r3) goto L_0x024f\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 2\n if (r0 >= r3) goto L_0x0234\n r0 = 0\n goto L_0x004f\n L_0x0234:\n java.util.zip.CRC32 r0 = r7.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n long r10 = r0.getValue() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = (int) r10 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 65535(0xffff, float:9.1834E-41)\n r0 = r0 & r3\n dvl r3 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.c() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 == r3) goto L_0x024f\n java.util.zip.ZipException r0 = new java.util.zip.ZipException // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = \"Corrupt GZIP header\"\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x024f:\n dvm r0 = defpackage.dvm.INITIALIZE_INFLATER // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0256:\n java.util.zip.Inflater r0 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != 0) goto L_0x027e\n java.util.zip.Inflater r0 = new java.util.zip.Inflater // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 1\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.g = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0262:\n java.util.zip.CRC32 r0 = r7.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.reset() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r7.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 - r3\n if (r0 <= 0) goto L_0x0284\n java.util.zip.Inflater r3 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r7.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.setInput(r4, r10, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.INFLATING // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x027b:\n r0 = 1\n goto L_0x004f\n L_0x027e:\n java.util.zip.Inflater r0 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.reset() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x0262\n L_0x0284:\n dvm r0 = defpackage.dvm.INFLATER_NEEDS_INPUT // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x027b\n L_0x0289:\n int r0 = r9 + r5\n int r0 = r7.a(r8, r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r5 + r0\n dvm r0 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r4 = defpackage.dvm.TRAILER // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != r4) goto L_0x029e\n boolean r0 = r7.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r5 = r3\n goto L_0x004f\n L_0x029e:\n r0 = 1\n r5 = r3\n goto L_0x004f\n L_0x02a2:\n java.util.zip.Inflater r0 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 == 0) goto L_0x02c7\n r0 = 1\n L_0x02a7:\n java.lang.String r3 = \"inflater is null\"\n defpackage.cld.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r7.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != r3) goto L_0x02c9\n r0 = 1\n L_0x02b3:\n java.lang.String r3 = \"inflaterInput has unconsumed bytes\"\n defpackage.cld.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r0 = r7.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 512(0x200, float:7.175E-43)\n int r0 = java.lang.Math.min(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != 0) goto L_0x02cb\n r0 = 0\n goto L_0x004f\n L_0x02c7:\n r0 = 0\n goto L_0x02a7\n L_0x02c9:\n r0 = 0\n goto L_0x02b3\n L_0x02cb:\n r3 = 0\n r7.e = r3 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.f = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r3 = r7.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r7.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.a(r4, r10, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.Inflater r3 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r7.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.setInput(r4, r10, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.INFLATING // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x02e9:\n boolean r0 = r7.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x004f\n L_0x02ef:\n if (r0 == 0) goto L_0x0301\n dvm r0 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r3 = defpackage.dvm.HEADER // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != r3) goto L_0x0334\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 10\n if (r0 >= r3) goto L_0x0334\n L_0x0301:\n r0 = 1\n L_0x0302:\n r7.n = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r0 = r15.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r0.l // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r4 = 0\n r0.l = r4 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r2 = r2 + r3\n dvk r0 = r15.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r0.m // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r4 = 0\n r0.m = r4 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r1 = r1 + r3\n if (r5 != 0) goto L_0x0342\n if (r2 <= 0) goto L_0x0332\n dxe r0 = r15.a\n r0.a(r2)\n dxh r0 = r15.j\n dxh r3 = defpackage.dxh.BODY\n if (r0 != r3) goto L_0x0332\n dvk r0 = r15.g\n if (r0 == 0) goto L_0x0336\n dzo r0 = r15.d\n long r2 = (long) r1\n r0.d(r2)\n int r0 = r15.r\n int r0 = r0 + r1\n r15.r = r0\n L_0x0332:\n r0 = 0\n L_0x0333:\n return r0\n L_0x0334:\n r0 = 0\n goto L_0x0302\n L_0x0336:\n dzo r0 = r15.d\n long r4 = (long) r2\n r0.d(r4)\n int r0 = r15.r\n int r0 = r0 + r2\n r15.r = r0\n goto L_0x0332\n L_0x0342:\n dtd r0 = r15.m // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r3 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dxv r3 = defpackage.dxw.a(r3, r4, r5) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.a(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 + r5\n r15.i = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x000d\n L_0x0356:\n dtd r3 = r15.n // Catch:{ all -> 0x008e }\n int r3 = r3.a // Catch:{ all -> 0x008e }\n if (r3 != 0) goto L_0x0386\n if (r2 <= 0) goto L_0x0378\n dxe r0 = r15.a\n r0.a(r2)\n dxh r0 = r15.j\n dxh r3 = defpackage.dxh.BODY\n if (r0 != r3) goto L_0x0378\n dvk r0 = r15.g\n if (r0 == 0) goto L_0x037a\n dzo r0 = r15.d\n long r2 = (long) r1\n r0.d(r2)\n int r0 = r15.r\n int r0 = r0 + r1\n r15.r = r0\n L_0x0378:\n r0 = 0\n goto L_0x0333\n L_0x037a:\n dzo r0 = r15.d\n long r4 = (long) r2\n r0.d(r4)\n int r0 = r15.r\n int r0 = r0 + r2\n r15.r = r0\n goto L_0x0378\n L_0x0386:\n dtd r3 = r15.n // Catch:{ all -> 0x008e }\n int r3 = r3.a // Catch:{ all -> 0x008e }\n int r0 = java.lang.Math.min(r0, r3) // Catch:{ all -> 0x008e }\n int r2 = r2 + r0\n dtd r3 = r15.m // Catch:{ all -> 0x008e }\n dtd r4 = r15.n // Catch:{ all -> 0x008e }\n dxv r0 = r4.a(r0) // Catch:{ all -> 0x008e }\n dtd r0 = (defpackage.dtd) r0 // Catch:{ all -> 0x008e }\n r3.a(r0) // Catch:{ all -> 0x008e }\n goto L_0x000d\n L_0x039e:\n if (r2 <= 0) goto L_0x03ba\n dxe r0 = r15.a\n r0.a(r2)\n dxh r0 = r15.j\n dxh r3 = defpackage.dxh.BODY\n if (r0 != r3) goto L_0x03ba\n dvk r0 = r15.g\n if (r0 == 0) goto L_0x03bd\n dzo r0 = r15.d\n long r2 = (long) r1\n r0.d(r2)\n int r0 = r15.r\n int r0 = r0 + r1\n r15.r = r0\n L_0x03ba:\n r0 = 1\n goto L_0x0333\n L_0x03bd:\n dzo r0 = r15.d\n long r4 = (long) r2\n r0.d(r4)\n int r0 = r15.r\n int r0 = r0 + r2\n r15.r = r0\n goto L_0x03ba\n L_0x03c9:\n dzo r1 = r15.d\n long r4 = (long) r2\n r1.d(r4)\n int r1 = r15.r\n int r1 = r1 + r2\n r15.r = r1\n goto L_0x00ab\n L_0x03d6:\n r3 = r4\n goto L_0x01a8\n L_0x03d9:\n r3 = r0\n goto L_0x0118\n */\n throw new UnsupportedOperationException(\"Method not decompiled: defpackage.dxd.e():boolean\");\n }", "public void b(World paramaqu, Random paramRandom, BlockPosition paramdt, Block parambec)\r\n/* 77: */ {\r\n/* 78: 93 */ BlockPosition localdt1 = paramdt.up();\r\n/* 79: */ label260:\r\n/* 80: 95 */ for (int i = 0; i < 128; i++)\r\n/* 81: */ {\r\n/* 82: 96 */ BlockPosition localdt2 = localdt1;\r\n/* 83: 97 */ for (int j = 0; j < i / 16; j++)\r\n/* 84: */ {\r\n/* 85: 98 */ localdt2 = localdt2.offset(paramRandom.nextInt(3) - 1, (paramRandom.nextInt(3) - 1) * paramRandom.nextInt(3) / 2, paramRandom.nextInt(3) - 1);\r\n/* 86: 99 */ if ((paramaqu.getBlock(localdt2.down()).getType() != BlockList.grass) || (paramaqu.getBlock(localdt2).getType().blocksMovement())) {\r\n/* 87: */ break label260;\r\n/* 88: */ }\r\n/* 89: */ }\r\n/* 90:104 */ if (paramaqu.getBlock(localdt2).getType().material == Material.air)\r\n/* 91: */ {\r\n/* 92: */ Object localObject;\r\n/* 93:108 */ if (paramRandom.nextInt(8) == 0)\r\n/* 94: */ {\r\n/* 95:109 */ localObject = paramaqu.b(localdt2).a(paramRandom, localdt2);\r\n/* 96:110 */ avy localavy = ((EnumFlowerVariant)localObject).a().a();\r\n/* 97:111 */ Block localbec = localavy.instance().setData(localavy.l(), (Comparable)localObject);\r\n/* 98:112 */ if (localavy.f(paramaqu, localdt2, localbec)) {\r\n/* 99:113 */ paramaqu.setBlock(localdt2, localbec, 3);\r\n/* 100: */ }\r\n/* 101: */ }\r\n/* 102: */ else\r\n/* 103: */ {\r\n/* 104:116 */ localObject = BlockList.tallgrass.instance().setData(bbh.a, bbi.b);\r\n/* 105:117 */ if (BlockList.tallgrass.f(paramaqu, localdt2, (Block)localObject)) {\r\n/* 106:118 */ paramaqu.setBlock(localdt2, (Block)localObject, 3);\r\n/* 107: */ }\r\n/* 108: */ }\r\n/* 109: */ }\r\n/* 110: */ }\r\n/* 111: */ }", "public final void mo1285b() {\n }", "public void mo5832b(android.content.Context r4) {\n /*\n r3 = this;\n r0 = 1\n java.lang.String r1 = m3304x() // Catch:{ a -> 0x002f, IOException -> 0x0027 }\n r3.mo5830a(r0, r1) // Catch:{ a -> 0x002f, IOException -> 0x0027 }\n L_0x0008:\n r0 = 2\n java.lang.String r1 = m3302v() // Catch:{ a -> 0x002d, IOException -> 0x0027 }\n r3.mo5830a(r0, r1) // Catch:{ a -> 0x002d, IOException -> 0x0027 }\n L_0x0010:\n r0 = 25\n java.lang.Long r1 = m3303w() // Catch:{ a -> 0x002b, IOException -> 0x0027 }\n long r1 = r1.longValue() // Catch:{ a -> 0x002b, IOException -> 0x0027 }\n r3.mo5829a(r0, r1) // Catch:{ a -> 0x002b, IOException -> 0x0027 }\n L_0x001d:\n r0 = 24\n java.lang.String r1 = m3300d(r4) // Catch:{ a -> 0x0029, IOException -> 0x0027 }\n r3.mo5830a(r0, r1) // Catch:{ a -> 0x0029, IOException -> 0x0027 }\n L_0x0026:\n return\n L_0x0027:\n r0 = move-exception\n goto L_0x0026\n L_0x0029:\n r0 = move-exception\n goto L_0x0026\n L_0x002b:\n r0 = move-exception\n goto L_0x001d\n L_0x002d:\n r0 = move-exception\n goto L_0x0010\n L_0x002f:\n r0 = move-exception\n goto L_0x0008\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.C1107j.mo5832b(android.content.Context):void\");\n }", "private android.graphics.Bitmap m6555f() {\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/79094208.run(Unknown Source)\n*/\n /*\n r5 = this;\n r0 = r5.getWidth();\n r1 = r5.getHeight();\n r2 = m6543a(r0, r1);\t Catch:{ OutOfMemoryError -> 0x000d }\n return r2;\n L_0x000d:\n r2 = \"ShimmerFrameLayout failed to create working bitmap\";\n r3 = new java.lang.StringBuilder;\n r3.<init>(r2);\n r2 = \" (width = \";\n r3.append(r2);\n r3.append(r0);\n r0 = \", height = \";\n r3.append(r0);\n r3.append(r1);\n r0 = \")\\n\\n\";\n r3.append(r0);\n r0 = java.lang.Thread.currentThread();\n r0 = r0.getStackTrace();\n r1 = r0.length;\n r2 = 0;\n L_0x0033:\n if (r2 >= r1) goto L_0x0046;\n L_0x0035:\n r4 = r0[r2];\n r4 = r4.toString();\n r3.append(r4);\n r4 = \"\\n\";\n r3.append(r4);\n r2 = r2 + 1;\n goto L_0x0033;\n L_0x0046:\n r0 = r3.toString();\n r1 = \"ShimmerFrameLayout\";\n android.util.Log.d(r1, r0);\n r0 = 0;\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.shimmer.ShimmerFrameLayout.f():android.graphics.Bitmap\");\n }", "static com.qiyukf.nimlib.p470f.p471a.C5826a m23369a(android.os.Parcel r4) {\n /*\n com.qiyukf.nimlib.f.a.a r0 = new com.qiyukf.nimlib.f.a.a\n r1 = 0\n r0.m50001init(r1)\n int r2 = r4.readInt()\n r0.f18499a = r2\n int r2 = r4.readInt()\n if (r2 <= 0) goto L_0x001d\n byte[] r2 = r4.createByteArray()\n java.nio.ByteBuffer r2 = java.nio.ByteBuffer.wrap(r2)\n r0.f18501c = r2\n L_0x001d:\n int r2 = r4.readInt()\n r0.f18500b = r2\n int r2 = r4.readInt()\n if (r2 <= 0) goto L_0x0061\n byte[] r4 = r4.createByteArray()\n int r3 = r0.f18500b\n if (r3 <= 0) goto L_0x005c\n int r1 = r0.f18500b\n if (r1 != r2) goto L_0x0049\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.wrap(r4)\n r0.f18502d = r4\n java.nio.ByteBuffer r4 = r0.f18502d\n r4.position(r2)\n goto L_0x0068\n L_0x0049:\n int r1 = r0.f18500b\n java.nio.ByteBuffer r1 = java.nio.ByteBuffer.allocate(r1)\n r0.f18502d = r1\n java.nio.ByteBuffer r1 = r0.f18502d\n r1.put(r4)\n goto L_0x0068\n L_0x005c:\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.wrap(r4, r1, r2)\n goto L_0x0065\n L_0x0061:\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.allocate(r1)\n L_0x0065:\n r0.f18502d = r4\n L_0x0068:\n boolean r4 = m23372b(r0)\n if (r4 == 0) goto L_0x006f\n return r0\n L_0x006f:\n int r4 = r0.f18500b\n if (r4 <= 0) goto L_0x007d\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r4 = f18504a\n int r1 = r0.f18499a\n r4.put(r1, r0)\n goto L_0x00a2\n L_0x007d:\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r4 = f18504a\n int r1 = r0.f18499a\n java.lang.Object r4 = r4.get(r1)\n com.qiyukf.nimlib.f.a.a r4 = (com.qiyukf.nimlib.p470f.p471a.C5826a) r4\n if (r4 == 0) goto L_0x00a2\n java.nio.ByteBuffer r1 = r4.f18502d\n java.nio.ByteBuffer r0 = r0.f18502d\n r1.put(r0)\n boolean r0 = m23372b(r4)\n if (r0 == 0) goto L_0x00a2\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r0 = f18504a\n int r1 = r4.f18499a\n r0.remove(r1)\n return r4\n L_0x00a2:\n r4 = 0\n return r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.qiyukf.nimlib.p470f.p471a.C5826a.C5829b.m23369a(android.os.Parcel):com.qiyukf.nimlib.f.a.a\");\n }", "public void method_2250() {\r\n // $FF: Couldn't be decompiled\r\n }", "private final com.google.wireless.android.finsky.dfe.p513g.p514a.C7467r m35669b(com.google.protobuf.nano.C7213a r8) {\n /*\n r7 = this;\n r1 = 0;\n L_0x0001:\n r0 = r8.m33550a();\n switch(r0) {\n case 0: goto L_0x000e;\n case 10: goto L_0x000f;\n case 18: goto L_0x001c;\n case 26: goto L_0x0029;\n case 34: goto L_0x003c;\n case 42: goto L_0x0050;\n case 50: goto L_0x0064;\n case 82: goto L_0x0078;\n case 98: goto L_0x008e;\n case 138: goto L_0x00a4;\n case 146: goto L_0x00b9;\n case 152: goto L_0x00c7;\n case 162: goto L_0x0106;\n case 170: goto L_0x011c;\n case 178: goto L_0x012e;\n case 184: goto L_0x0143;\n case 192: goto L_0x0151;\n case 218: goto L_0x015f;\n case 226: goto L_0x0171;\n case 234: goto L_0x0187;\n case 258: goto L_0x019d;\n case 266: goto L_0x01b3;\n case 274: goto L_0x01c8;\n case 290: goto L_0x01de;\n case 298: goto L_0x021e;\n case 306: goto L_0x022c;\n default: goto L_0x0008;\n };\n L_0x0008:\n r0 = super.a(r8, r0);\n if (r0 != 0) goto L_0x0001;\n L_0x000e:\n return r7;\n L_0x000f:\n r0 = r8.m33564f();\n r7.f37912d = r0;\n r0 = r7.f37911c;\n r0 = r0 | 1;\n r7.f37911c = r0;\n goto L_0x0001;\n L_0x001c:\n r0 = r8.m33564f();\n r7.f37914f = r0;\n r0 = r7.f37911c;\n r0 = r0 | 4;\n r7.f37911c = r0;\n goto L_0x0001;\n L_0x0029:\n r0 = r7.f37916h;\n if (r0 != 0) goto L_0x0034;\n L_0x002d:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.c;\n r0.<init>();\n r7.f37916h = r0;\n L_0x0034:\n r0 = r7.f37916h;\n r8.m33552a(r0);\n r7.f37910a = r1;\n goto L_0x0001;\n L_0x003c:\n r0 = r7.f37917i;\n if (r0 != 0) goto L_0x0047;\n L_0x0040:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.z;\n r0.<init>();\n r7.f37917i = r0;\n L_0x0047:\n r0 = r7.f37917i;\n r8.m33552a(r0);\n r0 = 1;\n r7.f37910a = r0;\n goto L_0x0001;\n L_0x0050:\n r0 = r7.f37919k;\n if (r0 != 0) goto L_0x005b;\n L_0x0054:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.f;\n r0.<init>();\n r7.f37919k = r0;\n L_0x005b:\n r0 = r7.f37919k;\n r8.m33552a(r0);\n r0 = 3;\n r7.f37910a = r0;\n goto L_0x0001;\n L_0x0064:\n r0 = r7.f37922n;\n if (r0 != 0) goto L_0x006f;\n L_0x0068:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.o;\n r0.<init>();\n r7.f37922n = r0;\n L_0x006f:\n r0 = r7.f37922n;\n r8.m33552a(r0);\n r0 = 6;\n r7.f37910a = r0;\n goto L_0x0001;\n L_0x0078:\n r0 = r7.f37924p;\n if (r0 != 0) goto L_0x0083;\n L_0x007c:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.d;\n r0.<init>();\n r7.f37924p = r0;\n L_0x0083:\n r0 = r7.f37924p;\n r8.m33552a(r0);\n r0 = 8;\n r7.f37910a = r0;\n goto L_0x0001;\n L_0x008e:\n r0 = r7.f37926r;\n if (r0 != 0) goto L_0x0099;\n L_0x0092:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.n;\n r0.<init>();\n r7.f37926r = r0;\n L_0x0099:\n r0 = r7.f37926r;\n r8.m33552a(r0);\n r0 = 10;\n r7.f37910a = r0;\n goto L_0x0001;\n L_0x00a4:\n r0 = r7.f37923o;\n if (r0 != 0) goto L_0x00af;\n L_0x00a8:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.q;\n r0.<init>();\n r7.f37923o = r0;\n L_0x00af:\n r0 = r7.f37923o;\n r8.m33552a(r0);\n r0 = 7;\n r7.f37910a = r0;\n goto L_0x0001;\n L_0x00b9:\n r0 = r8.m33565g();\n r7.f37931w = r0;\n r0 = r7.f37911c;\n r0 = r0 | 16;\n r7.f37911c = r0;\n goto L_0x0001;\n L_0x00c7:\n r2 = r7.f37911c;\n r2 = r2 | 2;\n r7.f37911c = r2;\n r2 = r8.m33573o();\n r3 = r8.m33567i();\t Catch:{ IllegalArgumentException -> 0x00f3 }\n switch(r3) {\n case 0: goto L_0x00fc;\n case 101: goto L_0x00fc;\n case 102: goto L_0x00fc;\n case 103: goto L_0x00fc;\n case 105: goto L_0x00fc;\n case 106: goto L_0x00fc;\n case 107: goto L_0x00fc;\n case 108: goto L_0x00fc;\n case 109: goto L_0x00fc;\n case 111: goto L_0x00fc;\n case 112: goto L_0x00fc;\n case 113: goto L_0x00fc;\n case 114: goto L_0x00fc;\n case 115: goto L_0x00fc;\n case 116: goto L_0x00fc;\n case 117: goto L_0x00fc;\n case 118: goto L_0x00fc;\n case 119: goto L_0x00fc;\n case 120: goto L_0x00fc;\n case 201: goto L_0x00fc;\n case 202: goto L_0x00fc;\n case 203: goto L_0x00fc;\n case 204: goto L_0x00fc;\n case 205: goto L_0x00fc;\n case 206: goto L_0x00fc;\n case 207: goto L_0x00fc;\n case 209: goto L_0x00fc;\n case 210: goto L_0x00fc;\n case 211: goto L_0x00fc;\n case 212: goto L_0x00fc;\n case 213: goto L_0x00fc;\n case 214: goto L_0x00fc;\n case 215: goto L_0x00fc;\n case 217: goto L_0x00fc;\n case 218: goto L_0x00fc;\n case 219: goto L_0x00fc;\n case 220: goto L_0x00fc;\n case 221: goto L_0x00fc;\n case 222: goto L_0x00fc;\n case 223: goto L_0x00fc;\n case 224: goto L_0x00fc;\n case 301: goto L_0x00fc;\n case 302: goto L_0x00fc;\n case 304: goto L_0x00fc;\n case 305: goto L_0x00fc;\n case 307: goto L_0x00fc;\n case 309: goto L_0x00fc;\n case 310: goto L_0x00fc;\n case 311: goto L_0x00fc;\n case 312: goto L_0x00fc;\n case 313: goto L_0x00fc;\n case 314: goto L_0x00fc;\n case 316: goto L_0x00fc;\n case 317: goto L_0x00fc;\n case 318: goto L_0x00fc;\n case 319: goto L_0x00fc;\n case 320: goto L_0x00fc;\n case 321: goto L_0x00fc;\n case 322: goto L_0x00fc;\n case 323: goto L_0x00fc;\n case 324: goto L_0x00fc;\n case 325: goto L_0x00fc;\n case 326: goto L_0x00fc;\n case 327: goto L_0x00fc;\n case 328: goto L_0x00fc;\n case 401: goto L_0x00fc;\n case 402: goto L_0x00fc;\n case 403: goto L_0x00fc;\n case 404: goto L_0x00fc;\n case 405: goto L_0x00fc;\n case 406: goto L_0x00fc;\n case 407: goto L_0x00fc;\n case 408: goto L_0x00fc;\n case 409: goto L_0x00fc;\n case 410: goto L_0x00fc;\n case 411: goto L_0x00fc;\n case 412: goto L_0x00fc;\n case 501: goto L_0x00fc;\n case 502: goto L_0x00fc;\n case 503: goto L_0x00fc;\n case 504: goto L_0x00fc;\n case 505: goto L_0x00fc;\n case 506: goto L_0x00fc;\n case 507: goto L_0x00fc;\n case 508: goto L_0x00fc;\n case 509: goto L_0x00fc;\n case 510: goto L_0x00fc;\n case 511: goto L_0x00fc;\n case 512: goto L_0x00fc;\n case 513: goto L_0x00fc;\n case 514: goto L_0x00fc;\n case 515: goto L_0x00fc;\n case 601: goto L_0x00fc;\n case 701: goto L_0x00fc;\n case 702: goto L_0x00fc;\n case 703: goto L_0x00fc;\n case 704: goto L_0x00fc;\n case 705: goto L_0x00fc;\n case 706: goto L_0x00fc;\n case 707: goto L_0x00fc;\n case 708: goto L_0x00fc;\n case 709: goto L_0x00fc;\n case 710: goto L_0x00fc;\n case 711: goto L_0x00fc;\n case 801: goto L_0x00fc;\n case 802: goto L_0x00fc;\n case 803: goto L_0x00fc;\n case 804: goto L_0x00fc;\n case 805: goto L_0x00fc;\n case 806: goto L_0x00fc;\n case 807: goto L_0x00fc;\n case 808: goto L_0x00fc;\n case 809: goto L_0x00fc;\n case 810: goto L_0x00fc;\n case 811: goto L_0x00fc;\n case 812: goto L_0x00fc;\n case 901: goto L_0x00fc;\n case 902: goto L_0x00fc;\n case 903: goto L_0x00fc;\n case 904: goto L_0x00fc;\n case 905: goto L_0x00fc;\n case 906: goto L_0x00fc;\n case 907: goto L_0x00fc;\n case 908: goto L_0x00fc;\n case 909: goto L_0x00fc;\n case 910: goto L_0x00fc;\n case 911: goto L_0x00fc;\n case 912: goto L_0x00fc;\n case 913: goto L_0x00fc;\n case 914: goto L_0x00fc;\n case 915: goto L_0x00fc;\n case 916: goto L_0x00fc;\n case 1001: goto L_0x00fc;\n case 1002: goto L_0x00fc;\n default: goto L_0x00d8;\n };\t Catch:{ IllegalArgumentException -> 0x00f3 }\n L_0x00d8:\n r4 = new java.lang.IllegalArgumentException;\t Catch:{ IllegalArgumentException -> 0x00f3 }\n r5 = 44;\n r6 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x00f3 }\n r6.<init>(r5);\t Catch:{ IllegalArgumentException -> 0x00f3 }\n r3 = r6.append(r3);\t Catch:{ IllegalArgumentException -> 0x00f3 }\n r5 = \" is not a valid enum RelationType\";\n r3 = r3.append(r5);\t Catch:{ IllegalArgumentException -> 0x00f3 }\n r3 = r3.toString();\t Catch:{ IllegalArgumentException -> 0x00f3 }\n r4.<init>(r3);\t Catch:{ IllegalArgumentException -> 0x00f3 }\n throw r4;\t Catch:{ IllegalArgumentException -> 0x00f3 }\n L_0x00f3:\n r3 = move-exception;\n r8.m33562e(r2);\n r7.a(r8, r0);\n goto L_0x0001;\n L_0x00fc:\n r7.f37913e = r3;\t Catch:{ IllegalArgumentException -> 0x00f3 }\n r3 = r7.f37911c;\t Catch:{ IllegalArgumentException -> 0x00f3 }\n r3 = r3 | 2;\n r7.f37911c = r3;\t Catch:{ IllegalArgumentException -> 0x00f3 }\n goto L_0x0001;\n L_0x0106:\n r0 = r7.f37927s;\n if (r0 != 0) goto L_0x0111;\n L_0x010a:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.m;\n r0.<init>();\n r7.f37927s = r0;\n L_0x0111:\n r0 = r7.f37927s;\n r8.m33552a(r0);\n r0 = 11;\n r7.f37910a = r0;\n goto L_0x0001;\n L_0x011c:\n r0 = r7.f37932x;\n if (r0 != 0) goto L_0x0127;\n L_0x0120:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.ag;\n r0.<init>();\n r7.f37932x = r0;\n L_0x0127:\n r0 = r7.f37932x;\n r8.m33552a(r0);\n goto L_0x0001;\n L_0x012e:\n r0 = r7.f37920l;\n if (r0 != 0) goto L_0x0139;\n L_0x0132:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.t;\n r0.<init>();\n r7.f37920l = r0;\n L_0x0139:\n r0 = r7.f37920l;\n r8.m33552a(r0);\n r0 = 4;\n r7.f37910a = r0;\n goto L_0x0001;\n L_0x0143:\n r0 = r8.m33560d();\n r7.f37933y = r0;\n r0 = r7.f37911c;\n r0 = r0 | 32;\n r7.f37911c = r0;\n goto L_0x0001;\n L_0x0151:\n r0 = r8.m33560d();\n r7.f37934z = r0;\n r0 = r7.f37911c;\n r0 = r0 | 64;\n r7.f37911c = r0;\n goto L_0x0001;\n L_0x015f:\n r0 = r7.f37908A;\n if (r0 != 0) goto L_0x016a;\n L_0x0163:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.k;\n r0.<init>();\n r7.f37908A = r0;\n L_0x016a:\n r0 = r7.f37908A;\n r8.m33552a(r0);\n goto L_0x0001;\n L_0x0171:\n r0 = r7.f37929u;\n if (r0 != 0) goto L_0x017c;\n L_0x0175:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.y;\n r0.<init>();\n r7.f37929u = r0;\n L_0x017c:\n r0 = r7.f37929u;\n r8.m33552a(r0);\n r0 = 13;\n r7.f37910a = r0;\n goto L_0x0001;\n L_0x0187:\n r0 = r7.f37928t;\n if (r0 != 0) goto L_0x0192;\n L_0x018b:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.b;\n r0.<init>();\n r7.f37928t = r0;\n L_0x0192:\n r0 = r7.f37928t;\n r8.m33552a(r0);\n r0 = 12;\n r7.f37910a = r0;\n goto L_0x0001;\n L_0x019d:\n r0 = r7.f37925q;\n if (r0 != 0) goto L_0x01a8;\n L_0x01a1:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.e;\n r0.<init>();\n r7.f37925q = r0;\n L_0x01a8:\n r0 = r7.f37925q;\n r8.m33552a(r0);\n r0 = 9;\n r7.f37910a = r0;\n goto L_0x0001;\n L_0x01b3:\n r0 = r7.f37921m;\n if (r0 != 0) goto L_0x01be;\n L_0x01b7:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.h;\n r0.<init>();\n r7.f37921m = r0;\n L_0x01be:\n r0 = r7.f37921m;\n r8.m33552a(r0);\n r0 = 5;\n r7.f37910a = r0;\n goto L_0x0001;\n L_0x01c8:\n r0 = r7.f37930v;\n if (r0 != 0) goto L_0x01d3;\n L_0x01cc:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.x;\n r0.<init>();\n r7.f37930v = r0;\n L_0x01d3:\n r0 = r7.f37930v;\n r8.m33552a(r0);\n r0 = 14;\n r7.f37910a = r0;\n goto L_0x0001;\n L_0x01de:\n r0 = 290; // 0x122 float:4.06E-43 double:1.433E-321;\n r2 = com.google.protobuf.nano.C7222l.m33624a(r8, r0);\n r0 = r7.f37909B;\n if (r0 != 0) goto L_0x020a;\n L_0x01e8:\n r0 = r1;\n L_0x01e9:\n r2 = r2 + r0;\n r2 = new com.google.wireless.android.finsky.dfe.p513g.p514a.C7468s[r2];\n if (r0 == 0) goto L_0x01f3;\n L_0x01ee:\n r3 = r7.f37909B;\n java.lang.System.arraycopy(r3, r1, r2, r1, r0);\n L_0x01f3:\n r3 = r2.length;\n r3 = r3 + -1;\n if (r0 >= r3) goto L_0x020e;\n L_0x01f8:\n r3 = new com.google.wireless.android.finsky.dfe.g.a.s;\n r3.<init>();\n r2[r0] = r3;\n r3 = r2[r0];\n r8.m33552a(r3);\n r8.m33550a();\n r0 = r0 + 1;\n goto L_0x01f3;\n L_0x020a:\n r0 = r7.f37909B;\n r0 = r0.length;\n goto L_0x01e9;\n L_0x020e:\n r3 = new com.google.wireless.android.finsky.dfe.g.a.s;\n r3.<init>();\n r2[r0] = r3;\n r0 = r2[r0];\n r8.m33552a(r0);\n r7.f37909B = r2;\n goto L_0x0001;\n L_0x021e:\n r0 = r8.m33564f();\n r7.f37915g = r0;\n r0 = r7.f37911c;\n r0 = r0 | 8;\n r7.f37911c = r0;\n goto L_0x0001;\n L_0x022c:\n r0 = r7.f37918j;\n if (r0 != 0) goto L_0x0237;\n L_0x0230:\n r0 = new com.google.wireless.android.finsky.dfe.g.a.w;\n r0.<init>();\n r7.f37918j = r0;\n L_0x0237:\n r0 = r7.f37918j;\n r8.m33552a(r0);\n r0 = 2;\n r7.f37910a = r0;\n goto L_0x0001;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.wireless.android.finsky.dfe.g.a.r.b(com.google.protobuf.nano.a):com.google.wireless.android.finsky.dfe.g.a.r\");\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 }", "static /* synthetic */ void m205-wrap9(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1, int r2) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap9(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01, int):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap9(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01, int):void\");\n }", "public void m7211c() {\n /*\n r34 = this;\n r16 = 0;\n r15 = 0;\n r5 = 0;\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"MINOR_TYPE\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r3 = -1;\n r4 = r2.hashCode();\n switch(r4) {\n case -1172269795: goto L_0x002e;\n case 2157948: goto L_0x0038;\n case 2571565: goto L_0x0024;\n default: goto L_0x0018;\n };\n L_0x0018:\n r2 = r3;\n L_0x0019:\n switch(r2) {\n case 0: goto L_0x0042;\n case 1: goto L_0x0162;\n case 2: goto L_0x01a9;\n default: goto L_0x001c;\n };\n L_0x001c:\n r2 = \"Undefined type\";\n r0 = r34;\n mobi.mmdt.componentsutils.p079a.p080a.C1104b.m6366b(r0, r2);\n L_0x0023:\n return;\n L_0x0024:\n r4 = \"TEXT\";\n r2 = r2.equals(r4);\n if (r2 == 0) goto L_0x0018;\n L_0x002c:\n r2 = 0;\n goto L_0x0019;\n L_0x002e:\n r4 = \"STICKER\";\n r2 = r2.equals(r4);\n if (r2 == 0) goto L_0x0018;\n L_0x0036:\n r2 = 1;\n goto L_0x0019;\n L_0x0038:\n r4 = \"FILE\";\n r2 = r2.equals(r4);\n if (r2 == 0) goto L_0x0018;\n L_0x0040:\n r2 = 2;\n goto L_0x0019;\n L_0x0042:\n r4 = mobi.mmdt.ott.provider.p169c.C1594n.TEXT;\n r33 = r5;\n L_0x0046:\n r8 = mobi.mmdt.componentsutils.p079a.p084e.C1113a.m6421a();\n r10 = mobi.mmdt.ott.provider.p169c.C1592l.IN;\n r0 = r34;\n r2 = r0.f4758b;\n r0 = r34;\n r3 = r0.f4757a;\n r3 = mobi.mmdt.ott.p109d.p111b.C1309a.m6934a(r3);\n r3 = r3.m6942b();\n r2 = r2.equals(r3);\n if (r2 == 0) goto L_0x0064;\n L_0x0062:\n r10 = mobi.mmdt.ott.provider.p169c.C1592l.OUT;\n L_0x0064:\n r0 = r34;\n r2 = r0.f4757a;\n r0 = r34;\n r3 = r0.f4761e;\n r2 = mobi.mmdt.ott.provider.p169c.C1583c.m7972a(r2, r3, r10);\n if (r2 != 0) goto L_0x0023;\n L_0x0072:\n r2 = mobi.mmdt.ott.MyApplication.m6445a();\n r2 = r2.f4177h;\n if (r2 == 0) goto L_0x008a;\n L_0x007a:\n r2 = mobi.mmdt.ott.MyApplication.m6445a();\n r2 = r2.f4177h;\n r0 = r34;\n r3 = r0.f4759c;\n r2 = r2.equals(r3);\n if (r2 != 0) goto L_0x024e;\n L_0x008a:\n r17 = 0;\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"REPLY_ON_MESSAGE_ID\";\n r2 = r2.get(r3);\n if (r2 == 0) goto L_0x00b8;\n L_0x0098:\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"REPLY_ON_MESSAGE_ID\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r2 = r2.isEmpty();\n if (r2 != 0) goto L_0x00b8;\n L_0x00aa:\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"REPLY_ON_MESSAGE_ID\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r17 = r2;\n L_0x00b8:\n r2 = new mobi.mmdt.ott.d.a.b;\n r0 = r34;\n r3 = r0.f4761e;\n r0 = r34;\n r5 = r0.f4760d;\n r0 = r34;\n r6 = r0.f4762f;\n r7 = \"SEND_TIME_IN_GMT\";\n r6 = r6.get(r7);\n r6 = (java.lang.String) r6;\n r6 = java.lang.Long.parseLong(r6);\n r11 = mobi.mmdt.ott.provider.p169c.C1593m.NOT_READ;\n r0 = r34;\n r12 = r0.f4759c;\n r13 = mobi.mmdt.ott.provider.p169c.C1595o.GROUP;\n r0 = r34;\n r14 = r0.f4758b;\n r2.<init>(r3, r4, r5, r6, r8, r10, r11, r12, r13, r14, r15, r16, r17);\n r0 = r34;\n r3 = r0.f4757a;\n r3 = mobi.mmdt.ott.logic.p157e.C1509a.m7621a(r3);\n r0 = r34;\n r4 = r0.f4762f;\n r0 = r33;\n r3.m7626a(r2, r0, r4);\n L_0x00f2:\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"REPLY_ON_MESSAGE_ID\";\n r2 = r2.get(r3);\n if (r2 == 0) goto L_0x013c;\n L_0x00fe:\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"REPLY_ON_MESSAGE_ID\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r2 = r2.isEmpty();\n if (r2 != 0) goto L_0x013c;\n L_0x0110:\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"REPLY_ON_MESSAGE_ID\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r0 = r34;\n r3 = r0.f4757a;\n r0 = r34;\n r4 = r0.f4761e;\n mobi.mmdt.ott.provider.p169c.C1583c.m7976b(r3, r4, r2);\n r0 = r34;\n r3 = r0.f4757a;\n r2 = mobi.mmdt.ott.provider.p169c.C1583c.m8003n(r3, r2);\n r0 = r34;\n r3 = r0.f4757a;\n r0 = r34;\n r4 = r0.f4761e;\n r5 = mobi.mmdt.ott.provider.p169c.C1595o.SINGLE;\n mobi.mmdt.ott.logic.p112a.p120c.p121a.p123b.C1387u.m7218a(r3, r4, r2, r5);\n L_0x013c:\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"MINOR_TYPE\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r3 = \"TEXT\";\n r2 = r2.equals(r3);\n if (r2 != 0) goto L_0x0023;\n L_0x0150:\n r2 = new mobi.mmdt.ott.logic.a.c.a.b.b;\n r0 = r34;\n r3 = r0.f4757a;\n r0 = r34;\n r4 = r0.f4762f;\n r2.<init>(r3, r15, r4);\n mobi.mmdt.ott.logic.C1494c.m7541c(r2);\n goto L_0x0023;\n L_0x0162:\n r6 = mobi.mmdt.ott.provider.p169c.C1594n.STICKER;\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"STICKER_ID\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r0 = r34;\n r3 = r0.f4762f;\n r4 = \"STICKER_PACKAGE_ID\";\n r3 = r3.get(r4);\n r3 = (java.lang.String) r3;\n r0 = r34;\n r4 = r0.f4762f;\n r7 = \"STICKER_VERSION\";\n r4 = r4.get(r7);\n r4 = (java.lang.String) r4;\n if (r4 == 0) goto L_0x02c9;\n L_0x018a:\n if (r2 == 0) goto L_0x02c9;\n L_0x018c:\n if (r3 == 0) goto L_0x02c9;\n L_0x018e:\n r7 = r4.isEmpty();\n if (r7 != 0) goto L_0x02c9;\n L_0x0194:\n r7 = r2.isEmpty();\n if (r7 != 0) goto L_0x02c9;\n L_0x019a:\n r7 = r3.isEmpty();\n if (r7 != 0) goto L_0x02c9;\n L_0x01a0:\n r16 = mobi.mmdt.ott.provider.p174h.C1629b.m8295a(r4, r3, r2);\n r33 = r5;\n r4 = r6;\n goto L_0x0046;\n L_0x01a9:\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"FILE_TYPE\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r3 = -1;\n r4 = r2.hashCode();\n switch(r4) {\n case 327328941: goto L_0x01de;\n case 796404377: goto L_0x01ca;\n case 802160718: goto L_0x01e8;\n case 808293817: goto L_0x01d4;\n default: goto L_0x01bd;\n };\n L_0x01bd:\n r2 = r3;\n L_0x01be:\n switch(r2) {\n case 0: goto L_0x01f2;\n case 1: goto L_0x020c;\n case 2: goto L_0x0222;\n case 3: goto L_0x0238;\n default: goto L_0x01c1;\n };\n L_0x01c1:\n r2 = \"Undefined file type\";\n r0 = r34;\n mobi.mmdt.componentsutils.p079a.p080a.C1104b.m6366b(r0, r2);\n goto L_0x0023;\n L_0x01ca:\n r4 = \"FILE_TYPE_IMAGE\";\n r2 = r2.equals(r4);\n if (r2 == 0) goto L_0x01bd;\n L_0x01d2:\n r2 = 0;\n goto L_0x01be;\n L_0x01d4:\n r4 = \"FILE_TYPE_VIDEO\";\n r2 = r2.equals(r4);\n if (r2 == 0) goto L_0x01bd;\n L_0x01dc:\n r2 = 1;\n goto L_0x01be;\n L_0x01de:\n r4 = \"FILE_TYPE_PUSH_TO_TALK\";\n r2 = r2.equals(r4);\n if (r2 == 0) goto L_0x01bd;\n L_0x01e6:\n r2 = 2;\n goto L_0x01be;\n L_0x01e8:\n r4 = \"FILE_TYPE_OTHER\";\n r2 = r2.equals(r4);\n if (r2 == 0) goto L_0x01bd;\n L_0x01f0:\n r2 = 3;\n goto L_0x01be;\n L_0x01f2:\n r3 = mobi.mmdt.ott.provider.p169c.C1594n.IMAGE;\n r2 = new mobi.mmdt.ott.logic.a.c.a.b.h;\n r0 = r34;\n r4 = r0.f4757a;\n r0 = r34;\n r5 = r0.f4762f;\n r6 = mobi.mmdt.ott.provider.p170d.C1605j.IMAGE;\n r2.<init>(r4, r5, r6);\n r2 = r2.m7152a();\n L_0x0207:\n r33 = r2;\n r4 = r3;\n goto L_0x0046;\n L_0x020c:\n r3 = mobi.mmdt.ott.provider.p169c.C1594n.VIDEO;\n r2 = new mobi.mmdt.ott.logic.a.c.a.b.h;\n r0 = r34;\n r4 = r0.f4757a;\n r0 = r34;\n r5 = r0.f4762f;\n r6 = mobi.mmdt.ott.provider.p170d.C1605j.VIDEO;\n r2.<init>(r4, r5, r6);\n r2 = r2.m7152a();\n goto L_0x0207;\n L_0x0222:\n r3 = mobi.mmdt.ott.provider.p169c.C1594n.PUSH_TO_TALK;\n r2 = new mobi.mmdt.ott.logic.a.c.a.b.h;\n r0 = r34;\n r4 = r0.f4757a;\n r0 = r34;\n r5 = r0.f4762f;\n r6 = mobi.mmdt.ott.provider.p170d.C1605j.PUSH_TO_TALK;\n r2.<init>(r4, r5, r6);\n r2 = r2.m7152a();\n goto L_0x0207;\n L_0x0238:\n r3 = mobi.mmdt.ott.provider.p169c.C1594n.FILE;\n r2 = new mobi.mmdt.ott.logic.a.c.a.b.h;\n r0 = r34;\n r4 = r0.f4757a;\n r0 = r34;\n r5 = r0.f4762f;\n r6 = mobi.mmdt.ott.provider.p170d.C1605j.OTHER;\n r2.<init>(r4, r5, r6);\n r2 = r2.m7152a();\n goto L_0x0207;\n L_0x024e:\n if (r33 == 0) goto L_0x029c;\n L_0x0250:\n r0 = r34;\n r0 = r0.f4757a;\n r18 = r0;\n r19 = r33.m8082n();\n r20 = r33.m8069a();\n r21 = r33.m8079k();\n r22 = r33.m8073e();\n r23 = r33.m8078j();\n r24 = r33.m8077i();\n r26 = 0;\n r27 = r33.m8081m();\n r28 = r33.m8080l();\n r29 = r33.m8075g();\n r30 = r33.m8071c();\n r31 = r33.m8072d();\n r32 = r33.m8070b();\n r33 = r33.m8074f();\n r2 = mobi.mmdt.ott.provider.p170d.C1598c.m8100a(r18, r19, r20, r21, r22, r23, r24, r26, r27, r28, r29, r30, r31, r32, r33);\n r2 = r2.getLastPathSegment();\n r2 = java.lang.Long.parseLong(r2);\n r15 = java.lang.Long.valueOf(r2);\n L_0x029c:\n r0 = r34;\n r2 = r0.f4757a;\n r0 = r34;\n r3 = r0.f4761e;\n r0 = r34;\n r5 = r0.f4760d;\n r0 = r34;\n r6 = r0.f4762f;\n r7 = \"SEND_TIME_IN_GMT\";\n r6 = r6.get(r7);\n r6 = (java.lang.String) r6;\n r6 = java.lang.Long.parseLong(r6);\n r11 = mobi.mmdt.ott.provider.p169c.C1593m.READ;\n r0 = r34;\n r12 = r0.f4759c;\n r13 = mobi.mmdt.ott.provider.p169c.C1595o.GROUP;\n r0 = r34;\n r14 = r0.f4758b;\n mobi.mmdt.ott.provider.p169c.C1583c.m7966a(r2, r3, r4, r5, r6, r8, r10, r11, r12, r13, r14, r15, r16);\n goto L_0x00f2;\n L_0x02c9:\n r33 = r5;\n r4 = r6;\n goto L_0x0046;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: mobi.mmdt.ott.logic.a.c.a.b.s.c():void\");\n }", "public final synchronized void a(com.ss.android.ugc.aweme.base.e.b r11) {\n /*\n r10 = this;\n monitor-enter(r10)\n r8 = 1\n java.lang.Object[] r1 = new java.lang.Object[r8] // Catch:{ all -> 0x0041 }\n r9 = 0\n r1[r9] = r11 // Catch:{ all -> 0x0041 }\n com.meituan.robust.ChangeQuickRedirect r3 = f34732a // Catch:{ all -> 0x0041 }\n r4 = 0\n r5 = 25164(0x624c, float:3.5262E-41)\n java.lang.Class[] r6 = new java.lang.Class[r8] // Catch:{ all -> 0x0041 }\n java.lang.Class<com.ss.android.ugc.aweme.base.e.b> r2 = com.ss.android.ugc.aweme.base.e.b.class\n r6[r9] = r2 // Catch:{ all -> 0x0041 }\n java.lang.Class r7 = java.lang.Void.TYPE // Catch:{ all -> 0x0041 }\n r2 = r10\n boolean r1 = com.meituan.robust.PatchProxy.isSupport(r1, r2, r3, r4, r5, r6, r7) // Catch:{ all -> 0x0041 }\n if (r1 == 0) goto L_0x0032\n java.lang.Object[] r1 = new java.lang.Object[r8] // Catch:{ all -> 0x0041 }\n r1[r9] = r11 // Catch:{ all -> 0x0041 }\n com.meituan.robust.ChangeQuickRedirect r3 = f34732a // Catch:{ all -> 0x0041 }\n r4 = 0\n r5 = 25164(0x624c, float:3.5262E-41)\n java.lang.Class[] r6 = new java.lang.Class[r8] // Catch:{ all -> 0x0041 }\n java.lang.Class<com.ss.android.ugc.aweme.base.e.b> r0 = com.ss.android.ugc.aweme.base.e.b.class\n r6[r9] = r0 // Catch:{ all -> 0x0041 }\n java.lang.Class r7 = java.lang.Void.TYPE // Catch:{ all -> 0x0041 }\n r2 = r10\n com.meituan.robust.PatchProxy.accessDispatch(r1, r2, r3, r4, r5, r6, r7) // Catch:{ all -> 0x0041 }\n monitor-exit(r10)\n return\n L_0x0032:\n java.util.ArrayList<com.ss.android.ugc.aweme.base.e.b<T>> r1 = r10.f34733b // Catch:{ all -> 0x0041 }\n boolean r1 = r1.contains(r11) // Catch:{ all -> 0x0041 }\n if (r1 != 0) goto L_0x003f\n java.util.ArrayList<com.ss.android.ugc.aweme.base.e.b<T>> r1 = r10.f34733b // Catch:{ all -> 0x0041 }\n r1.add(r11) // Catch:{ all -> 0x0041 }\n L_0x003f:\n monitor-exit(r10)\n return\n L_0x0041:\n r0 = move-exception\n monitor-exit(r10)\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.ss.android.ugc.aweme.base.e.a.a(com.ss.android.ugc.aweme.base.e.b):void\");\n }", "void m5768b() throws C0841b;", "static /* synthetic */ void m200-wrap4(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap4(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap4(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }", "public static /* synthetic */ p163g.p201e.p203b.p204d.C5419r.C5420a m18181a(p163g.p201e.p203b.p204d.C5419r.C5420a r3, com.bamtech.sdk4.account.DefaultAccount r4, java.util.List<com.bamtech.sdk4.subscription.Subscription> r5, boolean r6, boolean r7, boolean r8, int r9, java.lang.Object r10) {\n /*\n r10 = r9 & 1\n if (r10 == 0) goto L_0x0006\n com.bamtech.sdk4.account.DefaultAccount r4 = r3.f12933a\n L_0x0006:\n r10 = r9 & 2\n if (r10 == 0) goto L_0x000c\n java.util.List<com.bamtech.sdk4.subscription.Subscription> r5 = r3.f12934b\n L_0x000c:\n r10 = r5\n r5 = r9 & 4\n if (r5 == 0) goto L_0x0013\n boolean r6 = r3.f12935c\n L_0x0013:\n r0 = r6\n r5 = r9 & 8\n if (r5 == 0) goto L_0x001a\n boolean r7 = r3.f12936d\n L_0x001a:\n r1 = r7\n r5 = r9 & 16\n if (r5 == 0) goto L_0x0021\n boolean r8 = r3.f12937e\n L_0x0021:\n r2 = r8\n r5 = r3\n r6 = r4\n r7 = r10\n r8 = r0\n r9 = r1\n r10 = r2\n g.e.b.d.r$a r3 = r5.mo17152a(r6, r7, r8, r9, r10)\n return r3\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p163g.p201e.p203b.p204d.C5419r.C5420a.m18181a(g.e.b.d.r$a, com.bamtech.sdk4.account.DefaultAccount, java.util.List, boolean, boolean, boolean, int, java.lang.Object):g.e.b.d.r$a\");\n }", "private final com.google.android.play.p179a.p352a.ae m28545b(com.google.protobuf.nano.a r8) {\n /*\n r7 = this;\n r6 = 1048576; // 0x100000 float:1.469368E-39 double:5.180654E-318;\n L_0x0002:\n r0 = r8.a();\n switch(r0) {\n case 0: goto L_0x000f;\n case 8: goto L_0x0010;\n case 18: goto L_0x001d;\n case 24: goto L_0x002a;\n case 34: goto L_0x0037;\n case 42: goto L_0x0044;\n case 50: goto L_0x0051;\n case 58: goto L_0x005e;\n case 66: goto L_0x006b;\n case 74: goto L_0x0078;\n case 82: goto L_0x0086;\n case 90: goto L_0x0094;\n case 98: goto L_0x00a2;\n case 106: goto L_0x00b0;\n case 114: goto L_0x00be;\n case 122: goto L_0x00cc;\n case 130: goto L_0x00dc;\n case 138: goto L_0x00eb;\n case 144: goto L_0x00fa;\n case 152: goto L_0x0108;\n case 160: goto L_0x0117;\n case 168: goto L_0x0126;\n default: goto L_0x0009;\n };\n L_0x0009:\n r0 = super.m4918a(r8, r0);\n if (r0 != 0) goto L_0x0002;\n L_0x000f:\n return r7;\n L_0x0010:\n r0 = r8.j();\n r7.f30754b = r0;\n r0 = r7.f30753a;\n r0 = r0 | 1;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x001d:\n r0 = r8.f();\n r7.f30755c = r0;\n r0 = r7.f30753a;\n r0 = r0 | 2;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x002a:\n r0 = r8.i();\n r7.f30757e = r0;\n r0 = r7.f30753a;\n r0 = r0 | 8;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0037:\n r0 = r8.f();\n r7.f30758f = r0;\n r0 = r7.f30753a;\n r0 = r0 | 16;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0044:\n r0 = r8.f();\n r7.f30759g = r0;\n r0 = r7.f30753a;\n r0 = r0 | 32;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0051:\n r0 = r8.f();\n r7.f30762j = r0;\n r0 = r7.f30753a;\n r0 = r0 | 256;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x005e:\n r0 = r8.f();\n r7.f30763k = r0;\n r0 = r7.f30753a;\n r0 = r0 | 512;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x006b:\n r0 = r8.f();\n r7.f30760h = r0;\n r0 = r7.f30753a;\n r0 = r0 | 64;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0078:\n r0 = r8.f();\n r7.f30761i = r0;\n r0 = r7.f30753a;\n r0 = r0 | 128;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0086:\n r0 = r8.f();\n r7.f30764l = r0;\n r0 = r7.f30753a;\n r0 = r0 | 1024;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0094:\n r0 = r8.f();\n r7.f30765m = r0;\n r0 = r7.f30753a;\n r0 = r0 | 2048;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x00a2:\n r0 = r8.f();\n r7.f30766n = r0;\n r0 = r7.f30753a;\n r0 = r0 | 4096;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x00b0:\n r0 = r8.f();\n r7.f30767o = r0;\n r0 = r7.f30753a;\n r0 = r0 | 8192;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x00be:\n r0 = r8.f();\n r7.f30768p = r0;\n r0 = r7.f30753a;\n r0 = r0 | 16384;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x00cc:\n r0 = r8.f();\n r7.f30769q = r0;\n r0 = r7.f30753a;\n r1 = 32768; // 0x8000 float:4.5918E-41 double:1.61895E-319;\n r0 = r0 | r1;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x00dc:\n r0 = r8.f();\n r7.f30770r = r0;\n r0 = r7.f30753a;\n r1 = 65536; // 0x10000 float:9.18355E-41 double:3.2379E-319;\n r0 = r0 | r1;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x00eb:\n r0 = r8.f();\n r7.f30771s = r0;\n r0 = r7.f30753a;\n r1 = 131072; // 0x20000 float:1.83671E-40 double:6.47582E-319;\n r0 = r0 | r1;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x00fa:\n r0 = r8.j();\n r7.f30756d = r0;\n r0 = r7.f30753a;\n r0 = r0 | 4;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0108:\n r0 = r8.i();\n r7.f30772t = r0;\n r0 = r7.f30753a;\n r1 = 262144; // 0x40000 float:3.67342E-40 double:1.295163E-318;\n r0 = r0 | r1;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0117:\n r0 = r8.e();\n r7.f30773u = r0;\n r0 = r7.f30753a;\n r1 = 524288; // 0x80000 float:7.34684E-40 double:2.590327E-318;\n r0 = r0 | r1;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0126:\n r1 = r7.f30753a;\n r1 = r1 | r6;\n r7.f30753a = r1;\n r1 = r8.o();\n r2 = r8.i();\t Catch:{ IllegalArgumentException -> 0x0151 }\n switch(r2) {\n case 0: goto L_0x015a;\n case 1: goto L_0x015a;\n case 2: goto L_0x015a;\n default: goto L_0x0136;\n };\t Catch:{ IllegalArgumentException -> 0x0151 }\n L_0x0136:\n r3 = new java.lang.IllegalArgumentException;\t Catch:{ IllegalArgumentException -> 0x0151 }\n r4 = 48;\n r5 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x0151 }\n r5.<init>(r4);\t Catch:{ IllegalArgumentException -> 0x0151 }\n r2 = r5.append(r2);\t Catch:{ IllegalArgumentException -> 0x0151 }\n r4 = \" is not a valid enum PairedDeviceType\";\n r2 = r2.append(r4);\t Catch:{ IllegalArgumentException -> 0x0151 }\n r2 = r2.toString();\t Catch:{ IllegalArgumentException -> 0x0151 }\n r3.<init>(r2);\t Catch:{ IllegalArgumentException -> 0x0151 }\n throw r3;\t Catch:{ IllegalArgumentException -> 0x0151 }\n L_0x0151:\n r2 = move-exception;\n r8.e(r1);\n r7.m4918a(r8, r0);\n goto L_0x0002;\n L_0x015a:\n r7.f30774v = r2;\t Catch:{ IllegalArgumentException -> 0x0151 }\n r2 = r7.f30753a;\t Catch:{ IllegalArgumentException -> 0x0151 }\n r2 = r2 | r6;\n r7.f30753a = r2;\t Catch:{ IllegalArgumentException -> 0x0151 }\n goto L_0x0002;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.play.a.a.ae.b(com.google.protobuf.nano.a):com.google.android.play.a.a.ae\");\n }", "public int mo4452e() {\n /*\n r7 = this;\n int r0 = r7.f2518c\n r7.f2519d = r0\n r0 = 0\n r1 = 0\n r2 = 0\n L_0x0007:\n int r3 = r7.f2519d\n if (r3 <= 0) goto L_0x003b\n byte r3 = r7.mo4449a()\n r4 = -1\n if (r3 == 0) goto L_0x0034\n r5 = 1\n if (r3 == r5) goto L_0x002e\n r6 = 2\n if (r3 == r6) goto L_0x002e\n r6 = 9\n if (r3 == r6) goto L_0x0007\n switch(r3) {\n case 14: goto L_0x0028;\n case 15: goto L_0x0028;\n case 16: goto L_0x0025;\n case 17: goto L_0x0025;\n case 18: goto L_0x0022;\n default: goto L_0x001f;\n }\n L_0x001f:\n if (r2 != 0) goto L_0x0007\n goto L_0x0039\n L_0x0022:\n int r1 = r1 + 1\n goto L_0x0007\n L_0x0025:\n if (r2 != r1) goto L_0x002b\n return r5\n L_0x0028:\n if (r2 != r1) goto L_0x002b\n return r4\n L_0x002b:\n int r1 = r1 + -1\n goto L_0x0007\n L_0x002e:\n if (r1 != 0) goto L_0x0031\n return r5\n L_0x0031:\n if (r2 != 0) goto L_0x0007\n goto L_0x0039\n L_0x0034:\n if (r1 != 0) goto L_0x0037\n return r4\n L_0x0037:\n if (r2 != 0) goto L_0x0007\n L_0x0039:\n r2 = r1\n goto L_0x0007\n L_0x003b:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: androidx.core.text.BidiFormatter.C0510a.mo4452e():int\");\n }" ]
[ "0.6855689", "0.65738744", "0.6553801", "0.65514857", "0.6516202", "0.6484478", "0.64813006", "0.6476208", "0.64747196", "0.6470553", "0.6430838", "0.6420733", "0.6368528", "0.6356758", "0.6338201", "0.63247937", "0.63150144", "0.6291071", "0.6282433", "0.6270945", "0.62367636", "0.62299246", "0.6229676", "0.6215116", "0.6207986", "0.6196978", "0.61768794", "0.61452335", "0.61432034", "0.6130158", "0.6129974", "0.61285233", "0.6099741", "0.6099082", "0.60608107", "0.6060026", "0.6060026", "0.60575604", "0.6054073", "0.60539496", "0.6049436", "0.6046234", "0.6045208", "0.6036884", "0.6035476", "0.60339725", "0.6020616", "0.6018105", "0.60116845", "0.59961224", "0.5983922", "0.5983274", "0.597611", "0.5968713", "0.59608376", "0.59604925", "0.595772", "0.5953958", "0.5953492", "0.5953476", "0.5953151", "0.5950911", "0.5937757", "0.5936555", "0.5932142", "0.5931507", "0.5924041", "0.59239984", "0.59216326", "0.59083736", "0.59051406", "0.59027374", "0.58958715", "0.5889676", "0.58884823", "0.58847827", "0.5881045", "0.5879774", "0.5871884", "0.58642006", "0.58621186", "0.58595127", "0.58586305", "0.5853653", "0.5848448", "0.5845878", "0.58427966", "0.5825365", "0.5824293", "0.58198774", "0.58134776", "0.5805533", "0.58028024", "0.5800715", "0.57977986", "0.57923895", "0.5787963", "0.57874143", "0.5776781", "0.57758224", "0.5769376" ]
0.0
-1
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_list_view_slide_item, container, false); listView = (RadListView)rootView.findViewById(R.id.listView); if(savedInstanceState != null) { destination = savedInstanceState.getParcelable("currentAttraction"); } if(destination == null) { return rootView; } ListViewAdapter adapter = new ListViewAdapter(destination.attractions); listView.setAdapter(adapter); View headerView = inflater.inflate(R.layout.listview_slideitem_header, listView, false); titleView = (TextView)headerView.findViewById(R.id.title); titleView.setText(destination.title); titleView.setTextColor(destination.color); contentView = (TextView)headerView.findViewById(R.id.content); contentView.setText(destination.info); TextView attractionsView = (TextView)headerView.findViewById(R.id.attractions); attractionsView.setTextColor(destination.color); listView.setHeaderView(headerView); FloatingActionButton fab = (FloatingActionButton)rootView.findViewById(R.id.fab); fab.getBackground().setColorFilter(destination.color, PorterDuff.Mode.SRC_IN); fab.setRippleColor(destination.color); View line = rootView.findViewById(R.id.line); line.setBackgroundColor(destination.color); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getActivity(), "Enquiry sent.", Toast.LENGTH_SHORT).show(); } }); image = (ImageView)rootView.findViewById(R.id.image); image.setImageResource(destination.src); CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) rootView.findViewById(R.id.collapsing_toolbar_layout); collapsingToolbar.setContentScrimColor(destination.color); Toolbar toolbar = (Toolbar) rootView.findViewById(R.id.toolbar); toolbar.setNavigationIcon(R.drawable.icon_arrow); toolbar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { getFragmentManager().popBackStack(); } }); return rootView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.wallpager_layout, null);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_invit_friends, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_zhuye, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_posts, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.ilustration_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_sow_drug_cost_per_week, container, false);\n\n db = new DataBaseAdapter(getActivity());\n hc = new HelperClass();\n pop = new FeedSowsFragment();\n\n infltr = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n parent = (LinearLayout) v.findViewById(R.id.layout_for_add);\n tvTotalCost = (TextView) v.findViewById(R.id.totalCost);\n\n getData();\n setData();\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_event, container, false);\n\n\n\n\n\n\n\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_feed, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.screen_select_list_student, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_overall, container, false);\n mNamesLayout = (LinearLayout) rootView.findViewById(R.id.fragment_overall_names_layout);\n mOverallView = (OverallView) rootView.findViewById(R.id.fragment_overall_view);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n\n\n view = inflater.inflate(R.layout.fragment_earning_fragmant, container, false);\n ini(view);\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n final View rootview = inflater.inflate(R.layout.activity_email_frag, container, false);\n ConfigInnerElements(rootview);\n return rootview;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\trootView = inflater.inflate(R.layout.fragment_attack_armor, container, false);\r\n\r\n\t\tfindInterfaceElements();\r\n\t\taddRangeSelector();\r\n\t\tupdateHeadings();\r\n\t\tsetListeners();\r\n\r\n\t\tsetFromData();\r\n\r\n\t\treturn rootView;\r\n\t}", "@SuppressLint(\"InflateParams\")\r\n\t@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_customer_all, null);\r\n\t\treturn view;\r\n\t}", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_fore_cast, container, false);\r\n initView();\r\n mainLayout.setVisibility(View.GONE);\r\n apiInterface = RestClinet.getClient().create(ApiInterface.class);\r\n loadData();\r\n return view;\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_friend, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_detail, container, false);\n image = rootView.findViewById(R.id.fr_image);\n name = rootView.findViewById(R.id.fr_name);\n phoneNumber = rootView.findViewById(R.id.fr_phone_number);\n email = rootView.findViewById(R.id.fr_email);\n street = rootView.findViewById(R.id.fr_street);\n city = rootView.findViewById(R.id.fr_city);\n state = rootView.findViewById(R.id.fr_state);\n zipcode = rootView.findViewById(R.id.fr_zipcode);\n dBrith = rootView.findViewById(R.id.date_brith);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_pm25, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_kkbox_playlist, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_feed_pager, container, false);\n\n// loadData();\n\n findViews(rootView);\n\n setViews();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n layout = (FrameLayout) inflater.inflate(R.layout.fragment_actualites, container, false);\n\n relLayout = (RelativeLayout) layout.findViewById(R.id.relLayoutActus);\n\n initListView();\n getXMLData();\n\n return layout;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.frag_post_prayer_video, container, false);\n setCustomDesign();\n setCustomClickListeners();\n return rootView;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.lf_em4305_fragment, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_recordings, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_category, container, false);\n initView(view);\n bindRefreshListener();\n loadParams();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_cm_box_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_layout12, container, false);\n\n iniv();\n\n init();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_details, container, false);\n //return inflater.inflate(R.layout.fragment_details, container, false);\n getIntentValues();\n initViews();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_mem_body_blood, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qiugouxiaoxi, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_coll_blank, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_attendance_divide, container, false);\n\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.show_program_fragment, parent, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,\n @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.visualization_fragment, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_category_details_page, container, false);\n initializeAll();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }", "protected int getLayoutResId() {\n return R.layout.activity_fragment;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_quizs, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n role = getArguments().getInt(\"role\");\n rootview = inflater.inflate(R.layout.fragment_application, container, false);\n layout = rootview.findViewById(R.id.patentDetails);\n progressBar = rootview.findViewById(R.id.progressBar);\n try {\n run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return rootview;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tview = inflater.inflate(R.layout.fragment_zhu, null);\n\t\tinitView();\n\t\tinitData();\n\t\treturn view;\n\t}", "@Override\n\t\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)\n\t\t{\n\t\t\tView rootView = inflater.inflate(R.layout.maimfragment, container, false);\n\t\t\treturn rootView;\n\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n return inflater.inflate(R.layout.fragment__record__week, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_porishongkhan, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dashboard, container, false);\n resultsRv = view.findViewById(R.id.db_results_rv);\n resultText = view.findViewById(R.id.db_search_empty);\n progressBar = view.findViewById(R.id.db_progressbar);\n lastVisitText = view.findViewById(R.id.db_last_visit);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_feedback, container, false);\n self = getActivity();\n initUI(view);\n initControlUI();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_service_summery, container, false);\n tvVoiceMS = v.findViewById(R.id.tvVoiceValue);\n tvDataMS = v.findViewById(R.id.tvdataValue);\n tvSMSMS = v.findViewById(R.id.tvSMSValue);\n tvVoiceFL = v.findViewById(R.id.tvVoiceFLValue);\n tvDataBS = v.findViewById(R.id.tvDataBRValue);\n tvTotal = v.findViewById(R.id.tvTotalAccountvalue);\n return v;\n }", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_clan_rank_details, container, false);\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_star_wars_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_lei, container, false);\n\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_quotation, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_wode_ragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n\n\n\n\n\n return inflater.inflate(R.layout.fragment_appoint_list, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n if (rootView == null) {\n rootView = inflater.inflate(R.layout.fragment_ip_info, container, false);\n initView();\n }\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_offer, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_rooms, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.fragment_img_eva, container, false);\n\n getSendData();\n\n initView(view);\n\n initData();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_project_collection, container, false);\n ButterKnife.bind(this, view);\n fragment = this;\n initView();\n getCollectionType();\n // getCategoryList();\n initBroadcastReceiver();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_yzm, container, false);\n initView(view);\n return view;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tmainLayout = inflater.inflate(R.layout.fragment_play, container, false);\r\n\t\treturn mainLayout;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_invite_request, container, false);\n initialiseVariables();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n getLocationPermission();\n return inflater.inflate(R.layout.centrum_fragment, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_habit_type_details, container, false);\n\n habitTitle = rootView.findViewById(R.id.textViewTitle);\n habitReason = rootView.findViewById(R.id.textViewReason);\n habitStartDate = rootView.findViewById(R.id.textViewStartDate);\n habitWeeklyPlan = rootView.findViewById(R.id.textViewWeeklyPlan);\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_information_friends4, container, false);\n\n if (getArguments() != null) {\n FriendsID = getArguments().getString(\"keyFriends\");\n }\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_post_details, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hotel, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_bus_inquiry, container, false);\n initView();\n initData();\n initDialog();\n getDataFromNet();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_weather, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_srgl, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_ground_detail_frgment, container, false);\n init();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_book_appointment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_wheretogo, container, false);\n ids();\n setup();\n click();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n binding = DataBindingUtil\n .inflate(inflater, R.layout.fragment_learning_leaders, container, false);\n init();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_end_game_tab, container, false);\n\n setupWidgets();\n setupTextFields(view);\n setupSpinners(view);\n\n // Inflate the layout for this fragment\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.memoir_fragment, container, false);\n\n getUserIdFromSharedPref();\n configureUI(view);\n configureSortSpinner();\n configureFilterSpinner();\n\n networkConnection = new NetworkConnection();\n new GetAllMemoirTask().execute();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_jadwal, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_delivery_detail, container, false);\n initialise();\n\n\n\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_4, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_product, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_group_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment06_7, container, false);\n initView(view);\n setLegend();\n setXAxis();\n setYAxis();\n setData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_downloadables, container, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.movie_list_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_like, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hall, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_unit_main, container, false);\n TextView mTxvBusinessAassistant = (TextView) view.findViewById(R.id.txv_business_assistant);\n TextView mTxvCardINformation = (TextView) view.findViewById(R.id.txv_card_information);\n RelativeLayout mRelOfficialWebsite = (RelativeLayout) view.findViewById(R.id.rel_official_website);\n RelativeLayout mRelPictureAblum = (RelativeLayout) view.findViewById(R.id.rel_picture_album);\n TextView mTxvQrCodeCard = (TextView) view.findViewById(R.id.txv_qr_code_card);\n TextView mTxvShareCard = (TextView) view.findViewById(R.id.txv_share_card);\n mTxvBusinessAassistant.setOnClickListener(this.mOnClickListener);\n mTxvCardINformation.setOnClickListener(this.mOnClickListener);\n mRelOfficialWebsite.setOnClickListener(this.mOnClickListener);\n mRelPictureAblum.setOnClickListener(this.mOnClickListener);\n mTxvQrCodeCard.setOnClickListener(this.mOnClickListener);\n mTxvShareCard.setOnClickListener(this.mOnClickListener);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_moviespage, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_s, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_overview, container, false);\n\n initOverviewComponents(view);\n registerListeners();\n initTagListener();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bahan_ajar, container, false);\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n root = (ViewGroup) inflater.inflate(R.layout.money_main, container, false);\n context = getActivity();\n initHeaderView(root);\n initView(root);\n\n getDate();\n initEvetn();\n return root;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_historical_event, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_event_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_video, container, false);\n unbinder = ButterKnife.bind(this, view);\n initView();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n v= inflater.inflate(R.layout.fragment_post_contacts, container, false);\n this.mapping(v);\n return v;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_measures, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_feed, container, false);\n findViews(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_surah_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_data_binded, container, false);\n }" ]
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.6625158", "0.66195583", "0.66164845", "0.6608733", "0.6596594", "0.65928894", "0.6585293", "0.65842897", "0.65730995", "0.6571248", "0.6569152", "0.65689117", "0.656853", "0.6566686", "0.65652984", "0.6553419", "0.65525705", "0.65432084", "0.6542382", "0.65411425", "0.6538022", "0.65366334", "0.65355957", "0.6535043", "0.65329415", "0.65311074", "0.65310687", "0.6528645", "0.65277404", "0.6525902", "0.6524516", "0.6524048", "0.65232015", "0.65224624", "0.65185034", "0.65130377", "0.6512968", "0.65122765", "0.65116245", "0.65106046", "0.65103024", "0.6509013", "0.65088093", "0.6508651", "0.6508225", "0.6504662", "0.650149", "0.65011525", "0.6500686", "0.64974767", "0.64935696", "0.6492234", "0.6490034", "0.6487609", "0.6487216", "0.64872116", "0.6486594", "0.64861935", "0.6486018", "0.6484269", "0.648366", "0.6481476", "0.6481086", "0.6480985", "0.6480396", "0.64797544", "0.647696", "0.64758915", "0.6475649", "0.6474114", "0.6474004", "0.6470706", "0.6470275", "0.64702207", "0.6470039", "0.6467449", "0.646602", "0.6462256", "0.64617974", "0.6461681", "0.6461214" ]
0.0
-1
Constructor. Initial capacity is 10.
public RegionSet(boolean sorted) { this(10, sorted); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setCapacity(int capacity) \n {\n this.capacity = capacity;\n }", "public void setCapacity(int capacity) {\r\n this.capacity = capacity;\r\n }", "public Crate(int cap){\r\n capacity = cap;\r\n }", "public void setCapacity(int capacity) {\n this.capacity = capacity;\n }", "public void setCapacity(int capacity) {\r\n\r\n this.capacity = capacity;\r\n }", "public ArrayQueue() {\n this(10);\n }", "public FixedSizeList(int capacity) {\n // YOUR CODE HERE\n }", "public RingBuffer(int capacity){\n structure = new LinkedList<E>();\n this.capacity = capacity;\n }", "public VectorLinearList()\n {// use default capacity of 10\n this(10);\n }", "public void setCapacity(Integer capacity) {\n this.capacity = capacity;\n }", "public void setCapacity(int value) {\n this.capacity = value;\n }", "public OrdinaryTruck() {\n\t\tsuper();\n\t\tmaxCapacity = 1000;\n\t}", "public void setCapacity(final int capacity) {\n this.capacity = capacity;\n }", "public Buffer(int capacity) {\r\n\t\t\r\n\t\tthis.data = new int[capacity];\r\n\t\tthis.capacity = capacity;\r\n\t\tthis.size = 0;\r\n\t\tthis.cursor = 0;\r\n\t\t\r\n\t\tinitialize();\r\n\t}", "public void setCapacity(int capacity) {\n\n\t\tthis.capacity = capacity;\n\t}", "public Queue()\r\n\t{\r\n\t\tthis(capacity);\r\n\t}", "public Storage(int capacity) {\n this.foods = new Food[capacity];\n buffer = new StringBuffer();\n }", "public int getInitialCapacity();", "public Battery(double initialCapacity) {\r\n capacity = initialCapacity;\r\n originalCapacity = initialCapacity;\r\n }", "public void setCapacity(Long capacity) {\n this.capacity = capacity;\n }", "abstract protected int getCapacity();", "public Locker(int capacity)\r\n {\r\n super(capacity);\r\n }", "public PageList(){\n count = 0;\n capacity = 4;\n itemArray = new int[capacity];\n }", "public PacketBuilder(int capacity) {\n\t\tbuffer = ByteBuffer.allocate(capacity);\n\t}", "public MyArrayList(int capacity) {\n\t\tarray = new Object[capacity];\n\t}", "public Stack() {\r\n\t\tthis(capacity);\r\n\t}", "public ArrayRingBuffer(int capacity) {\n Buffer_num = capacity;\n rb =(T[]) new Object[Buffer_num];\n fillCount = 0;\n first = 0;\n last = 0;\n }", "public Array(int capacity)\n {\n array = new Object[capacity];\n }", "public MyArrayList(int capacity){\n if(capacity >= 0)\n elements = new Object[capacity];\n else\n throw new IllegalArgumentException(\"capacity: \" + capacity);\n }", "public abstract int capacity();", "public void setCapacity(int n) {\n\t\tcapacity = n;\n\t}", "protected Recycler()\r\n/* 88: */ {\r\n/* 89:120 */ this(DEFAULT_MAX_CAPACITY_PER_THREAD);\r\n/* 90: */ }", "public Stack(int capacity) {\n this.foundation = new String[capacity];\n this.usage = 0;\n }", "public IntSequence(int capacity) {\n this.myValues = new int[capacity];\n }", "public void setCapacity(double capacity) {\n\t\tthis.capacity = capacity;\n\t}", "public DTCCollection(final int initialCapacity) {\n\t\tsuper(initialCapacity);\n\t}", "public ArrayList(int initialCapacity) {\n\t\tthis(initialCapacity, 75);\n\t}", "public int getCapacity();", "public DS_My() {\n // Set field variables\n this.CAPACITY = 500;\n this.ls = new Pair[CAPACITY];\n this.size = 0;\n }", "@SuppressWarnings(\"unchecked\")\n private void init(int capacity) {\n buffer = (T[]) new Object[capacity];\n head = 0;\n entries = 0;\n }", "public Population(int capacity) {\r\n Validate.positive(capacity, \"capacity\");\r\n this.capacity = capacity;\r\n }", "public MinStack() {\n this.capacity = CAPACITY;\n this.objects = new Object[capacity];\n }", "public int capacity();", "public int capacity();", "public void setCapacity(String capacity) {\n\t\tthis.capacity = capacity;\n\t}", "public BasicOrderedSeries( final int initialCapacity )\n\t{\n\t\tsuper( initialCapacity );\n\t}", "public SimpleList(int capacity) {\n this.values = new Object[capacity];\n }", "public Warehouse(int capacity) {\n\t\tsuper();\n\t\tthis.capacity = capacity;\n\t\twharehouseData = new Object[capacity];\n\t}", "List() {\n final int ten = 10;\n list = new int[ten];\n size = 0;\n }", "public int getCapacity() {\r\n return capacity;\r\n }", "public int getCapacity() {\r\n return capacity;\r\n }", "public int getCapacity() {\r\n return capacity;\r\n }", "@Override\n public int Capacity() {\n return current_capacity;\n }", "public MyArrayList(int capacity) {\r\n\t\t//checks if the capacity of the list exceeds the minimum capacity required by the array\r\n\t\tif (capacity > 4)\r\n\t\t\tthis.capacity=capacity;\r\n\t\tthis.list=new Object[this.capacity];\r\n\t\t//this()\r\n\t}", "public PriorityQueue(int capacity) { \r\n this.capacity=capacity;\r\n this.currentSize=0;\r\n this.queue=new NodeBase[capacity];\r\n }", "public Vector(int initialCapacity) {\n construct(initialCapacity);\n }", "public int getCapacity()\n {\n return capacity;\n }", "public int getCapacity() {\n return capacity;\n }", "public int getCapacity() {\n return capacity;\n }", "public int getCapacity() {\n return capacity;\n }", "public int getCapacity() {\n return capacity;\n }", "protected Recycler(int maxCapacityPerThread)\r\n/* 93: */ {\r\n/* 94:124 */ this(maxCapacityPerThread, MAX_SHARED_CAPACITY_FACTOR);\r\n/* 95: */ }", "public TabuList(int capacity)\r\n\t{\r\n\t\tthis.capacity = capacity;\r\n\t\tqueue = new LinkedList<Solution>();\r\n\t\tset = new TreeSet<Solution>();\r\n\t}", "@Test\n public void capacityTest() {\n // TODO: test capacity\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList () {\n\t\tcapacity = 10;\n\t\tsize = 0;\n\t\tlist = (E[]) new Object[capacity];\n\t}", "SchemaCache(int capacity) {\n super(64, 0.75f, true);\n this.capacity = capacity;\n }", "public ArrayRingBuffer(int capacity) {\n first = 0;\n last = 0;\n fillCount = 0;\n this.capacity = capacity;\n rb = (T[]) new Object[this.capacity];\n // Create new array with capacity elements.\n // first, last, and fillCount should all be set to 0.\n // this.capacity should be set appropriately. Note that the local variable\n // here shadows the field we inherit from AbstractBoundedQueue, so\n // you'll need to use this.capacity to set the capacity.\n }", "public StackClass(int ele[],int capacity){\n \tthis(ele); \n \tthis.capacity=capacity;\n\t}", "public MyStack(int capacity) {\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tT[] arr = (T[])new Object[capacity];\r\n\t\tstack = arr;\r\n\t\ttopIndex = -1;\r\n\t}", "public ArrayList() { // constructs list with default capacity\n this(CAPACITY);\n }", "@SuppressWarnings(\"unchecked\")\n public Trace(int capacity) {\n values = (T[])new Object[capacity];\n head = -1;\n used = 0;\n }", "public int getCapacity() {\r\n\r\n return capacity;\r\n }", "public MyStack() {\r\n\t\tthis(DEFAULT_CAPACITY);\r\n\t}", "public MessageQueue(int capacity) \n { \n elements = new Message[capacity]; \n count = 0; \n head = 0; \n tail = 0; \n }", "@Override\n public int getMaxCapacity() {\n return 156250000;\n }", "public Stack(int capacity) {\r\n// elements = new int[capacity];\r\n characters = new char[capacity];\r\n }", "public static int getCapacity() {\n\t\treturn capacity ;\n\t}", "public HeapSet (int initialCapacity) {\r\n\t\tsuper (initialCapacity);\r\n\t}", "public void setCapacity(int capacity)\n {\n Validate.isTrue(capacity > 0, \"Capacity must be > 0\");\n capacity_ = capacity; \n }", "public Heap(int initialCapacity) {\r\n\t\tthis(initialCapacity, null);\r\n\t}", "public MyLRUCache(int capacity) {\n\t\tthis.capacity = capacity;\n\t}", "public int getCapacity() {\r\n return this.capacity;\r\n }", "public StringList(int capacity) {\n super(capacity);\n }", "public int capacity() {\n return capacity;\n }", "public ListPool(int capacity) {\n pool = new ArrayBlockingQueue<>(capacity);\n }", "public GenericDynamicArray() {this(11);}", "public Long getCapacity() {\n return capacity;\n }", "public FixedSizeArrayStack() {\r\n\t\tthis(CAPACITY);\r\n\t}", "public ArrayQueue(int capacity){\r\n\t\tq = new String [capacity];\r\n\t\tn = 0;\r\n\t\tfirst = 0;\r\n\t\tlast = 0; \r\n\t}", "public final int getCapacity() {\n\t\treturn capacity;\n\t}", "public Heap(int capacity) {\n\t\t this.capacity = capacity;\n\t\t data = new Integer[this.capacity];\t\n\t\t size = 0;\n\t }", "public ObjectList(final int initialCapacity) {\n super(initialCapacity);\n }", "public RandomizedQueue() {\n this.capacity = 2;\n this.numberOfItems = 0;\n\n this.queue = (Item[]) new Object[capacity];\n }", "public int getCapacity() {\n\n\t\treturn capacity;\n\t}", "public int capacity()\n {\n return capacity;\n }", "protected Recycler(int maxCapacityPerThread, int maxSharedCapacityFactor)\r\n/* 98: */ {\r\n/* 99:128 */ this(maxCapacityPerThread, maxSharedCapacityFactor, RATIO, MAX_DELAYED_QUEUES_PER_THREAD);\r\n/* 100: */ }", "public RandomizedQueue() {\n \t\titems = new Object[MIN_COUNT];\n \t\tsize = 0;\n \t}", "public Stack() {\r\n this(20);\r\n }", "public LRUCache(int capacity) {\n super(capacity + 1, 1.0f, true); // Pass 'true' for accessOrder.\n this.capacity = capacity;\n }", "public double getCapacity() {\n\t\treturn capacity;\n\t}", "public VectorStackWithIterator() {\n\t\tthis(10);\n\t}" ]
[ "0.75192744", "0.7344346", "0.7318697", "0.7310526", "0.7302553", "0.7269782", "0.71923685", "0.7165135", "0.71618676", "0.710623", "0.7072989", "0.7025536", "0.70026684", "0.696228", "0.6959608", "0.69046104", "0.6900964", "0.6899584", "0.6895133", "0.6845615", "0.6832458", "0.6830746", "0.68072265", "0.67776537", "0.67735845", "0.6769996", "0.6768015", "0.67613655", "0.6748616", "0.67470074", "0.67407924", "0.67337155", "0.6712689", "0.6708599", "0.66915303", "0.6680554", "0.66740376", "0.6671012", "0.667043", "0.66661286", "0.6646934", "0.6640558", "0.6640258", "0.6640258", "0.66339844", "0.66217613", "0.66194254", "0.6612872", "0.66047406", "0.66024256", "0.66024256", "0.66024256", "0.6600925", "0.65998775", "0.6593223", "0.6592692", "0.65867984", "0.65852225", "0.65852225", "0.65852225", "0.65852225", "0.6566304", "0.65457964", "0.65399945", "0.6531602", "0.6523798", "0.6510345", "0.6508483", "0.64974356", "0.6489084", "0.64862084", "0.6481246", "0.64781505", "0.64781445", "0.64757264", "0.6475256", "0.64634144", "0.6462793", "0.64482707", "0.6438191", "0.6434773", "0.64334106", "0.6430366", "0.6411977", "0.64114964", "0.6402813", "0.64010787", "0.64003605", "0.6399468", "0.6388004", "0.63832223", "0.6379997", "0.6376761", "0.6372972", "0.63638484", "0.63595915", "0.63520026", "0.6341495", "0.63358843", "0.6332918", "0.6327839" ]
0.0
-1
sort regions with highest priority (highest value) first
@Override public int compare(E region1, E region2) { return Integer.compare(region2.getPriority(), region1.getPriority()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void dimension_sort() { // sort the dimensions according to their effect to GCP\n\t\tfor (int i = 0;i < dims-1;i++) {\n\t\t\tdimension[i] = (byte) i;\n\t\t}\n\t\tboolean swapped = true;\n\t\tint i=0;\n\t\tbyte temp;\n\t\twhile (swapped) {\n\t\t\tswapped = false;\n\t\t\ti++;\n\t\t\tfor (int j = 0; j < dimension.length-i;j++) { // smaller range, put it the front\n\t\t\t\tif (cardinalities[dimension[j]] > cardinalities[dimension[j+1]]) {\n\t\t\t\t\ttemp = dimension[j];\n\t\t\t\t\tdimension[j] = dimension[j+1];\n\t\t\t\t\tdimension[j+1] = temp;\n\t\t\t\t\tswapped = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void sortScoresDescendently(){\n this.langsScores.sort((LangScoreBankUnit o1, LangScoreBankUnit o2) -> {\n return Double.compare(o2.getScore(),o1.getScore());\n });\n }", "public void sortCompetitors(){\n\t\t}", "int getPriorityOrder();", "public void sortArray(){\n\t\tfor (int i=0; i<population.length;i++){\n\n\t\t\tfor (int j=0; j<population.length-i-1;j++){\n\n\t\t\t\tif(population[j].computeFitness()>population[j+1].computeFitness()) {\n\t\t\t\t\t//swap their positions in the array\n\t\t\t\t\tChromosome temp1 = population[j];\n\t\t\t\t\tpopulation[j] = population[j+1];\n\t\t\t\t\tpopulation[j+1] = temp1;\n\t\t\t\t}//end if\n\n\t\t\t}//end j for\n\n\t\t}//end i for\n\t}", "public void sort() {\r\n // sort the process variables\r\n Arrays.sort(pvValues, categoryComparator);\r\n fireTableDataChanged();\r\n }", "private void sortEScores() {\n LinkedHashMap<String, Double> sorted = eScores\n .entrySet()\n .stream()\n .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))\n .collect(\n toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,\n LinkedHashMap::new));\n eScores = sorted;\n }", "public static void sortByFitlvl() {\n Collections.sort(Population);\n if (debug) {\n debugLog(\"\\nSorted: \");\n printPopulation();\n }\n }", "@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}", "private static void mergeSort(int[] attr, int low, int hight) {\n\t\t\n\t}", "public Comparator<Integer> comparator() {\n return new Comparator<Integer>() {\n @Override\n public int compare(Integer o1, Integer o2) {\n Http2PriorityNode n1 = nodesByID.get(o1);\n Http2PriorityNode n2 = nodesByID.get(o2);\n if(n1 == null && n2 == null) {\n return 0;\n }\n if(n1 == null) {\n return -1;\n }\n if(n2 == null) {\n return 1;\n }\n //do the comparison\n //this is kinda crap, but I can't really think of any better way to handle this\n\n double d1 = createWeightingProportion(n1);\n double d2 = createWeightingProportion(n2);\n return Double.compare(d1, d2);\n }\n };\n }", "private void sort() {\n Collections.sort(mEntries, new Comparator<BarEntry>() {\n @Override\n public int compare(BarEntry o1, BarEntry o2) {\n return o1.getX() > o2.getX() ? 1 : o1.getX() < o2.getX() ? -1 : 0;\n }\n });\n }", "void order() {\n for (int i = 0; i < numVertices; i++) {\n if (simp[i][numParams] < simp[best][numParams]) {\n best = i;\n }\n if (simp[i][numParams] > simp[worst][numParams]) {\n worst = i;\n }\n }\n nextWorst = best;\n for (int i = 0; i < numVertices; i++) {\n if (i != worst) {\n if (simp[i][numParams] > simp[nextWorst][numParams]) {\n nextWorst = i;\n }\n }\n }\n }", "private static ArrayList<Integer> mergKsort(int[][] arr) {\n\t\tArrayList<Integer> rv = new ArrayList<>();\r\n\t\tPriorityQueue<Pair> pq= new PriorityQueue<>();\r\n\t\t\t\t\r\n\t\tfor (int i=0;i<arr.length;i++) {\r\n\t\tPair p = new Pair(i,0,arr[i][0]);\r\n\t\t\tpq.add(p);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\twhile(pq.size()>0) {\r\n\t\t\tPair p=pq.remove();\r\n\t\t\trv.add(p.val);\r\n\t\t\tp.di++;\r\n\t\t\tif(p.di<arr[p.li].length) {\r\n\t\t\t\tp.val=arr[p.li][p.di];\r\n\t\t\t\tpq.add(p);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn rv;\r\n\r\n\t}", "protected void sortResources()\n {\n PriorityComparator priorityComparator = new PriorityComparator();\n List<Resource> resources = getResources();\n Collections.sort(resources, priorityComparator);\n }", "public void sortGivenArray_popularity() { \n int i, j, k; \n for(i = movieList.size()/2; i > 0; i /= 2) {\n for(j = i; j < movieList.size(); j++) {\n Movie key = movieList.get(j);\n for(k = j; k >= i; k -= i) {\n if(key.rents > movieList.get(k-i).rents) {\n movieList.set(k, movieList.get(k-i));\n } else {\n break; \n }\n }\n movieList.set(k, key);\n }\n } \n }", "private void sortByWeight()\n\t{\n\t\tfor(int i=1; i<circles.size(); i++)\n\t\t{\n\t\t\tPVCircle temp = circles.get(i);\n\t\t\tint thisWeight = circles.get(i).getWeight();\n\t\t\tint j;\n\t\t\tfor(j=i-1; j>=0; j--)\n\t\t\t{\n\t\t\t\tint compWeight = circles.get(j).getWeight();\n\t\t\t\tif(thisWeight < compWeight)\n\t\t\t\t\tbreak;\n\t\t\t\telse\n\t\t\t\t\tcircles.set(j+1, circles.get(j));\n\t\t\t}\n\t\t\tcircles.set(j+1, temp);\n\t\t}\n\t\t\n\t}", "@Override\n public int compare(Integer a, Integer b) {\n if (base.get(a) >= base.get(b)) {\n return 1;\n } else {\n return -1;\n } // returning 0 would merge keys\n }", "private void sortLeaves() {\r\n\r\n\t\tboolean swapOccured;\r\n\r\n\t\tdo {\r\n\t\t\tswapOccured = false;\r\n\r\n\t\t\tfor(int index=0; index < this.treeNodes.length - 1; index++) {\r\n\t\t\t\tint currentLeaf = index;\r\n\t\t\t\tint nextLeaf = currentLeaf + 1;\r\n\t\t\t\tif(this.treeNodes[currentLeaf].getFrequency() > this.treeNodes[nextLeaf].getFrequency()) {\r\n\t\t\t\t\tswapLeaves(currentLeaf, nextLeaf);\r\n\t\t\t\t\tswapOccured=true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile(swapOccured);\r\n\t}", "protected Individual[] sortIndsArr(Individual[] ar)\n\t\t{\tint num_ar = ar.length;\n\t\t\tIndividual temp;\n\t\t\tfor(int j=0;j<num_ar-1;j++)\n\t\t\t\tfor(int i=0;i<num_ar-1-j;i++)\n\t\t\t\t\tif(ar[i].getFitness()<ar[i+1].getFitness()) {\n\t\t\t\t\t\ttemp\t= ar[i+1];\n\t\t\t\t\t\tar[i+1]\t= ar[i];\n\t\t\t\t\t\tar[i]\t= temp;\n\t\t\t\t\t}\n\t\t\treturn ar;\n\t\t}", "private void sortByAmount(){\n int stopPos = 0;\n while(colours.size()-stopPos > 0){\n int inARow = 1;\n for(int i = colours.size() - 1; i > stopPos; i--){\n if(colours.get(i-1).getAmount() < colours.get(i).getAmount()){\n rgb temp = new rgb(colours.get(i-1));\n colours.set(i-1, colours.get(i));\n colours.set(i, temp);\n }else{\n inARow++;\n }\n }\n stopPos++;\n if(inARow == colours.size()){\n break;\n }\n }\n }", "public void sortKnowledgeBase()\n {\n int i;\n Random random;\n String aPredicate;\n StringTokenizer tokenizer;\n //------------\n random = new Random();\n i = 0;\n while (i < knowledgeBase.size())\n {\n aPredicate = knowledgeBase.get(i).commitments.get(0).predicate;\n tokenizer = new StringTokenizer(aPredicate,\"(), \");\n if(tokenizer.nextToken().equals(\"secuencia\"))\n knowledgeBase.get(i).priority = random.nextInt(100);\n //end if\n else\n knowledgeBase.get(i).priority = random.nextInt(10000);\n //end else\n i = i + 1;\n }//end while\n Collections.sort(knowledgeBase);\n }", "private Vector<Node> sortCodes()\n\t{\n\t\tVector<Node> nodes = new Vector<Node>();\n\t\tfor(int i = 0; i < prioQ.size(); i++)\n\t\t{\n\t\t\tNode n = new Node(prioQ.get(i).getData(),\n\t\t\t\t\tprioQ.get(i).getCount());\n\t\t\tnodes.add(n);\n\t\t}\n\t\n\t\tCollections.sort(nodes, new Comparator() {\n\t public int compare(Object o1, Object o2) {\n\t Integer x1 = ((Node) o1).getCount();\n\t Integer x2 = ((Node) o2).getCount();\n\t int sComp = x1.compareTo(x2);\n\n\t if (sComp != 0) {\n\t return sComp;\n\t } else {\n\t Integer a1 = ((Node) o1).getData();\n\t Integer a2 = ((Node) o2).getData();\n\t return a1.compareTo(a2);\n\t }\n\t }\n\t });\n\t\t\n\t\treturn nodes;\n\t}", "public void selectionSort()\r\n {\r\n for(int x = 0; x < numItems; x++)\r\n {\r\n int smallestLoc = x;\r\n for(int y = x+1; y<numItems; y++)\r\n {\r\n if(mArray[y]< mArray[smallestLoc])\r\n {\r\n smallestLoc = y;\r\n }\r\n }\r\n int temp = mArray[x];\r\n mArray[x] = mArray[smallestLoc];\r\n mArray[smallestLoc] = temp;\r\n }\r\n }", "public void sort() {\n\t\t\tCollections.sort(population, new SolutionComparator());\n\t\t}", "public ArrayList<Chromosome> getChromosomesSorted() {\n int j;\n boolean flag = true; // set flag to true to begin first pass\n Chromosome temp; //holding variable\n ArrayList<Chromosome> sortedChromosomes = this.chromosomes;\n while (flag) {\n flag = false; //set flag to false awaiting a possible swap\n for (j = 0; j < sortedChromosomes.size() - 1; j++) {\n if (sortedChromosomes.get(j).getTotalGH() < sortedChromosomes.get(j + 1).getTotalGH()) // change to > for ascending sort\n {\n temp = sortedChromosomes.get(j); //swap elements\n sortedChromosomes.set(j, sortedChromosomes.get(j + 1));\n sortedChromosomes.set(j + 1, temp);\n flag = true; //shows a swap occurred \n }\n }\n }\n return sortedChromosomes;\n }", "@Override\r\n\t\t\tpublic int compare(Presentor o1, Presentor o2) {\n\t\t\t\tint sort = 0;\r\n\t\t\t\tint a = o1.getZs() - o2.getZs();\r\n\t\t\t\tif (a != 0) {\r\n\t\t\t\t\tsort = (a < 0) ? 1 : -1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\ta = o1.getJd() - o2.getJd();\r\n\t\t\t\t\tif (a != 0) {\r\n\t\t\t\t\t\tsort = (a < 0) ? 1 : -1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn sort;\r\n\t\t\t}", "public void sortSubstrateSwitchByResource() {\n\t\tCollections.sort(this.listNode, new Comparator<SubstrateSwitch>() {\n\t\t\t@Override\n\t\t\tpublic int compare(SubstrateSwitch o1, SubstrateSwitch o2) {\n\n\t\t\t\tif (o1.getCpu() < o2.getCpu()) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tif (o1.getCpu() > o2.getCpu()) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t});\n\t}", "@Override\n\t\t\t\tpublic int compare(Integer a, Integer b) {\n\t\t\t\t\tInteger x= (Integer)P[a];\n\t\t\t\t\tInteger y= (Integer)P[b];\n\t\t\t\t\treturn x.compareTo(y);\n\t\t\t\t}", "@Override\n\t\t\tpublic int compare( Entry<Exercice, Integer> o1, Entry<Exercice, Integer> o2 )\n\t\t\t{\n\t\t\t\treturn - o1.getValue().compareTo( o2.getValue() );\n\t\t\t}", "public List<ValueType> sort() {\r\n // TODO\r\n return null;\r\n }", "public static void selectionSort (int[] elts) {\r\n\t\tint minPosition;\r\n\t\tint length = elts.length;\r\n\t\tfor (int i = 0; i < length-1; i++) {\r\n\t\t\tminPosition = findMinPositionSegment (elts, i, length-i);\r\n\t\t\tif (minPosition != i)\r\n\t\t\t\tswap (elts, i, minPosition);\r\n\t\t}\r\n\t}", "public static void selectionSort (int[] elts) {\r\n\t\tint minPosition;\r\n\t\tint length = elts.length;\r\n\t\tfor (int i = 0; i < length-1; i++) {\r\n\t\t\tminPosition = findMinPositionSegment (elts, i, length-i);\r\n\t\t\tif (minPosition != i)\r\n\t\t\t\tswap (elts, i, minPosition);\r\n\t\t}\r\n\t}", "public void sortBlocks(){\n\t\tCurrentSets = getCurrentSets();\n\t\tif(CurrentSets == 1){\n\t\t\treturn;\n\t\t}else{\n\t\t\tfor(i = 0; i < CurrentSets - 1; i++){\n\t\t\t\tfor(j = i + 1; j < CurrentSets; j++){\n\t\t\t\t\tif((Integer.parseInt(blocks[i].getHexTag(), 16)) > (Integer.parseInt(blocks[j].getHexTag(), 16))){\n\t\t\t\t\t\ttemp = blocks[j];\n\t\t\t\t\t\tblocks[j] = blocks[i];\n\t\t\t\t\t\tblocks[i] = temp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void sortByFuelConsumption(){\n for (int d = carPark.getCars().size() / 2; d >= 1; d /= 2)\n for (int i = d; i < carPark.getCars().size(); i++)\n for (int j = i; j >= d && carPark.getCars().get(j-d).getFuelConsumption() > carPark.getCars().get(j).getFuelConsumption(); j -= d) {\n Car temp = carPark.getCars().get(j);\n carPark.getCars().remove(j);\n carPark.getCars().add(j - 1, temp);\n }\n }", "protected HRegionInfo[] getMostLoadedRegions() {\n ArrayList<HRegionInfo> regions = new ArrayList<HRegionInfo>();\n synchronized (onlineRegions) {\n for (HRegion r : onlineRegions.values()) {\n if (regions.size() < numRegionsToReport) {\n regions.add(r.getRegionInfo());\n } else {\n break;\n }\n }\n }\n return regions.toArray(new HRegionInfo[regions.size()]);\n }", "private void sortEntities(){\n for (int i = 1; i < sorted.size; i++) {\n for(int j = i ; j > 0 ; j--){\n \tEntity e1 = sorted.get(j);\n \tEntity e2 = sorted.get(j-1);\n if(getRL(e1) < getRL(e2)){\n sorted.set(j, e2);\n sorted.set(j-1, e1);\n }\n }\n }\n }", "private void sort() {\n ScoreComparator comparator = new ScoreComparator();\n Collections.sort(scores, comparator);\n }", "public int compareTo(FilterMapping o)\n {\n if (this.depth < o.depth)\n return -1;\n else if (this.depth > o.depth)\n return 1;\n else if (this.priority < o.priority)\n return -1;\n else if (this.priority > o.priority)\n return 1;\n else\n return 0;\n }", "void sortV();", "public void sortMatches();", "public List<GameStateChild> orderChildrenWithHeuristics(List<GameStateChild> children)\n {\n \tList<Double> childUtils = new ArrayList<Double>();\n \tList<Double> tempUtils = new ArrayList<Double>();\n \tList<GameStateChild> tempChildren = new ArrayList<GameStateChild>();\n \t\n \tdouble tempUtil;\n \tint tempIndex = 0;\n \tint priority = 1;\n \t\n \tfor(int i = 0; i < children.size(); i++) {\n \t\tGameStateChild child = children.get(i);\n \t\tSet<MapLocation> myUnitLocations = new HashSet<MapLocation>();\n \t\tchildUtils.add(i, child.state.getUtility());\n \t}\n \t\n \ttempUtils = childUtils;\n \tCollections.sort(childUtils);\n \t\n \tfor(int j = 0; j < children.size(); j++) {\n \t\t\n \t\t//Utility value to be found in unsorted array\n \t\ttempUtil = childUtils.get(j);\n \t\t\n \t\tfor(int k = 0; k < children.size(); k++) {\n \t\t\t\n \t\t\t//If the utility value is the same as this value in the unsorted array, store the index\n \t\t\tif(tempUtil == tempUtils.get(k))\n \t\t\t\ttempIndex = k;\n \t\t}\n \t\t\n \t\t//Add the child to the correct position in a temporary list\n \t\ttempChildren.add(j, children.get(tempIndex));\n \t} \t\n return tempChildren;\n }", "public void sort()\n\t{\n\t\tfor(int i=0;i<bowlers.size()-1;i++)\n\t\t{\n\t\t\tfor(int j=i+1;j<bowlers.size();j++)\n\t\t\t{\n\t\t\t\tif(bowlers.get(i).getBall()<bowlers.get(j).getBall())\n\t\t\t\t{\n\t\t\t\t\tBowler bowler=bowlers.get(i);\n\t\t\t\t\tbowlers.set(i,bowlers.get(j));\n\t\t\t\t\tbowlers.set(j,bowler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<bowlers.size();i++)\n\t\t{\n\t\tSystem.out.println(bowlers.get(i).getBall());\n\t\t}\n\t}", "public static void sortByPopular(){\n SORT_ORDER = POPULAR_PATH;\n }", "public CountryList sortByCountDesc() {\n\t\tCountryList sorted = new CountryList();\n\t\tfor (int i = 0; i < this.nextAvailable; i++)\n\t\t\tsorted.binInsertDesc(new Country(this.countries.get(i)));\n\t\tsorted.totalCount = this.totalCount;\n\t\treturn sorted;\n\t}", "public void sortHighScores(){\n for(int i=0; i<MAX_SCORES;i++){\n long score = highScores[i];\n String name= names[i];\n int j;\n for(j = i-1; j>= 0 && highScores[j] < score; j--){\n highScores[j+1] = highScores[j];\n names[j+1] = names[j];\n }\n highScores[j+1] = score;\n names[j+1] = name;\n }\n }", "public void sortHighscores(){\n Collections.sort(highscores);\n Collections.reverse(highscores);\n }", "void sort( int low, int high)\n {\n if (low > high)\n {\n /* pi is partitioning index, arr[pi] is\n now at right place */\n int pi = partition(low, high);\n\n // Recursively sort elements before\n // partition and after partition\n sort( low, pi-1);\n sort( pi+1, high);\n }\n }", "@Override\n \t\t\t\t\tpublic int compare(Entry<Fooable, Integer> o1,\n \t\t\t\t\t\t\tEntry<Fooable, Integer> o2) {\n \t\t\t\t\t\tif (o1.getValue() < o2.getValue())\n \t\t\t\t\t\t\treturn -1;\n \n \t\t\t\t\t\tif (o1.getValue() > o2.getValue())\n \t\t\t\t\t\t\treturn 1;\n \n \t\t\t\t\t\t// Fallback sorting on String comparison\n \t\t\t\t\t\treturn o1.getKey().getName()\n \t\t\t\t\t\t\t\t.compareToIgnoreCase(o2.getKey().getName());\n \t\t\t\t\t}", "public static void sort(Vector features, int sortStrand, boolean byLow) {\n int setSize = features.size();\n\n if (setSize == 0) {\n return;\n }\n\n int[] coord = new int[setSize];\n RangeI[] obj = new RangeI[setSize];\n\n for (int i=0; i < setSize; i++) {\n RangeI sf = (RangeI) features.elementAt(i);\n if (byLow) {\n coord[i] = sf.getLow();\n } else {\n coord[i] = sf.getStart();\n }\n obj [i] = sf;\n }\n\n QuickSort.sort(coord,obj);\n\n // Used to be sortStrand == 1 but it seemed wrong to sort 0 stranded features backwards\n if (sortStrand != -1) {\n for (int i=0; i < setSize;i++) {\n features.setElementAt(obj[i], i);\n }\n }\n else {\n for (int i=0; i < setSize;i++) {\n features.setElementAt(obj[i], (setSize - i - 1));\n }\n }\n }", "public static void customSort(List<Integer> array) {\n Map<Integer, Integer> map = new HashMap<>();\n List<Integer> outputArray = new ArrayList<>();\n int ii = 0;\n for (int current : array) {\n if (ii==0){\n ii++;\n continue;\n }\n int count = map.getOrDefault(current, 0);\n map.put(current, count + 1);\n outputArray.add(current);\n ii++;\n }\n\n Set<Map.Entry<Integer, Integer>> entries = map.entrySet();\n for (Map.Entry<Integer, Integer> entry : entries) {\n entry.getKey();\n }\n\n // Compare the map by value\n SortComparator comp = new SortComparator(map);\n\n // Sort the map using Collections CLass\n Collections.sort(outputArray,comp);\n\n // Final Output\n for (Integer i : outputArray) {\n System.out.print(i + \" \");\n }\n System.out.println();\n\n }", "void sortUI();", "public void sort(){\n\t\tCollections.sort(_ligacoes, (new Comparator<Ligacao>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Ligacao l1, Ligacao l2){\n\t\t\t\tint resultado = Integer.compare(l1.getCusto(), l2.getCusto());\n\t\t\t\tif (resultado == 0)\n\t\t\t\t\tresultado = Boolean.compare(l1.isAerea(), l2.isAerea());\n\t\t\t\treturn resultado;\n\t\t\t}\n\t\t}));\n\t}", "@Override\n \tpublic void sort() {\n \t\tArrays.sort(data);\n \t}", "int getPriority();", "int getPriority();", "int getPriority();", "int getPriority();", "int getPriority();", "int getPriority();", "int getPriority();", "int getPriority();", "@Override\n\t\t\tpublic int compare(Entry<String, Double> o1,\n\t\t\t\t\tEntry<String, Double> o2) {\n\t\t\t\tif(o1.getValue()>o2.getValue()){\n\t\t\t\t\treturn -1;\n\t\t\t\t}else if(o1.getValue()<o2.getValue()){\n\t\t\t\t\treturn 1;\n\t\t\t\t}else{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic int compare(List<Integer> o1, List<Integer> o2) {\n\t\t\t\tif(o1.get(0)< o2.get(0)){\n\t\t\t\t\treturn -1;\n\t\t\t\t}else if(o1.get(0) > o2.get(0)){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "private void sortCoreTypes() {\n\t\tArrays.sort(coreBuiltin, (o1, o2) -> Long.compare(o1.id, o2.id));\n\t}", "public void sortRegions(List<Mdr13Record> list) {\n \t\tSort sort = getConfig().getSort();\n \t\tList<SortKey<Mdr13Record>> keys = new ArrayList<SortKey<Mdr13Record>>();\n \t\tfor (Mdr13Record reg : list) {\n \t\t\tSortKey<Mdr13Record> key = sort.createSortKey(reg, reg.getName(), reg.getMapIndex());\n \t\t\tkeys.add(key);\n \t\t}\n \n \t\tCollections.sort(keys);\n \n \t\tString lastName = \"\";\n \t\tint record = 0;\n \t\tMdr28Record mdr28 = null;\n \t\tfor (SortKey<Mdr13Record> key : keys) {\n \t\t\trecord++;\n \t\t\tMdr13Record reg = key.getObject();\n \n \t\t\t// If this is new name, then create a mdr28 record for it. This\n \t\t\t// will be further filled in when the other sections are prepared.\n \t\t\tString name = reg.getName();\n \t\t\tif (!name.equals(lastName)) {\n \t\t\t\tmdr28 = new Mdr28Record();\n \t\t\t\tmdr28.setName(name);\n \t\t\t\tmdr28.setStrOffset(reg.getStrOffset());\n \t\t\t\tmdr28.setMdr14(reg.getMdr14());\n \t\t\t\tmdr28.setMdr23(record);\n\t\t\t\tlastName = name;\n \t\t\t}\n \n \t\t\tassert mdr28 != null;\n \t\t\treg.setMdr28(mdr28);\n \n\t\t\tregions.add(reg);\n \t\t}\n \t}", "@Override\n\t\t\tpublic int compare(Entry<Integer, Double> o1, Entry<Integer, Double> o2) {\n\t\t\t\treturn -(int) (o1.getValue().compareTo(o2.getValue()));\n\t\t\t}", "public void selectionSort(int[] x)\n {\n for (int i = 0; i < x.length-1; i++) {\n int minIndex = i;\n for (int j = i+1; j < x.length; j++) {\n if (x[minIndex] > x[j]) {\n minIndex = j;\n }\n }\n int temp = x[i];\n x[i] = x[minIndex];\n x[minIndex] = temp;\n }\n \n public void replaceFirst(int oldVal, int newVal)\n {\n \n }\n}", "public void selectionSort(){\n for(int x=0; x < arraySize; x++){\n int minimum = x;\n for(int y = x; y < arraySize; y++){\n // Change to < for descending sort\n if(theArray[minimum] > theArray[y]){\n minimum = y;\n }\n }\n swapValues(x, minimum);\n printHorizontalArray(x, -1);\n }\n }", "public void sortGlobalAccountBalances()\n\t{\n\t\tCollections.sort(globalAccountBalances, new GlobalAccountBalanceBean.GlobalAccountBalanceBeanComparator());\n\t}", "public static WordFrq[] sort(WordFrq b[]){\n WordFrq temp;\n int i=0;\n while (i < 3) {\n for (i = 1; i < 3; i++) {\n if (b[i-1].count > b[i].count) {\n temp = b[i];\n b[i] = b[i-1];\n b[i-1] = temp;\n break;\n }\n }\n }\n\n\n return b;\n\n\n\n\n\n }", "public void sortColors(int[] nums) {\n\n int min = 0;\n int max = nums.length -1;\n\n\n for(int i = 0 ; i <= max ; i++) { // i 是当前待移动下标\n if(nums[i] == 0 && i!=min){\n swap(i, min , nums);\n min++;\n i--;\n }\n if(nums[i] == 2 && i!=max){\n swap(i, max, nums);\n max--;\n i--;\n }\n }\n return;\n }", "public static void selectionSort(int[] data){\n\n\tfor(int i = 0; i < data.length; i++){\n\t int min = data[i];\n\t int indexToReplace = i;\n\n\t for(int k = i; k < data.length; k++){\n\t\tif(data[k] < min){\n\t\t indexToReplace = k;\n\t\t min = data[k];\n\t\t}\n\t }\n\n\t int old = data[i];\n\t data[i] = min;\n\t data[indexToReplace] = old;\n\t}\n }", "public static void sort (int[] data)\n {\n \t\n \tfor(int i = 0; i < data.length-1; i++)\n \t{\n \t\tint max = data[i];\n \t\tint indexOfMax = i;\n \t\t\n \t\tfor(int j = i + 1; j < data.length; j++)\n \t\t{\n \t\t\tif(data[j] > max)\n \t\t\t{\n \t\t\t\tmax = data[j];\n \t\t\t\tindexOfMax = j;\n \t\t\t}\n \t\t}\n \t\t\n \t\tdata[indexOfMax] = data[i];\n \t\tdata[i] = max;\n \t}\n \t\n // Your TA will help you write selection sort in lab. \n }", "private void ordenaLista(List<AgrupamentoTipoBean> valoresMap) {\n\t\tCollections.sort(valoresMap, new Comparator<AgrupamentoTipoBean>() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic int compare(AgrupamentoTipoBean o1, AgrupamentoTipoBean o2) {\n\t\t\t\treturn o1.getQuantidade() > o2.getQuantidade() ? -1 : +1;\n\t\t\t}\n\t\t\t\n\t\t});\n\t}", "private void sortOutlines() {\r\n Collections.sort(outlines, reversSizeComparator);\r\n }", "void sort();", "void sort();", "@Override\n\tpublic int compare(Vegetable veg1, Vegetable veg2) {\n\t\tif(veg1.getVegid() == veg2.getVegid()) {\n\t\t\treturn 0;\n\t\t}\n\t\telse if(veg1.getVegid() > veg2.getVegid()) {\n\t\t\treturn 1;\n\t\t}\n\t\telse \n\t\t\treturn -1;\n\t}", "public int compare(E a, E b) {\n // Complete this method.\n\t\treturn -1 * ((Map.Entry<String,Integer>)a).getValue().compareTo(((Map.Entry<String,Integer>)b).getValue());\n }", "public static int[] gnomeSort(int[] arr){\n int i = 1, j = 2;\n while (i < arr.length){\n if (arr[i - 1] < arr[i]){\n i = j;\n j++;\n } else {\n int tmp = arr[i - 1];\n arr[i - 1] = arr[i];\n arr[i] = tmp;\n i--;\n if (i == 0){\n i = j;\n j++;\n }\n }\n }\n return arr;\n }", "@Override\r\n public int compare(SGSystem arg0, SGSystem arg1) {\r\n if (arg0.priority < arg1.priority) {\r\n return -1;\r\n }\r\n if (arg0.priority > arg1.priority) {\r\n return 1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }", "Map<String, Double> sortByValues(Map<String, Double> map_to_sort){\n\tList<Map.Entry<String,Double>> ranklist = new LinkedList<Map.Entry<String,Double>>(map_to_sort.entrySet());\n\tCollections.sort(ranklist, new Comparator<Map.Entry<String, Double>>(){\n\t\tpublic int compare(Map.Entry<String,Double> o1, Map.Entry<String,Double> o2){\n\t\t\treturn o2.getValue().compareTo((double)o1.getValue() );\n\t\t}\n\t});\n\t\n\tMap<String, Double> sortedRank = new LinkedHashMap<String,Double>();\n\tfor(Map.Entry<String, Double> rank : ranklist){\n\t\tsortedRank.put(rank.getKey(), rank.getValue());\t\t\t\n\t}\n\t\n\treturn sortedRank;\n\t}", "@Test\n public void Scenario1() {\n\n Response resp = reqSpec.request().get();\n\n DataWrapper respBody = resp.as(DataWrapper.class);\n List<Regions> regions = respBody.getData().get(0).getRegions();\n\n Map<Integer, String> sortedIntensity = new TreeMap<>();\n\n try {\n\n ListIterator iterator = regions.listIterator();\n int iter = 0;\n\n while (iterator.hasNext()) {\n\n sortedIntensity.put(regions.get(iter).getIntensity().getForecast(),\n regions.get(iter).getShortname());\n iter++;\n iterator.next();\n }\n\n } catch (NullPointerException npe) {\n npe.printStackTrace();\n }\n\n System.out.println(\"Regions sorted by intensity forecast:\");\n System.out.println(sortedIntensity);\n }", "public int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}", "public int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}", "public ArrayList<Individual> getSortedPopulation(){\n ArrayList<Individual> sortedIndividuals = new ArrayList<Individual>();\n\n for(Individual individual: individuals){\n int indexToadd = 0;\n\n if(sortedIndividuals.isEmpty()){\n sortedIndividuals.add(individual);\n }\n else {\n for(Individual sortedIndividual : sortedIndividuals){\n if(individual.getFitness() > sortedIndividual.getFitness()){\n indexToadd = sortedIndividuals.indexOf(sortedIndividual);\n break;\n }\n }\n if(indexToadd == 0 ){\n sortedIndividuals.add(individual);\n }\n else {\n sortedIndividuals.add(indexToadd,individual);\n }\n }\n }\n return sortedIndividuals;\n }", "int[] orderBands(int orig[], int step) {\n int map[] = new int[orig.length];\n int ret[] = new int[orig.length];\n\n for (int i = 0; i < map.length; i++)\n map[i] = i;\n\n for (int i = 0; i < ret.length; i++) {\n int index = i;\n for (int j = i + 1; j < ret.length; j++) {\n if (orig[map[index]] > orig[map[j]]) {\n index = j;\n }\n }\n ret[map[index]] = i * step;\n map[index] = map[i];\n }\n return ret;\n }", "private static void selectionSort(double[] numbers) {\n for (int top = numbers.length-1; top > 0; top-- ) {\n int maxloc = 0;\n for (int i = 1; i <= top; i++) {\n if (numbers[i] > numbers[maxloc])\n maxloc = i;\n }\n double temp = numbers[top];\n numbers[top] = numbers[maxloc];\n numbers[maxloc] = temp;\n }\n }", "private void sortPopulation() {\n println(\"sortPopulation()\", 1);\n //population_size = population.size();\n for(int i = 1; i < population_size; i++) {\n \n //current is the one we're going to put in the right place\n Individual current = population[i];\n double current_fitness = current.getFitness();\n \n //Test to see if current's fitness is better than the previous one; if so, then it's out of order\n double last_fitness = population[i - 1].getFitness();\n \n //if(current_fitness < last_fitness) {\n if(population[i].isLessThan(population[i - 1])) {\n \n println(population[i].getFitness() + \" < \" + population[i - 1].getFitness(), 5);\n //Now, search from the beginning to see where it goes\n int j = 0;\n //System.out.print(\"j = \" + Integer.toString(j) + \" \");\n //while(current_fitness >= population[j].getFitness() && j < population_size - 1) {\n while(population[j].isLessThanOrEqual(population[i]) && j < population_size - 1) {\n j++;\n //System.out.print(\"j = \" + Integer.toString(j) + \" \");\n }\n //We've found the correct place\n Individual temp = new Individual();\n temp = population[i];\n for(int q = i; q > j; q--) {\n population[q] = population[q - 1];\n //System.out.print(\"q = \" + Integer.toString(q) + \" \");\n }\n population[j] = temp;\n }\n }\n }", "@Override\n public int compareTo(Building b) {\n if((b.priority == null)||(this.priority == null)) {\n return 0;\n }\n else if(this.priority.getValue() == b.priority.getValue()){\n return 0;\n }\n else if(this.priority.getValue() < b.priority.getValue()){\n return 1;\n }\n else if(this.priority.getValue() > b.priority.getValue()){\n return -1;\n }\n else{\n return 0;\n }\n }", "public static LinkedHashMap<UUID, Double> sortMap(RacePlugin plugin) {\n LinkedHashMap<UUID, Double> reverseSortedMap = new LinkedHashMap<>();\r\n\r\n//Use Comparator.reverseOrder() for reverse ordering\r\n getLocations(plugin).entrySet()\r\n .stream()\r\n .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))\r\n .forEachOrdered(x -> reverseSortedMap.put(x.getKey(), x.getValue()));\r\n return reverseSortedMap;\r\n }", "private static void selectionSort(String[] numbers) {\n for (int top = numbers.length-1; top > 0; top-- ) {\n int maxloc = 0;\n for (int i = 1; i <= top; i++) {\n if (numbers[i].compareTo(numbers[maxloc]) > 0)\n maxloc = i;\n }\n String temp = numbers[top];\n numbers[top] = numbers[maxloc];\n numbers[maxloc] = temp;\n }\n }", "public void selectionSort(int [] nums) {\n\t\tfor(int i=0;i<nums.length;i++) {\n\t\t\tint min=i;\n\t\t\tfor(int j=i+1;j<nums.length;j++) {\n\t\t\t\tif(less(nums[j],nums[i])) \n\t\t\t\t\tmin=j;\n\t\t\t}\n\t\t\tswap(nums,i,min);\n\t\t}\n\t}", "public void selectionSort(int [] nums) {\n\t\tfor(int i=0;i<nums.length;i++) {\n\t\t\tint min=i;\n\t\t\tfor(int j=i+1;j<nums.length;j++) {\n\t\t\t\tif(less(nums[j],nums[i])) \n\t\t\t\t\tmin=j;\n\t\t\t}\n\t\t\tswap(nums,i,min);\n\t\t}\n\t}", "public void selectionSort(int [] array) {\n\t\t\n\t\t//10,3,6,13,2,1\n\t\t//1,3,6,13,2,10 \n\t\t//1,2,6,13,3,10\n\t\t//1,2,3,13,6,10\n\t\t//1,2,3,6,13,10\n\t\t//1,2,3,6,10,13\n\t\t\n\t\tint minValue = 0;\n\t\tint minIndex = 0; \n\t\t\n\t\tfor(int i=0; i<array.length-1; i++) {\n\t\t\t\n\t\t\tminValue = array[i];\n\t\t\t\n\t\t\tfor(int j=i; j<array.length; j++) {\n\t\t\t\t\n\t\t\t\tif(array[j]<minValue) {\n\t\t\t\t\t\n\t\t\t\t\tminValue = array[j];\n\t\t\t\t\tminIndex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tint temp = array[i];\n\t\t\tarray[i] = array[minIndex];\n\t\t\tarray[minIndex] = temp;\n\t\t\tSystem.out.println(Arrays.toString(array));\n\t\t}\n\t}", "public static void selectionSort(int[] data){\n\n int sfIndex, lowestSF, store;\n sfIndex = 0;\n for (int i = 0; i < data.length; i++){\n lowestSF = data[i];\n for (int j = i; j < data.length; j++){\n if (data[j] < lowestSF){\n lowestSF = data[j];\n sfIndex = j;\n }\n }\n store = data[i];\n data[i] = lowestSF;\n data[sfIndex] = store;\n }\n }", "private List<OrderDistance> sortOrdersByPriorities(List<OrderDistance> orderDistances) {\n\n /*Keeps orders and their priorities.\n * TreeMap keeps data in order using keys\n */\n\n Map<Integer, List<OrderDistance>> listMap = orderDistances.stream()\n .collect(groupingBy(order -> getPriority(order.getOrder()), TreeMap::new, mapping(Function.identity(), toList())));\n\n /*\n * There are three list which consists of vip,food and other\n * Here we are flatting them into single list\n */\n return listMap.values().stream().flatMap(Collection::stream).collect(toList());\n }", "@Override\r\n\tpublic int compare(Entry<Integer, Integer> o1, Entry<Integer, Integer> o2) {\n\t\treturn o2.getValue().compareTo(o1.getValue());\r\n\t}", "public void sortByPopulation()\r\n {\r\n PrintWriter output;\r\n int max, t0;\r\n String t1;\r\n \r\n //Selection sort\r\n for(int i = 0; i<population.length;i++) //loops through\r\n {\r\n max = i; //Assume first element is max\r\n for(int x = i + 1;x<population.length;x++) //loops through the rest\r\n {\r\n if(population[x] >population[max]) //sets new max if a subsequent element is bigger\r\n { \r\n max = x;\r\n }\r\n }\r\n //change the positions\r\n t0 = population[i];\r\n population[i] = population[max];\r\n population[max] = t0;\r\n t1 = countries[i];\r\n countries[i] = countries[max];\r\n countries[max] = t1;\r\n }\r\n \r\n try\r\n {\r\n output = new PrintWriter (new FileWriter (\"sortedByPopulation.txt\")); //saves\r\n \r\n //prints to the file\r\n for (int x = 0 ; x <population.length ; x++)\r\n output.printf(\"%-1s \\t\\t\\t\\t %,d %n\", countries[x], population[x]);\r\n output.close (); //closes stream\r\n }\r\n catch (IOException e)\r\n {\r\n JOptionPane.showMessageDialog (null, \"Something went wrong with the input or output operations!\"); //error message\r\n }\r\n }" ]
[ "0.61103487", "0.5711024", "0.5657137", "0.56427836", "0.5594065", "0.5547978", "0.5502727", "0.5476381", "0.5471704", "0.54355395", "0.54141855", "0.5362128", "0.53613955", "0.5358765", "0.5335541", "0.5292505", "0.5283047", "0.52828187", "0.52663505", "0.5264478", "0.5248842", "0.52337164", "0.5213073", "0.52123165", "0.5208573", "0.5188102", "0.5178904", "0.5177236", "0.5169674", "0.5168371", "0.51678574", "0.51615435", "0.51615435", "0.51516426", "0.51494205", "0.5144137", "0.5141374", "0.5137747", "0.5131169", "0.51249933", "0.5115423", "0.5113625", "0.5113365", "0.51074487", "0.5102275", "0.5099074", "0.5096861", "0.5095053", "0.5093998", "0.50845337", "0.50797826", "0.5070242", "0.5069458", "0.50657916", "0.5061229", "0.5061229", "0.5061229", "0.5061229", "0.5061229", "0.5061229", "0.5061229", "0.5061229", "0.5060705", "0.50532305", "0.5052087", "0.50460804", "0.5043189", "0.5036667", "0.503584", "0.5026822", "0.50199574", "0.50196487", "0.50180423", "0.5017385", "0.501131", "0.5010475", "0.50094515", "0.50094515", "0.49987423", "0.49940085", "0.49927863", "0.49819872", "0.49726585", "0.49705616", "0.4966904", "0.4966904", "0.49629426", "0.4960718", "0.49597296", "0.4958395", "0.4957773", "0.49570182", "0.49562177", "0.4955337", "0.4955337", "0.49518633", "0.49510023", "0.4950989", "0.49393687", "0.49381107" ]
0.6515276
0
TODO Autogenerated method stub
@Override public void onTouchingLetterChanged(int position) { AddFriend addFriend = memberlist .get(position); String ss = addFriend.getType(); if (ss.equals("1")) {// 接受 Log.e("", addFriend.getSourceID() + " " + addFriend .getTargetID()); acceptRequest(position); } else if (ss.equals("2")) {// 已添加 } else if (ss.equals("3")) {// 等待验证 } else {// 添加 Intent intent = new Intent( NewFriendsActivity.this, AddVerificationActivity.class); intent.putExtra("addfriends", memberlist.get(position)); startActivity(intent); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.newfriends); // currentPosition = getIntent().getIntExtra("currentposition", 0); AppConfig.isRefreshRed = true; initView(); AppConfig.isRefreshRed = true; if (currentPosition == 0) { // getCustomer(); // 获的新的用户 getFriendsFromDB(); } else if (currentPosition == 1) { getFriendsFromDB(); } listView.setOnItemClickListener(this); }
{ "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
private void getCustomer() { final LoginGet loginget = new LoginGet(); loginget.setLoginGetListener(new LoginGetListener() { @Override public void getMember(ArrayList<Customer> list) { } @Override public void getCustomer(ArrayList<Customer> list) { customerList = new ArrayList<Customer>(); customerList.addAll(list); if (customerList.size() > 0) { defaultPage.setVisibility(View.GONE); ll.setVisibility(View.VISIBLE); myNewCustomersAdapter = new MyNewCustomersAdapter( NewFriendsActivity.this, customerList); listView.setAdapter(myNewCustomersAdapter); } else { tv2.setText("You haven't friends for a long time"); } } }); loginget.CustomerRequest(NewFriendsActivity.this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void run() { JSONObject ronfinfo = ConnectService .getIncidentbyHttpGet(AppConfig.URL_PUBLIC + "Friend/ToApproveList?rongCloudIDs=" + newbuilder); Log.e("url", AppConfig.URL_PUBLIC + "Friend/ToApproveList?rongCloudIDs=" + newbuilder); List<AddFriend> addinfo = formatFrinds(ronfinfo); if (addinfo.size() > 0) { setFriendsNameTel(addinfo); } handler.obtainMessage(AppConfig.LOAD_FINISH).sendToTarget(); }
{ "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
private void setFriendsNameTel(List<AddFriend> addinfo) { for (AddFriend addFriend : memberlist) { // 查找数据库 String rongid = ""; if (addFriend.getTargetID().equals(AppConfig.RongUserID)) { // source rongid = addFriend.getSourceID(); } else if (addFriend.getSourceID().equals(AppConfig.RongUserID)) { rongid = addFriend.getTargetID(); } for (AddFriend addFriend2 : addinfo) { if (rongid.equals(addFriend2.getTargetID())) { // addFriend2.getTargetID() // 指好友的rongyunid addFriend.setName(addFriend2.getName()); addFriend.setPhone(addFriend2.getPhone()); addFriend.setUrl(addFriend2.getUrl()); addFriend.setUserID(addFriend2.getUserID()); break; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) { String tel = arg0.toString(); if (currentPosition == 0) { // customer List<Customer> list = new ArrayList<Customer>(); for (Customer customer : customerList) { if (customer.getPhone().contains(tel)) { list.add(customer); } } myNewCustomersAdapter = new MyNewCustomersAdapter( NewFriendsActivity.this, list); listView.setAdapter(myNewCustomersAdapter); } else if (currentPosition == 1) { List<AddFriend> list2 = new ArrayList<AddFriend>(); for (AddFriend friends : memberlist) { if (friends.getPhone().contains(tel)) { list2.add(friends); } } myNewFriendsAdapter = new MyNewFriendsAdapter( NewFriendsActivity.this, list2); myNewFriendsAdapter .setOnHealthChangedListener(new OnHealthChangedListener() { @Override public void onTouchingLetterChanged(int position) { // TODO Auto-generated method stub AddFriend addFriend = memberlist .get(position); String ss = addFriend.getType(); if (ss.equals("1")) { Log.e("接受", addFriend.getSourceID() + " " + addFriend .getTargetID()); acceptRequest(position); } else if (ss.equals("2")) { } else if (ss.equals("3")) { } else { Intent intent = new Intent( NewFriendsActivity.this, AddVerificationActivity.class); intent.putExtra("addfriends", memberlist.get(position)); startActivity(intent); } } }); listView.setAdapter(myNewFriendsAdapter); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onTouchingLetterChanged(int position) { AddFriend addFriend = memberlist .get(position); String ss = addFriend.getType(); if (ss.equals("1")) { Log.e("接受", addFriend.getSourceID() + " " + addFriend .getTargetID()); acceptRequest(position); } else if (ss.equals("2")) { } else if (ss.equals("3")) { } else { Intent intent = new Intent( NewFriendsActivity.this, AddVerificationActivity.class); intent.putExtra("addfriends", memberlist.get(position)); startActivity(intent); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onClick(View arg0) { switch (arg0.getId()) { case R.id.layout_back: inputManager.hideSoftInputFromWindow(getCurrentFocus() .getApplicationWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); finish(); break; case R.id.txt_right_title: // customerDao.delete(); inputManager.hideSoftInputFromWindow(getCurrentFocus() .getApplicationWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); Intent intent = new Intent(NewFriendsActivity.this, AddFriendsActivity.class); startActivity(intent); break; default: break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { switch (currentPosition) { case 0: // Intent intent = new Intent(NewFriendsActivity.this, // UserDetail.class); // intent.putExtra("UserID", customerList.get(arg2).getUserID()); // startActivity(intent); break; case 1: // Intent intent2 = new Intent(NewFriendsActivity.this, // UserDetail.class); // intent2.putExtra("UserID", memberlist.get(arg2).getUserID()); // startActivity(intent2); break; default: break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Initialize min and max numbers for Math.random()
public void generete() { int minQuantFig = 1, maxQuantFig = 10, minNum = 1, maxNum = 100, minColor = 0, maxColor = (int)colors.length - 1, // Initialize figures property for random calculations randomColor = 0, randomFigure = 0, // Squere property randomSideLength = 0, // Circle property randomRadius = 0, // IsoscelesRightTriangle property randomHypotenus = 0, // Trapizoid properties randomBaseA = 0, randomBaseB = 0, randomAltitude = 0; // Generate random number to set figueres's quantaty setFigureQuantaty( generateWholoeNumInRange(minQuantFig, maxQuantFig) ); for( int i = 0; i < getFigureQuantaty(); i++ ) { // Convert double random value to int and close it in range from 1 to number of elements in array randomFigure = (int)( Math.random() * figures.length ); randomColor = generateWholoeNumInRange( minColor, maxColor ); // Get random color's index from colors array // Create new figure depending on randomFigure switch (figures[randomFigure]) { case "Circle": randomRadius = generateWholoeNumInRange( minNum, maxNum ); // Get random value of circle's radius; Circle newCircle = new Circle( colors[randomColor], randomRadius ); // Initialize Circle with random parameters newCircle.drawFigure(); break; case "Squere": randomSideLength = generateWholoeNumInRange( minNum, maxNum ); // Get random value of side length; Squere newSquere = new Squere( colors[randomColor], randomSideLength ); // Initialize Circle with random parameters newSquere.drawFigure(); break; case "Triangle": randomSideLength = generateWholoeNumInRange( minNum, maxNum ); // Get random value of side length; randomHypotenus = generateWholoeNumInRange( minNum, maxNum ); // Get random value of hypotenus; IsoscelesRightTriangle newTriangle = new IsoscelesRightTriangle( colors[randomColor], randomSideLength, randomHypotenus ); // Initialize Circle with random parameters newTriangle.drawFigure(); break; case "Trapezoid": randomBaseA = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's side A; randomBaseB = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's side B; randomAltitude = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's altitude; Trapezoid newTrapezoid = new Trapezoid( colors[randomColor], randomBaseA, randomBaseB, randomAltitude ); // Create new Trapezoid with random parameters newTrapezoid.drawFigure(); break; }; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int _getRandomFromRange(int min, int max) {\n\t \n return min + random_.nextInt(max - min + 1);\n }", "public RangeRandom(final float min, final float max) {\n this.max = max;\n this.min = min;\n this.random = new Random(System.nanoTime());\n }", "private static int random(int min, int max) {\r\n\t\tRandom rand = java.util.concurrent.ThreadLocalRandom.current();\r\n\t\treturn min + (int) (rand.nextDouble()*(max-min));\r\n\t}", "private static double randomGenerator(double min, double max) {\n return (double)java.lang.Math.random() * (max - min +1) + min;\n }", "private int randomRange(int min, int max) {\n\t\tRandom random = new Random();\n\t\treturn random.nextInt((max - min) + 1) + min;\n\t}", "protected int random(int min, int max) {\n\t\treturn this.rand.nextInt(max-min) + min;\n\t}", "private static int generateRandom(int min, int max) {\n // max - min + 1 will create a number in the range of min and max, including max. If you don´t want to include it, just delete the +1.\n // adding min to it will finally create the number in the range between min and max\n return r.nextInt(max-min+1) + min;\n }", "private static int generateRandomNumber(int min, int max) {\n return (int)Math.floor(Math.random() * (max - min + 1)) + min;\n }", "private static int getRandomNumber(int min, int max) \n { //generates a random number within a range\n return (min + rand.nextInt((max - min) + 1));\n }", "public static int createRandom(int min, int max){\n\t\tif (min == max){\n\t\t\treturn min;\n\t\t}\n\t\telse{\t\t\t\n\t\t\treturn (int)(Math.random() * (max - min) + min); \n\t\t}\n\t}", "public int randomGenerator(int min, int max) {\n int random = (int) ((Math.random()*((max-min)+1))+min);\n return random;\n }", "private int getRandomNumberInRange(int min, int max) {\r\n\r\n\t\tRandom r = new Random();\r\n\t\treturn ((r.nextInt(max - min) + 1) + min)*40;\r\n\t}", "private static int randInt(final int min, final int max) {\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n return rand.nextInt((max - min) + 1) + min;\n }", "private static int randomBetween(Random r, int min, int max) {\n return r.nextInt(max - min) + min;\n }", "public static int random(int min, int max) {\r\n\t\tint diff = max - min + 1;\r\n\t\treturn ((int) (Math.random() * diff)) + min;\r\n\t}", "public double rand (double min, double max) {\r\n\t\tdouble r = rand();\r\n\t\tr = min + (max - min) * r;\r\n\t\treturn r;\r\n\t}", "private static int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n }", "public static int getRandom(int min, int max){\n\t int x = (int)(Math.random()*((max-min)+1))+min;\n\t return x;\n\t}", "public SpriteIndexRandom(int min, int max) {\n\n this.min = min;\n this.max = max;\n }", "static int getRandint(int min, int max) {\r\n\t\tRandom r = new Random();\r\n\t\treturn r.nextInt((max - min) + 1) + min;\r\n\t}", "protected static int randBetween(int min, int max) {\n\t\tRandom rand = new Random();\n\t\treturn rand.nextInt(max - (min + 1)) + min;\n\t}", "public static double rng(double min, double max) {\r\n\r\n return (Math.random() * ((max - min) + 1)) + min;\r\n }", "private static int newSecretNumber(int min, int max)\n {\n Random rnd = new Random();\n return rnd.nextInt((max + 1 - min) + min);\n }", "private double generateRandomValue(int min, int max) {\n\t\tdouble number = (Math.random() * max * 100) / 100 + min;\n\t\treturn number;\n\t}", "public static int rand(int min, int max) {\n return RUtilities.rand(min, max);\n }", "public static int RandomNumber(int min, int max){\n Random random = new Random();\n int randomNum = random.nextInt((max - min)+1)+min;\n return randomNum;\n }", "public static int getRandomNumber(int min, int max){\r\n Random r = new Random();\r\n return r.nextInt((max - min) +1) + min;\r\n }", "private int generateWholoeNumInRange( int min, int max ) {\r\n\r\n // Evaluate random number from min to max including min and max\r\n return (int)(Math.random()*(max - min + 1) + min);\r\n\r\n }", "private int getRandomNumberInRange(int min, int max) {\n Random rand = new Random();\n return rand.nextInt((max - min) + 1) + min;\n }", "public final int random(int min, int max) {\n return Utils.random(min, max);\n }", "private static int getRandomNumberInRange(int min, int max) {\n\n if (min >= max) {\n throw new IllegalArgumentException(\"max must be greater than min\");\n }\n Random r = new Random();\n return r.nextInt((max - min) + 1) + min;\n }", "public int coordinateGenerator(int max, int min) {\n\t\tRandom r = new Random();\n\t\tint a =r.nextInt(max - min) + min;\n\t\treturn a;\n\t}", "private static int randomInt(int min, int max) {\n if (min >= max) {\n throw new IllegalArgumentException(\"max must be greater than min\");\n }\n\n Random r = new Random();\n return r.nextInt(max - min) + min;\n }", "public static int generate(int min, int max) {\n\t\n\treturn min + (int) (Math.random() * ((max - min) + 1));\n\t\n\t}", "public static int generatRandomPositiveNegitiveValue(int max , int min) {\n\t int ii = -min + (int) (Math.random() * ((max - (-min)) + 1));\n\t return ii;\n\t}", "public int randint(int max, int min)\n {\n Random rand = new Random();\n int randomNum = rand.nextInt((max - min) + 1) + min;\n return randomNum;\n }", "public static int random(int min, int max) {\n return (int) Math.floor(Math.random() * (max - min + 1) + min);\n }", "public int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n}", "public int originalgetRandomPositiveInt(int min, int max){\r\n int number = getRandomPositiveInt(); \r\n return (int)number%(max - min + 1)+min;\r\n }", "private int randomIntRange(int min, int max) {\r\n Random random = new Random();\r\n if (min < 0 || max < 0) {\r\n return (random.nextInt(Math.abs(max - min)) + Math.abs(min) + 1) * -1;\r\n }\r\n return random.nextInt(max - min) + min + 1;\r\n }", "public static double rand(double min, double max) {\n\n\t\treturn min + (max - min) * Math.random();\n\n\t}", "public int randomValueFromClosedInterval(int min, int max, MersenneTwisterFast random)\n {\n if (max - min < 0) // we had an overflow\n {\n int l = 0;\n do l = random.nextInt();\n while(l < min || l > max);\n return l;\n }\n else return min + random.nextInt(max - min + 1);\n }", "public int getRandomArbitrary(int min, int max) {\n\t\treturn (int) (Math.random() * (max - min) + min);\n\t}", "private double getRandomDouble(double min, double max)\r\n\t{\r\n\t\tdouble randNum = Math.random() * (max - min) + min;\r\n\t\treturn randNum;\r\n\t}", "public static int randNum(int min, int max) {\r\n\t\treturn ThreadLocalRandom.current().nextInt(min, max + 1);\r\n\t}", "public static int getRandomInt(int min, int max) {\n return getInstance().rand.nextInt((max - min) + 1) + min;\n }", "public void initMaxMin(){\n\t\tmax = dja.max();\n\t\tmin = dja.min();\n\t}", "float getRandomValue(float min, float max)\r\n\t{\n\t\tRandom r = new Random(/*SEED!!!*/);\r\n\t\t//get a float between 0 and 1 then multiply it by the min/max difference.\r\n\t\tfloat num = r.nextFloat();\r\n\t\tnum = num * (max-min) + min;\r\n\t\treturn num;\r\n\t}", "public int randomInt(int min, int max) {\n\t\t\t\t // NOTE: Usually this should be a field rather than a method\n\t\t\t\t // variable so that it is not re-seeded every call.\n\t\t\t\t Random rand = new Random();\n\t\t\t\t // nextInt is normally exclusive of the top value,\n\t\t\t\t // so add 1 to make it inclusive\n\t\t\t\t int randomNum = rand.nextInt((max - min) + 1) + min;\n\t\t\t\t return randomNum;\n\t\t\t\t}", "private int generateRandomNb(int min, int max) {\n Random random = new Random();\n\n return random.nextInt((max - min) + 1) + min;\n }", "public int randomInt(int min, int max) {\r\n\t\treturn (int)(Math.random()*(max-min))+min;\r\n\t}", "public static int randomNumber(){\r\n int max = 10;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static int randInt(int min, int max) {\r\n\t Random rand = new Random();\r\n\t int randomNum = rand.nextInt((max - min) + 1) + min;\r\n\t return randomNum;\r\n\t}", "public static int randInt(int min, int max) {\n int randomNum = random.nextInt((max - min) + 1) + min;\n return randomNum;\n }", "public int randInt(int min, int max) {\n\t Random rand = new Random();\n\n\t // nextInt is normally exclusive of the top value,\n\t // so add 1 to make it inclusive\n\t int randomNum = rand.nextInt((max - min) + 1) + min;\n\n\t return randomNum;\n\t }", "int randomIntInRange(int min, int max) {\n\t\tRandom rand = new Random();\n\t\treturn rand.nextInt(max + 1 - min) + min;\n\t}", "private int genRandomWaveNum(int min, int max){\n int m = genRandomInt(min, max);\n return m;\n }", "private void populateRandom(double[][] matrix, double min, double max) {\n\t\tdouble range = max - min;\n\t\tfor (int i = 0; i < matrix.length; i++) {\n\t\t\tfor (int j = 0; j < matrix[0].length; j++) {\n\t\t\t\tmatrix[i][j] = (range * Math.random()) + min;\n\t\t\t}\n\t\t}\n\t}", "public static int randomRound(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n return randNum;\r\n }", "public static int randInt(int min, int max) \n\t{\n\t Random rand = new Random();\n\n\t // nextInt is normally exclusive of the top value,\n\t // so add 1 to make it inclusive\n\t int randomNum = rand.nextInt((max - min) + 1) + min;\n\n\t return randomNum;\n\t}", "public static int randInt(int min, int max) {\n\n // Usually this can be a field rather than a method variable\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n }", "public static int randInt(int min, int max) {\n\t\t// nextInt is normally exclusive of the top value,\n\t\t// so add 1 to make it inclusive\n\t\tint randomNum = rd.nextInt((max - min) + 1) + min;\n\n\t\treturn randomNum;\n\t}", "public static int randInt(int min, int max) {\n\n // NOTE: Usually this should be a field rather than a method\n // variable so that it is not re-seeded every call.\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n }", "private void initialiseNumbers() {\r\n double choice = Math.random();\r\n sourceNumbers = new int[6];\r\n if(choice<0.8) {\r\n //one big number, 5 small.\r\n sourceNumbers[0] = (Integer) bigPool.remove(0);\r\n for( int i=1; i<6; i++) {\r\n sourceNumbers[i] = (Integer) smallPool.remove(0);\r\n }\r\n } else {\r\n //two big numbers, 5 small\r\n sourceNumbers[0] = (Integer) bigPool.remove(0);\r\n sourceNumbers[1] = (Integer) bigPool.remove(0);\r\n for( int i=2; i<6; i++) {\r\n sourceNumbers[i] = (Integer) smallPool.remove(0);\r\n }\r\n }\r\n\r\n //for target all numbers from 101 to 999 are equally likely\r\n targetNumber = 101 + (int) (899 * Math.random());\r\n }", "public static int customRandom(int range)\n {\n \tint random = (int)(Math.random()*10)%range;\n\t\n\treturn random;\n }", "public static int randInt(int min, int max) {\n\t Random rand = new Random();\n\n\t // nextInt is normally exclusive of the top value,\n\t // so add 1 to make it inclusive\n\t int randomNum = rand.nextInt((max - min) + 1) + min;\n\n\t return randomNum;\n\t}", "public static int randInt(int min, int max) {\n\t Random rand = new Random();\n\n\t // nextInt is normally exclusive of the top value,\n\t // so add 1 to make it inclusive\n\t int randomNum = rand.nextInt((max - min) + 1) + min;\n\n\t return randomNum;\n\t}", "public static int randInt(int min, int max) {\n\t Random rand = new Random();\n\n\t // nextInt is normally exclusive of the top value,\n\t // so add 1 to make it inclusive\n\t int randomNum = rand.nextInt((max - min) + 1) + min;\n\n\t return randomNum;\n\t}", "int getRandom(int max);", "public static void main(String[] args) {\n int min=100;\n int max=999;\n int random = (int) (min + Math.random() * (max - min));\n int a=random%10;\n int a1=(random/10)%10;\n int a2=(random/100)%10;\n System.out.println(\"Число = \" +random +\" наибольшее число = \" +Math.max(a, Math.max(a1,a2)));\n}", "public static int randInt(int min, int max) {\r\n\r\n\t\t\t// Usually this can be a field rather than a method variable\r\n\t\t\tRandom rand = new Random();\r\n\r\n\t\t\t// nextInt is normally exclusive of the top value,\r\n\t\t\t// so add 1 to make it inclusive\r\n\t\t\tint randomNum = rand.nextInt((max - min) + 1) + min;\r\n\r\n\t\t\treturn randomNum;\r\n\t\t}", "public static int randomNumberAlg(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static int generateIntRange(int min, int max) {\n return random.nextInt(max - min + 1) + min;\n }", "public int getRandomNumberInInterval() {\n\t\treturn getRandomNumberUsingNextInt(min, max);\n\t}", "public static int randomRangeBound(int minDigits, int maxDigits) {\r\n int digitBoundDiff = maxDigits - minDigits + 1;\r\n int i = rn.nextInt() % digitBoundDiff;\r\n if (i < 0) {\r\n i = -i;\r\n }\r\n return minDigits + i;\r\n }", "public int randomNum() {\n\t\treturn 1 + (int) (Math.random() * 3); // randomNum = minimum + (int)(Math.random() * maximum);\n\t}", "private Integer randomHemoglobina(){\n\t\t\tint Min = 9, Max = 23;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}", "public static int randInt(int min, int max) {\n Random rand = new Random();\n return rand.nextInt((max - min) + 1) + min;\n }", "public int randInt(int min, int max) {\n\t\tint randomNum = rand.nextInt((max - min) + 1) + min;\n\n\t\treturn randomNum;\n\t}", "public Randp(int max) {\n\t\t\n\t\tnumsLeft = max;\n\t\t\n\t\tfor (int i = 1; i <= max; i++) {\n\t\t\t\n\t\t\t// Adds all numbers to array list\n\t\t\tlistOfNums.add(i);\n\t\t}\n\t}", "public static int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n }", "public static int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n }", "public static void rand_generator(int[] ran,int n,int min, int max){\r\n Random r1 = new Random(); // rand function\r\n for(int i=0;i<n;i++)\r\n {\r\n ran[i] = r1.nextInt((max - min) + 1) + min; // saving the random values in the corresponding arrays\r\n }\r\n }", "public int generateRandomNumber(int min, int max) {\n\t\tif (min >= max) {\n\t\t\tthrow new IllegalArgumentException(\"max must be greater than min\");\n\t\t}\n\t\tRandom r = new Random();\n\t\treturn (r.nextInt((max - min) + 1) + min);\n\t}", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "public static int randInt(int incMin, int incMax){\n\n int rand=incMin+rng.nextInt((incMax-incMin)-1);\n return rand;\n }", "public static int randomInt(int min, int max) {\n Random rand = new Random();\n int randomNum = rand.nextInt((max - min) + 1) + min;\n return randomNum;\n }", "public static int randInt(int min, int max) {\n\t\trand = new Random();\n\n\t\t// nextInt is normally exclusive of the top value,\n\t\t// so add 1 to make it inclusive\n\t\tint randomNum = rand.nextInt((max - min) + 1) + min;\n\n\t\treturn randomNum;\n\t}", "public final static int getRandomInt(final int min, final int max, final Random random) {\n final int dif = max - min;\n final float number = random.nextFloat(); // 0 <= number < 1\n\n return min + Math.round(number * dif);\n }", "private int randomX(int minRandX, int maxRandX) {\n\t\tint randX = MinRandX + (int)(Math.random() * ((MaxRandX - MinRandX) + 1));\n\t\treturn randX;\n\t}", "static int createInjection(int min, int max){\n\t\t\tint myInjection = (int)(Math.random() * 10 * (Math.random() > 0.5 ? max : min));\t\n\t\t\treturn myInjection;\n\t\t\t}", "@Override\n public int[] next() {\n min = rand.nextInt(100);\n max = rand.nextInt(100);\n Thread.yield();\n if (min > max) max = min;\n int[] ia = {min, max};\n return ia;\n }", "public static ArrayList<String> generateNumberArray(int min, int max) {\n int[] ran = new int[]{-20, -10, 10, 20};\n ArrayList<Integer> integerArrayList;\n HashSet<Integer> set = new HashSet<>();\n\n int diff = min / 5;\n\n int target = randInt(min + diff, max - diff);\n set.add(target);\n while (set.size() != 4) {\n int badChoice = target + NumberGenerator.randInt(-diff, diff);\n set.add(badChoice);\n }\n set.remove(target);\n integerArrayList = new ArrayList<>(set);\n\n integerArrayList.add(0, target);\n\n ArrayList<String> integers = new ArrayList<>();\n for (Integer myInt : integerArrayList) {\n integers.add(String.valueOf(myInt));\n }\n\n //add a number which has the same last number as target\n while (true) {\n int insertPos = NumberGenerator.randInt(1, 4);\n int subIndex = NumberGenerator.randInt(0, 3);\n int badChoice = target + ran[subIndex];\n\n if (!set.contains(badChoice) && target!= badChoice && badChoice >= min && badChoice <= max) {\n integers.add(insertPos, String.valueOf(badChoice));\n break;\n }\n }\n return integers;\n }", "public static int generateRandomIntegerNumber(int minNumber, int maxNumber){\n\n Random rndmGnrtr = new Random();\n return rndmGnrtr.nextInt(maxNumber - minNumber + 1) + minNumber; // minNumber + for avoid 0\n }", "public static int randInt(int min, int max) {\n\t\tRandom rand = new Random();\n\n\t\t// nextInt is normally exclusive of the top value,\n\t\t// so add 1 to make it inclusive\n\t\tint randomNum = rand.nextInt((max - min) + 1) + min;\n\n\t\treturn randomNum;\n\t}", "public static int randInt(int min, int max) {\n\t\tRandom rand = new Random();\n\n\t\t// nextInt is normally exclusive of the top value,\n\t\t// so add 1 to make it inclusive\n\t\tint randomNum = rand.nextInt((max - min) + 1) + min;\n\n\t\treturn randomNum;\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tint max = 5;\r\n\t\tint min = 1;\r\n\t\tint r = random(min,max);\r\n\t\tSystem.out.println(r);\r\n\t\t\r\n\t}", "public static int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n\n return rand.nextInt((max - min) + 1) + min;\n }", "public static int randomNumber100(){\r\n int max = 100;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public int getNumber(int min, int max) {\n return (int)(Math.random()* (max-min+1)) + min;\n }", "public static int getRandomNumberInRange(int min, int max) {\n\n if (min > max) {\n throw new IllegalArgumentException(\"max must be greater than min\");\n }\n\n Random r = new Random();\n return r.nextInt((max - min) + 1) + min;\n }" ]
[ "0.7745761", "0.767581", "0.76055515", "0.75650656", "0.7560262", "0.75124884", "0.74830943", "0.74446476", "0.7332793", "0.7321365", "0.7289016", "0.72735554", "0.7270398", "0.72612536", "0.72394544", "0.72348064", "0.71991056", "0.7191414", "0.7183089", "0.71548885", "0.7151098", "0.7146018", "0.7140918", "0.7136517", "0.7121644", "0.71129036", "0.71009874", "0.7089541", "0.70853555", "0.707245", "0.705804", "0.70355314", "0.69958353", "0.69881076", "0.6984022", "0.69690406", "0.69644415", "0.6946919", "0.6936268", "0.6934763", "0.6918842", "0.69160646", "0.69094163", "0.69066966", "0.69015706", "0.6899429", "0.68848306", "0.6883104", "0.6873398", "0.68288743", "0.67990226", "0.6784756", "0.6764457", "0.6760941", "0.67546386", "0.67431164", "0.6733502", "0.6719248", "0.67159903", "0.67147154", "0.6709353", "0.6693762", "0.66895384", "0.66846615", "0.6679096", "0.6678176", "0.6678176", "0.6678176", "0.6665941", "0.66562676", "0.6649884", "0.6644475", "0.6641122", "0.65973806", "0.6596628", "0.65773106", "0.65730006", "0.65629494", "0.6554901", "0.655224", "0.6529179", "0.6529179", "0.65246534", "0.6518781", "0.6502423", "0.64996755", "0.649102", "0.64807606", "0.647855", "0.6475869", "0.64670426", "0.64648825", "0.64566", "0.64557165", "0.6447318", "0.6447318", "0.644669", "0.6443538", "0.6442045", "0.64404625", "0.6430112" ]
0.0
-1
Method for random generation of whole numbers in specifiec range
private int generateWholoeNumInRange( int min, int max ) { // Evaluate random number from min to max including min and max return (int)(Math.random()*(max - min + 1) + min); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int customRandom(int range)\n {\n \tint random = (int)(Math.random()*10)%range;\n\t\n\treturn random;\n }", "private int randomGen(int upperBound) {\n\t\tRandom r = new Random();\n\t\treturn r.nextInt(upperBound);\n\t}", "private int _getRandomFromRange(int min, int max) {\n\t \n return min + random_.nextInt(max - min + 1);\n }", "private static double randomGenerator(double min, double max) {\n return (double)java.lang.Math.random() * (max - min +1) + min;\n }", "int RandomGenerator0To29 (){\n\t\t int randomInt2 = 0;\n\t\t Random randomGenerator2 = new Random();\n\t\t for (int idx2 = 1; idx2 <= 10; ++idx2) {\n\t\t\t randomInt2 = randomGenerator2.nextInt(30);\n\t\t }\n\t\t return randomInt2;\n\t }", "int getRandom(int max);", "public static int randomRound(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n return randNum;\r\n }", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "private static int generateRandom(int min, int max) {\n // max - min + 1 will create a number in the range of min and max, including max. If you don´t want to include it, just delete the +1.\n // adding min to it will finally create the number in the range between min and max\n return r.nextInt(max-min+1) + min;\n }", "private int rand(int lower, int upper) {\n return lower + (int)(Math.random() * ((upper - lower) + 1));\n }", "public static int randomNumber100(){\r\n int max = 100;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public int getRandomNumberInInterval() {\n\t\treturn getRandomNumberUsingNextInt(min, max);\n\t}", "private int getRandomNumberInRange(int min, int max) {\r\n\r\n\t\tRandom r = new Random();\r\n\t\treturn ((r.nextInt(max - min) + 1) + min)*40;\r\n\t}", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "private static int getRandomNumber(int min, int max) \n { //generates a random number within a range\n return (min + rand.nextInt((max - min) + 1));\n }", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "private int randomNumber(int high, int low){\n \t\t Random r = new Random();\n \t\t return (r.nextInt(high-low) + low);\n \t }", "public int originalgetRandomPositiveInt(int min, int max){\r\n int number = getRandomPositiveInt(); \r\n return (int)number%(max - min + 1)+min;\r\n }", "int getRandom(int limit){\n Random rand = new Random();\n int upperBound = limit;\n return rand.nextInt(upperBound) + 1;\n }", "public static int randomNumberAlg(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static double rangedRandom(double a){\n\t\treturn -a + Calc.random(a * 2);\n\t}", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "public static String generateRandomInteger() {\n SecureRandom random = new SecureRandom();\n int aStart = 1;\n long aEnd = 999999999;\n long range = aEnd - (long) aStart + 1;\n long fraction = (long) (range * random.nextDouble());\n long randomNumber = fraction + (long) aStart;\n return String.valueOf(randomNumber);\n }", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "public static int randomNumber(){\r\n int max = 10;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static int randomNumber(int start, int end) {\n long range = (long) end - (long) start + 1;\n // compute a fraction of the range, 0 <= frac < range\n long fraction = (long) (range * RANDOM.nextDouble());\n return (int) (fraction + start);\n }", "public int randomGQ() {\n\t\treturn(getRandomInteger(10,100));\n\t}", "public int randomGenerator(int min, int max) {\n int random = (int) ((Math.random()*((max-min)+1))+min);\n return random;\n }", "private double genMultiplier() {\n return (random.nextInt(81) + 60)/100.0;\n }", "private static int generateRandomNumber(int min, int max) {\n return (int)Math.floor(Math.random() * (max - min + 1)) + min;\n }", "private int randBetween(int start, int end) {\n\t\treturn start + (int)Math.round(Math.random() * (end - start));\n\t}", "private double generateRandomValue(int min, int max) {\n\t\tdouble number = (Math.random() * max * 100) / 100 + min;\n\t\treturn number;\n\t}", "public int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n}", "public static int randomNumberRatio(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "Boolean getRandomize();", "public static int getRandom(int n){\n\t\treturn rg.nextInt(n); \n\t}", "protected int random(int min, int max) {\n\t\treturn this.rand.nextInt(max-min) + min;\n\t}", "private static int random(int min, int max) {\r\n\t\tRandom rand = java.util.concurrent.ThreadLocalRandom.current();\r\n\t\treturn min + (int) (rand.nextDouble()*(max-min));\r\n\t}", "public int getRandom(int bound) {\n return ThreadLocalRandom.current().nextInt(bound);\n }", "private int genRandomWaveNum(int min, int max){\n int m = genRandomInt(min, max);\n return m;\n }", "private int randomRange(int min, int max) {\n\t\tRandom random = new Random();\n\t\treturn random.nextInt((max - min) + 1) + min;\n\t}", "private int generateRandomNumber() {\n\t\treturn (int) Math.floor(Math.random() * Constants.RANDOM_NUMBER_GENERATOR_LIMIT);\n\t}", "private static int newSecretNumber(int min, int max)\n {\n Random rnd = new Random();\n return rnd.nextInt((max + 1 - min) + min);\n }", "@Test\n public void genRandom() {\n runAndWait(() -> genRandom(10_000, 500, 1), 32, 2000);\n runAndWait(() -> genRandom(10_000, 500, 100), 32, 2000);\n runAndWait(() -> genRandom(250_000, 4000, 50), 4, 5_000);\n }", "public static int randomNumber50(){\r\n int max = 50;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "private int getRandomNumberInRange(int min, int max) {\n Random rand = new Random();\n return rand.nextInt((max - min) + 1) + min;\n }", "private float genX(float x) {\r\n return (_rand.nextFloat() * 40) - 20;\r\n }", "private int random(int from, int to) {\n return from + (int) (Math.random() * (to - from + 1));\n }", "private static String createRandomInteger(int aStart, long aEnd,Random aRandom){\n \tif ( aStart > aEnd ) {\n\t throw new IllegalArgumentException(\"Start cannot exceed End.\");\n\t }\n\t long range = aEnd - (long)aStart + 1;\n\t long fraction = (long)(range * aRandom.nextDouble());\n\t long randomNumber = fraction + (long)aStart;\n\t return Long.toString(randomNumber);\n\t }", "public int compete() {\r\n\t\tint max = 20;\r\n\t\tint min = 10;\r\n\t\tRandom Rand = new Random();\r\n\t\tint ranNum = Rand.nextInt(max - min) + min;\r\n\t\treturn ranNum;\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tRandom rr=new Random();\r\n\t\t\r\n\t\tSystem.out.println(Math.random());//[0,1)\r\n\t\t \r\n\t\t// 第一种情况 int(强转之后最终的值一定是0)\r\n\t\t// 第二种情况 int(强转之后将小数点舍去 1-5)\r\n\t\tSystem.out.println((int)Math.random()*5);//0.99*5永远到不了5\r\n\t\tSystem.out.println((int)(Math.random()*5+1));//[1,5.)\r\n\t\t\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\t\r\n\t\tfor(int i=0;i<=20;i++){\r\n\t\t\tSystem.out.print(i%7+\"-\");\r\n\t\t\t\r\n\t\t}\r\n\t\t//1-M的随机产生\r\n\t\t//(int)(Math.random()*M+1)\r\n\t\t\r\n\t\t\r\n\t\t//产生0 1的概率不同 Math.random()<p?0:1\r\n\t\tSystem.out.println(\"----\"+rr.rand01p());\r\n\t\tSystem.out.println(\"----\"+rr.rand01());\r\n\t\tfor(int i=0;i<=11;i++){\r\n\t\t\tSystem.out.print(i%6+\"-\");\r\n\t\t \t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(rr.rand106());\r\n\t}", "private int getRandomWithExclusion(int bound, List<Integer> exclude) {\n int random = Constants.RAND.nextInt(bound - exclude.size());\n for (int ex : exclude) {\n if (random < ex) break;\n random++;\n }\n return random;\n \n }", "public static void rand_generator(int[] ran,int n,int min, int max){\r\n Random r1 = new Random(); // rand function\r\n for(int i=0;i<n;i++)\r\n {\r\n ran[i] = r1.nextInt((max - min) + 1) + min; // saving the random values in the corresponding arrays\r\n }\r\n }", "public static double randomNum(Random g)\n\t{\n\t\treturn -5+g.nextDouble()*10;\n\t}", "private int getRandomInteger(int start, int end){\n\t\tif (start > end) {\n\t\t\tthrow new IllegalArgumentException(\"Start cannot exceed End.\");\n\t\t}\n\t\tRandom random = new Random();\n\t\tlong range = (long)end - (long)start + 1;\n\t\tlong fraction = (long)(range * random.nextDouble());\n\t\tint randomNumber = (int)(fraction + start); \n\t\treturn(randomNumber);\n\t}", "public static double random() {\r\n return uniform();\r\n }", "private static int randomNumberBetween(final int start, final int end) {\n\t\treturn start + (int) Math.round(Math.random() * (end - start));\n\t}", "float getRandomValue(float min, float max)\r\n\t{\n\t\tRandom r = new Random(/*SEED!!!*/);\r\n\t\t//get a float between 0 and 1 then multiply it by the min/max difference.\r\n\t\tfloat num = r.nextFloat();\r\n\t\tnum = num * (max-min) + min;\r\n\t\treturn num;\r\n\t}", "int random(int m)\n {\n return (int) (1 + Math.random()%m);\n }", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "private int generatePiece()\n\t{\n\t\tint toReturn = 0;\n\t\tint max = 1;\n\t\tint min = -1;\n\t\t\n\t\twhile(toReturn == 0)\n\t\t{\n\t\t\ttoReturn = r.nextInt((max - min) + 1) + min;\n\t\t}\n\t\tSystem.out.println(toReturn);\n\t\treturn toReturn;\n\t}", "public void generateR(){\n\t\t\tdo{\n\t\t\t\tr = new BigInteger(80, new Random());\n\t\t\t}while(!(q.gcd(r).equals(BigInteger.ONE)&&r.compareTo(q)<0&&r.compareTo(BigInteger.ONE)>=0));\n\t}", "public void randomNumberTest() {\n //Generating streams of random numbers\n Random random = new Random();\n random.ints(5)//(long streamSize, double randomNumberOrigin, double randomNumberBound)\n .sorted()\n .forEach(System.out::println);\n /*\n -1622707470\n -452508309\n 1346762415\n 1456878623\n 1783692417\n */\n }", "public static int randomNext() { return 0; }", "private int rand(int lower, int higher) {\n\t\treturn lower + (int) ((higher - lower + 1) * Math.random());\n\t\t\n\t}", "public static int uniform(int N) {\r\n return random.nextInt(N);\r\n }", "public static double rng(double min, double max) {\r\n\r\n return (Math.random() * ((max - min) + 1)) + min;\r\n }", "private static int randomBetween(Random r, int min, int max) {\n return r.nextInt(max - min) + min;\n }", "public static int getRandomNumber(int min, int max){\r\n Random r = new Random();\r\n return r.nextInt((max - min) +1) + min;\r\n }", "private static int myRandom(int low, int high) {\n return (int) (Math.random() * (high + 1 - low) + low);\n }", "private Integer randomBilirrubina(){\n\t\t\tint Min = 0, Max = 14;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "int RandomGeneratorZeroToThree (){\n\t\t int randomInt = 0;\n\t\t Random randomGenerator = new Random();\n\t\t for (int idx = 1; idx <= 10; ++idx) {\n\t\t\t randomInt = randomGenerator.nextInt(4);\n\n\t\t }\n\t\t return randomInt;\n\t }", "public int randomNum() {\n\t\treturn 1 + (int) (Math.random() * 3); // randomNum = minimum + (int)(Math.random() * maximum);\n\t}", "private static int getRandomNumberInRange(int min, int max) {\n\n if (min >= max) {\n throw new IllegalArgumentException(\"max must be greater than min\");\n }\n Random r = new Random();\n return r.nextInt((max - min) + 1) + min;\n }", "private static int getRandomNumberOfRooms(){\r\n return r.nextInt(50)+1;\r\n }", "private static int getSecretNum(int arg1) {\n Random rand = new Random();\n return rand.nextInt(UPPERBOUND)+1; //make range 1-100\n }", "public int getRandomPositiveInt(){\r\n long gen = (a*seed+c)%m;\r\n seed = gen;\r\n return (int)gen;\r\n }", "public static int getRandom(int min, int max){\n\t int x = (int)(Math.random()*((max-min)+1))+min;\n\t return x;\n\t}", "private double getRandomDouble(double min, double max)\r\n\t{\r\n\t\tdouble randNum = Math.random() * (max - min) + min;\r\n\t\treturn randNum;\r\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public static int RandomNumber(int min, int max){\n Random random = new Random();\n int randomNum = random.nextInt((max - min)+1)+min;\n return randomNum;\n }", "private static int randInt(final int min, final int max) {\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n return rand.nextInt((max - min) + 1) + min;\n }", "private static int randInt(int lower, int upper) {\n\t\tRandom random = new Random();\n\t\treturn random.nextInt((upper - lower) + 1) + lower;\n\t}", "public static void main(String[] args) {\n// System.out.println(Math.floor(12.34));/\n// System.out.println(Math.(12.34));/\n// System.out.println(Math.ceil(12.34));/\n// System.out.println(Math.ceil(12.34));/\n int start=5;\n int end=66;\n int i=start+(int)(Math.round(Math.random()*(end-start)) );\n System.out.println(i);\n }", "private static int newNumber()\n\t{\n\t\tdouble initial = Math.random();\n\t\tdouble rangeAdjusted = initial * (10000 - 1001) + 1000;\n\t\tint rounded = (int)Math.round(rangeAdjusted);\n\t\treturn rounded;\n\t}", "private static int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n }", "public static int uniform( int N ) {\n return random.nextInt( N + 1 );\n }", "public double rand (double min, double max) {\r\n\t\tdouble r = rand();\r\n\t\tr = min + (max - min) * r;\r\n\t\treturn r;\r\n\t}", "public static int getRandomBalance(){\n return rand.nextInt(1000000);\n }", "public static int randInt(int incMin, int incMax){\n\n int rand=incMin+rng.nextInt((incMax-incMin)-1);\n return rand;\n }", "public static double random()\n {\n final int MAX_INT = 2147483647;\n int n = MAX_INT;\n \n // Just to ensure it does not return 1.0\n while(n == MAX_INT)\n \tn = abs (RAND.nextInt());\n \n return n * (1.0 / MAX_INT);\n }", "private Integer randomHemoglobina(){\n\t\t\tint Min = 9, Max = 23;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}", "protected int pathDrawLots(int bound)\n {\n Random r= new Random();\n int num = r.nextInt(bound);\n return num;\n\n\n }", "public void getRange()\n\t{\n\t\tint start = randInt(0, 9);\n\t\tint end = randInt(0, 9);\t\t\n\t\tint startNode = start<=end?start:end;\n\t\tint endNode = start>end?start:end;\n\t\tSystem.out.println(\"Start : \"+startNode+\" End : \"+endNode);\n\t}", "public int getRandomNumber(int lowerLimit, int upperLimit)\n {\n int num = random.nextInt(upperLimit);\n // repeat while the number is lower than the lower limit.\n while(num < lowerLimit){\n num = random.nextInt(upperLimit);\n }\n return num;\n }", "public static void main(String[] args) {\n\t\tRandom rn = new Random();\n\t\tint low = -100;\n\t\tint high = 100;\n\t\tGen_Random_Number(low, high);\n\n\t}" ]
[ "0.76634", "0.7289775", "0.72208136", "0.7130806", "0.69449896", "0.69097507", "0.6908095", "0.6896285", "0.68810904", "0.6875212", "0.6874418", "0.68735796", "0.68665785", "0.68331015", "0.68311673", "0.6824936", "0.68195736", "0.68127614", "0.68014354", "0.6799253", "0.6783467", "0.6772933", "0.67539465", "0.675119", "0.67453754", "0.6730536", "0.67250663", "0.6710569", "0.67097765", "0.6703836", "0.6702712", "0.67019343", "0.6692572", "0.6687225", "0.6684458", "0.66786504", "0.66667265", "0.6662534", "0.6656122", "0.66560704", "0.66544473", "0.6652263", "0.6651744", "0.6648027", "0.6646255", "0.6638494", "0.6624009", "0.6617123", "0.6613184", "0.6594892", "0.6594641", "0.6594027", "0.6586407", "0.6586401", "0.6572973", "0.6570443", "0.6555127", "0.65502304", "0.6548658", "0.65475106", "0.65387917", "0.6536308", "0.6535937", "0.65303224", "0.65240514", "0.65235037", "0.65165526", "0.65051776", "0.6504753", "0.64945537", "0.649369", "0.6484381", "0.64809173", "0.64765453", "0.64744544", "0.6470775", "0.6458217", "0.6455711", "0.6452211", "0.64475256", "0.6430701", "0.6423749", "0.6422295", "0.64222246", "0.640994", "0.6403582", "0.63963175", "0.6380117", "0.6373692", "0.6371874", "0.6370765", "0.6355084", "0.635222", "0.6351743", "0.63412136", "0.6338872", "0.6333868", "0.6311581", "0.6309148", "0.63070405" ]
0.67058337
29
String s=" My name is Sayantika Ghosh "; String reverseString=reverse(s); System.out.println(reverseString);
public static void main(String[] args) { int [] a={5,10,90}; int [] b={4,7,9,10}; List <Integer> l1=new ArrayList<>(); l1=mergeSorted(a,b); System.out.println(l1); Map <Integer,Integer> se=new HashMap<>(); se.put(4,6); se.putIfAbsent(4,7); se.put(6,9); se.put(7,8); System.out.println(se.get(4)); System.out.println(se.get(1)); System.out.println(se.containsKey(4)); System.out.println(se.containsValue(10)); se.replace(4,10); System.out.println(se.containsValue(10)); System.out.println(se.keySet()); System.out.println(se.values()); System.out.println(se.entrySet()); int [] new1={1,2,3,4,5}; int [] new2=Arrays.copyOfRange(new1,1,4); for( int i:new2){ System.out.println(i); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String reverse()\n {\n Stack<String> words = new Stack<String>() ;\n char[] r = s.toCharArray() ;\n StringBuffer sb = new StringBuffer() ; \n String[] w = s.split(\" \");\n \n for(String c : w)\n {\n words.push(c) ;\n }\n while(!words.isEmpty())\n {\n \n \tsb.append(words.pop()) ;\n \n sb.append(\" \") ;\n }\n return sb.substring(0, s.length()) .toString();\n }", "public static void main(String[] args) {\n\t\tString s = \"I am Ritesh Kumar\";\r\n \r\n\t\tString to = StringRecusiveReverse.reverseMe(s);\r\n\t\tString to1 = StringRecusiveReverse.recursiveReverseString(s);\r\n\t\tSystem.out.println(to);\r\n System.out.println(to1);\r\n /*StringTokenizer st=new StringTokenizer(s);\r\n while(st.hasMoreTokens()) {\r\n \ts1=st.nextToken(); \r\n \tSystem.out.println(s1);\r\n }*/\r\n String[] s1=s.split(\" \");\r\n \r\n for(int i=s1.length-1;i>=0;i--)\r\n \tSystem.out.println(s1[i]);\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tString s = \"hello my name is john\";\r\n\t\t//System.out.println(reverse(s,0,s.length()-1));\r\n\t\t\r\n\t\tSystem.out.println(reverseWordsAlt(s));\r\n\t}", "public static String reverse(String s)\n\t{\n\t\tStringBuilder stb = new StringBuilder(s);\n\t\treturn stb.reverse().toString();\n\t}", "public static void Rev_Str_Fn(){\r\n\t\r\n\tString x=\"ashu TATA\";\r\n\t\r\n\tStringBuilder stb=new StringBuilder();\r\n\tstb.append(x);\r\n\tstb.reverse();\r\n\tSystem.out.println(stb);\r\n}", "static void reverseString(String s){\n\tString[] words=s.split(\" \");\n\tString ReverseString=\"\";\n\tfor(int i=0;i<words.length;i++)\n\t{\n\t\tString word=words[i];\n\t\tString reverseword=\"\";\n\t\tfor(int j=word.length()-1;j>=0;j--){\n\t\t\treverseword=reverseword+word.charAt(j);\n\t\t}\n\t\t\n\t\tReverseString=ReverseString+reverseword+\"\";\n\t}\n\tSystem.out.println(s);\n\tSystem.out.println(\"ReverseString is - \" +ReverseString);\n\t\n}", "public static void main(String[] args) {\n String str = null;\n //String str = \"My Name Is Aakash\";\n //String str = \"!@@#$%^&*()+_)(*&^%$#@!@#$%^&*(_)(*&^%$%^&**&^%$#$%^&*&^%$##$%^&*&^%$\";\n //String str = \"_sakdkjashdksahkdhjksahdkjakjshdkjahsdkaskdkasdjhasjhckhagcuagskdjkasdjkaskjdhjkashdkjhakjdjkasdkaskjdajksdhjkashdjkahsjkdhjkasckjackhaduihcadlcdjcbkjsbdcjksdjkckjsdcjksdnjkcnjksdhckjsdhjkvsdjvnkjdsbvjkdsvkjdshkhsdkfheklwjfbjkwegfwegfiuwekjfbewjkhfgwejyfguiwejfbwekhfgywegfkjewbhjfgewjfgewhjfjhewgf\";\n\n System.out.println(reverseString(str));\n }", "public static String reverse(String s){\n \tif(s.length()==0)\n return s;\n else{\n \treturn reverse(s.substring(1))+s.substring(0,1);\n }\n }", "public static String reverse(String s)\n {\n return new StringBuilder(s).reverse().toString();\n }", "public static void main(String[] args) {\n String s =\" 1\";\n\n System.out.println(reverseWords(s));\n\n }", "void reverse(string str) \n{ \n for (int i=str.length()-1; i>=0; i--) \n cout << str[i]; \n}", "public static void main(String[] args) {\n\t\tString str1=\"A man, a plan, a canal: Panama\";\r\n\t\tSystem.out.println(reverseString(str1));\r\n\t}", "private static String reverse(String in){\n\t\tString reversed = \"\";\n\t\tfor(int i = in.length() - 1; i >= 0; i--){\n\t\t\treversed += in.charAt(i);\n\t\t}\n\t\treturn reversed;\n\t}", "public static void main(String[] args) {\nString str=\"Welcome To Coding Ninja\";\n\nSystem.out.println(reverse_each(str));\n\t\t\n\t}", "public String reverse(String s) {\n\t\tStringBuilder builder = new StringBuilder();\n\t\tfor (int i = s.length() - 1; i >= 0; i--) {\n\t\t\tchar charS = s.charAt(i);\n\t\t\tbuilder.append(charS);\n\t\t}\n\t\treturn builder.toString();\n\t}", "public static void main(String[] args) {\n \n String str1 = \"hello, return olleh\";\n \n System.out.println( \"ReverseString ans: \" + reverseStr(str1)); \n \n }", "public static void main(String[] args) {\n\t\t\r\n\t\tString str=\"Ali Can\";\r\n\t\t\r\n\t\tString reverse=\"\";\r\n\t\t\r\n\t\tfor(int i=str.length()-1;i>=0;i--) {\r\n\t\t\treverse=reverse+str.charAt(i);\r\n\t\t}\r\n\t\tSystem.out.println(reverse);\r\n\t}", "public static void main(String[] args) {\n StringBuffer s = new StringBuffer(\"GeeksforGeeks\");\n System.out.println(\"Original string is : \" + s );\n //print the reversed string\n System.out.print(\"Reversed string is : \" );\n //call reverse method\n reverse(s);\n\t}", "public static void main(String[] args) {\n\tScanner s = new Scanner(System.in);\n\tSystem.out.println(\"Enter String\");\n\tString input = s.nextLine();\n\tString a=reverse(input);\n\tSystem.out.print(a);\n}", "public void StringReverse(String parameter){\n String str=parameter;\n String[] arr=str.split(\"\\\\s+\");\n for(int i=0;i<arr.length;i++){\n arr[i]=arr[i].replaceAll(\"[^\\\\w]\", \"\");\n }\n reverser(arr);\n\n String output=new String();\n for(int i=0;i<arr.length;i++){\n output=output+arr[i]+\" \";\n }\n System.out.println(output);\n }", "private void reverse(StringBuffer s)\n {\n s.reverse();\n String k = s.toString();\n String tokens[] = k.split(\" \");\n for(int i=0;i<tokens.length;i++)\n {\n StringBuffer temp = new StringBuffer(tokens[i]);\n System.out.print(temp.reverse()+\" \");\n }\n //Normal method\n /*String[] words = s.split(\" \");\n int i = words.length-1;\n while(i>=0)\n {\n System.out.print(words[i]+\" \");\n i--;\n }*/\n }", "static String reverse3(String s)\n\t{\n\t\tString reverseStr = new StringBuffer(s).reverse().toString();\n\t\treturn reverseStr;\n \n\t}", "public static String reverse(String st) {\n\t\t\n\t\tif(st == null || st ==\"\") {\n\t\t\treturn st;\n\t\t}\n\t\tStringBuffer br = new StringBuffer();\n\t\tfor(int i=st.length()-1; i>=0; i--) {\n\t\t\tbr.append(st.charAt(i));\n\t\t}\n\t\treturn br.toString();\n\t}", "public static String reverseString(String s) {\n\t\tString reverse = \"\";\n\t\tint length = s.length();\n\t\t\n\t\tfor(int i=0; i<length; i++){\n\t\t\t//reverse += (s.charAt(length-1-i) + \"\");\n\t\t\treverse = reverse.concat(s.charAt(length-i-1) + \"\");\n\t\t\t\n\t\t\t\n\t\t}\n\t\treturn reverse;\n \n }", "public static void main1(String[] args) {\n String str = \"i am a student\";\n String[] arr = str.split(\" \");\n reverse(arr);\n System.out.println(Arrays.toString(arr));\n StringBuilder builder = new StringBuilder();\n for (int i = 0; i < arr.length; i++) {\n builder.append(arr[i]);\n if (i != arr.length - 1) {\n builder.append(\" \");\n }\n }\n builder.reverse();\n System.out.println(builder);\n }", "@Override\n\tpublic String reverse() {\n\t\tint len = theString.length();\n\t\tString s1 = \"\";\n\t\tfor (int i = len - 1; i >= 0; i--) {\n\t\t\ts1 = s1 + theString.charAt(i);\n\t\t}\n\t\t// System.out.println(s1);\n\n\t\treturn s1;\n\t}", "public static void main(String[] args) {\n\n String s = \"Life is beautiful\"; //give any sentence you want to reverse and run program\n\n System.out.println(reverseWordsInSentence(s)); //This line is to print result on the console\n }", "public String reverse(String input) {\n \n // if there is no string, send it back\n if (input == null) {\n return input;\n }\n // string to return\n String output = \"\";\n // go from the back of input and put its last character at the front of the new string\n for (int i = input.length() - 1; i >= 0; i--) {\n output = output + input.charAt(i);\n }\n \n return output;\n}", "public static void main(String[] args) {\n\t\tString name=\"BEGMYRAT\";\r\n\t\tString reversed=\"\";\r\n\t\t\r\n\t\tfor(int idx=name.length()-1; idx>=0; idx--) {\r\n\t\t\treversed=reversed+name.charAt(idx);\r\n\t\t}System.out.println(reversed);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n String input = \"Lukman\";\n StringBuilder input1 = new StringBuilder();\n\n // append a string into StringBuilder input1\n //input1.append(input);\n\n // reverse StringBuilder input1\n //input1 = input1.reverse();\n\n // print reversed String\n int len = input.length() - 1;\n for (int i = len; i >= 0; --i) {\n input1.append(input.charAt(i));\n }\n System.out.println(\"Reverse:\" + input1);\n }", "public static String reverse(String sentence)\n {\n // Complete this method. Use a Stack.\n ...\n\n\n\n\n\n\n }", "public static String reverse( String s ) {\n String s2 = \"\";\n for (int i = s.length() -1; i >= 0; i--) { // start at the end of the string; keep going while i>= 0; decriment i\n s2 = s2 += s.charAt(i);\n }\n return s2;\n }", "public static void main(String[] args) {\n\n String name = \"Mesud\";\n ReverseString(name);\n\n System.out.println(\"Hello World\");\n\n String name2 = \"Leyla\";\n ReverseString(name2);\n\n }", "private static String reverseString(String s) \r\n\t{\r\n\t\tif(s.length() == 1)\r\n\t\t\treturn s;\r\n\t\treturn \"\" + s.charAt(s.length() - 1) + reverseString(s.substring(0, s.length() - 1));\r\n\t}", "static void reverse(StringBuffer str)\n\t {\n\t\t Stack<Character> s = new Stack<Character>();\n\t\t int len = str.length();\n\t\t for(int i= 0; i<len ;i ++)\n\t\t {\n\t\t\t s.push(str.charAt(i));\n\t\t }\n\t\t \n\t\t //pop the string and print it\n\t\t for(int i= 0; i<len ;i ++)\n\t\t {\n\t\t\t System.out.print(s.pop());\n\t\t }\n\t }", "@Test\n public void reverseString_passString_ReturnReversedString() {\n String output = Java8Streams.reverseString(\"java interview\");\n\n assertThat(output).isEqualTo(\"weivretni avaj\");\n }", "public static void main(String[] args)\n {\n String input = \"now this was interesting\";\n\n StringBuilder input1 = new StringBuilder();\n\n // append a string into StringBuilder input1\n input1.append(input);\n\n // reverse StringBuilder input1\n input1.reverse();\n\n // print reversed String\n System.out.println(input1);\n }", "public static void main(String[] args) {\n\n StringBuilder lz = new StringBuilder(\"Led Zeppelin\");\n lz.reverse();\n System.out.println(lz);\n\n String lz2 = \"Led Zeppelin\";\n// System.out.println(lz2.reverse()); // does not compile\n\n }", "public static String reverse(String str)\n {\n // return if string is null or empty\n if (str == null || str.equals(\"\"))\n return str;\n \n // variable to store the reversed string\n String rev = \"\";\n \n // use string concatenation operator to build reversed string by\n // reading character from the end of the original string\n for (int i = str.length() - 1; i >=0 ; i--)\n rev += str.charAt(i);\n \n return rev;\n }", "public static String reverse (String s)\n {\n String reversed = \" \";\n for (int i = s.length()-1; i >=0; i--)\n {\n reversed += s.charAt(i);\n }\n return reversed;\n }", "String reverseMyInput(String input);", "public static void main(String[] args) {\n\r\n\t\tString reverse = \"hakunaMatata\";\r\n\t\tchar[] creverse = reverse.toCharArray();\r\n\r\n\t\tList<Character> list = new ArrayList();\r\n\r\n\t\tfor (char c : creverse)list.add(c);\r\n\t\tCollections.reverse(list);\r\n\t\tListIterator litr = list.listIterator();\r\n\t\twhile (litr.hasNext())\r\n\t\t\tSystem.out.println(\"Reverse of String: \" + litr.next());\r\n\t}", "String reverseTheString(String str)\n {\n \n char s[] = str.toCharArray();\n char temp [] = new char[s.length];\n \n int j = 0; \n for (int i = s.length - 1; i >=0; i--)\n {\n temp[j++] = s[i];\n }\n return new String(temp) ; \n }", "private String reverseString(String s) {\n char[] c = s.toCharArray();\n int i = 0, j = s.length() - 1;\n while (i < j) {\n if (c[i] != c[j]) {\n c[i] ^= c[j];\n c[j] ^= c[i];\n c[i] ^= c[j];\n }\n ++i;\n --j;\n }\n return new String(c);\n }", "public String reverse(String input) \n {\n \tString outputt = \"\";\n \t//Finds the length of the string input\n \tint i = input.length();\n \t\n \tif (input == \"\")\n \t{\n \t\treturn outputt;\n \t}\n \telse\n \t{\n \t\t//Goes letter by letter building the string backwards\n \t\tfor (int c = 0; c < i; c++)\n \t\t{\n \t\tString a_letter = Character.toString(input.charAt((i - c -1)));\n \t\toutputt = (outputt + a_letter);\n \t\t}\n \t\treturn outputt;\n \t\t//return new StringBuffer(input).reverse().toString();\n \t}\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tStringBuffer s1 = new StringBuffer(\"This method returns the reversed object on which it was called\");\r\n\t\tSystem.out.println(\"Original string: \" + s1);\r\n\t\ts1.reverse();\r\n\t\tSystem.out.println(\"Reversed string: \" + s1);\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\n\t\tSystem.out.println(\"Enter the String\");\n\t\tString string=s.nextLine();\n\t\tSystem.out.println(string);\n\t\tString rev=\"\";\n\t\tint length=string.length();\n\t\tfor(int i=length-1;i>=0;i--) {\n\t\t\trev=rev+string.charAt(i);\n\t\t}\n\t\tSystem.out.println(rev);\n\t}", "public String reverse(String s) {\n String ret = \"\";\n for(int i = 0; i < s.length; i+= 1) {\n ret = s.charAt(i) + ret; //this will go in reverse as the next character will appear before the previously placed ret character.\n }\n return ret;\n}", "public static void main(String[] args) {\n String str = \" \";\n String s = ReverseSentence(str);\n System.out.println(s);\n }", "public String reversestring(String inputstring){\n String originalstring = inputstring; //Originial String\n int n = originalstring.length(); //Length of the string\n String answer=\"\";\n\n for(int i=n-1;i>=0;i--){\n System.out.print(originalstring.charAt(i));\n answer += originalstring.charAt(i) + \" \";//Reversing the string\n }\n answer = answer.trim();\n return answer;\n }", "public static String reverseStr( String str ){\n //your code goes here\n if (str == null || \"\".equalsIgnoreCase(str)){\n return str;\n }\n\n String reverse = \"\";\n for (int i = 0; i < str.length(); i++){\n reverse += str.charAt(str.length()-1-i);\n }\n\n return reverse;\n }", "public static void main(String[] args)\r\n\t{\n\t\t\tString s;\r\n\t\t\tSystem.out.println(\"Enter a string\");\r\n\t\t\tScanner in=new Scanner(System.in);\r\n\t\t\ts=in.nextLine();\r\n\t\t\tStringBuffer s2=new StringBuffer(s);\r\n\t\t\tfor(int i=0;i<s.length();i++)\r\n\t\t\t{\r\n\t\t\t\ts2.setCharAt(i,s.charAt(s.length()-i-1));\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Reverse is \"+s);\r\n\t}", "public static void main (String []args){\n\t\tString reverse=\"\";\n\t\tString s=\"ABCDEF\";\n\t\tint length=s.length();\n\t\tSystem.out.println(length);\n\t\tfor (int i=length-1;i>=0;i--)\n\t\t{\n\t\t\treverse=reverse+s.charAt(i);\n\n\t\t}\n\n\n\n\t\t//String reversing with String Builder class\n\n\t\tStringBuilder str= new StringBuilder(\"ReverseNumber\");\n\t\tString\tNewoff= \"\"+str.reverse();\n\t\tSystem.out.println(Newoff);\n\n\n\n\n\t}", "@Test\n\tpublic void revStrSentances() {\n\n\t\tString s = \"i like this program very much\";\n\t\tString[] words = s.split(\" \");\n\t\tString revStr = \"\";\n\t\tfor (int i = words.length - 1; i >= 0; i--) {\n\t\t\trevStr += words[i] + \" \";\n\n\t\t}\n\n\t\tSystem.out.println(revStr);\n\n\t}", "public String reverseWords(String s) {\n\n String[] splts = s.split(\" \");\n\n StringBuilder sb = new StringBuilder();\n sb.append(new StringBuilder(splts[0]).reverse());\n \n for(int i = 1 ; i< splts.length ;i ++)\n sb.append(\" \" + new StringBuilder(splts[i]).reverse());\n \n return sb.toString();\n\n }", "void reverse();", "void reverse();", "public void reverseString(char[] s) {\n for(int i = 0; i < s.length/2; i++){\n char temp = s[i];\n s[i] = s[s.length-(i+1)];\n s[s.length-(i+1)] = temp;\n \n }\n \n \n }", "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 String input = \"DXC technologies limited\";\n\n String revr = \"\";\n for (int z = input.length() - 1; z >= 0; z--) {\n revr = revr + input.charAt(z);\n }\n System.out.println(revr);\n\n\n String splitwords[] = input.split(\" \");\n String reverseword = \"\";\n\n for (int i = 0; i < splitwords.length; i++) {\n String word = splitwords[i];\n String reversewords = \"\";\n\n for (int j = word.length() - 1; j >= 0; j--) {\n reversewords = reversewords + word.charAt(j);\n }\n reverseword = reverseword + reversewords + \" \";\n\n }\n System.out.println(\"traditional method is \" +trim(reverseword));\n\n //return reverseword;\n\n }", "static void findReverseString(String string){\n\t\tfor (int i = string.length() -1; i >= 0; i--) {\n\t\t\tSystem.out.print(string.charAt(i));\n\t\t}\n\t}", "public static String reverse(String str) {\n String retStr = \"\"; //final string\n for (int i = str.length(); i > 0; i--) { //for loop starting from the end of the string\n retStr += str.substring(i-1,i);\n }\n return retStr;\n }", "public static void main(String[] args) {\nScanner obj =new Scanner(System.in);\n\t\tSystem.out.println(\"Enter the String\");\nString value=obj.nextLine();\nreverseString1(value);\n\t}", "public static void reverseUsingCustomizedLogic(String str) {\n\t\tint strLength = str.length();\n\n\t\tStringBuilder strBuilder = new StringBuilder();\n\n\t\tfor (int i = strLength - 1; i >= 0; i--) {\n\t\t\tstrBuilder = strBuilder.append(str.charAt(i));\n\t\t}\n\t\tSystem.out.println(\"str value after reverse using customized logic : \" + strBuilder.toString());\n\t}", "public static void main(String[] args) {\n\t\tString str = \"Pooja\";\n\t\tchar str1[] = str.toCharArray();\n\t\tString reverse = \"\";\n\t\t\n\t\tfor (int i = str1.length; i>=0 ; i--) {\n\t\t\treverse = reverse + str1[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(reverse);\n\n\t}", "public static void main(String[] args) {\r\n\t\tString str = \"madam\";\r\n\t\tString rev = \"\";\r\n\t\tfor(int i = str.length()-1; i>=0; i--)\r\n\t\t{\r\n\t\t rev = rev+str.charAt(i);\t\r\n\t\t}\r\n\t\tSystem.out.println(rev);\r\n\t\tif(rev.equals(str))\r\n\t\t{\r\n\t\t\tSystem.out.println(\"its a palendrome\");\r\n\t\t}else {\r\n\t\t\tSystem.out.println(\"its not palendrome\");\r\n\t\t}\r\n\t\treverse(\"avinesh\");\r\n\t\t\r\n\r\n\t}", "public static void main(String [] args )\n {\n String org, rev=\"\";\n Scanner scanner = new Scanner(System.in);\n\n System.out.println(\"Enter a string to Reverse\");\n org=scanner.nextLine();\n //input length value\n int length=org.length();\n\n for (int i=length - 1; i >=0; i--)\n rev=rev +org.charAt(i);\n\n System.out.println(\"Reverse of the entered string is:\" +rev);\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter the String : \");\r\n\t\tString s = sc.nextLine();\r\n\t\t\r\n\t\tStack<Character> stack = new Stack<>();\r\n\t\t\r\n\t\tfor(int i=0;i<s.length();i++)\r\n\t\t{\r\n\t\t\tstack.push(s.charAt(i));\r\n\t\t}\r\n\t\tSystem.out.println(\"Reverse of string is :\");\r\n\t\t\r\n\t\twhile(!stack.empty())\r\n\t\t{\r\n\t\t\tSystem.out.print(stack.pop());\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public String reverse(String input) {\n char[] carr = input.toCharArray();\n reverse(carr, 0 ,carr[carr.length - 1]);\n return String.valueOf(carr);\n }", "public static void main(String[] args) {\n\t\tStringReverse m = new StringReverse();\n\t\t//char[] a = {'A',' ','m','a','n',',',' ','a',' ','p','l','a','n',',',' ','a',' ','c','a','n','a','l',':',' ','P','a','n','a','m','a'};\n\t\tchar[] a = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};\n\t\tSystem.out.println(m.reverseString(a));\n\t}", "public void reverseString(char[] s) {\n for(int i = 0, j = s.length - 1; i < s.length / 2; i++,j--){\n //temporary holder\n char temp = s[j];\n //swap characters\n s[j] = s[i];\n s[i] = temp;\n }\n }", "public String reverse(String input) {\n\t\t// Write your solution here.\n\t\tchar[] arr = input.toCharArray();\n\t\tint left = 0, right = input.length() - 1;\n\t\thelper(arr, left, right);\n\t\treturn new String(arr);\n\t}", "public static void main(String[] args) {\n\t\tString reverse = \"Ragha\";\r\n\t\t//String reversed = ;\r\n //System.out.println(reverseAstring(reverse.toCharArray(),0));\r\n \t//printReverseString(reverse.toCharArray(),0);\r\n \tSystem.out.println('A'^'B');\r\n \tSystem.out.println('B'^3);\r\n \tSystem.out.println(3^65);\r\n\t}", "private static void reverseWord(String word) {\n // StringBuild.reverse()\n System.out.println(new StringBuilder(word).reverse().toString());\n\n // Add char one by one iteration method\n StringBuilder reversed = new StringBuilder();\n char[] chars = word.toCharArray();\n for (int i = 0; i < chars.length; i++) {\n reversed.append(chars[chars.length - i - 1]);\n }\n System.out.println(reversed.toString());\n }", "String reverse(String first) {\n\t String reverse = \"\";\n\t for (int i = first.length()-1; i>=0; i--) {\n\t reverse = reverse+first.charAt(i);\n\t }\n\t return reverse;\n\t }", "public static void main(String[] args) {\n\t\t\n\t\tString str=\"Selenium\";\n\t\tString revStr=\"\";\n\t\t\n\t\tfor (int i=str.length()-1;i>=0;i--){\n\t\t\trevStr=revStr+str.charAt(i);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Reverse String is \"+revStr);\n\n\t}", "public static String reverse(String text) {\n String helper=\"\";\n int a=0;\n \n \n while (a < text.length()){\n helper = helper + text.charAt(text.length() - (1+a));\n a++;\n }\n return helper;\n }", "public static String reverse(String input)\n\t{\n\t\tif(input.length()==0) return input;\n\t\tStringBuilder s = new StringBuilder();\n\t\treturn s.append(input.substring(1)).append(input.charAt(0)).toString();\n\t}", "public String reverse(String input) {\n if (input == null || input.length() <= 1) {\n return input;\n }\n char[] array = input.toCharArray();\n int slow = 0;\n int fast = array.length - 1;\n while (slow < fast) {\n swap(array, slow, fast);\n slow++;\n fast--;\n }\n return new String(array);\n }", "public static void main(String[] args) {\n\t\r\n\t\r\n\tString str=\"Welcome\";\r\n\t\r\n\tchar[] arr=str.toCharArray();\r\n\tList<Character> l=new LinkedList<>();\r\n\tfor (Character c1 : arr) {\r\n\t\tl.add(c1);\r\n\t}\r\n\tCollections.reverse(l);\r\n\tListIterator<Character> i=l.listIterator();\r\n\twhile (i.hasNext()) {\r\n\t\tSystem.out.print(i.next());\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n\t\r\n}", "public static void reverse(String sentence) {\r\n\r\n if ((sentence == null) || (sentence.length() <= 1)) {\r\n System.out.println(sentence);\r\n }\r\n else {\r\n System.out.print(sentence.charAt(sentence.length() - 1));\r\n reverse(sentence.substring(0, sentence.length() - 1));\r\n }\r\n }", "protected static void reverseWordsInAString(String s) {\n\t\t\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\r\n String words[] = s.split(\" \"); // splits the input string into an array of\r\n // strings based on a split character\r\n for (String word: words) // iterates through all the entries in the string array\r\n sb.append(new StringBuilder(word).reverse().toString() + \" \"); //uses the reverse\r\n //method to reverse the entry in the array, append it to the string builder and add the\r\n // space back in\r\n System.out.println(sb.toString().trim()); // outputs the fully appended StringBuilder\r\n // .trim() removes any extra whitespace\r\n\t}", "public static String reverseWord(String str){\n StringBuilder result = new StringBuilder();\n StringTokenizer tokenizer = new StringTokenizer(str,\"\");\n\n while (tokenizer.hasMoreTokens()){\n StringBuilder sb = new StringBuilder();\n sb.append(tokenizer.nextToken());\n sb.reverse();\n\n result.append(sb);\n result.append(\" \");\n }\n return result.toString(); //converting the StringBuilder into String\n }", "public static void reverseUsingStringBuilder(String str) {\n\n\t\tStringBuilder revStrBuilder = new StringBuilder(str);\n\t\tString revStr = revStrBuilder.reverse().toString();\n\n\t\tSystem.out.println(\"str value after reverse using JAVA API: \" + revStr);\n\t}", "public static void reverser(String word) {\n String newStr = \"\";\n for (int i = word.length(); i > 0; i--) {\n newStr += word.substring(i - 1, i);\n }\n System.out.println(newStr);\n }", "public static void main(String[] args) {\n\n System.out.println(reverseWordOrder(\"Hello World\"));// ->\"World Hello\";\n System.out.println(reverseWordOrder(\"Java is fun\"));// ->\"fun is Java\"\n System.out.println(reverseWordOrder(\"Hi How Are You\")); //->\"You Are How Hi\"\n System.out.println(reverseWordOrder(\"talk is cheap. show me the code\")) ;//->\"code the me show cheap. is talk\"\n\n }", "@Test\n public void reverse_Givenastring_ReverseEachWord()\n {\n\n assertEquals(\"a kciuq nworb xof spmuj revo eht yzal god\",fp.Reversethestring(\"a quick brown fox jumps over the lazy dog\"));\n\n }", "@Test\n\tpublic void checkReverseString()\n\n\t{\n\t\tassertEquals(\"nitin si a doog yob \",test.testReverseString(\"nitin is a good boy\"));\n\t\t\n\t}", "public static void main(String[] args) {\n\n\t System.out.println(Sample.name);\n\n\t\t\n\t\t\n\t\tint num=153,rev=0, value;\n\t\t\t\twhile(num!=0)\n\t\t\t\t{\n\t\t\t\t\tvalue=num%10;\n\t\t\t\t\trev=rev*10+value;\n\t\t\t\t\tnum=num/10;\n\t\t\t\t\tSystem.out.println(\"reverse value is \"+ rev);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tString string = \"sushma\";\n\t\t\t String reverse = new StringBuffer(string).reverse().toString();\n\t\t\t System.out.println(\"\\nString before reverse: \"+string);\n\t\t\t System.out.println(\"String after reverse: \"+reverse);\n\t\t\t \n\t\t\t \n\t\t\t \n\t\t\t String name=\"siva\";\n\t\t\t int size=name.length();\n\t\t\t System.out.println(size);\n\t\t\t for(int i=size;i>0;--i)\n\t\t\t \t \n\t\t\t {\n\t\t\t \t System.out.print(name.charAt(i-1)); \n\t\t\t \t \n\n\t\t\t }\n\t\t\t \n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tSystem.out.println(reverse(\"foo\"));\n\t\tSystem.out.println(reverse(\"student\"));\n\t\t\n\t}", "public String reverseInput(String input)\n\t{\n\t\tif(input==null)\n\t\t\treturn null;\n String reverseString=\"\";\n for(int i=input.length()-1;i>=0;i--)\n {\n \treverseString+=input.charAt(i);\n }\n return reverseString;\n\t}", "public static String reverse(String str){\n String result=\"\";//\"CBA\"\n\n for (int i = str.length()-1; i>=0; i--) {\n result+=str.charAt(i);\n }\n return result;\n }", "public static void main(String[] args) {\n System.out.println(\"what do you wanna reverse?\");\n Scanner in = new Scanner(System.in);\n String str = in.nextLine();\n StringBuilder ohyeah = new StringBuilder(str);\n System.out.println(\"Here ya go:\");\n System.out.println(ohyeah.reverse().toString());\n\n//option 2 with recursion\n System.out.println(\"what do you wanna reverse?\");\n Scanner in2 = new Scanner(System.in);\n String hey = in2.nextLine();\n String reverseHey = reverse(hey);\n System.out.println(\"Here ya go: \"+ reverseHey);\n }", "public static String reverseString(String input) {\r\n\t\tString reversed = \"\";\r\n\t\tfor (int i = input.length() - 1; i >= 0; i--) {\r\n\t\t\treversed += input.charAt(i);\r\n\t\t}\r\n\t\treturn reversed;\r\n\t}", "public static void main(String[] args) {\n\t\t\n\tString given=\"Welcome to the Java class\";\n\t\n\n\t\n\t/* to reverse String\n\t * split();\n\t * step1: split-->array of string\n\t * step2: use for loop and use decrement to print values\n\t */\n\tString reversed =\"\";\t\n\tString []str=given.split(\"\\\\s\");\n\tfor (int j=str.length-1; j>=0; j--) {\n\treversed = reversed + str[j] + \" \";\n\t}\n\tSystem.out.println(reversed);\t\t\n\t\t\n\t//String []\tstr =given.split (\"\\\\s);\n\t//for (int j=str.length-1; j>=0; j--){\n\t//System.out.println(str[j]);}\n\t/////////////////////////////////////////////\n\t\n\t//Write a java program to reverse String?\t\n\t//toCharArray();charAt();\n\t\n\t\tString given1=\"today is java class\";\n\t\tchar []charArray=given1.toCharArray();\n\t\tfor (int i=charArray.length-1; i>=0; i--) {\n\t\t\tSystem.out.print(charArray[i]);\n\t\t}\n\t///////////////////////////////////////////////using charAt\tmethod\n\t\tSystem.out.println();\n\t\tString given2=\"I love java\";\n\t\t\n\t\tfor(int i=given2.length()-1; i>=0; i--) {\n\t\t\tSystem.out.print(given2.charAt(i));\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\n\t\t\n\t\t\n\t}", "@Test\n\tpublic void RevStr() {\n\n\t\tString str = \"i am the tester\";\n\t\tfor (int i = str.length() - 1; i >= 0; i--) {\n\t\t\tSystem.out.println(str.charAt(i));\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\n\t\t\n\t\tScanner s= new Scanner(System.in);\n\t\tSystem.out.println(\"Enter the String\");\n\t\tString value=s.nextLine();\n\t\t\n\t\t\n\n\t\treverse(value);\n s.close();\t\t\n\t}", "public static String reverseString2(String s) {\n\t\tint length = s.length();\n\t\tchar[] arr = s.toCharArray();\n\t\t\n\t\tfor(int i=0; i< length / 2; i++){\n\t\t\tchar temp = arr[i];\n\t\t\tarr[i] = arr[length-1-i];\n\t\t\tarr[length-1-i] = temp;\n\t\t}\n\t\t\n\t\n\t\treturn new String(arr);\n\t\t\t\n\t}", "public static void main(String[] args) {\n String s = \" \" ;\n\n Solution solution = new Solution();\n String s1 = solution.reverseWords(s);\n\n System.out.println(\"the work is: \" + s1) ;\n }", "public String reverse(String string) {\n\t\t// TODO Write an implementation for this method declaration\n\t\tString result = \"\";\n\t\tint indexCount = string.length()-1;\n\t\t\n\t\twhile(indexCount > -1) {\n//\t\t\tresult += string.charAt(indexCount);\n\t\t\tchar character = string.charAt(indexCount);\n\t\t\t//System.out.println(character);\n\t\t\tresult = result + character;\n\t\t\tindexCount--;\n\t\t}\n\t\t\n\t\t//System.out.println(result);\n\t\treturn result;\n\n\t}", "public static void main(String[] args) {\n\t\tStringBuilder sb = new StringBuilder(\"12345\");\n\t\t\n\t\t//inverte a posição dos caracteres da string de traz pra frente e imprime a mensagem\n\t\tSystem.out.println(sb.reverse());\n\t}" ]
[ "0.79712194", "0.7860108", "0.78118646", "0.7800181", "0.7795032", "0.77375", "0.7712067", "0.7694875", "0.76819533", "0.76629037", "0.76363295", "0.7634324", "0.7601114", "0.7587785", "0.7586975", "0.75741595", "0.75464326", "0.75383246", "0.7520995", "0.7513209", "0.7489329", "0.7477014", "0.746264", "0.7445793", "0.74214405", "0.74083394", "0.7378258", "0.73745286", "0.736704", "0.73657984", "0.7351813", "0.7350339", "0.73484045", "0.732905", "0.7325984", "0.7295761", "0.7292997", "0.72916114", "0.7277064", "0.72513217", "0.7248424", "0.7241345", "0.7217421", "0.7191818", "0.7175439", "0.71632963", "0.71519995", "0.71434754", "0.7143088", "0.7142204", "0.713096", "0.7120538", "0.7113428", "0.71118116", "0.7106212", "0.70966274", "0.70966274", "0.708726", "0.7070577", "0.70649844", "0.70552593", "0.7050497", "0.70262456", "0.70211613", "0.7016449", "0.7014744", "0.70061976", "0.69971", "0.6990797", "0.698705", "0.69780767", "0.69734836", "0.6972128", "0.69694495", "0.69578195", "0.6950639", "0.69491374", "0.6944387", "0.6941493", "0.69265234", "0.6915198", "0.69138706", "0.6911861", "0.6908532", "0.689648", "0.68931526", "0.6887271", "0.6882845", "0.68771404", "0.6875544", "0.687207", "0.6852221", "0.6848529", "0.68445456", "0.68428993", "0.68265325", "0.6814458", "0.6812515", "0.6799683", "0.6798987", "0.6785407" ]
0.0
-1
Test success with draw sufficient fund.
@Test public void testSuccessWithDrawSufficientFund() throws IOException, URISyntaxException { URI uri = builder.setPath("/accounts/1/withdraw/10").build(); HttpPut request = new HttpPut(uri); request.setHeader("Content-type", "application/json"); HttpResponse response = client.execute(request); int statusCode = response.getStatusLine().getStatusCode(); assertTrue(statusCode == 200); assertTrue(mapper.readValue(EntityUtils.toString(response.getEntity()), AccountDetails.class).getAccountBalance() .equals(new BigDecimal(100).setScale(4, RoundingMode.HALF_EVEN))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void withdrawTest(){\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tAccount cAcc = new CurrentAccount(cus);\n\t\tbc.withdraw(cAcc, 300);\n\t\tboolean flag = false;\n\t\tif(cAcc.getBalance() == -300.0){\n\t\t\tflag = true;\n\t\t}\n\t\tassertTrue(flag);\n\t}", "@Test\n public void holdTest() {\n\n PaymentDto paymentDto = initPayment(inAccountId, outAccountId, \"700\");\n\n final String firstPaymentId = paymentDto.getId();\n\n paymentDto = authorizePayment(firstPaymentId, 200);\n\n assertEquals(\"Payment status AUTHORIZED\", PaymentStatus.AUTHORIZED, paymentDto.getStatus());\n\n\n //init and authorize second payment, but there is 700 cents of 1000 withhold - ERROR: WITHDRAW_NO_FUNDS\n\n paymentDto = initPayment(inAccountId, outAccountId, \"700\");\n\n final String secondPaymentId = paymentDto.getId();\n\n paymentDto = authorizePayment(secondPaymentId, 200);\n\n assertEquals(\"Payment status ERROR\", PaymentStatus.ERROR, paymentDto.getStatus());\n\n assertEquals(\"Error reason WITHDRAW_NO_FUNDS\", new Integer(ErrorCode.WITHDRAW_NO_FUNDS.getCode()), paymentDto.getErrorReason());\n\n\n //confirm first payment - OK\n\n paymentDto = confirmPayment(firstPaymentId, 200);\n\n assertEquals(\"Payment status CONFIRMED\", PaymentStatus.CONFIRMED, paymentDto.getStatus());\n\n\n //confirm second payment, which was filed on authorization - still got ERROR: WITHDRAW_NO_FUNDS\n\n paymentDto = confirmPayment(secondPaymentId, 200);\n\n assertEquals(\"Payment status ERROR\", PaymentStatus.ERROR, paymentDto.getStatus());\n\n assertEquals(\"Error reason WITHDRAW_NO_FUNDS\", new Integer(ErrorCode.WITHDRAW_NO_FUNDS.getCode()), paymentDto.getErrorReason());\n\n }", "protected boolean withdraw(double amount)\n\t{\n\t\tif(amount>acc_balance)\n\t\t\treturn false;\n\t\t\n\t\t//else the deduction is done from balance and success message is passed\n\t\tacc_balance-=amount;\n\t\treturn true;\n\t}", "public abstract boolean withdraw(float amount);", "@Test\n\tpublic void testWithdraw() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);;\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(01, \"acc1\", 00000, 50.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tArrayList<Account> expected = new ArrayList<>();\n\t\texpected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Withdrawl Successful\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"fail withdrawing $50 + fee\", testResult);\n\t}", "public void succeededWithdraw(){\n\t\tstate = ATM_State.WITHDRAWALNOTIFICATION;\n\t\tgui.setDisplay(\"Withdrawal success.\");\n\t}", "private boolean tryPay() {\n return new Random().nextInt(100) + 1 <= 50;\n }", "public void retConfirm(float draw){\n System.out.println(\"La cantidad de \"+draw+\" ha sido retirada correctamente\");\n System.out.println(\"\");\n}", "@Test\r\n\tpublic void withdraw() {\n\t\tResult<String> loanWithdraw = qddPaymentService.loanWithdraw(141227113319030002L);\r\n\t\tSystem.out.println(loanWithdraw);\r\n\t}", "public int withdraw() {\n\t\tif ((acc.getBalance() - keyboard.getAmt()) > acc.getMinimumBalace()) {\r\n\t\t\tif (casher.withdraw(keyboard.getAmt()) == 1) {\r\n\t\t\t\tsetNewBalance();\r\n\t\t\t\t\r\n\t\t\t\treciept.printer(acc.getAccountNumber(), acc.getBalance(), keyboard.getAmt());\r\n\t\t\t\treturn 1;\r\n\t\t\t} else\r\n\t\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn 0;\r\n\r\n\t}", "@Test\n public void withdrawCheckingTest(){\n userC.withdraw(200.00);\n assertEquals(\"Balance is now $100.00\", userC.getCurrentBalance(), 100.00, DELTA);\n }", "protected void acceptedPaymentVerification() {\n BillingSummaryPage.tableBillingGeneralInformation.getRow(1)\n .getCell(\"Current Due\").waitFor(cell -> !cell.getValue().equals(\"Calculating...\"));\n\n assertThat(BillingSummaryPage.tableBillingGeneralInformation.getRow(1))\n .hasCellWithValue(\"Current Due\", BillingHelper.DZERO.toString())\n .hasCellWithValue(\"Total Due\", BillingHelper.DZERO.toString())\n .hasCellWithValue(\"Total Paid\", modalPremiumAmount.get().toString());\n\n assertThat(BillingSummaryPage.tableBillsAndStatements.getRow(1).getCell(\"Status\")).valueContains(PAID_IN_FULL);\n\n assertThat(BillingSummaryPage.tablePaymentsOtherTransactions)\n .with(POLICY_NUMBER, masterPolicyNumber.get())\n .with(TYPE, PAYMENT)\n .with(TableConstants.BillingPaymentsAndTransactionsGB.AMOUNT, String.format(\"(%s)\", modalPremiumAmount.get().toString()))\n .containsMatchingRow(1);\n\n }", "private static boolean hasFunds(double cost)\n {\n if (Clock.getRoundNum() < 200) { //TODO edit this out if necessary\n return rc.getTeamOre() > cost;\n } else {\n return rc.getTeamOre() > cost*2;\n }\n }", "public void payedConfirmation(){\n\t\tassert reserved: \"a seat also needs to be reserved when bought\";\n\t\tassert customerId != -1: \"this seat needs to have a valid user id\";\n\t\tpayed = true;\n\t}", "@Test\n\tpublic void depositTest(){\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tAccount cAcc = new CurrentAccount(cus);\n\t\tbc.deposit(cAcc, 500, true);\n\t\tboolean flag = false;\n\t\tif(cAcc.getBalance() == 500.0){\n\t\t\tflag = true;\n\t\t}\n\t\tassertTrue(flag);\n\t}", "public boolean withdrawal (double amount) \r\n {\r\n\r\n boolean result = false;\r\n\r\n if ( ! super.withdrawal (amount) ) \r\n {\r\n System.out.println (\"Using overdraft...\");\r\n if ( ! overdraft.withdrawal (amount-balance) )\r\n System.out.println (\"Overdraft source insufficient.\");\r\n else {\r\n balance = 0;\r\n System.out.println (\"Current Balance on account \" + account + \": \" + balance);\r\n result = true;\r\n }\r\n }\r\n System.out.println ();\r\n\r\n return result;\r\n\r\n }", "if (charge == adhocTicket.getCharge()) {\n System.out.println(\"Charge is passed\");\n }", "@Override\n\tpublic boolean withdraw(int accNo, double money) {\n\t\treturn false;\n\t}", "boolean hasCorrect();", "public void failedWithdraw(){\n\t\tstate = ATM_State.WITHDRAWALNOTIFICATION;\n\t\tgui.setDisplay(\"Invalid withdrawal amount.\");\n\t}", "public void testOneWithdrawal(){\n\t\t//Pre-conditions\n\t\tteller.setWorking(true);\n\t\tteller.setHost(host);\n\t\t\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\t\n\t\tassertEquals(\"Teller should have no pending loans, but it has \" + teller.pendingLoans.size(),0,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller should have no accountsListed, but it has \" + teller.accountsListed.size(),0,teller.accountsListed.size());\n\t\t\n\t\t//Step 0 of test - Teller has an account for this customer already \n\t\tteller.accountsListed.add(new BankAccount(withdraw,100));\n\t\t\n\t\t//Post-conditions of step 0 \n\t\tassertEquals(\"Teller should have one account listed, instead it has \" + teller.accountsListed.size(),1,teller.accountsListed.size());\n\t\tassertEquals(\"Teller's only account should have a balance of 100, instead it has \" + teller.accountsListed.get(0).getBalance(), \n\t\t\t\t100.0,teller.accountsListed.get(0).getBalance());\n\t\t\n\t\t//Step 1 of test\n\t\t//msgGoSeeTeller(Banker)\n\t\twithdraw.msgGoSeeTeller(teller);\n\t\t\n\t\t//Post-conditions of step 1 \n\t\tassertEquals(\"Teller's state should be busy, but instead it is: \" + teller.getState(),\"Busy\",teller.getState());\n\t\tassertEquals(\"Teller should have one pending transaction, but it has: \" +teller.pendingTransactions.size(),\n\t\t\t\t1,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller's transaction should be to withdraw 100 dollars, instead it is for \" + teller.pendingTransactions.get(withdraw), \n\t\t\t\t-100.0, teller.pendingTransactions.get(withdraw));\n\t\t\n\t\t//Step 2 of test\n\t\tassertTrue(\"Teller's scheduler should return true, but it doesn't.\", teller.pickAndExecuteAnAction());\n\t\t\n\t\t//Post-conditions of step 2 \n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\tassertTrue(\"Host's log should have a message stating \\\"Updated account, and added teller\\\", instead it reads: \" + host.log.getLastLoggedEvent().toString(), \n\t\t\t\thost.log.containsString(\"Updated account, and added teller\"));\n\t\tassertTrue(\"Customer's log should have a message stating \\\"Got 100.0 dollars, leaving bank.\\\", instead it reads: \" + withdraw.log.getLastLoggedEvent().toString(),\n\t\t\t\twithdraw.log.containsString(\"Got 100.0 dollars, leaving bank.\"));\n\t\tassertEquals(\"Customer's account stored in teller should be updated with the correct balance of 0.0, instead it has \" + teller.accountsListed.get(0).getBalance(), \n\t\t\t\t0.0, teller.accountsListed.get(0).getBalance());\n\t\t\n\t}", "if(true==adhocTicket.isPaid()){\n System.out.println(\"isPaid() is passed\");\n }", "boolean hasPass();", "boolean hasPass();", "@Test\n public void testWithdraw() {\n System.out.println(\"withdraw\");\n double d = 1.0;\n Account instance = new Account(\"Piper\", 10.0);\n double expResult = 9.0;\n double result = instance.withdraw(d);\n assertEquals(expResult, result, 0.0);\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"The test case is a prototype.\");\n }", "void withdraw(double amount) {\n\t\tif (isSuspended()) {\n\t\t\tSystem.out.println(\"Account is suspended.\");\n\t\t\treturn;\n\t\t}\n\t\tif (amount <= 0) {\n\t\t\tSystem.out.println(\"Amount must be more than 0.\");\n\t\t\tSystem.out.println(\"Withdrawing failed.\");\n\t\t\treturn;\n\t\t}\n\t\tif (check(amount)) {\n\t\t\tbalance -= amount;\n\t\t\tSystem.out.println(\"Withdraw \" + amount + \" successfully.\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Withdraw \" + amount + \" unsuccessfully. Do not have enough available funds.\");\n\t\t}\n\t}", "public void denyDraw(){\n System.out.println(\"No cuenta con suficiente money\");\n System.out.println(\"\");\n}", "public boolean passed(){\n if (totalMark() == -1) {\n throw new IllegalArgumentException(\"Not enough marks to evaluate student\"); \n } else if (totalMark() >= 50){\n return true;\n }else{\n return false;\n }\n }", "public boolean withdrawal (double amount)\r\n {\r\n\r\n System.out.println (\"Penalty incurred: \" + PENALTY);\r\n return super.withdrawal (amount+PENALTY);\r\n\r\n }", "@Test\n\tpublic void testChargesNonStudent() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(01, \"acc1\", 00000, 50.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (acc1.currentBalance == 949.90) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"can not withdraw transaction charge (non student)\", testResult);\n\t}", "boolean withdraw(UUID name, double amount);", "@Test\n\tpublic void testChargesStudent() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, true);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(01, \"acc1\", 00000, 50.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (acc1.currentBalance == 949.95) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"can not withdraw transaction charge (student)\", testResult);\n\t}", "@Test\r\n\tpublic void TestDrawSuit() {\n\t\ttry {\r\n\t\t\tDeck AKDeck = new Deck();\r\n\t\t\tassertEquals(eSuit.DIAMONDS, AKDeck.Draw(eSuit.DIAMONDS).geteSuit());\r\n\t\t} catch (DeckException ex) {\r\n\t\t\tSystem.out.println(\"The deck is empty. No more cards can be drawn.\");\r\n\t\t}\r\n\t}", "private void checkResults() {\n\n if (Dealer.calcTotal() == p1.calcTotal()) {\n System.out.println(\"You and the dealer Tie, Here is your money back.\");\n System.out.println(\"Total Winnings: \" + totalWinnings + \"\\n\");\n } else if (p1.calcTotal() > Dealer.calcTotal() && !bust) {\n System.out.println(\"You win!\");\n totalWinnings += betNum;\n p1.addPointCount(betNum);\n System.out.println(\"Total Winnings: \" + totalWinnings + \"\\n\");\n } else if (Dealer.calcTotal() > 31) {\n System.out.println(\"Dealer busts. You Win!\");\n totalWinnings += betNum;\n p1.addPointCount(betNum);\n System.out.println(\"Total Winnings: \" + totalWinnings + \"\\n\");\n } else if (Dealer.getTotal() > p1.calcTotal() && Dealer.getTotal() < 32) {\n System.out.println(\"Dealer Wins.\");\n System.out.println(\"Total Winnings: \" + totalWinnings + \"\\n\");\n p1.subPointCount(betNum);\n }\n }", "public boolean withdraw(long id, String password, String currency, double amount);", "@Override\n\tpublic boolean applyWorkPermit() {\n\t\tboolean isSuccess = InternationalStudent.passBySuccessRate((float) 0.6);\n\t\tif (isSuccess) {\n\t\t\tthis.hasWorkPermit = true;\n\t\t}\n\t\treturn isSuccess;\n\t}", "public void withdraw(double ammount) throws insufficientFunds{\n if(ammount > abal)\n throw new insufficientFunds();\n else{\n ammount = abal - ammount;\n UpdateDB();\n }\n }", "public void withdraw(double amount) {\n\t\tif (amount < balance) {\n\t\t\tSystem.out.println(\"Successful withdraw: $\" + amount);\n\t\t\tbalance -= amount;\n\t\t} else {\n\t\t\tSystem.out.println(\"Withdraw Failed: Insufficient balance. The amount of $\" + amount + \" is more than your balance ($\" + balance +\").\");\n\t\t}\n\t}", "Boolean checkAccountHasSufficientBalance(PrintWriter out, Account from, Double amount);", "@Test\n\tpublic void testCheckSufficientCredits_False() {\n\n\t\tint creditsRequired = 11;\n\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertFalse(\"Expected insufficient credit\", sufficientCredits);\n\t}", "@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }", "public boolean isBalanced ();", "private static void withdraw(double amount) {\n double resultWithdraw = balance - amount;\r\n if (resultWithdraw < 0 || amount > 2000) {\r\n System.out.println(\"Withdrawal cannot exceed $2000. Balance cannot be reduced below $0.\");\r\n } else {\r\n System.out.println(amount + \" has been withdrawn from your bank account.\\nCurrent balance \" + resultWithdraw + \".\");\r\n }\r\n }", "@Test \n\tpublic void test1() {\n\t\taccount.withdraw(1000);\n\t\t//Sample (Expected) Output\n\t\tassertEquals(1000, account.getAmount(),0.01);\n\t}", "private boolean DeriveStockWith_FundIsAvailable() {\n\t\tif (getFunds() > 0) {\n\t\t\tif (calculateInputStock_Items() > getFunds()) {\n\t\t\t\tSystem.err.println(\"Insufficient Funds, Cannot restock\");\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t\t// available funds can accommodate input stock requirement\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.err.println(\"Insufficient Funds\");\n\t\t}\n\t\treturn false;\n\t}", "public void withdraw(float amount) {}", "public void withdraw(float amount) {}", "private void doWithdrawal() {\n while(true){\n try{\n Account userAccount = ui.readAccount(currentUser.getAccounts());\n int amountWithdrawn = ui.readWithdrawalAmount();\n\n if(userAccount.debit(amountWithdrawn)){\n ui.displayNewBalance(userAccount);\n break;\n\n } else {\n ui.displayError(\"You do not have enough money in this account to withdraw \" + amountWithdrawn);\n }\n }catch(Exception e){\n ui.displayError(\"Please enter a valid number.\");\n }\n }\n\n }", "boolean hasTotalBet();", "boolean hasTotalBet();", "@Test\n\tpublic void testCheckSufficientCredits_OverdraftFacility() {\n\n\t\tint creditsRequired = 11;\n\n\t\tSmsMessage msg = new SmsMessage();\n\t\tSmsTask smsTask = new SmsTask();\n\t\tsmsTask.setSakaiSiteId(SmsConstants.SMS_DEV_DEFAULT_SAKAI_SITE_ID);\n\t\tsmsTask.setSmsAccountId(account.getId());\n\t\tsmsTask.setDateCreated(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setDateToSend(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setStatusCode(SmsConst_DeliveryStatus.STATUS_PENDING);\n\t\tsmsTask.setAttemptCount(2);\n\t\tsmsTask.setMessageBody(SmsConstants.SMS_DEV_DEFAULT_SMS_MESSAGE_BODY);\n\t\tsmsTask.setSenderUserName(\"senderUserName\");\n\t\tsmsTask.setMaxTimeToLive(1);\n\t\tsmsTask.getSmsMessages().add(msg);\n\t\tsmsTask.setCreditEstimate(creditsRequired);\n\t\tmsg.setSmsTask(smsTask);\n\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertFalse(\"Expected insufficient credit\", sufficientCredits);\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tsufficientCredits = smsBillingImpl.checkSufficientCredits(account\n\t\t\t\t.getId(), creditsRequired);\n\t\tAssert.assertTrue(\"Expected insufficient credit\", !sufficientCredits);\n\t}", "public double calculateExpectedDisagreement();", "@Test\n\tpublic void testWithdraw(){\n\t\t\n\t\t// Arrange\n\t\tBigDecimal amountToWithdraw = new BigDecimal(10.00);\n\t\tBigDecimal expectedBalance = new BigDecimal(110.5);\n\t\tdouble delta = 1e-3;\n\t\t// Act\n\t\tcurrentAccount.withdraw(amountToWithdraw);\n\t\tBalance actualBalance = currentAccount.checkBalance();\n\t\t\n\t\t// Assert\n\t\tassertEquals(expectedBalance.doubleValue(), actualBalance.getAmount().doubleValue(), delta);\n\t}", "@Test\r\n void enoughFunds() {\n BankAccount account = new BankAccount(100);\r\n \r\n // Assertion for no exceptions\r\n assertDoesNotThrow(() -> account.withdraw(100));\r\n }", "@Override\r\n\tpublic boolean withdraw(double amount) {\n\t\ttry {\r\n\t\t\tif (accountStatus.equals(AccountStatus.ACTIVE)) {\r\n\t\t\t\tif (balance > amount) {\r\n\t\t\t\t\tbalance = (float) (balance - amount);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new InsufficientBalanceException(\"You'er Balance is insufficient to make this transation !\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\tthrow new AccountInactiveException(\"You'er Account is not Active !\");\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void withDrawAmount() {\n\t\t\n\t\ttry {\t\n\t\t\tlog.log(Level.INFO, \"Please Enter the account number you want to withdraw: \");\n\t\t\tint withdrawAccountNumber = scan.nextInt();\n\t\t\tlong amount;\n\t\t\tlog.log(Level.INFO, \"Please Enter the amount you want to withdraw : \");\n\t\t\tamount = scan.nextLong();\n\t\t\tbankop.withDraw(withdrawAccountNumber,amount);\n\t\t\t\n\t\t}catch(AccountDetailsException | BalanceException message ) {\n\t\t\tlog.log(Level.INFO, message.getMessage());\n\t\t}\n\n\t}", "public static boolean doTestsPass() {\r\n // todo: implement more tests, please\r\n // feel free to make testing more elegant\r\n boolean testsPass = true;\r\n double result = power(2,-2);\r\n return testsPass && result==0.25;\r\n }", "@Override\r\n\tvoid withdraw(double amount) {\n\t\tsuper.withdraw(amount);\r\n\t\tif(minimumblc>500)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"you have withdraw rupees\"+ (amount));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"withdraw failed \");\r\n\t\t}\r\n\t\t\r\n\t}", "public void transConfirm(float draw){\n System.out.println(\"La cantidad de \"+draw+\" ha sido transferida correctamente\");\n System.out.println(\"\");\n}", "boolean withdraw (int value )\n {\n if (value>balance)\n {\n return false;\n }\n else {\n balance-=value;\n return true;\n }\n }", "public void checkResult(){\n\t\tif(throwNum == 0){\n\t\t\tthis.firstThrow = this.sumOfDice;\n\t\t}\n\n\t\tif((this.sumOfDice == 7 || this.sumOfDice==11) && throwNum==0){\n\t\t\tthis.game = gameStatus.WON;\n\t\t}\n\t\telse if(this.sumOfDice ==2 || this.sumOfDice== 3 ||this.sumOfDice==12){\n\t\t\tthis.game = gameStatus.LOST;\n\t\t}\n\t\telse if((this.game == gameStatus.CONTINUE && this.sumOfDice == 7)){\n\t\t\tthis.game = gameStatus.LOST;\n\t\t}\n\t\telse if((this.sumOfDice== this.firstThrow) && throwNum!=0){\n\t\t\tthis.game = gameStatus.WON;\n\t\t}\n\t\telse{\n\t\t\tthis.game = gameStatus.CONTINUE;\n\t\t}\n\t}", "public abstract boolean deposit(float amount);", "public boolean isFine();", "public void successful(int price, int balance) {\n System.out.println(\"De vragenlijst is succesvol toegevoegd aan uw vragenlijst collectie. \" +\n \"Het aankoopbedrag is afgeschreven van uw saldo. Uw aankoopbedrag was: \"\n + price + \". Uw saldo is verlaagd van \" + (balance + price) + \" naar \" + balance);\n }", "public abstract void withdraw(float amount);", "@Override\n public boolean isCompleted() {\n return dalek.getZeitonCount() == NUM_CRYSTALS;\n }", "void withdraw(double amount){\r\n\t\t//subtract to the current balance the amount\r\n\t\tsetBalance(getBalance() - amount);\r\n\t\t\r\n\t\t//alert the user that his bank account is in the red if the balance lower than 0\r\n\t\tif(getBalance()<0){\r\n\t\t\tSystem.out.println(\"Your bank account is in the red.\");\r\n\t\t}\r\n\t}", "private boolean setIsSuccessful() {\n\t\tisSuccessful = false;\n\t\tRandom rand = new Random();\n\t\tint val = rand.nextInt(50);\n\t\tif (val % 2 == 0) {\n\t\t\tisSuccessful = true;\n\t\t}\n\t\treturn isSuccessful;\n\t}", "@Test\n\tpublic void testCheckSufficientCredits_Enddated() {\n\n\t\tint creditsRequired = 11;\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTime(new Date());\n\t\tcal.add(Calendar.HOUR, -2);\n\t\taccount.setEnddate(cal.getTime());\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertFalse(\"Expected insufficient credit\", sufficientCredits);\n\t\taccount.setEnddate(null); // restore\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t}", "public void withdraw(double dollarAmount) throws InsufficientFundsException {\r\n\t\tif (this.accountBalance - dollarAmount < 0 || this.accountBalance - dollarAmount - 1.50 < 0) {\r\n\t\t\tthrow new InsufficientFundsException();\r\n\t\t} else {\r\n\t\t\ttransactionTracker++;\r\n\t\t\tSystem.out.println(transactionTracker);\r\n\t\t\tif (transactionTracker > 4) {\r\n\t\t\t\tthis.accountBalance = this.accountBalance - dollarAmount - 1.50;\r\n\t\t\t} else {\r\n\t\t\t\tthis.accountBalance = this.accountBalance - dollarAmount;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private boolean decideIfEventShouldBeReportedAsAFailure() {\n \tint value = new Random().nextInt(100);\n \tif (value < TARGET_SUCCESS_RATE) {\n \t\treturn false;\n \t} else {\n \treturn true;\n \t}\n }", "boolean getCorrect();", "@Test\n public void testFailureWithDrawInSufficientFund() throws IOException, URISyntaxException {\n URI uri = builder.setPath(\"/accounts/2/withdraw/1000\").build();\n\n HttpPut request = new HttpPut(uri);\n request.setHeader(\"Content-type\", \"application/json\");\n HttpResponse response = client.execute(request);\n int statusCode = response.getStatusLine().getStatusCode();\n assertTrue(statusCode == 500);\n }", "public int isDrawn()\r\n {\r\n if(drawn == false)\r\n {\r\n return 0;\r\n }\r\n else if(drawn == true)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return 2;\r\n }\r\n }", "boolean hasLedger();", "boolean isTestEligible();", "private boolean canChooseDrawCardPenalty(Player nextPlayer) {\n boolean can = false;\n for (Card temp : nextPlayer.getCards()) {\n if (temp instanceof Draw2Card) {\n can = true;\n break;\n }\n }\n if (!can) {\n System.out.println(\"The next player was fined.\");\n }\n return can;\n }", "public abstract boolean isBalanced();", "@Override\n public void withdraw(double amount) {\n try {\n if (amount > 1000) {\n throw new InvalidFundingAmountException(amount);\n }\n if (this.getBalance() < 5000) {\n throw new InsufficientFundsException(amount);\n }\n doWithdrawing(amount);\n } catch (BankException e) {\n System.out.println(e.getMessage());\n }\n }", "@Test\n public void should_ReturnTrue_When_DietRecommended(){\n double weight = 100.0;\n double height = 1.70;\n //when\n boolean recommended = BMICalculator.isDietRecommended(weight,height);\n //then\n assertTrue(recommended);\n }", "@Test\n public void testImpossible1TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0000\");\n AccountOfUser acc2 = new AccountOfUser(0, \"0000 0000 0000 0001\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n bank.addAccountToUser(user.getPassport(), acc2);\n assertThat(bank.transferMoney(user.getPassport(), acc.getRequisites(), user.getPassport(), acc2.getRequisites(), 100), is(false));\n }", "protected static Boolean withdrawCanBeMade(\n Account account,\n Integer amount,\n Transaction.TransactionType type\n ) {\n return doWithdrawCheck(account, null, null, amount, type);\n }", "public boolean successfulHit(CreatureAttack attack, Creature attacked){\r\n return attack.attacker.attributes.health.accuracy.next() >= attacked.attributes.health.evasion.next();\r\n }", "public void testGolden() throws Throwable {\n verifyGolden(this, getData());\n }", "private boolean verifyAmountPayable(String adjustmentOption, HashMap<String, String> testData,\n\t\t\tExtentTest extentedReport, boolean screenshot) {\n\t\tboolean isOk = false;\n\t\t\n\t\tint totalInstallments = adjustmentOption.contains(\"spread\") ? 12\n\t\t\t\t: (adjustmentOption.contains(\"single\") ? 13 : 12);\n\t\t//List<WebElement> lstDueDates = driver.findElements(By.cssSelector(cssPaySchedDueDates));\n\t\tList<WebElement> lstCalculatedPremium = driver.findElements(By.cssSelector(cssPaySchedCalculatedPremium));\n\t\tList<WebElement> lstTaxes = driver.findElements(By.cssSelector(cssPaySchedTaxes));\n\t\tList<WebElement> lstCharges = driver.findElements(By.cssSelector(cssPaySchedCharges));\n\t\tList<WebElement> lstChargesTax = driver.findElements(By.cssSelector(cssPaySchedChargesTax));\n\t\tList<WebElement> lstInstallments = driver.findElements(By.cssSelector(cssPaySchedInstallments));\n\t\tList<WebElement> lstAmountPayable = driver.findElements(By.cssSelector(cssPaySchedAmountPayable));\n\t\tfloat expectedTotalAmountPayable = 0;\n\t\tString actualTotalAmountPayable = divTotalAmountPayable.getText().trim();\n\t\tString totalPayment = (adjustmentOption.contains(\"spread\") || adjustmentOption.contains(\"single\"))\n\t\t\t\t? spnNewPremiumAcceptanceTab.getText().trim() : spnTotalPaymentAcceptanceTab.getText().trim();\n\t\t\n\t\tboolean isOkRowCount = lstAmountPayable.size() == totalInstallments;\n\t\tLog.message(\"Row count: [\" + lstCalculatedPremium.size() + \"]; totalInstallments: [\" + totalInstallments\n\t\t\t\t+ \"]; isOkRowCount: [\" + isOkRowCount + \"]\", extentedReport);\n\t\tboolean isOkRowData = false;\n\t\tboolean isOkTotalAmountPayable = false;\n\t\t\n\t\tfor (int i = 0; i < totalInstallments; i++) {\n\t\t\tfloat rowCalculatedPremium = Float.parseFloat(lstCalculatedPremium.get(i).getText().trim());\n\t\t\tfloat rowTaxes = Float.parseFloat(lstTaxes.get(i).getText().trim());\n\t\t\tfloat rowCharges = Float.parseFloat(lstCharges.get(i).getText().trim());\n\t\t\tfloat rowChargesTax = Float.parseFloat(lstChargesTax.get(i).getText().trim());\n\t\t\tfloat rowInstallments = Float.parseFloat(lstInstallments.get(i).getText().trim());\n\t\t\tString rowAmountPayable = lstAmountPayable.get(i).getText().trim();\n\t\t\tString rowTotal = String.format(\"%.2f\", (rowCalculatedPremium + rowTaxes + rowCharges + rowChargesTax + rowInstallments));\n\t\t\texpectedTotalAmountPayable += Float.parseFloat(rowAmountPayable);\n\t\t\tboolean isOkCurrentRow = rowAmountPayable.equals(rowTotal);\n\t\t\tLog.message(\"Row #\" + (i + 1) + \": rowAmountPayable: [\" + rowAmountPayable + \"]; rowTotal: [\" + rowTotal\n\t\t\t\t\t+ \"]; isOkCurrentRow: [\" + isOkCurrentRow + \"]\", extentedReport);\n\t\t\tif (i > 0 && !isOkRowData) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tisOkRowData = isOkCurrentRow;\n\t\t\t}\n\t\t}\n\t\t\n\t\tisOkTotalAmountPayable = actualTotalAmountPayable.equals(String.format(\"%.2f\", expectedTotalAmountPayable))\n\t\t\t\t&& actualTotalAmountPayable.equals(totalPayment);\n\t\tLog.message(\n\t\t\t\t\"actualTotalAmountPayable: [\" + actualTotalAmountPayable + \"]; expectedTotalAmountPayable: [\"\n\t\t\t\t\t\t+ String.format(\"%.2f\", expectedTotalAmountPayable) + \"]; totalPayment: [\" + totalPayment + \"]\",\n\t\t\t\textentedReport);\n\t\t\n\t\tisOk = isOkRowCount && isOkRowData && isOkTotalAmountPayable;\n\t\tLog.message(\"isOkRowCount: [\" + isOkRowCount + \"]; isOkRowData: [\" + isOkRowData\n\t\t\t\t+ \"]; isOkTotalAmountPayable: [\" + isOkTotalAmountPayable + \"]\", extentedReport);\n\t\t\t\t\n\t\t\n\t\treturn isOk;\n\t}", "@Test \nvoid testFillPrescripNoRefills() {\n\tprescrip.setRefills(0);\n\t testPharm.receivePrescription(prescrip);\n\tBoolean success = testPharm.fillPrescription(prescrip.getId()); //doesn't exist\n assertFalse(success);\n}", "public boolean withdraw(double amount)\t{\n\t\tbalance = balance - amount;\n\t\tnumWithdraws++;\n\t\treturn true;\n\t}", "private void drawCard1(){\n Shoe s = new Shoe(1);\n\n boolean[][] gotPicked=new boolean[4][13];\n\n for(int i=0; i<Deck.getNumCardsInDeck(); i++){\n Card c=s.drawCard();\n int st=c.getSuit();\n int rnk=c.getRank();\n gotPicked[st][rnk]=true;\n }\n\n for(int i=0; i<gotPicked.length;i++){\n for(int j=0;j<gotPicked[0].length;j++){\n Assert.assertTrue(gotPicked[i][j]);\n }\n }\n }", "public boolean validateFair(double fair) {\n\t\tif(this.passenger.getBalance() < fair) {\n\t\t\tthis.cancelledRides.add(passenger.getName());\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}", "public int checkEND(int amount, boolean burnStun);", "@Test\n public void depositCheckingTest(){\n userC.deposit(200.00);\n assertEquals(\"Balance is now $500.00\", userC.getCurrentBalance(), 500.00, DELTA);\n }", "public void withdraw(double amount)\n {\n if (amount <= balance) {\n balance = balance - amount;\n }\n else {\n System.err.println(\"Transaction Declined\");\n remainder = balance - amount;\n System.out.println(\"Your balance would have been \" + remainder);\n }\n }", "boolean isWinningCombination(Ticket ticket);", "public void withdrawFromChecking(double amount) {\r\n\t\tif(amount > this.getSavingsBalance()) {\r\n\t\t\tSystem.out.println(\"Unsufficient funds\");\r\n\t\t} else {\r\n\t\t\tthis.checkingBalance -= amount;\r\n\t\t\ttotalAmount -= amount;\r\n\t\t}\r\n\t}", "public void showReportAbuseSuccess() {\n try {\n AlertDialog.Builder builder = new AlertDialog.Builder(this.mContext);\n builder.setTitle(this.mContext.getResources().getString(R.string.consult_report_abuse_thanks));\n builder.setMessage(this.mContext.getResources().getString(R.string.consult_comment_report_abuse_success));\n builder.setPositiveButton(this.mContext.getResources().getString(R.string.alert_dialog_confirmation_ok_button_text), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialogInterface, int i) {\n dialogInterface.dismiss();\n }\n });\n builder.show();\n } catch (Exception unused) {\n Trace.w(TAG, \"Failed to show disclaimer for consult photo editing\");\n }\n }", "@Test\n\tpublic void testCheckSufficientCredits_True() {\n\n\t\tint creditsRequired = 1;\n\t\taccount.setCredits(10l);\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tSmsMessage msg = new SmsMessage();\n\t\tSmsTask smsTask = new SmsTask();\n\t\tsmsTask.setSakaiSiteId(SmsConstants.SMS_DEV_DEFAULT_SAKAI_SITE_ID);\n\t\tsmsTask.setSmsAccountId(account.getId());\n\t\tsmsTask.setDateCreated(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setDateToSend(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setStatusCode(SmsConst_DeliveryStatus.STATUS_PENDING);\n\t\tsmsTask.setAttemptCount(2);\n\t\tsmsTask.setMessageBody(SmsConstants.SMS_DEV_DEFAULT_SMS_MESSAGE_BODY);\n\t\tsmsTask.setSenderUserName(\"senderUserName\");\n\t\tsmsTask.setMaxTimeToLive(1);\n\t\tsmsTask.getSmsMessages().add(msg);\n\t\tsmsTask.setCreditEstimate(creditsRequired);\n\t\tmsg.setSmsTask(smsTask);\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertTrue(\"Expected sufficient credit\", sufficientCredits);\n\n\t\taccount.setCredits(0l);\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tboolean insufficientCredits = !smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertTrue(\"Expected insufficient credit\", insufficientCredits);\n\n\t}", "public void withdraw(double amount) throws InsufficientFundsException {\n if (amount <= balance) {\n balance -= amount;\n \n try {\n \n Class.forName(\"net.ucanaccess.jdbc.UcanaccessDriver\");\n \n // Load Driver\n String connURL=\"jdbc:ucanaccess://c:/Users/Ellen/Documents/CIST2373/ChattBankMDB.mdb\";\n \n // Get Connection\n Connection con = DriverManager.getConnection(connURL);\n \n // Create Statement\n Statement stmt = con.createStatement();\n \n // Create sql string \n String sql = \"Update Accounts set Balance = \"+getBalance()+ \n \" where AcctNo= '\"+getAcctNo()+\"'\";\n \n // Check for properly formed sql\n System.out.println(sql);\n \n // Execute Statement\n int n = stmt.executeUpdate(sql);\n if (n == 1)\n System.out.println(\"Update was successful!\");\n else\n System.out.println(\"Update failed!\"); \n \n // Close Connection\n con.close(); \n } //end try\n \n catch (Exception err) {\n System.out.println(\"Error: \" + err);\n } //end catch\n } //end if\n else {\n throw new InsufficientFundsException(amount);\n } //end else\n }", "public void checkIfWinOrDraw() {\r\n\t\tif (theModel.getIsDraw() == true) {\r\n\t\t\tDrawNum++;\r\n\t\t\tactivePlayer = winningPlayer;\r\n\t\t\t// cards go to communalPile\r\n\r\n\t\t} else {\r\n\t\t\ttheModel.winningCard(winningPlayer);\r\n\t\t\ttheModel.transferWinnerCards(winningPlayer);\r\n\t\t}\r\n\r\n\t}", "public void makeWithdraw() {\n withDraw();\n }", "private void withdraw() {\n userInput = 0;\n while (userInput <= 0) {\n System.out.printf(\"Din nuværende balance er: %.2f DKK\\n\" +\n \"Indtast ønsket beløb at hæve: \", balanceConverted);\n\n textMenuKey(false, \"\");\n\n if (userInput <= 0) {\n System.out.println(\"Indtast et gyldigt beløb\");\n }\n }\n\n if ((userInput * 100) <= balance) {\n moneyController(-userInput);\n mysql.transactionUpdate(customerNumber, customerName, balance, userInput, \"Withdraw\");\n } else {\n System.out.println(\"Utilstrækkelig balance på kontien\");\n }\n }" ]
[ "0.69287056", "0.6656225", "0.66219985", "0.6526051", "0.6502458", "0.64200675", "0.6251987", "0.6241916", "0.6216835", "0.62099665", "0.6207926", "0.6192595", "0.6184773", "0.61834806", "0.6179567", "0.6150711", "0.61285585", "0.6107406", "0.61044765", "0.61007833", "0.609587", "0.6088505", "0.60393554", "0.60393554", "0.60111284", "0.6009901", "0.59682983", "0.5966371", "0.59523606", "0.5937287", "0.59199095", "0.5917617", "0.5908219", "0.58983797", "0.5873049", "0.58730185", "0.5867057", "0.5841497", "0.5835054", "0.5834531", "0.5833435", "0.58296853", "0.58268803", "0.58258563", "0.58256453", "0.58154064", "0.58154064", "0.5811854", "0.5807225", "0.5807225", "0.58012384", "0.5791843", "0.5751644", "0.57438827", "0.5741493", "0.573693", "0.5730934", "0.5723761", "0.57160836", "0.57117414", "0.5710424", "0.5704559", "0.5704414", "0.5689391", "0.56861335", "0.5680915", "0.5677022", "0.56687945", "0.56665456", "0.5658527", "0.5643373", "0.5635679", "0.56312907", "0.56303394", "0.562374", "0.5623354", "0.56201667", "0.5616111", "0.56134224", "0.56125623", "0.5610835", "0.56036186", "0.56023955", "0.56017417", "0.55878186", "0.5587686", "0.55849236", "0.55754364", "0.55721533", "0.55667573", "0.55665547", "0.5566227", "0.55614173", "0.55594873", "0.5558784", "0.55579484", "0.55507463", "0.5550337", "0.5548599", "0.55436814" ]
0.57341135
56
Test failure with draw in sufficient fund.
@Test public void testFailureWithDrawInSufficientFund() throws IOException, URISyntaxException { URI uri = builder.setPath("/accounts/2/withdraw/1000").build(); HttpPut request = new HttpPut(uri); request.setHeader("Content-type", "application/json"); HttpResponse response = client.execute(request); int statusCode = response.getStatusLine().getStatusCode(); assertTrue(statusCode == 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void failedWithdraw(){\n\t\tstate = ATM_State.WITHDRAWALNOTIFICATION;\n\t\tgui.setDisplay(\"Invalid withdrawal amount.\");\n\t}", "public void fail() {\r\n\t\tcontestantIt.currentC().updatePoints(-FAIL);\r\n\t}", "@Test(priority = 7, description=\"Check for remaining cards field, with bad value to Draw\", dependsOnGroups = \"StatusCheck\")\n public void drawUsingBadCountValue() throws IOException, URISyntaxException {\n response = DeckOfCardsApi.drawCardsFromDeckUsingGet(\"https://deckofcardsapi.com/api/deck/\", deckID, \"-1\");\n jsonObject = DeckOfCardsApi.getJsonData(response);\n\n Assert.assertEquals(DeckOfCardsApi.getJsonValue(jsonObject, jkey_remaining), \"50\", \"Expected to Fail, Seems like an error in the API; When given -n, n is a number, All Cards are deleted but only n card remains.\");\n }", "@Test\r\n\tpublic void TestDrawSuit() {\n\t\ttry {\r\n\t\t\tDeck AKDeck = new Deck();\r\n\t\t\tassertEquals(eSuit.DIAMONDS, AKDeck.Draw(eSuit.DIAMONDS).geteSuit());\r\n\t\t} catch (DeckException ex) {\r\n\t\t\tSystem.out.println(\"The deck is empty. No more cards can be drawn.\");\r\n\t\t}\r\n\t}", "@Test\r\n\t public void feelingLucky() {\r\n\t \t Assert.fail();\r\n\t Assert.fail();\r\n\t }", "@Test\n\tpublic void withdrawTest(){\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tAccount cAcc = new CurrentAccount(cus);\n\t\tbc.withdraw(cAcc, 300);\n\t\tboolean flag = false;\n\t\tif(cAcc.getBalance() == -300.0){\n\t\t\tflag = true;\n\t\t}\n\t\tassertTrue(flag);\n\t}", "@Test\r\n void enoughFunds() {\n BankAccount account = new BankAccount(100);\r\n \r\n // Assertion for no exceptions\r\n assertDoesNotThrow(() -> account.withdraw(100));\r\n }", "@Test(expected=Exception.class)\n public void withdraw1100FromAccount_shouldThrowException() throws Exception{\n account.withdraw(1100);\n }", "@Test\n public void test2() {\n cashRegister.addTens(5);\n try {\n cashRegister.withdraw(0, 5);\n fail();\n } catch (InsufficientCashException e) {\n assertEquals(e.getMessage(), \"Not enough denominations\");\n }\n }", "public void createFailure() {\n\t\tgetController().changeFree(true);\t\t\n\t\tdisplayAdvertisement(\"opponent failure\");\n\t\tvalidate();\n\t}", "private void fail() {\n mFails++;\n if(mFails > MAX_NUMBER_OF_FAILS) {\n gameOver();\n }\n }", "@Test(expected = Exception.class)\n public void testCardSelectionIsValid_FALSE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n \n }", "@Test(expected = IllegalStateException.class)\n public void discardDrawOne() {\n this.reset();\n this.bps.discardDraw(0);\n }", "public double calculateExpectedDisagreement();", "private boolean decideIfEventShouldBeReportedAsAFailure() {\n \tint value = new Random().nextInt(100);\n \tif (value < TARGET_SUCCESS_RATE) {\n \t\treturn false;\n \t} else {\n \treturn true;\n \t}\n }", "@Test\n public void CardRequirementError() {\n MSG_ACTION_ACTIVATE_LEADERCARD message = new MSG_ACTION_ACTIVATE_LEADERCARD(0);\n DevelopmentCard card1 = new DevelopmentCard(1, Color.GREEN, 0, null, null);\n p.getDevelopmentSlot().addCard(card1, 1);\n c.emptyQueue();\n assertFalse(am.activateLeaderCard(p, message));\n assertEquals(MessageType.MSG_ERROR, c.messages.get(0).getMessageType());\n assertEquals(1, c.messages.size());\n }", "@Test\n public void holdTest() {\n\n PaymentDto paymentDto = initPayment(inAccountId, outAccountId, \"700\");\n\n final String firstPaymentId = paymentDto.getId();\n\n paymentDto = authorizePayment(firstPaymentId, 200);\n\n assertEquals(\"Payment status AUTHORIZED\", PaymentStatus.AUTHORIZED, paymentDto.getStatus());\n\n\n //init and authorize second payment, but there is 700 cents of 1000 withhold - ERROR: WITHDRAW_NO_FUNDS\n\n paymentDto = initPayment(inAccountId, outAccountId, \"700\");\n\n final String secondPaymentId = paymentDto.getId();\n\n paymentDto = authorizePayment(secondPaymentId, 200);\n\n assertEquals(\"Payment status ERROR\", PaymentStatus.ERROR, paymentDto.getStatus());\n\n assertEquals(\"Error reason WITHDRAW_NO_FUNDS\", new Integer(ErrorCode.WITHDRAW_NO_FUNDS.getCode()), paymentDto.getErrorReason());\n\n\n //confirm first payment - OK\n\n paymentDto = confirmPayment(firstPaymentId, 200);\n\n assertEquals(\"Payment status CONFIRMED\", PaymentStatus.CONFIRMED, paymentDto.getStatus());\n\n\n //confirm second payment, which was filed on authorization - still got ERROR: WITHDRAW_NO_FUNDS\n\n paymentDto = confirmPayment(secondPaymentId, 200);\n\n assertEquals(\"Payment status ERROR\", PaymentStatus.ERROR, paymentDto.getStatus());\n\n assertEquals(\"Error reason WITHDRAW_NO_FUNDS\", new Integer(ErrorCode.WITHDRAW_NO_FUNDS.getCode()), paymentDto.getErrorReason());\n\n }", "@SmallTest\n\tpublic void testBadMatchPenalty() {\n\t\tbadMatch();\n\t\tassertEquals((Integer) (START_SCORE - BAD_MATCH_PENALTY), Integer.valueOf(solo.getText(1).getText().toString()));\n\t}", "@Test\n public void testWithdraw() {\n System.out.println(\"withdraw\");\n double d = 1.0;\n Account instance = new Account(\"Piper\", 10.0);\n double expResult = 9.0;\n double result = instance.withdraw(d);\n assertEquals(expResult, result, 0.0);\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"The test case is a prototype.\");\n }", "@Test(expected = FacilityNotFreeException.class)\n\tpublic void testBookNotFree() throws Exception {\n\t\t// create a reservation\n\t\tdataHelper.createPersistedReservation(\"aUser\", Arrays.asList(room1.getId()), validStartDate, validEndDate);\n\t\t// book should fail..\n\t\tbookingManagement.book(USER_ID, Arrays.asList(room1.getId()), validStartDate, validEndDate);\n\t}", "public void withdraw(double ammount) throws insufficientFunds{\n if(ammount > abal)\n throw new insufficientFunds();\n else{\n ammount = abal - ammount;\n UpdateDB();\n }\n }", "public void denyDraw(){\n System.out.println(\"No cuenta con suficiente money\");\n System.out.println(\"\");\n}", "@Test @SpecAssertion(id = \"432-A2\", section=\"4.3.2\")\n public void testConversionComparedWithRate(){\n Assert.fail();\n }", "boolean isFail();", "@Then ( \"the Prescription was not added\" )\r\n public void failure () {\r\n // assertTrue( driver.getPageSource().contains( \"Error occurred creating\r\n // prescription\" ) );\r\n }", "@Test(expected=InsufficientCreditException.class)\n\tpublic void testNotEnoughtCredit() throws Exception {\n\t\tfor (int i = 49; i >= -1000; i--) {\n\t\t\td.dispense(i, 13);\n\t\t}\n\t}", "@Override\n\t\t\t\tpublic void doFail() {\n\t\t\t\t}", "@Test\r\n void notEnoughFunds() {\n BankAccount account = new BankAccount(9);\r\n\r\n // Assertion for exception\r\n assertThrows(NotEnoughFundsException.class, () -> account.withdraw(10),\r\n \"Balance must be greater than amount of withdrawal\");\r\n }", "boolean isFailure();", "private boolean isUtilityFailure(){\n\n if (this.selectedTrain.getAC() == -1||\n this.selectedTrain.getHeat() == -1 || this.selectedTrain.getLights() == -1\n || this.selectedTrain.getLeftDoor() == -1 || this.selectedTrain.getRightDoor() == -1){\n return true; // there is a utility failure..\n }\n\n return false; // there isn't a utility failure\n }", "@Test\n public void accuseFailTest() throws Exception {\n assertTrue(\"failure - accused status was not set to true\", target.isAccused());\n\n }", "public void testGolden() throws Throwable {\n verifyGolden(this, getData());\n }", "@Test\n\tvoid cannotPurchase() {\n\t\ttestCrew.setMoney(0);\n\t\titemList.get(0).purchase(testCrew);\n\t\tassertEquals(testCrew.getMoney(), 0);\n\t\tassertTrue(testCrew.getMedicalItems().isEmpty());\n\t}", "@Test\n public void testInvalidTerritory() {\n RiskPlayer player = new RiskPlayer(UUID.randomUUID());\n RiskPlayer player2 = new RiskPlayer(UUID.randomUUID());\n RiskBoard board = new RiskBoard();\n player.conqueredTerritory(TerritoryEnum.GREENLAND);\n board.getTerritory(TerritoryEnum.GREENLAND).changePlayer(player, 3);\n player2.conqueredTerritory(TerritoryEnum.ICELAND);\n board.getTerritory(TerritoryEnum.ICELAND).changePlayer(player2, 6);\n ValidDieDefendAction action = new ValidDieDefendAction(player, board,\n TerritoryEnum.GREENLAND);\n AttackAction attack = new AttackAction(player2, TerritoryEnum.ICELAND,\n TerritoryEnum.GREAT_BRITIAN, 3);\n DefendAction defend = new DefendAction(player2, board, attack, 2);\n assertFalse(action.validateDefendMove(defend));\n }", "public static void hitWrong()\n\t{\n\t\troundEnd();\n\t\tlblUpdate.setText(\"You have answer incorrectly. You lose.\");\n\t}", "@Test\n public void testFullGameDraw() throws AuthenticationException {\n Map<String, String> data = gameInitializationService.createGame();\n Integer gameId = Integer.parseInt(data.get(GAME_ID));\n final String tokenPlayerX = data.get(TOKEN);\n final String tokenPlayerO = gameInitializationService.joinGame(gameId);\n AnotherPlayersTurnException anotherPlayersTurnException = null;\n try {\n gamePlayService.playGame(gameId, \"A1\", tokenPlayerX);\n } catch (AnotherPlayersTurnException e) {\n anotherPlayersTurnException = e;\n }\n Assertions.assertNotNull(anotherPlayersTurnException, \"Another player test.\");\n Assertions.assertEquals(\"Another player has to play.\", anotherPlayersTurnException.getMessage(),\n \"Another player exception message test\");\n Assertions.assertTrue(gamePlayService.playGame(gameId, \"A1\", tokenPlayerO), \"Test game - O is playing A1!\");\n Assertions.assertTrue(gamePlayService.playGame(gameId, \"A2\", tokenPlayerX), \"Test game - X is playing A2!\");\n Assertions.assertTrue(gamePlayService.playGame(gameId, \"B1\", tokenPlayerO), \"Test game - O is playing B1!\");\n Assertions.assertTrue(gamePlayService.playGame(gameId, \"B2\", tokenPlayerX), \"Test game - X is playing B2!\");\n Assertions.assertTrue(gamePlayService.playGame(gameId, \"C2\", tokenPlayerO), \"Test game - O is playing C2!\");\n Assertions.assertTrue(gamePlayService.playGame(gameId, \"C1\", tokenPlayerX), \"Test game - X is playing C1!\");\n Assertions.assertTrue(gamePlayService.playGame(gameId, \"A3\", tokenPlayerO), \"Test game - O is playing A3!\");\n Assertions.assertTrue(gamePlayService.playGame(gameId, \"B3\", tokenPlayerX), \"Test game - X is playing B3!\");\n Assertions.assertTrue(gamePlayService.playGame(gameId, \"C3\", tokenPlayerO), \"Test game - O is playing C3!\");\n GameOverException gameOverException = null;\n try {\n gamePlayService.playGame(gameId, \"A1\", tokenPlayerX);\n } catch (GameOverException e) {\n gameOverException = e;\n }\n Assertions.assertNotNull(gameOverException, \"Game over test.\");\n Assertions.assertEquals(\"This game is already over.\", gameOverException.getMessage(),\n \"Game over exception message test\");\n try {\n gamePlayService.playGame(gameId, \"A1\", tokenPlayerO);\n } catch (GameOverException e) {\n gameOverException = e;\n }\n Assertions.assertNotNull(gameOverException, \"Game over test.\");\n Assertions.assertEquals(\"This game is already over.\", gameOverException.getMessage(),\n \"Game over exception message test\");\n Assertions.assertEquals(\"DRAW\", gamePlayService.obtainGameStatus(gameId, tokenPlayerX));\n }", "@Test\n public void testNotEnoughCash() throws Exception {\n\n // login with sufficient rights\n shop.login(admin.getUsername(), admin.getPassword());\n\n // trying to pay for a sale with insufficient funds\n assertEquals(-1, shop.receiveCashPayment(saleId, toBePaid-1), 0.001);\n\n // verify sale did not change state to PAID/COMPLETED\n assertFalse(isTransactionInAccountBook(saleId));\n\n // verify system's balance did not change\n assertEquals(totalBalance, shop.computeBalance(), 0.001);\n }", "@Override\n boolean canFail() {\n return true;\n }", "protected boolean withdraw(double amount)\n\t{\n\t\tif(amount>acc_balance)\n\t\t\treturn false;\n\t\t\n\t\t//else the deduction is done from balance and success message is passed\n\t\tacc_balance-=amount;\n\t\treturn true;\n\t}", "@Test\r\n\tpublic void TestDrawRank() {\n\t\ttry {\r\n\t\t\tDeck AKDeck = new Deck();\r\n\t\t\tassertEquals(eRank.FOUR, AKDeck.Draw(eRank.FOUR).geteRank());\r\n\t\t} catch (DeckException ex) {\r\n\t\t\tSystem.out.println(\"The deck is empty. No more cards can be drawn.\");\r\n\t\t}\r\n\t}", "@Test\n public void ResourceRequirementError() {\n MSG_ACTION_ACTIVATE_LEADERCARD message = new MSG_ACTION_ACTIVATE_LEADERCARD(1);\n assertFalse(am.activateLeaderCard(p, message));\n assertEquals(MessageType.MSG_ERROR, c.messages.get(0).getMessageType());\n assertEquals(1, c.messages.size());\n }", "@Test\n\tpublic void testCase2()\n\t{\n\t\tint numberOfCases=-1;\n\t\t\n\t\t//checking number of case is positive or not\n\t\tboolean valid=BillEstimation.numberOfCaseValidation(numberOfCases);\n\t\tassertFalse(valid);\n\t\t\n\t}", "@Test\n\tpublic void testCheckSufficientCredits_False() {\n\n\t\tint creditsRequired = 11;\n\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertFalse(\"Expected insufficient credit\", sufficientCredits);\n\t}", "public withdrawException() {\n super(\"The Sum you entered is greater than your available money... \");\n }", "@Test\n public void pickUpSomeGoldTest() {\n\tassertNotEquals(0,score);\n }", "@Override\n public void withdraw(double amount) {\n try {\n if (amount > 1000) {\n throw new InvalidFundingAmountException(amount);\n }\n if (this.getBalance() < 5000) {\n throw new InsufficientFundsException(amount);\n }\n doWithdrawing(amount);\n } catch (BankException e) {\n System.out.println(e.getMessage());\n }\n }", "public void withdraw() throws InvalidCourseException {\n\tif (this.nbOfCourses <= 2) //because this method is only called if we want to subtract -1 from nb of courses\n\t throw new InvalidCourseException(\"You have reached the minimum number of courses allowed.\");\n\telse {\n\t System.out.println(\"You have successfully withdrawn from a course.\");\n\t this.nbOfCourses--;\n\t}\n }", "@Test\n public void isCorrectTest(){\n BuyCard cardErr = new BuyCard(12,0);\n\n thrown.expect(IllegalArgumentException.class);\n thrown.expectMessage(\"Row index out of bounds.\");\n cardErr.isCorrect();\n }", "@Test\n public void testImpossible1TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0000\");\n AccountOfUser acc2 = new AccountOfUser(0, \"0000 0000 0000 0001\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n bank.addAccountToUser(user.getPassport(), acc2);\n assertThat(bank.transferMoney(user.getPassport(), acc.getRequisites(), user.getPassport(), acc2.getRequisites(), 100), is(false));\n }", "public void testImproperUseOfTheCircuit() {\n \t fail(\"testImproperUseOfTheCircuit\");\n }", "@Test\n public void testInvalidPlayer() {\n RiskPlayer player = new RiskPlayer(UUID.randomUUID());\n RiskPlayer player2 = new RiskPlayer(UUID.randomUUID());\n RiskBoard board = new RiskBoard();\n player.conqueredTerritory(TerritoryEnum.GREENLAND);\n board.getTerritory(TerritoryEnum.GREENLAND).changePlayer(player, 3);\n player2.conqueredTerritory(TerritoryEnum.ICELAND);\n board.getTerritory(TerritoryEnum.ICELAND).changePlayer(player2, 6);\n ValidDieDefendAction action = new ValidDieDefendAction(player, board,\n TerritoryEnum.GREENLAND);\n AttackAction attack = new AttackAction(player2, TerritoryEnum.ICELAND,\n TerritoryEnum.GREENLAND, 3);\n DefendAction defend = new DefendAction(player2, board, attack, 2);\n assertFalse(action.validateDefendMove(defend));\n }", "@Test\n public void testPayUnpaidOrderFails() throws Exception {\n\n // login with sufficient rights\n shop.login(admin.getUsername(), admin.getPassword());\n\n // issue an order\n int orderId = shop.issueOrder(productCode, 10, 1);\n\n // trying to pay for an order with receiveCashPayment fails\n assertEquals(-1, shop.receiveCashPayment(orderId, 10), 0.001);\n\n // verify order is still in ISSUED state\n assertEquals(\"ISSUED\", shop.getAllOrders().stream()\n .filter(b -> b.getBalanceId() == orderId)\n .map(Order::getStatus)\n .findAny()\n .orElse(null));\n\n // verify system's balance did not change\n assertEquals(totalBalance, shop.computeBalance(), 0.001);\n }", "@Test\n public void testGetNumberDieMoreThanTwoTroops() {\n RiskPlayer player = new RiskPlayer(UUID.randomUUID());\n RiskBoard board = new RiskBoard();\n player.conqueredTerritory(TerritoryEnum.GREENLAND);\n board.getTerritory(TerritoryEnum.GREENLAND).changePlayer(player, 3);\n ValidDieDefendAction action = new ValidDieDefendAction(player, board,\n TerritoryEnum.GREENLAND);\n assertTrue(action.getMaxNumberDie() == 2);\n }", "@Test\n\tpublic void testCheckSufficientCredits_OverdraftFacility() {\n\n\t\tint creditsRequired = 11;\n\n\t\tSmsMessage msg = new SmsMessage();\n\t\tSmsTask smsTask = new SmsTask();\n\t\tsmsTask.setSakaiSiteId(SmsConstants.SMS_DEV_DEFAULT_SAKAI_SITE_ID);\n\t\tsmsTask.setSmsAccountId(account.getId());\n\t\tsmsTask.setDateCreated(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setDateToSend(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setStatusCode(SmsConst_DeliveryStatus.STATUS_PENDING);\n\t\tsmsTask.setAttemptCount(2);\n\t\tsmsTask.setMessageBody(SmsConstants.SMS_DEV_DEFAULT_SMS_MESSAGE_BODY);\n\t\tsmsTask.setSenderUserName(\"senderUserName\");\n\t\tsmsTask.setMaxTimeToLive(1);\n\t\tsmsTask.getSmsMessages().add(msg);\n\t\tsmsTask.setCreditEstimate(creditsRequired);\n\t\tmsg.setSmsTask(smsTask);\n\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertFalse(\"Expected insufficient credit\", sufficientCredits);\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tsufficientCredits = smsBillingImpl.checkSufficientCredits(account\n\t\t\t\t.getId(), creditsRequired);\n\t\tAssert.assertTrue(\"Expected insufficient credit\", !sufficientCredits);\n\t}", "@Test\n public void testGetNumberDieOneTroop() {\n RiskPlayer player = new RiskPlayer(UUID.randomUUID());\n RiskBoard board = new RiskBoard();\n player.conqueredTerritory(TerritoryEnum.GREENLAND);\n board.getTerritory(TerritoryEnum.GREENLAND).changePlayer(player, 1);\n ValidDieDefendAction action = new ValidDieDefendAction(player, board,\n TerritoryEnum.GREENLAND);\n assertTrue(action.getMaxNumberDie() == 1);\n }", "void withdraw(double amount) {\n\t\tif (isSuspended()) {\n\t\t\tSystem.out.println(\"Account is suspended.\");\n\t\t\treturn;\n\t\t}\n\t\tif (amount <= 0) {\n\t\t\tSystem.out.println(\"Amount must be more than 0.\");\n\t\t\tSystem.out.println(\"Withdrawing failed.\");\n\t\t\treturn;\n\t\t}\n\t\tif (check(amount)) {\n\t\t\tbalance -= amount;\n\t\t\tSystem.out.println(\"Withdraw \" + amount + \" successfully.\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Withdraw \" + amount + \" unsuccessfully. Do not have enough available funds.\");\n\t\t}\n\t}", "@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }", "@Test\n public void testRecursionsFailure() throws Exception {\n assertTrue(doRecursions(false));\n }", "@Test\n public void testWrongPartner() {\n /* Set up scenario. As one might see, no partnership was registered hence we throw an\n error.\n */\n this.quotes = Controller.getQuotes(desiredBikes, this.dateRange,\n this.customer.getLocation(),\n true);\n Quote chosenQuote = this.quotes.get(0);\n Provider originalProvider = chosenQuote.provider;\n Payment orderInfo = BookingController.bookQuote(chosenQuote, this.customer);\n deliveryService.carryOutPickups(this.bookingDate);\n deliveryService.carryOutDropoffs();\n assertThrows(AssertionError.class, () ->\n {\n this.provider2.registerReturn(orderInfo.getOrderNumber());\n });\n }", "@Test\n\tpublic void testWithdraw() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);;\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(01, \"acc1\", 00000, 50.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tArrayList<Account> expected = new ArrayList<>();\n\t\texpected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Withdrawl Successful\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"fail withdrawing $50 + fee\", testResult);\n\t}", "@Test\n\tpublic void planeCanTakeOff() {\n\t\ttry {\n\t\t\theathrow.landing(tap);\n\t\t} catch (Exception exception) {\n\n\t\t}\n\n\t\ttry {\n\t\t\theathrow.takeoff(tap);\n\t\t} catch (Exception exception) {\n\n\t\t}\n\n\t\tassertEquals(expectedPlanes, heathrow.hangar);\n\t\tassertTrue(heathrow.hangar.isEmpty());\n\t}", "@Test\n public void getNumDraw() {\n this.reset();\n assertEquals(-1, this.bps.getNumDraw());\n // max # of visible cards in the draw pile\n this.reset();\n this.bps.startGame(this.fullDeck, false, 7, 1);\n assertEquals(1, this.bps.getNumDraw());\n }", "public void testOneWithdrawal(){\n\t\t//Pre-conditions\n\t\tteller.setWorking(true);\n\t\tteller.setHost(host);\n\t\t\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\t\n\t\tassertEquals(\"Teller should have no pending loans, but it has \" + teller.pendingLoans.size(),0,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller should have no accountsListed, but it has \" + teller.accountsListed.size(),0,teller.accountsListed.size());\n\t\t\n\t\t//Step 0 of test - Teller has an account for this customer already \n\t\tteller.accountsListed.add(new BankAccount(withdraw,100));\n\t\t\n\t\t//Post-conditions of step 0 \n\t\tassertEquals(\"Teller should have one account listed, instead it has \" + teller.accountsListed.size(),1,teller.accountsListed.size());\n\t\tassertEquals(\"Teller's only account should have a balance of 100, instead it has \" + teller.accountsListed.get(0).getBalance(), \n\t\t\t\t100.0,teller.accountsListed.get(0).getBalance());\n\t\t\n\t\t//Step 1 of test\n\t\t//msgGoSeeTeller(Banker)\n\t\twithdraw.msgGoSeeTeller(teller);\n\t\t\n\t\t//Post-conditions of step 1 \n\t\tassertEquals(\"Teller's state should be busy, but instead it is: \" + teller.getState(),\"Busy\",teller.getState());\n\t\tassertEquals(\"Teller should have one pending transaction, but it has: \" +teller.pendingTransactions.size(),\n\t\t\t\t1,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller's transaction should be to withdraw 100 dollars, instead it is for \" + teller.pendingTransactions.get(withdraw), \n\t\t\t\t-100.0, teller.pendingTransactions.get(withdraw));\n\t\t\n\t\t//Step 2 of test\n\t\tassertTrue(\"Teller's scheduler should return true, but it doesn't.\", teller.pickAndExecuteAnAction());\n\t\t\n\t\t//Post-conditions of step 2 \n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\tassertTrue(\"Host's log should have a message stating \\\"Updated account, and added teller\\\", instead it reads: \" + host.log.getLastLoggedEvent().toString(), \n\t\t\t\thost.log.containsString(\"Updated account, and added teller\"));\n\t\tassertTrue(\"Customer's log should have a message stating \\\"Got 100.0 dollars, leaving bank.\\\", instead it reads: \" + withdraw.log.getLastLoggedEvent().toString(),\n\t\t\t\twithdraw.log.containsString(\"Got 100.0 dollars, leaving bank.\"));\n\t\tassertEquals(\"Customer's account stored in teller should be updated with the correct balance of 0.0, instead it has \" + teller.accountsListed.get(0).getBalance(), \n\t\t\t\t0.0, teller.accountsListed.get(0).getBalance());\n\t\t\n\t}", "@Test\n public void testGetNumberDie() {\n RiskPlayer player = new RiskPlayer(UUID.randomUUID());\n RiskBoard board = new RiskBoard();\n player.conqueredTerritory(TerritoryEnum.GREENLAND);\n board.getTerritory(TerritoryEnum.GREENLAND).changePlayer(player, 2);\n ValidDieDefendAction action = new ValidDieDefendAction(player, board,\n TerritoryEnum.GREENLAND);\n assertTrue(action.getMaxNumberDie() == 2);\n }", "@Override\n\tpublic boolean withdraw(int accNo, double money) {\n\t\treturn false;\n\t}", "@Test\n public void testDealerRefusesWhenOutOfCards() {\n }", "@Test(expected=MissingPrice.class)\n\tpublic void testNotEnoughBought() {\n\t\tpos.setPricing(\"A\", 4, 7);\n\n\t\tpos.scan(\"A\");\n\t\tpos.total();\n\t}", "@Test\n public void withdrawCheckingTest(){\n userC.withdraw(200.00);\n assertEquals(\"Balance is now $100.00\", userC.getCurrentBalance(), 100.00, DELTA);\n }", "public void withdraw(double amount) {\n\t\tif (amount < balance) {\n\t\t\tSystem.out.println(\"Successful withdraw: $\" + amount);\n\t\t\tbalance -= amount;\n\t\t} else {\n\t\t\tSystem.out.println(\"Withdraw Failed: Insufficient balance. The amount of $\" + amount + \" is more than your balance ($\" + balance +\").\");\n\t\t}\n\t}", "@Override\r\n\tvoid withdraw(double amount) {\n\t\tsuper.withdraw(amount);\r\n\t\tif(minimumblc>500)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"you have withdraw rupees\"+ (amount));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"withdraw failed \");\r\n\t\t}\r\n\t\t\r\n\t}", "private boolean isValidDraw(final int x, final int y, final int z, final Tile newTile) {\r\n\t\t// Bomb out straight away if it's out-of-bounds\r\n\t\tif (!isInBounds(x, y)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Ensure no-one draws items on solid floortiles\r\n\t\tif (map.getTile(x, y, 0).isSolid() && z > 0 && newTile != Tile.getEmptyTile()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Looks like a draw will occur\r\n\t\treturn true;\r\n\t}", "public void onTestFailure(ITestResult tr) {\n\t\ttest= extent.createTest(tr.getName());\n\t\ttest.log(Status.FAIL, MarkupHelper.createLabel(tr.getName(), ExtentColor.RED));\n\t\tString screenShotPath = \"./Screenshot/\"+tr.getName()+\".png\";\n\t\tFile file = new File(screenShotPath);\n\t\tif(file.exists()) {\n\t\t\ttest.fail(\"Screenshot below \"+test.addScreenCaptureFromPath(screenShotPath));\n\t\t}\n\t\t\t\n\t}", "double getMissChance();", "@Test(groups ={Slingshot,Regression})\n\tpublic void EditViewLessthan15AcctsErrorValidation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify whether proper error message is displayed in view when continuing with out enabling the accounts check box\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMvManageView\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t\t.clicktestacct();\n\t\t/*.ClickManageUserLink()\n\t\t.ManageViews()\n\t\t.VerifyEditviewname(userProfile)\n\t\t.EditViewNameErrorValidation(userProfile); \t \t\t\t\t\t\t \t \t\t\n\t}*/\n\t}", "@Test\n\t\tpublic void testKudomonStolen() throws KudomonCantBeCaughtException {\n\t\t thrown.expect(KudomonCantBeCaughtException.class);\n\t\t thrown.expectMessage(\"aggron has been stolen from you!\");\n\t\t testTrainer1.attemptCapture(aggron);\n\t\t testTrainer2.attemptCapture(aggron);\n\t\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "@Test\n public void testImpossible2TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0001\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n assertThat(bank.transferMoney(user.getPassport(), \"0000 0000 0000 0000\", user.getPassport(), acc.getRequisites(), 100), is(false));\n }", "private void draw() throws Stalemate {\n if (picked == totalMovesAllowed && !didAnyoneWin) {\n myGame.whatMove.setText(\"Press Reset!\");\n throw (new Stalemate());\n }\n }", "boolean isMismatch(double score);", "boolean isClockFailure();", "private void assertFail(int value) {\n try {\n converter.convertRomanNumber(value);\n fail();\n } catch (Exception e) {\n }\n }", "@Test\r\n\tvoid testGetPlayerSkillsShouldFail() {\r\n\t\tController ctrl = new Controller();\r\n\t\t\r\n\t\tint sru = 99999999;\r\n\t\t\r\n\t\t//Passing\r\n\t\tint standard = ctrl.getSkillRatingByName(sru, \"Standard\");\r\n\t\tint spin= ctrl.getSkillRatingByName(sru, \"Spin\");\r\n\t\tint pop = ctrl.getSkillRatingByName(sru, \"Pop\");\r\n\t\t\r\n\t\t//Tackling\r\n\t\tint front = ctrl.getSkillRatingByName(sru, \"Front\");\r\n\t\tint rear = ctrl.getSkillRatingByName(sru, \"Rear\");\r\n\t\tint side = ctrl.getSkillRatingByName(sru, \"Side\");\r\n\t\tint scrabble = ctrl.getSkillRatingByName(sru, \"Scrabble\");\r\n\t\t\r\n\t\t//Kicking\r\n\t\tint drop = ctrl.getSkillRatingByName(sru, \"Drop\");\r\n\t\tint punt = ctrl.getSkillRatingByName(sru, \"Punt\");\r\n\t\tint grubber = ctrl.getSkillRatingByName(sru, \"Grubber\");\r\n\t\tint goal = ctrl.getSkillRatingByName(sru, \"Goal\");\r\n\t\t\r\n\t\tboolean success = false;\r\n\t\t\r\n\t\tif(standard == 1 && spin == 1 && pop == 1 && front == 1 && rear == 1 && side == 1 \r\n\t\t\t\t&& scrabble == 1 && drop == 1 && punt == 1 && grubber == 1 && goal == 1) {\r\n\t\t\tsuccess = true;\r\n\t\t}\r\n\t\t\r\n\t\tassertTrue(success);\r\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "public void withDrawAmount() {\n\t\t\n\t\ttry {\t\n\t\t\tlog.log(Level.INFO, \"Please Enter the account number you want to withdraw: \");\n\t\t\tint withdrawAccountNumber = scan.nextInt();\n\t\t\tlong amount;\n\t\t\tlog.log(Level.INFO, \"Please Enter the amount you want to withdraw : \");\n\t\t\tamount = scan.nextLong();\n\t\t\tbankop.withDraw(withdrawAccountNumber,amount);\n\t\t\t\n\t\t}catch(AccountDetailsException | BalanceException message ) {\n\t\t\tlog.log(Level.INFO, message.getMessage());\n\t\t}\n\n\t}", "@Test\n public void overdraw_forCheckingAccount_shouldSucceed() {\n\n AccountWithEnum accountWithEnum = new AccountWithEnum(100, 12345, AccountType.CHECKING);\n\n accountWithEnum.withdraw(150);\n\n Assert.assertEquals(-50, accountWithEnum.getBalance());\n }", "@Test\r\n\tpublic void testCoinRejected() {\r\n\t\tCoin coin = new Coin(7);\r\n\t\tTheCoinSlotListener csListener = new TheCoinSlotListener();\r\n\t\tcsListener.coinRejected(vend.getCoinSlot(), coin);\r\n\t\tassertEquals(csListener.getCurrentCredit(), 0);\t\t\t\r\n\t}", "@Test\r\n\tpublic void testMakePurchase_not_enough_money() {\r\n\t\tassertEquals(false, vendMachine.makePurchase(\"A\"));\r\n\t}", "public void retConfirm(float draw){\n System.out.println(\"La cantidad de \"+draw+\" ha sido retirada correctamente\");\n System.out.println(\"\");\n}", "@Test\n\tpublic void testIfKingHasNotLost()\n\t{\n\t\tData d = new Data();\n\t\td.set(14, 34); // set a black piece to square 34\n\t\td.set(15, 32); // set a black piece to square 32\n\t\td.set(16, 22); //set a black piece to square 22, i.e. one above the king\n\t\td.set(17, 44); // set a black piece to square 44, i.e. one below the king\n\t\t\n\t\tassertFalse(d.kingLost(100)); \n\t}", "public void printFailure() {\n //\n }", "@Test\r\n\tpublic void checkBreathsTest() {\n\t\tassertTrue(boardService.getGameRules().checkBreaths(board.field[10][16])); //we expect to have breaths\r\n\t\t\r\n\t\t//than we check if whites have breaths - expected = false\r\n\t\tassertFalse(boardService.getGameRules().checkBreaths(board.field[11][15])); //we expect no to have breaths\r\n\t}", "@Test\n\tpublic void testWithdraw(){\n\t\t\n\t\t// Arrange\n\t\tBigDecimal amountToWithdraw = new BigDecimal(10.00);\n\t\tBigDecimal expectedBalance = new BigDecimal(110.5);\n\t\tdouble delta = 1e-3;\n\t\t// Act\n\t\tcurrentAccount.withdraw(amountToWithdraw);\n\t\tBalance actualBalance = currentAccount.checkBalance();\n\t\t\n\t\t// Assert\n\t\tassertEquals(expectedBalance.doubleValue(), actualBalance.getAmount().doubleValue(), delta);\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}", "private static void withdraw(double amount) {\n double resultWithdraw = balance - amount;\r\n if (resultWithdraw < 0 || amount > 2000) {\r\n System.out.println(\"Withdrawal cannot exceed $2000. Balance cannot be reduced below $0.\");\r\n } else {\r\n System.out.println(amount + \" has been withdrawn from your bank account.\\nCurrent balance \" + resultWithdraw + \".\");\r\n }\r\n }", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}", "@Test(expected = DoesNotOwnException.class)\n\tpublic void cannotPlayDevCardTest() throws DoesNotOwnException, CannotPlayException\n\t{\n\t\tp.playDevelopmentCard(c, game.getBank());\n\t}" ]
[ "0.70846987", "0.65435004", "0.6538429", "0.6424044", "0.6256454", "0.6254904", "0.6232302", "0.6197731", "0.6189511", "0.6184905", "0.614579", "0.61244977", "0.6120207", "0.60916936", "0.60892576", "0.60584146", "0.6029429", "0.5995548", "0.5954243", "0.59373385", "0.5926523", "0.5919156", "0.59163165", "0.59072286", "0.5905012", "0.5904889", "0.5885669", "0.5878972", "0.5865067", "0.5860418", "0.585743", "0.5856179", "0.5855185", "0.5849847", "0.5841408", "0.583387", "0.5826921", "0.58233374", "0.5819882", "0.5804748", "0.5801506", "0.58000517", "0.5799692", "0.5787329", "0.57859075", "0.5784508", "0.57844603", "0.576931", "0.5766742", "0.5763072", "0.5753924", "0.57536006", "0.5749957", "0.5738122", "0.5737952", "0.57378745", "0.57277405", "0.57197535", "0.57125336", "0.5710543", "0.5707195", "0.5686527", "0.56793725", "0.56793094", "0.5662115", "0.56570697", "0.5655077", "0.5646544", "0.56359255", "0.5635777", "0.5628003", "0.5627148", "0.5621229", "0.5620789", "0.5619537", "0.5619173", "0.5619173", "0.5619173", "0.56157696", "0.56145567", "0.5614497", "0.56120646", "0.56079674", "0.5607832", "0.5601697", "0.5601697", "0.55989134", "0.55944693", "0.5593605", "0.5593108", "0.5592506", "0.5583751", "0.5579748", "0.55791444", "0.55639744", "0.5562078", "0.5558473", "0.55537283", "0.55537283", "0.5551845" ]
0.60768485
15
Test success transfer fund sufficient fund.
@Test public void testSuccessTransferFundSufficientFund() throws IOException, URISyntaxException { URI uri = builder.setPath("/transfers").build(); BigDecimal amount = new BigDecimal(10).setScale(4, RoundingMode.HALF_EVEN); HttpPost request = new HttpPost(uri); request.setHeader("Content-type", "application/json"); request.setEntity(new StringEntity(mapper.writeValueAsString(new MoneyTransfer(amount, 1L, 4L)))); HttpResponse response = client.execute(request); int statusCode = response.getStatusLine().getStatusCode(); assertTrue(statusCode == 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void moneyTrnasferSucess() {\n\t\t\n\t\tString accountNumberFrom = createAccount(\"krishna\",4000);\n\t\tString accountNumberTo = createAccount(\"ram\",2000);\n\t\tdouble amountToBeTranfered = 500.0;\n\t\tMoneyTransfer moneyTransfer = new MoneyTransfer();\n\t\tmoneyTransfer.setAccountNumberFrom(Integer.parseInt(accountNumberFrom));\n\t\tmoneyTransfer.setAccountNumberTo(Integer.parseInt(accountNumberTo));\n\t\tmoneyTransfer.setAmount(amountToBeTranfered);\n\t\t\n\t\tString requestBody = gson.toJson(moneyTransfer);\n\t\t\n\t\tRequestSpecification request = RestAssured.given();\n\t\trequest.body(requestBody);\n\t\tResponse response = request.put(\"/transfer\");\n\t\t\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - START\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(amountToBeTranfered);\n\t\tsb.append(\" has been transferred to : \");\n\t\tsb.append(accountNumberTo);\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - END\n\t\t\n\t\tAssertions.assertEquals(sb.toString(), response.asString());\n\t\t\n\t}", "@Test\n public void transferCheckingtoSavingsTest(){\n assertTrue(userC.transfer(150.00, userS));\n }", "@Test\n\tpublic void depositTest(){\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tAccount cAcc = new CurrentAccount(cus);\n\t\tbc.deposit(cAcc, 500, true);\n\t\tboolean flag = false;\n\t\tif(cAcc.getBalance() == 500.0){\n\t\t\tflag = true;\n\t\t}\n\t\tassertTrue(flag);\n\t}", "@Test\n public void proveraTransfera() {\n Account ivana = mobi.openAccount(\"Ivana\");\n Account pera = mobi.openAccount(\"Pera\");\n\n mobi.payInMoney(ivana.getNumber(), 5000.0);\n mobi.transferMoney(ivana.getNumber(), pera.getNumber(), 2000.0);\n //ocekujemo da nakon ovoga ivana ima 3000, a pera 2000\n\n SoftAssert sa = new SoftAssert();\n sa.assertEquals(ivana.getAmount(), 3000.0);\n sa.assertEquals(pera.getAmount(), 2000.0);\n\n sa.assertAll();\n }", "@Test\n\tpublic void testWithdraw() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);;\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(01, \"acc1\", 00000, 50.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tArrayList<Account> expected = new ArrayList<>();\n\t\texpected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Withdrawl Successful\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"fail withdrawing $50 + fee\", testResult);\n\t}", "@Test\n public void holdTest() {\n\n PaymentDto paymentDto = initPayment(inAccountId, outAccountId, \"700\");\n\n final String firstPaymentId = paymentDto.getId();\n\n paymentDto = authorizePayment(firstPaymentId, 200);\n\n assertEquals(\"Payment status AUTHORIZED\", PaymentStatus.AUTHORIZED, paymentDto.getStatus());\n\n\n //init and authorize second payment, but there is 700 cents of 1000 withhold - ERROR: WITHDRAW_NO_FUNDS\n\n paymentDto = initPayment(inAccountId, outAccountId, \"700\");\n\n final String secondPaymentId = paymentDto.getId();\n\n paymentDto = authorizePayment(secondPaymentId, 200);\n\n assertEquals(\"Payment status ERROR\", PaymentStatus.ERROR, paymentDto.getStatus());\n\n assertEquals(\"Error reason WITHDRAW_NO_FUNDS\", new Integer(ErrorCode.WITHDRAW_NO_FUNDS.getCode()), paymentDto.getErrorReason());\n\n\n //confirm first payment - OK\n\n paymentDto = confirmPayment(firstPaymentId, 200);\n\n assertEquals(\"Payment status CONFIRMED\", PaymentStatus.CONFIRMED, paymentDto.getStatus());\n\n\n //confirm second payment, which was filed on authorization - still got ERROR: WITHDRAW_NO_FUNDS\n\n paymentDto = confirmPayment(secondPaymentId, 200);\n\n assertEquals(\"Payment status ERROR\", PaymentStatus.ERROR, paymentDto.getStatus());\n\n assertEquals(\"Error reason WITHDRAW_NO_FUNDS\", new Integer(ErrorCode.WITHDRAW_NO_FUNDS.getCode()), paymentDto.getErrorReason());\n\n }", "@Test\n public void testImpossible1TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0000\");\n AccountOfUser acc2 = new AccountOfUser(0, \"0000 0000 0000 0001\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n bank.addAccountToUser(user.getPassport(), acc2);\n assertThat(bank.transferMoney(user.getPassport(), acc.getRequisites(), user.getPassport(), acc2.getRequisites(), 100), is(false));\n }", "@Test\n\tpublic void testTransfer() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"acc2\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(02, \"acc1\", 00000, 200.00, \"\"));\n\t\ttransactions.add(2, new Transaction(02, \"acc2\", 00001, 200.00, \"\"));\n\t\ttransactions.add(3, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\t// ArrayList<Account> expected = new ArrayList();\n\t\t// expected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\t\t// expected.add(1, new Account(00001, \"acc2\", true, 1050.00, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Money Transfered\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"money not transfered\", testResult);\n\t}", "@Test\n\tpublic void testDeposit() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(04, \"acc1\", 00000, 100.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (outContent.toString().contains(\"Deposit Successful\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"unable to deposit money\", testResult);\n\t}", "@Test\n\tpublic void withdrawTest(){\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tAccount cAcc = new CurrentAccount(cus);\n\t\tbc.withdraw(cAcc, 300);\n\t\tboolean flag = false;\n\t\tif(cAcc.getBalance() == -300.0){\n\t\t\tflag = true;\n\t\t}\n\t\tassertTrue(flag);\n\t}", "public void transferedFunds(AuctionItem purchasedItem){\n Message<AuctionItem> message = new Message<>(Message.MessageIdentifier.\n TRANSFER_FUNDS,purchasedItem);\n Message<Integer> reply = sendMSG(message);\n if(reply != null){\n if(reply.getMessageIdentifier() == Message.MessageIdentifier.\n TRANSFER_SUCCESS){\n }else{\n System.out.println(\"Bank missing transfer funds\");\n }\n }\n }", "public void testOneWithdrawal(){\n\t\t//Pre-conditions\n\t\tteller.setWorking(true);\n\t\tteller.setHost(host);\n\t\t\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\t\n\t\tassertEquals(\"Teller should have no pending loans, but it has \" + teller.pendingLoans.size(),0,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller should have no accountsListed, but it has \" + teller.accountsListed.size(),0,teller.accountsListed.size());\n\t\t\n\t\t//Step 0 of test - Teller has an account for this customer already \n\t\tteller.accountsListed.add(new BankAccount(withdraw,100));\n\t\t\n\t\t//Post-conditions of step 0 \n\t\tassertEquals(\"Teller should have one account listed, instead it has \" + teller.accountsListed.size(),1,teller.accountsListed.size());\n\t\tassertEquals(\"Teller's only account should have a balance of 100, instead it has \" + teller.accountsListed.get(0).getBalance(), \n\t\t\t\t100.0,teller.accountsListed.get(0).getBalance());\n\t\t\n\t\t//Step 1 of test\n\t\t//msgGoSeeTeller(Banker)\n\t\twithdraw.msgGoSeeTeller(teller);\n\t\t\n\t\t//Post-conditions of step 1 \n\t\tassertEquals(\"Teller's state should be busy, but instead it is: \" + teller.getState(),\"Busy\",teller.getState());\n\t\tassertEquals(\"Teller should have one pending transaction, but it has: \" +teller.pendingTransactions.size(),\n\t\t\t\t1,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller's transaction should be to withdraw 100 dollars, instead it is for \" + teller.pendingTransactions.get(withdraw), \n\t\t\t\t-100.0, teller.pendingTransactions.get(withdraw));\n\t\t\n\t\t//Step 2 of test\n\t\tassertTrue(\"Teller's scheduler should return true, but it doesn't.\", teller.pickAndExecuteAnAction());\n\t\t\n\t\t//Post-conditions of step 2 \n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\tassertTrue(\"Host's log should have a message stating \\\"Updated account, and added teller\\\", instead it reads: \" + host.log.getLastLoggedEvent().toString(), \n\t\t\t\thost.log.containsString(\"Updated account, and added teller\"));\n\t\tassertTrue(\"Customer's log should have a message stating \\\"Got 100.0 dollars, leaving bank.\\\", instead it reads: \" + withdraw.log.getLastLoggedEvent().toString(),\n\t\t\t\twithdraw.log.containsString(\"Got 100.0 dollars, leaving bank.\"));\n\t\tassertEquals(\"Customer's account stored in teller should be updated with the correct balance of 0.0, instead it has \" + teller.accountsListed.get(0).getBalance(), \n\t\t\t\t0.0, teller.accountsListed.get(0).getBalance());\n\t\t\n\t}", "@Test\n public void testSuccessTransferFundInsufficientFund() throws IOException, URISyntaxException {\n URI uri = builder.setPath(\"/transfers\").build();\n BigDecimal amount = new BigDecimal(100000).setScale(4, RoundingMode.HALF_EVEN);\n\n HttpPost request = new HttpPost(uri);\n request.setHeader(\"Content-type\", \"application/json\");\n request.setEntity(new StringEntity(mapper.writeValueAsString(new MoneyTransfer(amount, 1L, 4L))));\n HttpResponse response = client.execute(request);\n\n int statusCode = response.getStatusLine().getStatusCode();\n assertTrue(statusCode == 500);\n }", "public void testOneDeposit(){\n\t\t//Pre-conditions\n\t\tteller.setWorking(true);\n\t\tteller.setHost(host);\n\t\t\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\t\n\t\tassertEquals(\"Teller should have no pending loans, but it has \" + teller.pendingLoans.size(),0,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller should have no accountsListed, but it has \" + teller.accountsListed.size(),0,teller.accountsListed.size());\n\t\t\n\t\t//Step 0 of test - Host sends the teller a new account for the incoming customer\n\t\tteller.msgHereIsAccount(new BankAccount(deposit,0));\n\t\t\n\t\t//Post-conditions of step 0 \n\t\tassertEquals(\"Teller should have one account listed, instead it has \" + teller.accountsListed.size(),1,teller.accountsListed.size());\n\t\tassertEquals(\"Teller's only account should have a balance of 0, instead it has \" + teller.accountsListed.get(0).getBalance(), \n\t\t\t\t0.0,teller.accountsListed.get(0).getBalance());\n\t\t\n\t\t//Step 1 of test\n\t\t//msgGoSeeTeller(Banker)\n\t\tdeposit.msgGoSeeTeller(teller);\n\t\t\n\t\t//Post-conditions of step 1 \n\t\tassertEquals(\"Teller's state should be busy, but instead it is: \" + teller.getState(),\"Busy\",teller.getState());\n\t\tassertEquals(\"Teller should have one pending transaction, but it has: \" +teller.pendingTransactions.size(),\n\t\t\t\t1,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller's transaction should be to deposit 100 dollars, instead it is for \" + teller.pendingTransactions.get(deposit), \n\t\t\t\t100.0, teller.pendingTransactions.get(deposit));\n\t\t\n\t\t//Step 2 of test\n\t\tassertTrue(\"Teller's scheduler should return true, but it doesn't.\", teller.pickAndExecuteAnAction());\n\t\t\n\t\t//Post-conditions of step 2 \n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\tassertTrue(\"Host's log should have a message stating \\\"Updated account, and added teller\\\", instead it reads: \" + host.log.getLastLoggedEvent().toString(), \n\t\t\t\thost.log.containsString(\"Updated account, and added teller\"));\n\t\tassertTrue(\"Customer's log should have a message stating \\\"Got 0.0 dollars, leaving bank.\\\", instead it reads: \" + deposit.log.getLastLoggedEvent().toString(),\n\t\t\t\tdeposit.log.containsString(\"Got 0.0 dollars, leaving bank.\"));\n\t\tassertEquals(\"Customer's account stored in teller should be updated with the correct balance of 100.0, instead it has \" + teller.accountsListed.get(0).getBalance(), 100.0, teller.accountsListed.get(0).getBalance());\n\t\t\n\t}", "@Test\n public void testImpossible2TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0001\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n assertThat(bank.transferMoney(user.getPassport(), \"0000 0000 0000 0000\", user.getPassport(), acc.getRequisites(), 100), is(false));\n }", "public boolean fundTransfer(int accountNumber, float amount) {\n\t\treturn dao.fundTransfer(accountNumber,amount);\r\n\t}", "@Test\n public void testPayTransactionSuccessfully() throws Exception {\n\n // login with sufficient rights\n shop.login(admin.getUsername(), admin.getPassword());\n\n // verify receive correct change when paying for sale\n double change = 3;\n assertEquals(change, shop.receiveCashPayment(saleId, toBePaid+change), 0.001);\n totalBalance += toBePaid;\n\n // verify sale is in state PAID/COMPLETED\n assertTrue(isTransactionInAccountBook(saleId));\n\n // verify system's balance did update correctly\n assertEquals(totalBalance, shop.computeBalance(), 0.001);\n }", "@Test\n public void testImpossible3TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(1000, \"0000 0000 0000 0000\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n assertThat(bank.transferMoney(user.getPassport(), acc.getRequisites(), user.getPassport(), \"0000 0000 0000 0001\", 100), is(false));\n }", "if (charge == adhocTicket.getCharge()) {\n System.out.println(\"Charge is passed\");\n }", "@Test\n\tpublic void testChargesStudent() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, true);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(01, \"acc1\", 00000, 50.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (acc1.currentBalance == 949.95) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"can not withdraw transaction charge (student)\", testResult);\n\t}", "@Test\n\tpublic void testChargesNonStudent() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(01, \"acc1\", 00000, 50.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (acc1.currentBalance == 949.90) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"can not withdraw transaction charge (non student)\", testResult);\n\t}", "@Test\n\tpublic void moneyTrnasferExcetionInsufficientBalanceOfFromAccount() {\n\t\t\n\t\tString accountNumberFrom = createAccount(\"krishna\",4000);\n\t\tString accountNumberTo = createAccount(\"ram\",2000);\n\t\tdouble amountToBeTranfered = 40000.0;\n\t\tMoneyTransfer moneyTransfer = new MoneyTransfer();\n\t\tmoneyTransfer.setAccountNumberFrom(Integer.parseInt(accountNumberFrom));\n\t\tmoneyTransfer.setAccountNumberTo(Integer.parseInt(accountNumberTo));\n\t\tmoneyTransfer.setAmount(amountToBeTranfered);\n\t\t\n\t\tString requestBody = gson.toJson(moneyTransfer);\n\t\t\n\t\tRequestSpecification request = RestAssured.given();\n\t\trequest.body(requestBody);\n\t\tResponse response = request.put(\"/transfer\");\n\t\t\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - START\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"Account Number - \");\n\t\tsb.append(accountNumberFrom);\n\t\tsb.append(\" do not have sufficient amout to transfer.\");\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - END\n\t\t\n\t\tAssertions.assertEquals(sb.toString(), response.asString());\n\t\t\n\t}", "private boolean DeriveStockWith_FundIsAvailable() {\n\t\tif (getFunds() > 0) {\n\t\t\tif (calculateInputStock_Items() > getFunds()) {\n\t\t\t\tSystem.err.println(\"Insufficient Funds, Cannot restock\");\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t\t// available funds can accommodate input stock requirement\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.err.println(\"Insufficient Funds\");\n\t\t}\n\t\treturn false;\n\t}", "protected boolean withdraw(double amount)\n\t{\n\t\tif(amount>acc_balance)\n\t\t\treturn false;\n\t\t\n\t\t//else the deduction is done from balance and success message is passed\n\t\tacc_balance-=amount;\n\t\treturn true;\n\t}", "@Test\n\tpublic void testCheckSufficientCredits_OverdraftFacility() {\n\n\t\tint creditsRequired = 11;\n\n\t\tSmsMessage msg = new SmsMessage();\n\t\tSmsTask smsTask = new SmsTask();\n\t\tsmsTask.setSakaiSiteId(SmsConstants.SMS_DEV_DEFAULT_SAKAI_SITE_ID);\n\t\tsmsTask.setSmsAccountId(account.getId());\n\t\tsmsTask.setDateCreated(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setDateToSend(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setStatusCode(SmsConst_DeliveryStatus.STATUS_PENDING);\n\t\tsmsTask.setAttemptCount(2);\n\t\tsmsTask.setMessageBody(SmsConstants.SMS_DEV_DEFAULT_SMS_MESSAGE_BODY);\n\t\tsmsTask.setSenderUserName(\"senderUserName\");\n\t\tsmsTask.setMaxTimeToLive(1);\n\t\tsmsTask.getSmsMessages().add(msg);\n\t\tsmsTask.setCreditEstimate(creditsRequired);\n\t\tmsg.setSmsTask(smsTask);\n\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertFalse(\"Expected insufficient credit\", sufficientCredits);\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tsufficientCredits = smsBillingImpl.checkSufficientCredits(account\n\t\t\t\t.getId(), creditsRequired);\n\t\tAssert.assertTrue(\"Expected insufficient credit\", !sufficientCredits);\n\t}", "@Test \n\tpublic void test1() {\n\t\taccount.withdraw(1000);\n\t\t//Sample (Expected) Output\n\t\tassertEquals(1000, account.getAmount(),0.01);\n\t}", "public abstract boolean deposit(float amount);", "@Test\n void bankListIsAccountExistToTransfer_accountExistWithSufficientMoneyToTransfer_success() {\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut(new PrintStream(outContent));\n BankList bankList = new BankList(storage);\n Ui uiTest = new Ui();\n Bank newSavingAccount = new Saving(\"Test Saving Account\", 1000, 2000);\n Bank newInvestmentAccount = new Investment(\"Test Investment Account\", 1000);\n String expectedReturnType = \"investment\";\n\n try {\n bankList.bankListAddBank(newSavingAccount, uiTest);\n bankList.bankListAddBank(newInvestmentAccount, uiTest);\n outContent.reset();\n String returnType = bankList.getTransferBankType(\"Test Investment Account\",\n 500);\n assertEquals(expectedReturnType, returnType);\n\n\n } catch (BankException error) {\n System.out.println(\"Expected no throw, but error thrown\");\n }\n\n assertEquals(2, bankList.getBankListSize());\n\n }", "@Test\r\n\tpublic void testValidationSuccess() {\r\n\t\tAccountTransferRequest accountTransferRequest = new AccountTransferRequest();\r\n\t\taccountTransferRequest.setUsername(VALID_USERNAME);\r\n\t\taccountTransferRequest.setPassword(VALID_PASSWORD);\r\n\t\taccountTransferRequest.setSenderAccount(VALID_SENDER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setReceiverAccount(VALID_RECEIVER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setTransferAmount(400.0);\t\t\r\n\t\ttry {\r\n\t\t\ttransferValidationUnit.validate(accountTransferRequest);\r\n\t\t} catch (ValidationException e) {\r\n\t\t\tAssert.fail(\"Found_Exception\");\r\n\t\t}\r\n\t}", "protected void acceptedPaymentVerification() {\n BillingSummaryPage.tableBillingGeneralInformation.getRow(1)\n .getCell(\"Current Due\").waitFor(cell -> !cell.getValue().equals(\"Calculating...\"));\n\n assertThat(BillingSummaryPage.tableBillingGeneralInformation.getRow(1))\n .hasCellWithValue(\"Current Due\", BillingHelper.DZERO.toString())\n .hasCellWithValue(\"Total Due\", BillingHelper.DZERO.toString())\n .hasCellWithValue(\"Total Paid\", modalPremiumAmount.get().toString());\n\n assertThat(BillingSummaryPage.tableBillsAndStatements.getRow(1).getCell(\"Status\")).valueContains(PAID_IN_FULL);\n\n assertThat(BillingSummaryPage.tablePaymentsOtherTransactions)\n .with(POLICY_NUMBER, masterPolicyNumber.get())\n .with(TYPE, PAYMENT)\n .with(TableConstants.BillingPaymentsAndTransactionsGB.AMOUNT, String.format(\"(%s)\", modalPremiumAmount.get().toString()))\n .containsMatchingRow(1);\n\n }", "@Override\r\n\tpublic boolean fundTransfer(FundTransferBean fb, double amount) {\n\t\tboolean isValid = true;\r\n\t\tfor (CustomerBean cb1 : customerList) {\r\n\t\t\tif(cb1.getPhoneNum()== fb.getSourcePhoneNum()) {\r\n\t\t\t\tfor (CustomerBean cb2 : customerList) {\r\n\t\t\t\t\tif(cb2.getPhoneNum()==fb.getDesPhoneNum()) {\r\n\t\t\t\t\t\twithdraw(cb1,amount);\r\n\t\t\t\t\t\tdeposit(cb2,amount);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthrow new WalletException();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn isValid;\r\n\t}", "@Override\n\tpublic boolean applyWorkPermit() {\n\t\tboolean isSuccess = InternationalStudent.passBySuccessRate((float) 0.6);\n\t\tif (isSuccess) {\n\t\t\tthis.hasWorkPermit = true;\n\t\t}\n\t\treturn isSuccess;\n\t}", "protected boolean isTransferTransactionValid(StateTransferTransaction tr) {\n\t\tString fromAddressPublicKey = ((StateTransferTransaction)tr).from;\n\t\tString toAddressPublicKey = ((StateTransferTransaction)tr).to;\t\t\t\t\n\t\tdouble amount = ((StateTransferTransaction)tr).amount;\n\t\tint nonce = ((StateTransferTransaction)tr).getNonce();\n\t\t\t\n\t\t// getting the fromAccount to be modified\n\t\tAccountInterface accountFromModify = null;\n\t\tint accountFromModifyFound = 0;\n\t\tboolean accountFromIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(fromAddressPublicKey)){\n\t\t\t\taccountFromModify = account;\n\t\t\t\taccountFromModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountFromModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"more than one matching account has been found at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountFromModifyFound == 1) {\n\t\t\tif (tr.getNonce() != accountFromModify.getNonce() + 1) {\n\t\t\t\t// error -> nonce not matching -> pssible replay attack\n\t\t\t\tServiceBus.logger.log(\"Nonce is not valid at transaction, possible replay aatack\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\t\t\t\t\n\t\t\t\tif (accountFromModify.getBalance() < amount){\n\t\t\t\t\t// not enoguh fund on the account\n\t\t\t\t\tServiceBus.logger.log(\"Not enoguh fund on the account at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// all cool but still not return because the second account has to be checked as well\n\t\t\t\telse {\n\t\t\t\t\taccountFromIsGood = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}else if (accountFromModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The account from which you want to transfer the fund does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\n\t\t// getting the toAccount to be modified\n\t\tAccountInterface accountToModify = null;\n\t\tint accountToModifyFound = 0;\n\t\tboolean accountToIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(toAddressPublicKey)){\n\t\t\t\taccountToModify = account;\n\t\t\t\taccountToModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountToModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"More than one account is found at matching the transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountToModifyFound == 1) {\n\t\t\taccountToIsGood = true;\n\t\t\t\t\n\t\t}else if (accountToModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The to account does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// transfer is only possible if the asset type is the same, otherwise it is an exchange\n\t\tif (!accountToModify.getAssetType().equals(accountFromModify.getAssetType())){\n\t\t\t// error, from and to asset type must be the same\n\t\t\tServiceBus.logger.log(\"From and to asset type must be the same, TrID : \" + tr.getTransctionId(), Severity.WARNING);\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\t\t\t\n\t\t// final check if all good return true\n\t\tif (accountFromIsGood && accountToIsGood){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// default value\n\t\treturn false;\t\t\t\n\t}", "private static boolean hasFunds(double cost)\n {\n if (Clock.getRoundNum() < 200) { //TODO edit this out if necessary\n return rc.getTeamOre() > cost;\n } else {\n return rc.getTeamOre() > cost*2;\n }\n }", "public void succeededWithdraw(){\n\t\tstate = ATM_State.WITHDRAWALNOTIFICATION;\n\t\tgui.setDisplay(\"Withdrawal success.\");\n\t}", "public void receiveResultpFT_Member_Fund(\n com.xteam.tourismpay.PFTMXStub.PFT_Member_FundResponse result) {\n }", "protected boolean isTransferTransactionValidEx(StateTransferTransaction tr) {\n\t\tString fromAddressPublicKey = ((StateTransferTransaction)tr).from;\n\t\tString toAddressPublicKey = ((StateTransferTransaction)tr).to;\t\t\t\t\n\t\tdouble amount = ((StateTransferTransaction)tr).amount;\n\t\tint nonce = ((StateTransferTransaction)tr).getNonce();\n\t\t\t\n\t\t// getting the fromAccount to be modified\n\t\tAccountInterface accountFromModify = null;\n\t\tint accountFromModifyFound = 0;\n\t\tboolean accountFromIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(fromAddressPublicKey)){\n\t\t\t\taccountFromModify = account;\n\t\t\t\taccountFromModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountFromModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"more than one matching account has been found at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountFromModifyFound == 1) {\n\t\t\tif (tr.getNonce() != accountFromModify.getNonce() + 1) {\n\t\t\t\t// error -> nonce not matching -> pssible replay attack\n\t\t\t\tServiceBus.logger.log(\"Nonce is not valid at transaction, possible replay aatack\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\t\t\t\t\n\t\t\t\tif (accountFromModify.getBalance() < amount){\n\t\t\t\t\t// not enoguh fund on the account\n\t\t\t\t\tServiceBus.logger.log(\"Not enoguh fund on the account at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// all cool but still not return because the second account has to be checked as well\n\t\t\t\telse {\n\t\t\t\t\taccountFromIsGood = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}else if (accountFromModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The account from which you want to transfer the fund does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\n\t\t// getting the toAccount to be modified\n\t\tAccountInterface accountToModify = null;\n\t\tint accountToModifyFound = 0;\n\t\tboolean accountToIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(toAddressPublicKey)){\n\t\t\t\taccountToModify = account;\n\t\t\t\taccountToModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountToModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"More than one account is found at matching the transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountToModifyFound == 1) {\n\t\t\taccountToIsGood = true;\n\t\t\t\t\n\t\t}else if (accountToModifyFound == 0) {\n\t\t\t// to account can be added to the state, asset type logic is questionable\n\t\t\t\n\t\t\tAccountBase account = new AccountBase(\n\t\t\t\t\t((StateTransferTransaction)tr).from,\n\t\t\t\t\t((StateTransferTransaction)tr).getNonce(),\n\t\t\t\t\t\"\",\n\t\t\t\t\t((StateTransferTransaction)tr).amount,\n\t\t\t\t\taccountFromModify.getAssetType());\t\n\t\t\taccounts.add(account);\n\t\t\t\n\t\t\taccountToIsGood = true;\n\t\t}\n\t\t\n\t\t// transfer is only possible if the asset type is the same, otherwise it is an exchange\n\t\tif (!accountToModify.getAssetType().equals(accountFromModify.getAssetType())){\n\t\t\t// error, from and to asset type must be the same\n\t\t\tServiceBus.logger.log(\"From and to asset type must be the same, TrID : \" + tr.getTransctionId(), Severity.WARNING);\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\t\t\t\n\t\t// final check if all good return true\n\t\tif (accountFromIsGood && accountToIsGood){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// default value\n\t\treturn false;\t\t\t\n\t}", "@Test\n public void depositCheckingTest(){\n userC.deposit(200.00);\n assertEquals(\"Balance is now $500.00\", userC.getCurrentBalance(), 500.00, DELTA);\n }", "@When(\"^the value of the deposit is true$\")\n public void the_value_of_the_deposit_is_true() throws Throwable {\n throw new PendingException();\n }", "@Test\n\tpublic void testCheckSufficientCredits_True() {\n\n\t\tint creditsRequired = 1;\n\t\taccount.setCredits(10l);\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tSmsMessage msg = new SmsMessage();\n\t\tSmsTask smsTask = new SmsTask();\n\t\tsmsTask.setSakaiSiteId(SmsConstants.SMS_DEV_DEFAULT_SAKAI_SITE_ID);\n\t\tsmsTask.setSmsAccountId(account.getId());\n\t\tsmsTask.setDateCreated(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setDateToSend(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setStatusCode(SmsConst_DeliveryStatus.STATUS_PENDING);\n\t\tsmsTask.setAttemptCount(2);\n\t\tsmsTask.setMessageBody(SmsConstants.SMS_DEV_DEFAULT_SMS_MESSAGE_BODY);\n\t\tsmsTask.setSenderUserName(\"senderUserName\");\n\t\tsmsTask.setMaxTimeToLive(1);\n\t\tsmsTask.getSmsMessages().add(msg);\n\t\tsmsTask.setCreditEstimate(creditsRequired);\n\t\tmsg.setSmsTask(smsTask);\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertTrue(\"Expected sufficient credit\", sufficientCredits);\n\n\t\taccount.setCredits(0l);\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tboolean insufficientCredits = !smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertTrue(\"Expected insufficient credit\", insufficientCredits);\n\n\t}", "private boolean tryPay() {\n return new Random().nextInt(100) + 1 <= 50;\n }", "public void mutualFund(){\n\t\tSystem.out.println(\"HSBC BANK :: MUTUAL FUND\");\n\t}", "public boolean isValidTransfer(double amount) {\n boolean amt = amount >= 0;\n boolean bal = false;\n if (amount <= this.balance + 100 && this.balance > 0) {\n bal = true;\n }\n return amt && bal && !isFreeze();\n }", "@Override\r\n\tpublic boolean transferAmnt(int toAccNo, double money)\r\n\t\t\tthrows EwalletException {\n\t\tAccount ftTemp =new Account();\r\n\t\tif(temp.getCustBal()>=money) {\r\n\t\tftTemp = dao.loginuser(toAccNo);\r\n\t\tif(ftTemp!=null)\r\n\t\t{\r\n\t\t\tftTemp.setCustBal(ftTemp.getCustBal()+money);\r\n\t\t\ttemp.setCustBal(temp.getCustBal()-money);\r\n\t\t\ttemp.settDetails(\"Date :\"+tDate+\" Amount Transfered :\"+money+\" To Acc No: \"+ftTemp.getAccNum()+\" Total Balance :\"+temp.getCustBal());\r\n\t\t\tftTemp.settDetails(\"Date :\"+tDate+\" Depsoited Amount :\"+money+\" From Acc No: \"+temp.getAccNum()+\" Total Balance :\"+ftTemp.getCustBal());\r\n\t\t\tdao.updatedetails(temp.getAccNum(), temp);\r\n\t\t\tdao.updatedetails(ftTemp.getAccNum(), ftTemp);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\telse if(temp.getCustBal()<money)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Low Balance to transfer\");\r\n\t\t}\r\n\t\t\r\n\t\telse\r\n\t\t\tSystem.out.println(\"No such user account\");\r\n\t\treturn false;\r\n\t}", "@Test\n public void testSuccessTransferFundDifferentCcy() throws IOException, URISyntaxException {\n URI uri = builder.setPath(\"/transfers\").build();\n BigDecimal amount = new BigDecimal(100).setScale(4, RoundingMode.HALF_EVEN);\n\n HttpPost request = new HttpPost(uri);\n request.setHeader(\"Content-type\", \"application/json\");\n request.setEntity(new StringEntity(mapper.writeValueAsString(new MoneyTransfer(amount, 1L, 2L))));\n HttpResponse response = client.execute(request);\n\n assertTrue(response.getStatusLine().getStatusCode() == 200);\n }", "@Test\n public void binDebitTest() {\n assertFalse(authResponse.isBinDebit());\n }", "@Test\n public void withdrawCheckingTest(){\n userC.withdraw(200.00);\n assertEquals(\"Balance is now $100.00\", userC.getCurrentBalance(), 100.00, DELTA);\n }", "public int checkEND(int amount, boolean burnStun);", "@Test\n public void testWithdraw() {\n System.out.println(\"withdraw\");\n double d = 1.0;\n Account instance = new Account(\"Piper\", 10.0);\n double expResult = 9.0;\n double result = instance.withdraw(d);\n assertEquals(expResult, result, 0.0);\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"The test case is a prototype.\");\n }", "public boolean sendMoney(BigDecimal amount, BankAccount toAccount){\n //check if balance can cover that transfer\n if(!mIsActive || balance.compareTo(amount)<0){\n //account not active or insufficient funds\n return false;\n }\n //take out of balance\n balance = balance.subtract(amount);\n //check that the receiver received the amount\n toAccount.deposit(amount);\n //success! return true\n return true;\n }", "public boolean getSuccess() {\n return (transactionFailure == null && amountConverted != null);\n }", "public boolean transfer(double total, String sender, String receiver) {\n\n }", "public boolean transferFunds (int secretKey, double amtToTransfer) {\n\n int sourceBankAccountNumber; // account FROM which to transfer\n int targetBankAccountNumber; // account TO which to transfer\n\n // use secretKey to obtain AccountLink, which will contains the\n // source and target BankAccount numbers\n AccountLink theAccountLink = hashMapOfSecretKeys.get(secretKey);\n\n if ( theAccountLink != null ) { // i.e. secretKey was valid\n\n sourceBankAccountNumber = theAccountLink.getAGENT_ACCOUNT_NUMBER();\n targetBankAccountNumber = theAccountLink.getAH_ACCOUNT_NUMBER();\n\n } else { // secretKey appears invalid; no transfer possible\n return false;\n }\n\n // use account numbers to get full BankAccounts\n BankAccount sourceBankAccount =\n hashMapOfAllAccts.get(sourceBankAccountNumber);\n BankAccount targetBankAccount =\n hashMapOfAllAccts.get(targetBankAccountNumber);\n\n // ask source BankAccount to delete amtToTransfer (if possible)\n // This effects a transfer only if frozen funds >= amtToTransfer\n boolean fundsTakenFromSource =\n sourceBankAccount.decreaseFrozenAndBalance(amtToTransfer);\n\n // if funds were able to be taken from source, then add amt to target\n if ( fundsTakenFromSource ) {\n targetBankAccount.increaseTotalBalance(amtToTransfer);\n updateBankDisplay();\n } else {\n return false; // b/c funds could not be taken from source\n }\n\n return true;\n }", "public static void INTTransfer_Insufficientbalance() {\n\n try {\n clickHarmburgerMenuBTN();\n clickTransferBTN();\n clickIntertnational();\n internationalFundTransfer();\n waitToElement(\"//android.widget.TextView[@text='Insufficient balance.']\");\n\n MobileElement insufficientMSG = driver.findElement(By.xpath(\"//android.widget.TextView[@text='Insufficient balance.']\"));\n verifyElementIsDisplayed(insufficientMSG, \"Insufficient Balance\");\n clickCancelButton();\n\n } catch (Exception e) {\n ReportHelper.logReportStatus(LogStatus.FAIL, \"unable to verify the message\" + e.getMessage());\n }\n\n\n }", "public boolean transferMoney(Account fromAcct, Account toAcct, DollarAmount amount,\n long timeout, TimeUnit unit)\n throws DollarAmount.InsufficientFundsException, InterruptedException {\n long stopTime = System.nanoTime() + unit.toNanos(timeout);\n\n for (; ; ) {\n if (fromAcct.lock.tryLock()) {\n try {\n if (toAcct.lock.tryLock()) {\n try {\n if (fromAcct.getBalance().compareTo(amount) < 0) {\n throw new DollarAmount.InsufficientFundsException();\n } else {\n fromAcct.debit(amount);\n toAcct.credit(amount);\n return true;\n }\n } finally {\n toAcct.lock.unlock();\n }\n }\n } finally {\n fromAcct.lock.unlock();\n }\n }\n\n if (System.nanoTime() > stopTime)\n return false;\n\n// TimeUnit.NANOSECONDS.sleep(fixedDelay + rnd.nextLong() % randMod);\n }\n }", "private void reportTransactionStatus(boolean success){\n if(success){\n sendMessage(\"<st>\");\n }else{\n sendMessage(\"<f>\");\n }\n }", "Boolean checkAccountHasSufficientBalance(PrintWriter out, Account from, Double amount);", "public void successful(int price, int balance) {\n System.out.println(\"De vragenlijst is succesvol toegevoegd aan uw vragenlijst collectie. \" +\n \"Het aankoopbedrag is afgeschreven van uw saldo. Uw aankoopbedrag was: \"\n + price + \". Uw saldo is verlaagd van \" + (balance + price) + \" naar \" + balance);\n }", "@Test\n\tpublic void moneyTrnasferExcetionAccountNumberWrong() {\n\t\t\n\t\tint accountNumberNotExist = 1820;\n\t\tString accountNumberTo = createAccount(\"ram\",2000);\n\t\tdouble amountToBeTranfered = 40000.0;\n\t\tMoneyTransfer moneyTransfer = new MoneyTransfer();\n\t\tmoneyTransfer.setAccountNumberFrom(accountNumberNotExist);\n\t\tmoneyTransfer.setAccountNumberTo(Integer.parseInt(accountNumberTo));\n\t\tmoneyTransfer.setAmount(amountToBeTranfered);\n\t\t\n\t\tString requestBody = gson.toJson(moneyTransfer);\n\t\t\n\t\tRequestSpecification request = RestAssured.given();\n\t\trequest.body(requestBody);\n\t\tResponse response = request.put(\"/transfer\");\n\t\t\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - START\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"Account not found with Account Number : \");\n\t\tsb.append(accountNumberNotExist);\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - END\n\t\t\n\t\tAssertions.assertEquals(sb.toString(), response.asString());\n\t\t\n\t}", "public boolean withdrawal (double amount) \r\n {\r\n\r\n boolean result = false;\r\n\r\n if ( ! super.withdrawal (amount) ) \r\n {\r\n System.out.println (\"Using overdraft...\");\r\n if ( ! overdraft.withdrawal (amount-balance) )\r\n System.out.println (\"Overdraft source insufficient.\");\r\n else {\r\n balance = 0;\r\n System.out.println (\"Current Balance on account \" + account + \": \" + balance);\r\n result = true;\r\n }\r\n }\r\n System.out.println ();\r\n\r\n return result;\r\n\r\n }", "@Test\n void executeMoneyTransfer() throws ParseException, JsonProcessingException {\n\n String idAccount = \"14537780\";\n String receiverName = \"Receiver Name\";\n String description = \"description text\";\n String currency = \"EUR\";\n String amount = \"100\";\n String executionDate = \"2020-12-12\";\n MoneyTransfer moneyTransfer = Utils.fillMoneyTransfer(idAccount, receiverName, description, currency, amount, executionDate);\n\n Response response = greetingWebClient.executeMoneyTransfer(moneyTransfer, idAccount);\n assertTrue(response.getStatus().equals(\"KO\"));\n\n\n }", "@Test\n public void testSuccessWithDrawSufficientFund() throws IOException, URISyntaxException {\n URI uri = builder.setPath(\"/accounts/1/withdraw/10\").build();\n\n HttpPut request = new HttpPut(uri);\n request.setHeader(\"Content-type\", \"application/json\");\n HttpResponse response = client.execute(request);\n int statusCode = response.getStatusLine().getStatusCode();\n assertTrue(statusCode == 200);\n\n assertTrue(mapper.readValue(EntityUtils.toString(response.getEntity()), AccountDetails.class).getAccountBalance()\n .equals(new BigDecimal(100).setScale(4, RoundingMode.HALF_EVEN)));\n\n }", "public void transferToChecking(double amount){\n withdrawSavings(amount);\r\n depositChecking(amount);\r\n }", "@Test\n\tpublic void testDeductMoney() {\n\t\tcard.addMoney(500);\n\t\tcard.deductMoney(200);\n\t\tassertEquals(400.0, card.getBalance());\n\t}", "@Test\n public void testValidBalance() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 100 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(100, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testDeposit() {\n System.out.println(\"deposit\");\n double d = 1.0;\n Account instance = new Account(\"Piper\", 10.0);\n double expResult = 11.0;\n double result = instance.deposit(d);\n assertEquals(expResult, result, 0.0);\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\tpublic void testCheckSufficientCredits_False() {\n\n\t\tint creditsRequired = 11;\n\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertFalse(\"Expected insufficient credit\", sufficientCredits);\n\t}", "@Test\r\n\tpublic void testTransferAmountZero() {\r\n\t\tAccountTransferRequest accountTransferRequest = new AccountTransferRequest();\r\n\t\taccountTransferRequest.setUsername(VALID_USERNAME);\r\n\t\taccountTransferRequest.setPassword(VALID_PASSWORD);\r\n\t\taccountTransferRequest.setSenderAccount(\"123456\");\r\n\t\taccountTransferRequest.setReceiverAccount(\"123456\");\r\n\t\taccountTransferRequest.setTransferAmount(0.0);\t\t\r\n\t\ttry {\r\n\t\t\ttransferValidationUnit.validate(accountTransferRequest);\r\n\t\t\tAssert.fail(\"Exception_Expected\");\r\n\t\t} catch (ValidationException exception) {\r\n\t\t\tAssert.assertNotNull(exception);\r\n\t\t\tAssert.assertEquals(\"transferAmount_Cannot_Be_Negative_Or_Zero\", exception.getMessage());\r\n\r\n\t\t}\r\n\t}", "if(true==adhocTicket.isPaid()){\n System.out.println(\"isPaid() is passed\");\n }", "@Override\n\tpublic void transferBalnace() {\n\t\tSystem.out.println(\"balance is transferd\");\n\t}", "@Test\n\tpublic void testWithdraw(){\n\t\t\n\t\t// Arrange\n\t\tBigDecimal amountToWithdraw = new BigDecimal(10.00);\n\t\tBigDecimal expectedBalance = new BigDecimal(110.5);\n\t\tdouble delta = 1e-3;\n\t\t// Act\n\t\tcurrentAccount.withdraw(amountToWithdraw);\n\t\tBalance actualBalance = currentAccount.checkBalance();\n\t\t\n\t\t// Assert\n\t\tassertEquals(expectedBalance.doubleValue(), actualBalance.getAmount().doubleValue(), delta);\n\t}", "boolean deposit(UUID name, double amount);", "@Test\r\n void enoughFunds() {\n BankAccount account = new BankAccount(100);\r\n \r\n // Assertion for no exceptions\r\n assertDoesNotThrow(() -> account.withdraw(100));\r\n }", "@Test\n public void testAmountLeftToPay() {\n //Just ensure that the first two digits are the same\n assertEquals(expectedResults.getAmountLeftToPay(), results.getAmountLeftToPay(), 0.15);\n }", "public boolean checkpay(){\n return pay;\n }", "public abstract Response makeTransfer(Transaction transaction) throws AccountNotFoundException, InsufficientFundsException;", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean CanBuySettlement();", "public boolean verifyPaymentTrasaction(ExtentTest extentedReport) throws Exception {\n\t\ttry {\n\t\t\tWaitUtils.waitForSpinner(driver);\n\t\t\tWaitUtils.waitForElementPresent(driver, txt_paymntRef, \"Failed to get payment reference id after payment\");\n\t\t\tLog.message(\"Payment reference number : \" + txt_paymntRef.getText(), extentedReport);\n\t\t\treturn (Integer.parseInt(txt_paymntRef.getText()) > 0);\n\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(\"Trasaction was not successful, failed to fetch the transaction id \" + e);\n\t\t}\n\n\t}", "public String fundmethod() throws InterruptedException \r\n\t\t{\r\n\t\t\tfund.click();\r\n\t\t\tThread.sleep(3000);\r\n\t\t\tString actual =fund.getText(); \r\n\t\t\tSystem.out.println(actual);\r\n\t\t\t//String expected =\"Funds\";\r\n\t\t\t//Assert.assertEquals(actual,expected);\r\n\t\t\treturn actual;\r\n\t\t\r\n\t\t\r\n\t\t}", "boolean isSuccessful();", "@Test\n public void withdrawTest() {\n\n WithdrawRequest withdrawRequest = WithdrawRequest.newBuilder()\n .setAccountNumber(7)\n .setAmount(40)\n .build();\n\n // this call waits for the response from the server\n this.blockingStub.withdraw(withdrawRequest)\n .forEachRemaining(money -> System.out.println(\"\\n\\tReceived : $\" + money.getValue()));\n }", "@Test\n public void test2() {\n cashRegister.addTens(5);\n try {\n cashRegister.withdraw(0, 5);\n fail();\n } catch (InsufficientCashException e) {\n assertEquals(e.getMessage(), \"Not enough denominations\");\n }\n }", "@Test\n public void test1() throws Throwable {\n SitNFe sitNFe0 = SitNFe.COM_DANFE;\n boolean boolean0 = sitNFe0.isReenviar();\n assertEquals(false, boolean0);\n }", "boolean completeTransaction(String amount) throws PreAuthFailure {\n String store_id = \"store5\"; // TestAPI, switch when in production\n String api_token = \"yesguy\";// TestAPI, switch when in production.\n String crypt = \"7\"; //TODO: Check if right crypt to be using.\n String storeName = \"PayGuard\"; // Must be <= 13 char.\n String processing_country_code = \"CA\";\n boolean status_check = false; //TODO: Should change this to true and test.\n\n Completion completion = new Completion();\n completion.setOrderId(orderId);\n completion.setCompAmount(amount);\n completion.setTxnNumber(token.getTxnNumber());\n completion.setCryptType(crypt);\n completion.setDynamicDescriptor(storeName);\n\n HttpsPostRequest mpgReq = new HttpsPostRequest();\n mpgReq.setProcCountryCode(processing_country_code);\n mpgReq.setTestMode(true); //false or comment out this line for production transactions\n mpgReq.setStoreId(store_id);\n mpgReq.setApiToken(api_token);\n mpgReq.setTransaction(completion);\n mpgReq.setStatusCheck(status_check);\n mpgReq.send();\n\n try\n {\n Receipt receipt = mpgReq.getReceipt();\n if(receipt.getComplete().equalsIgnoreCase(\"false\")){\n throw new PreAuthFailure(\"Token failed completion: \" + receipt.getMessage());\n }\n return true;\n }\n catch (Exception e)\n {\n throw new PreAuthFailure(\"Token failed completion: \" + e.toString());\n }\n }", "@Test\n public void testNotEnoughCash() throws Exception {\n\n // login with sufficient rights\n shop.login(admin.getUsername(), admin.getPassword());\n\n // trying to pay for a sale with insufficient funds\n assertEquals(-1, shop.receiveCashPayment(saleId, toBePaid-1), 0.001);\n\n // verify sale did not change state to PAID/COMPLETED\n assertFalse(isTransactionInAccountBook(saleId));\n\n // verify system's balance did not change\n assertEquals(totalBalance, shop.computeBalance(), 0.001);\n }", "@Test\n public void testGiveChange() throws Exception {\n System.out.println(\"giveChange\");\n //CashRegister instance = new CashRegister();\n assertEquals(0.0, instance.giveChange(), EPSILON);\n instance.scanItem(0.55);\n instance.scanItem(1.27);\n double expResult = 0.18;\n instance.collectPayment(Money.QUARTER, 8);\n double result = instance.giveChange();\n assertEquals(expResult, result, EPSILON);\n \n }", "boolean hasTotalBet();", "boolean hasTotalBet();", "@Test\r\n\tpublic void withdraw() {\n\t\tResult<String> loanWithdraw = qddPaymentService.loanWithdraw(141227113319030002L);\r\n\t\tSystem.out.println(loanWithdraw);\r\n\t}", "@Test\n\tpublic void testDebitCard() {\n\t\tassertEquals(100.0, card.getBalance());\n\t}", "@Test\n public void testPayCompletedSale() throws Exception {\n\n // login with sufficient rights\n shop.login(admin.getUsername(), admin.getPassword());\n\n // pay for sale so it is in state PAID/COMPLETED\n assertEquals(0, shop.receiveCashPayment(saleId, toBePaid), 0.001);\n totalBalance += toBePaid;\n\n // try to pay for sale second time returns -1\n assertEquals(-1, shop.receiveCashPayment(saleId, toBePaid), 0.001);\n\n // verify sale remains in state PAID/COMPLETED\n assertTrue(isTransactionInAccountBook(saleId));\n\n // verify system's balance did not update a second time\n assertEquals(totalBalance, shop.computeBalance(), 0.001);\n }", "@Test\n\tpublic void testCase3()\n\t{\n\t\tString caseType=\"silicone\";\n\t\tint numberOfCases=10;\n\t\tfloat amount=BillEstimation.fareCalculation(caseType,numberOfCases);\n\t\tSystem.out.println(\"Bill amount\"+amount);\n\t\tAssert.assertEquals(5000.1f,amount,0.2f); \n\t\t/*\n\t\t * Assert.assertEquals(expected, actual, delta) delta is how long the actual\n\t\t * value differs from expected\n\t\t */\n\t}", "private static void deposite (double amount) {\n double resultDeposit = balance + amount;\r\n System.out.println(\"Deposit successful.\\nCurrent balance: \" + \"$\" + resultDeposit+ \".\");\r\n }" ]
[ "0.70070654", "0.6780822", "0.66709435", "0.6628549", "0.65709496", "0.65639096", "0.653701", "0.64976466", "0.6489428", "0.6432896", "0.6411856", "0.63567793", "0.63453937", "0.629159", "0.6285827", "0.62759197", "0.626677", "0.625796", "0.6215692", "0.6204952", "0.62008417", "0.61716205", "0.6165495", "0.6163366", "0.6151916", "0.61316675", "0.61140126", "0.60767144", "0.6066912", "0.6048559", "0.60423285", "0.6031407", "0.60109", "0.59993505", "0.59972703", "0.5981756", "0.59758604", "0.59688133", "0.59500414", "0.59338903", "0.5931591", "0.5913046", "0.5880546", "0.5871661", "0.5860679", "0.5859268", "0.58333987", "0.5832755", "0.58277327", "0.58185935", "0.58075315", "0.58066434", "0.5800403", "0.5799578", "0.5796951", "0.57899463", "0.5787816", "0.5778173", "0.57779956", "0.57767785", "0.57671523", "0.57638854", "0.57637656", "0.5762941", "0.57452714", "0.57432103", "0.5733196", "0.57243556", "0.5711691", "0.5697841", "0.56962246", "0.5695021", "0.56834143", "0.5677044", "0.5672252", "0.56674623", "0.5659351", "0.5659351", "0.5659351", "0.5659351", "0.5659351", "0.5659351", "0.5659351", "0.5658985", "0.5650508", "0.5645061", "0.56289333", "0.56288636", "0.5622504", "0.56178635", "0.56116724", "0.56069034", "0.5602664", "0.56011194", "0.56011194", "0.55943", "0.5585632", "0.5584546", "0.5583266", "0.55797845" ]
0.6503305
7
Test success transfer fund insufficient fund.
@Test public void testSuccessTransferFundInsufficientFund() throws IOException, URISyntaxException { URI uri = builder.setPath("/transfers").build(); BigDecimal amount = new BigDecimal(100000).setScale(4, RoundingMode.HALF_EVEN); HttpPost request = new HttpPost(uri); request.setHeader("Content-type", "application/json"); request.setEntity(new StringEntity(mapper.writeValueAsString(new MoneyTransfer(amount, 1L, 4L)))); HttpResponse response = client.execute(request); int statusCode = response.getStatusLine().getStatusCode(); assertTrue(statusCode == 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testImpossible1TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0000\");\n AccountOfUser acc2 = new AccountOfUser(0, \"0000 0000 0000 0001\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n bank.addAccountToUser(user.getPassport(), acc2);\n assertThat(bank.transferMoney(user.getPassport(), acc.getRequisites(), user.getPassport(), acc2.getRequisites(), 100), is(false));\n }", "@Test\n\tpublic void moneyTrnasferExcetionInsufficientBalanceOfFromAccount() {\n\t\t\n\t\tString accountNumberFrom = createAccount(\"krishna\",4000);\n\t\tString accountNumberTo = createAccount(\"ram\",2000);\n\t\tdouble amountToBeTranfered = 40000.0;\n\t\tMoneyTransfer moneyTransfer = new MoneyTransfer();\n\t\tmoneyTransfer.setAccountNumberFrom(Integer.parseInt(accountNumberFrom));\n\t\tmoneyTransfer.setAccountNumberTo(Integer.parseInt(accountNumberTo));\n\t\tmoneyTransfer.setAmount(amountToBeTranfered);\n\t\t\n\t\tString requestBody = gson.toJson(moneyTransfer);\n\t\t\n\t\tRequestSpecification request = RestAssured.given();\n\t\trequest.body(requestBody);\n\t\tResponse response = request.put(\"/transfer\");\n\t\t\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - START\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"Account Number - \");\n\t\tsb.append(accountNumberFrom);\n\t\tsb.append(\" do not have sufficient amout to transfer.\");\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - END\n\t\t\n\t\tAssertions.assertEquals(sb.toString(), response.asString());\n\t\t\n\t}", "@Test\n\tpublic void moneyTrnasferSucess() {\n\t\t\n\t\tString accountNumberFrom = createAccount(\"krishna\",4000);\n\t\tString accountNumberTo = createAccount(\"ram\",2000);\n\t\tdouble amountToBeTranfered = 500.0;\n\t\tMoneyTransfer moneyTransfer = new MoneyTransfer();\n\t\tmoneyTransfer.setAccountNumberFrom(Integer.parseInt(accountNumberFrom));\n\t\tmoneyTransfer.setAccountNumberTo(Integer.parseInt(accountNumberTo));\n\t\tmoneyTransfer.setAmount(amountToBeTranfered);\n\t\t\n\t\tString requestBody = gson.toJson(moneyTransfer);\n\t\t\n\t\tRequestSpecification request = RestAssured.given();\n\t\trequest.body(requestBody);\n\t\tResponse response = request.put(\"/transfer\");\n\t\t\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - START\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(amountToBeTranfered);\n\t\tsb.append(\" has been transferred to : \");\n\t\tsb.append(accountNumberTo);\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - END\n\t\t\n\t\tAssertions.assertEquals(sb.toString(), response.asString());\n\t\t\n\t}", "@Test\n public void testImpossible2TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0001\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n assertThat(bank.transferMoney(user.getPassport(), \"0000 0000 0000 0000\", user.getPassport(), acc.getRequisites(), 100), is(false));\n }", "private boolean DeriveStockWith_FundIsAvailable() {\n\t\tif (getFunds() > 0) {\n\t\t\tif (calculateInputStock_Items() > getFunds()) {\n\t\t\t\tSystem.err.println(\"Insufficient Funds, Cannot restock\");\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t\t// available funds can accommodate input stock requirement\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.err.println(\"Insufficient Funds\");\n\t\t}\n\t\treturn false;\n\t}", "@Test\n public void testImpossible3TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(1000, \"0000 0000 0000 0000\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n assertThat(bank.transferMoney(user.getPassport(), acc.getRequisites(), user.getPassport(), \"0000 0000 0000 0001\", 100), is(false));\n }", "@Test\r\n\tpublic void testTransferAmountNegative() {\r\n\t\tAccountTransferRequest accountTransferRequest = new AccountTransferRequest();\r\n\t\taccountTransferRequest.setUsername(VALID_USERNAME);\r\n\t\taccountTransferRequest.setPassword(VALID_PASSWORD);\r\n\t\taccountTransferRequest.setSenderAccount(\"123456\");\r\n\t\taccountTransferRequest.setReceiverAccount(\"123456\");\r\n\t\taccountTransferRequest.setTransferAmount(-100.0);\r\n\t\ttry {\r\n\t\t\ttransferValidationUnit.validate(accountTransferRequest);\r\n\t\t\tAssert.fail(\"Exception_Expected\");\r\n\t\t} catch (ValidationException exception) {\r\n\t\t\tAssert.assertNotNull(exception);\r\n\t\t\tAssert.assertEquals(\"transferAmount_Cannot_Be_Negative_Or_Zero\", exception.getMessage());\r\n\r\n\t\t}\r\n\t}", "public static void INTTransfer_Insufficientbalance() {\n\n try {\n clickHarmburgerMenuBTN();\n clickTransferBTN();\n clickIntertnational();\n internationalFundTransfer();\n waitToElement(\"//android.widget.TextView[@text='Insufficient balance.']\");\n\n MobileElement insufficientMSG = driver.findElement(By.xpath(\"//android.widget.TextView[@text='Insufficient balance.']\"));\n verifyElementIsDisplayed(insufficientMSG, \"Insufficient Balance\");\n clickCancelButton();\n\n } catch (Exception e) {\n ReportHelper.logReportStatus(LogStatus.FAIL, \"unable to verify the message\" + e.getMessage());\n }\n\n\n }", "@Test\r\n\tpublic void testTransferAmountZero() {\r\n\t\tAccountTransferRequest accountTransferRequest = new AccountTransferRequest();\r\n\t\taccountTransferRequest.setUsername(VALID_USERNAME);\r\n\t\taccountTransferRequest.setPassword(VALID_PASSWORD);\r\n\t\taccountTransferRequest.setSenderAccount(\"123456\");\r\n\t\taccountTransferRequest.setReceiverAccount(\"123456\");\r\n\t\taccountTransferRequest.setTransferAmount(0.0);\t\t\r\n\t\ttry {\r\n\t\t\ttransferValidationUnit.validate(accountTransferRequest);\r\n\t\t\tAssert.fail(\"Exception_Expected\");\r\n\t\t} catch (ValidationException exception) {\r\n\t\t\tAssert.assertNotNull(exception);\r\n\t\t\tAssert.assertEquals(\"transferAmount_Cannot_Be_Negative_Or_Zero\", exception.getMessage());\r\n\r\n\t\t}\r\n\t}", "@Test\n public void holdTest() {\n\n PaymentDto paymentDto = initPayment(inAccountId, outAccountId, \"700\");\n\n final String firstPaymentId = paymentDto.getId();\n\n paymentDto = authorizePayment(firstPaymentId, 200);\n\n assertEquals(\"Payment status AUTHORIZED\", PaymentStatus.AUTHORIZED, paymentDto.getStatus());\n\n\n //init and authorize second payment, but there is 700 cents of 1000 withhold - ERROR: WITHDRAW_NO_FUNDS\n\n paymentDto = initPayment(inAccountId, outAccountId, \"700\");\n\n final String secondPaymentId = paymentDto.getId();\n\n paymentDto = authorizePayment(secondPaymentId, 200);\n\n assertEquals(\"Payment status ERROR\", PaymentStatus.ERROR, paymentDto.getStatus());\n\n assertEquals(\"Error reason WITHDRAW_NO_FUNDS\", new Integer(ErrorCode.WITHDRAW_NO_FUNDS.getCode()), paymentDto.getErrorReason());\n\n\n //confirm first payment - OK\n\n paymentDto = confirmPayment(firstPaymentId, 200);\n\n assertEquals(\"Payment status CONFIRMED\", PaymentStatus.CONFIRMED, paymentDto.getStatus());\n\n\n //confirm second payment, which was filed on authorization - still got ERROR: WITHDRAW_NO_FUNDS\n\n paymentDto = confirmPayment(secondPaymentId, 200);\n\n assertEquals(\"Payment status ERROR\", PaymentStatus.ERROR, paymentDto.getStatus());\n\n assertEquals(\"Error reason WITHDRAW_NO_FUNDS\", new Integer(ErrorCode.WITHDRAW_NO_FUNDS.getCode()), paymentDto.getErrorReason());\n\n }", "@Test\n\tpublic void testCheckSufficientCredits_OverdraftFacility() {\n\n\t\tint creditsRequired = 11;\n\n\t\tSmsMessage msg = new SmsMessage();\n\t\tSmsTask smsTask = new SmsTask();\n\t\tsmsTask.setSakaiSiteId(SmsConstants.SMS_DEV_DEFAULT_SAKAI_SITE_ID);\n\t\tsmsTask.setSmsAccountId(account.getId());\n\t\tsmsTask.setDateCreated(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setDateToSend(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setStatusCode(SmsConst_DeliveryStatus.STATUS_PENDING);\n\t\tsmsTask.setAttemptCount(2);\n\t\tsmsTask.setMessageBody(SmsConstants.SMS_DEV_DEFAULT_SMS_MESSAGE_BODY);\n\t\tsmsTask.setSenderUserName(\"senderUserName\");\n\t\tsmsTask.setMaxTimeToLive(1);\n\t\tsmsTask.getSmsMessages().add(msg);\n\t\tsmsTask.setCreditEstimate(creditsRequired);\n\t\tmsg.setSmsTask(smsTask);\n\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertFalse(\"Expected insufficient credit\", sufficientCredits);\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tsufficientCredits = smsBillingImpl.checkSufficientCredits(account\n\t\t\t\t.getId(), creditsRequired);\n\t\tAssert.assertTrue(\"Expected insufficient credit\", !sufficientCredits);\n\t}", "@Test\n public void proveraTransfera() {\n Account ivana = mobi.openAccount(\"Ivana\");\n Account pera = mobi.openAccount(\"Pera\");\n\n mobi.payInMoney(ivana.getNumber(), 5000.0);\n mobi.transferMoney(ivana.getNumber(), pera.getNumber(), 2000.0);\n //ocekujemo da nakon ovoga ivana ima 3000, a pera 2000\n\n SoftAssert sa = new SoftAssert();\n sa.assertEquals(ivana.getAmount(), 3000.0);\n sa.assertEquals(pera.getAmount(), 2000.0);\n\n sa.assertAll();\n }", "public void failedWithdraw(){\n\t\tstate = ATM_State.WITHDRAWALNOTIFICATION;\n\t\tgui.setDisplay(\"Invalid withdrawal amount.\");\n\t}", "@Test\n\tpublic void testWithdraw() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);;\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(01, \"acc1\", 00000, 50.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tArrayList<Account> expected = new ArrayList<>();\n\t\texpected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Withdrawl Successful\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"fail withdrawing $50 + fee\", testResult);\n\t}", "@Test\n\tpublic void testChargesNonStudent() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(01, \"acc1\", 00000, 50.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (acc1.currentBalance == 949.90) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"can not withdraw transaction charge (non student)\", testResult);\n\t}", "@Test\n public void testNotEnoughCash() throws Exception {\n\n // login with sufficient rights\n shop.login(admin.getUsername(), admin.getPassword());\n\n // trying to pay for a sale with insufficient funds\n assertEquals(-1, shop.receiveCashPayment(saleId, toBePaid-1), 0.001);\n\n // verify sale did not change state to PAID/COMPLETED\n assertFalse(isTransactionInAccountBook(saleId));\n\n // verify system's balance did not change\n assertEquals(totalBalance, shop.computeBalance(), 0.001);\n }", "@Test\n\tpublic void testCheckSufficientCredits_False() {\n\n\t\tint creditsRequired = 11;\n\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertFalse(\"Expected insufficient credit\", sufficientCredits);\n\t}", "@Test\n\tpublic void depositTest(){\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tAccount cAcc = new CurrentAccount(cus);\n\t\tbc.deposit(cAcc, 500, true);\n\t\tboolean flag = false;\n\t\tif(cAcc.getBalance() == 500.0){\n\t\t\tflag = true;\n\t\t}\n\t\tassertTrue(flag);\n\t}", "@Test\n\tpublic void testDeposit() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(04, \"acc1\", 00000, 100.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (outContent.toString().contains(\"Deposit Successful\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"unable to deposit money\", testResult);\n\t}", "@Test\n public void testSuccessTransferFundSufficientFund() throws IOException, URISyntaxException {\n URI uri = builder.setPath(\"/transfers\").build();\n BigDecimal amount = new BigDecimal(10).setScale(4, RoundingMode.HALF_EVEN);\n\n HttpPost request = new HttpPost(uri);\n request.setHeader(\"Content-type\", \"application/json\");\n request.setEntity(new StringEntity(mapper.writeValueAsString(new MoneyTransfer(amount, 1L, 4L))));\n HttpResponse response = client.execute(request);\n\n int statusCode = response.getStatusLine().getStatusCode();\n assertTrue(statusCode == 200);\n }", "protected boolean isTransferTransactionValidEx(StateTransferTransaction tr) {\n\t\tString fromAddressPublicKey = ((StateTransferTransaction)tr).from;\n\t\tString toAddressPublicKey = ((StateTransferTransaction)tr).to;\t\t\t\t\n\t\tdouble amount = ((StateTransferTransaction)tr).amount;\n\t\tint nonce = ((StateTransferTransaction)tr).getNonce();\n\t\t\t\n\t\t// getting the fromAccount to be modified\n\t\tAccountInterface accountFromModify = null;\n\t\tint accountFromModifyFound = 0;\n\t\tboolean accountFromIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(fromAddressPublicKey)){\n\t\t\t\taccountFromModify = account;\n\t\t\t\taccountFromModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountFromModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"more than one matching account has been found at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountFromModifyFound == 1) {\n\t\t\tif (tr.getNonce() != accountFromModify.getNonce() + 1) {\n\t\t\t\t// error -> nonce not matching -> pssible replay attack\n\t\t\t\tServiceBus.logger.log(\"Nonce is not valid at transaction, possible replay aatack\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\t\t\t\t\n\t\t\t\tif (accountFromModify.getBalance() < amount){\n\t\t\t\t\t// not enoguh fund on the account\n\t\t\t\t\tServiceBus.logger.log(\"Not enoguh fund on the account at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// all cool but still not return because the second account has to be checked as well\n\t\t\t\telse {\n\t\t\t\t\taccountFromIsGood = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}else if (accountFromModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The account from which you want to transfer the fund does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\n\t\t// getting the toAccount to be modified\n\t\tAccountInterface accountToModify = null;\n\t\tint accountToModifyFound = 0;\n\t\tboolean accountToIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(toAddressPublicKey)){\n\t\t\t\taccountToModify = account;\n\t\t\t\taccountToModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountToModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"More than one account is found at matching the transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountToModifyFound == 1) {\n\t\t\taccountToIsGood = true;\n\t\t\t\t\n\t\t}else if (accountToModifyFound == 0) {\n\t\t\t// to account can be added to the state, asset type logic is questionable\n\t\t\t\n\t\t\tAccountBase account = new AccountBase(\n\t\t\t\t\t((StateTransferTransaction)tr).from,\n\t\t\t\t\t((StateTransferTransaction)tr).getNonce(),\n\t\t\t\t\t\"\",\n\t\t\t\t\t((StateTransferTransaction)tr).amount,\n\t\t\t\t\taccountFromModify.getAssetType());\t\n\t\t\taccounts.add(account);\n\t\t\t\n\t\t\taccountToIsGood = true;\n\t\t}\n\t\t\n\t\t// transfer is only possible if the asset type is the same, otherwise it is an exchange\n\t\tif (!accountToModify.getAssetType().equals(accountFromModify.getAssetType())){\n\t\t\t// error, from and to asset type must be the same\n\t\t\tServiceBus.logger.log(\"From and to asset type must be the same, TrID : \" + tr.getTransctionId(), Severity.WARNING);\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\t\t\t\n\t\t// final check if all good return true\n\t\tif (accountFromIsGood && accountToIsGood){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// default value\n\t\treturn false;\t\t\t\n\t}", "@Test\n public void transferCheckingtoSavingsTest(){\n assertTrue(userC.transfer(150.00, userS));\n }", "@Test\n\tpublic void moneyTrnasferExcetionAccountNumberWrong() {\n\t\t\n\t\tint accountNumberNotExist = 1820;\n\t\tString accountNumberTo = createAccount(\"ram\",2000);\n\t\tdouble amountToBeTranfered = 40000.0;\n\t\tMoneyTransfer moneyTransfer = new MoneyTransfer();\n\t\tmoneyTransfer.setAccountNumberFrom(accountNumberNotExist);\n\t\tmoneyTransfer.setAccountNumberTo(Integer.parseInt(accountNumberTo));\n\t\tmoneyTransfer.setAmount(amountToBeTranfered);\n\t\t\n\t\tString requestBody = gson.toJson(moneyTransfer);\n\t\t\n\t\tRequestSpecification request = RestAssured.given();\n\t\trequest.body(requestBody);\n\t\tResponse response = request.put(\"/transfer\");\n\t\t\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - START\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"Account not found with Account Number : \");\n\t\tsb.append(accountNumberNotExist);\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - END\n\t\t\n\t\tAssertions.assertEquals(sb.toString(), response.asString());\n\t\t\n\t}", "@Test\n public void test2() {\n cashRegister.addTens(5);\n try {\n cashRegister.withdraw(0, 5);\n fail();\n } catch (InsufficientCashException e) {\n assertEquals(e.getMessage(), \"Not enough denominations\");\n }\n }", "@Test\r\n void enoughFunds() {\n BankAccount account = new BankAccount(100);\r\n \r\n // Assertion for no exceptions\r\n assertDoesNotThrow(() -> account.withdraw(100));\r\n }", "public void enoughForTransfer(double amount) throws BankException {\n if (this.currentAmount + amount > MAX_AMOUNT) {\n logger.warning(\"The amount in the receiving bank account cannot exceed 9 digits\");\n throw new BankException(\"The amount in the receiving bank account cannot exceed 9 digits\");\n }\n }", "public void transferedFunds(AuctionItem purchasedItem){\n Message<AuctionItem> message = new Message<>(Message.MessageIdentifier.\n TRANSFER_FUNDS,purchasedItem);\n Message<Integer> reply = sendMSG(message);\n if(reply != null){\n if(reply.getMessageIdentifier() == Message.MessageIdentifier.\n TRANSFER_SUCCESS){\n }else{\n System.out.println(\"Bank missing transfer funds\");\n }\n }\n }", "@Test\n\tpublic void withdrawTest(){\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tAccount cAcc = new CurrentAccount(cus);\n\t\tbc.withdraw(cAcc, 300);\n\t\tboolean flag = false;\n\t\tif(cAcc.getBalance() == -300.0){\n\t\t\tflag = true;\n\t\t}\n\t\tassertTrue(flag);\n\t}", "@Test\n void bankListIsAccountExistToTransfer_accountExistWithSufficientMoneyToTransfer_success() {\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut(new PrintStream(outContent));\n BankList bankList = new BankList(storage);\n Ui uiTest = new Ui();\n Bank newSavingAccount = new Saving(\"Test Saving Account\", 1000, 2000);\n Bank newInvestmentAccount = new Investment(\"Test Investment Account\", 1000);\n String expectedReturnType = \"investment\";\n\n try {\n bankList.bankListAddBank(newSavingAccount, uiTest);\n bankList.bankListAddBank(newInvestmentAccount, uiTest);\n outContent.reset();\n String returnType = bankList.getTransferBankType(\"Test Investment Account\",\n 500);\n assertEquals(expectedReturnType, returnType);\n\n\n } catch (BankException error) {\n System.out.println(\"Expected no throw, but error thrown\");\n }\n\n assertEquals(2, bankList.getBankListSize());\n\n }", "public boolean isValidTransfer(double amount) {\n boolean amt = amount >= 0;\n boolean bal = false;\n if (amount <= this.balance + 100 && this.balance > 0) {\n bal = true;\n }\n return amt && bal && !isFreeze();\n }", "@Test\r\n\tpublic void testValidationSuccess() {\r\n\t\tAccountTransferRequest accountTransferRequest = new AccountTransferRequest();\r\n\t\taccountTransferRequest.setUsername(VALID_USERNAME);\r\n\t\taccountTransferRequest.setPassword(VALID_PASSWORD);\r\n\t\taccountTransferRequest.setSenderAccount(VALID_SENDER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setReceiverAccount(VALID_RECEIVER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setTransferAmount(400.0);\t\t\r\n\t\ttry {\r\n\t\t\ttransferValidationUnit.validate(accountTransferRequest);\r\n\t\t} catch (ValidationException e) {\r\n\t\t\tAssert.fail(\"Found_Exception\");\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testDeductMoney() {\n\t\tcard.addMoney(500);\n\t\tcard.deductMoney(200);\n\t\tassertEquals(400.0, card.getBalance());\n\t}", "protected boolean withdraw(double amount)\n\t{\n\t\tif(amount>acc_balance)\n\t\t\treturn false;\n\t\t\n\t\t//else the deduction is done from balance and success message is passed\n\t\tacc_balance-=amount;\n\t\treturn true;\n\t}", "@Test\n\tpublic void testTransfer() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"acc2\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(02, \"acc1\", 00000, 200.00, \"\"));\n\t\ttransactions.add(2, new Transaction(02, \"acc2\", 00001, 200.00, \"\"));\n\t\ttransactions.add(3, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\t// ArrayList<Account> expected = new ArrayList();\n\t\t// expected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\t\t// expected.add(1, new Account(00001, \"acc2\", true, 1050.00, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Money Transfered\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"money not transfered\", testResult);\n\t}", "protected boolean isTransferTransactionValid(StateTransferTransaction tr) {\n\t\tString fromAddressPublicKey = ((StateTransferTransaction)tr).from;\n\t\tString toAddressPublicKey = ((StateTransferTransaction)tr).to;\t\t\t\t\n\t\tdouble amount = ((StateTransferTransaction)tr).amount;\n\t\tint nonce = ((StateTransferTransaction)tr).getNonce();\n\t\t\t\n\t\t// getting the fromAccount to be modified\n\t\tAccountInterface accountFromModify = null;\n\t\tint accountFromModifyFound = 0;\n\t\tboolean accountFromIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(fromAddressPublicKey)){\n\t\t\t\taccountFromModify = account;\n\t\t\t\taccountFromModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountFromModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"more than one matching account has been found at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountFromModifyFound == 1) {\n\t\t\tif (tr.getNonce() != accountFromModify.getNonce() + 1) {\n\t\t\t\t// error -> nonce not matching -> pssible replay attack\n\t\t\t\tServiceBus.logger.log(\"Nonce is not valid at transaction, possible replay aatack\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\t\t\t\t\n\t\t\t\tif (accountFromModify.getBalance() < amount){\n\t\t\t\t\t// not enoguh fund on the account\n\t\t\t\t\tServiceBus.logger.log(\"Not enoguh fund on the account at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// all cool but still not return because the second account has to be checked as well\n\t\t\t\telse {\n\t\t\t\t\taccountFromIsGood = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}else if (accountFromModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The account from which you want to transfer the fund does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\n\t\t// getting the toAccount to be modified\n\t\tAccountInterface accountToModify = null;\n\t\tint accountToModifyFound = 0;\n\t\tboolean accountToIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(toAddressPublicKey)){\n\t\t\t\taccountToModify = account;\n\t\t\t\taccountToModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountToModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"More than one account is found at matching the transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountToModifyFound == 1) {\n\t\t\taccountToIsGood = true;\n\t\t\t\t\n\t\t}else if (accountToModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The to account does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// transfer is only possible if the asset type is the same, otherwise it is an exchange\n\t\tif (!accountToModify.getAssetType().equals(accountFromModify.getAssetType())){\n\t\t\t// error, from and to asset type must be the same\n\t\t\tServiceBus.logger.log(\"From and to asset type must be the same, TrID : \" + tr.getTransctionId(), Severity.WARNING);\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\t\t\t\n\t\t// final check if all good return true\n\t\tif (accountFromIsGood && accountToIsGood){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// default value\n\t\treturn false;\t\t\t\n\t}", "@Test \n\tpublic void test1() {\n\t\taccount.withdraw(1000);\n\t\t//Sample (Expected) Output\n\t\tassertEquals(1000, account.getAmount(),0.01);\n\t}", "public void testOneWithdrawal(){\n\t\t//Pre-conditions\n\t\tteller.setWorking(true);\n\t\tteller.setHost(host);\n\t\t\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\t\n\t\tassertEquals(\"Teller should have no pending loans, but it has \" + teller.pendingLoans.size(),0,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller should have no accountsListed, but it has \" + teller.accountsListed.size(),0,teller.accountsListed.size());\n\t\t\n\t\t//Step 0 of test - Teller has an account for this customer already \n\t\tteller.accountsListed.add(new BankAccount(withdraw,100));\n\t\t\n\t\t//Post-conditions of step 0 \n\t\tassertEquals(\"Teller should have one account listed, instead it has \" + teller.accountsListed.size(),1,teller.accountsListed.size());\n\t\tassertEquals(\"Teller's only account should have a balance of 100, instead it has \" + teller.accountsListed.get(0).getBalance(), \n\t\t\t\t100.0,teller.accountsListed.get(0).getBalance());\n\t\t\n\t\t//Step 1 of test\n\t\t//msgGoSeeTeller(Banker)\n\t\twithdraw.msgGoSeeTeller(teller);\n\t\t\n\t\t//Post-conditions of step 1 \n\t\tassertEquals(\"Teller's state should be busy, but instead it is: \" + teller.getState(),\"Busy\",teller.getState());\n\t\tassertEquals(\"Teller should have one pending transaction, but it has: \" +teller.pendingTransactions.size(),\n\t\t\t\t1,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller's transaction should be to withdraw 100 dollars, instead it is for \" + teller.pendingTransactions.get(withdraw), \n\t\t\t\t-100.0, teller.pendingTransactions.get(withdraw));\n\t\t\n\t\t//Step 2 of test\n\t\tassertTrue(\"Teller's scheduler should return true, but it doesn't.\", teller.pickAndExecuteAnAction());\n\t\t\n\t\t//Post-conditions of step 2 \n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\tassertTrue(\"Host's log should have a message stating \\\"Updated account, and added teller\\\", instead it reads: \" + host.log.getLastLoggedEvent().toString(), \n\t\t\t\thost.log.containsString(\"Updated account, and added teller\"));\n\t\tassertTrue(\"Customer's log should have a message stating \\\"Got 100.0 dollars, leaving bank.\\\", instead it reads: \" + withdraw.log.getLastLoggedEvent().toString(),\n\t\t\t\twithdraw.log.containsString(\"Got 100.0 dollars, leaving bank.\"));\n\t\tassertEquals(\"Customer's account stored in teller should be updated with the correct balance of 0.0, instead it has \" + teller.accountsListed.get(0).getBalance(), \n\t\t\t\t0.0, teller.accountsListed.get(0).getBalance());\n\t\t\n\t}", "public int checkEND(int amount, boolean burnStun);", "public boolean debit(double amount) throws InsufficientFundsException,InvalidAmountException {\r\n\t\tif (getAmount() + overdraftBalance < amount){\r\n\t\t\tthrow new InsufficientFundsException(\"Insufficient funds to withdraw the amount.\");\r\n\t\t}\r\n\t\tif (amount <= 0){\r\n throw new InvalidAmountException(\"Amount can't be negative or 0.\");\r\n }\r\n\t\tsetAmount(getAmount() - amount);\r\n\t\tthis.setCountVal(this.getCountVal() + 1);\r\n return true;\r\n\t}", "@Override\r\n\tpublic boolean fundTransfer(FundTransferBean fb, double amount) {\n\t\tboolean isValid = true;\r\n\t\tfor (CustomerBean cb1 : customerList) {\r\n\t\t\tif(cb1.getPhoneNum()== fb.getSourcePhoneNum()) {\r\n\t\t\t\tfor (CustomerBean cb2 : customerList) {\r\n\t\t\t\t\tif(cb2.getPhoneNum()==fb.getDesPhoneNum()) {\r\n\t\t\t\t\t\twithdraw(cb1,amount);\r\n\t\t\t\t\t\tdeposit(cb2,amount);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthrow new WalletException();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn isValid;\r\n\t}", "@Test\n public void binDebitTest() {\n assertFalse(authResponse.isBinDebit());\n }", "public boolean fundTransfer(int accountNumber, float amount) {\n\t\treturn dao.fundTransfer(accountNumber,amount);\r\n\t}", "private void validateBalance(Double fromBalance, Double transferAmount) throws PaymentsException {\n\t\tif ((fromBalance - transferAmount) <= 0) {\n\t\t\tlogger.error(\"Not enough balance.\");\n\t\t\tthrow new PaymentsException(\" Not enough funds. \");\n\t\t\t\n\t\t}\n\t}", "public boolean transferMoney(Account fromAcct, Account toAcct, DollarAmount amount,\n long timeout, TimeUnit unit)\n throws DollarAmount.InsufficientFundsException, InterruptedException {\n long stopTime = System.nanoTime() + unit.toNanos(timeout);\n\n for (; ; ) {\n if (fromAcct.lock.tryLock()) {\n try {\n if (toAcct.lock.tryLock()) {\n try {\n if (fromAcct.getBalance().compareTo(amount) < 0) {\n throw new DollarAmount.InsufficientFundsException();\n } else {\n fromAcct.debit(amount);\n toAcct.credit(amount);\n return true;\n }\n } finally {\n toAcct.lock.unlock();\n }\n }\n } finally {\n fromAcct.lock.unlock();\n }\n }\n\n if (System.nanoTime() > stopTime)\n return false;\n\n// TimeUnit.NANOSECONDS.sleep(fixedDelay + rnd.nextLong() % randMod);\n }\n }", "@Test\n public void testFailureWithDrawInSufficientFund() throws IOException, URISyntaxException {\n URI uri = builder.setPath(\"/accounts/2/withdraw/1000\").build();\n\n HttpPut request = new HttpPut(uri);\n request.setHeader(\"Content-type\", \"application/json\");\n HttpResponse response = client.execute(request);\n int statusCode = response.getStatusLine().getStatusCode();\n assertTrue(statusCode == 500);\n }", "Boolean checkAccountHasSufficientBalance(PrintWriter out, Account from, Double amount);", "public static void atmCheckTransferValid(String accNum, int amount, String accNumB) {\n\t\ttry {\n\t\t\tif (amount >= 0 && amount <= 1000000) {\n\t\t\t\tif (AccMgr.checkDailyTransferLimit(accNum, amount)) {\n\t\t\t\t\tAccMgr.performDailyTransfer(amount, accNum);\n\t\t\t\t\tTransactionFileMgr.addXfrTransaction(accNum, Integer.toString(amount), accNumB);\n\t\t\t\t\tSystem.out.println(\"Transfer successful!\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"You have exceeded the daily limit\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Please enter a number between 0 - 1000000\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\n\t}", "public void testOneDeposit(){\n\t\t//Pre-conditions\n\t\tteller.setWorking(true);\n\t\tteller.setHost(host);\n\t\t\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\t\n\t\tassertEquals(\"Teller should have no pending loans, but it has \" + teller.pendingLoans.size(),0,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller should have no accountsListed, but it has \" + teller.accountsListed.size(),0,teller.accountsListed.size());\n\t\t\n\t\t//Step 0 of test - Host sends the teller a new account for the incoming customer\n\t\tteller.msgHereIsAccount(new BankAccount(deposit,0));\n\t\t\n\t\t//Post-conditions of step 0 \n\t\tassertEquals(\"Teller should have one account listed, instead it has \" + teller.accountsListed.size(),1,teller.accountsListed.size());\n\t\tassertEquals(\"Teller's only account should have a balance of 0, instead it has \" + teller.accountsListed.get(0).getBalance(), \n\t\t\t\t0.0,teller.accountsListed.get(0).getBalance());\n\t\t\n\t\t//Step 1 of test\n\t\t//msgGoSeeTeller(Banker)\n\t\tdeposit.msgGoSeeTeller(teller);\n\t\t\n\t\t//Post-conditions of step 1 \n\t\tassertEquals(\"Teller's state should be busy, but instead it is: \" + teller.getState(),\"Busy\",teller.getState());\n\t\tassertEquals(\"Teller should have one pending transaction, but it has: \" +teller.pendingTransactions.size(),\n\t\t\t\t1,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller's transaction should be to deposit 100 dollars, instead it is for \" + teller.pendingTransactions.get(deposit), \n\t\t\t\t100.0, teller.pendingTransactions.get(deposit));\n\t\t\n\t\t//Step 2 of test\n\t\tassertTrue(\"Teller's scheduler should return true, but it doesn't.\", teller.pickAndExecuteAnAction());\n\t\t\n\t\t//Post-conditions of step 2 \n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\tassertTrue(\"Host's log should have a message stating \\\"Updated account, and added teller\\\", instead it reads: \" + host.log.getLastLoggedEvent().toString(), \n\t\t\t\thost.log.containsString(\"Updated account, and added teller\"));\n\t\tassertTrue(\"Customer's log should have a message stating \\\"Got 0.0 dollars, leaving bank.\\\", instead it reads: \" + deposit.log.getLastLoggedEvent().toString(),\n\t\t\t\tdeposit.log.containsString(\"Got 0.0 dollars, leaving bank.\"));\n\t\tassertEquals(\"Customer's account stored in teller should be updated with the correct balance of 100.0, instead it has \" + teller.accountsListed.get(0).getBalance(), 100.0, teller.accountsListed.get(0).getBalance());\n\t\t\n\t}", "@Test(expected=Exception.class)\n public void withdraw1100FromAccount_shouldThrowException() throws Exception{\n account.withdraw(1100);\n }", "public abstract boolean deposit(float amount);", "@Test\r\n\tpublic void testMakePurchase_not_enough_money() {\r\n\t\tassertEquals(false, vendMachine.makePurchase(\"A\"));\r\n\t}", "@Test\n public void testWithdraw() {\n System.out.println(\"withdraw\");\n double d = 1.0;\n Account instance = new Account(\"Piper\", 10.0);\n double expResult = 9.0;\n double result = instance.withdraw(d);\n assertEquals(expResult, result, 0.0);\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 receiveResultpFT_Member_Fund(\n com.xteam.tourismpay.PFTMXStub.PFT_Member_FundResponse result) {\n }", "@Test\n\tpublic void testWithdraw(){\n\t\t\n\t\t// Arrange\n\t\tBigDecimal amountToWithdraw = new BigDecimal(10.00);\n\t\tBigDecimal expectedBalance = new BigDecimal(110.5);\n\t\tdouble delta = 1e-3;\n\t\t// Act\n\t\tcurrentAccount.withdraw(amountToWithdraw);\n\t\tBalance actualBalance = currentAccount.checkBalance();\n\t\t\n\t\t// Assert\n\t\tassertEquals(expectedBalance.doubleValue(), actualBalance.getAmount().doubleValue(), delta);\n\t}", "@Test\r\n void notEnoughFunds() {\n BankAccount account = new BankAccount(9);\r\n\r\n // Assertion for exception\r\n assertThrows(NotEnoughFundsException.class, () -> account.withdraw(10),\r\n \"Balance must be greater than amount of withdrawal\");\r\n }", "private boolean isValidTransaction(double remainingCreditLimit, double transactionAmount){\n return transactionAmount <= remainingCreditLimit;\n }", "public void mutualFund(){\n\t\tSystem.out.println(\"HSBC BANK :: MUTUAL FUND\");\n\t}", "@Test\n public void testMoreRequired() throws VendingMachineInventoryException{\n service.addFunds(\"1.00\");\n Item testitem = new Item(\"testitem\", \"1.50\", \"5\");\n service.addItem(\"testitem\", testitem);\n BigDecimal moneyRequired = service.moreRequired(\"testitem\");\n BigDecimal expectedMoneyRequired = new BigDecimal(\"0.50\");\n assertEquals(moneyRequired, expectedMoneyRequired);\n }", "@Test\n\tpublic void testCheckSufficientCredits_True() {\n\n\t\tint creditsRequired = 1;\n\t\taccount.setCredits(10l);\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tSmsMessage msg = new SmsMessage();\n\t\tSmsTask smsTask = new SmsTask();\n\t\tsmsTask.setSakaiSiteId(SmsConstants.SMS_DEV_DEFAULT_SAKAI_SITE_ID);\n\t\tsmsTask.setSmsAccountId(account.getId());\n\t\tsmsTask.setDateCreated(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setDateToSend(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setStatusCode(SmsConst_DeliveryStatus.STATUS_PENDING);\n\t\tsmsTask.setAttemptCount(2);\n\t\tsmsTask.setMessageBody(SmsConstants.SMS_DEV_DEFAULT_SMS_MESSAGE_BODY);\n\t\tsmsTask.setSenderUserName(\"senderUserName\");\n\t\tsmsTask.setMaxTimeToLive(1);\n\t\tsmsTask.getSmsMessages().add(msg);\n\t\tsmsTask.setCreditEstimate(creditsRequired);\n\t\tmsg.setSmsTask(smsTask);\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertTrue(\"Expected sufficient credit\", sufficientCredits);\n\n\t\taccount.setCredits(0l);\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tboolean insufficientCredits = !smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertTrue(\"Expected insufficient credit\", insufficientCredits);\n\n\t}", "public static void agentCheckTransferValid(String accNum, int amount, String accNumB) {\n\t\ttry {\n\t\t\tif (amount >= 0 && amount <= 99999999) {\n\t\t\t\tSystem.out.println(\"Transfer successful!\");\n\t\t\t\tTransactionFileMgr.addXfrTransaction(accNum, Integer.toString(amount), accNumB);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Please enter a number between 0 - 99999999\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\n\t}", "public Masary_Error CheckBillType(String BTC, double CusAmount, String CustId, double serv_balance, double masry_balance, double billamount, double fees, Main_Provider provider, double deductedAmount) {\n Masary_Error Status = new Masary_Error();\n try {\n Masary_Bill_Type bill_type = MasaryManager.getInstance().getBTC(BTC);\n double trunccusamount = Math.floor(CusAmount);\n// double deductedAmount = MasaryManager.getInstance().GetDeductedAmount(Integer.parseInt(CustId), Integer.parseInt(BTC), CusAmount, provider.getPROVIDER_ID());\n if ((deductedAmount > serv_balance) || deductedAmount == -1) {\n Status = MasaryManager.getInstance().GETMasary_Error(\"-501\", provider);\n } else if (!bill_type.isIS_PART_ACC() && CusAmount < billamount) {\n Status = MasaryManager.getInstance().GETMasary_Error(\"-502\", provider);\n } else if (!bill_type.isIS_OVER_ACC() && CusAmount > billamount && billamount != 0) {\n Status = MasaryManager.getInstance().GETMasary_Error(\"-503\", provider);\n } else if (!bill_type.isIS_ADV_ACC() && billamount == 0) {\n Status = MasaryManager.getInstance().GETMasary_Error(\"-504\", provider);\n } else if (!bill_type.isIS_FRAC_ACC() && (CusAmount - trunccusamount) > 0) {\n Status = MasaryManager.getInstance().GETMasary_Error(\"-505\", provider);\n } else if ((CusAmount > masry_balance) || deductedAmount == -2 || deductedAmount == -3 || deductedAmount == -4) {\n Status = MasaryManager.getInstance().GETMasary_Error(\"-506\", provider);\n } else {\n Status = MasaryManager.getInstance().GETMasary_Error(\"200\", provider);\n }\n } catch (Exception ex) {\n\n MasaryManager.logger.error(\"Exception \" + ex.getMessage(), ex);\n }\n\n return Status;\n }", "@Test\n public void accuseFailTest() throws Exception {\n assertTrue(\"failure - accused status was not set to true\", target.isAccused());\n\n }", "private boolean tryPay() {\n return new Random().nextInt(100) + 1 <= 50;\n }", "public boolean steamFailure() {\n double steam = this.steamMessage.getDoubleParameter();\n if (steam < 0) {\n return true;\n }\n if (steam > this.configuration.getMaximualSteamRate()) {\n return true;\n }\n return false;\n }", "private void doWithdrawal() {\n while(true){\n try{\n Account userAccount = ui.readAccount(currentUser.getAccounts());\n int amountWithdrawn = ui.readWithdrawalAmount();\n\n if(userAccount.debit(amountWithdrawn)){\n ui.displayNewBalance(userAccount);\n break;\n\n } else {\n ui.displayError(\"You do not have enough money in this account to withdraw \" + amountWithdrawn);\n }\n }catch(Exception e){\n ui.displayError(\"Please enter a valid number.\");\n }\n }\n\n }", "public boolean withdrawal (double amount) \r\n {\r\n\r\n boolean result = false;\r\n\r\n if ( ! super.withdrawal (amount) ) \r\n {\r\n System.out.println (\"Using overdraft...\");\r\n if ( ! overdraft.withdrawal (amount-balance) )\r\n System.out.println (\"Overdraft source insufficient.\");\r\n else {\r\n balance = 0;\r\n System.out.println (\"Current Balance on account \" + account + \": \" + balance);\r\n result = true;\r\n }\r\n }\r\n System.out.println ();\r\n\r\n return result;\r\n\r\n }", "private static boolean hasFunds(double cost)\n {\n if (Clock.getRoundNum() < 200) { //TODO edit this out if necessary\n return rc.getTeamOre() > cost;\n } else {\n return rc.getTeamOre() > cost*2;\n }\n }", "@Override\n public String getMessage() {\n return \"Insufficient Funds! Current Balance: \" + balance;\n }", "@Test(expected=InsufficientCreditException.class)\n\tpublic void testNotEnoughtCredit() throws Exception {\n\t\tfor (int i = 49; i >= -1000; i--) {\n\t\t\td.dispense(i, 13);\n\t\t}\n\t}", "public double calculateExpectedDisagreement();", "public abstract Response makeTransfer(Transaction transaction) throws AccountNotFoundException, InsufficientFundsException;", "@Test\n public void testPayTransactionSuccessfully() throws Exception {\n\n // login with sufficient rights\n shop.login(admin.getUsername(), admin.getPassword());\n\n // verify receive correct change when paying for sale\n double change = 3;\n assertEquals(change, shop.receiveCashPayment(saleId, toBePaid+change), 0.001);\n totalBalance += toBePaid;\n\n // verify sale is in state PAID/COMPLETED\n assertTrue(isTransactionInAccountBook(saleId));\n\n // verify system's balance did update correctly\n assertEquals(totalBalance, shop.computeBalance(), 0.001);\n }", "if (charge == adhocTicket.getCharge()) {\n System.out.println(\"Charge is passed\");\n }", "@Test\n public void testAmountLeftToPay() {\n //Just ensure that the first two digits are the same\n assertEquals(expectedResults.getAmountLeftToPay(), results.getAmountLeftToPay(), 0.15);\n }", "protected void acceptedPaymentVerification() {\n BillingSummaryPage.tableBillingGeneralInformation.getRow(1)\n .getCell(\"Current Due\").waitFor(cell -> !cell.getValue().equals(\"Calculating...\"));\n\n assertThat(BillingSummaryPage.tableBillingGeneralInformation.getRow(1))\n .hasCellWithValue(\"Current Due\", BillingHelper.DZERO.toString())\n .hasCellWithValue(\"Total Due\", BillingHelper.DZERO.toString())\n .hasCellWithValue(\"Total Paid\", modalPremiumAmount.get().toString());\n\n assertThat(BillingSummaryPage.tableBillsAndStatements.getRow(1).getCell(\"Status\")).valueContains(PAID_IN_FULL);\n\n assertThat(BillingSummaryPage.tablePaymentsOtherTransactions)\n .with(POLICY_NUMBER, masterPolicyNumber.get())\n .with(TYPE, PAYMENT)\n .with(TableConstants.BillingPaymentsAndTransactionsGB.AMOUNT, String.format(\"(%s)\", modalPremiumAmount.get().toString()))\n .containsMatchingRow(1);\n\n }", "@Test\n\tpublic void testChargesStudent() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, true);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(01, \"acc1\", 00000, 50.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (acc1.currentBalance == 949.95) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"can not withdraw transaction charge (student)\", testResult);\n\t}", "@Test\n\tpublic void testCheckSufficientCredits_Enddated() {\n\n\t\tint creditsRequired = 11;\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTime(new Date());\n\t\tcal.add(Calendar.HOUR, -2);\n\t\taccount.setEnddate(cal.getTime());\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertFalse(\"Expected insufficient credit\", sufficientCredits);\n\t\taccount.setEnddate(null); // restore\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t}", "public void withdraw(double ammount) throws insufficientFunds{\n if(ammount > abal)\n throw new insufficientFunds();\n else{\n ammount = abal - ammount;\n UpdateDB();\n }\n }", "@Test\n public void testDeposit() {\n System.out.println(\"deposit\");\n double d = 1.0;\n Account instance = new Account(\"Piper\", 10.0);\n double expResult = 11.0;\n double result = instance.deposit(d);\n assertEquals(expResult, result, 0.0);\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"The test case is a prototype.\");\n }", "public boolean transferFunds (int secretKey, double amtToTransfer) {\n\n int sourceBankAccountNumber; // account FROM which to transfer\n int targetBankAccountNumber; // account TO which to transfer\n\n // use secretKey to obtain AccountLink, which will contains the\n // source and target BankAccount numbers\n AccountLink theAccountLink = hashMapOfSecretKeys.get(secretKey);\n\n if ( theAccountLink != null ) { // i.e. secretKey was valid\n\n sourceBankAccountNumber = theAccountLink.getAGENT_ACCOUNT_NUMBER();\n targetBankAccountNumber = theAccountLink.getAH_ACCOUNT_NUMBER();\n\n } else { // secretKey appears invalid; no transfer possible\n return false;\n }\n\n // use account numbers to get full BankAccounts\n BankAccount sourceBankAccount =\n hashMapOfAllAccts.get(sourceBankAccountNumber);\n BankAccount targetBankAccount =\n hashMapOfAllAccts.get(targetBankAccountNumber);\n\n // ask source BankAccount to delete amtToTransfer (if possible)\n // This effects a transfer only if frozen funds >= amtToTransfer\n boolean fundsTakenFromSource =\n sourceBankAccount.decreaseFrozenAndBalance(amtToTransfer);\n\n // if funds were able to be taken from source, then add amt to target\n if ( fundsTakenFromSource ) {\n targetBankAccount.increaseTotalBalance(amtToTransfer);\n updateBankDisplay();\n } else {\n return false; // b/c funds could not be taken from source\n }\n\n return true;\n }", "private static void deposite (double amount) {\n double resultDeposit = balance + amount;\r\n System.out.println(\"Deposit successful.\\nCurrent balance: \" + \"$\" + resultDeposit+ \".\");\r\n }", "@When(\"^the value of the deposit is true$\")\n public void the_value_of_the_deposit_is_true() throws Throwable {\n throw new PendingException();\n }", "@Test\r\n public void test6() \r\n {\r\n \tint loan = -1;\r\n \ttry{\r\n \t\tloan = p.getMonthlyAmount(TestHelper.getSSN(57,0,0,5555), 0 , 100, 100);\r\n assertTrue(loan == Consts.ZERO);\r\n \t}catch(AssertionError err){\r\n \t\tSystem.out.println(\"Test 6, correct : 0, got : \"+ loan);\r\n \t}\r\n \r\n }", "InsufficientFunds(Account a) {\n balance = a.currentBalance();\n }", "public void depositAmount() {\n\t\n\t\ttry {\n\t\t\tlog.log(Level.INFO, \"Please Enter the account number you want to deposit: \");\n\t\t\tint depositAccountNumber = scan.nextInt();\n\t\t\tlong amount;\n\t\t\tlog.log(Level.INFO, \"Please Enter the amount you want to Deposit : \");\n\t\t\tamount = scan.nextLong();\n\t\t\tbankop.deposit(depositAccountNumber,amount);\n\t\t\t\n\t\t}catch(AccountDetailsException | BalanceException message ) {\n\t\t\tlog.log(Level.INFO, message.getMessage());\n\t\t}\n\t\t\n\t}", "boolean isSetAmount();", "boolean debit(TransactionRequest transaction) throws ebank.InsufficientBalanceException,ebank.CardNumberException, SQLException, ClassNotFoundException;", "boolean hasAmount();", "boolean hasAmount();", "public boolean sendMoney(BigDecimal amount, BankAccount toAccount){\n //check if balance can cover that transfer\n if(!mIsActive || balance.compareTo(amount)<0){\n //account not active or insufficient funds\n return false;\n }\n //take out of balance\n balance = balance.subtract(amount);\n //check that the receiver received the amount\n toAccount.deposit(amount);\n //success! return true\n return true;\n }", "@Test\n public void testPayUnpaidOrderFails() throws Exception {\n\n // login with sufficient rights\n shop.login(admin.getUsername(), admin.getPassword());\n\n // issue an order\n int orderId = shop.issueOrder(productCode, 10, 1);\n\n // trying to pay for an order with receiveCashPayment fails\n assertEquals(-1, shop.receiveCashPayment(orderId, 10), 0.001);\n\n // verify order is still in ISSUED state\n assertEquals(\"ISSUED\", shop.getAllOrders().stream()\n .filter(b -> b.getBalanceId() == orderId)\n .map(Order::getStatus)\n .findAny()\n .orElse(null));\n\n // verify system's balance did not change\n assertEquals(totalBalance, shop.computeBalance(), 0.001);\n }", "@Test\n public void test_total_balance3() {\n assertEquals(0, ao3.totalBalanceOfAccountsOwned(), EPS);\n }", "@Override\r\n\tpublic boolean transferAmnt(int toAccNo, double money)\r\n\t\t\tthrows EwalletException {\n\t\tAccount ftTemp =new Account();\r\n\t\tif(temp.getCustBal()>=money) {\r\n\t\tftTemp = dao.loginuser(toAccNo);\r\n\t\tif(ftTemp!=null)\r\n\t\t{\r\n\t\t\tftTemp.setCustBal(ftTemp.getCustBal()+money);\r\n\t\t\ttemp.setCustBal(temp.getCustBal()-money);\r\n\t\t\ttemp.settDetails(\"Date :\"+tDate+\" Amount Transfered :\"+money+\" To Acc No: \"+ftTemp.getAccNum()+\" Total Balance :\"+temp.getCustBal());\r\n\t\t\tftTemp.settDetails(\"Date :\"+tDate+\" Depsoited Amount :\"+money+\" From Acc No: \"+temp.getAccNum()+\" Total Balance :\"+ftTemp.getCustBal());\r\n\t\t\tdao.updatedetails(temp.getAccNum(), temp);\r\n\t\t\tdao.updatedetails(ftTemp.getAccNum(), ftTemp);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\telse if(temp.getCustBal()<money)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Low Balance to transfer\");\r\n\t\t}\r\n\t\t\r\n\t\telse\r\n\t\t\tSystem.out.println(\"No such user account\");\r\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic boolean withdraw(double amount) {\n\t\ttry {\r\n\t\t\tif (accountStatus.equals(AccountStatus.ACTIVE)) {\r\n\t\t\t\tif (balance > amount) {\r\n\t\t\t\t\tbalance = (float) (balance - amount);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new InsufficientBalanceException(\"You'er Balance is insufficient to make this transation !\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\tthrow new AccountInactiveException(\"You'er Account is not Active !\");\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Test\n public void testSuccessTransferFundDifferentCcy() throws IOException, URISyntaxException {\n URI uri = builder.setPath(\"/transfers\").build();\n BigDecimal amount = new BigDecimal(100).setScale(4, RoundingMode.HALF_EVEN);\n\n HttpPost request = new HttpPost(uri);\n request.setHeader(\"Content-type\", \"application/json\");\n request.setEntity(new StringEntity(mapper.writeValueAsString(new MoneyTransfer(amount, 1L, 2L))));\n HttpResponse response = client.execute(request);\n\n assertTrue(response.getStatusLine().getStatusCode() == 200);\n }", "@Test\n\tpublic void testDebitCard() {\n\t\tassertEquals(100.0, card.getBalance());\n\t}", "@Test\r\n public void test1() \r\n {\r\n \tint loan = -1;\r\n \ttry{\r\n loan = p.getMonthlyAmount(TestHelper.getSSN(19,0,0,5555), 0, 100, 100);\r\n assertTrue(loan == Consts.ZERO);\r\n \t}catch(AssertionError err){\r\n \t\tSystem.out.println(\"Test 1, correct : 0, got : \"+ loan);\r\n \t}\r\n }", "protected void imposeTransactionFee ()\n {\n if (getBalance () < minimumBalance)\n super.withdraw (transactionFee);\n }", "@Test\r\n public void test3()\r\n {\r\n \tint loan = -1;\r\n \ttry{\r\n \t\tloan = p.getMonthlyAmount(TestHelper.getSSN(46,0,0,5555), 0 , 100, 100);\r\n assertTrue(loan == Consts.FULL_LOAN + Consts.FULL_SUBSIDY);\r\n \t\t\r\n \t}catch(AssertionError err){\r\n \t\tSystem.out.println(\"Test 3, correct : 9904, got : \"+ loan);\r\n \t}\r\n \r\n }", "@Test\r\n public void test4() \r\n {\r\n \tint loan = -1;\r\n \ttry{\r\n \t\tloan = p.getMonthlyAmount(TestHelper.getSSN(47,0,0,5555), 0 , 100, 100);\r\n assertTrue(loan == Consts.FULL_SUBSIDY); \t\t\r\n \t}catch(AssertionError err){\r\n \t\tSystem.out.println(\"Test 4, correct : 2816, got : \"+ loan);\r\n \t}\r\n }" ]
[ "0.67796665", "0.6664834", "0.6596582", "0.6562491", "0.646813", "0.6456275", "0.63400877", "0.6318614", "0.63162595", "0.6304697", "0.630188", "0.6299793", "0.62833774", "0.62786067", "0.62697697", "0.6227526", "0.62248516", "0.61881083", "0.6180604", "0.6178933", "0.6163257", "0.614817", "0.6134658", "0.6130826", "0.61075544", "0.608836", "0.6073461", "0.6071161", "0.6066585", "0.60646296", "0.6038077", "0.6014959", "0.60091686", "0.6004417", "0.60028076", "0.599067", "0.5989238", "0.5983311", "0.59179056", "0.59123397", "0.5896947", "0.5892112", "0.58789253", "0.587044", "0.5865838", "0.5858079", "0.58501154", "0.5848953", "0.58328074", "0.5827602", "0.5824865", "0.57979345", "0.57859486", "0.5784356", "0.5782763", "0.57684296", "0.5720612", "0.57197934", "0.5710403", "0.57056165", "0.56902474", "0.56779665", "0.56762433", "0.56719196", "0.5670133", "0.566851", "0.56675005", "0.5667288", "0.56651527", "0.566441", "0.5655679", "0.564699", "0.5643253", "0.56355876", "0.5632171", "0.56271803", "0.5625801", "0.56255573", "0.5620674", "0.561061", "0.5609042", "0.5607003", "0.5605216", "0.560202", "0.5598006", "0.5596346", "0.5591566", "0.55772537", "0.55772537", "0.557485", "0.55629325", "0.5562101", "0.5544492", "0.5535499", "0.55312884", "0.5530066", "0.55229926", "0.5522008", "0.55179423", "0.55171794" ]
0.66241753
2
Test success transfer fund different ccy.
@Test public void testSuccessTransferFundDifferentCcy() throws IOException, URISyntaxException { URI uri = builder.setPath("/transfers").build(); BigDecimal amount = new BigDecimal(100).setScale(4, RoundingMode.HALF_EVEN); HttpPost request = new HttpPost(uri); request.setHeader("Content-type", "application/json"); request.setEntity(new StringEntity(mapper.writeValueAsString(new MoneyTransfer(amount, 1L, 2L)))); HttpResponse response = client.execute(request); assertTrue(response.getStatusLine().getStatusCode() == 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void transferCheckingtoSavingsTest(){\n assertTrue(userC.transfer(150.00, userS));\n }", "@Test\n\tpublic void depositTest(){\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tAccount cAcc = new CurrentAccount(cus);\n\t\tbc.deposit(cAcc, 500, true);\n\t\tboolean flag = false;\n\t\tif(cAcc.getBalance() == 500.0){\n\t\t\tflag = true;\n\t\t}\n\t\tassertTrue(flag);\n\t}", "@Test\n\tpublic void moneyTrnasferSucess() {\n\t\t\n\t\tString accountNumberFrom = createAccount(\"krishna\",4000);\n\t\tString accountNumberTo = createAccount(\"ram\",2000);\n\t\tdouble amountToBeTranfered = 500.0;\n\t\tMoneyTransfer moneyTransfer = new MoneyTransfer();\n\t\tmoneyTransfer.setAccountNumberFrom(Integer.parseInt(accountNumberFrom));\n\t\tmoneyTransfer.setAccountNumberTo(Integer.parseInt(accountNumberTo));\n\t\tmoneyTransfer.setAmount(amountToBeTranfered);\n\t\t\n\t\tString requestBody = gson.toJson(moneyTransfer);\n\t\t\n\t\tRequestSpecification request = RestAssured.given();\n\t\trequest.body(requestBody);\n\t\tResponse response = request.put(\"/transfer\");\n\t\t\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - START\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(amountToBeTranfered);\n\t\tsb.append(\" has been transferred to : \");\n\t\tsb.append(accountNumberTo);\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - END\n\t\t\n\t\tAssertions.assertEquals(sb.toString(), response.asString());\n\t\t\n\t}", "@Test\n public void proveraTransfera() {\n Account ivana = mobi.openAccount(\"Ivana\");\n Account pera = mobi.openAccount(\"Pera\");\n\n mobi.payInMoney(ivana.getNumber(), 5000.0);\n mobi.transferMoney(ivana.getNumber(), pera.getNumber(), 2000.0);\n //ocekujemo da nakon ovoga ivana ima 3000, a pera 2000\n\n SoftAssert sa = new SoftAssert();\n sa.assertEquals(ivana.getAmount(), 3000.0);\n sa.assertEquals(pera.getAmount(), 2000.0);\n\n sa.assertAll();\n }", "@Test\n\tpublic void withdrawTest(){\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tAccount cAcc = new CurrentAccount(cus);\n\t\tbc.withdraw(cAcc, 300);\n\t\tboolean flag = false;\n\t\tif(cAcc.getBalance() == -300.0){\n\t\t\tflag = true;\n\t\t}\n\t\tassertTrue(flag);\n\t}", "public void testOneDeposit(){\n\t\t//Pre-conditions\n\t\tteller.setWorking(true);\n\t\tteller.setHost(host);\n\t\t\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\t\n\t\tassertEquals(\"Teller should have no pending loans, but it has \" + teller.pendingLoans.size(),0,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller should have no accountsListed, but it has \" + teller.accountsListed.size(),0,teller.accountsListed.size());\n\t\t\n\t\t//Step 0 of test - Host sends the teller a new account for the incoming customer\n\t\tteller.msgHereIsAccount(new BankAccount(deposit,0));\n\t\t\n\t\t//Post-conditions of step 0 \n\t\tassertEquals(\"Teller should have one account listed, instead it has \" + teller.accountsListed.size(),1,teller.accountsListed.size());\n\t\tassertEquals(\"Teller's only account should have a balance of 0, instead it has \" + teller.accountsListed.get(0).getBalance(), \n\t\t\t\t0.0,teller.accountsListed.get(0).getBalance());\n\t\t\n\t\t//Step 1 of test\n\t\t//msgGoSeeTeller(Banker)\n\t\tdeposit.msgGoSeeTeller(teller);\n\t\t\n\t\t//Post-conditions of step 1 \n\t\tassertEquals(\"Teller's state should be busy, but instead it is: \" + teller.getState(),\"Busy\",teller.getState());\n\t\tassertEquals(\"Teller should have one pending transaction, but it has: \" +teller.pendingTransactions.size(),\n\t\t\t\t1,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller's transaction should be to deposit 100 dollars, instead it is for \" + teller.pendingTransactions.get(deposit), \n\t\t\t\t100.0, teller.pendingTransactions.get(deposit));\n\t\t\n\t\t//Step 2 of test\n\t\tassertTrue(\"Teller's scheduler should return true, but it doesn't.\", teller.pickAndExecuteAnAction());\n\t\t\n\t\t//Post-conditions of step 2 \n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\tassertTrue(\"Host's log should have a message stating \\\"Updated account, and added teller\\\", instead it reads: \" + host.log.getLastLoggedEvent().toString(), \n\t\t\t\thost.log.containsString(\"Updated account, and added teller\"));\n\t\tassertTrue(\"Customer's log should have a message stating \\\"Got 0.0 dollars, leaving bank.\\\", instead it reads: \" + deposit.log.getLastLoggedEvent().toString(),\n\t\t\t\tdeposit.log.containsString(\"Got 0.0 dollars, leaving bank.\"));\n\t\tassertEquals(\"Customer's account stored in teller should be updated with the correct balance of 100.0, instead it has \" + teller.accountsListed.get(0).getBalance(), 100.0, teller.accountsListed.get(0).getBalance());\n\t\t\n\t}", "@Test\n public void testImpossible1TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0000\");\n AccountOfUser acc2 = new AccountOfUser(0, \"0000 0000 0000 0001\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n bank.addAccountToUser(user.getPassport(), acc2);\n assertThat(bank.transferMoney(user.getPassport(), acc.getRequisites(), user.getPassport(), acc2.getRequisites(), 100), is(false));\n }", "@Test\n public void depositCheckingTest(){\n userC.deposit(200.00);\n assertEquals(\"Balance is now $500.00\", userC.getCurrentBalance(), 500.00, DELTA);\n }", "@Test \n\tpublic void test1() {\n\t\taccount.withdraw(1000);\n\t\t//Sample (Expected) Output\n\t\tassertEquals(1000, account.getAmount(),0.01);\n\t}", "@Test\n public void holdTest() {\n\n PaymentDto paymentDto = initPayment(inAccountId, outAccountId, \"700\");\n\n final String firstPaymentId = paymentDto.getId();\n\n paymentDto = authorizePayment(firstPaymentId, 200);\n\n assertEquals(\"Payment status AUTHORIZED\", PaymentStatus.AUTHORIZED, paymentDto.getStatus());\n\n\n //init and authorize second payment, but there is 700 cents of 1000 withhold - ERROR: WITHDRAW_NO_FUNDS\n\n paymentDto = initPayment(inAccountId, outAccountId, \"700\");\n\n final String secondPaymentId = paymentDto.getId();\n\n paymentDto = authorizePayment(secondPaymentId, 200);\n\n assertEquals(\"Payment status ERROR\", PaymentStatus.ERROR, paymentDto.getStatus());\n\n assertEquals(\"Error reason WITHDRAW_NO_FUNDS\", new Integer(ErrorCode.WITHDRAW_NO_FUNDS.getCode()), paymentDto.getErrorReason());\n\n\n //confirm first payment - OK\n\n paymentDto = confirmPayment(firstPaymentId, 200);\n\n assertEquals(\"Payment status CONFIRMED\", PaymentStatus.CONFIRMED, paymentDto.getStatus());\n\n\n //confirm second payment, which was filed on authorization - still got ERROR: WITHDRAW_NO_FUNDS\n\n paymentDto = confirmPayment(secondPaymentId, 200);\n\n assertEquals(\"Payment status ERROR\", PaymentStatus.ERROR, paymentDto.getStatus());\n\n assertEquals(\"Error reason WITHDRAW_NO_FUNDS\", new Integer(ErrorCode.WITHDRAW_NO_FUNDS.getCode()), paymentDto.getErrorReason());\n\n }", "@Test\n\tpublic void testTransfer() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"acc2\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(02, \"acc1\", 00000, 200.00, \"\"));\n\t\ttransactions.add(2, new Transaction(02, \"acc2\", 00001, 200.00, \"\"));\n\t\ttransactions.add(3, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\t// ArrayList<Account> expected = new ArrayList();\n\t\t// expected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\t\t// expected.add(1, new Account(00001, \"acc2\", true, 1050.00, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Money Transfered\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"money not transfered\", testResult);\n\t}", "if (charge == adhocTicket.getCharge()) {\n System.out.println(\"Charge is passed\");\n }", "@Test\n\tpublic void testChargesStudent() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, true);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(01, \"acc1\", 00000, 50.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (acc1.currentBalance == 949.95) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"can not withdraw transaction charge (student)\", testResult);\n\t}", "@Test\n\tpublic void testChargesNonStudent() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(01, \"acc1\", 00000, 50.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (acc1.currentBalance == 949.90) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"can not withdraw transaction charge (non student)\", testResult);\n\t}", "public void testOneWithdrawal(){\n\t\t//Pre-conditions\n\t\tteller.setWorking(true);\n\t\tteller.setHost(host);\n\t\t\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\t\n\t\tassertEquals(\"Teller should have no pending loans, but it has \" + teller.pendingLoans.size(),0,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller should have no accountsListed, but it has \" + teller.accountsListed.size(),0,teller.accountsListed.size());\n\t\t\n\t\t//Step 0 of test - Teller has an account for this customer already \n\t\tteller.accountsListed.add(new BankAccount(withdraw,100));\n\t\t\n\t\t//Post-conditions of step 0 \n\t\tassertEquals(\"Teller should have one account listed, instead it has \" + teller.accountsListed.size(),1,teller.accountsListed.size());\n\t\tassertEquals(\"Teller's only account should have a balance of 100, instead it has \" + teller.accountsListed.get(0).getBalance(), \n\t\t\t\t100.0,teller.accountsListed.get(0).getBalance());\n\t\t\n\t\t//Step 1 of test\n\t\t//msgGoSeeTeller(Banker)\n\t\twithdraw.msgGoSeeTeller(teller);\n\t\t\n\t\t//Post-conditions of step 1 \n\t\tassertEquals(\"Teller's state should be busy, but instead it is: \" + teller.getState(),\"Busy\",teller.getState());\n\t\tassertEquals(\"Teller should have one pending transaction, but it has: \" +teller.pendingTransactions.size(),\n\t\t\t\t1,teller.pendingTransactions.size());\n\t\tassertEquals(\"Teller's transaction should be to withdraw 100 dollars, instead it is for \" + teller.pendingTransactions.get(withdraw), \n\t\t\t\t-100.0, teller.pendingTransactions.get(withdraw));\n\t\t\n\t\t//Step 2 of test\n\t\tassertTrue(\"Teller's scheduler should return true, but it doesn't.\", teller.pickAndExecuteAnAction());\n\t\t\n\t\t//Post-conditions of step 2 \n\t\tassertEquals(\"Teller's state should be free, but instead it is: \" + teller.getState(),\"Free\",teller.getState());\n\t\tassertEquals(\"Teller should have no pending transactions, but it has: \" +teller.pendingTransactions.size(),0,teller.pendingTransactions.size());\n\t\tassertTrue(\"Host's log should have a message stating \\\"Updated account, and added teller\\\", instead it reads: \" + host.log.getLastLoggedEvent().toString(), \n\t\t\t\thost.log.containsString(\"Updated account, and added teller\"));\n\t\tassertTrue(\"Customer's log should have a message stating \\\"Got 100.0 dollars, leaving bank.\\\", instead it reads: \" + withdraw.log.getLastLoggedEvent().toString(),\n\t\t\t\twithdraw.log.containsString(\"Got 100.0 dollars, leaving bank.\"));\n\t\tassertEquals(\"Customer's account stored in teller should be updated with the correct balance of 0.0, instead it has \" + teller.accountsListed.get(0).getBalance(), \n\t\t\t\t0.0, teller.accountsListed.get(0).getBalance());\n\t\t\n\t}", "@Test\n public void withdrawCheckingTest(){\n userC.withdraw(200.00);\n assertEquals(\"Balance is now $100.00\", userC.getCurrentBalance(), 100.00, DELTA);\n }", "@Test\n\tpublic void testDeductMoney() {\n\t\tcard.addMoney(500);\n\t\tcard.deductMoney(200);\n\t\tassertEquals(400.0, card.getBalance());\n\t}", "@Test\n\tpublic void testDeposit() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(04, \"acc1\", 00000, 100.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (outContent.toString().contains(\"Deposit Successful\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"unable to deposit money\", testResult);\n\t}", "@Test\n public void testSuccessTransferFundSufficientFund() throws IOException, URISyntaxException {\n URI uri = builder.setPath(\"/transfers\").build();\n BigDecimal amount = new BigDecimal(10).setScale(4, RoundingMode.HALF_EVEN);\n\n HttpPost request = new HttpPost(uri);\n request.setHeader(\"Content-type\", \"application/json\");\n request.setEntity(new StringEntity(mapper.writeValueAsString(new MoneyTransfer(amount, 1L, 4L))));\n HttpResponse response = client.execute(request);\n\n int statusCode = response.getStatusLine().getStatusCode();\n assertTrue(statusCode == 200);\n }", "@Test\r\n public void testPayByCash() {\r\n \r\n int paidAmount = 100;\r\n int cost = 60;\r\n instance = new Controller(dbMgr);\r\n int expResult = 40;\r\n int result = instance.payByCash(paidAmount, cost);\r\n assertEquals(expResult, result);\r\n \r\n }", "@Test\n public void testImpossible3TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(1000, \"0000 0000 0000 0000\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n assertThat(bank.transferMoney(user.getPassport(), acc.getRequisites(), user.getPassport(), \"0000 0000 0000 0001\", 100), is(false));\n }", "@Test\n void executeMoneyTransfer() throws ParseException, JsonProcessingException {\n\n String idAccount = \"14537780\";\n String receiverName = \"Receiver Name\";\n String description = \"description text\";\n String currency = \"EUR\";\n String amount = \"100\";\n String executionDate = \"2020-12-12\";\n MoneyTransfer moneyTransfer = Utils.fillMoneyTransfer(idAccount, receiverName, description, currency, amount, executionDate);\n\n Response response = greetingWebClient.executeMoneyTransfer(moneyTransfer, idAccount);\n assertTrue(response.getStatus().equals(\"KO\"));\n\n\n }", "@Test\n public void testImpossible2TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0001\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n assertThat(bank.transferMoney(user.getPassport(), \"0000 0000 0000 0000\", user.getPassport(), acc.getRequisites(), 100), is(false));\n }", "@Test\n\tpublic void testDebitCard() {\n\t\tassertEquals(100.0, card.getBalance());\n\t}", "@Test\n public void processTestC()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n //failed transaction\n trans = new Transaction(acc_db,acc.get_Account_Number(),5,10);\n\n Assert.assertEquals(false,trans.process());\n }", "@Test\n public void testGiveChange() throws Exception {\n System.out.println(\"giveChange\");\n //CashRegister instance = new CashRegister();\n assertEquals(0.0, instance.giveChange(), EPSILON);\n instance.scanItem(0.55);\n instance.scanItem(1.27);\n double expResult = 0.18;\n instance.collectPayment(Money.QUARTER, 8);\n double result = instance.giveChange();\n assertEquals(expResult, result, EPSILON);\n \n }", "@Test\n\tpublic void AccountCredit_test() { Using HamCrest \t\t\n\t\t// Exercise code to run and test\n\t\t//\n\t\tmiCuenta.setHolder(this.arg1);\n\t\t//\n\t\tmiCuenta.setBalance(this.arg2); \n\t\t//\n\t\tmiCuenta.setZone(this.arg3);\n\t\t//\n\t\tmiCuenta.debit(this.arg4);\n\t\tint Debit = miCuenta.getBalance(); \t\t\t\t\n\t\t// Verify\n\t\tassertThat(this.arg5, is(Debit));\n\t\t\n\t}", "@Test\n public void testPayTransactionSuccessfully() throws Exception {\n\n // login with sufficient rights\n shop.login(admin.getUsername(), admin.getPassword());\n\n // verify receive correct change when paying for sale\n double change = 3;\n assertEquals(change, shop.receiveCashPayment(saleId, toBePaid+change), 0.001);\n totalBalance += toBePaid;\n\n // verify sale is in state PAID/COMPLETED\n assertTrue(isTransactionInAccountBook(saleId));\n\n // verify system's balance did update correctly\n assertEquals(totalBalance, shop.computeBalance(), 0.001);\n }", "@Test\n public void loanWithCahargesOfTypeAmountPlusInterestPercentageAndCashBasedAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer amountPlusInterestPercentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\"));\n addCharges(charges, amountPlusInterestPercentageDisbursementCharge, \"1\", null);\n\n Integer amountPlusInterestPercentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC, ChargesHelper\n .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\", false));\n addCharges(charges, amountPlusInterestPercentageSpecifiedDueDateCharge, \"1\", \"29 September 2011\");\n\n Integer amountPlusInterestPercentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\", false));\n addCharges(charges, amountPlusInterestPercentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n clientID.toString(), collateralId);\n Assertions.assertNotNull(collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"126.06\", \"0.0\", \"0.0\");\n validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, \"1\", \"126.06\", \"0.0\", \"0.0\");\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"126.04\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"126.06\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"157.57\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"31.51\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"126.06\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3309.06\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"94.53\", \"31.51\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2911.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"157.57\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240.00\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"157.57\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID,\n (Integer) getloanCharge(amountPlusInterestPercentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"63.02\", \"31.51\", \"31.51\");\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3277.55\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3277.55\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2969.72\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"181.77\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.0\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2791.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"157.57\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3303\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3303\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3149.11\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"31.51\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"122.38\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3241.19\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3121.19\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3121.19\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3121.19\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3089.68\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"31.51\"), JournalEntry.TransactionType.CREDIT));\n }", "@Test\n public void loanWithCahargesOfTypeAmountPercentageAndCashBasedAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer percentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\"));\n addCharges(charges, percentageDisbursementCharge, \"1\", null);\n\n Integer percentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageSpecifiedDueDateCharge, \"1\", \"29 September 2011\");\n\n Integer percentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n clientID.toString(), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"120.00\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"149.11\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"29.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"120.00\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3300.60\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"120.00\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"90.89\", \"29.11\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2911.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"149.11\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240.00\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"149.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID, (Integer) getloanCharge(percentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"61.19\", \"29.11\", \"29.70\");\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3271.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3271.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2969.72\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"181.77\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2791.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"149.11\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3301.78\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3301.78\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3149.11\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"30.29\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"122.38\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3240.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3120.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3120.58\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3120.58\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3089.68\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"30.90\"), JournalEntry.TransactionType.CREDIT));\n }", "@Test\n\tpublic void testWithdraw() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);;\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(01, \"acc1\", 00000, 50.00, \"\"));\n\t\ttransactions.add(2, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tArrayList<Account> expected = new ArrayList<>();\n\t\texpected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Withdrawl Successful\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"fail withdrawing $50 + fee\", testResult);\n\t}", "@Test\n public void testVerser1() {\n\n //Arrange\n CompteBancaire cpt = new CompteBancaire(5000.0);\n double montant_a_verser = 1000.0;\n double excepted = 6000.0;\n\n //Act\n assertEquals(true, cpt.verser(montant_a_verser));\n\n //Assert\n assertEquals(excepted, cpt.getSolde(), 0);\n }", "@Test\n public void cscResultTest() {\n assertEquals(\"C\", authResponse.getCscResult());\n }", "@Test\r\n\tpublic void debitarRechazado() {\r\n\t}", "@Test\n public void testCrediCard() {\n PaymentInstrument instrument = new PaymentInstrument();\n instrument.setCardNumber(\"5424000000000015\");\n instrument.setCvv(\"999\");\n instrument.setMonth(\"12\");\n instrument.setYear(\"17\");\n\n PaymentGatewayRequest gatewayRequest = new PaymentGatewayRequest(\"Bying Test prodocut\", 6, instrument,300.00);\n gatewayRequest.setCustomerId(\"1419278590612\");\n gatewayRequest.setInvoiceNumber(\"INV0001\");\n gatewayRequest.setRefId(\"IN00021\");\n PaymentGatewayResponse process = authorizedNetGateway.process(gatewayRequest);\n\n LOG.debug(\"Response returend is \" + process);\n Assert.assertTrue(process.isSuccess());\n\n }", "@Test\n public void desiredCurNumberConversionUSD(){\n //standard set up\n CurrencyRates one = new CurrencyRates();\n //checks if 2 corresponds to USD\n assertEquals(\"USD\", one.desiredCurNumberConversion(2));\n }", "@Test\r\n public void testPayByCard() {\r\n \r\n int cost = 60;\r\n \r\n instance.payByCard(cost);\r\n \r\n }", "@Test\n\tpublic void testCheckSufficientCredits_True() {\n\n\t\tint creditsRequired = 1;\n\t\taccount.setCredits(10l);\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tSmsMessage msg = new SmsMessage();\n\t\tSmsTask smsTask = new SmsTask();\n\t\tsmsTask.setSakaiSiteId(SmsConstants.SMS_DEV_DEFAULT_SAKAI_SITE_ID);\n\t\tsmsTask.setSmsAccountId(account.getId());\n\t\tsmsTask.setDateCreated(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setDateToSend(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setStatusCode(SmsConst_DeliveryStatus.STATUS_PENDING);\n\t\tsmsTask.setAttemptCount(2);\n\t\tsmsTask.setMessageBody(SmsConstants.SMS_DEV_DEFAULT_SMS_MESSAGE_BODY);\n\t\tsmsTask.setSenderUserName(\"senderUserName\");\n\t\tsmsTask.setMaxTimeToLive(1);\n\t\tsmsTask.getSmsMessages().add(msg);\n\t\tsmsTask.setCreditEstimate(creditsRequired);\n\t\tmsg.setSmsTask(smsTask);\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertTrue(\"Expected sufficient credit\", sufficientCredits);\n\n\t\taccount.setCredits(0l);\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tboolean insufficientCredits = !smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertTrue(\"Expected insufficient credit\", insufficientCredits);\n\n\t}", "@Test\n\tpublic void testConvertAmountToCredits() {\n\t\tdouble amount = smsBillingImpl.convertCreditsToAmount(testCredits);\n\t\tdouble credits = smsBillingImpl.convertAmountToCredits(amount);\n\t\tAssert.assertTrue(credits == testCredits);\n\t}", "@Test\n public void binDebitTest() {\n assertFalse(authResponse.isBinDebit());\n }", "@Test\n\tpublic void testSettleCreditDifference() {\n\t\tint creditEstimate = 50;\n\t\tLong originalAccBalance = 150l;\n\n\t\tSmsAccount smsAccount = new SmsAccount();\n\t\tsmsAccount.setSakaiUserId(\"3\");\n\t\tsmsAccount.setSakaiSiteId(\"3\");\n\t\tsmsAccount.setMessageTypeCode(\"3\");\n\t\tsmsAccount.setOverdraftLimit(1000L);\n\t\tsmsAccount.setCredits(originalAccBalance);\n\t\tsmsAccount.setAccountName(\"accountname\");\n\t\tsmsAccount.setAccountEnabled(true);\n\t\thibernateLogicLocator.getSmsAccountLogic()\n\t\t\t\t.persistSmsAccount(smsAccount);\n\n\t\tSmsTask smsTask = new SmsTask();\n\t\tsmsTask.setSakaiSiteId(SmsConstants.SMS_DEV_DEFAULT_SAKAI_SITE_ID);\n\t\tsmsTask.setSenderUserName(\"sakaiUserId\");\n\t\tsmsTask.setSmsAccountId(smsAccount.getId());\n\t\tsmsTask.setDateCreated(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setDateToSend(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setStatusCode(SmsConst_DeliveryStatus.STATUS_PENDING);\n\t\tsmsTask.setAttemptCount(2);\n\t\tsmsTask.setMessageBody(SmsConstants.SMS_DEV_DEFAULT_SMS_MESSAGE_BODY);\n\t\tsmsTask.setSenderUserName(\"senderUserName\");\n\t\tsmsTask.setMaxTimeToLive(1);\n\t\tsmsTask.setCreditEstimate(creditEstimate);\n\t\tsmsTask.setGroupSizeActual(0);\n\t\tsmsTask.setMessageTypeId(SmsConstants.MESSAGE_TYPE_SYSTEM_ORIGINATING);\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTime(smsTask.getDateToSend());\n\t\tcal.add(Calendar.SECOND, smsTask.getMaxTimeToLive());\n\t\tsmsTask.setDateToExpire(cal.getTime());\n\t\thibernateLogicLocator.getSmsTaskLogic().persistSmsTask(smsTask);\n\n\t\tsmsBillingImpl.reserveCredits(smsTask);\n\n\t\tsmsAccount = hibernateLogicLocator.getSmsAccountLogic().getSmsAccount(\n\t\t\t\tsmsAccount.getId());\n\t\tAssert.assertNotNull(smsAccount);\n\n\t\t// Account was credited\n\t\tAssert.assertTrue(smsAccount.getCredits() < originalAccBalance);\n\n\t\tsmsBillingImpl.settleCreditDifference(smsTask, smsTask.getCreditEstimate(), smsTask.getCreditsActual());\n\n\t\tsmsAccount = hibernateLogicLocator.getSmsAccountLogic().getSmsAccount(\n\t\t\t\tsmsAccount.getId());\n\n\t\t// Account balance was returnd to origional state since the actual\n\t\t// groups size on the task was zero\n\t\tAssert.assertTrue(smsAccount.getCredits() == originalAccBalance);\n\n\t}", "@Test\n public void test2() {\n cashRegister.addTens(5);\n try {\n cashRegister.withdraw(0, 5);\n fail();\n } catch (InsufficientCashException e) {\n assertEquals(e.getMessage(), \"Not enough denominations\");\n }\n }", "@Test\n\tpublic void testValidTransaction() {\n\t\t\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\tdatabase.addCustomer(merchant);\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tString transJMSMessage = transHandle.generateTransactionJMSRequest();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\n\t\tassertEquals(\"Transaction participants are valid\",verifyParticipants);\n\t\tassertEquals(transJMSMessage,customer.getBankId()+\" \"+ merchant.getBankId()+ \" \" + amount + \" \" + \"comment\");\n\t}", "@Test\n public void testIsSameCurrency() {\n \n Money moneyUsd = new Money(new BigDecimal(\"1.23\"), Currency.getInstance(\"USD\"));\n Money moneyUsd2 = new Money(new BigDecimal(\"1.23\"), Currency.getInstance(\"USD\"));\n Money moneyCad = new Money(new BigDecimal(\"1.23\"), Currency.getInstance(\"CAD\"));\n\n assertTrue(\"Currencies same\", moneyUsd.isSameCurrency(moneyUsd2));\n assertTrue(\"Currencies same symmetric\", moneyUsd2.isSameCurrency(moneyUsd));\n assertFalse(\"Currencies different\", moneyUsd.isSameCurrency(moneyCad));\n \n }", "@Test\n public void withdrawTest() {\n\n WithdrawRequest withdrawRequest = WithdrawRequest.newBuilder()\n .setAccountNumber(7)\n .setAmount(40)\n .build();\n\n // this call waits for the response from the server\n this.blockingStub.withdraw(withdrawRequest)\n .forEachRemaining(money -> System.out.println(\"\\n\\tReceived : $\" + money.getValue()));\n }", "@Test\n public void loanWithCahargesOfTypeAmountPlusInterestPercentageAndUpfrontAccrualAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer amountPlusInterestPercentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\"));\n addCharges(charges, amountPlusInterestPercentageDisbursementCharge, \"1\", null);\n\n Integer amountPlusInterestPercentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC, ChargesHelper\n .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\", false));\n\n Integer amountPlusInterestPercentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\", false));\n addCharges(charges, amountPlusInterestPercentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount, expenseAccount,\n overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"126.06\", \"0.0\", \"0.0\");\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"126.04\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"126.06\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"31.51\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"31.51\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"605.94\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"126.04\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"605.94\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"126.04\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), \"29 September 2011\", \"1\"));\n\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, \"1\", \"126.06\", \"0.0\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"29 September 2011\",\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.DEBIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"29 September 2011\",\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3309.06\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"94.53\", \"31.51\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"157.57\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOG.info(\"----------- Waive installment charge for 2nd installment ---------\");\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID,\n (Integer) getloanCharge(amountPlusInterestPercentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"63.02\", \"31.51\", \"31.51\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"31.51\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"31.51\"), JournalEntry.TransactionType.DEBIT));\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3277.55\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3277.55\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3277.55\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.DEBIT));\n\n Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.0\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // checking the journal entry as applied penalty has been collected\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3303\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3303\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3303\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3241.19\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3121.19\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make over payment for repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3221.61\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3221.61\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3121.19\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForLiabilityAccount(overpaymentAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"100.42\"), JournalEntry.TransactionType.CREDIT));\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.getLoanDetail(REQUEST_SPEC, RESPONSE_SPEC, loanID, \"status\");\n LoanStatusChecker.verifyLoanAccountIsOverPaid(loanStatusHashMap);\n }", "@Test\n\tpublic void testDispenseCredit_1() throws Exception {\n\t\tint expense = d.dispense(50, 2);\n\t\tassertEquals(50, expense);\n\n\t\texpense = d.dispense(51, 2);\n\t\tassertEquals(50, expense);\n\n\t\texpense = d.dispense(100, 13);\n\t\tassertTrue(expense == 50);\n\t}", "@Test\n public void test1() throws Throwable {\n SitNFe sitNFe0 = SitNFe.COM_DANFE;\n boolean boolean0 = sitNFe0.isReenviar();\n assertEquals(false, boolean0);\n }", "@Test\n public void buyCard() throws Exception {\n model.getTurnTracker().setCurrentTurn(PlayerIndex.FIRST);\n when(devCardFacade.canBuyDevCard(currentPlayer)).thenReturn(true);\n dcc.buyCard();\n verify(devCardFacade, atMost(1)).buyDevCard(currentPlayer);\n }", "@Test\n public void testVerser2() {\n\n //Arrange\n CompteBancaire cpt = new CompteBancaire(6500.0);\n double montant_a_verser = -2000.0;\n double excepted = 6500.0;\n\n //Act\n assertEquals(false, cpt.verser(montant_a_verser));\n\n //Assert\n assertEquals(excepted, cpt.getSolde(), 0);\n\n }", "@Test\n public void loanWithFlatCahargesAndCashBasedAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer flatDisbursement = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC, ChargesHelper.getLoanDisbursementJSON());\n addCharges(charges, flatDisbursement, \"100\", null);\n Integer flatSpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"100\", false));\n addCharges(charges, flatSpecifiedDueDate, \"100\", \"29 September 2011\");\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);\n\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"100.00\", \"0.0\", \"0.0\");\n validateCharge(flatSpecifiedDueDate, loanCharges, \"100\", \"100.00\", \"0.0\", \"0.0\");\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"200.00\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"100.00\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"150.00\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"50.00\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3301.49\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n validateCharge(flatSpecifiedDueDate, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"150.00\", \"50.0\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2911.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"150.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240.00\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), \"29 October 2011\", \"100\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"150.00\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID, (Integer) getloanCharge(flatInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"100.00\", \"50.0\", \"50.0\");\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3251.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3251.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2969.72\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"181.77\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n Integer flatPenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"100\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), \"29 September 2011\", \"100\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatPenaltySpecifiedDueDate, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"100\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2811.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"150.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3301.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3129.11\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"50.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"122.38\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), \"10 January 2012\", \"100\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"100\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3239.68\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"100\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.DEBIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3139.68\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3139.68\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3139.68\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3089.68\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"50.00\"), JournalEntry.TransactionType.CREDIT));\n }", "@Test\n public void processCompoundTransaction_TestC() throws Exception {\n ct = new CompoundTransaction(\"compound\");\n\n Assert.assertEquals(false, trans_mang.processCompoundTransaction(ct));\n }", "@Test\n public void loanWithCahargesAndUpfrontAccrualAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer percentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\"));\n addCharges(charges, percentageDisbursementCharge, \"1\", null);\n\n Integer percentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageSpecifiedDueDateCharge, \"1\", \"29 September 2011\");\n\n Integer percentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount, expenseAccount,\n overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"120.00\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"149.11\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"29.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"605.94\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"605.94\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"120.00\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3300.60\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"120.00\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"90.89\", \"29.11\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"149.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOG.info(\"----------- Waive installment charge for 2nd installment ---------\");\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID, (Integer) getloanCharge(percentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"61.19\", \"29.11\", \"29.70\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"29.7\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"29.7\"), JournalEntry.TransactionType.DEBIT));\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3271.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3271.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3271.49\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.DEBIT));\n\n Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // checking the journal entry as applied penalty has been collected\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3301.78\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3301.78\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3301.78\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3240.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3120.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make over payment for repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3220.58\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3220.58\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3120.58\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForLiabilityAccount(overpaymentAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT));\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.getLoanDetail(REQUEST_SPEC, RESPONSE_SPEC, loanID, \"status\");\n LoanStatusChecker.verifyLoanAccountIsOverPaid(loanStatusHashMap);\n }", "@Test\n public void currencyTest() {\n assertEquals(\"GBP\", authResponse.getCurrency());\n }", "@Test(groups = \"his.wardadmission.test\", dependsOnMethods = { \"addWardTestCase\" })\n\tpublic void updateDischargeSignTestCase() throws IOException, JSONException {\n\n\t\tJSONObject jsonRequestObject = new JSONObject(RequestUtil\n\t\t\t\t.requestByID(TestCaseConstants.UPDATE_DISCHARGE_SIGN));\n\t\t\n\t\tArrayList<String> resArrayList = getHTTPResponse(\n\t\t\t\tproperties\n\t\t\t\t\t\t.getProperty(TestCaseConstants.URL_APPEND_UPDATE_DISCHARGE_SIGN),\n\t\t\t\tTestCaseConstants.HTTP_POST, jsonRequestObject.toString());\n\n\t\tSystem.out.println(\"message :\"+resArrayList.get(0));\n\n\t\tAssert.assertEquals(Integer.parseInt(resArrayList.get(1)),\n\t\t\t\tSUCCESS_STATUS_CODE);\n\t\t\n\t}", "@Test\n public void testSuccessTransferFundInsufficientFund() throws IOException, URISyntaxException {\n URI uri = builder.setPath(\"/transfers\").build();\n BigDecimal amount = new BigDecimal(100000).setScale(4, RoundingMode.HALF_EVEN);\n\n HttpPost request = new HttpPost(uri);\n request.setHeader(\"Content-type\", \"application/json\");\n request.setEntity(new StringEntity(mapper.writeValueAsString(new MoneyTransfer(amount, 1L, 4L))));\n HttpResponse response = client.execute(request);\n\n int statusCode = response.getStatusLine().getStatusCode();\n assertTrue(statusCode == 500);\n }", "@Test\n\tpublic void testChargePinDebitCard() throws Exception {\n\t\tHashMap<String, Object> mapBody = new HashMap<String, Object>();\n\t\tmapBody.put(\"amount\", 1.00);mapBody.put(\"currency\", \"USD\");\n\t\tmapBody.put(\"card\", returnMapCardWithCardPresent());\n\t\t\n\t\tHttpResponse response = TestUtil.post(CCChargeUrl,\n\t\t\t\tCCChargeHeaderParams, mapBody);\n\t\tHashMap<String, Object> result = validateChargeRes(response, 201, Status.CAPTURED.toString());\n\t}", "@Test\n\tpublic void testCharge() throws Exception {\n\t\tfor (int i = 0; i <= 500; i += 25) {\n\t\t\tint expense = d.dispense(50 + i, 2);\n\t\t\tassertEquals(50, expense);\n\t\t}\n\t}", "@Test\n public void test01ConfRespSignedByRecepient() throws Exception {\n log.trace(\">test01ConfRespSignedByRecepient\");\n\n this.cmpConfiguration.setResponseProtection(cmpAlias, \"signature\");\n this.cmpConfiguration.setCMPDefaultCA(cmpAlias, \"\");\n this.globalConfigurationSession.saveConfiguration(ADMIN, this.cmpConfiguration);\n\n byte[] nonce = CmpMessageHelper.createSenderNonce();\n byte[] transid = CmpMessageHelper.createSenderNonce();\n\n // Send a confirm message to the CA\n String hash = \"foo123\";\n PKIMessage confirm = genCertConfirm(userDN, this.cacert, nonce, transid, hash, 0, null);\n assertNotNull(confirm);\n ByteArrayOutputStream bao = new ByteArrayOutputStream();\n ASN1OutputStream dOut = ASN1OutputStream.create(bao, ASN1Encoding.DER);\n dOut.writeObject(confirm);\n byte[] ba = bao.toByteArray();\n // Send request and receive response\n byte[] resp = sendCmpHttp(ba, 200, cmpAlias);\n checkCmpResponseGeneral(resp, this.testx509ca.getSubjectDN(), userDN, this.cacert, nonce, transid, true, null, PKCSObjectIdentifiers.sha256WithRSAEncryption.getId());\n checkCmpPKIConfirmMessage(userDN, this.cacert, resp);\n\n log.trace(\"<test01ConfRespSignedByRecepient\");\n }", "@Test\n\tpublic void testCheckSufficientCredits_OverdraftFacility() {\n\n\t\tint creditsRequired = 11;\n\n\t\tSmsMessage msg = new SmsMessage();\n\t\tSmsTask smsTask = new SmsTask();\n\t\tsmsTask.setSakaiSiteId(SmsConstants.SMS_DEV_DEFAULT_SAKAI_SITE_ID);\n\t\tsmsTask.setSmsAccountId(account.getId());\n\t\tsmsTask.setDateCreated(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setDateToSend(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setStatusCode(SmsConst_DeliveryStatus.STATUS_PENDING);\n\t\tsmsTask.setAttemptCount(2);\n\t\tsmsTask.setMessageBody(SmsConstants.SMS_DEV_DEFAULT_SMS_MESSAGE_BODY);\n\t\tsmsTask.setSenderUserName(\"senderUserName\");\n\t\tsmsTask.setMaxTimeToLive(1);\n\t\tsmsTask.getSmsMessages().add(msg);\n\t\tsmsTask.setCreditEstimate(creditsRequired);\n\t\tmsg.setSmsTask(smsTask);\n\n\t\tboolean sufficientCredits = smsBillingImpl.checkSufficientCredits(\n\t\t\t\taccount.getId(), creditsRequired);\n\t\tAssert.assertFalse(\"Expected insufficient credit\", sufficientCredits);\n\t\thibernateLogicLocator.getSmsAccountLogic().persistSmsAccount(account);\n\t\tsufficientCredits = smsBillingImpl.checkSufficientCredits(account\n\t\t\t\t.getId(), creditsRequired);\n\t\tAssert.assertTrue(\"Expected insufficient credit\", !sufficientCredits);\n\t}", "@Test\n\tpublic final void testAccordanceWithStandard() {\n\t\tboolean isOk = jtxc.accordanceWithStandard(file);\n assertTrue(isOk);\n }", "@Test\n public void testVirement3() {\n\n //Arrange\n CompteBancaire cpt1 = new CompteBancaire(0.0);\n CompteBancaire cpt2 = new CompteBancaire(43000.0);\n double montant_a_virer = 8000.0;\n double excepted_solde_cpt1 = 0.0;\n double excepted_solde_cpt2 = 43000.0;\n\n //Act\n assertEquals(false, cpt1.virerArgent(cpt2, montant_a_virer));\n\n //Assert\n assertEquals(excepted_solde_cpt1, cpt1.getSolde(), 0);\n assertEquals(excepted_solde_cpt2, cpt2.getSolde(), 0);\n\n }", "@Test\n\tpublic void moneyTrnasferExcetionAccountNumberWrong() {\n\t\t\n\t\tint accountNumberNotExist = 1820;\n\t\tString accountNumberTo = createAccount(\"ram\",2000);\n\t\tdouble amountToBeTranfered = 40000.0;\n\t\tMoneyTransfer moneyTransfer = new MoneyTransfer();\n\t\tmoneyTransfer.setAccountNumberFrom(accountNumberNotExist);\n\t\tmoneyTransfer.setAccountNumberTo(Integer.parseInt(accountNumberTo));\n\t\tmoneyTransfer.setAmount(amountToBeTranfered);\n\t\t\n\t\tString requestBody = gson.toJson(moneyTransfer);\n\t\t\n\t\tRequestSpecification request = RestAssured.given();\n\t\trequest.body(requestBody);\n\t\tResponse response = request.put(\"/transfer\");\n\t\t\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - START\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"Account not found with Account Number : \");\n\t\tsb.append(accountNumberNotExist);\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - END\n\t\t\n\t\tAssertions.assertEquals(sb.toString(), response.asString());\n\t\t\n\t}", "@Test\n void bankListIsAccountExistToTransfer_accountExistWithSufficientMoneyToTransfer_success() {\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut(new PrintStream(outContent));\n BankList bankList = new BankList(storage);\n Ui uiTest = new Ui();\n Bank newSavingAccount = new Saving(\"Test Saving Account\", 1000, 2000);\n Bank newInvestmentAccount = new Investment(\"Test Investment Account\", 1000);\n String expectedReturnType = \"investment\";\n\n try {\n bankList.bankListAddBank(newSavingAccount, uiTest);\n bankList.bankListAddBank(newInvestmentAccount, uiTest);\n outContent.reset();\n String returnType = bankList.getTransferBankType(\"Test Investment Account\",\n 500);\n assertEquals(expectedReturnType, returnType);\n\n\n } catch (BankException error) {\n System.out.println(\"Expected no throw, but error thrown\");\n }\n\n assertEquals(2, bankList.getBankListSize());\n\n }", "public void testCC() throws Throwable {\n\n long ts = System.currentTimeMillis();\n String summary = \"somary\" + ts;\n String id = TestUtil.createIssue(getRepository(), summary);\n BugzillaIssue issue = (BugzillaIssue) getRepository().getIssue(id);\n openTask(issue);\n assertEquals(summary, issue.getFieldValue(IssueField.SUMMARY));\n\n resetStatusValues(issue);\n\n BugzillaRepository repository = getRepository();\n BugzillaRepositoryConnector brc = new BugzillaRepositoryConnector(new File(getWorkDir().getAbsolutePath(), \"bugzillaconfiguration\"));\n NbTask task = BugzillaUtil.getTask(repository, id, false);\n TaskData td = task.getTaskDataState().getRepositoryData();\n\n // add a cc\n assertNotSame(REPO_USER, issue.getFieldValue(IssueField.CC));\n setFieldValue(td, IssueField.NEWCC, REPO_USER);\n getRepository().getExecutor().execute(new SubmitCommand(brc, getRepository().getTaskRepository(), td));\n issue.refresh();\n \n assertEquals(REPO_USER, issue.getFieldValue(IssueField.CC));\n assertStatus(BugzillaIssue.FIELD_STATUS_MODIFIED, issue, IssueField.CC);\n\n resetStatusValues(issue);\n\n // add new cc\n td = task.getTaskDataState().getRepositoryData();\n setFieldValue(td, IssueField.NEWCC, REPO_USER2);\n getRepository().getExecutor().execute(new SubmitCommand(brc, getRepository().getTaskRepository(), td));\n issue.refresh();\n\n List<String> ccs = issue.getFieldValues(IssueField.CC);\n assertEquals(2, ccs.size());\n assertTrue(ccs.contains(REPO_USER));\n assertTrue(ccs.contains(REPO_USER2));\n assertStatus(BugzillaIssue.FIELD_STATUS_MODIFIED, issue, IssueField.CC);\n\n resetStatusValues(issue);\n \n // add two cc-s at once\n td = task.getTaskDataState().getRepositoryData();\n setFieldValue(td, IssueField.NEWCC, REPO_USER3 + \", \" + REPO_USER4);\n getRepository().getExecutor().execute(new SubmitCommand(brc, getRepository().getTaskRepository(), td));\n issue.refresh();\n\n ccs = issue.getFieldValues(IssueField.CC);\n assertEquals(4, ccs.size());\n assertTrue(ccs.contains(REPO_USER));\n assertTrue(ccs.contains(REPO_USER2));\n assertTrue(ccs.contains(REPO_USER3));\n assertTrue(ccs.contains(REPO_USER4));\n assertStatus(BugzillaIssue.FIELD_STATUS_MODIFIED, issue, IssueField.CC);\n\n resetStatusValues(issue);\n\n // remove a cc\n td = task.getTaskDataState().getRepositoryData();\n ccs = new ArrayList<String>();\n ccs.add(REPO_USER4);\n ccs.add(REPO_USER);\n setFieldValues(td, IssueField.REMOVECC, ccs);\n getRepository().getExecutor().execute(new SubmitCommand(brc, getRepository().getTaskRepository(), td));\n issue.refresh();\n\n ccs = issue.getFieldValues(IssueField.CC);\n assertEquals(2, ccs.size());\n assertTrue(ccs.contains(REPO_USER2));\n assertTrue(ccs.contains(REPO_USER3));\n assertStatus(BugzillaIssue.FIELD_STATUS_MODIFIED, issue, IssueField.CC);\n\n resetStatusValues(issue);\n\n // remove all\n td = task.getTaskDataState().getRepositoryData();\n ccs = new ArrayList<String>();\n ccs.add(REPO_USER3);\n ccs.add(REPO_USER2); \n setFieldValues(td, IssueField.REMOVECC, ccs);\n getRepository().getExecutor().execute(new SubmitCommand(brc, getRepository().getTaskRepository(), td));\n issue.refresh();\n ccs = issue.getFieldValues(IssueField.CC);\n assertEquals(0, ccs.size());\n assertStatus(BugzillaIssue.FIELD_STATUS_MODIFIED, issue, IssueField.CC);\n\n }", "@Test\r\n public void testValidarCPF() {\r\n System.out.println(\"validarCPF\");\r\n long cpf = 0L;\r\n ClienteDAO instance = new ClienteDAO();\r\n boolean expResult = false;\r\n boolean result = instance.validarCPF(cpf);\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "@Test\n\tpublic void createAccountDebtsTest() {\n\t\tsetChequingRadioDefaultOff();\n\t\trdbtnDebt.setSelected(true);\n\t\tdata.setRdbtnDebt(rdbtnDebt);\n\t\tAccount account = data.createNewAccount();\n\t\taccountTest = new Account(TEST_ACCOUNT_NAME, bankTest,\n\t\t\t\tAccount.Types.DEBITS.getAccountType());\n\t\tassertEquals(accountTest, account);\n\t}", "@Test\n public void transStatusTest() {\n assertEquals(\"P\", authResponse.getTransStatus());\n }", "@Test\n public void checkingAccount2() {\n Bank bank = new Bank();\n Customer bill = new Customer(\"Bill\");\n Account checkingAccount = new CheckingAccount(bill, Account.CHECKING);\n bank.addCustomer(new Customer(\"Bill\").openAccount(checkingAccount));\n Transaction t = new CreditTransaction(1000.0);\n t.setTransactionDate(getTestDate(-5));\n checkingAccount.addTransaction(t);\n\n assertEquals(Math.pow(1 + 0.001 / 365.0, 5) * 1000 - 1000, bank.totalInterestPaid(), DOUBLE_DELTA);\n }", "@Test\n public void loanWithFlatCahargesAndUpfrontAccrualAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer flatDisbursement = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC, ChargesHelper.getLoanDisbursementJSON());\n addCharges(charges, flatDisbursement, \"100\", null);\n Integer flatSpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"100\", false));\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount, expenseAccount,\n overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"100.00\", \"0.0\", \"0.0\");\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"200.00\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"100.00\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"50.00\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"50.00\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"605.94\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"200.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"605.94\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"200.00\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), \"29 September 2011\", \"100\"));\n\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n validateCharge(flatSpecifiedDueDate, loanCharges, \"100\", \"100.00\", \"0.0\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"29 September 2011\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.DEBIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"29 September 2011\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3301.49\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n validateCharge(flatSpecifiedDueDate, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"150.00\", \"50.0\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), \"29 October 2011\", \"100\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"150.00\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOG.info(\"----------- Waive installment charge for 2nd installment ---------\");\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID, (Integer) getloanCharge(flatInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"100.00\", \"50.0\", \"50.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"50.0\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"50.0\"), JournalEntry.TransactionType.DEBIT));\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3251.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3251.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3251.49\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.DEBIT));\n\n Integer flatPenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"100\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), \"29 September 2011\", \"100\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatPenaltySpecifiedDueDate, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"100\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // checking the journal entry as applied penalty has been collected\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3301.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), \"10 January 2012\", \"100\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"100\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3239.68\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"100\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3139.68\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make over payment for repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3220.60\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3220.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3139.68\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForLiabilityAccount(overpaymentAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"80.92\"), JournalEntry.TransactionType.CREDIT));\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.getLoanDetail(REQUEST_SPEC, RESPONSE_SPEC, loanID, \"status\");\n LoanStatusChecker.verifyLoanAccountIsOverPaid(loanStatusHashMap);\n }", "@Test\n\tpublic void testChargePinDebitCardWithDeviceInfo() throws Exception {\n\t\tHashMap<String, Object> mapBody = new HashMap<String, Object>();\n\t\tmapBody.put(\"amount\", 1.00);mapBody.put(\"currency\", \"USD\");\n\t\tmapBody.put(\"card\", returnMapCardWithCardPresent());\n\t\t\n\t\tHashMap<String, Object> mapCardContext = new HashMap<String, Object>();\n\t\tmapCardContext.put(\"deviceInfo\", constructMapDeviceInfo());\n\t\tmapBody.put(\"context\", mapCardContext);\n\t\t\n\t\tHttpResponse response = TestUtil.post(CCChargeUrl,\n\t\t\t\tCCChargeHeaderParams, mapBody);\n\t\tHashMap<String, Object> result = validateChargeRes(response, 201, Status.CAPTURED.toString());\n\t}", "@Test\n\tpublic void moneyTrnasferExcetionInsufficientBalanceOfFromAccount() {\n\t\t\n\t\tString accountNumberFrom = createAccount(\"krishna\",4000);\n\t\tString accountNumberTo = createAccount(\"ram\",2000);\n\t\tdouble amountToBeTranfered = 40000.0;\n\t\tMoneyTransfer moneyTransfer = new MoneyTransfer();\n\t\tmoneyTransfer.setAccountNumberFrom(Integer.parseInt(accountNumberFrom));\n\t\tmoneyTransfer.setAccountNumberTo(Integer.parseInt(accountNumberTo));\n\t\tmoneyTransfer.setAmount(amountToBeTranfered);\n\t\t\n\t\tString requestBody = gson.toJson(moneyTransfer);\n\t\t\n\t\tRequestSpecification request = RestAssured.given();\n\t\trequest.body(requestBody);\n\t\tResponse response = request.put(\"/transfer\");\n\t\t\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - START\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"Account Number - \");\n\t\tsb.append(accountNumberFrom);\n\t\tsb.append(\" do not have sufficient amout to transfer.\");\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - END\n\t\t\n\t\tAssertions.assertEquals(sb.toString(), response.asString());\n\t\t\n\t}", "@Test\r\n\tpublic void testValidationSuccess() {\r\n\t\tAccountTransferRequest accountTransferRequest = new AccountTransferRequest();\r\n\t\taccountTransferRequest.setUsername(VALID_USERNAME);\r\n\t\taccountTransferRequest.setPassword(VALID_PASSWORD);\r\n\t\taccountTransferRequest.setSenderAccount(VALID_SENDER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setReceiverAccount(VALID_RECEIVER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setTransferAmount(400.0);\t\t\r\n\t\ttry {\r\n\t\t\ttransferValidationUnit.validate(accountTransferRequest);\r\n\t\t} catch (ValidationException e) {\r\n\t\t\tAssert.fail(\"Found_Exception\");\r\n\t\t}\r\n\t}", "@Test\n public void testVirement2() {\n\n //Arrange\n CompteBancaire cpt1 = new CompteBancaire(63000.0);\n CompteBancaire cpt2 = new CompteBancaire(43000.0);\n double montant_a_virer = 88000.0;\n double excepted_solde_cpt1 = 63000.0;\n double excepted_solde_cpt2 = 43000.0;\n\n //Act\n assertEquals(false, cpt1.virerArgent(cpt2, montant_a_virer));\n\n //Assert\n assertEquals(excepted_solde_cpt1, cpt1.getSolde(), 0);\n assertEquals(excepted_solde_cpt2, cpt2.getSolde(), 0);\n\n }", "protected void acceptedPaymentVerification() {\n BillingSummaryPage.tableBillingGeneralInformation.getRow(1)\n .getCell(\"Current Due\").waitFor(cell -> !cell.getValue().equals(\"Calculating...\"));\n\n assertThat(BillingSummaryPage.tableBillingGeneralInformation.getRow(1))\n .hasCellWithValue(\"Current Due\", BillingHelper.DZERO.toString())\n .hasCellWithValue(\"Total Due\", BillingHelper.DZERO.toString())\n .hasCellWithValue(\"Total Paid\", modalPremiumAmount.get().toString());\n\n assertThat(BillingSummaryPage.tableBillsAndStatements.getRow(1).getCell(\"Status\")).valueContains(PAID_IN_FULL);\n\n assertThat(BillingSummaryPage.tablePaymentsOtherTransactions)\n .with(POLICY_NUMBER, masterPolicyNumber.get())\n .with(TYPE, PAYMENT)\n .with(TableConstants.BillingPaymentsAndTransactionsGB.AMOUNT, String.format(\"(%s)\", modalPremiumAmount.get().toString()))\n .containsMatchingRow(1);\n\n }", "@Test\n public void testBtcPrice() throws Exception {\n RetrieveCryptoPrices retrieveCryptoPrices = new RetrieveCryptoPrices();\n retrieveCryptoPrices.setBtcPrice(\"10000\");\n assertEquals(\"10000\", retrieveCryptoPrices.getBtcPrice());\n\n }", "public static void transfer() {\n\t\ttry {\n\t\t\tif (!LoginMgr.isLoggedIn()) {\n\t\t\t\tthrow new NotLoggedInException();\n\t\t\t}\n\n\t\t\t// Scanner s = new Scanner(System.in);\n\t\t\tSystem.out.println(\"Enter account number to transfer to: \");\n\t\t\tString accNum = \"\";\n\t\t\tif (Quinterac.s.hasNextLine())\n\t\t\t\taccNum = Quinterac.s.nextLine();\n\n\t\t\tif (!ValidAccListMgr.checkAccNumExist(accNum)) {\n\t\t\t\tSystem.out.println(\"Please enter a valid account number\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Enter account number to transfer from: \");\n\t\t\tString accNumB = \"\";\n\t\t\tif (Quinterac.s.hasNextLine())\n\t\t\t\taccNumB = Quinterac.s.nextLine();\n\n\t\t\tif (!ValidAccListMgr.checkAccNumExist(accNumB)) {\n\t\t\t\tSystem.out.println(\"Please enter a valid account number\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Enter the amount of money to transfer in cents: \");\n\t\t\tint amount = 0;\n\t\t\tif (Quinterac.s.hasNextInt())\n\t\t\t\tamount = Integer.parseInt(Quinterac.s.nextLine());\n\n\t\t\tString modeName = LoginMgr.checkMode();\n\t\t\tif (modeName.equals(\"machine\")) {\n\t\t\t\tatmCheckTransferValid(accNum, amount, accNumB);\n\t\t\t} else if (modeName.equals(\"agent\")) {\n\t\t\t\tagentCheckTransferValid(accNum, amount, accNumB);\n\t\t\t}\n\n\t\t} catch (NotLoggedInException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\n\t}", "@Test\r\n\tpublic void testDeliveryChuteFull() {\r\n\t\tdcListen.chuteFull(vend.getDeliveryChute());\r\n\t\tassertTrue(vend.getDeliveryChute().isDisabled());\r\n\t}", "public void testDecisionEnPasillosSeguirDerecho(){\r\n\t\tdireccionActual = Direccion.ABAJO;\r\n\t\tDireccion futura = cazar.haciaDondeIrDesdeUnaPosicionHastaOtraConDireccionActual(destino, uno, direccionActual);\r\n\t\tassertEquals(futura,Direccion.ABAJO);\r\n\r\n\t\tdireccionActual = Direccion.ARRIBA;\r\n\t\tfutura = cazar.haciaDondeIrDesdeUnaPosicionHastaOtraConDireccionActual(destino, cuatro, direccionActual);\r\n\t\tassertEquals(futura,Direccion.ARRIBA);\r\n\r\n\t\tdireccionActual = Direccion.IZQUIERDA;\r\n\t\tfutura = cazar.haciaDondeIrDesdeUnaPosicionHastaOtraConDireccionActual(destino, nueve, direccionActual);\r\n\t\tassertEquals(Direccion.IZQUIERDA,futura);\t\t\r\n\t}", "@Test\n public void testVirement1() {\n\n //Arrange\n CompteBancaire cpt1 = new CompteBancaire(63000.0);\n CompteBancaire cpt2 = new CompteBancaire(43000.0);\n double montant_a_virer = 28000.0;\n double excepted_solde_cpt1 = 35000.0;\n double excepted_solde_cpt2 = 71000.0;\n\n //Act\n assertEquals(true, cpt1.virerArgent(cpt2, montant_a_virer));\n\n //Assert\n assertEquals(excepted_solde_cpt1, cpt1.getSolde(), 0);\n assertEquals(excepted_solde_cpt2, cpt2.getSolde(), 0);\n\n }", "@Override\r\n\tpublic boolean fundTransfer(FundTransferBean fb, double amount) {\n\t\tboolean isValid = true;\r\n\t\tfor (CustomerBean cb1 : customerList) {\r\n\t\t\tif(cb1.getPhoneNum()== fb.getSourcePhoneNum()) {\r\n\t\t\t\tfor (CustomerBean cb2 : customerList) {\r\n\t\t\t\t\tif(cb2.getPhoneNum()==fb.getDesPhoneNum()) {\r\n\t\t\t\t\t\twithdraw(cb1,amount);\r\n\t\t\t\t\t\tdeposit(cb2,amount);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthrow new WalletException();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn isValid;\r\n\t}", "public void paymentgetSuccess() throws InterruptedException {\n\t\tAssert.assertTrue(driver.findElement(By.xpath(props.getProperty(\"payment_success\"))).isDisplayed(),\n\t\t\t\t\"Payment get success\");\n\t\tThread.sleep(3000);\n\t\tdriver.findElement(By.xpath(props.getProperty(\"i_payment\"))).click();\n\t\tdriver.findElement(By.xpath(props.getProperty(\"i_payment\"))).getText();\n\t}", "@Test\n public void testWithdraw() {\n System.out.println(\"withdraw\");\n double d = 1.0;\n Account instance = new Account(\"Piper\", 10.0);\n double expResult = 9.0;\n double result = instance.withdraw(d);\n assertEquals(expResult, result, 0.0);\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 transnoTest() {\n assertEquals(Integer.valueOf(74875), authResponse.getTransno());\n }", "public void testCheckout() throws InterruptedException {\n\t\taddressRadio.click();\n\t\tpFirstname.click();\n\t\tpFirstname.sendKeys(\"Paul\");\n\t\tpLastname.click();\n\t\tpLastname.sendKeys(\"Tal\");\n\t\tpAddress1.click();\n\t\tpAddress1.sendKeys(\"16 Talbi st\");\n\t\tpCity.click();\n\t\tpCity.sendKeys(\"Toronto\");\n\t\tpPostcode.click();\n\t\tpPostcode.sendKeys(\"M1V 3E8\");\n\t\tSelect cDropdown = new Select(selectC);\n\t\tcDropdown.selectByVisibleText(\"Canada\");\n\t\tSelect zDropdown = new Select(selectZ);\n\t\tzDropdown.selectByVisibleText(\"Ontario\");\n\t\tcontinueBilling.click();\n\t\tThread.sleep(3000);\n\t\tSelect aDropdown = new Select(selectA);\n\t\taDropdown.getFirstSelectedOption();\n\t\tdriver.findElement(By.cssSelector(\"#button-shipping-address\")).click();\n\t\tThread.sleep(3000);\n\t\tdriver.findElement(By.cssSelector(\"#button-shipping-method\")).click();\t\n\t\tThread.sleep(3000);\n\t\tdriver.findElement(By.cssSelector(\"input[type='checkbox'][name='agree']\")).click();\t\t\n\t\tdriver.findElement(By.cssSelector(\"#button-payment-method\")).click();\t\n\t\tdriver.findElement(By.cssSelector(\"input[value='Confirm Order']\")).click();\t\n\t\tThread.sleep(3000);\n\t\tif(driver.getCurrentUrl().contains(\"/success\")) {\n\t\t\tdriver.findElement(By.cssSelector(\"a[href*='/home']\")).click();\t\t\n\t\t\tAssert.assertTrue(true);\n\t\t} else {\n\t\t\tAssert.assertFalse(true);\n\t\t}\n\n\t}", "@Test\n public void spendShouldBeOK() throws Exception {\n UnsecureCompactBuilder compactBuilder = new UnsecureCompactBuilder();\n\n NonceClaim nonceClaim = new NonceClaim();\n nonceClaim.setNonce(\"nonce\");\n\n String jwt = compactBuilder.claims(nonceClaim).build().toString();\n\n NonceType nonceType = new NonceType();\n nonceType.setName(\"welcome\");\n\n Nonce nonce = new Nonce();\n nonce.setId(UUID.randomUUID());\n ResourceOwner ro = FixtureFactory.makeResourceOwner();\n nonce.setResourceOwner(ro);\n nonce.setNonceType(nonceType);\n\n when(mockHashToken.run(\"nonce\")).thenReturn(\"hashedNonce\");\n when(mockNonceRepository.getByTypeAndNonce(NonceName.WELCOME, \"hashedNonce\")).thenReturn(nonce);\n\n subject.spend(jwt, NonceName.WELCOME);\n\n verify(mockNonceRepository).setSpent(nonce.getId());\n verify(mockNonceRepository).revokeUnSpent(nonce.getNonceType().getName(), nonce.getResourceOwner().getId());\n }", "@Test\n public void testSuccessWithDrawSufficientFund() throws IOException, URISyntaxException {\n URI uri = builder.setPath(\"/accounts/1/withdraw/10\").build();\n\n HttpPut request = new HttpPut(uri);\n request.setHeader(\"Content-type\", \"application/json\");\n HttpResponse response = client.execute(request);\n int statusCode = response.getStatusLine().getStatusCode();\n assertTrue(statusCode == 200);\n\n assertTrue(mapper.readValue(EntityUtils.toString(response.getEntity()), AccountDetails.class).getAccountBalance()\n .equals(new BigDecimal(100).setScale(4, RoundingMode.HALF_EVEN)));\n\n }", "@Test\n public void testDeposit() {\n System.out.println(\"deposit\");\n double d = 1.0;\n Account instance = new Account(\"Piper\", 10.0);\n double expResult = 11.0;\n double result = instance.deposit(d);\n assertEquals(expResult, result, 0.0);\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 loanWithChargesOfTypeAmountPercentageAndPeriodicAccrualAccountingEnabled() throws InterruptedException {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer percentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\"));\n addCharges(charges, percentageDisbursementCharge, \"1\", null);\n\n Integer percentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageSpecifiedDueDateCharge, \"1\", \"29 September 2011\");\n\n Integer percentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount, expenseAccount,\n overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"120.00\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"149.11\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"29.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,\n GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n ArrayList<HashMap> loanTransactionDetails = LOAN_TRANSACTION_HELPER.getLoanTransactionDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n validateAccrualTransactionForDisbursementCharge(loanTransactionDetails);\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"120.00\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3300.60\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"120.00\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"90.89\", \"29.11\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"149.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOG.info(\"----------- Waive installment charge for 2nd installment ---------\");\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID, (Integer) getloanCharge(percentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"61.19\", \"29.11\", \"29.70\");\n\n /*\n * JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount( assetAccount, \"20 September 2011\", new\n * JournalEntry(Float.parseFloat(\"29.7\"), JournalEntry.TransactionType.CREDIT));\n * JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount (expenseAccount, \"20 September 2011\", new\n * JournalEntry(Float.parseFloat(\"29.7\"), JournalEntry.TransactionType.DEBIT));\n */\n\n final String jobName = \"Add Accrual Transactions\";\n\n SCHEDULER_JOB_HELPER.executeAndAwaitJob(jobName);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n checkAccrualTransactions(loanSchedule, loanID);\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3271.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3271.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3271.49\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.DEBIT));\n\n Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // checking the journal entry as applied penalty has been collected\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3301.78\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3301.78\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3301.78\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3240.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3120.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3120.58\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3120.58\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3120.58\"), JournalEntry.TransactionType.CREDIT));\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.getLoanDetail(REQUEST_SPEC, RESPONSE_SPEC, loanID, \"status\");\n LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap);\n }", "@Test\n public void processCompoundTransaction_TestD() throws Exception {\n ct = new CompoundTransaction(\"compound1\");\n ct1 = new CompoundTransaction(\"compound2\");\n\n acc3 = new Account(3,\"Jacob&Leon3\",2000);\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n acc_db.addAccount(acc3);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),100));\n ct.addTransaction(new Transaction(\"atomic2\", acc_db,acc3.get_Account_Number(),acc2.get_Account_Number(),100));\n\n ct1.addTransaction(new Transaction(\"atomic3\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),200));\n\n ct.addTransaction(ct1);\n\n Assert.assertEquals(true,trans_mang.processCompoundTransaction(ct));\n }", "@Test\n public void loanWithChargesOfTypeAmountPlusInterestPercentageAndPeriodicAccrualAccountingEnabled() throws InterruptedException {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer amountPlusInterestPercentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\"));\n addCharges(charges, amountPlusInterestPercentageDisbursementCharge, \"1\", null);\n\n Integer amountPlusInterestPercentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC, ChargesHelper\n .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\", false));\n addCharges(charges, amountPlusInterestPercentageSpecifiedDueDateCharge, \"1\", \"29 September 2011\");\n\n Integer amountPlusInterestPercentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\", false));\n addCharges(charges, amountPlusInterestPercentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount, expenseAccount,\n overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"126.06\", \"0.0\", \"0.0\");\n validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, \"1\", \"126.06\", \"0.0\", \"0.0\");\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"126.04\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"126.06\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"157.57\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"31.51\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"126.06\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3309.06\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"94.53\", \"31.51\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"157.57\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOG.info(\"----------- Waive installment charge for 2nd installment ---------\");\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID,\n (Integer) getloanCharge(amountPlusInterestPercentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"63.02\", \"31.51\", \"31.51\");\n\n /*\n * JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount( assetAccount, \"20 September 2011\", new JournalEntry(\n * Float.parseFloat(\"31.51\"), JournalEntry.TransactionType.CREDIT));\n * JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount (expenseAccount, \"20 September 2011\", new\n * JournalEntry(Float.parseFloat(\"31.51\"), JournalEntry.TransactionType.DEBIT));\n */\n\n final String jobName = \"Add Accrual Transactions\";\n\n SCHEDULER_JOB_HELPER.executeAndAwaitJob(jobName);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n checkAccrualTransactions(loanSchedule, loanID);\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3277.55\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3277.55\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3277.55\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.DEBIT));\n\n Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.0\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // checking the journal entry as applied penalty has been collected\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3303\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3303\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3303\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3241.19\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3121.19\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3121.19\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3121.19\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3121.19\"), JournalEntry.TransactionType.CREDIT));\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.getLoanDetail(REQUEST_SPEC, RESPONSE_SPEC, loanID, \"status\");\n LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap);\n }", "public boolean deposito(int idConta, double quantia) {\n try {\n Conta conta = new Conta(idConta); //deveria poder fazer isto\n boolean executado = conta.depositoConta(quantia);\n System.out.println(executado ? \"Deposito efetuado com sucesso.\" : \"Erro ao Efeuar o Deposito\" );\n return executado;\n } catch (Exception e) {\n System.out.println(\"Erro no serviço deposito: \" + e.getMessage());\n return false;\n } \n}", "@Test\n public void cash() {\n System.out.println(BotClient.getCash(0));\n }", "@Test(expected = InsufficientCreditException.class)\n\tpublic void testDispenseCredit_2() throws Exception {\n\t\tint expense = d.dispense(50, 2);\n\t\tassertEquals(50, expense);\n\n\t\texpense = d.dispense(51, 2);\n\t\tassertEquals(50, expense);\n\n\t\texpense = d.dispense(100, 13);\n\t\tassertTrue(expense == 50);\n\n\t\texpense = d.dispense(49, 2);\n\t}", "public void testUsarCarta(){\n\t\tassertFalse(c1.haSidoUsada());\r\n\t\tc1.usarCarta();\r\n\t\tassertTrue(c1.haSidoUsada());\r\n\t\tc1.reiniciarCarta();\r\n\t\tassertFalse(c1.haSidoUsada());\r\n\t}", "public void testDecisionEnPasillosDoblar(){\r\n\t\tdireccionActual = Direccion.ARRIBA;\r\n\t\tDireccion futura = cazar.haciaDondeIrDesdeUnaPosicionHastaOtraConDireccionActual(destino, cinco, direccionActual);\r\n\t\tassertEquals(Direccion.DERECHA,futura);\r\n\r\n\t\tdireccionActual = Direccion.IZQUIERDA;\r\n\t\tfutura=cazar.haciaDondeIrDesdeUnaPosicionHastaOtraConDireccionActual(destino, cinco, direccionActual);\r\n\t\tassertEquals(Direccion.ABAJO,futura);\r\n\t\t\r\n\t\tdireccionActual = Direccion.IZQUIERDA;\r\n\t\tfutura = cazar.haciaDondeIrDesdeUnaPosicionHastaOtraConDireccionActual(destino, tres, direccionActual);\r\n\t\tassertEquals(Direccion.ARRIBA, futura);\r\n\t\t\r\n\t\tdireccionActual = Direccion.DERECHA;\r\n\t\tfutura = cazar.haciaDondeIrDesdeUnaPosicionHastaOtraConDireccionActual(destino, seis, direccionActual);\r\n\t\tassertEquals(Direccion.ARRIBA, futura);\r\n\t}", "@Test\n public void testCalculateNominationCuantity2() throws FileNotFoundException {\n System.out.println(\"testCalculateNominationCuantity 2\");\n double expResult = 125.0;\n double result = calc.getChange(124d, calc.calculateDenominationCuantity(124d));\n assertEquals(expResult, result);\n }", "@Test\n\tpublic void createAccountCashTest() {\n\t\tsetChequingRadioDefaultOff();\n\t\trdbtnCash.setSelected(true);\n\t\tdata.setRdbtnCash(rdbtnCash);\n\t\tAccount account = data.createNewAccount();\n\t\taccountTest = new Account(TEST_ACCOUNT_NAME, bankTest,\n\t\t\t\tAccount.Types.CASH.getAccountType());\n\t\tassertEquals(accountTest, account);\n\n\t}", "@Test\r\n\tpublic void debitarAprobado() {\r\n\t}", "public void testDecisionDeDarLaVueltaSiNoHaySalida(){\r\n\t\tdireccionActual = Direccion.ARRIBA;\r\n\t\tDireccion futura = cazar.haciaDondeIrDesdeUnaPosicionHastaOtraConDireccionActual(destino, uno, direccionActual);\r\n\t\tassertEquals(Direccion.ABAJO, futura);\r\n\r\n\t\tdireccionActual = Direccion.DERECHA;\r\n\t\tfutura= cazar.haciaDondeIrDesdeUnaPosicionHastaOtraConDireccionActual(destino, siete, direccionActual);\r\n\t\tassertEquals(Direccion.IZQUIERDA, futura);\r\n\t}" ]
[ "0.6909692", "0.6784337", "0.67500305", "0.64509606", "0.64415586", "0.63373137", "0.63005656", "0.62969697", "0.627906", "0.62774616", "0.6240592", "0.62275684", "0.6224149", "0.62000024", "0.6160644", "0.6144756", "0.61353517", "0.61085033", "0.6105973", "0.6098067", "0.6096142", "0.60743934", "0.6041135", "0.6027602", "0.5976101", "0.5973981", "0.59691346", "0.5923949", "0.58788073", "0.5864916", "0.5857092", "0.5848876", "0.5841087", "0.5840603", "0.5829384", "0.5808438", "0.580541", "0.5804904", "0.5803529", "0.58017516", "0.579267", "0.57729596", "0.5770602", "0.5769891", "0.5761859", "0.5757422", "0.57569385", "0.5749366", "0.5740485", "0.57357836", "0.57357365", "0.5735023", "0.57346594", "0.5726837", "0.57244444", "0.571523", "0.5708797", "0.56988764", "0.5697472", "0.5697435", "0.5695887", "0.5674729", "0.565306", "0.56482494", "0.56417143", "0.56363136", "0.5631806", "0.5622543", "0.56121314", "0.5610406", "0.56062853", "0.5605749", "0.55919474", "0.5588452", "0.5574032", "0.5565185", "0.5563473", "0.5558469", "0.5553139", "0.5551214", "0.5545965", "0.5540341", "0.5539502", "0.5535535", "0.55352646", "0.55347836", "0.5531113", "0.5527042", "0.55191636", "0.55186486", "0.5516411", "0.55135596", "0.55048335", "0.55047053", "0.55020905", "0.5496624", "0.5489926", "0.54897815", "0.5457341", "0.54493177" ]
0.71290994
0
Constructs a BranchSkeleton object by given parameters, as detailed here.
public Branch(int nCurveRes,float nCurve,float nCurveBack,float nCurveV,Random rand,float totalLength,float radius,Point3f startPoint,Vector3f startVector,float offset) { setStartPoints(nCurveRes,radius,startVector,rand,offset,totalLength); //Some initialization. setVectors(nCurveRes,nCurve,nCurveBack,nCurveV); points=utils.ThreeD.setPoints(directions,startPoint); //Derives points from vectors and starting point. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Branch() { }", "BranchingBlock createBranchingBlock();", "WithCreate withBranch(String branch);", "private BaleElement.Branch createOuterBranch(BaleAstNode sn)\n{\n switch (sn.getNodeType()) {\n case FILE :\n\t return new BaleElement.CompilationUnitNode(for_document,cur_parent);\n case CLASS :\n\t return new BaleElement.ClassNode(for_document,cur_parent);\n case METHOD :\n\t return new BaleElement.MethodNode(for_document,cur_parent);\n case FIELD :\n\t return new BaleElement.FieldNode(for_document,cur_parent);\n case ANNOTATION :\n\t return new BaleElement.AnnotationNode(for_document,cur_parent);\n case STATEMENT :\n\t return new BaleElement.SplitStatementNode(for_document,cur_parent);\n case EXPRESSION :\n\t return new BaleElement.SplitExpressionNode(for_document,cur_parent);\n case BLOCK :\n\t return new BaleElement.BlockNode(for_document,cur_parent);\n case SWITCH_BLOCK :\n\t return new BaleElement.SwitchBlockNode(for_document,cur_parent);\n case INITIALIZER :\n\t return new BaleElement.InitializerNode(for_document,cur_parent);\n case SET :\n\t // return new BaleElement.DeclSet(for_document,cur_parent);\n\t break;\n default:\n\t break;\n }\n return null;\n}", "public BranchDetails(String branchName, Integer changesetsAhead, Integer changesetsBehind) {\n this.branchName = branchName;\n this.changesetsAhead = changesetsAhead;\n this.changesetsBehind = changesetsBehind;\n }", "MultipleBranchingBlock createMultipleBranchingBlock();", "public ArrayList <Branch> createBranch(){\n\t\tPVector dir1 =PVector.sub(loc_end,loc_begin);\n\t\tPVector dir2 =PVector.sub(loc_end,loc_begin);\n\t\t//println(\"loc_newEnd1: \"+loc_end.x+\" : \"+loc_end.y);\n\t\t//println(\"loc_newEnd1: \"+dir1.x+\" : \"+dir1.y);\n\t\tdir1.rotate(random(PI/4,PI/5));\n\t\tdir1.mult(0.67f);\n\t\tPVector loc_newEnd1 = PVector.add(loc_end,dir1);\n\t\tBranch branch_a = new Branch(this.loc_end,loc_newEnd1);\n\t\t\n\t\tdir2.rotate(random(-PI/4,-PI/5));\n\t\tdir2.mult(0.67f);\n\t\tPVector loc_newEnd2 = PVector.add(loc_end,dir2);\n\t\tBranch branch_b = new Branch(this.loc_end,loc_newEnd2);\n\n\t\tArrayList<Branch> bs = new ArrayList<Branch>() ;\n\t\tbs.add(branch_a);\n\t\tbs.add(branch_b);\n\t\tcomplete=true;\n\n\t\t\n\t\t//println(\"loc_newEnd2: \"+loc_newEnd2.x+\" : \"+loc_newEnd2.y);\n\t\t\n\t\treturn bs;\n\n\t}", "public Branch3(int firstX1, int firstY1, int firstX2, int firstY2) {\n super(firstX1, firstY1, firstX2, firstY2);\n middle = null;\n }", "public BranchDetails(String branchName) {\n this(branchName, null, null);\n }", "public LarvaSkeleton() {\n\n }", "public Branch(String label, Node node) {\n super(label);\n\n if (node == null) {\n throw new InvalidParameterException(\"Cannot create branch with no node.\");\n }\n\n this.node = node;\n }", "BOp createBOp();", "public Branch(int id, String name, String regionCode) {\n this(name,regionCode);\n this.id = id;\n }", "BranchGroup createSceneGraph() {\n BranchGroup objRoot = new BranchGroup();\n\n // Add the primitives to the scene\n setupSpheres();\n objRoot.addChild(spheresSwitch);\n setupGrid();\n objRoot.addChild(gridSwitch);\n objRoot.addChild(lightGroup);\n objRoot.addChild(bgSwitch);\n objRoot.addChild(fogSwitch);\n objRoot.addChild(soundSwitch);\n\n KeyPrintBehavior key = new KeyPrintBehavior();\n key.setSchedulingBounds(infiniteBounds);\n objRoot.addChild(key);\n return objRoot;\n }", "private MazeTree createBranch(boolean generate, MazeTree baseCell, String branch, int longestPath, int x, int y) throws InterruptedException {\n x = modifyX(branch, x);\n y = modifyY(branch, y);\n if (generate & !isPanelUsed(x, y)) {\n return createMaze(baseCell, longestPath - 1, branch);\n }\n return null;\n }", "public RelocateBranch() {\n }", "@Override\n\tpublic B makeB(Map<String, String> attributes, Div divObj) {\n\t\treturn new B( attributes, divObj );\n\t}", "public Branch(E e) {\n\t\tinfo = e;\n\t\tisLeaf = true;\n\t}", "public BranchAndBound() {\n this.timeFi = Long.parseLong(\"2000000000000\");;\n this.numSoluciones = 0;\n }", "private BranchGroup createBranchGroup() {\n BranchGroup bg = new BranchGroup();\n\n TransformGroup tg = new TransformGroup();\n tg.addChild(new ColorCube(0.3f));\n\n // creo un'istanza Transform3D per ogni asse\n Transform3D rotationX = new Transform3D();\n Transform3D rotationY = new Transform3D();\n Transform3D rotationZ = new Transform3D();\n\n // applico le trasformazioni tramite \"rotX\", \"rotY\" e \"rotZ\"\n rotationX.rotX(Math.PI * 0.2d);\n rotationY.rotY(Math.PI * 0.2d);\n\n // Unisco le trasformazioni\n rotationY.mul(rotationX);\n rotationZ.rotZ(Math.PI * 0.2d);\n rotationZ.mul(rotationY);\n\n // applico la trasformazione al TransformGroup e la aggiungo al branchgroup\n tg.setTransform(rotationZ); \n bg.addChild(tg);\n\n return bg;\n }", "@Override\r\n\tprotected Element createBranchElement(Element parent, AttributeSet a) {\n\t\tswitch (this.branchContext) {\r\n\t\t\tcase FILE_HEADER:\r\n\t\t\t\treturn new FileHeaderBranchElement(parent, a);\r\n\t\t\tcase BEFORE_HEX:\r\n\t\t\t\treturn new BeforeHexBranchElement(parent, a);\r\n\t\t\tcase AFTER_HEX:\r\n\t\t\t\treturn new AfterHexBranchElement(parent, a);\r\n\t\t\tcase HEX_HEADER:\r\n\t\t\t\treturn new HexHeaderBranchElement(parent, a);\r\n\t\t\tcase HEX_CODE:\r\n\t\t\t\treturn new HexCodeBranchElement(parent, a);\r\n\t\t\tdefault:\r\n\t\t\t\t// fall-back case\r\n\t\t\t\treturn super.createBranchElement(parent, a);\r\n\t\t}\r\n\t}", "public abstract OwObjectSkeleton createObjectSkeleton(OwObjectClass objectclass_p, OwResource resource_p) throws Exception;", "public GitBranch(String aName) { _name = aName; }", "interface WithBranch {\n /**\n * Specifies the branch property: The repo branch of the source control. Include branch as empty string for\n * VsoTfvc..\n *\n * @param branch The repo branch of the source control. Include branch as empty string for VsoTfvc.\n * @return the next definition stage.\n */\n WithCreate withBranch(String branch);\n }", "public Branch createBreak(Position pos) {\n return xnf.Break(pos);\n }", "@Override\n public CreateBranchResult createBranch(CreateBranchRequest request) {\n request = beforeClientExecution(request);\n return executeCreateBranch(request);\n }", "protected TreeItem createBranch(Object value) {\r\n return createBranch(value, false);\r\n }", "BElementStructure createBElementStructure();", "public BLabel()\n {\n this((String) null, WEST);\n }", "public void initStackBricks() {\n\t\tdouble brickSize = MainApplication.WINDOW_HEIGHT / ASPECT_RATIO;\n\t\t// Array of numbered blocks, also formats them\n\t\tfor (int i = 0; i < callStack; i++) {\n\t\t\tstackBricks[i] = new GButton(String.valueOf(i + 1), (i + 1) * brickSize, 0.0, brickSize, brickSize,\n\t\t\t\t\tlevelColor(i + 1), Color.WHITE);\n\t\t}\n\t}", "public Bout()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1); \n CreaBoutique();\n\n }", "public ContentLeaf(SequenceNumber branch, int startPosition, BeContentElement contentElement) {\n\tsuper(branch, startPosition);\n\tsetContentElement(contentElement);\n}", "BR createBR();", "public Branch(String name, Commit root, Gitlet git){\n\t\tmyRoot = root;\n\t\tmyName = name;\n\t\tmyLeaf = root;\n\t\tmyGit = git;\n\t\tmyGit.getMyBranches().put(myName, this);\n\t}", "public void create(Branch branch) {\n branch_dao.create(branch);\n }", "private BranchGroup createSceneGraph() {\n\n\t\t// create the main BranchGroup\n\t\tBranchGroup objRoot = new BranchGroup();\n\n\t\tobjRoot.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\n\t\tobjRoot.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);\n\n\t\t// reckon the size of the graph\n\t\tint nbRules = rules.length;\n\n\t\tfloat[] maxC = new float[criteres.length];\n\t\tfloat[] minC = new float[criteres.length];\n\n\t\tint nRule, nCrit;\n\t\tAttribute attr;\n\t\tfloat val;\n\t\tHashtable htAttrs = new Hashtable();\n\n\t\tfor (nRule = 0; nRule < nbRules; nRule++) {\n\t\t\t//make a list of all attributes\n\t\t\tIterator it = (rules[nRule].getCondition()).listIterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tattr = (Attribute) it.next();\n\t\t\t\thtAttrs.put(attr.toString(), attr);\n\t\t\t}\n\n\t\t\tattr = rules[nRule].getConclusion();\n\t\t\thtAttrs.put(attr.toString(), attr);\n\n\t\t\t//find min & max of each criteres\n\t\t\tfor (nCrit = 0; nCrit < criteres.length; nCrit++) {\n\t\t\t\tval = (rules[nRule].getCritere(criteres[nCrit]).getValue());\n\n\t\t\t\tif (nRule == 0) {\n\t\t\t\t\tmaxC[nCrit] = val;\n\t\t\t\t\tminC[nCrit] = val;\n\t\t\t\t} else {\n\t\t\t\t\tif (maxC[nCrit] < val)\n\t\t\t\t\t\tmaxC[nCrit] = val;\n\t\t\t\t\tif (minC[nCrit] > val)\n\t\t\t\t\t\tminC[nCrit] = val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tLinkedList lAttrs = new LinkedList(htAttrs.values());\n\t\tint nbAttrs = lAttrs.size();\n\n\t\tfloat size = .040f;\t\t\n//\t\tfloat size = 0.85f/(nbAttrs+10);\n//\t\tfloat size = 0.05f - (0.0006f * nbRules);\n\n\t\t// create a new BranchGroup to turn the scene\n\t\tTransform3D tRotateX = new Transform3D();\n\t\ttRotateX.rotX(Math.PI / 6.0d);\n\t\tTransform3D tRotateY = new Transform3D();\n\t\ttRotateY.rotY(-Math.PI / 6.0d);\n\t\ttRotateX.mul(tRotateY);\n\t\tfloat minSize = Math.min(0.75f/(nbAttrs+10), 0.05f - (0.0006f * nbRules));\n\n\n\n\t\tTransform3D tScale = new Transform3D();\n\t\ttScale.setScale(minSize/size);\n\t\ttRotateX.mul(tScale);\n\t\tTransformGroup tgRotate = new TransformGroup(tRotateX);\n\n\t\tobjRoot.addChild(tgRotate);\n\n\t\t// create a new BranchGroup \n\t\tBranchGroup bgObjGraph = new BranchGroup();\n\n\t\ttgRotate.addChild(bgObjGraph);\n\n\t\t// Draw the graph\n\t\tint nAtt;\n\t\tboolean drawn;\n\t\tRule currentRule;\n\t\tLinkedList ruleLHS;\n\t\tIterator idxRulesLHS;\n\t\tfor (nRule = 0; nRule < nbRules; nRule++) {\n\t\t\tcurrentRule = rules[nRule];\n\t\t\tfor (nAtt = 0; nAtt < nbAttrs; nAtt++) {\n\t\t\t\tidxRulesLHS = (currentRule.getCondition()).listIterator();\n\t\t\t\tdrawn = false;\n\t\t\t\tif (currentRule\n\t\t\t\t\t.getConclusion()\n\t\t\t\t\t.equals(((Attribute) lAttrs.get(nAtt)))) {\n\t\t\t\t\t//draw as a conclusion\t\n\t\t\t\t\tbgObjGraph.addChild(\n\t\t\t\t\t\tcreateBox(\n\t\t\t\t\t\t\t(nRule * size) - (nbRules / 2 * size),\n\t\t\t\t\t\t\tnAtt * size,\n\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\tnew Color3f(Color.RED)));\n\t\t\t\t\tdrawn = true;\n\t\t\t\t}\n\t\t\t\tif (!drawn) {\n\t\t\t\t\twhile (idxRulesLHS.hasNext()) {\n\t\t\t\t\t\tif (((Attribute) idxRulesLHS.next())\n\t\t\t\t\t\t\t.equals((Attribute) lAttrs.get(nAtt))) {\n\t\t\t\t\t\t\t//draw as an attribute\t\n\t\t\t\t\t\t\tbgObjGraph.addChild(\n\t\t\t\t\t\t\t\tcreateBox(\n\t\t\t\t\t\t\t\t\t(nRule * size) - (nbRules / 2 * size),\n\t\t\t\t\t\t\t\t\tnAtt * size,\n\t\t\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\t\t\tnew Color3f(Color.green)));\n\t\t\t\t\t\t\tdrawn = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!drawn) {\n\t\t\t\t\t//draw as nothing\t\n\t\t\t\t\tbgObjGraph.addChild(\n\t\t\t\t\t\tcreateBox(\n\t\t\t\t\t\t\t(nRule * size) - (nbRules / 2 * size),\n\t\t\t\t\t\t\tnAtt * size,\n\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\tsize / 10,\n\t\t\t\t\t\t\tnew Color3f(Color.BLACK)));\n\t\t\t\t}\n\n\t\t\t\t// draw criteres values\n\t\t\t\tfor (nCrit = 0; nCrit < criteres.length; nCrit++) {\n\t\t\t\t\tval = (rules[nRule].getCritere(criteres[nCrit]).getValue());\n\t\t\t\t\tbgObjGraph.addChild(\n\t\t\t\t\t\tcreateBox((nRule*size)-(nbRules/2*size),\n\t\t\t\t\t\t\t-(nCrit+1)*size,\n\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\t5*size*nCrit+(val-minC[nCrit])*4*size/(maxC[nCrit]-minC[nCrit]),\n\t\t\t\t\t\t\tnew Color3f(ColorArray.colorArray[nCrit + 3])));\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t//draw rule ID\t\n\t\t\tbgObjGraph.addChild(\n\t\t\t\tcreateTextY(\n\t\t\t\t\t(nRule * size) - (nbRules / 2 * size),\n\t\t\t\t\tnAtt * size,\n\t\t\t\t\tsize,\n\t\t\t\t\tcurrentRule.getId(),\n\t\t\t\t\tnew Color3f(Color.WHITE)));\n\n\t\t}\n\n\t\t// draw ladder\n\t\tint i;\n\t\tLineArray axis;\n\t\tfor (i = 0; i < 10; i++) {\n\t\t\taxis = new LineArray(2, LineArray.COORDINATES | LineArray.COLOR_3);\n\t\t\taxis.setCoordinate(\n\t\t\t\t0,\n\t\t\t\tnew Point3f(- (nbRules + 4) * size / 2, i * size, -size));\n\t\t\taxis.setCoordinate(\n\t\t\t\t1,\n\t\t\t\tnew Point3f((nbRules + 4) * size / 2, i * size, -size));\n\t\t\taxis.setColor(0, new Color3f(1f, 0f, 1f));\n\t\t\taxis.setColor(1, new Color3f(1f, 0f, 1f));\n\n\t\t\tbgObjGraph.addChild(new Shape3D(axis));\n\t\t}\n\n\t\t//draw min/max\n\t\tfor (nCrit = 0; nCrit < criteres.length; nCrit++) {\n\t\t\tbgObjGraph.addChild(\n\t\t\t\tcreateTextScale(\n\t\t\t\t\t(nbRules + 5) * size / 2,\n\t\t\t\t\tnCrit * 5 * size - size / 2,\n\t\t\t\t\tsize,\n\t\t\t\t\t(new Float(minC[nCrit])).toString(),\n\t\t\t\t\tnew Color3f(ColorArray.colorArray[nCrit + 3])));\n\t\t\tbgObjGraph.addChild(\n\t\t\t\tcreateTextScale(\n\t\t\t\t\t(nbRules + 5) * size / 2,\n\t\t\t\t\tnCrit * 5 * size + 4 * size - size / 2,\n\t\t\t\t\tsize,\n\t\t\t\t\t(new Float(maxC[nCrit])).toString(),\n\t\t\t\t\tnew Color3f(ColorArray.colorArray[nCrit + 3])));\n\t\t\tbgObjGraph.addChild(\n\t\t\t\tcreateTextScale(\n\t\t\t\t\t(nbRules + 8) * size / 2,\n\t\t\t\t\tnCrit * 5 * size + 2 * size - size / 2,\n\t\t\t\t\tsize,\n\t\t\t\t\tcriteres[nCrit],\n\t\t\t\t\tnew Color3f(ColorArray.colorArray[nCrit + 3])));\n\n\t\t}\n\n\t\t// write attributes\n\t\tfor (nAtt = 0; nAtt < nbAttrs; nAtt++) {\n\t\t\tbgObjGraph.addChild(\n\t\t\t\tcreateTextX(\n\t\t\t\t\t(nRule * size) + size - (nbRules / 2 * size),\n\t\t\t\t\tnAtt * size + size / 3,\n\t\t\t\t\tsize,\n\t\t\t\t\t((Attribute) lAttrs.get(nAtt)).toString(),\n\t\t\t\t\tnew Color3f(Color.WHITE)));\n\t\t}\n\n\n\t\t// draw legend\n\t\tbgObjGraph.addChild(createBox(- (nbRules / 2 * size),(nbAttrs+5) * size,size,size,new Color3f(Color.green)));\n\t\tbgObjGraph.addChild(createTextX( size - (nbRules / 2 * size),(nbAttrs+5) * size + size / 3,size,\"ANTECEDENT\",new Color3f(Color.WHITE)));\n\t\tbgObjGraph.addChild(createBox(- (nbRules / 2 * size),(nbAttrs+7) * size,size,size,new Color3f(Color.red)));\n\t\tbgObjGraph.addChild(createTextX( size - (nbRules / 2 * size),(nbAttrs+7) * size + size / 3,size,\"CONSEQUENT\",new Color3f(Color.WHITE)));\n\t\t\t\n\n\t\treturn objRoot;\n\t}", "public BF() {\n\t\tsuper(\"Body Fat\", \"%\");\n\t}", "public Skeleton( int wave ){\n\tName = \"Skeleton\";\n\tHP = maxHP = 20 + ( wave * 20);\n\tAttack = (wave * 7);\n\tDefense = (wave * 4);\n\tSPDefense = (wave *2);\n\tAccuracy = (wave * 4);\n\tSpeed = .65;\n }", "private void createAndSetNewBranch()\n {\n Date startDateOfArticle = getStartDateOfArticle();\n final String branchId = startDateOfArticle == null ? GWikiProps.formatTimeStamp(new Date()) : GWikiProps\n .formatTimeStamp(startDateOfArticle);\n\n wikiContext.runInTenantContext(branchId, getWikiSelector(), new CallableX<Void, RuntimeException>()\n {\n @Override\n public Void call() throws RuntimeException\n {\n final GWikiElement branchInfo = PlcUtils.createInfoElement(wikiContext, branchId, \"\", branchId, \"\");\n final GWikiElement branchFileStats = PlcUtils.createFileStats(wikiContext);\n wikiContext.getWikiWeb().getAuthorization().runAsSu(wikiContext, new CallableX<Void, RuntimeException>()\n {\n @Override\n public Void call() throws RuntimeException\n {\n wikiContext.getWikiWeb().saveElement(wikiContext, branchInfo, false);\n wikiContext.getWikiWeb().saveElement(wikiContext, branchFileStats, false);\n return null;\n }\n });\n GLog.note(GWikiLogCategory.Wiki, \"Autocreate branch: \" + branchId);\n return null;\n }\n });\n\n // set new created branch as selected\n selectedBranch = branchId;\n }", "protected void makeTheTree(){\n\n structure.getRootNode().branchList.add(structure.getNode11());\n structure.getRootNode().branchList.add(structure.getNode12());\n structure.getRootNode().branchList.add(structure.getNode13());\n\n structure.getNode11().branchList.add(structure.getNode111());\n structure.getNode11().branchList.add(structure.getNode112());\n structure.getNode11().branchList.add(structure.getNode113());\n\n structure.getNode13().branchList.add(structure.getNode131());\n\n structure.getNode112().branchList.add(structure.getNode1121());\n\n }", "public BranchGroup createSceneGraph() {\n BranchGroup node = new BranchGroup();\n TransformGroup TG = createSubGraph();\n TG.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);\n TG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\n // mouse behaviour\n MouseRotate mouse = new MouseRotate(TG);\n mouse.setSchedulingBounds(new BoundingSphere());\n // key nav\n KeyNavigatorBehavior keyNav = new KeyNavigatorBehavior(TG); //Imposto il bound del behavior\n keyNav.setSchedulingBounds(new BoundingSphere(new Point3d(), 100.0)); //Aggiungo il behavior alla scena\n TG.addChild(keyNav);\n TG.addChild(mouse);\n node.addChild(TG);\n // Add directionalLight\n node.addChild(directionalLight());\n // Add ambientLight\n node.addChild(ambientLight());\n return node;\n }", "public Bank ()\n {\n super (\"Bank\", defaults, trans, sharedQueue);\n customer = new Source (0, defaults [0], \"Bank$Customer\", customer_es, sharedQueue);\n teller = new Facility (1, defaults [1], new LinkedList<Coroutine> (), teller_es, sharedQueue);\n exit = new Sink (2, defaults [2], null, sharedQueue);\n initModel (new DynamicNode [] { customer, teller, exit });\n \n }", "@Override\n\tvoid parseBranch(int index, boolean branched) {\n\t\t\n\t}", "public void buildInitialBand()\r\n\t{\n\t\r\n\tint bl = boundary.size();\r\n\tfor(int i=0; i<bl; i++) \r\n\t\t{\r\n\t\tInt2d bCur = boundary.get(i);\r\n\t\t//System.out.println(bCur.x + \", \" + bCur.y + \": size = \" + heap.size());\r\n\t\t\r\n\t\ttestPointsAround(bCur.x,bCur.y);\r\n\t\t}\r\n\t\r\n\t}", "BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries);", "protected abstract BallJoint newBallJointImpl( Body body1, Body body2 );", "@Override\n\tpublic void buildBVH() {\n\t\tif(this.bvhObjList.size()<=4) {\n\t\t}else {\n\t\t BVH nebt1 = new BVH(this.bvHi);\n\t\t BVH nebt2 = new BVH(this.bvHi);\n\t\tint tmp = this.calculateSplitDimension(this.bvhBox.getMax().sub(this.bvhBox.getMin()));\n\t\tfloat splitpos;\n\t\tif(tmp==0) {\n\t\t\tsplitpos = this.calculateMinMax().b.avg(this.calculateMinMax().a).x();\n\t\t}else if(tmp==1) {\n\t\t\tsplitpos = this.calculateMinMax().b.avg(this.calculateMinMax().a).y();\n\t\t}else {\n\t\t\tsplitpos = this.calculateMinMax().b.avg(this.calculateMinMax().a).z();\n\t\t\t\n\t\t}\n\t\tthis.distributeObjects(nebt1, nebt2, tmp, splitpos);\n\t\tthis.bvHi.add(nebt1);\n\t\tthis.neb1 = bvHi.indexOf(nebt1);\n\t\tthis.bvHi.add(nebt2);\n\t\tthis.neb2 = bvHi.indexOf(nebt2);\n\t\tnebt2.buildBVH();\n\t\tnebt1.buildBVH();\n\n\t\t}\n\t}", "public Boop() {\n\t\tsuper();\n\t}", "public Branch(final int id, final String name, final String address) {\n\t\tthis.id = id;\n\t\tthis.name = name;\n\t\tthis.address = address;\n\t}", "public static void main(String[] args) {\n\n\t\tHSBCBank hs= new HSBCBank();\n\t\ths.credit();\n\t\ths.debit();\n\t\ths.homeLoan();\n\t\ths.transferMoney();\n\t\ths.carLoan();\n\t\ths.mutualFunds();\n\t\ths.systematicInvestmentPlan();\n\t\t\n\t\tSystem.out.println(USBank.min_bal);\n\t\t\n\t\t//Dynamic Polymorphism\n\t\t//Child class object can be referred by Parent Interface reference variable\n\t\t\n\t\tUSBank ub = new HSBCBank();\n\t\tub.credit();\n\t\tub.debit();\n\t\tub.transferMoney();\n\t\n\t\n\t}", "public BLabel(String text)\n {\n this(text, WEST);\n }", "public Bombas(int x,int y) {\n \tsuper(x,y);\n }", "public InternalBranch(String name) {\n this(InternalRefId.ofBranch(name).getId(), name, InternalL1.EMPTY.getMap(), Id.EMPTY, SINGLE_EMPTY_COMMIT, DT.now());\n }", "public BSPLine() {\n super();\n }", "private void populateBranches() {\n\t\tStationsDTO[] station = null;\n\t\ttry {\n\t\t\tstation = handler.getAllBranches();\n\t\t\tif (null != station) {\n\t\t\t\tint len = station.length;\n\t\t\t\tfor (int i = 0; i < len; i++) {\n\t\t\t\t\tcoBranch.add(station[i].getName() + \" - \"\n\t\t\t\t\t\t\t+ station[i].getId());\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception exception) {\n\t\t\texception.printStackTrace();\n\t\t}\n\t}", "public Branch branchFromFile(String name) {\n File branchFile = Utils.join(_branch, name);\n if (!branchFile.exists()) {\n throw new IllegalArgumentException(\n \"No branch file with that name found.\");\n }\n return Utils.readObject(branchFile, Branch.class);\n }", "public BrtosEntrypointSkeletonGenerator(Logger log, Model model, File dir) {\n\t\tthis.log = log;\n\t\tthis.model = model;\n\t\tthis.allThreads = model.getThreadImplementations();\n\t\t// this.threadSourcePorts = model.getThreadSourcePorts();\n\n\t\t// Create source directories\n\t\tFile genDir = new File(dir, \"gen\");\n\t\tgenDir.mkdirs();\n\n\t\t// Create new source files\n\t\tString name = Util.normalizeAadlName(model.getSystemInstanceName());\n\t\tCFile = new File(genDir, name + \".c\");\n\t\tHFile = new File(genDir, name + \".h\");\n\n\t\tthis.model.getSourceFiles().add(CFile.getPath());\n\n\t\t// Define signal set from event ports\n\t\t// write implementations for event ports set the signals\n\t\t// main tasking threads wait for signal set\n\t\t// and dispatch to appropriate entrypoint\n\n\t\tdefineSignalSet();\n\t}", "public CSGEnvironmentBSP(\r\n\t) {\r\n\t\tthis( false );\r\n\t}", "private Branch mapEntityToModel(BranchEntity entity) {\n\t\tBranch branch = new Branch();\n\t\tbranch.setBranchId(entity.getId());\n\t\tbranch.setLocation(entity.getLocation());\n\t\tbranch.setName(entity.getName());\n\t\tbranch.setPhoneNumber(entity.getPhone());\n\t\treturn branch;\n\t}", "public BranchGroup createSceneGraph() {\n BranchGroup objRoot = new BranchGroup();\n\n // Create the TransformGroup node and initialize it to the\n // identity. Enable the TRANSFORM_WRITE capability so that\n // our behavior code can modify it at run time. Add it to\n // the root of the subgraph.\n TransformGroup objTrans = new TransformGroup();\n objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\n objRoot.addChild(objTrans);\n\n // Create a simple Shape3D node; add it to the scene graph.\n objTrans.addChild(new ColorCube(0.4));\n\n // Create a new Behavior object that will perform the\n // desired operation on the specified transform and add\n // it into the scene graph.\n Transform3D yAxis = new Transform3D();\n Alpha rotationAlpha = new Alpha(-1, 4000);\n\n RotationInterpolator rotator = new RotationInterpolator(rotationAlpha,\n objTrans, yAxis, 0.0f, (float) Math.PI * 2.0f);\n BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0),\n 100.0);\n rotator.setSchedulingBounds(bounds);\n objRoot.addChild(rotator);\n\n // Have Java 3D perform optimizations on this scene graph.\n objRoot.compile();\n\n return objRoot;\n }", "public Billfold()\n {\n \n }", "private void createTree() {\n\n // custom brown color\n Color brown = new Color(149, 99, 57);\n\n // trunk\n NscComponent trunk = new NscRectangle(49, 164, 13, 51);\n createShape(trunk, brown, true);\n\n // branches\n drawLine(50, 125, 50, 165, 10, brown);\n drawLine(25, 125, 50, 165, 10, brown);\n drawLine(75, 125, 50, 165, 10, brown);\n\n // branch outlines\n drawLine(49, 125, 49, 150, 1, Color.black);\n drawLine(60, 125, 60, 150, 1, Color.black);\n drawLine(24, 125, 49, 165, 1, Color.black);\n drawLine(35, 125, 50, 150, 1, Color.black);\n drawLine(85, 125, 60, 165, 1, Color.black);\n drawLine(74, 125, 60, 150, 1, Color.black);\n\n // leafs\n NscEllipse leafs2 = new NscEllipse(0, 5, 60, 122);\n NscEllipse leafs3 = new NscEllipse(50, 5, 60, 122);\n NscEllipse leafs = new NscEllipse(25, 0, 60, 127);\n NscEllipse leafs4 = new NscEllipse(25, 1, 60, 124);\n createShape(leafs2, treeColor, true);\n createShape(leafs3, treeColor, true);\n createShape(leafs, treeColor, true);\n createShape(leafs4, treeColor, false);\n\n repaint();\n }", "public static void main(String[] args) {\n\t\tHSBCBank hs = new HSBCBank();\n\t\ths.credit();\n\t\ths.debit();\n\t\ths.carLoan();\n\t\ths.educationLoan();\n\t\ths.transferMoney();\n\t\t\n\t\tSystem.out.println(\"---------------\");\n\t\t\n\t\tUSBank us = new HSBCBank();\n\t\tus.credit();\n\t\tus.debit();\n\t\tus.transferMoney();\n\t\tSystem.out.println(us.min_bal);\n\t}", "public BinaryTree() {\n\t}", "@Transactional\n\t@Override\n\tpublic void createBranch(Branch branch) {\n\t\tcall = new SimpleJdbcCall(jdbcTemplate).withProcedureName(\"create_branch\");\n\t\tMap<String, Object> culoMap = new HashMap<String, Object>();\n\t\tculoMap.put(\"Pname_branch\", branch.getNameBranch());\n\t\tculoMap.put(\"Paddress_branch\", branch.getAddressBranch());\n\t\tculoMap.put(\"Pphone_branch\", branch.getPhoneBranch());\n\t\t\n\t\t\n\t\tSqlParameterSource src = new MapSqlParameterSource()\n\t\t\t\t.addValues(culoMap);\n\t\tcall.execute(src);\n\t}", "public MinStack1() {\n\n }", "private void constructTree() {\r\n\t\tsortLeaves();\r\n\t\tNode currentNode;\r\n\t\tint index = 0;\r\n\t\t\tdo{\r\n\t\t\t\t// Create a new node with the next two least frequent nodes as its children\r\n\t\t\t\tcurrentNode = new Node(this.treeNodes[0], this.treeNodes[1]); \r\n\t\t\t\taddNewNode(currentNode);\r\n\t\t\t}\r\n\t\t\twhile (this.treeNodes.length > 1); // Until there is only one root node\r\n\t\t\tthis.rootNode = currentNode;\r\n\t\t\tindex++;\r\n\t}", "public void createBalls() {\n // add the required amount of balls according to the levelinfo.\n for (int i = 0; i < this.levelInfo.numberOfBalls(); i++) {\n Ball ball = new Ball(new Point(400, 580), 5, java.awt.Color.WHITE);\n // let the ball know the frame limits.\n ball.updateFrame(this.upper, this.lower, this.right, this.left);\n // let the ball know the collidables.\n ball.setGameEnvironment(this.environment);\n // use the velocity from the velocity list of levelinfo.\n Velocity v = this.levelInfo.initialBallVelocities().get(i);\n ball.setVelocity(v);\n // add the ball to the game.\n ball.addToGame(this);\n // increase the ball counter by 1.\n this.ballCounter.increase(1);\n }\n }", "private static Bat createBat(){\n try {\n UtilityMethods.print(\"Creating Big bat for you...!\"); \n BatGenerator batGenerator = new BatGenerator();\n BatBuilder bigBatBuilder = new BigBatBuilder();\n batGenerator.setBatBuilder(bigBatBuilder);\n batGenerator.constructBat(\n \"Bat\", \n \"Male\",\n 25,\n \"Scavenger\"\n );\n Bat bigBat = bigBatBuilder.getBat();\n UtilityMethods.print(\"\\n\"); \n bigBat.eat();\n UtilityMethods.print(\"\\n\"); \n bigBat.speak();\n UtilityMethods.print(\"\\n\"); \n bigBat.walk();\n UtilityMethods.print(\"\\n\"); \n } catch (Exception e) {\n UtilityMethods.print(e.getMessage()); \n }\n return null; \n }", "public void testBranch() throws Exception {\n IProject project = createProject(\"testBranch\", new String[] { \"changed.txt\", \"deleted.txt\", \"folder1/\", \"folder1/a.txt\", \"folder1/b.txt\", \"folder1/subfolder1/c.txt\" });\n \n branch(asResourceMapping(new IResource[] { project }, IResource.DEPTH_ONE), new CVSTag(\"b1\", CVSTag.BRANCH));\n branch(asResourceMapping(new IResource[] { project.getFolder(\"folder1\") }, IResource.DEPTH_ONE), new CVSTag(\"b2\", CVSTag.BRANCH));\n branch(asResourceMapping(new IResource[] { project.getFile(\"folder1/subfolder1/c.txt\") }, IResource.DEPTH_ZERO), new CVSTag(\"b3\", CVSTag.BRANCH));\n branch(asResourceMapping(new IResource[] { project }, IResource.DEPTH_INFINITE), new CVSTag(\"b4\", CVSTag.BRANCH));\n }", "public final AstValidator.split_branch_return split_branch() throws RecognitionException {\n AstValidator.split_branch_return retval = new AstValidator.split_branch_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n CommonTree SPLIT_BRANCH407=null;\n AstValidator.alias_return alias408 =null;\n\n AstValidator.cond_return cond409 =null;\n\n\n CommonTree SPLIT_BRANCH407_tree=null;\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:628:2: ( ^( SPLIT_BRANCH alias cond ) )\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:628:4: ^( SPLIT_BRANCH alias cond )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n SPLIT_BRANCH407=(CommonTree)match(input,SPLIT_BRANCH,FOLLOW_SPLIT_BRANCH_in_split_branch3344); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n SPLIT_BRANCH407_tree = (CommonTree)adaptor.dupNode(SPLIT_BRANCH407);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(SPLIT_BRANCH407_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_alias_in_split_branch3346);\n alias408=alias();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, alias408.getTree());\n\n\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_cond_in_split_branch3348);\n cond409=cond();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, cond409.getTree());\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n aliases.add( (alias408!=null?alias408.name:null) );\n }\n\n if ( state.backtracking==0 ) {\n }\n }\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n }\n\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "public KinectSkeleton(Main main) {\n this.main = main;\n }", "private Bus constructBus(String line, Point point) {\n\t\t// parse the information\n\t\tStringTokenizer tokenizer = new StringTokenizer(line,\",\");\n \tint id = Integer.parseInt(tokenizer.nextToken().trim());\n \tString name = tokenizer.nextToken();\n \tif (name.startsWith(\"\\\"\")) {\n \t\twhile (!name.endsWith(\"\\\"\")) {\n \t\t\tname = name + \",\" + tokenizer.nextToken();\n \t\t}\n \t}\n \t/*int area = */Integer.parseInt(tokenizer.nextToken().trim());\n \t/*int zone = */Integer.parseInt(tokenizer.nextToken().trim());\n \tdouble voltageMagnitude = Double.parseDouble(tokenizer.nextToken().trim());\n \tdouble voltageAngle = Double.parseDouble(tokenizer.nextToken().trim());\n \tdouble baseVoltageKiloVolts = Double.parseDouble(tokenizer.nextToken().trim());\n \tdouble remoteVoltage = Double.parseDouble(tokenizer.nextToken().trim());\n \tint status = Integer.parseInt(tokenizer.nextToken().trim());\n\t\t\n \tBus bus = registerBus(id);\n bus.setAttribute(Bus.NAME_KEY,name);\n bus.setVoltagePU(voltageMagnitude);\n bus.setPhaseAngle(voltageAngle);\n bus.setSystemVoltageKV(baseVoltageKiloVolts);\n bus.setRemoteVoltagePU(remoteVoltage);\n bus.setStatus(status == 1 ? true : false);\n \tbus.setCoordinate(point == null ? new PointImpl(0,0) : point); \t\n \treturn bus;\t\t\n\t}", "public bly(int paramInt, Random paramRandom, bjb parambjb, EnumDirection paramej)\r\n/* 10: */ {\r\n/* 11:831 */ super(paramInt);\r\n/* 12: */ \r\n/* 13:833 */ this.m = paramej;\r\n/* 14:834 */ this.d = a(paramRandom);\r\n/* 15:835 */ this.l = parambjb;\r\n/* 16: */ }", "void create(Node node) {\n if (node.table.negatives() == 0) {\r\n node.atribute = 1;\r\n return;\r\n }\r\n if (node.table.positives() == 0) {\r\n node.atribute = 0;\r\n return;\r\n }\r\n\r\n //If no test split the data, make it a leaf with the majoriti of the target atribute\r\n int atr;\r\n //Choose the best atribute\r\n atr = this.chooseBestAtrib(node);\r\n node.atribute = atr;\r\n\r\n //No atribute split the data, so make the node a leaf with the majoriti of the class (either positive or negative)\r\n if (node.atribute == -1) {\r\n //System.out.println(\"Atribute is -1 in TeeBuidler.create\");\r\n if (node.table.negatives() > node.table.positives()) {\r\n node.atribute = 0;\r\n return;\r\n }\r\n if (node.table.positives() >= node.table.negatives()) {\r\n node.atribute = 1;\r\n return;\r\n }\r\n }\r\n\r\n Table table_left = new Table(), table_right = new Table();\r\n node.table.splitByAtrib(node.atribute, table_left, table_right);\r\n\r\n //Create two children for the current node //parameters: identifier,parent_result,atribute of split,id_child1, id_child2, table\r\n node.child_left = new Node(node.id + node.id, \"1\", -1, -1, -1, table_left);\r\n node.child_right = new Node(node.id + node.id+1, \"0\", -1, -1, -1, table_right);\r\n node.id_child_left = node.id + node.id;\r\n node.id_child_right = node.id + node.id+1;\r\n\r\n\r\n TreeBuilder builder = new TreeBuilder();\r\n builder.create(node.child_left);\r\n builder.create(node.child_right);\r\n\r\n }", "public interface BranchNode extends StatementNode\n{\n\t/**\n\t * Set the branching condition.\n\t * \n\t * @param condition\n\t * the condition of the branch.\n\t */\n\tpublic void setCondition(ExpressionNode condition);\n\n\t/**\n\t * Get the branching condition.\n\t * \n\t * @return the condition of the branch.\n\t */\n\tpublic ExpressionNode getCondition();\n\n\t/**\n\t * Set the statement that is executed when the condition evaluates to true.\n\t * \n\t * @param statement\n\t * The statement to execute when the condition evaluates to true.\n\t */\n\tpublic void setStatementNodeOnTrue(StatementNode statement);\n\n\t/**\n\t * The statement that is executed when the condition evaluates to true.\n\t * \n\t * @return The statement to execute when the condition evaluates to true.\n\t */\n\tpublic StatementNode getStatementNodeOnTrue();\n\n\t/**\n\t * Set the statement that is executed when the condition evaluates to false.\n\t * This is the else statement. If there is no else set to null.\n\t * \n\t * @param statement\n\t * The statement to execute when the condition evaluates to false or\n\t * null if no else branch is needed.\n\t */\n\tpublic void setStatementNodeOnFalse(StatementNode statement);\n\n\t/**\n\t * The statement that is executed when the condition is false. This is the else\n\t * branch. If no else branch exists this will return null.\n\t * \n\t * @return The statement to execute when the condition evaluates to false.\n\t */\n\tpublic StatementNode getStatementNodeOnFalse();\n}", "public BSTTreeBlueJTest()\n {\n }", "public static void testNewBBFArchitecture(){\n\t\t\n\t\tString outputDir = \"E:\\\\testing\\\\Java Backbone Fitting\\\\test orientation fix\\\\\";\n\t\tString inputFileName = outputDir+\"Berlin@Berlin_2NDs_B_Square_SW_96-160_201411201541.prejav\";\n\t\t\t\n\t\tExperiment ex = new Experiment(inputFileName);\n\t\t\n\t\t\n\t\tBackboneFitter bbf = new BackboneFitter(ex.getTrackFromInd(50));\n\t\tbbf.fitTrack();\n\t\t\n\t\tBackboneFitter bbfOld = new BackboneFitter();\n\t\t///method no longer exists\n\t\t//bbfOld.fitTrack(ex.getTrackFromInd(50));\n\t\t///\n\t\t\n\t\tSystem.out.println(\"Done\");\n\t}", "public Head() {\r\n\t\tLog.debug(\"new Head\");\r\n\t\tsetStyleName(\"resHead\");\r\n\t\tsetWidth(WIDTH);\r\n\t\tsetAutoHeight();\r\n\t\tsetPadding(0);\r\n\r\n\t\ttitleRow = new HLayout();\r\n\t\ttitle = new Label();\r\n\t\tbreadcrumbs = new Breadcrumbs();\r\n\r\n\t\ttitleRow.setHeight(TITLE_HEIGHT);\r\n\t\ttitleRow.setWidth(WIDTH);\r\n\t\ttitle.setAutoFit(true);\r\n\t\ttitle.setWrap(false);\r\n\t\ttitle.setStyleName(\"resHeadTitle\");\r\n\t\ttitleRow.addMember(title);\r\n\r\n\t\taddMember(titleRow);\r\n\t\taddMember(breadcrumbs);\r\n\r\n\t}", "B createB();", "public Branch(Branch r, Branch l) {\n\t\tright = r;\n\t\tleft = l;\n\t\tisLeaf = false;\n\t}", "private SceneGraphObject createNodeFromSuper( String className, Class[] parameterTypes, Object[] parameters ) {\n\tSceneGraphObject ret;\n\n String tmp = this.getClass().getName();\n String superClass = tmp.substring( tmp.indexOf(\"state\")+6, tmp.length()-5 );\n Constructor constructor;\n\n try {\n Class state = Class.forName( superClass );\n constructor = state.getConstructor( parameterTypes );\n ret = (SceneGraphObject)constructor.newInstance( parameters );\n\t} catch(ClassNotFoundException e1) {\n\t throw new SGIORuntimeException( \"No State class for \"+\n\t\t\t\t\t\tsuperClass );\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 Bishop()\n {\n super();\n }", "protected void setBreadCrumb() {\n BreadCrumbHolder[] breadCrumbHolders = new BreadCrumbHolder[2];\n\n // common data\n HashMap<String, String> data = new HashMap<String, String>();\n data.put(Constants.User.USER_LOGIN, mUserLogin);\n data.put(Constants.Repository.REPO_NAME, mRepoName);\n\n // User\n BreadCrumbHolder b = new BreadCrumbHolder();\n b.setLabel(mUserLogin);\n b.setTag(Constants.User.USER_LOGIN);\n b.setData(data);\n breadCrumbHolders[0] = b;\n\n // Repo\n b = new BreadCrumbHolder();\n b.setLabel(mRepoName);\n b.setTag(Constants.Repository.REPO_NAME);\n b.setData(data);\n breadCrumbHolders[1] = b;\n\n createBreadcrumb(\"Branches\", breadCrumbHolders);\n }", "public NCLBody() {}", "BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries, int expectedBytesPerEntry);", "public MinStack2() {\n\n }", "public KinectSkeleton(Main main) {\r\n Material matW = new Material(main.getAssetManager(), \"Common/MatDefs/Misc/Unshaded.j3md\");\r\n matW.setColor(\"Color\", ColorRGBA.Black);\r\n if (main.kinect.joint != null) {\r\n //starting joints\r\n float[][] StartingJoint = {{(float) main.kinect.joint[10][1] / 1000f, (float) main.kinect.joint[10][2] / 1000f, (float) main.kinect.joint[10][3] / 1000f}, //right wrist\r\n {(float) main.kinect.joint[9][1] / 1000f, (float) main.kinect.joint[9][2] / 1000f, (float) main.kinect.joint[9][3] / 1000f}, //right elbow\r\n {(float) main.kinect.joint[8][1] / 1000f, (float) main.kinect.joint[8][2] / 1000f, (float) main.kinect.joint[8][3] / 1000f}, //right shoulder\r\n {(float) main.kinect.joint[2][1] / 1000f, (float) main.kinect.joint[2][2] / 1000f, (float) main.kinect.joint[2][3] / 1000f}, //shoulder center\r\n {(float) main.kinect.joint[4][1] / 1000f, (float) main.kinect.joint[4][2] / 1000f, (float) main.kinect.joint[4][3] / 1000f}, //left shoulder\r\n {(float) main.kinect.joint[5][1] / 1000f, (float) main.kinect.joint[5][2] / 1000f, (float) main.kinect.joint[5][3] / 1000f}, //left elbow\r\n {(float) main.kinect.joint[0][1] / 1000f, (float) main.kinect.joint[0][2] / 1000f, (float) main.kinect.joint[0][3] / 1000f}, //hip center\r\n {(float) main.kinect.joint[0][1] / 1000f, (float) main.kinect.joint[0][2] / 1000f, (float) main.kinect.joint[0][3] / 1000f}, //hip center\r\n {(float) main.kinect.joint[0][1] / 1000f, (float) main.kinect.joint[0][2] / 1000f, (float) main.kinect.joint[0][3] / 1000f}, //hip center\r\n {(float) main.kinect.joint[0][1] / 1000f, (float) main.kinect.joint[0][2] / 1000f, (float) main.kinect.joint[0][3] / 1000f}, //hip center\r\n {(float) main.kinect.joint[0][1] / 1000f, (float) main.kinect.joint[0][2] / 1000f, (float) main.kinect.joint[0][3] / 1000f}, //hip center\r\n {(float) main.kinect.joint[13][1] / 1000f, (float) main.kinect.joint[13][2] / 1000f, (float) main.kinect.joint[13][3] / 1000f}, //left knee\r\n {(float) main.kinect.joint[17][1] / 1000f, (float) main.kinect.joint[17][2] / 1000f, (float) main.kinect.joint[17][3] / 1000f}}; //right knee\r\n //joint the starting joints connect to\r\n float[][] ConnectingJoint = {{(float) main.kinect.joint[9][1] / 1000f, (float) main.kinect.joint[9][2] / 1000f, (float) main.kinect.joint[9][3] / 1000f}, //right elbow\r\n {(float) main.kinect.joint[8][1] / 1000f, (float) main.kinect.joint[8][2] / 1000f, (float) main.kinect.joint[8][3] / 1000f}, //right shoulder\r\n {(float) main.kinect.joint[2][1] / 1000f, (float) main.kinect.joint[2][2] / 1000f, (float) main.kinect.joint[2][3] / 1000f}, //shoulder center\r\n {(float) main.kinect.joint[4][1] / 1000f, (float) main.kinect.joint[4][2] / 1000f, (float) main.kinect.joint[4][3] / 1000f}, //left shoulder\r\n {(float) main.kinect.joint[5][1] / 1000f, (float) main.kinect.joint[5][2] / 1000f, (float) main.kinect.joint[5][3] / 1000f}, //left elbow\r\n {(float) main.kinect.joint[6][1] / 1000f, (float) main.kinect.joint[6][2] / 1000f, (float) main.kinect.joint[6][3] / 1000f}, //left wrist\r\n {(float) main.kinect.joint[2][1] / 1000f, (float) main.kinect.joint[2][2] / 1000f, (float) main.kinect.joint[2][3] / 1000f}, //shoulder center\r\n {(float) main.kinect.joint[8][1] / 1000f, (float) main.kinect.joint[8][2] / 1000f, (float) main.kinect.joint[8][3] / 1000f}, //right shoulder\r\n {(float) main.kinect.joint[4][1] / 1000f, (float) main.kinect.joint[4][2] / 1000f, (float) main.kinect.joint[4][3] / 1000f}, //left shoulder\r\n {(float) main.kinect.joint[13][1] / 1000f, (float) main.kinect.joint[13][2] / 1000f, (float) main.kinect.joint[13][3] / 1000f}, //left knee\r\n {(float) main.kinect.joint[17][1] / 1000f, (float) main.kinect.joint[17][2] / 1000f, (float) main.kinect.joint[17][3] / 1000f}, //right knee\r\n {(float) main.kinect.joint[14][1] / 1000f, (float) main.kinect.joint[14][2] / 1000f, (float) main.kinect.joint[14][3] / 1000f}, //left ankle\r\n {(float) main.kinect.joint[18][1] / 1000f, (float) main.kinect.joint[18][2] / 1000f, (float) main.kinect.joint[18][3] / 1000f}}; //right ankle\r\n //start loop to connect all joints\r\n for (int i = 0; i < bones.length; i++) {\r\n Cylinder c = new Cylinder(10, 10, 0.04f, 1f, true);\r\n //set geometry, connect and transform cylinder, set material\r\n bones[i] = new Geometry(\"Cylinder\", c);\r\n setConnectiveTransform(ConnectingJoint[i], StartingJoint[i], bones[i]);\r\n bones[i].setMaterial(matW);\r\n //attach physics to bones\r\n RigidBodyControl phy = new RigidBodyControl(1f); //0f = 0 mass\r\n bones[i].addControl(phy);\r\n phy.setKinematic(true);\r\n //attach physics to world\r\n main.bulletAppState.getPhysicsSpace().add(phy);\r\n //attach to node so we can play\r\n skeleton.attachChild(bones[i]);\r\n }\r\n //float y = (float) main.kinect.joint[0][3] / 1000f+(float) main.kinect.joint[0][3] / 1000f;\r\n skeleton.move(0, 0.75f, 0);\r\n ;\r\n } else {\r\n System.out.println(\"NULL!\");\r\n }\r\n }", "private void branch01(Node parent) {\n final GeneralLP lp0 = parent.lp;\n final int v = intVars[parent.level];\n Maths.CnF cf = new Maths.CnF(lp0.x[v - 1]);\n\n double[][] a2 = Arrays.copyOf(lp0.a, lp0.m);\n double[] bLeft = lp0.b; // left branch\n double[] bRight = Arrays.copyOf(lp0.b, lp0.m); // right branch\n double[] c2 = Arrays.copyOf(lp0.c, lp0.n);\n double c0Right = lp0.c0 + lp0.c[v - 1]; // c0Left unchanged\n branch01Arguments(c2, a2, bRight, lp0, v);\n\n // LP1: left branch (=0)\n LOG.debug(parent, \"left branch x(\", v, \") =\", 0);\n GeneralLP lp1 = new GeneralLP(lp0.objectiveType, lp0.c0, c2, a2, lp0.signs, bLeft, lp0.freeVars);\n Node child1 = new Node(lp1, parent, Node.LEFT).binary(v);\n nodes.addLast(child1);\n\n // LP2: right branch (=1)\n LOG.debug(parent, \"right branch x(\", v, \") =\", 1);\n GeneralLP lp2 = new GeneralLP(lp0.objectiveType, c0Right, c2, a2, lp0.signs, bRight, lp0.freeVars);\n Node child2 = new Node(lp2, parent, Node.RIGHT).binary(v);\n nodes.addLast(child2);\n\n parent.lp = null; // release memory\n }", "public DLB(){\r\n\t\t//generate the root node with a terminating value\r\n\t\tnodes = new DLBNode('/');\r\n\t}", "public BST() {\n }", "private BTNode createNode() {\n BTNode btNode;\n btNode = new <DataPair>BTNode ();\n btNode.mIsLeaf = true;\n btNode.mCurrentKeyNum = 0;\n return btNode;\n }", "private void createBrain() {\n\t\t\n\t\tMSimulationConfig simConfig;\n\n\t\t//How many input and output nodes to create in the agents brain\n\t\tint inputNodes = configNumSegments*3;\n\t\tint outputNodes = 3;\n\n\t\t//Create a CPPNFactory. Feed the factory a series of CPPN and after all chromosomes have been read in, it can return a fully formed brain.\n\t\tCPPNFactory cFactory = new CPPNFactory(inputNodes,outputNodes);\n\n\t\t/* Get a reference to the agent's chromosome. */\n\t\tChromosome chromosome = (Chromosome)geneticObject;\n\n\t\t// \t/**\n\t\t// \t * Each 'chromosome' the agent contains is an instance of the genome class.\n\t\t// \t * \n\t\t// \t * Each chromosome contains multiple types of genes that can contain the following information to build the CPPN:\n\t\t// \t * 1: A sort of 'header' gene that says how many neurons will be in this layer of the brain\n\t\t// \t * 2: Add nodes to the buildSyanpse CPPN, so this will need to include a 'type' integer, to designate the kind of function\n\t\t// \t * \t\tthat this node will use. 3 Parameter integers, which will be used to augment the function so that\n\t\t// \t * \t\teach node has a higher degree of possible diversity.\n\t\t// \t * \t\tThere are 4 different 'types' of nodes, which correspond to 0: Parabola, 1: Sigmoid, 2: Gauss, 3: Sin.\n\t\t// \t * 3: Add nodes to the buildNeurons CPPN, this should be built just like the buildSynapseCPPN. There will probably need to\n\t\t// \t * \t\tbe some field in the gene that lets this part of the code distinguish between genes for the buildNeuronCPPN and the\n\t\t// \t * \t\tbuildSyanpse CPPNs.\n\t\t// \t * \n\t\t// \t * Some additional notes:\n\t\t// \t * 1: The first two nodes in any CPPN arrayList of nodes will always be the input nodes for that network.\n\t\t// \t * 2: The last node in the CPPN arrayList of nodes will always be the output node for that network.\n\t\t// \t */\n\n\t\t// \t/**\n\t\t// \t * ##############\n\t\t// \t * CREATE CPPN HERE ###############################\n\t\t// \t * ##############\n\t\t// \t */\n\n\t\t//Once all the CPPN's have been input to the cFactory, the brain will be finished and it can be pulled out.\n\t\t// mnetwork = cFactory.getBrain();\n\t\tmnetwork = cFactory.createNetworkFromChromosome(chromosome, 8);\n\t\t\n\t\t/* Create and set the simulation configuration parameters. */\n\t\tsimConfig = new MSimulationConfig(20);\n\t\t\n\t\t/* Create the simulation instance with our network. */\n\t\tthis.msimulation = new MSimulation(this.mnetwork, simConfig);\n\t}", "Structure createStructure();", "public Board(String boardName) {\n\n /*\n * Created according to the specs online.\n */\n if (boardName.equals(\"default\")) {\n Ball ball1 = new Ball(new Vect(0, 0), new Geometry.DoublePair(1.25,\n 1.25));\n Gadget circle = new CircleBumper(1, 10, new Gadget[] {});\n Gadget triangle = new TriangleBumper(12, 15, 180, new Gadget[] {});\n Gadget square1 = new SquareBumper(0, 17, new Gadget[] {});\n Gadget square2 = new SquareBumper(1, 17, new Gadget[] {});\n Gadget square3 = new SquareBumper(2, 17, new Gadget[] {});\n Gadget circle1 = new CircleBumper(7, 18, new Gadget[] {});\n Gadget circle2 = new CircleBumper(8, 18, new Gadget[] {});\n Gadget circle3 = new CircleBumper(9, 18, new Gadget[] {});\n this.balls = new Ball[] { ball1 };\n this.gadgets = new Gadget[] { circle, triangle, square1, square2,\n square3, circle1, circle2, circle3, top, bottom, left,\n right };\n\n } else if (boardName.equals(\"absorber\")) {\n Ball ball1 = new Ball(new Vect(0, 0), new Geometry.DoublePair(\n 10.25, 15.25));\n Ball ball2 = new Ball(new Vect(0, 0), new Geometry.DoublePair(\n 19.25, 3.25));\n Ball ball3 = new Ball(new Vect(0, 0), new Geometry.DoublePair(1.25,\n 5.25));\n Gadget absorber = new Absorber(0, 18, 20, 2, new Gadget[] {});\n Gadget triangle = new TriangleBumper(19, 0, 90, new Gadget[] {});\n Gadget circle1 = new CircleBumper(1, 10, new Gadget[] { absorber });\n Gadget circle2 = new CircleBumper(2, 10, new Gadget[] { absorber });\n Gadget circle3 = new CircleBumper(3, 10, new Gadget[] { absorber });\n Gadget circle4 = new CircleBumper(4, 10, new Gadget[] { absorber });\n Gadget circle5 = new CircleBumper(5, 10, new Gadget[] { absorber });\n this.balls = new Ball[] { ball1, ball2, ball3 };\n this.gadgets = new Gadget[] { absorber, triangle, circle1, circle2,\n circle3, circle4, circle5, top, left, right, bottom };\n }\n\n else if (boardName.equals(\"flippers\")) {\n Ball ball1 = new Ball(new Vect(0, 0), new Geometry.DoublePair(.25,\n 3.25));\n Ball ball2 = new Ball(new Vect(0, 0), new Geometry.DoublePair(5.25,\n 3.25));\n Ball ball3 = new Ball(new Vect(0, 0), new Geometry.DoublePair(\n 10.25, 3.25));\n Ball ball4 = new Ball(new Vect(0, 0), new Geometry.DoublePair(\n 15.25, 3.25));\n Ball ball5 = new Ball(new Vect(0, 0), new Geometry.DoublePair(\n 19.25, 3.25));\n Gadget left1 = new LeftFlipper(0, 8, 90, new Gadget[] {});\n Gadget left2 = new LeftFlipper(4, 10, 90, new Gadget[] {});\n Gadget left3 = new LeftFlipper(9, 8, 90, new Gadget[] {});\n Gadget left4 = new LeftFlipper(15, 8, 90, new Gadget[] {});\n Gadget circle1 = new CircleBumper(5, 18, new Gadget[] {});\n Gadget circle2 = new CircleBumper(7, 13, new Gadget[] {});\n Gadget circle3 = new CircleBumper(0, 5, new Gadget[] { left1 });\n Gadget circle4 = new CircleBumper(5, 5, new Gadget[] {});\n Gadget circle5 = new CircleBumper(10, 5, new Gadget[] { left3 });\n Gadget circle6 = new CircleBumper(15, 5, new Gadget[] { left4 });\n Gadget triangle1 = new TriangleBumper(19, 0, 90, new Gadget[] {});\n Gadget triangle2 = new TriangleBumper(10, 18, 180, new Gadget[] {});\n Gadget right1 = new RightFlipper(2, 15, 0, new Gadget[] {});\n Gadget right2 = new RightFlipper(17, 15, 0, new Gadget[] {});\n Gadget absorber = new Absorber(0, 19, 20, 1, new Gadget[] { right1,\n right2, new Absorber(0, 19, 20, 1, new Gadget[] {}) });\n this.balls = new Ball[] { ball1, ball2, ball3, ball4, ball5 };\n this.gadgets = new Gadget[] { left1, left2, left3, left4, circle1,\n circle2, circle3, circle4, circle5, circle6, triangle1,\n triangle2, right1, right2, absorber, top, bottom, left,\n right };\n } else {\n this.gadgets = new Gadget[] {};\n this.balls = new Ball[] {};\n }\n\n checkRep();\n }", "public Joint (SkeletonJoint skeletonJoint) {\n\t\tthis.skeletonJoint = skeletonJoint;\n\t\tposition2d = new Vector2f();\n\t\tposition3d = new Vector3f();\n\t\tconfidence = 0;\n\t}", "public LarvaSkeleton(long captureTime,\n TrackerPoint head,\n TrackerPoint midpoint,\n TrackerPoint tail,\n double length,\n TrackerPoint centroid,\n double headToBodyAngle,\n double tailBearing) {\n this();\n this.captureTime = captureTime;\n this.head = head;\n this.centroid = centroid;\n this.midpoint = midpoint;\n this.tail = tail;\n this.length = length;\n this.headToBodyAngle = headToBodyAngle;\n this.tailBearing = tailBearing;\n }", "public Triangle(int h, int b){\n if(h == b){\n height = h;\n base = b;\n }\n else{\n height = h;\n base = height;\n }\n }", "public borFactoryImpl() {\n\t\tsuper();\n\t}", "public BinaryNode() {\n\t\tthis(null);\t\t\t// Call next constructor\n\t}" ]
[ "0.6465311", "0.6119591", "0.5620688", "0.5544659", "0.55417734", "0.5476867", "0.5470451", "0.5441254", "0.53573656", "0.5347183", "0.5321644", "0.5279855", "0.524999", "0.5249057", "0.5217055", "0.51768327", "0.5116992", "0.50651175", "0.50218964", "0.50188076", "0.5001834", "0.49994043", "0.49940947", "0.4961726", "0.49612236", "0.49409902", "0.49348578", "0.49322373", "0.49049157", "0.4899123", "0.48815197", "0.48709083", "0.48613077", "0.48566404", "0.48521358", "0.48520842", "0.48354557", "0.4831027", "0.48180145", "0.4812628", "0.4806105", "0.4803135", "0.48020133", "0.47917435", "0.47878745", "0.47812837", "0.47795397", "0.4760422", "0.47558203", "0.4745302", "0.47368968", "0.4736502", "0.47064507", "0.47054017", "0.4693501", "0.46893147", "0.46806723", "0.46698043", "0.4669525", "0.46664208", "0.46607497", "0.46528453", "0.46468076", "0.4636711", "0.46224546", "0.46203458", "0.46189454", "0.46184054", "0.46174407", "0.46124455", "0.4608786", "0.4607116", "0.46051908", "0.4596483", "0.45881298", "0.4577631", "0.45765978", "0.4573964", "0.45703033", "0.45649958", "0.45603126", "0.4554796", "0.4548614", "0.45477098", "0.4539025", "0.45347252", "0.45338887", "0.45221436", "0.45177737", "0.45050386", "0.4504828", "0.44999295", "0.44976243", "0.44947788", "0.44925895", "0.4487224", "0.4484647", "0.44845238", "0.44842654", "0.44827044" ]
0.4879486
31
/ Setting some initialization values: Number of stems in this branch, length of vector and radii array. Setting the first vector as the first vector given to us, normalized.
private void setStartPoints(int nCurveRes,float radius,Vector3f startVector,Random rand,float offset,float totalLength) { super.setStartPoints(nCurveRes,rand,totalLength); for(int i=0;i<=nCurveRes;i++) radii[i]=radius*(nCurveRes-i)/nCurveRes; startVector.normalize(); directions[0]=new Vector3f(startVector); this.offset=offset; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void init(myVector[] _initSt, SnowGlobeWin.SolverType _solv) {\n\t\tcurIDX = 0;\t\t\t\t\t\t\t\t\t//cycling ptr to idx in arrays of current sim values\n\t\t\n\t\taPosition = new myVector[szAcc];\n\t\taLinMomentum = new myVector[szAcc];\n\t\taAngMomentum = new myVector[szAcc];\n\t\taForceAcc = new myVector[szAcc];\n\t\taTorqueAcc = new myVector[szAcc];\n\t\taOldPos = new myVector[szAcc];\n\t\taOldLinMmnt = new myVector[szAcc];\n\t\taOldAngMmnt = new myVector[szAcc];\n\t\taOldForceAcc = new myVector[szAcc];\n\t\taOldTorqueAcc = new myVector[szAcc];\n\t\t\n\t\tfor(int i=0;i<szAcc;++i){\n\t\t\taPosition[i] = new myVector();\n\t\t\taLinMomentum[i] = new myVector();\n\t\t\taAngMomentum[i] = new myVector();\n\t\t\taForceAcc[i] = new myVector();\n\t\t\taTorqueAcc[i] = new myVector();\n\t\t\taOldPos[i] = new myVector();\n\t\t\taOldLinMmnt[i] = new myVector();\n\t\t\taOldAngMmnt[i] = new myVector();\n\t\t\taOldForceAcc[i] = new myVector();\n\t\t\taOldTorqueAcc[i] = new myVector();\n\t\t}\n//\t\taPosition[0].set(_pos);\n//\t\taLinMomentum[0].set(_velocity);\n//\t\taAngMomentum[0].set(_velocity);\n//\t\taForceAcc[0].set(_forceAcc);\n//\t\taTorqueAcc.set(_forceAcc);\n//\t\taOldPos[0].set(_pos);\n//\t\taOldLinMmnt[0].set(_velocity);\n//\t\taOldAngMmnt[0].set(_velocity);\n//\t\taOldForceAcc[0].set(_forceAcc);\n//\t\taOldTorqueAcc[0].set(_forceAcc);\n\t\t\n\t\tsetOrigMass(mass);\n//\t\tinitPos = new myVector(_pos);\n//\t\tinitVel = new myVector(_velocity);\n\t\tsolveType = _solv;\n\t\tsolver = new mySolver( _solv);\n\t}", "public UniformVector() {\n super(3);\n this.min = new VectorN(3);\n this.max = new VectorN(1.0, 1.0, 1.0);\n this.idum = -1;\n this.rn = new RandomNumber(this.idum);\n fillVector();\n }", "public VOIVector(int initialsize) {\r\n super(initialsize);\r\n }", "public Vector normalize ( );", "public void fillVector(){\n int n = min.length;\n for (int i = 0; i < n; i++) {\n this.x[i] = min.x[i] + (max.x[i] - min.x[i])*rn.uniformDeviate();\n }\n }", "public void init() {\n\n\n verdiend = 133;\n\n verdeling = verdiend / 4;\n }", "public void normalize() {\n\t\tdouble norm = norm();\n\t\tif (DoubleComparison.eq(norm, 0)) {\n\t\t\tthrow new RuntimeException(\"Failed to normalize: length is zero\");\n\t\t}\n\t\tthis.x = this.x / norm;\n\t\tthis.y = this.y / norm;\n\t\tthis.z = this.z / norm;\n\t}", "@Override\n public void init()\n {\n out = mul(num(100.0/Math.log10(length)), log10(div(sum(truerange(), length), diff(highest(length), lowest(length)))));\n }", "private void setInitialBallVelocity() {\n\t\tvx = rgen.nextDouble(1.0, 3.0);\n\t\tif (rgen.nextBoolean(0.5)) vx = -vx;\n\t\t\n\t\tvy = 3;\n\t}", "public void normalize() { sets length to 1\n //\n double length = Math.sqrt(x * x + y * y);\n\n if (length != 0.0) {\n float s = 1.0f / (float) length;\n x = x * s;\n y = y * s;\n }\n }", "public void SetVector(int[] v){ this.vector=v;}", "public Vector normalized(){\r\n\t\tfloat len = this.length();\r\n\t\tif( len != 0.0f && len != 1.0f ){\r\n\t\t\treturn new Vector( this.x / len, this.y / len, this.z / len );\r\n\t\t}\r\n\t\treturn this;\r\n\t}", "public Vector normalize() {\n double num=1/length();\n head = scale(num).head;\n return this;\n }", "public void normalize() {\r\n\t\tfloat length = (float) this.lenght();\r\n\t\tif (length > 0) {\r\n\t\t\tx /= length;\r\n\t\t\ty /= length;\r\n\t\t\tz /= length;\r\n\t\t}\r\n\t}", "public Vector(float[] axis){ this.axis = axis;}", "public void initializeDemandVector() {\r\n\t\tdouble marketSplit = Parameters.marketSplit / 100.0;\r\n\t\tfor (int i = 0; i < demandVector.length; i++) {\r\n\t\t\t\r\n\t\t\tdouble r = RandomHelper.nextDoubleFromTo(0, 1);\r\n\t\t\t\r\n\t\t\tdemandVector[i] = r < marketSplit ? 1 : 0;\r\n\t\t}\r\n\t}", "protected void setForceNormalVector() {\n\t\tvn = forceNormalVector(v1, v2);\n\t}", "@Test\n void normalize() {\n\n Vector v = new Vector(1, 2, 3);\n Vector vCopy = new Vector(v.getHead());\n Vector vCopyNormalize = vCopy.normalize();\n if (vCopy != vCopyNormalize)\n fail(\"ERROR: normalize() function creates a new vector\");\n if (!isZero(vCopyNormalize.length() - 1))\n fail(\"ERROR: normalize() result is not a unit vector\");\n Vector u = v.normalized();\n if (u == v)\n fail(\"ERROR: normalized() function does not create a new vector\");\n }", "public UniformVector(VectorN mn, VectorN mx){\n super(mn.length);\n mx.checkVectorDimensions(mn);\n this.min = new VectorN(mn);\n this.max = new VectorN(mx);\n this.idum = -1;\n this.rn = new RandomNumber(this.idum); \n fillVector();\n }", "public Vector()\r\n {\r\n // initialise instance variables\r\n first = null;\r\n last = null;\r\n count = 0;\r\n }", "public void initVector(int n) {\n\t\tvector = new ArrayList<Integer>(n);\n\t\tfor(int i=0;i<n;i++)\n\t\tvector.add(0);\n\t}", "protected void init() {\n \t\r\n ratios.put(1, 32.0f);\r\n ratios.put(2, 16.0f);\r\n ratios.put(3, 8.0f);\r\n ratios.put(4, 4.0f);\r\n ratios.put(5, 2.0f);\r\n ratios.put(6, 1.0f);\r\n }", "public void normalize() {\n float length = (float)Math.sqrt(nx * nx + ny * ny);\n nx/=length;\n ny/=length;\n }", "@Test //test normalize\n public void testNormalize() {\n double[] tempDoubleA = new double[]{3.1, 4.1};\n MyVector actualDoubleNorm = (new MyVector(tempDoubleA)).normalize();\n double normal = sqrt(3.1 * 3.1 + 4.1 * 4.1);\n MyVector expectDoubleNorm = new MyVector(new double[]{(3.1 / normal), (4.1 / normal)});\n\n assertTrue(actualDoubleNorm.equal(expectDoubleNorm), \"test int v mult int\");\n\n int[] tempIntA = new int[]{3, 4};\n MyVector actualIntNorm = (new MyVector(tempIntA)).normalize();\n MyVector expectIntNorm = new MyVector(new double[]{3 / (double) 5, 4 / (double) 5});\n assertTrue(actualIntNorm.equal(expectIntNorm), \"test int v mult int\");\n\n MyVector emptyNorm = EMPTYVECTOR.normalize();\n assertTrue(EMPTYVECTOR.equal(emptyNorm), \"test on empty vector normalization\");\n }", "private void correctParameter(){\n \tint ifObtuse;\r\n \tif(initialState.v0_direction>90)ifObtuse=1;\r\n \telse ifObtuse=0;\r\n \tdouble v0=initialState.v0_val;\r\n \tdouble r0=initialState.r0_val;\r\n \tdouble sintheta2=Math.sin(Math.toRadians(initialState.v0_direction))*Math.sin(Math.toRadians(initialState.v0_direction));\r\n \tdouble eccentricityMG=Math.sqrt(center.massG*center.massG-2*center.massG*v0*v0*r0*sintheta2+v0*v0*v0*v0*r0*r0*sintheta2);\r\n \tdouble cosmiu0=-(v0*v0*r0*sintheta2-center.massG)/eccentricityMG;\r\n \tpe=(v0*v0*r0*r0*sintheta2)/(center.massG+eccentricityMG);\r\n \tap=(v0*v0*r0*r0*sintheta2)/(center.massG-eccentricityMG);\r\n \tsemimajorAxis=(ap+pe)/2;\r\n \tsemiminorAxis=Math.sqrt(ap*pe);\r\n \tsemifocallength=(ap-pe)/2;\r\n \tSystem.out.println(semimajorAxis+\",\"+semiminorAxis+\",\"+semifocallength);\r\n \teccentricity=eccentricityMG/center.massG;\r\n \tperiod=2*Math.PI*Math.sqrt(semimajorAxis*semimajorAxis*semimajorAxis/(center.massG));\r\n \trotate=(360-Math.toDegrees(Math.acos(cosmiu0)));\r\n \torbitCalculator.angleDelta=(Math.toDegrees(Math.acos(cosmiu0))+360);\r\n \trotate=rotate+initialState.r0_direction;\r\n \t\r\n \tif(ifObtuse==1) {\r\n \t\tdouble rbuf=rotate;\r\n \t\trotate=initialState.r0_direction-rotate;\r\n \t\torbitCalculator.angleDelta+=(2*rbuf-initialState.r0_direction);\r\n \t}\r\n \tfor(;;) {\r\n \t\tif(rotate>360)rotate=rotate-360;\r\n \t\telse break;\r\n \t}\r\n \tfor(;;) {\r\n \t\tif(rotate<0)rotate=rotate+360;\r\n \t\telse break;\r\n \t}\r\n \t/*\r\n \tpe=initialState.r0_val;\r\n rotate=initialState.r0_direction;\r\n ap=(initialState.v0_val*initialState.v0_val*pe*pe)/(2*center.massG-initialState.v0_val*initialState.v0_val*pe);\r\n peSpeed=initialState.v0_val;\r\n apSpeed=(2*center.massG-initialState.v0_val*initialState.v0_val*pe)/(initialState.v0_val*pe);\r\n if(ap<pe){\r\n double lf=ap;ap=pe;pe=lf;\r\n lf=apSpeed;apSpeed=peSpeed;peSpeed=lf;\r\n }\r\n semimajorAxis=(ap+pe)/2;\r\n semifocallength=(ap-pe)/2;\r\n semiminorAxis=Math.sqrt(ap*pe);\r\n eccentricity=semifocallength/semimajorAxis;\r\n period=2*Math.PI*Math.sqrt(semimajorAxis*semimajorAxis*semimajorAxis/(center.massG));*/\r\n }", "public void setVectorNorm(double normb) {\n this.normb = normb;\n }", "StateVector(int site) {\n kLow = site;\n if (!initialized) { // Initialize the static working arrays on the first call\n logger = Logger.getLogger(StateVector.class.getName());\n tempV = new DMatrixRMaj(5,1);\n tempV2 = new DMatrixRMaj(5,1);\n tempM = new DMatrixRMaj(5,5);\n tempA = new DMatrixRMaj(5,5);\n Q = new DMatrixRMaj(5,5);\n U = CommonOps_DDRM.identity(5,5);\n Cinv = new DMatrixRMaj(5,5);\n solver = LinearSolverFactory_DDRM.symmPosDef(5);\n initialized = true;\n }\n }", "public abstract Vector4fc normalize(float length);", "public UniformVector(VectorN mn, VectorN mx, long seed){\n super(mn.length);\n mx.checkVectorDimensions(mn);\n this.min = new VectorN(mn);\n this.max = new VectorN(mx);\n if (seed > 0) seed = -seed;\n this.idum = seed;\n this.rn = new RandomNumber(this.idum); \n fillVector();\n }", "BlueSphere(int[] val) {\n value[0] = val[0];\n }", "public Vector2D normalize() \n {\n \tfloat length = getLength();\n if (length != 0.0f) \n {\n this.setX(this.getX() / length);\n this.setY(this.getY() / length);\n } \n else \n {\n this.setX(0.0f);\n this.setY(0.0f);\n }\n return this;\n }", "public void setVelocity(float dummyX, float dummyZ){\n\t\t\n\t}", "public Vector Normalize(){\n float magnitude = Magnitude();\n for(int i = 0; i < axis.length; i++){\n axis[i] /= magnitude;\n }\n return this;\n }", "public TwoBody(double mu, VectorN r, VectorN v)\n\t{\n\t\tthis.mu = mu;\n\t\trv2Elements(r, v);\n\t}", "RedSphere(int[] vals) {\n for (int i = 0; i < 6; i++) {\n value[i] = vals[i];\n }\n }", "RedSphere() {\n Random random = new Random();\n for (int i = 0; i < 6; i++) {\n value[i] = random.nextInt(33) + 1;\n }\n }", "public void setVector(int[] paramArrayOfInt)\n/* */ {\n/* 370 */ enterEvi(this.downNode, paramArrayOfInt);\n/* */ }", "private void initWithSize(int size) {\r\n this.size = size;\r\n if (size == 0) {\r\n size = 1; //Prevents memory allocation problem on GPU\r\n }\r\n\r\n normalX = new double[size];\r\n normalY = new double[size];\r\n normalZ = new double[size];\r\n\r\n vertexAX = new double[size];\r\n vertexAY = new double[size];\r\n vertexAZ = new double[size];\r\n\r\n edgeBAX = new double[size];\r\n edgeBAY = new double[size];\r\n edgeBAZ = new double[size];\r\n\r\n edgeCAX = new double[size];\r\n edgeCAY = new double[size];\r\n edgeCAZ = new double[size];\r\n\r\n centerX = new double[size];\r\n centerY = new double[size];\r\n centerZ = new double[size];\r\n\r\n area = new double[size];\r\n }", "@Test\n void testNormalize() {\n\n Vector vCopy = new Vector(v.getHead());\n Vector vCopyNormalize = vCopy.normalize();\n assertEquals(vCopy, vCopyNormalize, \"ERROR: normalize() function creates a new vector\");\n\n\n }", "public Vector330Class normalize(){\n if(this.magnitude() <= EPS){\n return new Vector330Class(0, 0);\n }\n else{\n return new Vector330Class(this.x * (1/this.magnitude()), this.y * (1/this.magnitude()));\n }\n }", "public Vector normalize(){\n\t\tdouble mag = magnitude();\n\t\treturn new Vector(x/mag, y/mag, z/mag);\n\t}", "public void setEqualTo(Vector v){ components = v.getVectorAsArray(); }", "public Vector(double x, double y, double z){\n double longueur = Math.sqrt(sqr(x) + sqr(y) + sqr(z));\n\n this.x = longueur > 0 ? x/longueur : this.x;\n this.y = longueur > 0 ? y/longueur : this.y;\n this.z = longueur > 0 ? z/longueur : this.z;\n \n }", "public void initialize(VectorSet orig) {\n\t\t\n\t}", "public Vec3(float initializer){\n\t\tthis(initializer, initializer, initializer);\n\t}", "public Vector2f normalize() {\n return div(length());\n }", "private void rv2Elements(VectorN r, VectorN v)\n\t{\n\t\tr.checkVectorDimensions(3);\n\t\tv.checkVectorDimensions(3);\n\t\t//Constants c = new Constants();\n\t\tVectorN evec = new VectorN(3); // e vector\n\t\tVectorN k = new VectorN(3); // unit vector in z direction\n\n\t\tthis.rv = new VectorN(r, v);\n\n\t\tdouble rmag = r.mag();\n\t\tdouble vmag = v.mag();\n\t\tdouble energy = vmag * vmag / 2.0 - this.mu / rmag;\n\n\t\tk.x[0] = 0.0;\n\t\tk.x[1] = 0.0;\n\t\tk.x[2] = 1.0;\n\n\t\tVectorN h = r.crossProduct(v);\n\t\tVectorN n = k.crossProduct(h);\n\n\t\tdouble rdotv = r.dotProduct(v);\n\n\t\tdouble q1 = (vmag * vmag - this.mu / rmag) / this.mu;\n\t\tdouble q2 = rdotv / this.mu;\n\n\t\tevec.x[0] = q1 * r.x[0] - q2 * v.x[0];\n\t\tevec.x[1] = q1 * r.x[1] - q2 * v.x[1];\n\t\tevec.x[2] = q1 * r.x[2] - q2 * v.x[2];\n\n\t\tthis.e = evec.mag();\n\n\t\tif (e != 1.0)\n\t\t{\n\t\t\tthis.a = -this.mu / (2.0 * energy);\n\t\t} else\n\t\t{\n\t\t\tthis.a = 1.0E30;\n\t\t\tSystem.out.println(\"parabolic orbit\");\n\t\t}\n\n\t\tthis.i = Math.acos(h.x[2] / h.mag()); // inclination\n\n\t\tthis.raan = Math.acos(n.x[0] / n.mag()); // raan\n\t\tif (n.x[1] < 0.0)\n\t\t{\n\t\t\tthis.raan = 2.0 * Constants.pi - raan;\n\t\t}\n\n\t\tthis.w = Math.acos(n.dotProduct(evec) / (n.mag() * e));\n\t\tif (evec.x[2] < 0.0)\n\t\t{\n\t\t\tthis.w = 2.0 * Constants.pi - this.w;\n\t\t}\n\n\t\tif (i == 0.0) // equatorial orbit, things blow up\n\t\t{\n\t\t\t//\t\t System.out.println(\"KeplerElements: equatorial orbit, RAAN no good\");\n\t\t\tthis.raan = 0.0;\n\t\t\tthis.w = Math.acos(evec.x[0] / e);\n\t\t\tif (evec.x[1] < 0.0)\n\t\t\t{\n\t\t\t\tthis.w = 2.0 * Constants.pi - this.w;\n\t\t\t}\n\t\t}\n\n\t\tif (i == Constants.pi) // equatorial orbit, things blow up\n\t\t{\n\t\t\t//\t\t System.out.println(\"KeplerElements: equatorial orbit, RAAN no good\");\n\t\t\tthis.raan = 0.0;\n\t\t\tthis.w = Math.acos(evec.x[0] / e);\n\t\t\tif (evec.x[1] > 0.0)\n\t\t\t{\n\t\t\t\tthis.w = 2.0 * Constants.pi - this.w;\n\t\t\t}\n\t\t}\n\n\t\tthis.ta = Math.acos(evec.dotProduct(r) / (e * rmag));\n\t\tif (rdotv < 0.0)\n\t\t{\n\t\t\tthis.ta = 2.0 * Constants.pi - this.ta;\n\t\t}\n\t}", "public void init() {\n//\t\tint anglesToEncTicks = (int) ((90 - currentAngle) * encoderTicksPerRev);\n//\t\tarmMotor.setEncPosition(anglesToEncTicks);\n\t\twhile (armMotor.isFwdLimitSwitchClosed() != true) {\n\t\t\tarmMotor.set(.2);\n\t\t}\n\t\tSystem.out.println(\"Calibrated!\");\n\t\tarmMotor.setEncPosition(0);\n\t}", "public Vector normalized() {\n double size = this.length();\n return new Vector(this.getHead().getX() / size, this.getHead().getY() / size, this.getHead().getZ() / size);\n }", "public void setRightVector(Vector v) throws IncorrectSpaceException {\n if (v.getSpace() != inputSpace) {\n throw new IncorrectSpaceException();\n }\n this.v = v;\n }", "private void initGeneStatusDistributionRangeVector() {\n\t\tfor (int i = 0; i < GATracker.GENE_STATUS_DISTRIBUTION_SIZE; i++) {\n\t\t\t// Rounding the number off to the 4 significand digits\n\t\t\tgene_status_distribution_range[i] = Math.round(2*Math.abs(Math.sin(i*Math.PI/180)*10000))/10000.0;\n\t\t}\n\t}", "public Vec3(float[] init){\n\t\tif(init.length >= 3){\n\t\t\tx = init[0];\n\t\t\ty = init[1];\n\t\t\tz = init[2];\n\t\t\ttrunc();\n\t\t}\n\t}", "public MyVector() {\n\t\tarr = new int[10];\n\t\tend = 0;\n\t}", "@Override\r\n\tpublic void initialize() {\n\t\tRandom randomGenerator = new Random();\r\n\t\tthis.size = Helper.getRandomInRange(1, 9, randomGenerator);\r\n\t\tif (this.size % 2 == 0)\r\n\t\t\tthis.size--;\r\n\t}", "public static void setVectors( Body body, StateVector state ) {\r\n\r\n body.lastState.copyStateVectors( body.currentState );\r\n body.currentState.x = state.x;\r\n body.currentState.y = state.y;\r\n body.currentState.z = state.z;\r\n body.currentState.vx = state.vx;\r\n body.currentState.vy = state.vy;\r\n body.currentState.vz = state.vz;\r\n\r\n }", "public final void normalize() {\n\tsvd(this);\n }", "float[][] getCameraVectorsNormal(int resX, int resY){\n float vectors[][]=new float[resX*resY][3];//first vector index, second the components of the vector\n float[] vect2=rotateYVector(dir);\n vect2[1]=0;\n vect2=normalize(vect2);\n float[] vect3=normalize(vectorProduct(dir, vect2));//dir, vect2, vect3 base vectors\n float[] x={0,0,0};\n float[] y={0,0,0};\n float[] temp={0,0,0};\n for(int i=0;i<3;i++){\n x[i]=(vect2[i])/(resX/2);\n y[i]=(vect3[i])/(resY/2);\n temp[i]=vect2[i];\n }\n \n for(int j=0;j<resY;j++){\n for(int i=0;i<resX;i++){\n vectors[j*resX+i][0]=dir[0]+vect2[0]+vect3[0];\n vectors[j*resX+i][1]=dir[1]+vect2[1]+vect3[1];\n vectors[j*resX+i][2]=dir[2]+vect2[2]+vect3[2];\n vectors[j*resX+i]=normalize(vectors[j*resX+i]);\n vect2[0]-=x[0];\n vect2[1]-=x[1];\n vect2[2]-=x[2];\n if((vectorLength(vect2)>(-0.0001)&&vectorLength(vect2)<0.0001)&&(resX%2)==0){\n vect2[0]-=x[0];\n vect2[1]-=x[1];\n vect2[2]-=x[2];\n }\n }\n //printVector(temp);\n vect2[0]=temp[0];\n vect2[1]=temp[1];\n vect2[2]=temp[2];\n vect3[0]-=y[0];\n vect3[1]-=y[1];\n vect3[2]-=y[2];\n if((vectorLength(vect3)>(-0.0001)&&vectorLength(vect3)<0.0001)&&(resY%2)==0){\n vect3[0]-=y[0];\n vect3[1]-=y[1];\n vect3[2]-=y[2];\n }\n }\n \n return vectors;\n }", "public Vector3 (double[] values) {\n set(values);\n }", "static void normalize(double[] state) {\r\n double norm = 1/Math.sqrt(state[0]*state[0]+state[2]*state[2]+state[4]*state[4]+state[6]*state[6]);\r\n state[0] *= norm;\r\n state[2] *= norm;\r\n state[4] *= norm;\r\n state[6] *= norm;\r\n }", "BlueSphere() {\n Random random = new Random();\n value[0] = random.nextInt(16) + 1;\n }", "protected void initialize() {\n \tbrakeFactor = 0.0;\n }", "static void bodyToSpace(double[] state, double[] vec) {\r\n // use q components for clarity\r\n double q0 = state[0], q1 = state[2], q2 = state[4], q3 = state[6];\r\n double v0 = (0.5-q2*q2-q3*q3)*vec[0]+(q1*q2-q0*q3)*vec[1]+(q1*q3+q0*q2)*vec[2];\r\n double v1 = (q1*q2+q0*q3)*vec[0]+(0.5-q1*q1-q3*q3)*vec[1]+(q2*q3-q0*q1)*vec[2];\r\n double v2 = (q1*q3-q0*q2)*vec[0]+(q2*q3+q0*q1)*vec[1]+(0.5-q1*q1-q2*q2)*vec[2];\r\n vec[0] = 2*v0;\r\n vec[1] = 2*v1;\r\n vec[2] = 2*v2;\r\n }", "@Override\n public void setRadii(float[] radii) {\n if (radii == null) {\n Arrays.fill(mRadii, 0);\n } else {\n Preconditions.checkArgument(radii.length == 8, \"radii should have exactly 8 values\");\n System.arraycopy(radii, 0, mRadii, 0, 8);\n }\n updatePath();\n invalidateSelf();\n }", "public abstract Vector4fc set(float d);", "@Override\n\tpublic double\n\tnormalize()\n\t{\n\t\tdouble len = length();\n\n\t\tif( len != 0 )\n\t\t{\n\t\t\tdata[0] /= len;\n\t\t\tdata[1] /= len;\n\t\t\tdata[2] /= len;\n\t\t}\n\t\t\n\t\treturn len;\n\t}", "public Vector4d normalize() {\n\t\tdouble len = length();\n\t\tif (len != 0) {\n\t\t\tx /= len;\n\t\t\ty /= len;\n\t\t\tz /= len;\n\t\t\tw /= len;\n\t\t}\n\t\treturn this;\n\t}", "public void initialize() {\n final Double optimismRate = new Double(0.0);\n _counts.clear();\n _values.clear();\n\n for (Integer index : Range.closed(0, _armsNo - 1).asSet(DiscreteDomains.integers())) {\n _counts.add(index, optimismRate.intValue());\n _values.add(index, optimismRate);\n }\n }", "public Vector normalize() {\n this.head = this.normalized().getHead();\n return this;\n }", "void normalizeSafe (Vector3f kVector)\r\n {\r\n set(kVector);\r\n normalizeSafe();\r\n }", "Vector getZeroVector();", "protected void buildRadius()\r\n\t{\n\t\tif (m_Qmax == null || m_Qmin == null)\r\n\t\t{\r\n\t\t\tupdateQMinQMax();\r\n\t\t}\r\n\t\t\r\n\t\tm_Radius = getMaxDistanceOrigin();\r\n\t}", "public Vector2f normalizeLocal ()\n {\n return normalize(this);\n }", "private void initialize(int entitySize, int relationSize,int k){\n entityVectors = new ArrayList<double[]>();\n relationVectors = new ArrayList<double[]>();\n normalVectors = new ArrayList<double[]>();\n for (int i = 0; i < entitySize; i++){\n double[] eVector = helper.initVector(k);\n double[] normedEVector = helper.norm(eVector);\n entityVectors.add(normedEVector);\n }\n for(int j =0; j < relationSize; j++){\n double[] rVector = helper.initVector(k);\n double[] normRVector = helper.norm(rVector);\n double[] nVector = helper.initVector(k);\n double[]normNVector = helper.norm(nVector);\n relationVectors.add(normRVector);\n normalVectors.add(normNVector);\n }\n }", "public TwoBody(VectorN r, VectorN v)\n\t{\n\t\trv2Elements(r, v);\n\t}", "public Vector normalized() {\n Vector t=new Vector(normalize());\n return t;\n }", "public Ray(Point3D head, Vector direction, Vector normal) {\n\t\tthis(head, direction);\n\t\tdouble nv = normal.dotProduct(_dir);\n\t\tif (!Util.isZero(nv)) {\n\t\t\tVector epsVector = normal.scale(nv > 0 ? DELTA : -DELTA);\n\t\t\t_p0 = head.add(epsVector);\n\t\t}\n\t}", "public static void initVelocity() {\n }", "public static void setVector(double[] v, double c0, double c1, double c2) {\n v[0] = c0;\n v[1] = c1;\n v[2] = c2;\n }", "void normalizeSafe()\r\n {\r\n float fLengthSquared = lengthSquared();\r\n if ( 0.0f == fLengthSquared )\r\n {\r\n set(ZERO);\r\n }\r\n else\r\n {\r\n scale(1.0f/(float)Math.sqrt(fLengthSquared));\r\n }\r\n }", "protected void initialize() {\n\t\t// startAngle = drive.getAngle();\n\t\tdrive.resetBothEncoders();\n\t\tpLeft = speed;\n\t\tpRight = speed;\n\t}", "private void setCurrentRadius(double r){\n\t\t\n\t\t_currentRadius = r;\n\t\t\n\t}", "private synchronized void initCircumstances() {\n if (circV == null) {\n\n // Calculate visit circumstances, which includes setup time.\n Function<Long, WorldCoords> coords = getObs()::getCoords;\n int size = Math.max(1, (int) (interval.getLength() / QUANTUM));\n circV = new TreeMap<Circumstance, Double[]>();\n for (Circumstance c: Circumstance.values()) {\n circV.put(c, new Double[size]);\n }\n TimingWindowSolver tws = new TimingWindowSolver(obs);\n ImprovedSkyCalc calc = new ImprovedSkyCalc(variant.getSchedule().getSite());\n for (int i = 0; i < size; i++) {\n long t = interval.getStart() + QUANTUM * i;\n calc.calculate(coords.apply(t), new Date(t), true);\n for (Circumstance c: Circumstance.values()) {\n Double[] vals = circV.get(c);\n switch (c) {\n case AIRMASS: vals[i] = calc.getAirmass(); break;\n case AZIMUTH: vals[i] = calc.getAzimuth(); break;\n case ELEVATION: vals[i] = calc.getAltitude(); break;\n case LUNAR_DISTANCE: vals[i] = calc.getLunarDistance(); break;\n case PARALLACTIC_ANGLE: vals[i] = calc.getParallacticAngle(); break;\n case TOTAL_SKY_BRIGHTNESS: vals[i] = calc.getTotalSkyBrightness(); break;\n case HOUR_ANGLE: vals[i] = calc.getHourAngle(); break;\n case TIMING_WINDOW_OPEN: vals[i] = tws.includes(t) ? 1. : 0.; break;\n default: throw new Error(\"Missing switch case for \" + c);\n }\n }\n }\n\n // Now calculate circumstances for science.\n if (getSetupType() != SetupType.NONE) {\n\n circS = new TreeMap<Circumstance, Double[]>();\n final long setupTime = getSetupTime();\n\n for (Circumstance c: Circumstance.values()) {\n\n Double[] valsV = circV.get(c);\n Double[] valsS = new Double[valsV.length];\n\n // We want to copy the range n ... length where n is the first\n // quantum that's not during setup time, or the last sample, so\n // we guarantee at least one.\n int n = Math.min((int) (setupTime / QUANTUM), valsV.length - 1);\n System.arraycopy(valsV, n, valsS, n, valsV.length - n);\n\n circS.put(c, valsS);\n\n }\n\n } else {\n\n // Science and visit circumstances are the same if there is no setup.\n circS = circV;\n\n }\n\n }\n }", "@Override\n\tpublic void initializeSubSlacks() throws IloException {\n\t\txiZ = new double[formulation.n()];\n\n\t\t/* Compute xiZ */\n\t\tfor(int i = 0 ; i < formulation.n() ; i++){\n\n\t\t\txiZ[i] = 0;\n\t\t\t\n\t\t\t/* Id of <i> in <Z> */\n\t\t\tint z = -1;\n\t\t\t\n\t\t\tif(currentSet().inZ[i])\n\t\t\t\tz = currentSet().Z.indexOf(i);\n\t\t\t\n\t\t\tfor(int z2 = 0 ; z2 < currentSet().Z.size() ; ++z2)\n\t\t\t\tif(z != z2)\n\t\t\t\t\txiZ[i] += vg.getValue(formulation.edgeVar(i,currentSet().Z.get(z2)));\n\t\t\t\n\t\t}\n\n\t}", "private void normalize() {\r\n // GET MAX PRICE \r\n for (Alternative alt : alternatives) {\r\n if (alt.getPrice() > 0 && alt.getPrice() < minPrice) {\r\n minPrice = alt.getPrice();\r\n }\r\n }\r\n\r\n for (Alternative alt : alternatives) {\r\n // NORMALIZE PRICE - NON BENIFICIAL using max - min \r\n double price = alt.getPrice();\r\n double value = minPrice / price;\r\n alt.setPrice(value);\r\n // BENITIFICIAL v[i,j] = x[i,j] / x[max,j]\r\n double wood = alt.getWood();\r\n value = wood / maxWood;\r\n alt.setWood(value);\r\n\r\n double brand = alt.getBrand();\r\n value = wood / maxBrand;\r\n alt.setBrand(value);\r\n\r\n double origin = alt.getOrigin();\r\n value = origin / maxOrigin;\r\n alt.setOrigin(value);\r\n\r\n }\r\n }", "static void spaceToBody(double[] state, double[] vec) {\r\n // use components for clarity\r\n double q0 = state[0], q1 = state[2], q2 = state[4], q3 = state[6];\r\n double v0 = (0.5-q2*q2-q3*q3)*vec[0]+(q1*q2+q0*q3)*vec[1]+(q1*q3-q0*q2)*vec[2];\r\n double v1 = (q1*q2-q0*q3)*vec[0]+(0.5-q1*q1-q3*q3)*vec[1]+(q2*q3+q0*q1)*vec[2];\r\n double v2 = (q1*q3+q0*q2)*vec[0]+(q2*q3-q0*q1)*vec[1]+(0.5-q1*q1-q2*q2)*vec[2];\r\n vec[0] = 2*v0;\r\n vec[1] = 2*v1;\r\n vec[2] = 2*v2;\r\n }", "public void setLeftVector(Vector u) throws IncorrectSpaceException {\n if (u.getSpace() != outputSpace) {\n throw new IncorrectSpaceException();\n }\n this.u = u;\n }", "public void normalize()\n {\n\tdef += 200*counter;\n\tdmg -= 0.5*counter;\n\tcounter = 0;\n }", "public Branch(int nCurveRes,float nCurve,float nCurveBack,float nCurveV,Random rand,float totalLength,float radius,Point3f startPoint,Vector3f startVector,float offset) {\n\t\tsetStartPoints(nCurveRes,radius,startVector,rand,offset,totalLength); //Some initialization.\n\t\tsetVectors(nCurveRes,nCurve,nCurveBack,nCurveV);\n\t\tpoints=utils.ThreeD.setPoints(directions,startPoint); //Derives points from vectors and starting point.\n\t}", "public Circle(double r)\n {\n setRad(r);\n\n }", "public void setVector(nvo_coords.CoordsType vector) {\n this.vector = vector;\n }", "private double[] getNormalVector(Conformer conformer, int[] atom) {\n\t\tdouble[] n = new double[3];\n\t\tgetNormalVector(conformer, atom, n);\n\t\treturn n;\n\t\t}", "public void setVector(float x, float y)\n {\n speedVector.x = x / 5;\n speedVector.y = y / 5;\n if((mag = speedVector.x * speedVector.x + speedVector.y * speedVector.y) > 1)\n {\n mag = FloatMath.sqrt(mag);\n speedVector.x /= mag;\n speedVector.y /= mag;\n }\n }", "public Vector3(double s)\n\t{\n\t\tx = y = z = s;\n\t}", "public Vector2f normalize (Vector2f result)\n {\n return mult(1f / length(), result);\n }", "public void unitize() {\n \t\tdouble len = this.len();\n \t\t// avoid division by zero\n\t\tif (len<vecPrecision) return;\n \t\t// don't unitize roughly unit vectors\n \t\tif (Math.abs(len-1)<vecPrecision) return;\n \t\t// divide dimensions by length to unitize\n \t\tfloat invlen = (float) (1.0 / len);\n \t\tthis.x *= invlen;\n \t\tthis.y *= invlen;\n \t\tthis.z *= invlen;\n \t}", "@Override\n protected void initialize() { \n\n \n SmartDashboard.putNumber(\"Side Velocity\", sideVelocity);\n SmartDashboard.putNumber(\"Belt velocity\", beltVelocity);\n\n }", "public Vector3 normalized() {\n\t\tif (isZeroVector(this)) {\n\t\t\treturn this;\n\t\t}\n\t\treturn new Vector3(x / norm(), y / norm(), z / norm());\n\t}", "public Vector3 boostVector() {\n\t\tif (this.e() == 0)\n\t\t\treturn new Vector3(0., 0., 0.);\n\t\treturn new Vector3(this.px() / this.e(), this.py() / this.e(), this.pz() / this.e());\n\t}", "protected void initializeUniformWeight() {\n\n if(CrashProperties.fitnessFunctions.length == 2){\n for (int n = 0; n < populationSize; n++) {\n double a = 1.0 * n / (populationSize - 1);\n lambda[n][0] = a;\n lambda[n][1] = 1 - (a);\n }\n }else {\n for (int n = 0; n < populationSize; n++) {\n double a = 1.0 * n / (populationSize - 1);\n lambda[n][0] = a;\n lambda[n][1] = (1 - (a))/2;\n lambda[n][2] = (1 - (a))/2;\n }\n }\n\n }", "static double[] unitVector(double[] vector) {\n if (vector.length != 3)\n throw new IllegalArgumentException(\"Argument not a 3-D vector <dim=\" + vector.length + \">.\");\n double magnitude = vectorMagnitude(vector);\n\n return (new double[] {vector[0] / magnitude, vector[1] / magnitude, vector[2] / magnitude});\n }", "private void initialize()\n\t{\n\t\tfor(int i = 0 ; i < SOM.length; i++)\n\t\t{\n\t\t\tfor(int j=0; j < SOM[0].length; j++)\n\t\t\t{ \n\t\t\t\tSOM[i][j] = new Node(INPUT_DIMENSION,i,j);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSOM_HORIZONTAL_LENGTH = SOM[0].length;\n\t\tSOM_VERTICAL_LENGTH = SOM.length;\n\t}" ]
[ "0.6084742", "0.602243", "0.5735669", "0.57144666", "0.5686324", "0.56827104", "0.5645569", "0.5641095", "0.5637958", "0.5637657", "0.56284773", "0.5622367", "0.55576396", "0.55270237", "0.54963785", "0.5486973", "0.54734033", "0.5463028", "0.5461288", "0.544667", "0.54017013", "0.5395074", "0.5372278", "0.53672093", "0.5353627", "0.5338977", "0.533623", "0.5329384", "0.53170055", "0.5314839", "0.5313111", "0.52757853", "0.5258906", "0.52520484", "0.5228742", "0.5228495", "0.5220034", "0.5212824", "0.52036995", "0.5201749", "0.5189742", "0.5186542", "0.51862675", "0.5184276", "0.51814616", "0.5176449", "0.51727545", "0.5161684", "0.51550704", "0.51436013", "0.51399094", "0.51309896", "0.5125908", "0.51160985", "0.5105498", "0.51005507", "0.50993055", "0.50911826", "0.5091137", "0.5089532", "0.5088212", "0.50787663", "0.507379", "0.50694597", "0.50674117", "0.50520754", "0.50506455", "0.50492376", "0.5047447", "0.50431573", "0.50375575", "0.50350505", "0.50303674", "0.5022344", "0.5017189", "0.5014165", "0.50118184", "0.50084645", "0.50078887", "0.5005624", "0.49996722", "0.4998508", "0.49889153", "0.49855796", "0.4980228", "0.49786216", "0.49762025", "0.49685052", "0.4966797", "0.49630606", "0.4962533", "0.49582118", "0.49575338", "0.49566087", "0.49549046", "0.4952257", "0.4947212", "0.49458575", "0.494276", "0.4934947", "0.49340913" ]
0.0
-1
/ access modifiers changed from: packageprivate
public final /* synthetic */ void a(int i, int i2, Activity activity, String str) { this.l = i; if (this.l > 0 || i2 != 1) { if (!TextUtils.isEmpty(str)) { this.l += str.length(); } return; } a.c((Context) activity, activity.getResources().getString(C0906R.string.bwo)).a(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n protected void prot() {\n }", "public void method_4270() {}", "@Override\n public void func_104112_b() {\n \n }", "private void m50366E() {\n }", "private void kk12() {\n\n\t}", "public final void mo51373a() {\n }", "@Override\n public void perish() {\n \n }", "public abstract void mo70713b();", "public void m23075a() {\n }", "public void mo38117a() {\n }", "private MApi() {}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public abstract void mo56925d();", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "public void mo21779D() {\n }", "public abstract void mo27386d();", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "void m1864a() {\r\n }", "public abstract Object mo26777y();", "public void mo21825b() {\n }", "protected boolean func_70814_o() { return true; }", "public final void mo91715d() {\n }", "public abstract void mo27385c();", "public void mo97908d() {\n }", "public void mo21782G() {\n }", "private TMCourse() {\n\t}", "private test5() {\r\n\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private Util() { }", "protected void mo6255a() {\n }", "private abstract void privateabstract();", "public void mo21877s() {\n }", "public void mo21787L() {\n }", "private MigrationInstantiationUtil() {\n\t\tthrow new IllegalAccessError();\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "public void mo21791P() {\n }", "private MetallicityUtils() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "public abstract void mo6549b();", "public void mo23813b() {\n }", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:49.426 -0500\", hash_original_method = \"26D71A046B8A5E21DEFC65FB89CD9FDA\", hash_generated_method = \"2293476E78FCC8BDA181F927AEA93BD1\")\n \nprivate void copyTables ()\n {\n if (prefixTable != null) {\n prefixTable = (Hashtable)prefixTable.clone();\n } else {\n prefixTable = new Hashtable();\n }\n if (uriTable != null) {\n uriTable = (Hashtable)uriTable.clone();\n } else {\n uriTable = new Hashtable();\n }\n elementNameTable = new Hashtable();\n attributeNameTable = new Hashtable();\n declSeen = true;\n }", "public void mo44053a() {\n }", "public void smell() {\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 }", "public void mo115190b() {\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}", "public void mo21785J() {\n }", "public void mo21793R() {\n }", "public void mo21878t() {\n }", "public void mo56167c() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public abstract String mo118046b();", "public void mo115188a() {\n }", "private SourcecodePackage() {}", "public abstract String mo41079d();", "void mo57277b();", "public void mo6944a() {\n }", "public abstract void mo30696a();", "public abstract void mo42329d();", "private final zzgy zzgb() {\n }", "private Utils() {\n\t}", "private Utils() {\n\t}", "protected boolean func_70041_e_() { return false; }", "zzafe mo29840Y() throws RemoteException;", "private Singletion3() {}", "public abstract void mo42331g();", "public abstract void mo35054b();", "public abstract String mo13682d();", "public void mo21786K() {\n }", "public void mo3376r() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public void mo3749d() {\n }", "public void mo21794S() {\n }", "public void mo12628c() {\n }", "private Infer() {\n\n }", "public void mo9848a() {\n }", "public abstract void mo27464a();", "private OMUtil() { }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private NativeSupport() {\n\t}", "public void mo2740a() {\n }", "@Override\n public boolean isPrivate() {\n return true;\n }" ]
[ "0.71507126", "0.66852754", "0.6558074", "0.6482426", "0.64311445", "0.638545", "0.63839656", "0.63482744", "0.63302624", "0.6277197", "0.62635255", "0.6250569", "0.62368745", "0.6233547", "0.6228953", "0.6197293", "0.6197293", "0.6194772", "0.6184139", "0.6180766", "0.61573917", "0.6152649", "0.6152198", "0.6116647", "0.61093503", "0.6108619", "0.60879374", "0.60821515", "0.60723346", "0.6068983", "0.60565233", "0.60564804", "0.605594", "0.6050983", "0.60498387", "0.60470885", "0.60436356", "0.603736", "0.60237354", "0.60237354", "0.60237354", "0.60237354", "0.6019666", "0.60196143", "0.6018301", "0.601686", "0.60056096", "0.600329", "0.5999082", "0.5997544", "0.59962994", "0.5995191", "0.5991293", "0.5991293", "0.5991293", "0.5991293", "0.5991293", "0.5991293", "0.5991293", "0.5991282", "0.5987402", "0.5987402", "0.5984476", "0.59827936", "0.5973211", "0.5958472", "0.5957542", "0.5953589", "0.59519774", "0.594738", "0.59457314", "0.59445536", "0.5942774", "0.5940164", "0.5938114", "0.5938083", "0.5926483", "0.59255004", "0.59255004", "0.5925304", "0.5914172", "0.5909818", "0.59050065", "0.59049857", "0.5904506", "0.5899379", "0.5896449", "0.5894286", "0.58935714", "0.5890183", "0.58829314", "0.58781534", "0.58774024", "0.58768195", "0.5875799", "0.5873635", "0.5867603", "0.5867603", "0.5866908", "0.58663774", "0.58619076" ]
0.0
-1
Create ctcom quit message object. The object's attributes get filled with the information extracted from the message string.
public QuitMessage(String messageString) throws ReadMessageException { super(messageString); this.type = MessageType.QUIT; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Message makeQuitMessage(String myName) {\n return new Message(MessageType.QUIT, myName, null);\n }", "public Message newMessage(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6) {\n/* 118 */ return new SimpleMessage(message);\n/* */ }", "public MQMsg() {\n\n messageType = \" \";\n service = \"SSSSSSSS\";\n serverUser = \"UUUUUUUU\";\n serverPassword = \"PPPPPPPP\";\n serverAppl = \"AAAAAAAA\";\n cicsTrx = \"CICS\";\n timeout = 30;\n retcode = 0;\n data = \"\";\n\n }", "public Message newMessage(String message, Object p0, Object p1, Object p2, Object p3, Object p4) {\n/* 101 */ return new SimpleMessage(message);\n/* */ }", "public Message newMessage(String message, Object p0, Object p1, Object p2, Object p3) {\n/* 93 */ return new SimpleMessage(message);\n/* */ }", "public Message newMessage(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7) {\n/* 127 */ return new SimpleMessage(message);\n/* */ }", "public Message newMessage(String message, Object p0) {\n/* 69 */ return new SimpleMessage(message);\n/* */ }", "public Message newMessage(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8) {\n/* 136 */ return new SimpleMessage(message);\n/* */ }", "public Message newMessage(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8, Object p9) {\n/* 145 */ return new SimpleMessage(message);\n/* */ }", "public Message() {\n message = \"\";\n senderID = \"\";\n time = 0;\n }", "public Message newMessage(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5) {\n/* 109 */ return new SimpleMessage(message);\n/* */ }", "protected ParseObject createMessage() {\n //format single variables appropriatly. most cases the field is an array\n ArrayList<ParseUser> nextDrinker = new ArrayList<ParseUser>();\n nextDrinker.add(mNextDrinker);\n ArrayList<String> groupName = new ArrayList<String>();\n groupName.add(mGroupName);\n\n ParseObject message = new ParseObject(ParseConstants.CLASS_MESSAGES);\n message.put(ParseConstants.KEY_SENDER_ID, ParseUser.getCurrentUser().getObjectId());\n message.put(ParseConstants.KEY_SENDER, ParseUser.getCurrentUser());\n message.put(ParseConstants.KEY_GROUP_ID, mGroupId);\n message.put(ParseConstants.KEY_GROUP_NAME, groupName);\n message.put(ParseConstants.KEY_SENDER_NAME, ParseUser.getCurrentUser().getUsername());\n message.put(ParseConstants.KEY_RECIPIENT_IDS, nextDrinker);\n message.put(ParseConstants.KEY_MESSAGE_TYPE, ParseConstants.TYPE_DRINK_REQUEST);\n\n return message;\n }", "public Message(){\n this.body = null;\n this.contact = null;\n }", "public POP3 parse(String s) {\n\n\n POP3 msg = new POP3();\n msg.setData(s);\n if (s.getBytes().length > 255) {\n if (s.contains(\"\\r\\n.\\r\\n\")) {\n msg.setDone();\n }\n } else if (!s.equals(\"+OK\\r\\n\")) {\n msg.setDone();\n }\n\n\n return msg;\n }", "DynamicMessage createDynamicMessage();", "public Message(){}", "public static IMMessage createEmptyMessage(String account,SessionTypeEnum sessionTypeEnum,int i){\n EMMessage msg=EMMessage.createTxtSendMessage(\"aa\",account);\r\n return new IMMessage(msg);\r\n }", "private CancelMessage makeCancelMessage(Tradable t, String details) throws InvalidDataException {\n\t\treturn new CancelMessage(t.getUser(),t.getProduct(),t.getPrice(),\n\t\t\t\tt.getRemainingVolume(), details, t.getSide(),t.getId());\n\t}", "private Message createMsg(long type,Object event){\r\n Message msg=new Message(0,type,0,\"\",new Object[]{event},\r\n System.currentTimeMillis(),0,0,null,0,0,0);\r\n return msg;\r\n }", "public static SimpleMessageObject createMessageObject(byte[] data) {\n SimpleMessageObject retVal = new SimpleMessageObject();\n \n // data is of the form:\n // byte(data type)|int(length of name)|name|int(length of value)|value\n boolean keepGoing = true;\n int currentPointer = 0;\n while(keepGoing) {\n int type = data[currentPointer];\n int bytesToRead = 0;\n String name;\n currentPointer++;\n switch(type) {\n //String\n case 0x73:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n String stringValue = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addString(name, stringValue);\n break;\n \n //int\n case 0x69:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n int intValue = DataConversions.getInt(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addInt(name, intValue); \n break;\n \n //long\n case 0x6c:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n long longValue = DataConversions.getLong(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addLong(name, longValue);\n break;\n \n //double\n case 0x64:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n double doubleValue = DataConversions.getDouble(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addDouble(name, doubleValue); \n break;\n \n //float\n case 0x66:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n float floatValue = DataConversions.getFloat(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addFloat(name, floatValue); \n break;\n \n //char\n case 0x63:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n char charValue = DataConversions.getChar(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addChar(name, charValue);\n break;\n \n //byte array\n case 0x62:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n byte[] byteValue = DataConversions.getByteArray(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addByteArray(name, byteValue);\n break;\n }\n \n if(currentPointer == data.length) {\n keepGoing = false;\n }\n }\n \n return retVal;\n }", "public Message newMessage(String type) {\n\tString address = null;\n\n\t/*\n * Provide the default address from the original open.\n */\n\n\tif (((m_mode & Connector.WRITE) > 0) && (host != null)) {\n\t address = ADDRESS_PREFIX + host;\n\t if (m_iport != 0) {\n\t\taddress = address + \":\" + String.valueOf(m_iport);\n\t }\n\t}\n\n\treturn newMessage(type, address);\n }", "public void parseMessage(String input) {\n int length = input.length() - 1 + Message.HEADER_LENGTH + Message.FOOTER_LENGTH;\n String message = \"\";\n message += Message.BEGIN_CHAR;\n message += \"\"+length;\n message += input;\n message += Message.END_CHAR;\n System.out.println(message);\n s.sendLine(message);\n }", "private Message(Parcel in) {\n text = in.readString();\n sender = in.readString();\n target = in.readString();\n sendersLatitude = in.readDouble();\n sendersLongitude = in.readDouble();\n numHops = in.readInt();\n expirationTime = in.readLong();\n createdByUser = in.readInt();\n }", "public Message(String unparsedData){\n\t\theaderLines = new ArrayList<ArrayList<String>>();\n\t\tString[] headFromEntity = unparsedData.split(\"\\n\\n\", 2);\n\t\tString[] msgInfo = headFromEntity[0].split(\"\\n\");\n\t\tString[] status = msgInfo[0].split(\" \");\n\t\t\n\t\tthis.messageInfo[0]= status[0];\t\t\t\t\t// Version\n\t\tthis.messageInfo[1] = status[1];\t\t\t\t// status code\n\t\tthis.messageInfo[2] = msgInfo[0].substring(2);\t// phrase\n\t\t\n\t\tfor (int i = 1; i < msgInfo.length; i++){\n\t\t\tstatus = msgInfo[i].split(\" \");\n\t\t\theaderLines.add(new ArrayList<String>());\n\t\t\theaderLines.get(headerLines.size()-1).add(status[0]);\n\t\t\theaderLines.get(headerLines.size()-1).add(msgInfo[i].substring(status[0].length()));\n\t\t}\n\t\t\n\t\tentity = headFromEntity[1].getBytes();\n\t}", "public Message newMessage(String message, Object... params) {\n/* 61 */ return new SimpleMessage(message);\n/* */ }", "public Message() {\n\t\tsuper();\n\t}", "public Message() {}", "public Message() {}", "public Message(){\n super();\n this.status = RETURN_OK;\n put(\"status\",this.status.getCode());\n put(\"message\", this.status.getMessage());\n }", "public Message newMessage(String message, Object p0, Object p1) {\n/* 77 */ return new SimpleMessage(message);\n/* */ }", "public CryptoSchemeMsg () { }", "public Message newMessage(String message, Object p0, Object p1, Object p2) {\n/* 85 */ return new SimpleMessage(message);\n/* */ }", "public MessageInfo() { }", "public LCAmsg2 () { }", "public FlowMonMessage(){}", "protected abstract Message createMessage(Object object, MessageProperties messageProperties);", "public InfoMessage createInfoMessage();", "private ExecuteMessage() {\n initFields();\n }", "public Message newMessage(String type, String addr) {\n\tMessage message = null;\n\n\tif (type.equals(MessageConnection.TEXT_MESSAGE)) {\n\n\t message = new TextObject(addr);\n\t} else {\n\t if (type.equals(MessageConnection.BINARY_MESSAGE)) {\n\n message = new BinaryObject(addr);\n\t } else {\n throw new IllegalArgumentException(\n \"Message type not supported\");\n\t }\n\t}\n\n\n\treturn message;\n }", "@Override\n\t\t\tpublic Message createMessage(Session session) throws JMSException {\n\t\t\t\tMessage m = session.createTextMessage(s);\n\t\t\t\treturn m;\n\t\t\t}", "private static void messageConstructor(){\n msg = \"These are the ammo you can spend.\\n\" +\n \"Every time you select the corresponding color, the quantity will decrease: \\n\";\n\n paymentSB.append(msg);\n if (tmpAmmoInAmmoBox[GeneralInfo.RED_ROOM_ID] > 0) {\n msg = red + \": Red ammo available: \" + tmpAmmoInAmmoBox[GeneralInfo.RED_ROOM_ID] + \"\\n\";\n paymentSB.append(msg);\n responeForAmmo.add(red);\n }\n if (tmpAmmoInAmmoBox[GeneralInfo.BLUE_ROOM_ID] > 0) {\n msg = blue + \": Blue ammo available: \" + tmpAmmoInAmmoBox[GeneralInfo.BLUE_ROOM_ID] + \"\\n\";\n paymentSB.append(msg);\n responeForAmmo.add(blue);\n }\n if (tmpAmmoInAmmoBox[GeneralInfo.YELLOW_ROOM_ID] > 0) {\n msg = yellow + \": Yellow ammo available: \" + tmpAmmoInAmmoBox[GeneralInfo.YELLOW_ROOM_ID] + \"\\n\";\n paymentSB.append(msg);\n responeForAmmo.add(yellow);\n }\n\n for (i = 0; i < tmpAmmoInPowerUp.size(); i++) {\n msg = (i + 1) + \": \" + tmpAmmoInPowerUp.get(i).getName() + \" COLOR: \" + tmpAmmoInPowerUp.get(i).getGainAmmoColor() + \"\\n\";\n paymentSB.append(msg);\n responseForPowerUp.add(Integer.toString(i + 1));\n }\n\n if (!responeForAmmo.isEmpty()) {\n possibleChoice.addAll(responeForAmmo);\n msg = \"Chose a letter R/B/Y \\n\";\n paymentSB.append(msg);\n }\n\n if(!responseForPowerUp.isEmpty()) {\n possibleChoice.addAll(responseForPowerUp);\n msg = \"choose a number from 1 to \" + i + \": \";\n paymentSB.append(msg);\n }\n }", "private Message createJMSMessageForjmsMyQueue(Session session, Object messageData) throws JMSException {\n TextMessage tm = session.createTextMessage();\n tm.setText(messageData.toString());\n return tm;\n }", "public Message() {\n }", "public Message() {\n }", "public Builder clearMsgType() {\n bitField0_ = (bitField0_ & ~0x00000001);\n msgType_ = com.eze.ezecli.ApiInput.MessageType.EXIT;\n onChanged();\n return this;\n }", "public Message(String type, Object message) {\n\t\tthis.type = type;\n\t\tthis.message = message;\n\t}", "private DAPMessage constructFrom(DatabaseTableRecord record) {\n return DAPMessage.fromXML(record.getStringValue(CommunicationNetworkServiceDatabaseConstants.DAP_MESSAGE_DATA_COLUMN_NAME));\n }", "ChildMessage(){\n\t\t\ttext = CLICK_TO_EDIT;\t\t\t\t\t\t\t\t// Set to Header default\n\t\t\tnamesText = CLICK_TO_ADD_NAMES;\t\t\t\t\t\t// Set to Header default\n\t\t\tnumbers = new HashMap<String,Integer>();\t\t\t// init numbers to none\n\t\t}", "public CarReply() {\n super();\n this.nrCars = 0;\n this.carwashID = \"\";\n }", "public ProtocolWorker(String message){\n this.message = message;\n }", "private Message(MessageType handle, String srcName, String text) {\n msgType = handle;\n // Save the properly formatted identifier for the user sending the\n // message.\n msgSender = srcName;\n // Save the text of the message.\n msgText = text;\n }", "public Message() {\n }", "public MessageResponse() {\r\n\t}", "public AbstractMessage() {\n\t\t//this.idMessage = SecUtils.getHex(SecUtils.getRandomBytes(SecUtils.getSeed(), 20));\n\t\tthis.idMessage = this.hashCode();\n\t\tthis.setChallenge(new Challenge());\n\t}", "public Protocol(String data)\r\n {\r\n char cData[] = data.toCharArray();\r\n msgType = cData[1];\r\n numArgs = cData[2] - '0';\r\n \r\n if (numArgs > 0)\r\n {\r\n args = new String[numArgs];\r\n int pos = 3;\r\n for (int i = 0; i < numArgs; ++i)\r\n {\r\n args[i] = \"\";\r\n while (cData[pos] != fieldEnd)\r\n {\r\n args[i] += cData[pos];\r\n ++pos;\r\n }\r\n ++pos;\r\n }\r\n }\r\n else\r\n {\r\n args = null;\r\n }\r\n }", "public Message () {\n\t\tthis.setCreationtime(Calendar.getInstance().getTimeInMillis());\n\t\tsetTimestamp();\n\t}", "public Message createMessage(String messageText)\n {\n Message msg =\n new MessageIcqImpl(messageText,\n OperationSetBasicInstantMessaging.DEFAULT_MIME_TYPE,\n OperationSetBasicInstantMessaging.DEFAULT_MIME_ENCODING, null);\n\n return msg;\n }", "public Alarm_Msg(){ }", "public SIPMessage() {\n this.unrecognizedHeaders = new LinkedList();\n this.headers = new LinkedList();\n nameTable = new Hashtable();\n \ttry {\n \tthis.attachHeader(new ContentLength(0),false);\n \t} catch (Exception ex) {}\n }", "public Message(int senderId, int receiverId, String text, Vect3 position, Vect3 speed, Vect3 targetPos, Vect3 startPos, double batteryLevel,\n\t\t\tPriority priority, ComInteract interaction, double vSpace) {\n\t\tthis.senderId = senderId;\n\t\tthis.receiverId = receiverId;\n\t\tthis.text = text;\n\t\tthis.position = position;\n\t\tthis.speed = speed;\n\t\tthis.targetPos = targetPos;\n\t\tthis.startPos = startPos;\n\t\tthis.batteryLevel = batteryLevel;\n\t\tthis.priority = priority;\n\t\tthis.interaction = interaction;\n\t\tthis.vSpace=vSpace;\n\t}", "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 }", "public void goodbyeMsg();", "public SystemMessage() {\r\n\t}", "public CallMessage() {\n\t}", "public Message() {\n\tkey = MessageKey.NULL;\n\tdata = null;\n\n\tattachment = null;\n }", "private Message createJMSMessageForjmsMessageQueue(Session session, Object messageData) throws JMSException {\n TextMessage tm = session.createTextMessage();\n tm.setText(messageData.toString());\n return tm;\n }", "protected abstract TMessage prepareMessage();", "public Message createMessage()\n {\n return messageFactory.createMessage();\n }", "public String build() {\n this.message_string = \"{\";\n\n if (this.recipient_id != null) {\n this.message_string += \"\\\"recipient\\\": {\\\"id\\\": \\\"\" + this.recipient_id + \"\\\"},\";\n }\n\n if ((this.message_text != null)\n && !(this.message_text.equals(\"\"))\n && !(this.buttons.isEmpty())) {\n this.message_string += \"\\\"message\\\": {\";\n this.message_string += \"\\\"attachment\\\": {\";\n this.message_string += \"\\\"type\\\": \\\"template\\\",\";\n this.message_string += \"\\\"payload\\\": {\";\n this.message_string += \"\\\"template_type\\\": \\\"button\\\",\";\n this.message_string += \"\\\"text\\\": \\\"\" + this.message_text + \"\\\",\";\n this.message_string += \"\\\"buttons\\\":[\";\n for (int j = 0; j < this.buttons.size(); j++) {\n HashMap<String, String> button = this.buttons.get(j);\n this.message_string += \"{\";\n if (!button.get(\"type\").equals(\"\")) {\n this.message_string += \"\\\"type\\\":\\\"\" + button.get(\"type\") + \"\\\",\";\n }\n if (!button.get(\"title\").equals(\"\")) {\n this.message_string += \"\\\"title\\\":\\\"\" + button.get(\"title\") + \"\\\",\";\n }\n if (!button.get(\"url\").equals(\"\")) {\n this.message_string += \"\\\"url\\\":\\\"\" + button.get(\"url\") + \"\\\",\";\n }\n if (!button.get(\"payload\").equals(\"\")) {\n this.message_string += \"\\\"payload\\\":\\\"\" + button.get(\"payload\") + \"\\\",\";\n }\n if (!button.get(\"webview_height_ratio\").equals(\"\")) {\n this.message_string +=\n \"\\\"webview_height_ratio\\\":\\\"\"\n + button.get(\"webview_height_ratio\")\n + \"\\\",\";\n }\n this.message_string = this.message_string.replaceAll(\",$\", \"\");\n this.message_string += \"},\";\n }\n this.message_string = this.message_string.replaceAll(\",$\", \"\");\n this.message_string += \"]\";\n this.message_string += \"}\";\n this.message_string += \"}\";\n this.message_string += \"}\";\n }\n\n this.message_string = this.message_string.replaceAll(\",$\", \"\");\n\n this.message_string += \"}\";\n\n return this.message_string;\n }", "private void constructACLMessage()\n {\n PlayIntroAction playIntroObject = new PlayIntroAction();\n playIntroObject.setLenght(numberOfMeasures);\n playIntroObject.setNow(true);\n playIntroObject.setDuration(-1);\n msg = new ACLMessage(ACLMessage.CFP);\n msg.setLanguage(codec.getName());\n msg.setOntology(ontology.getName());\n for(int i = 0; i < receivers.size(); i++)\n {\n try\n {\n //fill the content using the Ontology concept\n myAgent.getContentManager().fillContent(msg,new Action((AID)receivers.elementAt(i),playIntroObject));\n }catch (Exception ex) { ex.printStackTrace(); }\n //Set the receiver of the message\n msg.addReceiver((AID)receivers.elementAt(i));\n\n }\n\n //Set the protocol that we gonna use\n msg.setProtocol(FIPANames.InteractionProtocol.FIPA_CONTRACT_NET);\n //We indicate the deadline of the reply\n msg.setReplyByDate(new Date(System.currentTimeMillis() + 30000));\n\n\n }", "private final TextMessage m43295c(ApiMessage apiMessage) {\n String id = apiMessage.getId();\n if (id == null) {\n throw new IllegalStateException(\"Required value was null.\".toString());\n }\n String matchId = apiMessage.getMatchId();\n if (matchId == null) {\n throw new IllegalStateException(\"Required value was null.\".toString());\n }\n String to = apiMessage.getTo();\n if (to == null) {\n throw new IllegalStateException(\"Required value was null.\".toString());\n }\n String from = apiMessage.getFrom();\n if (from == null) {\n throw new IllegalStateException(\"Required value was null.\".toString());\n }\n String message = apiMessage.getMessage();\n if (message != null) {\n return new TextMessage(null, id, matchId, to, from, message, m43292a(apiMessage.getSentDate()), false, false, DeliveryStatus.SUCCESS, 1, null);\n }\n throw new IllegalStateException(\"Required value was null.\".toString());\n }", "public static Message parse(String messageData)\n {\n // Split by new line\n String[] messageParts = messageData.split(\"\\n\");\n\n // Assume first line is the action\n int action = Integer.parseInt(messageParts[0]);\n\n // And second line is the client\n int clientID = Integer.parseInt(messageParts[1]);\n\n // Set default for recipient\n int recipient = -1;\n\n // If the 3rd line is not a new line\n if(messageParts[2] != \"\\n\") {\n // We assume it's the recipient ID\n recipient = Integer.parseInt(messageParts[2]);\n }\n\n // The last part is always the message body\n String body = messageParts[messageParts.length - 1];\n return new Message(action, clientID, recipient, body);\n }", "private void decode_message(String receivedMessage) {\n String[] messageComponents = receivedMessage.split(\"##\");\n String actionName = messageComponents[0];\n int actionType = caseMaps.get(actionName);\n\n switch (actionType) {\n case 1:\n String nodeToConnect = messageComponents[1];\n break;\n case 2:\n String receivedPrevNode = messageComponents[1].split(\"&&\")[0];\n String receivedNextNode = messageComponents[1].split(\"&&\")[1];\n break;\n case 3:\n String key = messageComponents[1].split(\"&&\")[0];\n String value = messageComponents[1].split(\"&&\")[1];\n insertIntoDB(key,value);\n break;\n case 4:\n String portRequested = messageComponents[1].split(\"&&\")[0];\n String AllMessages = messageComponents[1].split(\"&&\")[1];\n break;\n case 5:\n String portRequestedSelect = messageComponents[1].split(\"&&\")[0];\n String selection = messageComponents[1].split(\"&&\")[1];\n break;\n case 6:\n String selectionDelete = messageComponents[1];\n DeleteKeys(selectionDelete);\n break;\n default:\n }\n\n }", "public ChatMessage(Cursor cursor) {\n // TODO\n this.id = Long.parseLong(MessageContract.getId(cursor));\n this.sender = MessageContract.getSender(cursor);\n this.messageText = MessageContract.getMessageText(cursor);\n this.timestamp = MessageContract.getTimestamp(cursor);\n this.longitude = MessageContract.getLongitude(cursor);\n this.latitude = MessageContract.getLatitude(cursor);\n }", "com.google.protobuf.ByteString getInitMsg();", "private CancelMessage() {\n initFields();\n }", "public ImMessage() {\r\n }", "public EndTurnResponse(String username, String message){\n //single player end game\n super(username, MessageType.ENDTURNUPDATE);\n this.message = message;\n this.gameOver=true;\n this.isSinglePlayer = true;\n }", "private void constructHeartbeatMessage() {\n // build head\n MessageProtobuf.Head.Builder headBuilder = MessageProtobuf.Head.newBuilder();\n headBuilder.setMsgId(UUID.randomUUID().toString());\n headBuilder.setMsgType(MsgConstant.MsgType.HEARTBEAT_MESSAGE);\n headBuilder.setTimeStamp(System.currentTimeMillis());\n\n // build message\n MessageProtobuf.Msg.Builder builder = MessageProtobuf.Msg.newBuilder();\n builder.setHead(headBuilder.build());\n\n defaultHeartbeatMessage = builder.build();\n }", "@Test\n public void replyAfterQuitTest(TestContext testContext) {\n this.testContext=testContext;\n smtpServer.setDialogue(\"220 example.com ESMTP\",\n \"EHLO\",\n \"250-example.com\\n\" +\n \"250 SIZE 48000000\",\n \"MAIL FROM\",\n \"250 2.1.0 Ok\",\n \"RCPT TO\",\n \"250 2.1.5 Ok\",\n \"DATA\",\n \"354 End data with <CR><LF>.<CR><LF>\",\n // message data\n \"250 2.0.0 Ok: queued as ABCDDEF0123456789\",\n \"QUIT\",\n \"221 2.0.0 Bye\",\n \"\",\n // this should not happen:\n \"this is unexpected\"\n );\n smtpServer.setCloseImmediately(false);\n\n testSuccess();\n }", "public Message(int receiverId, String text, Vect3 startPos, Priority priority, ComInteract interaction) {\n\t\tthis.receiverId = receiverId;\n\t\tthis.startPos = startPos;\n\t\tthis.priority = priority;\n\t\tthis.interaction = interaction;\n\t}", "public static void main(String[] args) throws SQLException, IOException {\n EzClass ChatMessage = new EzClass(Ref.getNmsOrOld(\"network.chat.ChatMessage\", \"ChatMessage\"));\n ChatMessage.setConstructor(String.class);\n ChatMessage.newInstance(\"Testing\");\n Object chatMessageEz = ChatMessage.getInstance();\n\n //Java Original Reflection examples\n Class<?> clazz = Ref.getNmsOrOld(\"network.chat.ChatMessage\", \"ChatMessage\");\n if (clazz != null) {\n try {\n Constructor<?> constructor = clazz.getDeclaredConstructor(String.class);\n constructor.setAccessible(true);\n Object chatMessage = constructor.newInstance(\"Testing\");\n } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {\n e.printStackTrace();\n }\n }\n }", "public XMXEDITClosedResponse(final String msg,\n final String rawResponse) {\n\n this();\n this.setRawResponse(rawResponse);\n this.message = msg;\n this.special = null;\n }", "public MessageRecord() {\n super(Message.MESSAGE);\n }", "private SocketMessage() {\n initFields();\n }", "public Message createMessage(byte nextByte) {\n if(nextByte!=delimeter) {\n addBytes(nextByte);\n return null;\n }\n else{\n content=popString();\n String[] spilt=content.split(\" \");\n int i=0;\n for(;i<spilt.length;i++){\n if(spilt[i].contains(\"@\"))\n this.listUserS.add(spilt[i].substring(1));\n }\n return this;\n }\n }", "public Message(String text, Person person) {\n\t\tthis(text, person, null, null);\n\t}", "Message newMessage(Uuid id, Uuid author, Uuid conversation, String body, Time creationTime);", "public void endMessage()\n\t{\n\t}", "public Message createMessage(MessageType type, String message) throws MessageFormatException {\n String salesMessage[] = message.split(\" \");\n switch (type) {\n case SINGLE:\n if (salesMessage.length == 2) {\n return new SingleSaleMessage(salesMessage);\n }\n throw new MessageFormatException(\"Message type \\\"single\\\" should contain the product type and price.\" +\n \"e.g. \\\"single apple 10p\\\"\");\n case MULTIPLE:\n if (salesMessage.length == 3) {\n return new MultipleSaleMessage(salesMessage);\n }\n throw new MessageFormatException(\"Message type \\\"multiple\\\" should contain the quantity, product type and price.\" +\n \"e.g. \\\"multiple 10 apple 10p\\\"\");\n case ADJUSTMENT:\n if (salesMessage.length == 3) {\n return new PriceAdjustmentMessage(salesMessage);\n }\n throw new MessageFormatException(\"Message type \\\"adjustment\\\" should contain the adjustment operation,\" +\n \" adjustment price and product type. e.g. \\\"adjustment add 10p apple\\\"\");\n default:\n throw new MessageFormatException(\"Message type %s not supported.\" +\n \"Supported message types are %s\", type.toString(), Arrays.toString(MessageType.values()));\n }\n }", "public MessageAbstract createMessageAbstract() {\n\t\tMessageAbstract messageAbstract = new MessageAbstract();\n\t\tmessageAbstract.setId(this.id);\n\t\tmessageAbstract.setMessage(this.message);\n\t\tmessageAbstract.setSentTimestamp(this.sentTimestamp);\n\n\t\t// Add sender's user ID if available\n\t\tif (this.origin != null) {\n\t\t\tmessageAbstract.setSenderUserId(this.origin.getId());\n\t\t\tmessageAbstract.setSenderScreenName(this.origin.getScreenName());\n\t\t}\n\t\treturn messageAbstract;\n\t}", "public void testParsing2() throws Exception {\n String data = \"8=FIX.4.2\\0019=76\\001\";\n data += \"35=6\\001\";\n data += \"23=IDENTIFIER\\001\";\n data += \"28=N\\001\";\n data += \"55=MSFT\\001\";\n data += \"54=1\\001\";\n data += \"711=2\\001\";\n data += \"311=DELL\\001\";\n data += \"318=USD\\001\";\n data += \"311=IBM\\001\";\n data += \"318=CAD\\001\";\n data += \"10=037\\001\";\n Message message = new Message(data, DataDictionaryTest.getDictionary());\n \n assertHeaderField(message, \"FIX.4.2\", BeginString.FIELD);\n assertHeaderField(message, \"76\", BodyLength.FIELD);\n assertHeaderField(message, MsgType.INDICATION_OF_INTEREST, MsgType.FIELD);\n assertBodyField(message, \"IDENTIFIER\", IOIid.FIELD);\n assertTrailerField(message, \"037\", CheckSum.FIELD);\n IndicationOfInterest.NoUnderlyings valueMessageType = new IndicationOfInterest.NoUnderlyings();\n message.getGroup(1, valueMessageType);\n assertEquals(\"wrong value\", \"DELL\", valueMessageType.getString(UnderlyingSymbol.FIELD));\n assertEquals(\"wrong value\", \"USD\", valueMessageType.getString(UnderlyingCurrency.FIELD));\n message.getGroup(2, valueMessageType);\n assertEquals(\"wrong value\", \"IBM\", valueMessageType.getString(UnderlyingSymbol.FIELD));\n assertEquals(\"wrong value\", \"CAD\", valueMessageType.getString(UnderlyingCurrency.FIELD));\n }", "public MassMsgFrame() {\n\t}", "@Test\r\n\tpublic void testC() {\r\n\t\t\r\n\t\tObjectHandshake h = new ObjectHandshake();\r\n\t\th.setUuid( UuidTool.getOne() );\r\n\t\t\r\n\t\tRunProtocol run = null;\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_A, 100, 200, true, true);\r\n\t\tassertTrue(run.beginA());\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_B, 100, 200, true, true);\r\n\t\tassertTrue(run.commitA());\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_B, 100, 200, true, true);\r\n\t\tassertTrue(run.beginB());\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_A, 100, 200, true, true);\r\n\t\tassertTrue(run.commitB());\r\n\t\t\r\n\t\tassertEquals(h.getLog(), \"1-1-100-2-1-101-2-2-200-1-2-201-\");\r\n\t}", "public Message(){\n this(\"Not Specified\",\"Not Specified\");\n }", "public OesMessageRecord() {\n super(OesMessage.OES_MESSAGE);\n }", "public ParcelableMessage(String name, String text) {\n\t\tsuper(name, text);\n\t}", "public void testParsing() throws Exception {\n Message message = new Message(\"8=FIX.4.2\\0019=40\\00135=A\\001\"\n + \"98=0\\001384=2\\001372=D\\001385=R\\001372=8\\001385=S\\00110=96\\001\",\n DataDictionaryTest.getDictionary());\n \n assertHeaderField(message, \"FIX.4.2\", BeginString.FIELD);\n assertHeaderField(message, \"40\", BodyLength.FIELD);\n assertEquals(\"wrong field value\", 40, message.getHeader().getInt(BodyLength.FIELD));\n assertHeaderField(message, \"A\", MsgType.FIELD);\n assertBodyField(message, \"0\", EncryptMethod.FIELD);\n assertTrailerField(message, \"96\", CheckSum.FIELD);\n NoMsgTypes valueMessageType = new Logon.NoMsgTypes();\n message.getGroup(1, valueMessageType);\n assertEquals(\"wrong value\", \"D\", valueMessageType.getString(RefMsgType.FIELD));\n assertEquals(\"wrong value\", \"R\", valueMessageType.getString(MsgDirection.FIELD));\n message.getGroup(2, valueMessageType);\n assertEquals(\"wrong value\", \"8\", valueMessageType.getString(RefMsgType.FIELD));\n assertEquals(\"wrong value\", \"S\", valueMessageType.getString(MsgDirection.FIELD));\n }", "public OctopusCollectedMsg() {\n super(DEFAULT_MESSAGE_SIZE);\n amTypeSet(AM_TYPE);\n }", "public Message(String t,int db_id){\n\t\tLog.d(TAG,\"new Message Constructor\");\n\t \tstartTime\t= Calendar.getInstance();\n\t \tendTime \t= Calendar.getInstance(); \n\t \theader = new ChildMessage();\n\t\ttext \t\t\t\t= new String(t);\t\t\t\t\t\t\t\t\t\t\t// Set text\n\t\tcMessages\t\t\t= new ArrayList<ChildMessage>();\n\t\tDB_ID = db_id;\n\t}" ]
[ "0.5936507", "0.5502597", "0.5460886", "0.5451124", "0.5386861", "0.53864026", "0.53515947", "0.5336677", "0.5334646", "0.5303378", "0.5299506", "0.52731264", "0.5263113", "0.52621365", "0.52476496", "0.522641", "0.51982105", "0.5185589", "0.5183363", "0.51780385", "0.5176184", "0.5174709", "0.51713574", "0.51651824", "0.5138412", "0.5132869", "0.5129748", "0.5129748", "0.51259834", "0.5118651", "0.50919694", "0.5088759", "0.5069455", "0.5016778", "0.49634284", "0.496299", "0.4931408", "0.4903572", "0.4901858", "0.4896776", "0.48943165", "0.48912147", "0.48790857", "0.48790857", "0.4875525", "0.4866204", "0.48635772", "0.4836292", "0.4832417", "0.48039925", "0.48000902", "0.4792308", "0.4785708", "0.47845942", "0.4777958", "0.47681507", "0.47654027", "0.4755841", "0.47501493", "0.47467518", "0.47463852", "0.4742468", "0.47398674", "0.4730496", "0.47217968", "0.4718702", "0.4717204", "0.4714769", "0.4699532", "0.469603", "0.46812072", "0.46800807", "0.46766305", "0.467604", "0.46706545", "0.46665406", "0.46625063", "0.465838", "0.46547866", "0.46512076", "0.4647696", "0.4642127", "0.463702", "0.46367103", "0.46348885", "0.4621463", "0.4617224", "0.46156698", "0.461523", "0.46134394", "0.4609976", "0.46058932", "0.46016812", "0.45968506", "0.45938313", "0.4587212", "0.45851418", "0.4581691", "0.45770517", "0.45761767" ]
0.5869352
1
Ein gesch?tzter Konstruktor der weitere Instanzierungen von BusinessObjectMapper Objekten verhindert.
protected BusinessObjectMapper() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static BusinessObjectMapper businessObjectMapper() {\n if(businessObjectMapper == null) {\n \tbusinessObjectMapper = new BusinessObjectMapper();\n }\n return businessObjectMapper;\n }", "public ObjectMapper() {\n this.typeConverter = null;\n }", "public JacksonAdapter() {\n simpleMapper = initializeObjectMapper(new ObjectMapper());\n //\n xmlMapper = initializeObjectMapper(new XmlMapper());\n xmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true);\n xmlMapper.setDefaultUseWrapper(false);\n //\n ObjectMapper flatteningMapper = initializeObjectMapper(new ObjectMapper())\n .registerModule(FlatteningSerializer.getModule(simpleMapper()))\n .registerModule(FlatteningDeserializer.getModule(simpleMapper()));\n jsonMapper = initializeObjectMapper(new ObjectMapper())\n // Order matters: must register in reverse order of hierarchy\n .registerModule(AdditionalPropertiesSerializer.getModule(flatteningMapper))\n .registerModule(AdditionalPropertiesDeserializer.getModule(flatteningMapper))\n .registerModule(FlatteningSerializer.getModule(simpleMapper()))\n .registerModule(FlatteningDeserializer.getModule(simpleMapper())); }", "public ObjectMapper getObjectMapper()\n/* */ {\n/* 123 */ return this.objectMapper;\n/* */ }", "public JsonSchemaMappingLookup() {\n // initialize all mappings from URLs to the respective schema\n businessObjectToJsonSchema.put(\"/rules\", DCC_VALIDATION_RULE_JSON_CLASSPATH);\n businessObjectToJsonSchema.put(\"/bnrules\", DCC_VALIDATION_RULE_JSON_CLASSPATH);\n businessObjectToJsonSchema.put(\"/cclrules\", CCL_JSON_SCHEMA);\n }", "@Bean\n public ObjectMapper objectMapper() {\n return new ObjectMapper();\n }", "@Bean\n\tpublic ObjectMapper objectMapper() {\n\t\treturn new ObjectMapper()\n\t\t\t\t.registerModules(new ProblemModule(), new ConstraintViolationProblemModule());\n\t}", "public CustomObjectMapper(){\n this.setDateFormat(new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\"));\n }", "protected AusschreibungMapper() {\r\n\t}", "@Bean\n\tpublic ObjectMapper mapper() {\n\t\treturn new ObjectMapper();\n\t}", "@Bean\n ObjectMapper objectMapper() {\n ObjectMapper objectMapper = new ObjectMapper();\n objectMapper.setSerializationInclusion(Include.NON_DEFAULT);\n return objectMapper;\n }", "protected void registerObjectMapper() {\n\n ObjectMapper mapper = JacksonMapperRegistry.get();\n\n // create JsonProvider to provide custom ObjectMapper\n JacksonJaxbJsonProvider provider = new JacksonJaxbJsonProvider(mapper, JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS);\n //provider.setMapper(mapper);\n\n register(provider);\n }", "private static ObjectMapper createObjectMapper() {\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tmapper.configure(SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS, false);\n\t\tmapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);\n\t\tmapper.registerModule(new JavaTimeModule());\n\t\treturn mapper;\n\t}", "private static <T extends ObjectMapper> T initializeObjectMapper(T mapper) {\n mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)\n .configure(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS, true)\n .configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)\n .configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true)\n .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)\n .configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true)\n .setSerializationInclusion(JsonInclude.Include.NON_NULL)\n // .registerModule(new JavaTimeModule()) -> TODO: anuchan Java 8 time (This the jackson module for java 8 Time)\n .registerModule(ByteArraySerializer.getModule())\n .registerModule(Base64UrlSerializer.getModule())\n .registerModule(DateTimeSerializer.getModule())\n .registerModule(DateTimeRfc1123Serializer.getModule())\n // .registerModule(DurationSerializer.getModule()) -> TODO: anuchan java 8 time (Custom module to convert java 8 Duration to String for serialization)\n .registerModule(HttpHeadersSerializer.getModule());\n mapper.setVisibility(mapper.getSerializationConfig().getDefaultVisibilityChecker()\n .withFieldVisibility(JsonAutoDetect.Visibility.ANY)\n .withSetterVisibility(JsonAutoDetect.Visibility.NONE)\n .withGetterVisibility(JsonAutoDetect.Visibility.NONE)\n .withIsGetterVisibility(JsonAutoDetect.Visibility.NONE));\n return mapper;\n }", "@Bean\n public ObjectMapper mapper() {\n return new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)\n .setDateFormat(dateFormat());\n }", "public Pojo1110110(){\r\n\t}", "@Bean\n @Primary\n public ObjectMapper objectMapper() {\n final ObjectMapper objectMapper = new ObjectMapper();\n objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);\n objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);\n objectMapper.addMixIn(IdentifiableDocument.class, MixIn.class);\n return objectMapper;\n }", "public OBOMapper() {\n this(true);\n }", "public String getBusinessObjectType() {\r\n return businessObjectType;\r\n }", "public LegProfile ()\n {\n\t// For Jackson ObjectMapper's sanity!\n }", "public static ObjectMapper getObjectMapper() {\n return defaultMapper;\n }", "public ObjectMappers() {\n\t\tthis.objectMappers = ImmutableList.of();\n\t}", "@Override\n public void initialize(Bootstrap<?> bootstrap) {\n bootstrap.setObjectMapper(io.dropwizard.jackson.Jackson.newMinimalObjectMapper());\n // avoids warning regarding com.fasterxml.jackson.databind.util.ClassUtil\n bootstrap.getObjectMapper().registerModule(new Jdk8Module());\n\n Jackson.initObjectMapper(bootstrap.getObjectMapper());\n bootstrap.getObjectMapper().setDateFormat(new StdDateFormat());\n // See https://github.com/dropwizard/dropwizard/issues/1558\n bootstrap.getObjectMapper().enable(MapperFeature.ALLOW_EXPLICIT_PROPERTY_RENAMING);\n }", "@BeanMapping( ignoreByDefault = true )\n @Mapping( target = \"key\", ignore = true)\n @Mapping( target = \"modificationDate\", ignore = true)\n @Mapping( target = \"creationDate\", ignore = true)\n BaseEntity mapBase(Object o);", "public ObjetosBeans() {\n this.init();\n }", "@Bean\n public Jackson2ObjectMapperBuilder objectMapperBuilder() {\n return new Jackson2ObjectMapperBuilder()\n .serializationInclusion(JsonInclude.Include.NON_NULL);\n }", "@Override\r\n\tpublic Class getObjectType() {\n\t\treturn mapperInterface;\r\n\t}", "@Bean\n @Primary\n public ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) {\n logger.debug(\"Register Jackson Mappers...\");\n ObjectMapper objectMapper = builder.build();\n objectMapper.registerModule(new JavaTimeModule());\n objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);\n return objectMapper;\n }", "@Override\n protected Map<String, Object> getBeansMap()\n {\n return TestUtility.getCountyData();\n }", "private JSONHelper() {\r\n\t\tsuper();\r\n\t}", "public AdditionalModelsConverter(ObjectMapperProvider springDocObjectMapper) {\n\t\tthis.springDocObjectMapper = springDocObjectMapper;\n\t}", "MTBTypesDTO() {\n // EMPTY CONSTRUCTOR\n }", "@Autowired\n public void objectMapper(ObjectMapper objectMapper) {\n objectMapper.addMixIn(ProductOption.class, ProductOptionMixIn.class);\n }", "private DTOFactory() {\r\n \t}", "protected StreamsJacksonMapper() {\n super();\n registerModule(new StreamsJacksonModule(configuration.getDateFormats()));\n if ( configuration.getEnableScala()) {\n registerModule(new DefaultScalaModule());\n }\n configure();\n }", "@Override\n protected JsonUtil getJsonUtil() {\n return super.getJsonUtil();\n }", "protected void initBoatMap() {}", "public JsonFactory setCodec(ObjectCodec oc)\n/* */ {\n/* 721 */ this._objectCodec = oc;\n/* 722 */ return this;\n/* */ }", "public ObjectMappers(ObjectMapper objectMapper) {\n\t\tthis(new ObjectMapper[] { objectMapper });\n\t}", "private OwBootstrapToIdMapping()\r\n {\r\n\r\n }", "@Override\n public BusinessObjectService getBusinessObjectService() {\n return businessObjectService;\n }", "public PersonaDTO(){}", "public PaymentDetailPojo() {\n }", "CategoryJsonWriterImpl() {\r\n\t\tsuper();\r\n\t}", "public JSONUtils() {\n\t\tsuper();\n\t}", "protected BusinessObject getNewBusinessObjInstance()\n {\n return BUSINESS_OBJ ;\n }", "public MapOther() {\n }", "private Book mapBookDTOToBook(BookDTO bookDTO) {\n\t\tModelMapper mapper = new ModelMapper();\n\t\tBook book = mapper.map(bookDTO, Book.class);\n\t\tbook.setCategory(new Category(bookDTO.getCategory().getCode(), \"\"));\n\t\tbook.setRegisterDate(LocalDate.now());\n\t\treturn book;\n\t}", "public Dto() {\n \t\n }", "protected MXBeanMappingFactory() {}", "public PersonaBean() {\n domicilio = new Domicilio();\n telefono = new Telefono();\n correoElectronico = new CorreoElectronico();\n persona = new Persona();\n this.tipoOperacion = \"Alta\";\n\n }", "public ObjectMapper getMapper() {\n return mapper;\n }", "public static ObjectMapper getMapper() {\n return MAPPER;\n }", "public void setObjectMapper(ObjectMapper objectMapper)\n/* */ {\n/* 114 */ Assert.notNull(objectMapper, \"ObjectMapper must not be null\");\n/* 115 */ this.objectMapper = objectMapper;\n/* 116 */ configurePrettyPrint();\n/* */ }", "@Mapper(componentModel = \"spring\", uses = {Business.class})\npublic interface BusinessMapper {\n\n BusinessDTO toDTO(Business business);\n\n @Mapping(target = \"advertisements\", ignore = true)\n Business toEntity(BusinessDTO businessDTO);\n}", "public JsonUtil() {\r\n this.jsonSerializer = new JSONSerializer().transform(new ExcludeTransformer(), void.class).exclude(\"*.class\");\r\n }", "private JsonUtils() {\n\t\tsuper();\n\t}", "public MapsAccountProperties() {\n }", "@Override\n\tprotected Mapping getMapping() {\n\t\treturn new Mapping()\n\t\t\t.add(\"firstname\", driver.getFirstName())\n\t\t\t.add(\"lastname\", driver.getLastName())\n\t\t\t.add(\"dateofbirth\", driver.getDateOfBirth())\n\t\t\t.add(\"gender\", driver.getGender())\n\t\t\t.add(\"age\", computeAge())\n\t\t\t.add(\"numberOfAccidents\", driver.getNumberOfAccidents())\n\t\t\t.add(\"numberOfTickets\", driver.getNumberOfTickets());\n\t}", "public RenderKitBean()\r\n {\r\n _renderers = new TreeMap();\r\n }", "JSONConverter getDefaultConverter();", "public void init() throws IllegalArgumentException {\r\n\t\tthis.listItemMapper = ListItemMapper.listitemMapper();\r\n\t\tthis.itemMapper = ItemMapper.itemMapper();\r\n\t\tthis.personMapper = PersonMapper.personMapper();\r\n\t\tthis.shoppingListMapper = ShoppingListMapper.shoppinglistMapper();\r\n\t\tthis.storeMapper = StoreMapper.storeMapper();\r\n\t\tthis.groupMapper = GroupMapper.groupMapper();\r\n\t\tthis.responsibilityMapper = ResponsibilityMapper.responsibilityMapper();\r\n\t\tthis.favoriteItemMapper = FavoriteItemMapper.favoriteItemMapper();\r\n\r\n\t}", "protected AbstractMessageSubscriber(ObjectMapper objectMapper) {\n this.objectMapper = objectMapper;\n }", "public abstract Object toJson();", "@Bean\n public Jackson2ObjectMapperBuilderCustomizer customizeJson() {\n return builder -> {\n builder.serializerByType(EasyComposition.class, compositionSerializer);\n builder.serializerByType(EasyMeasure.class, measureSerializer);\n builder.serializerByType(EasyStaff.class, staffSerializer);\n builder.serializerByType(EasyVoice.class, voiceSerializer);\n builder.serializerByType(Environment.class, environmentSerializer);\n builder.serializerByType(Device.class, deviceSerializer);\n builder.serializerByType(Json.class, jsonSerializer);\n builder.serializerByType(Rational.class, rationalSerializer);\n builder.deserializerByType(Rational.class, rationalDeserializer);\n };\n }", "private SerializerFactory() {\r\n registerAvailableSerializers();\r\n }", "public interface ospector\n{\n\n public abstract void addAbstractTypeResolver(AbstractTypeResolver abstracttyperesolver);\n\n public abstract void addBeanDeserializerModifier(BeanDeserializerModifier beandeserializermodifier);\n\n public abstract void addBeanSerializerModifier(BeanSerializerModifier beanserializermodifier);\n\n public abstract void addDeserializationProblemHandler(DeserializationProblemHandler deserializationproblemhandler);\n\n public abstract void addDeserializers(Deserializers deserializers);\n\n public abstract void addKeyDeserializers(KeyDeserializers keydeserializers);\n\n public abstract void addKeySerializers(Serializers serializers);\n\n public abstract void addSerializers(Serializers serializers);\n\n public abstract void addTypeModifier(TypeModifier typemodifier);\n\n public abstract void addValueInstantiators(ValueInstantiators valueinstantiators);\n\n public abstract void appendAnnotationIntrospector(AnnotationIntrospector annotationintrospector);\n\n public abstract w getMapperVersion();\n\n public abstract s getOwner();\n\n public abstract TypeFactory getTypeFactory();\n\n public abstract void insertAnnotationIntrospector(AnnotationIntrospector annotationintrospector);\n\n public abstract boolean isEnabled(f f);\n\n public abstract boolean isEnabled(i i);\n\n public abstract boolean isEnabled(n n);\n\n public abstract boolean isEnabled(DeserializationFeature deserializationfeature);\n\n public abstract boolean isEnabled(MapperFeature mapperfeature);\n\n public abstract boolean isEnabled(SerializationFeature serializationfeature);\n\n public transient abstract void registerSubtypes(NamedType anamedtype[]);\n\n public transient abstract void registerSubtypes(Class aclass[]);\n\n public abstract void setClassIntrospector(ClassIntrospector classintrospector);\n\n public abstract void setMixInAnnotations(Class class1, Class class2);\n}", "public SellerDTO() {\n\t\t\n\t}", "public static BokMapper getInstance(){\r\n\t\treturn BokMapper;\r\n\t}", "@Mapper(withIoC = IoC.SPRING, withIgnoreMissing = IgnoreMissing.ALL)\npublic interface RemainMapper extends SelmaObjectMapper<RemainTadbir, Remain> {\n}", "BusinessEntityFactory getBusinessEntityFactory();", "@SuppressWarnings(\"unchecked\")\n\tpublic UserSerializer() {\n\t\tsuper();\n\t\tmapSerializer.putAll(BeanRetriever.getBean(\"mapSerializerStrategy\", Map.class));\n\t}", "@Mapper(componentModel = \"spring\")\npublic interface DataDictItemMapping {\n DataDictItemVo asDataDictItemVo(DataDictItem entity);\n\n DataDictItemOrdinaryVo asOrdinary(DataDictItem entity);\n\n @Mapping(target = \"priority\", ignore = true)\n @Mapping(target = \"lastUpdater\", ignore = true)\n @Mapping(target = \"lastUpdatedAt\", ignore = true)\n @Mapping(target = \"id\", ignore = true)\n @Mapping(target = \"dictId\", ignore = true)\n @Mapping(target = \"creator\", ignore = true)\n @Mapping(target = \"createdAt\", ignore = true)\n DataDictItem asDataDictItem(DataDictItemInsertRo ro);\n\n DataDictItemComplexVo asComplex(DataDictItem entity);\n\n DataDictItem asDataDictItem(DataDictItemUpdateRo ro);\n}", "@Test\n\tpublic void testJacksonCreateSaveAndLoad() throws Exception {\n\t\tFile filename = File.createTempFile(\"TestZWaveCommandClass\", \".json\");\n\t\tfilename.deleteOnExit();\n\n\t\t// Create a set command in json format.\n\t\tZWaveCommandClass \tswitchCommandClass \t= new ZWaveCommandClass(\"Switch Binary\",(byte) 0x25);\n\t\tZWaveCommand\t\tsetCommand\t\t\t= new ZWaveCommand(\"set\",(byte) 0x01);\n\t\tsetCommand.addSendVariable(\"value\");\n\t\tZWaveCommand\t\tgetCommand\t\t\t= new ZWaveCommand(\"get\",(byte) 0x02);\n\t\tZWaveCommand\t\treportCommand\t\t= new ZWaveCommand(\"report\",(byte) 0x03);\n\t\treportCommand.addReceiveVariable(\"value\");\n\t\tswitchCommandClass.add(setCommand);\n\t\tswitchCommandClass.add(getCommand);\n\t\tswitchCommandClass.add(reportCommand);\n\n\t\t// Write out the command class\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tmapper.writerWithDefaultPrettyPrinter().writeValue(new FileWriter(filename), switchCommandClass);\n\n\t\t// Read that set command in json format.\n\t\tObjectMapper mapper2 = new ObjectMapper();\n\t\t@SuppressWarnings(\"unused\")\n\t\tZWaveCommandClass setCommand2 = mapper2.readValue(FileUtils.readFileToByteArray(filename), ZWaveCommandClass.class );\n\t}", "public BeansCompany() {\n\t\tsuper();\n\t}", "private String converttoJson(Object medicine) throws JsonProcessingException {\r\n ObjectMapper objectMapper = new ObjectMapper();\r\n return objectMapper.writeValueAsString(medicine);\r\n }", "@Override\n protected void configureFactoryBuilder(final DefaultMapperFactory.Builder factoryBuilder) {\n factoryBuilder.mapNulls(false).build();\n }", "public AbstractTypeMapping()\n {\n super();\n }", "@Bean\n public MapperFactory mapperFactory() {\n\n //1. Build the mapperFactory\n DefaultMapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();\n\n //2. Register all the configurable mappers\n mapperConfiguration.registerConfigurableMappers(mapperFactory);\n\n //3. Register all converters\n converterConfiguration.registerCustomConverters(mapperFactory);\n\n return mapperFactory;\n }", "public interface MapObjectType {\n}", "public StructureTownHallConfigDao() {\n\t\tsuper(StructureTownHallConfig.STRUCTURE_TOWN_HALL_CONFIG, StructureTownHallConfigPojo.class);\n\t}", "public MapperBase() {\r\n }", "public interface PaymentOrderMapper extends Mapper<PaymentOrder>{\n\n}", "public ProductTaxCodesDTO()\n\t{\n\t\tsuper();\n\t}", "private void initializeMongoConverter() {\n mongoTemplate = new MongoTemplate(new SimpleMongoDbFactory(new MongoClient(), databaseName));\n JaxbAnnotationModule jaxbAnnotationModule = new JaxbAnnotationModule();\n ObjectMapper objectMapper = new ObjectMapper();\n objectMapper.registerModule(jaxbAnnotationModule);\n }", "public ClaseJson() {\n }", "public void setBusinessObjectType(String businessObjectType) {\r\n this.businessObjectType = businessObjectType;\r\n }", "public MappableBuilder( final MappableBuilderFactory factory )\r\n {\r\n this.toStringNullValue = factory.getStringNullValue();\r\n this.messageFormatIteratorEntry = new MessageFormat(factory.getMessageFormatIteratorEntry());\r\n this.messageFormatIterableEntry = new MessageFormat(factory.getMessageFormatIterableEntry());\r\n this.messageFormatEnumerationEntry = new MessageFormat(factory.getMessageFormatEnumerationEntry());\r\n this.messageFormatArrayEntry = new MessageFormat(factory.getMessageFormatArrayEntry());\r\n this.messageFormatMethodName = new MessageFormat(factory.getMessageFormatMethodName());\r\n this.methodesNamePattern = factory.getMethodesNamePattern();\r\n this.returnTypeClasses = factory.getClasses();\r\n this.mappableItemSet = factory.getMappableItemSet();\r\n }", "@Override\r\n\tpublic JSONConvertor<?> getJSONConveter() throws OneM2MException {\n\t\treturn ConvertorFactory.getJSONConvertor(TimeSeries.class, TimeSeries.SCHEMA_LOCATION);\r\n\t}", "public BaseDto() {\n }", "@Override\r\n\tpublic Object getMapper() {\n\t\treturn null;\r\n\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "public ClassificationAttributesDTO()\n\t{\n\t\tsuper();\n\t}", "@Override\n\tprotected void wrapperDicsOrEnums(JSONObject jSONObject) {\n\t\tsuper.wrapperDicsOrEnums(jSONObject);\n\t\tJSONArray lstImportClass = jSONObject.getJSONArray(\"importClass\");\n lstImportClass.add(\"java.util.Map\");\n jSONObject.put(\"importClass\", removeDuplicate((List) lstImportClass));\n\t}", "@Override\n public boolean isObject() {\n return false;\n }", "public interface OrganizationMapper extends Mapper<OrganizationDTO> {\n}", "public PropertySellerDetailDTO() {\n\n\t}", "public ProcessDataMapper() {\t}", "public GenericDomainObject() {\n\tkeys = new LinkedHashMap<String, Object>();\n\tattributes = new LinkedHashMap<String, Object>();\n }", "@Override\n protected Map<String, Object> getBeansMap()\n {\n return TestUtility.getStateData();\n }" ]
[ "0.72480637", "0.64461356", "0.64254636", "0.61914486", "0.61405927", "0.611376", "0.60989195", "0.60731506", "0.60361534", "0.5991737", "0.5960954", "0.59528536", "0.58519155", "0.5846993", "0.58337575", "0.5818768", "0.5814421", "0.5659796", "0.5647228", "0.5642384", "0.5636104", "0.5631194", "0.5610188", "0.560494", "0.5594176", "0.55506647", "0.55378824", "0.5536047", "0.5528349", "0.5522886", "0.5508323", "0.54752344", "0.5457735", "0.5438687", "0.5424158", "0.53976476", "0.5394829", "0.5391527", "0.53914964", "0.5373205", "0.53639233", "0.53565866", "0.5339605", "0.53189933", "0.5317735", "0.5316185", "0.53113145", "0.53063124", "0.5298422", "0.52892584", "0.5288142", "0.52814656", "0.5261427", "0.5257694", "0.5254879", "0.5238456", "0.5214053", "0.5210305", "0.520923", "0.52080595", "0.5206414", "0.52056813", "0.52019566", "0.5189929", "0.5187778", "0.5178269", "0.517458", "0.5168056", "0.51643956", "0.5162743", "0.51618016", "0.51512367", "0.51510066", "0.5149932", "0.51437634", "0.51425207", "0.51415193", "0.5140146", "0.51345056", "0.5133562", "0.5128151", "0.51232386", "0.5118709", "0.5116065", "0.5099536", "0.50986826", "0.50936663", "0.5088852", "0.50875425", "0.5086784", "0.5081994", "0.50818235", "0.5080628", "0.50684065", "0.5066795", "0.5066245", "0.50653905", "0.5061455", "0.5058693", "0.5058001" ]
0.8125033
0
Stellt die SingeletonEigenschaft der Mapperklasse sicher Sie daf?r sorgt, dass nur eine einzige Instanz von BusinessObjectMapper existiert.
public static BusinessObjectMapper businessObjectMapper() { if(businessObjectMapper == null) { businessObjectMapper = new BusinessObjectMapper(); } return businessObjectMapper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected BusinessObjectMapper() {\n }", "public ObjectMapper getObjectMapper()\n/* */ {\n/* 123 */ return this.objectMapper;\n/* */ }", "public ObjectMappers() {\n\t\tthis.objectMappers = ImmutableList.of();\n\t}", "@Bean\n\tpublic ObjectMapper objectMapper() {\n\t\treturn new ObjectMapper()\n\t\t\t\t.registerModules(new ProblemModule(), new ConstraintViolationProblemModule());\n\t}", "public ObjectMapper() {\n this.typeConverter = null;\n }", "@Mapper(withIoC = IoC.SPRING, withIgnoreMissing = IgnoreMissing.ALL)\npublic interface RemainMapper extends SelmaObjectMapper<RemainTadbir, Remain> {\n}", "protected void registerObjectMapper() {\n\n ObjectMapper mapper = JacksonMapperRegistry.get();\n\n // create JsonProvider to provide custom ObjectMapper\n JacksonJaxbJsonProvider provider = new JacksonJaxbJsonProvider(mapper, JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS);\n //provider.setMapper(mapper);\n\n register(provider);\n }", "private static <T extends ObjectMapper> T initializeObjectMapper(T mapper) {\n mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)\n .configure(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS, true)\n .configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)\n .configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true)\n .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)\n .configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true)\n .setSerializationInclusion(JsonInclude.Include.NON_NULL)\n // .registerModule(new JavaTimeModule()) -> TODO: anuchan Java 8 time (This the jackson module for java 8 Time)\n .registerModule(ByteArraySerializer.getModule())\n .registerModule(Base64UrlSerializer.getModule())\n .registerModule(DateTimeSerializer.getModule())\n .registerModule(DateTimeRfc1123Serializer.getModule())\n // .registerModule(DurationSerializer.getModule()) -> TODO: anuchan java 8 time (Custom module to convert java 8 Duration to String for serialization)\n .registerModule(HttpHeadersSerializer.getModule());\n mapper.setVisibility(mapper.getSerializationConfig().getDefaultVisibilityChecker()\n .withFieldVisibility(JsonAutoDetect.Visibility.ANY)\n .withSetterVisibility(JsonAutoDetect.Visibility.NONE)\n .withGetterVisibility(JsonAutoDetect.Visibility.NONE)\n .withIsGetterVisibility(JsonAutoDetect.Visibility.NONE));\n return mapper;\n }", "@Bean\n\tpublic ObjectMapper mapper() {\n\t\treturn new ObjectMapper();\n\t}", "protected AusschreibungMapper() {\r\n\t}", "public interface OrganizationMapper extends Mapper<OrganizationDTO> {\n}", "public JacksonAdapter() {\n simpleMapper = initializeObjectMapper(new ObjectMapper());\n //\n xmlMapper = initializeObjectMapper(new XmlMapper());\n xmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true);\n xmlMapper.setDefaultUseWrapper(false);\n //\n ObjectMapper flatteningMapper = initializeObjectMapper(new ObjectMapper())\n .registerModule(FlatteningSerializer.getModule(simpleMapper()))\n .registerModule(FlatteningDeserializer.getModule(simpleMapper()));\n jsonMapper = initializeObjectMapper(new ObjectMapper())\n // Order matters: must register in reverse order of hierarchy\n .registerModule(AdditionalPropertiesSerializer.getModule(flatteningMapper))\n .registerModule(AdditionalPropertiesDeserializer.getModule(flatteningMapper))\n .registerModule(FlatteningSerializer.getModule(simpleMapper()))\n .registerModule(FlatteningDeserializer.getModule(simpleMapper())); }", "@Bean\n public ObjectMapper objectMapper() {\n return new ObjectMapper();\n }", "public static ObjectMapper getMapper() {\n return MAPPER;\n }", "@Mapper(componentModel = \"spring\", uses = {Business.class})\npublic interface BusinessMapper {\n\n BusinessDTO toDTO(Business business);\n\n @Mapping(target = \"advertisements\", ignore = true)\n Business toEntity(BusinessDTO businessDTO);\n}", "public interface PaymentOrderMapper extends Mapper<PaymentOrder>{\n\n}", "public static ObjectMapper getObjectMapper() {\n return defaultMapper;\n }", "@Override\r\n\tpublic Object getMapper() {\n\t\treturn null;\r\n\t}", "protected MapperIF getBeanMapper() {\r\n\t\treturn beanMapper;\r\n\t}", "public ObjectMapper getMapper() {\n return mapper;\n }", "@Override\n\tpublic Object getMapper() {\n\t\treturn null;\n\t}", "@Bean\n public ObjectMapper mapper() {\n return new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)\n .setDateFormat(dateFormat());\n }", "private static ObjectMapper createObjectMapper() {\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tmapper.configure(SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS, false);\n\t\tmapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);\n\t\tmapper.registerModule(new JavaTimeModule());\n\t\treturn mapper;\n\t}", "@Bean\n ObjectMapper objectMapper() {\n ObjectMapper objectMapper = new ObjectMapper();\n objectMapper.setSerializationInclusion(Include.NON_DEFAULT);\n return objectMapper;\n }", "@Bean\n @Primary\n public ObjectMapper objectMapper() {\n final ObjectMapper objectMapper = new ObjectMapper();\n objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);\n objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);\n objectMapper.addMixIn(IdentifiableDocument.class, MixIn.class);\n return objectMapper;\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TourBubblRoutePointMapper {\n\n @Mapping(source = \"tourBubbl.id\", target = \"tourBubblId\")\n TourBubblRoutePointDTO tourBubblRoutePointToTourBubblRoutePointDTO(TourBubblRoutePoint tourBubblRoutePoint);\n\n List<TourBubblRoutePointDTO> tourBubblRoutePointsToTourBubblRoutePointDTOs(List<TourBubblRoutePoint> tourBubblRoutePoints);\n\n @Mapping(source = \"tourBubblId\", target = \"tourBubbl\")\n TourBubblRoutePoint tourBubblRoutePointDTOToTourBubblRoutePoint(TourBubblRoutePointDTO tourBubblRoutePointDTO);\n\n List<TourBubblRoutePoint> tourBubblRoutePointDTOsToTourBubblRoutePoints(List<TourBubblRoutePointDTO> tourBubblRoutePointDTOs);\n\n default TourBubbl tourBubblFromId(Long id) {\n if (id == null) {\n return null;\n }\n TourBubbl tourBubbl = new TourBubbl();\n tourBubbl.setId(id);\n return tourBubbl;\n }\n}", "@Bean\n public MapperFactory mapperFactory() {\n\n //1. Build the mapperFactory\n DefaultMapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();\n\n //2. Register all the configurable mappers\n mapperConfiguration.registerConfigurableMappers(mapperFactory);\n\n //3. Register all converters\n converterConfiguration.registerCustomConverters(mapperFactory);\n\n return mapperFactory;\n }", "public ObjectMappers(ObjectMapper objectMapper) {\n\t\tthis(new ObjectMapper[] { objectMapper });\n\t}", "public interface Mapper<T, T2> {\n\n /**\n * Sets the source object.\n *\n * @param source the source instance.\n * @return a <b>IOMap</b> instance.\n */\n Mapper<T, T2> from(T source);\n\n /**\n * Sets the target class.\n *\n * @param target the target class.\n * @return a <b>IOMap</b> instance.\n */\n Mapper<T, T2> to(Class<T2> target);\n\n /**\n * Sets an ignorable object with the ignorable fields for mapping operation.\n *\n * @param ignorable the ignorable instance.\n * @return a <b>IOMap</b> instance.\n */\n Mapper<T, T2> ignoring(Ignorable ignorable);\n\n /**\n * Sets a customizable object with the fields for the explicit mapping.\n *\n * @param customizable the customizable instance.\n * @return a <b>IOMap</b> instance.\n */\n Mapper<T, T2> relate(Customizable customizable);\n\n /**\n * Starts with the building target object\n *\n * @return a target object instance.\n */\n T2 build();\n\n}", "@Mapper\npublic interface ShippmentDtoBoMapper {\n\n\tpublic ShippmentDto mapBoToDto(ShippmentBo shippmentBo);\n\n\n\n\tpublic ShippmentBo mapDtoToBo(ShippmentDto shippmentDto);\n}", "@Mapper\npublic interface BeerMapper {\n\n\tBeerMapper INSTANCE = Mappers.getMapper(BeerMapper.class);\n\n\tBeerDto mapBeerDtoFrom(final Beer beer);\n\n\tBeer mapBeerFrom(final BeerDto beerDto);\n}", "@Mapper(componentModel = \"spring\", uses = {ArquivoAnexoMapper.class})\npublic interface ProcessoAnexoMapper{\n\n ProcessoAnexoDTO processoAnexoToProcessoAnexoDTO(ProcessoAnexo processoAnexo);\n\n List<ProcessoAnexoDTO> processoAnexosToProcessoAnexoDTOs(List<ProcessoAnexo> processoAnexos);\n\n @Mapping(target = \"processo\", ignore = true)\n ProcessoAnexo processoAnexoDTOToProcessoAnexo(ProcessoAnexoDTO processoAnexoDTO);\n\n List<ProcessoAnexo> processoAnexoDTOsToProcessoAnexos(List<ProcessoAnexoDTO> processoAnexoDTOs);\n\n\n}", "public HibernateAwareObjectMapper() {\n\t Hibernate4Module hm = new Hibernate4Module();\n\t hm.disable(Hibernate4Module.Feature.FORCE_LAZY_LOADING);\n\t enable(SerializationFeature.INDENT_OUTPUT);\n\t enable(SerializationFeature.WRAP_EXCEPTIONS);\n\t disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);\n\t registerModule(hm);\n\t}", "@Override\r\n\tpublic boolean needDealMapper() {\n\t\treturn false;\r\n\t}", "@Mapper\npublic interface SeguridadDtoMap {\n SeguridadDtoMap INSTANCE = Mappers.getMapper( SeguridadDtoMap.class );\n\n GrupoDto grupoToGrupoDto(Grupo grupo);\n\n Grupo grupoDtoToGrupo(GrupoDto grupoDto);\n}", "public CustomObjectMapper(){\n this.setDateFormat(new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\"));\n }", "public static BokMapper getInstance(){\r\n\t\treturn BokMapper;\r\n\t}", "@Bean\n @Primary\n public ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) {\n logger.debug(\"Register Jackson Mappers...\");\n ObjectMapper objectMapper = builder.build();\n objectMapper.registerModule(new JavaTimeModule());\n objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);\n return objectMapper;\n }", "@Override\r\n\tpublic Class getObjectType() {\n\t\treturn mapperInterface;\r\n\t}", "@Component\n@Mapper(componentModel = \"spring\")\npublic interface CarriageMapper {\n\n Carriage carriageModelToCarriage(CarriageModel carriageModel);\n\n CarriageModel carriageToCarriageModel(Carriage carriage);\n\n CarriageModel carriageDtoToCarriageModel(CarriageDto carriageDto);\n\n CarriageDto carriageModelToCarriageDto(CarriageModel carriageModel);\n\n List<CarriageModel> carriagesToCarriageModels(List<Carriage> carriages);\n\n List<CarriageDto> carriageModelsToCarriageDtos(List<CarriageModel> carriageModels);\n\n List<Carriage> carriageModelsToCarriages(List<CarriageModel> carriageModels);\n}", "protected StreamsJacksonMapper() {\n super();\n registerModule(new StreamsJacksonModule(configuration.getDateFormats()));\n if ( configuration.getEnableScala()) {\n registerModule(new DefaultScalaModule());\n }\n configure();\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface OTHERMapper extends EntityMapper<OTHERDTO, OTHER> {\n\n\n\n default OTHER fromId(Long id) {\n if (id == null) {\n return null;\n }\n OTHER oTHER = new OTHER();\n oTHER.setId(id);\n return oTHER;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {AuthorityMapper.class, })\npublic interface BizUserMapper {\n\n BizUserDTO bizUserToBizUserDTO(BizUser bizUser);\n\n List<BizUserDTO> bizUsersToBizUserDTOs(List<BizUser> bizUsers);\n\n @Mapping(target = \"companies\", ignore = true)\n @Mapping(target = \"products\", ignore = true)\n BizUser bizUserDTOToBizUser(BizUserDTO bizUserDTO);\n\n List<BizUser> bizUserDTOsToBizUsers(List<BizUserDTO> bizUserDTOs);\n\n default Authority authorityFromId(Long id) {\n if (id == null) {\n return null;\n }\n Authority authority = new Authority();\n authority.setId(id);\n return authority;\n }\n}", "public interface BeanMapper<A, B> extends Mapper<A, B> {\n void setBeanMapperConsumer(BeanMapperConsumer beanMapperConsumer);\n}", "public interface UserInfoMapper extends Mapper<UserInfo> {\n\n}", "@Mapper(componentModel = \"spring\", uses = {AanvraagberichtMapper.class})\npublic interface FdnAanvragerMapper extends EntityMapper<FdnAanvragerDTO, FdnAanvrager> {\n\n @Mapping(source = \"aanvraagbericht.id\", target = \"aanvraagberichtId\")\n FdnAanvragerDTO toDto(FdnAanvrager fdnAanvrager);\n\n @Mapping(target = \"adres\", ignore = true)\n @Mapping(target = \"legitimatiebewijs\", ignore = true)\n @Mapping(target = \"werksituaties\", ignore = true)\n @Mapping(target = \"gezinssituaties\", ignore = true)\n @Mapping(target = \"financieleSituaties\", ignore = true)\n @Mapping(source = \"aanvraagberichtId\", target = \"aanvraagbericht\")\n FdnAanvrager toEntity(FdnAanvragerDTO fdnAanvragerDTO);\n\n default FdnAanvrager fromId(Long id) {\n if (id == null) {\n return null;\n }\n FdnAanvrager fdnAanvrager = new FdnAanvrager();\n fdnAanvrager.setId(id);\n return fdnAanvrager;\n }\n}", "@Mapper(componentModel = \"spring\")\npublic interface FrecuenciaMapper extends AbstractMapper<FrecuenciaVO, Frecuencia> {\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface MisteriosoMapper extends EntityMapper<MisteriosoDTO, Misterioso> {\n\n \n\n \n\n default Misterioso fromId(Long id) {\n if (id == null) {\n return null;\n }\n Misterioso misterioso = new Misterioso();\n misterioso.setId(id);\n return misterioso;\n }\n}", "@Override\n protected void configureFactoryBuilder(final DefaultMapperFactory.Builder factoryBuilder) {\n factoryBuilder.mapNulls(false).build();\n }", "protected AbstractMessageSubscriber(ObjectMapper objectMapper) {\n this.objectMapper = objectMapper;\n }", "@Mapper\npublic interface SpiderMapper {\n \n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface EventdataMapper {\n\n @Mapping(source = \"application.id\", target = \"applicationId\")\n @Mapping(source = \"applicationevent.id\", target = \"applicationeventId\")\n @Mapping(source = \"applicationview.id\", target = \"applicationviewId\")\n @Mapping(source = \"application.name\", target = \"applicationName\")\n @Mapping(source = \"applicationevent.name\", target = \"applicationeventName\")\n @Mapping(source = \"applicationview.name\", target = \"applicationviewName\")\n EventdataDTO eventdataToEventdataDTO(Eventdata eventdata);\n\n List<EventdataDTO> eventdataToEventdataDTOs(List<Eventdata> eventdata);\n\n @Mapping(source = \"applicationId\", target = \"application\")\n @Mapping(source = \"applicationeventId\", target = \"applicationevent\")\n @Mapping(source = \"applicationviewId\", target = \"applicationview\")\n Eventdata eventdataDTOToEventdata(EventdataDTO eventdataDTO);\n\n List<Eventdata> eventdataDTOsToEventdata(List<EventdataDTO> eventdataDTOs);\n\n default Application applicationFromId(Long id) {\n if (id == null) {\n return null;\n }\n Application application = new Application();\n application.setId(id);\n return application;\n }\n\n default Applicationevent applicationeventFromId(Long id) {\n if (id == null) {\n return null;\n }\n Applicationevent applicationevent = new Applicationevent();\n applicationevent.setId(id);\n return applicationevent;\n }\n\n default Applicationview applicationviewFromId(Long id) {\n if (id == null) {\n return null;\n }\n Applicationview applicationview = new Applicationview();\n applicationview.setId(id);\n return applicationview;\n }\n}", "public OBOMapper() {\n this(true);\n }", "@Mapper(componentModel = \"spring\")\npublic interface DataDictItemMapping {\n DataDictItemVo asDataDictItemVo(DataDictItem entity);\n\n DataDictItemOrdinaryVo asOrdinary(DataDictItem entity);\n\n @Mapping(target = \"priority\", ignore = true)\n @Mapping(target = \"lastUpdater\", ignore = true)\n @Mapping(target = \"lastUpdatedAt\", ignore = true)\n @Mapping(target = \"id\", ignore = true)\n @Mapping(target = \"dictId\", ignore = true)\n @Mapping(target = \"creator\", ignore = true)\n @Mapping(target = \"createdAt\", ignore = true)\n DataDictItem asDataDictItem(DataDictItemInsertRo ro);\n\n DataDictItemComplexVo asComplex(DataDictItem entity);\n\n DataDictItem asDataDictItem(DataDictItemUpdateRo ro);\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TipoTelaMapper {\n\n @Mapping(source = \"direccionamientoTela.id\", target = \"direccionamientoTelaId\")\n @Mapping(source = \"direccionamientoTela.nombre\", target = \"direccionamientoTelaNombre\")\n TipoTelaDTO tipoTelaToTipoTelaDTO(TipoTela tipoTela);\n\n @Mapping(source = \"direccionamientoTelaId\", target = \"direccionamientoTela\")\n @Mapping(target = \"telaCrudas\", ignore = true)\n TipoTela tipoTelaDTOToTipoTela(TipoTelaDTO tipoTelaDTO);\n\n default DireccionamientoTela direccionamientoTelaFromId(Long id) {\n if (id == null) {\n return null;\n }\n DireccionamientoTela direccionamientoTela = new DireccionamientoTela();\n direccionamientoTela.setId(id);\n return direccionamientoTela;\n }\n}", "public interface ItemMapper extends Mapper<Item> {\n}", "@Override\r\n\tpublic BaseMapper<T> getMapper() {\n\t\treturn comMessageMapper;\r\n\t}", "@Repository\npublic interface ItemMapper extends Mapper<Item> {\n\n\n}", "public interface PageTagMapper extends Mapper<PageTagDTO> {\n\n}", "public JsonSchemaMappingLookup() {\n // initialize all mappings from URLs to the respective schema\n businessObjectToJsonSchema.put(\"/rules\", DCC_VALIDATION_RULE_JSON_CLASSPATH);\n businessObjectToJsonSchema.put(\"/bnrules\", DCC_VALIDATION_RULE_JSON_CLASSPATH);\n businessObjectToJsonSchema.put(\"/cclrules\", CCL_JSON_SCHEMA);\n }", "@BeanMapping( ignoreByDefault = true )\n @Mapping( target = \"key\", ignore = true)\n @Mapping( target = \"modificationDate\", ignore = true)\n @Mapping( target = \"creationDate\", ignore = true)\n BaseEntity mapBase(Object o);", "@Autowired\n\t@Override\n\tpublic void setBaseMapper() {\n\t\tthis.baseMapper=trxMapper;\n\t}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface EmploymentTypeMapper extends EntityMapper<EmploymentTypeDTO, EmploymentType> {\n\n\n @Mapping(target = \"people\", ignore = true)\n EmploymentType toEntity(EmploymentTypeDTO employmentTypeDTO);\n\n default EmploymentType fromId(Long id) {\n if (id == null) {\n return null;\n }\n EmploymentType employmentType = new EmploymentType();\n employmentType.setId(id);\n return employmentType;\n }\n}", "protected MXBeanMappingFactory() {}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface HeritageMediaMapper {\n\n @Mapping(source = \"category.id\", target = \"categoryId\")\n @Mapping(source = \"category.categoryName\", target = \"categoryCategoryName\")\n @Mapping(source = \"language.id\", target = \"languageId\")\n @Mapping(source = \"language.heritageLanguage\", target = \"languageHeritageLanguage\")\n @Mapping(source = \"group.id\", target = \"groupId\")\n @Mapping(source = \"group.name\", target = \"groupName\")\n @Mapping(source = \"heritageApp.id\", target = \"heritageAppId\")\n @Mapping(source = \"heritageApp.name\", target = \"heritageAppName\")\n @Mapping(source = \"user.id\", target = \"userId\")\n @Mapping(source = \"user.login\", target = \"userLogin\")\n HeritageMediaDTO heritageMediaToHeritageMediaDTO(HeritageMedia heritageMedia);\n\n @Mapping(source = \"categoryId\", target = \"category\")\n @Mapping(source = \"languageId\", target = \"language\")\n @Mapping(source = \"groupId\", target = \"group\")\n @Mapping(source = \"heritageAppId\", target = \"heritageApp\")\n @Mapping(source = \"userId\", target = \"user\")\n HeritageMedia heritageMediaDTOToHeritageMedia(HeritageMediaDTO heritageMediaDTO);\n\n default HeritageCategory heritageCategoryFromId(Long id) {\n if (id == null) {\n return null;\n }\n HeritageCategory heritageCategory = new HeritageCategory();\n heritageCategory.setId(id);\n return heritageCategory;\n }\n\n default HeritageLanguage heritageLanguageFromId(Long id) {\n if (id == null) {\n return null;\n }\n HeritageLanguage heritageLanguage = new HeritageLanguage();\n heritageLanguage.setId(id);\n return heritageLanguage;\n }\n\n default HeritageGroup heritageGroupFromId(Long id) {\n if (id == null) {\n return null;\n }\n HeritageGroup heritageGroup = new HeritageGroup();\n heritageGroup.setId(id);\n return heritageGroup;\n }\n\n default HeritageApp heritageAppFromId(Long id) {\n if (id == null) {\n return null;\n }\n HeritageApp heritageApp = new HeritageApp();\n heritageApp.setId(id);\n return heritageApp;\n }\n\n default User userFromId(Long id) {\n if (id == null) {\n return null;\n }\n User user = new User();\n user.setId(id);\n return user;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface StockOutFrozenTubeMapper {\n\n @Mapping(source = \"stockOutFrozenBox.id\", target = \"stockOutFrozenBoxId\")\n @Mapping(source = \"frozenTube.id\", target = \"frozenTubeId\")\n StockOutFrozenTubeDTO stockOutFrozenTubeToStockOutFrozenTubeDTO(StockOutFrozenTube stockOutFrozenTube);\n\n List<StockOutFrozenTubeDTO> stockOutFrozenTubesToStockOutFrozenTubeDTOs(List<StockOutFrozenTube> stockOutFrozenTubes);\n\n @Mapping(source = \"stockOutFrozenBoxId\", target = \"stockOutFrozenBox\")\n @Mapping(source = \"frozenTubeId\", target = \"frozenTube\")\n StockOutFrozenTube stockOutFrozenTubeDTOToStockOutFrozenTube(StockOutFrozenTubeDTO stockOutFrozenTubeDTO);\n\n List<StockOutFrozenTube> stockOutFrozenTubeDTOsToStockOutFrozenTubes(List<StockOutFrozenTubeDTO> stockOutFrozenTubeDTOs);\n\n default StockOutFrozenBox stockOutFrozenBoxFromId(Long id) {\n if (id == null) {\n return null;\n }\n StockOutFrozenBox stockOutFrozenBox = new StockOutFrozenBox();\n stockOutFrozenBox.setId(id);\n return stockOutFrozenBox;\n }\n\n default FrozenTube frozenTubeFromId(Long id) {\n if (id == null) {\n return null;\n }\n FrozenTube frozenTube = new FrozenTube();\n frozenTube.setId(id);\n return frozenTube;\n }\n}", "@Mapper\npublic interface JorugiBoardMapper {\n List<JorugiBoard> getJorugiBoardList();\n}", "public MapperBase() {\r\n }", "private Mapper() {\n\n }", "@Mapper(componentModel = \"spring\", uses = {TipoDocumentoMapper.class, GeneroMapper.class, AseguradoraMapper.class, GrupoEtnicoMapper.class, RegimenMapper.class, MunicipioMapper.class, TipoResidenciaMapper.class})\npublic interface PacienteMapper extends EntityMapper<PacienteDTO, Paciente> {\n\n @Mapping(source = \"tipoDocumento.id\", target = \"tipoDocumentoId\")\n @Mapping(source = \"tipoDocumento.nombre\", target = \"tipoDocumentoNombre\")\n @Mapping(source = \"genero.id\", target = \"generoId\")\n @Mapping(source = \"genero.nombre\", target = \"generoNombre\")\n @Mapping(source = \"aseguradora.id\", target = \"aseguradoraId\")\n @Mapping(source = \"aseguradora.nombre\", target = \"aseguradoraNombre\")\n @Mapping(source = \"grupoEtnico.id\", target = \"grupoEtnicoId\")\n @Mapping(source = \"grupoEtnico.nombre\", target = \"grupoEtnicoNombre\")\n @Mapping(source = \"regimen.id\", target = \"regimenId\")\n @Mapping(source = \"regimen.nombre\", target = \"regimenNombre\")\n @Mapping(source = \"municipio.id\", target = \"municipioId\")\n @Mapping(source = \"municipio.nombre\", target = \"municipioNombre\")\n @Mapping(source = \"tipoResidencia.id\", target = \"tipoResidenciaId\")\n @Mapping(source = \"tipoResidencia.nombre\", target = \"tipoResidenciaNombre\")\n PacienteDTO toDto(Paciente paciente);\n\n @Mapping(target = \"aplicacions\", ignore = true)\n @Mapping(target = \"acudientes\", ignore = true)\n @Mapping(source = \"tipoDocumentoId\", target = \"tipoDocumento\")\n @Mapping(source = \"generoId\", target = \"genero\")\n @Mapping(source = \"aseguradoraId\", target = \"aseguradora\")\n @Mapping(source = \"grupoEtnicoId\", target = \"grupoEtnico\")\n @Mapping(source = \"regimenId\", target = \"regimen\")\n @Mapping(source = \"municipioId\", target = \"municipio\")\n @Mapping(source = \"tipoResidenciaId\", target = \"tipoResidencia\")\n Paciente toEntity(PacienteDTO pacienteDTO);\n\n default Paciente fromId(Long id) {\n if (id == null) {\n return null;\n }\n Paciente paciente = new Paciente();\n paciente.setId(id);\n return paciente;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface WwtreatmentthreeMapper {\n\n WwtreatmentthreeDTO wwtreatmentthreeToWwtreatmentthreeDTO(Wwtreatmentthree wwtreatmentthree);\n\n List<WwtreatmentthreeDTO> wwtreatmentthreesToWwtreatmentthreeDTOs(List<Wwtreatmentthree> wwtreatmentthrees);\n\n Wwtreatmentthree wwtreatmentthreeDTOToWwtreatmentthree(WwtreatmentthreeDTO wwtreatmentthreeDTO);\n\n List<Wwtreatmentthree> wwtreatmentthreeDTOsToWwtreatmentthrees(List<WwtreatmentthreeDTO> wwtreatmentthreeDTOs);\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface EightydMapper extends EntityMapper<EightydDTO, Eightyd> {\n\n\n\n default Eightyd fromId(Long id) {\n if (id == null) {\n return null;\n }\n Eightyd eightyd = new Eightyd();\n eightyd.setId(id);\n return eightyd;\n }\n}", "private void initMapper() {\n final BeanPropertyFilter filterOutAllExcept =\n SimpleBeanPropertyFilter.filterOutAllExcept(\"fname\", \"executionTimeNano\");\n this.mapper.addMixInAnnotations(\n PortalEvent.class, PortletRenderExecutionEventFilterMixIn.class);\n final SimpleFilterProvider filterProvider = new SimpleFilterProvider();\n filterProvider.addFilter(\n PortletRenderExecutionEventFilterMixIn.FILTER_NAME, filterOutAllExcept);\n this.portletEventWriter = this.mapper.writer(filterProvider);\n }", "private ModuleMapper() {\n mapper = new HashMap<String, String>();\n mapper.put(\"accounts\", \"Accounts\");\n mapper.put(\"acl_actions\", \"ACLActions\");\n mapper.put(\"acl_roles\", \"ACLRoles\");\n mapper.put(\"bugs\", \"Bugs\");\n mapper.put(\"calls\", \"Calls\");\n mapper.put(\"campaign_log\", \"CampaignLog\");\n mapper.put(\"campaign_trkrs\", \"CampaignTrackers\");\n mapper.put(\"campaigns\", \"Campaigns\");\n mapper.put(\"cases\", \"Cases\");\n mapper.put(\"contacts\", \"Contacts\");\n mapper.put(\"currencies\", \"Currencies\");\n mapper.put(\"document_revisions\", \"DocumentRevisions\");\n mapper.put(\"documents\", \"Documents\");\n mapper.put(\"eapm\", \"EAPM\");\n mapper.put(\"email_addresses\", \"EmailAddresses\");\n mapper.put(\"email_marketing\", \"EmailMarketing\");\n mapper.put(\"email_templates\", \"EmailTemplates\");\n mapper.put(\"emailman\", \"EmailMan\");\n mapper.put(\"emails\", \"Emails\");\n mapper.put(\"inbound_email\", \"InboundEmail\");\n mapper.put(\"job_queue\", \"SchedulersJobs\");\n mapper.put(\"leads\", \"Leads\");\n mapper.put(\"meetings\", \"Meetings\");\n mapper.put(\"notes\", \"Notes\");\n mapper.put(\"oauth_consumer\", \"OAuthKeys\");\n mapper.put(\"oauth_tokens\", \"OAuthTokens\");\n mapper.put(\"opportunities\", \"Opportunities\");\n mapper.put(\"project\", \"Project\");\n mapper.put(\"project_task\", \"ProjectTask\");\n mapper.put(\"prospect_lists\", \"ProspectLists\");\n mapper.put(\"prospects\", \"Prospects\");\n mapper.put(\"releases\", \"Releases\");\n mapper.put(\"roles\", \"Roles\");\n mapper.put(\"saved_search\", \"SavedSearch\");\n mapper.put(\"schedulers\", \"Schedulers\");\n mapper.put(\"sugarfeed\", \"SugarFeed\");\n mapper.put(\"tasks\", \"Tasks\");\n mapper.put(\"users\", \"Users\");\n }", "public MapOther() {\n }", "public void mapping() {\n\t\t\n\t}", "public void setObjectMapper(ObjectMapper objectMapper)\n/* */ {\n/* 114 */ Assert.notNull(objectMapper, \"ObjectMapper must not be null\");\n/* 115 */ this.objectMapper = objectMapper;\n/* 116 */ configurePrettyPrint();\n/* */ }", "@Test\n public void map() {\n \n /*\n * Construct the mapper factory;\n */\n MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();\n \n /*\n * Register mappings for the fields whose names done match; 'byDefault' covers the matching ones\n */\n mapperFactory.classMap(A.class, B1.class)\n .field(\"a1.Pa11\", \"Pb11\")\n .field(\"a1.Pa12\", \"Pb12\")\n .byDefault()\n .register();\n \n mapperFactory.classMap(A.class, B2.class)\n .field(\"a2.Pa21\", \"Pb21\")\n .field(\"a2.Pa22\", \"Pb22\")\n .byDefault()\n .register();\n \n /*\n * Construct some test object\n */\n A source = new A();\n source.p1 = new Property(\"p1\", \"p1.value\");\n source.p2 = new Property(\"p2\", \"p2.value\");\n source.a1 = new A1();\n source.a1.Pa11 = new Property(\"Pa11\", \"Pa11.value\");\n source.a1.Pa12 = new Property(\"Pa12\", \"Pa12.value\");\n source.a2 = new A2();\n source.a2.Pa21 = new Property(\"Pa21\", \"Pa21.value\");\n source.a2.Pa22 = new Property(\"Pa22\", \"Pa22.value\");\n \n MapperFacade mapper = mapperFactory.getMapperFacade();\n \n Collection<A> collectionA = new ArrayList<>();\n collectionA.add(source);\n\n /*\n * Map the collection of A into a collection of B1 using 'mapAsList'\n */\n Collection<B1> collectionB1 = mapper.mapAsList(collectionA, B1.class);\n \n Assert.assertNotNull(collectionB1);\n B1 b1 = collectionB1.iterator().next();\n Assert.assertEquals(source.p1, b1.p1);\n Assert.assertEquals(source.p2, b1.p2);\n Assert.assertEquals(source.a1.Pa11, b1.Pb11);\n Assert.assertEquals(source.a1.Pa12, b1.Pb12);\n \n /*\n * Map the collection of A into a collection of B2 using 'mapAsList'\n */\n Collection<B2> collectionB2 = mapper.mapAsList(collectionA, B2.class);\n \n B2 b2 = collectionB2.iterator().next();\n Assert.assertNotNull(b2);\n Assert.assertEquals(source.p1, b2.p1);\n Assert.assertEquals(source.p2, b2.p2);\n Assert.assertEquals(source.a2.Pa21, b2.Pb21);\n Assert.assertEquals(source.a2.Pa22, b2.Pb22);\n }", "public interface ItemDescMapper extends Mapper<ItemDesc> {\n}", "@Bean\n public Jackson2ObjectMapperBuilder objectMapperBuilder() {\n return new Jackson2ObjectMapperBuilder()\n .serializationInclusion(JsonInclude.Include.NON_NULL);\n }", "public interface SmsAccountMapper31 extends BaseMapper31<SmsAccount> {\n\n\n}", "public interface EntryLeagueInfoMapper extends MyBaseMapper<EntryLeagueInfoEntity> {\n\n}", "@Mapper\npublic interface TestMapper extends MyMapper<Person1> {\n //List<Person1> findAll();\n}", "public interface UserMapper extends Mapper<User>{\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface MedicoCalendarioMapper extends EntityMapper<MedicoCalendarioDTO, MedicoCalendario> {\n\n\n\n default MedicoCalendario fromId(Long id) {\n if (id == null) {\n return null;\n }\n MedicoCalendario medicoCalendario = new MedicoCalendario();\n medicoCalendario.setId(id);\n return medicoCalendario;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {CompanyMapper.class})\npublic interface VehicleMapper extends EntityMapper<VehicleDTO, Vehicle> {\n\n @Mapping(source = \"company.id\", target = \"companyId\")\n VehicleDTO toDto(Vehicle vehicle);\n\n @Mapping(target = \"vehicleDocuments\", ignore = true)\n @Mapping(target = \"vehicleStaffs\", ignore = true)\n @Mapping(source = \"companyId\", target = \"company\")\n Vehicle toEntity(VehicleDTO vehicleDTO);\n\n default Vehicle fromId(Long id) {\n if (id == null) {\n return null;\n }\n Vehicle vehicle = new Vehicle();\n vehicle.setId(id);\n return vehicle;\n }\n}", "public Class<? extends AIngleMapper> getMapperClass() {\n return mapperClass;\n }", "@Mapper\npublic interface RecruitMapper {\n\n /**\n * 根据招募表主键ID查询\n * @param id\n * @return\n */\n public Recruit getRecruitById(String id);\n\n /**\n * 根据商家ID查询对应招募信息\n * @param owner\n * @return\n */\n public List<Recruit> getRecruitListByOwner(String owner);\n\n public int insertRecruit(Recruit recruit);\n\n public int updateRecruit(Recruit recruit);\n}", "protected final void configure(final MapperFactory factory) {\n\n factory.classMap(Case.class, CaseDTO.class).byDefault().register();\n\n factory.classMap(Case.class, CaseDetailsDTO.class).byDefault().register();\n\n factory\n .classMap(CaseGroup.class, CaseGroupDTO.class)\n .field(\"status\", \"caseGroupStatus\")\n .byDefault()\n .register();\n\n factory.classMap(CaseEvent.class, CaseEventDTO.class).byDefault().register();\n\n factory\n .classMap(Category.class, CategoryDTO.class)\n .field(\"categoryName\", \"name\")\n .byDefault()\n .register();\n\n factory.classMap(Response.class, ResponseDTO.class).byDefault().register();\n }", "@Mapper\npublic interface WorkGroupMapper extends BaseMapper<WorkGroup> {\n}", "public interface BreakfastMapper {\n Breakfast getBreakfastId(int idBreakfast);\n List<Breakfast> getAllBreakfast();\n}", "public interface OrderStatusMapper extends BaseMapper<OrderStatus> {\n}", "@Bean\n public TypeMap<CarriageDto, Carriage> getCarriageDtoCarriageTypeMap() {\n return getModelMapper().createTypeMap(CarriageDto.class, Carriage.class, \"CarriageDtoCarriage\")\n .addMappings(mapper -> mapper.when(isNotNull()).map(CarriageDto::getUniqueNumber, Carriage::setUniqueNumber))\n .addMappings(mapper -> mapper.when(isNotNull()).map(CarriageDto::getStatus, Carriage::setStatus))\n .addMappings(mapper -> mapper.when(isNotNull()).map(CarriageDto::getCustomerName, Carriage::setCustomerName))\n .addMappings(mapper -> mapper.when(isNotNull()).map(CarriageDto::getInitiateDate, Carriage::setInitiateDate))\n .addMappings(mapper -> mapper.when(isNotNull()).map(CarriageDto::getFinishDate, Carriage::setFinishDate))\n .addMappings(mapper -> mapper.when(isNotNull()).map(CarriageDto::getEstimatedLeadTime, Carriage::setEstimatedLeadTime))\n\n .addMappings(mapper -> mapper.using(MappingContext::getDestination).map(CarriageDto::getWaypoints, Carriage::setWaypoints))\n .addMappings(mapper -> mapper.using(MappingContext::getDestination).map(CarriageDto::getVehicle, Carriage::setVehicle))\n .addMappings(mapper -> mapper.using(MappingContext::getDestination).map(CarriageDto::getDrivers, Carriage::setDrivers))\n .addMappings(mapper -> mapper.using(MappingContext::getDestination).map(CarriageDto::getCargoes, Carriage::setCargoes));\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface CustomerMapper {\n\n CustomerDTO customerToCustomerDTO(Customer customer);\n\n List<CustomerDTO> customersToCustomerDTOs(List<Customer> customers);\n\n @Mapping(target = \"orders\", ignore = true)\n Customer customerDTOToCustomer(CustomerDTO customerDTO);\n\n List<Customer> customerDTOsToCustomers(List<CustomerDTO> customerDTOs);\n}", "@Mapper(\n componentModel = \"spring\",\n uses = {ParticleMapper.class, SmsDeviceMapper.class})\npublic interface SmsBondMapper extends EntityMapper<SmsBondDTO, SmsBond> {\n\n default SmsBond fromId(Long id) {\n if (id == null) {\n return null;\n }\n SmsBond smsBond = new SmsBond();\n smsBond.setId(id);\n return smsBond;\n }\n}", "@Mapper\npublic interface MissionMapper {\n\n MissionMapper INSTANCE = Mappers.getMapper(MissionMapper.class);\n\n @Mapping(source = \"izQuestion\", target = \"izQuestion\")\n @Mapping(source = \"missionDescription\", target = \"missionDescription\")\n @Mapping(source = \"missionName\", target = \"missionName\")\n @Mapping(source = \"shortDescription\", target = \"shortDescription\")\n @Mapping(source = \"winnerScore\", target = \"winnerScore\")\n @Mapping(source = \"storyId\", target = \"story.id\")\n Mission dtoToMission (MissionDTO missionDTO);\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface Record25HerfinancieeringMapper extends EntityMapper<Record25HerfinancieeringDTO, Record25Herfinancieering> {\n\n\n\n default Record25Herfinancieering fromId(Long id) {\n if (id == null) {\n return null;\n }\n Record25Herfinancieering record25Herfinancieering = new Record25Herfinancieering();\n record25Herfinancieering.setId(id);\n return record25Herfinancieering;\n }\n}", "@Repository\n@Mapper\npublic interface AppInfoMapper extends BaseMapper<AppInfoEntity> {\n}", "@Test\n public void testMapping2() throws JsonParseException, JsonMappingException, IOException {\n InputStream is = CoinfloorTickerTest.class.getResourceAsStream(\"/marketdata/example-ticker-update.json\");\n\n // Use Jackson to parse it\n ObjectMapper mapper = new ObjectMapper();\n CoinfloorTicker testObject = mapper.readValue(is, CoinfloorTicker.class);\n\n // Verify that the example data was mapped correctly\n Assert.assertEquals(0, testObject.getErrorCode());\n Assert.assertEquals(BigDecimal.valueOf(0, 2), testObject.getLast());\n Assert.assertEquals(BigDecimal.valueOf(0, 2), testObject.getHigh());\n Assert.assertEquals(BigDecimal.valueOf(0, 2), testObject.getLow());\n Assert.assertEquals(BigDecimal.valueOf(31899, 2), testObject.getAsk());\n Assert.assertEquals(BigDecimal.valueOf(0, 2), testObject.getBid());\n }", "public interface StatusMapper extends BaseMapper<Status> {\n\n}" ]
[ "0.78805155", "0.6732063", "0.6479252", "0.6383367", "0.6371499", "0.63529", "0.63056344", "0.63001263", "0.6224584", "0.61883926", "0.61881924", "0.6160007", "0.6117104", "0.61087126", "0.60762733", "0.6054318", "0.6017606", "0.5999387", "0.59904975", "0.59710103", "0.59163964", "0.58867764", "0.58863217", "0.5879955", "0.585589", "0.58349425", "0.5824603", "0.57963175", "0.5781294", "0.5780024", "0.5740165", "0.57378703", "0.573772", "0.57344", "0.56994987", "0.5676995", "0.5667368", "0.56450564", "0.5644687", "0.56376606", "0.5632369", "0.5629128", "0.56271166", "0.56262374", "0.56173426", "0.56149393", "0.5601312", "0.5601138", "0.56009763", "0.55996215", "0.5586999", "0.55834395", "0.55781895", "0.55609196", "0.55592597", "0.55575854", "0.5539457", "0.5531999", "0.5528338", "0.55280733", "0.55230814", "0.5522707", "0.55204195", "0.5518803", "0.551408", "0.5488636", "0.5485203", "0.5484089", "0.5479721", "0.54761845", "0.5473513", "0.5470742", "0.54701054", "0.54593027", "0.54523176", "0.544678", "0.54452205", "0.54312843", "0.5421981", "0.5418721", "0.5412942", "0.5412873", "0.5412057", "0.5411174", "0.5409409", "0.5407807", "0.5406201", "0.54052556", "0.5399956", "0.5394012", "0.5380247", "0.5379985", "0.53730667", "0.5372344", "0.537043", "0.5367912", "0.53656894", "0.53650385", "0.53609264", "0.53604174" ]
0.7649721
1
Metodo que saca un alert dialog cuando no exite el libro buscado
public void noExiste() { AlertDialog.Builder dialogo1 = new AlertDialog.Builder(BuscarLibro.this); dialogo1.setTitle("Aviso"); dialogo1.setMessage("No existe ningun libro con esos datos"); dialogo1.setCancelable(false); dialogo1.setPositiveButton("Aceptar", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialogo1, int id) { } }); dialogo1.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialogo1, int id) { } }); dialogo1.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void noSensorAlert() {\n AlertDialog.Builder alertDialog = new AlertDialog.Builder(context);\n alertDialog.setMessage(\"This device doesn;t have the necessary sensors for this application \")\n .setCancelable(false)\n .setNegativeButton(\"Close\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) { stop()/*finish()*/; }\n });\n }", "public void msgErreur(){\n \n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Entrée invalide\");\n alert.setHeaderText(\"Corriger les entrées invalides.\");\n alert.setContentText(\"Les informations entrées sont erronnées\");\n\n alert.showAndWait();\n \n\n}", "public void resultIsNull(){\n if(alertDialog.isShowing()){\n return;\n }\n if(inActive){\n return;\n }\n }", "private void msgNoServidorConfigurado() {\r\n\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n\tbuilder.setMessage(R.string.txtSinServidor).setCancelable(false)\r\n\t\t.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\r\n\t\t public void onClick(DialogInterface dialog, int id) {\r\n\t\t\tListaRutasActivity.this.finish();\r\n\t\t }\r\n\t\t});\r\n\tAlertDialog alert = builder.create();\r\n\talert.show();\r\n }", "public void alertInvalid(){\n Alert alert = new Alert(Alert.AlertType.WARNING);\n alert.setTitle(\"Herencia invalida\");\n alert.setHeaderText(\"Un hijo no puede ser hijo de su padre o un padre no puede ser padre de su padre,\"\n + \"No puede crear herencia con entidades debiles.\");\n alert.showAndWait();\n }", "private void Ignorado() {\n Dialogo(R.string.ignorada);\n }", "private void alertDialoge() {\n builder.setMessage(R.string.dialoge_desc).setTitle(R.string.we_request_again);\n\n builder.setCancelable(false)\n .setPositiveButton(R.string.give_permissions, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n requestPermission();\n }\n })\n .setNegativeButton(R.string.dont_ask_again, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // Action for 'Don't Ask Again' Button\n // the sharedpreferences value is true\n editor.putBoolean(getResources().getString(R.string.dont_ask_again), true);\n editor.commit();\n dialog.cancel();\n }\n });\n //Creating dialog box\n AlertDialog alert = builder.create();\n alert.show();\n }", "@Override\n public void onCancel(AmbilWarnaDialog dialog){\n }", "public void onClick(DialogInterface dialog, int id) {\n dialog.cancel(); \n Toast.makeText(context,\"you choose no action for alertbox\", \n Toast.LENGTH_SHORT).show(); \n }", "private void mensajeErrorSinDatos() {\r\n\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n\tbuilder.setMessage(R.string.txtErrorSinDatos).setCancelable(false)\r\n\t\t.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\r\n\t\t public void onClick(DialogInterface dialog, int id) {\r\n\t\t\tListaRutasActivity.this.finish();\r\n\t\t }\r\n\t\t});\r\n\tAlertDialog alert = builder.create();\r\n\talert.show();\r\n }", "public static void noSupplierSelected(){\r\n\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\talert.setTitle(\"Error!\");\r\n\t\talert.setHeaderText(\"\");\r\n\t\talert.setContentText(\"Bitte wählen Sie einen Lieferanten aus!\");\r\n\t\talert.showAndWait();\r\n\t}", "private void alertBox(String title, String message) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"GPS Anda tampaknya dinonaktifkan, apakah Anda ingin mengaktifkannya?\")\n .setCancelable(false)\n .setTitle(\"STATUS GPS\")\n .setPositiveButton(\n \"YA\",\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n /* this gonna call class of settings then dialog interface disappeared */\n Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(intent);\n dialog.cancel();\n }\n }\n )\n .setNegativeButton(\"TIDAK\", new DialogInterface.OnClickListener() {\n public void onClick(final DialogInterface dialog, @SuppressWarnings(\"unused\") final int id) {\n dialog.cancel();\n }\n }\n );\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n }", "private void ShowRetrievedErrorPopupDialog(){\n ShowWhaitSpinner();\n //there is an error, show popup message\n Context context;\n AlertDialog.Builder builder = new AlertDialog.Builder(getContext());\n builder.setMessage(R.string.error_message_download_resources)\n .setCancelable(false)\n .setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n startActivity(new Intent(getContext(), MainActivity.class));\n }\n });\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n\n }", "private void notConnectedDialog() {\n final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(mContext);\n alertDialogBuilder.setTitle(mContext.getResources().getString(R.string.not_connected_title));\n alertDialogBuilder.setCancelable(false);\n alertDialogBuilder.setMessage(mContext.getResources().getString(R.string.not_connected_message));\n\n alertDialogBuilder.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface arg0, int arg1) {\n alertDialog.dismiss();\n finish();\n }\n });\n\n alertDialog = alertDialogBuilder.create();\n alertDialog.show();\n\n }", "private void alertDialog(int title, int message, int icon) {\n tst_Message.cancel();\n tst_Message = null;\n AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);\n builder.setTitle(title);\n builder.setMessage(message);\n builder.setIcon(icon);\n builder.setPositiveButton(R.string.dialog_pos_btn, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n reset();\n }\n });\n builder.show();\n }", "@Override\n public void onCancel(AmbilWarnaDialog dialog) {\n }", "@Override\n public void onCancel(AmbilWarnaDialog dialog) {\n }", "public static void alertbox_Reject() throws CheetahException {\n\t\ttry {\n\t\t\tAlert simpleAlert = CheetahEngine.getDriverInstance().switchTo().alert();\n\t\t\tsimpleAlert.dismiss();\n\t\t} catch (Exception e) {\n\t\t\tthrow new CheetahException(e);\n\t\t}\n\t}", "public void onClick(DialogInterface arg0, int arg1) {\n\t \t //Declare Object From Get Internet Connection Status For Check Internet Status\n\t \t System.exit(0);\n\t \t\t\t arg0.dismiss();\n\t \t\t\t \n\t }", "private void errorPopUp() {\n new AlertDialog.Builder(mActivity)\n .setTitle(\"Oops\")\n .setMessage(\"Please choose an emotional state or enter a date and time\")\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n //Go back without changing anything\n dialogInterface.dismiss();\n }\n })\n .create()\n .show();\n }", "public void checkAlert() {\n try {\n wait(1000);\n driver.switchTo().alert();\n driver.findElement(By.xpath(\"//*[@title='No, thanks']\")).click();\n } catch (Exception e) {\n // Do nothing\n }\n }", "AlertDialog getAlertDialog();", "private void MissPIBox(View v){\n\t\t//create an alert box with specified properties\n\t\tnew AlertDialog.Builder(this)\n\t\t.setTitle(\"Error\")\n\t\t.setMessage(\"Sorry, please enter the prescription information\")\n\t\t.setNeutralButton(\"ok\", null)\n \t.show();\n\t}", "private void showLoserDialog() {\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION, \"You Have Been Defeated \" + player1.getName() + \",Computer Wins!!\", new ButtonType(\"Close\", ButtonBar.ButtonData.NO), new ButtonType(\"Try Again?\", ButtonBar.ButtonData.YES));\n alert.setGraphic(new ImageView(new Image(this.getClass().getResourceAsStream(\"/Images/bronze.png\"))));\n alert.setHeaderText(null);\n alert.setTitle(\"Computer Wins\");\n alert.showAndWait();\n if (alert.getResult().getButtonData() == ButtonBar.ButtonData.YES) {\n onReset();\n }\n }", "public void showAlert2(){\n ImportingOCR.this.runOnUiThread(new Runnable() {\n public void run() {\n AlertDialog.Builder builder = new AlertDialog.Builder(ImportingOCR.this);\n builder.setTitle(\"Validating faild\");\n\n builder.setMessage(\"This check already exists in database please try another one.\")\n .setCancelable(false)\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n Intent intent = new Intent(ImportingOCR.this, ImportingOCR.class);\n intent.putExtra(\"personid\", personid);\n intent.putExtra(\"amount\", amount);\n intent.putExtra(\"date\", date);\n intent.putExtra(\"username\", uploader);\n startActivity(intent);\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n dialog.dismiss();\n return;\n }\n });\n }", "private Alert createWarningAlert() {\n Alert alert = new Alert(Alert.AlertType.WARNING, \"Are you sure, you wan't to Restart The Game?\", new ButtonType(\"Confirm\", ButtonBar.ButtonData.YES), new ButtonType(\"Cancel\", ButtonBar.ButtonData.NO));\n alert.setTitle(\"Confirm Deletion\");\n alert.setHeaderText(null);\n return alert;\n }", "public void alertDialogBasico() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n\r\n // 2. Encadenar varios métodos setter para ajustar las características del diálogo\r\n builder.setMessage(R.string.dialog_message);\r\n\r\n\r\n builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {\r\n public void onClick(DialogInterface dialog, int id) {\r\n\r\n }\r\n });\r\n\r\n\r\n builder.show();\r\n\r\n }", "@Override\n public void onFail(String arg0) {\n if (dialog_pay != null && dialog_pay.isShowing()) {\n dialog_pay.dismiss();\n }\n }", "private void notifyUiApiFailure() {\n\n if (stillAlive()) {\n\n AlertDialog.Builder alertDialog = new AlertDialog.Builder(getActivity());\n View convertView = getActivity().getLayoutInflater().inflate(R.layout.api_error_alert_title, null);\n alertDialog.setCustomTitle(convertView);\n\n alertDialog.setNegativeButton(\"OK\", new DialogInterface.OnClickListener() {\n\n @Override\n public void onClick(DialogInterface dialog, int id) {\n\n }\n });\n\n // Set the line color\n Dialog d = alertDialog.show();\n int dividerId = d.getContext().getResources().getIdentifier(\"android:id/titleDivider\", null, null);\n View divider = d.findViewById(dividerId);\n divider.setBackground(new ColorDrawable(Color.parseColor(\"#00274c\")));\n }\n }", "@SuppressWarnings(\"deprecation\")\n\t\tprivate void alertDialog(String msg) \n\t\t{\n\t\t\tAlertDialog alertDialog = new AlertDialog.Builder(LoginScreenActivity.this).create();\n\t alertDialog.setTitle(\"StyleZ\");\n\t alertDialog.setMessage(msg);\n\t alertDialog.setButton(\"OK\", new DialogInterface.OnClickListener() \n\t {\n\t public void onClick(DialogInterface dialog, int which) {\n\t \t\n\t // Write your code here to execute after dialog closed\n\t dialog.dismiss();\n\t \n\t if(strstatus.equals(\"success\"))\n\t {\n\t Intent i=new Intent(LoginScreenActivity.this,StyleZTab.class);\n\t startActivity(i);\n\t finish();\n\t }\n\t else\n\t {\n\t \t imgviewloginon.setVisibility(View.GONE);\n\t imgviewloginoff.setVisibility(View.VISIBLE);\n\t }\n\t }\n\t });\n\t alertDialog.show();\n\t\t}", "private void bannedAlert() {\n Alert alert = new Alert(Alert.AlertType.WARNING);\n alert.initOwner(_dialogStage);\n alert.setTitle(\"Account blocked\");\n alert.setHeaderText(\"Account blocked\");\n alert.setContentText(\"Your account has been blocked due\"\n + \" to too many incorrect login attempts. To \"\n + \"unblock your account, please contact an \"\n + \"administrator.\");\n\n alert.showAndWait();\n return;\n }", "private AlertDialog alertBuilder() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"Missing Arduino Unit, go to Settings?\").\n setCancelable(false).setPositiveButton(\n \"Yes\", new DialogInterface.OnClickListener() {\n\n public void onClick(DialogInterface dialog, int id) {\n //call qr scan intent\n Intent prefScreen = new Intent(TempMeasure.this, Preferences.class);\n startActivityForResult(prefScreen, 0);\n }\n }).setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n\n public void onClick(DialogInterface dialog, int id) {\n dialog.cancel();\n }\n });\n AlertDialog alert = builder.create();\n return alert;\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n Toast.makeText(MainActivity.this,\"Su registro se ha cancelado\", Toast.LENGTH_SHORT).show();\n }", "@Override\n\t\t\t\t\tpublic void onCancel(DialogInterface dialog) {\n\t\t\t\t\t}", "private void showAlert() {\n AlertDialog.Builder alert = new AlertDialog.Builder(this);\n alert.setMessage(\"Error al autenticar usuario\");\n alert.setPositiveButton(\"Aceptar\", null);\n AlertDialog pop = alert.create();\n alert.show();\n }", "private void confirmationAlert() {\n\t\tAlert confirm = new Alert( AlertType.CONFIRMATION, \"You Will Not Be Able To Change Your Name\\nAfter You Press 'OK'.\");\n\t\tconfirm.setHeaderText(\"Are You Sure?\");\n confirm.setTitle(\"Confirm Name\");\n confirm.showAndWait().ifPresent(response -> {\n if (response == ButtonType.OK) {\n \tbackground.remove( pointer );\n \tkeyStrokes = keyStrokes.replace(\" \", \"-\");\n\t\t\t\tinsertNewHiScore();\n\t\t\t\tnewHighScore = false;\n }\n });\n\t}", "public void onClick(DialogInterface arg0, int arg1) {\n// Toast.makeText(getApplicationContext(), \"User Is Not Wish To Exit\", Toast.LENGTH_SHORT).show();\n }", "public void onClick(DialogInterface arg0, int arg1) {\n// Toast.makeText(getApplicationContext(), \"User Is Not Wish To Exit\", Toast.LENGTH_SHORT).show();\n }", "private void showErrorDialogue() {\n\t\ttry {\n\t\t\tnew AlertDialog.Builder(mContext)\n\t\t\t\t\t.setTitle(\"Something unfortunate happened...\")\n\t\t\t\t\t.setMessage(\"Your device was not able to verify activation. Please check your internet connection and ensure you are using the latest version of the application.\")\n\t\t\t\t\t.setNeutralButton(\"Close\", new DialogInterface.OnClickListener() {\n\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.show();\n\t\t} catch (Exception e) {\n\t\t\t//not in main activity, not a problem\n\t\t\tLog.w(TAG, e.getMessage());\n\t\t}\n\t}", "@Override\n public void onCancel(DialogInterface dialog) {\n }", "private void alert(String title, String msg) {\n if (title.isEmpty() || msg.isEmpty()) {\n return;\n }\n if (isFinishing()) {\n return;\n }\n new AlertDialog.Builder(this).setTitle(title).setMessage(msg)\n .setIcon(android.R.drawable.ic_dialog_info)\n .setNeutralButton(R.string.ok, null).show();\n }", "public void show_message_no_data() {\n\t\tAlertDialog.Builder dialog=new AlertDialog.Builder(this);\n\t\t\n dialog.setTitle(\"Notice\");\n dialog.setMessage(\"No data for TI list\");\n \n dialog.setPositiveButton(\"OK\",new DialogListener(this, dialog, 0));\n \n dialog.create();\n dialog.show();\n\t\t\n\t}", "public void alertTypeHeritageIncorrect(){\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Error\");\n alert.setHeaderText(\"Debe elegir solo un tipo de herencia para poder continuar.\");\n alert.showAndWait();\n }", "private void showErrorAlert()\n {\n \tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n \tbuilder.setMessage(getResources().getString(R.string.app_error_str))\n \t .setCancelable(false)\n \t .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n \t public void onClick(DialogInterface dialog, int id) {\n \t dialog.cancel();\n \t }\n \t });\n \t \n \tAlertDialog alert = builder.create();\n \talert.show();\n }", "private void noConditionBox(View v){\n\t\tnew AlertDialog.Builder(this)\n\t\t.setTitle(\"Error\")\n\t\t.setMessage(\"Nurse have not given this patient a vitalsign\")\n\t\t.setNeutralButton(\"ok\", null)\n \t.show();\n\t}", "private void ExitApplication()\n\t{\n\t\t Builder alertbox = new AlertDialog.Builder(AppMenu.this);\n\t // set the message to display\n\t alertbox.setMessage(\"آیا می خواهید از برنامه خارج شوید ؟\");\n\t \n\t // set a negative/no button and create a listener\n\t alertbox.setPositiveButton(\"خیر\", new DialogInterface.OnClickListener() {\n\t // do something when the button is clicked\n\t public void onClick(DialogInterface arg0, int arg1) {\n\t arg0.dismiss();\n\t }\n\t });\n\t \n\t // set a positive/yes button and create a listener\n\t alertbox.setNegativeButton(\"بلی\", new DialogInterface.OnClickListener() {\n\t // do something when the button is clicked\n\t public void onClick(DialogInterface arg0, int arg1) {\n\t \t //Declare Object From Get Internet Connection Status For Check Internet Status\n\t \t System.exit(0);\n\t \t\t\t arg0.dismiss();\n\t \t\t\t \n\t }\n\t });\n\t \n\t alertbox.show();\n\t}", "@Override\n public void onFailure(Call<ResponseBody> call, Throwable t) {\n dialog.dismiss();\n\n }", "public void onClick(DialogInterface arg0, int arg1) {\n// Toast.makeText(getApplicationContext(), \"User Is Not Wish To Exit\", Toast.LENGTH_SHORT).show();\n\n }", "private void showErrorDialog(){\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n\n builder.setTitle(getString(R.string.booking_not_created));\n builder.setMessage(getString(R.string.customer_already_has_active_booking_error));\n builder.setIcon(R.drawable.ic_error_black_24dp);\n builder.setCancelable(false);\n // When users confirms dialog, close the activity\n builder.setPositiveButton(android.R.string.ok, (dialog, which) -> {\n // Close the Activity..\n finish();\n });\n\n AlertDialog dialog = builder.create();\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n\n // Change button colors\n Button positiveButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE);\n positiveButton.setTextColor(getColor(R.color.colorPrimary));\n }", "private void ShowNoInternetConnection(){\n StopWhaitSpinner();\n //There was an error show error message\n AlertDialog.Builder builder = new AlertDialog.Builder(getContext());\n builder.setMessage(R.string.recconnecting_request)\n .setCancelable(false)\n .setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n startActivity(new Intent(getContext(), MainActivity.class));\n }\n });\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n\n }", "@Override\n public void onFailure(retrofit2.Call<CommanResponsePojo> call, Throwable t) {\n pd.dismiss();\n Log.e(\"TAG\", t.toString());\n EmpowerApplication.alertdialog(t.getMessage(), CompoffActivity.this);\n\n\n }", "public void onClick(DialogInterface dialog, int id) {\n if(hideMissed==true) {\n OnMissedClicked();\n System.out.println(\"onMissedClicked....\"+1);\n }\n else{\n String alrt=MiraConstants.LANGUAGE.equals(MiraConstants.HINDI)?\" अलर्ट \":\"ALERT\";\n String msg=MiraConstants.LANGUAGE.equals(MiraConstants.HINDI)?\"अभी यह टीका छूटी हुई खुराक नहीं माना जा सकता\":\"Currently this vaccine cannot be considered as missed dose\";\n AlertDialog.Builder dialog12 = myAlertDialog(1,alrt,msg);\n dialog12.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n\n }\n });\n dialog12.show();\n\n// Toast.makeText(getApplicationContext(),\"You can't missed dose..\",Toast.LENGTH_SHORT).show();\n }\n }", "public static native void alert(String texto)/*-{\n\t\t\t\n\t\t\t$wnd.bootbox.alert(texto);\t\n\t\n\t\n\t}-*/;", "DialogResult show();", "private void incorrectDialog() {\n // Update score.\n updateScore(scoreDecrease);\n\n // Show Dialog.\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"TRUMPED! This Tweet is \" + (realTweet ? \"real\" : \"fake\"));\n //builder.setPositiveButton(\"OK\", (dialog, which) -> chooseRandomTweet());\n builder.setOnDismissListener(unused -> chooseRandomTweet());\n AlertDialog dialog = builder.create();\n dialog.show();\n }", "public static void noSupplierOrderSelected() {\r\n\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\talert.setTitle(\"Error!\");\r\n\t\talert.setHeaderText(\"\");\r\n\t\talert.setContentText(\"Bitte wählen Sie eine Bestellung aus!\");\r\n\t\talert.showAndWait();\r\n\t}", "public void noConnectivityAlert() {\n\t\tAlertDialog.Builder alert_box = new AlertDialog.Builder(this);\n\t\talert_box.setIcon(R.drawable.icon);\n\t\talert_box.setMessage(\"No network available, Please make sure you have Internet access to proceed.\");\n\t\talert_box.setPositiveButton(\"Quit\", new DialogInterface.OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\tfinish();\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t\talert_box.setNegativeButton(\"Retry\", new DialogInterface.OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\tif (!NetworkUtilities.isOnline(Sw_LoginScreenActivity.this)) {\n\t\t\t\t\tnoConnectivityAlert();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\talert_box.show();\n\t}", "private void showErrorDialog(int errorCode) {\n\t\t\n }", "private void showCheckDialog() {\n AlertDialog.Builder showAuditAlert = new AlertDialog.Builder(this); // Create Alert dialog\n showAuditAlert.setTitle(\"Total prize\"); // Set title\n showAuditAlert.setMessage(\"= \"+mydb.getResultDayAudit(year,month,day).intValue()+\"\"); // Set message\n\n showAuditAlert.setPositiveButton(\"Done\",\n new DialogInterface.OnClickListener()\n { // Can hear \"CLICK\"\n @Override\n public void onClick(DialogInterface dialog,int which)\n {\n \tdialog.dismiss(); // CLICK then disappear\n }\n }\n );\n showAuditAlert.show(); // Show dialog that created upper this line\n }", "private void dialogNoCamera() {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\tbuilder.setMessage(\"Your device has no cameras!\")\n\t\t\t\t.setCancelable(false)\n\t\t\t\t.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tAlertDialog alert = builder.create();\n\t\talert.show();\n\t}", "@Override\n public void onClick(View v) {\n builder.setMessage(R.string.alertMessage)\n .setCancelable(false)\n .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n //buClick();\n //finish();\n dialog.cancel();\n calculat();\n\n }\n })\n .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // Action for 'NO' Button\n dialog.cancel();\n\n }\n });\n //Creating dialog box\n AlertDialog alert = builder.create();\n //Setting the title manually\n alert.setTitle(R.string.alertTitle);\n alert.show();\n }", "public void Report_User_alert(){\n final AlertDialog.Builder alert=new AlertDialog.Builder(context,R.style.DialogStyle);\n alert.setTitle(\"Report\")\n .setMessage(\"Are you sure to Report this user?\")\n .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n dialog.dismiss();\n }\n })\n .setPositiveButton(\"yes\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n Send_report();\n }\n });\n\n alert.setCancelable(true);\n alert.show();\n }", "void dismissAlertDialog();", "void showAlert(String message);", "@Override\n public void onClick(DialogInterface dialog, int which){\n guardarUsr();\n }", "private void showConfirmClearDialog() {\n AlertDialog.Builder dialog = new AlertDialog.Builder(getActivity());\n dialog.setTitle(res.getString(R.string.dialog_clear_sale));\n dialog.setPositiveButton(res.getString(R.string.no), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n\n }\n });\n\n dialog.setNegativeButton(res.getString(R.string.clear), new DialogInterface.OnClickListener() {\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n register.cancleSale();\n update();\n }\n });\n\n dialog.show();\n }", "@Override\r\n\t\t\t\t\tpublic void onCancel(DialogInterface dialog) {\r\n\t\t\t\t\t}", "private void esegui() {\n /* variabili e costanti locali di lavoro */\n OperazioneMonitorabile operazione;\n\n try { // prova ad eseguire il codice\n\n /**\n * Lancia l'operazione di analisi dei dati in un thread asincrono\n * al termine il thread aggiorna i dati del dialogo\n */\n operazione = new OpAnalisi(this.getProgressBar());\n operazione.avvia();\n\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n }", "@Override\n\tpublic void onNoButtonDialogToConfirmDuiClicked() {\n\n\t}", "public void alertOfTypeIncorrect(){\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Error\");\n alert.setHeaderText(\"Solo los atributos compuestos pueden contener mas atributos.\");\n alert.showAndWait();\n }", "@Override\n\t\t\t\tpublic void confirm() {\n\t\t\t\t\tdialog.dismiss();\n\t\t\t\t}", "public void ClickCerrarSesion() {\n // Se redirige a la actividad de Editat Perfil\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Cerrar Sesion\");\n builder.setMessage(\"¿Estas seguro que quieres cerrar sesión?, Esto te devolvera a la pantalla de inicio\");\n // Boton para cerrar sesion\n builder.setPositiveButton(\"Cerrar Sesión\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n finish();\n }\n });\n builder.setNegativeButton(\"Cancelar\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n builder.show();\n }", "private void alertBox_service(final String title, final String msg) {\r\n\t\tAlertDialog.Builder service_alert = new AlertDialog.Builder(this);\r\n\t\tservice_alert.setTitle(title);\r\n\t\tif (msg.equalsIgnoreCase(\"Successfully Pre Authorized\")) {\r\n\t\t\tservice_alert\r\n\t\t\t.setMessage(\"The credit card information is securely saved\");\r\n\t\t} else {\r\n\t\t\tservice_alert.setMessage(msg);\r\n\t\t}\r\n\t\tservice_alert.setNeutralButton(\"OK\",new DialogInterface.OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\tif (msg.equals(\"Successfully Pre Authorized\")) {\r\n\t\t\t\t\tif (getIntent().getExtras().getString(\"class_name\").equalsIgnoreCase(\"ZouponsLogin\")|| getIntent().getExtras().getString(\"class_name\").equalsIgnoreCase(\"Registration\")) {\r\n\t\t\t\t\t\tstartActivity(new Intent(AddCreditCard.this,ShopperHomePage.class));\r\n\t\t\t\t\t} else if (getIntent().getExtras().getString(\"class_name\").equalsIgnoreCase(\"ManageWallets\")) {\r\n\t\t\t\t\t\tstartActivity(new Intent(AddCreditCard.this,ManageWallets.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK));\r\n\t\t\t\t\t} else if (getIntent().getExtras().getString(\"class_name\").equalsIgnoreCase(\"StoreOwner_Billing\")) {\r\n\t\t\t\t\t\tIntent intent_rightmenuBilling = new Intent(AddCreditCard.this,ManageWallets.class);\r\n\t\t\t\t\t\tintent_rightmenuBilling.putExtra(\"FromStoreOwnerBilling\", true);\r\n\t\t\t\t\t\tintent_rightmenuBilling.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\t\t\t\t\tstartActivity(intent_rightmenuBilling);\r\n\t\t\t\t\t} else if (getIntent().getExtras().getString(\"class_name\").equalsIgnoreCase(\"MobilePay\")) {\r\n\t\t\t\t\t\tsetResult(RESULT_OK); // to move control to step2 managecards on activity result\r\n\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t} else if (getIntent().getExtras().getString(\"class_name\").equalsIgnoreCase(\"StoreOwner_PointOfSale\")) {\r\n\t\t\t\t\t\tif (WebServiceStaticArrays.mFirstDataGlobalPaymentList.size() > 0) {\r\n\t\t\t\t\t\t\tFirstDataGlobalpayment_ClassVariables mFirstData_details = (FirstDataGlobalpayment_ClassVariables) WebServiceStaticArrays.mFirstDataGlobalPaymentList.get(0);\r\n\t\t\t\t\t\t\tIntent card_intent = new Intent();\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"user_id\", getIntent().getExtras().getString(\"user_id\"));\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"card_id\",\tmFirstData_details.mCardId);\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"card_name\",mNonZouponsMemberCardName);\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"card_masknumber\",\tmNonZouponsMemberCardMask);\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"card_expirymonth\", mNonZouponsMemberCardexpiryMonth);\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"card_expiryyear\",\tmNonZouponsMemberCardexpiryYear);\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"card_cvv\", mNonZouponsMemberCardCVV);\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"address\", \"\");\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"zipcode\",\tmNonZouponsMemberZipcode);\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"streetnumber\",mNonZouponsMemberStreetNumber);\r\n\t\t\t\t\t\t\tManageCardAddPin_ClassVariables.mEditCardFlag = \"false\";\r\n\t\t\t\t\t\t\tManageCardAddPin_ClassVariables.mAddPinFlag = \"true\";\r\n\t\t\t\t\t\t\tsetResult(RESULT_OK, card_intent); // to move control to step2 managecards on activity result or POS part2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdialog.dismiss();\r\n\t\t\t}\r\n\t\t});\r\n\t\tservice_alert.show();\r\n\t}", "void AlertaValidacion(String title, String message){\n AlertDialog.Builder builder = new AlertDialog.Builder(RegisterActivity.this);\n builder.setTitle(title);\n builder.setMessage(message).setPositiveButton(\"ACEPTAR\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n }", "private void showAlert(String status, String msg){\n android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(HostelRequestActivity.this)\n .setTitle(status)\n .setMessage(msg);\n builder.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n onBackPressed();\n }\n\n });\n //call api for insertion\n builder.setCancelable(false);\n android.app.AlertDialog alert = builder.create();\n alert.show();\n }", "private void alert(String title, String msj){\n android.app.AlertDialog.Builder alertDialog = new android.app.AlertDialog.Builder(getActivity());\n alertDialog.setTitle(title);\n alertDialog.setMessage(msj);\n alertDialog.setPositiveButton(getString(R.string.alert_accept), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n }\n });\n alertDialog.show();\n }", "public void graceFullyExit() {\n Log.e(\"NET\", \"No network.\");\n final AlertDialog.Builder myBuild = new AlertDialog.Builder(Start.this);\n myBuild.setTitle(R.string.noNetworkTitle);\n myBuild.setMessage(R.string.noNetworkText);\n myBuild.setNeutralButton(\"OK\", new DialogInterface.OnClickListener() {\n\n\n public void onClick(DialogInterface dialog, int which) {\n Log.i(\"Start\", \"Kommit hit\");\n finish();\n }\n });\n myBuild.show();\n }", "public void showWarningMessage(View view){\n\n //Show popup to warn user about the entered start and destiantion Addresses\n builder = new AlertDialog.Builder(this);\n //Setting message manually and performing action on button click\n builder.setMessage(\"Please insert a start and a destination address!\")\n .setCancelable(false)\n .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // finish();\n Toast.makeText(getApplicationContext(),\"you choose yes action for the warning popup\",\n Toast.LENGTH_SHORT).show();\n }\n });\n /* .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // Action for 'NO' Button\n dialog.cancel();\n Toast.makeText(getApplicationContext(),\"you choose no action for for the warning popup\",\n Toast.LENGTH_SHORT).show();\n }\n } );*/\n //Creating dialog box\n AlertDialog alert = builder.create();\n //Setting the title manually\n alert.setTitle(\"WARNING!\");\n alert.show();\n }", "@Override\n public void onFailure(@NonNull Exception e) {\n dialog.dismiss();\n //Display err toast msg\n Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onCancel(DialogInterface arg0) {\n\n }", "public void alertAlreadySolved() {\n\t\tthis.alert(\"ERROR\",\"Game already solved\",AlertType.WARNING);\n\t}", "@Override\n\t\tpublic void onCancel(DialogInterface dialog) {\n\t\t\t\n\t\t}", "private void show_Alert(String msg) {\n ((TextView) dialog.findViewById(R.id.tv_text)).setText(msg);\n dialog.findViewById(R.id.tv_ok).setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n dialog.dismiss();\n }\n });\n dialog.show();\n }", "private void AlertUserToReset() {\n Builder builder = new AlertDialog.Builder(this);\n View titleView = LayoutInflater.from(CheckResultActivity.this)\n .inflate(R.layout.custom_alert_dialog, null);\n TextView title = (TextView) titleView.findViewById(R.id.title);\n title.setText(getString(R.string.alert_restore_title));\n builder.setCustomTitle(titleView);\n builder.setMessage(getString(R.string.alert_restore_note));\n builder.setPositiveButton(R.string.alert_dialog_ok, null);\n builder.create().show();\n }", "private void showAlertSelectionFail(String title, String msg) {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(title);\n\n // Header Text: null\n alert.setHeaderText(null);\n alert.setContentText(msg);\n alert.showAndWait();\n }", "public void onClick(DialogInterface dialog, int whichButton) {\n String nada = null;\n callbackContext.error(\"cancelled\");\n }", "@Override\n public void onClick(View view) {\n dialog.dismiss();// ini method untuk menghilangkan alertdialog\n }", "public void ShowNoInternetDialog() {\r\n showAlertDialog(LoginUserActivity.this, getResources().getString(R.string.text_no_internet_connection),\r\n getResources().getString(R.string.text_please_check_your_network), false);\r\n }", "public void alertForOuitMessage() {\n final AlertDialog.Builder builder = new AlertDialog.Builder(context);\n final AlertDialog alert = builder.create();\n alert.getWindow().getAttributes().windowAnimations = R.style.alertAnimation;\n View view = alert.getLayoutInflater().inflate(R.layout.quiz_quit_alert, null);\n TextView title1 = (TextView) view.findViewById(R.id.title1);\n title1.setText(context.getString(R.string.quiz_quit_are));\n title1.setTypeface(VodafoneRg);\n TextView title2 = (TextView) view.findViewById(R.id.title2);\n title2.setText(context.getString(R.string.quiz_quit_progress));\n title2.setTypeface(VodafoneRg);\n TextView quiz_text = (TextView) view.findViewById(R.id.quit_text);\n quiz_text.setTypeface(VodafoneRg);\n LinearLayout quit_layout = (LinearLayout) view.findViewById(R.id.quit_layout);\n alert.setCustomTitle(view);\n TextView quit_icon = (TextView) view.findViewById(R.id.quit_icon);\n quit_icon.setTypeface(materialdesignicons_font);\n quit_icon.setText(Html.fromHtml(\"&#xf425;\"));\n quit_layout.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n alert.dismiss();\n finish();\n }\n });\n alert.show();\n }", "public static void mensagemRealizarCadastro() {\n\t\tJOptionPane.showMessageDialog(null, \"Favor clique em atualizar para re-listar e selecionar o novo item recem cadastrado.\", \"Informação\", JOptionPane.INFORMATION_MESSAGE, new ImageIcon(Toolkit.getDefaultToolkit().getImage(CadastroQuartos.class.getResource(\"/Imagens/Informacao32.png\"))));\n\t}", "@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\talert.dismiss();\n\t\t\t}", "private void PatientNoExist(View v) {\n\t\t//create an alert box with specified properties\n \tnew AlertDialog.Builder(this)\n \t.setTitle(\"Error\")\n \t.setMessage(\"Sorry, This Patient doesn't exist\")\n \t.setNeutralButton(\"ok\", null)\n \t.show();\n\t}", "private void AlertNoGps() {\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"El sistema GPS esta desactivado, ¿Desea activarlo?\")\n .setCancelable(false)\n .setPositiveButton(\"Si\", new DialogInterface.OnClickListener() {\n public void onClick(@SuppressWarnings(\"unused\") final DialogInterface dialog, @SuppressWarnings(\"unused\") final int id) {\n startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS));\n }\n })\n .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n public void onClick(final DialogInterface dialog, @SuppressWarnings(\"unused\") final int id) {\n dialog.cancel();\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n }", "public void noStorageAlert() {\n\t\tAlertDialog.Builder alert_box = new AlertDialog.Builder(this);\n\t\talert_box.setIcon(R.drawable.icon);\n\t\talert_box.setMessage(\"No SD Card found, Please insert SD Card to proceed.\");\n\t\talert_box.setPositiveButton(\"Quit\", new DialogInterface.OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\tfinish();\n\t\t\t}\n\t\t});\n\t\talert_box.setNegativeButton(\"Retry\", new DialogInterface.OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\tif (!hasStorage(true))\n\t\t\t\t\tnoStorageAlert();\n\t\t\t}\n\t\t});\n\t\talert_box.show();\n\t}", "private void MissHCNBox(View v){\n\t\t//create an alert box with specified properties\n\t\tnew AlertDialog.Builder(this)\n\t\t.setTitle(\"Error\")\n\t\t.setMessage(\"Sorry, please enter a health card number of a patient\")\n\t\t.setNeutralButton(\"ok\", null)\n \t.show();\n\t}", "@Override\n public void onCancel(DialogInterface dialog) {\n\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\t\t\t\tdialog.show();\n\t\t\t\t//alert.show();\n\t\t\t\t\n\t\t\t}", "public static void mensagemErroCadastrar() {\n\t\tJOptionPane.showMessageDialog(null, \"Erro ao cadastrar. Revise os dados inseridos.\", \"Erro\", JOptionPane.ERROR_MESSAGE, new ImageIcon(Toolkit.getDefaultToolkit().getImage(CadastroQuartos.class.getResource(\"/Imagens/Erro32.png\"))));\n\t}", "@Override\r\n\tpublic void beforeAlertDismiss(WebDriver arg0) {\n\t\t\r\n\t}", "public String isInConsistentAlert(String object, String data) {\n\t\tlogger.debug(\"Verify the Invalid Alert pop up \");\n\t\tboolean presentFlag = false;\n\t\ttry {\n\t\t\t//waitForPageLoad(driver);\n\t\t\tAlert alert = driver.switchTo().alert();\n\t\t\tif (!presentFlag) {\n\t\t\t\tlogger.debug(\"Alert detected\");\n\t\t\t\tThread.sleep(2000);\n\t\t\t\talert.accept();\n\t\t\t\t//browserSpecificPauseForAlert(object, data);\n\t\t\t\tpresentFlag = true;\n\t\t\t}\n\t\t\tif (presentFlag) {\t\n\t\t\t\treturn Constants.KEYWORD_PASS;\n\t\t\t} else {\n\t\t\t\treturn Constants.KEYWORD_PASS;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\n\t\t\treturn Constants.KEYWORD_PASS + \" -- Alert not detected\";\n\t\t}\n\t}" ]
[ "0.7551343", "0.7266427", "0.72159004", "0.7193351", "0.70633006", "0.69271916", "0.6916834", "0.6808792", "0.6764315", "0.67472255", "0.67276275", "0.6718254", "0.6692744", "0.66890574", "0.6680353", "0.6674604", "0.6674604", "0.6668384", "0.66662836", "0.6664979", "0.663816", "0.6629806", "0.66193885", "0.65870315", "0.65655714", "0.6545686", "0.65427417", "0.6527617", "0.65045434", "0.65034866", "0.6501003", "0.6491896", "0.6483524", "0.64745057", "0.6472073", "0.64702404", "0.6463534", "0.6463534", "0.646276", "0.6462647", "0.6457782", "0.64544874", "0.6453786", "0.6434655", "0.64341474", "0.6429926", "0.64277405", "0.6425396", "0.64165264", "0.6415061", "0.64148104", "0.641466", "0.64122", "0.6409343", "0.640374", "0.63941205", "0.6393649", "0.6392851", "0.63858545", "0.63830364", "0.63732505", "0.6364436", "0.63642716", "0.6344221", "0.6334725", "0.63214266", "0.63204813", "0.6316385", "0.63073504", "0.63064677", "0.6299834", "0.62976545", "0.6282288", "0.628095", "0.627911", "0.6276104", "0.6274077", "0.62573147", "0.62548816", "0.6254154", "0.62489045", "0.62471646", "0.6247127", "0.62442815", "0.6237337", "0.6237335", "0.62348133", "0.6234512", "0.6234394", "0.62317026", "0.6230697", "0.6230321", "0.6226928", "0.62265104", "0.62241113", "0.621839", "0.62143475", "0.6210184", "0.62097526", "0.6207578" ]
0.72442895
2
Metodo que saca el listado de libros
public void listado() { BuscarL.setText("Listado Libros"); listViewLibros.setVisibility(View.VISIBLE); editTextBuscar.setVisibility(View.INVISIBLE); btnBuscarL.setVisibility(View.INVISIBLE); textView2.setVisibility(View.INVISIBLE); texto.setVisibility(View.INVISIBLE); radioButtonTitulo.setVisibility(View.INVISIBLE); radioButtonAutor.setVisibility(View.INVISIBLE); radioButtonEditorial.setVisibility(View.INVISIBLE); Libro[] arr=new Libro[arrLibros.size()]; for(int i=0;i<arrLibros.size();i++) { arr[i]=arrLibros.get(i); } AdaptadorLibros adaptador = new AdaptadorLibros(BuscarLibro.this, arr); listViewLibros.setAdapter(adaptador); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void mostrarLibros() {\n\n\t\tlibros\n\t\t.stream()\n\t\t.forEach(System.out::println);\n//\t\t\n//\t\tfor (Libro l :libros) {\n//\t\t\tSystem.out.println(l);\n//\t\t}\n\t}", "public List<Libro> getListaDeLibros() {\r\n\t\treturn listaDeLibros;\r\n\t}", "private void mostrarLibros() {\n dlmLibros.clear();\n for (Libro libro : modelo.getLibros()) {\n dlmLibros.addElement(libro);\n }\n seleccionarLibrosOriginales();\n }", "public List<LibroVO> librosMasLeidos() {\n\t\tJDBCTemplate mysql = MysqlConnection.getConnection();\n\t\ttry {\n\t\t\tmysql.connect();\n\t\t\tLibroDAO OwlDAO = new LibroDAO();\n\t\t\tList<LibroVO> resultado = new ArrayList();\n\t\t\tresultado = OwlDAO.obtenerLibrosByVenta(mysql);\n\t\t\tif (resultado.isEmpty()) {\n\t\t\t\tmysql.disconnect();\n\t\t\t\treturn null;\n\n\t\t\t} else {\n\t\t\t\tmysql.disconnect();\n\t\t\t\treturn resultado;\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace(System.err);\n\t\t\treturn null;\n\t\t} finally {\n\t\t\tmysql.disconnect();\n\t\t}\n\t}", "@RequestMapping(value = \"/liburall\",method = RequestMethod.GET)\n\t public List<Libur> liburList(){\n\t return liburService.getAllLibur();\n\t }", "public interface DAOLibro {\n\t\n\t/**\n\t * Este metodo permite agregar un libro a la libreria\n\t * \n\t * @param libro el libro a agregar\n\t * @return true si se creo exitosamente, false sino\n\t */\n\tpublic boolean crea(Libro libro);\n\t\n\t/**\n\t * Este metodo busca un libro a partir de su nombre\n\t * \n\t * @param nombre el nombre del libro a buscar\n\t * @return una referencia al libro o null si no se encontro\n\t */\n\tpublic Libro recupera(String nombre);\n\t\n\t/**\n\t * Actualiza libro\n\t * \n\t * @param libro\n\t * @return true si se actualizo correctamente, false si no\n\t */\n\tpublic boolean actualiza(Libro libro);\n\n\t/**\n\t * Retira un libro de la libreria\n\t * \n\t * @param libro el libro a retirar\n\t * @return true si se retiro exitosamente, false sino\n\t */\n\tpublic boolean borra(Libro libro);\n\t\n\t/**\n\t * Regresa la lista de todos los libros\n\t * \n\t * @return un ArrayList con todos los libros de la libreria\n\t */\n\tpublic ArrayList<Libro> recuperaTodos();\n\n\n}", "public static void getLibrary(String user, UsoApi<ArrayList> needResult)\n {\n final String[] response = new String[1];\n final SyncHttpClient client = new SyncHttpClient();\n client.setTimeout(5000);\n\n\n String api = host + \"/library/\" + user;\n\n client.get(api,\n new TextHttpResponseHandler() {\n @Override\n public void onSuccess(int statusCode, Header[] headers, final String res) {\n response[0] = res;\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers, final String res, Throwable t) {\n response[0] = res;\n }\n }\n );\n\n ArrayList<BibliotecaTab.BiblioItem> items = new ArrayList<>();\n\n JsonArray listas = new JsonParser().parse(response[0]).getAsJsonObject().get(\"listas\").getAsJsonArray();\n BibliotecaTab.BiblioItem title1 = new BibliotecaTab.BiblioItem();\n title1.tipo = BibliotecaTab.BiblioItem.TITLE;\n title1.title = \"Tus listas de reproducción\";\n items.add(title1);\n\n if(listas.size() == 0)\n {\n BibliotecaTab.BiblioItem title3 = new BibliotecaTab.BiblioItem();\n title3.tipo = BibliotecaTab.BiblioItem.NOTHING;\n title3.title = \"No tienes ninguna lista de reproducción\";\n items.add(title3);\n }\n for(int i=0; i<listas.size(); i++) {\n BibliotecaTab.BiblioItem biblioItem = new BibliotecaTab.BiblioItem();\n biblioItem.tipo = BibliotecaTab.BiblioItem.PLAYLIST;\n Lista lista = new Lista(listas.get(i).getAsJsonObject());\n biblioItem.lista = lista;\n items.add(biblioItem);\n }\n\n JsonArray marchas = new JsonParser().parse(response[0]).getAsJsonObject().get(\"marchas\").getAsJsonArray();\n BibliotecaTab.BiblioItem title2 = new BibliotecaTab.BiblioItem();\n title2.tipo = BibliotecaTab.BiblioItem.TITLE;\n title2.title = \"Tus marchas más escuchadas\";\n items.add(title2);\n if(marchas.size() == 0)\n {\n BibliotecaTab.BiblioItem title3 = new BibliotecaTab.BiblioItem();\n title3.tipo = BibliotecaTab.BiblioItem.NOTHING;\n title3.title = \"Aún no has escuchado ninguna marcha :(\";\n items.add(title3);\n }\n for(int i=0; i<marchas.size(); i++) {\n BibliotecaTab.BiblioItem biblioItem = new BibliotecaTab.BiblioItem();\n biblioItem.tipo = BibliotecaTab.BiblioItem.SONG;\n Marcha marcha = new Marcha(marchas.get(i).getAsJsonObject());\n biblioItem.marcha = marcha;\n items.add(biblioItem);\n }\n\n needResult.result(items);\n }", "public void listar() {\n\t\t\n\t}", "private void mostrarLibro(Libro libro) {\n\t\tSystem.out.println(libro.getId()+\" - \"+libro.getTitulo()+\" - \"+libro.getAutor());\r\n\t}", "public List<LibroVO> librosPorCategoria(String cat) {\n\t\tJDBCTemplate mysql = MysqlConnection.getConnection();\n\t\ttry {\n\t\t\tmysql.connect();\n\t\t\tCategoriaDAO OwlDAO = new CategoriaDAO();\n\t\t\tList<LibroVO> resultado = new ArrayList();\n\t\t\tresultado = OwlDAO.obtenerLibrosInCategoria(cat, mysql, \"lecturas\");\n\t\t\tif (resultado.isEmpty()) {\n\t\t\t\tmysql.disconnect();\n\t\t\t\treturn null;\n\n\t\t\t} else {\n\t\t\t\tmysql.disconnect();\n\t\t\t\treturn resultado;\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace(System.err);\n\t\t\treturn null;\n\t\t} finally {\n\t\t\tmysql.disconnect();\n\t\t}\n\t}", "public BusquedaLibrosForManagedBean() {\r\n libros=new ArrayList<>();\r\n autores=new ArrayList<>();\r\n libro=new Libro(1, 500, \"Codigo limpio\", new Autor(\"Martin\", \"Robert\"));\r\n autores.add(libro.getAutor());\r\n libros.add(libro);\r\n libro=new Libro(2, 300, \"No me hagas pensar\", new Autor(\"Steve\", \"Krug\"));\r\n autores.add(libro.getAutor());\r\n libros.add(libro);\r\n libro=new Libro(3, 350, \"El libro negro del programador\", new Autor(\"Rafael\", \"Gomes\"));\r\n autores.add(libro.getAutor());\r\n libros.add(libro); \r\n libro=new Libro(4, 800, \"Romeo y Julieta\", new Autor(\"William\", \"Sheakespeare\"));\r\n autores.add(libro.getAutor());\r\n libros.add(libro); \r\n libro=new Libro(5, 700, \"Los hombres que no amaban a las mujeres\", new Autor(\"Larsson\", \"Stieg\"));\r\n autores.add(libro.getAutor());\r\n libros.add(libro);\r\n libro=new Libro();\r\n autor=new Autor();\r\n palabra = new String();\r\n dialogo = false;\r\n dialogo2 = false;\r\n }", "private int buscarLibro(String autor, String titulo) {\n\t\t// TODO Auto-generated method stub\n\t\tint esta = -1, contador = 0;\n\t\tif(numLibs != 0)\n\t\t\tfor(Libro libro : lb) {\n\t\t\t\tif( libro != null )\n\t\t\t\t\tif((libro.getAutor().equalsIgnoreCase(autor) && (libro.getTitulo().equalsIgnoreCase(titulo)))){\n\t\t\t\t\t\testa = contador;\n\t\t\t\t\t}\n\t\t\t\tcontador++;\n\t\t\t}\n\t\treturn esta;\n\t}", "public String getList_Base();", "private void cargarSitiosLibres() {\r\n\t\tList<ArrSitioPeriodo> listado = mngRes.sitiosLibresPorPeriodoGenero(periodo.getPrdId(),\r\n\t\t\t\tgetEstudiante().getMatGenero());\r\n\t\thashSitios = new HashMap<String, ArrSitioPeriodo>();\r\n\t\tsitiosLibres = new ArrayList<SelectItem>();\r\n\t\tif (listado != null && !listado.isEmpty()) {\r\n\t\t\tgetSitiosLibres().add(new SelectItem(0, \"Seleccionar\"));\r\n\t\t\tfor (ArrSitioPeriodo sitio : listado) {\r\n\t\t\t\tgetSitiosLibres().add(new SelectItem(sitio.getId().getArtId(), sitio.getSitNombre()));\r\n\t\t\t\thashSitios.put(sitio.getId().getArtId(), sitio);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public String toString() {\n return \"Libro{\" + \"idLibro=\" + idLibro + \", titulo=\" + titulo + \", autor=\" + autor + \", editorial=\" + editorial + \", isbn=\" + isbn + \", genero=\" + genero + \", cantidadTotal=\" + cantidadTotal + \", cantidadDisponible=\" + cantidadDisponible + \", descargable=\" + descargable + \", linkDescarga=\" + linkDescarga + \", bibliotecario=\" + bibliotecario + '}';\n }", "public ArrayList getLibrary() {\n return Library;\n }", "public void librosPorCategorian() {\n\t\tJDBCTemplate mysql = MysqlConnection.getConnection();\n\t\ttry {\n\t\t\tmysql.connect();\n\t\t\tCategoriaDAO OwlDAO = new CategoriaDAO();\n\t\t\tList<LibroVO> resultado = new ArrayList();\n\t\t\tOwlDAO.actualizarCategorian(mysql);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace(System.err);\n\n\t\t} finally {\n\t\t\tmysql.disconnect();\n\t\t}\n\t}", "public Library (){\r\n\t\tthis.inverntory = new List();\r\n\t}", "public void listarProducto() {\n }", "public Libreria() {\n\t\tnumLibs = 0;\n\t\tlb = new Libro[CAP_INICIAL];\n\t}", "public Libreria(String nombre)\n {\n libros = new ArrayList<>();\n this.nombre = nombre;\n\n }", "private ArrayList<String> getNuclideLibraryListFromLscMdb() {\n\t\tArrayList<String> alNuclideLibraryList = new ArrayList<String>();\n\t\ttry {\n\t\t\tString query = \"select Nuclide\"\n\t\t\t\t\t+ \" from NuclideLibraryNuclides where LibraryFile = ?;\";\n\t\t\tPreparedStatement ps = lscConnection.getInstance().getConnection()\n\t\t\t\t\t.prepareStatement(query);\n\t\t\tps.setString(1, nuclidesLibrary);\n\t\t\tps.execute();\n\t\t\tResultSet rs = ps.getResultSet();\n\t\t\tString nuclide;\n\t\t\twhile (rs.next()) {\n\t\t\t\tnuclide = rs.getString(\"Nuclide\");\n\t\t\t\talNuclideLibraryList.add(nuclide);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\tSystem.out.println(\"getNuclideLibraryList error\");\n\t\t}\n\t\treturn alNuclideLibraryList;\n\t}", "public Libro getLIBRO() {\r\n return LIBRO;\r\n }", "public void mostrarLbros(ArrayList<Libro> libros) {\n\t\tIterator<Libro> i=libros.iterator();\r\n\t\t\r\n\t\twhile(i.hasNext()){\r\n\t\t\tmostrarLibro(i.next());\r\n\t\t}\r\n\t\t\r\n\t}", "public ArrayList<Libro> recuperaTodos();", "public List getLibs() {\r\n\t\tList libs = (List) super.get(LIBS_FIELD_NAME);\r\n\t\tif (libs == null) {\r\n\t\t\tlibs = new JSONArray();\r\n\t\t\tsuper.put(LIBS_FIELD_NAME, libs);\r\n\t\t}\r\n\t\treturn libs;\r\n\t}", "public String getLibro() {\n return libro;\n }", "@Override\r\n\tpublic List<Libro> readAll() {\n\t\treturn libroRepository.findAll();\r\n\t}", "public LinkedList<clsCarro> listarCarros(){\n return modeloCarro.listarCarros();\n }", "public List<Mobibus> darMobibus();", "public List<ItemLivro> getListaLivros() {\n return itemLivroDAOBD.listar();\n }", "public void loadAllLists(){\n }", "private void loadLists() {\n }", "public Lectura(String libro) {\n this.libro = libro;\n }", "public void ouvrirListe(){\n\t\n}", "public static void recorrerColeccion(SortedSet<Libro> libros) {\n Iterator it = libros.iterator();\n while (it.hasNext()) {\n Libro x = (Libro) it.next();\n System.out.println(x.getTitulo());\n\n }\n }", "public List<Laboratorio> getLaboratorios() {\n if(this.intentoLab){\n this.lab=f.consultarLaboratorios();\n this.intentoLab=false;\n }\n return this.lab; \n }", "public static ArrayList<String> getLlistaNoms() throws IOException{\n return ctrl_Persistencia.llistaFitxers(\"@../../Dades\",\"llista\");\n }", "private void listViewPendentes(List<Compra> listAll) {\n\t\t\n\t}", "public ListaDependente() {\n initComponents();\n carregarTabela();\n }", "public abstract String getLibelle();", "private void cargarModelo() {\n dlmLibros = new DefaultListModel<>();\n listaLibros.setModel(dlmLibros);\n }", "@Override\r\n\tpublic String toString() {\r\n\t\treturn \"Libro [paginas=\" + paginas + \", titulo=\" + titulo + \"]\";\r\n\t}", "public Libro(String autorLibro, String tituloLibro, int numeroDePaginas, \n boolean esLibroDeTextoONo)\n {\n autor = autorLibro;\n titulo = tituloLibro;\n numeroPaginas = numeroDePaginas;\n numeroReferencia = \"\";\n vecesPrestado = 0;\n esLibroDeTexto = esLibroDeTextoONo;\n }", "public List<Robot> getRobots();", "public List<Integer> getAllLocos(LocoDataFois unlocos) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tSystem.out.println(\"getuncleasedlocos\");\n\t\t\tList<Integer> locos= new ArrayList<>();\n\t\t\tString shedid = unlocos.getLoco_Owningshed();\n//\t\t\tString traccode= unlocos.getLoco_Tractioncode();\n\t\t\tSystem.out.println(\"service\"+shedid);\n\t\t\tobj_uncleansedrepo.getLocono(shedid).forEach(locos::add);\n\t\t\tif(locos.isEmpty()) {\n\t\t\treturn locos ;\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"data\" +locos);\n\t\t\treturn locos;\n\t\t\n\t\n\t}", "@Override\n public Retorno_MsgObj obtenerLista() {\n PerManejador perManager = new PerManejador();\n\n return perManager.obtenerLista(\"Curso.findAll\", null);\n }", "List<ParqueaderoEntidad> listar();", "@Override\n public List listar() {\n return instalaciones.getAll();\n }", "public ListaArquivos() {\n initComponents();\n setShowNavigation(false);\n }", "public Integer getIdLibro() {\n return idLibro;\n }", "public ArrayList<Book> getListBook();", "private static void alta(ArrayList<Libro> catalogo) {\n\t\tString datosLibro = obtenerDatosLibro();\n\t\t// titulo:isbn:genero:autor:paginas\n\t\t// Procesar la entrada\n\t\tLibro libro = procesaEntrada(datosLibro);\n\t\t// Crear el libro con los datos de la entrada\n\t\tcatalogo.add(libro);\n\t\t// Meter el libro en el catalogo\n\t}", "public List getJalLibraryPlates(JalLibraryPlate jalLibraryPlate);", "@Override\n\tpublic List<Libro> readAll() {\n\t\treturn libroDao.readAll();\n\t}", "public Nodo(datos libro)\n {\n this.libro=libro;//LA VARIABLE LIBRO TENDRA LOS DATOS DE LA CLASE LIBRO\n }", "public ArrayList<DataUsuario> listarUsaurios();", "public int getIdLibro()\n {\n return id;\n }", "public abstract List<UIReader> getReaderList();", "public String getLibelle() {\n return libelle;\n }", "Object getTolist();", "@Override\n\tpublic ArrayList<MODEL.Medicamento> getlista() {\n\t\treturn null;\n\t}", "List<Curso> obtenerCursos();", "public void llenadoDeCombos() {\n PerfilDAO asignaciondao = new PerfilDAO();\n List<Perfil> asignacion = asignaciondao.listar();\n cbox_perfiles.addItem(\"\");\n for (int i = 0; i < asignacion.size(); i++) {\n cbox_perfiles.addItem(Integer.toString(asignacion.get(i).getPk_id_perfil()));\n }\n \n }", "@Override\n\tpublic List<Marca> listaporitem() {\n\t\treturn marcadao.listaporitem();\n\t}", "public String getLibelle() {\n\t\treturn getTo(true).getLibelle();\n\t}", "public boolean buscarLibro(String codigoLibro){\n libro = manejadorArchivoLibro.leerArchivo(LIBRO, codigoLibro, \".lib\");\n return libro != null;\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 abstract ArrayList<ImportExportPair> getConfiguracion();", "public List<Produto> buscarProdutos(){\n return new ArrayList<>();\n }", "public ArrayList<Book> getListBooklanguage(String laguage);", "List<Vehiculo>listar();", "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 }", "void setLibroCollection(Collection<Libro> libroCollection);", "public void printLibrary() {\n System.out.println(\"\\nLIBRARY OWNER: \" + ownerName); //uses the name that the user specified for owner name\r\n System.out.println(\"\\nSONGS IN LIBRARY: \" );\r\n this.home.printSongs(); //lists all of the songs that were added by the user, including demo songs\r\n this.playlists.forEach((name, playlist) -> { // each playlist is listed after one another\r\n System.out.println(\"\\nPLAYLIST NAME: \" + playlist.getName()); //states name of playlist based on user input\r\n System.out.println(\"PLAYLIST DESCRIPTION: \" + playlist.getDescription()); //states name of description of playlist based on user input\r\n playlist.printSongs();\r\n });\r\n\r\n\r\n\r\n }", "private static List getPackages(Context param0) {\n }", "List<TipoHuella> listarTipoHuellas();", "public ArrayList<DataProducto> listarProductos(String nickName);", "private void ImportLibrary(){\n for(int i = 0; i < refact.size(); i++){\n if(refact.get(i).contains(\"import\")){\n for(String library : libraries){\n refact.add(i, library + \"\\r\");\n }\n break;\n }\n }\n\n\n }", "protected List<Object> getModules() {\n return new ArrayList<>();\n }", "public String getLibelle() {\n\t\treturn _libelle;\n\t}", "public ListaResponse<G> listar();", "public ArrayList<String> listarProgramas();", "public ArrayList getOrdenCartas();", "Library(){\n library = new ArrayList<>();\n shoppingCart = new ArrayList<>();\n }", "public static <T> void queryAll() {\n\t\tString sql = \"SELECT * FROM LIBRARY ORDER BY BID \";\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tClass<T> clazz = (Class<T>) Lib.class;\n\t\tSystem.out.println(\"All books info is displayed below: \");\n\t\ttry {\n\t\t\tList<T> eleList = dao.queryData(sql, clazz);\n\t\t\tfor (T ele : eleList) {\n\t\t\t\tSystem.out.println(\"\\t\"+ele);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public java.lang.String getLibelle(){\r\n return this.libelle;\r\n }", "public static ArrayList<LivroModel> buscarLivros(int utilizador){\n\n return null;\n }", "public ListaPracownikow() {\n generujPracownikow();\n //dodajPracownika();\n }", "public interface IRKatalog {\n public List<Modulkatalog> getAlleKataloge();\n}", "public int nbLibres() {\n\t\tint libre = 0;\n\t\tfor(Borne b : bornes) {\n\t\t\tlibre += b.getEtatBorne();\n\t\t}\n\t\treturn libre;\n\t}", "List<DocumentationItem> documentation();", "@SuppressWarnings(\"unchecked\")\r\n\t\r\n\tpublic List<ParadaUtil> listar() {\n\t\tiniciarTransacao();\r\n\t\tCriteria c = s.createCriteria(ParadaUtil.class);\r\n\t\tc.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);\r\n\t\treturn c.list();\r\n\t}", "public List<String> verCarrito(){\n\t\treturn this.compras;\n\t}", "public void listarDocDaDisciplina(){\r\n for(int i=0;i<docentes.size();i++){\r\n System.out.println(docentes.get(i).toString());\r\n }\r\n }", "public String getNombreLibro()\n {\n return nombre;\n }", "private void initList(CartInfo ci) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "@Override\n public String toString() {\n return \"Id del Libro: \"+id+\" Nombre del Libro: \"+nombre+\" Disponibilidad: \"+disponibilidad;\n }", "public static String buscarTodosLosLibros() throws Exception{ //BUSCARtODOS no lleva argumentos\r\n //primero: nos conectamos a oracle con la clase conxion\r\n \r\n Connection con=Conexion.conectarse(\"system\",\"system\");\r\n //segundo: generamos un statemenr de sql con la conexion anterior\r\n Statement st=con.createStatement();\r\n //3: llevamos a cabo la consulta select \r\n ResultSet res=st.executeQuery(\"select * from persona\"); //reset arreglo enmutado de java estructura de datos\r\n System.out.println(\"depues del select\");\r\n int indice=0;\r\n ArrayList<persona> personas=new ArrayList<persona>();\r\n while(res.next()){ //del primero hasta el ultimo prod que vea SI PONGO SECUENCIA NO ENTRA AL WHILE\r\n Integer id= res.getInt(1); \r\n String nombre=res.getString(2);\r\n String empresa=res.getString(3);\r\n Integer edad=res.getInt(4);\r\n String telefono=res.getString(5);\r\n \r\n ///llenamos el arrayList en cada vuelta\r\n personas.add(new persona(id,nombre,empresa,edad,telefono));\r\n \r\n System.out.println(\"estoy en el array list despues del select\");\r\n }\r\n \r\n //el paso final, transformamos a objeto json con jackson\r\n ObjectMapper maper=new ObjectMapper(); //mapeo a objeto jackson\r\n \r\n st.close();\r\n con.close();\r\n System.out.println(\"convirtiendo el json\");\r\n return maper.writeValueAsString(personas);\r\n \r\n }", "public List getList();" ]
[ "0.6860528", "0.68424326", "0.6840964", "0.6583", "0.65681607", "0.6338242", "0.6283941", "0.623596", "0.62111354", "0.6208862", "0.6084942", "0.6055461", "0.6007239", "0.60071796", "0.6005336", "0.6003816", "0.59848887", "0.59741664", "0.59612846", "0.59577304", "0.5944306", "0.59234214", "0.5918027", "0.5893203", "0.5869339", "0.58538735", "0.58228624", "0.5789323", "0.57638144", "0.575719", "0.57464033", "0.57425237", "0.57359105", "0.57351315", "0.57285607", "0.5705512", "0.5704767", "0.56918836", "0.5677954", "0.56775415", "0.5676585", "0.56756175", "0.56615716", "0.5659421", "0.56345683", "0.5630334", "0.5619992", "0.5619672", "0.5610926", "0.55973", "0.55635273", "0.5559087", "0.5558967", "0.5547918", "0.55424833", "0.5539836", "0.5529592", "0.549146", "0.5491051", "0.5473033", "0.5470512", "0.5468478", "0.5467402", "0.54645467", "0.5462668", "0.5458", "0.54569846", "0.54561245", "0.544162", "0.544041", "0.5440199", "0.543719", "0.54205483", "0.5419814", "0.5419592", "0.5412812", "0.54036206", "0.54006714", "0.53903544", "0.5387123", "0.5384947", "0.5384067", "0.5376729", "0.53764373", "0.53736943", "0.53717643", "0.53526086", "0.534935", "0.5345582", "0.534245", "0.5342358", "0.5341597", "0.53342414", "0.53341776", "0.5321441", "0.53209627", "0.53138906", "0.53113055", "0.53087527", "0.5303994" ]
0.5670758
42
Constructs new VDC Request
public VDCRequest() { this.listVirVM = new HashMap<>(); this.listVirLink = new LinkedList<>(); // this.listVirSwitch = new LinkedList<>(); this.numVM = 0; this.vdcID = 0; this.bwrequest = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public VDCRequest(Map<Integer, VirtualMachine> listVM, LinkedList<VirtualLink> listVLink, double startTime,\n\t\t\tdouble lifeTime, int vdcID) {\n\t\tthis.listVirVM = listVM;\n\t\tthis.listVirLink = listVLink;\n\t\t// this.listVirSwitch = listVSwitch;\n\t\tthis.startTime = startTime;\n\t\tthis.lifeTime = lifeTime;\n\t\tthis.vdcID = vdcID;\n\t}", "protected DiameterClientRequest newRequest(ChargingConstants.CcRecordType type) {\n\t\tlong accountingRecordNumber = getRecordNumber();\n\t\tDiameterClientRequest request = _client.newAuthRequest(ChargingConstants.COMMAND_CC, true);\n\n\t\tDiameterAVP avp = new DiameterAVP(ChargingUtils.getCcRequestTypeAVP());\n\t\tavp.setValue(EnumeratedFormat.toEnumerated(type.getValue()), false);\n\t\trequest.addDiameterAVP(avp);\n\n\t\tavp = new DiameterAVP(ChargingUtils.getCcRequestNumberAVP());\n\t\tavp.setValue(Unsigned32Format.toUnsigned32(accountingRecordNumber), false);\n\t\trequest.addDiameterAVP(avp);\n\n\t\treturn request;\n\t}", "public CalccustoRequest()\r\n\t{\r\n\t}", "public TestBSSVRequest() {\r\n }", "public CalccustoRequest(UserContext userContext)\r\n\t{\r\n\t\tsuper(userContext);\r\n\t}", "public CalccustoRequest(UserContext userContext, Tenant tenant)\r\n\t{\r\n\t\tsuper(userContext, tenant);\r\n\t}", "private void initRequest()\n\t{\n\t\tthis.request = new RestClientReportRequest();\n\t\tRequestHelper.copyConfigsToRequest(this.getConfigs(), this.request);\n\t\tRequestHelper.copyParamsToRequest(this.getParams(), this.request);\n\t\t\n\t\tthis.performQuery();\n\t}", "public com.vodafone.global.er.decoupling.binding.request.GetVersionRequest createGetVersionRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.GetVersionRequestImpl();\n }", "private final static HttpRequest createRequest() {\r\n\r\n HttpRequest req = new BasicHttpRequest\r\n (\"GET\", \"/\", HttpVersion.HTTP_1_1);\r\n //(\"OPTIONS\", \"*\", HttpVersion.HTTP_1_1);\r\n\r\n return req;\r\n }", "public VehicleSearchRequest createSearchVechicle() {\r\n\r\n\t\tVehicleSearchRequest searchRequest = new VehicleSearchRequest();\r\n\r\n\t\tif (StringUtils.isBlank(searchLocation)) {\r\n\t\t\tsearchRequest.setLocation(DefaultValues.LOCATION_DEFAULT.getDef());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setLocation(searchLocation);\r\n\t\t}\r\n\r\n\t\tif (StringUtils.isBlank(searchVehicleType)) {\r\n\t\t\tsearchRequest.setVehicleType(VehicleType.getEnum(DefaultValues.VEHICLE_TYPE_DEFAULT.getDef()));\r\n\t\t} else {\r\n\t\t\tsearchRequest.setVehicleType(VehicleType.getEnum(searchVehicleType));\r\n\t\t}\r\n\r\n\t\tif (StringUtils.isBlank(searchFin)) {\r\n\t\t\tsearchRequest.setFin(DefaultValues.FIN_DEFAULT.getDef());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setFin(searchFin);\r\n\t\t}\r\n\r\n\t\tif (StringUtils.isBlank(searchModel)) {\r\n\t\t\tsearchRequest.setModel(DefaultValues.MODEL_DEFAULT.getDef());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setModel(searchModel);\r\n\t\t}\r\n\r\n\t\tif (StringUtils.isBlank(searchFuelType)) {\r\n\t\t\tsearchRequest.setFuelType(FuelType.DEFAULT);\r\n\t\t} else {\r\n\t\t\tsearchRequest.setFuelType(FuelType.getEnum(searchFuelType));\r\n\t\t}\r\n\r\n\t\tif (searchMaxCapacity == 0) {\r\n\t\t\tsearchRequest.setMaxCapacity(DefaultValues.MAX_CAPACITY_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMaxCapacity(searchMaxCapacity);\r\n\t\t}\r\n\r\n\t\tif (searchMinCapacity == 0) {\r\n\t\t\tsearchRequest.setMinCapacity(DefaultValues.MIN_CAPACITY_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMinCapacity(searchMinCapacity);\r\n\t\t}\r\n\r\n\t\tif (searchMinYear == 0) {\r\n\t\t\tsearchRequest.setMinYear(DefaultValues.MIN_YEAR_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMinYear(searchMinYear);\r\n\t\t}\r\n\r\n\t\tif (searchMaxYear == 0) {\r\n\t\t\tsearchRequest.setMaxYear(DefaultValues.MAX_YEAR_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMaxYear(searchMaxYear);\r\n\t\t}\r\n\r\n\t\tif (searchMaxPrice == 0) {\r\n\t\t\tsearchRequest.setMaxPrice(DefaultValues.MAX_PRICE_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMaxPrice(searchMaxPrice);\r\n\t\t}\r\n\r\n\t\tif (searchMinPrice == 0) {\r\n\t\t\tsearchRequest.setMinPrice(DefaultValues.MIN_PRICE_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMinPrice(searchMinPrice);\r\n\t\t}\r\n\t\treturn searchRequest;\r\n\t}", "public GetVideoRequest(UUID requestUUID, Video video) {\n super(requestUUID, video.getVidUrl());\n this.video = video;\n getVideoRequestCount += 1;\n }", "Request _create_request(Context ctx,\n String operation,\n NVList arg_list,\n NamedValue result);", "public void build() {\n\t\t\tRequest request = new Request();\n request.context = context;\n\t\t\trequest.requestType = requestType;\n\t\t\trequest.url = url;\n\t\t\trequest.envelope = envelope;\n\t\t\trequest.headers = headers;\n\n\t\t\trequest.responseListener = responseListener;\n\t\t\trequest.onValidateResponseListener = validateResponseListener;\n\n\t\t\trequest.isDebug = isDebug;\n\n\t\t\trequest.start();\n\t\t}", "public com.vodafone.global.er.decoupling.binding.request.ErVersionInfoRequest createErVersionInfoRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.ErVersionInfoRequestImpl();\n }", "public TboFlightSearchRequest() {\n}", "private CreateCatalogRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "Request _create_request(Context ctx,\n String operation,\n NVList arg_list,\n NamedValue result,\n ExceptionList exclist,\n ContextList ctxlist);", "private Request() {\n initFields();\n }", "public UBERequest() {\r\n }", "public static WPSGetCapabilities create( String id, String request )\n throws InvalidParameterValueException, MissingParameterValueException {\n Map<String, String> map = KVP2Map.toMap( request );\n map.put( \"ID\", id );\n return create( map );\n }", "public Request(){\n\t\tthis(null, null, null);\n\t}", "public RPCRequest()\n\t{\n\t\tsuper();\n\t}", "public Request _create_request(Context ctx,\n String operation,\n NVList arg_list,\n NamedValue result) {\n throw new NO_IMPLEMENT(reason);\n }", "public UdrImpl(DiameterClientRequest request, Version version) {\n\t\tsuper(request, version);\n\t}", "public DeviceDataRequestCommand()\n {\n }", "public SystemCommandRequest()\r\n\t{\r\n\t}", "public com.vodafone.global.er.decoupling.binding.request.GetServiceRequest createGetServiceRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.GetServiceRequestImpl();\n }", "public DCAEServiceObject(String serviceId, DCAEServiceRequest request) {\n DateTime now = DateTime.now(DateTimeZone.UTC);\n this.setServiceId(serviceId);\n this.setTypeId(request.getTypeId());\n this.setVnfId(request.getVnfId());\n this.setVnfType(request.getVnfType());\n this.setVnfLocation(request.getVnfLocation());\n this.setDeploymentRef(request.getDeploymentRef());\n this.setCreated(now);\n this.setModified(now);\n // Assumption here is that you are here from the PUT which means that the service is RUNNING.\n this.setStatus(DCAEServiceStatus.RUNNING);\n }", "Graph callConstructQuery(String name, Map<String, String> params);", "public Request _create_request(Context ctx,\n String operation,\n NVList arg_list,\n NamedValue result,\n ExceptionList exceptions,\n ContextList contexts) {\n throw new NO_IMPLEMENT(reason);\n }", "public Request() {\n }", "public Request() {\n\n }", "public ServiceRequest() {\n super();\n this.addNamespaceToRequest = true;\n }", "private Request() {}", "private Request() {}", "public Request() {\n this.setRequestId(newRequestId());\n this.setRequestValue(0.0);\n this.date = new Date();\n }", "private CalRequest(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "public RequestMessage() {\r\n\t\tsuper();\r\n\t\tthis.criteria = new PersonSearchCriteria();\r\n\t\tthis.setSourceSystemID(SOURCE_SYSTEM_ID);\r\n\t\tthis.setSourceUserID(SOURCE_USER_ID);\r\n\t}", "public static Request constructRequest(VirtualControlLoopEvent onset, ControlLoopOperation operation, Policy policy,\n String targetVnf) {\n /*\n * Construct an APPC request\n */\n Request request = new Request();\n request.setCommonHeader(new CommonHeader());\n request.getCommonHeader().setRequestId(onset.getRequestId());\n request.getCommonHeader().setSubRequestId(operation.getSubRequestId());\n request.setAction(policy.getRecipe().substring(0, 1).toUpperCase() + policy.getRecipe().substring(1));\n\n // convert policy payload strings to objects\n if (policy.getPayload() == null) {\n logger.info(\"no APPC payload specified for policy {}\", policy.getName());\n } else {\n convertPayload(policy.getPayload(), request.getPayload());\n }\n\n // add/replace specific values\n request.getPayload().put(\"generic-vnf.vnf-id\", targetVnf);\n\n /*\n * Return the request\n */\n\n return request;\n }", "public void subscribeToCovRequest() {\n try {\n DeviceService.localDevice.send(bacnetDevice, new SubscribeCOVRequest(new UnsignedInteger(1), getObjectIdentifier(), Boolean.TRUE, new UnsignedInteger(0))).get();\n LOG.info(\"Subscription @: '\" + getObjectIdentifier() + \"' on: \" + bacnetDevice.getObjectIdentifier());\n } catch (BACnetException e) {\n LOG.warn(\"Can't subscribe : '\" + getObjectIdentifier() + \"' on: \" + bacnetDevice.getObjectIdentifier());\n }\n\n }", "private GRPCRequest(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n }", "private DGRequest(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "public static int buildSlice(AcceptedReq acceptedReq, HashMap<String, VM> allocVmMapForReq, HashMap<String, VSw> rsvdVSwIdToObjMap, HashMap<String, Datapath> datapathIdToObjMap, String controller_url){\n\n\t\tint threadSleepTime = 0;\n\t\t\n\t\t\n\t\t\n\t\tString reqUri = acceptedReq.getReqUri();\n\t\t\n\t\t//String fvReqMethod = \"get-config\";\n\t\t//String fvReqJsonString = new JsonObject().add(\"id\",99).add(\"method\", \"get-config\").add(\"params\", new JsonObject()).add(\"jsonrpc\", \"2.0\").toString();\n\t\tSystem.out.println(\"\\nAdding slice for Request \"+reqUri);\n\t\t//Multimap<String, String> hostedVmUris = getHostedVmUris(allocVmMapForReq);\n\t\tMap<String, String> hostedOvsUris = getHostedOvsUris(rsvdVSwIdToObjMap, datapathIdToObjMap);\n\n\t\tSystem.out.println(\"Allocated VMs = \"+allocVmMapForReq.size());\n\t\tfor(String allocVmUri : allocVmMapForReq.keySet()){\n\t\t\tVM allocVmObj = allocVmMapForReq.get(allocVmUri);\n\t\t\tSystem.out.println(\"\\nresourceUri \\t = \"+allocVmObj.getResourceURI());\n\t\t\tSystem.out.println(\"resourceLocation \\t = \"+allocVmObj.getResLocation());\n\t\t\tSystem.out.println(\"intfs.macAddress \\t = \"+allocVmObj.getIntfsObjArray()[0].getMacAddress());\n\t\t\tSystem.out.println(\"target VLAN-id \\t = \"+acceptedReq.getTargetVlan());\n\t\t\t\n\t\t}\n\n\t\tif(BUILD_SLICE_DBG)\n\t\t\tfor(String rsvdVSwId : acceptedReq.getRsvdVsResList()){\n\t\t\t\tVSw vSwObj = rsvdVSwIdToObjMap.get(rsvdVSwId);\n\t\t\t\tPrintContainerValues.printVSwObj(vSwObj);\n\t\n\t\t\t}\n\t\t\t// TODO: Edit this to print only location Datapath info \n\t\tif(BUILD_SLICE_DBG)\n\t\t\tfor(String datapathUri : datapathIdToObjMap.keySet()){\n\t\t\t\tDatapath datapathObj = datapathIdToObjMap.get(datapathUri);\n\t\t\t\tPrintContainerValues.printDatapathObj(datapathObj);\n\t\n\t\t\t}\n\t\t\n\t\t//if(BUILD_SLICE_DBG)\n\t\tSystem.out.println(\"\\nhostedOvsUris.size() = \"+hostedOvsUris.size());\n\t\t\tfor(String hostUri : hostedOvsUris.keySet())\n\t\t\t\tSystem.out.println(\"\\t Host = \"+hostUri+\"\\t Ovs = \"+hostedOvsUris.get(hostUri));\n\t\t\n\t\t\n\n\t\t// Creating one flowvisor slice for each request\n\t\tJsonObject addSliceParamObj = new JsonObject();\n\t\taddSliceParamObj.add(\"slice-name\", reqUri).add(\"controller-url\", controller_url).add(\"admin-contact\", \"[email protected]\").add(\"password\", \"\");\n\t\tJsonObject addSliceJsonReq= new JsonObject();\n\t\taddSliceJsonReq.add(\"id\",1).add(\"method\", \"add-slice\").add(\"params\", addSliceParamObj).add(\"jsonrpc\", \"2.0\");\n\t\tSystem.out.println(addSliceJsonReq.toString());\n\t\t// Commit slice creation by making flowvisor request\n\t\tif(COMMIT_DEPLOYMENT)makeFvRequest(\"add-slice\", addSliceJsonReq.toString());\n\t\telse PrintContainerValues.prettyPrintJSONAsString(addSliceJsonReq.toString());\n\t\t\n\t\t// $ curl -k -d '{\"id\":1,\"method\":\"add-slice\",\"params\":{\"slice-name\":\"REQ-0\",\"controller-url\":\"tcp:192.168.0.203:6633\",\"admin-contact\":\"[email protected]\",\"password\":\"\"},\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.200:8081\n\t\t// Creating flowspace array\n\t\t//JsonArray addFlowspaceArray = new JsonArray();\n\t\t\n\t\tSystem.out.println(\"acceptedReq.getAlocVsResList().size() = \"+acceptedReq.getRsvdVsResList().size());\n\t\tfor (String rsvdVsResId : acceptedReq.getRsvdVsResList()){\n\t\t\tString virtualizedSwUri = rsvdVSwIdToObjMap.get(rsvdVsResId).getLocation();\n\t\t\tDatapath virtualizedSwObj = datapathIdToObjMap.get(virtualizedSwUri);\n\t\t\tString ovsMacAddress = virtualizedSwObj.getDpid();\n\t\t\tSystem.out.println(\"\\t virtualizedSwUri = \"+virtualizedSwUri+\"\\t Location = \"+virtualizedSwObj.getResLocation());\n\t\t\t\n\t\t\tif(COMMIT_DEPLOYMENT)\n\t\t\ttry {\n\t\t\t\tThread.sleep(2000);\n\t\t\t\tthreadSleepTime += 2000;\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t// Creating flowspace array\n\t\t\tJsonArray addFlowspaceArray = new JsonArray();\n\t\t\t// $ fvctl -f /dev/null add-flowspace all-host3-ovsbr0 00:00:d4:ae:52:d2:73:da 1 all pox1=7\n\t\t\t// $ curl -k -d '{\"id\":\"1\",\"method\":\"list-datapath-flowdb\",\"params\":{\"dpid\":\"5e:3e:08:9e:01:93:5e:08\"},\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.101:8081\n\t\t\t\n\t\t\tJsonObject sliceActionJsonObj = new JsonObject();\n\t\t\tsliceActionJsonObj.add(\"slice-name\", reqUri).add(\"permission\", 7);\t//\t{ \"slice-name\" : <name> \", \"permission\" : <perm-value> }\n\t\n\t\t\tJsonArray sliceActionJsonArray = new JsonArray();\t\t\t\t\t//\t[ { \"slice-name\" : <name> \", \"permission\" : <perm-value> } ]\n\t\t\tsliceActionJsonArray.add(sliceActionJsonObj);\n\t\n\t\t\tJsonObject matchJsonObj = new JsonObject();\t\t\t\t\t\t\t// \t{\"dl_vlan\":1000}\n\t\t\tmatchJsonObj.add(\"dl_vlan\", acceptedReq.getTargetVlan());\n\t\n\t\t\tJsonObject addFlowspaceParamObj = new JsonObject();\n\t\t\t//addFlowspaceParamObj.add(\"name\",virtualizedSwUri+\"_\"+reqUri+\"_\"+flowSpaceNumber).add(\"dpid\", ovsMacAddress).add(\"priority\", 1).add(\"match\", matchJsonObj).add(\"slice-action\", sliceActionJsonArray);\n\t\t\taddFlowspaceParamObj.add(\"name\",virtualizedSwUri+\"_\"+reqUri).add(\"dpid\", ovsMacAddress).add(\"priority\", 1).add(\"match\", matchJsonObj).add(\"slice-action\", sliceActionJsonArray);\n\t\t\t// {\"name\":\"S-4_REQ-0\",\"dpid\":\"00:00:f0:4d:a2:33:8e:7d\",\"priority\":1,\"match\":{\"dl_src\":\"f0:62:15:9f:71:97\"},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]}\n\t\t\t\n\t\t\taddFlowspaceArray.add(addFlowspaceParamObj);\n\t\t\t// [{addFlowspaceParamObj1}, {addFlowspaceParamObj2}, ... ]\n\t\t\t\n\t\t\tJsonObject addFlowspaceJsonReq= new JsonObject();\n\t\t\taddFlowspaceJsonReq.add(\"id\",1).add(\"method\", \"add-flowspace\").add(\"params\", addFlowspaceArray).add(\"jsonrpc\", \"2.0\");\n\t\t\t\n\t\t\t//\tCommit flowspace creation by making flowvisor request\n\t\t\tif(COMMIT_DEPLOYMENT)makeFvRequest(\"add-flowspace\", addFlowspaceJsonReq.toString());\n\t\t\t//else PrintContainerValues.prettyPrintJSONAsString(addFlowspaceJsonReq.toString());\n\t\t\t\n\t\t}\n\t\t\n\t\t//JsonObject addFlowspaceJsonReq= new JsonObject();\n\t\t//addFlowspaceJsonReq.add(\"id\",1).add(\"method\", \"add-flowspace\").add(\"params\", addFlowspaceArray).add(\"jsonrpc\", \"2.0\");\n\t\t// {\"id\":1, \"method\":\"add-flowspace\", \"params\": [{addFlowspaceParamObj1}, {addFlowspaceParamObj2}, ... ], \"jsonrpc\":\"2.0\"}\n\t\t\n\t\t// curl -k -d '{\"id\":1,\"method\":\"add-flowspace\",\"params\":[{\"name\":\"S-1_REQ-0_FS-0\",\"dpid\":\"00:0037d\",\"priority\":1,\"match\":{\"dl_vlan\":1000},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]}],\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.200:8081\n\t\t// curl -k -d '{\"id\":1,\"method\":\"add-flowspace\",\"params\":[{\"name\":\"S-1_REQ-0_FS-0\",\"dpid\":\"00:00:f0:4d:a2:33:8e:7d\",\"priority\":1,\"match\":{\"dl_vlan\":1000},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]},{\"name\":\"S-10_REQ-0_FS-1\",\"dpid\":\"5e:3e:08:9e:01:93:5d:90\",\"priority\":1,\"match\":{\"dl_vlan\":1000},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]},{\"name\":\"S-4_REQ-0_FS-2\",\"dpid\":\"00:00:d4:ae:52:d2:73:da\",\"priority\":1,\"match\":{\"dl_vlan\":1000},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]},{\"name\":\"S-3_REQ-0_FS-3\",\"dpid\":\"5e:3e:08:9e:01:93:5e:08\",\"priority\":1,\"match\":{\"dl_vlan\":1000},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]},{\"name\":\"S-2_REQ-0_FS-4\",\"dpid\":\"5e:3e:c4:54:44:4f:2b:24\",\"priority\":1,\"match\":{\"dl_vlan\":1000},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]}],\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.200:8081\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// curl -k -d '{\"id\":1,\"method\":\"add-flowspace\",\"params\":[{\"name\":\"S-6_REQ-0\",\"dpid\":\"00:00:f0:4d:a2:33:8e:7d\",\"priority\":1,\"match\":{\"dl_src\":\"5e:ef:de:b5:7e:b2\"},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]},{\"name\":\"S-5_REQ-0\",\"dpid\":\"00:00:d4:ae:52:d2:73:da\",\"priority\":1,\"match\":{\"dl_src\":\"32:bb:e5:61:66:fa\"},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]},{\"name\":\"S-5_REQ-0\",\"dpid\":\"00:00:d4:ae:52:d2:73:da\",\"priority\":1,\"match\":{\"dl_src\":\"fa:83:bb:4b:cb:c0\"},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]}],\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.101:8081\n\t\t// \n\t\t// curl -k -d '{\"id\":1,\"method\":\"add-flowspace\",\"params\":[{\"name\":\"S-3_REQ-0_FS-0\",\"dpid\":\"00:00:f0:4d:a2:33:8e:7d\",\"priority\":1,\"match\":{\"dl_src\":\"08:0d:40:bd:51:e2\"},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]}],\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.101:8081\n\t\t// curl -k -d '{\"id\":1,\"method\":\"add-flowspace\",\"params\":[{\"name\":\"S-4_REQ-0_FS-0\",\"dpid\":\"00:00:d4:ae:52:d2:73:da\",\"priority\":1,\"match\":{\"dl_src\":\"2c:ed:7a:9c:1a:2b\"},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]}],\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.101:8081\n\t\t// curl -k -d '{\"id\":1,\"method\":\"add-flowspace\",\"params\":[{\"name\":\"S-4_REQ-0_FS-1\",\"dpid\":\"00:00:d4:ae:52:d2:73:da\",\"priority\":1,\"match\":{\"dl_src\":\"00:34:63:74:74:dd\"},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]}],\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.101:8081\n\t\t\n\t\t//PrintContainerValues.prettyPrintJSONAsString(addFlowspaceJsonReq.toString());\n\t\t//makeFvRequest(\"add-flowspace\", addFlowspaceJsonReq.toString());\n\t\treturn threadSleepTime;\n\t}", "public CreateDeviceRequest(CreateDeviceRequest source) {\n if (source.ProductId != null) {\n this.ProductId = new String(source.ProductId);\n }\n if (source.DeviceName != null) {\n this.DeviceName = new String(source.DeviceName);\n }\n if (source.DevAddr != null) {\n this.DevAddr = new String(source.DevAddr);\n }\n if (source.AppKey != null) {\n this.AppKey = new String(source.AppKey);\n }\n if (source.DevEUI != null) {\n this.DevEUI = new String(source.DevEUI);\n }\n if (source.AppSKey != null) {\n this.AppSKey = new String(source.AppSKey);\n }\n if (source.NwkSKey != null) {\n this.NwkSKey = new String(source.NwkSKey);\n }\n if (source.DefinedPsk != null) {\n this.DefinedPsk = new String(source.DefinedPsk);\n }\n }", "private void createRequest() {\n // Configure Google Sign In\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n // Build a GoogleSignInClient with the options specified by gso.\n mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n }", "public QBXMLRequest() {\n }", "static public QRScanProviderVolunteerRequest create(String serializedData) {\n Gson gson = new Gson();\n return gson.fromJson(serializedData, QRScanProviderVolunteerRequest.class);\n }", "public RequestUpdateCancha() {\n }", "public Builder setRequest(com.czht.face.recognition.Czhtdev.Request value) {\n if (requestBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n request_ = value;\n onChanged();\n } else {\n requestBuilder_.setMessage(value);\n }\n bitField0_ |= 0x00000002;\n return this;\n }", "public InquiryLftrattribRequest()\r\n\t{\r\n\t}", "public LogVendorRequest (long id) {\r\n\t\tsuper(id);\r\n\t}", "public ReAuthRequest createReAuthRequest(Request req) {\n return null;\r\n }", "protected RequestLine createRequestLine(String method, String uri, ProtocolVersion ver) {\n/* 337 */ return new BasicRequestLine(method, uri, ver);\n/* */ }", "private BenchmarkRequest(com.google.protobuf.GeneratedMessage.Builder builder) {\n super(builder);\n }", "public void makeRequest() {\n Request newRequest = new Request();\n\n if (mProduct == null) {\n Toast.makeText(getContext(), \"BAD\", Toast.LENGTH_LONG).show();\n return;\n }\n\n newRequest.setClient(ParseUser.getCurrentUser());\n newRequest.setProduct(mProduct);\n newRequest.setBeaut(mBeaut);\n\n Date dateTime = new Date(selectedAppointmet.appDate.getTimeInMillis());\n newRequest.setDateTime(dateTime);\n // TODO: uncomment below line when dataset is clean and products have lengths\n// newRequest.setLength(mProduct.getLength());\n newRequest.setLength(1);\n newRequest.setSeat(selectedAppointmet.seatId);\n newRequest.setDescription(rComments.getText().toString());\n\n sendRequest(newRequest);\n }", "public NewDeviceRequest(String deviceId) {\n super();\n setId(deviceId);\n }", "public DescribeEventsRequest() {}", "public void createServiceRequest() {\n getMainActivity().startService(new Intent(getMainActivity(), RequestService.class));\n }", "public ClearRequest() {\n // default constructor\n }", "private DdzReadyRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private CalRequest(\r\n\t\t\t\tcom.google.protobuf.GeneratedMessage.Builder<?> builder) {\r\n\t\t\tsuper(builder);\r\n\t\t\tthis.unknownFields = builder.getUnknownFields();\r\n\t\t}", "@Override\n\tprotected void initForInspect(AWRequestContext requestContext) {\n\n\t}", "@Override\n\tpublic void initRequest() {\n\n\t}", "public CardRequest() {\r\n card = new MSRData(); // an empty one\r\n }", "@Deprecated\n public static RequestRejectReleasePdu createRequestPdu(int sourceId, int messageId, int multicastGroupAddress) {\n return new RequestRejectReleasePdu(Request_PDU, sourceId, messageId, multicastGroupAddress);\n }", "public LogVendorRequest (\r\n\t\tlong id,\r\n\t\tlong vendorId) {\r\n\r\n\t\tsuper (\r\n\t\t\tid,\r\n\t\t\tvendorId);\r\n\t}", "private VirtualDatacenterDto getValidVdc(final VirtualDatacenter vdc)\n {\n\n ClientResponse response =\n get(resolveVirtualDatacenterURI(vdc.getId()), SYSADMIN, SYSADMIN,\n VirtualDatacenterDto.MEDIA_TYPE);\n assertEquals(response.getStatusCode(), Status.OK.getStatusCode());\n\n VirtualDatacenterDto dto = response.getEntity(VirtualDatacenterDto.class);\n return dto;\n }", "public com.vodafone.global.er.decoupling.binding.request.SelfcareSubscriptionsRequest createSelfcareSubscriptionsRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.SelfcareSubscriptionsRequestImpl();\n }", "com.exacttarget.wsdl.partnerapi.QueryRequest addNewQueryRequest();", "public GetContactRequest()\r\n {\r\n }", "private Builder() {\n super(sparqles.avro.discovery.DGETInfo.SCHEMA$);\n }", "private DistributedClearOperation(OperationType op, RegionEventImpl event,\n RegionVersionVector rvv, Set<InternalDistributedMember> recipients) {\n super(event);\n this.rvv = rvv;\n operation = op;\n this.recipients = recipients;\n if (event != null) {\n operationTag = event.getVersionTag();\n }\n }", "public MessageRequest() {\n\t}", "public VersionsRequest(String user, String filename){\n super(user, filename);\n }", "public ChatRequest()\r\n\t{\r\n\t}", "TransferInitiateResponse initiateConsumerRequest(DataRequest dataRequest);", "public IComplianceRequest buildRequest(final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions) {\n return new com.microsoft.graph.requests.extensions.ComplianceRequest(getRequestUrl(), getClient(), requestOptions);\n }", "@Override\r\n public Context initControlContext() throws Exception {\r\n _log.info(\"\");\r\n _log.info(\"...Preparing generation of free generate\");\r\n for (DfFreeGenRequest request : _freeGenRequestList) {\r\n _log.info(\" \" + request.toString());\r\n }\r\n final VelocityContext context = createVelocityContext();\r\n return context;\r\n }", "public RequestAuthorizeGuestDTO() {\n\t\tsuper();\n\t}", "public CreateDeviceRequest(CreateDeviceRequest source) {\n if (source.ProjectId != null) {\n this.ProjectId = new String(source.ProjectId);\n }\n if (source.DeviceId != null) {\n this.DeviceId = new String(source.DeviceId);\n }\n if (source.DeviceName != null) {\n this.DeviceName = new String(source.DeviceName);\n }\n if (source.DeviceType != null) {\n this.DeviceType = new String(source.DeviceType);\n }\n if (source.DeviceToken != null) {\n this.DeviceToken = new String(source.DeviceToken);\n }\n }", "pvcs createpvcs();", "public CreateDirectConnectTunnelRequest(CreateDirectConnectTunnelRequest source) {\n if (source.DirectConnectId != null) {\n this.DirectConnectId = new String(source.DirectConnectId);\n }\n if (source.DirectConnectTunnelName != null) {\n this.DirectConnectTunnelName = new String(source.DirectConnectTunnelName);\n }\n if (source.DirectConnectOwnerAccount != null) {\n this.DirectConnectOwnerAccount = new String(source.DirectConnectOwnerAccount);\n }\n if (source.NetworkType != null) {\n this.NetworkType = new String(source.NetworkType);\n }\n if (source.NetworkRegion != null) {\n this.NetworkRegion = new String(source.NetworkRegion);\n }\n if (source.VpcId != null) {\n this.VpcId = new String(source.VpcId);\n }\n if (source.DirectConnectGatewayId != null) {\n this.DirectConnectGatewayId = new String(source.DirectConnectGatewayId);\n }\n if (source.Bandwidth != null) {\n this.Bandwidth = new Long(source.Bandwidth);\n }\n if (source.RouteType != null) {\n this.RouteType = new String(source.RouteType);\n }\n if (source.BgpPeer != null) {\n this.BgpPeer = new BgpPeer(source.BgpPeer);\n }\n if (source.RouteFilterPrefixes != null) {\n this.RouteFilterPrefixes = new RouteFilterPrefix[source.RouteFilterPrefixes.length];\n for (int i = 0; i < source.RouteFilterPrefixes.length; i++) {\n this.RouteFilterPrefixes[i] = new RouteFilterPrefix(source.RouteFilterPrefixes[i]);\n }\n }\n if (source.Vlan != null) {\n this.Vlan = new Long(source.Vlan);\n }\n if (source.TencentAddress != null) {\n this.TencentAddress = new String(source.TencentAddress);\n }\n if (source.CustomerAddress != null) {\n this.CustomerAddress = new String(source.CustomerAddress);\n }\n if (source.TencentBackupAddress != null) {\n this.TencentBackupAddress = new String(source.TencentBackupAddress);\n }\n if (source.CloudAttachId != null) {\n this.CloudAttachId = new String(source.CloudAttachId);\n }\n if (source.BfdEnable != null) {\n this.BfdEnable = new Long(source.BfdEnable);\n }\n if (source.NqaEnable != null) {\n this.NqaEnable = new Long(source.NqaEnable);\n }\n if (source.BfdInfo != null) {\n this.BfdInfo = new BFDInfo(source.BfdInfo);\n }\n if (source.NqaInfo != null) {\n this.NqaInfo = new NQAInfo(source.NqaInfo);\n }\n }", "private Builder(sparqles.avro.discovery.DGETInfo other) {\n super(sparqles.avro.discovery.DGETInfo.SCHEMA$);\n if (isValidValue(fields()[0], other.allowedByRobotsTXT)) {\n this.allowedByRobotsTXT = data().deepCopy(fields()[0].schema(), other.allowedByRobotsTXT);\n fieldSetFlags()[0] = true;\n }\n if (isValidValue(fields()[1], other.Operation)) {\n this.Operation = data().deepCopy(fields()[1].schema(), other.Operation);\n fieldSetFlags()[1] = true;\n }\n if (isValidValue(fields()[2], other.URL)) {\n this.URL = data().deepCopy(fields()[2].schema(), other.URL);\n fieldSetFlags()[2] = true;\n }\n if (isValidValue(fields()[3], other.Exception)) {\n this.Exception = data().deepCopy(fields()[3].schema(), other.Exception);\n fieldSetFlags()[3] = true;\n }\n if (isValidValue(fields()[4], other.ResponseType)) {\n this.ResponseType = data().deepCopy(fields()[4].schema(), other.ResponseType);\n fieldSetFlags()[4] = true;\n }\n if (isValidValue(fields()[5], other.ResponseCode)) {\n this.ResponseCode = data().deepCopy(fields()[5].schema(), other.ResponseCode);\n fieldSetFlags()[5] = true;\n }\n if (isValidValue(fields()[6], other.ResponseServer)) {\n this.ResponseServer = data().deepCopy(fields()[6].schema(), other.ResponseServer);\n fieldSetFlags()[6] = true;\n }\n if (isValidValue(fields()[7], other.ResponseLink)) {\n this.ResponseLink = data().deepCopy(fields()[7].schema(), other.ResponseLink);\n fieldSetFlags()[7] = true;\n }\n if (isValidValue(fields()[8], other.Content)) {\n this.Content = data().deepCopy(fields()[8].schema(), other.Content);\n fieldSetFlags()[8] = true;\n }\n if (isValidValue(fields()[9], other.SPARQLDESCpreds)) {\n this.SPARQLDESCpreds = data().deepCopy(fields()[9].schema(), other.SPARQLDESCpreds);\n fieldSetFlags()[9] = true;\n }\n if (isValidValue(fields()[10], other.voiDpreds)) {\n this.voiDpreds = data().deepCopy(fields()[10].schema(), other.voiDpreds);\n fieldSetFlags()[10] = true;\n }\n }", "public AuthorizationRequest() { }", "public PickUpCasualtyRequest() {\n\n // empty\n }", "public DataRequest() {\n\t\tfilters = new ArrayList<FilteringRule>();\n\t\tsort_by = new ArrayList<SortingRule>();\n\t}", "@Override\n protected void handleRequest(final Message request, final ConnectionKey connkey, final Peer peer) {\n final Message answer = new Message();\n answer.prepareResponse(request);\n AVP avp;\n avp = request.find(ProtocolConstants.DI_SESSION_ID);\n if (avp != null) {\n answer.add(avp);\n }\n node().addOurHostAndRealm(answer);\n avp = request.find(ProtocolConstants.DI_CC_REQUEST_TYPE);\n if (avp == null) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_MISSING_AVP,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP,\n new AVP[]{new AVP(ProtocolConstants.DI_CC_REQUEST_TYPE, new byte[]{})})});\n return;\n }\n final int ccRequestType; // = -1;\n try {\n ccRequestType = new AVP_Unsigned32(avp).queryValue();\n } catch (final InvalidAVPLengthException ex) {\n throw new AssertionError(\"Unexpected exception: \" + ex, ex);\n }\n if (ccRequestType != ProtocolConstants.DI_CC_REQUEST_TYPE_INITIAL_REQUEST\n && ccRequestType != ProtocolConstants.DI_CC_REQUEST_TYPE_UPDATE_REQUEST\n && ccRequestType != ProtocolConstants.DI_CC_REQUEST_TYPE_TERMINATION_REQUEST\n && ccRequestType != ProtocolConstants.DI_CC_REQUEST_TYPE_EVENT_REQUEST) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_INVALID_AVP_VALUE,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{avp})});\n return;\n }\n\n //This test server does not support multiple-services-cc\n avp = request.find(ProtocolConstants.DI_MULTIPLE_SERVICES_CREDIT_CONTROL);\n if (avp != null) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_INVALID_AVP_VALUE,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{avp})});\n return;\n }\n avp = request.find(ProtocolConstants.DI_MULTIPLE_SERVICES_INDICATOR);\n if (avp != null) {\n int indicator = -1;\n try {\n indicator = new AVP_Unsigned32(avp).queryValue();\n } catch (final InvalidAVPLengthException ex) {\n throw new AssertionError(\"Unexpected exception: \" + ex, ex);\n }\n if (indicator != ProtocolConstants.DI_MULTIPLE_SERVICES_INDICATOR_MULTIPLE_SERVICES_NOT_SUPPORTED) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_INVALID_AVP_VALUE,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{avp})});\n return;\n }\n }\n\n answer.add(new AVP_Unsigned32(ProtocolConstants.DI_RESULT_CODE, ProtocolConstants.DIAMETER_RESULT_SUCCESS));\n avp = request.find(ProtocolConstants.DI_AUTH_APPLICATION_ID);\n if (avp != null) {\n answer.add(avp);\n }\n avp = request.find(ProtocolConstants.DI_CC_REQUEST_TYPE);\n if (avp != null) {\n answer.add(avp);\n }\n avp = request.find(ProtocolConstants.DI_CC_REQUEST_NUMBER);\n if (avp != null) {\n answer.add(avp);\n }\n\n switch (ccRequestType) {\n case ProtocolConstants.DI_CC_REQUEST_TYPE_INITIAL_REQUEST:\n case ProtocolConstants.DI_CC_REQUEST_TYPE_UPDATE_REQUEST:\n case ProtocolConstants.DI_CC_REQUEST_TYPE_TERMINATION_REQUEST:\n //grant whatever is requested\n avp = request.find(ProtocolConstants.DI_REQUESTED_SERVICE_UNIT);\n if (avp != null) {\n final AVP g = new AVP(avp);\n g.code = ProtocolConstants.DI_GRANTED_SERVICE_UNIT;\n answer.add(avp);\n }\n break;\n case ProtocolConstants.DI_CC_REQUEST_TYPE_EVENT_REQUEST:\n //examine requested-action\n avp = request.find(ProtocolConstants.DI_REQUESTED_ACTION);\n if (avp == null) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_MISSING_AVP,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP,\n new AVP[]{new AVP(ProtocolConstants.DI_REQUESTED_ACTION, new byte[]{})})});\n return;\n }\n int requestedAction = -1;\n try {\n requestedAction = new AVP_Unsigned32(avp).queryValue();\n } catch (final InvalidAVPLengthException ex) {\n throw new AssertionError(\"Unexpected exception: \" + ex, ex);\n }\n switch (requestedAction) {\n case ProtocolConstants.DI_REQUESTED_ACTION_DIRECT_DEBITING:\n //nothing. just indicate success\n break;\n case ProtocolConstants.DI_REQUESTED_ACTION_REFUND_ACCOUNT:\n //nothing. just indicate success\n break;\n case ProtocolConstants.DI_REQUESTED_ACTION_CHECK_BALANCE:\n //report back that the user has sufficient balance\n answer.add(new AVP_Unsigned32(ProtocolConstants.DI_CHECK_BALANCE_RESULT,\n ProtocolConstants.DI_DI_CHECK_BALANCE_RESULT_ENOUGH_CREDIT));\n break;\n case ProtocolConstants.DI_REQUESTED_ACTION_PRICE_ENQUIRY:\n //report back a price of DKK42.17 per kanelsnegl\n answer.add(new AVP_Grouped(ProtocolConstants.DI_COST_INFORMATION,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_UNIT_VALUE,\n new AVP[]{new AVP_Integer64(ProtocolConstants.DI_VALUE_DIGITS, 4217),\n new AVP_Integer32(ProtocolConstants.DI_EXPONENT, -2)\n }),\n new AVP_Unsigned32(ProtocolConstants.DI_CURRENCY_CODE, 208),\n new AVP_UTF8String(ProtocolConstants.DI_COST_UNIT, \"kanelsnegl\")\n }));\n break;\n default: {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_INVALID_AVP_VALUE,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{avp})});\n return;\n }\n\n }\n break;\n default:\n throw new AssertionError(\"Unexpected value:\" + ccRequestType);\n }\n\n Utils.setMandatory_RFC3588(answer);\n\n try {\n answer(answer, connkey);\n } catch (final NotAnAnswerException ex) {\n throw new AssertionError(\"Unexpected exception: \" + ex, ex);\n }\n }", "protected VClass getVclassParameter(VitroRequest vreq) {\n\t\tString vclassId = vreq.getParameter(\"vclassId\");\n\t\tif (StringUtils.isEmpty(vclassId)) {\n\t\t\tlog.error(\"parameter vclassId expected but not found\");\n\t\t\tthrow new IllegalStateException(\"parameter vclassId expected \");\n\t\t}\n\t\treturn instantiateVclass(vclassId, vreq);\n\t}", "private Builder(sparqles.avro.discovery.DGETInfo.Builder other) {\n super(other);\n if (isValidValue(fields()[0], other.allowedByRobotsTXT)) {\n this.allowedByRobotsTXT = data().deepCopy(fields()[0].schema(), other.allowedByRobotsTXT);\n fieldSetFlags()[0] = true;\n }\n if (isValidValue(fields()[1], other.Operation)) {\n this.Operation = data().deepCopy(fields()[1].schema(), other.Operation);\n fieldSetFlags()[1] = true;\n }\n if (isValidValue(fields()[2], other.URL)) {\n this.URL = data().deepCopy(fields()[2].schema(), other.URL);\n fieldSetFlags()[2] = true;\n }\n if (isValidValue(fields()[3], other.Exception)) {\n this.Exception = data().deepCopy(fields()[3].schema(), other.Exception);\n fieldSetFlags()[3] = true;\n }\n if (isValidValue(fields()[4], other.ResponseType)) {\n this.ResponseType = data().deepCopy(fields()[4].schema(), other.ResponseType);\n fieldSetFlags()[4] = true;\n }\n if (isValidValue(fields()[5], other.ResponseCode)) {\n this.ResponseCode = data().deepCopy(fields()[5].schema(), other.ResponseCode);\n fieldSetFlags()[5] = true;\n }\n if (isValidValue(fields()[6], other.ResponseServer)) {\n this.ResponseServer = data().deepCopy(fields()[6].schema(), other.ResponseServer);\n fieldSetFlags()[6] = true;\n }\n if (isValidValue(fields()[7], other.ResponseLink)) {\n this.ResponseLink = data().deepCopy(fields()[7].schema(), other.ResponseLink);\n fieldSetFlags()[7] = true;\n }\n if (isValidValue(fields()[8], other.Content)) {\n this.Content = data().deepCopy(fields()[8].schema(), other.Content);\n fieldSetFlags()[8] = true;\n }\n if (isValidValue(fields()[9], other.SPARQLDESCpreds)) {\n this.SPARQLDESCpreds = data().deepCopy(fields()[9].schema(), other.SPARQLDESCpreds);\n fieldSetFlags()[9] = true;\n }\n if (isValidValue(fields()[10], other.voiDpreds)) {\n this.voiDpreds = data().deepCopy(fields()[10].schema(), other.voiDpreds);\n fieldSetFlags()[10] = true;\n }\n }", "private Request(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Request(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Request(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Request(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public com.vodafone.global.er.decoupling.binding.request.SelfcareMicroServicesRequest createSelfcareMicroServicesRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.SelfcareMicroServicesRequestImpl();\n }", "public RequestEntity(Entity entity, Monitor monitor) {\n this.builder = new FormCreator(this, entity);\n this.channel = entity.getChannel();\n this.header = entity.getHeader(); \n this.body = entity.getBody();\n this.entity = entity;\n }", "public com.vodafone.global.er.decoupling.binding.request.ErRequest createErRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.ErRequestImpl();\n }", "public VITACareer()\r\n {\r\n }", "protected void createLocationRequest() {\n\t\tmLocationRequest = new LocationRequest();\n\t\tmLocationRequest.setInterval(UPDATE_INTERVAL);\n\t\tmLocationRequest.setFastestInterval(FATEST_INTERVAL);\n\t\tmLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\t\tmLocationRequest.setSmallestDisplacement(DISPLACEMENT);\n\t}", "public Map<String, AccessPoint> createParameters() {\r\n\t\tMap<String, AccessPoint> pm = new TreeMap<String, AccessPoint>();\r\n\t\tpm.put(\"vcNumber\", new MutableFieldAccessPoint(\"vcNumber\", this));\r\n\t\treturn pm;\r\n\t}", "public CartCreateRequest(String email, String ltc, Integer siteID,\n\t\t\tInteger languageID, String ccy) {\n\t\tsuper();\n\t\tthis.email = email;\n\t\tthis.ltc = ltc;\n\t\tthis.siteID = siteID;\n\t\tthis.languageID = languageID;\n\t\tthis.ccy = ccy;\n\t}" ]
[ "0.66525733", "0.5745801", "0.56229246", "0.55327314", "0.54822487", "0.54702735", "0.5390817", "0.5300221", "0.5287298", "0.52747524", "0.5226188", "0.52197915", "0.52050275", "0.52044046", "0.51761264", "0.51716244", "0.516824", "0.51364076", "0.5134805", "0.5098682", "0.50606555", "0.50523394", "0.50280625", "0.50217", "0.4959576", "0.49546102", "0.49419558", "0.49346858", "0.49250606", "0.49172595", "0.48909426", "0.48812693", "0.48771468", "0.487199", "0.487199", "0.48711476", "0.48631698", "0.4844617", "0.48384282", "0.48371646", "0.4829741", "0.48185623", "0.48075208", "0.48056668", "0.48051763", "0.4791265", "0.478071", "0.47702858", "0.47693428", "0.47588652", "0.4755531", "0.4738557", "0.47309208", "0.47289333", "0.4728916", "0.47212952", "0.47130752", "0.47072488", "0.47063556", "0.47048524", "0.47044095", "0.47042084", "0.47016627", "0.4701059", "0.46989107", "0.46914992", "0.4691327", "0.4689532", "0.4680908", "0.468036", "0.46741503", "0.46736717", "0.46591768", "0.46512762", "0.46491846", "0.46456635", "0.4642154", "0.46415952", "0.46321347", "0.46236786", "0.46209326", "0.4617605", "0.4609175", "0.46015957", "0.4598297", "0.45969832", "0.45909393", "0.45903394", "0.45874247", "0.45866188", "0.45866188", "0.45866188", "0.45866188", "0.45866045", "0.45851833", "0.45750943", "0.45681506", "0.456771", "0.45666406", "0.45481804" ]
0.7528393
0
Constructs new VDC Request
public VDCRequest(Map<Integer, VirtualMachine> listVM, LinkedList<VirtualLink> listVLink, double startTime, double lifeTime, int vdcID) { this.listVirVM = listVM; this.listVirLink = listVLink; // this.listVirSwitch = listVSwitch; this.startTime = startTime; this.lifeTime = lifeTime; this.vdcID = vdcID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public VDCRequest() {\n\t\tthis.listVirVM = new HashMap<>();\n\t\tthis.listVirLink = new LinkedList<>();\n\t\t// this.listVirSwitch = new LinkedList<>();\n\t\tthis.numVM = 0;\n\t\tthis.vdcID = 0;\n\t\tthis.bwrequest = 0;\n\t}", "protected DiameterClientRequest newRequest(ChargingConstants.CcRecordType type) {\n\t\tlong accountingRecordNumber = getRecordNumber();\n\t\tDiameterClientRequest request = _client.newAuthRequest(ChargingConstants.COMMAND_CC, true);\n\n\t\tDiameterAVP avp = new DiameterAVP(ChargingUtils.getCcRequestTypeAVP());\n\t\tavp.setValue(EnumeratedFormat.toEnumerated(type.getValue()), false);\n\t\trequest.addDiameterAVP(avp);\n\n\t\tavp = new DiameterAVP(ChargingUtils.getCcRequestNumberAVP());\n\t\tavp.setValue(Unsigned32Format.toUnsigned32(accountingRecordNumber), false);\n\t\trequest.addDiameterAVP(avp);\n\n\t\treturn request;\n\t}", "public CalccustoRequest()\r\n\t{\r\n\t}", "public TestBSSVRequest() {\r\n }", "public CalccustoRequest(UserContext userContext)\r\n\t{\r\n\t\tsuper(userContext);\r\n\t}", "public CalccustoRequest(UserContext userContext, Tenant tenant)\r\n\t{\r\n\t\tsuper(userContext, tenant);\r\n\t}", "private void initRequest()\n\t{\n\t\tthis.request = new RestClientReportRequest();\n\t\tRequestHelper.copyConfigsToRequest(this.getConfigs(), this.request);\n\t\tRequestHelper.copyParamsToRequest(this.getParams(), this.request);\n\t\t\n\t\tthis.performQuery();\n\t}", "public com.vodafone.global.er.decoupling.binding.request.GetVersionRequest createGetVersionRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.GetVersionRequestImpl();\n }", "private final static HttpRequest createRequest() {\r\n\r\n HttpRequest req = new BasicHttpRequest\r\n (\"GET\", \"/\", HttpVersion.HTTP_1_1);\r\n //(\"OPTIONS\", \"*\", HttpVersion.HTTP_1_1);\r\n\r\n return req;\r\n }", "public VehicleSearchRequest createSearchVechicle() {\r\n\r\n\t\tVehicleSearchRequest searchRequest = new VehicleSearchRequest();\r\n\r\n\t\tif (StringUtils.isBlank(searchLocation)) {\r\n\t\t\tsearchRequest.setLocation(DefaultValues.LOCATION_DEFAULT.getDef());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setLocation(searchLocation);\r\n\t\t}\r\n\r\n\t\tif (StringUtils.isBlank(searchVehicleType)) {\r\n\t\t\tsearchRequest.setVehicleType(VehicleType.getEnum(DefaultValues.VEHICLE_TYPE_DEFAULT.getDef()));\r\n\t\t} else {\r\n\t\t\tsearchRequest.setVehicleType(VehicleType.getEnum(searchVehicleType));\r\n\t\t}\r\n\r\n\t\tif (StringUtils.isBlank(searchFin)) {\r\n\t\t\tsearchRequest.setFin(DefaultValues.FIN_DEFAULT.getDef());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setFin(searchFin);\r\n\t\t}\r\n\r\n\t\tif (StringUtils.isBlank(searchModel)) {\r\n\t\t\tsearchRequest.setModel(DefaultValues.MODEL_DEFAULT.getDef());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setModel(searchModel);\r\n\t\t}\r\n\r\n\t\tif (StringUtils.isBlank(searchFuelType)) {\r\n\t\t\tsearchRequest.setFuelType(FuelType.DEFAULT);\r\n\t\t} else {\r\n\t\t\tsearchRequest.setFuelType(FuelType.getEnum(searchFuelType));\r\n\t\t}\r\n\r\n\t\tif (searchMaxCapacity == 0) {\r\n\t\t\tsearchRequest.setMaxCapacity(DefaultValues.MAX_CAPACITY_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMaxCapacity(searchMaxCapacity);\r\n\t\t}\r\n\r\n\t\tif (searchMinCapacity == 0) {\r\n\t\t\tsearchRequest.setMinCapacity(DefaultValues.MIN_CAPACITY_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMinCapacity(searchMinCapacity);\r\n\t\t}\r\n\r\n\t\tif (searchMinYear == 0) {\r\n\t\t\tsearchRequest.setMinYear(DefaultValues.MIN_YEAR_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMinYear(searchMinYear);\r\n\t\t}\r\n\r\n\t\tif (searchMaxYear == 0) {\r\n\t\t\tsearchRequest.setMaxYear(DefaultValues.MAX_YEAR_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMaxYear(searchMaxYear);\r\n\t\t}\r\n\r\n\t\tif (searchMaxPrice == 0) {\r\n\t\t\tsearchRequest.setMaxPrice(DefaultValues.MAX_PRICE_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMaxPrice(searchMaxPrice);\r\n\t\t}\r\n\r\n\t\tif (searchMinPrice == 0) {\r\n\t\t\tsearchRequest.setMinPrice(DefaultValues.MIN_PRICE_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMinPrice(searchMinPrice);\r\n\t\t}\r\n\t\treturn searchRequest;\r\n\t}", "public GetVideoRequest(UUID requestUUID, Video video) {\n super(requestUUID, video.getVidUrl());\n this.video = video;\n getVideoRequestCount += 1;\n }", "Request _create_request(Context ctx,\n String operation,\n NVList arg_list,\n NamedValue result);", "public void build() {\n\t\t\tRequest request = new Request();\n request.context = context;\n\t\t\trequest.requestType = requestType;\n\t\t\trequest.url = url;\n\t\t\trequest.envelope = envelope;\n\t\t\trequest.headers = headers;\n\n\t\t\trequest.responseListener = responseListener;\n\t\t\trequest.onValidateResponseListener = validateResponseListener;\n\n\t\t\trequest.isDebug = isDebug;\n\n\t\t\trequest.start();\n\t\t}", "public com.vodafone.global.er.decoupling.binding.request.ErVersionInfoRequest createErVersionInfoRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.ErVersionInfoRequestImpl();\n }", "public TboFlightSearchRequest() {\n}", "private CreateCatalogRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "Request _create_request(Context ctx,\n String operation,\n NVList arg_list,\n NamedValue result,\n ExceptionList exclist,\n ContextList ctxlist);", "private Request() {\n initFields();\n }", "public UBERequest() {\r\n }", "public static WPSGetCapabilities create( String id, String request )\n throws InvalidParameterValueException, MissingParameterValueException {\n Map<String, String> map = KVP2Map.toMap( request );\n map.put( \"ID\", id );\n return create( map );\n }", "public Request(){\n\t\tthis(null, null, null);\n\t}", "public RPCRequest()\n\t{\n\t\tsuper();\n\t}", "public Request _create_request(Context ctx,\n String operation,\n NVList arg_list,\n NamedValue result) {\n throw new NO_IMPLEMENT(reason);\n }", "public UdrImpl(DiameterClientRequest request, Version version) {\n\t\tsuper(request, version);\n\t}", "public DeviceDataRequestCommand()\n {\n }", "public SystemCommandRequest()\r\n\t{\r\n\t}", "public com.vodafone.global.er.decoupling.binding.request.GetServiceRequest createGetServiceRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.GetServiceRequestImpl();\n }", "public DCAEServiceObject(String serviceId, DCAEServiceRequest request) {\n DateTime now = DateTime.now(DateTimeZone.UTC);\n this.setServiceId(serviceId);\n this.setTypeId(request.getTypeId());\n this.setVnfId(request.getVnfId());\n this.setVnfType(request.getVnfType());\n this.setVnfLocation(request.getVnfLocation());\n this.setDeploymentRef(request.getDeploymentRef());\n this.setCreated(now);\n this.setModified(now);\n // Assumption here is that you are here from the PUT which means that the service is RUNNING.\n this.setStatus(DCAEServiceStatus.RUNNING);\n }", "Graph callConstructQuery(String name, Map<String, String> params);", "public Request _create_request(Context ctx,\n String operation,\n NVList arg_list,\n NamedValue result,\n ExceptionList exceptions,\n ContextList contexts) {\n throw new NO_IMPLEMENT(reason);\n }", "public Request() {\n }", "public Request() {\n\n }", "public ServiceRequest() {\n super();\n this.addNamespaceToRequest = true;\n }", "private Request() {}", "private Request() {}", "public Request() {\n this.setRequestId(newRequestId());\n this.setRequestValue(0.0);\n this.date = new Date();\n }", "private CalRequest(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "public RequestMessage() {\r\n\t\tsuper();\r\n\t\tthis.criteria = new PersonSearchCriteria();\r\n\t\tthis.setSourceSystemID(SOURCE_SYSTEM_ID);\r\n\t\tthis.setSourceUserID(SOURCE_USER_ID);\r\n\t}", "public static Request constructRequest(VirtualControlLoopEvent onset, ControlLoopOperation operation, Policy policy,\n String targetVnf) {\n /*\n * Construct an APPC request\n */\n Request request = new Request();\n request.setCommonHeader(new CommonHeader());\n request.getCommonHeader().setRequestId(onset.getRequestId());\n request.getCommonHeader().setSubRequestId(operation.getSubRequestId());\n request.setAction(policy.getRecipe().substring(0, 1).toUpperCase() + policy.getRecipe().substring(1));\n\n // convert policy payload strings to objects\n if (policy.getPayload() == null) {\n logger.info(\"no APPC payload specified for policy {}\", policy.getName());\n } else {\n convertPayload(policy.getPayload(), request.getPayload());\n }\n\n // add/replace specific values\n request.getPayload().put(\"generic-vnf.vnf-id\", targetVnf);\n\n /*\n * Return the request\n */\n\n return request;\n }", "public void subscribeToCovRequest() {\n try {\n DeviceService.localDevice.send(bacnetDevice, new SubscribeCOVRequest(new UnsignedInteger(1), getObjectIdentifier(), Boolean.TRUE, new UnsignedInteger(0))).get();\n LOG.info(\"Subscription @: '\" + getObjectIdentifier() + \"' on: \" + bacnetDevice.getObjectIdentifier());\n } catch (BACnetException e) {\n LOG.warn(\"Can't subscribe : '\" + getObjectIdentifier() + \"' on: \" + bacnetDevice.getObjectIdentifier());\n }\n\n }", "private GRPCRequest(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n }", "private DGRequest(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "public static int buildSlice(AcceptedReq acceptedReq, HashMap<String, VM> allocVmMapForReq, HashMap<String, VSw> rsvdVSwIdToObjMap, HashMap<String, Datapath> datapathIdToObjMap, String controller_url){\n\n\t\tint threadSleepTime = 0;\n\t\t\n\t\t\n\t\t\n\t\tString reqUri = acceptedReq.getReqUri();\n\t\t\n\t\t//String fvReqMethod = \"get-config\";\n\t\t//String fvReqJsonString = new JsonObject().add(\"id\",99).add(\"method\", \"get-config\").add(\"params\", new JsonObject()).add(\"jsonrpc\", \"2.0\").toString();\n\t\tSystem.out.println(\"\\nAdding slice for Request \"+reqUri);\n\t\t//Multimap<String, String> hostedVmUris = getHostedVmUris(allocVmMapForReq);\n\t\tMap<String, String> hostedOvsUris = getHostedOvsUris(rsvdVSwIdToObjMap, datapathIdToObjMap);\n\n\t\tSystem.out.println(\"Allocated VMs = \"+allocVmMapForReq.size());\n\t\tfor(String allocVmUri : allocVmMapForReq.keySet()){\n\t\t\tVM allocVmObj = allocVmMapForReq.get(allocVmUri);\n\t\t\tSystem.out.println(\"\\nresourceUri \\t = \"+allocVmObj.getResourceURI());\n\t\t\tSystem.out.println(\"resourceLocation \\t = \"+allocVmObj.getResLocation());\n\t\t\tSystem.out.println(\"intfs.macAddress \\t = \"+allocVmObj.getIntfsObjArray()[0].getMacAddress());\n\t\t\tSystem.out.println(\"target VLAN-id \\t = \"+acceptedReq.getTargetVlan());\n\t\t\t\n\t\t}\n\n\t\tif(BUILD_SLICE_DBG)\n\t\t\tfor(String rsvdVSwId : acceptedReq.getRsvdVsResList()){\n\t\t\t\tVSw vSwObj = rsvdVSwIdToObjMap.get(rsvdVSwId);\n\t\t\t\tPrintContainerValues.printVSwObj(vSwObj);\n\t\n\t\t\t}\n\t\t\t// TODO: Edit this to print only location Datapath info \n\t\tif(BUILD_SLICE_DBG)\n\t\t\tfor(String datapathUri : datapathIdToObjMap.keySet()){\n\t\t\t\tDatapath datapathObj = datapathIdToObjMap.get(datapathUri);\n\t\t\t\tPrintContainerValues.printDatapathObj(datapathObj);\n\t\n\t\t\t}\n\t\t\n\t\t//if(BUILD_SLICE_DBG)\n\t\tSystem.out.println(\"\\nhostedOvsUris.size() = \"+hostedOvsUris.size());\n\t\t\tfor(String hostUri : hostedOvsUris.keySet())\n\t\t\t\tSystem.out.println(\"\\t Host = \"+hostUri+\"\\t Ovs = \"+hostedOvsUris.get(hostUri));\n\t\t\n\t\t\n\n\t\t// Creating one flowvisor slice for each request\n\t\tJsonObject addSliceParamObj = new JsonObject();\n\t\taddSliceParamObj.add(\"slice-name\", reqUri).add(\"controller-url\", controller_url).add(\"admin-contact\", \"[email protected]\").add(\"password\", \"\");\n\t\tJsonObject addSliceJsonReq= new JsonObject();\n\t\taddSliceJsonReq.add(\"id\",1).add(\"method\", \"add-slice\").add(\"params\", addSliceParamObj).add(\"jsonrpc\", \"2.0\");\n\t\tSystem.out.println(addSliceJsonReq.toString());\n\t\t// Commit slice creation by making flowvisor request\n\t\tif(COMMIT_DEPLOYMENT)makeFvRequest(\"add-slice\", addSliceJsonReq.toString());\n\t\telse PrintContainerValues.prettyPrintJSONAsString(addSliceJsonReq.toString());\n\t\t\n\t\t// $ curl -k -d '{\"id\":1,\"method\":\"add-slice\",\"params\":{\"slice-name\":\"REQ-0\",\"controller-url\":\"tcp:192.168.0.203:6633\",\"admin-contact\":\"[email protected]\",\"password\":\"\"},\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.200:8081\n\t\t// Creating flowspace array\n\t\t//JsonArray addFlowspaceArray = new JsonArray();\n\t\t\n\t\tSystem.out.println(\"acceptedReq.getAlocVsResList().size() = \"+acceptedReq.getRsvdVsResList().size());\n\t\tfor (String rsvdVsResId : acceptedReq.getRsvdVsResList()){\n\t\t\tString virtualizedSwUri = rsvdVSwIdToObjMap.get(rsvdVsResId).getLocation();\n\t\t\tDatapath virtualizedSwObj = datapathIdToObjMap.get(virtualizedSwUri);\n\t\t\tString ovsMacAddress = virtualizedSwObj.getDpid();\n\t\t\tSystem.out.println(\"\\t virtualizedSwUri = \"+virtualizedSwUri+\"\\t Location = \"+virtualizedSwObj.getResLocation());\n\t\t\t\n\t\t\tif(COMMIT_DEPLOYMENT)\n\t\t\ttry {\n\t\t\t\tThread.sleep(2000);\n\t\t\t\tthreadSleepTime += 2000;\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t// Creating flowspace array\n\t\t\tJsonArray addFlowspaceArray = new JsonArray();\n\t\t\t// $ fvctl -f /dev/null add-flowspace all-host3-ovsbr0 00:00:d4:ae:52:d2:73:da 1 all pox1=7\n\t\t\t// $ curl -k -d '{\"id\":\"1\",\"method\":\"list-datapath-flowdb\",\"params\":{\"dpid\":\"5e:3e:08:9e:01:93:5e:08\"},\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.101:8081\n\t\t\t\n\t\t\tJsonObject sliceActionJsonObj = new JsonObject();\n\t\t\tsliceActionJsonObj.add(\"slice-name\", reqUri).add(\"permission\", 7);\t//\t{ \"slice-name\" : <name> \", \"permission\" : <perm-value> }\n\t\n\t\t\tJsonArray sliceActionJsonArray = new JsonArray();\t\t\t\t\t//\t[ { \"slice-name\" : <name> \", \"permission\" : <perm-value> } ]\n\t\t\tsliceActionJsonArray.add(sliceActionJsonObj);\n\t\n\t\t\tJsonObject matchJsonObj = new JsonObject();\t\t\t\t\t\t\t// \t{\"dl_vlan\":1000}\n\t\t\tmatchJsonObj.add(\"dl_vlan\", acceptedReq.getTargetVlan());\n\t\n\t\t\tJsonObject addFlowspaceParamObj = new JsonObject();\n\t\t\t//addFlowspaceParamObj.add(\"name\",virtualizedSwUri+\"_\"+reqUri+\"_\"+flowSpaceNumber).add(\"dpid\", ovsMacAddress).add(\"priority\", 1).add(\"match\", matchJsonObj).add(\"slice-action\", sliceActionJsonArray);\n\t\t\taddFlowspaceParamObj.add(\"name\",virtualizedSwUri+\"_\"+reqUri).add(\"dpid\", ovsMacAddress).add(\"priority\", 1).add(\"match\", matchJsonObj).add(\"slice-action\", sliceActionJsonArray);\n\t\t\t// {\"name\":\"S-4_REQ-0\",\"dpid\":\"00:00:f0:4d:a2:33:8e:7d\",\"priority\":1,\"match\":{\"dl_src\":\"f0:62:15:9f:71:97\"},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]}\n\t\t\t\n\t\t\taddFlowspaceArray.add(addFlowspaceParamObj);\n\t\t\t// [{addFlowspaceParamObj1}, {addFlowspaceParamObj2}, ... ]\n\t\t\t\n\t\t\tJsonObject addFlowspaceJsonReq= new JsonObject();\n\t\t\taddFlowspaceJsonReq.add(\"id\",1).add(\"method\", \"add-flowspace\").add(\"params\", addFlowspaceArray).add(\"jsonrpc\", \"2.0\");\n\t\t\t\n\t\t\t//\tCommit flowspace creation by making flowvisor request\n\t\t\tif(COMMIT_DEPLOYMENT)makeFvRequest(\"add-flowspace\", addFlowspaceJsonReq.toString());\n\t\t\t//else PrintContainerValues.prettyPrintJSONAsString(addFlowspaceJsonReq.toString());\n\t\t\t\n\t\t}\n\t\t\n\t\t//JsonObject addFlowspaceJsonReq= new JsonObject();\n\t\t//addFlowspaceJsonReq.add(\"id\",1).add(\"method\", \"add-flowspace\").add(\"params\", addFlowspaceArray).add(\"jsonrpc\", \"2.0\");\n\t\t// {\"id\":1, \"method\":\"add-flowspace\", \"params\": [{addFlowspaceParamObj1}, {addFlowspaceParamObj2}, ... ], \"jsonrpc\":\"2.0\"}\n\t\t\n\t\t// curl -k -d '{\"id\":1,\"method\":\"add-flowspace\",\"params\":[{\"name\":\"S-1_REQ-0_FS-0\",\"dpid\":\"00:0037d\",\"priority\":1,\"match\":{\"dl_vlan\":1000},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]}],\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.200:8081\n\t\t// curl -k -d '{\"id\":1,\"method\":\"add-flowspace\",\"params\":[{\"name\":\"S-1_REQ-0_FS-0\",\"dpid\":\"00:00:f0:4d:a2:33:8e:7d\",\"priority\":1,\"match\":{\"dl_vlan\":1000},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]},{\"name\":\"S-10_REQ-0_FS-1\",\"dpid\":\"5e:3e:08:9e:01:93:5d:90\",\"priority\":1,\"match\":{\"dl_vlan\":1000},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]},{\"name\":\"S-4_REQ-0_FS-2\",\"dpid\":\"00:00:d4:ae:52:d2:73:da\",\"priority\":1,\"match\":{\"dl_vlan\":1000},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]},{\"name\":\"S-3_REQ-0_FS-3\",\"dpid\":\"5e:3e:08:9e:01:93:5e:08\",\"priority\":1,\"match\":{\"dl_vlan\":1000},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]},{\"name\":\"S-2_REQ-0_FS-4\",\"dpid\":\"5e:3e:c4:54:44:4f:2b:24\",\"priority\":1,\"match\":{\"dl_vlan\":1000},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]}],\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.200:8081\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// curl -k -d '{\"id\":1,\"method\":\"add-flowspace\",\"params\":[{\"name\":\"S-6_REQ-0\",\"dpid\":\"00:00:f0:4d:a2:33:8e:7d\",\"priority\":1,\"match\":{\"dl_src\":\"5e:ef:de:b5:7e:b2\"},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]},{\"name\":\"S-5_REQ-0\",\"dpid\":\"00:00:d4:ae:52:d2:73:da\",\"priority\":1,\"match\":{\"dl_src\":\"32:bb:e5:61:66:fa\"},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]},{\"name\":\"S-5_REQ-0\",\"dpid\":\"00:00:d4:ae:52:d2:73:da\",\"priority\":1,\"match\":{\"dl_src\":\"fa:83:bb:4b:cb:c0\"},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]}],\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.101:8081\n\t\t// \n\t\t// curl -k -d '{\"id\":1,\"method\":\"add-flowspace\",\"params\":[{\"name\":\"S-3_REQ-0_FS-0\",\"dpid\":\"00:00:f0:4d:a2:33:8e:7d\",\"priority\":1,\"match\":{\"dl_src\":\"08:0d:40:bd:51:e2\"},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]}],\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.101:8081\n\t\t// curl -k -d '{\"id\":1,\"method\":\"add-flowspace\",\"params\":[{\"name\":\"S-4_REQ-0_FS-0\",\"dpid\":\"00:00:d4:ae:52:d2:73:da\",\"priority\":1,\"match\":{\"dl_src\":\"2c:ed:7a:9c:1a:2b\"},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]}],\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.101:8081\n\t\t// curl -k -d '{\"id\":1,\"method\":\"add-flowspace\",\"params\":[{\"name\":\"S-4_REQ-0_FS-1\",\"dpid\":\"00:00:d4:ae:52:d2:73:da\",\"priority\":1,\"match\":{\"dl_src\":\"00:34:63:74:74:dd\"},\"slice-action\":[{\"slice-name\":\"REQ-0\",\"permission\":7}]}],\"jsonrpc\":\"2.0\"}' https://fvadmin:@192.168.0.101:8081\n\t\t\n\t\t//PrintContainerValues.prettyPrintJSONAsString(addFlowspaceJsonReq.toString());\n\t\t//makeFvRequest(\"add-flowspace\", addFlowspaceJsonReq.toString());\n\t\treturn threadSleepTime;\n\t}", "public CreateDeviceRequest(CreateDeviceRequest source) {\n if (source.ProductId != null) {\n this.ProductId = new String(source.ProductId);\n }\n if (source.DeviceName != null) {\n this.DeviceName = new String(source.DeviceName);\n }\n if (source.DevAddr != null) {\n this.DevAddr = new String(source.DevAddr);\n }\n if (source.AppKey != null) {\n this.AppKey = new String(source.AppKey);\n }\n if (source.DevEUI != null) {\n this.DevEUI = new String(source.DevEUI);\n }\n if (source.AppSKey != null) {\n this.AppSKey = new String(source.AppSKey);\n }\n if (source.NwkSKey != null) {\n this.NwkSKey = new String(source.NwkSKey);\n }\n if (source.DefinedPsk != null) {\n this.DefinedPsk = new String(source.DefinedPsk);\n }\n }", "private void createRequest() {\n // Configure Google Sign In\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n // Build a GoogleSignInClient with the options specified by gso.\n mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n }", "public QBXMLRequest() {\n }", "static public QRScanProviderVolunteerRequest create(String serializedData) {\n Gson gson = new Gson();\n return gson.fromJson(serializedData, QRScanProviderVolunteerRequest.class);\n }", "public RequestUpdateCancha() {\n }", "public Builder setRequest(com.czht.face.recognition.Czhtdev.Request value) {\n if (requestBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n request_ = value;\n onChanged();\n } else {\n requestBuilder_.setMessage(value);\n }\n bitField0_ |= 0x00000002;\n return this;\n }", "public InquiryLftrattribRequest()\r\n\t{\r\n\t}", "public LogVendorRequest (long id) {\r\n\t\tsuper(id);\r\n\t}", "public ReAuthRequest createReAuthRequest(Request req) {\n return null;\r\n }", "protected RequestLine createRequestLine(String method, String uri, ProtocolVersion ver) {\n/* 337 */ return new BasicRequestLine(method, uri, ver);\n/* */ }", "private BenchmarkRequest(com.google.protobuf.GeneratedMessage.Builder builder) {\n super(builder);\n }", "public void makeRequest() {\n Request newRequest = new Request();\n\n if (mProduct == null) {\n Toast.makeText(getContext(), \"BAD\", Toast.LENGTH_LONG).show();\n return;\n }\n\n newRequest.setClient(ParseUser.getCurrentUser());\n newRequest.setProduct(mProduct);\n newRequest.setBeaut(mBeaut);\n\n Date dateTime = new Date(selectedAppointmet.appDate.getTimeInMillis());\n newRequest.setDateTime(dateTime);\n // TODO: uncomment below line when dataset is clean and products have lengths\n// newRequest.setLength(mProduct.getLength());\n newRequest.setLength(1);\n newRequest.setSeat(selectedAppointmet.seatId);\n newRequest.setDescription(rComments.getText().toString());\n\n sendRequest(newRequest);\n }", "public NewDeviceRequest(String deviceId) {\n super();\n setId(deviceId);\n }", "public DescribeEventsRequest() {}", "public void createServiceRequest() {\n getMainActivity().startService(new Intent(getMainActivity(), RequestService.class));\n }", "public ClearRequest() {\n // default constructor\n }", "private DdzReadyRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private CalRequest(\r\n\t\t\t\tcom.google.protobuf.GeneratedMessage.Builder<?> builder) {\r\n\t\t\tsuper(builder);\r\n\t\t\tthis.unknownFields = builder.getUnknownFields();\r\n\t\t}", "@Override\n\tprotected void initForInspect(AWRequestContext requestContext) {\n\n\t}", "@Override\n\tpublic void initRequest() {\n\n\t}", "public CardRequest() {\r\n card = new MSRData(); // an empty one\r\n }", "@Deprecated\n public static RequestRejectReleasePdu createRequestPdu(int sourceId, int messageId, int multicastGroupAddress) {\n return new RequestRejectReleasePdu(Request_PDU, sourceId, messageId, multicastGroupAddress);\n }", "public LogVendorRequest (\r\n\t\tlong id,\r\n\t\tlong vendorId) {\r\n\r\n\t\tsuper (\r\n\t\t\tid,\r\n\t\t\tvendorId);\r\n\t}", "private VirtualDatacenterDto getValidVdc(final VirtualDatacenter vdc)\n {\n\n ClientResponse response =\n get(resolveVirtualDatacenterURI(vdc.getId()), SYSADMIN, SYSADMIN,\n VirtualDatacenterDto.MEDIA_TYPE);\n assertEquals(response.getStatusCode(), Status.OK.getStatusCode());\n\n VirtualDatacenterDto dto = response.getEntity(VirtualDatacenterDto.class);\n return dto;\n }", "public com.vodafone.global.er.decoupling.binding.request.SelfcareSubscriptionsRequest createSelfcareSubscriptionsRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.SelfcareSubscriptionsRequestImpl();\n }", "com.exacttarget.wsdl.partnerapi.QueryRequest addNewQueryRequest();", "public GetContactRequest()\r\n {\r\n }", "private Builder() {\n super(sparqles.avro.discovery.DGETInfo.SCHEMA$);\n }", "private DistributedClearOperation(OperationType op, RegionEventImpl event,\n RegionVersionVector rvv, Set<InternalDistributedMember> recipients) {\n super(event);\n this.rvv = rvv;\n operation = op;\n this.recipients = recipients;\n if (event != null) {\n operationTag = event.getVersionTag();\n }\n }", "public MessageRequest() {\n\t}", "public VersionsRequest(String user, String filename){\n super(user, filename);\n }", "public ChatRequest()\r\n\t{\r\n\t}", "TransferInitiateResponse initiateConsumerRequest(DataRequest dataRequest);", "public IComplianceRequest buildRequest(final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions) {\n return new com.microsoft.graph.requests.extensions.ComplianceRequest(getRequestUrl(), getClient(), requestOptions);\n }", "@Override\r\n public Context initControlContext() throws Exception {\r\n _log.info(\"\");\r\n _log.info(\"...Preparing generation of free generate\");\r\n for (DfFreeGenRequest request : _freeGenRequestList) {\r\n _log.info(\" \" + request.toString());\r\n }\r\n final VelocityContext context = createVelocityContext();\r\n return context;\r\n }", "public RequestAuthorizeGuestDTO() {\n\t\tsuper();\n\t}", "public CreateDeviceRequest(CreateDeviceRequest source) {\n if (source.ProjectId != null) {\n this.ProjectId = new String(source.ProjectId);\n }\n if (source.DeviceId != null) {\n this.DeviceId = new String(source.DeviceId);\n }\n if (source.DeviceName != null) {\n this.DeviceName = new String(source.DeviceName);\n }\n if (source.DeviceType != null) {\n this.DeviceType = new String(source.DeviceType);\n }\n if (source.DeviceToken != null) {\n this.DeviceToken = new String(source.DeviceToken);\n }\n }", "pvcs createpvcs();", "public CreateDirectConnectTunnelRequest(CreateDirectConnectTunnelRequest source) {\n if (source.DirectConnectId != null) {\n this.DirectConnectId = new String(source.DirectConnectId);\n }\n if (source.DirectConnectTunnelName != null) {\n this.DirectConnectTunnelName = new String(source.DirectConnectTunnelName);\n }\n if (source.DirectConnectOwnerAccount != null) {\n this.DirectConnectOwnerAccount = new String(source.DirectConnectOwnerAccount);\n }\n if (source.NetworkType != null) {\n this.NetworkType = new String(source.NetworkType);\n }\n if (source.NetworkRegion != null) {\n this.NetworkRegion = new String(source.NetworkRegion);\n }\n if (source.VpcId != null) {\n this.VpcId = new String(source.VpcId);\n }\n if (source.DirectConnectGatewayId != null) {\n this.DirectConnectGatewayId = new String(source.DirectConnectGatewayId);\n }\n if (source.Bandwidth != null) {\n this.Bandwidth = new Long(source.Bandwidth);\n }\n if (source.RouteType != null) {\n this.RouteType = new String(source.RouteType);\n }\n if (source.BgpPeer != null) {\n this.BgpPeer = new BgpPeer(source.BgpPeer);\n }\n if (source.RouteFilterPrefixes != null) {\n this.RouteFilterPrefixes = new RouteFilterPrefix[source.RouteFilterPrefixes.length];\n for (int i = 0; i < source.RouteFilterPrefixes.length; i++) {\n this.RouteFilterPrefixes[i] = new RouteFilterPrefix(source.RouteFilterPrefixes[i]);\n }\n }\n if (source.Vlan != null) {\n this.Vlan = new Long(source.Vlan);\n }\n if (source.TencentAddress != null) {\n this.TencentAddress = new String(source.TencentAddress);\n }\n if (source.CustomerAddress != null) {\n this.CustomerAddress = new String(source.CustomerAddress);\n }\n if (source.TencentBackupAddress != null) {\n this.TencentBackupAddress = new String(source.TencentBackupAddress);\n }\n if (source.CloudAttachId != null) {\n this.CloudAttachId = new String(source.CloudAttachId);\n }\n if (source.BfdEnable != null) {\n this.BfdEnable = new Long(source.BfdEnable);\n }\n if (source.NqaEnable != null) {\n this.NqaEnable = new Long(source.NqaEnable);\n }\n if (source.BfdInfo != null) {\n this.BfdInfo = new BFDInfo(source.BfdInfo);\n }\n if (source.NqaInfo != null) {\n this.NqaInfo = new NQAInfo(source.NqaInfo);\n }\n }", "private Builder(sparqles.avro.discovery.DGETInfo other) {\n super(sparqles.avro.discovery.DGETInfo.SCHEMA$);\n if (isValidValue(fields()[0], other.allowedByRobotsTXT)) {\n this.allowedByRobotsTXT = data().deepCopy(fields()[0].schema(), other.allowedByRobotsTXT);\n fieldSetFlags()[0] = true;\n }\n if (isValidValue(fields()[1], other.Operation)) {\n this.Operation = data().deepCopy(fields()[1].schema(), other.Operation);\n fieldSetFlags()[1] = true;\n }\n if (isValidValue(fields()[2], other.URL)) {\n this.URL = data().deepCopy(fields()[2].schema(), other.URL);\n fieldSetFlags()[2] = true;\n }\n if (isValidValue(fields()[3], other.Exception)) {\n this.Exception = data().deepCopy(fields()[3].schema(), other.Exception);\n fieldSetFlags()[3] = true;\n }\n if (isValidValue(fields()[4], other.ResponseType)) {\n this.ResponseType = data().deepCopy(fields()[4].schema(), other.ResponseType);\n fieldSetFlags()[4] = true;\n }\n if (isValidValue(fields()[5], other.ResponseCode)) {\n this.ResponseCode = data().deepCopy(fields()[5].schema(), other.ResponseCode);\n fieldSetFlags()[5] = true;\n }\n if (isValidValue(fields()[6], other.ResponseServer)) {\n this.ResponseServer = data().deepCopy(fields()[6].schema(), other.ResponseServer);\n fieldSetFlags()[6] = true;\n }\n if (isValidValue(fields()[7], other.ResponseLink)) {\n this.ResponseLink = data().deepCopy(fields()[7].schema(), other.ResponseLink);\n fieldSetFlags()[7] = true;\n }\n if (isValidValue(fields()[8], other.Content)) {\n this.Content = data().deepCopy(fields()[8].schema(), other.Content);\n fieldSetFlags()[8] = true;\n }\n if (isValidValue(fields()[9], other.SPARQLDESCpreds)) {\n this.SPARQLDESCpreds = data().deepCopy(fields()[9].schema(), other.SPARQLDESCpreds);\n fieldSetFlags()[9] = true;\n }\n if (isValidValue(fields()[10], other.voiDpreds)) {\n this.voiDpreds = data().deepCopy(fields()[10].schema(), other.voiDpreds);\n fieldSetFlags()[10] = true;\n }\n }", "public AuthorizationRequest() { }", "public PickUpCasualtyRequest() {\n\n // empty\n }", "public DataRequest() {\n\t\tfilters = new ArrayList<FilteringRule>();\n\t\tsort_by = new ArrayList<SortingRule>();\n\t}", "@Override\n protected void handleRequest(final Message request, final ConnectionKey connkey, final Peer peer) {\n final Message answer = new Message();\n answer.prepareResponse(request);\n AVP avp;\n avp = request.find(ProtocolConstants.DI_SESSION_ID);\n if (avp != null) {\n answer.add(avp);\n }\n node().addOurHostAndRealm(answer);\n avp = request.find(ProtocolConstants.DI_CC_REQUEST_TYPE);\n if (avp == null) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_MISSING_AVP,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP,\n new AVP[]{new AVP(ProtocolConstants.DI_CC_REQUEST_TYPE, new byte[]{})})});\n return;\n }\n final int ccRequestType; // = -1;\n try {\n ccRequestType = new AVP_Unsigned32(avp).queryValue();\n } catch (final InvalidAVPLengthException ex) {\n throw new AssertionError(\"Unexpected exception: \" + ex, ex);\n }\n if (ccRequestType != ProtocolConstants.DI_CC_REQUEST_TYPE_INITIAL_REQUEST\n && ccRequestType != ProtocolConstants.DI_CC_REQUEST_TYPE_UPDATE_REQUEST\n && ccRequestType != ProtocolConstants.DI_CC_REQUEST_TYPE_TERMINATION_REQUEST\n && ccRequestType != ProtocolConstants.DI_CC_REQUEST_TYPE_EVENT_REQUEST) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_INVALID_AVP_VALUE,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{avp})});\n return;\n }\n\n //This test server does not support multiple-services-cc\n avp = request.find(ProtocolConstants.DI_MULTIPLE_SERVICES_CREDIT_CONTROL);\n if (avp != null) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_INVALID_AVP_VALUE,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{avp})});\n return;\n }\n avp = request.find(ProtocolConstants.DI_MULTIPLE_SERVICES_INDICATOR);\n if (avp != null) {\n int indicator = -1;\n try {\n indicator = new AVP_Unsigned32(avp).queryValue();\n } catch (final InvalidAVPLengthException ex) {\n throw new AssertionError(\"Unexpected exception: \" + ex, ex);\n }\n if (indicator != ProtocolConstants.DI_MULTIPLE_SERVICES_INDICATOR_MULTIPLE_SERVICES_NOT_SUPPORTED) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_INVALID_AVP_VALUE,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{avp})});\n return;\n }\n }\n\n answer.add(new AVP_Unsigned32(ProtocolConstants.DI_RESULT_CODE, ProtocolConstants.DIAMETER_RESULT_SUCCESS));\n avp = request.find(ProtocolConstants.DI_AUTH_APPLICATION_ID);\n if (avp != null) {\n answer.add(avp);\n }\n avp = request.find(ProtocolConstants.DI_CC_REQUEST_TYPE);\n if (avp != null) {\n answer.add(avp);\n }\n avp = request.find(ProtocolConstants.DI_CC_REQUEST_NUMBER);\n if (avp != null) {\n answer.add(avp);\n }\n\n switch (ccRequestType) {\n case ProtocolConstants.DI_CC_REQUEST_TYPE_INITIAL_REQUEST:\n case ProtocolConstants.DI_CC_REQUEST_TYPE_UPDATE_REQUEST:\n case ProtocolConstants.DI_CC_REQUEST_TYPE_TERMINATION_REQUEST:\n //grant whatever is requested\n avp = request.find(ProtocolConstants.DI_REQUESTED_SERVICE_UNIT);\n if (avp != null) {\n final AVP g = new AVP(avp);\n g.code = ProtocolConstants.DI_GRANTED_SERVICE_UNIT;\n answer.add(avp);\n }\n break;\n case ProtocolConstants.DI_CC_REQUEST_TYPE_EVENT_REQUEST:\n //examine requested-action\n avp = request.find(ProtocolConstants.DI_REQUESTED_ACTION);\n if (avp == null) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_MISSING_AVP,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP,\n new AVP[]{new AVP(ProtocolConstants.DI_REQUESTED_ACTION, new byte[]{})})});\n return;\n }\n int requestedAction = -1;\n try {\n requestedAction = new AVP_Unsigned32(avp).queryValue();\n } catch (final InvalidAVPLengthException ex) {\n throw new AssertionError(\"Unexpected exception: \" + ex, ex);\n }\n switch (requestedAction) {\n case ProtocolConstants.DI_REQUESTED_ACTION_DIRECT_DEBITING:\n //nothing. just indicate success\n break;\n case ProtocolConstants.DI_REQUESTED_ACTION_REFUND_ACCOUNT:\n //nothing. just indicate success\n break;\n case ProtocolConstants.DI_REQUESTED_ACTION_CHECK_BALANCE:\n //report back that the user has sufficient balance\n answer.add(new AVP_Unsigned32(ProtocolConstants.DI_CHECK_BALANCE_RESULT,\n ProtocolConstants.DI_DI_CHECK_BALANCE_RESULT_ENOUGH_CREDIT));\n break;\n case ProtocolConstants.DI_REQUESTED_ACTION_PRICE_ENQUIRY:\n //report back a price of DKK42.17 per kanelsnegl\n answer.add(new AVP_Grouped(ProtocolConstants.DI_COST_INFORMATION,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_UNIT_VALUE,\n new AVP[]{new AVP_Integer64(ProtocolConstants.DI_VALUE_DIGITS, 4217),\n new AVP_Integer32(ProtocolConstants.DI_EXPONENT, -2)\n }),\n new AVP_Unsigned32(ProtocolConstants.DI_CURRENCY_CODE, 208),\n new AVP_UTF8String(ProtocolConstants.DI_COST_UNIT, \"kanelsnegl\")\n }));\n break;\n default: {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_INVALID_AVP_VALUE,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{avp})});\n return;\n }\n\n }\n break;\n default:\n throw new AssertionError(\"Unexpected value:\" + ccRequestType);\n }\n\n Utils.setMandatory_RFC3588(answer);\n\n try {\n answer(answer, connkey);\n } catch (final NotAnAnswerException ex) {\n throw new AssertionError(\"Unexpected exception: \" + ex, ex);\n }\n }", "protected VClass getVclassParameter(VitroRequest vreq) {\n\t\tString vclassId = vreq.getParameter(\"vclassId\");\n\t\tif (StringUtils.isEmpty(vclassId)) {\n\t\t\tlog.error(\"parameter vclassId expected but not found\");\n\t\t\tthrow new IllegalStateException(\"parameter vclassId expected \");\n\t\t}\n\t\treturn instantiateVclass(vclassId, vreq);\n\t}", "private Builder(sparqles.avro.discovery.DGETInfo.Builder other) {\n super(other);\n if (isValidValue(fields()[0], other.allowedByRobotsTXT)) {\n this.allowedByRobotsTXT = data().deepCopy(fields()[0].schema(), other.allowedByRobotsTXT);\n fieldSetFlags()[0] = true;\n }\n if (isValidValue(fields()[1], other.Operation)) {\n this.Operation = data().deepCopy(fields()[1].schema(), other.Operation);\n fieldSetFlags()[1] = true;\n }\n if (isValidValue(fields()[2], other.URL)) {\n this.URL = data().deepCopy(fields()[2].schema(), other.URL);\n fieldSetFlags()[2] = true;\n }\n if (isValidValue(fields()[3], other.Exception)) {\n this.Exception = data().deepCopy(fields()[3].schema(), other.Exception);\n fieldSetFlags()[3] = true;\n }\n if (isValidValue(fields()[4], other.ResponseType)) {\n this.ResponseType = data().deepCopy(fields()[4].schema(), other.ResponseType);\n fieldSetFlags()[4] = true;\n }\n if (isValidValue(fields()[5], other.ResponseCode)) {\n this.ResponseCode = data().deepCopy(fields()[5].schema(), other.ResponseCode);\n fieldSetFlags()[5] = true;\n }\n if (isValidValue(fields()[6], other.ResponseServer)) {\n this.ResponseServer = data().deepCopy(fields()[6].schema(), other.ResponseServer);\n fieldSetFlags()[6] = true;\n }\n if (isValidValue(fields()[7], other.ResponseLink)) {\n this.ResponseLink = data().deepCopy(fields()[7].schema(), other.ResponseLink);\n fieldSetFlags()[7] = true;\n }\n if (isValidValue(fields()[8], other.Content)) {\n this.Content = data().deepCopy(fields()[8].schema(), other.Content);\n fieldSetFlags()[8] = true;\n }\n if (isValidValue(fields()[9], other.SPARQLDESCpreds)) {\n this.SPARQLDESCpreds = data().deepCopy(fields()[9].schema(), other.SPARQLDESCpreds);\n fieldSetFlags()[9] = true;\n }\n if (isValidValue(fields()[10], other.voiDpreds)) {\n this.voiDpreds = data().deepCopy(fields()[10].schema(), other.voiDpreds);\n fieldSetFlags()[10] = true;\n }\n }", "private Request(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Request(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Request(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Request(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public com.vodafone.global.er.decoupling.binding.request.SelfcareMicroServicesRequest createSelfcareMicroServicesRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.SelfcareMicroServicesRequestImpl();\n }", "public RequestEntity(Entity entity, Monitor monitor) {\n this.builder = new FormCreator(this, entity);\n this.channel = entity.getChannel();\n this.header = entity.getHeader(); \n this.body = entity.getBody();\n this.entity = entity;\n }", "public com.vodafone.global.er.decoupling.binding.request.ErRequest createErRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.ErRequestImpl();\n }", "public VITACareer()\r\n {\r\n }", "protected void createLocationRequest() {\n\t\tmLocationRequest = new LocationRequest();\n\t\tmLocationRequest.setInterval(UPDATE_INTERVAL);\n\t\tmLocationRequest.setFastestInterval(FATEST_INTERVAL);\n\t\tmLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\t\tmLocationRequest.setSmallestDisplacement(DISPLACEMENT);\n\t}", "public Map<String, AccessPoint> createParameters() {\r\n\t\tMap<String, AccessPoint> pm = new TreeMap<String, AccessPoint>();\r\n\t\tpm.put(\"vcNumber\", new MutableFieldAccessPoint(\"vcNumber\", this));\r\n\t\treturn pm;\r\n\t}", "public CartCreateRequest(String email, String ltc, Integer siteID,\n\t\t\tInteger languageID, String ccy) {\n\t\tsuper();\n\t\tthis.email = email;\n\t\tthis.ltc = ltc;\n\t\tthis.siteID = siteID;\n\t\tthis.languageID = languageID;\n\t\tthis.ccy = ccy;\n\t}" ]
[ "0.7528393", "0.5745801", "0.56229246", "0.55327314", "0.54822487", "0.54702735", "0.5390817", "0.5300221", "0.5287298", "0.52747524", "0.5226188", "0.52197915", "0.52050275", "0.52044046", "0.51761264", "0.51716244", "0.516824", "0.51364076", "0.5134805", "0.5098682", "0.50606555", "0.50523394", "0.50280625", "0.50217", "0.4959576", "0.49546102", "0.49419558", "0.49346858", "0.49250606", "0.49172595", "0.48909426", "0.48812693", "0.48771468", "0.487199", "0.487199", "0.48711476", "0.48631698", "0.4844617", "0.48384282", "0.48371646", "0.4829741", "0.48185623", "0.48075208", "0.48056668", "0.48051763", "0.4791265", "0.478071", "0.47702858", "0.47693428", "0.47588652", "0.4755531", "0.4738557", "0.47309208", "0.47289333", "0.4728916", "0.47212952", "0.47130752", "0.47072488", "0.47063556", "0.47048524", "0.47044095", "0.47042084", "0.47016627", "0.4701059", "0.46989107", "0.46914992", "0.4691327", "0.4689532", "0.4680908", "0.468036", "0.46741503", "0.46736717", "0.46591768", "0.46512762", "0.46491846", "0.46456635", "0.4642154", "0.46415952", "0.46321347", "0.46236786", "0.46209326", "0.4617605", "0.4609175", "0.46015957", "0.4598297", "0.45969832", "0.45909393", "0.45903394", "0.45874247", "0.45866188", "0.45866188", "0.45866188", "0.45866188", "0.45866045", "0.45851833", "0.45750943", "0.45681506", "0.456771", "0.45666406", "0.45481804" ]
0.66525733
1
Always reads at least one line. Reads one line if lower is zero or less.
public static double[] skipUntil( BufferedReader[] zeroIn, double lower) { String[] input = new String[zeroIn.length]; double[] lastValue = new double[zeroIn.length]; double zero = Double.MAX_VALUE; try { while (true) { for (int i = 0; i < input.length; i++) { input[i] = zeroIn[i].readLine(); if(input[i] == null){ System.out.println("End reached"); return null; } } zero = populateNextValues(lastValue, input); if(zero >= lower){break;} } } catch (IOException e) { throw new IllegalStateException("readline", e); } return lastValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void readNext() {\n nextLine = null;\n try {\n while (nextLine == null) {\n nextLine = reader.readNext();\n reader.consumeEmptyLines();\n if (reader.eof()) {\n break;\n }\n }\n if (nextLine != null) {\n super.recordCounter++;\n if (super.readLimit > 0 && super.recordCounter > super.readLimit) {\n nextLine = null;\n }\n }\n } catch (Exception ignore) {\n // no more lines\n }\n }", "public String readFirstLine() {\n if ( scanner.hasNextLine() ) {\n return scanner.nextLine();\n }\n return \"\";\n }", "protected void readAhead() {\n if (! reader.hasNext()) {\n this.nextLine = null;\n } else {\n this.nextLine = reader.next();\n while (this.nextLine != null && this.nextLine.isEmpty() && reader.hasNext())\n this.nextLine = reader.next();\n }\n }", "public abstract String getFirstLine();", "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 }", "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 boolean hasLine(){\r\n\t\tif (getLine().equals(\"\"))\r\n\t\t\treturn false;\r\n\t\telse return true;\r\n\t}", "private static String readNextLine(BufferedReader reader) {\n\t\t\n\t\ttry {\n\t\t\tString line = reader.readLine();\n\t\t\treturn line;\n\t\t} catch(IOException e) {\n\t\t\tGdx.app.error(TAG, \"Failed to read the file\", e);\n\t\t\ttry {\n\t\t\t\treader.close();\n\t\t\t} catch(IOException ex) {\n\t\t\t\tGdx.app.error(TAG, \"Failed to close file\");\n\t\t\t\tGdx.app.exit();\n\t\t\t}\n\t\t\tGdx.app.exit();\n\t\t\treturn null;\n\t\t}\n\t}", "public abstract boolean read(String line);", "public boolean hasNextLine() {\n return nextLine != null;\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 }", "public static boolean hasNextLine() {\n return sc.hasNext();\n }", "public boolean hasNextLine() {\n return sc.hasNextLine();\n }", "public static String readNextLine() {\n return sc.nextLine();\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 boolean scanLine()\r\n\t{\r\n\t\tboolean isLine=true;\r\n\t\t\r\n\t\t//Implement Filter here.\r\n\t\t\r\n\t\treturn isLine;\r\n\t}", "public static void readEmptyLine(BufferedReader input_file_stream) {\n try {\n input_file_stream.readLine();\n } catch (IOException e) {\n System.out.println(\"Error reading empty line from stream \" + input_file_stream.toString());\n }\n }", "public static boolean hasNextLine(){\n \tboolean result = scanner.hasNext();\n \treturn result;\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 String readNextLine() throws IOException {\n if (this.reader == null) {\n return null;\n }\n\n boolean openNext = false;\n String line;\n while ((line = this.reader.readLine()) == null) {\n // The current file is read at the end, ready to read next one\n this.close(this.index);\n\n if (++this.index < this.readables.size()) {\n // Open the second or subsequent readables, need\n this.reader = this.open(this.index);\n openNext = true;\n } else {\n return null;\n }\n }\n // Determine if need to skip duplicate header\n if (openNext && isDuplicateHeader(line)) {\n line = this.readNextLine();\n }\n return line;\n }", "protected String readLine()\n { try { if (stdin!=null) return stdin.readLine(); } catch (IOException e) {}\n return null;\n }", "private boolean lineIsNumberAboveZero(final String line) {\n try {\n return Integer.parseInt(line) > 1;\n } catch(final NumberFormatException nfe) {\n return false;\n }\n }", "public List<String> nextOneLine() throws IOException {\n counterSeveralLines = linesAfter;\n if (StringUtils.isBlank(currentPath)) return null;\n String sCurrentLine;\n if ((sCurrentLine = bufferReader.readLine()) != null) {\n listBefore = addToArray(sCurrentLine);\n }\n return listBefore;\n }", "public static int minimumNumberOfLineItems() {\n return 0;\n }", "public String nextLine() {\n\t\treturn null;\r\n\t}", "@Test(timeout=100)\r\n\tpublic void testSkipEmptyLines() {\r\n\t\tString [] r1 = {\"aaa\",\"bbb\",\"ccc\"};\r\n\t\tString [] r2 = {\"AAA\",\"BBB\"};\r\n\t\tString [] r3 = {\"the-end\"};\r\n\t\twriteArrayToLine(r1);\r\n\t\twriteline(\"\"); // empty line\r\n\t\twriteline(\"\"); // another empty line\r\n\t\twriteArrayToLine(r2);\r\n\t\twriteline(\"\");\r\n\t\twriteArrayToLine(r3);\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\tString [] next = csv.next();\r\n\t\tassertEquals( r1.length, next.length );\r\n\t\tassertArrayEquals( r1, next );\r\n\t\tassertTrue( csv.hasNext() );\r\n\t\tassertArrayEquals( r2, csv.next() );\r\n\t\tassertTrue( csv.hasNext() );\r\n\t\tassertArrayEquals( r3, csv.next() );\r\n\t\tassertFalse( csv.hasNext() );\r\n\t}", "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 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() {\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 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}", "int getLinesRead();", "public String getFirstLine() {\r\n return this.firstLine;\r\n }", "public boolean isLineCountNull() {\n\t\treturn lineCount == null;\n\t}", "public VCFLine getNextValidLine () throws IOException {\n\t\tgoNextLine();\n\t\treturn getCurrentValidLine();\n\t}", "public String getLine(Integer aLineNumber, Boolean aSkipEmpty) {\n\t\tif (size() > 0) {\n\t\t\tInteger count = aLineNumber < 0 ? (mLines.length + aLineNumber) : aLineNumber;\n\t\t\t\n\t\t\twhile(count >= 0 && count < mLines.length) {\n\t\t\t\tif (!aSkipEmpty || mLines[count].trim().length() > 0) {\n\t\t\t\t\treturn mLines[count].trim();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcount = aLineNumber < 0 ? (count - 1) : (count + 1);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\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 abstract boolean isFirstLineHeader();", "public static String readLine(BufferedReader reader, StringBuilder sb0) throws IOException {\n final int readAheadLimit = 2;\n\n int val = 0;\n String retstr = null;\n while (reader.ready()) {\n val = reader.read();\n\n // Stop reading if end of file seen\n if (val == -1) {\n break;\n }\n\n final char c = (char)val;\n\n // Stop reading if we find a line ending and set return string\n if (c == '\\n') {\n retstr = sb0.toString();\n clearAndResizeSbIfNeeded(sb0);\n break;\n } else if (c == '\\r') {\n // Check for Windows line ending, CRLF\n reader.mark(readAheadLimit);\n if (reader.read() != '\\n') {\n reader.reset();\n }\n\n retstr = sb0.toString();\n clearAndResizeSbIfNeeded(sb0);\n break;\n } else {\n sb0.append(c);\n }\n }\n\n return retstr;\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}", "void checkFirstRecord(int code, int lineCount) {\n if (lineCount == 1) {\n outputError(lineCount + \" - Fatal - \" +\n \"Load file must start with a code 01 record. \" +\n \"This record is code: \" + code);\n } // if (lineCount == 1)\n }", "private String nextLine(BufferedReader reader) throws IOException {\n String ln = reader.readLine();\n if (ln != null) {\n int ci = ln.indexOf('#');\n if (ci >= 0)\n ln = ln.substring(0, ci);\n ln = ln.trim();\n }\n return ln;\n }", "private String skipEmptyLines(String line, Scanner myReader){\n while (myReader.hasNextLine()){\n if (line.length() == 0){\n line = myReader.nextLine();\n }\n else{\n String[] tokens = line.split(\" \");\n if (tokens.length > 0){\n return line;\n }\n }\n }\n return \"\";\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 void skipEmptyLines() throws IOException {\n for (;;) {\n if (nextChar != ';') {\n do {\n readNextChar();\n } while (isWhitespace(nextChar));\n if (nextChar != ';') return;\n }\n do {\n readNextChar();\n if (nextChar == -1) return;\n } while (nextChar != '\\n');\n }\n }", "public String getFirstLine() {\n return this.firstLine;\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}", "int nextLine(int allocate) throws IOException {\n final int length = lineLoader.nextLine(allocate);\n if(length>=0)\n lineNumber++;\n return length;\n }", "protected long skipLines(FSDataInputStream in, BufferedReader reader, \n long numLines) \n throws IOException {\n long lineNum = 0;\n while (lineNum != numLines) {\n String line = reader.readLine();\n if (line == null) {\n break;\n }\n lineNum++;\n }\n LOG.info(\"Skipped \" + lineNum + \" lines\");\n if (lineNum != numLines) {\n LOG.warn(\"Skipped wrong number of lines\");\n }\n return lineNum;\n }", "private String fileReadOneLine(String fname) {\n BufferedReader br;\n String line = null;\n\n try {\n br = new BufferedReader(new FileReader(fname), 512);\n try {\n line = br.readLine();\n } finally {\n br.close();\n }\n } catch (Exception e) {\n Log.e(TAG, \"Exception when reading /sys/* file\", e);\n }\n return line;\n }", "public synchronized String Readline() {\n\t return lines.poll();\n\t}", "public int getLine() { \n\t// * JFlex starts in zero\n\treturn yyline+1;\n}", "private String getNextLine() throws IOException {\n final BufferedReader in = this.in;\n if (in == null) {\n throw new NoSuchElementException();\n } else {\n final String nextLine = this.in.readLine();\n if (nextLine == null) {\n throw new NoSuchElementException();\n }\n return nextLine;\n }\n }", "protected void setMinLineCount(int minLineCount) {\n\t\tthis.minLineCount = minLineCount;\n\t}", "public String nextLine()\n\t{\t\t\n\t\t\n\t\treturn this.getIn().nextLine();\n\t}", "private void checkEmptyLine(String line) {\n if (line.substring(5).replace('\\t', ' ')\n .replace('\\n', ' ').trim().length() != 0) {\n throw new IllegalArgumentException(\"Invalid characters after tag.\");\n }\n }", "void getNextLine()\n\t\t\tthrows IOException, FileNotFoundException {\n String nextLine = \"\";\n if (reader == null) {\n nextLine = textLineReader.readLine();\n } else {\n nextLine = reader.readLine();\n }\n if (nextLine == null) {\n atEnd = true;\n line = new StringBuffer();\n } else {\n\t\t line = new StringBuffer (nextLine);\n }\n if (context.isTextile()) {\n textilize ();\n }\n\t\tlineLength = line.length();\n\t\tlineIndex = 0;\n\t}", "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 }", "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 }", "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}", "@Override\n public String readLine() {\n try {\n return this.bufferedReader.readLine();\n } catch (IOException e) {\n return \"\";\n }\n }", "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}", "axiom Object readLine(Object BufferedReader(FileReaderr f)) {\n\treturn f.get(0);\n }", "protected boolean ignoreLinesStartWith(char a) {\r\n if (!this.hasNextToken()) return false;\r\n boolean b = false;\r\n while (true) {\r\n char c = this.stream.peek();\r\n if (c==a) {\r\n this.getUntilMeetChar('\\n');\r\n b = true;\r\n continue;\r\n }\r\n return b;\r\n }\r\n }", "private boolean consumeSingleLine(final String message) {\n\t\tif(startParsing(message))\n\t\t\treturn match(message);\n\n\t\treturn false;\n\t}", "private static int skipLines(int noOfLines, DataInputStream dis){\n\t\tint len = -1;\n\t\tfor(int i = 0; i < noOfLines; i++){\n\t\t\tint templen = readLine(dis);\n\t\t\tif(templen > 0){\n\t\t\t\tlen = templen;\n\t\t\t}\n\t\t}\n\t\treturn len;\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 }", "public abstract String readLine() throws IOException, InterruptedException;", "private void processFirstLine(String line) {\r\n\t\tString[] numsAsStr = line.split(\" \");\r\n\t\tnumRows = Integer.parseInt(numsAsStr[0]);\r\n\t\tnumCols = Integer.parseInt(numsAsStr[1]);\r\n\t\t/**\r\n\t\t * Taken out for time testing\r\n\t\t */\r\n//\t\tSystem.out.println(\"Rows: \" + numRows + \" Cols: \" + numCols);\r\n\t}", "static boolean Line(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"Line\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = Word(b, l + 1);\n r = r && Line_1(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "private String readLine() throws IOException {\n/* 276 */ String line = null;\n/* */ \n/* */ \n/* 279 */ boolean isLastFilePart = (this.no == 1L);\n/* */ \n/* 281 */ int i = this.currentLastBytePos;\n/* 282 */ while (i > -1) {\n/* */ \n/* 284 */ if (!isLastFilePart && i < ReversedLinesFileReader.this.avoidNewlineSplitBufferSize) {\n/* */ \n/* */ \n/* 287 */ createLeftOver();\n/* */ \n/* */ break;\n/* */ } \n/* */ int newLineMatchByteCount;\n/* 292 */ if ((newLineMatchByteCount = getNewLineMatchByteCount(this.data, i)) > 0) {\n/* 293 */ int lineStart = i + 1;\n/* 294 */ int lineLengthBytes = this.currentLastBytePos - lineStart + 1;\n/* */ \n/* 296 */ if (lineLengthBytes < 0) {\n/* 297 */ throw new IllegalStateException(\"Unexpected negative line length=\" + lineLengthBytes);\n/* */ }\n/* 299 */ byte[] lineData = new byte[lineLengthBytes];\n/* 300 */ System.arraycopy(this.data, lineStart, lineData, 0, lineLengthBytes);\n/* */ \n/* 302 */ line = new String(lineData, ReversedLinesFileReader.this.encoding);\n/* */ \n/* 304 */ this.currentLastBytePos = i - newLineMatchByteCount;\n/* */ \n/* */ break;\n/* */ } \n/* */ \n/* 309 */ i -= ReversedLinesFileReader.this.byteDecrement;\n/* */ \n/* */ \n/* 312 */ if (i < 0) {\n/* 313 */ createLeftOver();\n/* */ \n/* */ break;\n/* */ } \n/* */ } \n/* */ \n/* 319 */ if (isLastFilePart && this.leftOver != null) {\n/* */ \n/* 321 */ line = new String(this.leftOver, ReversedLinesFileReader.this.encoding);\n/* 322 */ this.leftOver = null;\n/* */ } \n/* */ \n/* 325 */ return line;\n/* */ }", "public VCFLine getCurrentValidLine () {\n\t\tcurrentLine = reader.getCurrentLine();\n\t\tpassValidation(currentLine);\n\t\treturn currentLine;\n\t}", "protected boolean checkEmpty(String line) {\n return line == null || line.isBlank();\n }", "public Stacktrace next() throws IOException {\n\t\tString line;\n\t\tStacktrace stacktrace = null;\n\t\twhile (stacktrace == null && (line = input.readLine()) != null) {\n\t\t\tif (!StringUtils.isEmpty(line)) {\n\t\t\t\tlineBuffer.add(line);\n\t\t\t\tstacktrace = processLine(line);\n\t\t\t}\n\t\t}\n\t\treturn stacktrace;\n\t}", "void incrementLinesRead();", "public final int getLine() {\n/* 377 */ return this.bufline[this.bufpos];\n/* */ }", "public static Queue<String> linesFromInput(SimpleReader input) {\n assert input != null : \"Violation of: input is not null\";\n assert input.isOpen() : \"Violation of: input.is_open\";\n\n Queue<String> lines = new Queue1L<String>();\n while (!input.atEOS()) {\n String text = input.nextLine(); // reads next line\n lines.enqueue(text);\n\n }\n return lines;\n }", "public boolean checkLine(String line) {\n int len = line.length();\n return !(len > 0 && Character.isWhitespace(line.charAt(len-1)));\n }", "abstract protected boolean isSkippableLine(String line);", "private String getNextLine(Scanner input)\n\t{\n\t\tString line = input.nextLine().trim();\n\t\twhile ((line.length() == 0 || line.startsWith(\"#\") || line.startsWith(\"!\")) && input.hasNext())\n\t\t\tline = input.nextLine().trim();\n\t\tif (line.startsWith(\"#\") || line.startsWith(\"!\"))\n\t\t\tline = \"\";\n\t\treturn line;\n\t}", "public abstract int getLine();", "public abstract int getLine();", "public int getFirstVisibleLine(){\n int j = Math.min(getOffsetY() / getLineHeight(), getLineCount() - 1);\n if(j < 0){\n return 0;\n }else{\n return j;\n }\n }", "private String nextLine() {\n if (console) {\n return con.nextLine();\n }\n return scan.nextLine();\n\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 boolean hasStartLineNumber() {\n return ((bitField0_ & 0x00000020) != 0);\n }", "public boolean hasStartLineNumber() {\n return ((bitField0_ & 0x00000020) != 0);\n }", "private boolean setNext() throws IOException {\n final String line = mIn.readLine();\n if (line == null) {\n mCurrent = null;\n return false;\n }\n try {\n mCurrent = mParser.parseLine(line);\n if (mCurrent.getNumberOfSamples() != mNumSamples) {\n throw new VcfFormatException(\"Expected \" + mNumSamples + \" samples, but there were \" + mCurrent.getNumberOfSamples());\n }\n } catch (final VcfFormatException e) {\n throw new VcfFormatException(\"Invalid VCF record. \" + e.getMessage() + \" on line:\" + line); // Add context information\n }\n return true;\n }", "public VCFLine getNextLine () throws IOException {\n\t\tgoNextLine();\n\t\treturn reader.getCurrentLine();\n\t}", "abstract public String readLine() throws TerminalException;", "static String readLine(int maxLg) throws IOException {\n\n\t\tbyte lin[] = new byte[maxLg];\n\t\tint lg = 0, car = -1;\n\n\t\twhile (lg < maxLg) {\n\t\t\tcar = System.in.read();\n\t\t\tif ((car < 0) || (car == '\\n')) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlin[lg++] += car;\n\t\t}\n\n\t\tif ((car < 0) && (lg == 0)) {\n\t\t\treturn (null); // eof\n\t\t}\n\n\t\treturn (new String(lin, 0, lg));\n\n\t}", "public static String getLine(InputStreamReader reader) {\n StringBuffer b = new StringBuffer();\n int c;\n try {\n while ((c = reader.read()) != -1 && c != '\\n') {\n if (c != '\\r')\n b.append((char)c);\n }\n } catch (IOException ioe) {\n c = -1;\n }\n\n if (c == -1 && b.length() == 0)\n return null;\n else\n return b.toString();\n }", "public static int getLine() {\r\n\t\treturn rline;\r\n\t}", "private void trim() {\n read(0);\n }", "private void advanceUntilNL() throws BufferEndedException {\twhile (reader.getLastDelimiter()!='\\n') reader.nextToken();}", "public final String readNextLine() throws IOException {\r\n String str;\r\n if (buf_end-buf_pos <= 0) {\r\n if (fillBuffer() < 0) {\r\n throw new IOException(\"Error filling buffer!\");\r\n }\r\n }\r\n int lineEnd = -1;\r\n for (int i = buf_pos; i < buf_end; i++) {\r\n if (buffer[i] == '\\n') {\r\n lineEnd = i;\r\n break;\r\n }\r\n }\r\n if (lineEnd < 0) {\r\n StringBuilder input = new StringBuilder(256);\r\n int c;\r\n while (((c = read()) != -1) && (c != '\\n')) {\r\n input.append((char)c);\r\n }\r\n if ((c == -1) && (input.length() == 0)) {\r\n return null;\r\n }\r\n return input.toString();\r\n }\r\n\r\n if (lineEnd > 0 && buffer[lineEnd-1] == '\\r') {\r\n str = new String(buffer, buf_pos, lineEnd - buf_pos -1);\r\n }\r\n else {\r\n str = new String(buffer, buf_pos, lineEnd - buf_pos);\r\n }\r\n buf_pos = lineEnd +1;\r\n return str;\r\n }", "public static String firstRow(String filePath) {\n\t\tString firstRow = new String();\n\t\ttry { // to catch IOException from readLine\n\t\t\tBufferedReader input = new BufferedReader(new FileReader(filePath));\n\t\t\tfirstRow = input.readLine();\n\t\t} catch (IOException e) {\n\t\t\tMain.debug.LOGWarning(e.toString());\n\t\t}\n\t\t\n\t\treturn firstRow;\n\t\t// 15 Feb 2018 06:33:12,083 22966346 [GxFileTransferThread - Thread 0]...\n\t}", "@Test\n public void testBasicRead() throws IOException {\n String output = singleLineFileInit(file, Charsets.UTF_8);\n\n PositionTracker tracker = new DurablePositionTracker(meta, file.getPath());\n ResettableInputStream in = new ResettableFileInputStream(file, tracker);\n\n String result = readLine(in, output.length());\n assertEquals(output, result);\n\n String afterEOF = readLine(in, output.length());\n assertNull(afterEOF);\n\n in.close();\n }", "public int getLine();", "public int getLine();", "public int getLine();" ]
[ "0.6364667", "0.6292855", "0.62113166", "0.6148203", "0.6047598", "0.5956557", "0.58112365", "0.57391655", "0.5732487", "0.5728883", "0.56991845", "0.5693009", "0.56691176", "0.5651591", "0.5643171", "0.5620504", "0.5605225", "0.55904096", "0.5557117", "0.55348647", "0.54954", "0.54844314", "0.5467952", "0.546605", "0.5445665", "0.54314804", "0.5427061", "0.54194415", "0.53889716", "0.53885436", "0.5387525", "0.53636855", "0.5361057", "0.53552973", "0.5347718", "0.5328225", "0.5325759", "0.5316138", "0.5306684", "0.5305378", "0.53036773", "0.530127", "0.529943", "0.52948725", "0.52808976", "0.5277862", "0.52760005", "0.526362", "0.52604675", "0.52603567", "0.524526", "0.5224968", "0.5185924", "0.5185281", "0.5177867", "0.517667", "0.51599157", "0.51449025", "0.51435107", "0.51395965", "0.5136386", "0.5130694", "0.5128524", "0.5121811", "0.511669", "0.5113148", "0.51040655", "0.50916106", "0.5074448", "0.5054503", "0.50427425", "0.5042228", "0.50142807", "0.5011373", "0.50100577", "0.49984178", "0.49843955", "0.4974925", "0.49587703", "0.49463993", "0.49463993", "0.49421117", "0.49361297", "0.4928218", "0.49254704", "0.49250737", "0.49216485", "0.4909621", "0.49079713", "0.49006605", "0.48990548", "0.4896873", "0.48756635", "0.48753303", "0.48725623", "0.4858347", "0.48507014", "0.4850063", "0.4850063", "0.4850063" ]
0.49216816
86
use 3754 as begin, 1003855 as end
public static void main(String[] args) throws Exception { File file = new File("out/gSeries" + Interpolate.prefix + "/zeros.dat"); // DataOutputStream out = Interpolate.outputStream( file); ZeroInfo zeroInput = null; int N = 1003814; double[] nextValues = null; double max = 70; int run = 0; int beginRun = 0; for (int i = 0; i < N ; i++) { zeroInput = readSingleZero( Interpolate.zeroIn, nextValues); nextValues = zeroInput.nextValues; // if(i>1003800){ // if(Math.abs(zeroInput.lastZero[1])>max){ // run = 0; // beginRun = i; // } else { // run++; // } // } // if(run>40){ // //run at 1003813 // System.out.println("run at " + beginRun); // break; // } if(i<3792 ){ continue; } final double z0 = zeroInput.lastZero[0]; final double z1 = zeroInput.nextValues[0]; final double d0 = zeroInput.lastZero[1]; final double d1 = zeroInput.nextValues[1]; final double maxFromInput = d0>0?zeroInput.lastZero[2]:-zeroInput.lastZero[2]; if(i==3792 || i==1003813){ //gSeries.begin 476.85026008636953 Poly4 poly = new Poly4(z0,z1, d0,d1,maxFromInput); System.out.println(i + ", " + Arrays.toString(zeroInput.lastZero) + ", \n" + "positionMax " + poly.positionMax + ", " + poly.eval(poly.positionMax) + ", \n" + Arrays.toString(nextValues)); } // for (int j = 0; j < zeroInput.lastZero.length; j++) { // out.writeDouble(zeroInput.lastZero[j]); // } // out.writeDouble(poly.positionMax); } // out.close(); // DataInputStream in = Interpolate.dataInputStream( file); // double[] tmin = new double[4]; // for (int i = 0; i < N-3792 ; i++) // { // for (int i1 = 0; i1 < tmin.length; i1++) // { // tmin[i1] = in.readDouble(); // } // System.out.println(Arrays.toString(tmin)); // } // in.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void begin() {}", "public void setBegin(int begin)\n {\n this.begin = begin;\n this.beginSpecified = true;\n }", "@Test(timeout = 4000)\n public void test005() throws Throwable {\n Range range0 = Range.ofLength(0L);\n long long0 = range0.getEnd();\n assertEquals(4294967294L, long0);\n \n Range.ofLength(0L);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n long long1 = range0.getBegin(range_CoordinateSystem0);\n assertEquals(0L, long1);\n }", "public void setBegin(int begin) {\n\t\tthis.begin = begin;\n\t}", "public int getBegin() {\n\t\treturn begin;\n\t}", "String getBegin();", "@Test(timeout = 4000)\n public void test102() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 2465L, 2465L);\n Object object0 = new Object();\n Range range1 = Range.of(range_CoordinateSystem0, 2465L, 2465L);\n range1.getBegin();\n range0.equals(range1);\n long long0 = range0.getEnd();\n assertEquals(2464L, long0);\n }", "void begin() throws OutputException;", "String getBeginRange();", "public abstract long mo24409b();", "public abstract void mo4378b(int i, zzud zzud);", "public abstract void mo4364a(int i, zzud zzud);", "public abstract void mo4365a(int i, zzwt zzwt);", "@Test(timeout = 4000)\n public void test116() throws Throwable {\n Range range0 = Range.ofLength(4294967244L);\n Long long0 = new Long(4294967244L);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n range0.toString(range_CoordinateSystem0);\n Range.of(4294967244L);\n Range.CoordinateSystem.values();\n Range range1 = Range.parseRange(\"[ 1 .. 4294967244 ]/RB\");\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.RESIDUE_BASED;\n Range range2 = Range.parseRange(\"[ 1 .. 4294967244 ]/RB\", range_CoordinateSystem1);\n range2.getEnd();\n range0.equals(range1);\n range2.getBegin();\n Range.CoordinateSystem range_CoordinateSystem2 = Range.CoordinateSystem.RESIDUE_BASED;\n // Undeclared exception!\n try { \n Range.parseRange(\"org.jcvi.jillion.core.Range$UnsignedByteStartLongLengthRange\", range_CoordinateSystem2);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // can not parse org.jcvi.jillion.core.Range$UnsignedByteStartLongLengthRange into a Range\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "public abstract long mo20901UQ();", "public int getInternalBlockLength()\r\n/* 40: */ {\r\n/* 41: 95 */ return 32;\r\n/* 42: */ }", "@Test(timeout = 4000)\n public void test099() throws Throwable {\n Object object0 = new Object();\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 127L, 127L);\n Range range1 = Range.of(127L);\n boolean boolean0 = range0.equals(range1);\n assertFalse(boolean0);\n \n long long0 = range1.getEnd();\n assertEquals(127L, long0);\n \n long long1 = range1.getBegin(range_CoordinateSystem0);\n assertEquals(128L, long1);\n }", "private void m50366E() {\n }", "public int end() { return _end; }", "public abstract long mo9229aD();", "public static void main003(String[] args) {\n\t\t/*\n\t\t * numberStart++ tra ve gia tri cua numberStart, sau đo tang number lan mot đon vi\n\t\t * numberStart-- tra ve gia tri cua numberStart, sau đo giam number xuong mot đon vi\n\t\t * ++numberStart tang numberStart len mot don vi, sau đo tra ve gia tri cua numberStart\n\t\t * --numberStart giam numberStart xuong mot don vi, sau đo tra ve gia tri cua numberStart\n\t\t */\n\t\tint numberStart\t= 20;\n\t\tint numberEnd\t= 0;\n\t\t\n//\t\tnumberEnd\t\t= ++numberStart;\n\t\tnumberEnd\t\t= --numberStart;\n\t\tSystem.out.println(\"Number Start = \" + numberStart);\n\t\tSystem.out.println(\"Number End = \" + numberEnd);\n\t}", "@Test(timeout = 4000)\n public void test41() throws Throwable {\n Range range0 = Range.of((-1732L), 1102L);\n Range.of(1102L);\n range0.toString();\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.ZERO_BASED;\n range0.getEnd(range_CoordinateSystem0);\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.RESIDUE_BASED;\n range0.toString(range_CoordinateSystem1);\n Range.CoordinateSystem range_CoordinateSystem2 = Range.CoordinateSystem.ZERO_BASED;\n Range.Builder range_Builder0 = new Range.Builder(range_CoordinateSystem2, (-2525L), 1965L);\n long long0 = (-1345L);\n range_Builder0.expandBegin((-1345L));\n range_Builder0.contractBegin((-2525L));\n Range range1 = range_Builder0.build();\n range1.startsBefore(range0);\n Range.of((-1345L));\n Range.CoordinateSystem range_CoordinateSystem3 = Range.CoordinateSystem.RESIDUE_BASED;\n // Undeclared exception!\n try { \n Range.parseRange(\"file can not be null\", range_CoordinateSystem3);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // can not parse file can not be null into a Range\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "@Test(timeout = 4000)\n public void test108() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, (-32768L), 2147484380L);\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.SPACE_BASED;\n Range range1 = Range.of(range_CoordinateSystem1, (-32768L), 2147484380L);\n range1.getEnd();\n boolean boolean0 = range0.equals(range1);\n assertFalse(boolean0);\n \n long long0 = range1.getEnd();\n assertEquals(2147484379L, long0);\n \n Object object0 = new Object();\n range0.getEnd();\n long long1 = range0.getBegin();\n assertEquals((-32769L), long1);\n }", "public int n_()\r\n/* 429: */ {\r\n/* 430:442 */ return this.a.length + 4;\r\n/* 431: */ }", "public void mo33392b() {\n mo33395e();\n }", "public abstract long mo9755t();", "public abstract void mo4379b(int i, zzwt zzwt);", "public abstract long mo24412e();", "public void mo115190b() {\n }", "@Test(timeout = 4000)\n public void test073() throws Throwable {\n Range range0 = Range.of(4162L);\n Range range1 = Range.of(999L);\n range1.equals(range0);\n assertFalse(range0.equals((Object)range1));\n \n long long0 = range1.getEnd();\n assertEquals(999L, long0);\n }", "public abstract int mo9754s();", "public abstract long mo24410c();", "void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);", "abstract void mo4366a(int i, zzwt zzwt, cu cuVar);", "@Test(timeout = 4000)\n public void test024() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 2147483647L, 2147483647L);\n Object object0 = new Object();\n long long0 = range0.getBegin();\n assertEquals(2147483647L, long0);\n \n range0.iterator();\n Object object1 = new Object();\n boolean boolean0 = range0.equals(object1);\n assertFalse(boolean0);\n \n long long1 = range0.getEnd();\n assertEquals(2147483646L, long1);\n }", "public void setFirstResult(int begin) {\n\r\n\t}", "public int start() { return _start; }", "@Test(timeout = 4000)\n public void test002() throws Throwable {\n long long0 = 785L;\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n // Undeclared exception!\n try { \n Range.of(range_CoordinateSystem0, 9223372036854775806L, (-128L));\n fail(\"Expecting exception: IndexOutOfBoundsException\");\n \n } catch(IndexOutOfBoundsException e) {\n //\n // given length -129 would make range [9223372036854775805 - ? ] beyond max allowed end offset\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "@Test(timeout = 4000)\n public void test029() throws Throwable {\n StringReader stringReader0 = new StringReader(\"GD}>zPHIT2VcF.\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 0, 0, 1847);\n javaCharStream0.adjustBeginLineColumn((-2819), 2281);\n int int0 = javaCharStream0.getBeginLine();\n assertEquals((-2818), int0);\n }", "C2841w mo7234g();", "public abstract void mo42331g();", "public int g()\r\n/* 601: */ {\r\n/* 602:645 */ return 0;\r\n/* 603: */ }", "public abstract long mo13681c();", "public abstract CharSequence mo2161g();", "private void m145775e() {\n long j;\n String str;\n int i;\n if (!this.f119477j.mo115499a()) {\n if (this.f119484q != null) {\n str = \"PRAGMA cipher_page_size\";\n if (this.f119485r == null || this.f119485r.pageSize <= 0) {\n i = SQLiteGlobal.f119529a;\n } else {\n i = this.f119485r.pageSize;\n }\n j = (long) i;\n } else {\n str = \"PRAGMA page_size\";\n j = (long) SQLiteGlobal.f119529a;\n }\n if (mo115435b(str, null, null) != j) {\n StringBuilder sb = new StringBuilder();\n sb.append(str);\n sb.append(\"=\");\n sb.append(j);\n mo115433a(sb.toString(), null, null);\n }\n }\n }", "public void mo9233aH() {\n }", "public int g()\r\n/* 173: */ {\r\n/* 174:198 */ return 0;\r\n/* 175: */ }", "void mo1933b(int i);", "void mo3314b(String str);", "public abstract int mo13680b();", "public abstract long mo131997a() throws IOException;", "@Test(timeout = 4000)\n public void test036() throws Throwable {\n Range range0 = Range.of(3132L);\n Range range1 = Range.of(3132L);\n range0.equals(range1);\n long long0 = range0.getEnd();\n assertSame(range0, range1);\n assertEquals(3132L, long0);\n }", "@Test(timeout = 4000)\n public void test114() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 2147483647L, 2147483647L);\n Object object0 = new Object();\n Range range1 = Range.of(range_CoordinateSystem0, 2147483647L, 2147483647L);\n range0.equals(range1);\n Range.Comparators.values();\n long long0 = range0.getBegin();\n assertTrue(range0.isEmpty());\n assertEquals(2147483647L, long0);\n }", "@Override\n public void func_104112_b() {\n \n }", "@Test(timeout = 4000)\n public void test019() throws Throwable {\n StringReader stringReader0 = new StringReader(\"GD}>zPHIT2VcF.\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 91, 91);\n javaCharStream0.BeginToken();\n javaCharStream0.adjustBeginLineColumn((-366), 1);\n int int0 = javaCharStream0.getLine();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals((-366), int0);\n }", "@Test(timeout = 4000)\n public void test086() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 32729L, 2147483647L);\n Object object0 = new Object();\n long long0 = range0.getBegin();\n assertEquals(32729L, long0);\n \n Object object1 = new Object();\n boolean boolean0 = range0.equals((Object) null);\n assertFalse(boolean0);\n }", "public void mo21792Q() {\n }", "Aweme mo62993e();", "@Test(timeout = 4000)\n public void test03() throws Throwable {\n DefaultNucleotideCodec defaultNucleotideCodec0 = DefaultNucleotideCodec.valueOf(\"INSTANCE\");\n byte[] byteArray0 = new byte[7];\n byteArray0[0] = (byte)118;\n byteArray0[1] = (byte) (-43);\n byteArray0[2] = (byte) (-107);\n byteArray0[3] = (byte)0;\n byteArray0[4] = (byte)5;\n byteArray0[5] = (byte)0;\n byteArray0[6] = (byte)0;\n Range range0 = Range.of((long) (byte)0, (long) (byte)0);\n Iterator<Nucleotide> iterator0 = defaultNucleotideCodec0.iterator(byteArray0, range0);\n assertNotNull(iterator0);\n }", "void mo72113b();", "public void mo42331g() {\n mo42335f();\n }", "@Test(timeout = 4000)\n public void test08() throws Throwable {\n DefaultNucleotideCodec defaultNucleotideCodec0 = DefaultNucleotideCodec.INSTANCE;\n byte[] byteArray0 = new byte[5];\n byte byte0 = (byte)0;\n byte byte1 = (byte)83;\n byte byte2 = (byte)3;\n byte byte3 = (byte)0;\n byte byte4 = (byte)0;\n Range range0 = Range.ofLength(3149L);\n // Undeclared exception!\n try { \n defaultNucleotideCodec0.iterator(byteArray0, range0);\n fail(\"Expecting exception: IndexOutOfBoundsException\");\n \n } catch(IndexOutOfBoundsException e) {\n //\n // range [ 0 .. 3148 ]/0B is out of range of sequence which is only [ 0 .. -1 ]/0B\n //\n verifyException(\"org.jcvi.jillion.core.residue.nt.DefaultNucleotideCodec$IteratorImpl\", e);\n }\n }", "public void mo23813b() {\n }", "public int captureCodeFragment03(int x) {\r\n return x + 1;\r\n }", "public void setBeginOffset(Integer beginOffset) {\n this.beginOffset = beginOffset;\n }", "public abstract void mo20156a(long j);", "@Test(timeout = 4000)\n public void test09() throws Throwable {\n DefaultNucleotideCodec defaultNucleotideCodec0 = DefaultNucleotideCodec.INSTANCE;\n Collection<Nucleotide> collection0 = null;\n byte[] byteArray0 = new byte[9];\n byteArray0[0] = (byte)0;\n byteArray0[1] = (byte)0;\n byteArray0[2] = (byte) (-72);\n byteArray0[3] = (byte) (-11);\n Range range0 = Range.of((long) (byte) (-11), 2L);\n // Undeclared exception!\n try { \n defaultNucleotideCodec0.iterator(byteArray0, range0);\n fail(\"Expecting exception: IndexOutOfBoundsException\");\n \n } catch(IndexOutOfBoundsException e) {\n //\n // range [ -11 .. 2 ]/0B is out of range of sequence which is only [ 0 .. 47348 ]/0B\n //\n verifyException(\"org.jcvi.jillion.core.residue.nt.DefaultNucleotideCodec$IteratorImpl\", e);\n }\n }", "public abstract void mo9811b(int i, long j);", "public abstract void mo4376b(int i);", "@Test(timeout = 4000)\n public void test69() throws Throwable {\n PipedReader pipedReader0 = new PipedReader();\n StreamTokenizer streamTokenizer0 = new StreamTokenizer(pipedReader0);\n streamTokenizer0.nval = (-2200.896);\n SQLUtil.renderNumber(streamTokenizer0);\n DBCatalog dBCatalog0 = new DBCatalog(\"TVsUO&^)F[AT_z+%R#\");\n assertNull(dBCatalog0.getDoc());\n }", "@Test(timeout = 4000)\n public void test118() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 32767L, 9223372036854775554L);\n Object object0 = new Object();\n Range range1 = Range.of(range_CoordinateSystem0, 9977L, 9223372036854775554L);\n range1.getEnd();\n boolean boolean0 = range1.equals(range0);\n assertFalse(boolean0);\n \n range1.getEnd();\n Object object1 = new Object();\n long long0 = range1.getEnd();\n assertEquals(9223372036854775553L, long0);\n \n long long1 = range0.getBegin();\n assertEquals(32767L, long1);\n }", "@Test(timeout = 4000)\n public void test34() throws Throwable {\n long long0 = 0L;\n Range range0 = Range.of(0L, 0L);\n range0.spliterator();\n Range.Builder range_Builder0 = new Range.Builder(range0);\n Object object0 = new Object();\n range0.equals(object0);\n range0.toString();\n // Undeclared exception!\n try { \n range0.endsBefore((Range) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // Null Range used in range comparison operation.\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "public abstract int mo4307b(int i);", "public abstract void mo4370a(zzud zzud);", "public void mo23438b() {\n }", "public void mo21787L() {\n }", "public abstract void mo9809b(int i);", "public static void m94920d() {\n Application application = BaseApplication.get();\n m94915b((Context) application, C6969H.m41409d(\"G7991D01CBA22AE27E50BAF41F6DAC6D36097DA088031A53AF10B8277F4EACFDB6694EA0EB03FA73DEF1E8377F1EAD6D97D\"), m94906a((Context) application, C6969H.m41409d(\"G7991D01CBA22AE27E50BAF41F6DAC6D36097DA088031A53AF10B8277F4EACFDB6694EA0EB03FA73DEF1E8377F1EAD6D97D\"), 0) + 1);\n m94916b(application, C6969H.m41409d(\"G7991D01CBA22AE27E50BAF41F6DAC6D36097DA088031A53AF10B8277F4EACFDB6694EA0EB03FA73DEF1E8377E6ECCED2\"), System.currentTimeMillis());\n }", "public abstract void mo9801a(int i, long j);", "public int getExtendedID()\r\n/* 12: */ {\r\n/* 13:17 */ return 10;\r\n/* 14: */ }", "public int arn() {\n return 383;\n }", "public abstract int mo9749n();", "@Test(timeout = 4000)\n public void test021() throws Throwable {\n StringReader stringReader0 = new StringReader(\"GD}>zPHIT2VcF.\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 0, 0, 1847);\n javaCharStream0.adjustBeginLineColumn((-2819), 2281);\n javaCharStream0.BeginToken();\n int int0 = javaCharStream0.getEndLine();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals((-2818), int0);\n }", "void mo1970b();", "@Test(timeout = 4000)\n public void test057() throws Throwable {\n Range.ofLength(4294967270L);\n Range.Builder range_Builder0 = new Range.Builder(4294967270L);\n }", "private void m145781k() {\n int i = this.f119477j.f119583i;\n StringBuilder sb = new StringBuilder(\"PRAGMA synchronous=\");\n sb.append(i);\n mo115433a(sb.toString(), null, null);\n }", "C20254v mo54454s(int i);", "C5537g mo4096b(int i);", "public abstract long mo9743h();", "public abstract void mo42330e();", "public final void mo14764a() {\n /*\n r9 = this;\n com.google.android.gms.common.util.Clock r0 = com.google.android.gms.ads.internal.zzp.zzkx()\n long r0 = r0.currentTimeMillis()\n java.lang.Object r2 = r9.f10846a\n monitor-enter(r2)\n int r3 = r9.f10847b // Catch:{ all -> 0x004d }\n int r4 = com.google.android.gms.internal.ads.C2349r5.f10765b // Catch:{ all -> 0x004d }\n if (r3 != r4) goto L_0x002c\n long r5 = r9.f10848c // Catch:{ all -> 0x004d }\n com.google.android.gms.internal.ads.zzaaq<java.lang.Long> r3 = com.google.android.gms.internal.ads.zzabf.zzcwh // Catch:{ all -> 0x004d }\n com.google.android.gms.internal.ads.zzabb r7 = com.google.android.gms.internal.ads.zzwq.zzqe() // Catch:{ all -> 0x004d }\n java.lang.Object r3 = r7.zzd(r3) // Catch:{ all -> 0x004d }\n java.lang.Long r3 = (java.lang.Long) r3 // Catch:{ all -> 0x004d }\n long r7 = r3.longValue() // Catch:{ all -> 0x004d }\n long r5 = r5 + r7\n int r3 = (r5 > r0 ? 1 : (r5 == r0 ? 0 : -1))\n if (r3 > 0) goto L_0x002c\n int r0 = com.google.android.gms.internal.ads.C2349r5.f10764a // Catch:{ all -> 0x004d }\n r9.f10847b = r0 // Catch:{ all -> 0x004d }\n L_0x002c:\n monitor-exit(r2) // Catch:{ all -> 0x004d }\n com.google.android.gms.common.util.Clock r0 = com.google.android.gms.ads.internal.zzp.zzkx()\n long r0 = r0.currentTimeMillis()\n java.lang.Object r3 = r9.f10846a\n monitor-enter(r3)\n int r2 = r9.f10847b // Catch:{ all -> 0x004a }\n r5 = 2\n if (r2 == r5) goto L_0x003f\n monitor-exit(r3) // Catch:{ all -> 0x004a }\n return\n L_0x003f:\n r2 = 3\n r9.f10847b = r2 // Catch:{ all -> 0x004a }\n int r2 = r9.f10847b // Catch:{ all -> 0x004a }\n if (r2 != r4) goto L_0x0048\n r9.f10848c = r0 // Catch:{ all -> 0x004a }\n L_0x0048:\n monitor-exit(r3) // Catch:{ all -> 0x004a }\n return\n L_0x004a:\n r0 = move-exception\n monitor-exit(r3) // Catch:{ all -> 0x004a }\n throw r0\n L_0x004d:\n r0 = move-exception\n monitor-exit(r2) // Catch:{ all -> 0x004d }\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.ads.C2386s5.mo14764a():void\");\n }", "void mo3194r();", "@Test(timeout = 4000)\n public void test24() throws Throwable {\n Range.Builder range_Builder0 = new Range.Builder();\n range_Builder0.contractBegin(0L);\n Range.Builder range_Builder1 = new Range.Builder(0L);\n range_Builder0.copy();\n Range range0 = range_Builder0.build();\n range_Builder0.shift(243L);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n linkedList0.add(range0);\n long long0 = 127L;\n Range range1 = Range.of((-636L), 127L);\n range1.isSubRangeOf(range0);\n // Undeclared exception!\n try { \n Range.parseRange(\"\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // can not parse into a Range\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "public void mo21789N() {\n }", "@Test(timeout = 4000)\n public void test14() throws Throwable {\n Range range0 = Range.of((-1259L));\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n range0.toString(range_CoordinateSystem0);\n Range range1 = Range.of((-1259L));\n long long0 = new Long((-1259L));\n range1.getEnd();\n Range range2 = range0.intersection(range1);\n List<Range> list0 = range2.split(255L);\n range2.complementFrom(list0);\n Range range3 = range1.asRange();\n String string0 = null;\n range3.intersection(range1);\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.RESIDUE_BASED;\n range2.getEnd(range_CoordinateSystem1);\n // Undeclared exception!\n try { \n Range.parseRange(\"[ -1259 .. -1258 ]/SB\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // can not parse [ -1259 .. -1258 ]/SB into a Range\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "void m5770d() throws C0841b;", "@Test(timeout = 4000)\n public void test109() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 2117L, 2117L);\n // Undeclared exception!\n try { \n range0.getBegin((Range.CoordinateSystem) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // CoordinateSystem can not be null\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "public abstract void mo4383c(long j);", "public abstract void mo133131c() throws InvalidDataException;", "int mo44965b();", "public int getResultLength() { return i_end; }" ]
[ "0.5846375", "0.583977", "0.57971025", "0.5720157", "0.5604755", "0.5489468", "0.54703164", "0.54034424", "0.5399074", "0.53917646", "0.5376326", "0.5351825", "0.5346061", "0.53323746", "0.53109264", "0.5307374", "0.5301697", "0.5299638", "0.52816975", "0.52795005", "0.5265418", "0.5261847", "0.5255141", "0.52546597", "0.52422434", "0.5234619", "0.5221861", "0.5201632", "0.51919043", "0.5191791", "0.5161577", "0.5153383", "0.5151146", "0.5149362", "0.5147784", "0.5134102", "0.5133115", "0.51268196", "0.51096827", "0.51092577", "0.51051265", "0.5104265", "0.5099793", "0.50996584", "0.50883967", "0.50823855", "0.5079336", "0.5054521", "0.50538087", "0.5053738", "0.50529015", "0.50526994", "0.5049284", "0.5047685", "0.5038173", "0.5036936", "0.50331247", "0.5032806", "0.50327075", "0.50306463", "0.50286746", "0.50249106", "0.5021663", "0.5020884", "0.50194585", "0.5017388", "0.50173676", "0.50162566", "0.50152576", "0.5014758", "0.5010211", "0.5008457", "0.5005941", "0.5005242", "0.50048935", "0.5001279", "0.49990383", "0.49971363", "0.49965695", "0.49948305", "0.49945965", "0.4993282", "0.49929446", "0.4992354", "0.49911764", "0.49898773", "0.4989663", "0.49806723", "0.49798346", "0.4979753", "0.49770987", "0.49609157", "0.49601692", "0.495996", "0.49595833", "0.4959457", "0.4958072", "0.4953962", "0.4953556", "0.49528646", "0.495152" ]
0.0
-1
data: contains marked values / tags tag: current tag of respective thread save: current saved value of respective thread
public AtomicLong63Array(int length) { int T = MAX_THREAD_ID; data = new long[length]; tag = new long[T]; save = new long[T]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void saveData(){\n SerializableManager.saveSerializable(this,user,\"userInfo.data\");\n SerializableManager.saveSerializable(this,todayCollectedID,\"todayCollectedCoinID.data\");\n SerializableManager.saveSerializable(this,CollectedCoins,\"collectedCoin.data\");\n uploadUserData uploadUserData = new uploadUserData(this);\n uploadUserData.execute(this.Uid);\n System.out.println(Uid);\n\n }", "public void setData(WrapperNBT data){\r\n\t\tsavedDataAccessor.internalData = data.tag;\r\n\t\tsavedDataAccessor.markDirty();\r\n\t\tworld.getPerWorldStorage().setData(savedDataAccessor.mapName, savedDataAccessor);\r\n\t}", "public void saveSelfInfo()\n\t{\n\t\tnew Thread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\thelper.addSelfInfo(uid, myApp.getSelfInfoList());\n\t\t\t}\n\t\t}).start();\n\t}", "private void updateData(char tag, byte[] data) {\n float max;\n float min;\n switch (tag){\n case 'E':\n addEntry(ecgChart, unpackFloatValue(data),\n PLOT_SPAN_SECONDS * ECG_SAMPLE_RATE);\n ecg_list.add(unpackFloatValue(data));\n if(ecg_list.size() > PLOT_SPAN_SECONDS * ECG_SAMPLE_RATE)\n ecg_list.remove(0);\n max = Collections.max(ecg_list);\n min = Collections.min(ecg_list);\n ecgChart.getAxisLeft().setAxisMaximum(max);\n ecgChart.getAxisLeft().setAxisMinimum(min);\n break;\n case 'O':\n addEntry(oxiChart, unpackFloatValue(data),\n PLOT_SPAN_SECONDS * OXIMETER_SAMPLE_RATE);\n oxi_list.add(unpackFloatValue(data));\n if(oxi_list.size() > PLOT_SPAN_SECONDS * OXIMETER_SAMPLE_RATE)\n oxi_list.remove(0);\n max = Collections.max(oxi_list);\n min = Collections.min(oxi_list);\n oxiChart.getAxisLeft().setAxisMaximum(max);\n oxiChart.getAxisLeft().setAxisMinimum(min);\n break;\n case 'P':\n pulseText.setText(String.valueOf((int)unpackFloatValue(data)));\n break;\n case 'S':\n spO2Text.setText(String.valueOf((int)unpackFloatValue(data)));\n break;\n case 'T':\n tempText.setText(String.format(\"%.1f\", unpackFloatValue(data)));\n break;\n case 'A':\n alarmHandler(new String(data));\n break;\n case 'W':\n errorHandler(new String(data));\n break;\n default:\n break;\n }\n }", "public static void threadstorer()\r\n\r\n\t{\r\n\t\tThread threadstoreData = new Thread(){\r\n\t\t\tpublic void run(){\r\n\t\t\t\ttry {\r\n\t\t\t\t\t//loadData(inputFile1);\r\n\t\t\t\t\tUtility.writeTofile(wordList, outputFile1);\r\n\t\t\t\t\tSystem.out.println(\"Word Stored\");\r\n\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tSystem.err.println(\"Error in storing data: \"+e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tThread threadstorePattern = new Thread(){\r\n\t\t\tpublic void run(){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tUtility.writeTofile(patternOut, outputFile2);\r\n\t\t\t\t\tSystem.out.println(\"Pattern stored\");\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tSystem.err.println(\"Error in storing pattern: \"+e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tthreadstoreData.run();\r\n\t\tthreadstorePattern.run();\r\n\t}", "Object getCurrentData();", "public void tickTag(String specificData) {\r\n dataTag.set(this.getPosition(specificData),\r\n dataTag.get(this.getPosition(specificData)) + 1);\r\n }", "Values values(Thread current) {\n return current.localValues;\n }", "protected void synchronizeData() {\n\n needsSyncData(false);\n\n DeferredDocumentImpl ownerDocument =\n (DeferredDocumentImpl) this.ownerDocument();\n data = ownerDocument.getNodeValueString(fNodeIndex);", "public interface ThreadReporter\n{\n\t/**\n\t Set the time for data points to be reported\n\t @param time\n\t */\n\tvoid setReportTime(long time);\n\n\t/**\n\t This lets you put a tag to all data points submitted to sub interfaces of\n\t ThreadReporter\n\t @param name\n\t @param value\n\t */\n\tvoid addTag(String name, String value);\n\tvoid removeTag(String name);\n\tvoid clearTags();\n\tvoid clearAll();\n}", "public static void getThreadInfo(){\r\n ThreadMeasurement currentThreadState = new ThreadMeasurement();\r\n threadList.add(currentThreadState);\r\n //ThreadMeasurement.printThreadState(currentThreadState);\r\n }", "@Override\r\n\tpublic void doProcessing() throws InterruptedException {\r\n\t\tMelody.getContext().handleProcessorStateUpdates();\r\n\r\n\t\tsynchronized (getTargetElement().getOwnerDocument()) {\r\n\t\t\tgetTargetElement().setAttribute(\r\n\t\t\t\t\tgetTargetAttributeName().getValue(), getNewValue());\r\n\t\t}\r\n\t}", "public void threadManager() {\n /**Retrieve all data stored in \"preference\"*/\n if (mNodeThingUtils.getAllSavedThing() != null) {\n\n Map<String, String> getAllSensor = mNodeThingUtils.getAllSavedThing();\n Set<String> keys = getAllSensor.keySet();\n\n /**It checks to see if he has already been registered*/\n if (!threadControl.containsKey(String.valueOf(keys))) {\n for (Iterator i = keys.iterator(); i.hasNext(); ) {\n String key = (String) i.next();\n /**This control is used to separate the thread type from the sensor type*/\n if (!key.matches(Constant.Regexp.THREAD_CONTROL) && key.length() != 2) {\n\n /**Creates a new thread and registers it as \"nodename: thingname\"\n * of type \"map\" so that it is easy to check later*/\n threadControl.put(key, new ThreadUtils(mContext));\n }\n }\n } else {\n LogUtils.logger(TAG, \"There is a thread named as \" + keys);\n }\n }\n }", "private void saveTag(Tag tag){\n Long num = tagMap.get(tag);\n tagMap.put(tag, (num == null) ? (long)1 : num+1);\n }", "private void saveData(){\n\t\tsynchronized(onlineAllInfoList){\n\t\t\tRecorder.save(onlineAllInfoList, onlineAllInfoListFileName);\n\t\t}\n\t\t//System.out.println(\"Saving onlineCompetitionInfoList...\");System.out.flush();\n\t\tsynchronized(onlineCompetitionInfoList){\n\t\t\tRecorder.save(onlineCompetitionInfoList, onlineCompetitionInfoListFileName);\t\t\t\n\t\t}\n\t\t//System.out.println(\"Saving competitionList...\");System.out.flush();\n\t\tsynchronized(competitionList){\n\t\t\tRecorder.save(competitionList, competitionInfoListFileName);\n\t\t}\n\t\t//System.out.println(\"Saving allAIInfoList...\");System.out.flush();\n\t\tsynchronized(allAIInfoList){\n\t\t\tRecorder.save(allAIInfoList, allInfoListFileName);\t\t\t\n\t\t}\n\t\t//System.out.println(\"Saving waitingInfoList...\");System.out.flush();\n\t\tsynchronized(waitingInfoList){\n\t\t\tRecorder.save(waitingInfoList, waitingInfoListFileName);\t\t\t\n\t\t}\n\t\t//System.out.println(\"Saving sortedAIInfoPool...\");System.out.flush();\n\t\tsynchronized(sortedAIInfoPool){\n\t\t\tRecorder.save(sortedAIInfoPool, sortedInfoListFileName);\t\t\t\n\t\t}\n\t}", "public void updateData(Trick completedTrick);", "@SuppressLint(\"CheckResult\")\n private void saveData() {\n boolean okToSave = true;\n\n if (mImages.size() == 0) {\n okToSave = false;\n ToastModifications.createToast(this, getString(R.string.at_least_one_photo), Toast.LENGTH_LONG);\n } else {\n for (View v : mAllEditTexts) {\n EditText thisEditText = (EditText) v;\n if (thisEditText.getText().toString().equals(\"\")) {\n okToSave = false;\n ToastModifications.createToast(this, getString(R.string.enter_value_for) + thisEditText.getTag(), Toast.LENGTH_SHORT);\n break;\n }\n }\n }\n\n if (okToSave) {\n new Thread(new Runnable() {\n @SuppressWarnings(\"ConstantConditions\")\n @Override\n public void run() {\n String[] imageDescrps = mImageDescription.toArray(new String[0]);\n String saleDate;\n\n if (mListingBeingEdited != null) {\n String editingListingSoldDate = mListingBeingEdited.getSaleDate();\n if (!editingListingSoldDate.equals(\"\")) { //it has been sold previously\n saleDate = determineSaveDate(true);\n } else { //it has not been sold\n saleDate = determineSaveDate(false);\n }\n\n } else {\n saleDate = determineSaveDate(false);\n }\n\n Listing listingToAdd = new Listing(\n mEditingId == null ? DEFAULT_LISTING_ID : mEditingId,\n mTypeSpinner.getSelectedItem().toString(),\n Double.valueOf(mPriceEditText.getText().toString()),\n Double.valueOf(mSurfaceAreaText.getText().toString()),\n Integer.valueOf(mBedroomsSpinner.getSelectedItem().toString()),\n mDescriptionEditText.getText().toString(),\n ImageTools.BitmapsToByteArray(mImages),\n imageDescrps,\n mAddressPostcodeEditText.getText().toString(),\n mAddressNumberEditText.getText().toString(),\n mAddressStreetEditText.getText().toString(),\n mAddressTownEditText.getText().toString(),\n mAddressCountyEditText.getText().toString(),\n mPoiAutocomplete.getText().toString(),\n mEditing ? mListingBeingEdited.getPostedDate() : Utils.getTodayDate(),\n saleDate,\n mListingBeingEdited != null ? mListingBeingEdited.getAgent() :\n (FirebaseHelper.getLoggedInUser() != null ? FirebaseHelper.getLoggedInUser() : getString(R.string.unknown_agent)),\n Utils.getTodayDate(),\n !mBuyOrLetSwitch.isChecked() ? BUY_STRING : LET_STRING,\n mSaleStatusImage.getTag().toString().equals(FOR_SALE_TAG));\n\n if (mEditing) {\n listingToAdd.setEditingAgent(FirebaseHelper.getLoggedInUser() != null ? FirebaseHelper.getLoggedInUser() : getString(R.string.unknown_agent));\n }\n\n mPresenter.addListing(getApplicationContext(), listingToAdd, mEditing);\n }\n\n }).start();\n\n\n createSaveListingProgressBar(); //create the progress bar to display to the user that saving is taking place\n }\n }", "private void saveData() {\n }", "private void updateSeedsInfoStatus(String tDate, Boolean tTag){\n \tSharedPreferences.Editor editor = mSharedPref.edit();\n \teditor.putBoolean(tDate, tTag);\n \teditor.commit(); \t\n }", "private void parseTag(Node node, ContentValues values, String table, String id) {\n\n String name = \"\";\n String value = node.getTextContent();\n\n if (value == null) {\n value = \"\";\n }\n\n NamedNodeMap attributes = node.getAttributes();\n\n switch (node.getNodeName()) {\n\n /*\n * Parents\n */\n case \"context\":\n if (table.equals(Tasks.TABLE_NAME)) {\n name = Tasks.COLUMN_CONTEXT;\n Node attr = attributes.getNamedItem(\"idref\");\n if (attr != null) {\n value = attr.getTextContent();\n }\n break;\n }\n // else, fall through to adding a parent ID\n\n case \"folder\":\n case \"task\":\n name = DatabaseContract.Entries.COLUMN_PARENT_ID;\n Node attr = attributes.getNamedItem(\"idref\");\n if (attr != null) {\n value = attr.getTextContent();\n }\n break;\n\n /*\n * Base\n */\n case \"added\":\n name = Base.COLUMN_DATE_ADDED;\n break;\n\n case \"modified\":\n name = Base.COLUMN_DATE_MODIFIED;\n break;\n\n /*\n * Entry\n */\n case \"name\":\n name = DatabaseContract.Entries.COLUMN_NAME;\n\n if (table.equals(Attachments.TABLE_NAME)) {\n\n // Save file path as well\n\n File file = new File(androidContext.getFilesDir(), \"data/\" + id + \"/\" + value);\n if (file.exists()) {\n values.put(Attachments.COLUMN_PATH, file.getPath());\n }\n }\n\n break;\n\n case \"rank\":\n name = DatabaseContract.Entries.COLUMN_RANK;\n break;\n\n /*\n * Attachment\n */\n case \"preview-image\":\n name = Attachments.COLUMN_PNG_PREVIEW;\n break;\n\n /*\n * Context\n */\n case \"location\":\n\n Node locationNameAttr = attributes.getNamedItem(\"name\");\n Node altitudeAttr = attributes.getNamedItem(\"altitude\");\n Node latitudeAttr = attributes.getNamedItem(\"latitude\");\n Node longitudeAttr = attributes.getNamedItem(\"longitude\");\n Node radiusAttr = attributes.getNamedItem(\"radius\");\n\n String locationName = \"\", altitude = \"\", latitude = \"\", longitude = \"\", radius = \"\";\n\n if (locationNameAttr != null) {\n locationName = locationNameAttr.getTextContent();\n }\n\n if (altitudeAttr != null) {\n altitude = altitudeAttr.getTextContent();\n }\n\n if (latitudeAttr != null) {\n latitude = latitudeAttr.getTextContent();\n }\n\n if (longitudeAttr != null) {\n longitude = longitudeAttr.getTextContent();\n }\n\n if (radiusAttr != null) {\n radius = radiusAttr.getTextContent();\n }\n\n values.put(Contexts.COLUMN_LOCATION_NAME, locationName);\n values.put(Contexts.COLUMN_ALTITUDE, altitude);\n values.put(Contexts.COLUMN_LATITUDE, latitude);\n values.put(Contexts.COLUMN_LONGITUDE, longitude);\n values.put(Contexts.COLUMN_RADIUS, radius);\n break;\n\n case \"prohibits-next-action\":\n name = Contexts.COLUMN_ON_HOLD;\n value = value.equals(\"true\") ? \"1\" : \"0\";\n break;\n\n /*\n * Perspectives/Settings\n */\n case \"plist\":\n if (table.equals(Perspectives.TABLE_NAME)) {\n\n // Parse as perspective\n\n name = Perspectives.COLUMN_VALUE;\n\n try {\n byte[] tagBytes = stringOf(node).getBytes();\n\n NSDictionary plist =\n (NSDictionary) PropertyListParser.parse(tagBytes);\n NSDictionary viewState = (NSDictionary) plist.get(\"viewState\");\n NSDictionary viewModeState = (NSDictionary) viewState.get(\"viewModeState\");\n String viewMode =\n ((NSString) viewState.get(\"viewMode\")).getContent();\n NSDictionary data = (NSDictionary) viewModeState.get(viewMode);\n\n String perspectiveName = ((NSString) plist.get(\"name\")).getContent();\n String icon =\n ((NSString) plist.get(\"iconNameInBundle\")).getContent();\n String group = ((NSString) data.get(\"collation\")).getContent();\n String sort = ((NSString) data.get(\"sort\")).getContent();\n\n // These three fields could be null, so check for that\n\n NSString filterDurationData = ((NSString) data.get(\"actionDurationFilter\"));\n NSString filterFlaggedData = ((NSString) data.get(\"actionFlaggedFilter\"));\n NSString filterStatusData =\n ((NSString) data.get(\"actionCompletionFilter\"));\n\n if (filterDurationData != null) {\n String filterDuration = filterDurationData.getContent();\n values.put(Perspectives.COLUMN_FILTER_DURATION, filterDuration);\n }\n\n if (filterFlaggedData != null) {\n String filterFlagged = filterFlaggedData.getContent();\n values.put(Perspectives.COLUMN_FILTER_FLAGGED, filterFlagged);\n }\n\n if (filterStatusData != null) {\n String filterStatus = filterStatusData.getContent();\n values.put(Perspectives.COLUMN_FILTER_STATUS, filterStatus);\n }\n\n values.put(Perspectives.COLUMN_NAME, perspectiveName);\n values.put(Perspectives.COLUMN_ICON, icon);\n values.put(Perspectives.COLUMN_VIEW_MODE, viewMode);\n values.put(Perspectives.COLUMN_GROUP, group);\n values.put(Perspectives.COLUMN_SORT, sort);\n } catch (IOException | ParseException | SAXException | ParserConfigurationException e) {\n Log.e(TAG, \"Error parsing perspective\", e);\n } catch (PropertyListFormatException e) {\n Log.e(TAG, \"Plist is malformed\", e);\n }\n } else if (table.equals(Settings.TABLE_NAME)) {\n\n // Parse as setting\n // Note that all the other settings pretty much read in fine as strings\n\n name = Settings.COLUMN_VALUE;\n\n try {\n byte[] tagBytes = stringOf(node).getBytes();\n\n switch (id) {\n case \"cPIrzdPU37-\": // No idea\n case \"PerspectiveOrder_v2\": // Perspective order\n\n NSObject[] array = ((NSArray) PropertyListParser.parse(tagBytes)).getArray();\n value = \"\";\n\n for (int i = 0; i < array.length; i++) {\n\n // Get the value of the string from the NSObject\n value += ((NSString) array[i]).getContent();\n\n // Add a comma delimeter, unless this is the last in the array\n if (i < array.length - 1) {\n value += \",\";\n }\n }\n\n break;\n case \"DueSoonInterval\":\n\n // Convert the number of seconds into a Duration object\n // which we can use to get a proper ISO duration\n\n value = Duration.ofSeconds(Long.valueOf(value)).toString();\n }\n } catch (IOException | ParseException | SAXException | ParserConfigurationException e) {\n Log.e(TAG, \"Error parsing setting\", e);\n } catch (PropertyListFormatException e) {\n Log.e(TAG, \"Plist is malformed\", e);\n }\n }\n\n break;\n\n /*\n * Tasks\n */\n case \"order\":\n\n // The task type is a tricky one, because it can be either 'sequential',\n // 'parallel' or 'single action', but 'single action' is only applicable\n // to projects and comes from a different tag (see \"singleton\" below).\n // As the \"singleton\" tag will always come first, we can test to see if\n // we've already added the 'type' column, and only proceed if we haven't.\n\n if (!values.containsKey(Tasks.COLUMN_TYPE)) {\n name = Tasks.COLUMN_TYPE;\n }\n break;\n\n case \"completed-by-children\":\n name = Tasks.COLUMN_COMPLETE_WITH_CHILDREN;\n value = value.equals(\"true\") ? \"1\" : \"0\";\n break;\n\n case \"start\":\n name = Tasks.COLUMN_DATE_DEFER;\n break;\n\n case \"due\":\n name = Tasks.COLUMN_DATE_DUE;\n break;\n\n case \"completed\":\n name = Tasks.COLUMN_DATE_COMPLETED;\n break;\n\n case \"estimated-minutes\":\n name = Tasks.COLUMN_ESTIMATED_TIME;\n if (!value.isEmpty()) {\n value = Duration.ofMinutes(Long.valueOf(value)).toString();\n }\n break;\n\n case \"flagged\":\n name = Tasks.COLUMN_FLAGGED;\n value = value.equals(\"true\") ? \"1\" : \"0\";\n break;\n\n case \"inbox\":\n name = Tasks.COLUMN_INBOX;\n value = value.equals(\"false\") ? \"0\" : \"1\";\n break;\n\n case \"note\":\n if (table.equals(Tasks.TABLE_NAME) && node.hasChildNodes()) {\n name = Tasks.COLUMN_NOTE_XML;\n value = stringOf(node);\n }\n break;\n\n case \"repetition-rule\":\n name = Tasks.COLUMN_REPETITION_RULE;\n break;\n\n case \"repetition-method\":\n name = Tasks.COLUMN_REPETITION_METHOD;\n break;\n\n /*\n * Projects\n */\n case \"project\":\n if (node.hasChildNodes()) {\n name = Tasks.COLUMN_PROJECT;\n value = \"1\";\n }\n\n // GO DEEPER\n\n NodeList children = node.getChildNodes();\n\n for (int i = 0; i < children.getLength(); i++) {\n\n Node child = children.item(i);\n\n parseTag(child, values, table, id);\n }\n\n break;\n\n case \"singleton\":\n if (value.equals(\"true\")) {\n name = Tasks.COLUMN_TYPE;\n value = \"single action\";\n }\n break;\n\n case \"last-review\":\n name = Tasks.COLUMN_PROJECT_LAST_REVIEW;\n break;\n\n case \"next-review\":\n name = Tasks.COLUMN_PROJECT_NEXT_REVIEW;\n break;\n\n case \"review-interval\":\n name = Tasks.COLUMN_PROJECT_REPEAT_REVIEW;\n break;\n\n case \"status\":\n name = Tasks.COLUMN_PROJECT_STATUS;\n break;\n }\n\n if (!name.isEmpty() && !value.isEmpty()) {\n values.put(name, value);\n }\n }", "public void Data(){\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public static void main(String[] args) {\n\n\n Main main = new Main();\n\n Thread thread1 = new Thread(new Runnable() {\n @Override\n public void run() {\n main.value = \"aaaaaa\";\n// Main main = new Main();\n// main.print10();\n System.out.println(main.value);\n\n }\n });\n Thread thread2 = new Thread(new Runnable() {\n @Override\n public void run() {\n main.value = main.value + \"bbbbb\";\n// Main main = new Main();\n// main.print10();\n System.out.println(main.value);\n\n }\n });\n\n\n thread1.start();\n thread2.start();\n\n\n }", "public void tukarData() {\n this.temp = this.data1;\n this.data1 = this.data2;\n this.data2 = this.temp;\n }", "private static void saveThreadLastRunTime() {\n\t\tif (mContext != null) {\n\t\t\tEditor edit = mContext.getSharedPreferences(Defines.SHARED_PREF_NAME, Context.MODE_PRIVATE).edit();\n\t\t\tedit.putLong(Defines.SHARED_PREF_THREAD_LAST_RUN_TIME, DataStore.mThreadLastRunSystemTime);\n\n\t\t\tedit.commit();\n\t\t}\n\t}", "@Override\n\tpublic void run() {\n\t\twhile(true){\n\t\t\tTairData data = null;\n\t\t\ttry {\n\t\t\t\tdata = this.tairDataList.take();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO: handle exception\n\t\t\t}\n\t\t\tif(data == null){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tTairRunnable.tairOperator.write(data.key, data.value);\n\t\t}\n\t\t\n\t}", "public SEDataThread(String storElement)\n {\n nodeChoice = storElement;\n }", "public void saveDeleteDoneMessage(){\n GUIMethods.Thread2 msg = guiM.new Thread2(tGUI.saveDeleteDone);\n msg.start();\n tGUI.setTimeDefaultValues();\n System.out.println(\"print\");\n\n }", "void assignDataReceived(Serializable dataReceived);", "public void run() {\n /*\n r18 = this;\n r3 = 0;\n r10 = 0;\n r0 = r18;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.this;\n r14 = r13.mInstanceLock;\n monitor-enter(r14);\n r11 = new java.util.ArrayList;\t Catch:{ all -> 0x005c }\n r0 = r18;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ all -> 0x005c }\n r13 = r13.mHistoricalRecords;\t Catch:{ all -> 0x005c }\n r11.<init>(r13);\t Catch:{ all -> 0x005c }\n monitor-exit(r14);\t Catch:{ all -> 0x0142 }\n r0 = r18;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ FileNotFoundException -> 0x005f }\n r13 = r13.mContext;\t Catch:{ FileNotFoundException -> 0x005f }\n r0 = r18;\n r14 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ FileNotFoundException -> 0x005f }\n r14 = r14.mHistoryFileName;\t Catch:{ FileNotFoundException -> 0x005f }\n r15 = 0;\n r3 = r13.openFileOutput(r14, r15);\t Catch:{ FileNotFoundException -> 0x005f }\n r12 = android.util.Xml.newSerializer();\n r13 = 0;\n r12.setOutput(r3, r13);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = \"UTF-8\";\n r14 = 1;\n r14 = java.lang.Boolean.valueOf(r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.startDocument(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"historical-records\";\n r12.startTag(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r9 = r11.size();\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r4 = 0;\n L_0x004b:\n if (r4 < r9) goto L_0x007f;\n L_0x004d:\n r13 = 0;\n r14 = \"historical-records\";\n r12.endTag(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.endDocument();\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n if (r3 == 0) goto L_0x005b;\n L_0x0058:\n r3.close();\t Catch:{ IOException -> 0x013f }\n L_0x005b:\n return;\n L_0x005c:\n r13 = move-exception;\n L_0x005d:\n monitor-exit(r14);\t Catch:{ all -> 0x005c }\n throw r13;\n L_0x005f:\n r2 = move-exception;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.LOG_TAG;\n r14 = new java.lang.StringBuilder;\n r15 = \"Error writing historical recrod file: \";\n r14.<init>(r15);\n r0 = r18;\n r15 = com.actionbarsherlock.widget.ActivityChooserModel.this;\n r15 = r15.mHistoryFileName;\n r14 = r14.append(r15);\n r14 = r14.toString();\n android.util.Log.e(r13, r14, r2);\n goto L_0x005b;\n L_0x007f:\n r13 = 0;\n r8 = r11.remove(r13);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r8 = (com.actionbarsherlock.widget.ActivityChooserModel.HistoricalRecord) r8;\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"historical-record\";\n r12.startTag(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"activity\";\n r15 = r8.activity;\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r15 = r15.flattenToString();\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.attribute(r13, r14, r15);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"time\";\n r0 = r8.time;\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r16 = r0;\n r15 = java.lang.String.valueOf(r16);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.attribute(r13, r14, r15);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"weight\";\n r15 = r8.weight;\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r15 = java.lang.String.valueOf(r15);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.attribute(r13, r14, r15);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"historical-record\";\n r12.endTag(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r4 = r4 + 1;\n goto L_0x004b;\n L_0x00bb:\n r5 = move-exception;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.LOG_TAG;\t Catch:{ all -> 0x0136 }\n r14 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0136 }\n r15 = \"Error writing historical recrod file: \";\n r14.<init>(r15);\t Catch:{ all -> 0x0136 }\n r0 = r18;\n r15 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ all -> 0x0136 }\n r15 = r15.mHistoryFileName;\t Catch:{ all -> 0x0136 }\n r14 = r14.append(r15);\t Catch:{ all -> 0x0136 }\n r14 = r14.toString();\t Catch:{ all -> 0x0136 }\n android.util.Log.e(r13, r14, r5);\t Catch:{ all -> 0x0136 }\n if (r3 == 0) goto L_0x005b;\n L_0x00dc:\n r3.close();\t Catch:{ IOException -> 0x00e1 }\n goto L_0x005b;\n L_0x00e1:\n r13 = move-exception;\n goto L_0x005b;\n L_0x00e4:\n r7 = move-exception;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.LOG_TAG;\t Catch:{ all -> 0x0136 }\n r14 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0136 }\n r15 = \"Error writing historical recrod file: \";\n r14.<init>(r15);\t Catch:{ all -> 0x0136 }\n r0 = r18;\n r15 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ all -> 0x0136 }\n r15 = r15.mHistoryFileName;\t Catch:{ all -> 0x0136 }\n r14 = r14.append(r15);\t Catch:{ all -> 0x0136 }\n r14 = r14.toString();\t Catch:{ all -> 0x0136 }\n android.util.Log.e(r13, r14, r7);\t Catch:{ all -> 0x0136 }\n if (r3 == 0) goto L_0x005b;\n L_0x0105:\n r3.close();\t Catch:{ IOException -> 0x010a }\n goto L_0x005b;\n L_0x010a:\n r13 = move-exception;\n goto L_0x005b;\n L_0x010d:\n r6 = move-exception;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.LOG_TAG;\t Catch:{ all -> 0x0136 }\n r14 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0136 }\n r15 = \"Error writing historical recrod file: \";\n r14.<init>(r15);\t Catch:{ all -> 0x0136 }\n r0 = r18;\n r15 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ all -> 0x0136 }\n r15 = r15.mHistoryFileName;\t Catch:{ all -> 0x0136 }\n r14 = r14.append(r15);\t Catch:{ all -> 0x0136 }\n r14 = r14.toString();\t Catch:{ all -> 0x0136 }\n android.util.Log.e(r13, r14, r6);\t Catch:{ all -> 0x0136 }\n if (r3 == 0) goto L_0x005b;\n L_0x012e:\n r3.close();\t Catch:{ IOException -> 0x0133 }\n goto L_0x005b;\n L_0x0133:\n r13 = move-exception;\n goto L_0x005b;\n L_0x0136:\n r13 = move-exception;\n if (r3 == 0) goto L_0x013c;\n L_0x0139:\n r3.close();\t Catch:{ IOException -> 0x013d }\n L_0x013c:\n throw r13;\n L_0x013d:\n r14 = move-exception;\n goto L_0x013c;\n L_0x013f:\n r13 = move-exception;\n goto L_0x005b;\n L_0x0142:\n r13 = move-exception;\n r10 = r11;\n goto L_0x005d;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.actionbarsherlock.widget.ActivityChooserModel.HistoryPersister.run():void\");\n }", "public String getData ()\n {\n if ( this.isAlive() )\n throw new IllegalStateException(\"getData: thread is still running\");\n return this.data.toString();\n }", "public static void Guardarnoti (Long duration, Data data, String tag){\n System.out.println(\"Estamos en Guardar noti -->\"+ duration +\"Tag: \"+tag);\n OneTimeWorkRequest noti = new OneTimeWorkRequest.Builder(WorkManager_noti.class)\n .setInitialDelay(duration, TimeUnit.MILLISECONDS).addTag(tag)\n .setInputData(data).build();\n\n WorkManager instance =WorkManager.getInstance();\n instance.enqueue(noti);\n }", "public void put(T data){\r\n\t\tthis.data = data;\r\n\t}", "void saveSaves(Object data, Context context);", "protected void storeCurrentValues() {\n }", "@Override\n public void run() {\n int flagcount = 0;\n Map<String, Integer> setBackLinksCounter = new HashMap<>(0);\n Map<String, Integer[]> setPaDaCounter = new HashMap<>(0);\n try {\n for (String domainName : setDomains) {\n setBackLinksCounter.put(domainName.trim(), getBackLinksCount(domainName.trim()));\n setPaDaCounter.put(domainName.trim(), getPaDaCounts(domainName.trim()));\n }\n } catch (Exception ex) {\n l.debug(ex + \" \" + ex.getMessage());\n }\n\n Integer countBackLinks;\n Integer[] countPaDa;\n String domainName;\n Integer keywordId;\n List<Serpkeywords> lstKeywordsURL = new ArrayList<>();\n List<Seokeyworddetails> listUpdatedKeywords = new ArrayList<>();\n try {\n for (Serpkeywords objKeywords : lstKeywords) {\n boolean check = false;\n if (lstKeywordsURL.size() != 0) {\n // System.out.println(\"came to dis section\");\n for (Serpkeywords stringURL : lstKeywordsURL) {\n \n if (stringURL.getUrl().equalsIgnoreCase(objKeywords.getUrl())) {\n System.out.println(\"true\");\n check = true;\n }\n }\n }\n if (check == false) {\n lstKeywordsURL.add(objKeywords);\n }\n }\n } catch (Exception ex) {\n l.debug(ex + \" \" + ex.getMessage());\n }\n \n\n try {\n // for (Serpkeywords objKeywords : lstKeywords) {\n Seokeyworddetails objSeokeyworddetails=null;\n for (Serpkeywords objKeywords : lstKeywordsURL) {\n objSeokeyworddetails = new Seokeyworddetails();\n\n domainName = objKeywords.getUrl().trim();\n keywordId = objKeywords.getKeywordID();\n countBackLinks = setBackLinksCounter.get(domainName);\n countPaDa = setPaDaCounter.get(domainName);\n int pacount = countPaDa[0];\n int dacount = countPaDa[1];\n if (countPaDa[1] == -1) {\n dacount = getDAvalue(domainName);\n }\n System.out.println(\"keywordis:::: \" + keywordId);\n System.out.println(\"Domain:::::: \" + domainName);\n System.out.println(\"da:::: \" + dacount);\n System.out.println(\"pa:::: \" + pacount);\n System.out.println(\"Backlinks :: \" + countBackLinks);\n\n objSeokeyworddetails.setKeywordID(objKeywords);\n objSeokeyworddetails.setUrl(domainName);\n objSeokeyworddetails.setKeyword(objKeywords.getKeyword());\n objSeokeyworddetails.setCampaignID(objKeywords.getCampaignID());\n objSeokeyworddetails.setCountBackLinks(countBackLinks);\n objSeokeyworddetails.setGooglePA(pacount);\n objSeokeyworddetails.setGoogleDA(dacount);\n\n listUpdatedKeywords.add(objSeokeyworddetails);\n\n// objKeywordDao.saveBackLinksResult1(keywordId, domainName, objKeywords.getKeyword(), objKeywords.getCampaignID(), countBackLinks, startTrackId, endtrackId, objKeywords.getUrl());\n// objKeywordDao.savePaDaResult1(keywordId, domainName, objKeywords.getKeyword(), objKeywords.getCampaignID(), pacount, dacount, objKeywords.getUrl());\n }\n\n } catch (Exception ex) {\n l.debug(ex + \" \" + ex.getMessage());\n }\n\n try {\n\n for (Seokeyworddetails objUniqueURL : listUpdatedKeywords) {\n\n for (Serpkeywords objKeywords : lstKeywords) {\n if (objUniqueURL.getUrl().equals(objKeywords.getUrl())) {\n keywordId = objUniqueURL.getKeywordID().getKeywordID();\n objKeywordDao.saveBackLinksResult(objKeywords.getKeywordID(), objKeywords.getUrl(), objKeywords.getKeyword(), objKeywords.getCampaignID(), objUniqueURL.getCountBackLinks(), startTrackId, endtrackId);\n objKeywordDao.savePaDaResult(objKeywords.getKeywordID(), objKeywords.getUrl(), objKeywords.getKeyword(), objKeywords.getCampaignID(),objUniqueURL.getGooglePA() , objUniqueURL.getGoogleDA());\n\n }\n\n }\n }\n\n } catch (Exception ex) {\n l.debug(ex + \" \" + ex.getMessage());\n }\n\n }", "private synchronized void syncData() {\n try {\n // pulling data from server\n pullData();\n\n // pushing local changes to server\n// recordStatus=2\n pushData();\n// recordStatus=1\n// pushData1();\n } catch (Throwable throwable) {\n Log.d(TAG, \"doWork: \" + throwable.getMessage());\n }\n // Toast.makeText(getApplicationContext(), \".\", Toast.LENGTH_SHORT).show();\n }", "void processRunEntry(RunningEntry ent,String lock,DystoreStore ds)\n{\n String th = ent.getThreadName();\n DylockLockRunData rd = getRunData(lock,ent.getTime());\n switch (ent.getEntryType()) {\n case ENTER :\n\t rd.addWaiting(ent.getTime(),th,ds,VIEW_TYPE_MUTEX);\n\t break;\n case ENTERED :\n\t rd.doneWaiting(ent.getTime(),th,ds);\n\t rd.acquireLock(ent.getTime(),th,ds,VIEW_TYPE_MUTEX);\n\t break;\n case UNLOCK :\n\t rd.releaseLock(ent.getTime(),th,ds,VIEW_TYPE_MUTEX);\n\t break;\n case RESET :\n\t rd.clear();\n\t break;\n }\n}", "void writeCurrentTrackData(int position, int value) {\n currentTrackData[position].write(position, value);\n }", "public void applyData(Object data) {\n \t\tif (!(data instanceof String))\n \t\t\treturn;\n \n \t\tfor (int i= 0; i < fListModel.length; i++) {\n \t\t\tfinal ListItem element= fListModel[i];\n \t\t\tif (data.equals(element.label)) {\n \t\t\t\tfinal Control control= fAnnotationTypeViewer.getControl();\n \t\t\t\tcontrol.getDisplay().asyncExec(new Runnable() {\n \t\t\t\t\tpublic void run() {\n \t\t\t\t\t\tcontrol.setFocus();\n \t\t\t\t\t\tfAnnotationTypeViewer.setSelection(new StructuredSelection(element), true);\n \t\t\t\t\t}\n \t\t\t\t});\n \t\t\t\treturn;\n \t\t\t}\n \t\t}\n \t}", "private void getSleepData() {\n\n }", "@Override\n public void run()\n {\n Double yearsSumArray[] = {0.0,0.0 };\n LinkedHashMap<Integer,Double > data_years = new LinkedHashMap<>();\n SortedSet<Long> keys = new TreeSet<>(data.keySet());\n for (Long key : keys)\n {\n Double value = data_years.get(key);\n Date date = new Date(key);\n int year = getYearNumber(date);\n if(data_years.get(year) == null)\n data_years.put(year,value);\n else\n data_years.put(year,data_years.get(year)+value);\n\n }\n Iterator iterator = data_years.entrySet().iterator();\n while (iterator.hasNext())\n {\n LinkedHashMap.Entry<Integer, Double>set = (LinkedHashMap.Entry<Integer, Double>) iterator.next();\n getActivity().runOnUiThread(new OneShotTask(label, datasetIndex,(long)set.getKey(),set.getValue()));\n }\n\n }", "private void updateData() {\n // store if checkbox is enabled and update the label accordingly\n updateOneItem(jcbMaxTracks, jsMaxTracks, jnMaxTracks, Variable.MAXTRACKS,\n Variable.MAXTRACKS_ENABLED);\n updateOneItem(jcbMaxSize, jsMaxSize, jnMaxSize, Variable.MAXSIZE, Variable.MAXSIZE_ENABLED);\n updateOneItem(jcbMaxLength, jsMaxLength, jnMaxLength, Variable.MAXLENGTH,\n Variable.MAXLENGTH_ENABLED);\n if (jcbOneMedia.isSelected()) {\n data.put(Variable.ONE_MEDIA, jcbMedia.getSelectedItem());\n data.put(Variable.ONE_MEDIA_ENABLED, Boolean.TRUE);\n } else {\n // keep old value... data.remove(Variable.KEY_MEDIA);\n data.put(Variable.ONE_MEDIA_ENABLED, Boolean.FALSE);\n }\n data.put(Variable.CONVERT_MEDIA, jcbConvertMedia.isSelected());\n data.put(Variable.RATING_LEVEL, jsRatingLevel.getValue());\n data.put(Variable.NORMALIZE_FILENAME, jcbNormalizeFilename.isSelected());\n }", "private void onRequestData(int tag) {\n \ttry {\n \t data = request.request();\n \t} catch(MatjiException e) {\n \t lastOccuredException = e;\n \t}\n }", "private void extractData(ChatConnection connection, HashMap<String, String> data, String message){\n\t\tString[] tags = message.split(\"tmi.twitch.tv \");\n\t\tfor (String item : new ArrayList<String>(Arrays.asList(tags[0].split(\";\")))) {\n\t\t\tif(!item.contains(\"=\")){\n\t\t\t\tdata = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tString key = item.substring(0, item.indexOf('='));\n\t\t\tString value = item.substring(item.indexOf('=') + 1);\n\t\t\tdata.put(key, value);\n\t\t}\n\t\tdata.put(\"tag\", tags[1].substring(0, tags[1].indexOf(connection.getChannelName())-1));\n\t}", "private void savePoSTag(PoSTag poSTag){\n Long num;\n num = poSTagPerWordMap.get(poSTag.getWord());\n poSTagPerWordMap.put(poSTag.getWord(), (num == null) ? (long)1 : num+1);\n\n num = poSTagMap.get(poSTag);\n poSTagMap.put(poSTag, (num == null) ? (long)1 : num+1);\n\n\n }", "@Override\n\t\tprotected void map(Object key, Text value, Context context)\n\t\t\t\tthrows IOException, InterruptedException {\n\t\t\tStringTokenizer str=new StringTokenizer(value.toString());\n//\t\t\tString[]str=new String(value.toString()).split(\"a\");\n\t\t\twhile(str.hasMoreTokens()){\n\t\t\t\tword.set(str.nextToken());\n\t\t\t\tcontext.write(word, one);\n\t\t\t\t}\n//\t\t\tfor(String b:str){\n//\t\t\t\tword.set(b);\n//\t\t\t\tcontext.write(word, one);\n//\t\t\t\t\n//\t\t\t}\n\t\t\t\n\t\t}", "public String getTagVal() {\n return tagVal;\n }", "public String getThreadsValue() {\r\n\t\treturn threadsValue;\r\n\t}", "void store(WebCrawlerData data);", "public synchronized void run() {\n String mesg = \"\";\n boolean saved = false;\n // Timeout in 10 seconds (5 loops per second)\n int counter = 50;\n // start to save flag changes\n System.out.println(\"SAVE FLAG WITH domain=\" + domainTextbox.getText() + \" comment=\" + commentTextbox.getText());\n cgiDataPoster saverThread = nfp.saveFlagHistory(flagFileID, domainTextbox.getText(), commentTextbox.getText());\n // check messages\n while (counter > 0) {\n mesg = saverThread.getMessage();\n if (mesg != null && mesg.startsWith(\"Saved\")) {\n System.out.println(\" GOT SAVED MESSAGE\");\n flagFileID = mesg.substring(mesg.indexOf(\"ID=\") + 3);\n mesg = mesg.substring(0, mesg.indexOf(\"ID=\"));\n saved = true;\n counter = 0;\n }\n if (mesg != null && mesg.startsWith(\"Failed\")) {\n System.out.println(\" GOT FAILED MESSAGE\");\n counter = 0;\n }\n question.setText(mesg);\n try {\n Thread.sleep(200);\n }\n catch (Exception e) {\n System.out.println(e);\n }\n counter--;\n }\n // close the panel whether it saved or not\n System.out.println(\"SAVED success=\" + saved);\n repaint();\n // wait 1.5 sec then hide panel\n try {\n Thread.sleep(1500);\n }\n catch (Exception e) {\n System.out.println(e);\n }\n this.close();\n }", "public void setUserData(Object data);", "public static void doSavechanges ( RunData data)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\t\tParameterParser params = data.getParameters ();\n\n\t\tString flow = params.getString(\"flow\").trim();\n\n\t\tif(flow == null || \"cancel\".equals(flow))\n\t\t{\n\t\t\tdoCancel(data);\n\t\t\treturn;\n\t\t}\n\n\t\t// get values from form and update STATE_STACK_EDIT_ITEM attribute in state\n\t\tcaptureValues(state, params);\n\n\t\tMap current_stack_frame = peekAtStack(state);\n\n\t\tEditItem item = (EditItem) current_stack_frame.get(STATE_STACK_EDIT_ITEM);\n\n\t\tif(flow.equals(\"showMetadata\"))\n\t\t{\n\t\t\tdoShow_metadata(data);\n\t\t\treturn;\n\t\t}\n\t\telse if(flow.equals(\"hideMetadata\"))\n\t\t{\n\t\t\tdoHide_metadata(data);\n\t\t\treturn;\n\t\t}\n\t\telse if(flow.equals(\"intentChanged\"))\n\t\t{\n\t\t\tdoToggle_intent(data);\n\t\t\treturn;\n\t\t}\n\t\telse if(flow.equals(\"addInstance\"))\n\t\t{\n\t\t\tString field = params.getString(\"field\");\n\t\t\taddInstance(field, item.getProperties());\n\t\t\tResourcesMetadata form = item.getForm();\n\t\t\tList flatList = form.getFlatList();\n\t\t\titem.setProperties(flatList);\n\t\t\treturn;\n\t\t}\n\t\telse if(flow.equals(\"linkResource\"))\n\t\t{\n\t\t\t// captureMultipleValues(state, params, false);\n\t\t\tcreateLink(data, state);\n\t\t\t//Map new_stack_frame = pushOnStack(state);\n\t\t\t//new_stack_frame.put(ResourcesAction.STATE_RESOURCES_HELPER_MODE, ResourcesAction.MODE_ATTACHMENT_SELECT);\n\t\t\tstate.setAttribute(ResourcesAction.STATE_RESOURCES_HELPER_MODE, ResourcesAction.MODE_ATTACHMENT_SELECT);\n\n\t\t\treturn;\n\t\t}\n\n\n\t\tSet alerts = (Set) state.getAttribute(STATE_EDIT_ALERTS);\n\n//\t\tif(item.isStructuredArtifact())\n//\t\t{\n//\t\t\tSchemaBean bean = (SchemaBean) current_stack_frame.get(STATE_STACK_STRUCT_OBJ_SCHEMA);\n//\t\t\tSaveArtifactAttempt attempt = new SaveArtifactAttempt(item, bean.getSchema());\n//\t\t\tvalidateStructuredArtifact(attempt);\n//\n//\t\t\tIterator errorIt = attempt.getErrors().iterator();\n//\t\t\twhile(errorIt.hasNext())\n//\t\t\t{\n//\t\t\t\tValidationError error = (ValidationError) errorIt.next();\n//\t\t\t\talerts.add(error.getDefaultMessage());\n//\t\t\t}\n//\t\t}\n\n\t\tif(alerts.isEmpty())\n\t\t{\n\t\t\t// populate the property list\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// get an edit\n\t\t\t\tContentCollectionEdit cedit = null;\n\t\t\t\tContentResourceEdit redit = null;\n\t\t\t\tGroupAwareEdit gedit = null;\n\t\t\t\tResourcePropertiesEdit pedit = null;\n\n\t\t\t\tif(item.isFolder())\n\t\t\t\t{\n\t\t\t\t\tcedit = ContentHostingService.editCollection(item.getId());\n\t\t\t\t\tgedit = cedit;\n\t\t\t\t\tpedit = cedit.getPropertiesEdit();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tredit = ContentHostingService.editResource(item.getId());\n\t\t\t\t\tgedit = redit;\n\t\t\t\t\tpedit = redit.getPropertiesEdit();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tBoolean preventPublicDisplay = (Boolean) state.getAttribute(STATE_PREVENT_PUBLIC_DISPLAY);\n\t\t\t\t\tif(preventPublicDisplay == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tpreventPublicDisplay = Boolean.FALSE;\n\t\t\t\t\t\tstate.setAttribute(STATE_PREVENT_PUBLIC_DISPLAY, preventPublicDisplay);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(! preventPublicDisplay.booleanValue())\n\t\t\t\t\t{\n\t\t\t\t\t\tContentHostingService.setPubView(gedit.getId(), item.isPubview());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(! AccessMode.GROUPED.toString().equals(item.getAccess()) && AccessMode.GROUPED == gedit.getAccess())\n\t\t\t\t\t{\n\t\t\t\t\t\tgedit.clearGroupAccess();\n\t\t\t\t\t}\n\t\t\t\t\telse if(AccessMode.GROUPED.toString().equals(item.getAccess()) && ! item.getEntityGroupRefs().isEmpty())\n\t\t\t\t\t{\n\t\t\t\t\t\tgedit.setGroupAccess(item.getEntityGroupRefs());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tgedit.clearGroupAccess();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(InconsistentException e)\n\t\t\t\t{\n\t\t\t\t\t// TODO: Should this be reported to user??\n\t\t\t\t\tlogger.debug(\"ResourcesAction.doSavechanges ***** InconsistentException changing groups ***** \" + e.getMessage());\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(ContentHostingService.isAvailabilityEnabled())\n\t\t\t\t{\n\t\t\t\t\tTime releaseDate = null;\n\t\t\t\t\tTime retractDate = null;\n\t\t\t\t\t\n\t\t\t\t\tboolean hidden = item.isHidden();\n\t\t\t\t\t\n\t\t\t\t\tif(item.useReleaseDate())\n\t\t\t\t\t{\n\t\t\t\t\t\treleaseDate = item.getReleaseDate();\n\t\t\t\t\t}\n\t\t\t\t\tif(item.useRetractDate())\n\t\t\t\t\t{\n\t\t\t\t\t\tretractDate = item.getRetractDate();\n\t\t\t\t\t}\n\t\t\t\t\tgedit.setAvailability(hidden, releaseDate, retractDate);\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\tif(item.isFolder())\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(item.isUrl())\n\t\t\t\t\t{\n\t\t\t\t\t\tredit.setContent(item.getFilename().getBytes());\n\t\t\t\t\t}\n\t\t\t\t\telse if(item.isStructuredArtifact())\n\t\t\t\t\t{\n\t\t\t\t\t\tredit.setContentType(item.getMimeType());\n\t\t\t\t\t\tredit.setContent(item.getContent());\n\t\t\t\t\t}\n\t\t\t\t\telse if(item.contentHasChanged())\n\t\t\t\t\t{\n\t\t\t\t\t\tredit.setContentType(item.getMimeType());\n\t\t\t\t\t\tredit.setContent(item.getContent());\n\t\t\t\t\t}\n\t\t\t\t\telse if(item.contentTypeHasChanged())\n\t\t\t\t\t{\n\t\t\t\t\t\tredit.setContentType(item.getMimeType());\n\t\t\t\t\t}\n\n\t\t\t\t\tBasicRightsAssignment rightsObj = item.getRights();\n\t\t\t\t\trightsObj.addResourceProperties(pedit);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tString copyright = StringUtil.trimToNull(params.getString (\"copyright\"));\n\t\t\t\t\tString newcopyright = StringUtil.trimToNull(params.getCleanString (NEW_COPYRIGHT));\n\t\t\t\t\tString copyrightAlert = StringUtil.trimToNull(params.getString(\"copyrightAlert\"));\n\t\t\t\t\tif (copyright != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (state.getAttribute(COPYRIGHT_NEW_COPYRIGHT) != null && copyright.equals(state.getAttribute(COPYRIGHT_NEW_COPYRIGHT)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (newcopyright != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpedit.addProperty (ResourceProperties.PROP_COPYRIGHT, newcopyright);\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\talerts.add(rb.getString(\"specifycp2\"));\n\t\t\t\t\t\t\t\t// addAlert(state, rb.getString(\"specifycp2\"));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (state.getAttribute(COPYRIGHT_SELF_COPYRIGHT) != null && copyright.equals (state.getAttribute(COPYRIGHT_SELF_COPYRIGHT)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tString mycopyright = (String) state.getAttribute (STATE_MY_COPYRIGHT);\n\t\t\t\t\t\t\tpedit.addProperty (ResourceProperties.PROP_COPYRIGHT, mycopyright);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpedit.addProperty(ResourceProperties.PROP_COPYRIGHT_CHOICE, copyright);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (copyrightAlert != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tpedit.addProperty (ResourceProperties.PROP_COPYRIGHT_ALERT, copyrightAlert);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tpedit.removeProperty (ResourceProperties.PROP_COPYRIGHT_ALERT);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!(item.isFolder() && (item.getId().equals ((String) state.getAttribute (STATE_HOME_COLLECTION_ID)))))\n\t\t\t\t{\n\t\t\t\t\tpedit.addProperty (ResourceProperties.PROP_DISPLAY_NAME, item.getName());\n\t\t\t\t}\t// the home collection's title is not modificable\n\n\t\t\t\tpedit.addProperty (ResourceProperties.PROP_DESCRIPTION, item.getDescription());\n\t\t\t\t// deal with quota (collections only)\n\t\t\t\tif ((cedit != null) && item.canSetQuota())\n\t\t\t\t{\n\t\t\t\t\tif (item.hasQuota())\n\t\t\t\t\t{\n\t\t\t\t\t\t// set the quota\n\t\t\t\t\t\tpedit.addProperty(ResourceProperties.PROP_COLLECTION_BODY_QUOTA, item.getQuota());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// clear the quota\n\t\t\t\t\t\tpedit.removeProperty(ResourceProperties.PROP_COLLECTION_BODY_QUOTA);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tList metadataGroups = (List) state.getAttribute(STATE_METADATA_GROUPS);\n\n\t\t\t\tstate.setAttribute(STATE_EDIT_ALERTS, alerts);\n\t\t\t\tsaveMetadata(pedit, metadataGroups, item);\n\t\t\t\talerts = (Set) state.getAttribute(STATE_EDIT_ALERTS);\n\n\t\t\t\t// commit the change\n\t\t\t\tif (cedit != null)\n\t\t\t\t{\n\t\t\t\t\tContentHostingService.commitCollection(cedit);\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\tContentHostingService.commitResource(redit, item.getNotification());\n\t\t\t\t}\n\n\t\t\t\tcurrent_stack_frame.put(STATE_STACK_EDIT_INTENT, INTENT_REVISE_FILE);\n\n\t\t\t\tBoolean preventPublicDisplay = (Boolean) state.getAttribute(STATE_PREVENT_PUBLIC_DISPLAY);\n\t\t\t\tif(preventPublicDisplay == null)\n\t\t\t\t{\n\t\t\t\t\tpreventPublicDisplay = Boolean.FALSE;\n\t\t\t\t\tstate.setAttribute(STATE_PREVENT_PUBLIC_DISPLAY, preventPublicDisplay);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (TypeException e)\n\t\t\t{\n\t\t\t\talerts.add(rb.getString(\"typeex\") + \" \" + item.getId());\n\t\t\t\t// addAlert(state,\" \" + rb.getString(\"typeex\") + \" \" + item.getId());\n\t\t\t}\n\t\t\tcatch (IdUnusedException e)\n\t\t\t{\n\t\t\t\talerts.add(RESOURCE_NOT_EXIST_STRING);\n\t\t\t\t// addAlert(state,RESOURCE_NOT_EXIST_STRING);\n\t\t\t}\n\t\t\tcatch (PermissionException e)\n\t\t\t{\n\t\t\t\talerts.add(rb.getString(\"notpermis10\") + \" \" + item.getId());\n\t\t\t\t// addAlert(state, rb.getString(\"notpermis10\") + \" \" + item.getId() + \". \" );\n\t\t\t}\n\t\t\tcatch (InUseException e)\n\t\t\t{\n\t\t\t\talerts.add(rb.getString(\"someone\") + \" \" + item.getId());\n\t\t\t\t// addAlert(state, rb.getString(\"someone\") + \" \" + item.getId() + \". \");\n\t\t\t}\n\t\t\tcatch (ServerOverloadException e)\n\t\t\t{\n\t\t\t\talerts.add(rb.getString(\"failed\"));\n\t\t\t}\n\t\t\tcatch (OverQuotaException e)\n\t\t\t{\n\t\t\t\talerts.add(rb.getString(\"changing1\") + \" \" + item.getId() + \" \" + rb.getString(\"changing2\"));\n\t\t\t\t// addAlert(state, rb.getString(\"changing1\") + \" \" + item.getId() + \" \" + rb.getString(\"changing2\"));\n\t\t\t}\n\t\t\tcatch(RuntimeException e)\n\t\t\t{\n\t\t\t\tlogger.debug(\"ResourcesAction.doSavechanges ***** Unknown Exception ***** \" + e.getMessage());\n\t\t\t\tlogger.debug(\"ResourcesAction.doSavechanges ***** Unknown Exception ***** \", e);\n\t\t\t\talerts.add(rb.getString(\"failed\"));\n\t\t\t}\n\t\t}\t// if - else\n\n\t\tif(alerts.isEmpty())\n\t\t{\n\t\t\t// modify properties sucessful\n\t\t\tString mode = (String) state.getAttribute(STATE_MODE);\n\t\t\tpopFromStack(state);\n\t\t\tresetCurrentMode(state);\n\t\t}\t//if-else\n\t\telse\n\t\t{\n\t\t\tIterator alertIt = alerts.iterator();\n\t\t\twhile(alertIt.hasNext())\n\t\t\t{\n\t\t\t\tString alert = (String) alertIt.next();\n\t\t\t\taddAlert(state, alert);\n\t\t\t}\n\t\t\talerts.clear();\n\t\t\tstate.setAttribute(STATE_EDIT_ALERTS, alerts);\n\t\t\t// state.setAttribute(STATE_CREATE_MISSING_ITEM, missing);\n\t\t}\n\n\t}", "private void getSavedValues() {\r\n\r\n if (this.pl_expert.getParam(\"displayNodeDegree\") != null) {\r\n this.display_node_degree_current = this.pl_expert.getParam(\"displayNodeDegree\");\r\n } else {\r\n this.display_node_degree_current = display_node_degree_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"displayEdges\") != null) {\r\n this.display_edges_current = this.pl_expert.getParam(\"displayEdges\");\r\n } else {\r\n this.display_edges_current = display_edges_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"scale\") != null) {\r\n this.scale_current = this.pl_expert.getParam(\"scale\");\r\n } else {\r\n this.scale_current = scale_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"minWeight\") != null) {\r\n this.minweight_edges_current = this.pl_expert.getParam(\"minWeight\");\r\n } else {\r\n this.minweight_edges_current = minweight_edges_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"iterations\") != null) {\r\n this.iterations_current = this.pl_expert.getParam(\"iterations\");\r\n } else {\r\n this.iterations_current = iterations_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"vote_value\") != null) {\r\n this.vote_value_current = this.pl_expert.getParam(\"vote_value\");\r\n } else {\r\n this.vote_value_current = vote_value_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"keep_value\") != null) {\r\n this.keepclass_value_current = this.pl_expert.getParam(\"keep_value\");\r\n } else {\r\n this.keepclass_value_current = keepclass_value_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"mut_value\") != null) {\r\n this.mut_value_current = this.pl_expert.getParam(\"mut_value\");\r\n } else {\r\n this.mut_value_current = mut_value_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"mutationParameter\") != null) {\r\n this.mut_option_current = this.pl_expert.getParam(\"mutationParameter\");\r\n } else {\r\n this.mut_option_current = mut_option_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"Update_param\") != null) {\r\n this.update_param_current = this.pl_expert.getParam(\"Update_param\");\r\n } else {\r\n this.update_param_current = update_param_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"Alg_param\") != null) {\r\n this.alg_param_current = this.pl_expert.getParam(\"Alg_param\");\r\n } else {\r\n this.alg_param_current = alg_param_default;\r\n }\r\n\r\n if (this.pl_expert.getParam(\"only_sub\") != null) {\r\n this.display_sub_current = new Boolean(this.pl_expert.getParam(\"only_sub\")).booleanValue();\r\n } else {\r\n this.display_sub_current = display_sub_default;\r\n }\r\n\r\n this.is_alg_started = false;\r\n }", "@Override\r\n @SuppressWarnings(\"empty-statement\")\r\n public Object createTaskData(int taskid) { \r\n List curPara = new ArrayList();\r\n ArrayList<String[]> regArgs1=new ArrayList<String[]>();\r\n String [] regArgs2 = null;\r\n synchronized(lock){\r\n curPara = paramList.get(taskid); \r\n }\r\n \r\n String _taskType = curPara.get(2).toString();\r\n String _info1 = curPara.get(4).toString();\r\n String _info2 = curPara.get(5).toString();\r\n if(_taskType.equals(\"c4c\")){ \r\n String _tupleTag = curPara.get(1).toString();\r\n HashMap<String,Object> requestArgs ;\r\n if (_info2.equals(\"MET\")) {\r\n try {\r\n Thread.sleep(100);\r\n System.out.println(\"[Notification-createTaskData] metadata array to send \"+C4CHelper.regArgs2.size());\r\n Thread.sleep(100);\r\n regArgs1=C4CHelper.regArgs2;\r\n Thread.sleep(10000);\r\n System.out.println(\"[Notification-createTaskData] metadata completed\");\r\n C4CHelper.uploadModel=true;\r\n } catch (Exception ex) {\r\n Logger.getLogger(FedMeteorPublisherMaster.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n } else if (_info2.equals(\"VER\")){\r\n try {\r\n Thread.sleep(100);\r\n System.out.println(\"[Notification-createTaskData] version array to send \"+C4CHelper.regArgs1.size());\r\n Thread.sleep(100);\r\n regArgs1=C4CHelper.regArgs1;\r\n Thread.sleep(10000);\r\n System.out.println(\"[Notification-createTaskData] version completed\");\r\n } catch (InterruptedException ex) {\r\n Logger.getLogger(FedMeteorPublisherMaster.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n } else if (_info1.equals(\"CONFIG\")){\r\n try {\r\n ArrayList<String[]> result=new ArrayList<String[]>();\r\n String[] res=new String[10];\r\n System.out.println(\"[Notification-createTaskData] config array to send: \"+C4CHelper.resultConfig.length());\r\n Thread.sleep(100);\r\n Pattern pattern = Pattern.compile(\"<IPAddress>(.*?)</IPAddress>\");\r\n Pattern pattern2 = Pattern.compile(\"<Port>(.*?)</Port>\");\r\n Matcher matcher = pattern.matcher(C4CHelper.resultConfig);\r\n Matcher matcher2 = pattern2.matcher(C4CHelper.resultConfig);\r\n while ((matcher.find()) && (matcher2.find())){\r\n res[0]=matcher.group(1);\r\n res[1]=matcher2.group(1);\r\n //System.out.println(\"[Notification-createTaskData] 1111 config completed \"+res[0] +\"-\"+res[1]);\r\n result.add(new String[] {res[0],res[1]});\r\n \r\n } \r\n regArgs1=result;\r\n //System.out.println(\"[Socket getInterfaceData] configuring ...end \"+result.get(0)[0]);\r\n //System.out.println(\"[Socket getInterfaceData] configuring ...end \"+result.get(0)[1]);\r\n System.out.println(\"[Notification-createTaskData] config completed\");\r\n \r\n } catch (InterruptedException ex) {\r\n Logger.getLogger(FedMeteorPublisherMaster.class.getName()).log(Level.SEVERE, null, ex);\r\n } \r\n } else { \r\n \r\n System.out.println(\"[Notification-createTaskData] fetch received\");\r\n }\r\n return (Object) regArgs1;\r\n \r\n }else if(_taskType.equals(\"C4C\")){\r\n String _tupleTag = curPara.get(1).toString();\r\n HashMap<String,Object> requestArgs ;\r\n if(_tupleTag.equals(\"CPT\")){\r\n requestArgs = (HashMap<String,Object>)curPara.get(9);\r\n }else{\r\n regArgs1 = null;\r\n }\r\n return (Object) regArgs1;\r\n }else{\r\n return null;\r\n } \r\n }", "public void saveData() {\n\t\t//place to save notes e.g to file\n\t}", "@Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n TagAttrazioneDAO.Tag result = dataSnapshot.getValue(TagAttrazioneDAO.Tag.class);\n result.ID = dataSnapshot.getKey();\n\n resultTags.add(result);\n\n if (resultTags.size() == attrazione.Tags.size()) {\n //ho letto tutti gli elementi, notifico il listener\n listener.onDataRead(resultTags);\n }\n\n }", "public BrowseHistoryContentValues putThreadId(long value) {\n mContentValues.put(BrowseHistoryColumns.THREAD_ID, value);\n return this;\n }", "public void Sync_Voting_Data() {\n progressdial();\n Thread T2 = new Thread() {\n @Override\n public void run() {\n try {\n if (!db.isOpen())\n db = openOrCreateDatabase(\"MDA_Club\", SQLiteDatabase.CREATE_IF_NECESSARY, null);\n\n String SqlQry = \"Select OP2_ID,User_Ans,Remark from C_\" + ClientId + \"_OP3 Where OP1_ID=\" + Mid + \" AND Submit=1 AND SyncID=1 Order by OP2_ID\";\n Cursor cursorT = db.rawQuery(SqlQry, null);\n String UAns, Remark, SData = \"\";\n int Op2Id;\n while (cursorT.moveToNext()) {\n Op2Id = cursorT.getInt(0);\n UAns = chkval(cursorT.getString(1));\n Remark = chkval(cursorT.getString(2));\n SData = SData + Op2Id + \"^\" + UAns + \"^\" + Remark + \"@@\";\n }\n cursorT.close();\n\n\n if (SData.length() > 2) {\n SData = SData.substring(0, SData.length() - 2);\n\n String TempMS = \"M\";\n if (UserType.equals(\"SPOUSE\")) {\n TempMS = \"S\";\n }\n\n SData = LogId + \"#\" + TempMS + \"#\" + Mid + \"#\" + SData + \"#\" + GPSLoc;\n\n WebServiceCall webcall = new WebServiceCall();\n WebResult = webcall.Sync_OpinionPoll_MS(ClientId, SData);\n if (WebResult.contains(\"Saved\")) {\n SqlQry = \"Update C_\" + ClientId + \"_OP3 Set SyncID=0 Where OP1_ID=\" + Mid;\n db.execSQL(SqlQry);\n } else {\n SqlQry = \"Delete from C_\" + ClientId + \"_OP3 Where OP1_ID=\" + Mid;\n db.execSQL(SqlQry);\n }\n }\n db.close();\n\n runOnUiThread(new Runnable() {\n public void run() {\n if (WebResult.contains(\"Saved\")) {\n btnSubmit.setVisibility(View.GONE);\n LV1.setEnabled(false);\n AlertDisplay(\"Result\", \"Submitted Successfully !\", true);\n } else if (WebResult.contains(\"Error\")) {\n AlertDisplay(\"Technical issue\", \"Something went wrong. Please try later !\", false);\n } else {\n AlertDisplay(\"Result\", WebResult, false);\n }\n }\n });\n } catch (Exception e) {\n //System.out.println(e.getMessage());\n e.printStackTrace();\n }\n Progsdial.dismiss();\n }\n };\n T2.start();\n }", "R serializeData(T t);", "public void shareData(){\n SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);\n //now get Editor\n SharedPreferences.Editor editor = sharedPref.edit();\n //put your value\n editor.putInt(\"score3\", points);\n\n //commits your edits\n editor.commit();\n }", "@Override\n public void run() {\n try {\n AlgoSimulationStepData algoSimulationStepData = changeQueue.take();\n temp[0] = algoSimulationStepData.getNodeButton();\n color[0] = algoSimulationStepData.getColor();\n temp[0].setBackgroundResource(color[0]);\n\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n\n }", "@Override\r\n\tpublic Text getCurrentValue() throws IOException, InterruptedException {\n\t\treturn this.value;\r\n\t}", "public void save(HashMap<Integer, T> data) {\n\t\tthis.data.putAll(data);\n\t}", "protected void processData(DataBean bean) {\n \t\tList<DataSetWithAxisInformation> dc = bean.getData();\n \t\tfinal AbstractDataset d = dc.get(0).getData();\n \t\tparentComp.getDisplay().asyncExec(new Runnable() {\n \t\t\t@Override\n \t\t\tpublic void run() {\n \t\t\t\tbtnStoreCurrentAsA.setEnabled(true);\n \t\t\t\tbtnStoreCurrentAsB.setEnabled(true);\n \t\t\t\ttry {\n \t\t\t\t\ttextMaxVal.setText(formatNumber(d.max()));\n \t\t\t\t\ttextMaxPos.setText(formatIntArray(d.maxPos()));\n \t\t\t\t} catch (UnsupportedOperationException e) {\n \t\t\t\t\ttextMaxVal.setText(\"n/a\");\n \t\t\t\t\ttextMaxPos.setText(\"\");\n \t\t\t\t}\n \t\t\t\ttry {\n \t\t\t\t\ttextMinVal.setText(formatNumber(d.min()));\n \t\t\t\t\ttextMinPos.setText(formatIntArray(d.minPos()));\n \t\t\t\t} catch (UnsupportedOperationException e) {\n \t\t\t\t\ttextMinVal.setText(\"n/a\");\n \t\t\t\t\ttextMinPos.setText(\"\");\n \t\t\t\t}\n \t\t\t\ttextSum.setText(formatObject(d.sum()));\n \t\t\t\ttextMean.setText(formatObject(d.mean()));\n \t\t\t}\n \t\t});\n \t}", "private static void saveData(String data) {\n }", "void setData(T data) {\n\t\tthis.data = data;\n\t}", "@Override\n\tpublic void saveTag(Tag newTag) throws Exception {\n\n\t}", "public void saveData ( ) {\n\t\tinvokeSafe ( \"saveData\" );\n\t}", "private void m45629a(long j, Context context) {\n boolean[] c = m45633c();\n SharedPreferences sharedPreferences = context.getSharedPreferences(SettingsManager.INSTABUG_SHARED_PREF_NAME, 0);\n c[61] = true;\n sharedPreferences.edit().putLong(\"LAST_FETCHED_AT\", j).apply();\n c[62] = true;\n }", "public List<Feature> process(String tag, String data);", "@Override\n public void run() {\n new NdefReaderTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,tag);\n }", "public void setData(T data){\n this.data = data;\n }", "public void updateDataModel() {\n //this.dataModel = new TelemetryChartDataModel();\n this.dataModel.\n setModel(getStartDate(), getEndDate(), selectedProjects, telemetryName, parameters);\n Thread thread = new Thread() {\n @Override\n public void run() {\n dataModel.loadData();\n }\n };\n thread.start();\n }", "private void getDataFromSharedPrefernce() {\r\n\r\n\t\tprofileImageString = mSharedPreferences_reg.getString(\"ProfileImageString\",\"\");\r\n\t\tpsedoName = mSharedPreferences_reg.getString(\"PseudoName\", \"\");\r\n\t\tprofiledescription = mSharedPreferences_reg.getString(\"Pseudodescription\", \"\");\r\n\r\n\t\tsetDataToRespectiveFields();\r\n\t}", "public void setCurrent (T aData){\r\n if(curr != null)\r\n curr.data = aData;\r\n }", "public static final void current (IData pipeline)\n throws ServiceException\n\t{\n\t\t// --- <<IS-START(current)>> ---\n\t\t// @subtype unknown\n\t\t// @sigtype java 3.5\n\t\t// [o] recref:0:required $thread tundra.schema:thread\n\t\tIDataCursor cursor = pipeline.getCursor();\n\n\t\ttry {\n\t\t IDataHelper.put(cursor, \"$thread\", ThreadHelper.toIData(ThreadHelper.current()));\n\t\t} finally {\n\t\t cursor.destroy();\n\t\t}\n\t\t// --- <<IS-END>> ---\n\n\n\t}", "private void parseData() {\n\t\t\r\n\t}", "public void onParaDataChangeByVar(int i) {\n }", "public void writeEntityToNBT(NBTTagCompound tagCompound) {\n/* 165 */ tagCompound.setInteger(\"Life\", this.fireworkAge);\n/* 166 */ tagCompound.setInteger(\"LifeTime\", this.lifetime);\n/* 167 */ ItemStack var2 = this.dataWatcher.getWatchableObjectItemStack(8);\n/* */ \n/* 169 */ if (var2 != null) {\n/* */ \n/* 171 */ NBTTagCompound var3 = new NBTTagCompound();\n/* 172 */ var2.writeToNBT(var3);\n/* 173 */ tagCompound.setTag(\"FireworksItem\", (NBTBase)var3);\n/* */ } \n/* */ }", "public abstract VALUEIN getCurrentValue() throws IOException, \n InterruptedException;", "public NBTTagCompound writeToNBT(NBTTagCompound tag)\r\n/* 158: */ {\r\n/* 159:159 */ tag.setByte(\"Id\", (byte)getID());\r\n/* 160:160 */ tag.setByte(\"Amplifier\", (byte)getAmplifier());\r\n/* 161:161 */ tag.setInt(\"Duration\", getDuration());\r\n/* 162:162 */ tag.setBoolean(\"Ambient\", getAmbient());\r\n/* 163:163 */ tag.setBoolean(\"ShowParticles\", getShowParticles());\r\n/* 164:164 */ return tag;\r\n/* 165: */ }", "@Override\n public void run() {\n /* try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }*/\n System.out.println(Thread.currentThread().getName());\n AddDataFromFile();\n Thread.yield();\n /* try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }*/\n\n }", "@Override\n public void run() {\n CompareService.getRankedJobStrings();\n\n // get current job\n current = DataHandler.GetDataHandlerInstance().GetCurrentJob();\n String formattedComp =\n JOB.title + \" | \" + current.title + \"\\n\" +\n JOB.currentJob + \" | \" + current.currentJob + \"\\n\" +\n JOB.company + \" | \" + current.company + \"\\n\" +\n JOB.city + \" | \" + current.city + \"\\n\" +\n JOB.state + \" | \" + current.state + \"\\n\" +\n JOB.yearlySalary + \" | \" + current.yearlySalary + \"\\n\" +\n JOB.yearlyBonus + \" | \" + current.yearlyBonus + \"\\n\" +\n JOB.teleworkDaysPerWeek + \" | \" + current.teleworkDaysPerWeek + \"\\n\" +\n JOB.retirementBenefit + \" | \" + current.retirementBenefit + \"\\n\" +\n JOB.leaveTime + \" | \" + current.leaveTime;\n intent.putExtra(\"job1\", JOB.title + \", \" + JOB.company);\n intent.putExtra(\"job2\", current.title + \", \" + current.company);\n startActivity(intent);\n }", "@Override\n\tpublic void saveNBTData(NBTTagCompound compound)\n\t{\n\t\t// We need to create a new tag compound that will save everything for our Extended Properties\n\t\tNBTTagCompound properties = new NBTTagCompound();\n\n\t\t// Store the Authy cell number and player email\n\t\tproperties.setString(\"AuthyCell\", this.authyCell);\n\t\tproperties.setString(\"PlayerEmail\", this.playerEmail);\n\t\tproperties.setString(\"AuthyCountryCode\", this.authyCountryCode);\n\t\tproperties.setString(\"AuthyID\", this.authyID);\n\t\tproperties.setString(\"AuthyPushRequestUUID\", this.pushRequestUUID);\n\t\tproperties.setString(\"AuthyPushRequestStatus\", this.pushRequestStatus);\n\t\tproperties.setIntArray(\"AuthySecuredDoorLocation\", this.authySecuredDoorLocation);\n\t\t// Store the date as milliseconds since Jan 1st 1970 because the properties class cannot store dates.\n\t\tif (this.authySuccessDate == null) {\n\t\t\tproperties.setLong(\"AuthyLast2FASuccess\", 0);\n\t\t} else {\n\t\t\tproperties.setLong(\"AuthyLast2FASuccess\", this.authySuccessDate.getTime());\n\t\t}\t\t\n\t\tcompound.setTag(EXT_PROP_NAME, properties);\n\t}", "private void saveData() {\n\n SharedPreferences sharedPreferences=getSharedPreferences(\"userInfo\", Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=sharedPreferences.edit();\n\n editor.putString(\"name\",name.getText().toString());\n editor.putString(\"regnum\",regnum.getText().toString());\n editor.putInt(\"count\", count);\n editor.apply();\n\n }", "@Override\n public boolean putRunData(RunData data)\n {\n if (data instanceof TurbineRunData)\n {\n parserService.putParser(((TurbineRunData) data).getParameterParser());\n parserService.putParser(((TurbineRunData) data).getCookieParser());\n\n return pool.putInstance(data);\n }\n else\n {\n return false;\n }\n }", "@Override\n\tpublic byte[] serialize(String topic, SearcherJob data) {\n\t\tbyte[] retVal = null;\n\t ObjectMapper objectMapper = new ObjectMapper();\n\t try {\n\t retVal = objectMapper.writeValueAsString(data).getBytes();\n\t } catch (Exception e) {\n\t e.printStackTrace();\n\t }\n\t return retVal;\n\t}", "void updateTags();", "LearningComponentTagcloud save(\r\n\t\t\tLearningComponentTagcloud learningComponentTagcloud);", "private void setUserData(){\n }", "private void collectTags\n (int[] i, int i0, int i1, long[] T) {\n for (int o=i0; o<i1; o++) // 1\n T[o] = data[i[o]]; // 1\n }", "@Override\n\tpublic void getData() {\n\t\t\n\t}", "public void map(Object key, Text value, Context context) throws IOException, InterruptedException{\n val = value.toString();\n\t\tarr = val.split(\"\\\\s+\");\n\t\tprova.set(Long.parseLong(arr[1]));\n\t\tcontext.write(prova,one);\n\t\t\n }", "@Override\r\n\t\t\t\tpublic void run() {\n\t\t\t\t\tint curid, threadId = tid;\r\n\t\t\t\t\twhile(true){\r\n\t\t\t\t\t\tsynchronized (lock) {\r\n\t\t\t\t\t\t\tcurid = lock[0];\r\n\t\t\t\t\t\t\tlock[0]++;\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(curid >= totalNum)break;\r\n\t\t\t\t\t\tint[] pid = delaunay.getLinked(curid + 1);\r\n\t\t\t\t\t\tfor(int id : pid){\r\n\t\t\t\t\t\t\tif(id == 0)continue;\r\n\t\t\t\t\t\t\tint id1 = idmap.get(curid), id2 = idmap.get(id - 1);\r\n\t\t\t\t\t\t\tif(id1 >= id2)continue;\r\n\t\t\t\t\t\t\tLong lineId = DataOfLine.calcLineId(id1, id2);\r\n\t\t\t\t\t\t\tLine nline = new Line(points.get(curid), points.get(id - 1));\r\n\t\t\t\t\t\t\tDataOfLine nDataOfLine = new DataOfLine(lineId, nline);\r\n\t\t\t\t\t\t\tnDataOfLine.signWithRSA(rsa);\r\n\t\t\t\t\t\t\tbtOfLine.put(lineId, nDataOfLine.writeToBytes());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(curid % 200 == 0){\r\n\t\t\t\t\t\t\tSystem.out.println(\"Commit Thread:\\t\" + threadId + \"\\tid:\\t\" + curid);\r\n\t\t\t\t\t\t\tlong end = System.currentTimeMillis();\r\n\t\t\t\t\t\t\tlong expectedTime = (end - start) / (curid + 1) * (totalNum - curid) / 1000;\r\n\t\t\t\t\t\t\tSystem.out.println(\"Expected time remaining: \" + expectedTime + \" s = \" + (expectedTime / 60) + \" m = \" + (expectedTime / 3600) + \" h\");\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trecmanOfLine.commit();\r\n\t\t\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(DEBUG){\r\n\t\t\t\t\t\t\t//recmanOfLine.commit();\r\n\t\t\t\t\t\t\tSystem.out.println(\"Thread :\\t\" + threadId + \" id :\\t\" + curid + \" has finished\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthreadStatus[threadId] = true;\r\n\t\t\t\t}", "public void updateData() {}", "void processTag(XMLNode tag) throws Exception {\n if(tag.type()== XMLNode.Type.TAG){\n state.traceTagBegin(tag.getTag()==null?\"process\":tag.getTag(),null);\n tagstk[tagstkptr++] = tag.getTag();\n \n dataloader.beginTag(tagstk, tagstkptr, tag.getTag(), tag.getAttribs());\n if(tag.getTags()!= null) for(XMLNode nextTag : tag.getTags()){\n processTag(nextTag);\n }\n ((LoadDatamapData)dataloader).endTag(tagstk, tagstkptr, tag, tag.getBody(), tag.getAttribs());\n \n tag.clearRef();\n \n tagstkptr--;\n tagstk[tagstkptr]= null;\n state.traceTagEnd();\n }\n }", "private MetricValues threadMetricValues(Set<MachineMetric> customSet,\n List<Long> values) {\n return metricValues(customSet, MachineMetricFactory.threadMetrics,\n values);\n }", "@Override\n\tpublic void processData() {\n\t\t\n\t}", "Values initializeValues(Thread current) {\n return current.localValues = new Values();\n }", "private void saveValues() {\r\n this.pl_expert.setParam(\"displayNodeDegree\", (String) this.nodeDegreeSpinner.getValue());\r\n this.pl_expert.setParam(\"displayEdges\", (String) this.displayEdgesSpinner.getValue());\r\n this.pl_expert.setParam(\"scale\", (String) this.scaleSpinner.getValue());\r\n this.pl_expert.setParam(\"minWeight\", (String) this.minweightSpinner.getValue());\r\n this.pl_expert.setParam(\"iterations\", (String) this.iterationsSpinner.getValue());\r\n this.pl_expert.setParam(\"mutationParameter\", this.mutationParameter.getSelection().getActionCommand());\r\n this.pl_expert.setParam(\"Update_param\", this.Update_param.getSelection().getActionCommand());\r\n this.pl_expert.setParam(\"vote_value\", (String) this.vote_value.getValue());\r\n this.pl_expert.setParam(\"keep_value\", (String) this.keep_value.getValue());\r\n this.pl_expert.setParam(\"mut_value\", (String) this.mut_value.getValue());\r\n this.pl_expert.setParam(\"only_sub\", new Boolean(this.only_sub.isSelected()).toString());\r\n\r\n this.is_alg_started = false;\r\n }", "@Override\r\n\tprotected void setData(Object data) {\n\t\t\r\n\t}" ]
[ "0.5340007", "0.51696396", "0.50765836", "0.50264764", "0.49212068", "0.49187863", "0.49008945", "0.47442323", "0.47423804", "0.474227", "0.4737793", "0.47177854", "0.47074354", "0.46994066", "0.46972162", "0.46876907", "0.46790907", "0.46740863", "0.46740076", "0.4655912", "0.4654679", "0.46478647", "0.46392477", "0.46326426", "0.46314943", "0.46276864", "0.4612252", "0.4580533", "0.45739183", "0.45610288", "0.45538524", "0.4549945", "0.45497796", "0.45467693", "0.4546051", "0.45390466", "0.4513111", "0.4512939", "0.45069176", "0.45059517", "0.4505344", "0.450101", "0.44911063", "0.44898593", "0.44882065", "0.4487322", "0.44776148", "0.4468491", "0.44602582", "0.44596723", "0.44538182", "0.445305", "0.4442476", "0.4442157", "0.44416535", "0.44398355", "0.44356644", "0.44316232", "0.44286215", "0.44245553", "0.44239375", "0.44193923", "0.44182548", "0.4416129", "0.4414374", "0.4412007", "0.44105932", "0.44069675", "0.4402737", "0.44025463", "0.43973246", "0.43961796", "0.43944764", "0.43943298", "0.43871713", "0.43749672", "0.43738514", "0.43712726", "0.43706802", "0.43670565", "0.43661162", "0.43622923", "0.43572837", "0.43540338", "0.43514436", "0.43502417", "0.43469876", "0.43466192", "0.43408236", "0.43407255", "0.43358096", "0.43347666", "0.4332013", "0.43308887", "0.43287322", "0.43285146", "0.43250322", "0.43226597", "0.43220782", "0.43219066", "0.43211892" ]
0.0
-1
Gets value at index i. 1. Read value at i (reset if needed).
public long get(int i) { return read(i); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public T get(int i) {\n // we add values.length to head-i to avoid negative indices\n return values[(head-i+values.length) % values.length];\n }", "private long read(int i) {\n while (true) {\n long x = data[i];\n if (!isTag(x)) return value(x);\n reset(i);\n }\n }", "public int read(int i);", "@Override\n public E get(int i) throws IndexOutOfBoundsException {\n validIndex(i);\n return data[i];\n }", "protected abstract int readInternal(int index);", "int get(int index)\n\t{\n\t\treturn inputArray[index];\n\t}", "int get(int i) {\n int numPosition = i / MAX_BITS;\n int intPosition = i % MAX_BITS;\n long val = values[numPosition] & (1 << intPosition);\n return (int) (val >> intPosition);\n }", "abstract int get(int index);", "public Object get(int i) {\n return elementAt(i);\n }", "public int get(int i) {\n\t\tassert i < size();\n\t\treturn arr[i];\n\t}", "public int get(int i) {\n if (i==0) {\n return first;\n }\n return rest.get(i - 1);\n }", "public int get(int index) {\n\t\treturn r[index];\n\t}", "public int get(int index);", "public int get(int index) {\n return array[index];\n }", "public T get(int i) {\n if (i == 0) {\n return this.first;\n }\n else {\n return this.rest.get(i--);\n }\n }", "int get(int idx);", "public T get(int i);", "public Object get( int index )\n {\n\treturn _data[index];\n }", "@Override\n public int get(int index) {\n checkIndex(index);\n return getEntry(index).value;\n }", "@Override\r\n\tpublic double getValue(int index) {\n\t\tif (data==null) return 0;\r\n\t\t\r\n\t\tdouble d = 0;\r\n\t\tint begin=index+pos;\r\n\t\tif (begin<0) begin=0;\r\n\t\tif (begin>data.size()-1) begin = data.size()-1;\r\n\t\td = data.get(begin).getOpen();\r\n\t\t\r\n\t\treturn d;\r\n\t}", "public int get(int i) throws ArrayIndexOutOfBoundsException {\n if (i >= 0 && i < count) {\n return list[i];\n } else {\n throw new ArrayIndexOutOfBoundsException();\n }\n }", "public Integer get(int i){\n\t\treturn body[i];\n\t}", "Object get(int i);", "abstract public Object getValue(int index);", "@Override\n public E get(int index) {\n // todo: Students must code\n checkRange(index); // throws IndexOOB Exception if out of range\n return data[calculate(index)];\n }", "T get(int i);", "public RTWValue getAsValue(int i);", "public int get(int i) {\n // YOUR CODE HERE\n return 1;\n }", "public int get(int i)\n {\n if(integerList != null)\n return integerList[i];\n else\n return -1;\n }", "public E get(int i) {\n\t\tcheckIndex(i);\n\t\tListNode<E> current = hop(i);\n\t\treturn current.value;\n\t}", "byte get(int index);", "E get(int i) throws IndexOutOfBoundsException;", "@Override\n public T get(final int index) {\n this.checkIndex(index);\n return this.data[index];\n }", "public Object get(int index);", "public Object get(int index);", "public Item get(int i) {\n return items[i - 1];\n }", "@Override\n public T get(int index) {\n if (index < 0 || index >= size) {\n return null;\n }\n int position = index + plusOne(nextFirst);\n if (position >= array.length) {\n position -= array.length;\n return array[position];\n } else {\n return array[position];\n }\n }", "public Object getValue(int index);", "public void testGetValue() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n test1.prev();\n test1.moveToPos(8);\n assertTrue(test1.getValue().inRange(8));\n for (int i = 0; i < 10; i++) {\n test1.next();\n }\n try {\n test1.getValue();\n }\n catch (Exception e) {\n assertTrue(e instanceof NoSuchElementException);\n }\n }", "public Item get(int i) {\n return items[i];\n }", "@Override\n\tpublic T get(int index) {\n\t\tif (index >= 0 && index < size) {\n\t\t\treturn data[index];\n\t\t}\n\t\treturn null;\n\t}", "Object get(int index);", "Object get(int index);", "float get(int idx);", "public E get(int index) {\n\t\tresetIterator();\n\t\tif (index < 0 || index >= size) {\n\t\t\treturn null;\n\t\t}\n\n\t\tfor (int i = 0; i < index; i++) {\n\t\t\tnext();\n\t\t}\n\t\treturn iterator.data;\n\t}", "public Object get (int i)\r\n {\r\n }", "public Item get(int i);", "T get(int index);", "T get(int index);", "T get(int index);", "T get(int index);", "T get(int index);", "@Override\n public E get(int index) {\n this.rangeCheck(index);\n return (E) this.values[index];\n }", "@Override\n\tpublic int get(int index) throws IndexOutOfBoundsException {\n\t\tif(checkIndex(index, size)) { //check if index is valid\n\t\t\treturn values[index]; //return the value at index\n\t\t}else {\n\t\t\tthrow new IndexOutOfBoundsException(\"Highest index: \" + size);\n\t\t}\t\n\t}", "protected E readValue(LineReader reader, long indexElement) throws IOException {\n int length = (int) getValueLength(indexElement);\n if (length == 0) {\n return getValueConverter().bytesToValue(buffer, 0);\n }\n long valPos = getValuePosition(indexElement);\n if (log.isTraceEnabled()) {\n log.trace(\"readValue: Retrieving value of length \" + length + \" from file at position \" + valPos);\n }\n synchronized (this) {\n reader.seek(valPos);\n if (buffer.length < length) {\n buffer = new byte[length];\n }\n reader.readFully(buffer, 0, length);\n }\n/* for (int i = 0 ; i < length ; i++) {\n System.out.println(buffer[i]);\n }\n */\n return getValueConverter().bytesToValue(buffer, length);\n }", "public T get(int index);", "public T get(int index);", "public T get(int index);", "public Item get(int index) {\n int track = nextFirst; //It does not modify nextFirst\n track = moveForward(track, index + 1);\n return items[track];\n }", "@Override\n public E get(final int index) {\n return array[index];\n }", "public abstract T get(int index);", "public int get(int index) {\n if(index>-1 && index<len) {\n SingleNode iSingleNode = head;\n for(int i=0; i<index; i++) {\n\n iSingleNode = iSingleNode.next;\n }\n return iSingleNode.data;\n }\n return 0;\n }", "public int readValue() { \n\t\treturn (port.readRawValue() - offset); \n\t}", "public Object getRaw(int i);", "public E get(int index)\n\t{\n\t\treturn contents[index];\n\t}", "Nda<V> get( int i );", "public Term get(int i) {\n\t\treturn this.elts[i];\n\t}", "@Override\n\tpublic E get(int i) {\n\t\tif (i < 0 || i >= this.numberOfElements) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\telse {\n\t\t\treturn this.arrayList[i];\n\t\t}\n\t}", "public Object get(int i)\n {\n if(_list!=null)\n return _list.get(i);\n return null;\n }", "public int get(int index) {\n\t checkIndex(index);\n\t return elementData[index];\n\t }", "@Override\n\tpublic E get(int i) throws IndexOutOfBoundsException {\n\t\treturn null;\n\t}", "E get(int i) {\r\n @SuppressWarnings(\"unchecked\")\r\n final E e = (E)arr[i];\r\n return e;\r\n }", "public E get(int idx) {\n assert idx >= 0;\n \n if(v == array[idx]){\n\t\tv = array[idx];\n\t}\n\t\n\tif(array[idx] == null){\n\t\tv = null;\n\t}\n\treturn v;\n }", "public T get(int aIndex);", "public E get(int i) {\n\n\t if (i < 0 && i > num_elements)\n\t return null;\n\t \n\t return(elements[i]);\n\t }", "public E get(int index)\n {\n if (index >= 0 && index < size)\n return data[index];\n else\n throw new NoSuchElementException();\n }", "protected int _getInt(int index)\r\n/* 378: */ {\r\n/* 379:392 */ return HeapByteBufUtil.getInt(this.array, index);\r\n/* 380: */ }", "default V item( int i ) { return getDataAt( indexOfIndex( i ) ); }", "@SuppressWarnings(\"unchecked\")\n public <T> T get(int index) {\n return (T)this.values[index];\n }", "public T get(int i) {\n return null;\n }", "T get(int position);", "public double get(int n) {\n int i = (pointer - 1 - n + memory.length) % memory.length;\n return memory[i];\n }", "public T get(int index) {\n return items[(nextFirst + 1 + index) % capacity];\n }", "public TypeHere get(int i) {\n return items[i];\n }", "public Object get(int index) {\n\tif(index > arr.length) return null;\n\treturn arr[index];\n}", "public synchronized E get(int index) {\n return this.array.get(index);\n }", "public float get(int index) {\n return storage[index];\n }", "E get( int index );", "public String get(int i) {\n Object obj = this.f51596a.get(i);\n C32569u.m150513a(obj, \"get(...)\");\n return (String) obj;\n }", "public int getValueAtIndex(int index) {\n if (index < arraySize)\n return theArray[index];\n\n return 0;\n }", "@Override\n public T get(int index) {\n return indexCheck(index) ? (T) data[index] : null;\n }", "Value get(int index) throws ExecutionException;", "public E get(int i) {\n\t\tif (size == 0) {\n\t\t\tthrow new IllegalArgumentException(\"List is empty, cannot retrieve item.\");\n\t\t}\n\n\t\tif (i < 0 || i >= size) {\n\t\t\tthrow new IndexOutOfBoundsException(\"Requested index is out of bounds.\");\n\t\t}\n\n\t\treturn list[i];\n\n\t}", "private int get(int pos) {\n if (pos != 0) {\n return this.nextNode.get(pos - 1);\n } else {\n return this.value;\n }\n }", "public float get(int index) {\r\n RangeCheck(index);\r\n return elementData[index];\r\n }", "int get(int index)\n\t{\n\t\t//Get the reference of the head of the Linked list\n\t\tNode ref = head;\n\t\t\n\t\t//Initialize the counter to -1\n\t\tint count = -1;\n\t\t\n\t\t//Traverse the Linked List until the Node with position index is reached\n\t\twhile(count != index)\n\t\t{\n\t\t\tcount++;\n\t\t\tref = ref.next;\n\t\t}\n\t\t\n\t\t//Return the value of the Node having position index\n\t\treturn ref.value;\n\t}", "public Object get(int index) {\n\t\tif(index <= arr.length-1) return arr[index];\n\t\treturn null;\n\t}", "public double get(int index) {\n\t\treturn 0;\n\t}", "public Comparable get( int index ) {\n \treturn _data[index]; }", "@Override\n public Integer get() {\n return ++counter;\n }" ]
[ "0.7263193", "0.72542495", "0.68397874", "0.683617", "0.6808017", "0.6749996", "0.67492914", "0.6742428", "0.6737924", "0.6729699", "0.6728398", "0.6672456", "0.66510576", "0.66066337", "0.65419644", "0.6526188", "0.6521437", "0.65157026", "0.6471566", "0.64397895", "0.6432557", "0.64246655", "0.6410269", "0.64069414", "0.64056236", "0.64022696", "0.64012235", "0.6372711", "0.6314726", "0.63135165", "0.6306559", "0.62943727", "0.62900954", "0.62868685", "0.62868685", "0.6273444", "0.6273351", "0.6256231", "0.625261", "0.62509227", "0.6249668", "0.6240704", "0.6240704", "0.6237431", "0.6233952", "0.62291396", "0.6223663", "0.61988205", "0.61988205", "0.61988205", "0.61988205", "0.61988205", "0.61883", "0.6183333", "0.6182908", "0.61790025", "0.61790025", "0.61790025", "0.61752534", "0.61707854", "0.61608124", "0.6147807", "0.6136441", "0.61350524", "0.61286706", "0.6121254", "0.6102121", "0.6097603", "0.60909903", "0.60866374", "0.60842174", "0.6080225", "0.60685784", "0.6068032", "0.6059638", "0.6059548", "0.6052186", "0.6024423", "0.60221165", "0.6021693", "0.60205996", "0.60017616", "0.6000269", "0.59967524", "0.5990675", "0.5982444", "0.59798616", "0.59760284", "0.59688693", "0.5966326", "0.5955708", "0.5946792", "0.59320545", "0.5927626", "0.5918794", "0.58946717", "0.5881389", "0.5874819", "0.5873468", "0.5872297" ]
0.7493033
0
Sets value at index i. 1. Convert target value to marked value. 2. Store into internal array.
public void set(int i, long v) { data[i] = newValue(v); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTargetValue(int idx, Object value);", "void set(int index, int value) {\n array[index] = value;\n }", "public void set(int i, int value) {\n\t\tassert i < size();\n\t\tarr[i] = value;\n\t}", "public void set(int index, Object value) {\n\n\t\t// the right portion of values of the array -> room is not available\n\t\tif(index >= arr.length) {\n\t\t\tObject[] tmpArr = new Object[index+1]; // keep all values of the variable arr\n\t\t\t\n\t\t\t// keep all items of arr\n\t\t\tfor(int i=0; i<arr.length; i++) {\n\t\t\t\ttmpArr[i] = arr[i];\n\t\t\t}\n\t\t\t\n\t\t\tarr = tmpArr; // exchange addresses\n \t\t}\t\n\t\t\n\t\tarr[index] = value;\n\t\t\n\t}", "public void setData(int i, int value) {\n data[i] = value;\n }", "public void set(int index, Object value) {\n\tif(arr.length < index){\n\t\tObject arr2[] = new Object[index+1];\n\t\tSystem.arraycopy(arr, 0, arr2, 0, arr.length);\n\t\tarr2[index] = value;\n\t\tarr = arr2;\n\t\t\n\t}\n\telse arr[index] = value;\n}", "public void setValueArray(int i, amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value value)\n {\n synchronized (monitor())\n {\n check_orphaned();\n amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value target = null;\n target = (amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value)get_store().find_element_user(VALUE$0, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n target.set(value);\n }\n }", "@Override\n public E set(int index, E value) {\n // todo: Students must code\n checkRange(index);\n int pos = calculate(index);\n E oldVal = data[pos];\n data[pos] = value;\n return oldVal;\n }", "public void set(int idx, E value) {\n assert idx >= 0;\n \n checkgrow(idx);\n \n\tarray[idx] = value;\n\t\n }", "void setArrayElement(int index, Object value);", "void setArrayElement(int index, Object value);", "public void setArray(int i, Array x);", "void set(int idx, int val);", "@Override\n public final void set(int index, E newValue) {\n array[index] = newValue;\n }", "void set(int i, int val) {\n int numPosition = i / MAX_BITS;\n int intPosition = i % MAX_BITS;\n\n if (val == 1)\n values[numPosition] |= (1 << intPosition);\n else\n values[numPosition] = values[numPosition]&~(1 << intPosition);\n }", "public void set(int i,T e){\n if(rangeCheck(i)){\n data[i] = e;\n }\n }", "void set(int i, E e) {\r\n arr[i] = e;\r\n }", "@Override\n public E set(int index, E value) {\n this.rangeCheck(index);\n E oldValue = (E) this.values[index];\n this.values[index] = value;\n return oldValue;\n }", "public T set(int i, T t) {\n if (i < 0 || i >= size) // if there is no index i in list\n throw new IndexOutOfBoundsException(\"Treated index: \" + i + \" | Size of the Dynamic Array \" + size()); // cause IndexOutOfBoundException\n T previousValue = (T) elements[i]; // store previous value of element with index i\n elements[i] = t; // set element with index i to t\n return previousValue; // return previous value of element with index i\n }", "public abstract <T> void set(int index, T value);", "void setArray(int index, Array value) throws SQLException;", "void setIdx(int i);", "public boolean set(int index, E value){\n if (index > maxIndex || index < 0){\n System.out.println(\"Error while replacing value. Your index \" + index + \" is out of bound of array\");\n return false;\n }\n\n array[index] = value;\n return true;\n }", "public void set(int[] ai);", "@Override\n\tpublic void setValueIndex(int index) {\n\t\t\n\t}", "@Override\n public E set(int i, E e) throws IndexOutOfBoundsException {\n checkRange(i);\n E previousValue = get(i);\n\n if (size == 1) {\n storage = e;\n } else if (size <= 5) {\n ((E[]) storage)[i] = e;\n } else {\n ((ArrayList<E>) storage).set(i, e);\n }\n\n return previousValue;\n }", "@Override\n public E set(int i, E e) throws IndexOutOfBoundsException {\n checkIndex(i, size);\n E temp = data[i];\n data[i] = e;\n return temp;\n }", "public T set(int index, T value) throws IndexOutOfBoundsException {\n checkException(index);\n arr[index] = value;\n return arr[index];\n }", "public void setElem(int index, long value) {\r\n a[index] = value;\r\n }", "@Override\n\tpublic void\n\tset( int i, double value )\n\t{\n\t\tdata[i] = value;\n\t}", "@Override\n public void set(int i, E e) throws IndexOutOfBoundsException {\n validIndex(i);\n data[i] = e;\n }", "public void setMark(int v, int val){\r\n\t\tMark[v]=val;\r\n\t}", "public void set(long index);", "void set(int index, T data);", "@Override\n\tpublic void setValueAt(Object arg0, int arg1, int arg2) {\n\t\t\n\t}", "@Override\n\tpublic void setValueAt(Object arg0, int arg1, int arg2) {\n\t\t\n\t}", "protected void _setInt(int index, int value)\r\n/* 483: */ {\r\n/* 484:497 */ HeapByteBufUtil.setInt(this.array, index, value);\r\n/* 485: */ }", "void update(int index, int val) {\n\t\tarray[index] = val;\n\t}", "protected void _setIntLE(int index, int value)\r\n/* 495: */ {\r\n/* 496:509 */ HeapByteBufUtil.setIntLE(this.array, index, value);\r\n/* 497: */ }", "@Override\n public boolean set(int index, T element) {\n array[index] = element;\n return true;\n }", "@Override\n public void setValueAt(java.lang.Object arg0, int arg1, int arg2) {\n\n }", "@Override\n public void setValueAt(java.lang.Object arg0, int arg1, int arg2) {\n\n }", "public void setValueAt(Object val, int row, int col) {\r\n }", "public synchronized boolean set(int index, E value) {\n return this.array.set(index, value);\n }", "public void set(int rowIndex, int columnIndex, int value) { target.set(index.get(rowIndex), columnIndex, value); }", "public void set(int index, int value) {\n\t\t\tcheckIndex(index);\n\t\t\telementData[index] = value;\n\t\t}", "public abstract void setIndex(int i, boolean b);", "public void set(int index, float value) {\r\n RangeCheck(index);\r\n elementData[index] = value;\r\n }", "BinaryArrayReadWrite set(int index, byte x);", "@Override\n public void setValue(int index, Object value)\n {\n if (index == 1)\n {\n super.setValue(index, value); \n }\n else if (index == 2)\n {\n if (m_Scaler != 0)\n {\n try\n { \n m_Value = ((Number)value).doubleValue() * getScaler();\n }\n catch (Exception ex)\n {\n //Sometimes scaler is set for wrong Object type.\n setValue(value);\n }\n }\n else\n {\n setValue(value);\n }\n }\n else if (index == 3)\n { \n //Set default values.\n if (value == null)\n {\n m_Scaler = m_Unit = 0;\n }\n else\n {\n if (Array.getLength(value) != 2)\n {\n m_Scaler = m_Unit = 0;\n }\n else\n {\n m_Scaler = ((Number)Array.get(value, 0)).intValue();\n m_Unit = (((Number)Array.get(value, 1)).intValue() & 0xFF);\n }\n }\n }\n else\n {\n throw new IllegalArgumentException(\"GetValue failed. Invalid attribute index.\");\n }\n }", "public void set(int index, int val) {\n boolean exists = arr.get(index).get(arr.get(index).size() - 1).id == id;\n if (exists) {\n arr.get(index).get(arr.get(index).size() - 1).val = val;\n } else {\n List<Pair> list = arr.get(index);\n list.add(new Pair(id, val));\n arr.set(index, list);\n } \n }", "public abstract E set(int index, E e);", "public void set(int index, float value) {\n storage[index] = value;\n }", "public Object set (int i, Object t)\r\n {\r\n }", "@Override\n public void setValueAt( Object aValue, Object node, int column )\n {\n }", "public void setValueAt(Object aValue, int row, int column)\n {\n\n }", "public void setEventArray(int i, org.hl7.fhir.CodeableConcept event)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.CodeableConcept target = null;\n target = (org.hl7.fhir.CodeableConcept)get_store().find_element_user(EVENT$0, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n target.set(event);\n }\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 setElementAt(Object obj, int index);", "@Override\n public void setValueAt(Object value, int row, int column) { data[row][column] = value; }", "public void setState(int i, int j, int val){\r\n this.state[i][j] = val;\r\n }", "protected void _setMediumLE(int index, int value)\r\n/* 471: */ {\r\n/* 472:485 */ HeapByteBufUtil.setMediumLE(this.array, index, value);\r\n/* 473: */ }", "public void set_data(short[] value) {\n for (int index0 = 0; index0 < value.length; index0++) {\n setElement_data(index0, value[index0]);\n }\n }", "void setBit(int index, int value);", "public Vector<T> set(int aIndex, T aValue);", "public void setInterFlag(int index, boolean value){\r\n\t\tif (index < 0 || index >= this.interVec.length)\r\n\t\t\t;\r\n\t\telse\r\n\t\t\tthis.interVec[index] = value;\r\n\t}", "public void setTargetSetupArray(int i, org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup targetSetup)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup target = null;\r\n target = (org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup)get_store().find_element_user(TARGETSETUP$0, i);\r\n if (target == null)\r\n {\r\n throw new IndexOutOfBoundsException();\r\n }\r\n target.set(targetSetup);\r\n }\r\n }", "public void changeNumberInArray(int index, int value) {\n if (index < 0 || index > array.length || value == 0) {\r\n throw new ArrayIndexOutOfBoundsException(\"Index is incorrect or value = 0\");\r\n }\r\n array[index] = value;\r\n }", "private Index(int i) {\r\n _value = i;\r\n }", "public void set(int index, int o) {\n\t\tif(index == 0) return;\n\t\tr[index] = o;\n\t}", "protected void _setMedium(int index, int value)\r\n/* 459: */ {\r\n/* 460:473 */ HeapByteBufUtil.setMedium(this.array, index, value);\r\n/* 461: */ }", "public void set(int i, float val) {\r\n\t\tswitch (i) {\r\n\t\tcase 0:\r\n\t\t\tx = val;\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t\ty = val;\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tz = val;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tthrow new IndexOutOfBoundsException();\r\n\t\t}\r\n\t}", "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}", "E set(int i , E e) throws IndexOutOfBoundsException;", "public void setPos(int index, int value) {\r\n this.pos[index] = value;\r\n }", "@Override\r\n\tpublic void setValueAt(Object aValue, int rowIndex, int columnIndex) {\n\t\t\r\n\t}", "public void setIndex(int i) {\n\t\t\n\t}", "@Override\n public void update(int i, E value) {\n if(!hasWork()) {\n throw new NoSuchElementException(\"The worklist is empty\");\n }\n // if i is less than 0 or greater than size of worklist, throw exception\n if(i < 0 || i >= array.length) {\n throw new IndexOutOfBoundsException(\"This index does not exist\");\n }\n // update value\n array[i] = value;\n }", "public void setVoxel(int i, VoxelGradient value) {\r\n data[i] = value;\r\n }", "public void setMarks(int[] newMarks){\n marks = newMarks;\n }", "public void setSourceDataArray(int i, org.landxml.schema.landXML11.SourceDataDocument.SourceData sourceData)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.SourceDataDocument.SourceData target = null;\r\n target = (org.landxml.schema.landXML11.SourceDataDocument.SourceData)get_store().find_element_user(SOURCEDATA$0, i);\r\n if (target == null)\r\n {\r\n throw new IndexOutOfBoundsException();\r\n }\r\n target.set(sourceData);\r\n }\r\n }", "public void set(int i);", "public void setIntensity(double[] value){\n\t\tintensity = new double[value.length];\n\t\tintensity = value;\n\t}", "@Override\n public void update(int i, E value) {\n if(!hasWork()) {\n throw new NoSuchElementException();\n }\n if(i < 0 || i >= size()) {\n throw new IndexOutOfBoundsException();\n }\n array[(front + i) % capacity()] = value;\n }", "@Override\n\tpublic void setValueAt(Object aValue, int rowIndex, int columnIndex) {\n\t\t\n\t}", "E set(int i, E e) throws IndexOutOfBoundsException;", "public void setDataMemory(int index, int value)\n {\n try \n {\n // If the memory address hasn't changed, don't notify any observers\n if (data_memory[index].intValue() != value)\n {\n data_memory[index].setValue(value); \n this.setChanged();\n notifyObservers(new MemoryChangeDetails(index, HexTableModel.OBSERVE_DATA_MEMORY));\n } \n }\n catch (ArrayIndexOutOfBoundsException OOB) { }\n }", "public T set(int i, T obj);", "public void set(int i, PdVector value)\n {\n switch(i)\n {\n case 0: p1 = value; break;\n case 1: p2 = value; break;\n case 2: p3 = value; break;\n default: throw new IndexOutOfBoundsException(\"Triangle indices should be in range [0, 2].\");\n }\n }", "void setStarArray(int i, stars.StarType star);", "public void setArrayAt(int indexStart, int len, double[] srcValue, int srcOffset) {\n final int indexEnd = indexStart + len;\n int srcIndex = srcOffset;\n for (int i = indexStart; i < indexEnd; i++,srcIndex++) {\n setAt(i, srcValue[srcIndex]);\n }\n }", "public void setValue(int value);", "void set(int index, Object element);", "public Comparable set( int index, Comparable newVal ) {\n\tComparable temp= _data[index];\n\t_data[index]= newVal;\n\treturn temp;\n }", "public void putValueBeforeArrayAddrIndex() {\n\t\tObj index = Tab.currentScope().findSymbol(\"@@TEMPOBJ\");\n\t\tObj address = Tab.currentScope().findSymbol(\"@@TEMPOBJ2\");\n\t\tObj value = Tab.currentScope().findSymbol(\"@@TEMPOBJ3\");\n\t\t\n\t\tCode.store(index);\n\t\tCode.store(address);\n\t\tCode.store(value);\n\t\t\n\t\tCode.load(address);\n\t\tCode.load(index);\n\t\tCode.load(value);\t\t\n\t}", "@Override\n public void setValueAt(Object aValue, int rowIndex, int columnIndex) {\n }", "public double set(int i, int j, double value) {\n\t\tdata[i][j] = value;\n\t\treturn value;\n\t}", "@Override\n\tpublic void setValueAt(Object aValue, int rowIndex, int columnIndex) {\n\n\t}", "public abstract void set( int i, int j, double value ) throws JWaveException;", "public void set(int i) {\n }" ]
[ "0.73894554", "0.71013516", "0.6879908", "0.6814281", "0.68042463", "0.67954487", "0.6769313", "0.6752956", "0.67258734", "0.6656549", "0.6656549", "0.6592232", "0.6529322", "0.64939916", "0.6439837", "0.6409633", "0.63595444", "0.63562256", "0.6336336", "0.62776214", "0.62599516", "0.62381464", "0.62088454", "0.61698157", "0.6161969", "0.615157", "0.61506134", "0.6131126", "0.6113105", "0.6108308", "0.6079116", "0.6074987", "0.6042908", "0.60414696", "0.602143", "0.602143", "0.6018746", "0.6013052", "0.600897", "0.6001737", "0.5987038", "0.5987038", "0.59840614", "0.59326476", "0.59320986", "0.592203", "0.5899742", "0.58671427", "0.5860823", "0.5846038", "0.58188874", "0.5803219", "0.5796334", "0.5782102", "0.5771153", "0.5763653", "0.5753", "0.57354575", "0.57267845", "0.57214504", "0.57199025", "0.56986964", "0.56957066", "0.5693087", "0.56841385", "0.56340677", "0.56278044", "0.5624707", "0.561034", "0.5609984", "0.5605106", "0.56040037", "0.5600906", "0.55962926", "0.5593051", "0.5586108", "0.5584559", "0.5581198", "0.5579518", "0.55626535", "0.55591977", "0.55589896", "0.55564857", "0.5556037", "0.5550966", "0.5542499", "0.55410504", "0.55329096", "0.5532254", "0.55322", "0.55279285", "0.5525601", "0.5525543", "0.5524729", "0.5523721", "0.5523506", "0.55178046", "0.55139285", "0.55069196", "0.5506849" ]
0.66343606
11
Performs compareandset at index i. 1. Convert expected value to marked value. 2. Convert target value to marked value. 3. Perform CAS.
public boolean compareAndSet (int i, long e, long y) { return cas(i, newValue(e), newValue(y)); // 1, 2, 3 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean compareAndSet\n (int[] i, long[] e, long y) {\n int I = i.length; // 1\n long[] x = new long[I]; // 1\n for (int o=0; o<I; o++) // 1\n x[o] = newValue(e[o]); // 1\n return kcss(i, x, newValue(y)); // 2, 3\n }", "<T> T cas(String variable, T expectedValue, T newValue, int... indexes) throws ClassCastException, ArrayIndexOutOfBoundsException;", "public void testCompareAndSet() {\n AtomicLong ai = new AtomicLong(1);\n assertTrue(ai.compareAndSet(1, 2));\n assertTrue(ai.compareAndSet(2, -4));\n assertEquals(-4, ai.get());\n assertFalse(ai.compareAndSet(-5, 7));\n assertEquals(-4, ai.get());\n assertTrue(ai.compareAndSet(-4, 7));\n assertEquals(7, ai.get());\n }", "public void testGetSet() {\n AtomicLong ai = new AtomicLong(1);\n assertEquals(1, ai.get());\n ai.set(2);\n assertEquals(2, ai.get());\n ai.set(-3);\n assertEquals(-3, ai.get());\n }", "@Test\n public void test_getAndSet_ByIndex_GenericMethods() throws Exception {\n\n FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$TEST$__$SCHEMA$_S_$MY$95$DESC$__$NUM1 descNum1_FieldSet = new FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$TEST$__$SCHEMA$_S_$MY$95$DESC$__$NUM1(\n executeInfo, null);\n\n\n\n descNum1_FieldSet.schemaInfo_Positioned = mock_schemaInfoFieldSet_descNum1;\n\n\n // Test the Get & Set methods & the Special Field-Value Get & Set methods - Object Type (string) _______________________________________\n FieldSet_TestUtilities.test_SetAndGet_useIndex(executeInfo, descNum1_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$TEST$__$SCHEMA$_S_$MY$95$DESC$__$NUM1.class,\n \"setField\", Object.class, \"setField__Special\", \"getField\", 0,\n \"hello\", null, null, \"hi\"); /* last 4 params: expected value, null expected value, unused expected value, default expected value */\n\n\n FieldSet_TestUtilities.test_SetAndGet_useIndex(executeInfo, descNum1_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$TEST$__$SCHEMA$_S_$MY$95$DESC$__$NUM1.class,\n \"setField\", Object.class, \"setField__Special\", \"getField\", 1,\n (short)10, null, null, (short)-1001); /* last 4 params: expected value, null expected value, unused expected value, default expected value */\n\n\n // Continuation Field\n FieldSet_TestUtilities.test_SetAndGet_useIndex(executeInfo, descNum1_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$TEST$__$SCHEMA$_S_$MY$95$DESC$__$NUM1.class,\n \"setField\", Object.class, \"setField__Special\", \"getField\", 2,\n 11, null, null, -1000); /* last 4 params: expected value, null expected value, unused expected value, default expected value */\n FieldSet_TestUtilities.test_SetAndGet_useIndex(executeInfo, descNum1_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$TEST$__$SCHEMA$_S_$MY$95$DESC$__$NUM1.class,\n \"setField\", Object.class, \"setField__Special\", \"getField\", 3,\n 12, null, null, -1000); /* last 4 params: expected value, null expected value, unused expected value, default expected value */\n\n\n // Object Continuation ________________________________________________________________________________________\n FieldSetTuple__net$__$unconventionalthinking$__$matrix$_CC_$SCHEMA$95$FOR$95$SCHEMA$_S_$DESCRIPTOR$_S_$FIELD$__$TYPES fieldTypes_FieldSet = new FieldSetTuple__net$__$unconventionalthinking$__$matrix$_CC_$SCHEMA$95$FOR$95$SCHEMA$_S_$DESCRIPTOR$_S_$FIELD$__$TYPES(\n executeInfo, null);\n\n fieldTypes_FieldSet.schemaInfo_Positioned = mock_schemaInfoFieldSet_fieldTypes;\n\n FieldSet_TestUtilities.test_SetAndGet_useIndex(executeInfo, fieldTypes_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$_CC_$SCHEMA$95$FOR$95$SCHEMA$_S_$DESCRIPTOR$_S_$FIELD$__$TYPES.class,\n \"setField\", Object.class, \"setField__Special\", \"getField\", 0,\n MPSymbols.char$_sym_$, null, null, MPSymbols.boolean$_sym_$); /* last 4 params: expected value, null expected value, unused expected value, default expected value */\n\n FieldSet_TestUtilities.test_SetAndGet_useIndex(executeInfo, fieldTypes_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$_CC_$SCHEMA$95$FOR$95$SCHEMA$_S_$DESCRIPTOR$_S_$FIELD$__$TYPES.class,\n \"setField\", Object.class, \"setField__Special\", \"getField\", 1,\n MPSymbols.int$_sym_$, null, null, MPSymbols.boolean$_sym_$); /* last 4 params: expected value, null expected value, unused expected value, default expected value */\n\n }", "public void testWeakCompareAndSet() {\n AtomicLong ai = new AtomicLong(1);\n do {} while (!ai.weakCompareAndSet(1, 2));\n do {} while (!ai.weakCompareAndSet(2, -4));\n assertEquals(-4, ai.get());\n do {} while (!ai.weakCompareAndSet(-4, 7));\n assertEquals(7, ai.get());\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodAsSet() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID\",\n SEPARATOR + \"portfolio.asSet() pf\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForValues(ri);\n }", "private boolean cas(int i, long e, long y) {\n synchronized (data) {\n if (data[i] != e) return false; // 1, 1a\n data[i] = y; // 1b\n return true; // 1b\n }\n }", "protected void soConsumerIndex(long newValue)\r\n/* 27: */ {\r\n/* 28:139 */ C_INDEX_UPDATER.lazySet(this, newValue);\r\n/* 29: */ }", "public void testCompareAndSetInMultipleThreads() throws Exception {\n final AtomicLong ai = new AtomicLong(1);\n Thread t = new Thread(new CheckedRunnable() {\n public void realRun() {\n while (!ai.compareAndSet(2, 3))\n Thread.yield();\n }});\n\n t.start();\n assertTrue(ai.compareAndSet(1, 2));\n t.join(LONG_DELAY_MS);\n assertFalse(t.isAlive());\n assertEquals(3, ai.get());\n }", "public void testGetAndSet() {\n AtomicLong ai = new AtomicLong(1);\n assertEquals(1, ai.getAndSet(0));\n assertEquals(0, ai.getAndSet(-10));\n assertEquals(-10, ai.getAndSet(1));\n }", "void set(int idx, int val);", "@Test\n public void test_getAndSet_ByIndex_TypedMethods() throws Exception {\n\n FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$TEST$__$SCHEMA$_S_$MY$95$DESC$__$NUM1 descNum1_FieldSet = new FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$TEST$__$SCHEMA$_S_$MY$95$DESC$__$NUM1(\n executeInfo, null);\n\n\n\n descNum1_FieldSet.schemaInfo_Positioned = mock_schemaInfoFieldSet_descNum1;\n\n // Test the Get & Set methods _________________________________________________________________________________\n\n\n FieldSet_TestUtilities.test_SetAndGet_useIndex(executeInfo, descNum1_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$TEST$__$SCHEMA$_S_$MY$95$DESC$__$NUM1.class,\n \"setField_String\", String.class, \"setField__Special\", \"getField_String\", 0,\n \"stuff\", null, null, \"hi\"); /* last 4 params: expected value, null expected value, unused expected value, default expected value */\n\n FieldSet_TestUtilities.test_SetAndGet_useIndex(executeInfo, descNum1_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$TEST$__$SCHEMA$_S_$MY$95$DESC$__$NUM1.class,\n \"setField_short\", Short.TYPE, \"setField__Special\", \"getField_short\", 1,\n (short)123, (short)-1, (short)-1, (short)-1001); /* last 4 params: expected value, getField_short expected value, unused expected value, default expected value */\n\n // continuation primiative field\n FieldSet_TestUtilities.test_SetAndGet_useIndex(executeInfo, descNum1_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$TEST$__$SCHEMA$_S_$MY$95$DESC$__$NUM1.class,\n \"setField_int\", Integer.TYPE, \"setField__Special\", \"getField_int\", 2,\n 456, -1, -1, -1000); /* last 4 params: expected value, getField_short expected value, unused expected value, default expected value */\n\n FieldSet_TestUtilities.test_SetAndGet_useIndex(executeInfo, descNum1_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$TEST$__$SCHEMA$_S_$MY$95$DESC$__$NUM1.class,\n \"setField_int\", Integer.TYPE, \"setField__Special\", \"getField_int\", 3,\n 789, -1, -1, -1000); /* last 4 params: expected value, getField_short expected value, unused expected value, default expected value */\n\n\n\n\n\n\n // Object Continuation\n FieldSetTuple__net$__$unconventionalthinking$__$matrix$_CC_$SCHEMA$95$FOR$95$SCHEMA$_S_$DESCRIPTOR$_S_$FIELD$__$TYPES fieldTypes_FieldSet = new FieldSetTuple__net$__$unconventionalthinking$__$matrix$_CC_$SCHEMA$95$FOR$95$SCHEMA$_S_$DESCRIPTOR$_S_$FIELD$__$TYPES(\n executeInfo, null);\n\n fieldTypes_FieldSet.schemaInfo_Positioned = mock_schemaInfoFieldSet_fieldTypes;\n\n\n // Test the Get & Set methods _________________________________________________________________________________\n FieldSet_TestUtilities.test_SetAndGet_useIndex(executeInfo, fieldTypes_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$_CC_$SCHEMA$95$FOR$95$SCHEMA$_S_$DESCRIPTOR$_S_$FIELD$__$TYPES.class,\n \"setField_Symbol\", Symbol.class, \"setField__Special\", \"getField_Symbol\", 0,\n MPSymbols.char$_sym_$, null, null, MPSymbols.boolean$_sym_$); /* last 4 params: expected value, getField_short expected value, unused expected value, default expected value */\n\n FieldSet_TestUtilities.test_SetAndGet_useIndex(executeInfo, fieldTypes_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$_CC_$SCHEMA$95$FOR$95$SCHEMA$_S_$DESCRIPTOR$_S_$FIELD$__$TYPES.class,\n \"setField_Symbol\", Symbol.class, \"setField__Special\", \"getField_Symbol\", 1,\n MPSymbols.byte$_sym_$, null, null, MPSymbols.boolean$_sym_$); /* last 4 params: expected value, getField_short expected value, unused expected value, default expected value */\n\n\n\n }", "@Test\r\n public void testThreaded() throws Exception {\r\n\r\n final ClientValue<Integer> value = new ClientValue<>();\r\n\r\n List<SetCheckValue> runs = new ArrayList<>();\r\n\r\n for (int i = 0; i < 500; i++) {\r\n runs.add(new SetCheckValue(value, i, false));\r\n }\r\n runAll(runs);\r\n checkForSuccess(runs);\r\n for (int i = 0; i < 500; i++) {\r\n runs.add(new SetCheckValue(value, i, true));\r\n }\r\n\r\n runAll(runs);\r\n checkForSuccess(runs);\r\n }", "private void checkAndSet() {\n if (value == null) {\n throw new IllegalArgumentException(EXC_NodeCannotBeNull());\n }\n\n if (equalNodes(value, selectedNodes)) {\n return;\n }\n\n List<Node> validNodes = null;\n for (int i = 0; i < value.length; i++) {\n if (value[i] == null) {\n throw new IllegalArgumentException(EXC_NoElementOfNodeSelectionMayBeNull());\n }\n \n if (!isUnderRoot(value[i])) {\n if (validNodes == null) {\n validNodes = new ArrayList<Node>(value.length);\n for (int j = 0; j < i; j++) {\n validNodes.add(value[j]);\n }\n }\n } else if (validNodes != null) {\n validNodes.add(value[i]);\n }\n }\n if (validNodes != null) {\n newValue = validNodes.toArray(new Node[validNodes.size()]);\n if (equalNodes(newValue, selectedNodes)) {\n return;\n } \n } else {\n newValue = value;\n }\n\n if ((newValue.length != 0) && (vetoableSupport != null)) {\n try {\n // we send the vetoable change event only for non-empty selections\n vetoableSupport.fireVetoableChange(PROP_SELECTED_NODES, selectedNodes, newValue);\n } catch (PropertyVetoException ex) {\n veto = ex;\n return;\n }\n }\n updateSelection();\n }", "public Comparable set( int index, Comparable newVal ) {\n\tComparable temp= _data[index];\n\t_data[index]= newVal;\n\treturn temp;\n }", "@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public boolean casValue(AbstractFuture<?> future, Object expect, Object update) {\n return UNSAFE.compareAndSwapObject(future, VALUE_OFFSET, expect, update);\n }", "@Override\n public E set(int index, E value) {\n // todo: Students must code\n checkRange(index);\n int pos = calculate(index);\n E oldVal = data[pos];\n data[pos] = value;\n return oldVal;\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodValues() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID\",\n SEPARATOR + \"portfolio.values() pf\");\n assertTrue(i1 instanceof CompactRangeIndex);\n Cache cache = CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForValues(ri);\n }", "public void set(long index);", "@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public boolean casValue(AbstractFuture<?> future, Object expect, Object update) {\n boolean z;\n synchronized (future) {\n if (((AbstractFuture) future).value == expect) {\n ((AbstractFuture) future).value = update;\n z = true;\n } else {\n z = false;\n }\n }\n return z;\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 abstract E set(int index, E e);", "@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public boolean casValue(AbstractFuture<?> future, Object expect, Object update) {\n return this.valueUpdater.compareAndSet(future, expect, update);\n }", "public int set(int index, int element);", "public final std.pair<RValue, Value /*P*/ > EmitAtomicCompareExchange(LValue Obj, RValue Expected, RValue Desired, SourceLocation Loc, \n AtomicOrdering Success/*= AtomicOrdering::SequentiallyConsistent*/, AtomicOrdering Failure/*= AtomicOrdering::SequentiallyConsistent*/, boolean IsWeak/*= false*/, \n AggValueSlot Slot/*= AggValueSlot::ignored()*/) {\n assert (!Expected.isAggregate() || Expected.getAggregateAddress().getElementType() == Obj.getAddress().getElementType());\n assert (!Desired.isAggregate() || Desired.getAggregateAddress().getElementType() == Obj.getAddress().getElementType());\n AtomicInfo Atomics/*J*/= new AtomicInfo(/*Deref*/$this(), Obj);\n \n return Atomics.EmitAtomicCompareExchange(new RValue(Expected), new RValue(Desired), Success, Failure, \n IsWeak);\n}", "boolean casEntriesArrayInt(int item, OFFSET offset, int expected, int value) {\n return unsafe.compareAndSwapInt(entries,\n Unsafe.ARRAY_INT_BASE_OFFSET + (item + offset.value) * Unsafe.ARRAY_INT_INDEX_SCALE,\n expected, value);\n }", "public void setTargetValue(int idx, Object value);", "T set(int index, T element);", "public static void main(String[] args) {\n Simple simple = new Simple(\"James\", 29);\n //AtomicReference --> creates possible ABA problem\n AtomicReference<Simple> atomicSimple= new AtomicReference<>(simple);\n System.out.println(atomicSimple.get());\n //expect false\n boolean falseResult = atomicSimple.compareAndSet(new Simple(\"Henry\", 22), new Simple(\"Andy\", 23));\n System.out.println(falseResult);\n boolean falseResult1 = atomicSimple.compareAndSet(new Simple(\"James\",29), new Simple(\"Andy\", 23));\n System.out.println(falseResult1);\n boolean result = atomicSimple.compareAndSet(simple, new Simple(\"Andy\", 23));\n System.out.println(result);\n }", "void set(int index, T data);", "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 }", "void setBit(int index, int value);", "private boolean sc(int i, long y) {\n return cas(i, tag[th()], y); // 1\n }", "public abstract boolean casValue(AbstractFuture<?> abstractFuture, Object obj, Object obj2);", "long getAndSet(long newValue);", "public abstract <T> void set(int index, T value);", "@Test\n public void Test4663220() {\n RuleBasedCollator collator = (RuleBasedCollator)Collator.getInstance(Locale.US);\n java.text.StringCharacterIterator stringIter = new java.text.StringCharacterIterator(\"fox\");\n CollationElementIterator iter = collator.getCollationElementIterator(stringIter);\n \n int[] elements_next = new int[3];\n logln(\"calling next:\");\n for (int i = 0; i < 3; ++i) {\n logln(\"[\" + i + \"] \" + (elements_next[i] = iter.next()));\n }\n \n int[] elements_fwd = new int[3];\n logln(\"calling set/next:\");\n for (int i = 0; i < 3; ++i) {\n iter.setOffset(i);\n logln(\"[\" + i + \"] \" + (elements_fwd[i] = iter.next()));\n }\n \n for (int i = 0; i < 3; ++i) {\n if (elements_next[i] != elements_fwd[i]) {\n errln(\"mismatch at position \" + i + \n \": \" + elements_next[i] + \n \" != \" + elements_fwd[i]);\n }\n }\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodGetValues() throws Exception {\n Index i1 =\n qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID\",\n SEPARATOR + \"portfolio.getValues() pf\");\n assertTrue(i1 instanceof CompactRangeIndex);\n Cache cache = CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForValues(ri);\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodEntrySet() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"entries.value.getID\",\n SEPARATOR + \"portfolio.entrySet() entries\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForEntries(ri);\n }", "@Override\n public E set(int index, E value) {\n this.rangeCheck(index);\n E oldValue = (E) this.values[index];\n this.values[index] = value;\n return oldValue;\n }", "@Override\n public E set(int index, E elem) {\n\t E first = _store[index];\n\t _store[index] =elem;\n\t return first;\n }", "public abstract void set(T first, T second, Double similarity);", "public void testGetLazySet() {\n AtomicLong ai = new AtomicLong(1);\n assertEquals(1, ai.get());\n ai.lazySet(2);\n assertEquals(2, ai.get());\n ai.lazySet(-3);\n assertEquals(-3, ai.get());\n }", "@Override\r\n\tpublic E set(int index, E e) {\r\n\t\tif (e == null) {\r\n\t\t\tthrow new NullPointerException();\r\n\t\t}\r\n\t\tif (index < 0 || index >= size) {\r\n\t\t\tthrow new IndexOutOfBoundsException();\r\n\t\t}\r\n\t\tfor (ListNode p = front; p != null; p = p.next) {\r\n\t\t\tif (e.equals(p.data)) {\r\n\t\t\t\tthrow new IllegalArgumentException();\r\n\t\t\t}\r\n\t\t}\r\n\t\tE result = null;\r\n\t\tif (front != null && index == 0) {\r\n\t\t\tresult = front.data;\r\n\t\t\tfront.data = e;\r\n\t\t\treturn result;\r\n\t\t} \r\n\r\n\t\tListNode current = front;\r\n\t\twhile (index > 0) {\r\n\t\t\tcurrent = current.next;\r\n\t\t\tindex--;\r\n\t\t}\t\t\t\r\n\t\t//check not beyond end of list\r\n\t\tif (current != null) {\t\t\t\t\r\n\t\t\tresult = current.data;\r\n\t\t\tcurrent.data = e;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public void testGetAndIncrement() {\n AtomicLong ai = new AtomicLong(1);\n assertEquals(1, ai.getAndIncrement());\n assertEquals(2, ai.get());\n ai.set(-2);\n assertEquals(-2, ai.getAndIncrement());\n assertEquals(-1, ai.getAndIncrement());\n assertEquals(0, ai.getAndIncrement());\n assertEquals(1, ai.get());\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodKeySet() throws Exception {\n Index i1 =\n qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"ks.toString\",\n SEPARATOR + \"portfolio.keySet() ks\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForKeys(ri);\n }", "private void collisionProcessing(K key, V value, int index) {\n Entry<K, V> current = (Entry<K, V>) table[index];\n\n while (current.hasNext()) {\n if (current.getKey().equals(key)) {\n current.setValue(value);\n return;\n }\n\n current = current.getNext();\n }\n\n if (current.getKey().equals(key)) {\n current.setValue(value);\n return;\n }\n\n current.setNext(new Entry<>(key, value));\n }", "private static void verifyLongs(long[] values, int[] ids) throws Exception {\n IndexWriterConfig iwc = newIndexWriterConfig();\n\n // Else we can get O(N^2) merging:\n int mbd = iwc.getMaxBufferedDocs();\n if (mbd != -1 && mbd < values.length / 100) {\n iwc.setMaxBufferedDocs(values.length / 100);\n }\n iwc.setCodec(getCodec());\n Directory dir;\n if (values.length > 100000) {\n dir = newMaybeVirusCheckingFSDirectory(createTempDir(\"TestRangeTree\"));\n } else {\n dir = newMaybeVirusCheckingDirectory();\n }\n\n int missingPct = random().nextInt(100);\n int deletedPct = random().nextInt(100);\n if (VERBOSE) {\n System.out.println(\" missingPct=\" + missingPct);\n System.out.println(\" deletedPct=\" + deletedPct);\n }\n\n BitSet missing = new BitSet();\n BitSet deleted = new BitSet();\n\n Document doc = null;\n int lastID = -1;\n\n IndexWriter w = new IndexWriter(dir, iwc);\n for (int ord = 0; ord < values.length; ord++) {\n int id;\n if (ids == null) {\n id = ord;\n } else {\n id = ids[ord];\n }\n if (id != lastID) {\n if (random().nextInt(100) < missingPct) {\n missing.set(id);\n if (VERBOSE) {\n System.out.println(\" missing id=\" + id);\n }\n }\n\n if (doc != null) {\n w.addDocument(doc);\n if (random().nextInt(100) < deletedPct) {\n int idToDelete = random().nextInt(id);\n w.deleteDocuments(new Term(\"id\", \"\" + idToDelete));\n deleted.set(idToDelete);\n if (VERBOSE) {\n System.out.println(\" delete id=\" + idToDelete);\n }\n }\n }\n\n doc = new Document();\n doc.add(newStringField(\"id\", \"\" + id, Field.Store.NO));\n doc.add(new NumericDocValuesField(\"id\", id));\n lastID = id;\n }\n\n if (missing.get(id) == false) {\n doc.add(new LongPoint(\"sn_value\", values[id]));\n byte[] bytes = new byte[8];\n NumericUtils.longToSortableBytes(values[id], bytes, 0);\n doc.add(new BinaryPoint(\"ss_value\", bytes));\n }\n }\n\n w.addDocument(doc);\n\n if (random().nextBoolean()) {\n if (VERBOSE) {\n System.out.println(\" forceMerge(1)\");\n }\n w.forceMerge(1);\n }\n final IndexReader r = DirectoryReader.open(w);\n w.close();\n\n IndexSearcher s = newSearcher(r, false);\n\n int numThreads = TestUtil.nextInt(random(), 2, 5);\n\n if (VERBOSE) {\n System.out.println(\"TEST: use \" + numThreads + \" query threads; searcher=\" + s);\n }\n\n List<Thread> threads = new ArrayList<>();\n final int iters = atLeast(100);\n\n final CountDownLatch startingGun = new CountDownLatch(1);\n final AtomicBoolean failed = new AtomicBoolean();\n\n for (int i = 0; i < numThreads; i++) {\n Thread thread =\n new Thread() {\n @Override\n public void run() {\n try {\n _run();\n } catch (Exception e) {\n failed.set(true);\n throw new RuntimeException(e);\n }\n }\n\n private void _run() throws Exception {\n startingGun.await();\n\n for (int iter = 0; iter < iters && failed.get() == false; iter++) {\n Long lower = randomValue();\n Long upper = randomValue();\n\n if (upper < lower) {\n long x = lower;\n lower = upper;\n upper = x;\n }\n\n Query query;\n\n if (VERBOSE) {\n System.out.println(\n \"\\n\"\n + Thread.currentThread().getName()\n + \": TEST: iter=\"\n + iter\n + \" value=\"\n + lower\n + \" TO \"\n + upper);\n byte[] tmp = new byte[8];\n NumericUtils.longToSortableBytes(lower, tmp, 0);\n System.out.println(\" lower bytes=\" + Arrays.toString(tmp));\n NumericUtils.longToSortableBytes(upper, tmp, 0);\n System.out.println(\" upper bytes=\" + Arrays.toString(tmp));\n }\n\n if (random().nextBoolean()) {\n query = LongPoint.newRangeQuery(\"sn_value\", lower, upper);\n } else {\n byte[] lowerBytes = new byte[8];\n NumericUtils.longToSortableBytes(lower, lowerBytes, 0);\n byte[] upperBytes = new byte[8];\n NumericUtils.longToSortableBytes(upper, upperBytes, 0);\n query = BinaryPoint.newRangeQuery(\"ss_value\", lowerBytes, upperBytes);\n }\n\n if (VERBOSE) {\n System.out.println(Thread.currentThread().getName() + \": using query: \" + query);\n }\n\n final FixedBitSet hits =\n s.search(query, FixedBitSetCollector.createManager(r.maxDoc()));\n\n if (VERBOSE) {\n System.out.println(\n Thread.currentThread().getName() + \": hitCount: \" + hits.cardinality());\n }\n\n NumericDocValues docIDToID = MultiDocValues.getNumericValues(r, \"id\");\n\n for (int docID = 0; docID < r.maxDoc(); docID++) {\n assertEquals(docID, docIDToID.nextDoc());\n int id = (int) docIDToID.longValue();\n boolean expected =\n missing.get(id) == false\n && deleted.get(id) == false\n && values[id] >= lower\n && values[id] <= upper;\n if (hits.get(docID) != expected) {\n // We do exact quantized comparison so the bbox query should never disagree:\n fail(\n Thread.currentThread().getName()\n + \": iter=\"\n + iter\n + \" id=\"\n + id\n + \" docID=\"\n + docID\n + \" value=\"\n + values[id]\n + \" (range: \"\n + lower\n + \" TO \"\n + upper\n + \") expected \"\n + expected\n + \" but got: \"\n + hits.get(docID)\n + \" deleted?=\"\n + deleted.get(id)\n + \" query=\"\n + query);\n }\n }\n }\n }\n };\n thread.setName(\"T\" + i);\n thread.start();\n threads.add(thread);\n }\n startingGun.countDown();\n for (Thread thread : threads) {\n thread.join();\n }\n IOUtils.close(r, dir);\n }", "private void testSet() {\n init();\n assertTrue(\"l2.set(l2, 0, 39)\", \n FListInteger.get(l2.set(l2, 0, 39), 0) == 39);\n assertTrue(\"l2.set(l2, 0, 51)\", \n FListInteger.get(l2.set(l2, 0, 51), 0) == 51);\n assertTrue(\"l1.set(l1, 0, 10101)\",\n FListInteger.get(l1.set(l1, 0, 10101), 0) == 10101);\n }", "E set(int i , E e) throws IndexOutOfBoundsException;", "@Override\n public T set(int index, T element) {\n if (indexCheck(index)) {\n T previousValue = (T) data[index];\n data[index] = element;\n return previousValue;\n }\n return null;\n }", "@Test\n public void testCompactRangeIndexOnPR() {\n Host host = Host.getHost(0);\n VM vm0 = host.getVM(0);\n VM vm1 = host.getVM(1);\n VM vm2 = host.getVM(2);\n VM vm3 = host.getVM(3);\n setCacheInVMs(vm0, vm1, vm2, vm3);\n vm0.invoke(helper.getCacheSerializableRunnableForPRAccessorCreate(regionName, redundancy,\n Portfolio.class));\n\n vm1.invoke(\n helper.getCacheSerializableRunnableForPRCreate(regionName, redundancy, Portfolio.class));\n\n vm2.invoke(\n helper.getCacheSerializableRunnableForPRCreate(regionName, redundancy, Portfolio.class));\n\n vm3.invoke(\n helper.getCacheSerializableRunnableForPRCreate(regionName, redundancy, Portfolio.class));\n\n vm0.invoke(helper.getCacheSerializableRunnableForPRIndexCreate(regionName, indexName,\n indexedExpression, fromClause, alias));\n\n\n AsyncInvocation<?>[] asyncInvs = new AsyncInvocation[12];\n\n asyncInvs[0] =\n vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));\n\n asyncInvs[1] = vm1.invokeAsync(\n helper.getCacheSerializableRunnableForPRRandomOps(regionName, stepSize, (2 * stepSize)));\n\n asyncInvs[2] = vm2.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (2 * stepSize), (3 * stepSize)));\n\n asyncInvs[3] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (3 * (stepSize)), totalDataSize));\n\n asyncInvs[4] =\n vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));\n\n asyncInvs[5] = vm1.invokeAsync(\n helper.getCacheSerializableRunnableForPRRandomOps(regionName, stepSize, (2 * stepSize)));\n\n asyncInvs[6] = vm2.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (2 * stepSize), (3 * stepSize)));\n\n asyncInvs[7] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (3 * (stepSize)), totalDataSize));\n\n asyncInvs[8] =\n vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));\n\n asyncInvs[9] = vm1.invokeAsync(\n helper.getCacheSerializableRunnableForPRRandomOps(regionName, stepSize, (2 * stepSize)));\n\n asyncInvs[10] = vm2.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (2 * stepSize), (3 * stepSize)));\n\n asyncInvs[11] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (3 * (stepSize)), totalDataSize));\n\n for (AsyncInvocation<?> inv : asyncInvs) {\n ThreadUtils.join(inv, 60 * 000);\n }\n\n for (AsyncInvocation<?> inv : asyncInvs) {\n if (inv.exceptionOccurred()) {\n Assert.fail(\"Random region operation failed on VM_\" + inv.getId(), inv.getException());\n }\n }\n vm0.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n\n vm1.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n\n vm2.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n\n vm3.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n }", "@Override\n public void run() {\n aia.addAndGet(1,15);\n aia.decrementAndGet(1);\n\n //weakly compare the first args to current value and sets\n aia.compareAndSet(1,14,20);\n System.out.println(aia.get(1));\n }", "public void set_AllSpreadIndexToOne(){\r\n\t//test to see if the fuel moistures are greater than 33 percent.\r\n\t//if they are, set their index value to 1\r\n\tif ((FFM>33)){ // fine fuel greater than 33?\r\n\t\tGRASS=0; \r\n\t\tTIMBER=0;\r\n\t}else{\r\n\t\tTIMBER=1;\r\n\t}\r\n}", "@Test\n public void testCompactRangeIndex() {\n // Create a Local Region.\n Host host = Host.getHost(0);\n VM vm0 = host.getVM(0);\n setCacheInVMs(vm0);\n vm0.invoke(helper.getCacheSerializableRunnableForReplicatedRegionCreation(regionName));\n\n vm0.invoke(helper.getCacheSerializableRunnableForPRIndexCreate(regionName, indexName,\n indexedExpression, fromClause, alias));\n\n AsyncInvocation<?>[] asyncInvs = new AsyncInvocation[2];\n\n asyncInvs[0] =\n vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));\n\n asyncInvs[1] =\n vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));\n\n for (AsyncInvocation<?> inv : asyncInvs) {\n ThreadUtils.join(inv, 30 * 000);\n }\n\n for (AsyncInvocation<?> inv : asyncInvs) {\n if (inv.exceptionOccurred()) {\n Assert.fail(\"Random region operation failed on VM_\" + inv.getId(), inv.getException());\n }\n }\n\n vm0.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n\n }", "@Override\n public int set(int index, int element) {\n checkIndex(index);\n int result = getEntry(index).value;\n getEntry(index).value = element;\n return result;\n }", "@Test\n public void testIntersection4()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n if (i != 500) {\n set2.add(i);\n expected.add(i);\n }\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Override\n\tpublic <T> boolean cas(String arg0, int arg1, T arg2, Transcoder<T> arg3,\n\t\t\tlong arg4, long arg5) throws TimeoutException,\n\t\t\tInterruptedException, MemcachedException {\n\t\treturn false;\n\t}", "void setPointChange(Integer setPoint, Integer expectedValue);", "@Test\r\n\tpublic void testSet() {\r\n\t\tll.add(0, t3);\r\n\t\tll.add(0, t2);\r\n\t\tll.add(2, t4);\r\n\t\t// order of list: [0: t2, 1: t3, 2: t4]\r\n\r\n\t\t// valid sets\r\n\t\tll.set(0, t1);\r\n\t\tassertEquals(3, ll.size());\r\n\t\tassertEquals(t1, ll.get(0));\r\n\t\tassertEquals(t3, ll.get(1));\r\n\r\n\t\tll.set(1, t2);\r\n\t\tassertEquals(3, ll.size());\r\n\t\tassertEquals(t1, ll.get(0));\r\n\t\tassertEquals(t2, ll.get(1));\r\n\t\tassertEquals(t4, ll.get(2));\r\n\r\n\t\tll.set(2, t3);\r\n\t\tassertEquals(3, ll.size());\r\n\t\tassertEquals(t3, ll.get(2));\r\n\t\tassertEquals(t2, ll.get(1));\r\n\t\t// order of list: [0: t1, 1: t2, 2: t3]\r\n\r\n\t\t// invalid sets\r\n\t\ttry {\r\n\t\t\tll.set(-1, t4);\r\n\t\t\tfail();\r\n\t\t} catch (IndexOutOfBoundsException e) {\r\n\t\t\tassertEquals(3, ll.size());\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tll.set(3, t4);\r\n\t\t\tfail();\r\n\t\t} catch (IndexOutOfBoundsException e) {\r\n\t\t\tassertEquals(3, ll.size());\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tll.set(0, null);\r\n\t\t\tfail();\r\n\t\t} catch (NullPointerException e) {\r\n\t\t\tassertEquals(t1, ll.get(0));\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tll.set(0, t3);\r\n\t\t\tfail();\r\n\t\t} catch (IllegalArgumentException e) {\r\n\t\t\tassertEquals(t1, ll.get(0));\r\n\t\t}\r\n\t}", "public boolean set(int index, E value){\n if (index > maxIndex || index < 0){\n System.out.println(\"Error while replacing value. Your index \" + index + \" is out of bound of array\");\n return false;\n }\n\n array[index] = value;\n return true;\n }", "public boolean set(O o, int index)\r\n {\r\n if (index >= count || index < 0) return false;\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=index-1;i++)\r\n {\r\n vi = vi.getNext();\r\n }\r\n \r\n vi.setObject(o);\r\n return true;\r\n \r\n }", "@Test\n public void shouldReturnConflictIfCompareAndSetFailsBecauseAKeyAlreadyExistsExceptionIsThrown() {\n final SetValue newKeyValue = new SetValue();\n newKeyValue.setExpectedValue(null);\n newKeyValue.setNewValue(NEW_VALUE);\n\n when(distributedStore.compareAndSet(KEY, newKeyValue)).thenReturn(Futures.<KeyValue>immediateFailedFuture(new KeyAlreadyExistsException(KEY)));\n\n assertThatResourceMethodReturnsStatus(\n client().resource(REQUEST_URI).type(MediaType.APPLICATION_JSON_TYPE).entity(newKeyValue),\n \"PUT\",\n ClientResponse.Status.CONFLICT\n );\n }", "public synchronized boolean set(int index, E value) {\n return this.array.set(index, value);\n }", "@Before\n public void setUp() throws Exception {\n accessor = mock(ValueVector.Accessor.class);\n when(accessor.getObject(anyInt())).thenAnswer(new Answer<Object>() {\n\n @Override\n public Object answer(InvocationOnMock invocationOnMock) throws Throwable {\n Object[] args = invocationOnMock.getArguments();\n Integer index = (Integer) args[0];\n if(index == 0) {\n return NON_NULL_VALUE;\n }\n if(index == 1) {\n return null;\n }\n throw new IndexOutOfBoundsException(\"Index out of bounds\");\n }\n });\n when(accessor.isNull(anyInt())).thenAnswer(new Answer<Object>() {\n\n @Override\n public Object answer(InvocationOnMock invocationOnMock) throws Throwable {\n Object[] args = invocationOnMock.getArguments();\n Integer index = (Integer) args[0];\n if(index == 0) {\n return false;\n }\n return true;\n }\n });\n\n metadata = UserBitShared.SerializedField.getDefaultInstance();\n valueVector = mock(ValueVector.class);\n when(valueVector.getAccessor()).thenReturn(accessor);\n when(valueVector.getMetadata()).thenReturn(metadata);\n\n genericAccessor = new GenericAccessor(valueVector);\n }", "private void setValueInternal(int current, boolean notifyChange) {\n\t\tif (mValue == current) {\n\t\t\treturn;\n\t\t}\n\t\t// Wrap around the values if we go past the start or end\n\t\tif (mWrapSelectorWheel) {\n\t\t\tcurrent = getWrappedSelectorIndex(current);\n\t\t} else {\n\t\t\tcurrent = Math.max(current, mMinValue);\n\t\t\tcurrent = Math.min(current, mMaxValue);\n\t\t}\n\t\t// int previous = mValue;\n\t\tmValue = current;\n\t\tupdateInputTextView();\n\t\tif (notifyChange) {\n\t\t\t// notifyChange(previous, current);\n\t\t}\n\t\tinitializeSelectorWheelIndices();\n\t\tinvalidate();\n\t}", "public E set(int index, E element);", "static void compare()\n {\n \tif(a < c)\n\t\t {\n\t\t\t comp_one = 1; //store this value , else zero default \n\t\t }\n\t\t if(c < b)\n\t\t {\n\t\t\t comp_two = 2; //store this value , else zero default\n\t\t }\n\t\t if(b < a)\n\t\t {\n\t\t\t comp_thr = 5; //store this value , else zero default\n\t\t }\n\t\t \n\t\t comp_val = comp_one + comp_two + comp_thr; //create a unique value by addition\n }", "E set(int i, E e) throws IndexOutOfBoundsException;", "public void testIntValue() {\n AtomicLong ai = new AtomicLong();\n assertEquals(0, ai.intValue());\n for (long x : VALUES) {\n ai.set(x);\n assertEquals((int)x, ai.intValue());\n }\n }", "@Override\n\tpublic synchronized final <V extends Value<V>> boolean update(\n\t\t\tfinal MarketTaker<V> taker) {\n\n\t\tif (!RegTaker.isValid(taker)) {\n\t\t\t// debug logged already\n\t\t\treturn false;\n\t\t}\n\n\t\tfinal RegTaker<?> regTaker = takerMap.get(taker);\n\n\t\tif (regTaker == null) {\n\t\t\tlog.warn(\"Taker not registered : {}\", taker);\n\t\t\treturn false;\n\t\t}\n\n\t\t//\n\n\t\tfinal Set<MarketInstrument> updateSet = new HashSet<MarketInstrument>();\n\t\tfinal Set<MarketInstrument> registerSet = new HashSet<MarketInstrument>();\n\t\tfinal Set<MarketInstrument> unregisterSet = new HashSet<MarketInstrument>();\n\t\tfinal Set<MarketInstrument> changeNotifySet = new HashSet<MarketInstrument>();\n\n\t\t{\n\n\t\t\tfinal MarketInstrument[] pastArray = regTaker.getInstruments();\n\t\t\tfinal MarketInstrument[] nextArray = taker.bindInstruments();\n\n\t\t\tfinal Set<MarketInstrument> pastSet = new HashSet<MarketInstrument>(\n\t\t\t\t\tArrays.asList(pastArray));\n\t\t\tfinal Set<MarketInstrument> nextSet = new HashSet<MarketInstrument>(\n\t\t\t\t\tArrays.asList(nextArray));\n\n\t\t\t/** past & next */\n\t\t\tupdateSet.addAll(pastSet);\n\t\t\tupdateSet.retainAll(nextSet);\n\n\t\t\t/** next - past */\n\t\t\tregisterSet.addAll(nextSet);\n\t\t\tregisterSet.removeAll(updateSet);\n\n\t\t\t/** past - next */\n\t\t\tunregisterSet.addAll(pastSet);\n\t\t\tunregisterSet.removeAll(updateSet);\n\n\t\t\t/** past + next */\n\t\t\tchangeNotifySet.addAll(updateSet);\n\t\t\tchangeNotifySet.addAll(registerSet);\n\t\t\tchangeNotifySet.addAll(unregisterSet);\n\n\t\t}\n\n\t\t//\n\n\t\t// log.debug(\"updateSet : {}\", updateSet);\n\t\t// log.debug(\"registerSet : {}\", registerSet);\n\t\t// log.debug(\"unregisterSet : {}\", unregisterSet);\n\t\t// log.debug(\"changeNotifySet : {}\", changeNotifySet);\n\n\t\t//\n\n\t\t/** unregister : based on past */\n\t\tfor (final MarketInstrument inst : unregisterSet) {\n\n\t\t\tfinal MarketDo market = marketMap.get(inst);\n\n\t\t\tmarket.runSafe(safeUnregister, regTaker);\n\n\t\t}\n\n\t\t/** update : based on merge of next and past */\n\t\tfor (final MarketInstrument inst : updateSet) {\n\n\t\t\tfinal MarketDo market = marketMap.get(inst);\n\n\t\t\tmarket.runSafe(safeUpdate, regTaker);\n\n\t\t}\n\n\t\t/** past = next */\n\t\tregTaker.bind();\n\n\t\t/** register : based on next */\n\t\tfor (final MarketInstrument inst : registerSet) {\n\n\t\t\tif (!isValid(inst)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!isRegistered(inst)) {\n\t\t\t\tregister(inst);\n\t\t\t}\n\n\t\t\tfinal MarketDo market = marketMap.get(inst);\n\n\t\t\tmarket.runSafe(safeRegister, regTaker);\n\n\t\t}\n\n\t\tfinal Set<MarketDo> ms = new HashSet<MarketDo>();\n\t\t/** remove / notify */\n\t\tfor (final MarketInstrument inst : changeNotifySet) {\n\n\t\t\tfinal MarketDo market = marketMap.get(inst);\n\n\t\t\tif (!market.hasRegTakers()) {\n\t\t\t\tunregister(inst);\n\t\t\t}\n\t\t\t\n\t\t\tms.add(market);\n\n\t\t}\n\t\t\n\t\tnotifyRegListeners(ms);\n\n\t\treturn true;\n\t}", "public T set(int i, T obj);", "public void testMutators() throws Exception {\n\n FileChangeSet fcs = new FileChangeSet();\n\n /*\n * Not the greatest test fixture ever. Overcome lack of accessors\n * returning Sets\n */\n FileChangeSet added = new FileChangeSet();\n added.fileAdded(\"file-1.html\");\n\n FileChangeSet modified = new FileChangeSet();\n modified.fileModified(\"file-2.html\");\n\n FileChangeSet deleted = new FileChangeSet();\n deleted.fileDeleted(\"file-3.html\");\n\n FileChangeSet targetDeleted = new FileChangeSet();\n targetDeleted.targetFileDeleted(\"file-4.html\");\n\n FileChangeSet targetAdded = new FileChangeSet();\n targetAdded.targetFileAdded(\"file-5.html\");\n\n assertEquals(\"size of ADDED correct\", 0, fcs.getAdded().size());\n assertEquals(\"size of MODIFIED correct\", 0, fcs.getModified().size());\n assertEquals(\"size of DELETED correct\", 0, fcs.getDeleted().size());\n assertEquals(\"size of TARGET FILE DELETED correct\", 0, fcs.getTargetDeleted().size());\n assertEquals(\"size of TARGET FILE ADDED correct\", 0, fcs.getTargetAdded().size());\n\n fcs.fileAdded(\"file-1.html\");\n\n assertEquals(\"size of ADDED correct\", 1, fcs.getAdded().size());\n assertEquals(\"content of ADDED correct\", added, fcs.getAdded());\n assertEquals(\"size of MODIFIED correct\", 0, fcs.getModified().size());\n assertEquals(\"size of DELETED correct\", 0, fcs.getDeleted().size());\n assertEquals(\"size of TARGET FILE DELETED correct\", 0, fcs.getTargetDeleted().size());\n assertEquals(\"size of TARGET FILE ADDED correct\", 0, fcs.getTargetAdded().size());\n\n fcs.fileModified(\"file-2.html\");\n\n assertEquals(\"size of ADDED correct\", 1, fcs.getAdded().size());\n assertEquals(\"content of ADDED correct\", added, fcs.getAdded());\n assertEquals(\"size of MODIFIED correct\", 1, fcs.getModified().size());\n assertEquals(\"content of MODIFIED correct\", modified, fcs.getModified());\n assertEquals(\"size of DELETED correct\", 0, fcs.getDeleted().size());\n assertEquals(\"size of TARGET FILE DELETED correct\", 0, fcs.getTargetDeleted().size());\n assertEquals(\"size of TARGET FILE ADDED correct\", 0, fcs.getTargetAdded().size());\n\n fcs.fileDeleted(\"file-3.html\");\n\n assertEquals(\"size of ADDED correct\", 1, fcs.getAdded().size());\n assertEquals(\"content of ADDED correct\", added, fcs.getAdded());\n assertEquals(\"size of MODIFIED correct\", 1, fcs.getModified().size());\n assertEquals(\"content of MODIFIED correct\", modified, fcs.getModified());\n assertEquals(\"size of DELETED correct\", 1, fcs.getDeleted().size());\n assertEquals(\"content of DELETED correct\", deleted, fcs.getDeleted());\n assertEquals(\"size of TARGET FILE DELETED correct\", 0, fcs.getTargetDeleted().size());\n assertEquals(\"size of TARGET FILE ADDED correct\", 0, fcs.getTargetAdded().size());\n\n fcs.targetFileDeleted(\"file-4.html\");\n\n assertEquals(\"size of ADDED correct\", 1, fcs.getAdded().size());\n assertEquals(\"content of ADDED correct\", added, fcs.getAdded());\n assertEquals(\"size of MODIFIED correct\", 1, fcs.getModified().size());\n assertEquals(\"content of MODIFIED correct\", modified, fcs.getModified());\n assertEquals(\"size of DELETED correct\", 1, fcs.getDeleted().size());\n assertEquals(\"content of DELETED correct\", deleted, fcs.getDeleted());\n assertEquals(\"size of TARGET FILE DELETED correct\", 1, fcs.getTargetDeleted().size());\n assertEquals(\"content of TARGET FILE DELETED correct\", targetDeleted, fcs.getTargetDeleted());\n assertEquals(\"size of TARGET FILE ADDED correct\", 0, fcs.getTargetAdded().size());\n\n fcs.targetFileAdded(\"file-5.html\");\n assertEquals(\"size of ADDED correct\", 1, fcs.getAdded().size());\n assertEquals(\"content of ADDED correct\", added, fcs.getAdded());\n assertEquals(\"size of MODIFIED correct\", 1, fcs.getModified().size());\n assertEquals(\"content of MODIFIED correct\", modified, fcs.getModified());\n assertEquals(\"size of DELETED correct\", 1, fcs.getDeleted().size());\n assertEquals(\"content of DELETED correct\", deleted, fcs.getDeleted());\n assertEquals(\"size of TARGET FILE DELETED correct\", 1, fcs.getTargetDeleted().size());\n assertEquals(\"content of TARGET FILE DELETED correct\", targetDeleted, fcs.getTargetDeleted());\n assertEquals(\"size of TARGET FILE ADDED correct\", 1, fcs.getTargetAdded().size());\n assertEquals(\"content of TARGET FILE ADDED correct\", targetAdded, fcs.getTargetAdded());\n\n }", "@Test(timeout = 30_000)\n public void setAndWait(TestContext should) {\n final int runs = 10;\n final Async test = should.async(runs);\n\n Redis.createClient(rule.vertx(), options).connect().onComplete(should.asyncAssertSuccess(cluster -> {\n for (int i = 0; i < runs; i++) {\n cluster.send(cmd(SET).arg(\"key\").arg(\"value\")).onComplete(should.asyncAssertSuccess(setResponse -> {\n should.assertEquals(\"OK\", setResponse.toString().toUpperCase());\n\n cluster.send(cmd(WAIT).arg(1).arg(2000)).onComplete(should.asyncAssertSuccess(waitResponse -> {\n should.assertEquals(1, waitResponse.toInteger());\n test.countDown();\n }));\n }));\n }\n }\n ));\n }", "@Test\n public void searchTrueTest() {\n assertThat(4, is(this.queue.search(\"work4\")));\n assertThat(1, is(this.queue.search(\"work1\")));\n }", "@Converted(kind = Converted.Kind.AUTO,\n source = \"${LLVM_SRC}/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp\", line = 1791,\n FQN=\"clang::CodeGen::CodeGenFunction::EmitAtomicCompareExchange\", NM=\"_ZN5clang7CodeGen15CodeGenFunction25EmitAtomicCompareExchangeENS0_6LValueENS0_6RValueES3_NS_14SourceLocationEN4llvm14AtomicOrderingES6_bNS0_12AggValueSlotE\",\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/CGAtomic.cpp -nm=_ZN5clang7CodeGen15CodeGenFunction25EmitAtomicCompareExchangeENS0_6LValueENS0_6RValueES3_NS_14SourceLocationEN4llvm14AtomicOrderingES6_bNS0_12AggValueSlotE\")\n//</editor-fold>\npublic final std.pair<RValue, Value /*P*/ > EmitAtomicCompareExchange(LValue Obj, RValue Expected, RValue Desired, SourceLocation Loc) {\n return EmitAtomicCompareExchange(Obj, Expected, Desired, Loc, \n AtomicOrdering.SequentiallyConsistent, AtomicOrdering.SequentiallyConsistent, false, \n AggValueSlot.ignored());\n}", "private void toggleMultiple(final Set<Long> selectedSet, final MultiToggleHelper helper) {\n final Cursor c = mListAdapter.getCursor();\n if (c == null || c.isClosed()) {\n return;\n }\n\n final HashMap<Long, Boolean> setValues = Maps.newHashMap();\n boolean allWereSet = true;\n\n c.moveToPosition(-1);\n while (c.moveToNext()) {\n long id = c.getInt(MessagesAdapter.COLUMN_ID);\n if (selectedSet.contains(id)) {\n boolean value = helper.getField(c);\n setValues.put(id, value);\n allWereSet = allWereSet && value;\n }\n }\n\n if (!setValues.isEmpty()) {\n final boolean newValue = !allWereSet;\n c.moveToPosition(-1);\n // TODO: we should probably put up a dialog or some other progress indicator for this.\n EmailAsyncTask.runAsyncParallel(new Runnable() {\n @Override\n public void run() {\n for (long id : setValues.keySet()) {\n if (setValues.get(id) != newValue) {\n helper.setField(id, newValue);\n }\n }\n }});\n }\n }", "public boolean compareTo(int index, int value){\n return list.get(index)==value;\n }", "private void startComparison(boolean[] selected) throws Exception {\n\n if (showArray) {\n System.out.println(\"target array: \" + Arrays.toString(intSelect.getArray()) + \"\\n\");\n }\n\n\n if (selected[0] == true) {\n timedSort(mergeSort);\n }\n if (selected[1] == true) {\n timedSort(quickSort);\n }\n if (selected[2] == true) {\n timedSort(heapSort);\n }\n\n }", "private void advanceCommitIndex() {\n // 获取quorum matchIndex\n int peerNum = configuration.getServersList().size();\n long[] matchIndexes = new long[peerNum];\n int i = 0;\n for (RaftProto.Server server : configuration.getServersList()) {\n if (server.getServerId() != localServer.getServerId()) {\n Peer peer = peerMap.get(server.getServerId());\n matchIndexes[i++] = peer.getMatchIndex();\n }\n }\n matchIndexes[i] = raftLog.getLastLogIndex();\n Arrays.sort(matchIndexes);\n long newCommitIndex = matchIndexes[peerNum / 2];\n LOG.debug(\"newCommitIndex={}, oldCommitIndex={}\", newCommitIndex, commitIndex);\n if (raftLog.getEntryTerm(newCommitIndex) != currentTerm) {\n LOG.debug(\"newCommitIndexTerm={}, currentTerm={}\",\n raftLog.getEntryTerm(newCommitIndex), currentTerm);\n return;\n }\n\n if (commitIndex >= newCommitIndex) {\n return;\n }\n long oldCommitIndex = commitIndex;\n commitIndex = newCommitIndex;\n raftLog.updateMetaData(currentTerm, null, raftLog.getFirstLogIndex(), commitIndex);\n // 同步到状态机\n for (long index = oldCommitIndex + 1; index <= newCommitIndex; index++) {\n RaftProto.LogEntry entry = raftLog.getEntry(index);\n if (entry.getType() == RaftProto.EntryType.ENTRY_TYPE_DATA) {\n stateMachine.apply(entry.getData().toByteArray());\n } else if (entry.getType() == RaftProto.EntryType.ENTRY_TYPE_CONFIGURATION) {\n applyConfiguration(entry);\n }\n }\n lastAppliedIndex = commitIndex;\n LOG.debug(\"commitIndex={} lastAppliedIndex={}\", commitIndex, lastAppliedIndex);\n commitIndexCondition.signalAll();\n }", "public Vector<T> set(int aIndex, T aValue);", "void set(int i, int val) {\n int numPosition = i / MAX_BITS;\n int intPosition = i % MAX_BITS;\n\n if (val == 1)\n values[numPosition] |= (1 << intPosition);\n else\n values[numPosition] = values[numPosition]&~(1 << intPosition);\n }", "@Test\n public void testSetIndex() {\n System.out.println(\"setIndex\");\n ArrayList<IndexKey> index = null;\n Data instance = null;\n instance.setIndex(index);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public LinkedHashSet<Integer> getCasesMatchingIndex(String indexName, String targetValue) {\n String[] args = new String[]{indexName, targetValue};\n if (SqlStorage.STORAGE_OUTPUT_DEBUG) {\n String query = String.format(\"SELECT %s FROM %s WHERE %s = ? AND %s = ?\", COL_CASE_RECORD_ID, TABLE_NAME, COL_INDEX_NAME, COL_INDEX_TARGET);\n DbUtil.explainSql(db, query, args);\n }\n Cursor c = db.query(TABLE_NAME, new String[]{COL_CASE_RECORD_ID}, COL_INDEX_NAME + \" = ? AND \" + COL_INDEX_TARGET + \" = ?\", args, null, null, null);\n LinkedHashSet<Integer> ret = new LinkedHashSet<>();\n SqlStorage.fillIdWindow(c, COL_CASE_RECORD_ID, ret);\n return ret;\n }", "public Mark(Integer markToSet, int nextState) {\r\n assert markToSet >= 0 && markToSet < 6;\r\n assert nextState >= 0 && nextState < 10000;\r\n this.nextState = nextState;\r\n this.markToSet = markToSet;\r\n }", "String setDone(int index);", "public void testCompare() {\n \n ExcitedIndex<Integer> t1 = null;\n ExcitedIndex<Integer> t2 = null;\n ExcitedIndexStrengthComparator instance = new ExcitedIndexStrengthComparator();\n \n int expResult = 0;\n int result = instance.compare(t1, t2);\n assertEquals(expResult, result);\n \n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "@Override\n public Date set(final int index, final Date value) {\n final long date = value.getTime();\n final Date previous = get(index);\n switch (index) {\n case 0: date1 = date; break;\n case 1: date2 = date; break;\n }\n modCount++;\n return previous;\n }", "public void search(IndexShort < O > index, short range, short k)\n throws Exception {\n // assertEquals(index.aDB.count(), index.bDB.count());\n // assertEquals(index.aDB.count(), index.bDB.count());\n // index.stats();\n index.resetStats();\n // it is time to Search\n int querySize = 1000; // amount of elements to read from the query\n String re = null;\n logger.info(\"Matching begins...\");\n File query = new File(testProperties.getProperty(\"test.query.input\"));\n File dbFolder = new File(testProperties.getProperty(\"test.db.path\"));\n BufferedReader r = new BufferedReader(new FileReader(query));\n List < OBPriorityQueueShort < O >> result = new LinkedList < OBPriorityQueueShort < O >>();\n re = r.readLine();\n int i = 0;\n long realIndex = index.databaseSize();\n\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n OBPriorityQueueShort < O > x = new OBPriorityQueueShort < O >(\n k);\n if (i % 100 == 0) {\n logger.info(\"Matching \" + i);\n }\n\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n if(i == 279){\n System.out.println(\"hey\");\n }\n index.searchOB(s, range, x);\n result.add(x);\n i++;\n }\n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n \n logger.info(index.getStats().toString());\n \n int maxQuery = i;\n // logger.info(\"Matching ends... Stats follow:\");\n // index.stats();\n\n // now we compare the results we got with the sequential search\n Iterator < OBPriorityQueueShort < O >> it = result.iterator();\n r.close();\n r = new BufferedReader(new FileReader(query));\n re = r.readLine();\n i = 0;\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n if (i % 300 == 0) {\n logger.info(\"Matching \" + i + \" of \" + maxQuery);\n }\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n OBPriorityQueueShort < O > x2 = new OBPriorityQueueShort < O >(\n k);\n searchSequential(realIndex, s, x2, index, range);\n OBPriorityQueueShort < O > x1 = it.next();\n //assertEquals(\"Error in query line: \" + i + \" slice: \"\n // + line, x2, x1); \n \n assertEquals(\"Error in query line: \" + i + \" \" + index.debug(s) + \"\\n slice: \"\n + line + \" \" + debug(x2,index ) + \"\\n\" + debug(x1,index), x2, x1);\n\n i++;\n }\n \n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n r.close();\n logger.info(\"Finished matching validation.\");\n assertFalse(it.hasNext());\n }", "@Test\n void _correctIfCaseTest() {\n\n actionApply();\n\n for (ReceiverPair receiverPair : dependedReceiverPairs) {\n for (AssingablePair assingablePair : incompatibleAssignablePairs) {\n verify(model).arithm(receiverPair.getVariableReceiver(), \"=\", assingablePair.getIndexAssignable());\n }\n }\n }", "public void testPersistence() {\n ImmutableSet<Integer> set = new ImmutableSet();\n for (int i = -50; i < 51; i++) {\n set.add(i);\n assertTrue(set.current != set.pastVersions.get(set.pastVersions.size()-1));\n }\n for(int i = -50; i < 51; i++) {\n set.remove(i);\n assertTrue(set.current != set.pastVersions.get(set.pastVersions.size()-1));\n }\n }", "@Test\n public void testSet_After_Next() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2, 6, 8));\n\n ListIterator<Integer> instance = baseList.listIterator();\n instance.next();\n instance.next();\n\n instance.set(9);\n int expResult = 1;\n\n assertEquals(expResult, baseList.indexOf(9));\n }", "@Override\n\tpublic void setEvaluator(int index, FitnessEvaluator<? super BitString> evaluator) {\n\t\t\n\t}", "@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public boolean casWaiters(AbstractFuture<?> future, Waiter expect, Waiter update) {\n return UNSAFE.compareAndSwapObject(future, WAITERS_OFFSET, expect, update);\n }", "@Test\n void _correctThenCaseTest() {\n\n actionApply();\n\n for (ReceiverPair receiverPair : dependedReceiverPairs) {\n for (AssingablePair assingablePair : incompatibleAssignablePairs) {\n verify(model).arithm(receiverPair.getVariableDependentReceiver(), \"!=\", assingablePair.getIndexdependentAssignable());\n }\n }\n }", "boolean updateValue() {\n boolean ret;\n\n if (Math.abs(curUtilityValue - nextUtilityValue) < Math.abs(curUtilityValue) * MAX_ERR_PERCENT / 100)\n ret = true;\n else {\n ret = false;\n // System.out.println(\" no match cell: x: \"+x+\" y: \"+y);\n }\n curUtilityValue = nextUtilityValue;\n return ret;\n\n }", "@Test\n public void iterateTestsSame() throws Exception {\n final int nThreads = 100;\n ExecutorService executor = Executors.newFixedThreadPool(nThreads);\n final AtomicReference<Throwable> ex = new AtomicReference<>(null);\n final int nTasks = 10_000;\n final CountDownLatch latch = new CountDownLatch(nTasks);\n final ConcurrentHashMap<Integer, String> map = new ConcurrentHashMap<>();\n for (int i = 0; i < nTasks; i++) {\n final int j = i;\n executor.submit(new Runnable() {\n public void run() {\n try {\n map.put(j, \"foo\");\n testSubmitSilentWithParamMutationSameCommand(new Consumer<String>() {\n @Override\n public void accept(String s) {\n map.remove(j);\n if (\"FAIL\".equals(s)) {\n ex.compareAndSet(null, new Exception(\"WE HAD AN ERROR in \" + j));\n }\n }\n }\n );\n } catch (Throwable t) {\n ex.compareAndSet(null, t);\n } finally {\n latch.countDown();\n }\n }});\n }\n System.out.println(\"Waiting on latch\");\n while (!latch.await(30, TimeUnit.SECONDS)) {\n System.out.println(\"Waiting, \" + latch.getCount() + \" outstanding\");\n System.out.println(\"Waiting keys \" + map.keySet().size());\n }\n executor.shutdown();\n System.out.println(\"Waiting, on executor\");\n executor.awaitTermination(30, TimeUnit.SECONDS);\n executor.shutdownNow();\n if (ex.get() != null) {\n // If this fails, there has been at least one error.\n Assert.assertNull(ex.get());\n }\n }", "@Test\n\tpublic void testListsAndSets() throws Exception {\n\t\ttestWith(TestClassListAndSet.getInstance());\n\t}", "@Override\n public VectorEquality compareTo(PredicateVector vectorCmp) {\n try {\n PredicateVector vectorLarge;\n PredicateVector vectorSmall;\n VectorEquality cmpResult;\n \n if (flagged || vectorCmp.flagged) {\n return VectorEquality.UNIQUE;\n }\n \n // TODO: add size check\n \n if (this.size() > vectorCmp.size() && !this.values().iterator().next().isEmpty()) {\n vectorLarge = this;\n vectorSmall = vectorCmp;\n cmpResult = VectorEquality.SUPERSET;\n } else {\n vectorLarge = vectorCmp;\n vectorSmall = this;\n cmpResult = VectorEquality.SUBSET;\n }\n \n int largeVectorIter = 0;\n int numEq = 0;\n \n List<Integer> vectorSmallKeys = new ArrayList<Integer>(vectorSmall.keySet());\n Collections.sort(vectorSmallKeys);\n \n List<Integer> vectorLargeKeys = new ArrayList<Integer>(vectorLarge.keySet());\n Collections.sort(vectorLargeKeys);\n\n int i = 0;\n\n for (Integer smallVectorKey: vectorSmallKeys) {\n StateVector smallVectorState = vectorSmall.get(smallVectorKey);\n // Check if we have not iterated over all large vector states\n if (largeVectorIter >= vectorLargeKeys.size() && !smallVectorState.isEmpty()) {\n cmpResult = VectorEquality.UNIQUE;\n break;\n }\n \n \n for (i = largeVectorIter; i < vectorLargeKeys.size(); i++) {\n StateVector largeVectorState = vectorLarge.get(vectorLargeKeys.get(i));\n VectorEquality cmpVectorResult = smallVectorState.compareTo(largeVectorState); \n if (cmpVectorResult == VectorEquality.EQUAL) {\n numEq += 1;\n break;\n }\n \n if (cmpVectorResult == VectorEquality.SUPERSET || cmpVectorResult == VectorEquality.SUBSET) {\n cmpResult = cmpVectorResult;\n numEq += 1;\n break;\n }\n }\n \n largeVectorIter = i + 1; // TODO: double check i+1\n }\n \n if (numEq < vectorSmall.size() && !vectorSmall.values().iterator().next().isEmpty())\n cmpResult = VectorEquality.UNIQUE;\n \n return cmpResult;\n } catch (ArrayIndexOutOfBoundsException e) {\n e.printStackTrace();\n }\n \n return VectorEquality.UNIQUE;\n }" ]
[ "0.6289065", "0.6200574", "0.6086619", "0.5529543", "0.5473795", "0.5430196", "0.53573066", "0.53500134", "0.5307873", "0.5224334", "0.5207857", "0.5182413", "0.51589847", "0.51388305", "0.5093257", "0.5071201", "0.5032854", "0.4969496", "0.49636295", "0.49198663", "0.49163607", "0.4906843", "0.48382086", "0.48228878", "0.47978622", "0.4797354", "0.47883227", "0.47722584", "0.47616744", "0.4745675", "0.47448677", "0.4733523", "0.4721962", "0.4717241", "0.4716089", "0.47058815", "0.4699702", "0.4695602", "0.46896663", "0.4688274", "0.46841326", "0.46627334", "0.46469092", "0.4646549", "0.46460488", "0.46416333", "0.4639683", "0.4638661", "0.4632854", "0.4628369", "0.46183798", "0.4596571", "0.45914894", "0.4585562", "0.45698076", "0.45545322", "0.45538893", "0.4552287", "0.45482457", "0.45422697", "0.45417586", "0.45355663", "0.45293173", "0.45269403", "0.45256805", "0.4523733", "0.45171887", "0.45155156", "0.4487862", "0.4485189", "0.448367", "0.44822478", "0.44760785", "0.44712925", "0.44699734", "0.44696346", "0.44525397", "0.4448772", "0.44416007", "0.4436789", "0.44314533", "0.44313022", "0.44308403", "0.4429051", "0.44280866", "0.44236273", "0.4417807", "0.44176388", "0.4402112", "0.44006345", "0.43982112", "0.43878838", "0.4387406", "0.4382684", "0.43823117", "0.43808025", "0.43669143", "0.43640208", "0.43636858", "0.43513262" ]
0.58872634
3
Performs kcompareandset at indices i. 1. Convert expected values to marked values. 2. Convert target value to marked value. 3. Perform KCSS.
public boolean compareAndSet (int[] i, long[] e, long y) { int I = i.length; // 1 long[] x = new long[I]; // 1 for (int o=0; o<I; o++) // 1 x[o] = newValue(e[o]); // 1 return kcss(i, x, newValue(y)); // 2, 3 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void testDifferentKValues()\r\n\t{\r\n\t\tLinkedHashMap<Integer, LinkedHashMap<Integer, Double>> energies;\r\n\r\n\t\tif (isEType) {\r\n\t\t\tenergies = ENERGIES_E;\r\n\t\t} else {\r\n\t\t\tenergies = ENERGIES_A;\r\n\t\t}\r\n\r\n\t\tfor (Map.Entry<Integer, LinkedHashMap<Integer, Double>> entry : energies.entrySet()) {\r\n\t\t\t\r\n\t\t\titerationsGoneThrough++;\r\n\t\t\tint percent = (int) ((iterationsGoneThrough / numberOfKIterations) * 80 + 20);\r\n\t\t\tmultiThreadingObj.myPublish(\"msg Generating assignments: \" + percent + \"%\");\r\n\t\t\tmultiThreadingObj.myPublish(\"val \" + percent);\r\n\t\t\t\r\n\t\t\tcurrentK = entry.getKey();\r\n\t\t\tenergiesForCurrentK = entry.getValue();\r\n\t\t\t\r\n\t\t\ttestDifferentJRangesForConstantK();\r\n\t\t}\r\n\t}", "private boolean kcss(int[] i, long[] e, long y) {\n int I = i.length;\n long[] x = new long[I];\n while (true) {\n x[0] = ll(i[0]); // 1\n snapshot(i, 1, I, x); // 2\n if (Arrays.compare(x, e) != 0) { // 3\n sc(i[0], x[0]); // 3a\n return false; // 3a\n }\n if (sc(i[0], y)) return true; // 3b\n } // 3c\n }", "private void testDifferentJRangesForConstantK()\r\n\t{\r\n\t\tint minJ = energiesForCurrentK.entrySet().iterator().next().getKey();\r\n\t\tint maxJ = 0;\r\n\r\n\t\tfor (Map.Entry<Integer, Double> entry : energiesForCurrentK.entrySet()) {\r\n\t\t\tmaxJ = entry.getKey();\r\n\t\t}\r\n\r\n\t\tint shiftsOfJPossible = (maxJ - minJ) + inputBranchArray.size() - 1;\r\n\r\n\t\tfor (int i = 0; i < shiftsOfJPossible; i++) {\r\n\t\t\tresetArraysAndHeader();\r\n\t\t\tsetHeaderDisplayState(false);\r\n\t\t\tlowestJValue = maxJ - i;\r\n\t\t\thighestJValue = lowestJValue + inputBranchArray.size() - 1;\r\n\t\t\tassignJValuesToInputBranch();\r\n\t\t\tpublishResults();\r\n\t\t}\r\n\t}", "public void compareWithinClusters() {\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tfor (Cluster cluster : clusterList) {\n\t\t\tList<Document> docList = documentDao.getDocListByClusterId(cluster.getId());\n\t\t\tint size = docList.size();\n\t\t\t\n\t\t\tdouble[][] matrix = new double[size][size];\n\t\t\t\n\t\t\tfor(int i =0; i<size; i++){\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (size > 1) {\n\t\t\t\t//List<Document> docList2 = docList1;\n\t\t\t\tfor (int i=0; i<size; i++){\n\t\t\t\t\tfor(int j=i+1; j<size; j++){\n\t\t\t\t\t\t//match docs docList.get(i) & docList.get(j)\n\t\t\t\t\t\tMap<String, Double> map = datumboxCaller.compareDocs(docList.get(i).getDocName(), docList.get(j).getDocName());\n\t\t\t\t\t\tmatrix[i][j] = map.get(\"Oliver\");\n\t\t\t\t\t\tmatrix[j][i] = map.get(\"Shingle\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//persist both metrics in a file \n\t\t\tpersist(matrix, cluster, docList);\n\t\t\t\n\t\t\t//printing the matrix\n\t\t\tSystem.out.println(\"\\nDocument Similarity Matrix for Cluster \"+cluster.getId());\n\t\t\tSystem.out.println(\"\\nOliver Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.println(docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nShingle Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.print(\"\\n\"+docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//print ends\n\t\t\t\n\t\t}\n\n\t}", "private static void kmeans(int[] rgb, int k) {\n\t\tColor[] rgbColor = new Color[rgb.length];\r\n\t\tColor[] ColorCluster = new Color[rgb.length];\r\n\t\tint[] ColorClusterID = new int[rgb.length];\r\n\t\t\r\n\t\tfor(int i = 0;i<rgb.length;i++) {\r\n\t\t\trgbColor[i] = new Color(rgb[i]);\r\n\t\t\tColorClusterID[i] = -1;\r\n\t\t}\r\n\t\t\r\n\t\tColor[] currentCluster = new Color[k];\t\t\r\n\t\tint randomNumber[]= ThreadLocalRandom.current().ints(0, rgb.length).distinct().limit(k).toArray();\r\n\t\tColor[] modifiedColorCluster = new Color[k];\t\r\n\t\t\r\n\t\tfor(int j=0;j<k;j++) {\r\n\t\t\tcurrentCluster[j]=rgbColor[randomNumber[j]];\r\n\t\t}\r\n\t\tint flag = 1;\r\n\t\tint maxIterations = 1000;\r\n\t\tint numIteration=0;\r\n\t\tdouble[] distance = new double[maxIterations+1];\t\t\r\n\t\tdistance[0]=Double.MAX_VALUE;\r\n\t\twhile(flag == 1) {\r\n\t\t\tflag = 0;\r\n\t\t\tnumIteration++;\r\n\t\t\tdistance[numIteration]=assignCLustersToPixels(rgbColor,currentCluster,ColorCluster,ColorClusterID,k,rgb.length);\r\n\t\t\tmodifiedColorCluster= findMeans(rgbColor,ColorClusterID,modifiedColorCluster,k,rgb.length);\r\n\t\t\tif(!clusterCenterCheck(currentCluster, modifiedColorCluster,k)){\r\n\t\t\t\tflag = 1;\r\n\t\t\t\tfor(int j=0;j<k;j++) {\r\n\t\t\t\t\tcurrentCluster[j]=modifiedColorCluster[j];}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tfor(int i = 0;i<rgb.length;i++) {\r\n\t\t\trgb[i]= getValue(ColorCluster[i].getRed(),ColorCluster[i].getGreen(),ColorCluster[i].getBlue());\r\n\t\t}\r\n\t\treturn;\r\n\t }", "public void doValidation(int currentRound)\n {\n getData(currentRound);\n// System.out.println(\"training unterminated ones\");\n kMeans.setItems(trainingData.get(0));\n kMeans.k=k1;\n kMeans.init();\n List<Cluster> unterminatedClusters=kMeans.doCluster();\n for (int i=0;i<unterminatedClusters.size();i++)\n {\n unterminatedClusters.get(i).label=0;\n }\n \n// System.out.println(\"training terminated ones\");\n kMeans.setItems(trainingData.get(1));\n kMeans.k=k2;\n kMeans.init();\n List<Cluster> terminatedClusters=kMeans.doCluster();\n for (int i=0;i<terminatedClusters.size();i++)\n {\n terminatedClusters.get(i).label=1;\n }\n \n List<Cluster> clusters=new ArrayList<Cluster>();\n clusters.addAll(unterminatedClusters);\n clusters.addAll(terminatedClusters);\n kMeans.setClusters(clusters);\n int[] corrects=new int[2];\n int[] counts=new int[2];\n for (int i=0;i<2;i++)\n {\n corrects[i]=0;\n counts[i]=0;\n }\n for (Item item:testData)\n {\n int label=kMeans.getNearestCluster(item).label;\n counts[label]++;\n if (label==item.type)\n {\n corrects[item.type]++;\n }\n }\n correctness+=corrects[1]*1.0/counts[1];\n correctCount+=corrects[1];\n// for (int i=0;i<2;i++)\n// System.out.println(\"for type \"+i+\": \" +corrects[i]+\" correct out of \"+counts[i]+\" in total (\"+corrects[i]*1.0/counts[i]+\")\");\n }", "void unionTreeCoreset(int k,int n_1,int n_2,int d, Point[] setA,Point[] setB, Point[] centres, MTRandom clustererRandom) {\n\t\t//printf(\"Computing coreset...\\n\");\n\t\t//total number of points\n\t\tint n = n_1+n_2;\n\n\t\t//choose the first centre (each point has the same probability of being choosen)\n\t\t\n\t\t//stores, how many centres have been choosen yet\n\t\tint choosenPoints = 0; \n\t\t\n\t\t//only choose from the n-i points not already choosen\n\t\tint j = clustererRandom.nextInt(n-choosenPoints); \n\n\t\t//copy the choosen point\n\t\tif(j < n_1){\n\t\t\t//copyPointWithoutInit(&setA[j],&centres[choosenPoints]);\n\t\t\tcentres[choosenPoints] = setA[j].clone();\n\t\t} else {\n\t\t\tj = j - n_1;\n\t\t\t//copyPointWithoutInit(&setB[j],&centres[choosenPoints]);\n\t\t\tcentres[choosenPoints] = setB[j].clone();\n\t\t}\n\t\ttreeNode root = new treeNode(setA,setB,n_1,n_2, centres[choosenPoints],choosenPoints); //??\n\t\tchoosenPoints = 1;\n\t\t\n\t\t//choose the remaining points\n\t\twhile(choosenPoints < k){\n\t\t\tif(root.cost > 0.0){\n\t\t\t\ttreeNode leaf = selectNode(root, clustererRandom);\n\t\t\t\tPoint centre = chooseCentre(leaf, clustererRandom);\n\t\t\t\tsplit(leaf,centre,choosenPoints);\n\t\t\t\t//copyPointWithoutInit(centre,&centres[choosenPoints]);\n\t\t\t\tcentres[choosenPoints] = centre;\n\t\t\t} else {\n\t\t\t\t//create a dummy point\n\t\t\t\t//copyPointWithoutInit(root.centre,&centres[choosenPoints]);\n\t\t\t\tcentres[choosenPoints] = root.centre;\n\t\t\t\tint l;\n\t\t\t\tfor(l=0;l<root.centre.dimension;l++){\n\t\t\t\t\tcentres[choosenPoints].coordinates[l] = -1 * 1000000;\n\t\t\t\t}\n\t\t\t\tcentres[choosenPoints].id = -1;\n\t\t\t\tcentres[choosenPoints].weight = 0.0;\n\t\t\t\tcentres[choosenPoints].squareSum = 0.0;\n\t\t\t}\n\t\t\t\n\t\t\tchoosenPoints++;\n\t\t}\n\n\t\t//free the tree\n\t\tfreeTree(root);\n\n\t\t//recalculate clustering features\n\t\tint i;\n\t\tfor(i=0;i<n;i++){\n\t\t\t\t\n\t\t\tif(i < n_1) {\n\t\t\t\t\n\t\t\t\tint index = setA[i].centreIndex;\n\t\t\t\tif(centres[index].id != setA[i].id){\n\t\t\t\t\tcentres[index].weight += setA[i].weight;\n\t\t\t\t\tcentres[index].squareSum += setA[i].squareSum;\n\t\t\t\t\tint l;\n\t\t\t\t\tfor(l=0;l<centres[index].dimension;l++){\n\t\t\t\t\t\tif(setA[i].weight != 0.0){\n\t\t\t\t\t\t\tcentres[index].coordinates[l] += setA[i].coordinates[l];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tint index = setB[i-n_1].centreIndex;\n\t\t\t\tif(centres[index].id != setB[i-n_1].id){\n\t\t\t\t\tcentres[index].weight += setB[i-n_1].weight;\n\t\t\t\t\tcentres[index].squareSum += setB[i-n_1].squareSum;\n\t\t\t\t\tint l;\n\t\t\t\t\tfor(l=0;l<centres[index].dimension;l++){\n\t\t\t\t\t\tif(setB[i-n_1].weight != 0.0){\n\t\t\t\t\t\t\tcentres[index].coordinates[l] += setB[i-n_1].coordinates[l];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args){\n\t\t\n\t\tLabelSet cLabelSet=new LabelSet();\n\t\tLabelSet tLabelSet=new LabelSet();\n\t\t\n\t\tList<Label> cLabels=new ArrayList<Label>();\n\t\tList<Label> tLabels=new ArrayList<Label>();\n\t\t\n\t\tcLabels.add(cLabelSet.newLabel(\"1\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"1\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"1\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"1\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"1\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"1\"));tLabels.add(tLabelSet.newLabel(\"o\"));\n\t\t\n\t\tcLabels.add(cLabelSet.newLabel(\"2\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"2\"));tLabels.add(tLabelSet.newLabel(\"o\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"2\"));tLabels.add(tLabelSet.newLabel(\"o\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"2\"));tLabels.add(tLabelSet.newLabel(\"o\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"2\"));tLabels.add(tLabelSet.newLabel(\"o\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"2\"));tLabels.add(tLabelSet.newLabel(\"d\"));\n\t\t\n\t\tcLabels.add(cLabelSet.newLabel(\"3\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"3\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"3\"));tLabels.add(tLabelSet.newLabel(\"d\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"3\"));tLabels.add(tLabelSet.newLabel(\"d\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"3\"));tLabels.add(tLabelSet.newLabel(\"d\"));\n\t\t\n\t\tExternalCQM m=new RI();\n\t\t\n\t\tSystem.out.println(m.getClass().getSimpleName()+\": \"+FormatUtil.d4(m.measure(cLabels,tLabels)));\n\t\t\n\t}", "public static void classfy(ArrayList<ArrayList<String>> dataset ,ArrayList<ArrayList<String>> testData,int k) {\n\t\tint index = 0;\r\n\t\tint count = 0;\r\n\t\tfor (ArrayList<String> testItem : testData) {\r\n\t\t\tString str=getFeatureLabel(dataset, testItem, k);\r\n\t\t\tSystem.out.println(str);\r\n\t\t\tif (testItem.get((testData.get(0).size()-1)).equals(str)) {\r\n\t\t\t\tSystem.out.println(\"testItem\"+index+\"分类正确\");\r\n\t\t\t\tcount ++;\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"testItem\"+index+\"分类错误\");\r\n\t\t\t}\r\n\t\t\tindex ++;\r\n\t\t}\r\n\t\tSystem.out.println(\"正确率为\"+count*1.0/testData.size());\r\n\t}", "private void partitionImpl(Collection<S> vocab, HashMap<Dimension<T>, MutableDouble> center) {\n double firstVal = Double.POSITIVE_INFINITY;\n double secondVal = Double.POSITIVE_INFINITY;\n S firstWord = null;\n S secondWord = null;\n\n LinkedList<S> cluster1 = new LinkedList<S>();\n LinkedList<S> cluster2 = new LinkedList<S>();\n HashMap<Dimension<T>, MutableDouble> newCenter1 = null;\n HashMap<Dimension<T>, MutableDouble> newCenter2 = null;\n\n if (vocab.size() > 2) {\n for (S word : vocab) {\n double dist = distanceToCenter(word, center);\n if (dist < secondVal) {\n if (dist < firstVal) {\n secondVal = firstVal;\n secondWord = firstWord;\n firstVal = dist;\n firstWord = word;\n } else {\n secondVal = dist;\n secondWord = word;\n }\n }\n }\n if (distance(firstWord, secondWord) <= 0.0) {\n System.out.printf(\"zero distance between '%s' and '%s'\\n\", firstWord, secondWord);\n // pick an arbitrary second word\n for (S word : vocab) {\n if (word.equals(firstWord) || word.equals(secondWord)) {\n continue;\n }\n if (distance(firstWord, word) > 0.0) {\n secondWord = word;\n break;\n }\n }\n System.out.printf(\"selected '%s' and '%s'\\n\", firstWord, secondWord);\n }\n\n HashMap<Dimension<T>, MutableDouble> center1 = wordToVector(firstWord);\n HashMap<Dimension<T>, MutableDouble> center2 = wordToVector(secondWord);\n for (S word : vocab) {\n double dist1 = distanceToCenter(word, center1);\n double dist2 = distanceToCenter(word, center2);\n if (dist1 < dist2) {\n cluster1.add(word);\n } else {\n cluster2.add(word);\n }\n }\n\n int changed = 1;\n int iteration = 0;\n while (++iteration <= MAX_ITERATIONS && changed > 0) {\n System.out.printf(\"Iteration %d/%d\\n\", iteration, MAX_ITERATIONS);\n changed = 0;\n newCenter1 = getCenter(cluster1);\n newCenter2 = getCenter(cluster2);\n\n LinkedList<S> tmpCluster1 = new LinkedList<S>();\n LinkedList<S> tmpCluster2 = new LinkedList<S>();\n\n for (ListIterator<S> it = cluster1.listIterator(); it.hasNext();) {\n S word = it.next();\n double dist1 = distanceToCenter(word, newCenter1);\n double dist2 = distanceToCenter(word, newCenter2);\n if (dist1 <= dist2) {\n tmpCluster1.add(word);\n } else {\n tmpCluster2.add(word);\n changed++;\n System.out.printf(\"changing %s : %g > %g\\n\", word, dist1, dist2);\n }\n }\n\n for (ListIterator<S> it = cluster2.listIterator(); it.hasNext();) {\n S word = it.next();\n double dist1 = distanceToCenter(word, newCenter1);\n double dist2 = distanceToCenter(word, newCenter2);\n if (dist2 <= dist1) {\n tmpCluster2.add(word);\n } else {\n tmpCluster1.add(word);\n changed++;\n System.out.printf(\"changing %s : %g < %g\\n\", word, dist1, dist2);\n }\n }\n cluster1 = tmpCluster1;\n cluster2 = tmpCluster2;\n System.out.printf(\"changed: %d/%d\\n\", changed, vocab.size());\n if (cluster1.size() == 0 || cluster2.size() == 0) {\n LinkedList<S> cl = cluster1.size() == 0 ? cluster2 : cluster1;\n System.out.printf(\"Cannot split %s, split them randomly\\n\", cl.toString());\n tmpCluster1 = new LinkedList<S>();\n tmpCluster2 = new LinkedList<S>();\n boolean b = true;\n for (S word : cl) {\n if (b) {\n tmpCluster1.add(word);\n } else {\n tmpCluster2.add(word);\n }\n b = !b;\n }\n cluster1 = tmpCluster1;\n cluster2 = tmpCluster2;\n }\n }\n } else if (vocab.size() == 2) {\n Iterator<S> it = vocab.iterator();\n S word1 = it.next();\n S word2 = it.next();\n cluster1.add(word1);\n cluster2.add(word2);\n newCenter1 = wordToVector(word1);\n newCenter2 = wordToVector(word2);\n } else {\n return;\n }\n\n if (notifyNewCluster(vocab, cluster1, cluster2)) {\n partition(cluster1, newCenter1);\n partition(cluster2, newCenter2);\n }\n\n }", "public void outputResults(int K)\n {\n //collect all sets\n int region_counter=1;\n ArrayList<Pair<Integer>> sorted_regions = new ArrayList<Pair<Integer>>();\n\n int width = this.image.getWidth();\n int height = this.image.getHeight();\n for(int h=0; h<height; h++){\n for(int w=0; w<width; w++){\n int id=getID(new Pixel(w,h));\n int setid=ds.find(id);\n if(id!=setid) continue;\n sorted_regions.add(new Pair<Integer>(ds.get(setid).size(),setid));\n }//end for w\n }//end for h\n\n //sort the regions\n Collections.sort(sorted_regions, new Comparator<Pair<Integer>>(){\n @Override\n public int compare(Pair<Integer> a, Pair<Integer> b) {\n if(a.p!=b.p) return b.p-a.p;\n else return b.q-a.q;\n }\n });\n\n //recolor and output region info\n\t\t\n //Todo: Your code here (remove this line)\n //Hint: Use image.setRGB(x,y,c.getRGB()) to change the color of a pixel (x,y) to the given color \"c\"\n\n //save output image\n String out_filename = img_filename+\"_seg_\"+K+\".png\";\n try\n {\n File ouptut = new File(out_filename);\n ImageIO.write(this.image, \"png\", ouptut);\n System.err.println(\"- Saved result to \"+out_filename);\n }\n catch (Exception e) {\n System.err.println(\"! Error: Failed to save image to \"+out_filename);\n }\n }", "private void compareDetected() {\n\t\tMap<Integer, Integer> shiftFreq = new HashMap<Integer, Integer>();\n\t\tfor (WordOccurence wordOcc : originalFreq.values()) {\n\t\t\twordOcc.calculateDifferences();\n\t\t\tif (!wordOcc.isValuesSet()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (shiftFreq.containsKey(wordOcc.getPossibleShift())) {\n\t\t\t\tshiftFreq.put(wordOcc.getPossibleShift(),\n\t\t\t\t\t\tshiftFreq.get(wordOcc.getPossibleShift()) + 1);\n\t\t\t} else {\n\t\t\t\tshiftFreq.put(wordOcc.getPossibleShift(), 1);\n\t\t\t}\n\t\t}\n\t\tshift = getMaxValuedKey(shiftFreq);\n\t}", "public void ruleOutPos(){\n for(int i=0;i<scores.length;i++) {\n for(int j=0;j<scores[i].length;j++) {\n scores[i][j][13] = 0;//0=pass, >0 is fail, set to pass initially\n\n //check Ns - bit crude - what to discount regions with high N\n double ns = (double) scores[i][j][14] / (double) pLens[j];\n if (ns >= minPb | ns >= minPm)//\n scores[i][j][13] += 4;\n\n //probe\n if (hasProbe){\n if (j == 1 | j == 4) {\n double perc = (double) scores[i][j][0] / (double) primers[j].length();\n if (perc >= minPb) {\n scores[i][j][12] = 1;//flag for failed % test\n scores[i][j][13] += 2;\n }\n }\n }\n //primer\n else {\n //if more than 2 mismatches in 1-4nt at 3'\n if(scores[i][j][11]>max14nt) {\n scores[i][j][13]+=1;\n }\n //use mLen (combined F and R length) initially to find initial candidates - filter later\n double perc=(double)scores[i][j][0]/(double)mLen;\n double percI=(double)scores[i][j][0]/(double)pLens[j];\n\n if(perc>=minPm | percI>=minPmI) {\n scores[i][j][12]=1;//flag for failed % test\n scores[i][j][13]+=2;\n }\n }\n }\n }//end of finding positions that prime loop\n }", "public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new FileReader(\"art2.in\"));\n PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"art2.out\")));\n int len=Integer.parseInt(br.readLine());\n int[] list=new int[len];\n for(int i=0;i<len;i++)\n list[i]=Integer.parseInt(br.readLine());\n\n //finds the troll test case\n boolean symmetric=true;\n for(int i=0;i<len;i++)\n if(list[i]!=list[len-i-1]) {\n symmetric = false;\n break;\n }\n if(symmetric){\n pw.println(len/2);\n pw.close();\n return;\n }\n\n DisjointSet disjointSet=new DisjointSet(len,list);\n HashMap<Integer,Range> ranges=new HashMap<>(len/10);\n int totalColors=0;\n for(int i=0;i<len;i++){\n if(list[i]==0)\n continue;\n if(!ranges.containsKey(list[i])) {\n ranges.put(list[i],new Range(i, i));\n totalColors++;\n }\n else\n ranges.get(list[i]).end=i;\n }\n\n// System.out.println(Arrays.toString(ranges));\n int iter=0;\n int colorsUsed=0;\n// System.out.println(Arrays.toString(disjointSet.parent));\n while(true){\n int foundThisIter=0;\n HashSet<Integer> connectionSpots=new HashSet<>();\n ArrayDeque<Integer> toRemove=new ArrayDeque<>(ranges.size());\n for(int e:ranges.keySet()){\n Range cur=ranges.get(e);\n if(disjointSet.find(cur.start)==disjointSet.find(cur.end)){\n connectionSpots.add(cur.start);\n connectionSpots.add(cur.end);\n toRemove.add(e);\n colorsUsed++;\n foundThisIter++;\n }\n\n }\n\n if(foundThisIter==0)\n break;\n if(colorsUsed==totalColors)\n break;\n for(int e:toRemove){\n ranges.remove(e);\n }\n for(int e:connectionSpots){\n// System.out.println(e);\n if(e-1>=0&&list[e-1]!=0)\n disjointSet.union(e,e-1);\n if(e+1<list.length&&list[e+1]!=0)\n disjointSet.union(e,e+1);\n }\n\n\n iter++;\n }\n// System.out.println(iter+1);\n if(colorsUsed!=totalColors)\n pw.println(-1);\n else\n pw.println(iter+1);\n pw.close();\n }", "private void doBayesianClassification() {\n\t\tList<MutualInformation> mutualInformationList = new ArrayList<MutualInformation>();\r\n\t\tint k = 5;\r\n\t\tSystem.out.println(\"k = \" + k);\r\n\t\tdouble N = fileNames.size();\r\n\t\t\r\n\t\tList<Set<String>> classifiedDocsList = new ArrayList<Set<String>>();\r\n\t\tclassifiedDocsList.add(setOfHamiltonDocs);\r\n\t\tclassifiedDocsList.add(setOfMadisonDocs);\r\n\t\tclassifiedDocsList.add(setOfJayDocs);\r\n\t\t\r\n\t\tfor (String term : corpusVocab) {\r\n\r\n\t\t\t// All docs containing this term\r\n\t\t\tSet<String> matchingDocs = new HashSet<String>();\r\n\t\t\t\r\n\t\t\tfor (PositionalPosting posting : pInvertedIndex.getPostings(term)) {\r\n\t\t\t\tmatchingDocs.add(fileNames.get(posting.getDocumentId()));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// iterate through all classes (Hamilton, Madison, Jay)\r\n\t\t\tfor (int i = 0; i < classifiedDocsList.size(); i++) {\r\n\t\t\t\t\r\n\t\t\t\tSet<String> classifiedDocs = classifiedDocsList.get(i);\r\n\t\t\t\t\r\n\t\t\t\tSet<String> intersection = new HashSet<String>(matchingDocs);\r\n\t\t\t\tintersection.retainAll(classifiedDocs);\r\n\t\t\t\tdouble N11 = intersection.size();\r\n\t\t\t\t\r\n\t\t\t\tSet<String> difference = new HashSet<String>(matchingDocs);\r\n\t\t\t\tdifference.removeAll(classifiedDocs);\r\n\t\t\t\tdouble N10 = difference.size();\r\n\t\t\t\t\r\n\t\t\t\tdouble N01 = classifiedDocs.size() - N11;\r\n\t\t\t\tdouble N00 = fileNames.size() - classifiedDocs.size() - N10;\r\n\r\n\t\t\t\t// Calculate I(t,c)\r\n\t\t\t\tdouble Itc = (N11 / N) * log2((N * N11) / ((N11 + N10) * (N11 + N01)))\r\n\t\t\t\t\t\t+ (N01 / N) * log2((N * N01) / ((N01 + N00) * (N11 + N01)))\r\n\t\t\t\t\t\t+ (N10 / N) * log2((N * N10) / ((N11 + N10) * (N10 + N00)))\r\n\t\t\t\t\t\t+ (N00 / N) * log2((N * N00) / ((N01 + N00) * (N10 + N00)));\r\n\t\t\t\tif (!Double.isNaN(Itc)) {\r\n\t\t\t\t\tmutualInformationList.add(new MutualInformation(term, Itc));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Build Discriminating Set of vocab terms by sorting mutual information\r\n\t\t// list and keep the first k values\r\n\t\tSet<String> terms = new HashSet<String>();\r\n\t\tCollections.sort(mutualInformationList, Collections.reverseOrder());\r\n\t\tfor (int i = 0; i < k; i++) {\r\n\t\t\tterms.add(mutualInformationList.get(i).getTerm());\r\n\t\t}\r\n\t\t\r\n\t\t// get term counts in classified (trainer) docs\t\t\r\n\t\tint[] classifiedDocsTermFreq = new int[classifiedDocsList.size()];\r\n\t\t\r\n\t\tclassifiedDocsTermFreq[0] = getTermFreq(hamiltonDocs, terms);\r\n\t\tclassifiedDocsTermFreq[1] = getTermFreq(madisonDocs, terms);\r\n\t\tclassifiedDocsTermFreq[2] = getTermFreq(jayDocs, terms);\r\n\t\t\r\n\t\t// Calculate p(t|c)\r\n\t\t// maps term to list of p(t|c) for each class\r\n\t\tMap<String, List<Double>> ptc = new HashMap<String, List<Double>>();\r\n\t\t\r\n\t\tfor (String term : terms) {\r\n\t\t\tptc.put(term, new ArrayList<Double>());\r\n\t\t\tfor (int i = 0; i < classifiedDocsList.size(); i++) {\r\n\t\t\t\t\r\n\t\t\t\tint ftc = 0;\r\n\t\t\t\tfor (PositionalPosting posting : pInvertedIndex.getPostings(term)) {\r\n\t\t\t\t\tif (classifiedDocsList.get(i).contains(fileNames.get(posting.getDocumentId()))) {\r\n\t\t\t\t\t\tftc += posting.getPositions().size();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tptc.get(term).add((double) (ftc + 1) / (double) (classifiedDocsTermFreq[i] + terms.size()));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// visit each unclassified document\r\n\t\ttry {\r\n\t\t\tPath currentWorkingPath = Paths.get(toBeClassified).toAbsolutePath();\r\n\t\t\t// This is our standard \"walk through all .txt files\" code.\r\n\t\t\tFiles.walkFileTree(currentWorkingPath, new SimpleFileVisitor<Path>() {\r\n\r\n\t\t\t\tpublic FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {\r\n\t\t\t\t\t// make sure we only process the current working directory\r\n\t\t\t\t\tif (currentWorkingPath.equals(dir)) {\r\n\t\t\t\t\t\treturn FileVisitResult.CONTINUE;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn FileVisitResult.SKIP_SUBTREE;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tpublic FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {\r\n\r\n\t\t\t\t\tif (file.toString().endsWith(\".txt\")) {\r\n\r\n\t\t\t\t\t\tTokenStream tokenStream = null;\r\n\t\t\t\t\t\t// terms in this document\r\n\t\t\t\t\t\tSet<String> docTerms = new HashSet<String>();\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\ttokenStream = Utils.getTokenStreams(file.toFile());\r\n\t\t\t\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\twhile (tokenStream.hasNextToken()) {\r\n\t\t\t\t\t\t\tString token = Utils.processWord(tokenStream.nextToken().trim(), false);\r\n\t\t\t\t\t\t\tdocTerms.add(token);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// only keep terms in discriminating set\r\n\t\t\t\t\t\tdocTerms.retainAll(terms);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// calculate log(p(c) + sum(log(p(ti|c))) for each class\r\n\t\t\t\t\t\tdouble[] pce = new double[classifiedDocsList.size()];\r\n\t\t\t\t\t\tfor (int i = 0; i < classifiedDocsList.size(); i++) {\r\n\t\t\t\t\t\t\tdouble sum = 0;\r\n\t\t\t\t\t\t\tfor (String term : docTerms) {\r\n\t\t\t\t\t\t\t\tsum += Math.log(ptc.get(term).get(i));\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\tpce[i] = Math.log(classifiedDocsTermFreq[i] / terms.size()) + sum;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (pce[0] > pce[1] && pce[0] > pce[2]) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"Document : \" + file.getFileName().toString() + \" : belongs to Hamilton\");\r\n\t\t\t\t\t\t} else if (pce[1] > pce[0] && pce[1] > pce[2]) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"Document : \" + file.getFileName().toString() + \" : belongs to Madison\");\r\n\t\t\t\t\t\t} else if (pce[2] > pce[0] && pce[2] > pce[1]) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"Document : \" + file.getFileName().toString() + \" : belongs to Jay\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tSystem.out.println(\"I don't know whom document : \" + file.getFileName().toString() + \" : belongs to.\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn FileVisitResult.CONTINUE;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// don't throw exceptions if files are locked/other errors occur\r\n\t\t\t\tpublic FileVisitResult visitFileFailed(Path file, IOException e) {\r\n\t\t\t\t\treturn FileVisitResult.CONTINUE;\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}", "public static void main(String args[]){\n\t\tString indexLocation = \"H:\\\\ukbench\\\\training2\\\\\";\r\n\t\tString searchLocation = \"H:\\\\ukbench\\\\query\\\\\";\r\n\t\t\r\n//\t\tint[] testSizes = {2000};\r\n//\t\tint[] numTreesTests = {3,4,5,6,7,8,9,10};\r\n//\t\tint[] examineTopNResultsTests = {5,10,20};\r\n\t\tint[] testSizes = {10200};\r\n\t\tint[] numTreesTests = {1};//3,4,5,10};\r\n\t\tint[] examineTopNResultsTests = {5,20};\r\n\t\tfor ( int testSize : testSizes ){\r\n\t\t\tfor ( int numTrees : numTreesTests ){\r\n\t\t\t\tfor ( int numResults : examineTopNResultsTests ){\r\n\t\t\t\t\tSystem.out.println(testSize + \", \" + numTrees + \", \" + numResults);\r\n\t\t\t\t\tMultiIndexFinder finder = new MultiIndexFinder(indexLocation,numTrees,testSize/4);\r\n\t\t\t\t\t\r\n\t\t\t\t\tList<FileFilter> filters = new ArrayList<FileFilter>();\r\n\t\t\t\t\tfilters.add(new FileFilter(\".*\\\\.jpg\"));\r\n\t\t\t\t\tFileFinder ffinder = new FileFinder(searchLocation,filters);\r\n\t\t\t\t\tList<File> files = ffinder.getFiles();\r\n\t\t\t\t\tint numRight = 0;\r\n\t\t\t\t\tint numWrong = 0;\r\n\t\t\t\t\tint count = 0;\r\n\t\t\t\t\tfor ( File file : files ){\r\n\t\t\t\t\t\tString foundFile = finder.findBestMatch(file.getAbsolutePath(),numResults);\r\n\t\t\t\t\t\t//System.out.println(\"for \" + file.getAbsolutePath() + \", found \" + foundFile);\r\n\t\t\t\t\t\tif ( !\"\".equals(foundFile) && IndexFinder.isCorrectFile(file.getAbsolutePath(),foundFile) ){\r\n\t\t\t\t\t\t\tnumRight++;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tnumWrong++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t\tif ( count >= (testSize *3)/4 ) break;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tSystem.out.println(numRight/(float)(numRight+numWrong));\r\n\t\t\t\t\tSystem.gc();\r\n\t\t\t\t}\r\n\t\t\t\tSystem.gc();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\n public void showHandledPeaksForInterestingCases() {\n List<ISpectrum> spectra = ClusteringTestUtilities.readISpectraFromResource();\n\n ISpectrum[] spectrums = (ISpectrum[]) spectra.toArray();\n\n ISimilarityChecker checker = new FrankEtAlDotProductTester();\n ISimilarityChecker currentChecker = new FrankEtAlDotProduct(0.5F, 15, true);\n\n //noinspection UnnecessaryLocalVariable,UnusedDeclaration,UnusedAssignment\n Set<String> interestingIds = new HashSet<>();\n\n\n for (int i = 0; i < spectrums.length; i++) {\n ISpectrum psm1 = spectrums[i];\n String id1 = psm1.getId();\n if (!INTERESTING_ID_SET.contains(id1))\n continue; // not an interesting case\n\n for (int j = i + 1; j < spectrums.length; j++) {\n ISpectrum psm2 = spectrums[j];\n\n String id2 = psm2.getId();\n if (!INTERESTING_ID_SET.contains(id2))\n continue; // not an interesting case\n\n // System.out.println(\"Comparing \" + id1 + \" \" + id2);\n\n StringBuilder usedPeaksTester = new StringBuilder();\n\n //noinspection UnnecessaryLocalVariable,UnusedDeclaration,UnusedAssignment\n double dotOrg = checker.assessSimilarity(psm1, psm2);\n\n // System.out.println(\"Peaks compared original Frank Et Al (when the code is written)\");\n // print usage\n // System.out.println(usedPeaksTester.toString());\n\n usedPeaksTester.setLength(0); // clear debug output\n double dotNew = currentChecker.assessSimilarity(psm1, psm2);\n\n // print usage\n // System.out.println(\"Peaks compared current Frank Et Al \");\n // System.out.println(usedPeaksTester.toString());\n\n\n }\n\n }\n }", "@Test\n public void testIntersection4()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n if (i != 500) {\n set2.add(i);\n expected.add(i);\n }\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test(timeout = 4000)\n public void test02() throws Throwable {\n Discretize discretize0 = new Discretize(\"l*{e5SNh\");\n boolean boolean0 = true;\n discretize0.m_ClassIndex = 177;\n discretize0.setUseEqualFrequency(true);\n double[][] doubleArray0 = new double[5][9];\n double[] doubleArray1 = new double[3];\n doubleArray1[0] = (double) 177;\n doubleArray1[1] = (double) 177;\n doubleArray1[2] = (double) 177;\n doubleArray0[0] = doubleArray1;\n double[] doubleArray2 = new double[2];\n doubleArray2[0] = (double) 177;\n doubleArray2[1] = (double) 177;\n doubleArray0[1] = doubleArray2;\n double[] doubleArray3 = new double[9];\n doubleArray3[0] = (double) 177;\n doubleArray3[1] = (double) 177;\n doubleArray3[2] = (double) 177;\n doubleArray3[3] = (double) 177;\n doubleArray3[4] = (double) 177;\n doubleArray3[5] = (double) 177;\n doubleArray3[6] = (double) 177;\n doubleArray3[7] = (double) 177;\n doubleArray3[8] = (double) 177;\n doubleArray0[2] = doubleArray3;\n double[] doubleArray4 = new double[8];\n doubleArray4[0] = (double) 177;\n doubleArray4[1] = (double) 177;\n doubleArray4[2] = (double) 177;\n doubleArray4[3] = (double) 177;\n doubleArray4[4] = (double) 177;\n doubleArray4[5] = (double) 177;\n doubleArray4[6] = (double) 177;\n doubleArray4[7] = (double) 177;\n doubleArray0[3] = doubleArray4;\n double[] doubleArray5 = new double[0];\n doubleArray0[4] = doubleArray5;\n discretize0.m_CutPoints = doubleArray0;\n discretize0.listOptions();\n discretize0.setIgnoreClass(true);\n String[] stringArray0 = new String[0];\n Discretize.main(stringArray0);\n discretize0.findNumBinsTipText();\n discretize0.setInvertSelection(true);\n // Undeclared exception!\n try { \n discretize0.getBinRangesString(511);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 511\n //\n verifyException(\"weka.filters.unsupervised.attribute.Discretize\", e);\n }\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodKeySet() throws Exception {\n Index i1 =\n qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"ks.toString\",\n SEPARATOR + \"portfolio.keySet() ks\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForKeys(ri);\n }", "private void giveTriangularBranchesHeaders(ArrayList<Map<Integer, Double>> branches, int kOffset)\r\n\t{\r\n\t\tint upperKValue;\r\n\t\tint lowerKValue = Math.abs(currentK + kOffset);\r\n\r\n\t\tif (kOffset > 0) {\r\n\t\t\tupperKValue = Math.abs(currentK + 1);\r\n\t\t} else {\r\n\t\t\tupperKValue = Math.abs(currentK - 1);\r\n\t\t}\r\n\r\n\t\tif (isEType) {\r\n\t\t\tfindLineMatchesFromPredictions(branches,\r\n\t\t\t\t\t\"R (Upper state K=\" + upperKValue + \", Lower state K=\" + lowerKValue + \")\",\r\n\t\t\t\t\t\"P (Upper state K=\" + upperKValue + \", Lower state K=\" + lowerKValue + \")\",\r\n\t\t\t\t\t\"Q (Upper state K=\" + upperKValue + \", Lower state K=\" + lowerKValue + \")\");\r\n\t\t} else {\r\n\t\t\tif (currentK >= 0) {\r\n\t\t\t\tif (IS_EVEN_SELECTION_RULES) {\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches,\r\n\t\t\t\t\t\t\t\"R (Upper state K=\" + upperKValue + \"+, Lower state K=\" + lowerKValue\r\n\t\t\t\t\t\t\t\t\t+ \"+)\",\r\n\t\t\t\t\t\t\t\"P (Upper state K=\" + upperKValue + \"+, Lower state K=\" + lowerKValue\r\n\t\t\t\t\t\t\t\t\t+ \"+)\",\r\n\t\t\t\t\t\t\t\"Q (Upper state K=\" + upperKValue + \"-, Lower state K=\" + lowerKValue\r\n\t\t\t\t\t\t\t\t\t+ \"+)\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches,\r\n\t\t\t\t\t\t\t\"R (Upper state K=\" + upperKValue + \"-, Lower state K=\" + lowerKValue\r\n\t\t\t\t\t\t\t\t\t+ \"+\" + \")\",\r\n\t\t\t\t\t\t\t\"P (Upper state K=\" + upperKValue + \"-, Lower state K=\" + lowerKValue\r\n\t\t\t\t\t\t\t\t\t+ \"+\" + \")\",\r\n\t\t\t\t\t\t\t\"Q (Upper state K=\" + upperKValue + \"-, Lower state K=\" + lowerKValue\r\n\t\t\t\t\t\t\t\t\t+ \"-)\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (IS_EVEN_SELECTION_RULES) {\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches,\r\n\t\t\t\t\t\t\t\"R (Upper state K=\" + upperKValue + \"-, Lower state K=\" + lowerKValue\r\n\t\t\t\t\t\t\t\t\t+ \"-)\",\r\n\t\t\t\t\t\t\t\"P (Upper state K=\" + upperKValue + \"-, Lower state K=\" + lowerKValue\r\n\t\t\t\t\t\t\t\t\t+ \"-)\",\r\n\t\t\t\t\t\t\t\"Q (Upper state K=\" + upperKValue + \"+, Lower state K=\" + lowerKValue\r\n\t\t\t\t\t\t\t\t\t+ \"-)\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches,\r\n\t\t\t\t\t\t\t\"R (Upper state K=\" + upperKValue + \"+, Lower state K=\" + lowerKValue\r\n\t\t\t\t\t\t\t\t\t+ \"-)\",\r\n\t\t\t\t\t\t\t\"P (Upper state K=\" + upperKValue + \"+, Lower state K=\" + lowerKValue\r\n\t\t\t\t\t\t\t\t\t+ \"-)\",\r\n\t\t\t\t\t\t\t\"Q (Upper state K=\" + upperKValue + \"+, Lower state K=\" + lowerKValue\r\n\t\t\t\t\t\t\t\t\t+ \"+)\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void positionIntersects(LinkedList<TermPositions> p1, LinkedList<TermPositions> p2, int k) {\n if (p1 != null && p2 != null) {\n int df1 = p1.size();\n int df2 = p2.size();\n while (!p1.isEmpty() && !p2.isEmpty()) {\n int tf1 = p1.peek().getPositionList().size();\n int tf2 = p1.peek().getPositionList().size();\n if (p1.peek().getDocId() == p2.peek().getDocId()) {\n LinkedList<Integer> pp1 = p1.peek().getPositionList();\n while (!pp1.isEmpty()) {\n for (Integer integer : p2.peek().getPositionList()) {\n if ((pp1.peek() - integer) < 0 && Math.abs(pp1.peek() - integer) <= (k + 1)) {\n double score = (1 + Math.log(tf1) * Math.log(N / df1)) + (1 + Math.log(tf2) * Math.log(N / df2));\n resultsCollector.add(new DocCollector(p1.peek().getDocId(), score));\n break;\n }\n }\n pp1.pop();\n }\n } else if (p1.peek().getDocId() < p2.peek().getDocId())\n p1.pop();\n else\n p2.pop();\n\n p1.pop();\n p2.pop();\n\n }\n\n }\n\n\n }", "public void KNN() {\n\n\t\t\n\t\t// for each point in test data\n\t\tdouble x = 0;\n\t\tdouble y = 0;\n\t\tdouble xy = 0;\n\t\tdouble sum = 0;\n\t\tdouble m = this.Extracted_TestDataset.length;\n\t\tArrayList<ArrayList<Double>> EucledianDistanceUnsorted = new ArrayList<>(this.Extracted_TestDataset.length);\n\t\tArrayList<ArrayList<Double>> EucledianDistanceSorted = new ArrayList<>(this.Extracted_TestDataset.length);\n\t\t//EucledianDistance\n\t\t\n\t\t// Initialize EucledianDistance List\n\t\tfor(int i=0; i < this.Extracted_TestDataset.length; i++) {\n\t\t\tEucledianDistanceUnsorted.add(new ArrayList());\n\t\t}\n\t\t\n\t\tfor(int i=0; i < this.Extracted_TestDataset.length; i++) {\n\t\t\tEucledianDistanceSorted.add(new ArrayList());\n\t\t}\n\t\t\n\t\t// Testing sorting \n\t\t/*\n\t\tfor(int i=0; i < this.Extracted_TestDataset.length; i++) {\n\t\t\tfor(int k=0; k < this.Extracted_TestDataset[i].length; k++) {\n\t\t\t\tdouble min = 0.0; // Set To Your Desired Min Value\n\t\t double max = 10.0; // Set To Your Desired Max Value\n\t\t double ran = (Math.random() * ((max - min) + 1)) + min; // This Will Create \n\t\t \n\t\t double xrounded = Math.round(ran * 100.0) / 100.0; \n\t\t System.out.print(xrounded); \n\t\t //System.out.print(\" , \"); \n\t\t EucledianDistanceUnsorted.get(i).add(xrounded);\n\t\t\t\t\n\t\t\t}\n\t\t\t//System.out.println(\"\"); \n\t\t\t\n\t\t}\n\t\t*/\n\n\t\t\n\t\t\n\t\t//start at index 1 discard the attribute name row\n\t\tfor ( int p = 1; p < (this.Extracted_TestDataset.length-1) ; p++) {\n\t\t//start at index 1 discard the attribute name row\n\t\tfor ( int i = 1; i < this.Extracted_TrainingDataset.length; i++) {\n\t\t\tsum = 0;\n\t\t\tint k = 0;\n\t\t\t//System.out.println(\"first loop\");\n\t\t\tfor ( ; k < (this.Extracted_TestDataset[0].length-1) ; k++) {\t\t\t\n\t\t\t\t//System.out.println(\"second loop\");\n\t\t\t\t\n\t\t\t\tx = (Double.parseDouble(this.Extracted_TestDataset[p][k]));\n\t\t\t\t\t//System.out.print(\" x value : \");\n\t\t\t\t\t//System.out.print(x);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\ty = (Double.parseDouble(this.Extracted_TrainingDataset[i][k]));\n\t\t\t//\tSystem.out.print(\" y value : \");\n\t\t\t//\tSystem.out.println(y);\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\txy = x - y;\n\t\t\t\n\t\t\t\txy = (Math.pow(xy, 2));\n\t\t\t\tsum += xy;\n\t\t\t\t\t\t\n\t\t\t\t//System.out.print(\" sum : \");\n\t\t\t\t//System.out.println(sum);\n\t\t\t\t}\n\n\t\t\tEucledianDistanceUnsorted.get(p).add((Math.sqrt(sum/k)));\n\t\t\t\t//System.out.printf(\" distance value of row %i in col %i : %s %n\", i, k ,EucledianDistanceUnsorted.get(i).get(k));\t\t\n\t\t\t}\n\t\t\n\t\t\t//start at index 1 discard the attribute name row\n\t\t\t/*for ( int i = 0; i < (this.Extracted_TrainingDataset.length-1) ; i++) {\t\t\n\t\t\t\tSystem.out.print(\" distance value of row \");\n\t\t\t\tSystem.out.print(p);\n\t\t\t\tSystem.out.print(\" in col \");\n\t\t\t\tSystem.out.print(i);\n\t\t\t\tSystem.out.print(\" = \");\n\t\t\t\tSystem.out.print(EucledianDistanceUnsorted.get(p).get(i));\n\t\t\t\tSystem.out.println(\"\");\t\n\t\t\t}*/\n\t\t\t\n\t\t System.out.print(\"Count : \");\n\t\t System.out.println(p);\n\t\t}\n\t\n\t\tSystem.out.println(\"About to sort distance\");\n\t\t\n\t\tfor( int i = 1; i < (EucledianDistanceUnsorted.size()-1); i++){\n\t\t\tArrayList<Double> temp = EucledianDistanceUnsorted.get(i);\n\t\t\tCollections.sort(temp);\n\t\t\tfor(int k=0; k < (this.Extracted_TrainingDataset.length- 1); k++) {\n\t\t\t\tEucledianDistanceSorted.get(i).add(temp.get(k));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\" Sorted eucledian distance of first k values \");\n\t\tfor(int i=1; i < EucledianDistanceSorted.size()-1; i++) {\n\t\t\tfor(int k=0; k < (this.ValueofK); k++) {\n\t\t\t\tSystem.out.print(EucledianDistanceSorted.get(i).get(k));\n\t\t\t\tSystem.out.print(\" , \");\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(\" finding class of first k points \");\n\t\t// find majority distance and find index of distance in unsorted distance \n\t\tdouble majority = 0.0;\n\t\tint IndexofDistance = 0;\n\t\tfor(int i=1; i < (EucledianDistanceSorted.size()-1); i++) {\n\t\t\t\n\t\t\t\tmajority = findMajority(EucledianDistanceSorted.get(i), this.ValueofK);\n\t\t\t\tSystem.out.print(\" index : \");\n\t\t\t\tSystem.out.print(i);\n\t\t\t\tSystem.out.print(\" majority : \");\n\t\t\t\tSystem.out.println(majority);\n\t\t\t\tIndexofDistance = findIndexofMajority(majority,EucledianDistanceUnsorted.get(i));\n\n\t\t\t\t//System.out.print(\" test row original class :\");\n\t\t\t\t//System.out.println(this.Extracted_TestDataset[i][this.feature_extraction.size()-1]);\n\t\t\t\tconfusionmatrix.addTrueValue(Extracted_TestDataset[i][this.feature_extraction.size()-1]);\n\t\t\t\t//System.out.print(\" predectived training row classifier : \");\n\t\t\t\t//System.out.println(this.Extracted_TrainingDataset[IndexofDistance][this.feature_extraction.size()-1]);\t\n\t\t\t\tconfusionmatrix.addPrediction(Extracted_TrainingDataset[IndexofDistance][this.feature_extraction.size()-1]);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"Total number of predictions: \" + confusionmatrix.TotalNumberOfPredictions());\n\t\t\tSystem.out.println(\"Number of correct predictions: \"+confusionmatrix.Correct());\n\t\t\tSystem.out.println(\"Number of incorrect predictions: \"+confusionmatrix.Incorrect());\n\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"True positive (TP): correct positive prediction: \" + confusionmatrix.TruePositive());\n\t\t\tSystem.out.println(\"False positive (FP): incorrect positive prediction: \" + confusionmatrix.FalsePositive());\n\t\t\tSystem.out.println(\"True negative (TN): correct negative prediction: \" + confusionmatrix.TrueNegative());\n\t\t\tSystem.out.println(\"False negative (FN): incorrect negative prediction: \" +confusionmatrix.FalseNegative()); \n\t\t\tSystem.out.println(\"Error Rate: \"+confusionmatrix.ErrorRate());\n\t\t\tSystem.out.println(\"Accuracy Rate: \"+confusionmatrix.AccuracyRate());\n\t}", "@Test\n public void testIntersection6()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n for (int i = 0; i < 5; i++) {\n set1.add(i);\n }\n for (int i = 1000; i < 1005; i++) {\n set1.add(i);\n }\n\n ConciseSet set2 = new ConciseSet();\n for (int i = 800; i < 805; i++) {\n set2.add(i);\n }\n for (int i = 806; i < 1005; i++) {\n set2.add(i);\n }\n\n for (int i = 1000; i < 1005; i++) {\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "public String Km() throws Exception {\n int x = 0;\n System.out.println(x+\" hlikiaaaaaa\");\n ΑrffCreator gen = new ΑrffCreator();\n\t\t\tgen.ArffGenerator();\n\t\t\t\n\t\t\tSimpleKMeans kmeans = new SimpleKMeans();\n\t \n\t\t\tkmeans.setSeed(2);\n\t \n\t\t\t//important parameter to set: preserver order, number of cluster.\n\t\t\tkmeans.setPreserveInstancesOrder(true);\n\t\t\tkmeans.setNumClusters(2);\n\t \n\t\t\tBufferedReader datafile = readDataFile(\"E:\\\\Users\\\\Filippos\\\\Documents\\\\NetBeansProjects\\\\MapsCopy\\\\mytext.arff\"); \n\t\t\tInstances data = new Instances(datafile);\n\t \n\t \n\t\t\tkmeans.buildClusterer(data);\n\t \n\t\t\t// This array returns the cluster number (starting with 0) for each instance\n\t\t\t// The array has as many elements as the number of instances\n\t\t\tint[] assignments = kmeans.getAssignments();\n int noNoobs=-1;\n\t\t\t//int i=0;\n\t\t\tint g = assignments.length;\n String studentsLvl = \"\";\n String quizAns = \"\";\n int clusterResult;\n\t\t\t/*----------------------------------------->xeirokinitos upologismos<----------------------------------------\n \n /*for(int clusterNum : assignments) {\n if(i==x){\n noNoobs = assignments[i];\n System.out.println(\"to \"+g+\"o einai \"+ clusterNum+\"= \"+x+\" o cluster EINAI PROXORIMENOS\");\n\t\t\t\t}\t\n if(i==g-1) {\n \n if(assignments[i] == noNoobs){\n studentsLvl = \"advanced\";\n System.out.println(\"MPAINEI STOUS PROXORIMENOUS\"+assignments[i]);\n \n }\n else{\n studentsLvl = \"beginner\";\n System.out.println(\"DEN PAEI POY8ENA ETSI\") ; \n }\n \n\t\t\t i++;\n\t\t\t}\n ---------------------------------------------------------------------------------------------------------*/\n /*upologizw thn euklideia apostash twn telikwn cluster cendroids apo to shmeio 0,0 \n auto pou apexei perissotero apo to kentro twn a3onwn , 8a einai to cluster advanced epeidi oso megaluterh hlikia \n kai kalutero scor sto preliminary test , toso pio advanced. Ka8w h logiki einai oti enas pio megalos kai diavasmenos ma8hths\n kaluteros apo enan pio pio mikro kai e3isou diavasmeno ma8hth h enan sunmoliko alla ligotero diavasmeno\n ----------------------------------------------------------------------------------------------------------*/\n \n //1 vazw ta teleutaia clusterCendroids se ena instance\t\t\t\n\t\t\tInstances clusterCendroid = kmeans.getClusterCentroids();\n //ta metatrepw se string\n\t\t\tString cluster0 = (clusterCendroid.firstInstance()).toString();\n\t\t\tString cluster1 = (clusterCendroid.lastInstance()).toString();\n\t\t\tSystem.out.println(cluster0+\"++++++++++++++++\"+cluster1);\n\t\t\t\n //2 spaw to ka8e string sto \",\" gt einai tis morfhs cluster0=\"x0,y0\" cluster1=\"x1,y1\"\n\t\t\tString[] parts = cluster0.split(\",\");\n\t\t\tString partx0 = parts[0]; // 004\n\t\t\tString party0 = parts[1]; // 034556\n\t\n\t\t\tSystem.out.println(partx0+\" || \"+party0);\n \n //3 Metatrepw ta String se double metavlites gia na epitrepontai oi pra3eis\n\t\t\tdouble clusterDx0 = Double.parseDouble(partx0);\n\t\t\tdouble clusterDy0 = Double.parseDouble(party0);\n\t\t\tSystem.out.println(clusterDx0+clusterDy0);\n\t\t\t\n //epanalamvanoume thn diadikasia apo to vhma 2\n\t\t\tString[] parts1 = cluster1.split(\",\");\n\t\t\tString partx1 = parts1[0]; // 004\n\t\t\tString party1 = parts1[1]; // 034556\n\t\t\t\n\t\t\tSystem.out.println(partx1+\" || \"+party1);\n\t\t\t\n \n double clusterDx1 = Double.parseDouble(partx1);\n\t\t\tdouble clusterDy1 = Double.parseDouble(party1);\n\t\t\t//System.out.println(clusterDx1+clusterDy2);\n //ypologizw thn euklidia apostasi twn 2 shmeivn ws pros to 0,0\n\t\t\tdouble popo = Math.sqrt((Math.pow(clusterDx0,2)+Math.pow(clusterDy0,2)));\n\t\t\tdouble popo2 = Math.sqrt((Math.pow(clusterDx1,2)+Math.pow(clusterDy1,2)));\n \n\t\t\tif (Math.max(popo, popo2)==popo) {\n \n clusterResult=0;\n\t\t\t\tSystem.out.println(\"0=advanced -- \"+popo+\"--1=begginer \"+popo2);\n\t\t\t}\n\t\t\telse {\n clusterResult=1;\n\t\t\t\tSystem.out.println(\"1=advanced -- \"+popo2+\"--0=begginer \"+popo);\n\t\t\t}\n\t\t\tSystem.out.println(popo+\"||\"+popo2+\"||\");\n \n if (assignments[data.numInstances()-1]==clusterResult){\n studentsLvl = \"advanced\";\n quizAns = \"yes\";\n System.out.println(\"MPAINEI STOUS PROXORIMENOUS \"+assignments[data.numInstances()-1]);\n }\n else{\n quizAns = \"no\";\n studentsLvl = \"beginner\";\n System.out.println(\"MPAINEI STOUS MH PROXORIMENOUS \"+assignments[data.numInstances()-1]) ; \n }\n \n coursequizs lev = new coursequizs();\n lev.studentLevel(studentsLvl,quizAns);\n \n System.out.println(Arrays.toString(assignments));\n return \"home.jsf\";\n\t\t}", "public static void main(String[] args) {\n\t\t\n\t\tString data = \"\\r\\n\" + \n\t\t\t\t\"3\\r\\n\" + \n\t\t\t\t\"5 2\\r\\n\" + \n\t\t\t\t\"13 32\\r\\n\" + \n\t\t\t\t\"100 1000\";\n\t\t\n\t\tScanner sc = new Scanner(data);\n\t\t\n\t\tint T = sc.nextInt();\n\t\tfor(int test_case = 1; test_case<=T; ++test_case) {\n\t\t\tint minji = sc.nextInt();\n\t\t\tint treasure = sc.nextInt();\n\t\t\tint answer = 0;\n\t\t\t\n\t\t\tint start = (minji<=treasure)? minji : treasure;\n\t\t\tint target = (minji>treasure)? minji : treasure;\n\t\t\t\n\t\t\tint line = 1;\n\t\t\tint left = 1;\n\t\t\tint right =1;\n\t\t\t\n\t\t\tint startLine = 0;\n\t\t\tint targetLine = 0;\n\t\t\t\n\t\t\twhile(startLine == 0 || targetLine == 0) {\n\t\t\t\tif(left <= start && right>= start) \n\t\t\t\t\tstartLine = line;\n\t\t\t\t\n\t\t\t\tif(left <= target && right>= target) {\n\t\t\t\t\ttargetLine = line;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tleft += line;\n\t\t\t\tright += (line + 1);\n\t\t\t\t\n\t\t\t\t++line;\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(startLine + \" \" + targetLine);\n\t\t\t\n\t\t\tleft = start;\n\t\t\tright = start;\n\t\t\tline = startLine;\n\t\t\t\n\t\t\twhile(answer == 0) {\n\t\t\t\tif(targetLine == line) {\n\t\t\t\t\tif(left<=target && right>=target) {\n\t\t\t\t\t\tanswer = targetLine - startLine;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tanswer = targetLine - startLine + Math.min(Math.abs(target - left),Math.abs(right - target));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//System.out.println(left);\n\t\t\t\t\n\t\t\t\tleft += line;\n\t\t\t\tright += (line + 1);\n\t\t\t\t\n\t\t\t\t++line;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"#\" + test_case + \" \" + answer);\n\t\t}\n\t}", "private String[] findSuitableK(String[] trainingDataSet){\n\t\ttry{\n\t\t\t\n\t\t}\n\t\tcatch(Exception ex){\n\t\t\tthrow ex;\n\t\t}\n\t\tfinally{\n\t\t\t\n\t\t}\n\t\t\n\t\treturn new String[]{\"neighbor1\", \"neighbor2\", \"neighbor3\"};\n\t}", "public static void ITdistances()\n\t{\n\t\t//System.err.println(\"Position\");\n\n\t\tclade = clad[k];\n\n\t\tclade.tipDistance = 0;\n\t\tclade.intDistance = 0;\n\t\tclade.tipDisNested = 0;\n\t\tclade.intDisNested = 0;\n\t\tclade.indTipClades = 0;\n\t\tclade.indIntClades = 0;\n\n\n\t\tif(clade.check != (double) clade.numSubClades && clade.check != 0)\n\t\t{ \n\t\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t\t{\n\t\t\t\tif (clade.Position[i] == tip)\n\t\t\t\t\tclade.indTipClades += clade.rowTotal[i];\n\t\t\t\telse\n\t\t\t\t\tclade.indIntClades += clade.rowTotal[i];\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t\t{\n\t\t\t\t// weigthing within class\n\t\t\t\tclade.tipDistance += clade.Position[i] * clade.Dc[i] * (double) clade.rowTotal[i] / (double) clade.indTipClades;\n\t\t\t\tclade.tipDisNested += clade.Position[i] * clade.Dn[i] * (double) clade.rowTotal[i] / (double) clade.indTipClades;\n\t\t\t\tclade.intDistance += (1 - clade.Position[i]) * clade.Dc[i] * (double) clade.rowTotal[i] / (double) clade.indIntClades;\n\t\t\t\tclade.intDisNested += (1 - clade.Position[i]) * clade.Dn[i] * (double) clade.rowTotal[i] / (double) clade.indIntClades;\t\n\t\t\t\t\n\t\t\t\t// unweighted\n\t\t\t\t//clade.tipDistance += clade.Position[i] * clade.Dc[i] / (double) clade.check;\n\t\t\t\t//clade.tipDisNested += clade.Position[i] * clade.Dn[i] / (double) clade.check;\n\t\t\t\t//clade.intDistance += (1 - clade.Position[i]) * clade.Dc[i] / (double) (clade.numSubClades - clade.check);\n\t\t\t\t//clade.intDisNested += (1 - clade.Position[i]) * clade.Dn[i] / (double) (clade.numSubClades - clade.check);\t\n\t\t\t}\n\n\t\t clade.tipIntDistance = clade.intDistance - clade.tipDistance;\n\t\t clade.tipIntDisNested = clade.intDisNested - clade.tipDisNested;\n\t\t if(verbose){\n\t\t\tlogfile.println(\"\\nIT \" + clade.cladeName + \" indTipClades = \" + clade.indTipClades\n\t\t\t\t+ \" indIntClades + \" + clade.indIntClades);\n\t\t\tlogfile.println(\"\\nITc \" + clade.cladeName + \" meanInt = \" + clade.intDistance\n\t\t\t\t+ \" meanTip = \" + clade.tipDistance);\n\t\t\tlogfile.println(\"ITn \" + clade.cladeName + \" meanInt = \" + clade.intDisNested\n\t\t\t\t+ \" meanTip = \" + clade.tipDisNested);\n\t\t }\n\t\t}\n\n\t\t//System.err.println(\"IT clade \" + clade.cladeName + \" meanInt = \" + clade.intDistance + \" meanTip = \" + clade.tipDistance);\n\n\t}", "public int predict(int[] testData) {\n /*\n * kNN algorithm:\n * \n * This algorithm compare the distance of every training data to the test data using \n * the euclidean distance algorithm, and find a specfic amount of training data \n * that are closest to the test data (the value of k determine that amount). \n * \n * After that, the algorithm compare those data, and determine whether more of those\n * data are labeled with 0, or 1. And use that to give the guess\n * \n * To determine k: sqrt(amount of training data)\n */\n\n /*\n * Problem:\n * Since results and distances will be stored in different arrays, but in the same order,\n * sorting distances will mess up the label, which mess up the predictions\n * \n * Solution:\n * Instead of sorting distances, use a search algorithm, search for the smallest distance, and then\n * the second smallest number, and so on. Get the index of that number, use the index to \n * find the result, and store it in a new ArrayList for evaluation\n */\n\n // Step 1 : Determine k \n double k = Math.sqrt(this.trainingData.size());\n k = 3.0;\n\n // Step 2: Calculate distances\n // Create an ArrayList to hold all the distances calculated\n ArrayList<Double> distances = new ArrayList<Double>();\n // Create another ArrayList to store the results\n ArrayList<Integer> results = new ArrayList<Integer>();\n for (int[] i : this.trainingData) {\n // Create a temp array with the last item (result) eliminated\n int[] temp = Arrays.copyOf(i, i.length - 1);\n double distance = this.eucDistance(temp, testData);\n // Add both the result and the distance into associated arraylists\n results.add(i[i.length - 1]);\n distances.add(distance);\n }\n\n // Step 3: Search for the amount of highest points according to k\n ArrayList<Integer> closestResultLst = new ArrayList<Integer>();\n for (int i = 0; i < k; i++) {\n double smallestDistance = Collections.min(distances);\n int indexOfSmallestDistance = distances.indexOf(smallestDistance);\n int resultOfSmallestDistance = results.get(indexOfSmallestDistance);\n closestResultLst.add(resultOfSmallestDistance);\n // Set the smallest distance to null, so it won't be searched again\n distances.set(indexOfSmallestDistance, 10.0);\n }\n\n // Step 4: Determine which one should be the result by looking at the majority of the numbers\n int yes = 0, no = 0;\n for (int i : closestResultLst) {\n if (i == 1) {\n yes++;\n } else if (i == 0) {\n no++;\n }\n }\n\n // Step 5: Return the result\n // test code\n // System.out.println(yes);\n // System.out.println(no);\n if (yes >= no) {\n return 1;\n } else {\n return 0;\n }\n }", "@Test\n public void testIntersection5()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 200000};\n List<Integer> expected = new ArrayList<>();\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "static boolean helper1(Set<String> set, int[] stones, int index, int k) {\n System.out.println(index + \" \" + k);\n for (int i = index + 1; i < stones.length; i++) {\n int gap = stones[i] - stones[index];\n if (gap >= k - 1 && gap <= k + 1) {\n boolean res = helper1(set, stones, i, gap);\n if (res == true) return true;\n } else if (gap > k + 1) break;\n }\n return (index == stones.length - 1);\n }", "@Override\r\n\tpublic MySet intersectSets(MySet[] t) {\r\n\t\tallElements = new ArrayList<Integer>();\r\n\r\n\t\t\r\n\t\tfor(Object element: t[0]) {\r\n\t\t\tallElements.add(element);\r\n\t\t}\r\n\t\r\n\t\tfor(Object e: allElements) {\r\n\t\t\tInteger c = map.getOrDefault(e, 0);\r\n\t\t\tmap.put((E)e, c + 1);\r\n\t\t}\r\n\t\t\r\n\t\tMySet<E> returnSet = (MySet<E>) new Set2<Integer>();\r\n\t\tfor(Map.Entry<E, Integer> entry :map.entrySet())\r\n\t\t\tif(entry.getValue() >= dataSet[0].length) // check\r\n\t\t\t\treturnSet.add(entry.getKey());\r\n\t\t\r\n\t\t\r\n\t\treturn returnSet;\r\n\t}", "@Test\n public void testIntersection3()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n set2.add(i);\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "private static void compareForIdenticalKeys() {\n Integer[] identical = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n\n Insertion insertion = new Insertion();\n insertion.analyzeSort(identical);\n insertion.getStat().printReport();\n\n Selection selection = new Selection();\n selection.analyzeSort(identical);\n selection.getStat().printReport();\n }", "@Override\n public RoaringBitmap compare(RoaringBitmap[] acc, int K, int universeSize) {\n int lastBitSlice = acc.length - 1;\n // use the O'Neil and Quass\n // comparison. (Algo 4.2)\n int beGtrThan = K - 1;\n\n RoaringBitmap beq = new RoaringBitmap();\n beq.flip(0, universeSize); // all ones bitmap\n RoaringBitmap bgt = new RoaringBitmap();\n\n int numberOfLeadingZeroSlices = 32 - (lastBitSlice + 1);\n if (Integer.numberOfLeadingZeros(beGtrThan) < numberOfLeadingZeroSlices)\n return bgt;\n\n // an improvement is that we can stop as soon as there are only trailing\n // ones in the constant.\n int finalSlice = 0;\n finalSlice = Integer.numberOfTrailingZeros(~beGtrThan); // omitted\n // optimization\n\n for (int i = lastBitSlice; i >= finalSlice; --i)\n if ((beGtrThan & (1 << i)) != 0)\n beq.and(acc[i]);\n else {\n bgt.or(RoaringBitmap.and(beq, acc[i]));\n beq.andNot(acc[i]);\n }\n\n return bgt;\n\n }", "public static void crossValidation() {\n\t\t\n\t\t//---------------------分为k折-----------------------------\n\t\t//初始化为k fold\n\t\tfor(int i=0;i<FOLD;i++) {\n\t\t\tArrayList<Point> tmp = new ArrayList<Point>();\n\t\t\tallData.add(tmp);\n\t\t}\n\t\t//选一个 删一个\n\t\tList<Integer> chosen = new ArrayList<Integer>();\n\t\tfor(int i=0;i<dataSet.size();i++) {\n\t\t\tchosen.add(i);\n\t\t}\n\t\t\n\t\t/*//按照原有比例采样\n\t\tfor(int i=0;i<FOLD;i++) { \n\t\t\tint choose = 0;\n\t\t\twhile( choose < ROW/FOLD && i != FOLD-1) {\n\t\t\t\tint p = pData.size() / FOLD; //采样的小类样本的个数\n\t\t\t\tint rand = new Random().nextInt(dataSet.size());\n\t\t\t\tif( choose < p) {\n\t\t\t\t\tif( chosen.contains(rand) && dataSet.get(rand).getLabel() == 0) {\n\t\t\t\t\t\tchosen.remove(new Integer(rand));\n\t\t\t\t\t\tchoose ++;\n\t\t\t\t\t\tallData.get(i).add(dataSet.get(rand));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif( chosen.contains(rand) && dataSet.get(rand).getLabel() != 0) {\n\t\t\t\t\t\tchosen.remove(new Integer(rand));\n\t\t\t\t\t\tchoose ++;\n\t\t\t\t\t\tallData.get(i).add(dataSet.get(rand));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//最后一折全部添加\n\t\t\tif( i == FOLD-1) {\n\t\t\t\tfor (Integer o : chosen) {\n\t\t\t\t\tallData.get(i).add(dataSet.get(o));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}*/\n\t\tfor(int i=0;i<FOLD;i++) { \n\t\t\tint choose = 0;\n\t\t\twhile( choose < ROW/FOLD && i != FOLD-1) {\n\t\t\t\tint rand = new Random().nextInt(dataSet.size());\n\t\t\t\tif( chosen.contains(rand)) {\n\t\t\t\t\tchosen.remove(new Integer(rand));\n\t\t\t\t\tchoose ++;\n\t\t\t\t\tallData.get(i).add(dataSet.get(rand));\n\t\t\t\t}\n\t\t\t}\n\t\t\t//最后一折全部添加\n\t\t\tif( i == FOLD-1) {\n\t\t\t\tfor (Integer o : chosen) {\n\t\t\t\t\tallData.get(i).add(dataSet.get(o));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\t//------------------取一折为测试,其余为训练集-----------------------------\n\t\tfor(int fold=0;fold<FOLD;fold++) {\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\t\n\t\t\tList<Point> trainData = new ArrayList<Point>();\n\t\t\tList<Point> testData = new ArrayList<Point>();\n\t\t\tList<Point> positiveTrainData = new ArrayList<Point>();\n\t\t\tList<Point> positiveTestData = new ArrayList<Point>();\n\t\t\t\n\t\t\ttestData.addAll(allData.get(fold));\n\t\t\tfor (List<Point> ps : allData) {\n\t\t\t\tif( ps != allData.get(fold))\n\t\t\t\t\ttrainData.addAll(ps);\n\t\t\t}\n\t\t\t//select the minority class instances\n\t\t\tfor (Point point : trainData) {\n\t\t\t\tif(point.getLabel() == 0)\n\t\t\t\t\tpositiveTrainData.add(point);\n\t\t\t}\n\t\t\tSystem.out.print(\"train data :\"+trainData.size() + \"\\t\");\n\t\t\tSystem.out.println(\"train positive :\"+positiveTrainData.size());\n\t\t\tfor (Point point : testData) {\n\t\t\t\tif(point.getLabel() == 0)\n\t\t\t\t\tpositiveTestData.add(point);\n\t\t\t}\n\t\t\tSystem.out.print(\"test data :\"+testData.size() + \"\\t\");\n\t\t\tSystem.out.println(\"test positive :\"+positiveTestData.size());\n\t\t\t\n\t\t\tborderline(positiveTrainData,trainData);\n\t\t\t\n\t\t\t//generate new dataset\n\t\t\tString trainFileName = NAME + \"BLTrain\"+fold+\".arff\";\n\t\t\tString testFileName = NAME + \"BLTest\"+fold+\".arff\";\n\t\t\t//TODO dataSet is a bug\n\t\t\tGenerate.generate(trainData,pointSet,COL,fileName,trainFileName);\n\t\t\tGenerate.generate(testData,new ArrayList<Point>(),COL,fileName,testFileName);\n\t\t\tpointSet.clear();\n\t\t\tlong endGenerating = System.currentTimeMillis();\n\t\t\tSystem.out.println(\"产生数据所用时间为:\"+ (endGenerating-start)*1.0/1000 + \"s\");\n\t\t\t\n\t\t\t\n\t\t/*\t//不进行任何处理\n\t\t\ttrainFileName = NAME + \"TrainWS\"+\".arff\";\n\t\t\ttestFileName = NAME + \"TestWS\"+\".arff\";\n\t\t\tGenerate.generate(dataSet,new ArrayList<Point>(),COL,fileName,trainFileName);\n\t\t\tGenerate.generate(testSet,new ArrayList<Point>(),COL,fileName,testFileName);\n//\t\t\tpointSet.clear();\n\t*/\t\t\n\t\t\t\n\t\t\t\n\t\t\tclassify(trainFileName,testFileName);\n\t\t\tlong endClassifying = System.currentTimeMillis();\n\t\t\tSystem.out.println(\"产生数据所用时间为:\"+ (endClassifying-start)*1.0/1000 + \"s\");\n\t\t}\n\t}", "@Test\n public void testIndexMaintenanceWithIndexOnMethodAsSet() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID\",\n SEPARATOR + \"portfolio.asSet() pf\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForValues(ri);\n }", "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "private static void k_means_online(double[][] X, int k, String[] args){\n double[][] m = chooseKCluserCentres(k, X[0].length);\n double[][] oldM = m;\n \n //while loop and stopping condition\n int count = 0;\n \n //the index of each m associated to X, done below\n //first array is list of m's, second will be associated X_row indexes\n /*int[][] X_Assignments = new int[k][noRows];*/\n List<List<Integer>> X_Assignments = initXAssignments(m);\n\n \tboolean continue_ = findTermination(count, oldM, m);\n while(continue_){\n \toldM = m;\n \tX_Assignments = initXAssignments(m);\n\n \tfor(int i=0; i<X.length; i++){\n \t\tint minClusterIndex = findMinClusterIndex(X[i], m);\n \t\t//System.out.println(minClusterIndex);\n \t\tX_Assignments.get(minClusterIndex).add(i); //add to the list of clusters to points\n \t}\n\n \t//Check lists\n \t//printDoubleArrayList(X_Assignments);\n\n \tfor (int i=0; i<m.length; i++){\n \t\tm[i] = findClusterMean(X, X_Assignments, m, i); //finds for every dimension \n \t}\n\n \tcontinue_ = findTermination(count, oldM, m);\n \tcount++;\n }\n\n double sumOfSquaresError = findSumOfSquaresError(X, m);\n printOutput(X_Assignments, m, sumOfSquaresError, k, count);\n\n //append output file specified by args[1]\n //writeOutputToFile (args[0], k, m, sumOfSquaresError, args[1]);\n }", "@Override\n protected int selectNextClusterIndex(\n final double[] minDistances,\n final boolean[] selected)\n {\n double maxMinDistance = Double.MAX_VALUE;\n int maxIndex = 0;\n\n final int elementCount = minDistances.length;\n for (int i = 0; i < elementCount; i++)\n {\n if (selected[i])\n {\n // Skip clusters we've already selected.\n continue;\n }\n\n // Get the current minimum distance for the element.\n double minDistance = minDistances[i];\n\n if (maxIndex == 0 || minDistance > maxMinDistance)\n {\n // This is the minium seen so far, so keep track of\n // it.\n maxIndex = i;\n maxMinDistance = minDistance;\n }\n }\n\n if (maxMinDistance <= 0.0)\n {\n // There are not enough points to prevent selecting two\n // that are on top of each other.\n return -1;\n }\n else\n {\n return maxIndex;\n }\n }", "public Map<Integer, Boolean> testCategorization(String topic, String[] features) {\n\n\t\tint n = trainingSet.size(); // Count docs.\n\n\t\t// Count docs in class.\n\t\tint nc = 0;\n\t\tfor (Integer id : trainingSet) {\n\t\t\tboolean inClass = this.getDocument(id).getTopics().contains(topic);\n\t\t\tif (inClass)\n\t\t\t\tnc++;\n\t\t}\n\n\t\tdouble prior_c = nc / (double) n;\n\t\tdouble prior_cbar = (n - nc) / (double) n;\n\n\t\tMap<String, Double> condProb_c = new HashMap<String, Double>();\n\t\tMap<String, Double> condProb_cbar = new HashMap<String, Double>();\n\n\t\t// Count docs in class containing term.\n\t\tfor (String term : features) {\n\t\t\tSet<Integer> postings = terms.get(term).getPostings().keySet();\n\t\t\tint nct_c = 0, nct_cbar = 0;\n\t\t\tfor (Integer id : trainingSet) {\n\t\t\t\tboolean inClass = this.getDocument(id).getTopics().contains(topic);\n\t\t\t\tif (postings.contains(id)) { // document contains the term\n\t\t\t\t\tif (inClass)\n\t\t\t\t\t\tnct_c++;\n\t\t\t\t\telse\n\t\t\t\t\t\tnct_cbar++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// And calculate conditional probabilities.\n\t\t\tcondProb_c.put(term, (nct_c + 1) / (double) (nc + 2));\n\t\t\tcondProb_cbar.put(term, (nct_cbar + 1) / (double) ((n - nc) + 2));\n\t\t}\n\n\t\t// ---APPLY BERNOULLI----\n\n\t\tMap<Integer, Boolean> marked = new HashMap<Integer, Boolean>();\n\t\tfor (Integer id : testSet) {\n\t\t\tdouble score_c = Math.log(prior_c);\n\t\t\tdouble score_cbar = Math.log(prior_cbar);\n\t\t\tfor (String term : features) {\n\t\t\t\tSet<Integer> postings = terms.get(term).getPostings().keySet();\n\t\t\t\tif (postings.contains(id)) {\n\t\t\t\t\tscore_c += Math.log(condProb_c.get(term));\n\t\t\t\t\tscore_cbar += Math.log(condProb_cbar.get(term));\n\t\t\t\t} else {\n\t\t\t\t\tscore_c += Math.log(1 - condProb_c.get(term));\n\t\t\t\t\tscore_cbar += Math.log(1 - condProb_cbar.get(term));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (score_c > score_cbar)\n\t\t\t\tmarked.put(id, true);\n\t\t\telse\n\t\t\t\tmarked.put(id, false);\n\t\t}\n\t\treturn marked;\n\t}", "@Test\n public void testComputeJaccardSimilarity() {\n // Test case 1\n String text = \"abcdef\";\n Set<String> actualKShingles = KShingling.getKShingles(3, text);\n Set<String> expectedKShingles = new HashSet<String>();\n expectedKShingles.add(\"abc\");\n expectedKShingles.add(\"bcd\");\n expectedKShingles.add(\"cde\");\n expectedKShingles.add(\"def\");\n\n // Asserts that both sets have the same size.\n Assert.assertEquals(expectedKShingles.size(), actualKShingles.size());\n\n // Asserts that all elements of the expected set of shingles is included\n // in the actual sets of shingles.\n for (String kShingle : expectedKShingles) {\n Assert.assertTrue(actualKShingles.contains(kShingle));\n }\n\n // Test case 2\n text = \"ab\";\n actualKShingles = KShingling.getKShingles(3, text);\n expectedKShingles = new HashSet<String>(); // No shingles is fine\n\n // Asserts that both sets have the same size.\n Assert.assertEquals(expectedKShingles.size(), actualKShingles.size());\n\n // Asserts that all elements of the expected set of shingles is included\n // in the actual sets of shingles.\n for (String kShingle : expectedKShingles) {\n Assert.assertTrue(actualKShingles.contains(kShingle));\n }\n\n // Test case 3\n text = \"abc def ghi\";\n actualKShingles = KShingling.getKShingles(4, text);\n expectedKShingles = new HashSet<String>();\n expectedKShingles.add(\"abc \");\n expectedKShingles.add(\"bc d\");\n expectedKShingles.add(\"c de\");\n expectedKShingles.add(\" def\");\n expectedKShingles.add(\"def \");\n expectedKShingles.add(\"ef g\");\n expectedKShingles.add(\"f gh\");\n expectedKShingles.add(\" ghi\");\n\n // Asserts that both sets have the same size.\n Assert.assertEquals(expectedKShingles.size(), actualKShingles.size());\n\n // Asserts that all elements of the expected set of shingles is included\n // in the actual sets of shingles.\n for (String kShingle : expectedKShingles) {\n Assert.assertTrue(actualKShingles.contains(kShingle));\n }\n }", "private void processIterationResults(Map<String, List<MutablePair<String, Double>>> continuousChoices,\n\t\t\tMap<String, Pair<String, Double>> iterationChoices, Map<String, List<String>> clusters,\n\t\t\tList<Mention> copyContext) {\n\t\tfor (Map.Entry<String, Pair<String, Double>> iterationChoice : iterationChoices.entrySet()) {\n\t\t\tfinal String key = iterationChoice.getKey();\n\t\t\tList<MutablePair<String, Double>> continuousPairs = continuousChoices.get(key);\n\t\t\tif (continuousPairs == null) {\n\t\t\t\tcontinuousPairs = Lists.newArrayList();\n\t\t\t\tcontinuousChoices.put(key, continuousPairs);\n\t\t\t}\n\n\t\t\tboolean found = false;\n\t\t\tfinal Pair<String, Double> iterationChoicePair = iterationChoice.getValue();\n\t\t\tfor (MutablePair<String, Double> continuousPair : continuousPairs) {\n\t\t\t\tif (continuousPair.getKey().equals(iterationChoicePair.getKey())) {\n\t\t\t\t\t// Same entity = 'Collision' - so modify/update score accordingly\n\t\t\t\t\tfound = true;\n\t\t\t\t\t// It's the same pair, so let's combine them!\n\t\t\t\t\tfinal Double currentValue = continuousPair.getValue();\n\t\t\t\t\tfinal Double newValue = computeNewValue(this.context.size() - clusters.size(), currentValue,\n\t\t\t\t\t\t\titerationChoicePair.getValue());\n\t\t\t\t\tcontinuousPair.setValue(newValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!found) {\n\t\t\t\t// TODO: Check if logic really holds as rn I'm not sure whether there really is\n\t\t\t\t// exactly one pair here if it doesn't exist yet\n\t\t\t\t//\n\t\t\t\t// Not a collision, so just add it\n\t\t\t\tcontinuousPairs.add(new MutablePair<String, Double>(iterationChoicePair.getLeft(),\n\t\t\t\t\t\tinitVal(iterationChoicePair.getRight())));\n\t\t\t}\n\t\t}\n\n\t\tDouble minValue = Double.MAX_VALUE;\n\t\tPair<String, Double> minPair = null;\n\t\tString minKey = null;\n\t\t// Find the entity-score pair for the worst surface form\n\t\tfor (Map.Entry<String, Pair<String, Double>> e : iterationChoices.entrySet()) {\n\t\t\tfinal Pair<String, Double> currentPair = e.getValue();\n\t\t\tfinal Double currentValue = currentPair.getRight();\n\t\t\tif (currentValue <= minValue) {\n\t\t\t\tminKey = e.getKey();\n\t\t\t\tminPair = currentPair;\n\t\t\t\tminValue = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Remove surface form with worst result (as it likely is noise)\n\t\tclusters.remove(minKey);\n\t\tMentionUtils.removeStringMention(minKey, copyContext);\n\n\t}", "private static void mergeNext() {\n\t\tString ids[] = getMinGeneIds();\n\t\tString minI = ids[0];\n\t\tString minJ = ids[1];\n\t\tString newEntry = createNewEntry(minI, minJ);\n\t\tTreeMap<String, Double> prevI = distanceMatrix.remove(minI);\n\t\tTreeMap<String, Double> prevJ = distanceMatrix.remove(minJ);\n\t\tminMatrix.remove(minI);minMatrix.remove(minJ);\n\t\tallClusters.remove(minI);allClusters.remove(minJ);\n\t\tTreeMap<String, Double> newTemp = new TreeMap<String, Double>(); \n\t\tfor(String c: allClusters) {\n\t\t\tTreeMap<String, Double> temp = distanceMatrix.get(c);\n\t\t\ttemp.remove(minI);temp.remove(minJ);\n\t\t\tdouble dist1 = prevI.get(c);\n\t\t\tdouble dist2 = prevJ.get(c);\n\t\t\tif(dist1 < dist2) {\n\t\t\t\tnewTemp.put(c,dist1);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist1);\n\t\t\t\ttemp.put(newEntry, dist1);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist1);\n\t\t\t} else {\n\t\t\t\tnewTemp.put(c,dist2);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist2);\n\t\t\t\ttemp.put(newEntry, dist2);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist2);\n\t\t\t}\n\t\t\tdistanceMatrix.put(c, temp);\n\t\t}\n\t\tdistanceMatrix.put(newEntry, newTemp);\n\t\tallClusters.add(newEntry);\n\t\ttotalCluster = allClusters.size();\n\t}", "private int PASSSelection(HashMap<Integer, Integer> T, HashMap<Integer, Integer> colours, ColEdge[] edge){\r\n\t\tHashMap<Integer, Integer> bestBoiStorage = new HashMap<>();\r\n\t\tHashMap<Integer, Integer> bestBoiFinder = new HashMap<>();\r\n\t\tfor(int s = 0; s < T.size(); s++){\r\n\t\t\tint coloursPos = 0;\r\n\t\t\tVs = T.get(s);\r\n\t\t\tfor(int i = 1; i < T.size(); i++){\r\n\t\t\t\tif(i != s){\r\n\t\t\t\t\tVi = T.get(i);\r\n\t\t\t\t\tcoloursPos += same(edge, colours, Vs, Vi);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbestBoiStorage.put(s, Vs);\r\n\t\t\tbestBoiFinder.put(s, coloursPos);\r\n\t\t}\r\n\t\tint mostColPos = 0;\r\n\t\tint mostColKey = 0;\r\n\t\tfor(int b = 0; b < bestBoiFinder.size(); b++){\r\n\t\t\tif(mostColPos == 0 || bestBoiFinder.get(b).compareTo(mostColPos) > 0){\r\n\t\t\t\tmostColPos = bestBoiFinder.get(b);\r\n\t\t\t\tmostColKey = b;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn bestBoiStorage.get(mostColKey);\r\n\t}", "public void testDifferentDotProducts() {\n List<ISpectrum> spectra = ClusteringTestUtilities.readISpectraFromResource();\n\n ISpectrum[] spectrums = (ISpectrum[]) spectra.toArray();\n\n int total = 0;\n int different = 0;\n ISimilarityChecker checker = new FrankEtAlDotProduct(0.5F, 15, true);\n ISimilarityChecker currentChecker = new FrankEtAlDotProductJohannes();\n\n Set<String> interestingIds = new HashSet<>();\n\n\n for (int i = 0; i < spectrums.length; i++) {\n ISpectrum psm1 = spectrums[i];\n for (int j = i + 1; j < spectrums.length; j++) {\n ISpectrum psm2 = spectrums[j];\n double dotOrg = checker.assessSimilarity(psm1, psm2);\n double dotNew = currentChecker.assessSimilarity(psm1, psm2);\n\n if (Math.abs(dotOrg - dotNew) > 0.00001) {\n different++;\n\n StringBuilder usedPeaksTester = new StringBuilder();\n\n // these are the really interesting cases\n dotOrg = checker.assessSimilarity(psm1, psm2);\n\n double noClosestPeak = dotNew;\n dotNew = currentChecker.assessSimilarity(psm1, psm2);\n String id2 = psm2.getId();\n String id1 = psm1.getId();\n interestingIds.add(id1);\n interestingIds.add(id2);\n\n // System.out.println(usedPeaksTester.toString());\n // System.out.printf(id2 + \":\" + id1 + \" \" + \"Old: %8.3f Newx: %8.3f New: %8.3f\\tDiff: %8.3f\\n\", dotOrg, noClosestPeak, dotNew, dotOrg - dotNew);\n }\n total++;\n\n }\n\n }\n\n List<String> sorted = new ArrayList<>(interestingIds);\n Collections.sort(sorted);\n // System.out.println(\"Interesting Ids\");\n for (String s : sorted) {\n // System.out.println(s);\n }\n\n\n TestCase.assertEquals(0, different);\n }", "public int[] findClusterCorrespondence(int[] idx1, int[] idx2) {\n\t\tint n = idx1.length;\n\t\tif (n != idx2.length) {\n\t\t\tSystem.out.println(\"Cluster Utils: findClusterCorrespondence: idx1 and idx2 has to have same number of elements\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// find unique values in idx1 and idx2\n\t\tUniqueResult<Integer> ur_idx1 = utils.findUnique(idx1);\n\t\tUniqueResult<Integer> ur_idx2 = utils.findUnique(idx2);\n\t\tif (ur_idx1.domain.length != ur_idx2.domain.length) {\n\t\t\tSystem.out.println(\"Cluster Utils: findClusterCorrespondence: idx1 and idx2 has different number of clusters\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// find Jaccard coefficient\n\t\tdouble[][] J = findJaccardIndex(idx1, idx2);\n\t\t\n\t\t// use Hungarian method - use any kind of Hungarian algorithm\n\t\tHungarianAlgorithm h = new HungarianAlgorithm();\n\t\t@SuppressWarnings(\"static-access\")\n\t\tint[][] match = h.hgAlgorithm(J, \"max\");\n\t\t\n\t\t// print match matrix\n\t\tif (verbose) {\n\t\t\tSystem.out.println(\"Hunguarian Cost Matrix\");\n\t\t\tutils.printMatrix(match);\n\t\t}\n\t\t\n\t\t// relabel the idx2\n\t\tif (verbose) System.out.println(\"Class correspondents matrix:\");\n\t\tint[] target = idx1.clone();\n\t\tfor (int i = 0; i < match.length; i++) {\n\t\t\tint idx1_index = ur_idx1.domain[match[i][0]];\n\t\t\tint idx2_index = ur_idx2.domain[match[i][1]];\n\t\t\tif (verbose) System.out.printf(\"%d\\t%d\", idx1_index, idx2_index);\t\t\t\n\t\t\tif (idx1_index != idx2_index) {\n\t\t\t\tif (verbose) System.out.printf(\"\\t(will replace all %d in idx2 by %d)\", idx2_index, idx1_index);\n\t\t\t\tboolean[] index = utils.getIndexByValue(idx2, idx2_index);\n\t\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t\tif (index[j]) target[j] = idx1_index;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (verbose) System.out.printf(\"\\n\");\n\t\t}\n\t\t\n\t\tif (verbose) {\n\t\t\tint v_tt = 15;\n\t\t\tif (target.length < v_tt) v_tt = target.length;\n\t\t\tSystem.out.printf(\"Printing first %d elements of input and output arrays\\n\", v_tt);\n\t\t\tSystem.out.printf(\"IDX1\\tIDX2\\tFINAL IDX\\n\");\n\t\t\tfor (int i = 0; i < v_tt; i++) System.out.printf(\"%d\\t%d\\t%d\\n\", idx1[i], idx2[i], target[i]);\n\t\t}\n\t\t\n\t\treturn target;\n\t}", "public void search(IndexShort < O > index, short range, short k)\n throws Exception {\n // assertEquals(index.aDB.count(), index.bDB.count());\n // assertEquals(index.aDB.count(), index.bDB.count());\n // index.stats();\n index.resetStats();\n // it is time to Search\n int querySize = 1000; // amount of elements to read from the query\n String re = null;\n logger.info(\"Matching begins...\");\n File query = new File(testProperties.getProperty(\"test.query.input\"));\n File dbFolder = new File(testProperties.getProperty(\"test.db.path\"));\n BufferedReader r = new BufferedReader(new FileReader(query));\n List < OBPriorityQueueShort < O >> result = new LinkedList < OBPriorityQueueShort < O >>();\n re = r.readLine();\n int i = 0;\n long realIndex = index.databaseSize();\n\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n OBPriorityQueueShort < O > x = new OBPriorityQueueShort < O >(\n k);\n if (i % 100 == 0) {\n logger.info(\"Matching \" + i);\n }\n\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n if(i == 279){\n System.out.println(\"hey\");\n }\n index.searchOB(s, range, x);\n result.add(x);\n i++;\n }\n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n \n logger.info(index.getStats().toString());\n \n int maxQuery = i;\n // logger.info(\"Matching ends... Stats follow:\");\n // index.stats();\n\n // now we compare the results we got with the sequential search\n Iterator < OBPriorityQueueShort < O >> it = result.iterator();\n r.close();\n r = new BufferedReader(new FileReader(query));\n re = r.readLine();\n i = 0;\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n if (i % 300 == 0) {\n logger.info(\"Matching \" + i + \" of \" + maxQuery);\n }\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n OBPriorityQueueShort < O > x2 = new OBPriorityQueueShort < O >(\n k);\n searchSequential(realIndex, s, x2, index, range);\n OBPriorityQueueShort < O > x1 = it.next();\n //assertEquals(\"Error in query line: \" + i + \" slice: \"\n // + line, x2, x1); \n \n assertEquals(\"Error in query line: \" + i + \" \" + index.debug(s) + \"\\n slice: \"\n + line + \" \" + debug(x2,index ) + \"\\n\" + debug(x1,index), x2, x1);\n\n i++;\n }\n \n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n r.close();\n logger.info(\"Finished matching validation.\");\n assertFalse(it.hasNext());\n }", "public final void test(final List<T> nodes) {\n Graph<T> approximate_graph = computeGraph(nodes);\n\n // Use Brute force to build the exact graph\n Brute brute = new Brute();\n brute.setK(k);\n brute.setSimilarity(similarity);\n Graph<T> exact_graph = brute.computeGraph(nodes);\n\n int correct = 0;\n for (T node : nodes) {\n correct += approximate_graph.getNeighbors(node)\n .countCommons(exact_graph.getNeighbors(node));\n }\n\n System.out.println(\n \"Computed similarities: \" + this.getComputedSimilarities());\n double speedup_ratio\n = (double) (nodes.size() * (nodes.size() - 1) / 2)\n / this.getComputedSimilarities();\n System.out.println(\"Speedup ratio: \" + speedup_ratio);\n\n double correct_ratio = (double) correct / (nodes.size() * k);\n System.out.println(\"Correct edges: \" + correct\n + \" (\" + correct_ratio * 100 + \"%)\");\n\n System.out.println(\"Quality-equivalent speedup: \"\n + speedup_ratio * correct_ratio);\n }", "@Override\n public VectorEquality compareTo(PredicateVector vectorCmp) {\n try {\n PredicateVector vectorLarge;\n PredicateVector vectorSmall;\n VectorEquality cmpResult;\n \n if (flagged || vectorCmp.flagged) {\n return VectorEquality.UNIQUE;\n }\n \n // TODO: add size check\n \n if (this.size() > vectorCmp.size() && !this.values().iterator().next().isEmpty()) {\n vectorLarge = this;\n vectorSmall = vectorCmp;\n cmpResult = VectorEquality.SUPERSET;\n } else {\n vectorLarge = vectorCmp;\n vectorSmall = this;\n cmpResult = VectorEquality.SUBSET;\n }\n \n int largeVectorIter = 0;\n int numEq = 0;\n \n List<Integer> vectorSmallKeys = new ArrayList<Integer>(vectorSmall.keySet());\n Collections.sort(vectorSmallKeys);\n \n List<Integer> vectorLargeKeys = new ArrayList<Integer>(vectorLarge.keySet());\n Collections.sort(vectorLargeKeys);\n\n int i = 0;\n\n for (Integer smallVectorKey: vectorSmallKeys) {\n StateVector smallVectorState = vectorSmall.get(smallVectorKey);\n // Check if we have not iterated over all large vector states\n if (largeVectorIter >= vectorLargeKeys.size() && !smallVectorState.isEmpty()) {\n cmpResult = VectorEquality.UNIQUE;\n break;\n }\n \n \n for (i = largeVectorIter; i < vectorLargeKeys.size(); i++) {\n StateVector largeVectorState = vectorLarge.get(vectorLargeKeys.get(i));\n VectorEquality cmpVectorResult = smallVectorState.compareTo(largeVectorState); \n if (cmpVectorResult == VectorEquality.EQUAL) {\n numEq += 1;\n break;\n }\n \n if (cmpVectorResult == VectorEquality.SUPERSET || cmpVectorResult == VectorEquality.SUBSET) {\n cmpResult = cmpVectorResult;\n numEq += 1;\n break;\n }\n }\n \n largeVectorIter = i + 1; // TODO: double check i+1\n }\n \n if (numEq < vectorSmall.size() && !vectorSmall.values().iterator().next().isEmpty())\n cmpResult = VectorEquality.UNIQUE;\n \n return cmpResult;\n } catch (ArrayIndexOutOfBoundsException e) {\n e.printStackTrace();\n }\n \n return VectorEquality.UNIQUE;\n }", "public static void pseudoTrueTuples(LogicProblem logicProblem, boolean applyChanges)\r\n throws RelationshipConflictException {\n \r\n HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable();\r\n HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs();\r\n \r\n// System.out.println(\"searching...\");\r\n //within a subgrid\r\n for (CategoryPair categoryPair : categoryPairs) {\r\n// System.out.println(\"Category pair:\" + categoryPair);\r\n //vertical and horizontal search\r\n for (final boolean verticalOrientation : new boolean[] { false, true } ) {\r\n\r\n Category subrowCategory = verticalOrientation?categoryPair.first():categoryPair.last();\r\n Category subcolumnCategory = verticalOrientation?categoryPair.last():categoryPair.first();\r\n\r\n //commenting \"vertical search\" \r\n //(subrows match first category's items\r\n // subcolumns match second category's items)\r\n\r\n //i (2 to floor(n/2)) is the number of elements in the combination tuple\r\n // i=2 in pseudoTrue pairs\r\n //(for subgrids of 5x5 items, looking for both pairs and triplets becomes redundant\r\n for (int i=2; i<=floor(logicProblem.getNumCategories()/2);i++) {\r\n\r\n //https://github.com/dpaukov/combinatoricslib3/wiki/v3.3.0#1-simple-combinations\r\n List<List<Item>> columnCombinations = Generator.combination(subcolumnCategory.getItems())\r\n .simple(i) //for pseudo true pairs, i=2\r\n .stream()\r\n .collect(Collectors.<List<Item>>toList());\r\n //for i=2, this would contain \r\n //Bethany, Donovan\r\n //Bethany, Elizabeth\r\n //...\r\n //Frederick, Peyton\r\n// columnCombinations.stream().forEach(l -> System.out.println(\r\n// (verticalOrientation?\"vertical\":\"horizontal\")+ \" combo: \"+l.toString()));\r\n\r\n //create the sets\r\n //for each combination, start over\r\n \r\n //columnTuple contains i items with which we will compute set intersections\r\n for (List<Item> columnItemTuple : columnCombinations) {\r\n //Bethany, Donovan\r\n \r\n //similarly, valueNoSets contains i sets of VALUE_NO relationships\r\n List<Set<Item>> valueNoSets = new ArrayList<>(); //size=i\r\n //build a set for each i item of columnTuple\r\n for (Item columnItem : columnItemTuple) {\r\n //Bethany\r\n Set<Item> valueNoSet = new HashSet<>(); //size = n\r\n for (Item rowItem : subrowCategory.getItems()) {\r\n //Haley's Comet ....\r\n if (relationshipTable.get(new ItemPair(rowItem, columnItem)).getValue() == Relationship.ValueType.VALUE_NO)\r\n //stacking all VALUE_NO relationship into vertical set\r\n valueNoSet.add(rowItem); //store into single subcolumn set \r\n }\r\n //adding each vertical set into list of sets\r\n if (valueNoSet.size() >= logicProblem.getNumItems() - i //for pairs, we need three VALUE_NO in the set\r\n && valueNoSet.size() < logicProblem.getNumItems()-1) //uniqueness will take or n-1 cases\r\n valueNoSets.add(valueNoSet); //store single subcolumn into multi-set\r\n }\r\n //magic!\r\n Set<Item> intersectionSet = new HashSet<>(); //avoid NPE when the next call is made\r\n if (valueNoSets.size()>=2) //don't compute intersections otherwise\r\n intersectionSet = Processor.multiSetIntersection(valueNoSets);\r\n\r\n if (intersectionSet.size()==logicProblem.getNumItems()-i) {\r\n \r\n// System.out.println(\"----> found candidates for pseudo true pairs!\");\r\n// intersectionSet.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n// System.out.println(\"\\t\\tvs.\");\r\n// columnItemTuple.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n \r\n //create predecessor list\r\n //we can only add the intersection output as predecessors\r\n ArrayList<Dependable> predecessors = new ArrayList<Dependable>();\r\n for (Item intersectionColumn : intersectionSet) {\r\n for (Item rowItem : columnItemTuple) {\r\n predecessors.add(relationshipTable.get(new ItemPair(rowItem, intersectionColumn)));\r\n }\r\n }\r\n\r\n\r\n //we have a bunch of work to do\r\n for (Item everyRowItem : subrowCategory.getItems()) {\r\n //for every row item not in the intersectionSet\r\n if (!intersectionSet.contains(everyRowItem)) {\r\n for (Item everyColumnItem : subcolumnCategory.getItems()) {\r\n //for every column item not in any of the columnTuple list\r\n if (!columnItemTuple.contains(everyColumnItem)) {\r\n Relationship rel = relationshipTable.get(new ItemPair(everyRowItem,everyColumnItem));\r\n if (rel.getValue()!=Relationship.ValueType.VALUE_NO)\r\n Processor.setRelationship(logicProblem, applyChanges, rel, \r\n Relationship.ValueType.VALUE_NO, Relationship.LogicType.PSEUDOTRUE,\r\n predecessors.toArray(new Relationship[predecessors.size()])); \r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "public void reduce(Text prefix, Iterator<IntWritable> iter,\n OutputCollector<Text, IntWritable> output, Reporter reporter) throws IOException {\nint a000_ = 0;\nint a001_ = 0;\nint a002_ = 0;\nint a003_ = 0;\nint a004_ = 0;\nint a005_ = 0;\nint a006_ = 0;\nint a007_ = 0;\nint a008_ = 0;\nint a009_ = 0;\nint a010_ = 0;\nint a011_ = 0;\nint a012_ = 0;\nint a013_ = 0;\nint a014_ = 0;\nint a015_ = 0;\nint a016_ = 0;\nint a017_ = 0;\nint a018_ = 0;\nint a019_ = 0;\nint a020_ = 0;\nint a021_ = 0;\nint a022_ = 0;\nint a023_ = 0;\nint a024_ = 0;\nint cur_ = 0;\n\nwhile (iter.hasNext()) {\ncur_ = iter.next().get();\na012_ = a000_ - a017_;\na004_ = cur_ - 2;\na008_ = a018_ - a009_;\na020_ = a020_ - cur_;\na021_ = a001_ - a009_;\na010_ = a002_ + a004_;\na013_ = a005_ + a005_;\na009_ = a019_ + a012_;\na008_ = a008_ * -5;\na021_ = a022_ - a023_;\na002_ = a020_ - a022_;\na019_ = cur_ + a020_;\ncur_ = cur_ + a008_;\na020_ = a006_ + a021_;\na021_ = a008_ - a017_;\na017_ = a021_ - a009_;\ncur_ = a011_ - a005_;\nif (a004_ == a007_) {\na007_ = -2 - a015_;\na022_ = a005_ - a019_;\na013_ = a010_ - a022_;\na024_ = a009_ + a000_;\na018_ = a003_ - 3;\na019_ = a021_ - a002_;\na000_ = a017_ + cur_;\na010_ = a020_ - 1;\na000_ = a020_ - a024_;\na017_ = a004_ + a007_;\na009_ = a001_ - a010_;\na015_ = a018_ + a022_;\na023_ = a013_ + a016_;\na024_ = cur_ - a019_;\na015_ = a013_ - a017_;\na024_ = a003_ - a021_;\na018_ = a003_ - a023_;\n} else {\na011_ = a006_ + a023_;\na018_ = a003_ - a015_;\na022_ = a008_ - a007_;\na005_ = a001_ - cur_;\na007_ = a000_ + a012_;\na000_ = a007_ + a023_;\na009_ = cur_ + a010_;\na018_ = -1 + a001_;\na003_ = -2 + a005_;\na006_ = a009_ + a020_;\na001_ = a017_ + a022_;\na024_ = a009_ + a006_;\na005_ = a017_ - a023_;\na004_ = a017_ - a019_;\na015_ = a018_ - a018_;\na021_ = a019_ + a011_;\na024_ = a009_ - a014_;\na009_ = 0 + a023_;\na020_ = a011_ + a006_;\na012_ = a005_ - a011_;\na010_ = a001_ - a018_;\na012_ = a002_ - a003_;\ncur_ = a006_ - a013_;\n}\na000_ = a023_ + a012_;\na008_ = a016_ - a018_;\na024_ = a018_ + a010_;\na013_ = a018_ + a002_;\na009_ = a016_ + a015_;\na005_ = a002_ + a009_;\na004_ = a009_ + a011_;\na011_ = a011_ + a013_;\na022_ = a019_ + a008_;\na017_ = a016_ + a010_;\na014_ = a012_ - a023_;\na005_ = a019_ - a001_;\na005_ = a013_ * -4;\na009_ = a020_ + a008_;\na012_ = a020_ - a001_;\na013_ = a016_ - a000_;\na012_ = a003_ + a000_;\na022_ = a001_ + a002_;\na001_ = a010_ - a024_;\na003_ = a008_ + a015_;\na012_ = a012_ - a020_;\na001_ = a019_ + a015_;\na009_ = a002_ + a018_;\na021_ = a024_ - a006_;\nif (a024_ == a014_) {\na006_ = a002_ + a016_;\na003_ = a020_ - 2;\na008_ = a020_ - a018_;\na015_ = a012_ + a001_;\na008_ = cur_ - a014_;\na001_ = a002_ - a008_;\na004_ = a015_ + a011_;\na024_ = -4 + a020_;\na021_ = a013_ + a012_;\na005_ = a012_ + a001_;\na009_ = a012_ + a018_;\na023_ = a016_ - a003_;\na011_ = a019_ - a012_;\na005_ = a000_ - a008_;\na004_ = a024_ - a011_;\na022_ = a024_ - a009_;\na005_ = a007_ + a011_;\na001_ = a012_ + a000_;\na006_ = a020_ - cur_;\na015_ = a020_ - 1;\n} else {\na001_ = a006_ - a019_;\na019_ = 2 - a014_;\ncur_ = a021_ + a009_;\na023_ = a010_ + 3;\na005_ = a018_ + a019_;\na015_ = cur_ + a020_;\na001_ = a009_ - a021_;\na016_ = a009_ - a004_;\na005_ = a003_ + a023_;\na006_ = a008_ - a008_;\ncur_ = a013_ - -3;\na018_ = a007_ + a009_;\nif (a011_ <= a024_) {\na001_ = a001_ - a007_;\na018_ = a001_ - a010_;\na015_ = a016_ + a008_;\na009_ = a013_ - a015_;\na001_ = a018_ + a001_;\na001_ = a024_ - a002_;\na018_ = a006_ + a015_;\na001_ = a000_ - 0;\na022_ = a024_ - a009_;\na011_ = a008_ - a015_;\na009_ = a017_ + a000_;\na016_ = a005_ + a023_;\na001_ = a007_ - a023_;\na008_ = a023_ - a020_;\na023_ = a005_ - a016_;\na020_ = a024_ + a008_;\na005_ = a008_ - a003_;\na016_ = a006_ + a011_;\na006_ = a004_ + a014_;\na013_ = -2 - a001_;\na021_ = a008_ - a005_;\na000_ = a011_ - a016_;\na024_ = a008_ - a000_;\na007_ = a008_ + a013_;\n} else {\na021_ = a010_ + a018_;\na005_ = a013_ - a023_;\na012_ = a011_ - a024_;\na014_ = a002_ + a009_;\na022_ = a022_ + a015_;\na024_ = a008_ + a021_;\ncur_ = a014_ + a009_;\na018_ = a004_ + a015_;\na004_ = a018_ + a004_;\na020_ = a013_ + a005_;\na017_ = a012_ - a007_;\na011_ = a017_ - a005_;\na015_ = a012_ - a014_;\na020_ = 2 - a009_;\na019_ = a001_ + a023_;\na003_ = a008_ - a020_;\ncur_ = a005_ - a001_;\na016_ = a011_ + a022_;\na005_ = a010_ + cur_;\na018_ = a021_ - a016_;\na022_ = a005_ - a016_;\n}\nif (a011_ == a020_) {\na017_ = a007_ + a006_;\na017_ = a001_ - a002_;\na003_ = a005_ + a023_;\na012_ = a007_ + a021_;\na005_ = a020_ + a005_;\na023_ = a019_ + a003_;\na019_ = a016_ - a013_;\na013_ = a008_ + a002_;\na023_ = a004_ - a020_;\na014_ = a000_ + a013_;\na015_ = a008_ + a011_;\na010_ = a004_ - a014_;\na020_ = a022_ - a013_;\na020_ = a011_ + a015_;\na021_ = a021_ + a021_;\na024_ = a009_ - 2;\na012_ = a014_ - a018_;\na014_ = a009_ + a024_;\na021_ = a019_ - a007_;\nif (a006_ <= a022_) {\ncur_ = a004_ - a006_;\na022_ = a021_ - a003_;\na013_ = a023_ - a001_;\na011_ = a017_ - a009_;\na002_ = a000_ + a005_;\na019_ = a005_ + a023_;\na007_ = a024_ + a013_;\na014_ = a001_ - a003_;\na007_ = 3 + a003_;\na000_ = a002_ + a011_;\na000_ = a004_ + a012_;\na018_ = a013_ + a024_;\na024_ = a023_ - cur_;\na001_ = a007_ + a008_;\ncur_ = a008_ + a000_;\na012_ = a013_ + a000_;\na001_ = a008_ - a021_;\na013_ = a006_ + a018_;\na024_ = a004_ - a001_;\na014_ = a000_ - a006_;\na008_ = a010_ * 2;\na000_ = a019_ + a011_;\na000_ = a019_ + a000_;\n} else {\na014_ = a010_ - a009_;\na007_ = a009_ + a004_;\na019_ = a017_ + a006_;\na001_ = a019_ + a005_;\na015_ = a000_ - a006_;\na002_ = a011_ + a011_;\na013_ = a013_ + a015_;\na005_ = a014_ + a015_;\na017_ = a000_ + a000_;\na015_ = a019_ - a013_;\na007_ = a021_ + a005_;\na020_ = -4 + a007_;\na007_ = a022_ + a003_;\na009_ = a021_ - a001_;\na002_ = a009_ + a004_;\na016_ = a018_ + a022_;\na008_ = a007_ - a001_;\na007_ = a010_ + a010_;\na012_ = a020_ + a013_;\na006_ = a011_ + a011_;\na023_ = a021_ + a002_;\na023_ = a015_ + a011_;\na008_ = a005_ - a024_;\na019_ = a000_ - a015_;\na007_ = a022_ - a003_;\na023_ = a008_ - a007_;\na007_ = a008_ - a023_;\na024_ = a018_ + a005_;\na001_ = a013_ - a002_;\na017_ = a023_ - a011_;\na022_ = a003_ + a004_;\n}\na010_ = a017_ - a010_;\na012_ = a013_ - a019_;\na001_ = cur_ + a012_;\na017_ = a015_ + a002_;\na018_ = a023_ + a020_;\na020_ = a012_ + a022_;\ncur_ = a023_ - a005_;\na000_ = a019_ - a022_;\na002_ = a006_ + a015_;\na022_ = a015_ - a003_;\na016_ = a013_ + -1;\na010_ = a016_ - a002_;\na021_ = a009_ - a008_;\na021_ = a002_ + a003_;\na013_ = a004_ - a008_;\n} else {\na015_ = a019_ + a023_;\na001_ = a014_ - a000_;\n}\na015_ = a014_ + a023_;\n}\na002_ = a014_ + a010_;\n}\noutput.collect(prefix, new IntWritable(a023_));\n}", "public Hashtable<Double, Integer> cluster(ArrayList<Double>[] array) {\n\t\t\n\t\tHashtable<Double, Integer> results = new Hashtable<Double, Integer>();\n\t\tfor (ArrayList<Double> arrayList : array) {\n\t\t\t/*\n\t\t\t * for (Double value : arrayList) { for (int i=1;\n\t\t\t * i<thresholds.length; i++) { if (thresholds[i-1] > value && value\n\t\t\t * >= thresholds[i]) clusteringConsole.put(value, i-1); } if\n\t\t\t * (!clusteringConsole.containsKey(value))\n\t\t\t * System.out.println(\"not classified: \"+value); }\n\t\t\t */\n\t\t\t\n\t\t\tint prevStateIndex = 0; \n\t\t\t//double prevStateCenter = centers[0];\n\t\t\t\n\t\t\tfor (Double value : arrayList) {\n\t\t\t\t \n\t\t\t\tdouble s = DEFAULT_SIGMA;\n\t\t\t\t//int stateIndex = prevStateIndex; // if distance not enough from previous center, the previous state will be copied\n\t\t\t\t//if ( Math.abs(value-prevStateCenter) > 0.25 ) { // if large distance from the previous center, look up where we are\n\t\t\t\t\t\n\t\t\t\t\tif (centers[0] + s > value && value > centers[0] - s)\n\t\t\t\t\t\tresults.put(value, 1);\n\t\t\t\t\telse if (centers[1] + s > value && value > centers[1] - s)\n\t\t\t\t\t\tresults.put(value, 2);\n\t\t\t\t\telse if (centers[2] + s > value && value > centers[2] - s)\n\t\t\t\t\t\tresults.put(value, 3);\n\t\t\t\t\telse if (centers[3] + s > value && value > centers[3] - s)\n\t\t\t\t\t\tresults.put(value, 4);\n\t\t\t\t\telse if (centers[4] + s > value && value > centers[4] - s)\n\t\t\t\t\t\tresults.put(value, 5);\n\t\t\t\t\telse results.put(value, 0);\n\t\t\t\t//}\n\t\t\t\t\n\t\t\t\t//prevStateCenter = centers[stateIndex];\n\t\t\t\t//prevStateIndex = stateIndex;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn results;\n\t}", "@Test\n public void testSegmentSelection() {\n assertMetrics(\"segments:2 absoluteProximity:0.1 proximity:1 segmentStarts:19,41\",\n \"a b c d e\",\"x a b x c x x x x x x x x x x x x x x a b c x x x x x x x x x e x d x c d x x x c d e\");\n // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2\n // 0 1 2 3 4\n // Should choose - - - - -\n\n // Same as above but best matching segment have too low exactness\n assertMetrics(\"segments:2 absoluteProximity:0.0903 proximity:0.9033 segmentStarts:1,41\",\n \"a b c d e\",\"x a b x c x x x x x x x x x x x x x x a:0.2 b:0.3 c:0.4 x x x x x x x x x e x d x c d x x x c d e\");\n // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2\n // 0 1 2 3 4\n // Should choose - - - - -\n\n assertMetrics(\"segments:1 absoluteProximity:0.0778 proximity:0.778\",\"a b c d e f\",\"x x a b b b c f e d a b c d x e x x x x x f d e f a b c a a b b c c d d e e f f\");\n\n // Prefer one segment with ok proximity over two segments with great proximity\n assertMetrics(\"segments:1 segmentStarts:0\",\"a b c d\",\"a b x c d x x x x x x x x x x x a b x x x x x x x x x x x c d\");\n assertMetrics(\"segments:1 segmentStarts:0\",\"a b c d\",\"a b x x x x x x x x c d x x x x x x x x x x x a b x x x x x x x x x x x c d\");\n }", "private void mutateCodes(int amount){\n\t\tbestCodes=new ArrayList<String[]>();\n\t\t//Extract best codes\n\t\t//System.out.println(\"First Key\"+GMSValues.firstKey());\n\t\tSystem.out.println(\"Extracting best Codes...\");\n\t\tList<Double> ValuesTemp=new ArrayList<Double>(GMSValues.values());\n\t\tCollections.sort(ValuesTemp);\n\t\tdouble threshold;\n\t\tif (amount>=ValuesTemp.size()){\n\t\t\tthreshold=ValuesTemp.get(ValuesTemp.size()-1);\n\t\t}else{\n\t\t\tthreshold=ValuesTemp.get(amount);\n\t\t}\n\t\tfor (Entry<String[], Double> e:GMSValues.entrySet()){\n\t\t\tif (e.getValue()<=threshold){\n\t\t\t\tbestCodes.add(e.getKey());\n\t\t\t}\n\t\t}\n\t\t//Permutation\n\t\tSystem.out.println(\"Permutating the best codes to find even better ones...\");\n\t\tmutatedCodes=new ArrayList<String[]>();\n\t\tmutatedCodes.addAll(bestCodes);\n\t\tfor (int i=0;i<bestCodes.size();i++){\n\t\t\tString[] Original=bestCodes.get(i);\n\t\t\tfor (int pos1=0;pos1<20;pos1++){\n\t\t\t\tfor (int pos2=pos1+1;pos2<20;pos2++){\n\t\t\t\t\tString[] NewCode=new String[20];\n\t\t\t\t\tSystem.arraycopy(Original, 0, NewCode, 0, 20);\n\t\t\t\t\tNewCode[pos1]=Original[pos2];\n\t\t\t\t\tNewCode[pos2]=Original[pos1];\n\t\t\t\t\tmutatedCodes.add(NewCode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Also include 5-Switch Permutations of the best codes to avoid local minimum\n\t\tfor (int i=0;i<bestCodes.size();i++){\n\t\t\tString[] Original=bestCodes.get(i);\n\t\t\tString[] Changed=new String[20];\n\t\t\tSystem.arraycopy(Original, 0, Changed, 0, 20);\n\t\t\tint x=0;\n\t\t\twhile (x<5){\n\t\t\t\tRandom ran = new Random();\n\t\t\t\tint x1 = ran.nextInt(20);\n\t\t\t\tint x2 = ran.nextInt(20);\n\t\t\t\tif (x1!=x2){\n\t\t\t\t\tx++;\n\t\t\t\t\tString[] NewCode=new String[20];\n\t\t\t\t\tSystem.arraycopy(Changed, 0, NewCode, 0, 20);\n\t\t\t\t\tNewCode[x1]=Changed[x2];\n\t\t\t\t\tNewCode[x2]=Changed[x1];\n\t\t\t\t\tChanged=NewCode;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmutatedCodes.add(Changed);\n\t\t}\n\t}", "public void minimize() {\n D = new boolean[states.length][states.length];\r\n S = new ArrayList<ArrayList<HashSet<Point>>>(); // lol\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int i = 0; i < states.length; i++) {\r\n ArrayList<HashSet<Point>> innerList = new ArrayList<HashSet<Point>>();\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int j = 0; j < states.length; j++) {\r\n Arrays.fill(D[i], false);\r\n innerList.add(new HashSet<Point>());\r\n }\r\n S.add(innerList);\r\n }\r\n\r\n // 2. states with different acceptances are distinguishable\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n if (acceptStates.contains(i) != acceptStates.contains(j)) {\r\n D[i][j] = true;\r\n }\r\n }\r\n }\r\n\r\n // 3. mark as possibly indistinguishable, enforce distinguishability\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n // only pairs that are as of yet indistinguishable\r\n if (D[i][j]) {\r\n continue;\r\n }\r\n\r\n DFAState qi = states[i];\r\n DFAState qj = states[j];\r\n\r\n // one of the things being compared is unreachable\r\n if (qi == null || qj == null) {\r\n continue;\r\n }\r\n\r\n // helps emulate \"for any\"\r\n boolean distinguished = false;\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n // if on the same letter, qm and qn move to distinguishable states\r\n if (D[m][n] || D[n][m]) {\r\n dist(i, j);\r\n distinguished = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!distinguished) {\r\n // qm and qn are indistinguishable\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n if (m < n && !(i == m && j == n)) {\r\n S.get(m).get(n).add(new Point(i, j));\r\n } else if (m > n && !(i == n && j == m)) {\r\n S.get(n).get(m).add(new Point(i, j));\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n mergeStates();\r\n }", "public static void main(String[] args) {\n\t\tHashMap<String, HashMap<String, Double>> file_alph_tf = new HashMap<String, HashMap<String, Double>>();\n\t\tHashMap<String, Double> file_alph_idf = new HashMap<String, Double>();\n\t\tHashMap<String, Double> tmp_idf = new HashMap<String, Double>();\n\t\tHashMap<String, HashMap<String, Double>> result_map = new HashMap<String, HashMap<String, Double>>();\n\t\t// 이후에 cosine similarity를 계산할때 사용할 top5해쉬맵\n\t\tHashMap<String, HashMap<String, Double>> top5 = new HashMap<String, HashMap<String, Double>>();\n\t\t\n\t\tTest01 t1 = new Test01();\n\t\tTest02 t2 = new Test02();\n\t\tTest03 t3 = new Test03();\n\t\t\n\t\t// 각 문서의 특성을 추출 : Test04 - map\t\t\n\t\t\n\t\tFile[] fileList = t1.get_file();\n\t\t\n\t\tfor (File file : fileList) {\n\t\t\t\n\t\t\tHashMap <String, Double> tmp_map = new HashMap <String, Double>();\n\t\t\t\n\t\t\t// count alphabet _ each files\n\t\t\ttry {\n\t\t\t\tFileReader file_reader = new FileReader(file);\n\t\t\t\tint cur = 0;\n\t\t\t\twhile ((cur = file_reader.read()) != -1) {\n\t\t\t\t\tif (cur != 32) {\n\t\t\t\t\t\tif (!tmp_map.containsKey(String.valueOf((char)cur))) {\n\t\t\t\t\t\t\ttmp_map.put(String.valueOf((char)cur), (double) 1);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdouble temp_num = tmp_map.get(String.valueOf((char)cur));\n\t\t\t\t\t\t\ttmp_map.put(String.valueOf((char)cur),temp_num+1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch(FileNotFoundException e) {\n\t\t\t\te.getStackTrace();\n\t\t\t} catch(IOException e) {\n\t\t\t\te.getStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// calc_TF\n\t\t\tArrayList<String> key_lst = new ArrayList<String>(tmp_map.keySet());\n\t\t\tdouble sum_value = 0;\n\t\t\t// TF의 분모 문서내에 오는 모든수 더하기\n\t\t\tfor (String k : key_lst) {\n\t\t\t\tsum_value += tmp_map.get(k);\t\n\t\t\t}\n\t\t\t// TF의 분자 : 해당 파일에 있는 알파벳의 갯수 (tmp_map에 저장되어있음) / tf분모\n\t\t\tfor (String tf_k : key_lst) {\n\t\t\t\tdouble tf = tmp_map.get(tf_k) / sum_value;\n\t\t\t\ttmp_map.put(tf_k, tf);\n\t\t\t}\n\t\t\tsum_value = 0;\n\t\t\tfile_alph_tf.put(file.getName(), tmp_map);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// calc_IDF_Bottom : counting IDF_Bottom\n\t\t\ttmp_idf = file_alph_tf.get(file.getName());\n\t\t\t\n\t\t\tfor (String idf_k : key_lst) {\n\t\t\t\tif (tmp_idf.get(idf_k) != 0) {\n\t\t\t\t\tif (!file_alph_idf.containsKey(idf_k)) {\n\t\t\t\t\t\tfile_alph_idf.put(idf_k, (double) 1);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tdouble tmp_num = file_alph_idf.get(idf_k);\n\t\t\t\t\t\tfile_alph_idf.put(idf_k, tmp_num+1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t} // file의 이름으로 반복\n\t\t\n\t\t\n\t\t// calc_IDF\n\t\tfor (File file : fileList) {\n\t\t\tHashMap<String, Double> aa = new HashMap<String, Double>();\n\t\t\tArrayList<String> key_lst = new ArrayList<String>(file_alph_idf.keySet());\n\t\t\tdouble temp_num = 0;\n\t\t\tfor (String key : key_lst) {\n\t\t\t\t\n\t\t\t\tdouble tf;\n\t\t\t\ttemp_num = 0;\n\t\t\t\ttry {\n\t\t\t\t\ttf = file_alph_tf.get(file.getName()).get(key);\n\t\t\t\t\tif (file_alph_idf.get(key) != 0) {\n\t\t\t\t\t\tdouble tt = file_alph_idf.get(key);\n\t\t\t\t\t\ttemp_num = 7/tt;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttemp_num = 0;\n\t\t\t\t\t}\n\t\t\t\t} catch(NullPointerException e) {\n\t\t\t\t\ttf = 0;\n\t\t\t\t}\n\t\t\t\tdouble idf = Math.log(1+ temp_num);\n\t\t\t\tdouble tfidf = tf*idf;\n\t\t\t\taa.put(key, tfidf);\n\t\t\t}\n//\t\t\tSystem.out.println();\n\t\t\tresult_map.put(file.getName(), aa);\n\t\t}\t\n\t\n\t\t\n\t\t\n\t\t\n\t\tfor(File f : fileList) {\n\t\t\t\n\t//---------------------------------------상위 5개-------------------------------------------\t\t\t\n\t\t\t\n//\t\t\tSystem.out.println(f.getName());\n\t\t\tString f_n = f.getName(); \n\t\t\t\n\t\t\t// 0. 정렬 전 파일 출력\n//\t\t\tArrayList <String> key_lst = new ArrayList<String>(result_map.get(f_n).keySet());\n//\t\t\tfor (String kk : key_lst) {\n//\t\t\t\tSystem.out.println(kk + \" : \" + result_map.get(f_n).get(kk));\n//\t\t\t}\n\t\t\t\n\t\t\tArrayList<String> Top5List = sortHSbyValue_double(result_map.get(f_n));\n//\t\t\tSystem.out.println(Top5List);\n\t\t\tHashMap<String, Double> map = new HashMap<String, Double>();\n\t\t\tfor (String s : Top5List) {\n\t\t\t\tmap.put(s, result_map.get(f_n).get(s));\n\t\t\t}\n\n\t\t\ttop5.put(f_n, map);\t\n\t\t}\n\t\t\n\t\t// cosine_similarity\n\t\t// 구하기 전에 벡터의 차원을 맞춰준다.\n\t\t// input받는 파일을 제외한 나머지 파일들과의 유사도를 구한다.\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.print(\"문서 이름을 입력하세요 : \");\n\t\tString input = sc.next();\n\t\t\n\t\tHashMap<String, Double> csMap = new HashMap<String, Double>();\n\t\t\n\t\tfor (File f : fileList) {\n\t\t\tHashMap<String, Double> a = (HashMap<String, Double>) top5.get(input).clone();\n\t\t\tArrayList<String> a_key_lst = new ArrayList<String>(a.keySet());\n\t\t\tArrayList<String> total_key = new ArrayList<String>();\n\t\t\t\n\t\t\tif (input.equals(f.getName())) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tHashMap<String, Double> b = (HashMap<String, Double>) top5.get(f.getName()).clone();\n\t\t\tArrayList<String> b_key_lst = new ArrayList<String>(b.keySet());\n\t\t\t\n\t\t\tfor (String a_k : a_key_lst) {\n\t\t\t\ttotal_key.add(a_k);\n\t\t\t}\n\t\t\tfor (String b_k : b_key_lst) {\n\t\t\t\ttotal_key.add(b_k);\n\t\t\t}\n\t\t\t\n\t\t\tfor (String t_k : total_key) {\n\t\t\t\tif(!a.containsKey(t_k)) {\n\t\t\t\t\ta.put(t_k, (double)0);\n\t\t\t\t}\n\t\t\t\tif(!b.containsKey(t_k)) {\n\t\t\t\t\tb.put(t_k, (double)0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdouble[] a_lst = t3.mapToList(a);\n\t\t\tdouble[] b_lst = t3.mapToList(b);\n\t\t\tdouble cs = cosinSimilarity(a_lst, b_lst);\n\t\t\tcsMap.put(f.getName(), cs);\n\t\t\t\n\t\t\ta_key_lst.clear();\n\t\t\ttotal_key.clear();\n\t\t\t\n\t\t}\n\t\t\n\t\tt2.sort_print(csMap, input);\n\t\t\n\t\tSystem.out.println();\n\t}", "public void kek() {\r\n System.out.println(\"answer\" + answer);\r\n checkColors = getColorPinValues(answer, guess);\r\n checkPosition = getPositionPinValues(answer,guess);\r\n change(checkColors, checkPosition);\r\n\r\n }", "public static void main(String[] args){\n int MIN = Integer.parseInt(args[0]);\n MAX = Integer.parseInt(args[1]);\n cutoffs = new int[args.length - 2];\n cache = new ArrayList<IndexedArrayList<SuperSavvyTrieHelper2>>();\n for (int i = 2; i < args.length; i++){\n cutoffs[i - 2] = Integer.parseInt(args[i]);\n cache.add(new IndexedArrayList<SuperSavvyTrieHelper2>());\n }\n for (int i = 0; i < cutoffs.length / 2; i++){\n int temp = cutoffs[i];\n cutoffs[i] = cutoffs[cutoffs.length - 1 - i];\n cutoffs[cutoffs.length - 1 - i] = temp;\n }\n multiplicitiesUsed = new boolean[MAX + 1];\n basesUsed = new DoublyLinkedArray(MAX + 1);\n SuperSavvyTrieHelper2.setCorrespondance(basesUsed);\n /*\n long count1 = lowerRecursion(MAX, 0);\n long count2 = middleRecursion(MAX, 0);\n long count3 = upperRecursion(MAX, 0);\n long total = count1 + count2 + count3;\n System.out.printf(\"%d + %d + %d = %d\\n\", count1, count2, count3, total);\n */\n hitCounts = new long[cutoffs.length];\n missCounts = new long[cutoffs.length];\n statCollector = new StatCollector(cutoffs);\n\n long startTime = System.nanoTime();\n long[] values = new long[MAX - MIN + 1];\n for (int i = MIN; i <= MAX; i++) {\n values[i - MIN] = upperRecursionWrapper(i);\n }\n //long[] testValues = new long[] {1752443,1911046, 2067456,2249444,2429337, 2647532,2852449,3101167,3350292,3632299,3916575};\n for (int i = 0; i < values.length; i++){\n //if (testValues[i] != values[i]){\n System.out.printf(\"%d: %d\\n\", i + MIN, values[i]);\n //}\n }\n long endTime = System.nanoTime();\n System.out.printf(\"%f,\", (double)(endTime - startTime) / 1000000000.0);\n long totalMissCounts = 0;\n long totalMissWeight1 = 0;\n long totalMissWeight2 = 0;\n long totalMissWeight3 = 0;\n /*\n for (int i = 0; i < cutoffs.length; i++){\n long totalCounts = hitCounts[i] + missCounts[i];\n totalMissCounts += missCounts[i];\n totalMissWeight1 += missCounts[i] * cutoffs[i];\n totalMissWeight2 += (hitCounts[i] / missCounts[i]) * cutoffs[i];\n totalMissWeight3 += (hitCounts[i] - missCounts[i]) * cutoffs[i] * cutoffs[i];\n System.out.printf(\"\\tCache %d: %d/%d/%d (%.5f%%)\", cutoffs[i], hitCounts[i], missCounts[i], totalCounts, (double) hitCounts[i] / totalCounts);\n }\n System.out.printf(\"\\t\\tMissCounts: %d, weighted: %d, ratio: %d, diff^2: %d\\n\", totalMissCounts, totalMissWeight1, totalMissWeight2, totalMissWeight3);\n */\n statCollector.printAll();\n }", "public static void main(String[] args) {\n\t\t\n\t\tint k = 3;\n\t\t\n\t\tint max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;\n\t\t\n\t\tint arr[] = new int[k];\n\t\t\n\t\tfor(int i = 0; i < k; i++) {\n\t\t\tif(max < arr[i])\n\t\t\t\tmax = arr[i];\n\t\t\tif(min > arr[i])\n\t\t\t\tmin = arr[i];\n\t\t}\n\t\t\n\t\t\n\t\tint [][] arr1 = {{3,8},{10,11},{1,3},{2,4}};\n\t\t\n\t\tSystem.out.println(selection(arr1));\n\t}", "public void assignPixelsToClusters(int[][] assigned){\n\n for(int i = 0; i < imageHeight; i++){\n for(int j = 0; j < imageWidth; j++){\n //System.out.println(\"pixel[\" + i + \"][\" + j + \"]\"); // Used for some debugging\n\n //Find the cluster color that is closest to the current pixel color\n int closestCluster = -1; // Holds the cluster that the pixel is closest to in color\n double closestDistance = Double.MAX_VALUE;// Initiate to the a max value\n for(int x = 0; x < kCenters.length; x++){\n if(diff(pixels[i][j], kCenters[x]) < closestDistance){\n closestCluster = x;\n closestDistance = diff(pixels[i][j], kCenters[x]);\n //Add the coordinates of this pixel to some arrayList of arrayList (a cluster arraylist)???\n }\n \n } // Done iterating through all kCenters and should have the closest\n if(closestCluster == -1){\n System.out.println(\"Error, no closest cluster found\");\n System.exit(-1);\n }\n assigned[i][j] = closestCluster;\n }\n }\n }", "public static void findKComplemenentaryPairs(int[] values, int k) {\n\t\t\n\t\t// first of all, we need to divide to conquer, let's build a binary tree\n\t\t// I will set root as K. This way, for each new value 'i' I will know which side of the tree\n\t\t// I should find 'j' \n\t\t\n\t\tLeaf root = new Leaf(k);\n\t\tcountIterations = 0;\n\t\tfor (int i = 0; i < values.length; i++) {\n\t\t\taddLeaf(root, values[i]);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.print(\"Tree built: \");\n\t\tprintTree(root); \t\t\t\t\t// this is just for debugging and will not be included in asymptotic analysis\n\t\tSystem.out.println(\"\\nTotal of \" + countIterations + \" iterations to build a tree for an array of \" + values.length + \" elements\");\n\t\t\n\t\tStringBuffer report = new StringBuffer();\n\t\t\n\t\tSystem.out.println(\"\\nPairs:\");\n\t\t// Trespass array and find value j that satisfies A[i] + A[j] = k\n\t\t\n\t\tint countTotal = 0;\n\t\tfor (int i = 0; i < values.length; i++) {\n\t\t\tcountIterations = 0;\n\t\t\tint val = values[i];\n\t\t\tint wanted = k - val;\n\t\t\tif (hasValue(root, wanted)) { \n\t\t\t\tSystem.out.println(\"- A[i,j] = [\" + val + \",\" + wanted + \"]\");\n\t\t\t}\n\t\t\treport.append(\"Iteration \" + i + \" took \" + countIterations + \" operations to search in the tree\\n\");\n\t\t\tcountTotal += countIterations;\n\t\t}\n\t\t\n\t\tSystem.out.println(report.toString());\n\t\tSystem.out.println(\"Total of operations for n=\" + values.length + \" was \" + countTotal + \" operations\");\n\t\t\n\t}", "@SuppressWarnings(\"MethodMayBeStatic\")\r\n public Counter<int[]> kBestSequences(SequenceModel ts, int k) {\r\n\r\n // Set up tag options\r\n int length = ts.length();\r\n int leftWindow = ts.leftWindow();\r\n int rightWindow = ts.rightWindow();\r\n\r\n if (rightWindow != 0) {\r\n throw new IllegalArgumentException(\"KBestSequenceFinder only works with rightWindow == 0 not \" + rightWindow);\r\n }\r\n\r\n int padLength = length + leftWindow + rightWindow;\r\n\r\n int[][] tags = new int[padLength][];\r\n int[] tagNum = new int[padLength];\r\n for (int pos = 0; pos < padLength; pos++) {\r\n tags[pos] = ts.getPossibleValues(pos);\r\n tagNum[pos] = tags[pos].length;\r\n }\r\n\r\n int[] tempTags = new int[padLength];\r\n\r\n // Set up product space sizes\r\n int[] productSizes = new int[padLength];\r\n\r\n int curProduct = 1;\r\n for (int i = 0; i < leftWindow; i++) {\r\n curProduct *= tagNum[i];\r\n }\r\n for (int pos = leftWindow; pos < padLength; pos++) {\r\n if (pos > leftWindow + rightWindow) {\r\n curProduct /= tagNum[pos - leftWindow - rightWindow - 1]; // shift off\r\n }\r\n curProduct *= tagNum[pos]; // shift on\r\n productSizes[pos - rightWindow] = curProduct;\r\n }\r\n\r\n double[][] windowScore = new double[padLength][];\r\n\r\n // Score all of each window's options\r\n for (int pos = leftWindow; pos < leftWindow + length; pos++) {\r\n windowScore[pos] = new double[productSizes[pos]];\r\n Arrays.fill(tempTags, tags[0][0]);\r\n\r\n for (int product = 0; product < productSizes[pos]; product++) {\r\n int p = product;\r\n int shift = 1;\r\n for (int curPos = pos; curPos >= pos - leftWindow; curPos--) {\r\n tempTags[curPos] = tags[curPos][p % tagNum[curPos]];\r\n p /= tagNum[curPos];\r\n if (curPos > pos) {\r\n shift *= tagNum[curPos];\r\n }\r\n }\r\n if (tempTags[pos] == tags[pos][0]) {\r\n // get all tags at once\r\n double[] scores = ts.scoresOf(tempTags, pos);\r\n // fill in the relevant windowScores\r\n for (int t = 0; t < tagNum[pos]; t++) {\r\n windowScore[pos][product + t * shift] = scores[t];\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Set up score and backtrace arrays\r\n double[][][] score = new double[padLength][][];\r\n int[][][][] trace = new int[padLength][][][];\r\n int[][] numWaysToMake = new int[padLength][];\r\n for (int pos = 0; pos < padLength; pos++) {\r\n\r\n score[pos] = new double[productSizes[pos]][];\r\n trace[pos] = new int[productSizes[pos]][][]; // the 2 is for backtrace, and which of the k best for that backtrace\r\n\r\n numWaysToMake[pos] = new int[productSizes[pos]];\r\n Arrays.fill(numWaysToMake[pos], 1);\r\n for (int product = 0; product < productSizes[pos]; product++) {\r\n if (pos > leftWindow) {\r\n // loop over possible predecessor types\r\n int sharedProduct = product / tagNum[pos];\r\n int factor = productSizes[pos] / tagNum[pos];\r\n\r\n numWaysToMake[pos][product] = 0;\r\n for (int newTagNum = 0; newTagNum < tagNum[pos - leftWindow - 1] && numWaysToMake[pos][product] < k; newTagNum++) {\r\n int predProduct = newTagNum * factor + sharedProduct;\r\n numWaysToMake[pos][product] += numWaysToMake[pos-1][predProduct];\r\n }\r\n if (numWaysToMake[pos][product] > k) { numWaysToMake[pos][product] = k; }\r\n }\r\n\r\n score[pos][product] = new double[numWaysToMake[pos][product]];\r\n Arrays.fill(score[pos][product], Double.NEGATIVE_INFINITY);\r\n trace[pos][product] = new int[numWaysToMake[pos][product]][];\r\n Arrays.fill(trace[pos][product], new int[]{-1,-1});\r\n }\r\n }\r\n\r\n // Do forward Viterbi algorithm\r\n // this is the hottest loop, so cache loop control variables hoping for a little speed....\r\n\r\n // loop over the classification spot\r\n for (int pos = leftWindow, posMax = length + leftWindow; pos < posMax; pos++) {\r\n // loop over window product types\r\n for (int product = 0, productMax = productSizes[pos]; product < productMax; product++) {\r\n // check for initial spot\r\n double[] scorePos = score[pos][product];\r\n int[][] tracePos = trace[pos][product];\r\n if (pos == leftWindow) {\r\n // no predecessor type\r\n scorePos[0] = windowScore[pos][product];\r\n } else {\r\n // loop over possible predecessor types/k-best\r\n\r\n int sharedProduct = product / tagNum[pos + rightWindow];\r\n int factor = productSizes[pos] / tagNum[pos + rightWindow];\r\n for (int newTagNum = 0, maxTagNum = tagNum[pos - leftWindow - 1]; newTagNum < maxTagNum; newTagNum++) {\r\n int predProduct = newTagNum * factor + sharedProduct;\r\n double[] scorePosPrev = score[pos-1][predProduct];\r\n for (int k1 = 0; k1 < scorePosPrev.length; k1++) {\r\n double predScore = scorePosPrev[k1] + windowScore[pos][product];\r\n if (predScore > scorePos[0]) { // new value higher then lowest value we should keep\r\n int k2 = Arrays.binarySearch(scorePos, predScore);\r\n k2 = k2 < 0 ? -k2 - 2 : k2 - 1;\r\n // open a spot at k2 by shifting off the lowest value\r\n System.arraycopy(scorePos, 1, scorePos, 0, k2);\r\n System.arraycopy(tracePos, 1, tracePos, 0, k2);\r\n\r\n scorePos[k2] = predScore;\r\n tracePos[k2]= new int[] {predProduct, k1};\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Project the actual tag sequence\r\n int[] whichDerivation = new int[k];\r\n int[] bestCurrentProducts = new int[k];\r\n double[] bestFinalScores = new double[k];\r\n Arrays.fill(bestFinalScores, Double.NEGATIVE_INFINITY);\r\n\r\n // just the last guy\r\n for (int product = 0; product < productSizes[padLength - 1]; product++) {\r\n double[] scorePos = score[padLength - 1][product];\r\n for (int k1 = scorePos.length - 1;\r\n k1 >= 0 && scorePos[k1] > bestFinalScores[0];\r\n k1--) {\r\n int k2 = Arrays.binarySearch(bestFinalScores, scorePos[k1]);\r\n k2 = k2 < 0 ? -k2 - 2 : k2 - 1;\r\n // open a spot at k2 by shifting off the lowest value\r\n System.arraycopy(bestFinalScores, 1, bestFinalScores, 0, k2);\r\n System.arraycopy(whichDerivation, 1, whichDerivation, 0, k2);\r\n System.arraycopy(bestCurrentProducts, 1, bestCurrentProducts, 0, k2);\r\n\r\n bestCurrentProducts[k2] = product;\r\n whichDerivation[k2] = k1;\r\n bestFinalScores[k2] = scorePos[k1];\r\n }\r\n }\r\n ClassicCounter<int[]> kBestWithScores = new ClassicCounter<int[]>();\r\n for (int k1 = k - 1; k1 >= 0 && bestFinalScores[k1] > Double.NEGATIVE_INFINITY; k1--) {\r\n int lastProduct = bestCurrentProducts[k1];\r\n for (int last = padLength - 1; last >= length - 1 && last >= 0; last--) {\r\n tempTags[last] = tags[last][lastProduct % tagNum[last]];\r\n lastProduct /= tagNum[last];\r\n }\r\n\r\n for (int pos = leftWindow + length - 2; pos >= leftWindow; pos--) {\r\n int bestNextProduct = bestCurrentProducts[k1];\r\n bestCurrentProducts[k1] = trace[pos + 1][bestNextProduct][whichDerivation[k1]][0];\r\n whichDerivation[k1] = trace[pos + 1][bestNextProduct][whichDerivation[k1]][1];\r\n tempTags[pos - leftWindow] =\r\n tags[pos - leftWindow][bestCurrentProducts[k1]\r\n / (productSizes[pos] / tagNum[pos - leftWindow])];\r\n }\r\n kBestWithScores.setCount(Arrays.copyOf(tempTags, tempTags.length), bestFinalScores[k1]);\r\n }\r\n\r\n return kBestWithScores;\r\n }", "@Test\n public void basicTest() {\n Point myPoint;\n\n// myPoint = pointSet.nearest(2, 2);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(2, -2);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(1, 4);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(3, -100);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(0, 0);\n// System.out.println(myPoint.toString());\n//\n// myPoint = kdPointSet.nearest(2, 2); //THIS ONE DOES NOT MATCH NAIVE!\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(2, -2);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(1, 4);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(3, -100);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(0, 0);\n// System.out.println(myPoint.toString());\n\n\n\n\n\n\n }", "public static void checkConsistency(){\n double[] aNormalW=new double[numberOfObjectives];\n double randomIndex=0;\n double sum=0;\n for (int row=0;row<numberOfObjectives;row++){\n for (int column=0;column<numberOfObjectives;column++){\n\n sum+=weights[column]*objectives[row][column];\n }\n df.setRoundingMode(RoundingMode.UP);\n aNormalW[row]= Double.valueOf(df.format(sum));\n sum=0;\n }\n double awtDividedByWt=0;\n for (int i=0;i<numberOfObjectives;i++){\n awtDividedByWt+=aNormalW[i]/weights[i];\n decimalFormat.setRoundingMode(RoundingMode.HALF_UP);\n Double.valueOf(decimalFormat.format(awtDividedByWt));\n }\n double reciprocalNumber=(double) 1/numberOfObjectives;\n decimalFormat.setRoundingMode(RoundingMode.UP);\n Double.valueOf(decimalFormat.format(reciprocalNumber));\n double step3=reciprocalNumber*awtDividedByWt;\n decimalFormat.setRoundingMode(RoundingMode.UP);\n double numerator=Double.valueOf(decimalFormat.format(step3))-numberOfObjectives;\n double denominator=numberOfObjectives-1;\n decimalFormat.setRoundingMode(RoundingMode.UP);\n double ci=Double.valueOf(decimalFormat.format(numerator)) /denominator;\n decimalFormat.setRoundingMode(RoundingMode.CEILING);\n System.out.println(\"Consistency Index (CI)= \"+Double.valueOf(decimalFormat.format(ci)));\n System.out.println();\n double ciDividedByRI=ci/table23(numberOfObjectives);\n decimalFormat.setRoundingMode(RoundingMode.UP);\n // Double.valueOf(df.format(ciDividedByRI));\n if (ciDividedByRI<0.10){\n randomIndex=ci/table23(numberOfObjectives);\n decimalFormat.setRoundingMode(RoundingMode.UP);\n System.out.println(\"Random Index (RI)= \"+Double.valueOf(decimalFormat.format(randomIndex)));\n System.out.println(\"degree of consistency is satisfactory !!\");\n }else {\n System.out.println(\"the AHP may not yield meaningful results !!\");\n }\n System.out.println();\n }", "private final void markEdgesFrom(int source, boolean value) {\n queueSize = 0;\n {\n int nOutgoingEdges = nOutgoingEdgess[source];\n int[] outgoingEdgeIndexes = outgoingEdgeIndexess[source];\n boolean[] outgoingEdgeIsMarked = outgoingEdgeIsMarkeds[source];\n //int[] outgoingEdgeOppositeIndexes = outgoingEdgeOppositeIndexess[source];\n //int[] outgoingEdges = outgoingEdgess[source];\n \n for (int i=0;i<nOutgoingEdges;++i) {\n if (outgoingEdgeIsMarked[i] == value) continue;\n outgoingEdgeIsMarked[i] = value;\n \n int edgeIndex = outgoingEdgeIndexes[i];\n if (isMarked[edgeIndex] != value) {\n isMarked[edgeIndex] = value;\n if (value) {\n addToMarkedEdges(source, i);\n //addToMarkedEdges(outgoingEdges[i], outgoingEdgeOppositeIndexes[i]);\n }\n else {\n clearMarkedEdges(source);\n //clearMarkedEdges(outgoingEdges[i]);\n }\n }\n isMarked[outgoingEdgeIndexes[i]] = value;\n addPairToQueue(source, i);\n }\n }\n \n \n int currIndex = 0;\n while (currIndex < queueSize) {\n int parent = queue[currIndex];\n ++currIndex;\n int parentOutgoingIndex = queue[currIndex];\n ++currIndex;\n\n int curr = outgoingEdgess[parent][parentOutgoingIndex];\n int currLevel = edgeLevels[outgoingEdgeIndexess[parent][parentOutgoingIndex]];\n \n int parX = xPositions[parent];\n int parY = yPositions[parent];\n int currX = xPositions[curr];\n int currY = yPositions[curr];\n int nOutgoingEdges = nOutgoingEdgess[curr];\n int[] outgoingEdges = outgoingEdgess[curr];\n int[] outgoingEdgeIndexes = outgoingEdgeIndexess[curr];\n boolean[] outgoingEdgeIsMarked = outgoingEdgeIsMarkeds[curr];\n int[] outgoingEdgeOppositeIndexes = outgoingEdgeOppositeIndexess[curr];\n \n for (int i=0;i<nOutgoingEdges;++i) {\n int nextLevel = edgeLevels[outgoingEdgeIndexes[i]];\n if ((outgoingEdgeIsMarked[i] == value) || (nextLevel != LEVEL_W && nextLevel <= currLevel)) continue;\n int next = outgoingEdges[i];\n if (!graph.isTaut(parX, parY, currX, currY, xPositions[next], yPositions[next])) continue;\n outgoingEdgeIsMarked[i] = value;\n \n int edgeIndex = outgoingEdgeIndexes[i];\n if (isMarked[edgeIndex] != value) {\n isMarked[edgeIndex] = value;\n if (value) {\n addToMarkedEdges(curr, i);\n addToMarkedEdges(next, outgoingEdgeOppositeIndexes[i]);\n }\n else {\n clearMarkedEdges(curr);\n clearMarkedEdges(next);\n }\n }\n isMarked[outgoingEdgeIndexes[i]] = value;\n \n // Only continue marking forward if not a skip vertex.\n if (nextLevel != LEVEL_W || nSkipEdgess[next] == 0) {\n addPairToQueue(curr, i);\n }\n }\n }\n }", "Vector selectBestSegPtsSet(Vector IterWiseSegPts){\n\t\tVector Vect = new Vector();\t\t\t// to return final set of segment pts\n\t\tVector TempVect = new Vector(); // to store temporary iteration results\n\t\tint index = -1;\n\t\t// if it consists of only common pts\n\t\tif(IterWiseSegPts.size() == 1) {\n\t\t\tindex = 0;\n\t\t}\n\t\t\n\t\t//if it consists of only two segment pt sets \n\t\telse if(IterWiseSegPts.size() == 2){\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 0);\n\t\t\tdouble PrevError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 1);\n\t\t\tdouble NewError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\t\n\t\t\tif((PrevError - NewError) > 100.0){ //selecting the second set if error reduction is > 100.0\n\t\t\t\tindex = 1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t}\n\t\telse if(IterWiseSegPts.size() > 2){\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 0);\n\t\t\tdouble PrevError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\t\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 1);\n\t\t\tdouble NewError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\tdouble ChangeInPrevError = PrevError - NewError;\n\t\t\tdouble ChangeInNewError;\n\t\t\tPrevError = NewError;\n\t\t\tif(ChangeInPrevError < 15.0){ //selecting the first set if change in error is < 30.0\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tint Iterator = 2;\n\t\t\t\tint Iterations = IterWiseSegPts.size();\n\t\t\t\twhile(Iterator < Iterations){\n\t\t\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, Iterator);\n\t\t\t\t\tNewError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\t\t\tTempVect = clearVector(TempVect);\n\t\t\t\t\tChangeInNewError = PrevError - NewError;\n\t\t\t\t\t// if new iteration's error is less (or more) than prev itertion within 30.0 \n\t\t\t\t\t// or if previous change in segment pts Error > 3 times new change in segment pts error\n\t\t\t\t\tif( (ChangeInNewError < 30.0) && (NewError < 1000.0)){// (ChangeInPrevError > (3 * ChangeInNewError))\n\t\t\t\t\t\tindex = Iterator - 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tChangeInPrevError = ChangeInNewError;\n\t\t\t\t\tPrevError = NewError;\n\t\t\t\t\tIterator++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\n\t\t//}\n\t\tTempVect = clearVector(TempVect);\n\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, index);\n\t\t//TempVect = copyVectorIndex(IterWiseSegPts, TempVect, IterWiseSegPts.size() -1);\n\t\tindex = 0;\n\t\twhile(index < (TempVect.size()-1)){\n\t\t\tVect.add((Integer)TempVect.get(index++));\n\t\t}\n\t\treturn Vect;\n\t}", "public static int getOptimalK(Dataset<Row> vectorData) {\n\t\tList<Integer> K = new ArrayList<Integer>();\n\t\tList<Double> computeCost = new ArrayList<Double>();\n\n\t\tfor (int i = 2; i < 10; i++) {\n\n\t\t\tKMeans kMeansForTops = new KMeans().setK(i).setSeed(1L);\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\tKMeansModel kMeansModel = kMeansForTops.fit(vectorData);\n\t\t\tSystem.out.println(\"Time to FIT \" + (System.currentTimeMillis() - start) / 1000);\n\t\t\tdouble cost = kMeansModel.computeCost(vectorData); // WCSS\n\t\t\t// KMeansSummary\n\t\t\tK.add(i);\n\t\t\tcomputeCost.add(cost);\n\t\t\t// System.out.println(\"================ Compite cost for K == \" + i + \" is == \"\n\t\t\t// + cost);\n\n\t\t\tDataset<Row> kMeansPredictions = kMeansModel.transform(vectorData);\n\n\t\t\tfor (int j = 0; j < i; j++) {\n\n\t\t\t\t// System.out.println(\"====================== Running it for \" + j + \"th cluster\n\t\t\t\t// when the K is \" + i);\n\t\t\t\t// System.out.println(\"====================== Range for the cluster count \" + i\n\t\t\t\t// + \" ===================\");\n\t\t\t\t// kMeansPredictions.where(kMeansPredictions.col(\"prediction\").equalTo(j)).agg(min(\"features\"),\n\t\t\t\t// max(\"features\")).show();\n\n\t\t\t}\n\n\t\t\t// kMeansPredictions.agg(min(\"features\"), max(\"features\")).show();\n\t\t\t// System.out.println(\"====================== Calculating Silhouette\n\t\t\t// ===================\");\n\n\t\t\t// Evaluate clustering by computing Silhouette score\n\t\t\tClusteringEvaluator topsEvaluator = new ClusteringEvaluator();\n\n\t\t\tdouble TopsSilhouette = topsEvaluator.evaluate(kMeansPredictions);\n\n\t\t\t// System.out.println(\"================ Silhouette score for K == \" + i + \" is\n\t\t\t// == \" + TopsSilhouette);\n\n\t\t}\n\n\t\tPlot plt = Plot.create();\n\t\t// plt.plot().add(K, computeCost).label(\"MyLabel\").linestyle(\"bx-\");\n\t\t// plt.plot().\n\n\t\tSystem.out.println(\"K List \" + K);\n\t\tSystem.out.println(\"Cost List \" + computeCost);\n\t\tplt.plot().add(K, computeCost).label(\"Elbow\").linestyle(\"--\");\n\t\tplt.xlabel(\"K\");\n\t\tplt.ylabel(\"Cost\");\n\t\tplt.title(\"Compute Cost for K-Means !\");\n\t\tplt.legend();\n\t\ttry {\n\t\t\tplt.show();\n\t\t} catch (IOException | PythonExecutionException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn 0;\n\n\t}", "@Test\n public void testMatch() {\n assertMetrics(\"match:1\", \"a\",\"a\");\n assertMetrics(\"match:0.9339\",\"a\",\"a x\");\n assertMetrics(\"match:0\", \"a\",\"x\");\n assertMetrics(\"match:0.9243\",\"a\",\"x a\");\n assertMetrics(\"match:0.9025\",\"a\",\"x a x\");\n\n assertMetrics(\"match:1\", \"a b\",\"a b\");\n assertMetrics(\"match:0.9558\",\"a b\",\"a b x\");\n assertMetrics(\"match:0.9463\",\"a b\",\"x a b\");\n assertMetrics(\"match:0.1296\",\"a b\",\"a x x x x x x x x x x x x x x x x x x x x x x b\");\n assertMetrics(\"match:0.1288\",\"a b\",\"a x x x x x x x x x x x x x x x x x x x x x x x x x x x b\");\n\n assertMetrics(\"match:0.8647\",\"a b c\",\"x x a x b x x x x x x x x a b c x x x x x x x x c x x\");\n assertMetrics(\"match:0.861\", \"a b c\",\"x x a x b x x x x x x x x x x a b c x x x x x x c x x\");\n assertMetrics(\"match:0.4869\",\"a b c\",\"a b x x x x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.4853\",\"a b c\",\"x x a x b x x x x x x x x x x b a c x x x x x x c x x\");\n assertMetrics(\"match:0.3621\",\"a b c\",\"a x b x x x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.3619\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.3584\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x x x c\");\n assertMetrics(\"match:0.3474\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x b x x x b x b x\");\n assertMetrics(\"match:0.3421\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x x x x\");\n assertMetrics(\"match:0.305\" ,\"a b c\",\"x x a x b:0.7 x x x x x x x x x x x x x x x x x x x x x x\");\n assertMetrics(\"match:0.2927\",\"a b!200 c\",\"x x a x b:0.7 x x x x x x x x x x x x x x x x x x x x x x\");\n }", "public void run() {\n\t\tArrays.fill(label, NOT_AN_INDEX);\r\n\t\t\r\n\t\t// while there is a u in V with considered[u]=0 and mate[u]=0 do\r\n\t\tstage: for (int u = 0; u < gOrig.numVertices(); u++ ) {\r\n\t\t\t// if(mate[u] == NOT_AN_INDEX){\r\n\t\t\tif (gOrig.vertex(u) == null) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (matching.matches() == gOrig.numVertices() / 2) {\r\n\t\t\t\t// we are done\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tSystem.out.print(String.format(\"considering vertex u%d\\n\", u));\r\n\t\t\tif ( ! matching.isMatched(u)) {\r\n\t\t\t\t\r\n\t\t\t\t// considered[u]=1,A={empty}\r\n\t\t\t\t// A = new WeightedDigraph(gOrig.numVertices()/2);\r\n\t\t\t\tA.clear();\r\n\t\t\t\t\r\n\t\t\t\t// forall v in V do exposed[v]=0\r\n\t\t\t\tArrays.fill(exposed, NOT_AN_INDEX);\r\n\t\t\t\t\r\n\t\t\t\t// Construct the auxiliary digraph\r\n\t\t\t\t\r\n\t\t\t\t// for all (v,w) in E do\r\n\t\t\t\tfor (int v = 0; v < gOrig.numVertices(); v++ ) {\r\n\t\t\t\t\tfor (Edge e : gOrig.eOuts(v)) {\r\n\t\t\t\t\t\tint w = e.right;\r\n\t\t\t\t\t\tassert e.left == v : \"vertex correspondence is wrong\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// if mate[w]=0 and w!=u then exposed[v]=w else if mate[w] !=v,0 then A=union(A,{v,mate[w]})\r\n\t\t\t\t\t\t// if(mate[w] == NOT_AN_INDEX && w != u){\r\n\t\t\t\t\t\t// exposed[v] = w;\r\n\t\t\t\t\t\t// }else if(mate[w] != v && mate[w] != NOT_AN_INDEX){\r\n\t\t\t\t\t\t// A.addEdge(new Edge(v,mate[w]));\r\n\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ( ! matching.isMatched(w) && w != u) {\r\n\t\t\t\t\t\t\t// DEBUG(String.format(\"adding (%d,%d) to exposed\\n\", v, w));\r\n\t\t\t\t\t\t\tif (exposed[v] == NOT_AN_INDEX) {\r\n\t\t\t\t\t\t\t\texposed[v] = w;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if (matching.mate(w) != v && matching.isMatched(w)) {\r\n\t\t\t\t\t\t\t// DEBUG(String.format(\"adding (%d,%d) to A\\n\", v, matching.mate(w)));\r\n\t\t\t\t\t\t\tA.add(new Edge(v, matching.mate(w)));\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\tDEBUG(String.format(\"Exposed vertices={%s}\\n\", printExposed()));\r\n\t\t\t\tif (exposed().size() == 0) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// forall v in V do seen[v]=0\r\n\t\t\t\tArrays.fill(seen, false);\r\n\t\t\t\t\r\n\t\t\t\t// Q={u}; label[u]=0; if exposed[u]!=0 then augment(u), goto stage;\r\n\t\t\t\tQ.clear();\r\n\t\t\t\tQ.add(u);\r\n\t\t\t\tArrays.fill(label, NOT_AN_INDEX);// unsure whether it was meant to clear label or just unset label[u] OLD_CODE=label[u] = NOT_AN_INDEX;\r\n\t\t\t\tif (isExposed(u)) {\r\n\t\t\t\t\taugment(u);\r\n\t\t\t\t\tDEBUG(String.format(\"new matching %s\\n\", matching.toString()));\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t// need to figure out how to handle blossom()\r\n\t\t\t\t\r\n\t\t\t\t// while Q != {empty} do\r\n\t\t\t\twhile ( ! Q.isEmpty()) {\r\n\t\t\t\t\tint v = Q.pop();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// forall unlabeled nodes w in V such that (v,w) in A\r\n\t\t\t\t\tfor (Edge e : A) {\r\n\t\t\t\t\t\tint w = e.left;\r\n\t\t\t\t\t\tif (e.right == v && label[w] == NOT_AN_INDEX && label[v] != w) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Q=union(Q,w), label[w]=v\r\n\t\t\t\t\t\t\tif ( ! Q.contains(w)) {\r\n\t\t\t\t\t\t\t\tQ.offer(w);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tcontinue; ///THIS CONTINUE WAS ADDED LATE AT NIGHT\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tlabel[w] = v;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// seen[mate[w]] = 1;\r\n\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\tint mate = findMate(w);\r\n\t\t\t\t\t\t\t\tseen[mate] = true;\r\n\t\t\t\t\t\t\t}catch(Exception err){\r\n\t\t\t\t\t\t\t\tDEBUG(String.format(\"error marking mate of %d as seen, mate not found\\n\", w));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// if exposed[w]!=0 then augment(w) goto stage;\r\n\t\t\t\t\t\t\tif (isExposed(w)) {\r\n\t\t\t\t\t\t\t\taugment(w);\r\n\t\t\t\t\t\t\t\tDEBUG(String.format(\"new matching %s\\n\", matching.toString()));\r\n\t\t\t\t\t\t\t\tcontinue stage;\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// if seen[w]=1 then blossom(w)\r\n\t\t\t\t\t\t\tif (seen[w]) {\r\n\t\t\t\t\t\t\t\tblossom(w);\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// remove loops created by the blossoms\r\n\t\t\t\t\tremoveSelfLoops(A);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static void k_means_offline(double[][] X, int k, String[] args){\n double[][] m = chooseKCluserCentres(k, X[0].length);\n double[][] oldM = m;\n \n //while loop and stopping condition\n int count = 0;\n \n //the index of each m associated to X, done below\n //first array is list of m's, second will be associated X_row indexes\n /*int[][] X_Assignments = new int[k][noRows];*/\n List<List<Integer>> X_Assignments = initXAssignments(m);\n\n \tboolean continue_ = findTermination(count, oldM, m);\n while(continue_){\n \toldM = m;\n \tX_Assignments = initXAssignments(m);\n\n \tfor(int i=0; i<X.length; i++){\n \t\tint minClusterIndex = findMinClusterIndex(X[i], m);\n \t\t//System.out.println(minClusterIndex);\n \t\tX_Assignments.get(minClusterIndex).add(i); //add to the list of clusters to points\n \t}\n\n \t//Check lists\n \t//printDoubleArrayList(X_Assignments);\n\n \tfor (int i=0; i<m.length; i++){\n \t\tm[i] = findClusterMean(X, X_Assignments, m, i); //finds for every dimension \n \t}\n\n \tcontinue_ = findTermination(count, oldM, m);\n \tcount++;\n }\n\n double sumOfSquaresError = findSumOfSquaresError(X, m);\n printOutput(X_Assignments, m, sumOfSquaresError, k, count);\n\n //append output file specified by args[1]\n writeOutputToFile (args[0], k, m, sumOfSquaresError, args[1]);\n }", "@Benchmark\n public void task0()\n throws IOException{\n Map<Character, Integer> letterScores = (new LetterScorer(maxThreads, validCharRegex))\n .getScoreFromCorpus(dataDir);\n\n Files.write(Paths.get(outFilePath)\n , (new KScorer(maxThreads, validCharRegex, kNeighborhood, letterScores))\n .getScoreFromCorpus(dataDir)\n .stream()\n .sorted(Comparator.comparing(Map.Entry::getKey))\n .map(e-> e.getKey() + \", \" + e.getValue())\n .collect(Collectors.joining(\"\\n\"))\n .getBytes());\n }", "public static boolean checkPath(int[][] bs, int i) {\n ArrayList<Integer> temp_cP = new ArrayList<Integer>();\r\n Set<Integer> temp_setcP = new HashSet<Integer>();\r\n boolean denoter = true;\r\n while (i == 3) {\r\n for (int k = 0; k < i; k++) {\r\n for (int e = 0; e < 3; e++) {\r\n temp_cP.add(e, bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n temp_cP.clear();\r\n temp_setcP.clear();\r\n\r\n for (int k = 0; k < i; k++) {\r\n for (int e = 3; e < 6; e++) {\r\n temp_cP.add(bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n while (i == 6) {\r\n\r\n for (int k = 3; k < i; k++) {\r\n for (int e = 0; e < 3; e++) {\r\n temp_cP.add(e, bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n temp_cP.clear();\r\n temp_setcP.clear();\r\n\r\n for (int k = 3; k < i; k++) {\r\n for (int e = 3; e < 6; e++) {\r\n temp_cP.add(bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n }\r\n return denoter;\r\n }", "@Test\n public void test_kmin_Integer_Collection3() {\n populate_i3();\n int actual = Selector.kmin(i3, 3, new CompareIntegerAscending());\n int expected = 6;\n Assert.assertEquals(\"3rd minimum not found\", expected, actual);\n }", "private void mark(int i) {\r\n // naechster Praesentationsschritt\r\n if (beforeAlgo) {\r\n beforeAlgo = false;\r\n lang.nextStep(\"Algorithm\");\r\n } else {\r\n lang.nextStep();\r\n }\r\n if (i != 0)\r\n code.unhighlight(i - 1);\r\n code.highlight(i); // neuen Code markieren\r\n explain.setText(\"\", null, null);\r\n if (lastT != null)\r\n colorObject(lastT, textColor);\r\n if (lastP != null)\r\n colorObject(lastP, edgeColor);\r\n\r\n }", "private static void applyRules(Instances itemsets, Instances predictions) {\n\t\tfor (int i=0; i<predictions.numInstances(); ++i) {\n\t\t\tInstance instance = predictions.instance(i);\n\t\t\tboolean covered = true;\n\t\t\tfor (int j= 0; j<itemsets.numInstances(); ++j) {\n\t\t\t\tInstance rule = itemsets.instance(j);\n\t\t\t\tcovered = true;\n\t\t\t\tfor (int k=0; k< itemsets.numAttributes() -1 ; ++k) {\n\t\t\t\t\tif (rule.value(k)==1) {\n\t\t\t\t\t\tcovered = instance.value(k)==1;\n\t\t\t\t\t\tif(!covered){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif (covered) {\n\t\t\t\t\t\n\t\t\t\t\tinstance.setClassValue(rule.classValue());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void CompareTwoFiles() {\n GetCharactersFromProject prog1Char;\r\n KGram prog1KGram;\r\n HashKGram prog1HashKGram;\r\n FingerPrint prog1FingerPrint;\r\n ArrayList<Integer> fingerprintProg1 = null;\r\n\r\n GetCharactersFromProject prog2Char;\r\n KGram prog2KGram;\r\n HashKGram prog2HashKGram;\r\n FingerPrint prog2FingerPrint;\r\n ArrayList<Integer> fingerprintProg2 = null;\r\n\r\n //for the first file\r\n try {\r\n prog1Char = new GetCharactersFromProject(filepath1);\r\n prog1KGram = new KGram(prog1Char.getCharacters());\r\n prog1HashKGram = new HashKGram(prog1KGram.ReturnProcessedKGram());\r\n prog1FingerPrint = new FingerPrint(prog1HashKGram.ReturnProcessedHashes());\r\n fingerprintProg1 = prog1FingerPrint.ReturnFingerPrint();\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n //this is for the second file\r\n try {\r\n prog2Char = new GetCharactersFromProject(filepath2);\r\n prog2KGram = new KGram(prog2Char.getCharacters());\r\n prog2HashKGram = new HashKGram(prog2KGram.ReturnProcessedKGram());\r\n prog2FingerPrint = new FingerPrint(prog2HashKGram.ReturnProcessedHashes());\r\n fingerprintProg2 = prog2FingerPrint.ReturnFingerPrint();\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n\r\n //this is for jaccard index. Jaccard index will be the basis of similarity\r\n float numSimilarity = 0;\r\n boolean isSimilarEncounter = false;\r\n int sizeFingerprint1 = fingerprintProg1.size();\r\n int sizeFingerprint2 = fingerprintProg2.size();\r\n\r\n for (Integer integer : fingerprintProg1) {\r\n\r\n for (Integer value : fingerprintProg2) {\r\n\r\n\r\n if ((integer.intValue() == value.intValue()) && !isSimilarEncounter) {\r\n numSimilarity++;\r\n isSimilarEncounter = true;\r\n }\r\n\r\n }\r\n\r\n\r\n isSimilarEncounter = false;\r\n }\r\n\r\n SimilarityScore = (numSimilarity / (sizeFingerprint1 + sizeFingerprint2 - numSimilarity));\r\n }", "@SuppressWarnings(\"unlikely-arg-type\")\r\n\tpublic static void main(String[] args) throws InterruptedException, ExecutionException, IOException {\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t\t// System.out.println(\"what\");\r\n\t\tint k = 7;\r\n\r\n\t\tchar[] set = { 'a', 'b', 'c' };\r\n\t\tchar[] str = new char[k];\r\n \r\n\t\tenumeratePaths(k, set, str, 0); // call function to generate the paths\r\n\t back_Up();// function to back up set of paths\r\n\t\t\t\t\t\t// information\r\n\t\t \r\n\r\n\t\tint[] lb = new int[R];// lower bound\r\n\t\tint[] ub = new int[R];// upper bound\r\n\r\n\t\tfor (int j = 0; j < R; j++) { // the sample range of integers is between 1 and 100\r\n\t\t\tlb[j] = -1000; // lower bound\r\n\t\t\tub[j] = 1000; // upper bound\r\n\r\n\t\t}\r\n\r\n\t\tfor (int run = 0; run < RUN; run++) {\r\n\r\n\t\t\tint[][] x = new int[pop_num][R];\r\n\t\t\tint[][] v = new int[pop_num][R];\r\n\t\t\t //id = 0;\r\n\t\t\t\r\n\t\t\t//paths.put(new String(str) , false);\r\n\t\t\tobj_total = 0;\r\n\t\t\t group_1_count = 0;\r\n\t\t group_2_count = 0;\r\n\t\t\t group_3_count = 0;\r\n\t\t\t group_4_count = 0;\r\n\t\t\t group_5_count = 0;\r\n\t\t\t group_6_count = 0;\r\n\t\t\t group_7_count = 0;\r\n\t\t\t group_8_count = 0;\r\n\t\t\t group_9_count = 0;\r\n\t\t\t\r\n\t\t\t group_10_count = 0;\r\n\t\t\t group_11_count = 0;\r\n\t\t\t group_12_count = 0;\r\n\t\t\t group_13_count = 0;\r\n\t\t\t group_14_count = 0;\r\n\t\t\t group_15_count = 0;\r\n\t\t\t group_16_count = 0;\r\n\t\t\t group_17_count = 0;\r\n\t\t\t group_18_count = 0;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// pick_counter_1 = 0;\r\n\t\t\t \r\n\t\t\t group_19_count = 0;\r\n\t\t\t group_20_count = 0;\r\n\t\t\t group_21_count = 0;\r\n\t\t\t group_22_count = 0;\r\n\t\t\t group_23_count = 0;\r\n\t\t\t group_24_count = 0;\r\n\t\t\t group_25_count = 0;\r\n\t\t\t group_26_count = 0;\r\n\t\t\t group_27_count = 0;\r\n\t\t\t\r\n\t\t\t group_28_count = 0;\r\n\t\t\t group_29_count = 0;\r\n\t\t\t group_30_count = 0;\r\n\t\t\t group_31_count = 0;\r\n\t\t\t group_32_count = 0;\r\n\t\t\t group_33_count = 0;\r\n\t\t\t group_34_count = 0;\r\n\t\t\t group_35_count = 0;\r\n\t\t\t group_36_count = 0;\r\n\t\t\t\r\n\t\t\t group_37_count = 0;\r\n\t group_38_count = 0;\r\n\t\t\t group_39_count = 0;\r\n\t\t\t group_40_count = 0;\r\n\t\t\t group_41_count = 0;\r\n\t\t\t group_42_count = 0;\r\n\t\t\t group_43_count = 0;\r\n\t\t\t group_44_count = 0;\r\n\t\t\t group_45_count = 0;\r\n\t\t\t\r\n\t\t group_46_count = 0;\r\n\t\t\t group_47_count = 0;\r\n\t\t\t group_48_count = 0;\r\n\t\t\t group_49_count = 0;\r\n\t\t\t group_50_count = 0;\r\n\t\t group_51_count = 0;\r\n\t\t\t group_52_count = 0;\r\n\t\t\t group_53_count = 0;\r\n\t\t\t group_54_count = 0;\r\n\t\t\t\r\n\t\t\t group_55_count = 0;\r\n\t\t\t group_56_count = 0;\r\n\t\t\t group_57_count = 0;\r\n\t\t\t group_58_count = 0;\r\n\t\t\t group_59_count = 0;\r\n\t\t\t group_60_count = 0;\r\n\t\t\t group_61_count = 0;\r\n\t\t group_62_count = 0;\r\n\t\t\t group_63_count = 0;\r\n\t\t group_64_count = 0;\r\n\t\t\t\r\n\t\t solution_1 = new int[500][R];\r\n\t\t\t\tsolution_2 = new int[500][R];\r\n\t\t\t\tsolution_3 = new int[500][R];\r\n\t\t\t\tsolution_4 = new int[500][R];\r\n\t\t\t\tsolution_5 = new int[500][R];\r\n\t\t\t\tsolution_6 = new int[500][R];\r\n\t\t\t\tsolution_7 = new int[500][R];\r\n\t\t\t\tsolution_8 = new int[500][R];\r\n\t\t\t\tsolution_9 = new int[500][R];\r\n\t\t\t\tsolution_10 = new int[500][R];\r\n\t\t\t\tsolution_11 = new int[500][R];\r\n\t\t\t\tsolution_12 = new int[500][R];\r\n\t\t\t\tsolution_13 = new int[500][R];\r\n\t\t\t\tsolution_14 = new int[500][R];\r\n\t\t\t\tsolution_15 = new int[500][R];\r\n\t\t\t\tsolution_16 = new int[500][R];\r\n\t\t\t\tsolution_17 = new int[500][R];\r\n\t\t\t\tsolution_18 = new int[500][R];\r\n\t\t\t\tsolution_19 = new int[500][R];\r\n\t\t\t\tsolution_20 = new int[500][R];\r\n\t\t\t\tsolution_21 = new int[500][R];\r\n\t\t\t\tsolution_22 = new int[500][R];\r\n\t\t\t\tsolution_23 = new int[500][R];\r\n\t\t\t\tsolution_24 = new int[500][R];\r\n\t\t\t\tsolution_25 = new int[500][R];\r\n\t\t\t\tsolution_26 = new int[500][R];\r\n\t\t\t\tsolution_27 = new int[500][R];\r\n\t\t\t\tsolution_28 = new int[500][R];\r\n\t\t\t\tsolution_29 = new int[500][R];\r\n\t\t\t\tsolution_30 = new int[500][R];\r\n\t\t\t\tsolution_31 = new int[500][R];\r\n\t\t\t\tsolution_32 = new int[500][R];\r\n\t\t\t\tsolution_33 = new int[500][R];\r\n\r\n\t\t\t\tsolution_34 = new int[500][R];\r\n\t\t\t\tsolution_35 = new int[500][R];\r\n\t\t\t\tsolution_36 = new int[500][R];\r\n\t\t\t\tsolution_37 = new int[500][R];\r\n\t\t\t\tsolution_38 = new int[500][R];\r\n\t\t\t\tsolution_39 = new int[500][R];\r\n\t\t\t\tsolution_40 = new int[500][R];\r\n\t\t\t\tsolution_41 = new int[500][R];\r\n\t\t\t\tsolution_42 = new int[500][R];\r\n\t\t\t\tsolution_43 = new int[500][R];\r\n\t\t\t\tsolution_44 = new int[500][R];\r\n\t\t\t\tsolution_45 = new int[500][R];\r\n\t\t\t\tsolution_46 = new int[500][R];\r\n\t\t\t\tsolution_47 = new int[500][R];\r\n\t\t\t\tsolution_48 = new int[500][R];\r\n\t\t\t\tsolution_49 = new int[500][R];\r\n\t\t\t\tsolution_50 = new int[500][R];\r\n\t\t\t\tsolution_51 = new int[500][R];\r\n\t\t\t\tsolution_52 = new int[500][R];\r\n\t\t\t\tsolution_53 = new int[500][R];\r\n\t\t\t\tsolution_54 = new int[500][R];\r\n\t\t\t\tsolution_55 = new int[500][R];\r\n\t\t\t\tsolution_56 = new int[500][R];\r\n\t\t\t\tsolution_57 = new int[500][R];\r\n\t\t\t\tsolution_58 = new int[500][R];\r\n\t\t\t\tsolution_59 = new int[500][R];\r\n\t\t\t\tsolution_60 = new int[500][R];\r\n\t\t\t\tsolution_61 = new int[500][R];\r\n\t\t\t\tsolution_62 = new int[500][R];\r\n\t\t\t\tsolution_63 = new int[500][R];\r\n\t\t\t\tsolution_64 = new int[500][R];\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t crossover_count = 0;\r\n boolean statusChecker =false;\r\n\t\t\tLinkedHashMap<String, List<Double>> parent_maps = new LinkedHashMap<String, List<Double>>();\r\n\t\t\t\r\n\t\t\tLinkedHashMap<String, List<Double>> offspring_maps = new LinkedHashMap<String, List<Double>>();\r\n\t\t\t\r\n\t\t\tLinkedHashMap<String, List<Double>> combined_maps = new LinkedHashMap<String, List<Double>>();\r\n\t\t//\tLinkedHashMap<String, List<Double>> fitnessmaps = new LinkedHashMap<String, List<Double>>();\r\n\r\n\t\t\tLinkedHashMap<String, Integer> setrank1 = new LinkedHashMap<String, Integer>();\r\n\t\t\r\n\r\n\t\t\tList<String> updated_population = new ArrayList<String>();\r\n\t\t\t\r\n\t\t\tList<String> combined_population = new ArrayList<String>();\r\n\t\t\tList<String> offspring_population = new ArrayList<String>();\r\n\t\t\t//List<String> parent_population = new ArrayList<String>();\r\n\t\t\tList<String> single_population = new ArrayList<String>();\r\n\r\n\t\t\tList<String> combined_population_list = new ArrayList<String>();\r\n\t\t\t\r\n\t\t\tList<String> temporary_path_holder = new ArrayList<String>();\r\n\t\t\t\r\n\t\t\tList<String> parents_population = new ArrayList<String>();\r\n\t\t\t\r\n\t\t\tList<String> parents_population_copy = new ArrayList<String>();\r\n\t\t\t\r\n\t\t//\tString traverse_template;\r\n\r\n\t\t\t// the 2d arrays below hold the solutions to each respective group\r\n\t\t\tint [][] solution = new int[500][R];\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t//\tboolean [] statu = new boolean [PATHNUM];\r\n\t\t\t\t\r\n\r\n\t\t\tint totalpathcounter = 0;\r\n\r\n\t\t\tint obj_total = 0;\r\n\r\n\t\t\tString getfinalpath = null;\r\n\t\t\t//String getfinalpath;\r\n\r\n\t\t\tif (run > 0) { // in each run reset the number counter of the paths covered in each group\r\n\r\n\t\t\t\treset_All();\r\n\t\t\t\tpaths.clear();\r\n\t\t\t\tupdated_population.clear();\r\n\t\t\t\tcombined_population.clear();\r\n\t\t\t\toffspring_population.clear();\r\n\t\t\t\tsingle_population.clear();\r\n\t\t\t\toffspring_maps.clear();\r\n\t\t\t\tsetrank1.clear();\r\n\t\t\t\t//setrank2.clear();\r\n\t\t\t\t//offspring_maps.clear();\r\n\t\t\t\tparents_population_copy.clear();\r\n\t\t\t\tcombined_maps.clear();\r\n\t\t\t\tparent_maps.clear();\r\n\t\t\t\tpaths.putAll(temporay_paths); \r\n\t\t\t}\r\n\r\n\t\t\tfor (int i = 0; i < pop_num; i++) // initialize the population with the dimension of R values/inputs\r\n\t\t\t{\r\n\r\n\t\t\t\tfor (int j = 0; j < R; j++) {\r\n\t\t\t\t\r\n\t\t\t\t\tx[i][j] = (int)(Math.random()*((ub[j] - lb[j])+1))+ lb[j];\r\n\r\n\t\t\t\t} //initial random population\r\n\r\n\t\t\t\tgetfinalpath = pathnum(x[i]); \r\n\t\t\t\t//archiving( String check_path_group , int num, int[][] offspring)\r\n int pickPaths= 0;\r\n\t\t\t\t\r\n\t\t\t\tSet<String> keyz = paths.keySet();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tfor (String key : keyz) {\r\n\r\n\t\t\t\t\tif (pickPaths < 50) { //pick subset of N paths\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\ttarget_subset.put(key + \" \" + \"new\", false);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tpickPaths++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\tparents_population.add(\"parent\" + \" \" + i);\r\n\t\t\t\t//record covered path and find group where it belongs\r\n\t\t\t\t//save test case in corresponding path group\r\n\t\t\t\tarchiving( getfinalpath , i, x);\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\tparents_population_copy.addAll(parents_population);\r\n\t\t\t\r\n\t\t\tcombined_population_list.addAll(parents_population_copy);\t\r\n\t\t\t///offspring_population.addAll(parents_population_copy);\r\n\t\t\t//Cycle[run] = 1;\r\n\r\n\t\t\t\tlong start_time = System.currentTimeMillis();\r\n\t\t\t\tlong wait_time = 1518750;\r\n\t\t\t\tlong end_time = start_time + wait_time;\r\n\t\t\t\tList<Double> temp_2 = new ArrayList<Double>();\r\n\t\t\t\t\r\n\t\t\t // int generation = 0;\r\n\t\t\t\t\r\n\t\t\t\twhile ((System.currentTimeMillis() < end_time) && obj_total < PATHNUM_NUMBER) // not exceeded the set\r\n\r\n\t\t\t\t{\r\n\t\t\t\t//LinkedHashMap<String, List<Double>> parent_maps_init = new LinkedHashMap<String, List<Double>>(); \r\n\t\t\t\t//initial random population tournament selection\r\n\t\t\t\r\n\t\t\t\t\t//List<Double> temp = new ArrayList<Double>();\r\n\t\t\t\t\tif (crossover_count == 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tRandom random = new Random();\r\n\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int i = 0; i < 25; i++) {\r\n\t\t\t\t\r\n\t\t\t\t\t\t//pick two parents to cross\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString randomKey_1 = parents_population_copy.get( random.nextInt(parents_population_copy.size())) ;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tparents_population_copy.remove(randomKey_1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString randomKey_2 = parents_population_copy.get( random.nextInt(parents_population_copy.size())) ;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tparents_population_copy.remove(randomKey_2);\r\n\t\t\t\t\t\t//access parent via parent_maps_init\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//split the string\r\n\t\t\t\t\t\t//parents_population.add(\"parent\" + \" \" + i);\r\n\t\t\t\t\t\tString [] parent_1_string = randomKey_1.split(\" \");\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString par_1;\r\n\r\n\t\t\t\t\t\tint pos_1;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tpar_1 = parent_1_string[0];\r\n\t\t\t\t\t\tpos_1 = Integer.parseInt(parent_1_string[1]);\r\n\t\t\t\t\t\t\r\n // String [] parent_2_string = randomKey_2.split(\" \");\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString [] parent_2_string = randomKey_1.split(\" \");\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString par_2;\r\n\r\n\t\t\t\t\t\tint pos_2;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tpar_2 = parent_2_string[0];\r\n\t\t\t\t\t\tpos_2 = Integer.parseInt(parent_2_string[1]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t //System.out.println(\"Random number 1 : \"+Math.random()\r\n\t\t\t\t\t\t//crossover nbased on probability\r\n\t\t\t\t \tRandom rand = new Random();\r\n\t\t\t\t\t//\tdouble rdm = rand.nextDouble();\t\t \r\n\t\t\t\t\t\tdouble rdm = Math.random();\r\n\t\t\t\t\t\t if(rdm < 0.75) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//single-point crossover\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \t//randomly find a position and exchange the tails\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\tint parent_1_random = rand.nextInt(R);\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t int new_point = parent_1_random; \r\n\t\t\t\t\t\t //exchange elements with parent_2\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t //\tint[][] temporal = new int[pop_num][R];\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t for (int j = 0 ; j < R; j++) {\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 \tv[pos_1][j] = x[pos_1][j];\r\n\t\t\t\t\t\t \tv[pos_2][j] = x[pos_2][j];\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t}\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t\t int g = new_point;\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t // for (int g = new_point ; new_point < R; new_point++) {\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \twhile (g <= R){\t\r\n\t\t\t\t\t \t\t//switch the tails of parent one and parent two\r\n\t\t\t\t\t\t \tv[pos_1][g] = x[pos_2][g];\r\n\t\t\t\t\t\t \tv[pos_2][g] = x[pos_1][g];\r\n\r\n\t\t\t\t\t \t g++;\r\n\t\t\t\t\t \t}\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdouble mutate = Math.random();\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t if(mutate < (1/R)) { \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t int child_1 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \tint child_2 = (int) (Math.random() * R);\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 \tv[pos_1][child_1] = (int)(Math.random()*((ub[child_1] - lb[child_1])+1))+ lb[child_1];\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_1);\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \tv[pos_2][child_2] = (int)(Math.random()*((ub[child_2] - lb[child_2])+1))+ lb[child_2]; \r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_2);\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t else {\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t offspring_population.add(\"child\" + \" \" + pos_1);\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t offspring_population.add(\"child\" + \" \" + pos_2);\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t }\r\n\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 \t\r\n\t\t\t\t\t \t\tfor (int j = 0 ; j < R; j++) {\r\n\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t \t\tv[pos_1][j] = x[pos_1][j];\r\n\t\t\t\t\t\t \t\tv[pos_2][j] = x[pos_2][j];\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\t\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\t//mutate\r\n\t\t\t\t\t \t\t\r\n\r\n\t\t\t\t\t \t// Random mut = new Random();\r\n\t\t\t\t\t\t\t\tdouble mutate = Math.random();\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t if(mutate < (1/R)) { \r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t int child_1 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t \tint child_2 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t \tv[pos_1][child_1] = (int)(Math.random()*((ub[child_1] - lb[child_1])+1))+ lb[child_1];\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\t \t\r\n\t\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_1);\r\n\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t \tv[pos_2][child_2] = (int)(Math.random()*((ub[child_2] - lb[child_2])+1))+ lb[child_2]; \r\n\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_2);\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\t\t }\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n //mutation (1/size of test case input vector)\r\n\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//get path traversed by offsprings\r\n\t\t\t\t \r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int i = 0; i < offspring_population.size(); i++) {// initialize the population with the dimension of R values/inputs\r\n\t\t\t\t\r\n\t\t\t\t String [] get_index = offspring_population.get(i).split(\" \");\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t String off_1;\r\n\r\n\t\t\t\t\tint index_1;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\toff_1 = get_index[0];\r\n\t\t\t\t\tindex_1 = Integer.parseInt(get_index[1]);\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tgetfinalpath = pathnum(v[index_1]);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tarchiving( getfinalpath , index_1, v);\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\t \r\n\t\t\t\t\t\r\n\t\t\t\t\t // if ()\r\n\t\t\t\t\t\r\n\t\t\t\t \t\tRandom random = new Random();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//\tLinkedHashMap<String, Boolean> changed_status = new LinkedHashMap<String, Boolean>();\r\n\t\t\t\t\t\t\t//\tLinkedHashMap<String, Boolean> child_status = new LinkedHashMap<String, Boolean>();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t \t\tparents_population_copy.clear();\r\n\t\t\t\t \t\tfor (int i = 0; i < 50; i++) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tparents_population_copy.add( \"parent\" + \" \" + i);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t \t\t\r\n\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\tfor (int i = 0; i < 25; i++) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tString randomKey_1 = parents_population_copy.get( random.nextInt(parents_population_copy.size())) ;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tparents_population_copy.remove(randomKey_1);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tString randomKey_2 = parents_population_copy.get( random.nextInt(parents_population_copy.size())) ;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tparents_population_copy.remove(randomKey_2);\r\n\t\t\t\t\t\t\t\t\t//access parent via parent_maps_init\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t//split the string\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tString [] parent_1_string = randomKey_1.split(\" \");\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tString par_1;\r\n\r\n\t\t\t\t\t\t\t\t\tint pos_1;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tpar_1 = parent_1_string[0];\r\n\t\t\t\t\t\t\t\t\tpos_1 = Integer.parseInt(parent_1_string[1]);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t // String [] parent_2_string = randomKey_2.split(\" \");\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tString par_2;\r\n\r\n\t\t\t\t\t\t\t\t\tint pos_2;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tString [] parent_2_string = randomKey_2.split(\" \");\r\n\t\t\t\t\t\t\t\t\tpar_2 = parent_2_string[0];\r\n\t\t\t\t\t\t\t\t\tpos_2 = Integer.parseInt(parent_2_string[1]);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t//crossover nbased on probability\r\n\t\t\t\t\t\t\t\t\tRandom rand = new Random();\r\n\t\t\t\t\t\t\t\t\tdouble rdm = Math.random();\t\t \r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t if(rdm < 0.75) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t//single-point crossover\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \t//randomly find a position nad exchange the tails\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\tint parent_1_random = rand.nextInt(R);\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t int single_point = parent_1_random; \r\n\t\t\t\t\t\t\t\t\t //exchange elements with parent_2\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t //\tint[][] temporal = new int[pop_num][R];\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t for (int j = 0 ; j < R; j++) {\r\n\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t\t \tv[pos_1][j] = x[pos_1][j];\r\n\t\t\t\t\t\t\t\t\t \tv[pos_2][j] = x[pos_2][j];\r\n\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t int s = single_point;\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t while (s <= R) {\r\n\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t \t\t//switch the tails of parent one and parent two\r\n\t\t\t\t\t\t\t\t\t \tv[pos_1][s] = x[pos_2][s];\r\n\t\t\t\t\t\t\t\t\t \tv[pos_2][s] = x[pos_1][s];\r\n\r\n\t\t\t\t\t\t\t\t \t s++;\r\n\t\t\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t \t Random mut = new Random();\r\n\t\t\t\t\t\t\t\t\t\tdouble mutate = Math.random();\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t if(mutate < (1/R)) { \r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t int child_1 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \tint child_2 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \tv[pos_1][child_1] = (int)(Math.random()*((ub[child_1] - lb[child_1])+1))+ lb[child_1];\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_1);\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \tv[pos_2][child_2] = (int)(Math.random()*((ub[child_2] - lb[child_2])+1))+ lb[child_2]; \r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_2);\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t else {\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t offspring_population.add(\"child\" + \" \" + pos_1);\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t offspring_population.add(\"child\" + \" \" + pos_2);\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t \t\tfor (int j = 0 ; j < R; j++) {\r\n\t\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t\t \t\tv[pos_1][j] = x[pos_1][j];\r\n\t\t\t\t\t\t\t\t\t \t\tv[pos_2][j] = x[pos_2][j];\r\n\t\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t\t\tdouble mutate = Math.random();\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t if(mutate < (1/R)) { \r\n\t\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t int child_1 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t\t \tint child_2 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t\t \tv[pos_1][child_1] = (int)(Math.random()*((ub[child_1] - lb[child_1])+1))+ lb[child_1];\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_1);\r\n\t\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t\t \tv[pos_2][child_2] = (int)(Math.random()*((ub[child_2] - lb[child_2])+1))+ lb[child_2]; \r\n\t\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_2);\r\n\t\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t \t}\r\n\t\t\t\r\n\t\t\t\t\t \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (int i_ = 0; i_ < offspring_population.size(); i_++) {// initialize the population with the dimension of R values/inputs\r\n\t\t\t\t\t\r\n\t\t\t\t\t String [] get_index = offspring_population.get(i_).split(\"\");\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t String off_1;\r\n\r\n\t\t\t\t\t\tint index_1;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toff_1 = get_index[0];\r\n\t\t\t\t\t\tindex_1 = Integer.parseInt(get_index[1]);\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t \r\n\t\t\t\t\t\tgetfinalpath = pathnum(v[index_1]); //get path traversed by offspring test case \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tarchiving( getfinalpath , i_, v);//add test case to archive\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t //match the paths traversed\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t\t\tcrossover_count++;\r\n\t\t\t\t\r\n\t\t\t\t\t//combined_population_list.addAll(parents_population_copy);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int i = 0; i < offspring_population.size(); i++) // add all offpsings to parent and form final combined population\r\n\t\t\t\t\t{\r\n\t\t\t\r\n\t\t\t\t\t\t\tcombined_population_list.add(offspring_population.get(i));\r\n\t\t\t\t }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tList<String> final_combined_population = new ArrayList<String>();\r\n\r\n\t\t\t\t\t// temp.clear();\r\n\r\n\t\t\t\t\tfinal_combined_population.addAll(combined_population_list);\t\r\n\t\t\t\t\t\r\n\t\t\t\t//fit.add(target_path_+ \" \" + path_status +\" \" + nonsimple_unmatched2);\r\n\t\t\t\t//evaluate parent and child population\r\n\t\t\t\t\tArrayList <String> offspring_fitness = new ArrayList<String>();\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int i = 0; i < final_combined_population.size(); i++) // contains both parent and offspring test cases\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\r\n String checkString = final_combined_population.get(i);\t\r\n \r\n String [] getType = checkString.split(\" \");\r\n \r\n\t\t\t\t\t\tString typeName = getType[0];\r\n\r\n\t\t\t\t\t\tint typeId = Integer.parseInt(getType[1]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//\tfit.add(target_path_+ \" \" + path_status +\" \" + nonsimple_unmatched2);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (typeName.equals(\"parent\")) {\r\n\r\n\t\t\t\t\t \toffspring_fitness = benchmarkfunction(x[typeId]);\r\n\t\t\t\t\t \t//extract path and fitness\r\n\t\t\t\t\t \tcheck_fitness.put( \"parent\" + \" \" + typeId , offspring_fitness);\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t \t//static LinkedHashMap<String, ArrayList<String>> check_fitness = new LinkedHashMap<String, ArrayList<String>>();\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 \r\n\t\t\t\t\t\telse {\r\n//\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//fit.add(target_path_+ \" \" + path_status +\" \" + nonsimple_unmatched2);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\toffspring_fitness = benchmarkfunction(v[typeId]);\r\n\t\t\t\t\t\t\tcheck_fitness.put( \"child\" + \" \" + typeId , offspring_fitness);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tint colum_sizes = 0;\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor ( String get_keys : check_fitness.keySet() ) {\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcolum_sizes = ( check_fitness.get(get_keys).size());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//process remove_objective_routine\r\n\t\t\t\t\t//process map first\r\n\t\t\t\t\t//static LinkedHashMap<String, ArrayList<String>> check_fitness = new LinkedHashMap<String, ArrayList<String>>();\r\n\t\t\t\t\tList<String> average_calculator = new ArrayList<String>();\r\n\t\t\t\t\t\r\n\t\t\t\t//\tint offspring_fitness_size = offspring_fitness.size();\r\n\t\t\t\t\r\n\t\t\t\t//\tIterator<Map.Entry<String, ArrayList<String>>> iteration_ = check_fitness.entrySet()\r\n\t\t\t\t\t\t\t//.iterator();\r\n\t\t\t\t\tString actualpath = \"\";\r\n\t\t\t\t\tString process_1 = \"\";\r\n\t\t\t\t\tString process_2 = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t//String updated_value_2 = \"\";\r\n\t\t\t\t\t//\"child\" + \" \" + typeId , offspring_fitness\r\n\t\t\t\t\t//String updated_value = \"\";\r\n\t\t\t\t\t\r\n//\t\t\t\t\tfit.add(target_path_+ \" \" + path_status +\" \" + nonsimple_unmatched2);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\tint pid = 0;\t\t\r\n\t\t\t\t\t\r\n\t\t\tfor (int i = 0 ; i < colum_sizes; i++ )\t{\r\n\t\t\t\t\t\r\n\t\t\t\tdouble add_objective_scores = 0.0;\r\n\t\t\t\tdouble sum_at_column = 0.0;\r\n\r\n\t\t\t\tfor ( String get_keys : check_fitness.keySet() ) {\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n // int pid = 0;\r\n \r\n\t\t\t\t\t\t//Map.Entry<String, ArrayList<String>> entry = iteration_.next();\r\n\r\n\t\t\t\t\t\taverage_calculator = check_fitness.get(get_keys);\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//entry.getValue();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString get_objective_score = average_calculator.get(i);\r\n\t\t\t \r\n\t\t\t //calculate average fitness\r\n\t\t\t \r\n\t\t\t\t\t\t//\tupdated_population.add(entry.getKey());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//50 is the number of test cases\r\n\t\t\t\t\t\t//while (pid < 50) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t///String checkString = final_combined_population.get(i);\t\r\n\t \r\n\t String [] getDetails = get_objective_score.split(\" \");\r\n\t\t\t\t\t\t actualpath = getDetails[0];\r\n double objective_scores = Double.parseDouble(getDetails[1]);\r\n \r\n add_objective_scores = add_objective_scores + objective_scores ;\r\n \r\n //total fitness at colum i\r\n sum_at_column = (add_objective_scores / check_fitness.size());\r\n //get total fitness \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//int old_value = remove_objective[actualpath]\r\n\t\t\t\t\t//if(remove_objective.contiansKey(actualpath))\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\tfor ( String entry_1 : target_subset.keySet() ) {\t//update path status\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif (entry_1.equals(actualpath)) {\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 String [] processPath = actualpath.split(\" \");\r\n\t\t\t\t\t\t\t process_1 = processPath[0];\r\n\t\t\t\t\t\t\t process_2 = processPath[1];\r\n\t\t\t\t\t\t\t \r\n\t //Double objective_scores = Double.parseDouble(getDetails[1]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (process_2.equals(\"new\")) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\ttarget_subset.put(process_1 + \" \" + \"old\" , false );\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tremove_objective.put( actualpath, sum_at_column);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//remove_objective.put( actualpath, max_1 + \" \" + add_objective_scores );\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tdouble previous_value = remove_objective.get(actualpath);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//double get_First = Double.parseDouble(get_Path[0]);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//double get_Second = Double.parseDouble(get_Path[1]);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ( previous_value > sum_at_column ) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tremove_objective.put( actualpath, sum_at_column);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t// Update status to true\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\ttemporary_path_holder.add(actualpath); \r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tpaths.put(actualpath, true);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\ttarget_subset.remove(actualpath);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t//\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tArrayList<String> remove_objectives_1 = new ArrayList<String>();\r\n\t\t\t\r\n\t\t\tfor ( String entry_2 : check_fitness.keySet() ) {\t//process test case // update their fitness vectors by deleting the removed objectives\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\tString [] process_to_remove = entry_2.split(\" \");\r\n\t\t\t\t\r\n\t\t\t\tString processes_1 = process_to_remove[0];\r\n\t\t\t\tint index_2 = Integer.parseInt(process_to_remove[1]);\r\n\t\t\t\t\r\n\t\t\t\tremove_objectives_1 = check_fitness.get(entry_2);\r\n\t\t\t\t\r\n\t\t\t\tfor (int i = 0; i < remove_objectives_1.size(); i++) // process the fitness vector and delete the worst values\r\n\t\t\t\t{\r\n\t\t\t\t\t//fit.add(target_path_+ \" \" + path_status +\" \" + nonsimple_unmatched2);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//target_subset.remove(actualpath);\r\n\t\t\t\t\t//temporary_path_holder.add(actualpath); \r\n\t\t\t\t\t\r\n\t\t\t\t\tString [] process_paths_to_remove = remove_objectives_1.get(i).split(\" \");\r\n\t\t\t\t\t\r\n\t\t\t\t\tString process_path_1 = process_paths_to_remove[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (temporary_path_holder.contains(process_path_1) ) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tremove_objectives_1.remove(process_path_1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcheck_fitness.put( processes_1 + \" \" + index_2, remove_objectives_1);\r\n\t\t\t\t\r\n\t\t\t\tremove_objectives_1.clear( );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//target_subset.put(process_1 + \" \" + \"old\" , false );\r\n\t\t\t\r\n\t\t\t Set<String> remainingPath = target_subset.keySet();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\tfor (String keyss : remainingPath) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t String [] get_Remaining = keyss.split(\" \");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t String remaining_1 = get_Remaining[0];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t still_remaining_targets.add(remaining_1); //back-up set of remaining targets\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 \r\n\t\t\t\t\t\r\n\t\t\t\tif (target_subset.size()!=0)\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tif ((obj_total) == PATHNUM_NUMBER ) { // if all paths covered break out of while loop\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t if ((obj_total) < PATHNUM_NUMBER ) { // if not all paths covered perform\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t if ((target_subset.size() == 1)) { \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t \t\r\n\t\t\t\t \t LinkedHashMap<String, ArrayList<Double>> updated_maps_ = new LinkedHashMap<String, ArrayList<Double>>();\r\n\t\t\t\t \t\r\n\t\t\t\t\t ArrayList<String> updated_fit_ = new ArrayList<String>();\t\r\n\t\t\t\t\t \r\n\t\t\t\t\t ArrayList<Double> updated_1 = new ArrayList<Double>();\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t \tfor ( String key_10 : check_fitness.keySet() ) {\r\n\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tupdated_fit_ = check_fitness.get(key_10);\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\tfor (int r= 0; r < updated_fit_.size(); r++) {\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t String [] get_list = updated_fit_.get(r).split(\" \");\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t double objective_score = Double.parseDouble(get_list[2]);\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t updated_1.add(objective_score);\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\tupdated_maps_.put(key_10, updated_1);\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tupdated_fit_.clear();\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tupdated_1.clear();\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t \t\r\n\t\t\t\t \t\r\n\t\t\t\t \tint counter = 0;\r\n\t\t\t\t\t\t\twhile (counter < 50) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t List<Double> value_holder = new ArrayList<Double>();\r\n\t\t\t\t\t\t\t\t List<String> keys = new ArrayList<String>(updated_maps_.keySet());\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t Random rand = new Random();\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t String key_ss = keys.get(rand.nextInt(keys.size()));\r\n\t\t\t\t\t\t\t\t String key_holder = null;\r\n\t\t\t\t\t\t\t\t value_holder.addAll(updated_maps_.get(key_ss));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t double min = value_holder.get(0);\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t value_holder.clear();\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t for (int i = 1 ; i < 10; i++) {\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t String key = keys.get(rand.nextInt(keys.size()));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t value_holder.addAll(updated_maps_.get(key));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t double checker = value_holder.get(0);\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t if (checker < min) {\r\n\t\t\t\t\t\t min = checker;\r\n\t\t\t\t\t\t key_holder = key;\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t value_holder.clear();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t parents_population_copy.add(key_holder);\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\r\n\t\t\t\t \t\r\n\t\t\t\t\t\r\n\t\t\t\t\t statusChecker = true;\r\n\t\t\t\t }//if only one uncovered path\r\n\t\t\t\t\t\t\r\n\t\t\t\t else { \r\n\t\t\t\t\t if (target_subset.size() > 1) { //if many remaining uncovered paths\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t LinkedHashMap<String, ArrayList<Double>> updated_maps = new LinkedHashMap<String, ArrayList<Double>>();\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t ArrayList<String> updated_fit = new ArrayList<String>();\t\r\n\t\t\t\t\t \r\n\t\t\t\t\t ArrayList<Double> updated_ = new ArrayList<Double>();\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t \tfor ( String key_10 : check_fitness.keySet() ) {\r\n\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tupdated_fit = check_fitness.get(key_10);\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\tfor (int r= 0; r < updated_fit.size(); r++) {\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t String [] get_list = updated_fit.get(r).split(\" \");\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t double objective_score = Double.parseDouble(get_list[2]);\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t updated_.add(objective_score);\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\tupdated_maps.put(key_10, updated_);\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tupdated_fit.clear();\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tupdated_.clear();\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\t}\t\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t //updated_maps.put(key_10, updated_); perform preference sorting on this map\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t \tint updated_sizes = 0;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tfor ( String get_keys : updated_maps.keySet() ) {\t\r\n\t\t\t\t\t\t\t\t\t updated_sizes = ( updated_maps.get(get_keys).size());\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t} \t\r\n\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tDouble[][] offspring_fitness_full = new Double[final_combined_population\r\n\t\t\t\t\t\t\t\t\t.size()][updated_sizes]; // n x m matrix of combined parents and offspring test cases\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tint updates = 0;\r\n\r\n\t\t\t\t\t\t\t// List<String> traverse_group = new ArrayList<String>();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//List<String> best_column = new ArrayList<String>();\r\n\t\t\t\t\t\t\tint fitss = 0;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile (updates < final_combined_population.size()) {\r\n\r\n\t\t\t\t\t\t\t\tList<Double> fitness_objectives_updated = new ArrayList<Double>();\r\n\t\t\t\t\t\t\t\t// fitness_objectives_updated.clear();\r\n\r\n\t\t\t\t\t\t\t\tfitness_objectives_updated = (updated_maps.get(final_combined_population.get(updates)));\r\n\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\tList<Double> temp_3 = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t// temp.clear();\r\n\r\n\t\t\t\t\t\t\t\ttemp_3.addAll(fitness_objectives_updated);\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tfor (int ups = 0; ups < temp_3.size(); ups++) {\r\n\r\n\t\t\t\t\t\t\t\t\toffspring_fitness_full[updates][ups] = fitness_objectives_updated.get(ups);\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tfitness_objectives_updated.clear();\r\n\t\t\t\t\t\t\t\tupdates++;\r\n\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\r\n\t\t\t\t\t \t//check if paths is covered , plus check replaced status\r\n\t\t\t \t// average objective score calculation.....\r\n\t\t\t\t\t\t\t// removing objectives\r\n\t\t\t\t\t\t\t// check current generation vs previous generation\r\n\t\t\t \t// update replaced status in main set of uncovered paths\r\n\t\t\t \r\n\t\t\t \t\r\n\t\t\t \t// update population by replacing the other targets\r\n\t\t\t \t\r\n\t\t\t \t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tList<String> best_column = new ArrayList<String>();\r\n\t\t\t\t\r\n\t\t\t\t\t\t\tint sizes = temp_2.size();\r\n\r\n\t\t\t\t\t\t\t//double row_fit;\r\n\t\t\t\t\t\t\tint colums = 0;\r\n\t\t\t\t\t\t\tString test_case;\r\n\t\t\t\t\t\t\tdouble fit_rowfit;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\tLinkedHashMap<String, Double> row_getter = new LinkedHashMap<String, Double>();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile (colums < sizes) {\r\n\r\n\t\t\t\t\t\t\t\tfor (int get_row = 0; get_row < (final_combined_population.size()); get_row++) {\r\n\r\n\t\t\t\t\t\t\t\t\tfit_rowfit = (offspring_fitness_full[get_row][colums]);\r\n\r\n\t\t\t\t\t\t\t\t\tdouble row_fitter = fit_rowfit;\r\n\r\n\t\t\t\t\t\t\t\t\trow_getter.put(final_combined_population.get(get_row), row_fitter);\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tMap<String, Double> result = row_getter.entrySet().stream() //get test case with minimum objective score for each objective\r\n\t\t\t\t\t\t\t\t\t\t.sorted(Map.Entry.comparingByValue())\r\n\t\t\t\t\t\t\t\t\t\t.collect(toMap(Map.Entry::getKey, Map.Entry::getValue,\r\n\t\t\t\t\t\t\t\t\t\t\t\t(oldValue, newValue) -> oldValue, LinkedHashMap::new));\r\n\t\t\t\t\t\t\t\t// System.out.println(\"Map yino\" +result );\r\n\r\n\t\t\t\t\t\t\t\tIterator<Map.Entry<String, Double>> best_col = result.entrySet().iterator();\r\n\r\n\t\t\t\t\t\t\t\twhile (best_col.hasNext()) {\r\n\r\n\t\t\t\t\t\t\t\t\tMap.Entry<String, Double> entry = best_col.next();\r\n\r\n\t\t\t\t\t\t\t\t\ttest_case = entry.getKey();\r\n\r\n\t\t\t\t\t\t\t\t\tif (!best_column.contains(test_case)) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tbest_column.add(test_case);\r\n\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tresult.clear();\r\n\t\t\t\t\t\t\t\trow_getter.clear();\r\n\t\t\t\t\t\t\t\tcolums++;\r\n\r\n\t\t\t\t\t\t\t}\r\n \r\n\t\t\t\t\t\t\t//Go straight to computing crowding distance for Font 0\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tint distance_zero;\r\n\r\n\t\t\t\t\t\t\t/************************************************************************************************************************************************************/\r\n\r\n\t\t\t\t\t\t\tdouble[][] distance_matrix_zero = new double[best_column.size()][best_column.size()];\r\n\r\n\t\t\t\t\t\t\tif ((best_column.size()) > 1) {\r\n\r\n\t\t\t\t\t\t\t\tfor (int best = 0; best < (best_column.size()); best++) {\r\n\r\n\t\t\t\t\t\t\t\t\tList<Double> front_0_1 = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\tfront_0_1 = updated_maps.get(best_column.get(best));\r\n\r\n\t\t\t\t\t\t\t\t\tfor (int ind_d = 0; ind_d < best_column.size(); ind_d++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (!((best_column.get(best).equals(best_column.get(ind_d))))) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tList<Double> front_0_2 = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfront_0_2 = updated_maps.get(best_column.get(ind_d));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tdistance_zero = get_count(front_0_1, front_0_2);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tint temp_dis = distance_zero;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tdistance_matrix_zero[best][ind_d] = temp_dis;\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tLinkedHashMap<String, Double> setdistance_zero_2 = new LinkedHashMap<String, Double>();\r\n\r\n\t\t\t\t\t\t\t\tfor (int font_ = 0; font_ < best_column.size(); font_++) {\r\n\r\n\t\t\t\t\t\t\t\t\tdouble zeros = 0.0;\r\n\r\n\t\t\t\t\t\t\t\t\tsetdistance_zero_2.put(best_column.get(font_), zeros);\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tfor (int font_i = 0; font_i < (best_column.size()); font_i++) {\r\n\r\n\t\t\t\t\t\t\t\t\tfor (int font_j = 0; font_j < best_column.size(); font_j++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (!((best_column.get(font_i).equals(best_column.get(font_j))))) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif (setdistance_zero_2.get(best_column\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.get(font_i)) < distance_matrix_zero[font_i][font_j]) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tdouble dis = (distance_matrix_zero[font_i][font_j]);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tsetdistance_zero_2.put(best_column.get(font_i), dis);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tMap<String, Double> result = setdistance_zero_2.entrySet().stream()\r\n\t\t\t\t\t\t\t\t\t\t.sorted(Map.Entry.comparingByValue())\r\n\t\t\t\t\t\t\t\t\t\t.collect(toMap(Map.Entry::getKey, Map.Entry::getValue,\r\n\t\t\t\t\t\t\t\t\t\t\t\t(oldValue, newValue) -> oldValue, LinkedHashMap::new));\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tfor (Map.Entry<String, Double> entry : result.entrySet()) {\r\n\r\n\t\t\t\t\t\t\t\t\tif (updated_population.size() < pop_num) { //updated_population holds the selected population for next generation\r\n\t\t\t\t\t\t\t\t\t\tupdated_population.add(entry.getKey());\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tresult.clear();\r\n\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//updated population has best performing test cases sorted in descending order\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\telse { // process the only item in the best set\r\n\r\n\t\t\t\t\t\t\t\tif (!best_column.isEmpty()) {\r\n\r\n\t\t\t\t\t\t\t\t\tString item_one = best_column.get(0);\r\n\r\n\t\t\t\t\t\t\t\t\tif (updated_population.size() < pop_num) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tupdated_population.add(item_one);\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t//Establish other fonts\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tList<String> fitness_objectives_comparator = new ArrayList<String>();\r\n\t\t\t\t\t\t\t// List<Double> fitness_objectives_p = new ArrayList<Double>();\r\n\t\t\t\t\t\t\t// List<Double> fitness_objectives_q= new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\tfor (int next_front = 0; next_front < final_combined_population.size(); next_front++) {\r\n\r\n\t\t\t\t\t\t\t\tif (!best_column.contains(final_combined_population.get(next_front))) {\r\n\r\n\t\t\t\t\t\t\t\t\tfitness_objectives_comparator.add(final_combined_population.get(next_front));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ((fitness_objectives_comparator.size()) > 1) {\r\n\r\n\t\t\t\t\t\t\t\tint[] dominateMe = new int[fitness_objectives_comparator.size()];\r\n\r\n\t\t\t\t\t\t\t\t// front[i] contains the list of individuals belonging to the front i\r\n\t\t\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\t\t\t\t\tList<Integer>[] front = new List[(fitness_objectives_comparator.size() + 1)];\r\n\r\n\t\t\t\t\t\t\t\t// iDominate[k] contains the list of solutions dominated by k\r\n\r\n\t\t\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\t\t\t\t\tList<Integer>[] iDominate = new List[fitness_objectives_comparator.size()];\r\n\r\n\t\t\t\t\t\t\t\tint flagDominate;\r\n\r\n\t\t\t\t\t\t\t\tfor (int i = 0; i < ((front.length)); i++) {\r\n\t\t\t\t\t\t\t\t\tfront[i] = new LinkedList<Integer>();\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tfor (int p = 0; p < fitness_objectives_comparator.size(); p++) {\r\n\t\t\t\t\t\t\t\t\t// Initialize the list of individuals that i dominate and the number\r\n\t\t\t\t\t\t\t\t\t// of individuals that dominate me\r\n\t\t\t\t\t\t\t\t\tiDominate[p] = new LinkedList<Integer>();\r\n\t\t\t\t\t\t\t\t\tdominateMe[p] = 0;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// int secondary_size =0 ;\r\n\t\t\t\t\t\t\t\tint N = fitness_objectives_comparator.size();\r\n\t\t\t\t\t\t\t\t// int[][] dominanceChecks = new int[N][N];\r\n\r\n\t\t\t\t\t\t\t\tfor (int p = 0; p < (N - 1); p++) {\r\n\r\n\t\t\t\t\t\t\t\t\tList<Double> fitness_temporary_p = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\tfitness_temporary_p = updated_maps.get((fitness_objectives_comparator.get(p)));\r\n\r\n\t\t\t\t\t\t\t\t\t// secondary_size = fitness_temporary_p.size();\r\n\r\n\t\t\t\t\t\t\t\t\tfor (int q = p + 1; q < N; q++) {\r\n\t\t\t\t\t\t\t\t\t\t// if (p != q) {\r\n\t\t\t\t\t\t\t\t\t\tList<Double> fitness_temporary_q = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\t\tfitness_temporary_q = updated_maps\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get((fitness_objectives_comparator.get(q)));\r\n\r\n\t\t\t\t\t\t\t\t\t\tflagDominate = frontdominace_Comparison(fitness_temporary_p,\r\n\t\t\t\t\t\t\t\t\t\t\t\tfitness_temporary_q);\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (flagDominate == -1) {\r\n\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"p---dominates>>>>>\" );\r\n\t\t\t\t\t\t\t\t\t\t\tiDominate[p].add(q);\r\n\t\t\t\t\t\t\t\t\t\t\tdominateMe[q]++;\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\telse if (flagDominate == 1) {\r\n\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"q---dominates>>>>>\" );\r\n\t\t\t\t\t\t\t\t\t\t\tiDominate[q].add(p);\r\n\t\t\t\t\t\t\t\t\t\t\tdominateMe[p]++;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tList<Double> fitness_temporary_qq = new ArrayList<Double>();\r\n\t\t\t\t\t\t\t\t\t\t\tList<Double> fitness_temporary_pp = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tCollections.sort(fitness_temporary_p);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfitness_temporary_pp.addAll(fitness_temporary_p);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tCollections.sort(fitness_temporary_q);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfitness_temporary_qq.addAll(fitness_temporary_q);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif (fitness_temporary_pp.get(0) < fitness_temporary_qq.get(0)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"p---dominates>>>>>\" );\r\n\t\t\t\t\t\t\t\t\t\t\t\tiDominate[p].add(q);\r\n\t\t\t\t\t\t\t\t\t\t\t\tdominateMe[q]++;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\telse if (fitness_temporary_qq.get(0) < fitness_temporary_pp.get(0)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"q---dominates>>>>>\" );\r\n\t\t\t\t\t\t\t\t\t\t\t\tiDominate[q].add(p);\r\n\t\t\t\t\t\t\t\t\t\t\t\tdominateMe[p]++;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tfor (int p = 0; p < ((fitness_objectives_comparator.size())); p++) {\r\n\r\n\t\t\t\t\t\t\t\t\tif (dominateMe[p] == 0) {\r\n\t\t\t\t\t\t\t\t\t\tfront[0].add(p);\r\n\r\n\t\t\t\t\t\t\t\t\t\t// setrank.put(Integer.parseInt(fitness_objectives_comparator.get(p)), 1);\r\n\t\t\t\t\t\t\t\t\t\tint val = 0;\r\n\t\t\t\t\t\t\t\t\t\tsetrank1.put(fitness_objectives_comparator.get(p), val);\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n/*****************************************************************************************************************************************************************************************/\r\n\r\n\t\t\t\t\t\t\t\tint font_s = 0;\r\n\t\t\t\t\t\t\t\t// if((front[font_s].size() != 0)) {\r\n\r\n\t\t\t\t\t\t\t\tIterator<Integer> it1, it2; // Iterators\r\n\t\t\t\t\t\t\t\twhile (front[font_s].size() != 0) {\r\n\t\t\t\t\t\t\t\t\t/// System.out.println(\"we got here\" + front[font_s]);\r\n\t\t\t\t\t\t\t\t\tfont_s++;\r\n\t\t\t\t\t\t\t\t\tit1 = front[font_s - 1].iterator();\r\n\t\t\t\t\t\t\t\t\twhile (it1.hasNext()) {\r\n\t\t\t\t\t\t\t\t\t\tit2 = iDominate[(it1.next())].iterator();\r\n\t\t\t\t\t\t\t\t\t\twhile (it2.hasNext()) {\r\n\t\t\t\t\t\t\t\t\t\t\tint index = it2.next();\r\n\t\t\t\t\t\t\t\t\t\t\tdominateMe[index]--;\r\n\t\t\t\t\t\t\t\t\t\t\tif (dominateMe[index] == 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tfront[font_s].add(index);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"Block_1: \" +front[font_s]);\r\n\t\t\t\t\t\t\t\t\t\t\t\tsetrank1.put(fitness_objectives_comparator.get(index), font_s);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tLinkedHashMap<String, Double> setdistance = new LinkedHashMap<String, Double>();\r\n\r\n\t\t\t\t\t\t\t\tLinkedHashMap<String, Double> setdistance_one = new LinkedHashMap<String, Double>();\r\n\r\n\t\t\t\t\t\t\t\tMap<Integer, ArrayList<String>> reverseMap = new HashMap<>();\r\n\r\n\t\t\t\t\t\t\t\tfor (Map.Entry<String, Integer> entry : setrank1.entrySet()) {\r\n\t\t\t\t\t\t\t\t\tif (!reverseMap.containsKey(entry.getValue())) {\r\n\t\t\t\t\t\t\t\t\t\treverseMap.put(entry.getValue(), new ArrayList<>());\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tArrayList<String> keys = reverseMap.get(entry.getValue());\r\n\t\t\t\t\t\t\t\t\tkeys.add(entry.getKey());\r\n\t\t\t\t\t\t\t\t\treverseMap.put(entry.getValue(), keys);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// process fonts\r\n\r\n\t\t\t\t\t\t\t\tint smaller;\r\n\t\t\t\t\t\t\t\tint smaller_one;\r\n\t\t\t\t\t\t\t//\tint remaining;\r\n\t\t\t\t\t\t\t\t// int smaller_two;\r\n\r\n\t\t\t\t\t\t\t\tint fronts = 0;\r\n\t\t\t\t\t\t\t\t// System.out.println(\"map's size\" + reverseMap.size());\r\n\t\t\t\t\t\t\t\twhile (fronts < (reverseMap.size())) {\r\n\r\n\t\t\t\t\t\t\t\t\t// if (updated_population.size()== pop_num) {\r\n\t\t\t\t\t\t\t\t\t// break;\r\n\t\t\t\t\t\t\t\t\t// }\r\n\r\n\t\t\t\t\t\t\t\t\tif (fronts != (reverseMap.size() - 1)) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tList<String> front_list = new ArrayList<String>();\r\n\r\n\t\t\t\t\t\t\t\t\t\tfront_list = reverseMap.get(fronts);\r\n\r\n\t\t\t\t\t\t\t\t\t\tif ((front_list.size()) > 1) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tdouble[][] distance_matrix = new double[front_list.size()][front_list\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.size()];\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfor (int ind_d = 0; ind_d < (front_list.size()); ind_d++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tList<Double> front_getter1 = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tfront_getter1 = updated_maps.get((front_list.get(ind_d)));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor (int d = 0; d < front_list.size(); d++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!(front_list.get(ind_d).equals(front_list.get(d)))) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tList<Double> front_getter2 = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfront_getter2 = updated_maps.get((front_list.get(d)));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsmaller = get_count(front_getter1, front_getter2);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tint sma = smaller;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdistance_matrix[ind_d][d] = sma;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfor (int font_ = 0; font_ < front_list.size(); font_++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tdouble valz = 0.0;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tsetdistance.put(front_list.get(font_), valz);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// all distances set\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfor (int font_i = 0; font_i < (front_list.size()); font_i++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t// distance_matrix\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor (int font_j = 0; font_j < front_list.size(); font_j++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!(front_list.get(font_i).equals(front_list.get(font_j)))) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (setdistance.get(front_list\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.get(font_i)) < distance_matrix[font_i][font_j]) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdouble dist = (distance_matrix[font_i][font_j]);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetdistance.put(front_list.get(font_i), dist);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tMap<String, Double> result = setdistance.entrySet().stream()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.sorted(Map.Entry.comparingByValue())\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.collect(toMap(Map.Entry::getKey, Map.Entry::getValue,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(oldValue, newValue) -> oldValue, LinkedHashMap::new));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tIterator<Map.Entry<String, Double>> iteration = result.entrySet()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.iterator();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\twhile (iteration.hasNext()) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tMap.Entry<String, Double> entry = iteration.next();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (updated_population.size() < pop_num) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tupdated_population.add(entry.getKey());\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tresult.clear();\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tString best_1;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tbest_1 = front_list.get(0);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif (updated_population.size() < (pop_num)) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tupdated_population.add(best_1);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tif (fronts == (reverseMap.size() - 1)) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tList<String> front_list_one = new ArrayList<String>();\r\n\r\n\t\t\t\t\t\t\t\t\t\tfront_list_one = reverseMap.get(reverseMap.size() - 1);\r\n\r\n\t\t\t\t\t\t\t\t\t\t// System.out.println(\"hahahq\" +front_list_one);\r\n\r\n\t\t\t\t\t\t\t\t\t\tdouble[][] distance_matrix_one = new double[front_list_one\r\n\t\t\t\t\t\t\t\t\t\t\t\t.size()][front_list_one.size()];\r\n\r\n\t\t\t\t\t\t\t\t\t\tfor (int ind_w = 0; ind_w < (front_list_one.size()); ind_w++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tList<Double> front_getter_one = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfront_getter_one = updated_maps.get((front_list_one.get(ind_w)));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfor (int dw = 0; dw < front_list_one.size(); dw++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (!(front_list_one.get(ind_w).equals(front_list_one.get(dw)))) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tList<Double> front_getter_two = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tfront_getter_two = updated_maps.get((front_list_one.get(dw)));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmaller_one = get_count(front_getter_one, front_getter_two);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tint sm = smaller_one;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdistance_matrix_one[ind_w][dw] = sm;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tfor (int font_ = 0; font_ < front_list_one.size(); font_++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tdouble dit = 0.0;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tsetdistance_one.put(front_list_one.get(font_), dit);\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t// all distances set\r\n\r\n\t\t\t\t\t\t\t\t\t\tfor (int font_i = 0; font_i < (front_list_one.size()); font_i++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfor (int font_j = 0; font_j < front_list_one.size(); font_j++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (!(front_list_one.get(font_i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.equals(front_list_one.get(font_j)))) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (setdistance_one.get(front_list_one\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.get(font_i)) < distance_matrix_one[font_i][font_j]) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdouble dst = (distance_matrix_one[font_i][font_j]);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetdistance_one.put(front_list_one.get(font_i), dst);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\tint remaining_ = (pop_num - updated_population.size());\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (setdistance_one.size() <= remaining_) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tMap<String, Double> result = setdistance_one.entrySet().stream()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.sorted(Map.Entry.comparingByValue())\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.collect(toMap(Map.Entry::getKey, Map.Entry::getValue,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(oldValue, newValue) -> oldValue, LinkedHashMap::new));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tIterator<Map.Entry<String, Double>> iteration = result.entrySet()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.iterator();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\twhile (iteration.hasNext()) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tMap.Entry<String, Double> entry = iteration.next();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (updated_population.size() < pop_num) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tupdated_population.add(entry.getKey());\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t// System.out.println( \"remaining---\" +remaining);\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tMap<String, Double> sortedByValueDesc = setdistance_one.entrySet()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.stream()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.sorted(Map.Entry.<String, Double>comparingByValue().reversed())\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.collect(toMap(Map.Entry::getKey, Map.Entry::getValue,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(e1, e2) -> e1, LinkedHashMap::new));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tList<String> front_remove = new ArrayList<String>();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tSet<String> keytest = sortedByValueDesc.keySet();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tint final_size = sortedByValueDesc.size();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// while(sortedByValueDesc.size() > remaining) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfor (String keysss : keytest) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (final_size > remaining_) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tfront_remove.add(keysss);\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\tfinal_size--;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// System.out.println( \"sorted map after---\" +sortedByValueDesc.size());\r\n\t\t\t\t\t\t\t\t\t\t\tSet<String> keytests = sortedByValueDesc.keySet();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfor (String key_sss : keytests) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (updated_population.size() < pop_num) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!front_remove.contains(key_sss)) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdated_population.add(key_sss);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tsetdistance.clear();\r\n\t\t\t\t\t\t\t\t\tsetdistance_one.clear();\r\n\r\n\t\t\t\t\t\t\t\t\tfronts++;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t\tif (!fitness_objectives_comparator.isEmpty()) {\r\n\r\n\t\t\t\t\t\t\t\t\tif (updated_population.size() < pop_num) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tString get_item = (fitness_objectives_comparator.get(0));\r\n\r\n\t\t\t\t\t\t\t\t\t\tupdated_population.add(get_item);\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n}\r\n}\r\n}}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tcatch(IndexOutOfBoundsException e) {}\r\n\r\n\t\t\t\t\t\t\t//updated_population.clear();\r\n\t\t\t\t\t\t\tcombined_population.clear();\r\n\t\t\t\t\t\t\t//combined_population2.clear();\r\n\t\t\t\t\t\t\tsetrank1.clear();\r\n\t\t\t\t\t\t\t//setrank2.clear();\r\n\t\t\t\t\t\t\t//setrank3.clear();\r\n\t\t\t\t\t\t\tcombined_maps.clear();\r\n\t\t\t\t\t\t\t//child_maps.clear();\r\n\r\n\t\t\t\t\t\t\r\n Set<String> add_target = paths.keySet();\r\n\t \t\r\n\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t \tint true_count = 0;\r\n\t \t// get status of removal\r\n\t \tfor (String key_ss : add_target) { \r\n\t \t\r\n\t \t//pick path whose status is false\r\n\t \t\tif ( paths.get(key_ss) ){\r\n\t \t\t\t\r\n\t \t\t\t true_count++;\r\n\t \t\t}\r\n\t \t\t\r\n\t \t\telse {\r\n\t \t\t\t\r\n\t \t\t\tbreak;\r\n\t \t\t}\r\n\t \t \t \r\n\t \t} \r\n\t \t\r\n\t \tif ( true_count == paths.size() ) {\r\n\t \t\t\r\n\t \t\t//if all paths have true as replaced status\r\n\t \t\t\r\n\t \t\t//set them to false\r\n\t \t\t\r\n\t \t\t//pick subset of paths not previously removed at previous generation\r\n\t \t\r\n\t \t\tSet<String> add_new_entry = paths.keySet();\r\n\t \t \t\r\n\t \t \t//replaced_status_2.put(id + new String(str), false);\r\n\t \t \tint entry_count = 0;\r\n\t \t \t// get status of removal\r\n\t \t \tfor (String enrty_ss : add_new_entry ) { \r\n\t \t\t\r\n\t \t \t\t paths.put(enrty_ss , false);\r\n\t \t \t\t\r\n\t \t \t}\r\n\t \t \t\r\n\t \t \tif (paths.size() > 50) {\r\n\t \t \t\r\n\t \t \tint counter_add_paths = 0;\r\n\t \t \t\t\r\n Set<String> add_target_from_Path_1 = paths.keySet();\r\n\t\t \t\r\n\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t \t\r\n\t\t \t// get status of removal\r\n\t\t \t for (String from_Path_1: add_target_from_Path_1) {\r\n\t \t \t\r\n\t \t \t\r\n\t \t \t\r\n\t \t\t if (still_remaining_targets.contains(from_Path_1) ) {\r\n\t \t \t\t\r\n\t \t \t\t continue;\r\n\t \t \t }\r\n\t \t\t\r\n\t \t\t else {\r\n\t \t\t\t \r\n\t \t\t\t \r\n\t \t\t\t if (counter_add_paths < 50) {\r\n\t \t\t\t\r\n\t \t\t\t if ( !temporary_path_holder.contains(from_Path_1) ){\r\n\t \t \t \t\t\r\n\t \t\t\t\t target_subset.put(from_Path_1 + \" \" + \"new\", false);\r\n\t\t \t \t\t\t\r\n\t \t\t\t\t counter_add_paths++;\r\n\t \t\t\t\t \r\n\t \t\t\t\t// retrieve test case from archive\r\n\t\t \t \t\t\t//updatePopulation(from_Path_1)..//return test case not previously added to temporary population\r\n\t \t\t\t\t \r\n\t\t \t \t\t}\r\n\t \t\t\t\r\n\t \t\t\t }\r\n\t \t\t\r\n\t \t\t\t\r\n\t \t\t\t\r\n\t \t\t }\r\n\t \t\t \r\n\t\t \t \r\n\t\t \t }\r\n\t \t \t}\r\n\t\t \t \r\n\t\t \t else {\r\n\t\t \t \t \r\n\t\t \t \t \r\n\t\t \t \tSet<String> add_target_from_Path_7 = paths.keySet();\r\n\t\t\t \t\r\n\t\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t\t \t\r\n\t\t\t \t// get status of removal\r\n\t\t\t \t for (String from_Path_7: add_target_from_Path_7) { // contains(Object)\r\n\t\t\t \t\r\n\t\t\t \t //get current path set..the paths already in subset should not be picked again....\r\n\t\t\t \t\t\r\n\t\t\t \t \t//\ttarget_subset.put(key + \" \" + \"new\", false);\t\r\n\t\t\t \t \t\r\n\t\t\t if (still_remaining_targets.contains(from_Path_7) ) {\r\n\t\t\t\t\t \t \t\t\r\n\t\t\t\t\t \t \t\tcontinue;\r\n\t\t\t\t\t \t \t}\r\n\t\t\t else { \r\n\t \t \t\tif ( !temporary_path_holder.contains(from_Path_7) ){\r\n\t \t \t\t\t\r\n\t \t \t\t\ttarget_subset.put(from_Path_7 + \" \" + \"new\", false);\r\n\t \t \t\t\t\r\n\t \t \t\t\t// retrieve test case from archive\r\n\t \t \t\t// retrieve test case from archive\r\n\t \t \t\t\t//updatePopulation(from_Path_7)..//return test case not previously added to temporary population\r\n\t \t \t\t}}\r\n\t\t \t \t \r\n\t\t\t \t }\t \r\n\t\t \t \t \r\n\t\t \t \t \r\n\t\t \t }\r\n\t }\r\n\t \t\t\r\n\t \telse {\r\n\t \t\t\r\n\t \t\t// pick paths with false status and add them to subset of targets\r\n\t \t\t\r\n\t \t\tint path_to_add_counter = 0;\r\n\t \t\t\r\n\t \tif (paths.size() > 50) {\r\n\t \t\tSet<String> add_target_from_Path = paths.keySet();\r\n\t\t \t\r\n\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t \t\r\n\t\t \t// get status of removal\r\n\t\t \t for (String from_Path: add_target_from_Path) { // contains(Object)\r\n\t\t \t\r\n\t\t \t //get current path set..the paths already in subset should not be picked again....\r\n\t\t \t\t\r\n\t\t \t \t//\ttarget_subset.put(key + \" \" + \"new\", false);\t\r\n\t\t \t \t\r\n\t\t \t \t\tif (still_remaining_targets.contains(from_Path) ) {\r\n\t\t\t\t \t \t\t\r\n\t\t\t\t \t \t\tcontinue;\r\n\t\t\t\t \t \t}\r\n\t\t \t \t\t\telse {\t\r\n\t\t \t \t\t\r\n\t\t \t \t\t if (path_to_add_counter < 50) {\r\n\t\t \t \t\t \r\n\t\t \t \t if ( !paths.get(from_Path) && (!temporary_path_holder.contains(from_Path) ) ){\r\n\t\t \t \t\t\r\n\t\t \t \t\t target_subset.put(from_Path + \" \" + \"new\", false);\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\tpath_to_add_counter++;\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t// retrieve test case from archive\r\n\t\t \t \t\t// retrieve test case from archive\r\n\t\t \t \t\t\t//updatePopulation(from_Path)..//return test case not previously added to temporary population\r\n\t\t \t \t\t }\r\n\t\t \t \t\t \r\n\t\t \t \t\t \r\n\t\t \t \t\t}\r\n\t\t \t \t\t\t}\r\n\t\t \t \t}\r\n\t \t}\r\n\t \t\r\n\t \t\r\n\t\t \t else {\r\n\t\t \t \t\t \r\n\t\t \t \t\tSet<String> add_target_from_Path_4 = paths.keySet();\r\n\t\t\t\t \t\r\n\t\t\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t\t\t \t\r\n\t\t\t\t \t// get status of removal\r\n\t\t\t\t \t for (String from_Path_4: add_target_from_Path_4) { // contains(Object)\r\n\t\t\t\t \t\r\n\t\t\t\t \t //get current path set..the paths already in subset should not be picked again....\r\n\t\t\t\t \t\t\r\n\t\t\t\t \t \t//\ttarget_subset.put(key + \" \" + \"new\", false);\t\r\n\t\t\t\t \t \t\r\n\t\t\t\t \r\n\t\t\t\t \t \t\t\tif (still_remaining_targets.contains(from_Path_4) ) {\r\n\t\t\t\t\t\t \t \t\t\r\n\t\t\t\t\t\t \t \t\tcontinue;\r\n\t\t\t\t\t\t \t \t}\r\n\t\t \t \t\t \r\n\t\t\t\t \t \t\t\telse {\r\n\t\t \t \t\t\t\r\n\t\t \t \t\tif ( !paths.get(from_Path_4) && (!temporary_path_holder.contains(from_Path_4) ) ){\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\ttarget_subset.put(from_Path_4 + \" \" + \"new\", false);\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t// retrieve test case from archive\r\n\t\t \t \t\t\t//updatePopulation(from_Path_4)..//return test case not previously added to temporary population\r\n\t\t \t \t\t}}\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t\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 \t\r\n\t \tparents_population_copy.clear();\r\n\t \t\r\n\t \tfor (int i = 0; i < 50 ; i++) // updated population \r\n\t \t\t\t{\r\n\r\n\t \t\t\t\t//for (int j = 0; j < R; j++) {\r\n\t \t\t\t\t\r\n\t \t\t\t\t//\tx[i][j] = (int)(Math.random()*((ub[j] - lb[j])+1))+ lb[j];\r\n\r\n\t \t\t\t\t//update set x\r\n\t \t\t\t\tparents_population_copy.add(\"parent\" + \" \" + i);\r\n\t \t\r\n\t \t\r\n\t \t\r\n\t \t\r\n\t\t\t\t}\r\n\t \t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse { //proceed to add paths if subset of target objectives is empty\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n Set<String> add_target = paths.keySet();\r\n\t \t\r\n\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t \tint true_count = 0;\r\n\t \t// get status of removal\r\n\t \tfor (String key_ss : add_target) { \r\n\t \t\r\n\t \t//pick path whose status is false\r\n\t \t\tif ( paths.get(key_ss) ){\r\n\t \t\t\t\r\n\t \t\t\t true_count++;\r\n\t \t\t}\r\n\t \t\t\r\n\t \t\telse {\r\n\t \t\t\t\r\n\t \t\t\tbreak;\r\n\t \t\t}\r\n\t \t \t \r\n\t \t} \r\n\t \t\r\n\t \tif ( true_count == paths.size() ) {\r\n\t \t\t\r\n\t \t\t//if all paths have true as replaced status\r\n\t \t\t\r\n\t \t\t//set them to false\r\n\t \t\t\r\n\t \t\t//pick subset of paths not previously removed at previous generation\r\n\t \t\r\n\t \t\tSet<String> add_new_entry = paths.keySet();\r\n\t \t \t\r\n\t \t \t//replaced_status_2.put(id + new String(str), false);\r\n\t \t \tint entry_count = 0;\r\n\t \t \t// get status of removal\r\n\t \t \tfor (String enrty_ss : add_new_entry ) { \r\n\t \t\t\r\n\t \t \t\t paths.put(enrty_ss , false);\r\n\t \t \t\t\r\n\t \t \t}\r\n\t \t \t\r\n\t \t \tif (paths.size() > 50) {\r\n\t \t \t\r\n\t \t \tint counter_add_paths = 0;\r\n\t \t \t\t\r\n Set<String> add_target_from_Path_1 = paths.keySet();\r\n\t\t \t\r\n\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t \t\r\n\t\t \t// get status of removal\r\n\t\t \t for (String from_Path_1: add_target_from_Path_1) {\r\n\t \t \t\r\n\t \t \t\r\n\t \t \t\r\n\t \t\t if (still_remaining_targets.contains(from_Path_1) ) {\r\n\t \t \t\t\r\n\t \t \t\t continue;\r\n\t \t \t }\r\n\t \t\t\r\n\t \t\t else {\r\n\t \t\t\t \r\n\t \t\t\t \r\n\t \t\t\t if (counter_add_paths < 50) {\r\n\t \t\t\t\r\n\t \t\t\t if ( !temporary_path_holder.contains(from_Path_1) ){\r\n\t \t \t \t\t\r\n\t \t\t\t\t target_subset.put(from_Path_1 + \" \" + \"new\", false);\r\n\t\t \t \t\t\t\r\n\t \t\t\t\t counter_add_paths++;\r\n\t \t\t\t\t \r\n\t \t\t\t\t// retrieve test case from archive\r\n\t\t \t \t\t\t//updatePopulation(from_Path_1)..//return test case not previously added to temporary population\r\n\t \t\t\t\t \r\n\t\t \t \t\t}\r\n\t \t\t\t\r\n\t \t\t\t }\r\n\t \t\t\r\n\t \t\t\t\r\n\t \t\t\t\r\n\t \t\t }\r\n\t \t\t \r\n\t\t \t \r\n\t\t \t }\r\n\t \t \t}\r\n\t\t \t \r\n\t\t \t else {\r\n\t\t \t \t \r\n\t\t \t \t \r\n\t\t \t \tSet<String> add_target_from_Path_7 = paths.keySet();\r\n\t\t\t \t\r\n\t\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t\t \t\r\n\t\t\t \t// get status of removal\r\n\t\t\t \t for (String from_Path_7: add_target_from_Path_7) { // contains(Object)\r\n\t\t\t \t\r\n\t\t\t \t //get current path set..the paths already in subset should not be picked again....\r\n\t\t\t \t\t\r\n\t\t\t \t \t//\ttarget_subset.put(key + \" \" + \"new\", false);\t\r\n\t\t\t \t \t\r\n\t\t\t if (still_remaining_targets.contains(from_Path_7) ) {\r\n\t\t\t\t\t \t \t\t\r\n\t\t\t\t\t \t \t\tcontinue;\r\n\t\t\t\t\t \t \t}\r\n\t\t\t else { \r\n\t \t \t\tif ( !temporary_path_holder.contains(from_Path_7) ){\r\n\t \t \t\t\t\r\n\t \t \t\t\ttarget_subset.put(from_Path_7 + \" \" + \"new\", false);\r\n\t \t \t\t\t\r\n\t \t \t\t\t// retrieve test case from archive\r\n\t \t \t\t// retrieve test case from archive\r\n\t \t \t\t\t//updatePopulation(from_Path_7)..//return test case not previously added to temporary population\r\n\t \t \t\t}}\r\n\t\t \t \t \r\n\t\t\t \t }\t \r\n\t\t \t \t \r\n\t\t \t \t \r\n\t\t \t }\r\n\t }\r\n\t \t\t\r\n\t \telse {\r\n\t \t\t\r\n\t \t\t// pick paths with false status and add them to subset of targets\r\n\t \t\t\r\n\t \t\tint path_to_add_counter = 0;\r\n\t \t\t\r\n\t \tif (paths.size() > 50) {\r\n\t \t\tSet<String> add_target_from_Path = paths.keySet();\r\n\t\t \t\r\n\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t \t\r\n\t\t \t// get status of removal\r\n\t\t \t for (String from_Path: add_target_from_Path) { // contains(Object)\r\n\t\t \t\r\n\t\t \t //get current path set..the paths already in subset should not be picked again....\r\n\t\t \t\t\r\n\t\t \t \t//\ttarget_subset.put(key + \" \" + \"new\", false);\t\r\n\t\t \t \t\r\n\t\t \t \t\tif (still_remaining_targets.contains(from_Path) ) {\r\n\t\t\t\t \t \t\t\r\n\t\t\t\t \t \t\tcontinue;\r\n\t\t\t\t \t \t}\r\n\t\t \t \t\t\telse {\t\r\n\t\t \t \t\t\r\n\t\t \t \t\t if (path_to_add_counter < 50) {\r\n\t\t \t \t\t \r\n\t\t \t \t if ( !paths.get(from_Path) && (!temporary_path_holder.contains(from_Path) ) ){\r\n\t\t \t \t\t\r\n\t\t \t \t\t target_subset.put(from_Path + \" \" + \"new\", false);\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\tpath_to_add_counter++;\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t// retrieve test case from archive\r\n\t\t \t \t\t// retrieve test case from archive\r\n\t\t \t \t\t\t//updatePopulation(from_Path)..//return test case not previously added to temporary population\r\n\t\t \t \t\t }\r\n\t\t \t \t\t \r\n\t\t \t \t\t \r\n\t\t \t \t\t}\r\n\t\t \t \t\t\t}\r\n\t\t \t \t}\r\n\t \t}\r\n\t \t\r\n\t \t\r\n\t\t \t else {\r\n\t\t \t \t\t \r\n\t\t \t \t\tSet<String> add_target_from_Path_4 = paths.keySet();\r\n\t\t\t\t \t\r\n\t\t\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t\t\t \t\r\n\t\t\t\t \t// get status of removal\r\n\t\t\t\t \t for (String from_Path_4: add_target_from_Path_4) { // contains(Object)\r\n\t\t\t\t \t\r\n\t\t\t\t \t //get current path set..the paths already in subset should not be picked again....\r\n\t\t\t\t \t\t\r\n\t\t\t\t \t \t//\ttarget_subset.put(key + \" \" + \"new\", false);\t\r\n\t\t\t\t \t \t\r\n\t\t\t\t \r\n\t\t\t\t \t \t\t\tif (still_remaining_targets.contains(from_Path_4) ) {\r\n\t\t\t\t\t\t \t \t\t\r\n\t\t\t\t\t\t \t \t\tcontinue;\r\n\t\t\t\t\t\t \t \t}\r\n\t\t \t \t\t \r\n\t\t\t\t \t \t\t\telse {\r\n\t\t \t \t\t\t\r\n\t\t \t \t\tif ( !paths.get(from_Path_4) && (!temporary_path_holder.contains(from_Path_4) ) ){\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\ttarget_subset.put(from_Path_4 + \" \" + \"new\", false);\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t// retrieve test case from archive\r\n\t\t \t \t\t\t//updatePopulation(from_Path_4)..//return test case not previously added to temporary population\r\n\t\t \t \t\t}}\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t\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\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t \t\r\n\t \t\r\n\t\t\t\tString updated_id;\r\n\r\n\t\t\t\tint updated_val;\r\n\r\n\t\t\t\t// int rem;\r\n\r\n\t\t\t\tfor (int pop = 0; pop < updated_population.size(); pop++) {\r\n\r\n\t\t\t\t\tif (pop == 50) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tString[] updated_pop = (updated_population.get(pop).split(\" \"));\r\n\t\t\t\t\tupdated_id = updated_pop[0];\r\n\t\t\t\t\tupdated_val = Integer.parseInt(updated_pop[1]);\r\n\r\n\t\t\t\t\tif (updated_id.equals(\"parent\")) {\r\n\t\t\t\t\t\tfor (int update_parent = 0; update_parent < R; update_parent++) {\r\n\t\t\t\t\t\t\t// x[i][j] = v[i][j] ;\r\n\r\n\t\t\t\t\t\t\tx[pop][update_parent] = x[updated_val][update_parent];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (updated_id.equals(\"child\")) {\r\n\t\t\t\t\t\tfor (int update_child = 0; update_child < R; update_child++) {\r\n\t\t\t\t\t\t\t// x[i][j] = v[i][j] ;\r\n\r\n\t\t\t\t\t\t\tx[pop][update_child] = v[updated_val][update_child];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t \t\r\n\t \t\r\n\t\t\t\t} \t\r\n\t // \tremoved_at_previous_iteration.clear();\r\n\t\t\t\t//}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t//\tfor (Map.Entry<String, ArrayList<String>> entry : names.entrySet()) {\r\n\t\t\t\t//\tString key = entry.getKey();\r\n\t\t\t\t//\tArrayList<String> value = entry.getValue();\r\n\t\t\t\t//\t}\r\n\r\n\t\t\t\r\n\t\t//\tSystem.out.println(\"NO. of cycles=\" + (Cycle[run] - 1)); // ���Number of Cycle\r\n\t\t\tcoverage[run] = obj_total * 100 / PATHNUM_NUMBER ; // percentage of paths covered per run\r\n\t\t\tSystem.out.println(\"Path coverage=\" + coverage[run] + \"%\");\r\n\t\t\tSystem.out.println(\"The optimal solution is\");\r\n\t\t\tSystem.out.println(\"template 1(bbbb): \");\r\n\t\t\t/*for (int a = 0; a < PATHNUM; a++) // Output the result\r\n\t\t {\r\n\t\t\t\tif (statu[a]) {\r\n\t\t\t\t\tSystem.out.print(\"path\" + a + \":\");\r\n\t\t\t\t\tfor (int j = 0; j < R; j++)\r\n\t\t\t\t\t\tSystem.out.print(solution[a][j] + \" \");\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t} else\r\n\t\t\t\t\tSystem.out.println(\"path\" + a + \"Not covered.\");\r\n\t\t\t}*/\r\n\r\n\t\t\t \r\n\r\n\t\t} \r\n\r\n\t\tdouble time_sum = 0, time_average;\r\n\t\tfloat coverage_sum = 0, coverage_average, cycle_sum = 0, cycle_average, case_average;\r\n\t\tint case_sum = 0;\r\n\t\tfor (int run = 0; run < RUN; run++) {\r\n\t\t\ttime_sum = time_sum + runtime[run];\r\n\t\t//\tcycle_sum = cycle_sum + (Cycle[run] - 1);\r\n\t\t//\tcase_sum = case_sum + total_case_num[run];\r\n\t\t\tcoverage_sum = coverage_sum + coverage[run];\r\n\t\t }\r\n\t\t\r\n\t\ttime_average = time_sum / RUN;\r\n\t\tcycle_average = cycle_sum / RUN;\r\n\t\tcase_average = case_sum / RUN;\r\n\t\tcoverage_average = coverage_sum / RUN;\r\n\r\n\t\tSystem.out.println(\"time_sum = \" + time_sum + \"ms\");\r\n\t\tSystem.out.println(\"time_average = \" + time_average + \"ms\");\r\n\t\tSystem.out.println(\"cycle_sum = \" + cycle_sum);\r\n\t\tSystem.out.println(\"cycle_average = \" + cycle_average);\r\n\t\tSystem.out.println(\"case_sum = \" + case_sum);\r\n\t\tSystem.out.println(\"case_average = \" + case_average);\r\n\t\tSystem.out.println(\"coverage_sum = \" + coverage_sum + \"%\");\r\n\t\tSystem.out.println(\"coverage_average = \" + coverage_average + \"%\");\r\n\r\n\t\r\n\t\t\r\n\t\t//test case number statistics\r\n\t\ttry \r\n\t\t{ \r\n//\t\t\tWritableWorkbook wbook= \r\n//\t\t\tWorkbook.createWorkbook(new File(\"E:/result0106.xls\")); \r\n//\t\t\t//生成名为“Ramdom”的工作表,参数0表示这是第一页 \r\n//\t\t\tWritableSheet sheet=wbook.createSheet(\"DE1\",0); \r\n\t\t\t\r\n\t\t\tFile file = new java.io.File(\"C:/Users/scybe/eclipse-workspace/TestData/Test_whole.xls\"); \r\n\t\t\tWorkbook book = Workbook.getWorkbook(file); \r\n\t\t\tWritableWorkbook wbook = Workbook.createWorkbook(file, book); \r\n \t WritableSheet sheet = wbook.getSheet(0); // 写入数据 sheet \r\n\t\t\t\r\n\t\t\tfor(int run=0 ; run<RUN; run++)\r\n\t\t\t{\r\n\t\t\t\tint q = run;\r\n\t\t\t\tjxl.write.Number number = new jxl.write.Number(col, q,total_case_num[run]); \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tsheet.addCell(number); \r\n\t\t\t\tSystem.out.println(total_case_num[run]);\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//total_case_num[run]\r\n\t\t\t\r\n\t\t \tdouble case_ave = getAverage(total_case_num , RUN);\r\n\t\t\tjxl.write.Number number1 = new jxl.write.Number(col, 25 ,case_ave); \r\n\t\t\tsheet.addCell(number1);\r\n\t\t\t\r\n\t\t\t \t\t\r\n\t\t\twbook.write(); \t\r\n\t\t\twbook.close();\r\n\t\t\t \r\n\t\t}catch(Exception e) \r\n\t\t{ \r\n\t\tSystem.out.println(e); \r\n\t\t} \r\n\t\t\t\t\t\t\r\n\t\t\r\n\t\t//coverage statistics \r\n\t\t\r\n\t\t//test case number statistics\r\n\t\t\t\t\r\n\t\t\r\n\t\t\r\n\t\ttry \r\n\t\t\t{ \r\n//\t\t\t\t\t\r\n\t\t\t\t\tFile file = new java.io.File(\"C:/Users/scybe/eclipse-workspace/TestData/Coverage_whole.xls\"); \r\n\t\t\t\t\tWorkbook book = Workbook.getWorkbook(file); \r\n\t\t\t\t\tWritableWorkbook wbook = Workbook.createWorkbook(file, book); \r\n\t\t \t WritableSheet sheet = wbook.getSheet(0); // 写入数据 sheet \r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(int run=0 ; run<RUN; run++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint q=run;\r\n\t\t\t\t\t\tjxl.write.Number number = new jxl.write.Number(col, q,coverage[run]); \r\n\t\t\t\t\t\tsheet.addCell(number); \r\n\t\t\t\t\t\t\r\n \r\n\t\t\t\t\t\t//写入数据并关闭文件 \t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//total_case_num[run]\r\n\t\t\t\t\t\r\n\t\t\t\t\tdouble case_ave = getAverages(coverage , RUN);\r\n\t\t\t\t\tjxl.write.Number number1 = new jxl.write.Number(col,25,case_ave); \r\n\t\t\t\t\tsheet.addCell(number1);\r\n\t\t\t\t\t\r\n\t\t\t\t\twbook.write(); \t\r\n\t\t\t\t\twbook.close();\r\n\t\t\t\t\t \r\n\t\t\t\t}catch(Exception e) \r\n\t\t\t\t{ \r\n\t\t\t\tSystem.out.println(e); \r\n\t\t\t\t} \r\n\t\t\t\t\r\n\t\t\r\n\r\n\t}", "public void calculateDifferences() {\n\t\t\tMap<Integer, Integer> shifts = new HashMap<Integer, Integer>();\n\t\t\tfor (int voiceDetected : vDitected) {\n\t\t\t\tfor (int oldValue : occurences) {\n\t\t\t\t\tint shift = voiceDetected - oldValue;\n\t\t\t\t\tif (shifts.containsKey(shift)) {\n\t\t\t\t\t\tshifts.put(shift, shifts.get(shift) + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tshifts.put(shift, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!shifts.isEmpty()) {\n\t\t\t\tpossibleShift = getMaxValuedKey(shifts);\n\t\t\t\tvaluesSet = true;\n\t\t\t}\n\t\t}", "public static void main(String[] args) throws IOException\n {\n int numFiles = 13;\n for(int curFileIndex = 0; curFileIndex < numFiles; curFileIndex++)\n {\n String inputOutputNumber = \"\"+curFileIndex;\n if(inputOutputNumber.length()==1)\n inputOutputNumber = \"0\" + inputOutputNumber;\n long startTime = System.nanoTime();\n String fileName = \"Coconut-tree\".toLowerCase() + \"-testcases\";\n String pathToHackerrankTestingFolder = \"/Users/spencersharp/Desktop/HackerrankTesting/\";\n BufferedReader f = new BufferedReader(new FileReader(pathToHackerrankTestingFolder + fileName + \"/input/input\"+inputOutputNumber+\".txt\"));\n PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(pathToHackerrankTestingFolder + fileName + \"/testOutput/testOutput\"+inputOutputNumber+\".txt\")));\n //Comment the end comment after this line\n \n /*\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter writer = new PrintWriter(new BufferedOutputStream(System.out));\n */\n String output = \"\"; //Write all output to this string\n\n //Code here\n String line = f.readLine();\n StringTokenizer st = new StringTokenizer(line);\n \n int n = Integer.parseInt(st.nextToken());\n int v = Integer.parseInt(st.nextToken());\n int t = Integer.parseInt(st.nextToken())-1;\n \n //TreeSet<Double> vals = new TreeSet<Double>();\n \n double minEV = 0.0;\n \n int numPickedSoFar = 0;\n \n double total = 0.0;\n \n for(int i = 0; i < n; i++)\n {\n st = new StringTokenizer(f.readLine());\n \n int p = Integer.parseInt(st.nextToken());\n int c = Integer.parseInt(st.nextToken());\n int fallChance = Integer.parseInt(st.nextToken());\n \n double ev = ((c*v)*(((100-fallChance))/100.0))-(p*(fallChance/100.0));\n \n if(ev > 0.0)\n {\n if(numPickedSoFar < t)\n {\n if(ev < minEV || minEV == 0.0)\n minEV = ev;\n total += ev;\n numPickedSoFar++;\n }\n else if(ev > minEV)\n {\n //out.println(\"ELSE\"+minEV);\n total -= minEV;\n minEV = ev;\n total += ev;\n }\n }\n //out.println(total);\n }\n \n writer.println(total);\n \n writer.close();\n //Code here\n \n //Use open comment before this line\n long endTime = System.nanoTime();\n\n long totalTime = endTime - startTime;\n\n double totalTimeInSeconds = ((double)totalTime)/1000000000;\n\n if(totalTimeInSeconds >= 4.0)\n out.println(\"TIME LIMIT EXCEEDED\");\n else\n {\n boolean isTestOutputCorrect = true;\n BufferedReader correctOutputReader = new BufferedReader(new FileReader(pathToHackerrankTestingFolder + fileName + \"/output/output\"+inputOutputNumber+\".txt\"));\n BufferedReader testOutputReader = new BufferedReader(new FileReader(pathToHackerrankTestingFolder + fileName + \"/testOutput/testOutput\"+inputOutputNumber+\".txt\"));\n String correctOutputLine;\n String testOutputLine;\n\n while((correctOutputLine=correctOutputReader.readLine())!=null && (testOutputLine=testOutputReader.readLine())!=null)\n {\n Double d1 = Double.parseDouble(correctOutputLine);\n Double d2 = Double.parseDouble(correctOutputLine);\n if(Math.abs(d1-d2) > 0.0001)\n {\n isTestOutputCorrect = false;\n break;\n }\n }\n\n if(isTestOutputCorrect)\n out.println(\"TEST \" + inputOutputNumber + \" CORRECT - TIME: \" + totalTimeInSeconds);\n else\n out.println(\"TEST \" + inputOutputNumber + \" INCORRECT - TIME: \" + totalTimeInSeconds);\n }\n }\n //Use close comment after this line\n \n }", "public static void main(String[] args) throws IOException {\n\t\tbr = new BufferedReader(new FileReader(new File(\"input.txt\")));\r\n\t\tSystem.setOut(new PrintStream(new File(\"output.txt\")));\r\n\t\tint T = readInt();\r\n\t\t\r\n\t\tfor (int ind = 1; ind<=T; ind++) {\r\n\t\t\tSystem.out.print(\"Case #\" + ind + \": \");\r\n\t\t\t\r\n\t\t\tint N = readInt();\r\n\t\t\tint[] ar = readIntArr();\r\n\t\t\tfor (int i = 0; i < N; i++)ar[i]--;\r\n\t\t\tboolean used[] = new boolean[N];\r\n\t\t\tint ans = 0;\r\n\t\t\tint pairMax = 0;\r\n\t\t\tint cycleMax = 0;\r\n\t\t\tint cyclePair = 0;\r\n\t\t\tint pair = 0;\r\n\t\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\t\tif (!used[i]) {\r\n\t\t\t\t\tList<Integer> list = new LinkedList<Integer>();\r\n\t\t\t\t\tlist.add(i);\r\n\t\t\t\t\tused[i] = true;\r\n\t\t\t\t\tint j = ar[i];\r\n\t\t\t\t\twhile(!list.contains(j) && !used[j]) {\r\n\t\t\t\t\t\tlist.add(j);\r\n\t\t\t\t\t\tused[j] = true;\r\n\t\t\t\t\t\tj = ar[j];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!list.contains(j))continue;\r\n\t\t\t\t\tif (list.size() == 2)pair++;\r\n\t\t\t\t\tboolean removed = false;\r\n\t\t\t\t\twhile(list.get(0) != j){list.remove(0);removed = true;}\r\n\t\t\t\t\tif (list.size() > 2 && list.size() > cycleMax) cycleMax = list.size();\r\n\t\t\t\t\tif (list.size() == 2) {\r\n\t\t\t\t\t\tint a = list.remove(0);\r\n\t\t\t\t\t\tint b = list.remove(0);\r\n\t\t\t\t\t\tint tmp = 2;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tboolean us[] = new boolean[N];\r\n\t\t\t\t\t\t\tus[a] = true;\r\n\t\t\t\t\t\t\tus[b] = true;\r\n\t\t\t\t\t\t\t//System.out.println(\" test \" + a + b);\r\n\t\t\t\t\t\t\tSet<Integer> set = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(a);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\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\tset = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(b);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//if (removed) {\r\n\t\t\t\t\t\t//\tif (tmp > cyclePair)cyclePair = tmp;\r\n\t\t\t\t\t\t//} else {\r\n\t\t\t\t\t\t pairMax += tmp;\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//cyclePair += 2 * pair;\r\n\t\t\t//if (pair > 1) pairMax += 2 * (pair - 1);\r\n\t\t\tans = Math.max(cyclePair, pairMax);\r\n\t\t\tans = Math.max(cycleMax, ans);\r\n\t\t\tSystem.out.println(ans);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "@Test\n public void test_kmin_Integer_Collection1() {\n populate_i1();\n int actual = Selector.kmin(i1, 1, new CompareIntegerAscending());\n int expected = 2;\n Assert.assertEquals(\"1st minimum not found\", expected, actual);\n }", "public static void testIteratorEqualsOtherMethods(RatingsDataset<Rating> ratingsDataset) {\n\n int errors = 0;\n try {\n\n Map<Integer, Integer> numRatingsUsers_byIterator = new TreeMap<Integer, Integer>();\n Map<Integer, Integer> numRatingsItems_byIterator = new TreeMap<Integer, Integer>();\n\n for (Rating r : ratingsDataset) {\n int idUser = r.getIdUser();\n int idItem = r.getIdItem();\n\n ratingsDataset.getRating(idUser, idItem);\n\n if (numRatingsUsers_byIterator.containsKey(idUser)) {\n numRatingsUsers_byIterator.put(idUser, numRatingsUsers_byIterator.get(idUser) + 1);\n } else {\n numRatingsUsers_byIterator.put(idUser, 1);\n }\n\n if (numRatingsItems_byIterator.containsKey(idItem)) {\n numRatingsItems_byIterator.put(idItem, numRatingsItems_byIterator.get(idItem) + 1);\n } else {\n numRatingsItems_byIterator.put(idItem, 1);\n }\n\n }\n\n for (int idUser : ratingsDataset.allUsers()) {\n int numRatingsUser_byGetRatings = ratingsDataset.getUserRatingsRated(idUser).size();\n int numRatingsUser_ByIterator = numRatingsUsers_byIterator.get(idUser);\n\n if (numRatingsUser_byGetRatings != numRatingsUser_ByIterator) {\n Global.showWarning(\"El usuario \" + idUser + \" tiene:\\n\"\n + \"\\t\" + numRatingsUser_byGetRatings + \" valoraciones según el método getUserRatingsRated(idUser) \\n\"\n + \"\\t\" + numRatingsUser_ByIterator + \" valoraciones según el iterador\");\n errors++;\n }\n }\n\n final Set<Integer> allRatedItems = new TreeSet<Integer>(ratingsDataset.allRatedItems());\n\n for (int idItem : allRatedItems) {\n\n int numRatingsItem_byGetRatings = ratingsDataset.getItemRatingsRated(idItem).size();\n int numRatingsItem_ByIterator = numRatingsItems_byIterator.get(idItem);\n\n if (numRatingsItem_byGetRatings != numRatingsItem_ByIterator) {\n Global.showWarning(\"El producto \" + idItem + \" tiene:\\n\"\n + \"\\t\" + numRatingsItem_byGetRatings + \" valoraciones según el método getItemRatingsRated(idItem) \\n\"\n + \"\\t\" + numRatingsItem_ByIterator + \" valoraciones según el iterador\");\n errors++;\n }\n }\n\n if (numRatingsItems_byIterator.keySet().equals(allRatedItems)) {\n } else {\n errors++;\n Global.showWarning(\"El conjunto de items valorados es distinto.\");\n\n Set<Integer> AMinusB = new TreeSet<Integer>(numRatingsItems_byIterator.keySet());\n AMinusB.removeAll(allRatedItems);\n\n Set<Integer> BMinusA = new TreeSet<Integer>(allRatedItems);\n BMinusA.removeAll(numRatingsItems_byIterator.keySet());\n\n if (!AMinusB.isEmpty()) {\n Global.showWarning(\"Produtos que no están en el allItemsRated --> \" + AMinusB.toString());\n }\n if (!BMinusA.isEmpty()) {\n Global.showWarning(\"Produtos que no están según el iterador --> \" + BMinusA.toString());\n }\n }\n\n if (numRatingsUsers_byIterator.keySet().equals(ratingsDataset.allUsers())) {\n } else {\n errors++;\n Global.showWarning(\"El conjunto de usuarios es distinto.\");\n }\n\n } catch (UserNotFound ex) {\n ERROR_CODES.USER_NOT_FOUND.exit(ex);\n } catch (ItemNotFound ex) {\n ERROR_CODES.ITEM_NOT_FOUND.exit(ex);\n }\n if (errors == 0) {\n Global.showWarning(\"Finished the dataset test.\");\n } else {\n Global.showWarning(\"Finished the dataset test with \" + errors + \" errors.\");\n }\n }", "private double validate(int k) {\n\t\tArrayList<Product> allData = trainData;\n\t\tshuffle(allData);\n\t\tArrayList<Double> accurs = new ArrayList<Double>();\n\t\tif (k < 1 || k > allData.size()) return -1;\n\t\tint foldLength = allData.size() / k;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tArrayList<Product> fold = new ArrayList<Product>();\n\t\t\tArrayList<Product> rest = new ArrayList<Product>();\n\t\t\tfold.addAll(allData.subList(i * foldLength, (i + 1) * foldLength));\n\t\t\trest.addAll(allData.subList(0, i * foldLength));\n\t\t\trest.addAll(allData.subList((i + 1) * foldLength, allData.size()));\n\t\t\tdouble[] predict = classify(fold, rest);\n\t\t\tdouble[] real = getLabels(fold);\n\t\t\taccurs.add(getAccuracyBinary(predict, real));\n\t\t}\n\t\tdouble accur = 0;\n\t\tfor (int i = 0; i < accurs.size(); i++) {\n\t\t\taccur += accurs.get(i);\n\t\t}\n\t\taccur /= accurs.size();\n\t\treturn accur;\n\t}", "@Override\n public Point[] chooseCentroids(AbstractCluster self) {\n if (K!=2) {\n System.err.println(\"The used splitter is not suppose to be used with K>2. This program will shut down\"); //#like\n exit(1);\n }\n Point[] result={self.get(0),self.get(0)};\n double max=0;\n for (int i=0; i<self.size(); ++i)\n for (int j=0; j<i; ++j)\n if (max<_distances.get(self.get(i).getId(),self.get(j).getId())) {\n max=_distances.get(self.get(i).getId(),self.get(j).getId());\n result[0]=self.get(i);\n result[1]=self.get(j);\n }\n return result;\n }", "private void update(ArrayList<Triple<Integer, Integer, Integer>> miniBatch, ArrayList<Triple<Integer, Integer, Integer>> corruptedTriples, double margin, double learningRate, double C, int k){\n ArrayList<double[]> copyEntityVectors = (ArrayList<double[]>) entityVectors.clone();\n ArrayList<double[]> copyRelationVectors = (ArrayList<double[]>) relationVectors.clone();\n ArrayList<double[]> copyNormalVectors = (ArrayList<double[]>) normalVectors.clone();\n\n for(int i = 0; i < miniBatch.size(); i ++){\n int head = miniBatch.get(i).getLeft();\n int relation = miniBatch.get(i).getMiddle();\n int tail = miniBatch.get(i).getRight();\n int headC = corruptedTriples.get(i).getLeft();\n int tailC = corruptedTriples.get(i).getRight();\n double[] normalVector = copyNormalVectors.get(relation);\n double[] headVector = copyEntityVectors.get(head);\n double[] relationVector = copyRelationVectors.get(relation);\n double[] tailVector = copyEntityVectors.get(tail);\n double[] headCVector = copyEntityVectors.get(headC);\n double[] tailCVector = copyEntityVectors.get(tailC);\n double[] projectHead = helper.planeProjection(headVector, normalVector); // project vector to a plane\n double[] projectTail = helper.planeProjection(tailVector, normalVector); // project vector to a plane\n double[] projectHeadC = helper.planeProjection(headCVector, normalVector); // project vector to a plane\n double[] projectTailC = helper.planeProjection(tailCVector, normalVector); // project vector to a plane\n\n Boolean orthogonal = helper.checkOrthogonal(relationVector, normalVector);\n double dotProduct = helper.dotProduct(relationVector, normalVector);\n\n double distanceL2 = helper.distanceL2(projectHead, relationVector, projectTail, k);\n double distanceL2C = helper.distanceL2(projectHeadC, relationVector, projectTailC, k);\n double loss = distanceL2 + margin - distanceL2C;\n if (loss > 0){\n double[] newHeadVector = new double[k];\n double[] newRelationVector = new double[k];\n double[] newTailVector = new double[k];\n double[]newNormalVector = new double[k];\n for (int j = 0; j< k; j++){\n double delta = 2*(projectTail[j] - projectHead[j] -relationVector[j]);\n double deltaC = 2*(projectTailC[j] - projectHeadC[j] - relationVector[j]);\n double constraintR = 0;\n double constraintN = 0;\n if (orthogonal == false){\n constraintR = 2 *C * dotProduct *normalVector[j]; // constraints if the relation vector and the normal vector is not orthogonal for relation vector\n constraintN = 2* C * dotProduct *relationVector[j]; // constraints if not orthogonal for normal vector\n }\n double newHead = headVector[j] + learningRate * delta * (1 - Math.pow(normalVector[j], 2)); // the partial derivative includes normal vector, second step chain rule\n double newRelation = relationVector[j] + learningRate * (delta - deltaC) - constraintR; // relation vector is not affected by normal vector, second step chain rule\n double newTail = tailVector[j] - learningRate * delta * (1 - Math.pow(normalVector[j], 2)); // the partial derivative includes normal vector\n double newNormal = normalVector[j] - constraintN; // update normal vector if not orthogonal\n newHeadVector[j] = newHead;\n newRelationVector[j] = newRelation;\n newTailVector[j] = newTail;\n newNormalVector[j] = newNormal;\n }\n double[] normedHeadVector = helper.norm(newHeadVector);\n double[] normedRelationVector = helper.norm(newRelationVector);\n double[] normedTailVector = helper.norm(newTailVector);\n double[] normedNormalVector = helper.norm(newNormalVector);\n copyEntityVectors.set(head, normedHeadVector);\n copyEntityVectors.set(tail, normedTailVector);\n copyRelationVectors.set(relation, normedRelationVector);\n copyNormalVectors.set(relation, normedNormalVector);\n }\n }\n entityVectors = copyEntityVectors;\n relationVectors = copyRelationVectors;\n normalVectors = copyNormalVectors;\n }", "@Test\n public void testIntersection1()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {33, 100000};\n List<Integer> expected = Arrays.asList(33, 100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "public static void main(String[] args) {\n ArrayList<Character> actual=new ArrayList<>();\n actual.add('R');\n actual.add('G');\n actual.add('B');\n actual.add('Y');\n ArrayList<Character> guess=new ArrayList<>();\n guess.add('G');\n guess.add('G');\n guess.add('R');\n guess.add('R');\n ArrayList<Character> hitLists=new ArrayList<>();\n ArrayList<Character> pseudoLists=new ArrayList<>();\n int hits=0;\n int pseudoHits=0;\n for(int i=0;i<4;i++)\n {\n \t if(actual.get(i)==guess.get(i))\n \t {\n \t\t hits++;\n \t\t hitLists.add(actual.get(i));\n \t }\n }\n for(int i=0;i<4;i++)\n {\n \t char g=guess.get(i);\n \t if(g!=actual.get(i)&&!hitLists.contains(g)&&actual.contains(g))\n { \n\t pseudoLists.add(g);\n }\n }\n for(int i=0;i<pseudoLists.size();i++)\n { char g=pseudoLists.get(i);\n \t int actualOccs=numOccurences(g,actual);\n \t int guessOccs=numOccurences(g,guess);\n \t \n\t\tif(guessOccs==actualOccs)\n \t {\n \t\t pseudoHits++; \n \t }\n\t\telse{\n\t\t\tpseudoHits+=Math.min(guessOccs,actualOccs);\n\t\t}\t \n System.out.println(g);\n }\n \n \n System.out.println(hits+\" hits \"+pseudoHits+\" pseudoHits\");\n\t}", "private void evaluationLogic() {\n // setup for logic:\n // if distToClosestEstimate[i][0] is smaller than threshold, we have a Tp\n // if distToClosestEstimate[i][0] is larger than threshold, we have a Fn\n // all estimatedFeatures that are not assigned Tp are therefore Fp\n for (int i = 0; i < groundTruthInstant.size(); ++i) {\n if (distToClosestEstimate[i][0] < truePositiveThreshold) {\n ++truePositiveCount;\n int assignedEstimatedFeature = (int) distToClosestEstimate[i][1];\n assignedEstimatedFeatures[assignedEstimatedFeature] = true;\n } else\n ++falseNegativeCount;\n }\n for (int i = 0; i < estimatedInstant.size(); ++i)\n if (!assignedEstimatedFeatures[i])\n ++falsePositiveCount;\n }", "public CoverageResult analyseCoverage(HashMap<String, ExplicitTarget> selectedFavorTargets, HashMap<String, ExplicitTarget> selectedAgainstTargets, HashMap<String, ExplicitTarget> availableTargets, boolean evaluateOnTrain) throws UIMAException, NumberFormatException, SQLException {\n//\t\tHashMap<String, Set<String>> targetToText=getAvailableTargetsToText(availableTargets);\n\t\tSet<String> wordsInSelectedTargets= getWordsInSelectedTargets(selectedFavorTargets,selectedAgainstTargets);\n\t\t\n\t\tEvaluationDataSet dataSet= null;\n\t\tif(evaluateOnTrain){\n\t\t\tdataSet=evaluationScenario.getTrainData();\n\t\t}else{\n\t\t\tevaluationScenario.getTestData();\n\t\t}\n\t\tSet<String> wordsInData=getWordsInData(dataSet.getDataReader());\n\t\t\n\t\tdouble coverageSelection=getCoverage(wordsInData,wordsInSelectedTargets);\n\t\tHashMap<String, Double> targetToCoverage=null;\n//\t\tHashMap<String, Double> targetToCoverage=getTargetToCoverage(wordsInData,targetToText);\n\t\tSystem.out.println(coverageSelection);\n\t\t\n\t\treturn new CoverageResult(coverageSelection,targetToCoverage);\n\t}", "@SuppressWarnings(\"boxing\")\n @Override\n public void apply(SetUniqueList<SoftwareVersion> trainversionSet, SoftwareVersion testversion) {\n // reset these for each run\n this.mm = null;\n this.classifier = null;\n\n double score = 0; // matching score to select the best matching training data from the set\n int num = 0;\n int biggest_num = 0;\n MetricMatch tmp;\n for (SoftwareVersion trainversion : trainversionSet) {\n num++;\n\n tmp = new MetricMatch(trainversion.getInstances(), testversion.getInstances());\n\n // metric selection may create error, continue to next training set\n try {\n tmp.attributeSelection();\n tmp.matchAttributes(this.method, this.threshold);\n }\n catch (Exception e) {\n e.printStackTrace();\n throw new RuntimeException(e);\n }\n\n // we only select the training data from our set with the most matching attributes\n if (tmp.getScore() > score && tmp.attributes.size() > 0) {\n score = tmp.getScore();\n this.mm = tmp;\n biggest_num = num;\n }\n }\n\n // if we have found a matching instance we use it, log information about the match for\n // additional eval later\n Instances ilist = null;\n if (this.mm != null) {\n ilist = this.mm.getMatchedTrain();\n LOGGER.debug(\"[MATCH FOUND] match: [\" + biggest_num + \"], score: [\" +\n score + \"], instances: [\" + ilist.size() + \"], attributes: [\" +\n this.mm.attributes.size() + \"], ilist attrs: [\" + ilist.numAttributes() + \"]\");\n for (Map.Entry<Integer, Integer> attmatch : this.mm.attributes.entrySet()) {\n LOGGER.debug(\"[MATCHED ATTRIBUTE] source attribute: [\" +\n this.mm.train.attribute(attmatch.getKey()).name() + \"], target attribute: [\" +\n this.mm.test.attribute(attmatch.getValue()).name() + \"]\");\n }\n }\n else {\n LOGGER.debug(\"[NO MATCH FOUND]\");\n }\n\n // if we have a match we build the MetricMatchingClassifier, if not we fall back to FixClass\n // Classifier\n try {\n if (this.mm != null) {\n this.classifier = new MetricMatchingClassifier();\n this.classifier.buildClassifier(ilist);\n ((MetricMatchingClassifier) this.classifier).setMetricMatching(this.mm);\n }\n else {\n this.classifier = new FixClass();\n this.classifier.buildClassifier(ilist); // this is null, but the FixClass Classifier\n // does not use it anyway\n }\n }\n catch (Exception e) {\n e.printStackTrace();\n throw new RuntimeException(e);\n }\n }", "private void setK(int mu) {\r\n\t\tk = 1;\r\n\t\tint g = 0;\r\n\t\tint intervalLength = intervals.length;\r\n\t\twhile(g<intervalLength && mu>intervals[g]) {\r\n\t\t\tg++;\r\n\t\t\tk++;\r\n\t\t}\r\n\t}", "@Test\n public void Test4663220() {\n RuleBasedCollator collator = (RuleBasedCollator)Collator.getInstance(Locale.US);\n java.text.StringCharacterIterator stringIter = new java.text.StringCharacterIterator(\"fox\");\n CollationElementIterator iter = collator.getCollationElementIterator(stringIter);\n \n int[] elements_next = new int[3];\n logln(\"calling next:\");\n for (int i = 0; i < 3; ++i) {\n logln(\"[\" + i + \"] \" + (elements_next[i] = iter.next()));\n }\n \n int[] elements_fwd = new int[3];\n logln(\"calling set/next:\");\n for (int i = 0; i < 3; ++i) {\n iter.setOffset(i);\n logln(\"[\" + i + \"] \" + (elements_fwd[i] = iter.next()));\n }\n \n for (int i = 0; i < 3; ++i) {\n if (elements_next[i] != elements_fwd[i]) {\n errln(\"mismatch at position \" + i + \n \": \" + elements_next[i] + \n \" != \" + elements_fwd[i]);\n }\n }\n }", "public void reduce(Text prefix, Iterator<IntWritable> iter,\n OutputCollector<Text, IntWritable> output, Reporter reporter) throws IOException {\nint a000 = 0;\nint a001 = 0;\nint a002 = 0;\nint a003 = 0;\nint a004 = 0;\nint a005 = 0;\nint a006 = 0;\nint a007 = 0;\nint a008 = 0;\nint a009 = 0;\nint a010 = 0;\nint a011 = 0;\nint a012 = 0;\nint a013 = 0;\nint a014 = 0;\nint a015 = 0;\nint a016 = 0;\nint a017 = 0;\nint a018 = 0;\nint a019 = 0;\nint a020 = 0;\nint a021 = 0;\nint a022 = 0;\nint a023 = 0;\nint a024 = 0;\nint cur = 0;\n\nwhile (iter.hasNext()) {\ncur = iter.next().get();\na014 = a022 - a006;\na013 = -2 - a022;\na018 += a003;\na011 -= a011;\na011 += a018;\na009 -= cur;\nif (a019 <= a021) {\na014 = a003 + a003;\na011 = a021 + 4;\na017 -= a002;\na005 = -5 - a019;\na004 = a003 - a016;\ncur += a017;\na013 += a010;\ncur -= a012;\na006 = a000 + a015;\na017 = a014 + a022;\na011 = a020 + a013;\na014 += a001;\na005 = a016 + a007;\ncur = 2 + a011;\na020 = a023 - a006;\na007 += a021;\na021 = a021 + a008;\na000 += a008;\na024 = a024 - a009;\na017 += 4;\na013 = a006 - a023;\na013 = a009 + a008;\na010 += a001;\na003 = a018 - a018;\na015 = a023 + a023;\na016 = a009 - a002;\na003 += -1;\na013 = a022 + a014;\na018 -= a020;\na001 = a003 + a009;\na024 += a015;\n} else {\nif (a017 > a011) {\na009 -= a001;\na024 -= a007;\na005 = a017 - a007;\na020 += a020;\nif (a003 != a001) {\na009 += a006;\na006 += a017;\na016 -= a004;\na024 = a008 + a002;\na014 -= a024;\na017 -= a010;\na012 -= a003;\na005 += a002;\na005 = a007 - a014;\na013 = a013 - a001;\na005 = a019 + a016;\na024 -= a014;\ncur = a005 - a010;\na004 = a003 - a001;\na000 = a021 - -1;\na019 = a006 - a008;\na006 = a018 + a009;\na015 -= a013;\na017 = a019 - a022;\na004 += a019;\na023 += a016;\na010 += a000;\na003 += a011;\na011 += a019;\na009 += a014;\na018 = a012 + a001;\ncur = -4 + 3;\na021 = a017 - a001;\na004 += a002;\na020 = -5 + a024;\na023 = a020 + a018;\na024 += a018;\n} else {\na017 = -5 - a012;\na013 = a023 - a018;\na020 = a020 - a017;\na003 += a013;\na004 = a019 - cur;\na016 += a010;\na021 += a018;\na008 = a010 - a012;\na010 -= a019;\na007 -= a013;\na015 -= a019;\na019 = a004 + a021;\na011 = a013 + a006;\na005 += a004;\na015 -= a016;\na017 = a002 - a024;\na002 -= a007;\na022 = a004 - cur;\na011 = a021 + a014;\na004 += a020;\na020 = a020 + a009;\na007 = a012 - a002;\na018 = a003 - a001;\na011 = a000 + a009;\na019 = a021 + a017;\na017 = a022 - a013;\na014 = a018 - a020;\na009 -= a023;\na007 -= a008;\na020 = 2 + a011;\na009 = cur + a010;\na015 -= a018;\na010 = a024 + a014;\n}\ncur -= a020;\n} else {\na008 = a003 - a017;\na024 -= a004;\nif (a014 >= a018) {\na005 = a000 + a021;\na003 = a006 + a002;\na009 = a021 + a023;\na003 += -5;\na022 += a024;\na010 = a014 + a016;\na024 = a008 + a010;\na008 = 2 - a003;\na014 -= a002;\na007 = a006 - a023;\na014 += a018;\na001 = a009 + a016;\na018 += a022;\na001 = a019 - a018;\na008 -= a011;\na019 -= a001;\na010 += a014;\ncur += a011;\na024 = a022 - a018;\na014 = a003 - a023;\na004 -= a002;\n} else {\na020 += a017;\na001 = a012 + a009;\na015 += a013;\na018 += a003;\na013 += a009;\na007 = a015 + a019;\na012 += a001;\na009 = a010 + -1;\na023 -= a017;\na020 = a017 + a004;\na005 = a011 - a001;\ncur -= a000;\na020 = a002 + a002;\na004 += a017;\na022 = a017 + a024;\na001 -= a016;\na012 = a021 + 0;\na002 -= a018;\na011 += a001;\na024 = a001 + a002;\na003 -= a015;\na016 = a022 - a014;\na008 = a002 - a001;\na006 += a009;\na018 -= a000;\na008 = a000 - a004;\na019 += a021;\na009 = a021 - a011;\na000 += a020;\na002 += a009;\nif (a024 == a022) {\ncur = a012 + a009;\na007 = a002 + a012;\na015 += a001;\na022 = a007 + a011;\na012 += a021;\na003 -= cur;\na018 -= a011;\na012 = a019 - a013;\na000 = a010 - a005;\na004 = a014 - a009;\na001 = a000 + a005;\na010 += a004;\na008 = a023 - 3;\na009 += a022;\na005 -= a018;\na004 += a003;\na018 = a001 + a001;\na010 = a003 + a014;\na011 -= a003;\na000 += 1;\na006 -= a018;\na008 = a011 - a009;\na008 = a013 - a009;\na011 = a016 + a009;\na008 -= a011;\na024 = a000 + a003;\na015 -= 4;\ncur = a008 - a024;\na024 = a012 - a008;\na005 = a023 + a020;\na024 -= a003;\n} else {\na017 = a012 + a013;\na017 = a019 - a000;\n}\na018 -= a005;\na006 = a021 + a019;\na005 += a007;\na018 += cur;\na005 += a008;\na008 += a017;\na019 = a002 - a006;\na005 = a000 + a011;\na003 = a021 - a005;\na019 = a014 + a006;\na018 -= a010;\na006 = 1 + a023;\na024 += a016;\na018 += a022;\na011 += a024;\na003 = a007 - a010;\na001 = a019 + a013;\na022 += a013;\na017 += a008;\na006 = a010 + a011;\na023 += a006;\na009 = a011 + a002;\na022 -= a015;\na024 = a012 - a019;\na001 -= a023;\na010 = a019 + cur;\na002 -= a009;\na012 -= a010;\na001 -= a006;\na021 = a000 - a000;\n}\na000 += a008;\na010 = a004 + a013;\na001 += cur;\na004 += a010;\na022 = a020 + a016;\na016 -= a008;\na010 = 4 - a018;\na007 = a021 - a011;\na010 -= a006;\na011 = a018 + a008;\na002 -= a000;\na004 -= a016;\na012 = a018 - a003;\na010 = a005 + a012;\na013 -= a005;\na011 = a010 - a001;\na007 -= a000;\na001 = a014 + a013;\na008 += a002;\na017 = a011 - a020;\na009 -= a013;\na022 -= a010;\na022 = a011 - a010;\n}\na005 = a021 - a002;\n}\na003 += a010;\na012 = cur - a021;\ncur += a017;\n}\noutput.collect(prefix, new IntWritable(a003));\n}", "public static void main(String args[]) throws Exception {\n\n String sourceFile = args[0]; //source file has supervised SRL tags\n String targetFile = args[1]; //target file has supervised SRL tags\n String alignmentFile = args[2];\n String sourceClusterFilePath = args[3];\n String targetClusterFilePath = args[4];\n String projectionFilters = args[5];\n double sparsityThresholdStart = Double.parseDouble(args[6]);\n double sparsityThresholdEnd = Double.parseDouble(args[6]);\n\n\n Alignment alignment = new Alignment(alignmentFile);\n HashMap<Integer, HashMap<Integer, Integer>> alignmentDic = alignment.getSourceTargetAlignmentDic();\n\n final IndexMap sourceIndexMap = new IndexMap(sourceFile, sourceClusterFilePath);\n final IndexMap targetIndexMap = new IndexMap(targetFile, targetClusterFilePath);\n ArrayList<String> sourceSents = IO.readCoNLLFile(sourceFile);\n ArrayList<String> targetSents = IO.readCoNLLFile(targetFile);\n\n System.out.println(\"Projection started...\");\n DependencyLabelsAnalyser dla = new DependencyLabelsAnalyser();\n for (int senId = 0; senId < sourceSents.size(); senId++) {\n if (senId % 100000 == 0)\n System.out.print(senId);\n else if (senId % 10000 == 0)\n System.out.print(\".\");\n\n Sentence sourceSen = new Sentence(sourceSents.get(senId), sourceIndexMap);\n Sentence targetSen = new Sentence(targetSents.get(senId), targetIndexMap);\n int maxNumOfProjectedLabels = dla.getNumOfProjectedLabels(sourceSen, alignmentDic.get(senId));\n double trainGainPerWord = (double) maxNumOfProjectedLabels/targetSen.getLength();\n\n if (trainGainPerWord >= sparsityThresholdStart && trainGainPerWord< sparsityThresholdEnd) {\n dla.analysSourceTargetDependencyMatch(sourceSen, targetSen, alignmentDic.get(senId),\n sourceIndexMap, targetIndexMap, projectionFilters);\n }\n }\n System.out.print(sourceSents.size() + \"\\n\");\n dla.writeConfusionMatrix(\"confusion_\"+sparsityThresholdStart+\"_\"+sparsityThresholdEnd+\".out\", sourceIndexMap, targetIndexMap);\n }", "public void ComputeSimilarity() {\n\t\t\n\t\t//first construct the vector space representations for these five reviews\n\t\t// the our smaples vector, finally get the similarity metric \n\t\tanalyzequery(LoadJson(\"./data/samples/query.json\"));\n\t\n\t\t\n\t\tHashMap<String, Double> Similarity = new HashMap<String, Double>();\n\n\t\tfor (int i = 0; i < m_reviews.size(); i++) {\n\t\t\tString content = m_reviews.get(i).getContent();\n\n\t\t\tHashMap<String, Integer> conunttf = new HashMap<String, Integer>();\n\n\t\t\tHashSet<String> biminiset = new HashSet<String>();\n \n\t\t\t//danci means word unit: one or two words\n\t\t\tArrayList danci = new ArrayList();\n\n\t\t\tfor (String token : tokenizer.tokenize(content)) {\n\t\t\t\tif (m_stopwords.contains(token))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (token.isEmpty())\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdanci.add(PorterStemmingDemo(SnowballStemmingDemo(NormalizationDemo(token))));\n\n\t\t\t}\n \n\t\t\t//get word count in a document\n\t\t\tfor (int k = 0; k < danci.size(); k++) {\n\n\t\t\t\tif (conunttf.containsKey(danci.get(k).toString())) {\n\t\t\t\t\tconunttf.put(danci.get(k).toString(),\n\t\t\t\t\t\t\tconunttf.get(danci.get(k).toString()) + 1);\n\t\t\t\t} else {\n\t\t\t\t\tconunttf.put(danci.get(k).toString(), 1);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tArrayList<String> N_gram = new ArrayList<String>();\n\n\t\t\tfor (String token : tokenizer.tokenize(content)) {\n\n\t\t\t\ttoken = PorterStemmingDemo(SnowballStemmingDemo(NormalizationDemo(token)));\n\t\t\t\tif (token.isEmpty()) {\n\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\n\t\t\t\t\tN_gram.add(token);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tString[] fine = new String[N_gram.size()];\n \n\t\t\t//get rid of stopwords\n\t\t\tfor (int p = 0; p < N_gram.size() - 1; p++) {\n\t\t\t\tif (m_stopwords.contains(N_gram.get(p)))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (m_stopwords.contains(N_gram.get(p + 1)))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tfine[p] = N_gram.get(p) + \"-\" + N_gram.get(p + 1);\n\n\t\t\t}\n\n\t\t\t\n\t\t\tfor (String str2 : fine) {\n\n\t\t\t\tif (conunttf.containsKey(str2)) {\n\t\t\t\t\tconunttf.put(str2, conunttf.get(str2) + 1);\n\t\t\t\t} else {\n\t\t\t\t\tconunttf.put(str2, 1);\n\t\t\t\t}\n\t\t\t}\n \n\t\t\t//compute tf * idf for each document\n\t\t\tfor (String key : conunttf.keySet()) {\n\t\t\t\tif (m_stats.containsKey(key)) {\n\t\t\t\t\tdouble df = (double) m_stats.get(key);\n\n\t\t\t\t\tdouble idf = (1 + Math.log(102201 / df));\n\n\t\t\t\t\tdouble tf = conunttf.get(key);\n\n\t\t\t\t\tdouble result = tf * idf;\n\n\t\t\t\t\tm_idf.put(key, result);\n\t\t\t\t} else {\n\t\t\t\t\tm_idf.put(key, 0.0);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\tHashMap<String, Double> query = new HashMap<String, Double>();\n\t\t\tHashMap<String, Double> test = new HashMap<String, Double>();\n \n\t\t\t//If query contains this word, store it for future computation \n\t\t\tfor (Map.Entry<String, Double> entry : m_idf.entrySet()) {\n\t\t\t\tString key = entry.getKey();\n\t\t\t\tif (query_idf.containsKey(key)) {\n\t\t\t\t\tquery.put(key, query_idf.get(key));\n\t\t\t\t\ttest.put(key, m_idf.get(key));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdouble dotProduct = 0.00;\n\t\t\tdouble magnitude1 = 0.0;\n\t\t\tdouble magnitude2 = 0.0;\n\t\t\tdouble magnitude3 = 0.0;\n\t\t\tdouble magnitude4 = 0.0;\n\t\t\tdouble cosineSimilarity = 0;\n \n\t\t\t\n\t\t\t//compute Compute similarity between query document and each document in file\n\t\t\tfor (String cal : test.keySet()) {\n\t\t\t\tdotProduct += query.get(cal) * test.get(cal); // a.b\n\t\t\t\tmagnitude1 += Math.pow(query.get(cal), 2); // (a^2)\n\t\t\t\tmagnitude2 += Math.pow(test.get(cal), 2); // (b^2)\n\n\t\t\t\tmagnitude3 = Math.sqrt(magnitude1);// sqrt(a^2)\n\t\t\t\tmagnitude4 = Math.sqrt(magnitude2);// sqrt(b^2)\n\t\t\t}\n\n\t\t\tif (magnitude3 != 0.0 | magnitude4 != 0.0)\n\t\t\t\tcosineSimilarity = dotProduct / (magnitude3 * magnitude4);\n\n\t\t\telse\n\t\t\t\tcosineSimilarity = 0;\n\n\t\t\tSimilarity.put(content, cosineSimilarity);\n\n\t\t\t\t\t\n\n\t\t}\n\n\t\t// sort output to get 3 reviews with the highest similarity with query review\n\t\tList<Map.Entry<String, Double>> infoIds = new ArrayList<Map.Entry<String, Double>>(\n\t\t\t\tSimilarity.entrySet());\n\n\t\tCollections.sort(infoIds, new Comparator<Map.Entry<String, Double>>() {\n\t\t\tpublic int compare(Map.Entry<String, Double> o1,\n\t\t\t\t\tMap.Entry<String, Double> o2) {\n\t\t\t\treturn (int) (o1.getValue() - o2.getValue());\n\t\t\t}\n\t\t});\n\n\t\tfor (int i = infoIds.size() - 1; i > infoIds.size() - 4; i--) {\n\t\t\tEntry<String, Double> ent = infoIds.get(i);\n\t\t\tSystem.out.println(ent.getValue()+\"++\"+ent.getKey()+\"\\n\");\n\n\t\t}\n\n\t}", "@Test\n public void testIndexMaintenanceWithIndexOnMethodKeys() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"ks.toString\",\n SEPARATOR + \"portfolio.keys() ks\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForKeys(ri);\n }", "static String classificacao(ArrayList<Musica> musicas, Musica proxima, int k){\n String classeResultado = \"\";\n\n int qtdeMusicas = musicas.size();\n //System.out.println(\"Quantidade de musicas \" + qtdeMusicas);\n double distAmostra[] = new double[qtdeMusicas];\n int vetorOrdenado[] = new int[qtdeMusicas];\n\n for(int i=0; i<qtdeMusicas;i++){\n double dist = distancia(musicas.get(i), proxima);\n distAmostra[i] = dist; \n } \n System.out.println(\"ANTES\");\n for(int i = 0; i < distAmostra.length; i++){\n System.out.println(distAmostra[i]);\n }\n \n selectionSort(distAmostra,vetorOrdenado);\n \n System.out.println(\"DEPOIS\");\n for(int i = 0; i < distAmostra.length; i++){\n System.out.println(distAmostra[i]);\n }\n \n int contadorDeClasse[] = new int[6];\n int vizinhos = 0;\n for(int i=0; i < distAmostra.length; i++){\n if(vizinhos > k){\n break;\n }\n \n String classe = musicas.get(vetorOrdenado[i]).getClasse();\n //System.out.println(\"musica classe \" + classe); //Para Teste\n\n switch (classe) {\n case \"rap\":\n contadorDeClasse[0]++;\n break;\n case \"axe\":\n contadorDeClasse[1]++;\n break;\n case \"sertanejo\":\n contadorDeClasse[2]++;\n break;\n case \"samba\":\n contadorDeClasse[3]++;\n break;\n case \"forro\":\n contadorDeClasse[4]++;\n break;\n case \"bossa_nova\":\n contadorDeClasse[5]++;\n break; \n }\n vizinhos++;\n } \n /*\n for(int i = 0; i < contadorDeClasse.length; i++){\n System.out.println(contadorDeClasse[i]);\n }\n */\n int maior = 0;\n int indiceMaior = -1;\n for (int i = 0; i < contadorDeClasse.length; i++) {\n if (contadorDeClasse[i] > maior) {\n maior = contadorDeClasse[i];\n indiceMaior = i;\n }\n }\n \n switch (indiceMaior) {\n case 0:\n classeResultado = \"rap\";\n break;\n case 1:\n classeResultado = \"axe\";\n break;\n case 2:\n classeResultado = \"sertanejo\";\n break;\n case 3:\n classeResultado = \"samba\";\n break;\n case 4:\n classeResultado = \"forro\";\n break;\n case 5:\n classeResultado = \"bossa_nova\";\n break; \n }\n return classeResultado;\n }", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}" ]
[ "0.5758785", "0.57394207", "0.56136185", "0.55218434", "0.5490933", "0.5270831", "0.51924086", "0.5164692", "0.51096773", "0.5061333", "0.503891", "0.49969563", "0.49847057", "0.49726978", "0.49602205", "0.4918573", "0.49167323", "0.4915955", "0.4897348", "0.48952895", "0.48939222", "0.48611635", "0.4856604", "0.4820624", "0.48097128", "0.48077288", "0.4805732", "0.47909915", "0.4790778", "0.47870147", "0.4783567", "0.47688627", "0.47514588", "0.4738934", "0.47346374", "0.4727717", "0.47121018", "0.4699765", "0.46911883", "0.46889198", "0.46779856", "0.46745953", "0.46463722", "0.46338582", "0.46322826", "0.4621614", "0.45995617", "0.4584665", "0.4584095", "0.45734712", "0.4561239", "0.45604655", "0.45567742", "0.45502526", "0.45487806", "0.454615", "0.4544388", "0.4536827", "0.4536593", "0.4532677", "0.45305154", "0.45303452", "0.45241383", "0.45233828", "0.45209712", "0.4518671", "0.45145306", "0.4505717", "0.45056888", "0.45001858", "0.4495541", "0.4495132", "0.4493259", "0.44932136", "0.4493158", "0.4489503", "0.44839597", "0.4479619", "0.44744685", "0.44711262", "0.4469463", "0.44684893", "0.44649935", "0.44634494", "0.44627312", "0.4462124", "0.446091", "0.4458741", "0.44538587", "0.44502395", "0.4448529", "0.44460627", "0.44457284", "0.44404694", "0.44390756", "0.44362637", "0.44361585", "0.4435261", "0.4425279", "0.442494" ]
0.5355909
5
Performs kcomparesingleswap at indices i. 1. Load linked value at i0. 2. Snapshot values at i1rest. 3. Check if captured values match expected. 3a. If a value didnt match, restore (fail). 3b. Otherwise, store conditional new value. 3c. Retry if that failed.
private boolean kcss(int[] i, long[] e, long y) { int I = i.length; long[] x = new long[I]; while (true) { x[0] = ll(i[0]); // 1 snapshot(i, 1, I, x); // 2 if (Arrays.compare(x, e) != 0) { // 3 sc(i[0], x[0]); // 3a return false; // 3a } if (sc(i[0], y)) return true; // 3b } // 3c }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean arraySwap (int i, int j){\n //Initialize a temporary card for switching values and index values for\n //row and column\n Card cardToSwitch = null;\n int iNum = -1;\n int jNum = -1;\n\n //Populate the temporary card and indices\n cardToSwitch = cardArray[i][j];\n iNum = i;\n jNum = j;\n\n //Error check to see if the temporary card was populated\n if(cardToSwitch == null){\n return false;\n }\n\n /* For each case, check the surrounding neighbors of the card. If one of\n the neighbors is the blank card use the temporary values to switch the\n cards values, then call swapLocation to swap the location values of the cards\n */\n else{\n //Case 1 it is not a corner or an edge, check if it is a neighbor\n if((iNum > 0) && (iNum < cardArray.length - 1) && (jNum > 0) &&\n (jNum < cardArray.length - 1)){\n if(cardArray[iNum][jNum - 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum - 1];\n cardArray[iNum][jNum - 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum - 1]);\n return true;\n }\n if(cardArray[iNum][jNum + 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum + 1];\n cardArray[iNum][jNum + 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum + 1]);\n return true;\n }\n if(cardArray[iNum + 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum + 1][jNum];\n cardArray[iNum + 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum + 1][jNum]);\n return true;\n }\n if(cardArray[iNum - 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum - 1][jNum];\n cardArray[iNum - 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum - 1][jNum]);\n return true;\n }\n }\n\n //Case 2: it is on the top edge but not a corner, check if it is a neighbor\n else if((iNum == 0) && (jNum > 0) && (jNum < cardArray.length - 1)){\n if(cardArray[iNum][jNum - 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum - 1];\n cardArray[iNum][jNum - 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum - 1]);\n return true;\n }\n if(cardArray[iNum][jNum + 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum + 1];\n cardArray[iNum][jNum + 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum + 1]);\n return true;\n }\n if(cardArray[iNum + 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum + 1][jNum];\n cardArray[iNum + 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum + 1][jNum]);\n return true;\n }\n }\n\n //Case 3: it is on the bottom edge but not a corner, check if it is a neighbor\n else if((iNum == cardArray.length - 1) && (jNum > 0) &&\n (jNum < cardArray.length - 1)){\n if(cardArray[iNum][jNum - 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum - 1];\n cardArray[iNum][jNum - 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum - 1]);\n return true;\n }\n if(cardArray[iNum][jNum + 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum + 1];\n cardArray[iNum][jNum + 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum + 1]);\n return true;\n }\n if(cardArray[iNum - 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum - 1][jNum];\n cardArray[iNum - 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum - 1][jNum]);\n return true;\n }\n }\n\n //Case 4: it is on the left edge but not a corner, check if it is a neighbor\n else if((iNum > 0) && (iNum < cardArray.length - 1) && (jNum == 0)){\n if(cardArray[iNum][jNum + 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum + 1];\n cardArray[iNum][jNum + 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum + 1]);\n return true;\n }\n if(cardArray[iNum - 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum - 1][jNum];\n cardArray[iNum - 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum - 1][jNum]);\n return true;\n }\n if(cardArray[iNum + 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum + 1][jNum];\n cardArray[iNum + 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum + 1][jNum]);\n return true;\n }\n }\n\n //Case 5: It is on the right edge but not a corner, check if it is a neighbor\n else if((iNum > 0) && (iNum < cardArray.length - 1) &&\n (jNum == cardArray.length - 1)){\n if(cardArray[iNum][jNum - 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum - 1];\n cardArray[iNum][jNum - 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum - 1]);\n return true;\n }\n if(cardArray[iNum - 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum - 1][jNum];\n cardArray[iNum - 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum - 1][jNum]);\n return true;\n }\n if(cardArray[iNum + 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum + 1][jNum];\n cardArray[iNum + 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum + 1][jNum]);\n return true;\n }\n }\n\n\n //Case 6: it is the top left corner, check if it is a neighbor\n else if((iNum == 0) && (jNum == 0)){\n if(cardArray[iNum + 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum + 1][jNum];\n cardArray[iNum + 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum + 1][jNum]);\n return true;\n }\n if(cardArray[iNum][jNum + 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum + 1];\n cardArray[iNum][jNum + 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum + 1]);\n return true;\n }\n }\n\n //Case 7: It is the top right corner, check if it is a neighbor\n else if((iNum == 0) && (jNum == cardArray.length - 1)){\n if(cardArray[iNum][jNum - 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum - 1];\n cardArray[iNum][jNum - 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum - 1]);\n return true;\n }\n\n if(cardArray[iNum + 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum + 1][jNum];\n cardArray[iNum + 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum + 1][jNum]);\n return true;\n }\n }\n\n //Case 8: It is the bottom left corner, check if it is a neighbor\n else if((iNum == cardArray.length - 1) && (jNum == 0)){\n if(cardArray[iNum -1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum - 1][jNum];\n cardArray[iNum - 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum - 1][jNum]);\n return true;\n }\n if(cardArray[iNum][jNum + 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum + 1];\n cardArray[iNum][jNum + 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum +1]);\n return true;\n }\n }\n\n //Case 9: It is the bottom right corner, check if it is a neighbor\n else if((iNum == cardArray.length - 1) && (jNum == cardArray.length - 1)){\n if(cardArray[iNum][jNum - 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum - 1];\n cardArray[iNum][jNum - 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum - 1]);\n return true;\n }\n if(cardArray[iNum - 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum - 1][jNum];\n cardArray[iNum - 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum - 1][jNum]);\n return true;\n }\n }\n\n //Case 10: The card is not a neighbor of the blank card, return false\n else{\n return false;\n }\n }\n\n //This case should never be hit, if it is, something is wrong\n return false;\n }", "@Test\n public void case5SortReversedSequence(){\n //Completely reverse sorted array\n int[] testArray = {1,2,3};\n SortDemoData data3 = new SortDemoData() ;\n data3.initializeArray(\"3 2 1\");\n assertTrue(map.get(algoUnderTest)+\" Before Sort ...First Element\",data3.myArray[2].key == testArray[0]);\n assertTrue(map.get(algoUnderTest)+\" Before Sort ...Second Element\",data3.myArray[1].key == testArray[1]);\n assertTrue(map.get(algoUnderTest)+\" Before Sort ...Third Element\",data3.myArray[0].key == testArray[2]);\n\n data3.runAlgo(algoUnderTest);\n\n if(algoUnderTest != 0)\n {\n assertTrue(map.get(algoUnderTest)+\" After Sort ...First Element\",data3.myArray[0].key == testArray[0]);\n assertTrue(map.get(algoUnderTest)+\" After Sort ...Second Element\",data3.myArray[1].key == testArray[1]);\n assertTrue(map.get(algoUnderTest)+\" After Sort ...Third Element\",data3.myArray[2].key == testArray[2]);\n }\n else {\n \t assertFalse(map.get(algoUnderTest)+\" After Sort ...First Element\",data3.myArray[0].key == testArray[0]);\n assertFalse(map.get(algoUnderTest)+\" After Sort ...Second Element\",data3.myArray[1].key == testArray[1]);\n assertFalse(map.get(algoUnderTest)+\" After Sort ...Third Element\",data3.myArray[2].key == testArray[2]);\n }\n \n }", "public void sequenceSwaps(int[] tempItem1, int[] tempItem2, Vector<int[]> cyclePosition, int distTotal, Vector<int[]> sequence, int mut_rate){\n boolean b;\n int[] cycles2 = new int[cyclePosition.size()];\n int nrSwaps = 0;\n Arrays.fill(cycles2,-1);\n sequence.clear();\n while(true){\n int j = r.nextInt(cyclePosition.size());\n\n b = false;\n for(int i = 0; i < cycles2.length; i++)\n if(cycles2[i] == -1){\n b = true;\n break;\n }\n if(!b){\n break;\n }\n while(cycles2[j] != -1)\n j = r.nextInt(cyclePosition.size());\n cycles2[j] = 1;\n int[] indexSwap = cyclePosition.elementAt(j).clone();\n int dist = indexSwap.length; //+1;//ps1.getDistance(tempDist1,tempDist2);\n\n //\n int rInt = r.nextInt(indexSwap.length);\n int indexI, indexII;\n \n //tempR.clear();\n for(int i = 0; i < dist-1; i++){\n indexI = tempItem1[indexSwap[rInt]];\n //find indexI in temp2\n indexII = -1;\n for(int k = 0; k < indexSwap.length; k++)\n if(tempItem2[indexSwap[k]] == indexI){\n indexII = indexSwap[k];\n break;\n }\n \n int[] tempInt = new int[2];\n tempInt[0] = indexII;\n tempInt[1] = indexSwap[rInt];\n\n sequence.add(tempInt);\n\n //swaps the two positions\n int temp = tempItem1[indexSwap[rInt]];\n tempItem1[indexSwap[rInt]]=tempItem1[indexII];\n tempItem1[indexII]=temp;\n\n nrSwaps++;\n if(nrSwaps >= mut_rate-1)\n break;\n\n }\n if(nrSwaps >= mut_rate-1)\n break;\n }\n }", "@Test\n public void case3SortTwoElements(){\n //Already sorted array\n SortDemoData data2 = new SortDemoData() ;\n\n int[] testArray = {1,2};\n data2.initializeArray(\"2 1\");\n assertTrue(map.get(algoUnderTest)+\" Before Sort ...First Element\",data2.myArray[1].key == testArray[0]);\n assertTrue(map.get(algoUnderTest)+\" Before Sort ...Second Element\",data2.myArray[0].key == testArray[1]);\n\n data2.runAlgo(algoUnderTest);\n \n if(algoUnderTest != 0)\n {\n assertTrue(map.get(algoUnderTest)+\" After Sort ...First Element\",data2.myArray[0].key == testArray[0]);\n assertTrue(map.get(algoUnderTest)+\" After Sort ...Second Element\",data2.myArray[1].key == testArray[1]);\n }\n \n else {\n \t assertFalse(map.get(algoUnderTest)+\" After Sort ...First Element\",data2.myArray[0].key == testArray[0]);\n assertFalse(map.get(algoUnderTest)+\" After Sort ...Second Element\",data2.myArray[1].key == testArray[1]);\n }\n\n\n }", "public static void swap(int a1, int b1) {\t\t\n\t\tint temp = algorithmThree[a1];\n\t\talgorithmThree[a1] = algorithmThree[b1];\n\t\talgorithmThree[b1] = temp;\n\t}", "private static <T> void vecswap(byte x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "protected void exchange(int i, int j)\n {\n Key t = pq[i];\n pq[i] = pq[j];\n pq[j] = t;\n }", "private int m3423z(int i, int i2) {\n int i3;\n int i4;\n for (int size = this.f4373c.size() - 1; size >= 0; size--) {\n C0933b bVar = this.f4373c.get(size);\n int i5 = bVar.f4379a;\n if (i5 == 8) {\n int i6 = bVar.f4380b;\n int i7 = bVar.f4382d;\n if (i6 < i7) {\n i4 = i6;\n i3 = i7;\n } else {\n i3 = i6;\n i4 = i7;\n }\n if (i < i4 || i > i3) {\n if (i < i6) {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n bVar.f4382d = i7 - 1;\n }\n }\n } else if (i4 == i6) {\n if (i2 == 1) {\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4382d = i7 - 1;\n }\n i++;\n } else {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n }\n i--;\n }\n } else {\n int i8 = bVar.f4380b;\n if (i8 <= i) {\n if (i5 == 1) {\n i -= bVar.f4382d;\n } else if (i5 == 2) {\n i += bVar.f4382d;\n }\n } else if (i2 == 1) {\n bVar.f4380b = i8 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i8 - 1;\n }\n }\n }\n for (int size2 = this.f4373c.size() - 1; size2 >= 0; size2--) {\n C0933b bVar2 = this.f4373c.get(size2);\n if (bVar2.f4379a == 8) {\n int i9 = bVar2.f4382d;\n if (i9 == bVar2.f4380b || i9 < 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n } else if (bVar2.f4382d <= 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n }\n return i;\n }", "private static <T> void vecswap(int x[], double[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "private static void doCase4(final double[] s, final int k, final NegateColumn q2NegCol, final ExchangeColumns q1XchgCols,\n final ExchangeColumns q2XchgCols) {\n if (s[k] <= ZERO) {\n s[k] = s[k] < ZERO ? -s[k] : ZERO;\n q2NegCol.negateColumn(k);\n }\n\n final int size = s.length;\n double tmp;\n\n // Order the singular values.\n for (int iter = k, next = iter + 1; next < size && s[iter] < s[next]; iter++, next++) {\n\n tmp = s[iter];\n s[iter] = s[next];\n s[next] = tmp;\n\n q1XchgCols.exchangeColumns(iter, next);\n q2XchgCols.exchangeColumns(iter, next);\n }\n }", "private void swap(int i, int j) {\n\t\tlong temp = a[i];\n\t\ta[i] = a[j];\n\t\ta[j] = temp;\n\t}", "public void optSwap(int firsts, int firste, int firstv, int seconds, int seconde, int secondv) {\n\t\tfor (int i=firsts; i<= firste; i++){\n\t\t\tfor (int j=seconds; j<= seconde; j++) {\n\t\t\t\tif ( valid(i) && valid(j) && (input[i] == secondv) && (input[j] == firstv) ) {\n\t\t\t\t\tswapIt(i, j);\n\t\t\t\t\tres++;//res = res + 1 for each success swap\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void snapshot\n (int[] i, int i0, int i1, long[] V) {\n int I = i.length;\n long[] va = V;\n long[] vb = new long[I];\n long[] ta = new long[I];\n long[] tb = new long[I];\n do {\n collectTags(i, i0, i1, ta);\n collectValues(i, i0, i1, va);\n collectValues(i, i0, i1, vb);\n collectTags(i, i0, i1, tb);\n } while(\n Arrays.compare(ta, i0, i1, tb, i0, i1) != 0 ||\n Arrays.compare(va, i0, i1, vb, i0, i1) != 0\n );\n }", "private void swap(int firstIdx, int secondIdx) {\r\n // TODO\r\n }", "private static void vecswap(double x[], int[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "@Override\n protected void runAlgorithm() {\n for (int i = 0; i < getArray().length; i++) {\n for (int j = i + 1; j < getArray().length; j++) {\n if (applySortingOperator(getValue(j), getValue(i))) {\n swap(i, j);\n }\n }\n }\n }", "private void compareSecondPass() {\n final int arraySize = this.oldFileNoMatch.size()\r\n + this.newFileNoMatch.size();\r\n this.compareArray = new SubsetElement[arraySize][2];\r\n final Iterator<String> oldIter = this.oldFileNoMatch.keySet()\r\n .iterator();\r\n int i = 0;\r\n while (oldIter.hasNext()) {\r\n final String key = oldIter.next();\r\n final SubsetElement oldElement = this.oldFileNoMatch.get(key);\r\n SubsetElement newElement = null;\r\n if (this.newFileNoMatch.containsKey(key)) {\r\n newElement = this.newFileNoMatch.get(key);\r\n }\r\n this.compareArray[i][0] = oldElement;\r\n this.compareArray[i][1] = newElement;\r\n i++;\r\n }\r\n // now go through the new elements and check for any that have no match.\r\n // these will be new elements with no corresponding old element\r\n final SubsetElement oldElement = null;\r\n final Iterator<String> newIter = this.newFileNoMatch.keySet()\r\n .iterator();\r\n while (newIter.hasNext()) {\r\n final String key = newIter.next();\r\n if (!this.oldFileNoMatch.containsKey(key)) {\r\n final SubsetElement newElement = this.newFileNoMatch.get(key);\r\n this.compareArray[i][0] = oldElement;\r\n this.compareArray[i][1] = newElement;\r\n i++;\r\n }\r\n\r\n }\r\n\r\n }", "@Test\n\tvoid testSwapPair()\n\t{\n\t\tSystem.out.println(\"test SwapPair\");\n\t\tString[] exp = {\"suruchi\", \"kunal\"};\n\t\toperate.swapPair(p);\n\t\t\n\t\t//act = {\"suruchi\",\"kunal\"}\n\t\tString[] act = {p.getFirst(),p.getSecond()};\n\n\t\t//if equal the pass then test\n\t\tassertArrayEquals(exp, act);\n\t\n\t}", "private static void vecswap(double x[], double[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "private static <T> void vecswap(long x[], T[] a2,int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "private void m3421k(C0933b bVar) {\n int i;\n int i2 = bVar.f4379a;\n if (i2 == 1 || i2 == 8) {\n throw new IllegalArgumentException(\"should not dispatch add or move for pre layout\");\n }\n int z = m3423z(bVar.f4380b, i2);\n int i3 = bVar.f4380b;\n int i4 = bVar.f4379a;\n if (i4 == 2) {\n i = 0;\n } else if (i4 == 4) {\n i = 1;\n } else {\n throw new IllegalArgumentException(\"op should be remove or update.\" + bVar);\n }\n int i5 = 1;\n for (int i6 = 1; i6 < bVar.f4382d; i6++) {\n int z2 = m3423z(bVar.f4380b + (i * i6), bVar.f4379a);\n int i7 = bVar.f4379a;\n if (i7 == 2 ? z2 == z : i7 == 4 && z2 == z + 1) {\n i5++;\n } else {\n C0933b b = mo7621b(i7, z, i5, bVar.f4381c);\n mo7625l(b, i3);\n mo7620a(b);\n if (bVar.f4379a == 4) {\n i3 += i5;\n }\n z = z2;\n i5 = 1;\n }\n }\n Object obj = bVar.f4381c;\n mo7620a(bVar);\n if (i5 > 0) {\n C0933b b2 = mo7621b(bVar.f4379a, z, i5, obj);\n mo7625l(b2, i3);\n mo7620a(b2);\n }\n }", "private static int[] greedyAssign(double[][] array, int[] assignment, int chunk_size) {\n\n\t\tint[] jToi = new int[chunk_size];\n\t\tArrays.fill(assignment, -1);\n\t\tArrays.fill(jToi, -1);\n\t\tfor (int i=0; i<edge_size; i++){\n\t\t\tHeapNode node = (HeapNode) edges[i];\n\t\t\tif (assignment[node.getI()]==-1 && jToi[node.getJ()]==-1){\n\t\t\t\tassignment[node.getI()]=node.getJ();\n\t\t\t\tjToi[node.getJ()]=node.getI();\n\t\t\t}\n\t\t}\n\t\t//long backtrace_start = System.currentTimeMillis();\n\t\tfor (int index = 0; index<chunk_size; index++){\n\t\t\tboolean swap_done = false;\n\t\t\tif (assignment[index]==-1){\n\t\t\t\tSystem.out.println(index);\n\t\t\t\tfor (int step=1; step<chunk_size/2; step++){\n\t\t\t\t\tint possible_i = (chunk_size+index-step)%chunk_size;\n\t\t\t\t\tint possible_j = assignment[possible_i];\n\t\t\t\t\tif (possible_j != -1){\n\t\t\t\t\t\tif (array[index][possible_j]!=BIG){\n\t\t\t\t\t\t\tfor (int l=0; l<chunk_size; l++){\n\t\t\t\t\t\t\t\tif (jToi[l]==-1 && array[possible_i][l]!=BIG){\n\t\t\t\t\t\t\t\t\tassignment[index]=possible_j;\n\t\t\t\t\t\t\t\t\tassignment[possible_i]=l;\n\t\t\t\t\t\t\t\t\tjToi[l]=possible_i;\n\t\t\t\t\t\t\t\t\tjToi[possible_j]=index;\n\t\t\t\t\t\t\t\t\tswap_done = true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/*for (int step2 = 1; step2<chunk_size/2; step2++){\n\t\t\t\t\t\t\t int l = (chunk_size+possible_j-step2)%chunk_size;\n\n\t\t\t\t\t\t\t if (jToi[l]==-1 && array[possible_i][l]!=BIG){\n\t\t\t\t\t\t\t assignment[index]=possible_j;\n\t\t\t\t\t\t\t assignment[possible_i]=l;\n\t\t\t\t\t\t\t jToi[l]=possible_i;\n\t\t\t\t\t\t\t jToi[possible_j]=index;\n\t\t\t\t\t\t\t swap_done = true;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t l=(possible_j+step2)%chunk_size;\n\t\t\t\t\t\t\t if (jToi[l]==-1 && array[possible_i][l]!=BIG){\n\t\t\t\t\t\t\t assignment[index]=possible_j;\n\t\t\t\t\t\t\t assignment[possible_i]=l;\n\t\t\t\t\t\t\t jToi[l]=possible_i;\n\t\t\t\t\t\t\t jToi[possible_j]=index;\n\t\t\t\t\t\t\t swap_done = true;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t }\t*/\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (swap_done)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse {\n\t\t\t\t\t\tpossible_i = (index+step)%chunk_size;\n\t\t\t\t\t\tpossible_j = assignment[possible_i];\n\t\t\t\t\t\tif (possible_j != -1){\n\t\t\t\t\t\t\tif (array[index][possible_j]!=BIG){\n\t\t\t\t\t\t\t\tfor (int l=0; l<chunk_size; l++){\n\t\t\t\t\t\t\t\t\tif (jToi[l]==-1 && array[possible_i][l]!=BIG){\n\t\t\t\t\t\t\t\t\t\tassignment[index]=possible_j;\n\t\t\t\t\t\t\t\t\t\tassignment[possible_i]=l;\n\t\t\t\t\t\t\t\t\t\tjToi[l]=possible_i;\n\t\t\t\t\t\t\t\t\t\tjToi[possible_j]=index;\n\t\t\t\t\t\t\t\t\t\tswap_done = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/*for (int step2 = 1; step2<chunk_size/2; step2++){\n\t\t\t\t\t\t\t\t int l = (chunk_size+possible_j-step2)%chunk_size;\n\n\t\t\t\t\t\t\t\t if (jToi[l]==-1 && array[possible_i][l]!=BIG){\n\t\t\t\t\t\t\t\t assignment[index]=possible_j;\n\t\t\t\t\t\t\t\t assignment[possible_i]=l;\n\t\t\t\t\t\t\t\t jToi[l]=possible_i;\n\t\t\t\t\t\t\t\t jToi[possible_j]=index;\n\t\t\t\t\t\t\t\t swap_done = true;\n\t\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t l=(possible_j+step2)%chunk_size;\n\t\t\t\t\t\t\t\t if (jToi[l]==-1 && array[possible_i][l]!=BIG){\n\t\t\t\t\t\t\t\t assignment[index]=possible_j;\n\t\t\t\t\t\t\t\t assignment[possible_i]=l;\n\t\t\t\t\t\t\t\t jToi[l]=possible_i;\n\t\t\t\t\t\t\t\t jToi[possible_j]=index;\n\t\t\t\t\t\t\t\t swap_done = true;\n\t\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }*/\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (swap_done)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn assignment;\n\t}", "private void swap(int i, int j) {\n\t\tint tmp = data.get(i);\n\t\tdata.set(i, data.get(j));\n\t\tdata.set(j, tmp);\n\t}", "private static void exchange(int[] A, int i, int j) {\n if(A[i] == A[j]) return;\n\n A[i] = A[i] ^ A[j];\n A[j] = A[i] ^ A[j];\n A[i] = A[i] ^ A[j];\n }", "private static <T> void vecswap(int x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "private static <T> void vecswap(float x[],T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "@Test\n public void Test2x2Swaps()\n {\n AssertSwappedBitSetIs(StringToBitSet(\"1011\"), 0, 1, \"1101\", 2);\n }", "@Test\n public void testSwapFirstTwo() {\n setUpCorrect();\n assertEquals(1, ((Board) boardManager.getBoard()).getTile(0, 0).getId());\n assertEquals(2, ((Board) boardManager.getBoard()).getTile(0, 1).getId());\n ((Board) boardManager.getBoard()).swapTiles(0, 0, 0, 1);\n assertEquals(2, ((Board) boardManager.getBoard()).getTile(0, 0).getId());\n assertEquals(1, ((Board) boardManager.getBoard()).getTile(0, 1).getId());\n }", "private static void vecswap(int x[], int[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "@Test\n public void case4SortSameSequence(){\n //Already sorted array\n SortDemoData data2 = new SortDemoData() ;\n\n int[] testArray = {1,2,3};\n data2.initializeArray(\"1 2 3\");\n assertTrue(map.get(algoUnderTest)+\" Before Sort ...First Element\",data2.myArray[0].key == testArray[0]);\n assertTrue(map.get(algoUnderTest)+\" Before Sort ...Second Element\",data2.myArray[1].key == testArray[1]);\n assertTrue(map.get(algoUnderTest)+\" Before Sort ...Third Element\",data2.myArray[2].key == testArray[2]);\n data2.runAlgo(algoUnderTest);\n\n assertTrue(map.get(algoUnderTest)+\" After Sort ...First Element\",data2.myArray[0].key == testArray[0]);\n assertTrue(map.get(algoUnderTest)+\" After Sort ...Second Element\",data2.myArray[1].key == testArray[1]);\n assertTrue(map.get(algoUnderTest)+\" After Sort ...Third Element\",data2.myArray[2].key == testArray[2]);\n\n }", "private static <T> void vecswap(double x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "private static <T,P> void vecswap(T x[], int[] a2,int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "private void backTrack(boolean[] a, int k, int[] input){\n\t\t\n\t\tif (isASolution(a, k, input)){\n\t\t\tprocessSolution(a, k, input);\n\t\t} else {\n\t\t\tboolean[] c = constructCandidates(a, k, input);\n\t\t\tfor(int i = 0; i < c.length; i++){\n\t\t\t\ta[k] = c[i];\n\t\t\t\tbackTrack(a, k + 1, input);\n\t\t\t}\n\t\t}\n\t}", "@Test\r\n public void testSwapFirstTwo() {\r\n int id1 = boardManager4.getBoard().getTile(0,0).getId();\r\n int id2 = boardManager4.getBoard().getTile(0,1).getId();\r\n boardManager4.getBoard().swapTiles(0,0,0,1);\r\n assertEquals(id1, boardManager4.getBoard().getTile(0,1).getId());\r\n assertEquals(id2,boardManager4.getBoard().getTile(0,0).getId());\r\n }", "public boolean swap(int i, int j) {\n lock.lock();\n\t if (value[i] <= 0 || value[j] >= maxval) {\n //Incase the value is out of bounds, we don't want to hold \n //resources\n //Free resources by unlocking the mutex lock\n lock.unlock();\n\t return false;\n\t }\n\t value[i]--;\n value[j]++;\n //Open the lock to mark end of critical section\n lock.unlock();\n\t return true;\n }", "public static boolean swapFirstImprove(ArrayList<City> routine) {\n for (int i = 1; i < routine.size() - 1; i++) {\n for (int j = i + 1; j < routine.size() - 1; j++) {\n double diff = evalSwap(routine, i, j);\n if (diff + 0.00001 < 0) { \n swapCity(routine, i, j);\n //return true;\n }\n }\n }\n return false;\n }", "private int d(@Nullable K ☃) {\r\n/* 127 */ return (xq.f(System.identityHashCode(☃)) & Integer.MAX_VALUE) % this.b.length;\r\n/* */ }\r\n/* */ private int b(@Nullable K ☃, int i) {\r\n/* */ int j;\r\n/* 131 */ for (j = i; j < this.b.length; j++) {\r\n/* 132 */ if (this.b[j] == ☃) {\r\n/* 133 */ return j;\r\n/* */ }\r\n/* 135 */ if (this.b[j] == a) {\r\n/* 136 */ return -1;\r\n/* */ }\r\n/* */ }", "private void testDifferentKValues()\r\n\t{\r\n\t\tLinkedHashMap<Integer, LinkedHashMap<Integer, Double>> energies;\r\n\r\n\t\tif (isEType) {\r\n\t\t\tenergies = ENERGIES_E;\r\n\t\t} else {\r\n\t\t\tenergies = ENERGIES_A;\r\n\t\t}\r\n\r\n\t\tfor (Map.Entry<Integer, LinkedHashMap<Integer, Double>> entry : energies.entrySet()) {\r\n\t\t\t\r\n\t\t\titerationsGoneThrough++;\r\n\t\t\tint percent = (int) ((iterationsGoneThrough / numberOfKIterations) * 80 + 20);\r\n\t\t\tmultiThreadingObj.myPublish(\"msg Generating assignments: \" + percent + \"%\");\r\n\t\t\tmultiThreadingObj.myPublish(\"val \" + percent);\r\n\t\t\t\r\n\t\t\tcurrentK = entry.getKey();\r\n\t\t\tenergiesForCurrentK = entry.getValue();\r\n\t\t\t\r\n\t\t\ttestDifferentJRangesForConstantK();\r\n\t\t}\r\n\t}", "private static <Key extends Comparable<Key> > void swim(Key []a, int k){\n while(k>1 &&less(a, k/2, k)){\n exch(a, k/2, k);\n k=k/2;\n }\n }", "private static <T> void vecswap(short x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "public void compareLeaf(int k){\n\t\twhile(k > 1 && lessThan(k, k/2)){\n\t\t\tString tempKey = queueArray[k/2][0];\n\t\t\tString tempVal = queueArray[k/2][1];\n\t\t\tqueueArray[k/2][0] = queueArray[k][0];\n\t\t\tqueueArray[k/2][1] = queueArray[k][1];\n\t\t\tqueueArray[k][0] = tempKey;\n\t\t\tqueueArray[k][1] = tempVal;\n\t\t\tk = k/2;\n\t\t}\n\t}", "private static void AssertSwappedBitSetIs(BitSet orig, int i, int j, String expected, int numElem)\n {\n BitSet tB = (BitSet)orig.clone();\n FixOrder.Perform2Swap(tB, i, j, numElem);\n assertEquals(String.format(\"swapping %d with %d\", i, j), StringToBitSet(expected), tB);\n }", "public void setSwapArrayElements(int borrowedIndex) \n\t{\n\t\tint localIntHolder = 0; \n\t\tString localStringHolder = \"\";\n\t\tdouble localDoubleHolder = 0.0;\n\n\t\tif(orderTotals[borrowedIndex] > 0.0) \n\t\t{\n\t\t\tlocalIntHolder = itemIDs[borrowedIndex];\n\t\t\titemIDs[borrowedIndex] = itemIDs[borrowedIndex + 1];\n\t\t\titemIDs[borrowedIndex + 1] = localIntHolder;\n\n\t\t\tlocalStringHolder = itemNames[borrowedIndex];\n\t\t\titemNames[borrowedIndex] = itemNames[borrowedIndex + 1];\n\t\t\titemNames[borrowedIndex + 1] = localStringHolder;\n\n\t\t\tlocalDoubleHolder = itemPrices[borrowedIndex];\n\t\t\titemPrices[borrowedIndex] = itemPrices[borrowedIndex + 1];\n\t\t\titemPrices[borrowedIndex + 1] = localDoubleHolder;\n\n\t\t\tlocalIntHolder = orderQuantity[borrowedIndex];\n\t\t\torderQuantity[borrowedIndex] = orderQuantity[borrowedIndex + 1];\n\t\t\torderQuantity[borrowedIndex + 1] = localIntHolder; \n\n\t\t\tlocalDoubleHolder = orderTotals[borrowedIndex];\n\t\t\torderTotals[borrowedIndex] = orderTotals[borrowedIndex + 1];\n\t\t\torderTotals[borrowedIndex + 1] = localDoubleHolder;\n\n\t\t}\n\t\telse \n\t\t{\n\n\t\t\tlocalIntHolder = itemIDs[borrowedIndex];\n\t\t\titemIDs[borrowedIndex] = itemIDs[borrowedIndex + 1];\n\t\t\titemIDs[borrowedIndex + 1] = localIntHolder;\n\n\t\t\tlocalStringHolder = itemNames[borrowedIndex];\n\t\t\titemNames[borrowedIndex] = itemNames[borrowedIndex + 1];\n\t\t\titemNames[borrowedIndex + 1] = localStringHolder;\n\n\t\t\tlocalDoubleHolder = itemPrices[borrowedIndex];\n\t\t\titemPrices[borrowedIndex] = itemPrices[borrowedIndex + 1];\n\t\t\titemPrices[borrowedIndex + 1] = localDoubleHolder;\n\n\t\t\tlocalIntHolder = inStockCounts[borrowedIndex];\n\t\t\tinStockCounts[borrowedIndex] = inStockCounts[borrowedIndex + 1];\n\t\t\tinStockCounts[borrowedIndex + 1] = localIntHolder;\n\t\t}\n\t}", "private static void swap(int[] arr, int i, int j) {\n arr[i] = arr[j]^arr[i]^(arr[j] = arr[i]);\n }", "private static <T> void vecswap(char x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "private void trIntroSort(int r34, int r35, int r36, int r37, int r38, io.netty.handler.codec.compression.Bzip2DivSufSort.TRBudget r39, int r40) {\n /*\n r33 = this;\n r0 = r33;\n r0 = r0.SA;\n r16 = r0;\n r4 = 64;\n r0 = new io.netty.handler.codec.compression.Bzip2DivSufSort.StackEntry[r4];\n r29 = r0;\n r32 = 0;\n r27 = 0;\n r4 = r38 - r37;\n r22 = trLog(r4);\n r28 = r27;\n r23 = r22;\n L_0x001a:\n if (r23 >= 0) goto L_0x02b6;\n L_0x001c:\n r4 = -1;\n r0 = r23;\n if (r0 != r4) goto L_0x01a4;\n L_0x0021:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 != 0) goto L_0x0050;\n L_0x002d:\n r22 = r23;\n L_0x002f:\n r26 = 0;\n L_0x0031:\n r0 = r26;\n r1 = r28;\n if (r0 >= r1) goto L_0x072a;\n L_0x0037:\n r4 = r29[r26];\n r4 = r4.d;\n r5 = -3;\n if (r4 != r5) goto L_0x004d;\n L_0x003e:\n r4 = r29[r26];\n r4 = r4.b;\n r5 = r29[r26];\n r5 = r5.c;\n r0 = r33;\n r1 = r34;\n r0.lsUpdateGroup(r1, r4, r5);\n L_0x004d:\n r26 = r26 + 1;\n goto L_0x0031;\n L_0x0050:\n r6 = r35 + -1;\n r10 = r38 + -1;\n r4 = r33;\n r5 = r34;\n r7 = r36;\n r8 = r37;\n r9 = r38;\n r25 = r4.trPartition(r5, r6, r7, r8, r9, r10);\n r0 = r25;\n r8 = r0.first;\n r0 = r25;\n r9 = r0.last;\n r0 = r37;\n if (r0 < r8) goto L_0x0072;\n L_0x006e:\n r0 = r38;\n if (r9 >= r0) goto L_0x016d;\n L_0x0072:\n r0 = r38;\n if (r8 >= r0) goto L_0x0087;\n L_0x0076:\n r17 = r37;\n r31 = r8 + -1;\n L_0x007a:\n r0 = r17;\n if (r0 >= r8) goto L_0x0087;\n L_0x007e:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x007a;\n L_0x0087:\n r0 = r38;\n if (r9 >= r0) goto L_0x009c;\n L_0x008b:\n r17 = r8;\n r31 = r9 + -1;\n L_0x008f:\n r0 = r17;\n if (r0 >= r9) goto L_0x009c;\n L_0x0093:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x008f;\n L_0x009c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = 0;\n r6 = 0;\n r4.<init>(r5, r8, r9, r6);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + -1;\n r6 = -2;\n r0 = r37;\n r1 = r38;\n r4.<init>(r5, r0, r1, r6);\n r29[r27] = r4;\n r4 = r8 - r37;\n r5 = r38 - r9;\n if (r4 > r5) goto L_0x0117;\n L_0x00bd:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x00e3;\n L_0x00c2:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r38 - r9;\n r5 = trLog(r5);\n r0 = r35;\n r1 = r38;\n r4.<init>(r0, r9, r1, r5);\n r29[r28] = r4;\n r38 = r8;\n r4 = r8 - r37;\n r22 = trLog(r4);\n L_0x00dd:\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x00e3:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x00f3;\n L_0x00e8:\n r37 = r9;\n r4 = r38 - r9;\n r22 = trLog(r4);\n r27 = r28;\n goto L_0x00dd;\n L_0x00f3:\n if (r28 != 0) goto L_0x00fa;\n L_0x00f5:\n r27 = r28;\n r22 = r23;\n L_0x00f9:\n return;\n L_0x00fa:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x0117:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0138;\n L_0x011c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r8 - r37;\n r5 = trLog(r5);\n r0 = r35;\n r1 = r37;\n r4.<init>(r0, r1, r8, r5);\n r29[r28] = r4;\n r37 = r9;\n r4 = r38 - r9;\n r22 = trLog(r4);\n goto L_0x00dd;\n L_0x0138:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x0148;\n L_0x013d:\n r38 = r8;\n r4 = r8 - r37;\n r22 = trLog(r4);\n r27 = r28;\n goto L_0x00dd;\n L_0x0148:\n if (r28 != 0) goto L_0x014f;\n L_0x014a:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x014f:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x016d:\n r17 = r37;\n L_0x016f:\n r0 = r17;\n r1 = r38;\n if (r0 >= r1) goto L_0x017e;\n L_0x0175:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r17;\n r17 = r17 + 1;\n goto L_0x016f;\n L_0x017e:\n if (r28 != 0) goto L_0x0186;\n L_0x0180:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x0186:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x01a4:\n r4 = -2;\n r0 = r23;\n if (r0 != r4) goto L_0x01ea;\n L_0x01a9:\n r27 = r28 + -1;\n r4 = r29[r27];\n r8 = r4.b;\n r4 = r29[r27];\n r9 = r4.c;\n r11 = r35 - r34;\n r4 = r33;\n r5 = r34;\n r6 = r36;\n r7 = r37;\n r10 = r38;\n r4.trCopy(r5, r6, r7, r8, r9, r10, r11);\n if (r27 != 0) goto L_0x01c8;\n L_0x01c4:\n r22 = r23;\n goto L_0x00f9;\n L_0x01c8:\n r27 = r27 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x01ea:\n r4 = r16[r37];\n if (r4 < 0) goto L_0x0202;\n L_0x01ee:\n r8 = r37;\n L_0x01f0:\n r4 = r16[r8];\n r4 = r4 + r34;\n r16[r4] = r8;\n r8 = r8 + 1;\n r0 = r38;\n if (r8 >= r0) goto L_0x0200;\n L_0x01fc:\n r4 = r16[r8];\n if (r4 >= 0) goto L_0x01f0;\n L_0x0200:\n r37 = r8;\n L_0x0202:\n r0 = r37;\n r1 = r38;\n if (r0 >= r1) goto L_0x028c;\n L_0x0208:\n r8 = r37;\n L_0x020a:\n r4 = r16[r8];\n r4 = r4 ^ -1;\n r16[r8] = r4;\n r8 = r8 + 1;\n r4 = r16[r8];\n if (r4 < 0) goto L_0x020a;\n L_0x0216:\n r4 = r16[r8];\n r4 = r4 + r34;\n r4 = r16[r4];\n r5 = r16[r8];\n r5 = r5 + r35;\n r5 = r16[r5];\n if (r4 == r5) goto L_0x0241;\n L_0x0224:\n r4 = r8 - r37;\n r4 = r4 + 1;\n r24 = trLog(r4);\n L_0x022c:\n r8 = r8 + 1;\n r0 = r38;\n if (r8 >= r0) goto L_0x0244;\n L_0x0232:\n r9 = r37;\n r31 = r8 + -1;\n L_0x0236:\n if (r9 >= r8) goto L_0x0244;\n L_0x0238:\n r4 = r16[r9];\n r4 = r4 + r34;\n r16[r4] = r31;\n r9 = r9 + 1;\n goto L_0x0236;\n L_0x0241:\n r24 = -1;\n goto L_0x022c;\n L_0x0244:\n r4 = r8 - r37;\n r5 = r38 - r8;\n if (r4 > r5) goto L_0x0264;\n L_0x024a:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = -3;\n r0 = r35;\n r1 = r38;\n r4.<init>(r0, r8, r1, r5);\n r29[r28] = r4;\n r35 = r35 + 1;\n r38 = r8;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0264:\n r4 = 1;\n r5 = r38 - r8;\n if (r4 >= r5) goto L_0x0282;\n L_0x0269:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r37;\n r1 = r24;\n r4.<init>(r5, r0, r8, r1);\n r29[r28] = r4;\n r37 = r8;\n r22 = -3;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0282:\n r35 = r35 + 1;\n r38 = r8;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x028c:\n if (r28 != 0) goto L_0x0294;\n L_0x028e:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x0294:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x02b6:\n r4 = r38 - r37;\n r5 = 8;\n if (r4 > r5) goto L_0x02d5;\n L_0x02bc:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 != 0) goto L_0x02cc;\n L_0x02c8:\n r22 = r23;\n goto L_0x002f;\n L_0x02cc:\n r33.trInsertionSort(r34, r35, r36, r37, r38);\n r22 = -3;\n r23 = r22;\n goto L_0x001a;\n L_0x02d5:\n r22 = r23 + -1;\n if (r23 != 0) goto L_0x0331;\n L_0x02d9:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 == 0) goto L_0x002f;\n L_0x02e5:\n r15 = r38 - r37;\n r10 = r33;\n r11 = r34;\n r12 = r35;\n r13 = r36;\n r14 = r37;\n r10.trHeapSort(r11, r12, r13, r14, r15);\n r8 = r38 + -1;\n L_0x02f6:\n r0 = r37;\n if (r0 >= r8) goto L_0x032b;\n L_0x02fa:\n r4 = r16[r8];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r9 = r8 + -1;\n L_0x030a:\n r0 = r37;\n if (r0 > r9) goto L_0x0329;\n L_0x030e:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r4 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n if (r4 != r0) goto L_0x0329;\n L_0x0320:\n r4 = r16[r9];\n r4 = r4 ^ -1;\n r16[r9] = r4;\n r9 = r9 + -1;\n goto L_0x030a;\n L_0x0329:\n r8 = r9;\n goto L_0x02f6;\n L_0x032b:\n r22 = -3;\n r23 = r22;\n goto L_0x001a;\n L_0x0331:\n r8 = r33.trPivot(r34, r35, r36, r37, r38);\n r0 = r16;\n r1 = r37;\n r2 = r16;\n swapElements(r0, r1, r2, r8);\n r4 = r16[r37];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r31 = r0.trGetC(r1, r2, r3, r4);\n r9 = r37 + 1;\n L_0x034e:\n r0 = r38;\n if (r9 >= r0) goto L_0x0369;\n L_0x0352:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0369;\n L_0x0366:\n r9 = r9 + 1;\n goto L_0x034e;\n L_0x0369:\n r8 = r9;\n r0 = r38;\n if (r9 >= r0) goto L_0x039e;\n L_0x036e:\n r0 = r32;\n r1 = r31;\n if (r0 >= r1) goto L_0x039e;\n L_0x0374:\n r9 = r9 + 1;\n r0 = r38;\n if (r9 >= r0) goto L_0x039e;\n L_0x037a:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 > r1) goto L_0x039e;\n L_0x038e:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0374;\n L_0x0394:\n r0 = r16;\n r1 = r16;\n swapElements(r0, r9, r1, r8);\n r8 = r8 + 1;\n goto L_0x0374;\n L_0x039e:\n r17 = r38 + -1;\n L_0x03a0:\n r0 = r17;\n if (r9 >= r0) goto L_0x03bb;\n L_0x03a4:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x03bb;\n L_0x03b8:\n r17 = r17 + -1;\n goto L_0x03a0;\n L_0x03bb:\n r18 = r17;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x03c1:\n r0 = r32;\n r1 = r31;\n if (r0 <= r1) goto L_0x03f5;\n L_0x03c7:\n r17 = r17 + -1;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x03cd:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 < r1) goto L_0x03f5;\n L_0x03e1:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x03c7;\n L_0x03e7:\n r0 = r16;\n r1 = r17;\n r2 = r16;\n r3 = r18;\n swapElements(r0, r1, r2, r3);\n r18 = r18 + -1;\n goto L_0x03c7;\n L_0x03f5:\n r0 = r17;\n if (r9 >= r0) goto L_0x045a;\n L_0x03f9:\n r0 = r16;\n r1 = r16;\n r2 = r17;\n swapElements(r0, r9, r1, r2);\n L_0x0402:\n r9 = r9 + 1;\n r0 = r17;\n if (r9 >= r0) goto L_0x042c;\n L_0x0408:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 > r1) goto L_0x042c;\n L_0x041c:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0402;\n L_0x0422:\n r0 = r16;\n r1 = r16;\n swapElements(r0, r9, r1, r8);\n r8 = r8 + 1;\n goto L_0x0402;\n L_0x042c:\n r17 = r17 + -1;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x0432:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 < r1) goto L_0x03f5;\n L_0x0446:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x042c;\n L_0x044c:\n r0 = r16;\n r1 = r17;\n r2 = r16;\n r3 = r18;\n swapElements(r0, r1, r2, r3);\n r18 = r18 + -1;\n goto L_0x042c;\n L_0x045a:\n r0 = r18;\n if (r8 > r0) goto L_0x0716;\n L_0x045e:\n r17 = r9 + -1;\n r26 = r8 - r37;\n r30 = r9 - r8;\n r0 = r26;\n r1 = r30;\n if (r0 <= r1) goto L_0x046c;\n L_0x046a:\n r26 = r30;\n L_0x046c:\n r19 = r37;\n r21 = r9 - r26;\n L_0x0470:\n if (r26 <= 0) goto L_0x0484;\n L_0x0472:\n r0 = r16;\n r1 = r19;\n r2 = r16;\n r3 = r21;\n swapElements(r0, r1, r2, r3);\n r26 = r26 + -1;\n r19 = r19 + 1;\n r21 = r21 + 1;\n goto L_0x0470;\n L_0x0484:\n r26 = r18 - r17;\n r4 = r38 - r18;\n r30 = r4 + -1;\n r0 = r26;\n r1 = r30;\n if (r0 <= r1) goto L_0x0492;\n L_0x0490:\n r26 = r30;\n L_0x0492:\n r19 = r9;\n r21 = r38 - r26;\n L_0x0496:\n if (r26 <= 0) goto L_0x04aa;\n L_0x0498:\n r0 = r16;\n r1 = r19;\n r2 = r16;\n r3 = r21;\n swapElements(r0, r1, r2, r3);\n r26 = r26 + -1;\n r19 = r19 + 1;\n r21 = r21 + 1;\n goto L_0x0496;\n L_0x04aa:\n r4 = r9 - r8;\n r8 = r37 + r4;\n r4 = r18 - r17;\n r9 = r38 - r4;\n r4 = r16[r8];\n r4 = r4 + r34;\n r4 = r16[r4];\n r0 = r31;\n if (r4 == r0) goto L_0x04d3;\n L_0x04bc:\n r4 = r9 - r8;\n r24 = trLog(r4);\n L_0x04c2:\n r17 = r37;\n r31 = r8 + -1;\n L_0x04c6:\n r0 = r17;\n if (r0 >= r8) goto L_0x04d6;\n L_0x04ca:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x04c6;\n L_0x04d3:\n r24 = -1;\n goto L_0x04c2;\n L_0x04d6:\n r0 = r38;\n if (r9 >= r0) goto L_0x04eb;\n L_0x04da:\n r17 = r8;\n r31 = r9 + -1;\n L_0x04de:\n r0 = r17;\n if (r0 >= r9) goto L_0x04eb;\n L_0x04e2:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x04de;\n L_0x04eb:\n r4 = r8 - r37;\n r5 = r38 - r9;\n if (r4 > r5) goto L_0x060c;\n L_0x04f1:\n r4 = r38 - r9;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x0571;\n L_0x04f7:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x051e;\n L_0x04fc:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r27] = r4;\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x051e:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0538;\n L_0x0523:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r37 = r9;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0538:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x0549;\n L_0x053d:\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x0549:\n if (r28 != 0) goto L_0x054f;\n L_0x054b:\n r27 = r28;\n goto L_0x00f9;\n L_0x054f:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0571:\n r4 = r8 - r37;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x05c6;\n L_0x0577:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x059e;\n L_0x057c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r27] = r4;\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x059e:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x05c0;\n L_0x05a3:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x05c0:\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x05c6:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x05f5;\n L_0x05cb:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r27] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x05f5:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r38 = r8;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x060c:\n r4 = r8 - r37;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x067b;\n L_0x0612:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0639;\n L_0x0617:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r27] = r4;\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x0639:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x0653;\n L_0x063e:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r38 = r8;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0653:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x0664;\n L_0x0658:\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x0664:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r38;\n r3 = r22;\n r4.<init>(r0, r1, r2, r3);\n r29[r28] = r4;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x067b:\n r4 = r38 - r9;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x06d0;\n L_0x0681:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x06a8;\n L_0x0686:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r27] = r4;\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x06a8:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x06ca;\n L_0x06ad:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x06ca:\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x06d0:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x06ff;\n L_0x06d5:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r27] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x06ff:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r37 = r9;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0716:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 == 0) goto L_0x002f;\n L_0x0722:\n r22 = r22 + 1;\n r35 = r35 + 1;\n r23 = r22;\n goto L_0x001a;\n L_0x072a:\n r27 = r28;\n goto L_0x00f9;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.netty.handler.codec.compression.Bzip2DivSufSort.trIntroSort(int, int, int, int, int, io.netty.handler.codec.compression.Bzip2DivSufSort$TRBudget, int):void\");\n }", "@Override\n \tpublic void swap(int i, int j) {\n \t\tint t=data[i];\n \t\tdata[i]=data[j];\n \t\tdata[j]=t;\n \t}", "@Test\n public void reuseKeys() throws Exception {\n VolatileLookUpTable.Builder<IntOption> builder = new VolatileLookUpTable.Builder<>();\n LookUpKey key = key();\n\n key.add(new IntOption(100));\n builder.add(key, new IntOption(100));\n key.reset();\n\n key.add(new IntOption(101));\n builder.add(key, new IntOption(101));\n key.reset();\n\n key.add(new IntOption(102));\n builder.add(key, new IntOption(102));\n key.reset();\n\n LookUpTable<IntOption> table = builder.build();\n assertThat(sort(table.get(key(100))), is(values(100)));\n assertThat(sort(table.get(key(101))), is(values(101)));\n assertThat(sort(table.get(key(102))), is(values(102)));\n }", "public void swapRows(int i1,int i2){\n\t\tint n = length();\n\t\tif (i1 < 0 || i1 >= n || i2 < 0 || i2 >= n) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tfor (int k = 0; k < n; k++) {\n\t\t\tdouble c = get(i1, k);\n\t\t\tset(i1, k, get(i2, k));\n\t\t\tset(i2, k, c);\n\t\t}\n\t}", "private void swap(int i, int j){\n \t\tint temp = a[i];\n \t\ta[i] = a[j];\n \t\ta[j] = temp;\n }", "private void swapAt(int i, int j) {\n\t\tfloat tmp = sequence[i];\n\t\tsequence[i] = sequence[j];\n\t\tsequence[j] = tmp;\n\t}", "private static void vecswap(char x[], char[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "private void runWrongUpdateTask2(BdbMapDao<BytesValue> dbLock,\n BdbMapDao<Blog.BlogEntry> blogEntryDao,\n ByteString key,\n AtomicInteger conflictCount) throws InterruptedException {\n for (int i = 0; i < execTimes; ++i) {\n\n // Optimistic lock, still causes a lot of contention\n boolean wasSuccessful = false;\n\n for (int retries = 0; retries < MAX_RETRIES; ++retries) {\n // [1] acquire record\n BytesValue lock = dbLock.get(null, key, () -> null);\n if (lock == null) { // does somebody acquired this record before?\n // ok - version is empty, looks like we are the ones who acquired it first\n // NOTE: we need big endian representation of long here!\n final ByteString versionKey = ByteString.copyFrom(Longs.toByteArray(versionId.incrementAndGet()));\n\n // [2] assign update version\n dbLock.put(null, key, BytesValue.newBuilder().setValue(versionKey).build());\n\n // [3] retrieve version once more, duplicates should be disregarded\n lock = dbLock.get(null, key, () -> null);\n if (lock != null && lock.getValue().equals(versionKey)) {\n // [4] same version, proceed with the update\n final Blog.BlogEntry original = blogEntryDao.get(null, key);\n blogEntryDao.put(null, key, Blog.BlogEntry.newBuilder(original)\n .setLikes(original.getLikes() + 1)\n .build());\n\n // [5] clear lock versions\n dbLock.delete(null, key);\n wasSuccessful = true;\n break;\n }\n }\n conflictCount.incrementAndGet(); // CAS failed, do it all over again\n } // optimistic lock retry loop\n\n if (!wasSuccessful) {\n throw new IllegalStateException();\n }\n }\n }", "private boolean cknows(int i, int j) {\n String key = i + \",\" + j;\n if (this.cache.containsKey(key))\n return this.cache.get(key);\n Boolean ans = knows(i, j);\n this.cache.put(key, ans);\n return ans.booleanValue();\n }", "static int minimumSwaps2(int[] arr) {\n Map<Integer, Integer> backward = new HashMap<>();\n Map<Integer, Integer> forward = new HashMap<>();\n for (int i = 0; i < arr.length; i++) {\n int move = i + 1 - arr[i];\n if (move > 0)\n forward.put(arr[i], move);\n else if (move < 0)\n backward.put(arr[i], move);\n }\n\n //count swap in pairs\n int pairs = 0;\n for (Integer bk : backward.keySet()) {\n for (Integer fk : forward.keySet()) {\n if (backward.get(bk) * (-1) == forward.get(fk)) {\n pairs = pairs + 1;\n continue;\n }\n }\n }\n //count swap others\n int swapCount = forward.size() + backward.size() - (2 * pairs);\n if (swapCount > 0) swapCount = swapCount - 1;\n\n System.out.println(String.format(\n \"forward(%d):%s\\nbackeward(%d):%s\\neach: %d, swap: %d\"\n , forward.size(), forward, backward.size(), backward,\n pairs, swapCount\n ));\n\n return swapCount + pairs;\n }", "private void exchange(int i, int j){\n\t\tnode_data t = _a[i];\n\t\t_a[i] = _a[j];\n\t\t_a[j] = t;\n\t}", "@Test\n public void testSameKeyAccessDiffCacheMultiRollingRestart()\n {\n doStressTest(\"IdxTestSKADCMRR\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/3, /*cRollingRestart*/5);\n }", "@Test\n public void testSameKeyAccessDiffCache()\n {\n doStressTest(\"IdxTestSKADC\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/1, /*cRollingRestart*/0);\n }", "private static <T,P> void vecswap(T x[], P[] a2,int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "public void replaceKeyInEntry(int i, @NullableDecl K k, boolean z) {\n int i2;\n int i3;\n Preconditions.checkArgument(i != -1);\n int smearedHash = Hashing.smearedHash(k);\n int findEntryByKey = findEntryByKey(k, smearedHash);\n int i4 = this.lastInInsertionOrder;\n if (findEntryByKey == -1) {\n i2 = i4;\n i3 = -2;\n } else if (z) {\n i2 = this.prevInInsertionOrder[findEntryByKey];\n i3 = this.nextInInsertionOrder[findEntryByKey];\n removeEntryKeyHashKnown(findEntryByKey, smearedHash);\n if (i == this.size) {\n i = findEntryByKey;\n }\n } else {\n throw new IllegalArgumentException(\"Key already present in map: \" + k);\n }\n if (i2 == i) {\n i2 = this.prevInInsertionOrder[i];\n } else if (i2 == this.size) {\n i2 = findEntryByKey;\n }\n if (i3 == i) {\n findEntryByKey = this.nextInInsertionOrder[i];\n } else if (i3 != this.size) {\n findEntryByKey = i3;\n }\n setSucceeds(this.prevInInsertionOrder[i], this.nextInInsertionOrder[i]);\n deleteFromTableKToV(i, Hashing.smearedHash(this.keys[i]));\n this.keys[i] = k;\n insertIntoTableKToV(i, Hashing.smearedHash(k));\n setSucceeds(i2, i);\n setSucceeds(i, findEntryByKey);\n }", "public void flipIndexes() {\n int temp = index1;\n index1 = index2;\n index2 = temp;\n }", "private BDD reachableStates(BDD i, BDD t, BDD x, Map<Integer, Integer> renaming){\n\t\tSystem.out.println(\"\\n\" + \"[*] Computing reachable states\" + \"\\n\");\n\n\t\tBDD result = this.factory.makeZero();\n\t\tBDD rCopy = null;\n\n\t\tint counter = 1;\n\t\tdo{\n\n\t\t\tSystem.out.println(\" - iteration K = \" + counter++);\n\n\t\t\tif(rCopy != null)\n\t\t\t\trCopy.free();\n\n\t\t\trCopy = result;\t\n\n\t\t\tBDD and = t.and(result);\t\t\t\n\t\t\tBDD exist = and.exist(x);\n\t\t\tand.free();\n\n\t\t\tBDD replace = exist.replace(renaming);\n\t\t\tresult = i.or(replace);\n\n\t\t\treplace.free();\n\n\t\t}while(!result.isEquivalentTo(rCopy));\n\n\t\trCopy.free();\n\n\t\tSystem.out.println(\"\\n\" + \"[*] Done computing reachable states\" + \"\\n\");\n\n\t\treturn result;\n\t}", "public void scramble(){\r\n for (int i = 0; i < data.length / 2; i++){\r\n int randomIndex1 = (int)(Math.random()*(data.length - 1));\r\n int randomIndex2 = (int)(Math.random()*(data.length - 1));\r\n swap(randomIndex1, randomIndex2);\r\n }\r\n }", "private void switchElements(int a, int b) {\r\n\t\tE temp = c[a];\r\n\t\tc[a] = c[b];\r\n\t\tc[b] = temp;\r\n\t}", "@Test\n public void doubleSortWithExchangeUnbalancedNodes() {\n ExternalSort es1 = new ExternalSort(OpProps.prototype(0, Long.MAX_VALUE).cloneWithMemoryExpensive(true).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), ARBTRIARY_LEAF, Collections.emptyList(), false);\n SingleSender ss = new SingleSender(OpProps.prototype(1, Long.MAX_VALUE).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), Mockito.mock(BatchSchema.class), es1, 0,\n MinorFragmentIndexEndpoint.newBuilder().setMinorFragmentId(0).build());\n Fragment f1 = new Fragment();\n f1.addOperator(ss);\n Wrapper w1 = new Wrapper(f1, 0);\n w1.overrideEndpoints(Arrays.asList(N1, N2));\n\n UnorderedReceiver or = new UnorderedReceiver(OpProps.prototype(1, Long.MAX_VALUE), Mockito.mock(BatchSchema.class), 0, Collections.emptyList(), false);\n ExternalSort es2 = new ExternalSort(OpProps.prototype(0, Long.MAX_VALUE).cloneWithMemoryExpensive(true).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), or, Collections.emptyList(), false);\n Fragment f2 = new Fragment();\n f2.addOperator(es2);\n Wrapper w2 = new Wrapper(f2, 0);\n w2.overrideEndpoints(Collections.singletonList(N1));\n\n\n MemoryAllocationUtilities.setMemory(options, ImmutableMap.of(f1, w1, f2, w2), 10 + adjustReserve);\n assertEquals(3L, es1.getProps().getMemLimit());\n assertEquals(3L, es2.getProps().getMemLimit());\n }", "@Override\n protected void swap(int i, int j)\n {\n E temp = this.elements[i];\n this.elements[i] = this.elements[j];\n \tthis.elementsToArrayIndex.put(elements[i], i);\n this.elements[j] = temp;\n \tthis.elementsToArrayIndex.put(elements[j], j);\n }", "void swap() {\n\t\tint remain_singles = this.d - this.couples_found;\n\t\tfor (int pit_id = 0; pit_id < remain_singles; pit_id++) {\n\t\t\tint dancer_id = findDancer(pit_id);\n\t\t\tif(dancers[dancer_id].soulmate != -1) continue;\n\t\t\tint next_pit = getNextPit(pit_id);\n\t\t\tif(next_pit == -1){\n\t\t\t\tdancers[dancer_id].next_pos = new Point(pits[pit_id].pos.x, pits[pit_id].pos.y);\n\t\t\t\tdancers[dancer_id].pit_id = pit_id;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdancers[dancer_id].next_pos = findNearestActualPoint(pits[next_pit].pos, pits[pit_id].pos);\n\t\t\t\tdancers[dancer_id].pit_id = next_pit;\n\t\t\t}\n\t\t}\n \t\tthis.state = 3 - this.state;\n \t\tthis.stay = 0;\n\t}", "private int compareExecute(int i) {\r\n\t\tswitch(sim40.memory[i]) {\r\n\r\n\t\tcase 19: /* jump */\r\n\t\t\ti = sim40.memory[i+1];\r\n\t\t\tbreak;\r\n\r\n\t\tcase 20: /* comp */\r\n\t\t\tupdateZeroFlagOnComp(Simulator.ACCUMULATOR_ADDRESS, sim40.memory[i+1]);\r\n\t\t\tupdateNegativeFlagOnComp(Simulator.ACCUMULATOR_ADDRESS, sim40.memory[++i]);\r\n\t\t\tbreak;\r\n\r\n\t\tcase 21: /* xcomp */\r\n\t\t\tupdateZeroFlagOnComp(Simulator.XREG_ADDRESS, sim40.memory[i+1]);\t\t\r\n\t\t\tupdateNegativeFlagOnComp(Simulator.XREG_ADDRESS, sim40.memory[++i]);\r\n\t\t\tbreak;\r\n\r\n\t\tcase 22: /* ycomp */\r\n\t\t\tupdateZeroFlagOnComp(Simulator.YREG_ADDRESS, sim40.memory[i+1]);\t\t\r\n\t\t\tupdateNegativeFlagOnComp(Simulator.YREG_ADDRESS, sim40.memory[++i]);\r\n\t\t\tbreak;\r\n\r\n\t\tcase 23: /* jineg */\r\n\t\t\tif((sim40.memory[Simulator.STATUS_ADDRESS] & (1<<1)) == 2) {\r\n\t\t\t\ti = sim40.memory[i+1];\r\n\t\t\t}\r\n\r\n\t\t\telse \r\n\t\t\t\ti = i + 2;\r\n\t\t\tbreak;\r\n\r\n\t\tcase 24 : /* jipos */\r\n\t\t\tif(((sim40.memory[Simulator.STATUS_ADDRESS] & (1<<0)) == 0) && ((sim40.memory[Simulator.STATUS_ADDRESS] & (1<<1)) == 0))\t\r\n\t\t\t\ti = sim40.memory[i+1];\r\n\t\t\telse \r\n\t\t\t\ti = i + 2;\r\n\t\t\tbreak;\r\n\r\n\t\tcase 25: /* jizero */\r\n\t\t\tif(((sim40.memory[Simulator.STATUS_ADDRESS] & (1<<0)) == 1))\r\n\t\t\t\ti = sim40.memory[i+1];\r\n\t\t\telse \r\n\t\t\t\ti = i + 2;\r\n\t\t\tbreak;\r\n\r\n\t\tcase 26: /* jicarry */\r\n\t\t\tif(((sim40.memory[Simulator.STATUS_ADDRESS] & (1<<2)) == 4))\r\n\t\t\t\ti = sim40.memory[i+1];\r\n\t\t\telse \r\n\t\t\t\ti = i + 2;\r\n\t\t\tbreak;\r\n\r\n\t\t}\r\n\r\n\t\treturn i;\r\n\t}", "@Test\n public void testSameKeyAccessDiffCacheMulti()\n {\n doStressTest(\"IdxTestSKADCM\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/3, /*cRollingRestart*/0);\n }", "public void swap(int index1, int index2) {\n \n }", "private void swap(int i, int j) {\n\t\t//gets elements\n\t\tPair e1 = heap.get(i);\n\t\tPair e2 = heap.get(j);\n\t\t//swaps them in heap\n\t\theap.remove(i);\n\t\theap.add(i,e2);\n\t\theap.remove(j);\n\t\theap.add(j,e1);\n\t\t//removes and re-adds their mappings\n\t\tlocation.remove(e1.element);\n\t\tlocation.remove(e2.element);\n\t\tlocation.put((int)e1.element, j);\n\t\tlocation.put((int)e2.element, i);\n\t}", "public boolean compareAndSet\n (int[] i, long[] e, long y) {\n int I = i.length; // 1\n long[] x = new long[I]; // 1\n for (int o=0; o<I; o++) // 1\n x[o] = newValue(e[o]); // 1\n return kcss(i, x, newValue(y)); // 2, 3\n }", "private static void exch(Comparable[] a, int i, int j) {\n Comparable swap = a[i];\n a[i] = a[j];\n a[j] = swap;\n }", "public void swapButtons(int i1, int j1, int i2, int j2) {\n\n\t// Swap locations of two elements in the state array.\n int temp = stateArray[i1][j1];\n stateArray[i1][j1] = stateArray[i2][j2];\n stateArray[i2][j2] = temp;\n\n // Update state if there is collapsed row or column after swapping.\n if(!isGoodState()) {\n updateState();\n\n // Else - swap back the positions of the elements.\n }else {\n \ttemp = stateArray[i2][j2];\n \tstateArray[i2][j2] = stateArray[i1][j1];\n stateArray[i1][j1] = temp;\n }\n }", "private void swap(int i, int j) {\n double[] temp = data[i];\n data[i] = data[j];\n data[j] = temp;\n }", "public void doTheAlgorithm() {\n this.swapCount = 0;\n this.compCount = 0;\n \n\t\tdoQuickSort(0, this.sortArray.length - 1);\n\t}", "private int[] swap(int[] a, int i, int j) {\n int tmp;\n tmp = a[i];\n a[i] = a[j];\n a[j] = tmp;\n return a;\n }", "public static void swap(int[] arr, int i, int j)\n {\n arr[i] = arr[i] ^ arr[j];\n arr[j] = arr[i] ^ arr[j];\n arr[i] = arr[i] ^ arr[j];\n }", "private void swapElement ( int p1, int p2 )\n\t{\n\t}", "@Test\n public void testCompactRangeIndexOnPR() {\n Host host = Host.getHost(0);\n VM vm0 = host.getVM(0);\n VM vm1 = host.getVM(1);\n VM vm2 = host.getVM(2);\n VM vm3 = host.getVM(3);\n setCacheInVMs(vm0, vm1, vm2, vm3);\n vm0.invoke(helper.getCacheSerializableRunnableForPRAccessorCreate(regionName, redundancy,\n Portfolio.class));\n\n vm1.invoke(\n helper.getCacheSerializableRunnableForPRCreate(regionName, redundancy, Portfolio.class));\n\n vm2.invoke(\n helper.getCacheSerializableRunnableForPRCreate(regionName, redundancy, Portfolio.class));\n\n vm3.invoke(\n helper.getCacheSerializableRunnableForPRCreate(regionName, redundancy, Portfolio.class));\n\n vm0.invoke(helper.getCacheSerializableRunnableForPRIndexCreate(regionName, indexName,\n indexedExpression, fromClause, alias));\n\n\n AsyncInvocation<?>[] asyncInvs = new AsyncInvocation[12];\n\n asyncInvs[0] =\n vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));\n\n asyncInvs[1] = vm1.invokeAsync(\n helper.getCacheSerializableRunnableForPRRandomOps(regionName, stepSize, (2 * stepSize)));\n\n asyncInvs[2] = vm2.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (2 * stepSize), (3 * stepSize)));\n\n asyncInvs[3] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (3 * (stepSize)), totalDataSize));\n\n asyncInvs[4] =\n vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));\n\n asyncInvs[5] = vm1.invokeAsync(\n helper.getCacheSerializableRunnableForPRRandomOps(regionName, stepSize, (2 * stepSize)));\n\n asyncInvs[6] = vm2.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (2 * stepSize), (3 * stepSize)));\n\n asyncInvs[7] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (3 * (stepSize)), totalDataSize));\n\n asyncInvs[8] =\n vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));\n\n asyncInvs[9] = vm1.invokeAsync(\n helper.getCacheSerializableRunnableForPRRandomOps(regionName, stepSize, (2 * stepSize)));\n\n asyncInvs[10] = vm2.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (2 * stepSize), (3 * stepSize)));\n\n asyncInvs[11] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (3 * (stepSize)), totalDataSize));\n\n for (AsyncInvocation<?> inv : asyncInvs) {\n ThreadUtils.join(inv, 60 * 000);\n }\n\n for (AsyncInvocation<?> inv : asyncInvs) {\n if (inv.exceptionOccurred()) {\n Assert.fail(\"Random region operation failed on VM_\" + inv.getId(), inv.getException());\n }\n }\n vm0.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n\n vm1.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n\n vm2.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n\n vm3.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n }", "private void swap(int one, int two)\r\n {\r\n//*** one->two\r\n long temp = a[two];\r\n a[one] = a[two];\r\n a[two] = temp;\r\n }", "private static void vecswap(int x[], int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a, b);\n\t}", "private Board swapTiles1d(short[] swap1, short[] swap2) {\n short[][] arr = tempArray(arr1d, N);\n int[][] tempTiles = new int[N][N];\n for (int i = 0; i < N; i++)\n for (int j = 0; j < N; j++)\n tempTiles[i][j] = (int) arr[i][j];\n int temp = tempTiles[swap1[0]][swap1[1]];\n tempTiles[swap1[0]][swap1[1]] = tempTiles[swap2[0]][swap2[1]];\n tempTiles[swap2[0]][swap2[1]] = temp;\n return new Board(tempTiles);\n }", "void rndSwapTwo(int i, int j) {\r\n\t\tint a, b;\r\n\t\tint tmp;\r\n\r\n\t\ta = Util.rndInt(i, j);\r\n\t\tb = Util.rndInt(i, j);\r\n\t\ttmp = index[a];\r\n\t\tindex[a] = index[b];\r\n\t\tindex[b] = tmp;\r\n\t}", "private static void swap(int[] a, int i, int j) {\n int swap = a[i];\n a[i] = a[j];\n a[j] = swap;\n }", "public void mo42595b() {\n if (getAndIncrement() == 0) {\n Observer<? super R> a = this.f41312b;\n int missing = 1;\n while (!this.f41318h) {\n if (this.f41317g) {\n boolean empty = this.f41320j.get() == null;\n if (this.f41315e) {\n if (empty) {\n Throwable ex = (Throwable) this.f41316f.get();\n if (ex != null) {\n a.onError(ex);\n } else {\n a.onComplete();\n }\n return;\n }\n } else if (((Throwable) this.f41316f.get()) != null) {\n a.onError(this.f41316f.mo42732a());\n return;\n } else if (empty) {\n a.onComplete();\n return;\n }\n }\n SwitchMapInnerObserver<T, R> inner = (C13573a) this.f41320j.get();\n if (inner != null) {\n SpscLinkedArrayQueue<R> q = inner.f41309c;\n if (inner.f41310d) {\n boolean empty2 = q.isEmpty();\n if (this.f41315e) {\n if (empty2) {\n this.f41320j.compareAndSet(inner, null);\n }\n } else if (((Throwable) this.f41316f.get()) != null) {\n a.onError(this.f41316f.mo42732a());\n return;\n } else if (empty2) {\n this.f41320j.compareAndSet(inner, null);\n }\n }\n boolean retry = false;\n while (!this.f41318h) {\n if (inner != this.f41320j.get()) {\n retry = true;\n } else if (this.f41315e || ((Throwable) this.f41316f.get()) == null) {\n boolean d = inner.f41310d;\n R v = q.poll();\n boolean empty3 = v == null;\n if (d && empty3) {\n this.f41320j.compareAndSet(inner, null);\n retry = true;\n } else if (!empty3) {\n a.onNext(v);\n }\n } else {\n a.onError(this.f41316f.mo42732a());\n return;\n }\n if (retry) {\n continue;\n }\n }\n return;\n }\n missing = addAndGet(-missing);\n if (missing == 0) {\n return;\n }\n }\n }\n }", "private static <T,P> void vecswap(List<T> x, List<P> a2,int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "public static void main(String[] args) {\n\t\t// Part 1 Bench Testing\n\t\t// -----------------------------------\n\n\t\t// -----------------------------------\n\t\t// Array and other declarations\n\t\t// -----------------------------------\n\t\tStopWatch sw = new StopWatch(); // timer for measuring execution speed\n\t\tfinal int SIZE = 100000; // size of array we are using\n\n\t\tint[] sourceArray, copyArray; // arrays for testing insertionSort and selectionSort\n\t\tInteger[] sourceArray2, copyArray2; // arrays for testing shell, merge, quicksort\n\n\t\t// -------------------------------------------------\n\t\t// Array initialization to a predetermined shuffle\n\t\t// -------------------------------------------------\n\t\tsourceArray = new int[SIZE]; // for use in selection, insertion sort\n\t\tscrambleArray(sourceArray, true); // scramble to a random state\n\t\tsourceArray2 = new Integer[SIZE]; // for use in shell,merge,quicksort\n\t\tscrambleArray(sourceArray2, true); // scramble to a random state\n\n\t\t// ---------------------------------------\n\t\t// SELECTION SORT\n\t\t// ---------------------------------------\n\t\t// for all sorts, we must reset copyArray\n\t\t// to sourceArray before sorting\n\t\t// ---------------------------------------\n\t\tcopyArray = Arrays.copyOf(sourceArray, SIZE);\n\n\t\tSystem.out.println(\"Before Selection Sort\");\n\t\t// printArray(copyArray);\n\t\tSystem.out.println(\"Selection Sort\");\n\t\tsw.start(); // start timer\n\t\tSortArray.selectionSort(copyArray, SIZE);\n\t\tsw.stop(); // stop timer\n\t\tSystem.out.println(\"selection sort took \" + sw.getElapsedTime() + \" msec\");\n\t\tSystem.out.println(\"After Selection Sort\");\n\t\t// printArray(copyArray);\n\n\t\t// -----------------------------------------\n\t\t// INSERTION SORT\n\t\t// -----------------------------------------\n\t\t// Reset copyArray back to unsorted state\n\t\t// -----------------------------------------\n\n\t\t// add statements for STEP 2 here\n\n\t\t// -----------------------------------------\n\t\t// SHELL SORT\n\t\t// -----------------------------------------\n\t\t// Reset copyArray2 back to unsorted state\n\t\t// -----------------------------------------\n\n\t\t// add statements for STEP 3 here\n\n\t\t// -----------------------------------------\n\t\t// MERGE SORT\n\t\t// -----------------------------------------\n\t\t// Reset copyArray2 back to unsorted state\n\t\t// -----------------------------------------\n\n\t\t// add statements for STEP 4 here\n\n\t\t// -----------------------------------------\n\t\t// QUICK SORT\n\t\t// -----------------------------------------\n\t\t// Reset copyArray2 back to unsorted state\n\t\t// -----------------------------------------\n\n\t\t// add statements for STEP 5 here\n\n\t}", "private boolean checkRowForOctPair(int i1, int i2) {\n for(int j=0;j<4;j++)\r\n {\r\n if(Kmap[i1][j]==0 || Kmap[i1][j]==-1)\r\n return false;\r\n }\r\n for(int j=0;j<4;j++)\r\n {\r\n if(Kmap[i2][j]==0 || Kmap[i2][j]==-1)\r\n return false;\r\n }\r\n \r\n for(int j=0;j<4;j++)\r\n {\r\n Kmap[i1][j]=-1;\r\n }\r\n for(int j=0;j<4;j++)\r\n {\r\n Kmap[i2][j]=-1;\r\n }\r\n \r\n return true;\r\n \r\n }", "private void vecswap(double x[], int a, int b, int n) {\r\n for (int i = 0; i < n; i++, a++, b++) {\r\n swap(x, a, b);\r\n }\r\n }", "private void swap(int[] a, int i, int j) {\n int tmp = a[i];\n a[i] = a[j];\n a[j] = tmp;\n }", "private static <E extends Comparable<? super E>> void swap(\r\n\t\t\tComparable<E>[] data, int i, int j) {\r\n\t\tComparable<E> temp = data[i];\r\n\t\tdata[i] = data[j];\r\n\t\tdata[j] = temp;\r\n\t}", "public void swap(int i, int j) {\n int temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }", "public native boolean Verify(byte[] bArr, byte[] bArr2, byte[] bArr3, int i);", "@Test\n void _correctThenCaseTest() {\n\n actionApply();\n\n for (ReceiverPair receiverPair : dependedReceiverPairs) {\n for (AssingablePair assingablePair : incompatibleAssignablePairs) {\n verify(model).arithm(receiverPair.getVariableDependentReceiver(), \"!=\", assingablePair.getIndexdependentAssignable());\n }\n }\n }", "private void swap(int index1, int index2){\r\n ListNode c = head;\r\n ListNode swapNode = head;\r\n \r\n E tmp = null, tmp1 = null;\r\n \r\n for(int i = 0; i < index1; i++) c = c.getLink();\r\n tmp = (E) c.getData();\r\n \r\n for(int i = 0; i < index2; i++) swapNode = swapNode.getLink();\r\n tmp1 = (E) swapNode.getData();\r\n c.setData(tmp1);\r\n swapNode.setData(tmp);\r\n }", "static int minSwap (int arr[], int n, int k) {\n int c=0;\n for(int i=0;i<n;i++)\n {\n if(arr[i]<=k)\n ++c;\n }\n int c1=0;\n int start=0,end=c;\n for(int j=0;j<end;j++)\n {\n if(arr[j]>k)\n ++c1;\n }\n int minans=c1;\n while(end<n)\n {\n if(arr[start]>k)\n --c1;\n if(arr[end]>k){\n ++c1;\n }\n minans=Math.min(minans,c1);\n start++;\n end++;\n }\n return minans;\n //Complete the function\n }", "private void prac(int n, int[] x, int[] z, int[] xT, int[] zT, int[] xT2, int[] zT2) {\r\n\t\tint d, e, r, i;\r\n\t\tint[] t;\r\n\t\tint[] xA = x, zA = z;\r\n\t\tint[] xB = fieldAux1, zB = fieldAux2;\r\n\t\tint[] xC = fieldAux3, zC = fieldAux4;\r\n\t\tdouble v[] = { 1.61803398875, 1.72360679775, 1.618347119656, 1.617914406529, 1.612429949509, 1.632839806089, 1.620181980807, 1.580178728295,\r\n\t\t\t\t1.617214616534, 1.38196601125 };\r\n\r\n\t\t/* chooses the best value of v */\r\n\t\tr = lucas_cost(n, v[0]);\r\n\t\ti = 0;\r\n\t\tfor (d = 1; d < 10; d++) {\r\n\t\t\te = lucas_cost(n, v[d]);\r\n\t\t\tif (e < r) {\r\n\t\t\t\tr = e;\r\n\t\t\t\ti = d;\r\n\t\t\t}\r\n\t\t}\r\n\t\td = n;\r\n\t\tr = (int) ((double) d / v[i] + 0.5);\r\n\t\t/* first iteration always begins by Condition 3, then a swap */\r\n\t\td = n - r;\r\n\t\te = 2 * r - n;\r\n\t\tSystem.arraycopy(xA, 0, xB, 0, NumberLength); // B = A\r\n\t\tSystem.arraycopy(zA, 0, zB, 0, NumberLength);\r\n\t\tSystem.arraycopy(xA, 0, xC, 0, NumberLength); // C = A\r\n\t\tSystem.arraycopy(zA, 0, zC, 0, NumberLength);\r\n\t\tduplicate(xA, zA, xA, zA); /* A=2*A */\r\n\t\twhile (d != e) {\r\n\t\t\tif (d < e) {\r\n\t\t\t\tr = d;\r\n\t\t\t\td = e;\r\n\t\t\t\te = r;\r\n\t\t\t\tt = xA;\r\n\t\t\t\txA = xB;\r\n\t\t\t\txB = t;\r\n\t\t\t\tt = zA;\r\n\t\t\t\tzA = zB;\r\n\t\t\t\tzB = t;\r\n\t\t\t}\r\n\t\t\t/* do the first line of Table 4 whose condition qualifies */\r\n\t\t\tif (4 * d <= 5 * e && ((d + e) % 3) == 0) { /* condition 1 */\r\n\t\t\t\tr = (2 * d - e) / 3;\r\n\t\t\t\te = (2 * e - d) / 3;\r\n\t\t\t\td = r;\r\n\t\t\t\tadd3(xT, zT, xA, zA, xB, zB, xC, zC); /* T = f(A,B,C) */\r\n\t\t\t\tadd3(xT2, zT2, xT, zT, xA, zA, xB, zB); /* T2 = f(T,A,B) */\r\n\t\t\t\tadd3(xB, zB, xB, zB, xT, zT, xA, zA); /* B = f(B,T,A) */\r\n\t\t\t\tt = xA;\r\n\t\t\t\txA = xT2;\r\n\t\t\t\txT2 = t;\r\n\t\t\t\tt = zA;\r\n\t\t\t\tzA = zT2;\r\n\t\t\t\tzT2 = t; /* swap A and T2 */\r\n\t\t\t} else if (4 * d <= 5 * e && (d - e) % 6 == 0) { /* condition 2 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tadd3(xB, zB, xA, zA, xB, zB, xC, zC); /* B = f(A,B,C) */\r\n\t\t\t\tduplicate(xA, zA, xA, zA); /* A = 2*A */\r\n\t\t\t} else if (d <= (4 * e)) { /* condition 3 */\r\n\t\t\t\td -= e;\r\n\t\t\t\tadd3(xT, zT, xB, zB, xA, zA, xC, zC); /* T = f(B,A,C) */\r\n\t\t\t\tt = xB;\r\n\t\t\t\txB = xT;\r\n\t\t\t\txT = xC;\r\n\t\t\t\txC = t;\r\n\t\t\t\tt = zB;\r\n\t\t\t\tzB = zT;\r\n\t\t\t\tzT = zC;\r\n\t\t\t\tzC = t; /* circular permutation (B,T,C) */\r\n\t\t\t} else if ((d + e) % 2 == 0) { /* condition 4 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tadd3(xB, zB, xB, zB, xA, zA, xC, zC); /* B = f(B,A,C) */\r\n\t\t\t\tduplicate(xA, zA, xA, zA); /* A = 2*A */\r\n\t\t\t} else if (d % 2 == 0) { /* condition 5 */\r\n\t\t\t\td /= 2;\r\n\t\t\t\tadd3(xC, zC, xC, zC, xA, zA, xB, zB); /* C = f(C,A,B) */\r\n\t\t\t\tduplicate(xA, zA, xA, zA); /* A = 2*A */\r\n\t\t\t} else if (d % 3 == 0) { /* condition 6 */\r\n\t\t\t\td = d / 3 - e;\r\n\t\t\t\tduplicate(xT, zT, xA, zA); /* T1 = 2*A */\r\n\t\t\t\tadd3(xT2, zT2, xA, zA, xB, zB, xC, zC); /* T2 = f(A,B,C) */\r\n\t\t\t\tadd3(xA, zA, xT, zT, xA, zA, xA, zA); /* A = f(T1,A,A) */\r\n\t\t\t\tadd3(xT, zT, xT, zT, xT2, zT2, xC, zC); /* T1 = f(T1,T2,C) */\r\n\t\t\t\tt = xC;\r\n\t\t\t\txC = xB;\r\n\t\t\t\txB = xT;\r\n\t\t\t\txT = t;\r\n\t\t\t\tt = zC;\r\n\t\t\t\tzC = zB;\r\n\t\t\t\tzB = zT;\r\n\t\t\t\tzT = t; /* circular permutation (C,B,T) */\r\n\t\t\t} else if ((d + e) % 3 == 0) { /* condition 7 */\r\n\t\t\t\td = (d - 2 * e) / 3;\r\n\t\t\t\tadd3(xT, zT, xA, zA, xB, zB, xC, zC); /* T1 = f(A,B,C) */\r\n\t\t\t\tadd3(xB, zB, xT, zT, xA, zA, xB, zB); /* B = f(T1,A,B) */\r\n\t\t\t\tduplicate(xT, zT, xA, zA);\r\n\t\t\t\tadd3(xA, zA, xA, zA, xT, zT, xA, zA); /* A = 3*A */\r\n\t\t\t} else if ((d - e) % 3 == 0) { /* condition 8 */\r\n\t\t\t\td = (d - e) / 3;\r\n\t\t\t\tadd3(xT, zT, xA, zA, xB, zB, xC, zC); /* T1 = f(A,B,C) */\r\n\t\t\t\tadd3(xC, zC, xC, zC, xA, zA, xB, zB); /* C = f(A,C,B) */\r\n\t\t\t\tt = xB;\r\n\t\t\t\txB = xT;\r\n\t\t\t\txT = t;\r\n\t\t\t\tt = zB;\r\n\t\t\t\tzB = zT;\r\n\t\t\t\tzT = t; /* swap B and T */\r\n\t\t\t\tduplicate(xT, zT, xA, zA);\r\n\t\t\t\tadd3(xA, zA, xA, zA, xT, zT, xA, zA); /* A = 3*A */\r\n\t\t\t} else if (e % 2 == 0) { /* condition 9 */\r\n\t\t\t\te /= 2;\r\n\t\t\t\tadd3(xC, zC, xC, zC, xB, zB, xA, zA); /* C = f(C,B,A) */\r\n\t\t\t\tduplicate(xB, zB, xB, zB); /* B = 2*B */\r\n\t\t\t}\r\n\t\t}\r\n\t\tadd3(x, z, xA, zA, xB, zB, xC, zC);\r\n\t}", "public boolean swap(int index1, int index2)\n\t{\n\t\tif (index1 >= 0 && index2 >= 0 && index1 < arraySize && index2 < arraySize)\n\t\t{ \n\t\t\tif (index1 != index2)\n\t\t\t{\n\t\t\t\tint holder = array[index1];\n\t\t\t\tarray[index1] = array[index2];\n\t\t\t\tarray[index2] = holder;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\t\n\t\treturn false;\n\t}", "private void exchange(int i, int j){\n\t\tString temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n\t}" ]
[ "0.54589546", "0.53178835", "0.52827054", "0.5273411", "0.5271122", "0.5229399", "0.51951337", "0.5175794", "0.51597565", "0.5156539", "0.51140755", "0.51087946", "0.5096542", "0.5091042", "0.5089321", "0.50864244", "0.5053527", "0.502679", "0.5021964", "0.50167906", "0.50076216", "0.50044644", "0.49957988", "0.49887013", "0.49748462", "0.49748322", "0.49740785", "0.4971515", "0.49706924", "0.49653527", "0.49558023", "0.49537432", "0.49521", "0.49462375", "0.49370015", "0.4917048", "0.49108705", "0.49093518", "0.49065927", "0.4892435", "0.4890944", "0.48801047", "0.48717707", "0.4869677", "0.48685622", "0.4864651", "0.4863039", "0.486199", "0.48616734", "0.4861362", "0.48553267", "0.48542467", "0.48498696", "0.4848916", "0.4843715", "0.4841662", "0.48218334", "0.48198402", "0.4817718", "0.48140967", "0.4811755", "0.48077923", "0.48032388", "0.4800396", "0.47978964", "0.47973418", "0.47827095", "0.4782461", "0.47785068", "0.47759295", "0.4771316", "0.47663495", "0.47650135", "0.47628823", "0.47617042", "0.4759446", "0.47425434", "0.47408238", "0.4739306", "0.47392887", "0.47392288", "0.4738272", "0.47377276", "0.4736394", "0.47313967", "0.47281194", "0.47275522", "0.47079766", "0.47017062", "0.47002298", "0.4696957", "0.46968502", "0.46916184", "0.46831372", "0.46813232", "0.4672281", "0.46693343", "0.46610585", "0.46576148", "0.46546006" ]
0.4809062
61
Collects snapshot at indices i. 1. Collect old tags at i. 2. Collect old values at i. 3. Collect new values at i. 4. Collect new tags at i. 5. Check if both tags and values match. 5a. If they match, return values. 5b. Otherwise, retry.
private void snapshot (int[] i, int i0, int i1, long[] V) { int I = i.length; long[] va = V; long[] vb = new long[I]; long[] ta = new long[I]; long[] tb = new long[I]; do { collectTags(i, i0, i1, ta); collectValues(i, i0, i1, va); collectValues(i, i0, i1, vb); collectTags(i, i0, i1, tb); } while( Arrays.compare(ta, i0, i1, tb, i0, i1) != 0 || Arrays.compare(va, i0, i1, vb, i0, i1) != 0 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void collectTags\n (int[] i, int i0, int i1, long[] T) {\n for (int o=i0; o<i1; o++) // 1\n T[o] = data[i[o]]; // 1\n }", "private void collectValues\n (int[] i, int i0, int i1, long[] V) {\n for (int o=i0; o<i1; o++) // 1\n V[o] = read(i[o]); // 1\n }", "public void reduce(IntWritable key, Iterable<Text> values, Context context) throws IOException, InterruptedException {\n HashMap<String, ArrayList<String>> hm = new HashMap<String, ArrayList<String>>();\n\n //ArrayList<String> tableS = new ArrayList<String>(); Trying to reduce memory\n ArrayList<String> tableT = new ArrayList<String>();\n\n //group the records in the iterator into table S and table T\n for(Text val : values){\n String record = val.toString();\n int i = record.indexOf(\" \");\n String tag = record.substring(0,i);\n String value = record.substring(i+1);\n\n if (tag.contentEquals(\"S\")) {\n //get the key-value information\n int j = value.indexOf(\" \");\n String tagKey = value.substring(0,j);\n String mapValue = value.substring(j+1);\n\n //if the key doesn't exist\n if (!hm.containsKey(tagKey)) {\n ArrayList<String> list = new ArrayList<String>();\n list.add(mapValue);\n hm.put(tagKey, list);\n } else {\n //same key exists, then add it to the array list\n hm.get(tagKey).add(mapValue);\n }\n } else if(tag.contentEquals(\"T\")) {\n tableT.add(value);\n }\n }\n\n// for (String s : tableS){\n// int i = s.indexOf(\" \");\n// String keyValue = s.substring(0, i);\n// //if the key doesn't exist\n// if (!hm.containsKey(keyValue)) {\n// ArrayList<String> list = new ArrayList<String>();\n// list.add(s.substring(i+1));\n// hm.put(keyValue, list);\n// } else {\n// //same key exists, then add it to the array list\n// hm.get(keyValue).add(s.substring(i+1));\n// }\n// }\n\n //then iterate through the other table to produce the result\n for (String t : tableT) {\n //check to see if there's a match\n int i = t.indexOf(\" \");\n String hashKey = t.substring(0, i);\n if (!hm.containsKey(hashKey)) {\n //no match and don't do anything\n } else {\n //match\n for (String s : hm.get(hashKey)) {\n String result = s + \" \" + hashKey + \":\" + t;\n context.write(key, new Text(result));\n }\n }\n }\n }", "private Iterable<Entry<K, V>> snapShot(int startIndex, K stop) {\n\t\tDoublyLinkedList<Entry<K, V>> buffer = new DoublyLinkedList<>();\n\t\tint j = startIndex;\n\t\twhile ( j < map.size() && (stop == null || stop.compareTo(map.get(j).getKey()) > 0 )) {\n\t\t\tbuffer.addLast(map.get(j++));\n\t\t}\n\t\treturn buffer;\n\t}", "@Test\n public void testScan() {\n // Choose, among the available ones, a random key as starting point for the scan transaction.\n int startScanKeyNumber = new Random().nextInt(((RiakKVClientTest.recordsToInsert) - (RiakKVClientTest.recordsToScan)));\n // Prepare a HashMap vector to store the scan transaction results.\n Vector<HashMap<String, ByteIterator>> scannedValues = new Vector<>();\n // Check whether the scan transaction is correctly performed or not.\n Assert.assertEquals(\"Scan transaction FAILED.\", OK, RiakKVClientTest.riakClient.scan(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(startScanKeyNumber))), RiakKVClientTest.recordsToScan, null, scannedValues));\n // After the scan transaction completes, compare the obtained results with the expected ones.\n for (int i = 0; i < (RiakKVClientTest.recordsToScan); i++) {\n Assert.assertEquals(\"Scan test FAILED: the current scanned key is NOT MATCHING the expected one.\", RiakKVClientTest.createExpectedHashMap((startScanKeyNumber + i)).toString(), scannedValues.get(i).toString());\n }\n }", "private long read(int i) {\n while (true) {\n long x = data[i];\n if (!isTag(x)) return value(x);\n reset(i);\n }\n }", "public void apply(at.ac.tuwien.dsg.mela.common.monitoringConcepts.ServiceMonitoringSnapshot serviceMonitoringSnapshot) {\n\n //1'step extract the monitoring data for the target service elements\n Map<MonitoredElement, MonitoredElementMonitoringSnapshot> levelMonitoringData = serviceMonitoringSnapshot.getMonitoredData(targetMonitoredElementLevel);\n\n if (levelMonitoringData == null) {\n Logger.getRootLogger().log(Level.WARN, \"Level \" + targetMonitoredElementLevel + \" not found in monitoring data\");\n return;\n }\n\n Collection<MonitoredElementMonitoringSnapshot> toBeProcessed = new ArrayList<MonitoredElementMonitoringSnapshot>();\n\n //step 2\n //if target IDs have ben supplied, use them to extract only the monitoring data for the target elements, else process all elements on this level\n if (targetMonitoredElementIDs.isEmpty()) {\n //if all on level, get each elementy data, and add its children data. Might destroy the data in the long run\n Collection<MonitoredElementMonitoringSnapshot> levelData = levelMonitoringData.values();\n for (MonitoredElementMonitoringSnapshot levelElementData : levelData) {\n\n toBeProcessed.add(levelElementData);\n }\n } else {\n for (String id : targetMonitoredElementIDs) {\n\n //TODO: an issue is that in the MonitoredElementMonitoringSnapshot I do NOT hold the children snapshots.\n //So now I follow the MonitoredElement children, get their MonitoredElementMonitoringSnapshot, and enrich the MonitoredElementMonitoringSnapshot supplied to the operations\n MonitoredElement element = new MonitoredElement(id);\n if (levelMonitoringData.containsKey(element)) {\n MonitoredElementMonitoringSnapshot elementData = levelMonitoringData.get(element);\n toBeProcessed.add(elementData);\n } else {\n Logger.getRootLogger().log(Level.WARN, \"Element with ID \" + id + \" not found in monitoring data\");\n }\n }\n }\n //step 3 \n //for each MonitoredElementMonitoringSnapshot apply composition rule and enrich monitoring data in place\n for (MonitoredElementMonitoringSnapshot snapshot : toBeProcessed) {\n\n MetricValue result = operation.apply(snapshot);\n// resultingMetric.setMonitoredElement(snapshot.getMonitoredElement());\n if (result != null) {\n //put new composite metric\n snapshot.putMetric(resultingMetric, result);\n }\n }\n }", "public void t6_whenGetTwoAlarms_thenProvideTagOfNextAlarm() {\n\n // Create three alarms. (so in the log we have: 0, 1, 2)\n //\n for (int i = 0; i < TEST_KEYS.length; i++) {\n dao.createOrUpdateAlarm(EXISTING_ALARM.domain, EXISTING_ALARM.adapterName,\n TEST_KEYS[i], EXISTING_ALARM.json);\n }\n // Let's remove all.\n //\n for (int i = 0; i < TEST_KEYS.length; i++) {\n dao.removeAlarm(EXISTING_ALARM.domain, EXISTING_ALARM.adapterName,\n TEST_KEYS[i]);\n }\n // Create three alarms again.\n //\n for (int i = 0; i < TEST_KEYS.length; i++) {\n dao.createOrUpdateAlarm(EXISTING_ALARM.domain, EXISTING_ALARM.adapterName,\n TEST_KEYS[i], EXISTING_ALARM.json);\n }\n // (so in the log we have: 0, 1, 2, x, x, x, 0, 1, 2)\n //\n // We expect:\n // all results - three alarms are returned.\n // first pack - two alarms are returned.\n // second pack - three alarms are returned.\n //\n check_for_t6(TEST_KEYS,\n new String[] {TEST_KEYS[0], TEST_KEYS[1]},\n TEST_KEYS);\n\n // Update one alarm.\n // It should be returned in the first pack AND in the second pack.\n dao.createOrUpdateAlarm(EXISTING_ALARM.domain, EXISTING_ALARM.adapterName,\n TEST_KEYS[0], EXISTING_ALARM.json);\n // (so in the log we have: 0, 1, 2, x, x, x, 0, 1, 2, 0)\n //\n // We expect:\n // all results - three alarms are returned.\n // first pack - two alarms are returned. Exactly in the same order.\n // second pack - three alarms are returned.\n //\n check_for_t6(new String[] {TEST_KEYS[1], TEST_KEYS[2], TEST_KEYS[0]},\n new String[] {TEST_KEYS[0], TEST_KEYS[1]},\n new String[] {TEST_KEYS[1], TEST_KEYS[2], TEST_KEYS[0]});\n\n // Update another alarm.\n dao.createOrUpdateAlarm(EXISTING_ALARM.domain, EXISTING_ALARM.adapterName,\n TEST_KEYS[2], EXISTING_ALARM.json);\n // (so in the log we have: 0, 1, 2, x, x, x, 0, 1, 2, 0, 2)\n //\n // We expect:\n // all results - three alarms are returned.\n // first pack - two alarms are returned. Exactly in the same order.\n // second pack - three alarms are returned.\n //\n check_for_t6(new String[] {TEST_KEYS[1], TEST_KEYS[0], TEST_KEYS[2]},\n new String[] {TEST_KEYS[0], TEST_KEYS[1]},\n new String[] {TEST_KEYS[1], TEST_KEYS[0], TEST_KEYS[2]});\n }", "public void recover(Iterator<String> uuids) throws IndexException\n {\n IndexReader reader = indexStorage.getIndexReader();\n try\n {\n final HashMap<String, Document> addedDocuments = new HashMap<String, Document>();\n final HashSet<String> removedDocuments = new HashSet<String>();\n while (uuids.hasNext())\n {\n String nodeUuid = uuids.next();\n\n GetContentEntryCommand getCommand = new GetContentEntryCommand(nodeUuid);\n final ContentEntry contentEntry = (ContentEntry)indexStorage.invokeNextInterceptor(null, getCommand);\n if (contentEntry == null)\n {\n if (indexStorage.getDocument(nodeUuid, reader) != null)\n {\n // item exist in index storage but doesn't exist in\n // persistence storage\n removedDocuments.add(nodeUuid);\n }\n }\n else\n {\n\n Document doc = nodeIndexer.createDocument(contentEntry);\n\n if (indexStorage.getDocument(nodeUuid, reader) != null)\n {\n // out dated content\n addedDocuments.put(nodeUuid, doc);\n removedDocuments.add(nodeUuid);\n }\n else\n {\n // content desn't exist\n addedDocuments.put(nodeUuid, doc);\n }\n }\n //flash if changes more when BUFFER_MAX_SIZE \n if (checkFlush(addedDocuments, removedDocuments))\n {\n flash(addedDocuments, removedDocuments);\n }\n }\n //if some changes left\n if (addedDocuments.size() + removedDocuments.size() >= 0)\n {\n indexStorage.save(new LuceneIndexTransaction(addedDocuments, removedDocuments));\n }\n }\n catch (Throwable e)\n {\n throw new IndexException(e.getLocalizedMessage(), e);\n }\n }", "private void sampleOfTheGeneratedWindowedAggregate() {\n Iterator<Integer[]> iterator = null;\n\n // builder3\n Integer[] rows = iterator.next();\n\n int prevStart = -1;\n int prevEnd = -1;\n\n for ( int i = 0; i < rows.length; i++ ) {\n // builder4\n Integer row = rows[i];\n\n int start = 0;\n int end = 100;\n if ( start != prevStart || end != prevEnd ) {\n // builder5\n int actualStart = 0;\n if ( start != prevStart || end < prevEnd ) {\n // builder6\n // recompute\n actualStart = start;\n // implementReset\n } else { // must be start == prevStart && end > prevEnd\n actualStart = prevEnd + 1;\n }\n prevStart = start;\n prevEnd = end;\n\n if ( start != -1 ) {\n for ( int j = actualStart; j <= end; j++ ) {\n // builder7\n // implementAdd\n }\n }\n // implementResult\n // list.add(new Xxx(row.deptno, row.empid, sum, count));\n }\n }\n // multiMap.clear(); // allows gc\n // source = Linq4j.asEnumerable(list);\n }", "private void reset(int i) {\n long x = data[i];\n if (isTag(x))\n cas(i, x, save[threadId(x)]);\n }", "public void run(){\n\n for (int locIdx = begN; locIdx < endN; locIdx++) {\n\n // do mean-shift for profiles at these locations\n\n for (int profileIdx=0; profileIdx<profiles.get(locIdx).size(); profileIdx++) {\n\n // access the detection\n// int profileLength = profiles.get(locIdx).get(profileIdx).length;\n\n // calculate peaks for the ring 'profileIdx'\n ArrayList<Float> currPeaks = extractPeakIdxsList(profiles.get(locIdx).get(profileIdx), startIdx.get(profileIdx), finishIdx.get(locIdx).get(profileIdx));\n\n //if (currPeaks.size()<3) {\n // // it is not a bifurcation according to MS for this ring, don't calculate further, leave empty fields of peakIdx at this location\n // break;\n //}\n //else {\n // add those points\n for (int pp=0; pp<currPeaks.size(); pp++){\n peakIdx.get(locIdx).get(profileIdx).add(pp, currPeaks.get(pp));\n }\n //}\n\n/*\n\t\t\t\tfor (int k=0; k<nrPoints; k++) {\n start[k] = ((float) k / nrPoints) * profileLength;\n }\n\n\t\t\t\tTools.runMS( \tstart,\n \tprofiles.get(locIdx).get(profileIdx),\n \tmaxIter,\n \tepsilon,\n \th,\n\t\t\t\t\t\t\t\tmsFinish);\n*/\n\n /*\n for (int i1=0; i1<nrPoints; i1++) {\n convIdx.get(locIdx).get(profileIdx)[i1] = (float) msFinish[i1];\n }\n*/\n/*\n int inputProfileLength = profiles.get(locIdx).get(profileIdx).length;\n Vector<float[]> cls = Tools.extractClusters1(msFinish, minD, M, inputProfileLength);\n\t\t\t\textractPeakIdx(cls, locIdx, profileIdx); // to extract 3 major ones (if there are three)\n*/\n\n }\n\n }\n\n }", "public Vector checkAllIdReferences()\n {\n Vector resultVector = new Vector();\n String msgText = \"\";\n String idrefValue = \"\";\n boolean iItemdrefResult = false;\n\n if ( !mItemIdrefs.isEmpty() )\n {\n int mItemIdrefsSize = mItemIdrefs.size();\n for ( int i = 0; i < mItemIdrefsSize; i++ )\n {\n idrefValue = (String)mItemIdrefs.elementAt(i);\n\n if ( !idrefValue.equals(\"\") ) \n {\n msgText = Messages.getString(\"ManifestMap.40\", idrefValue ); \n LOGGER.info( \"INFO: \" + msgText ); \n DetailedLogMessageCollection.getInstance().addMessage( \n new LogMessage( MessageType.INFO, msgText ) );\n\n iItemdrefResult = checkIdReference( idrefValue );\n\n // track all idref values whose reference was not valid\n\n if ( !iItemdrefResult )\n {\n msgText = Messages.getString(\"ManifestMap.43\", idrefValue ); \n LOGGER.info( \"FAILED: \" + msgText ); \n DetailedLogMessageCollection.getInstance().addMessage( new LogMessage(\n MessageType.FAILED, msgText ) );\n\n resultVector.add( idrefValue );\n }\n }\n }\n }\n\n if ( !mDependencyIdrefs.isEmpty() )\n {\n int mDependencyIdrefsSize = mDependencyIdrefs.size();\n for ( int i = 0; i < mDependencyIdrefsSize; i++ )\n {\n idrefValue = (String)mDependencyIdrefs.elementAt(i);\n\n if ( !idrefValue.equals(\"\") ) \n {\n msgText = Messages.getString(\"ManifestMap.40\", idrefValue ); \n LOGGER.info( \"INFO: \" + msgText ); \n DetailedLogMessageCollection.getInstance().addMessage( new LogMessage( MessageType.INFO,\n msgText ) );\n \n boolean iDependencydrefResult = checkIdReference( idrefValue );\n\n // track all idref values whose reference was not valid\n\n if ( !iDependencydrefResult )\n {\n msgText = Messages.getString(\"ManifestMap.43\", idrefValue ); \n LOGGER.info( \"FAILED: \" + msgText ); \n DetailedLogMessageCollection.getInstance().addMessage( new LogMessage(\n MessageType.FAILED, msgText ) );\n\n resultVector.add( idrefValue );\n }\n }\n }\n }\n\n return resultVector;\n }", "void merge_at(int i) {\n \n int pa = this.base[i];\n int pb = this.base[i+1];\n int na = this.len[i];\n int nb = this.len[i+1];\n \n //assert_(na > 0 && nb > 0);\n //assert_(pa + na == pb);\n \n // Record the length of the combined runs; if i is the 3rd-last\n // run now, also slide over the last run (which isn't involved\n // in this merge). The current run i+1 goes away in any case.\n if (i == this.n - 3) {\n this.len[i+1] = this.len[i+2];\n this.base[i+1] = this.base[i+2];\n }\n this.len[i] = na + nb;\n --this.n;\n \n // Where does b start in a? Elements in a before that can be\n // ignored (already in place).\n int k = gallop_right(this.data[pb], this.data, pa, na, 0);\n pa += k;\n na -= k;\n if (na == 0)\n return;\n \n // Where does a end in b? Elements in b after that can be\n // ignored (already in place).\n nb = gallop_left(this.data[pa + na - 1], this.data, pb, nb, nb-1);\n if (nb == 0)\n return;\n \n // Merge what remains of the runs, using a temp array with\n // min(na, nb) elements.\n if (na <= nb)\n merge_lo(pa, na, pb, nb);\n else\n merge_hi(pa, na, pb, nb);\n }", "private static void verifyLongs(long[] values, int[] ids) throws Exception {\n IndexWriterConfig iwc = newIndexWriterConfig();\n\n // Else we can get O(N^2) merging:\n int mbd = iwc.getMaxBufferedDocs();\n if (mbd != -1 && mbd < values.length / 100) {\n iwc.setMaxBufferedDocs(values.length / 100);\n }\n iwc.setCodec(getCodec());\n Directory dir;\n if (values.length > 100000) {\n dir = newMaybeVirusCheckingFSDirectory(createTempDir(\"TestRangeTree\"));\n } else {\n dir = newMaybeVirusCheckingDirectory();\n }\n\n int missingPct = random().nextInt(100);\n int deletedPct = random().nextInt(100);\n if (VERBOSE) {\n System.out.println(\" missingPct=\" + missingPct);\n System.out.println(\" deletedPct=\" + deletedPct);\n }\n\n BitSet missing = new BitSet();\n BitSet deleted = new BitSet();\n\n Document doc = null;\n int lastID = -1;\n\n IndexWriter w = new IndexWriter(dir, iwc);\n for (int ord = 0; ord < values.length; ord++) {\n int id;\n if (ids == null) {\n id = ord;\n } else {\n id = ids[ord];\n }\n if (id != lastID) {\n if (random().nextInt(100) < missingPct) {\n missing.set(id);\n if (VERBOSE) {\n System.out.println(\" missing id=\" + id);\n }\n }\n\n if (doc != null) {\n w.addDocument(doc);\n if (random().nextInt(100) < deletedPct) {\n int idToDelete = random().nextInt(id);\n w.deleteDocuments(new Term(\"id\", \"\" + idToDelete));\n deleted.set(idToDelete);\n if (VERBOSE) {\n System.out.println(\" delete id=\" + idToDelete);\n }\n }\n }\n\n doc = new Document();\n doc.add(newStringField(\"id\", \"\" + id, Field.Store.NO));\n doc.add(new NumericDocValuesField(\"id\", id));\n lastID = id;\n }\n\n if (missing.get(id) == false) {\n doc.add(new LongPoint(\"sn_value\", values[id]));\n byte[] bytes = new byte[8];\n NumericUtils.longToSortableBytes(values[id], bytes, 0);\n doc.add(new BinaryPoint(\"ss_value\", bytes));\n }\n }\n\n w.addDocument(doc);\n\n if (random().nextBoolean()) {\n if (VERBOSE) {\n System.out.println(\" forceMerge(1)\");\n }\n w.forceMerge(1);\n }\n final IndexReader r = DirectoryReader.open(w);\n w.close();\n\n IndexSearcher s = newSearcher(r, false);\n\n int numThreads = TestUtil.nextInt(random(), 2, 5);\n\n if (VERBOSE) {\n System.out.println(\"TEST: use \" + numThreads + \" query threads; searcher=\" + s);\n }\n\n List<Thread> threads = new ArrayList<>();\n final int iters = atLeast(100);\n\n final CountDownLatch startingGun = new CountDownLatch(1);\n final AtomicBoolean failed = new AtomicBoolean();\n\n for (int i = 0; i < numThreads; i++) {\n Thread thread =\n new Thread() {\n @Override\n public void run() {\n try {\n _run();\n } catch (Exception e) {\n failed.set(true);\n throw new RuntimeException(e);\n }\n }\n\n private void _run() throws Exception {\n startingGun.await();\n\n for (int iter = 0; iter < iters && failed.get() == false; iter++) {\n Long lower = randomValue();\n Long upper = randomValue();\n\n if (upper < lower) {\n long x = lower;\n lower = upper;\n upper = x;\n }\n\n Query query;\n\n if (VERBOSE) {\n System.out.println(\n \"\\n\"\n + Thread.currentThread().getName()\n + \": TEST: iter=\"\n + iter\n + \" value=\"\n + lower\n + \" TO \"\n + upper);\n byte[] tmp = new byte[8];\n NumericUtils.longToSortableBytes(lower, tmp, 0);\n System.out.println(\" lower bytes=\" + Arrays.toString(tmp));\n NumericUtils.longToSortableBytes(upper, tmp, 0);\n System.out.println(\" upper bytes=\" + Arrays.toString(tmp));\n }\n\n if (random().nextBoolean()) {\n query = LongPoint.newRangeQuery(\"sn_value\", lower, upper);\n } else {\n byte[] lowerBytes = new byte[8];\n NumericUtils.longToSortableBytes(lower, lowerBytes, 0);\n byte[] upperBytes = new byte[8];\n NumericUtils.longToSortableBytes(upper, upperBytes, 0);\n query = BinaryPoint.newRangeQuery(\"ss_value\", lowerBytes, upperBytes);\n }\n\n if (VERBOSE) {\n System.out.println(Thread.currentThread().getName() + \": using query: \" + query);\n }\n\n final FixedBitSet hits =\n s.search(query, FixedBitSetCollector.createManager(r.maxDoc()));\n\n if (VERBOSE) {\n System.out.println(\n Thread.currentThread().getName() + \": hitCount: \" + hits.cardinality());\n }\n\n NumericDocValues docIDToID = MultiDocValues.getNumericValues(r, \"id\");\n\n for (int docID = 0; docID < r.maxDoc(); docID++) {\n assertEquals(docID, docIDToID.nextDoc());\n int id = (int) docIDToID.longValue();\n boolean expected =\n missing.get(id) == false\n && deleted.get(id) == false\n && values[id] >= lower\n && values[id] <= upper;\n if (hits.get(docID) != expected) {\n // We do exact quantized comparison so the bbox query should never disagree:\n fail(\n Thread.currentThread().getName()\n + \": iter=\"\n + iter\n + \" id=\"\n + id\n + \" docID=\"\n + docID\n + \" value=\"\n + values[id]\n + \" (range: \"\n + lower\n + \" TO \"\n + upper\n + \") expected \"\n + expected\n + \" but got: \"\n + hits.get(docID)\n + \" deleted?=\"\n + deleted.get(id)\n + \" query=\"\n + query);\n }\n }\n }\n }\n };\n thread.setName(\"T\" + i);\n thread.start();\n threads.add(thread);\n }\n startingGun.countDown();\n for (Thread thread : threads) {\n thread.join();\n }\n IOUtils.close(r, dir);\n }", "public void calculateRevisionMetricValuesFromVersionedItemMetricValues(SoftwareProject project, List<Metric> metrics) {\r\n //it is not possible to calculate metricvalues from project metrics, because they are already in that granularity\r\n List<Metric> nonProjectMetrics = new ArrayList<Metric>(metrics.size());\r\n for (Metric metric : metrics) {\r\n if (metric.getExtratcsFrom() == Metric.EXTRACTS_FROM_PROJECT) {\r\n continue;\r\n }\r\n nonProjectMetrics.add(metric);\r\n }\r\n if (nonProjectMetrics.isEmpty()) {\r\n System.out.println(\"There are no metrics to calculate.\");\r\n return;\r\n }\r\n\r\n //A map to store the last value of each item\r\n Map<Metric, Map<Item, Double>> mapNewestItemMeasurement = new HashMap<Metric, Map<Item, Double>>();\r\n for (Metric metric : nonProjectMetrics) {\r\n mapNewestItemMeasurement.put(metric, new HashMap<Item, Double>());\r\n }\r\n\r\n System.out.println(\"Get revisions...\");\r\n Set<Revision> revisions = revisionService.getByProject(project);\r\n int count = 1;\r\n int total = revisions.size();\r\n for (Revision revision : revisions) {\r\n System.out.println(\"\\n\" + count++ + \"/\" + total + \" Revision = \" + revision);\r\n\r\n for (Metric metric : nonProjectMetrics) {\r\n// Output.println(\" \" + metric);\r\n\r\n //get the list of items modified in this revision\r\n List<VersionedItemMetricValue> vimvs = versionedItemMetricValueService.getByRevisionAndMetric(revision, metric);\r\n\r\n// Output.println(\" Updating the measured items:\" + vimvs.size());\r\n //for each of them, update the map with the last measured value\r\n for (VersionedItemMetricValue vimv : vimvs) {\r\n// Output.println(\" >>> vimv = \" + vimv);\r\n if (vimv.getVersionedItem().getType() == VersionedItem.TYPE_DELETED) {\r\n mapNewestItemMeasurement.get(vimv.getMetric()).remove(vimv.getVersionedItem().getItem());\r\n } else {\r\n mapNewestItemMeasurement.get(vimv.getMetric()).put(vimv.getVersionedItem().getItem(), vimv.getDoubleValue());\r\n }\r\n }\r\n// Output.println(\" Calculating the value of revision\");\r\n //after update the map, it contains the last value of each item.\r\n\r\n // ================ início do novo método para o metric manager que deve contabilizar para MetricValue os VIMVs\r\n Double sum = 0d;\r\n int numberOfConsederedArtifacts = 0;\r\n StringBuilder strSoma = new StringBuilder();\r\n for (Double oneValue : mapNewestItemMeasurement.get(metric).values()) {\r\n// soma.append(\" + \").append(oneValue);\r\n if (!oneValue.isNaN()) {\r\n sum += oneValue;\r\n numberOfConsederedArtifacts++;\r\n }\r\n }\r\n if (metric.getAcronym().equals(MetricEnumeration.ACC.getAcronym())\r\n || metric.getAcronym().equals(MetricEnumeration.CAM.getAcronym())\r\n || metric.getAcronym().equals(MetricEnumeration.DAM.getAcronym())\r\n || metric.getAcronym().equals(MetricEnumeration.RMA.getAcronym())) {\r\n sum /= numberOfConsederedArtifacts;\r\n }\r\n MetricValue mv = new MetricValue(revision, metric, sum);\r\n // ================ fim do novo método\r\n\r\n strSoma.append(\" |\").append(mapNewestItemMeasurement.get(metric).values().size()).append(\"|\").append(\" = \").append(mv);\r\n Output.println(\" \" + strSoma.toString());\r\n\r\n metricValueService.save(mv);\r\n }\r\n }\r\n }", "@SuppressWarnings({ \"deprecation\", \"serial\" })\n\tprivate void doBatchCompute() {\n\t\tHConnection hConnection = null;\n\t\tHTableInterface hTableInterface = null;\n\t\tHBaseAdmin admin = null;\n\t\ttry {\n\t\t\t//scan the events table\n\t\t\thConnection = HConnectionManager.createConnection(conf);\n\t\t\thTableInterface = hConnection.getTable(DashboardUtils.curatedEvents);\n\t\t\tadmin = new HBaseAdmin(conf);\n\t\t\t\n\t\t\t//create an empty dataset here and do union or intersections in subsequent nested iterations\n\t\t\tList<DatasetBean> emptyFeed = new ArrayList<DatasetBean>();\n\t\t\tDatasetBean datasetBean = new DatasetBean();\n\t\t\t\n\t\t\t//start scanning through the table\n\t\t\tScan scan = new Scan();\n\t\t\tResultScanner scanner = hTableInterface.getScanner(scan);\n\t\t\tfor(Result r = scanner.next(); r != null; r = scanner.next()) {\n\t\t\t\t//to stop scanner from creating too many threads\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(3000);\n\t\t\t\t} catch(InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//cumulative set which is empty containing the DatasetBean class object\n\t\t\t\tDataset<Row> cumulativeSet = sparkSession.createDataFrame(emptyFeed, datasetBean.getClass());\n\t\t\t\t\n\t\t\t\t//scan through every row of feedEvents table and process each corresponding event\n\t\t\t\tif(!r.isEmpty()) {\n\t\t\t\t\teventTable = Bytes.toString(r.getRow());\n\t\t\t\t\t\n\t\t\t\t\t//create table if it didn't already exist\n\t\t\t\t\tif(!admin.tableExists(eventTable)) {\n\t\t\t\t\t\tHTableDescriptor creator = new HTableDescriptor(eventTable);\n\t\t\t\t\t\tcreator.addFamily(new HColumnDescriptor(DashboardUtils.eventTab_cf));\n\t\t\t\t\t\tadmin.createTable(creator);\n\t\t\t\t\t\tlogger.info(\"**************** just created the following table in batch process since it didn't exist: \" + eventTable);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//declare the dataset storing the data from betaFeed\n\t\t\t\t\tDataset<Row> feedDataSet;\n\t\t\t\t\t//long eventdatacount = eventmap.get(eventTable);\n\t\t\t\t\t\n\t\t\t\t\tcurrentStore = RSSFeedUtils.betatable;\n\t\t\t\t\t//this dataset is populated with betaFeed data\n\t\t\t\t\tfeedDataSet = loadbetaFeed();\n\t\t\t\t\t\n\t\t\t\t\t//store the data as a temporary table to process via sparkSQL\n\t\t\t\t\tfeedDataSet.createOrReplaceTempView(currentStore);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tfeedevents = Job.getInstance(conf);\n\t\t\t\t\tfeedevents.getConfiguration().set(TableOutputFormat.OUTPUT_TABLE, eventTable);\n\t\t\t\t\tfeedevents.setOutputFormatClass(TableOutputFormat.class);\n\t\t\t\t\t\n\t\t\t\t\t//read the tags attribute of the event, and start reading it from left to right....tags are in format as in the documentation\n\t\t\t\t\t//break the OR tag, followed by breaking the AND tag, followed by processing each tag or event contained in it\n\t\t\t\t\tString tags = \"\";\n\t\t\t\t\tif(r.containsColumn(Bytes.toBytes(DashboardUtils.curatedEvents_cf), Bytes.toBytes(DashboardUtils.curatedTags))) {\n\t\t\t\t\t\ttags = Bytes.toString(r.getValue(Bytes.toBytes(DashboardUtils.curatedEvents_cf), Bytes.toBytes(DashboardUtils.curatedTags)));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tString backupTagStr = tags;\n\t\t\t\t\t\n\t\t\t\t\twhile(tags.contains(\")\")) {\n\t\t\t\t\t\tString threstr=null;\n\t\t\t\t\t\tSystem.out.println(\"tags:\" + tags.trim());\n\t\t\t\t\t\t\n\t\t\t\t\t\tString[] ortagstrings = tags.trim().split(\"OR\");\n\t\t\t\t\t\tfor(String ortag : ortagstrings) {\n\t\t\t\t\t\t\tSystem.out.println(\"val of ortag:\" + ortag);\n\t\t\t\t\t\t\tthrestr = ortag.trim();\n\t\t\t\t\t\t\t//these are the parameters being fetched and populated in the events...i.e, feedname,totle,link,description,categories and date\n\t\t\t\t\t\t\tString qry =\"SELECT rssFeed, title, articleLink, description, categories, articleDate FROM \" + currentStore + \" WHERE \";\n\t\t\t\t\t\t\tStringBuilder querybuilder = new StringBuilder(qry);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSystem.out.println(\"tag:\"+ortag.trim());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] andtagstrings = ortag.trim().split(\"AND\");\n\t\t\t\t\t\t\tDataset<Row> andSet = sparkSession.createDataFrame(emptyFeed, datasetBean.getClass());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString proctag=null;\n\t\t\t\t\t\t\tfor(int i=0; i<andtagstrings.length; i++) {\n\t\t\t\t\t\t\t\tproctag = andtagstrings[i];\n\t\t\t\t\t\t\t\tSystem.out.println(\"process tag:\" + proctag);\n\t\t\t\t\t\t\t\t//if the part of the tag being processed is an event, open up a second stream to load data from corresponding table\n\t\t\t\t\t\t\t\tif(proctag.trim().replaceAll(\"\\\\(\", \"\").startsWith(\"EVENT\")) {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"qwerty:\" + proctag.trim());\n\t\t\t\t\t\t\t\t\tString curatedevent = proctag.trim().substring(6, proctag.trim().length()).trim().replaceAll(\" \", \"__\").replaceAll(\"\\\\)\", \"\");\n\t\t\t\t\t\t\t\t\tlogger.info(\"################################################################################# event:\"+curatedevent);\n\t\t\t\t\t\t\t\t\t//dataset comes here\n\t\t\t\t\t\t\t\t\tif(admin.tableExists(curatedevent)) {\n\t\t\t\t\t\t\t\t\t\tDataset<Row> eventdataset = loadcuratedEvent(curatedevent);\n\t\t\t\t\t\t\t\t\t\tlogger.info(\"**************************************************** event:\" + curatedevent + \" while processing:\"+eventTable);\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\tif(i==0) {\n\t\t\t\t\t\t\t\t\t\t\tandSet = eventdataset.union(andSet);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(andSet.count() == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\tandSet = eventdataset.union(andSet);\n\t\t\t\t\t\t\t\t\t\t\t} else if(andSet.count() > 0) {\n\t\t\t\t\t\t\t\t\t\t\t\tandSet = eventdataset.intersect(andSet);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tlogger.info(\"*************************** event \" + curatedevent + \" does not exist *********************************\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//if it's a normal tag, make a sparkSQL query out of it\n\t\t\t\t\t\t\t\t} else if(!proctag.trim().replaceAll(\"\\\\(\", \"\").startsWith(\"EVENT\")) {\n\t\t\t\t\t\t\t\t\tquerybuilder.append(\"categories RLIKE '\" + proctag.trim().replaceAll(\"\\\\(\", \"\").replaceAll(\"\\\\)\", \"\") + \"' AND \");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//once the tag is fully processed, merge all data points and store in a resultant dataset\n\t\t\t\t\t\t\tif(querybuilder.toString().length() > qry.length()) {\n\t\t\t\t\t\t\t\t//logger.info(\"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ inside query string ###############################\");\n\t\t\t\t\t\t\t\tquerybuilder = new StringBuilder(querybuilder.toString().substring(0, querybuilder.toString().length() -5));\n\t\t\t\t\t\t\t\t//dataset comes here\n\t\t\t\t\t\t\t\tDataset<Row> queryset = sparkSession.sql(querybuilder.toString());\n\n\t\t\t\t\t\t\t\t//id the set it empty, fill it with the single data point\n\t\t\t\t\t\t\t\tif(andSet.count() == 0 && !backupTagStr.contains(\"EVENT\")) {\n\t\t\t\t\t\t\t\t\tandSet = queryset.union(andSet);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tlogger.info(\"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ doing query string with zero count:\" + eventTable);\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\t\n\t\t\t\t\t\t\t\t\tlogger.info(\"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ doing intersect for query:\" + eventTable);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tandSet.createOrReplaceTempView(\"andSet1\");\n\t\t\t\t\t\t\t\t\tqueryset.createOrReplaceTempView(\"querySet1\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tDataset<Row> fSet = sparkSession.sql(\"SELECT DISTINCT(a.*) FROM andSet1 a INNER JOIN querySet1 b ON a.title = b.title\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tandSet = fSet;\n\t\t\t\t\t\t\t\t\tqueryset.unpersist();\n\t\t\t\t\t\t\t\t\tfSet.unpersist();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcumulativeSet = andSet.union(cumulativeSet);\n\t\t\t\t\t\t\tandSet.unpersist();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\ttags = tags.substring(threstr.length(), tags.length()).trim().replaceAll(\"\\\\)\", \"\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlogger.info(\"########################################################################################################### table:\"+eventTable);\n\t\t\t\t\t\n\t\t\t\t\tcumulativeSet.createOrReplaceTempView(\"cumulativeEvent\");\n\t\t\t\t\n\t\t\t\t\t//as a double check, only fetch distinct records from all the merges...done via sparkSQL\n\t\t\t\t\tDataset<Row> finalSet = sparkSession.sql(\"SELECT DISTINCT(*) FROM cumulativeEvent\");\n\t\t\t\t\t\n\t\t\t\t\tJavaRDD<Row> eventRDD = finalSet.toJavaRDD();\n\t\t\t\t\tJavaPairRDD<ImmutableBytesWritable, Put> eventpairRDD = eventRDD.mapToPair(new PairFunction<Row, ImmutableBytesWritable, Put>() {\n\n\t\t\t\t\t\tpublic Tuple2<ImmutableBytesWritable, Put> call(Row arg0) throws Exception {\n\t\t\t\t\t\t\tObject link = arg0.getAs(\"articleLink\");\n\t\t\t\t\t\t\tif((String)link != null) {\n\t\t\t\t\t\t\t\t//parameters being populated into the events table\n\t\t\t\t\t\t\t\treturn DashboardUtils.objectsofCuratedEvents(arg0.getAs(\"rssFeed\"), arg0.getAs(\"title\"), link, arg0.getAs(\"description\"), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\targ0.getAs(\"categories\"), arg0.getAs(\"articleDate\"));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn DashboardUtils.objectsofCuratedEvents(arg0.getAs(\"rssFeed\"), arg0.getAs(\"title\"), \"link not available\", arg0.getAs(\"description\"), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\targ0.getAs(\"categories\"), arg0.getAs(\"articleDate\"));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tlogger.info(\"******************************** going to dump curated events data in hbase for event: \" + eventTable);\n\t\t\t\t\teventpairRDD.saveAsNewAPIHadoopDataset(feedevents.getConfiguration());\n\t\t\t\t\t\n\t\t\t\t\teventRDD.unpersist();\n\t\t\t\t\tfinalSet.unpersist();\n\t\t\t\t\tcumulativeSet.unpersist();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tscanner.close();\n\t\t\thTableInterface.close();\n\t\t\thConnection.close();\n\t\t\t\n\t\t} catch(IOException e) {\n\t\t\tlogger.info(\"error while establishing Hbase connection...\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void crossref(){\r\n reftable = new ArrayList();\r\n if(!log.isEmpty() && ses.isEmpty()){\r\n for(int i=0 ; i<log.size() ; i++){\r\n all_log alg = new all_log(log.get(i).getuserid(), log.get(i).getuserip(), log.get(i).geturl(), log.get(i).gettime(), \"\", \"\");\r\n reftable.add(alg);\r\n }\r\n }else if(!ses.isEmpty() && log.isEmpty()) {\r\n for(int i=0 ; i<ses.size() ; i++){\r\n ArrayList<AndroidRec> ad = ses.get(i).getrec();\r\n for(int j=0 ; j<ad.size() ; j++) {\r\n all_log alg = new all_log(\"unknow\", \"unknow\", ad.get(j).geturl(), ad.get(j).gettime(), ad.get(j).getsystem(), ad.get(j).getsoft());\r\n reftable.add(alg);\r\n }\r\n }\r\n }else if(!ses.isEmpty() && !log.isEmpty()){\r\n for(int i=0 ; i<log.size() ; i++){\r\n all_log alg = new all_log(log.get(i).getuserid(), log.get(i).getuserip(), log.get(i).geturl(), log.get(i).gettime(), \"\", \"\");\r\n reftable.add(alg);\r\n }\r\n\r\n \r\n \r\n for(int k=0 ; k<ses.size() ; k++) {\r\n ArrayList<usersort> sort = new ArrayList<usersort>();\r\n ArrayList userid = new ArrayList(); \r\n ArrayList<Integer> poss = new ArrayList(); \r\n ArrayList<AndroidRec> ad = new ArrayList();\r\n ad.addAll(ses.get(k).getrec());\r\n \r\n for(int n=0 ; n<ad.size() ; n++){\r\n long andtime = Long.parseLong(ad.get(n).gettime());\r\n for(int t=0 ; t<reftable.size() ; t++){\r\n long logtime = (Long.parseLong(reftable.get(t).gettime()))*1000;\r\n if((logtime-andtime)>60000)\r\n break;\r\n if(Math.abs(andtime - logtime) <= 60000){\r\n String andurl = ad.get(n).geturl();\r\n String logurl = reftable.get(t).geturl();\r\n if(andurl.equals(logurl)){\r\n userid.add(reftable.get(t).getid());\r\n poss.add(n);\r\n poss.add(t);\r\n }\r\n }\r\n }\r\n }\r\n //find correct in matches\r\n \r\n for(int i=0 ; i<userid.size() ; i++){\r\n if(sort.isEmpty()){\r\n usersort so = new usersort(userid.get(i).toString());\r\n sort.add(so);\r\n }\r\n for(int j=0 ; j<sort.size() ; j++){ \r\n if(userid.get(i).toString().equals(sort.get(j).getid())){\r\n sort.get(j).accnum();\r\n }else if(j==(sort.size()-1) && !userid.get(i).toString().equals(sort.get(j).getid())){\r\n usersort so = new usersort(userid.get(i).toString());\r\n sort.add(so);\r\n }\r\n }\r\n }\r\n String correctuser = \"\";\r\n int usernum = 0;\r\n for(int s=0 ; s<sort.size() ; s++){\r\n if((sort.get(s).getnum())>usernum){\r\n usernum = sort.get(s).getnum();\r\n correctuser = sort.get(s).getid();\r\n }\r\n }\r\n //\r\n \r\n //\r\n if(!ad.isEmpty()){\r\n int del = 0;\r\n for(int i=0 ; i<poss.size() ; i+=2){\r\n if((reftable.get(poss.get(i+1))).getid().equals(correctuser)){\r\n if(!ad.isEmpty()){\r\n reftable.get(poss.get(i+1)).setsys(ad.get(poss.get(i)-del).getsystem());\r\n reftable.get(poss.get(i+1)).setsoft(ad.get(poss.get(i)-del).getsoft());\r\n int index = poss.get(i) - del;\r\n ad.remove(index);\r\n del = del + 1;\r\n }\r\n }\r\n }\r\n }\r\n for(int i=0 ; i<ad.size() ; i++){\r\n all_log alg = new all_log(\"unknow\", \"unknow\", ad.get(i).geturl(), ad.get(i).gettime(), ad.get(i).getsystem(), ad.get(i).getsoft());\r\n reftable.add(alg);\r\n }\r\n sort.clear();\r\n }\r\n }\r\n\r\n for(int i=0 ; i<reftable.size() ; i++){\r\n long sort = 0;\r\n if(reftable.get(i).gettime().length() == 13){\r\n sort = Long.parseLong(reftable.get(i).gettime());\r\n }else if (reftable.get(i).gettime().length() == 10){\r\n sort = Long.parseLong(reftable.get(i).gettime())*1000;\r\n }\r\n reftable.get(i).settime((new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").format(new Date(sort))).toString());\r\n //System.out.println(reftable.get(i).toString());\r\n //System.out.println(reftable.size());\r\n }\r\n }", "public static void testIteratorEqualsOtherMethods(RatingsDataset<Rating> ratingsDataset) {\n\n int errors = 0;\n try {\n\n Map<Integer, Integer> numRatingsUsers_byIterator = new TreeMap<Integer, Integer>();\n Map<Integer, Integer> numRatingsItems_byIterator = new TreeMap<Integer, Integer>();\n\n for (Rating r : ratingsDataset) {\n int idUser = r.getIdUser();\n int idItem = r.getIdItem();\n\n ratingsDataset.getRating(idUser, idItem);\n\n if (numRatingsUsers_byIterator.containsKey(idUser)) {\n numRatingsUsers_byIterator.put(idUser, numRatingsUsers_byIterator.get(idUser) + 1);\n } else {\n numRatingsUsers_byIterator.put(idUser, 1);\n }\n\n if (numRatingsItems_byIterator.containsKey(idItem)) {\n numRatingsItems_byIterator.put(idItem, numRatingsItems_byIterator.get(idItem) + 1);\n } else {\n numRatingsItems_byIterator.put(idItem, 1);\n }\n\n }\n\n for (int idUser : ratingsDataset.allUsers()) {\n int numRatingsUser_byGetRatings = ratingsDataset.getUserRatingsRated(idUser).size();\n int numRatingsUser_ByIterator = numRatingsUsers_byIterator.get(idUser);\n\n if (numRatingsUser_byGetRatings != numRatingsUser_ByIterator) {\n Global.showWarning(\"El usuario \" + idUser + \" tiene:\\n\"\n + \"\\t\" + numRatingsUser_byGetRatings + \" valoraciones según el método getUserRatingsRated(idUser) \\n\"\n + \"\\t\" + numRatingsUser_ByIterator + \" valoraciones según el iterador\");\n errors++;\n }\n }\n\n final Set<Integer> allRatedItems = new TreeSet<Integer>(ratingsDataset.allRatedItems());\n\n for (int idItem : allRatedItems) {\n\n int numRatingsItem_byGetRatings = ratingsDataset.getItemRatingsRated(idItem).size();\n int numRatingsItem_ByIterator = numRatingsItems_byIterator.get(idItem);\n\n if (numRatingsItem_byGetRatings != numRatingsItem_ByIterator) {\n Global.showWarning(\"El producto \" + idItem + \" tiene:\\n\"\n + \"\\t\" + numRatingsItem_byGetRatings + \" valoraciones según el método getItemRatingsRated(idItem) \\n\"\n + \"\\t\" + numRatingsItem_ByIterator + \" valoraciones según el iterador\");\n errors++;\n }\n }\n\n if (numRatingsItems_byIterator.keySet().equals(allRatedItems)) {\n } else {\n errors++;\n Global.showWarning(\"El conjunto de items valorados es distinto.\");\n\n Set<Integer> AMinusB = new TreeSet<Integer>(numRatingsItems_byIterator.keySet());\n AMinusB.removeAll(allRatedItems);\n\n Set<Integer> BMinusA = new TreeSet<Integer>(allRatedItems);\n BMinusA.removeAll(numRatingsItems_byIterator.keySet());\n\n if (!AMinusB.isEmpty()) {\n Global.showWarning(\"Produtos que no están en el allItemsRated --> \" + AMinusB.toString());\n }\n if (!BMinusA.isEmpty()) {\n Global.showWarning(\"Produtos que no están según el iterador --> \" + BMinusA.toString());\n }\n }\n\n if (numRatingsUsers_byIterator.keySet().equals(ratingsDataset.allUsers())) {\n } else {\n errors++;\n Global.showWarning(\"El conjunto de usuarios es distinto.\");\n }\n\n } catch (UserNotFound ex) {\n ERROR_CODES.USER_NOT_FOUND.exit(ex);\n } catch (ItemNotFound ex) {\n ERROR_CODES.ITEM_NOT_FOUND.exit(ex);\n }\n if (errors == 0) {\n Global.showWarning(\"Finished the dataset test.\");\n } else {\n Global.showWarning(\"Finished the dataset test with \" + errors + \" errors.\");\n }\n }", "@Override\n public Iterator<? extends Map.Entry<Key, Value>> reduceKV(Iterator<Map.Entry<Key, Value>> iter) {\n Key keyBeforeTT = null, keyAfterTT = null;\n Value valueBeforeTT = null;\n List<Value> valuesAfterTT = new LinkedList<>();\n\n while (iter.hasNext()) {\n Map.Entry<Key, Value> next = iter.next();\n Key k = next.getKey();\n Value v = next.getValue();\n\n if (k.getTimestamp() < tt) {\n if (keyBeforeTT == null || k.getTimestamp() > keyBeforeTT.getTimestamp()) {\n keyBeforeTT = k;\n valueBeforeTT = v;\n }\n } else {\n if (keyAfterTT == null || k.getTimestamp() > keyAfterTT.getTimestamp())\n keyAfterTT = k;\n valuesAfterTT.add(v);\n }\n }\n\n // Entries with ts >= tt are summed together into one entry with the timestamp of the most recent one.\n // If no entry is seen with ts < tt and we are on scan or full majc scope, then no entries are emitted.\n if (sScope == SScope.SCAN_OR_MAJC_FULL && keyBeforeTT == null)\n return null;\n\n // All entries are emitted after applying the above rules.\n if (keyBeforeTT == null && keyAfterTT == null)\n return null;\n else if (keyAfterTT == null)\n return Iterators.singletonIterator(new AbstractMap.SimpleImmutableEntry<>(keyBeforeTT, valueBeforeTT));\n else if (keyBeforeTT == null)\n return Iterators.singletonIterator(new AbstractMap.SimpleImmutableEntry<>(keyAfterTT, summer.reduce(keyAfterTT, valuesAfterTT.iterator())));\n else {\n // emit most recent entry first\n return new PeekingIterator2<Map.Entry<Key, Value>>(\n new AbstractMap.SimpleImmutableEntry<>(keyAfterTT, summer.reduce(keyAfterTT, valuesAfterTT.iterator())),\n new AbstractMap.SimpleImmutableEntry<>(keyBeforeTT, valueBeforeTT)\n );\n }\n }", "public static void scanDirty(List<Intersection> sections){\n for(int i = 0; i<sections.size(); i++){\n Intersection section = sections.get(i);\n if(section.dirty != 0){\n int startI = i;\n double min = Double.MAX_VALUE;\n for(int j = 0; j<sections.size(); j++){\n if(j == startI){\n continue;\n }\n Intersection other = sections.get(j);\n\n double m = Vector3DOps.mag(Vector3DOps.difference(other.location, section.location));\n if(m < min){\n min = m;\n }\n if( m < Math.abs(section.dirty) ){\n System.out.println(\"should take it: \" + other.dirty);\n //System.out.println(\"removing: \" + i + \", \" + m + \" < \" + section.dirty);\n //System.out.println(\"\\t by: \" + j + \" , \" + other.dirty);\n if(startI > i){\n continue;\n }\n sections.remove(i);\n i--;j--;\n }\n }\n if( startI > i){\n System.out.println(\"removed\");\n } else{\n System.out.println(\"left\");\n }\n }\n }\n\n\n }", "@Test\n public void iterateTestsSame() throws Exception {\n final int nThreads = 100;\n ExecutorService executor = Executors.newFixedThreadPool(nThreads);\n final AtomicReference<Throwable> ex = new AtomicReference<>(null);\n final int nTasks = 10_000;\n final CountDownLatch latch = new CountDownLatch(nTasks);\n final ConcurrentHashMap<Integer, String> map = new ConcurrentHashMap<>();\n for (int i = 0; i < nTasks; i++) {\n final int j = i;\n executor.submit(new Runnable() {\n public void run() {\n try {\n map.put(j, \"foo\");\n testSubmitSilentWithParamMutationSameCommand(new Consumer<String>() {\n @Override\n public void accept(String s) {\n map.remove(j);\n if (\"FAIL\".equals(s)) {\n ex.compareAndSet(null, new Exception(\"WE HAD AN ERROR in \" + j));\n }\n }\n }\n );\n } catch (Throwable t) {\n ex.compareAndSet(null, t);\n } finally {\n latch.countDown();\n }\n }});\n }\n System.out.println(\"Waiting on latch\");\n while (!latch.await(30, TimeUnit.SECONDS)) {\n System.out.println(\"Waiting, \" + latch.getCount() + \" outstanding\");\n System.out.println(\"Waiting keys \" + map.keySet().size());\n }\n executor.shutdown();\n System.out.println(\"Waiting, on executor\");\n executor.awaitTermination(30, TimeUnit.SECONDS);\n executor.shutdownNow();\n if (ex.get() != null) {\n // If this fails, there has been at least one error.\n Assert.assertNull(ex.get());\n }\n }", "int insertSelective(TbSnapshot record);", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_5() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class, true);\r\n\t\t\t\t\r\n\t\t\t\tHashMap<String,Object> o2 = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t\t\r\n\t\t\t\to = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, \r\n\t\t\t\t\t\tdate, null, userData, null);\r\n\t\t\t\to2 = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, \r\n\t\t\t\t\t\tdate, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void testCompactRangeIndexOnPR() {\n Host host = Host.getHost(0);\n VM vm0 = host.getVM(0);\n VM vm1 = host.getVM(1);\n VM vm2 = host.getVM(2);\n VM vm3 = host.getVM(3);\n setCacheInVMs(vm0, vm1, vm2, vm3);\n vm0.invoke(helper.getCacheSerializableRunnableForPRAccessorCreate(regionName, redundancy,\n Portfolio.class));\n\n vm1.invoke(\n helper.getCacheSerializableRunnableForPRCreate(regionName, redundancy, Portfolio.class));\n\n vm2.invoke(\n helper.getCacheSerializableRunnableForPRCreate(regionName, redundancy, Portfolio.class));\n\n vm3.invoke(\n helper.getCacheSerializableRunnableForPRCreate(regionName, redundancy, Portfolio.class));\n\n vm0.invoke(helper.getCacheSerializableRunnableForPRIndexCreate(regionName, indexName,\n indexedExpression, fromClause, alias));\n\n\n AsyncInvocation<?>[] asyncInvs = new AsyncInvocation[12];\n\n asyncInvs[0] =\n vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));\n\n asyncInvs[1] = vm1.invokeAsync(\n helper.getCacheSerializableRunnableForPRRandomOps(regionName, stepSize, (2 * stepSize)));\n\n asyncInvs[2] = vm2.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (2 * stepSize), (3 * stepSize)));\n\n asyncInvs[3] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (3 * (stepSize)), totalDataSize));\n\n asyncInvs[4] =\n vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));\n\n asyncInvs[5] = vm1.invokeAsync(\n helper.getCacheSerializableRunnableForPRRandomOps(regionName, stepSize, (2 * stepSize)));\n\n asyncInvs[6] = vm2.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (2 * stepSize), (3 * stepSize)));\n\n asyncInvs[7] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (3 * (stepSize)), totalDataSize));\n\n asyncInvs[8] =\n vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));\n\n asyncInvs[9] = vm1.invokeAsync(\n helper.getCacheSerializableRunnableForPRRandomOps(regionName, stepSize, (2 * stepSize)));\n\n asyncInvs[10] = vm2.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (2 * stepSize), (3 * stepSize)));\n\n asyncInvs[11] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (3 * (stepSize)), totalDataSize));\n\n for (AsyncInvocation<?> inv : asyncInvs) {\n ThreadUtils.join(inv, 60 * 000);\n }\n\n for (AsyncInvocation<?> inv : asyncInvs) {\n if (inv.exceptionOccurred()) {\n Assert.fail(\"Random region operation failed on VM_\" + inv.getId(), inv.getException());\n }\n }\n vm0.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n\n vm1.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n\n vm2.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n\n vm3.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n }", "private void compareSecondPass() {\n final int arraySize = this.oldFileNoMatch.size()\r\n + this.newFileNoMatch.size();\r\n this.compareArray = new SubsetElement[arraySize][2];\r\n final Iterator<String> oldIter = this.oldFileNoMatch.keySet()\r\n .iterator();\r\n int i = 0;\r\n while (oldIter.hasNext()) {\r\n final String key = oldIter.next();\r\n final SubsetElement oldElement = this.oldFileNoMatch.get(key);\r\n SubsetElement newElement = null;\r\n if (this.newFileNoMatch.containsKey(key)) {\r\n newElement = this.newFileNoMatch.get(key);\r\n }\r\n this.compareArray[i][0] = oldElement;\r\n this.compareArray[i][1] = newElement;\r\n i++;\r\n }\r\n // now go through the new elements and check for any that have no match.\r\n // these will be new elements with no corresponding old element\r\n final SubsetElement oldElement = null;\r\n final Iterator<String> newIter = this.newFileNoMatch.keySet()\r\n .iterator();\r\n while (newIter.hasNext()) {\r\n final String key = newIter.next();\r\n if (!this.oldFileNoMatch.containsKey(key)) {\r\n final SubsetElement newElement = this.newFileNoMatch.get(key);\r\n this.compareArray[i][0] = oldElement;\r\n this.compareArray[i][1] = newElement;\r\n i++;\r\n }\r\n\r\n }\r\n\r\n }", "public void MeasureMovement(int[] dupCellID, int numslices, int b){\r\n\t\tfor (int x = 1; x < b; x = x + 1){ \r\n\t\t\tIJ.selectWindow(dupCellID[x]);\r\n\t\t\tImagePlus TheDuplicate = WindowManager.getCurrentImage();\r\n\t\t\tIJ.run(\"Threshold...\",\"method='Default'\");\r\n\t\t\tnew WaitForUserDialog(\"Threshold\", \"Threshold yeast cell to select the nucleus, then click OK.\").show();\r\n\t\t\tResultsTable res = new ResultsTable();\r\n\t\t\tdouble[] SliceNumY = new double[numslices];\r\n\t\t\tdouble[] SliceNumX = new double[numslices];\r\n\t\t\t\tfor(int z = 1; z < numslices; z = z+1) {\r\n\t\t\t\t\tTheDuplicate.setSlice(z);\r\n\t\t\t\t\tIJ.run(TheDuplicate, \"Analyze Particles...\", \"size=100-550 pixel circularity=0.00-1.00 show=Nothing display clear include add slice\");\r\n\t\t\t\t\tres = Analyzer.getResultsTable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tint MaxY = TheDuplicate.getHeight();\r\n\t\t\t\t\tint Midpoint = MaxY/2; \r\n\t\t\t\t\tint MaxCount = res.getCounter();\r\n\t\t\t\t\tdouble yVal = 0;\r\n\t\t\t\t\tdouble xVal = 0;\r\n\t\t\t\t\tif (MaxCount > 1){\r\n\t\t\t\t\t\tfor (int c = 0; c < (MaxCount - 1); c = c + 1){\r\n\t\t\t\t\t\t\tyVal = res.getValueAsDouble(7, c);\r\n\t\t\t\t\t\t\txVal = res.getValueAsDouble(6, c);\r\n\t\t\t\t\t\t\tif (Math.abs((yVal/0.13) - Midpoint) <= 10 ){\r\n\t\t\t\t\t\t\t\tyVal = res.getValueAsDouble(7, c);\r\n\t\t\t\t\t\t\t\txVal = res.getValueAsDouble(6, c);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * if statement to only record the centre X Y \r\n\t\t\t\t\t * coordinate of the nucleus when 1 object has \r\n\t\t\t\t\t * been found. If more than 1 object is identified\r\n\t\t\t\t\t * then the XY coordinates default to zero to prevent \r\n\t\t\t\t\t * other fluorescent cell components from skewing the data\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (MaxCount > 0 && MaxCount <2) {\r\n\t\t\t\t\t\tyVal = res.getValueAsDouble(7, 0);\r\n\t\t\t\t\t\txVal = res.getValueAsDouble(6, 0);\r\n\t\t\t\t\t\tSliceNumY[z] = yVal;\r\n\t\t\t\t\t\tSliceNumX[z] = xVal; \r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tSliceNumY[z] = 0;\r\n\t\t\t\t\t\tSliceNumX[z] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\toutputinfo(SliceNumY, SliceNumX, numslices); //Write the results to text file\r\n\t\t\tTheDuplicate.changes = false;\t\r\n\t\t\tTheDuplicate.close();\r\n\t\t}\r\n\t}", "public List<StockCounter> compareOldAndNewStepToExtractStockMotionsAndUpdateStockCounters(Etape oldEtape, Etape newEtape, CounterType counterTypeFrom, CounterType counterTypeTo);", "@Test\n\tpublic void ensureBug77IsSolved() {\n\t\tTag a = new Tag(A);\n\t\ttagService.create(a);\n\t\tTag b = tagService.create(new Tag(B));\n\t\tTag c = tagService.create(new Tag(C));\n\t\tIterable<Tag> values = tagService.find().matching(\n\t\t\t\tnew QueryBuilder<TagInformer>() {\n\n\t\t\t\t\tpublic QueryExpression createMatchingExpression(\n\t\t\t\t\t\t\tTagInformer object) {\n\t\t\t\t\t\treturn object.getText().equalsToIgnoreCase(\"a\");\n\t\t\t\t\t}\n\t\t\t\t}).getAll();\n\t\tassertThat(values, IsCollectionContaining.hasItems(a));\n\t\tassertThat(values, IsNot.not(IsCollectionContaining.hasItems(b, c)));\n\t}", "public void search(IndexShort < O > index, short range, short k)\n throws Exception {\n // assertEquals(index.aDB.count(), index.bDB.count());\n // assertEquals(index.aDB.count(), index.bDB.count());\n // index.stats();\n index.resetStats();\n // it is time to Search\n int querySize = 1000; // amount of elements to read from the query\n String re = null;\n logger.info(\"Matching begins...\");\n File query = new File(testProperties.getProperty(\"test.query.input\"));\n File dbFolder = new File(testProperties.getProperty(\"test.db.path\"));\n BufferedReader r = new BufferedReader(new FileReader(query));\n List < OBPriorityQueueShort < O >> result = new LinkedList < OBPriorityQueueShort < O >>();\n re = r.readLine();\n int i = 0;\n long realIndex = index.databaseSize();\n\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n OBPriorityQueueShort < O > x = new OBPriorityQueueShort < O >(\n k);\n if (i % 100 == 0) {\n logger.info(\"Matching \" + i);\n }\n\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n if(i == 279){\n System.out.println(\"hey\");\n }\n index.searchOB(s, range, x);\n result.add(x);\n i++;\n }\n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n \n logger.info(index.getStats().toString());\n \n int maxQuery = i;\n // logger.info(\"Matching ends... Stats follow:\");\n // index.stats();\n\n // now we compare the results we got with the sequential search\n Iterator < OBPriorityQueueShort < O >> it = result.iterator();\n r.close();\n r = new BufferedReader(new FileReader(query));\n re = r.readLine();\n i = 0;\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n if (i % 300 == 0) {\n logger.info(\"Matching \" + i + \" of \" + maxQuery);\n }\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n OBPriorityQueueShort < O > x2 = new OBPriorityQueueShort < O >(\n k);\n searchSequential(realIndex, s, x2, index, range);\n OBPriorityQueueShort < O > x1 = it.next();\n //assertEquals(\"Error in query line: \" + i + \" slice: \"\n // + line, x2, x1); \n \n assertEquals(\"Error in query line: \" + i + \" \" + index.debug(s) + \"\\n slice: \"\n + line + \" \" + debug(x2,index ) + \"\\n\" + debug(x1,index), x2, x1);\n\n i++;\n }\n \n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n r.close();\n logger.info(\"Finished matching validation.\");\n assertFalse(it.hasNext());\n }", "private void compareFirstPass() {\n this.oldFileNoMatch = new HashMap<String, SubsetElement>();\r\n Iterator<String> iter = this.oldFile.keySet().iterator();\r\n while (iter.hasNext()) {\r\n final String key = iter.next();\r\n if (!this.newFile.containsKey(key)) {\r\n final String newKey = this.oldFile.get(key).getSubsetCode()\r\n + this.oldFile.get(key).getConceptCode();\r\n this.oldFileNoMatch.put(newKey, this.oldFile.get(key));\r\n }\r\n }\r\n\r\n // Now repeat going the other way, pulling all new file no matches into\r\n // newFileNoMatch\r\n this.newFileNoMatch = new HashMap<String, SubsetElement>();\r\n iter = this.newFile.keySet().iterator();\r\n while (iter.hasNext()) {\r\n final String key = iter.next();\r\n if (!this.oldFile.containsKey(key)) {\r\n final String newKey = this.newFile.get(key).getSubsetCode()\r\n + this.newFile.get(key).getConceptCode();\r\n this.newFileNoMatch.put(newKey, this.newFile.get(key));\r\n }\r\n }\r\n\r\n // dump the initial large HashMaps to reclaim some memory\r\n this.oldFile = null;\r\n this.newFile = null;\r\n }", "@Override\r\n\tpublic boolean startIterateSnapShotRecords() {\n\t\tCollection <Record> records = new ArrayList <Record> ();\r\n\t\tErrorAndLogMsg m = clientProxy.getRecordSnapshot(records);\r\n\t\t\r\n\t\tif (m!=null && m.anyError())\r\n\t\t\treturn false;\r\n\t\telse {\r\n\t\t\titerSnapshot = records.iterator();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public void checkForTag(int i) {\n if (wordsOfInput[i].indexOf('#') == 0) {\n if ((!containsStartDate || !containsStartTime) && index > i) {\n index = i;\n tpsIndex = i;\n }\n String tag = wordsOfInput[i].substring(1);\n tags.add(tag);\n }\n }", "int getRequestedValues(int index);", "public void c() {\n List<Long> b2 = this.f17034e.b();\n ArrayList arrayList = new ArrayList();\n List<Long> a2 = this.f17035f.a(new OrderKey(false, 9));\n new ArrayList();\n ArrayList arrayList2 = new ArrayList();\n ArrayList arrayList3 = new ArrayList();\n for (Long next : b2) {\n DBCheckoutItem a3 = this.f17032c.a(next.longValue());\n if (a3 == null) {\n arrayList.add(next);\n } else {\n CheckoutItem checkoutItem = new CheckoutItem();\n List<DBOrderDetail> a4 = this.i.a(next);\n ArrayList arrayList4 = new ArrayList();\n for (DBOrderDetail next2 : a4) {\n DBUserInfo a5 = this.f17033d.a(next2.c());\n if (a5 == null) {\n arrayList3.add(Integer.valueOf(next2.c()));\n }\n DBUserInfo a6 = this.f17033d.a(next2.E());\n if (a6 == null) {\n arrayList3.add(Integer.valueOf(next2.E()));\n }\n OrderDetail orderDetail = new OrderDetail();\n if (this.f17033d.c(next2.E())) {\n b.a(next2, a5, orderDetail);\n } else {\n b.a(next2, a6, orderDetail);\n }\n long firstItemSnapshotId = orderDetail.getFirstItemSnapshotId();\n if (firstItemSnapshotId > 0) {\n DBItemSnapShot c2 = this.f17036g.c(firstItemSnapshotId);\n if (c2 == null) {\n new aq().a(next2.b(), firstItemSnapshotId);\n } else {\n com.shopee.app.data.store.b.a.a(c2, this.h, orderDetail);\n }\n } else {\n com.shopee.app.data.store.b.a.a((DBItemSnapShot) null, this.h, orderDetail);\n }\n if (a2.contains(Long.valueOf(orderDetail.getCheckoutId()))) {\n orderDetail.setUnread(true);\n } else {\n orderDetail.setUnread(false);\n }\n arrayList4.add(orderDetail);\n }\n if (arrayList3.size() > 0) {\n new au().a((List<Integer>) arrayList3);\n }\n List<DBCheckoutOrder> i2 = a3.i();\n ArrayList arrayList5 = new ArrayList();\n for (DBCheckoutOrder a7 : i2) {\n CheckoutOrderInfo checkoutOrderInfo = new CheckoutOrderInfo();\n b.a(a7, (String) null, checkoutOrderInfo);\n arrayList5.add(checkoutOrderInfo);\n }\n b.a(a3, (List<OrderDetail>) arrayList4, (List<CheckoutOrderInfo>) arrayList5, this.j.getChangePaymentOption(), checkoutItem);\n if (a2.contains(Long.valueOf(checkoutItem.getCheckoutId()))) {\n checkoutItem.setUnread(true);\n } else {\n checkoutItem.setUnread(false);\n }\n arrayList2.add(checkoutItem);\n }\n }\n this.f16402a.a(\"CHECKOUT_LIST_LOCAL_LOAD\", new com.garena.android.appkit.b.a(arrayList2));\n }", "@Override\n public boolean next(Void aVoid, ArrayWritable arrayWritable) throws IOException {\n boolean result = this.parquetReader.next(aVoid, arrayWritable);\n if(!result) {\n // if the result is false, then there are no more records\n return false;\n } else {\n // TODO(VC): Right now, we assume all records in log, have a matching base record. (which would be true until we have a way to index logs too)\n // return from delta records map if we have some match.\n String key = arrayWritable.get()[HoodieRealtimeInputFormat.HOODIE_RECORD_KEY_COL_POS].toString();\n if (LOG.isDebugEnabled()) {\n LOG.debug(String.format(\"key %s, base values: %s, log values: %s\",\n key, arrayWritableToString(arrayWritable), arrayWritableToString(deltaRecordMap.get(key))));\n }\n if (deltaRecordMap.containsKey(key)) {\n Writable[] replaceValue = deltaRecordMap.get(key).get();\n Writable[] originalValue = arrayWritable.get();\n System.arraycopy(replaceValue, 0, originalValue, 0, originalValue.length);\n arrayWritable.set(originalValue);\n }\n return true;\n }\n }", "@Test\n public void iterateTests() throws Exception {\n final int nThreads = 100;\n ExecutorService executor = Executors.newFixedThreadPool(nThreads);\n final AtomicReference<Throwable> ex = new AtomicReference<>(null);\n final int nTasks = 10_000;\n final CountDownLatch latch = new CountDownLatch(nTasks);\n final ConcurrentHashMap<Integer, Future<?>> map = new ConcurrentHashMap<>();\n for (int i = 0; i < nTasks; i++) {\n final int j = i;\n map.put(j, executor.submit(new Runnable() {\n public void run() {\n try {\n testSubmitSilentWithParamMutation();\n testSubmitSilentWithParamMutationUncacheable();\n } catch (Throwable t) {\n ex.compareAndSet(null, t);\n } finally {\n latch.countDown();\n map.remove(j);\n }\n }}));\n }\n System.out.println(\"Waiting on latch\");\n while (!latch.await(30, TimeUnit.SECONDS)) {\n System.out.println(\"Waiting, \" + latch.getCount() + \" outstanding\");\n System.out.println(\"Waiting keys \" + map.keySet());\n }\n executor.shutdown();\n System.out.println(\"Waiting, on executor\");\n executor.awaitTermination(30, TimeUnit.SECONDS);\n executor.shutdownNow();\n if (ex.get() != null) {\n Assert.assertNull(ex.get());\n }\n }", "@Override\n\tprotected void updateDataFromRead(CountedData counter, final GATKSAMRecord gatkRead, final int offset, final byte refBase) {\n Object[][] covars;\n\t\ttry {\n\t\t\tcovars = (Comparable[][]) gatkRead.getTemporaryAttribute(getCovarsAttribute());\n\t\t\t// Using the list of covariate values as a key, pick out the RecalDatum from the data HashMap\n\t NestedHashMap data;\n\t data = dataManager.data;\n\t final Object[] key = covars[offset];\n\t\t\tBisulfiteRecalDatumOptimized datum = (BisulfiteRecalDatumOptimized) data.get( key );\n\t if( datum == null ) { // key doesn't exist yet in the map so make a new bucket and add it\n\t // initialized with zeros, will be incremented at end of method\n\t datum = (BisulfiteRecalDatumOptimized)data.put( new BisulfiteRecalDatumOptimized(), true, (Object[])key );\n\t }\n\n\t // Need the bases to determine whether or not we have a mismatch\n\t final byte base = gatkRead.getReadBases()[offset];\n\t final long curMismatches = datum.getNumMismatches();\n\t final byte baseQual = gatkRead.getBaseQualities()[offset];\n\n\t // Add one to the number of observations and potentially one to the number of mismatches\n\t datum.incrementBaseCounts( base, refBase, baseQual );\n\t increaseCountedBases(counter,1);\n\t\t\tincreaseNovelCountsBases(counter,1);\n\t\t\tincreaseNovelCountsMM(counter,(datum.getNumMismatches() - curMismatches));\n\t \n\t\t} catch (IllegalArgumentException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} catch (IllegalAccessException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} catch (InstantiationException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n //counter.novelCountsBases++;\n \n //counter.novelCountsMM += datum.getNumMismatches() - curMismatches; // For sanity check to ensure novel mismatch rate vs dnsnp mismatch rate is reasonable\n \n }", "private long ll(int i) {\n while (true) {\n incTag();\n long x = read(i);\n save[th()] = x;\n if (cas(i, x, tag[th()])) return x;\n }\n }", "@Test\n public void testDiffScanTokens() throws Exception {\n Schema schema = getBasicSchema();\n CreateTableOptions createOptions = new CreateTableOptions();\n createOptions.setRangePartitionColumns(ImmutableList.of());\n createOptions.setNumReplicas(1);\n KuduTable table = client.createTable(testTableName, schema, createOptions);\n\n // Set up the table for a diff scan.\n int numRows = 20;\n long timestamp = setupTableForDiffScans(client, table, numRows);\n\n // Since the diff scan interval is [start, end), increment the start timestamp to exclude\n // the last row inserted in the first group of ops, and increment the end timestamp to include\n // the last row deleted in the second group of ops.\n List<KuduScanToken> tokens = client.newScanTokenBuilder(table)\n // TODO(KUDU-3146): Disable including the table metadata so the new column name is\n // retrieved when deserializing the scanner.\n .includeTableMetadata(false)\n .diffScan(timestamp + 1, client.getLastPropagatedTimestamp() + 1)\n .build();\n assertEquals(1, tokens.size());\n\n checkDiffScanResults(tokens.get(0).intoScanner(client), 3 * numRows / 4, numRows / 4);\n }", "public void invoke(Tuple2<String, Integer> value) throws Exception {\n bufferedElements.add(value);\n if (bufferedElements.size() == threshold) {\n for (Tuple2<String, Integer> element : bufferedElements) {\n /**\n * send it to the sink here!!!\n * such as write into text files, or other sinks\n */\n }\n bufferedElements.clear();\n }\n }", "@Override\n\tpublic void execute(Tuple tuple) {\n\t\tString key = tuple.getStringByField(\"key\");\n\t\tdouble tweet_senti = tuple.getDoubleByField(\"senti_score\");\n\t\tif (!bucket.containsKey(key)) {\n\t\t\tBucketEntity entity = new BucketEntity(key, 1, (bucketID - 1));\n\t\t\tentity.setTweets_senti(tweet_senti);\n\t\t\tbucket.put(key, entity);\n\t\t} else {\n\t\t\tBucketEntity prev_entity = bucket.get(key);\n\t\t\tprev_entity.setFrequency(prev_entity.getFrequency() + 1);\n\t\t\tprev_entity.setTweets_senti(tweet_senti);\n\t\t\tbucket.put(key, prev_entity);\n\t\t}\n\t\tif (!top_value.containsKey(bucket.get(key).getFrequency())) {\n\t\t\tHashSet<String> temp = new HashSet<>();\n\t\t\ttemp.add(bucket.get(key).getEntity());\n\t\t\ttop_value.put(bucket.get(key).getFrequency(), temp);\n\t\t} else {\n\t\t\tSet<String> temp = top_value.get(bucket.get(key).getFrequency());\n\t\t\tif (top_value.containsKey(bucket.get(key).getFrequency() - 1)) {\n\t\t\t\tSet<String> prev_temp = top_value.get(bucket.get(key).getFrequency() - 1);\n\t\t\t\tprev_temp.remove(bucket.get(key).getEntity());\n\t\t\t\ttop_value.put(bucket.get(key).getFrequency() - 1, prev_temp);\n\t\t\t}\n\t\t\ttemp.add(bucket.get(key).getEntity());\n\t\t\ttop_value.put(bucket.get(key).getFrequency(), temp);\n\t\t}\n\t\tthreshold++;\n\t\tSystem.out.println(\"bucket id:\" + bucketID + \"\\t threshold:\" + threshold);\n\n\t\tif (threshold % bucketSize == 0) {\n\n\t\t\tfor (String hshtg : bucket.keySet()) {\n\t\t\t\tBucketEntity temp = bucket.get(hshtg);\n\t\t\t\t// System.out.println(\"Checking before emitting:\"+hshtg+\"\\t\n\t\t\t\t// frequency:\"+temp.getFrequency());\n\t\t\t\tif (temp.getFrequency() + temp.getDelta() <= bucketID) {\n\t\t\t\t\tSet<String> temp_tag = top_value.get(temp.getFrequency());\n\t\t\t\t\ttemp_tag.remove(temp.getEntity());\n\t\t\t\t\ttop_value.put(temp.getFrequency(), temp_tag);\n\t\t\t\t\tbucket.remove(hshtg);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbucketID++;\n\t\t}\n\t}", "public void run()\n\t\t\t{\n\t\t\t\tlong waitTime = 25;\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < 5; i++)\n\t\t\t\t{\n\t\t\t\t\tboolean auditSucceeded = false;\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tauditSucceeded = doAuditStellentUpdate(userId, gfid, recordId, updateKind);\n\t\t\t\t\t} catch (SQLException e)\n\t\t\t\t\t{\n\t\t\t\t\t\tauditSucceeded = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (auditSucceeded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Wait progressively longer, up to three times...\n\t\t\t\t\t\t\tThread.sleep(waitTime);\n\t\t\t\t\t\t\twaitTime = 2*waitTime;\n\t\t\t\t\t\t} catch(InterruptedException ie)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//do nothing... just continue...\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t}", "private Map<SODPosition, Integer> updateSODPositions() {\n Map<SODPosition, Integer> sodPositionsWithDelta = new HashMap<>();\n // This will hold all instruments that have associated transactions\n // this is neede at the end to carry forward SOD transaction on which\n // no transactions have come.\n Set<String> instrumentsProcessed = new HashSet<>();\n for (Transaction transaction : transactions) {\n List<SODPosition> positions = sodPositions.get(transaction.getInstrument());\n instrumentsProcessed.add(transaction.getInstrument());\n if (TransactionType.B.equals(transaction.getTranscationType())) {\n for (SODPosition position : positions) {\n if (AccountType.E.equals(position.getAccountType())) {\n LOGGER.debug(\"Processing Transaction Buy for Account Type E with account ID = \" + position.getAccount() + \" and instrument = \" + position.getInstrument());\n position.setQuantity(position.getQuantity() + transaction.getQuantity());\n sodPositionsWithDelta = populateDeltaMap(sodPositionsWithDelta, position, transaction.getQuantity());\n } else {\n LOGGER.debug(\"Processing Transaction Buy for Account Type I with account ID = \" + position.getAccount() + \" and instrument = \" + position.getInstrument());\n position.setQuantity(position.getQuantity() - transaction.getQuantity());\n sodPositionsWithDelta = populateDeltaMap(sodPositionsWithDelta, position, (transaction.getQuantity() * -1));\n }\n }\n } else {\n for (SODPosition position : positions) {\n if (AccountType.E.equals(position.getAccountType())) {\n LOGGER.debug(\"Processing Transaction Sell for Account Type E with account ID = \" + position.getAccount() + \" and instrument = \" + position.getInstrument());\n position.setQuantity(position.getQuantity() - transaction.getQuantity());\n sodPositionsWithDelta = populateDeltaMap(sodPositionsWithDelta, position, (transaction.getQuantity() * -1));\n } else {\n LOGGER.debug(\"Processing Transaction Sell for Account Type I with account ID = \" + position.getAccount() + \" and instrument = \" + position.getInstrument());\n position.setQuantity(position.getQuantity() + transaction.getQuantity());\n sodPositionsWithDelta = populateDeltaMap(sodPositionsWithDelta, position, transaction.getQuantity());\n }\n }\n }\n }\n\n /*\n Populate sodPositions with the positions on which there were no transactions\n */\n for (Map.Entry<String, ArrayList<SODPosition>> entry : sodPositions.entrySet()) {\n if (!instrumentsProcessed.contains(entry.getKey())) {\n for (SODPosition value : entry.getValue()) {\n sodPositionsWithDelta.put(value, 0);\n }\n }\n }\n return sodPositionsWithDelta;\n }", "private Vector<ResultSet> locJoin(final List<Connection> connections, String n1Keys) throws InterruptedException, SQLException {\n\t\tfinal String bigQueryTableAndFilter =\n\t\t\t\t\"lineitem, orders, customer WHERE l_orderkey = o_orderkey AND o_custkey = c_custkey AND o_orderdate between date '1995-01-01' and date '1996-12-31' AND c_nationkey IN \"\n\t\t\t\t\t\t+ n1Keys;\n\t\tExecutorService taskExecutor = Executors.newFixedThreadPool(connections.size());\n\n\t\t// Get partkeys and insert into temporary tables\n\t\ttaskExecutor.execute(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tString bitvectorForPart = BloomJoin.getBitVector(connections, bigQueryTableAndFilter, \"l_partkey\");\n\n\t\t\t\t\t// Get Part keys using bit vector\n\t\t\t\t\tString sql1SelectClause = \"SELECT p_partkey FROM part\";\n\t\t\t\t\tString sql1WhereClause = \"p_type ='\" + type + \"'\";\n\t\t\t\t\tString sql1Column = \"p_partkey\";\n\t\t\t\t\tVector<ResultSet> partKeysResultSets;\n\n\t\t\t\t\tpartKeysResultSets = BloomJoin.getBloomFilteredResults(connections, bitvectorForPart, sql1SelectClause, sql1WhereClause, sql1Column);\n\n\t\t\t\t\t// Insert partkeys in temporary table\n\t\t\t\t\tfinal String temporaryTableQuery = \"create temporary table part_temp (p_partkey integer);\";\n final String temporaryTablePartIndexing = \"CREATE INDEX temp_part_idx ON part_temp (p_partkey);\";\n final String[] indexingQueries = new String[1];\n indexingQueries[0] = temporaryTablePartIndexing;\n\n final String insertIntoTemporaryTableQuery = \"insert into part_temp values (?);\";\n\n createTemporaryTable(connections, temporaryTableQuery, indexingQueries,\n insertIntoTemporaryTableQuery, partKeysResultSets, 1);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Get suppkeys and nationkeys and insert into temporary tables\n\t\ttaskExecutor.execute(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tString bitvectorForSupp = BloomJoin.getBitVector(connections, bigQueryTableAndFilter, \"l_suppkey\");\n\n\t\t\t\t\t// Get Suppkeys and nationkeys using bit vector\n\t\t\t\t\tString sql1SelectClause = \"SELECT s_suppkey, s_nationkey FROM supplier\";\n\t\t\t\t\tString sql1WhereClause = \"1=1\";\n\t\t\t\t\tString sql1Column = \"s_suppkey\";\n\t\t\t\t\tVector<ResultSet> suppKeysResultSets;\n\n\t\t\t\t\tsuppKeysResultSets = BloomJoin.getBloomFilteredResults(connections, bitvectorForSupp, sql1SelectClause, sql1WhereClause, sql1Column);\n\t\t\t\t\t// Insert suppkeys and nationkeys in temporary table\n\t\t\t\t\tfinal String temporaryTableQuery = \"create temporary table supplier_temp (s_suppkey integer, s_nationkey integer);\";\n final String temporaryTableSuppIndexing = \"CREATE INDEX temp_supp_idx ON supplier_temp (s_suppkey);\";\n final String temporaryTableNationIndexing = \"CREATE INDEX temp_nation_idx ON supplier_temp (s_nationkey);\";\n final String[] indexingQueries = new String[2];\n indexingQueries[0] = temporaryTableSuppIndexing;\n indexingQueries[1] = temporaryTableNationIndexing;\n\t\t\t\t\tfinal String insertIntoTemporaryTableQuery = \"insert into supplier_temp values (?, ?);\";\n createTemporaryTable(connections, temporaryTableQuery, indexingQueries,\n insertIntoTemporaryTableQuery, suppKeysResultSets, 2);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\n\t\ttaskExecutor.shutdown();\n\t\ttaskExecutor.awaitTermination(20, TimeUnit.MINUTES);\n\n\t\t// Get the big query result\n\t\tString joinQuery =\n\t\t\t\t\"SELECT o_year, SUM(case when nationkey=? then volume else 0 end) AS nationvolume, SUM(volume) AS allnationvolume FROM \"\n\t\t\t\t\t\t+ \" ( SELECT extract(year from o_orderdate) as o_year, l_extendedprice * (1-l_discount) as volume, s.s_nationkey as nationkey \"\n\t\t\t\t\t\t+ \" FROM lineitem, orders, customer, supplier_temp s, part_temp p \"\n\t\t\t\t\t\t+ \" WHERE l_orderkey = o_orderkey AND o_custkey = c_custkey AND o_orderdate between date '1995-01-01' and date '1996-12-31' \"\n\t\t\t\t\t\t+ \" AND s.s_suppkey = l_suppkey AND p.p_partkey = l_partkey AND c_nationkey IN \" + n1Keys + \") as allnations \"\n\t\t\t\t\t\t+ \" GROUP BY o_year ORDER BY o_year;\";\n\t\tList<Object> parameters = new ArrayList<Object>();\n\t\tparameters.add(n2key);\n\t\tVector<ResultSet> results = Utils.runDistributedQuery(connections, joinQuery, parameters);\n\t\tif (VERBOSE) {\n\t\t\tfor (ResultSet rs : results) {\n\t\t\t\trs.beforeFirst();\n\t\t\t\twhile (rs.next()) {\n\t\t\t\t\tSystem.out.println(rs.getString(1) + \" \" + rs.getString(2) + \" \" + rs.getString(3));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn results;\n\n\t}", "public ArrayList<Tuple2<Input, Input>> call(ArrayList<Tuple2<Data<Type0, Type1>, Input>> lst1a,\n ArrayList<Tuple2<Data<Type0, Type1>, Input>> lst1b) {\n\n if (sameRDD) {\n\n int[] permutationArray = new int[lst1a.size()];\n for (int i = 0; i < permutationArray.length; i++) {\n permutationArray[i] = i;\n }\n ArrayList<Tuple2<Data<Type0, Type1>, Input>> list2 = new ArrayList<Tuple2<Data<Type0, Type1>, Input>>();//new Tuple2<Data<Type0,Type1>,Input>[lst1a.length];\n //Collections.copy(lst1a,list2);\n list2.addAll(lst1a);\n\n new myMergeSort<Type0, Type1, Input>().sort(list2, permutationArray, new revDataComparator<Type0, Type1, Input>(\n list2ASC, list2ASCSec, equalReverse));\n\n ArrayList<Tuple2<Input, Input>> wilResult = getViolationsSelf(lst1a,\n permutationArray);\n return wilResult;\n } else {\n\n // reset pivot flag\n for (int i = 0; i < lst1b.size(); i++) {\n lst1b.get(i)._1().resetPivot();\n }\n\n ArrayList<Tuple2<Data<Type0, Type1>, Input>> list1 = merge(lst1a, lst1b, list1ASC, list1ASCSec);\n\n int[] permutationArray = new int[list1.size()];\n for (int i = 0; i < permutationArray.length; i++) {\n permutationArray[i] = i;\n }\n ArrayList<Tuple2<Data<Type0, Type1>, Input>> list2 = new ArrayList<Tuple2<Data<Type0, Type1>, Input>>();//Tuple2<Data<Type0,Type1>,Record>[list1.length];\n //System.arraycopy(list1, 0, list2, 0, list1.size());\n //Collections.copy(list1,list2);\n list2.addAll(list1);\n new myMergeSort<Type0, Type1, Input>().sort(list2, permutationArray, new revDataComparator<Type0, Type1, Input>(\n list2ASC, list2ASCSec, equalReverse));\n\n ArrayList<Tuple2<Input, Input>> wilResult = getViolationsNonSelf(\n list1, permutationArray);\n\n return wilResult;\n }\n // return output;\n\n }", "public void testUnpackMultipleTuplesMultipleBags() throws InvalidAdviceException {\n // Set up the baggage\n BaggageAPIForTest baggage = new BaggageAPIForTest();\n baggage.put(\"bag1\", new Object[][] {{\"b1_t1_v1\", \"b1_t1_v2\"}, {\"b1_t2_v1\", \"b1_t2_v2\"}, {\"b1_t3_v1\", \"b1_t3_v2\"}});\n baggage.put(\"bag2\", new Object[][] {{\"b2_t1_v1\", \"b2_t1_v2\"}, {\"b2_t2_v1\", \"b2_t2_v2\"}, {\"b2_t3_v1\", \"b2_t3_v2\"}});\n baggage.put(\"bag3\", new Object[][] {{\"b3_t1_v1\", \"b3_t1_v2\"}, {\"b3_t2_v1\", \"b3_t2_v2\"}, {\"b3_t3_v1\", \"b3_t3_v2\"}});\n \n EmitAPIForTest results = new EmitAPIForTest();\n Advice advice = AdviceTestUtils.newAdvice().observe(\"a\", \"b\")\n .unpack(\"bag1\", \"c\", \"d\")\n .unpack(\"bag2\", \"e\", \"f\")\n .unpack(\"bag3\", \"g\", \"h\")\n .emit(\"test1\", \"a\")\n .build(baggage, results);\n \n assertTrue(\"Expect nothing emitted yet\", results.emitted.size() == 0);\n advice.advise(\"vva\", \"vvb\");\n advice.advise(\"vva\", \"vvc\");\n advice.advise(\"vva\", \"vve\");\n int expected = 3 * 3 * 3 * 3;\n for (int i = 0; i < expected; i++) {\n results.expectTuple(\"vva\");\n }\n results.check();\n assertTrue(\"Expect \"+expected+\" output tuple emitted\", results.emitted.size() == expected); \n }", "public static Map<List<Integer>, List<List<Integer>>> CollectTableInstasnces(List<List<Integer>> candidateList,\n Map<Integer,Map<List<Integer>, List<List<Integer>>>> starNeighbor,\n Map<List<Integer>, List<List<Integer>>> tableInstanceSizekSub1,\n int k){\n\n\n // [A, B]:[[1,2],[1,3]]\n // Return table instances\n Map<List<Integer>, List<List<Integer>>> tableInstances = new HashMap<>();\n\n // convert candidate to hashset\n Set<List<Integer>> candidateSet = new HashSet<>(candidateList);\n\n for(List<Integer> candidate: candidateSet){\n if (starNeighbor.containsKey(candidate.get(0))){\n\n // get remain candidate list\n List<Integer> remainCandidateElement = candidate.subList(1, k+1);\n\n // store the table instance of the current candidate\n List<List<Integer>> realCliquesAll = new ArrayList<>();\n\n // Loop hashmap\n Iterator<Map.Entry<List<Integer>, List<List<Integer>>>> itr = starNeighbor.get(candidate.get(0)).entrySet().iterator();\n while (itr.hasNext()){\n Map.Entry<List<Integer>, List<List<Integer>>> entry = itr.next();\n // put remain instance\n List<List<Integer>> tempRemain = new ArrayList<>();\n\n for (Integer feature : remainCandidateElement) {\n List<Integer> remainPoint = entry.getValue().parallelStream().filter( point ->\n point.get(0).equals(feature))\n .map(inst -> inst.get(1))\n .collect(Collectors.toList());\n\n if (!remainPoint.isEmpty()) {\n tempRemain.add(remainPoint);\n }\n }\n\n if (tempRemain.size() == k){\n // store the first instance into it\n tempRemain.add(0, Arrays.asList(entry.getKey().get(1)));\n\n // Cartesian product tempRemain based on combinatoricslib lib\n List<List<Integer>> remainFeatureInstance = MyGenerator.cartesianProductInteger(tempRemain);\n\n // Check real cliques\n List<List<Integer>> realClique = remainFeatureInstance.parallelStream().filter( row -> {\n\n return tableInstanceSizekSub1.get(remainCandidateElement).contains(row.subList(1, k+1));\n\n }).collect(Collectors.toList());\n\n if (!realClique.isEmpty()){\n realCliquesAll.addAll(realClique);\n }\n\n }\n }\n // put in table instances\n if(!realCliquesAll.isEmpty()){\n tableInstances.put(candidate, realCliquesAll);\n }\n }\n\n }\n return tableInstances;\n }", "private void runWrongUpdateTask2(BdbMapDao<BytesValue> dbLock,\n BdbMapDao<Blog.BlogEntry> blogEntryDao,\n ByteString key,\n AtomicInteger conflictCount) throws InterruptedException {\n for (int i = 0; i < execTimes; ++i) {\n\n // Optimistic lock, still causes a lot of contention\n boolean wasSuccessful = false;\n\n for (int retries = 0; retries < MAX_RETRIES; ++retries) {\n // [1] acquire record\n BytesValue lock = dbLock.get(null, key, () -> null);\n if (lock == null) { // does somebody acquired this record before?\n // ok - version is empty, looks like we are the ones who acquired it first\n // NOTE: we need big endian representation of long here!\n final ByteString versionKey = ByteString.copyFrom(Longs.toByteArray(versionId.incrementAndGet()));\n\n // [2] assign update version\n dbLock.put(null, key, BytesValue.newBuilder().setValue(versionKey).build());\n\n // [3] retrieve version once more, duplicates should be disregarded\n lock = dbLock.get(null, key, () -> null);\n if (lock != null && lock.getValue().equals(versionKey)) {\n // [4] same version, proceed with the update\n final Blog.BlogEntry original = blogEntryDao.get(null, key);\n blogEntryDao.put(null, key, Blog.BlogEntry.newBuilder(original)\n .setLikes(original.getLikes() + 1)\n .build());\n\n // [5] clear lock versions\n dbLock.delete(null, key);\n wasSuccessful = true;\n break;\n }\n }\n conflictCount.incrementAndGet(); // CAS failed, do it all over again\n } // optimistic lock retry loop\n\n if (!wasSuccessful) {\n throw new IllegalStateException();\n }\n }\n }", "private void m14048a(List<ScanResult> list, SQLiteDatabase sQLiteDatabase) {\n Throwable th;\n System.currentTimeMillis();\n this.f18056e = false;\n if (list != null && list.size() != 0 && sQLiteDatabase != null && list != null) {\n double d = 0.0d;\n double d2 = 0.0d;\n int i = 0;\n Object obj = null;\n double[] dArr = new double[8];\n Object obj2 = null;\n int i2 = 0;\n StringBuffer stringBuffer = new StringBuffer();\n int i3 = 0;\n for (ScanResult scanResult : list) {\n if (i3 > 10) {\n break;\n }\n if (i3 > 0) {\n stringBuffer.append(\",\");\n }\n i3++;\n stringBuffer.append(\"\\\"\").append(Jni.encode2(scanResult.BSSID.replace(Config.TRACE_TODAY_VISIT_SPLIT, \"\"))).append(\"\\\"\");\n }\n Cursor cursor = null;\n Cursor rawQuery;\n try {\n rawQuery = sQLiteDatabase.rawQuery(\"select * from wof where id in (\" + stringBuffer.toString() + \");\", null);\n try {\n if (rawQuery.moveToFirst()) {\n while (!rawQuery.isAfterLast()) {\n double d3 = rawQuery.getDouble(1) - 113.2349d;\n double d4 = rawQuery.getDouble(2) - 432.1238d;\n int i4 = rawQuery.getInt(4);\n int i5 = rawQuery.getInt(5);\n if (i5 <= 8 || i5 <= i4) {\n int i6;\n Object obj3;\n float[] fArr;\n if (!this.f18055d) {\n if (obj == null) {\n int i7;\n if (obj2 != null) {\n int i8 = 0;\n while (i8 < i2) {\n Object obj4;\n double d5;\n double d6;\n fArr = new float[1];\n Location.distanceBetween(d4, d3, dArr[i8 + 1], dArr[i8], fArr);\n if (fArr[0] < 1000.0f) {\n obj4 = 1;\n d5 = d + dArr[i8];\n d6 = dArr[i8 + 1] + d2;\n i5 = i + 1;\n } else {\n obj4 = obj;\n i5 = i;\n d6 = d2;\n d5 = d;\n }\n i8 += 2;\n d2 = d6;\n d = d5;\n obj = obj4;\n i = i5;\n }\n if (obj == null) {\n if (i2 >= 8) {\n break;\n }\n i4 = i2 + 1;\n dArr[i2] = d3;\n i7 = i4 + 1;\n dArr[i4] = d4;\n i6 = i7;\n obj3 = obj2;\n } else {\n d += d3;\n d2 += d4;\n i++;\n i6 = i2;\n obj3 = obj2;\n }\n } else {\n i4 = i2 + 1;\n dArr[i2] = d3;\n i7 = i4 + 1;\n dArr[i4] = d4;\n i3 = 1;\n i6 = i7;\n }\n } else {\n fArr = new float[1];\n Location.distanceBetween(d4, d3, d2 / ((double) i), d / ((double) i), fArr);\n if (fArr[0] > 1000.0f) {\n rawQuery.moveToNext();\n } else {\n i6 = i2;\n obj3 = obj2;\n }\n }\n } else {\n fArr = new float[1];\n Location.distanceBetween(d4, d3, this.f18059h, this.f18058g, fArr);\n if (((double) fArr[0]) > this.f18057f + 2000.0d) {\n rawQuery.moveToNext();\n } else {\n obj = 1;\n d += d3;\n d2 += d4;\n i++;\n i6 = i2;\n obj3 = obj2;\n }\n }\n if (i > 4) {\n break;\n }\n rawQuery.moveToNext();\n i2 = i6;\n obj2 = obj3;\n } else {\n rawQuery.moveToNext();\n }\n }\n if (i > 0) {\n this.f18056e = true;\n this.f18060i = d / ((double) i);\n this.f18061j = d2 / ((double) i);\n }\n }\n if (rawQuery != null) {\n try {\n rawQuery.close();\n } catch (Exception e) {\n }\n }\n } catch (Exception e2) {\n cursor = rawQuery;\n } catch (Throwable th2) {\n th = th2;\n }\n } catch (Exception e3) {\n if (cursor != null) {\n try {\n cursor.close();\n } catch (Exception e4) {\n }\n }\n } catch (Throwable th3) {\n rawQuery = null;\n th = th3;\n if (rawQuery != null) {\n try {\n rawQuery.close();\n } catch (Exception e5) {\n }\n }\n throw th;\n }\n }\n }", "void processMultiValue(int numDocs, int[][] outGroupIds);", "private static void mergeNext() {\n\t\tString ids[] = getMinGeneIds();\n\t\tString minI = ids[0];\n\t\tString minJ = ids[1];\n\t\tString newEntry = createNewEntry(minI, minJ);\n\t\tTreeMap<String, Double> prevI = distanceMatrix.remove(minI);\n\t\tTreeMap<String, Double> prevJ = distanceMatrix.remove(minJ);\n\t\tminMatrix.remove(minI);minMatrix.remove(minJ);\n\t\tallClusters.remove(minI);allClusters.remove(minJ);\n\t\tTreeMap<String, Double> newTemp = new TreeMap<String, Double>(); \n\t\tfor(String c: allClusters) {\n\t\t\tTreeMap<String, Double> temp = distanceMatrix.get(c);\n\t\t\ttemp.remove(minI);temp.remove(minJ);\n\t\t\tdouble dist1 = prevI.get(c);\n\t\t\tdouble dist2 = prevJ.get(c);\n\t\t\tif(dist1 < dist2) {\n\t\t\t\tnewTemp.put(c,dist1);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist1);\n\t\t\t\ttemp.put(newEntry, dist1);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist1);\n\t\t\t} else {\n\t\t\t\tnewTemp.put(c,dist2);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist2);\n\t\t\t\ttemp.put(newEntry, dist2);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist2);\n\t\t\t}\n\t\t\tdistanceMatrix.put(c, temp);\n\t\t}\n\t\tdistanceMatrix.put(newEntry, newTemp);\n\t\tallClusters.add(newEntry);\n\t\ttotalCluster = allClusters.size();\n\t}", "public static void main(String[] args){\n int MIN = Integer.parseInt(args[0]);\n MAX = Integer.parseInt(args[1]);\n cutoffs = new int[args.length - 2];\n cache = new ArrayList<IndexedArrayList<SuperSavvyTrieHelper2>>();\n for (int i = 2; i < args.length; i++){\n cutoffs[i - 2] = Integer.parseInt(args[i]);\n cache.add(new IndexedArrayList<SuperSavvyTrieHelper2>());\n }\n for (int i = 0; i < cutoffs.length / 2; i++){\n int temp = cutoffs[i];\n cutoffs[i] = cutoffs[cutoffs.length - 1 - i];\n cutoffs[cutoffs.length - 1 - i] = temp;\n }\n multiplicitiesUsed = new boolean[MAX + 1];\n basesUsed = new DoublyLinkedArray(MAX + 1);\n SuperSavvyTrieHelper2.setCorrespondance(basesUsed);\n /*\n long count1 = lowerRecursion(MAX, 0);\n long count2 = middleRecursion(MAX, 0);\n long count3 = upperRecursion(MAX, 0);\n long total = count1 + count2 + count3;\n System.out.printf(\"%d + %d + %d = %d\\n\", count1, count2, count3, total);\n */\n hitCounts = new long[cutoffs.length];\n missCounts = new long[cutoffs.length];\n statCollector = new StatCollector(cutoffs);\n\n long startTime = System.nanoTime();\n long[] values = new long[MAX - MIN + 1];\n for (int i = MIN; i <= MAX; i++) {\n values[i - MIN] = upperRecursionWrapper(i);\n }\n //long[] testValues = new long[] {1752443,1911046, 2067456,2249444,2429337, 2647532,2852449,3101167,3350292,3632299,3916575};\n for (int i = 0; i < values.length; i++){\n //if (testValues[i] != values[i]){\n System.out.printf(\"%d: %d\\n\", i + MIN, values[i]);\n //}\n }\n long endTime = System.nanoTime();\n System.out.printf(\"%f,\", (double)(endTime - startTime) / 1000000000.0);\n long totalMissCounts = 0;\n long totalMissWeight1 = 0;\n long totalMissWeight2 = 0;\n long totalMissWeight3 = 0;\n /*\n for (int i = 0; i < cutoffs.length; i++){\n long totalCounts = hitCounts[i] + missCounts[i];\n totalMissCounts += missCounts[i];\n totalMissWeight1 += missCounts[i] * cutoffs[i];\n totalMissWeight2 += (hitCounts[i] / missCounts[i]) * cutoffs[i];\n totalMissWeight3 += (hitCounts[i] - missCounts[i]) * cutoffs[i] * cutoffs[i];\n System.out.printf(\"\\tCache %d: %d/%d/%d (%.5f%%)\", cutoffs[i], hitCounts[i], missCounts[i], totalCounts, (double) hitCounts[i] / totalCounts);\n }\n System.out.printf(\"\\t\\tMissCounts: %d, weighted: %d, ratio: %d, diff^2: %d\\n\", totalMissCounts, totalMissWeight1, totalMissWeight2, totalMissWeight3);\n */\n statCollector.printAll();\n }", "private void splice()\n {\n String dateCompare =\"\";\n int changeCount = 1;\n int numberOfHashes = sizeForHashTable();\n setUpHashMap(numberOfHashes);\n\n for (int i=0; i<= this.data.size();i++)\n {\n if (i == 0)\n {\n dateCompare = this.data.get(i).getFCTTIME().getPretty();\n loadHashTable(changeCount,this.data.get(i));\n }else if ( dateCompare != this.data.get(i).getFCTTIME().getPretty())\n {\n changeCount += 1;\n dateCompare = this.data.get(i).getFCTTIME().getPretty();\n loadHashTable(changeCount,this.data.get(i));\n }else\n {\n loadHashTable(changeCount,this.data.get(i));\n }\n }\n }", "@Override\n public void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException {\n ArrayList<String> cache = new ArrayList<String>();\n String groupId = \"\";\n String earlist = \"\";\n int earlistTime = 999999;\n int latestTime = 0;\n for (Text e : values) {\n cache.add(e.toString());\n String[] input = e.toString().split(\",\");\n int time = Integer.parseInt(input[1]);\n //find the eaelistTime and latestTime of Typhoon\n if (time < earlistTime)\n earlistTime = time;\n if (time > latestTime)\n latestTime = time;\n }\n\n for (String e : cache) {\n String[] input1 = e.split(\",\");\n if (Integer.parseInt(input1[1]) == earlistTime) {\n String[] coordE = input1[2].trim().split(\"\\\\s+\");\n double tyLatE = Double.parseDouble(coordE[0]);\n double tyLngE = Double.parseDouble(coordE[2]);\n //if the start point of typhoon is west of 123E, then it may be group 2 or group 3\n if (tyLngE < 123) {\n for (String s : cache) {\n String[] input2 = s.split(\",\");\n if (Integer.parseInt(input2[1]) == latestTime) {\n String[] coordL = input2[2].trim().split(\"\\\\s+\");\n double tyLatL = Double.parseDouble(coordL[0]);\n double tyLngL = Double.parseDouble(coordL[2]);\n //if the end point of typhoon is west of 115E, then it belongs to group 3\n if (tyLngL < 115)\n groupId = \"3\";\n //if the end point of typhoon is east of 115E, then it belongs to group 2\n if (tyLngL > 115)\n groupId = \"2\";\n }\n }\n }\n //if the start point of typhoon is east of 123E, then it may be group 2 or group 3\n if (tyLngE > 123)\n groupId = \"1\";\n }\n }\n for (String e : cache) {\n context.write(null, new Text(groupId + \",\" + e));\n }\n\n }", "protected static void updateMismatchCounts(CountedData counter, final AlignmentContext context, final byte refBase) {\n for( PileupElement p : context.getBasePileup() ) {\n final byte readBase = p.getBase();\n final byte readBaseQual = p.getQual();\n final int readBaseIndex = BaseUtils.simpleBaseToBaseIndex(readBase);\n final int refBaseIndex = BaseUtils.simpleBaseToBaseIndex(refBase);\n try{\n \tif( readBaseIndex != -1 && refBaseIndex != -1 ) {\n //if( readBaseIndex != refBaseIndex && !(BisulfiteSnpUtil.isCytosine(refBase,false) && BisulfiteSnpUtil.isCytosine(readBase,true))) {\n //counter.novelCountsMM++;\n \t\tif( readBaseIndex != refBaseIndex ){\n \t\t\tif((BisulfiteSnpUtil.isCytosine(refBase,false) && BisulfiteSnpUtil.isCytosine(readBase,true))){\n \t\t\t\tif(readBaseQual <= 5){\n \t\t\t\t\tincreaseNovelCountsMM(counter,1);\n \t\t\t\t}\n \t\t\t\telse{\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t}\n \t\t\telse{\n \t\t\t\tincreaseNovelCountsMM(counter,1);\n \t\t\t}\n }\n increaseNovelCountsBases(counter,1);\n \t}\n }\n catch (InstantiationException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t}\n }\n }", "@Override\r\n public void extractIndexBetween(List<HistoricalIndexElement> index, long start, long end) {\n historicalBuffersLock.lock();\r\n try {\r\n for (Block block : historicalBlocks) {\r\n HistoricalIndexElement[] elements = block.index.toSortedElements();\r\n for (HistoricalIndexElement historicalIndexElement : elements) {\r\n long time = historicalIndexElement.getTime();\r\n if (time >= start && time < end) {\r\n index.add(historicalIndexElement);\r\n }\r\n }\r\n }\r\n } finally {\r\n historicalBuffersLock.unlock();\r\n }\r\n\r\n if (currentBlock != null) {\r\n // Now the current block\r\n HistoricalIndexElement[] elements = currentBlock.index.toSortedElements();\r\n for (HistoricalIndexElement historicalIndexElement : elements) {\r\n long time = historicalIndexElement.getTime();\r\n if (time >= start && time < end) {\r\n index.add(historicalIndexElement);\r\n }\r\n }\r\n }\r\n\r\n }", "@Override\n\tprotected void reduce(CompositeKey2 key, Iterable<LongWritable> values, Context context)\n\t\t\tthrows IOException, InterruptedException {\n\t\tfor (LongWritable v : values) {\t\t\t\n\t\t\t// check counter if count < k\n\t\t\tif(context.getCounter(Counters.NUM_COUNT).getValue() < k){\n\t\t\t\t// output (<article_id>, <rev_id_count>)\n\t\t\t\tcontext.write(v, new LongWritable (key.getRev_ID_Count()));\n\t\t\t\tcontext.getCounter(Counters.NUM_COUNT).increment(1);\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\t\t\t\t\n\t\t}\t\t\t\n\t}", "@Test\r\n\tpublic void testPositiveGenerateSignedUUIDs_4() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedUUIDs(10, identifier, null, userData, null);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, UUID[].class, true);\r\n\t\t\t\t\r\n\t\t\t\tHashMap<String,Object> o2 = roc.generateSignedUUIDs(10, identifier, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t\t\r\n\t\t\t\to = roc.generateSignedUUIDs(10, date, null, userData, null);\r\n\t\t\t\to2 = roc.generateSignedUUIDs(10, date, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public void testFilterMultipleBags() throws InvalidAdviceException {\n // Set up the baggage\n BaggageAPIForTest baggage = new BaggageAPIForTest();\n baggage.put(\"bag1\", new Object[][] {{\"v1\", \"b1_v2\"}, {\"b1_v3\", \"v1\"}, {\"v2\", \"b1_v5\"}});\n baggage.put(\"bag2\", new Object[][] {{\"b2_v1\", \"v2\"}, {\"b2_v3\", \"v1\"}, {\"b2_v5\", \"v3\"}});\n \n EmitAPIForTest results = new EmitAPIForTest();\n Advice advice = AdviceTestUtils.newAdvice().observe(\"a\", \"b\")\n .unpack(\"bag1\", \"c\", \"d\")\n .unpack(\"bag2\", \"e\", \"f\")\n .where(\"\\\"{}\\\"==\\\"{}\\\"\", \"c\", \"f\")\n .emit(\"test1\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\")\n .build(baggage, results);\n \n assertTrue(\"Expect nothing emitted yet\", results.emitted.size() == 0);\n advice.advise(\"vva\", \"vvb\");\n results.expectTuple(\"vva\", \"vvb\", \"v2\", \"b1_v5\", \"b2_v1\", \"v2\");\n results.expectTuple(\"vva\", \"vvb\", \"v1\", \"b1_v2\", \"b2_v3\", \"v1\");\n results.check();\n assertTrue(\"Expect 2 output tuple emitted\", results.emitted.size() == 2); \n }", "private static void fun2(List<String> ac1, List<List<String>> result, int index) {\n\t\tString key = ac1.get(0);\r\n\t\tfor(int i=index;i<result.size();i++){\r\n\t\t\tList<String> res=result.get(i);\r\n\t\t\tif(res.get(0).equals(key)){\r\n\t\t\t\t//check if any one of the value is repeated\r\n\t\t\t\tboolean check=fun3(res,ac1);\r\n\t\t\t\tif(check){\r\n\t\t\t\t\tfor(int j=1;j<ac1.size();j++){\r\n\t\t\t\t\t\tres.add(ac1.get(i));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testGroupNumerousKeysValues() {\n\t\tint max = 1000;\n\t\tint oldsize = 0;\n\t\tint newsize = 0;\n\t\tString valueTemp = \"\";\n\t\tStringBuilder sBuilder = new StringBuilder();\n\n\t\tfor (int i = 0; i < 2000; i++) {\n\t\t\tsBuilder = sBuilder.append('a');\n\t\t}\n\n\t\tvalueTemp = sBuilder.toString();\n\n\t\ttry {\n\t\t\toldsize = VintageConfigWebUtils.lookup(groupString).size();\n\t\t\tVintageConfigWebUtils.batchregister(groupString, keyString, valueTemp, 1, max);\n\n\t\t\tnewsize = VintageConfigWebUtils.lookup(groupString).size();\n\t\t\tSystem.out.print(oldsize + max);\n\t\t\tSystem.out.print(\"newsize:\" + newsize);\n\t\t\tassertEquals(oldsize + max, newsize);\n\n\t\t\tfor (int i = 0; i < max; i++) {\n\t\t\t\tList<String> nodesList = VintageConfigWebUtils.lookup(groupString, keyString+i);\n\t\t\t\tString nodevalue = getValueFromConfigNode(nodesList.get(0));\n\t\t\t\tassertEquals(nodevalue, valueTemp+i);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\tSystem.out.print(e.getMessage());\n\t\t\tfail(\"error in testGroupNumerousKeys\");\n\t\t} finally {\n\t\t\tVintageConfigWebUtils.batchunregister(groupString, keyString, 0, max);\n\t\t\tassertEquals(oldsize, VintageConfigWebUtils.lookup(groupString).size());\n\t\t}\n\t}", "public ArrayList<ArrayList> union(ArrayList<ArrayList> data, ArrayList<ArrayList> data2)\n {\n if(data == null || data2 == null)\n {\n return null;\n }\n ArrayList<Document> docs = data.get(0);\n ArrayList<Double> relevance = data.get(1);\n ArrayList<Integer> occurrence = data.get(2);\n ArrayList<Integer> popularity = data.get(3);\n \n ArrayList<Document> docs2 = data2.get(0);\n ArrayList<Double> relevance2 = data2.get(1);\n ArrayList<Integer> occurrence2 = data2.get(2);\n ArrayList<Integer> popularity2 = data2.get(3);\n \n ArrayList<Document> docs3 = new ArrayList<>();\n ArrayList<Double> relevance3 = new ArrayList<>();\n ArrayList<Integer> occurrence3 = new ArrayList<>();\n ArrayList<Integer> popularity3 = new ArrayList<>();\n \n for(int i = 0; i < docs.size(); i++)\n {\n docs3.add(docs.get(i));\n relevance3.add(relevance.get(i));\n occurrence3.add(occurrence.get(i));\n popularity3.add(popularity.get(i));\n }\n \n for(Document d: docs2)\n {\n if(!docs3.contains(d))\n {\n docs3.add(d);\n int docIndex = docs2.indexOf(d);\n relevance3.add(relevance2.get(docIndex));\n occurrence3.add(occurrence2.get(docIndex));\n popularity3.add(d.popularity);\n }\n else\n {\n int docIndex = docs3.indexOf(d);\n int docIndex2 = docs2.indexOf(d);\n double oldRel = (double) relevance3.get(docIndex);\n int oldOcc = (int) occurrence3.get(docIndex);\n relevance3.set(docIndex, oldRel+relevance2.get(docIndex2));\n if(oldOcc > occurrence2.get(docIndex2))\n {\n occurrence3.set(docIndex, occurrence2.get(docIndex2));\n }\n } \n }\n ArrayList<ArrayList> data3 = new ArrayList();\n data3.add(docs3);\n data3.add(relevance3);\n data3.add(occurrence3);\n data3.add(popularity3);\n return data3; \n }", "public void a(HashCache var0) {\n/* 46 */ this.f.clear();\n/* 47 */ b();\n/* */ \n/* 49 */ Tag<T> var1 = TagSet.a();\n/* 50 */ Function<MinecraftKey, Tag<T>> var2 = var1 -> this.f.containsKey(var1) ? var0 : null;\n/* 51 */ Function<MinecraftKey, T> var3 = var0 -> this.c.getOptional(var0).orElse(null);\n/* 52 */ this.f.forEach((var3, var4) -> {\n/* */ List<Tag.b> var5 = var4.b(var0, var1).collect((Collector)Collectors.toList());\n/* */ \n/* */ if (!var5.isEmpty()) {\n/* */ throw new IllegalArgumentException(String.format(\"Couldn't define tag %s as it is missing following references: %s\", new Object[] { var3, var5.stream().map(Objects::toString).collect(Collectors.joining(\",\")) }));\n/* */ }\n/* */ \n/* */ JsonObject var6 = var4.c();\n/* */ Path var7 = a(var3);\n/* */ try {\n/* */ String var8 = e.toJson((JsonElement)var6);\n/* */ String var9 = a.hashUnencodedChars(var8).toString();\n/* */ if (!Objects.equals(var2.a(var7), var9) || !Files.exists(var7, new java.nio.file.LinkOption[0])) {\n/* */ Files.createDirectories(var7.getParent(), (FileAttribute<?>[])new FileAttribute[0]);\n/* */ try (BufferedWriter var10 = Files.newBufferedWriter(var7, new java.nio.file.OpenOption[0])) {\n/* */ var10.write(var8);\n/* */ } \n/* */ } \n/* */ var2.a(var7, var9);\n/* 71 */ } catch (IOException var8) {\n/* */ LOGGER.error(\"Couldn't save tags to {}\", var7, var8);\n/* */ } \n/* */ });\n/* */ }", "protected static TraceableFloat recombineGenes(TraceableFloat a, TraceableFloat b, float new_a_value){\n\n // of aVal = bVal = newVal, both genes should have 50% impact\n double influence_factor_a = 0.5;\n double influence_factor_b = 0.5;\n\n if(a.getValue() == new_a_value && b.getValue() != new_a_value) //return a if it has 100% influence. Faster and avoids 0.0 impact traceTuples\n return a;\n if(b.getValue() == new_a_value && a.getValue() != new_a_value) //return b if it has 100% influence. Faster and avoids 0.0 impact traceTuples\n return b;\n if(a.getValue() != new_a_value && b.getValue() != new_a_value) { //compute the new values if non of them are equal\n //if you don't cast here, the resulting values are integers and will be roundet!\n influence_factor_a = 1.0 - (double)Math.abs(a.getValue() - new_a_value) / (double)(Math.abs(a.getValue() - new_a_value) + Math.abs(b.getValue() - new_a_value));\n influence_factor_b = 1.0 - (double)Math.abs(b.getValue() - new_a_value) / (double)(Math.abs(a.getValue() - new_a_value) + Math.abs(b.getValue() - new_a_value));\n }\n\n int i = 0; //index for trace vector a\n int j = 0; //index for trace vector b\n\n List<TraceTuple> new_traceVector = new ArrayList<TraceTuple>();\n\n while(true){ //this iterates over the traceVector of this individual\n if(i >= a.getTraceVector().size() && j >= b.getTraceVector().size()) //stop if both vectors are empty\n break;\n else if(i >= a.getTraceVector().size() && !(j >= b.getTraceVector().size())){//append if the a vector is empty and b vector is not.\n int currentBID = b.getTraceVector().get(j).getTraceID();\n double currentBImpact = b.getTraceVector().get(j).getImpact();\n new_traceVector.add(new TraceTuple(currentBID, influence_factor_b * currentBImpact));\n j++;\n }\n else if(!(i >= a.getTraceVector().size()) && j >= b.getTraceVector().size()){//append if the b vector is empty and a vector is not.\n int currentAID = a.getTraceVector().get(i).getTraceID();\n double currentAImpact = a.getTraceVector().get(i).getImpact();\n new_traceVector.add(new TraceTuple(currentAID, influence_factor_a * currentAImpact));\n i++;\n }\n else {//if both arrays are not empty, append the next traceID:\n int currentAID = a.getTraceVector().get(i).getTraceID();\n int currentBID = b.getTraceVector().get(j).getTraceID();\n\n double currentAImpact = a.getTraceVector().get(i).getImpact();\n double currentBImpact = b.getTraceVector().get(j).getImpact();\n\n if (currentAID == currentBID) {//combine the two if equal\n new_traceVector.add(new TraceTuple(currentAID, influence_factor_a * currentAImpact + influence_factor_b * currentBImpact));\n i++;\n j++;\n }\n\n if (currentAID < currentBID) {//add the traceID of a if its smaller than the traceID of b\n new_traceVector.add(new TraceTuple(currentAID, influence_factor_a * currentAImpact));\n i++;\n }\n\n if (currentBID < currentAID) {//add the traceID of b if its smaller than the traceID of a\n new_traceVector.add(new TraceTuple(currentBID, influence_factor_b * currentBImpact));\n j++;\n }\n }\n }\n\n return new TraceableFloat(new_a_value, new_traceVector);\n }", "public Map<TopicAndPartition, Long> getOffsets() {\n Map<TopicAndPartition, Long> returnOffsetsMap = new HashMap<>();\n\n for (String topic : topicList) {\n\n Map<TopicAndPartition, Long> resMap = dao.getOffsets(groupid, topic);\n if (!resMap.isEmpty()) {\n\n Map<TopicAndPartition, Long> earliestMap = getEarliestOffsets();\n for (Map.Entry<TopicAndPartition, Long> entry : earliestMap.entrySet()) {\n\n TopicAndPartition currentTAP = entry.getKey();\n String currentEarliestTopicName = entry.getKey().topic();\n Long currentEarliestOffset = entry.getValue();\n\n /*\n Using kafka's EarliestOffsetMap, run through all TAPs.\n 1. If tap in stored offsets, and storedOffset>=earliestOffset, add to results\n else add with earliest offset\n 2. If TAP not in stored offsetMap, add from earliestMap\n */\n\n //stay on topic (lol)\n if (currentEarliestTopicName.equals(topic)) {\n\n if (resMap.containsKey(currentTAP)) {\n Long currentStoredOffset = resMap.get(currentTAP);\n if (currentStoredOffset >= currentEarliestOffset) {\n Log.debug(\"Found stored partition: {}:{}, adding to map\", currentTAP.topic(), currentTAP.partition());\n returnOffsetsMap.put(currentTAP, currentStoredOffset);\n } else {\n Log.info(\"Stored partition offset lower than earliest, adding as earliest: {}:{}\", currentTAP.topic(), currentTAP.partition());\n Log.info(\"\\tstored:{}, earliest:{}\", currentStoredOffset, currentEarliestOffset);\n returnOffsetsMap.put(currentTAP, currentEarliestOffset);\n }\n } else { // Stored offsets dit not contain this TAP at all\n Log.info(\"Found new partition: {}:{}, adding to map\", currentTAP.topic(), currentTAP.partition());\n returnOffsetsMap.put(currentTAP, currentEarliestOffset);\n }\n }\n }\n\n } else {\n //There are no offsets for this groupid/topic combo, revert to\n if (startFrom.equals(\"latest\")) {\n Log.info(\"No offsets found for {}:{}, reverting to 'latest'\", groupid, topic);\n returnOffsetsMap.putAll(getLatestOffsets(topic));\n } else if (startFrom.equals(\"earliest\")){\n Log.info(\"No offsets found for {}:{}, reverting to 'earliest'\", groupid, topic);\n returnOffsetsMap.putAll(getEarliestOffsets(topic));\n } else {\n //This sould not occur as values are checked in the builder\n throw new IllegalArgumentException(\"startFrom cannot be anything other than 'earliest' or 'latest'\");\n }\n }\n }\n return returnOffsetsMap;\n }", "private void processCollection(MotifCollection collection, String strategy) throws ExecutionError {\n List<Motif> list=collection.getPayload();\n for (Motif motif:list) {\n String motifname=motif.getName();\n Motif[] temp=null;\n try {\n temp=getMotif(motifname);\n } catch (ExecutionError gme) { // this happens if the motifname is not a recognized ID\n if (skipUnrecognizedCheckbox.isSelected()) continue;\n else throw gme;\n }\n Motif originalMotif=temp[0];\n Motif updatedMotif=temp[1]; \n try {\n if (strategy.equals(REPLACE_CURRENT)) {\n String shortname=motif.getShortName();\n if (shortname!=null && !shortname.isEmpty()) updatedMotif.setShortName(shortname);\n String longname=motif.getLongName();\n if (longname!=null && !longname.isEmpty()) updatedMotif.setLongName(longname);\n String classification=motif.getClassification();\n if (classification!=null && !classification.isEmpty()) updatedMotif.setClassification(classification);\n int quality=motif.getQuality();\n if (quality!=6) updatedMotif.setQuality(quality);\n String part=motif.getPart();\n if (part!=null && !part.equals(Motif.FULL)) updatedMotif.setPart(part);\n String factors=motif.getBindingFactors();\n if (factors!=null && !factors.isEmpty()) updatedMotif.setBindingFactors(factors);\n String organisms=motif.getOrganisms();\n if (organisms!=null && !organisms.isEmpty()) updatedMotif.setOrganisms(organisms);\n ArrayList<String> alternatives=motif.getKnownDuplicatesNames();\n String[] namelist=new String[alternatives.size()];\n if (alternatives!=null && !alternatives.isEmpty()) updatedMotif.setKnownDuplicatesNames(alternatives.toArray(namelist));\n ArrayList<String> interaction=motif.getInteractionPartnerNames();\n namelist=new String[interaction.size()];\n if (interaction!=null && !interaction.isEmpty()) updatedMotif.setInteractionPartnerNames(interaction.toArray(namelist));\n ArrayList<String> tissues=motif.getTissueExpressionAsStringArray();\n namelist=new String[tissues.size()];\n if (tissues!=null && !tissues.isEmpty()) updatedMotif.setTissueExpression(tissues.toArray(namelist));\n for (String userproperty:motif.getUserDefinedProperties()) {\n Object value=motif.getUserDefinedPropertyValue(userproperty);\n if (value instanceof ArrayList) value=((ArrayList)value).clone();\n updatedMotif.setUserDefinedPropertyValue(userproperty, value);\n }\n double[][] matrix=motif.getMatrix();\n if (matrix!=null) updatedMotif.setMatrix(matrix);\n }\n else if (strategy.equals(MERGE_OR_REPLACE_CURRENT)) {\n String shortname=motif.getShortName();\n if (shortname!=null && !shortname.isEmpty()) updatedMotif.setShortName(shortname);\n String longname=motif.getLongName();\n if (longname!=null && !longname.isEmpty()) updatedMotif.setLongName(longname);\n String classification=motif.getClassification();\n if (classification!=null && !classification.isEmpty()) updatedMotif.setClassification(classification);\n int quality=motif.getQuality();\n if (quality!=6) updatedMotif.setQuality(quality);\n String part=motif.getPart();\n if (part!=null && !part.equals(Motif.FULL)) updatedMotif.setPart(part);\n \n String factors=motif.getBindingFactors(); \n if (factors!=null && !factors.isEmpty()) mergeOrReplaceCurrentProperty(originalMotif,updatedMotif, \"Factors\", factors);\n String organisms=motif.getOrganisms();\n if (organisms!=null && !organisms.isEmpty()) mergeOrReplaceCurrentProperty(originalMotif,updatedMotif, \"Organisms\", organisms);\n \n ArrayList<String> alternatives=motif.getKnownDuplicatesNames();\n ArrayList<String> alternativesOriginal=originalMotif.getKnownDuplicatesNames();\n if (alternatives!=null && !alternatives.isEmpty()) updatedMotif.setKnownDuplicatesNames(mergeStringLists(alternativesOriginal, alternatives));\n \n ArrayList<String> interactions=motif.getInteractionPartnerNames();\n ArrayList<String> interactionsOriginal=originalMotif.getInteractionPartnerNames();\n if (interactions!=null && !interactions.isEmpty()) updatedMotif.setInteractionPartnerNames(mergeStringLists(interactionsOriginal, interactions));\n \n ArrayList<String> tissues=motif.getTissueExpressionAsStringArray();\n ArrayList<String> tissuesOriginal=originalMotif.getTissueExpressionAsStringArray();\n if (tissues!=null && !tissues.isEmpty()) updatedMotif.setTissueExpression(mergeStringLists(tissuesOriginal, tissues));\n \n double[][] matrix=motif.getMatrix();\n if (matrix!=null) updatedMotif.setMatrix(matrix); \n \n for (String userproperty:motif.getUserDefinedProperties()) {\n Class type=Motif.getClassForUserDefinedProperty(userproperty, gui.getEngine());\n if (type!=null && (type.equals(ArrayList.class) || type.equals(String.class))) { // can the new properties be merged?\n String merged=mergeStringsLists( (String)originalMotif.getUserDefinedPropertyValueAsType(userproperty,String.class), (String)motif.getUserDefinedPropertyValueAsType(userproperty,String.class)); \n String[] mergedSplit=merged.split(\"\\\\s*,\\\\s*\");\n ArrayList<String> value=new ArrayList<String>(mergedSplit.length);\n value.addAll(Arrays.asList(merged));\n updatedMotif.setUserDefinedPropertyValue(userproperty, value);\n } else updatedMotif.setUserDefinedPropertyValue(userproperty, motif.getUserDefinedPropertyValue(userproperty)); // the property can not be merged \n } \n \n }\n else if (strategy.equals(MERGE_OR_KEEP_CURRENT)) {\n String shortname=motif.getShortName();\n String originalshortname=originalMotif.getShortName();\n if (shortname!=null && !shortname.isEmpty() && (originalshortname==null || originalshortname.isEmpty())) updatedMotif.setShortName(shortname);\n String longname=motif.getLongName();\n String originallongname=originalMotif.getLongName();\n if (longname!=null && !longname.isEmpty() && (originallongname==null || originallongname.isEmpty())) updatedMotif.setLongName(longname);\n String classification=motif.getClassification();\n String originalclassification=originalMotif.getClassification(); \n if (classification!=null && !classification.isEmpty() && (originalclassification==null || originalclassification.isEmpty())) updatedMotif.setClassification(classification);\n// int quality=motif.getQuality();\n// if (quality!=6) updatedMotif.setQuality(quality);\n// String part=motif.getPart();\n// if (part!=null && !part.equals(Motif.FULL)) updatedMotif.setPart(part);\n String factors=motif.getBindingFactors(); \n if (factors!=null && !factors.isEmpty()) mergeOrKeepCurrentProperty(originalMotif,updatedMotif, \"Factors\", factors);\n String organisms=motif.getOrganisms();\n if (organisms!=null && !organisms.isEmpty()) mergeOrKeepCurrentProperty(originalMotif,updatedMotif, \"Organisms\", organisms);\n \n ArrayList<String> alternatives=motif.getKnownDuplicatesNames();\n ArrayList<String> alternativesOriginal=originalMotif.getKnownDuplicatesNames();\n if (alternatives!=null && !alternatives.isEmpty()) updatedMotif.setKnownDuplicatesNames(mergeStringLists(alternativesOriginal, alternatives));\n \n ArrayList<String> interactions=motif.getInteractionPartnerNames();\n ArrayList<String> interactionsOriginal=originalMotif.getInteractionPartnerNames();\n if (interactions!=null && !interactions.isEmpty()) updatedMotif.setInteractionPartnerNames(mergeStringLists(interactionsOriginal, interactions));\n \n ArrayList<String> tissues=motif.getTissueExpressionAsStringArray();\n ArrayList<String> tissuesOriginal=originalMotif.getTissueExpressionAsStringArray();\n if (tissues!=null && !tissues.isEmpty()) updatedMotif.setTissueExpression(mergeStringLists(tissuesOriginal, tissues));\n \n if (originalMotif.getMatrix()==null) {\n double[][] matrix=motif.getMatrix();\n if (matrix!=null) updatedMotif.setMatrix(matrix); \n }\n \n for (String userproperty:motif.getUserDefinedProperties()) {\n Class type=Motif.getClassForUserDefinedProperty(userproperty, gui.getEngine());\n if (type!=null && (type.equals(ArrayList.class) || type.equals(String.class))) { // can the new properties be merged?\n String merged=mergeStringsLists( (String)originalMotif.getUserDefinedPropertyValueAsType(userproperty,String.class), (String)motif.getUserDefinedPropertyValueAsType(userproperty,String.class)); \n String[] mergedSplit=merged.split(\"\\\\s*,\\\\s*\");\n ArrayList<String> value=new ArrayList<String>(mergedSplit.length);\n value.addAll(Arrays.asList(merged));\n updatedMotif.setUserDefinedPropertyValue(userproperty, value);\n } else updatedMotif.setUserDefinedPropertyValue(userproperty, originalMotif.getUserDefinedPropertyValue(userproperty)); // the property can not be merged \n } \n }\n } catch (ExecutionError e) {\n throw new ExecutionError(\"ParseError for motif '\"+motifname+\"'.\\n\"+e.getMessage());\n } \n }\n }", "synchronized Collection getZombieAffected(Bundle [] bundles) {\n // set of affected bundles will be in start-level/bundle-id order \n TreeSet affected = new TreeSet(new Comparator() {\n public int compare(Object o1, Object o2) {\n BundleImpl b1 = (BundleImpl)o1; \n BundleImpl b2 = (BundleImpl)o2;\n int dif = b1.getStartLevel() - b2.getStartLevel();\n if (dif == 0) {\n dif = (int)(b1.getBundleId() - b2.getBundleId());\n }\n return dif;\n }\n public boolean equals(Object o) {\n return ((o != null) && getClass().equals(o.getClass()));\n }\n });\n if (bundles == null) {\n if (Debug.packages) {\n Debug.println(\"getZombieAffected: check - null\");\n }\n for (Iterator i = packages.values().iterator(); i.hasNext();) {\n Pkg p = (Pkg)i.next();\n for (Iterator ps = p.providers.iterator(); ps.hasNext(); ) {\n ExportPkg ep = (ExportPkg)ps.next();\n if (ep.zombie) {\n if (Debug.packages) {\n Debug.println(\"getZombieAffected: found zombie - \" + ep.bpkgs.bundle);\n }\n affected.add(ep.bpkgs.bundle);\n }\n }\n }\n } else {\n for (int i = 0; i < bundles.length; i++) {\n if (bundles[i] != null) {\n if (Debug.packages) {\n Debug.println(\"getZombieAffected: check - \" + bundles[i]);\n }\n BundleImpl tmp = (BundleImpl)bundles[i];\n\n if (tmp.isFragment() &&\n tmp.isAttached() && \n !affected.contains(tmp.getFragmentHost())) {\n affected.add(tmp.getFragmentHost());\n } else {\n affected.add(bundles[i]);\n }\n }\n }\n }\n ArrayList moreBundles = new ArrayList(affected);\n for (int i = 0; i < moreBundles.size(); i++) {\n BundleImpl b = (BundleImpl)moreBundles.get(i);\n for (Iterator j = b.getExports(); j.hasNext(); ) {\n ExportPkg ep = (ExportPkg)j.next();\n if (ep.pkg != null && ep.pkg.providers.contains(ep)) {\n for (Iterator k = ep.getPackageImporters().iterator(); k.hasNext(); ) {\n Bundle ib = (Bundle)k.next();\n if (!affected.contains(ib)) {\n moreBundles.add(ib);\n if (Debug.packages) {\n Debug.println(\"getZombieAffected: added - \" + ib);\n }\n affected.add(ib);\n }\n }\n }\n }\n }\n return affected;\n }", "@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n int i = 0, indexi = 0;\n int loopi = 0;\n for (DataSnapshot dsp : dataSnapshot.getChildren()) {\n\n String username = \"\", phone = \"\", driverGpsLat = \"\", driverGpsLog = \"\", plate = \"\", carDesc = \"\",\n verify = \"true\";\n i++;\n String key = dsp.getKey();\n String val = dsp.getValue().toString();\n String actualVal = val.replace(\"{\", \"\").replace(\"}\", \"\");\n String[] separatedActual = actualVal.split(\",\");\n for (int uval = 0; uval < separatedActual.length; uval++) {\n String[] actValArr = separatedActual[uval].split(\"=\");\n String keyVal1 = actValArr[0];\n String val1 = actValArr[actValArr.length - 1];\n\n if (keyVal1.trim().equals(\"GpsLat\")) {\n driverGpsLat = val1;\n continue;\n } else if (keyVal1.trim().equals(\"GpsLog\")) {\n driverGpsLog = val1;\n continue;\n } else if (keyVal1.trim().equals(\"Full Name\")) {\n username = val1;\n\n continue;\n } else if (keyVal1.trim().equals(\"Plate Number\")) {\n plate = val1;\n continue;\n } else if (keyVal1.trim().equals(\"Phone Number\")) {\n phone = val1;\n continue;\n } else if (keyVal1.trim().equals(\"Cab Description\")) {\n carDesc = val1;\n continue;\n } else if (keyVal1.trim().equals(\"Verification\")) {\n verify = val1;\n if (verify.equals(\"false\")) {\n break;\n }\n }\n\n }\n double gpsLatDrv, gpsLogDrv;\n try {\n gpsLatDrv = Double.parseDouble(driverGpsLat);\n gpsLogDrv = Double.parseDouble(driverGpsLog);\n } catch (Exception doubleExp) {\n gpsLatDrv = 0.0;\n gpsLogDrv = 0.0;\n }\n if (gpsLatDrv == 0.0 || gpsLogDrv == 0.0 || username.equals(\"\")) {\n continue;\n }\n // if (!(driverList.contains(mapList.get(\"Plate Number\")))){\n LatLng PERTH = new LatLng(gpsLatDrv, gpsLogDrv);\n\n if (verify.equals(\"true\") && !lstArr.contains(plate)) {\n\n mClusterManager.addItem(new Person(PERTH,username, R.drawable.logo_sixr,plate + \",\"+phone+ \",\" + carDesc,username));\n loopi = loopi + 1;\n lstArr.add(plate);\n\n }\n }\n\n }", "@Test\n public void testGetAll() throws Exception {\n JumpCloneImplant existing;\n Map<Integer, Map<Integer, JumpCloneImplant>> listCheck = new HashMap<>();\n\n existing = new JumpCloneImplant(jumpCloneID, typeID);\n existing.setup(testAccount, 7777L);\n existing = CachedData.update(existing);\n listCheck.put(jumpCloneID, new HashMap<>());\n listCheck.get(jumpCloneID)\n .put(typeID, existing);\n\n existing = new JumpCloneImplant(jumpCloneID + 10, typeID + 10);\n existing.setup(testAccount, 7777L);\n existing = CachedData.update(existing);\n listCheck.put(jumpCloneID + 10, new HashMap<>());\n listCheck.get(jumpCloneID + 10)\n .put(typeID + 10, existing);\n\n // Associated with different account\n existing = new JumpCloneImplant(jumpCloneID, typeID);\n existing.setup(otherAccount, 7777L);\n CachedData.update(existing);\n\n // Not live at the given time\n existing = new JumpCloneImplant(jumpCloneID + 3, typeID + 3);\n existing.setup(testAccount, 9999L);\n CachedData.update(existing);\n\n // EOL before the given time\n existing = new JumpCloneImplant(jumpCloneID + 4, typeID + 4);\n existing.setup(testAccount, 7777L);\n existing.evolve(null, 7977L);\n CachedData.update(existing);\n\n List<JumpCloneImplant> result = CachedData.retrieveAll(8888L,\n (contid, at) -> JumpCloneImplant.accessQuery(testAccount,\n contid, 1000,\n false, at,\n AttributeSelector.any(),\n AttributeSelector.any()));\n Assert.assertEquals(listCheck.size(), result.size());\n for (JumpCloneImplant next : result) {\n int jumpCloneID = next.getJumpCloneID();\n int typeID = next.getTypeID();\n Assert.assertTrue(listCheck.containsKey(jumpCloneID));\n Assert.assertTrue(listCheck.get(jumpCloneID)\n .containsKey(typeID));\n Assert.assertEquals(listCheck.get(jumpCloneID)\n .get(typeID), next);\n }\n\n }", "@Test\n public void testFindNMatches() {\n List<Path> files = new ArrayList<>();\n files.add(new File(String.join(File.separator, \"src\", \"test\", \"resources\"),\n \"logviewer-search-context-tests.log.test\").toPath());\n files.add(new File(String.join(File.separator, \"src\", \"test\", \"resources\"),\n \"logviewer-search-context-tests.log.gz\").toPath());\n\n final LogviewerLogSearchHandler handler = getSearchHandler();\n\n final List<Map<String, Object>> matches1 = handler.findNMatches(files, 20, 0, 0, \"needle\").getMatches();\n final List<Map<String, Object>> matches2 = handler.findNMatches(files, 20, 0, 126, \"needle\").getMatches();\n final List<Map<String, Object>> matches3 = handler.findNMatches(files, 20, 1, 0, \"needle\").getMatches();\n\n assertEquals(2, matches1.size());\n assertEquals(4, ((List) matches1.get(0).get(\"matches\")).size());\n assertEquals(4, ((List) matches1.get(1).get(\"matches\")).size());\n assertEquals(String.join(File.separator, \"test\", \"resources\", \"logviewer-search-context-tests.log.test\"), matches1.get(0).get(\"fileName\"));\n assertEquals(String.join(File.separator, \"test\", \"resources\", \"logviewer-search-context-tests.log.gz\"), matches1.get(1).get(\"fileName\"));\n\n assertEquals(2, ((List) matches2.get(0).get(\"matches\")).size());\n assertEquals(4, ((List) matches2.get(1).get(\"matches\")).size());\n\n assertEquals(1, matches3.size());\n assertEquals(4, ((List) matches3.get(0).get(\"matches\")).size());\n }", "private static <K, V> void assertDocumentUpdated(DataGenerator<K, V> gen, K expectedKey, V expectedValue, String prevTag, Document<K, V> result) {\n gen.assertKeyEquals(expectedKey, result.getKey());\n gen.assertValueEquals(expectedValue, result.getValue());\n assertFalse(TAG_ASSERT_FAILURE_MSG, Strings.isNullOrEmpty(result.getTag()));\n assertNotEquals(prevTag, result.getTag());\n }", "public RatingSearch explode() {\n Elements elements = doc.getElementsByTag(\"table\");\n IqdbMatch bestMatch = null;\n List<IqdbMatch> additionalMatches = new LinkedList<>();\n for (int i = 1; i < elements.size(); i++) {\n //iterating through all the table elements. First one is your uploaded image\n\n //Each table is one \"card\" on iqdb so only the second one will be the \"best match\"\n Element element = elements.get(i);\n IqdbElement iqdbElement = new IqdbElement(element);\n\n Elements noMatch = element.getElementsContainingText(\"No relevant matches\");\n if (noMatch.size() > 0) {\n log.warn(\"There was no relevant match for this document\");\n// break;\n return null;\n }\n// TODO I don't think we can determine if these are even relevant. So once we see 'No relevent matches' we can\n// just call it there. We won't need 'Possible Match' yet\n// Elements possibleMatchElement = element.getElementsContainingText(\"Possible match\");\n// if (possibleMatchElement.size() > 0) {\n// additionalMatches.add(iqdbElement.explode(IqdbMatchType.NO_RELEVANT_BUT_POSSIBLE));\n// }\n\n //Second element will provide all the information you need. going into the similarity and all that is a waste of time\n //Use the similarity search for Best Match to identify the element that is best match if you don't trust the 2nd.\n Elements bestMatchElement = element.getElementsContainingText(\"Best Match\");\n if (bestMatchElement.size() > 0) {\n bestMatch = iqdbElement.explode(IqdbMatchType.BEST);\n }\n\n //can similarly search for \"Additional match\" to find all teh additional matches. Anything beyond additional matches is a waste of time.\n Elements additionalMatchElements = element.getElementsContainingText(\"Additional match\");\n if (additionalMatchElements.size() > 0) {\n additionalMatches.add(iqdbElement.explode(IqdbMatchType.ADDITIONAL));\n }\n }\n\n if (bestMatch == null && !additionalMatches.isEmpty()) {\n log.warn(\"No Best Match found, taking first additionalMatch, does this ever happen?\");\n bestMatch = additionalMatches.remove(0);\n }\n\n return null;//new RatingSearch(bestMatch, additionalMatches);\n }", "@Test\n public void enumerateAccumulatorTest() throws Exception\n {\n Enumerate enumerate = new Enumerate();\n\n Tuple tuple1 = TupleFactory.getInstance().newTuple(1);\n tuple1.set(0, 10);\n\n Tuple tuple2 = TupleFactory.getInstance().newTuple(1);\n tuple2.set(0, 20);\n\n Tuple tuple3 = TupleFactory.getInstance().newTuple(1);\n tuple3.set(0, 30);\n\n Tuple tuple4 = TupleFactory.getInstance().newTuple(1);\n tuple4.set(0, 40);\n\n Tuple tuple5 = TupleFactory.getInstance().newTuple(1);\n tuple5.set(0, 50);\n\n DataBag bag1 = BagFactory.getInstance().newDefaultBag();\n bag1.add(tuple1);\n bag1.add(tuple2);\n bag1.add(tuple3);\n\n DataBag bag2 = BagFactory.getInstance().newDefaultBag();\n bag2.add(tuple4);\n bag2.add(tuple5);\n\n Tuple inputTuple1 = TupleFactory.getInstance().newTuple(1);\n inputTuple1.set(0,bag1);\n\n Tuple inputTuple2 = TupleFactory.getInstance().newTuple(1);\n inputTuple2.set(0,bag2);\n\n enumerate.accumulate(inputTuple1);\n enumerate.accumulate(inputTuple2);\n assertEquals(enumerate.getValue().toString(), \"{(10,0),(20,1),(30,2),(40,3),(50,4)}\");\n\n // Testing that cleanup code is correct by calling cleanup() and passing inputs back to Enumerate instance\n enumerate.cleanup();\n enumerate.accumulate(inputTuple1);\n enumerate.accumulate(inputTuple2);\n assertEquals(enumerate.getValue().toString(), \"{(10,0),(20,1),(30,2),(40,3),(50,4)}\");\n }", "private boolean doRetries(int start,\n int end,\n ReplicatedEnvironment env, \n EntityIndex<Integer, RepTestData> index) {\n boolean success = false;\n boolean noData = false;\n int maxTries = 100;\n\n for (int tries = 0; !success && tries < maxTries; tries++) {\n try {\n Transaction txn = env.beginTransaction(null, null);\n int realStart = 0;\n EntityCursor<RepTestData> cursor = null;\n try {\n cursor = index.entities(txn, null);\n realStart = cursor.first(null).getKey();\n cursor.close();\n cursor = \n index.entities(txn, start, true, end, true, null);\n noData = addRecordsToList(cursor);\n success = true;\n } finally {\n if (cursor != null) {\n cursor.close();\n }\n\n if (success) {\n if (noData) {\n checkNoDataCorrectness(start, realStart, tries);\n } else {\n checkCorrectness(tries);\n }\n txn.commit();\n } else {\n txn.abort();\n }\n list.clear();\n }\n } catch (LockConflictException e) {\n success = false;\n }\n }\n\n return noData;\n }", "long getUpdateCounts(int index);", "public void calculateDifferences() {\n\t\t\tMap<Integer, Integer> shifts = new HashMap<Integer, Integer>();\n\t\t\tfor (int voiceDetected : vDitected) {\n\t\t\t\tfor (int oldValue : occurences) {\n\t\t\t\t\tint shift = voiceDetected - oldValue;\n\t\t\t\t\tif (shifts.containsKey(shift)) {\n\t\t\t\t\t\tshifts.put(shift, shifts.get(shift) + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tshifts.put(shift, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!shifts.isEmpty()) {\n\t\t\t\tpossibleShift = getMaxValuedKey(shifts);\n\t\t\t\tvaluesSet = true;\n\t\t\t}\n\t\t}", "protected void afterTimeSlices()\n\t\tthrows DbCompException\n\t{\n//AW:AFTER_TIMESLICES\n // This code will be executed once after each group of time slices.\n // For TimeSlice algorithms this is done once after all slices.\n // For Aggregating algorithms, this is done after each aggregate\n // period.\n ComputationDAI compdao = tsdb.makeComputationDAO(); \n ArrayList<TimeSeriesIdentifier> tsids = new ArrayList<TimeSeriesIdentifier>();\n TimeSeriesDAI tsdai = tsdb.makeTimeSeriesDAO();\n TimeSeriesIdentifier itsid = getParmTsId(\"input\");\n CTimeSeries icts = new CTimeSeries(itsid.getKey(),itsid.getInterval(),itsid.getTableSelector());\n try {\n tsdai.fillTimeSeriesMetadata(icts);\n int fillDependentCompIds = tsdb.fillDependentCompIds(icts, comp.getAppId() );\n } catch (DbIoException ex) {\n Logger.getLogger(QueueFromFixedTS.class.getName()).log(Level.SEVERE, null, ex);\n } catch (BadTimeSeriesException ex) {\n Logger.getLogger(QueueFromFixedTS.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n HashSet<DbKey> dependentCompIds = icts.getDependentCompIds();\n for( DbKey key: dependentCompIds){\n if( !key.equals( this.comp.getKey() )){ // we don't want an endless loop\n DbComputation mycomp;\n try {\n mycomp = compdao.getComputationById(key);\n if( mycomp.hasGroupInput() && mycomp.isEnabled() ){\n for( DbCompParm parm: mycomp.getParmList() ){\n debug3(parm.getDataTypeId().toString());\n if( parm.isInput() && parm.getSiteDataTypeId().isNull() ){ \n DataType dt = parm.getDataType();\n TsGroup group = mycomp.getGroup();\n //group.addIntervalCode(parm.getInterval());\n //group.addVersion( parm.getVersion() );\n group.addOtherMember(\"version\", parm.getVersion());\n group.addDataTypeId(dt.getKey());\n group.setTransient(); \n group.clearExpandedList();\n //group.refilter(tsdb);\n tsids = tsdb.expandTsGroup(group); \n break; // we got what we need\n }\n\n }\n }\n \n CTimeSeries cts = null;\n for( TimeSeriesIdentifier tsid: tsids ){\n debug3(\"inserting data for \" + tsid.getUniqueString() );\n cts = new CTimeSeries(tsid.getKey(), tsid.getInterval(), tsid.getTableSelector() ); \n tsdai.fillTimeSeries(cts, dates);\n // a little odd, but we are just trying to requeue data\n TimedVariable tv = null;\n for( int i = 0; i < cts.size(); i++ ){\n tv = cts.sampleAt(i);\n tv.setFlags( tv.getFlags() | VarFlags.TO_WRITE );\n }\n tsdai.saveTimeSeries(cts);\n debug3(\"saved data to database\");\n \n }\n \n \n } catch (DbIoException ex) {\n warning(\"database connection failed\");\n } catch (NoSuchObjectException ex) {\n debug3(\"no comp for key \" + key);\n } catch (BadTimeSeriesException ex) {\n debug3(\"could read timeseries data\");\n }\n \n \n }\n \n }\n tsdai.close();\n compdao.close();\n \n//AW:AFTER_TIMESLICES_END\n;\n\t}", "public void reduce(Text _key, Iterator<VIntArrayWritable> values,\n\t\t\tOutputCollector<Text, Text> output, Reporter reporter) throws IOException {\t\t\t\n\t\tList<VIntWritable[]> buf = new ArrayList<>(); //String representations of entity ids (URIs)\n\t\treporter.setStatus(\"Reducing block \"+_key);\n\t\twhile (values.hasNext()) {\n\t\t\tVIntArrayWritable e1Array = (VIntArrayWritable) values.next();\t\t\t\n\t\t\tVIntWritable[] e1 = (VIntWritable[]) e1Array.get();\t\t\t\n\t\t\treporter.progress();\n\t\t\t//System.out.println(\"Reducing...\"+e1);\n\t\t\tVIntWritable dID1 = e1[0]; //clean-clean ER\n\t\t\t//IntWritable eid1 = e1[1];\t\t\t\n\t\t\tVIntWritable[] e1Values = Arrays.copyOfRange(e1, 2, e1.length);\t\t\t\n\t\t\t\n\t\t\tfor (VIntWritable[] e2 : buf) {\t\t\t\n\t\t\t\t\n\t\t\t\treporter.progress();\n\t\t\t\tif (!e2[0].equals(dID1)){ //clean-clean ER\n\t\t\t\t\t//IntWritable eid2 = e2[1];\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//this is the main logic of the reducer!\n\t\t\t\t\tif (!doOverlapFast(e1Values,Arrays.copyOfRange(e2, 2, e2.length))) {\n\t\t\t\t\t\treporter.incrCounter(OutputData.UNIQUE_PAIRS, 1);\n\t\t\t\t\t\t//output.collect(new Text(e1.split(\";;;\")[1]), new Text(e2.split(\";;;\")[1]));\n\t\t\t\t\t} /*else {\n\t\t\t\t\t\treporter.incrCounter(OutputData.REDUNDANT_PAIRS, 1);\n\t\t\t\t\t}*/\n\t\t\t\t} //clean-clean ER\n\t\t\t}\t\t\t\n\t\t\tbuf.add(e1);\t\n\t\t}\n\t}", "void verifyMetaRowsAreUpdated(HConnection hConnection)\n throws IOException {\n List<Result> results = MetaTableAccessor.fullScan(hConnection);\n assertTrue(results.size() >= REGION_COUNT);\n\n for (Result result : results) {\n byte[] hriBytes = result.getValue(HConstants.CATALOG_FAMILY,\n HConstants.REGIONINFO_QUALIFIER);\n assertTrue(hriBytes != null && hriBytes.length > 0);\n assertTrue(MetaMigrationConvertingToPB.isMigrated(hriBytes));\n\n byte[] splitA = result.getValue(HConstants.CATALOG_FAMILY,\n HConstants.SPLITA_QUALIFIER);\n if (splitA != null && splitA.length > 0) {\n assertTrue(MetaMigrationConvertingToPB.isMigrated(splitA));\n }\n\n byte[] splitB = result.getValue(HConstants.CATALOG_FAMILY,\n HConstants.SPLITB_QUALIFIER);\n if (splitB != null && splitB.length > 0) {\n assertTrue(MetaMigrationConvertingToPB.isMigrated(splitB));\n }\n }\n }", "@Test\n public void testSearchNastyCases() {\n RpkiObjectCoder coder = new RpkiObjectCoder();\n AtomicInteger brokenCounter = new AtomicInteger(0);\n lmdb.readTx0(tx -> {\n lmdbRpkiObject.forEach(tx, (k, bb) -> {\n byte[] bytes = Bytes.toBytes(bb);\n try {\n RpkiObject rpkiObject = coder.fromBytes(bytes);\n assertEquals(rpkiObject.key(), k);\n assertArrayEquals(Sha256.hash(rpkiObject.getEncoded()), rpkiObject.getSha256());\n } catch (Exception e) {\n brokenCounter.incrementAndGet();\n e.printStackTrace();\n }\n });\n });\n assertEquals(0, brokenCounter.get());\n }", "static /* synthetic */ void m34120F(int i, long j) {\n AppMethodBeat.m2504i(114776);\n C22440b c22440b;\n if (i == 11) {\n c22440b = new C22440b();\n c22440b.startTime = System.currentTimeMillis();\n sJR.put(Long.valueOf(j), c22440b);\n AppMethodBeat.m2505o(114776);\n return;\n }\n if (i == 12) {\n if (!sJR.containsKey(Long.valueOf(j))) {\n new C22440b().startTime = System.currentTimeMillis();\n AppMethodBeat.m2505o(114776);\n return;\n }\n } else if (i == 13) {\n c22440b = (C22440b) sJR.get(Long.valueOf(j));\n if (c22440b != null) {\n c22440b.endTime = System.currentTimeMillis();\n sJT.add(c22440b);\n sJR.remove(Long.valueOf(j));\n }\n }\n AppMethodBeat.m2505o(114776);\n }", "void warmup(ConsolidatedSnapshot snapshot, double[] forecasts);", "private void coverExistingValues() \n {\n for(int i = 1; i <= gDim; i++)\n {\n for(int j = 1; j <= gDim; j++)\n {\n //If the board has a value at the current position, cover the satisfied rows and columns\n if(board[i - 1][j - 1] != null)\n {\n int rowIndex = rcvToMatrixRow(i, j, board[i - 1][j - 1]);\n coverSatisfiedColumns(ecmCoveredCols, rowIndex);\n coverSatisfiedRows(ecmCoveredRows, rowIndex);\n }\n }\n }\n }", "@Test\r\n\tpublic void testConcurentUpdate() throws InterruptedException, ExecutionException{\r\n\t\tfinal Annotations annos = new Annotations();\r\n\t\t// Apply these annos to this node.\r\n\t\tannos.setId(KeyFactory.keyToString(node.getId()));\r\n\t\tannos.addAnnotation(\"stringKey\", \"String\");\r\n\t\t\r\n\t\tLoopingAnnotaionsWoker workerOne = new LoopingAnnotaionsWoker(dboAnnotationsDao, 10, annos);\r\n\t\tLoopingAnnotaionsWoker workerTwo = new LoopingAnnotaionsWoker(dboAnnotationsDao, 10, annos);\r\n\t\t// Start both workers\r\n\t\tExecutorService pool = Executors.newFixedThreadPool(2);\r\n\t\tFuture<Boolean> furtureOne = pool.submit(workerOne);\r\n\t\tFuture<Boolean> furtureTwo = pool.submit(workerTwo);\r\n\t\t// Wait for the threads to finish.\r\n\r\n\t\tassertTrue(furtureOne.get());\r\n\t\tassertTrue(furtureTwo.get());\r\n\r\n\t\t// There should be no duplication.\r\n\t\tAnnotations clone = dboAnnotationsDao.getAnnotations(node.getId());\r\n\t\t// There should be no duplication.\r\n\t\tassertNotNull(clone);\r\n\t\tCollection list = clone.getAllValues(\"stringKey\");\r\n\t\tassertNotNull(list);\r\n\t\tassertEquals(\"There should only be one value for this annotations. That means multiple threads caused duplication!\", 1, list.size());\r\n\t\tassertEquals(\"String\", list.iterator().next() );\r\n\t}", "private void jobFilter_30_Run1st() {\r\n\r\n//\t\tfinal long start = System.nanoTime();\r\n\r\n\t\tif (_allPhotos.length == 0) {\r\n\r\n\t\t\t// there are no images in the current folder,\r\n\r\n\t\t\t/*\r\n\t\t\t * gallery MUST be updated even when no images are displayed because images from the\r\n\t\t\t * previous folder are still displayed\r\n\t\t\t */\r\n\r\n\t\t\tupdateUI_GalleryInfo();\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfinal boolean isGPSFilter = _imageFilterGPS == PhotoFilterGPS.WITH_GPS;\r\n\t\tfinal boolean isNoGPSFilter = _imageFilterGPS == PhotoFilterGPS.NO_GPS;\r\n\t\tfinal boolean isTourFilter = _imageFilterTour == PhotoFilterTour.WITH_TOURS;\r\n\t\tfinal boolean isNoTourFilter = _imageFilterTour == PhotoFilterTour.NO_TOURS;\r\n\r\n\t\tfinal boolean isFilterSet = isGPSFilter || isNoGPSFilter || isTourFilter || isNoTourFilter;\r\n\r\n\t\t// get current dirty counter\r\n\t\tfinal int currentDirtyCounter = _jobFilterDirtyCounter;\r\n\r\n\t\tPhoto[] newFilteredPhotos = null;\r\n\r\n\t\tif (isFilterSet) {\r\n\r\n\t\t\tfinal int numberOfPhotos = _allPhotos.length;\r\n\t\t\tfinal Photo[] tempFilteredPhotos = new Photo[numberOfPhotos];\r\n\r\n\t\t\t// filterindex is incremented when the filter contains a gallery item\r\n\t\t\tint filterIndex = 0;\r\n\t\t\tint photoIndex = 0;\r\n\r\n\t\t\t// loop: all photos\r\n\t\t\tfor (final Photo photo : _allPhotos) {\r\n\r\n\t\t\t\tif (_filterJobIsCanceled) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tboolean isPhotoInFilter = false;\r\n\r\n\t\t\t\tif (photo.isExifLoaded == false) {\r\n\r\n\t\t\t\t\t// image is not yet loaded, it must be loaded to get the gps state\r\n\r\n\t\t\t\t\tputInExifLoadingQueue(photo);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// check again, the gps state could have been cached and set\r\n\t\t\t\tif (photo.isExifLoaded) {\r\n\r\n\t\t\t\t\tfinal boolean isPhotoWithGps = _isLinkPhotoDisplayed\r\n\t\t\t\t\t\t\t? photo.isLinkPhotoWithGps\r\n\t\t\t\t\t\t\t: photo.isTourPhotoWithGps;\r\n\r\n\t\t\t\t\tif (isGPSFilter) {\r\n\t\t\t\t\t\tif (isPhotoWithGps) {\r\n\t\t\t\t\t\t\tisPhotoInFilter = true;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} else if (isNoGPSFilter) {\r\n\r\n\t\t\t\t\t\tif (!isPhotoWithGps) {\r\n\t\t\t\t\t\t\tisPhotoInFilter = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfinal boolean isSavedInTour = photo.isSavedInTour;\r\n\r\n\t\t\t\tif (isTourFilter) {\r\n\t\t\t\t\tif (isSavedInTour) {\r\n\t\t\t\t\t\tisPhotoInFilter = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else if (isNoTourFilter) {\r\n\r\n\t\t\t\t\tif (!isSavedInTour) {\r\n\t\t\t\t\t\tisPhotoInFilter = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (isPhotoInFilter) {\r\n\r\n\t\t\t\t\ttempFilteredPhotos[filterIndex] = _allPhotos[photoIndex];\r\n\r\n\t\t\t\t\tfilterIndex++;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tphotoIndex++;\r\n\t\t\t}\r\n\r\n\t\t\t// remove trailing array items which are not set\r\n\t\t\tnewFilteredPhotos = Arrays.copyOf(tempFilteredPhotos, filterIndex);\r\n\r\n\t\t} else {\r\n\r\n\t\t\t// a filter is not set, display all images but load exif data which is necessary when sorting by date\r\n\r\n\t\t\tnewFilteredPhotos = Arrays.copyOf(_allPhotos, _allPhotos.length);\r\n\r\n\t\t\t// loop: all photos\r\n\t\t\tfor (final Photo photo : _allPhotos) {\r\n\r\n\t\t\t\tif (_filterJobIsCanceled) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (photo.isExifLoaded == false) {\r\n\r\n\t\t\t\t\t// image is not yet loaded, it must be loaded to get the gps state\r\n\t\t\t\t\tputInExifLoadingQueue(photo);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// check sorting\r\n//\t\tif (_initialSorting != _currentSorting) {\r\n//\r\n//\t\t\t/*\r\n//\t\t\t * photo must be sorted because sorting is different than the initial sorting, this\r\n//\t\t\t * will sort only the filtered photo\r\n//\t\t\t */\r\n//\r\n\t\tArrays.sort(newFilteredPhotos, getCurrentComparator());\r\n//\t\t}\r\n\r\n\t\t/**\r\n\t\t * Update UI\r\n\t\t * <p>\r\n\t\t * gallery MUST be updated even when no images are displayed because images from the\r\n\t\t * previous folder are still displayed\r\n\t\t */\r\n\t\tupdateUI_GalleryItems(newFilteredPhotos, null);\r\n\r\n\t\tif (_jobFilterDirtyCounter > currentDirtyCounter) {\r\n\r\n\t\t\t// filter is dirty again\r\n\r\n\t\t\tjobFilter_23_ScheduleSubsequentWithoutRunCheck();\r\n\r\n\t\t} else {\r\n\r\n\t\t\t// clear progress bar\r\n\r\n\t\t\tjobUILoading_20_Schedule();\r\n\t\t}\r\n\r\n//\t\tfinal float timeDiff = (float) (System.nanoTime() - start) / 1000000;\r\n////\t\tif (timeDiff > 10) {}\r\n//\t\tSystem.out.println(\"filterJob_20_RunInitial:\\t\" + timeDiff + \" ms\\t\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n//\t\t// TODO remove SYSTEM.OUT.PRINTLN\r\n\t}", "public ArtifactBasicResults readVersions( Collection<ArtifactBasicMetadata> query )\n throws RepositoryException\n {\n if( query == null || query.size() < 1 )\n return null;\n\n ArtifactBasicResults res = new ArtifactBasicResults( query.size() );\n \n String root = _repo.getServer().getURL().toString();\n \n for( ArtifactBasicMetadata bmd : query )\n {\n ArtifactLocation loc = new ArtifactLocation( root, bmd );\n \n Collection<String> versions = null;\n \n try\n {\n versions = getCachedVersions( loc, bmd );\n \n if( Util.isEmpty( versions ) )\n continue;\n }\n catch( Exception e )\n {\n res.addError( bmd, e );\n continue;\n }\n\n VersionRange versionQuery;\n try\n {\n versionQuery = VersionRangeFactory.create( bmd.getVersion(), _repo.getVersionRangeQualityRange() );\n }\n catch( VersionException e )\n {\n res.addError( bmd, new RepositoryException(e) );\n continue;\n }\n\n Quality vq = new Quality( bmd.getVersion() );\n \n if( vq.equals( Quality.FIXED_RELEASE_QUALITY ) \n || vq.equals( Quality.FIXED_LATEST_QUALITY )\n || vq.equals( Quality.SNAPSHOT_QUALITY )\n )\n {\n try\n {\n loc = calculateLocation( root, bmd, res );\n }\n catch( Exception e )\n {\n res.addError( bmd, e );\n continue;\n }\n \n if( loc == null )\n continue;\n \n ArtifactBasicMetadata vmd = new ArtifactBasicMetadata();\n vmd.setGroupId( bmd.getGroupId() );\n vmd.setArtifactId( bmd.getArtifactId() );\n vmd.setClassifier( bmd.getClassifier() );\n vmd.setType( bmd.getType() );\n vmd.setVersion( loc.getVersion() );\n \n res = ArtifactBasicResults.add( res, bmd, vmd );\n \n continue;\n\n }\n \n for( String version : versions )\n {\n Quality q = new Quality( version );\n\n if( ! _repo.isAcceptedQuality( q ) )\n continue;\n \n if( !versionQuery.includes( version ) )\n continue;\n \n ArtifactBasicMetadata vmd = new ArtifactBasicMetadata();\n vmd.setGroupId( bmd.getGroupId() );\n vmd.setArtifactId( bmd.getArtifactId() );\n vmd.setClassifier( bmd.getClassifier() );\n vmd.setType( bmd.getType() );\n vmd.setVersion( version );\n \n res = ArtifactBasicResults.add( res, bmd, vmd );\n }\n \n }\n \n return res;\n }", "@Test\n public void multipleProducerAndMultipleConsumerScenarioTest() throws InterruptedException, ExecutionException {\n List<Chunk> chunkList1 = new ArrayList<>();\n //generate chunks for producer 1\n int numOfChunksToUpload = 1000;\n while (numOfChunksToUpload > 0) {\n chunkList1.add(generateChunk(10));\n numOfChunksToUpload--;\n }\n\n //Calculate the cached price list for producer 1\n Map<String, Record> expectedPriceList = new HashMap<>();\n String expectedPrice;\n chunkList1.forEach((chunk) -> {\n Map<String, List<Record>> groupedRecords = chunk.getData().stream().collect(Collectors.groupingBy(Record::getId));\n groupedRecords.forEach((s, l) -> {\n l.sort(recordComparator);\n Record latestRecord = l.get(0);\n expectedPriceList.put(latestRecord.getId(), latestRecord);\n\n });\n\n });\n\n\n List<Chunk> chunkList2 = new ArrayList<>();\n //generate chunks for producer 2\n numOfChunksToUpload = 1000;\n while (numOfChunksToUpload > 0) {\n chunkList2.add(generateChunk(10));\n numOfChunksToUpload--;\n }\n\n //Calculate cached price list for producer 2\n Map<String, Record> cachedPriceList = new HashMap<>();\n chunkList2.forEach((chunk) -> {\n Map<String, List<Record>> groupedRecords = chunk.getData().stream().collect(Collectors.groupingBy(Record::getId));\n groupedRecords.forEach((s, l) -> {\n l.sort(recordComparator);\n Record latestRecord = l.get(0);\n cachedPriceList.put(latestRecord.getId(), latestRecord);\n\n });\n\n });\n\n //calculating expected price with both the producer's cached price list\n cachedPriceList.forEach((k, v) -> {\n Record originalRecord = expectedPriceList.get(k);\n if (originalRecord != null) {\n if (v.getAsOf().compareTo(originalRecord.getAsOf()) >= 0) {\n expectedPriceList.put(k, v);\n }\n } else {\n expectedPriceList.put(k, v);\n }\n });\n\n expectedPrice = String.valueOf(expectedPriceList.get(\"5\").getPayload().get(\"Price\"));\n log.info(\"Expected latest price: \" + expectedPrice);\n //Start the producer 1 thread\n ExecutorService executorService = Executors.newFixedThreadPool(4);\n ProducerThread producerThread1 = new ProducerThread(\"Producer1\", chunkList1, 100, new ApplicationService());\n Future<String> producerResult1 = executorService.submit(producerThread1);\n\n //Start the producer 2 thread\n ProducerThread producerThread2 = new ProducerThread(\"Producer2\", chunkList2, 100, new ApplicationService());\n Future<String> producerResult2 = executorService.submit(producerThread2);\n\n //Wait for both the batch run to start\n Thread.sleep(20);\n //Start a consumer thread to access the price while the batch is running\n Future<String> consumer1Result = executorService.submit(new ConsumerThread(\"Consumer1\", 1, new ApplicationService()));\n assertNull(consumer1Result.get());\n\n //Wait for all the batch runs to be completed\n if (ProducerConstants.BATCH_COMPLETION_MESSAGE.equals(producerResult1.get()) && ProducerConstants.BATCH_COMPLETION_MESSAGE.equals(producerResult2.get())) {\n //Start a consumer thread to access the price and then apply assertion to the expected and actual price\n Future<String> consumer2Result = executorService.submit(new ConsumerThread(\"Consumer2\", 5, new ApplicationService()));\n assertEquals(expectedPrice, consumer2Result.get());\n }\n executorService.shutdown();\n\n }", "@Test\n// @Ignore(\"KnownBug: ACCUMULO-3646\")\n public void testInjectOnScan() throws Exception {\n Connector conn = tester.getConnector();\n\n // create table, add table split, write data\n final String tableName = getUniqueNames(1)[0];\n Map<Key, Value> input = new HashMap<>();\n input.put(new Key(\"aTablet1\", \"\", \"cq\"), new Value(\"7\".getBytes(StandardCharsets.UTF_8)));\n input.put(new Key(\"kTablet2\", \"\", \"cq\"), new Value(\"7\".getBytes(StandardCharsets.UTF_8)));\n input.put(new Key(\"zTablet2\", \"\", \"cq\"), new Value(\"7\".getBytes(StandardCharsets.UTF_8)));\n SortedSet<Text> splitset = new TreeSet<>();\n splitset.add(new Text(\"f\"));\n TestUtil.createTestTable(conn, tableName, splitset, input);\n\n // expected data back\n Map<Key, Value> expect = new HashMap<>(input);\n expect.putAll(HardListIterator.allEntriesToInject);\n\n // attach InjectIterator\n IteratorSetting itset = new IteratorSetting(15, InjectIterator.class);\n conn.tableOperations().attachIterator(tableName, itset, EnumSet.of(IteratorUtil.IteratorScope.scan));\n itset = new IteratorSetting(16, DebugIterator.class);\n conn.tableOperations().attachIterator(tableName, itset, EnumSet.of(IteratorUtil.IteratorScope.scan));\n\n // read back both tablets in parallel\n BatchScanner scan = conn.createBatchScanner(tableName, Authorizations.EMPTY, 2);\n// Key startKey = new Key(new Text(\"d\"), cf, cq);\n Range rng = new Range();\n scan.setRanges(Collections.singleton(rng));\n log.debug(\"Results of scan on table \" + tableName + ':');\n Map<Key, Value> actual = new TreeMap<>(TestUtil.COMPARE_KEY_TO_COLQ); // only compare row, colF, colQ\n for (Map.Entry<Key, Value> entry : scan) {\n Key k = entry.getKey();\n Value v = entry.getValue();\n log.debug(k + \" \" + v);\n Assert.assertFalse(\"Duplicate entry found: \" + k, actual.containsKey(k)); // Fails\n actual.put(k, v);\n }\n //TestUtil.assertEqualEntriesRowColFColQ(expect, actual);\n Assert.assertEquals(expect, actual);\n\n // delete test data\n conn.tableOperations().delete(tableName);\n }", "@Test\n public void testMultimapViewInWindow() throws Exception {\n byte[] duplicateKey = new byte[] {0x01};\n Coder<WindowedValue<Long>> valueCoder =\n WindowedValue.getFullCoder(VarLongCoder.of(), INTERVAL_WINDOW_CODER);\n final ListMultimap<byte[], WindowedValue<Long>> firstWindow =\n ImmutableListMultimap.<byte[], WindowedValue<Long>>builder()\n .put(new byte[] {0x00}, valueInIntervalWindow(12L, 10))\n .put(duplicateKey, valueInIntervalWindow(22L, 10))\n .put(duplicateKey, valueInIntervalWindow(23L, 10))\n .put(new byte[] {0x02}, valueInIntervalWindow(32L, 10))\n .build();\n final ListMultimap<byte[], WindowedValue<Long>> secondWindow =\n ImmutableListMultimap.<byte[], WindowedValue<Long>>builder()\n .put(new byte[] {0x00}, valueInIntervalWindow(42L, 20))\n .put(new byte[] {0x03}, valueInIntervalWindow(52L, 20))\n .put(new byte[] {0x02}, valueInIntervalWindow(62L, 20))\n .build();\n final ListMultimap<byte[], WindowedValue<Long>> thirdWindow =\n ImmutableListMultimap.<byte[], WindowedValue<Long>>builder()\n .put(new byte[] {0x02}, valueInIntervalWindow(73L, 30))\n .put(new byte[] {0x04}, valueInIntervalWindow(82L, 30))\n .put(new byte[] {0x05}, valueInIntervalWindow(92L, 30))\n .build();\n\n final PCollectionView<MultimapView<byte[], WindowedValue<Long>>> view =\n DataflowPortabilityPCollectionView.with(\n new TupleTag<>(),\n FullWindowedValueCoder.of(\n KvCoder.of(ByteArrayCoder.of(), valueCoder), INTERVAL_WINDOW_CODER));\n\n IsmRecordCoder<WindowedValue<Long>> ismCoder =\n IsmRecordCoder.of(\n 1,\n 0,\n ImmutableList.of(ByteArrayCoder.of(), INTERVAL_WINDOW_CODER, BigEndianLongCoder.of()),\n valueCoder);\n\n Multimap<Integer, IsmRecord<WindowedValue<Long>>> elementsPerShard =\n forMap(ismCoder, firstWindow);\n elementsPerShard.putAll(forMap(ismCoder, secondWindow));\n elementsPerShard.putAll(forMap(ismCoder, thirdWindow));\n\n List<IsmRecord<WindowedValue<Long>>> firstElements = new ArrayList<>();\n List<IsmRecord<WindowedValue<Long>>> secondElements = new ArrayList<>();\n for (Map.Entry<Integer, Collection<IsmRecord<WindowedValue<Long>>>> entry :\n elementsPerShard.asMap().entrySet()) {\n if (entry.getKey() % 2 == 0) {\n firstElements.addAll(entry.getValue());\n } else {\n secondElements.addAll(entry.getValue());\n }\n }\n // Ensure that each file will have some records.\n checkState(!firstElements.isEmpty());\n checkState(!secondElements.isEmpty());\n\n Source sourceA = initInputFile(firstElements, ismCoder);\n Source sourceB = initInputFile(secondElements, ismCoder);\n\n final IsmSideInputReader reader =\n sideInputReader(view.getTagInternal().getId(), sourceA, sourceB);\n\n List<Callable<Map<BoundedWindow, MultimapView<byte[], WindowedValue<Long>>>>> tasks =\n new ArrayList<>();\n for (int i = 0; i < 3; ++i) {\n tasks.add(\n () -> {\n // Store a strong reference to the returned value so that the logical reference\n // cache is not cleared for this test.\n MultimapView<byte[], WindowedValue<Long>> firstValues =\n reader.get(view, intervalWindow(10));\n MultimapView<byte[], WindowedValue<Long>> secondValues =\n reader.get(view, intervalWindow(20));\n MultimapView<byte[], WindowedValue<Long>> thirdValues =\n reader.get(view, intervalWindow(30));\n\n for (Map.Entry<byte[], Collection<WindowedValue<Long>>> entry :\n firstWindow.asMap().entrySet()) {\n verifyIterable(entry.getValue(), firstValues.get(entry.getKey()));\n }\n for (Map.Entry<byte[], Collection<WindowedValue<Long>>> entry :\n secondWindow.asMap().entrySet()) {\n verifyIterable(entry.getValue(), secondValues.get(entry.getKey()));\n }\n for (Map.Entry<byte[], Collection<WindowedValue<Long>>> entry :\n thirdWindow.asMap().entrySet()) {\n verifyIterable(entry.getValue(), thirdValues.get(entry.getKey()));\n }\n\n // Assert that the same value reference was returned showing that it was cached.\n assertSame(firstValues, reader.get(view, intervalWindow(10)));\n assertSame(secondValues, reader.get(view, intervalWindow(20)));\n assertSame(thirdValues, reader.get(view, intervalWindow(30)));\n\n return ImmutableMap.of(\n intervalWindow(10), firstValues,\n intervalWindow(20), secondValues,\n intervalWindow(30), thirdValues);\n });\n }\n\n List<Future<Map<BoundedWindow, MultimapView<byte[], WindowedValue<Long>>>>> results =\n pipelineOptions.getExecutorService().invokeAll(tasks);\n Map<BoundedWindow, MultimapView<byte[], WindowedValue<Long>>> value = results.get(0).get();\n // Assert that all threads got back the same reference\n for (Future<Map<BoundedWindow, MultimapView<byte[], WindowedValue<Long>>>> result : results) {\n assertEquals(value, result.get());\n for (Map.Entry<BoundedWindow, MultimapView<byte[], WindowedValue<Long>>> entry :\n result.get().entrySet()) {\n assertSame(value.get(entry.getKey()), entry.getValue());\n }\n }\n }", "@Test\r\n\tpublic void testIntegerSequenceCache_4() {\n\t\tboolean[] replacement = {true, true, true, true};\r\n\t\tRandomOrgCache<String[][]> c = rocs[0].createIntegerSequenceCache(4, LENGTH, MIN, MAX, replacement, BASE, 10);\r\n\t\tc.stop();\r\n\r\n\t\ttry {\r\n\t\t\tc.get();\r\n\t\t\tcollector.addError(new Error(\"should have thrown NoSuchElementException\"));\r\n\t\t} catch (NoSuchElementException e) {}\r\n\t\t\r\n\t\tc.resume();\r\n\t\t\r\n\t\tString[][] got = null;\r\n\t\t\r\n\t\twhile (got == null) {\r\n\t\t\ttry {\r\n\t\t\t\tgot = c.get();\r\n\t\t\t} catch (NoSuchElementException e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(50);\r\n\t\t\t\t} catch (InterruptedException e1) {\r\n\t\t\t\t\tcollector.addError(new Error(\"shouldn't have been interrupted!\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor (int i = 0; i < got.length; i++) {\r\n\t\t\tcollector.checkThat(got[i].length == LENGTH[i], equalTo(true));\r\n\t\t}\r\n\t\t\r\n\t\tcollector.checkThat(got, notNullValue());\r\n\t}", "public static HashMap<String, HashMap<Integer, Integer>> binHiggsData(HashMap<String, ArrayList<Double>> energyMap){\r\n\r\n\t\t//hashmap. Keys: detector name. Value: the hashmap above\r\n\t\tHashMap<String, HashMap<Integer, Integer>> bothDetectorsBinnedData = new HashMap<String, HashMap<Integer, Integer>>();\r\n\r\n\t\t//arraylist of the detector in the map so we can loop through all of them \r\n\t\tArrayList<String> detectorList = new ArrayList<String>();\r\n\t\tdetectorList.addAll(energyMap.keySet());\r\n\r\n\t\t//loop through all of the detectors (in this case, just GG and ZZ)\r\n\t\tfor (String detector : detectorList){\r\n\r\n\t\t\t//initialise values - this needs to be done in this for loop to reset for each detector\r\n\t\t\tint currentValueBin;\r\n\t\t\tint currentFreq;\t\r\n\t\t\tint newFreq;\r\n\t\t\tdouble currentValueBinD;\r\n\r\n\t\t\t//hashmap. Keys: each bin minimum. Value: number of readings in that bin\r\n\t\t\tHashMap<Integer, Integer> numberOfReadingsInEachBin = new HashMap<Integer, Integer>();\r\n\r\n\t\t\t//find the current list of data for this detector\r\n\t\t\tArrayList<Double> currentData = energyMap.get(detector);\r\n\r\n\t\t\tArrayList<Integer> flooredValues = new ArrayList<Integer>();\r\n\r\n\t\t\t//loop through all of the data in the set for this detector\r\n\t\t\tfor (double currentE : currentData){\r\n\r\n\t\t\t\t//round the value down, this is what the bin will be\r\n\t\t\t\tcurrentValueBinD = Math.floor(currentE);\r\n\t\t\t\tcurrentValueBin = (int) currentValueBinD;\r\n\r\n\t\t\t\tflooredValues.add(currentValueBin);\r\n\r\n\r\n\t\t\t\t//look for this value in the hashmap of bins and frequency\r\n\t\t\t\tInteger frequency = numberOfReadingsInEachBin.get(currentValueBin);\r\n\r\n\r\n\r\n\t\t\t\t//if this bin hasn't been put into the hashmap yet, put it in\r\n\t\t\t\tif (frequency == null){\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(currentValueBin, 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//if it has, add one to the frequency\r\n\t\t\t\telse{\r\n\t\t\t\t\tcurrentFreq = numberOfReadingsInEachBin.get(currentValueBin);\r\n\t\t\t\t\tnewFreq = currentFreq +1;\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(currentValueBin, newFreq);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//System.out.println(Collections.min(currentData));\r\n\r\n\t\t\t//if there have been frequencies of zero, they won't have been added, add them now\r\n\t\t\tfor (int i = Collections.min(flooredValues); i < Collections.max(flooredValues); i++){\r\n\t\t\t\tInteger currentReadings = numberOfReadingsInEachBin.get(i);\r\n\r\n\t\t\t\tif (currentReadings == null){\r\n\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(i, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//put the detector and the corresponding frequency data into the hashmap\r\n\t\t\tbothDetectorsBinnedData.put(detector, numberOfReadingsInEachBin);\r\n\r\n\t\t}\r\n\t\treturn bothDetectorsBinnedData;\r\n\t}", "private List<E> snapshot() {\n\t\tList<E> list = Lists.newArrayListWithExpectedSize(size());\n\t\tfor (Multiset.Entry<E> entry : entrySet()) {\n\t\t\tE element = entry.getElement();\n\t\t\tfor (int i = entry.getCount(); i > 0; i--) {\n\t\t\t\tlist.add(element);\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "@Test\n void execute_testingLotsOfBoundaryValues () {\n ihd2.initialize(sensor);\n ihd1.initialize(sensor);\n iad.initialize(ihd1, ihd2);\n\n\n// here i create array with data that i send in to test\n int testData[] = {0, -23, 45, 290, 50, -123, 200, 199, 201, -200, 5, 1, -1, 29};\n\n // in this test the output is two booleans, the output might change for each loop, so i must create an array of arrays that i\n // store the expected results in. so here for example when value zero which is the first value in the testData array is sent\n // to the for loop, once it passed the system and analyze has given it two booleans,\n // it will be compared to the test0 array in the array of arrays called expectedResults.\n boolean test0[] = {false, false};\n boolean test1[] = {false, false};\n boolean test2[] = {true, true};\n boolean test3[] = {true, true};\n boolean test4[] = {true, true};\n boolean test5[] = {false, false};\n boolean test6[] = {true, true};\n boolean test7[] = {true, true};\n boolean test8[] = {true, true};\n boolean test9[] = {false, false};\n boolean test10[] = {false, false};\n boolean test11[] = {false, false};\n boolean test12[] = {false, false};\n boolean test13[] = {true, true};\n\n\n boolean[] expectedResult[] = {test0,test1, test2, test3, test4, test5, test6, test7, test8, test9, test10, test11, test12, test13};\n\n\n\n\n\n // after initialize inputs are set to zero, here inputs is changed with array content at index t\n for (int t = 0; t < testData.length; t++) {\n sensor.safetyOutput = testData[t];\n sensor.originalOutput = testData[t];\n\n // then i must run both ihd so that the safety and original output is transferred to read1 and read2 which is used in\n // iad execute that does the analyze\n ihd1.execute();\n ihd2.execute();\n\n // then i run the execute which analyze the data\n iad.execute();\n\n\n\n // then i take the result and store it in an array.\n boolean[] booleansProducedByAnalyzeMethod = iad.getData();\n// here i store the expectedResultvalue on position t in the testet array\n boolean testet[] = expectedResult[t];\n// and last but not the least i compare both arrays and print out result.\n\n if (Arrays.equals(testet, booleansProducedByAnalyzeMethod))\n System.out.println(\"Pass boundaryvaluestest\"+ t);\n else\n System.out.println(\"Fail boundaryvaluestest\"+ t);\n\n\n }\n }", "public static void m9105b(com.facebook.api.feedcache.db.FeedDbMutationService r5) {\n /*\n L_0x0000:\n r1 = r5.f5242q;\n monitor-enter(r1);\n r0 = r5.f5242q;\t Catch:{ all -> 0x004d }\n r0 = r0.isEmpty();\t Catch:{ all -> 0x004d }\n if (r0 == 0) goto L_0x0010;\n L_0x000b:\n r0 = 0;\n r5.f5240o = r0;\t Catch:{ all -> 0x004d }\n monitor-exit(r1);\t Catch:{ all -> 0x004d }\n return;\n L_0x0010:\n r0 = r5.f5242q;\t Catch:{ all -> 0x004d }\n r0 = r0.removeFirst();\t Catch:{ all -> 0x004d }\n r0 = (com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbRequest) r0;\t Catch:{ all -> 0x004d }\n monitor-exit(r1);\t Catch:{ all -> 0x004d }\n r1 = \"FeedDbMutationService(%s)\";\n r2 = r0.getClass();\n r2 = r2.getSimpleName();\n r3 = -341619410; // 0xffffffffeba34d2e float:-3.9483876E26 double:NaN;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r1, r2, r3);\n r1 = -243934633; // 0xfffffffff175da57 float:-1.21740455E30 double:NaN;\n r1 = com.facebook.tools.dextr.runtime.detour.LoomLoggerDetour.a(r1);\n r2 = \"FeedDbMutationService\";\n r3 = r0.getClass();\n r3 = r3.getSimpleName();\n com.facebook.loom.logger.api.LoomLogger.a(r1, r2, r3);\n r1 = r0 instanceof com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbInsertionRequest;\t Catch:{ all -> 0x0134 }\n if (r1 == 0) goto L_0x0050;\n L_0x0041:\n r0 = (com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbInsertionRequest) r0;\t Catch:{ all -> 0x0134 }\n r5.m9111a(r0);\t Catch:{ all -> 0x0134 }\n r0 = 1514815075; // 0x5a4a3e63 float:1.42316351E16 double:7.484180884E-315;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r0);\n goto L_0x0000;\n L_0x004d:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ }\n throw r0;\n L_0x0050:\n r1 = r0 instanceof com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbMutationRequest;\t Catch:{ }\n if (r1 == 0) goto L_0x0060;\n L_0x0054:\n r0 = (com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbMutationRequest) r0;\t Catch:{ }\n r5.m9100a(r0);\t Catch:{ }\n r0 = 32841027; // 0x1f51d43 float:9.0040775E-38 double:1.6225623E-316;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r0);\n goto L_0x0000;\n L_0x0060:\n r1 = r0 instanceof com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbStorySeenRequest;\t Catch:{ }\n if (r1 == 0) goto L_0x0070;\n L_0x0064:\n r0 = (com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbStorySeenRequest) r0;\t Catch:{ }\n r5.m9103a(r0);\t Catch:{ }\n r0 = -150761083; // 0xfffffffff7039185 float:-2.668525E33 double:NaN;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r0);\n goto L_0x0000;\n L_0x0070:\n r1 = r0 instanceof com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbImageCacheStateUpdateRequest;\t Catch:{ }\n if (r1 == 0) goto L_0x0080;\n L_0x0074:\n r0 = (com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbImageCacheStateUpdateRequest) r0;\t Catch:{ }\n r5.m9097a(r0);\t Catch:{ }\n r0 = -1582673432; // 0xffffffffa1aa51e8 float:-1.1541328E-18 double:NaN;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r0);\n goto L_0x0000;\n L_0x0080:\n r1 = r0 instanceof com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbSeeFirstClearRequest;\t Catch:{ }\n if (r1 == 0) goto L_0x0091;\n L_0x0084:\n r0 = (com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbSeeFirstClearRequest) r0;\t Catch:{ }\n r5.m9101a(r0);\t Catch:{ }\n r0 = -1051379810; // 0xffffffffc155379e float:-13.326078 double:NaN;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r0);\n goto L_0x0000;\n L_0x0091:\n r1 = r0 instanceof com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbCacheResultRerankRequest;\t Catch:{ }\n if (r1 == 0) goto L_0x00a2;\n L_0x0095:\n r0 = (com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbCacheResultRerankRequest) r0;\t Catch:{ }\n r5.m9094a(r0);\t Catch:{ }\n r0 = -521547659; // 0xffffffffe0e9d075 float:-1.3478476E20 double:NaN;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r0);\n goto L_0x0000;\n L_0x00a2:\n r1 = r0 instanceof com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbCacheRerankRequest;\t Catch:{ }\n if (r1 == 0) goto L_0x00b3;\n L_0x00a6:\n r0 = (com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbCacheRerankRequest) r0;\t Catch:{ }\n r5.m9093a(r0);\t Catch:{ }\n r0 = -495910365; // 0xffffffffe2710223 float:-1.1114548E21 double:NaN;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r0);\n goto L_0x0000;\n L_0x00b3:\n r1 = r0 instanceof com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbStoryImageUrlAddRequest;\t Catch:{ }\n if (r1 == 0) goto L_0x00c4;\n L_0x00b7:\n r0 = (com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbStoryImageUrlAddRequest) r0;\t Catch:{ }\n r5.m9102a(r0);\t Catch:{ }\n r0 = 1956524893; // 0x749e335d float:1.0027157E32 double:9.66651735E-315;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r0);\n goto L_0x0000;\n L_0x00c4:\n r1 = r0 instanceof com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbDeleteStoriesRequest;\t Catch:{ }\n if (r1 == 0) goto L_0x00d5;\n L_0x00c8:\n r0 = (com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbDeleteStoriesRequest) r0;\t Catch:{ }\n r5.m9095a(r0);\t Catch:{ }\n r0 = 1671584920; // 0x63a25c98 float:5.990089E21 double:8.25872683E-315;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r0);\n goto L_0x0000;\n L_0x00d5:\n r1 = r0 instanceof com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbDeleteStoryRequest;\t Catch:{ }\n if (r1 == 0) goto L_0x00e6;\n L_0x00d9:\n r0 = (com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbDeleteStoryRequest) r0;\t Catch:{ }\n r5.m9096a(r0);\t Catch:{ }\n r0 = -696100424; // 0xffffffffd68259b8 float:-7.1660925E13 double:NaN;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r0);\n goto L_0x0000;\n L_0x00e6:\n r1 = r0 instanceof com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbVpvOmnistoreSyncRequest;\t Catch:{ }\n if (r1 == 0) goto L_0x00f5;\n L_0x00ea:\n r5.m9106c();\t Catch:{ }\n r0 = -1045059660; // 0xffffffffc1b5a7b4 float:-22.706886 double:NaN;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r0);\n goto L_0x0000;\n L_0x00f5:\n r1 = r0 instanceof com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbLikeAndCommentCountUpdateRequest;\t Catch:{ }\n if (r1 == 0) goto L_0x0106;\n L_0x00f9:\n r0 = (com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbLikeAndCommentCountUpdateRequest) r0;\t Catch:{ }\n r5.m9098a(r0);\t Catch:{ }\n r0 = 759596755; // 0x2d4686d3 float:1.1284934E-11 double:3.752906613E-315;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r0);\n goto L_0x0000;\n L_0x0106:\n r1 = r0 instanceof com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbLiveVideoStatusUpdateRequest;\t Catch:{ }\n if (r1 == 0) goto L_0x0117;\n L_0x010a:\n r0 = (com.facebook.api.feedcache.db.FeedDbMutationService.FeedDbLiveVideoStatusUpdateRequest) r0;\t Catch:{ }\n r5.m9099a(r0);\t Catch:{ }\n r0 = -1270711073; // 0xffffffffb4427cdf float:-1.8113086E-7 double:NaN;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r0);\n goto L_0x0000;\n L_0x0117:\n r1 = \"FeedDbMutationService\";\n r2 = \"Mutation request is not supported: %s\";\n r3 = 1;\n r3 = new java.lang.Object[r3];\t Catch:{ }\n r4 = 0;\n r0 = r0.getClass();\t Catch:{ }\n r0 = r0.getSimpleName();\t Catch:{ }\n r3[r4] = r0;\t Catch:{ }\n com.facebook.debug.log.BLog.c(r1, r2, r3);\t Catch:{ }\n r0 = 492192568; // 0x1d564338 float:2.8357415E-21 double:2.43175439E-315;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r0);\n goto L_0x0000;\n L_0x0134:\n r0 = move-exception;\n r1 = -693974918; // 0xffffffffd6a2c87a float:-8.9490962E13 double:NaN;\n com.facebook.tools.dextr.runtime.detour.TracerDetour.a(r1);\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.api.feedcache.db.FeedDbMutationService.b(com.facebook.api.feedcache.db.FeedDbMutationService):void\");\n }", "private static void task222(int nUMS, RedBlackBST<Integer, Integer> i) {\n\t\tSystem.out.println(\"RED BLAST BST Started Search...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (i.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\n\t}", "@Test\n public void testUpdate() {\n // Choose a random key to read, among the available ones.\n int updateKeyNumber = new Random().nextInt(RiakKVClientTest.recordsToInsert);\n // Define a HashMap to save the previously stored values for eventually restoring them.\n HashMap<String, ByteIterator> readValueBeforeUpdate = new HashMap<>();\n RiakKVClientTest.riakClient.read(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(updateKeyNumber))), null, readValueBeforeUpdate);\n // Prepare an update HashMap to store.\n HashMap<String, String> updateValue = new HashMap<>();\n updateValue.put(RiakKVClientTest.firstField, \"UPDATED\");\n updateValue.put(RiakKVClientTest.secondField, \"UPDATED\");\n updateValue.put(RiakKVClientTest.thirdField, \"UPDATED\");\n // First of all, perform the update and check whether it's failed or not.\n Assert.assertEquals(\"Update transaction FAILED.\", OK, RiakKVClientTest.riakClient.update(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(updateKeyNumber))), StringByteIterator.getByteIteratorMap(updateValue)));\n // Then, read the key again and...\n HashMap<String, ByteIterator> readValueAfterUpdate = new HashMap<>();\n Assert.assertEquals(\"Update test FAILED. Unable to read key value.\", OK, RiakKVClientTest.riakClient.read(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(updateKeyNumber))), null, readValueAfterUpdate));\n // ...compare the result with the new one!\n Assert.assertEquals(\"Update transaction NOT EXECUTED PROPERLY. Values DID NOT CHANGE.\", updateValue.toString(), readValueAfterUpdate.toString());\n // Finally, restore the previously read key.\n Assert.assertEquals(\"Update test FAILED. Unable to restore previous key value.\", OK, RiakKVClientTest.riakClient.update(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(updateKeyNumber))), readValueBeforeUpdate));\n }", "void processScanCoordinates(List<Long> scanTimeStampList, String scanType){\n List<LatLng> scanCoordinates = new ArrayList<>();\n System.out.println(\"LENGTH BEFOREEEE\" + scanTimeStampList.size() + scanType);\n for(int i = 0; i < stepTimeStamp.size()-1;i++){\n long upperTimeBound = stepTimeStamp.get((i+1));\n long lowerTimeBound = stepTimeStamp.get(i);\n List<Integer> scanIndexWithinStep = new ArrayList<>();\n //Searches through the list of timestamps and adds the scan numbers that fall within the step to a list\n for(int j = 0; j < scanTimeStampList.size();j++){\n if(scanTimeStampList.get(j) <= upperTimeBound && scanTimeStampList.get(j)> lowerTimeBound){\n scanIndexWithinStep.add(j);\n }\n }\n if(scanIndexWithinStep.size()>0) {\n //Can loop through them as they will be sequential\n for (int k = scanIndexWithinStep.get(0); k <= scanIndexWithinStep.get(scanIndexWithinStep.size() - 1); k++) {\n //Run the algorithm for each scan that falls within the time range for each step\n double tempLat;\n double tempLong;\n //Formula from Dr. Zheng's paper\n // i here represents the number of steps as the index number in adaptiveTimeList is the step number\n if (xIncreasing) {\n tempLat = startLat + STEP_LENGTH * (i + (double) (scanTimeStampList.get(k) - lowerTimeBound) / (double) (upperTimeBound - lowerTimeBound)) * yCompMotion * degToMRatio;\n } else {\n tempLat = startLat - STEP_LENGTH * (i + (double) (scanTimeStampList.get(k) - lowerTimeBound) / (double) (upperTimeBound - lowerTimeBound)) * yCompMotion * degToMRatio;\n }\n if (yIncreasing) {\n tempLong = startLong + STEP_LENGTH * (i + (double) (scanTimeStampList.get(k) - lowerTimeBound) / (double) (upperTimeBound - lowerTimeBound)) * xCompMotion * degToMRatio;\n } else {\n tempLong = startLong - STEP_LENGTH * (i + (double) (scanTimeStampList.get(k) - lowerTimeBound) / (double) (upperTimeBound - lowerTimeBound)) * xCompMotion * degToMRatio;\n }\n scanCoordinates.add(new LatLng(tempLat, tempLong));\n }\n }\n\n }\n System.out.println(\"LENGTHHHH AFTER\" + scanCoordinates.size() + scanType);\n if(scanType == \"mag\"){\n magCoords = scanCoordinates;\n }\n else if(scanType == \"gyro\"){\n gyroCoords = scanCoordinates;\n }\n else if(scanType == \"accel\"){\n accelCoords = scanCoordinates;\n }\n else if(scanType == \"blue\"){\n blueGlobalCoords = scanCoordinates;\n }\n else if(scanType == \"red\"){\n redGlobalCoords = scanCoordinates;\n }\n }", "private void createFiveValueSet()\n\t{\n\t\tm_mockery.checking(new Expectations()\n\t\t{\n\t\t\t{\n\t\t\t\tallowing(m_values).getItemCount();\n\t\t\t\twill(returnValue(5));\n\t\t\t\t\n\t\t\t\t// Keys.\n\t\t\t\tallowing(m_values).getKey(0);\n\t\t\t\twill(returnValue(0));\n\t\t\t\tallowing(m_values).getKey(1);\n\t\t\t\twill(returnValue(1));\n\t\t\t\tallowing(m_values).getKey(2);\n\t\t\t\twill(returnValue(2));\n\t\t\t\tallowing(m_values).getKey(3);\n\t\t\t\twill(returnValue(3));\n\t\t\t\tallowing(m_values).getKey(4);\n\t\t\t\twill(returnValue(4));\n\t\t\t\t\n\t\t\t\tallowing(m_values).getIndex(0);\n\t\t\t\twill(returnValue(0));\n\t\t\t\tallowing(m_values).getIndex(1);\n\t\t\t\twill(returnValue(1));\n\t\t\t\tallowing(m_values).getIndex(2);\n\t\t\t\twill(returnValue(2));\n\t\t\t\tallowing(m_values).getIndex(3);\n\t\t\t\twill(returnValue(3));\n\t\t\t\tallowing(m_values).getIndex(4);\n\t\t\t\twill(returnValue(4));\n\t\t\t\t\n\t\t\t\tallowing(m_values).getKeys();\n\t\t\t\twill(returnValue(new ArrayList<Integer>() {\n\t\t\t\t\t{\n\t\t\t\t\t\tadd(0);\n\t\t\t\t\t\tadd(1);\n\t\t\t\t\t\tadd(2);\n\t\t\t\t\t\tadd(3);\n\t\t\t\t\t\tadd(4);\n\t\t\t\t\t}}));\n\t\t\t\t\n\t\t\t\t// Values.\n\t\t\t\tallowing(m_values).getValue(0);\n\t\t\t\twill(returnValue(1.1));\n\t\t\t\tallowing(m_values).getValue(1);\n\t\t\t\twill(returnValue(2));\n\t\t\t\tallowing(m_values).getValue(2);\n\t\t\t\twill(returnValue(3.14));\n\t\t\t\tallowing(m_values).getValue(3);\n\t\t\t\twill(returnValue(4));\n\t\t\t\tallowing(m_values).getValue(4);\n\t\t\t\twill(returnValue(5));\n\t\t\t}\n\t\t});\n\t}", "static List<BitData> getReplacementBitDataOfRanges(Collection<Range<Long>> ranges, Collection<Long> fullBits) {\n checkNotNull(ranges, \"ranges was null\");\n checkNotNull(fullBits, \"fullBits was null\");\n\n List<BitData> averages = new ArrayList<>();\n\n for (Range<Long> range : ranges) {\n Long average = round(fullBits.stream().filter(range::contains).collect(averagingLong(Long::longValue)));\n averages.add(new BitData(range, singletonList(average)));\n }\n return averages;\n }" ]
[ "0.5769587", "0.5494651", "0.4892958", "0.4813927", "0.4706906", "0.47065455", "0.46948096", "0.46798402", "0.46758664", "0.46456856", "0.46008635", "0.4559699", "0.4522309", "0.44778404", "0.44594458", "0.44309735", "0.4417244", "0.43684965", "0.43522346", "0.43432713", "0.43391308", "0.43300244", "0.43260288", "0.43029624", "0.42974815", "0.42774278", "0.42595828", "0.42540625", "0.4245393", "0.42410907", "0.42233738", "0.42200926", "0.4217455", "0.42087325", "0.4205172", "0.4203633", "0.41990492", "0.41947854", "0.41926682", "0.41823906", "0.41819507", "0.41717702", "0.41668436", "0.41554138", "0.41508472", "0.41485128", "0.41470027", "0.41417181", "0.4139876", "0.41323534", "0.41205767", "0.4118153", "0.41174808", "0.41141674", "0.41124344", "0.41062474", "0.4099902", "0.40936708", "0.4087319", "0.40857148", "0.4085472", "0.40783206", "0.4073437", "0.40722427", "0.4065688", "0.40563017", "0.40482405", "0.40473005", "0.40464962", "0.40425515", "0.40424615", "0.40415046", "0.4041159", "0.40363777", "0.40328106", "0.40309477", "0.40275624", "0.40262064", "0.4024165", "0.40228945", "0.40199086", "0.40117693", "0.4009322", "0.40056252", "0.39997178", "0.39992365", "0.39975217", "0.3994035", "0.39924526", "0.39920473", "0.39912754", "0.39861467", "0.39860272", "0.39784542", "0.39778143", "0.39755288", "0.39720345", "0.3970217", "0.39698595", "0.396688" ]
0.75549364
0
Reads tags at indices i. 1. For each index, read its tag.
private void collectTags (int[] i, int i0, int i1, long[] T) { for (int o=i0; o<i1; o++) // 1 T[o] = data[i[o]]; // 1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private long read(int i) {\n while (true) {\n long x = data[i];\n if (!isTag(x)) return value(x);\n reset(i);\n }\n }", "public Tag readTag() throws IOException {\n/* 78 */ char[] arrayOfChar = new char[1024];\n/* */ \n/* 80 */ int j = -1;\n/* */ \n/* 82 */ Integer integer1 = null;\n/* 83 */ Integer integer2 = null;\n/* */ \n/* 85 */ int i = read(2);\n/* 86 */ if (i < 0) {\n/* 87 */ throw new IOException(\"stop.\");\n/* */ }\n/* 89 */ if (i > arrayOfChar.length) {\n/* 90 */ throw new IOException(\"Invalid tag length.\");\n/* */ }\n/* 92 */ while (i > 0) {\n/* 93 */ j = read(2);\n/* 94 */ int k = read(2);\n/* 95 */ switch (j) {\n/* */ case 1:\n/* 97 */ integer1 = new Integer(read(4));\n/* 98 */ integer2 = new Integer(read(4));\n/* */ break;\n/* */ } \n/* */ \n/* 102 */ i -= 4 + k;\n/* */ } \n/* 104 */ return new Tag(i, j, integer1, integer2);\n/* */ }", "public void checkForTag(int i) {\n if (wordsOfInput[i].indexOf('#') == 0) {\n if ((!containsStartDate || !containsStartTime) && index > i) {\n index = i;\n tpsIndex = i;\n }\n String tag = wordsOfInput[i].substring(1);\n tags.add(tag);\n }\n }", "org.multibit.hd.core.protobuf.MBHDContactsProtos.Tag getTag(int index);", "org.multibit.hd.core.protobuf.MBHDContactsProtos.TagOrBuilder getTagOrBuilder(\n int index);", "public org.multibit.hd.core.protobuf.MBHDContactsProtos.Tag getTag(int index) {\n return tag_.get(index);\n }", "public org.multibit.hd.core.protobuf.MBHDContactsProtos.TagOrBuilder getTagOrBuilder(\n int index) {\n return tag_.get(index);\n }", "public void read(Integer i) {\n\n Object[][] obj = readItems(i);\n\n for (View v : views) {\n v.update(obj);\n }\n\n }", "private void loadOldTags() throws IOException {\n File fileAnnotation = new File(filePathAnnDestination);\n if (!fileAnnotation.exists()) {\n fileAnnotation.createNewFile();\n }\n FileReader fr = new FileReader(fileAnnotation);\n\n\n\n\n BufferedReader br = new BufferedReader(fr);\n String line;\n\n while ((line = br.readLine()) != null) {\n String[] annotations = line.split(\"[ \\t]\");\n String word = line.substring(line.lastIndexOf('\\t') + 1);\n String[] words = word.split(\" \");\n\n int start = Integer.parseInt(annotations[2]);\n if (words.length != 0) {\n for (int i = 0; i < words.length; i++) {\n int end = start + words[i].length();\n taggedItems.put(start + \"-\" + end, annotations[1]);\n System.out.println(\"Loading old tags: \" + start + \"-\" + end + \"\\t\" + annotations[1]);\n start = end + 1;\n }\n }\n taggedItems.put(annotations[2] + \"-\" + annotations[3], annotations[1]);\n\n noOfTagsAlready = Integer.parseInt(annotations[0].substring(1));\n if (noOfTagsAlreadyMax < noOfTagsAlready)\n noOfTagsAlreadyMax = noOfTagsAlready;\n }\n br.close();\n fr.close();\n System.out.println(\"Loaded tags\");\n }", "public abstract void readTagPayload(DataInput in) throws IOException;", "protected void skipRemainingTagsInCurrentIfd() throws IOException, ExifInvalidFormatException {\n int endOfTags = mIfdStartOffset + OFFSET_SIZE + TAG_SIZE * mNumOfTagInIfd;\n int offset = mTiffStream.getReadByteCount();\n if (offset > endOfTags) {\n return;\n }\n if (mNeedToParseOffsetsInCurrentIfd) {\n while (offset < endOfTags) {\n mTag = readTag();\n offset += TAG_SIZE;\n if (mTag == null) {\n continue;\n }\n checkOffsetOrImageTag(mTag);\n }\n } else {\n skipTo(endOfTags);\n }\n long ifdOffset = readUnsignedLong();\n // For ifd0, there is a link to ifd1 in the end of all tags\n if (mIfdType == IfdId.TYPE_IFD_0\n && (isIfdRequested(IfdId.TYPE_IFD_1) || isThumbnailRequested())) {\n if (ifdOffset > 0) {\n registerIfd(IfdId.TYPE_IFD_1, ifdOffset);\n }\n }\n }", "@Override\n\tpublic Tags read(int tagID) {\n\t\treturn entityMgr.find(Tags.class, tagID);\n\t}", "public int read(int i);", "public static void tagExtractor() throws IOException {\t\n\t\tDate inizio=new Date();\n\t\t//Inizializzo le Regex\n\t\tRegex regex= new Regex();\n\t\tRegex.CreateRegex();\n\t\t//Inizializzo i file di output\n\t\tResult.inizialize();\n\n\t\tfinal File sourceDocDir = new File(\"C:/Users/Pietro/Desktop/datasetTagMining\");\n\t\tif (sourceDocDir.canRead()) {\n\t\t\tif (sourceDocDir.isDirectory()) {\n\t\t\t\tString[] files = sourceDocDir.list();\n\t\t\t\t// an IO error could occur\n\t\t\t\tif (files != null) {\n\t\t\t\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\t\t\t\tSystem.out.println(files[i]);\n\t\t\t\t\t\tTagExtractor.Extractor(new File(sourceDocDir, files[i]),regex);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\n\n\n\t\t}\n\t\tDate fine=new Date();\n\t\tlong tempo=(fine.getTime() - inizio.getTime())/1000;\n\t\tResult.writeStats(\"Tempo Estrazione Tag: \"+\" \"+ tempo);\n\t\tResult.close();\n\n\n\n\n\t}", "public void testGetTagList() throws IOException {\n\n part.setBasedata(\"http://localhost/~luisdanielibanesgonzalez/datasets/MiniBase.nt\");\n part.reload();\n\n List<TrioMonoid> tags = part.getTagList();\n assertEquals(16,tags.size());\n for(TrioMonoid tm : tags){\n assertEquals(1,tm.getTokens().size());\n assertEquals(1,tm.getCoeffs().size());\n assertEquals(new Long(1),tm.getCoeffs().get(0));\n System.out.println(tm.toString());\n }\n\n \n }", "public int read(int[] i) throws IOException {\n\t\treturn read(i, 0, i.length);\n\t}", "public org.multibit.hd.core.protobuf.MBHDContactsProtos.Tag getTag(int index) {\n if (tagBuilder_ == null) {\n return tag_.get(index);\n } else {\n return tagBuilder_.getMessage(index);\n }\n }", "public Term get(int i) {\n\t\treturn this.elts[i];\n\t}", "@Override public BufferedImage getSlice(int i) {\n\t\tBufferedImage slice = null;\n\t\ttry {\n\t\t\tslice = ImageIO.read(tiffs[i]);\n\t\t} catch (IOException e) {\n\t\t\treturn null;\n\t\t}\n\t\treturn slice;\n\t}", "protected abstract int readInternal(int index);", "public org.multibit.hd.core.protobuf.MBHDContactsProtos.TagOrBuilder getTagOrBuilder(\n int index) {\n if (tagBuilder_ == null) {\n return tag_.get(index); } else {\n return tagBuilder_.getMessageOrBuilder(index);\n }\n }", "@DISPID(73)\r\n\t// = 0x49. The runtime will prefer the VTID if present\r\n\t@VTID(78)\r\n\tasci.activebatch.ITags tags();", "protected void initFile(String id) throws FormatException, IOException {\n super.initFile(id);\n in = new RandomAccessFile(id, \"r\");\n \n // initialize an array containing tag offsets, so we can\n // use an O(1) search instead of O(n) later.\n // Also determine whether we will be reading color or grayscale\n // images\n \n //in.seek(0);\n byte[] toRead = new byte[4];\n in.read(toRead);\n long order = batoi(toRead); // byte ordering\n little = toRead[2] != 0xff || toRead[3] != 0xff;\n \n toRead = new byte[4];\n Vector v = new Vector(); // a temp vector containing offsets.\n \n // Get first offset.\n in.seek(16);\n in.read(toRead);\n int nextOffset = batoi(toRead);\n int nextOffsetTemp;\n \n boolean first = true;\n while(nextOffset != 0) {\n in.seek(nextOffset + 4);\n in.read(toRead);\n // get next tag, but still need this one\n nextOffsetTemp = batoi(toRead);\n in.read(toRead);\n if ((new String(toRead)).equals(\"PICT\")) {\n boolean ok = true;\n if (first) {\n // ignore first image if it is called \"Original Image\" (pure white)\n first = false;\n in.skipBytes(47);\n byte[] layerNameBytes = new byte[127];\n in.read(layerNameBytes);\n String layerName = new String(layerNameBytes);\n if (layerName.startsWith(\"Original Image\")) ok = false;\n }\n if (ok) v.add(new Integer(nextOffset)); // add THIS tag offset\n }\n if (nextOffset == nextOffsetTemp) break;\n nextOffset = nextOffsetTemp;\n }\n \n in.seek(((Integer) v.firstElement()).intValue());\n \n // create and populate the array of offsets from the vector\n numBlocks = v.size();\n offsets = new int[numBlocks];\n for (int i = 0; i < numBlocks; i++) {\n offsets[i] = ((Integer) v.get(i)).intValue();\n }\n \n // populate the imageTypes that the file uses\n toRead = new byte[2];\n imageType = new int[numBlocks];\n for (int i = 0; i < numBlocks; i++) {\n in.seek(offsets[i]);\n in.skipBytes(40);\n in.read(toRead);\n imageType[i] = batoi(toRead);\n }\n \n initMetadata();\n }", "public void readFromNBT(NBTTagCompound par1NBTTagCompound);", "private static List<XMLTag> processTags(String line, int index, int length) {\n List<XMLTag> tempTags = new ArrayList<>();\n\n XMLTag xmlTag = new XMLTag();\n String value = line;\n\n xmlTag.setLine(index + 1);\n\n if (hasTag(value)) {\n // has a tag\n while (hasTag(value) || hasString(value)) {\n xmlTag = new XMLTag();\n xmlTag.setLine(index + 1);\n\n int startTag = value.indexOf(\"<\");\n int endTag = value.indexOf(\">\");\n boolean order = endTag > startTag;\n\n if (hasStringBeforeTag(value, startTag)) {\n xmlTag.setTagType(7);\n xmlTag.setEndIndex(startTag + length + 1);\n xmlTag.setStartIndex(0 + length + 1);\n xmlTag.setValue(value.substring(0, startTag));\n value = value.substring(startTag);\n\n } else if (startTag != -1) {\n // has <\n if (endTag != -1) {\n // has < and > ==> can be 1, 2, 3, 8\n if (order) {\n if (value.substring(startTag + 1, startTag + 2).equals(\"/\")) {\n // 2\n xmlTag.setTagType(2);\n String[] values = value.substring(startTag + 2, endTag).split(\" \");\n xmlTag.setqName(values[0]);\n } else if (value.substring(endTag - 1, endTag).equals(\"/\")) {\n // 3\n xmlTag.setTagType(3);\n String[] qName = value.substring(startTag + 1).split(\"/| \");// **needs to be //?\n xmlTag.setqName(qName[0]);\n\n } else if (value.substring(startTag + 1, startTag + 2).equals(\"?\")) {\n // 8\n xmlTag.setTagType(8);\n } else if (value.substring(startTag + 1, startTag + 2).equals(\"!\")) {\n // 7 <![CDATA[ ]]>\n xmlTag.setTagType(7);\n } else {\n // 1\n xmlTag.setTagType(1);\n String[] values = (value.substring(startTag + 1, endTag)).split(\" \");\n xmlTag.setqName(values[0]);\n }\n\n xmlTag.setEndIndex(endTag + length + 1);\n xmlTag.setStartIndex(startTag + length + 1);\n xmlTag.setValue(value.substring(startTag, endTag + 1));\n value = value.substring(endTag + 1);\n\n } else {\n\n if (endTag > 0 && value.substring(endTag - 1, endTag).equals(\"/\")) {\n xmlTag.setTagType(5);\n\n } else {\n if (value.substring(endTag - 1, endTag).equals(\"?\")) {\n xmlTag.setTagType(8);\n } else if (value.substring(endTag - 1, endTag).equals(\"]\")) {\n // 7 ]]>\n xmlTag.setTagType(7);\n } else {\n xmlTag.setTagType(6);\n }\n }\n xmlTag.setValue(value.substring(0, endTag + 1));\n xmlTag.setEndIndex(endTag + length + 1);\n xmlTag.setStartIndex(-1);\n value = value.substring(endTag + 1);\n }\n\n } else {\n // has < ==> can be 4 || can be 8\n if (value.substring(startTag + 1, startTag + 2).equals(\"?\")) {\n xmlTag.setTagType(8);\n } else if (value.substring(startTag + 1, startTag + 2).equals(\"!\")) {\n // 7 <![CDATA[\n xmlTag.setTagType(7);\n } else {\n xmlTag.setTagType(4);\n String[] values = (value.substring(startTag + 1)).split(\" \");\n xmlTag.setqName(values[0]);\n }\n xmlTag.setValue(value);\n xmlTag.setEndIndex(-1);\n xmlTag.setStartIndex(startTag + length + 1);\n value = \"\";\n }\n } else {\n // no <\n if (endTag != -1) {\n // has > ==> can be 5, 6\n\n if (endTag > 0 && value.substring(endTag - 1, endTag).equals(\"/\")) {\n xmlTag.setTagType(5);\n\n } else {\n if (endTag > 0 && value.substring(endTag - 1, endTag).equals(\"?\")) {\n xmlTag.setTagType(8);\n } else if (endTag > 0 && value.substring(endTag - 1, endTag).equals(\"]\")) {\n // 7 ]]>\n xmlTag.setTagType(7);\n } else {\n xmlTag.setTagType(6);\n }\n }\n xmlTag.setValue(value.substring(0, endTag + 1));\n xmlTag.setEndIndex(endTag + length + 1);\n xmlTag.setStartIndex(-1);\n value = value.substring(endTag + 1);\n\n } else {\n // no tags ==> 7\n xmlTag.setValue(value);\n xmlTag.setTagType(7);\n xmlTag.setEndIndex(-1);\n xmlTag.setStartIndex(-1);\n value = \"\";\n\n }\n }\n\n xmlTagsQueue.add(xmlTag);\n tempTags.add(xmlTag);\n }\n } else {\n // whole line has no tags\n xmlTag.setValue(value);\n xmlTag.setTagType(7);\n xmlTag.setEndIndex(-1);\n xmlTag.setStartIndex(-1);\n\n xmlTagsQueue.add(xmlTag);\n tempTags.add(xmlTag);\n\n return tempTags;\n }\n\n return tempTags;\n }", "public int index(int i) {\n\t\tif (i < 0 || i >= text.length) throw new IndexOutOfBoundsException();\n\t\treturn r2p[i];\n\t}", "private String next(int i) throws IOException {\r\n\t\tif(buffer!=null) {\r\n\t\t\tString s=buffer;\r\n\t\t\tbuffer=null;\r\n\t\t\treturn s;\r\n\t\t}\r\n\t\tif (i==0) {\r\n\t\t\treturn in.readLine();\r\n\t\t} else return in2.readLine();\r\n\t}", "public String getTag(int tagIndex) {\n int s = getTagStart(tagIndex);\n if (s >= 0 && s < tags.length()) {\n int e = getTagEnd(tagIndex);\n return substring(s, e);\n } else {\n return \"\";\n }\n }", "public void loadTagBuffer() {\r\n\r\n try {\r\n bPtr = 0;\r\n\r\n if (raFile != null) {\r\n fLength = raFile.length();\r\n }\r\n\r\n if (fLength < FileDicomBaseInner.BUFFER_SIZE) {\r\n\r\n if (tagBuffer == null) {\r\n tagBuffer = new byte[(int) fLength];\r\n } else if (fLength > tagBuffer.length) {\r\n tagBuffer = new byte[(int) fLength];\r\n }\r\n } else if (tagBuffer == null) {\r\n tagBuffer = new byte[FileDicomBaseInner.BUFFER_SIZE];\r\n } else if (tagBuffer.length < FileDicomBaseInner.BUFFER_SIZE) {\r\n tagBuffer = new byte[FileDicomBaseInner.BUFFER_SIZE];\r\n }\r\n\r\n raFile.readFully(tagBuffer);\r\n } catch (final IOException ioE) {}\r\n }", "public HTMLTag readTag ()\n\t\t\tthrows IOException, FileNotFoundException {\n\t\t\t\n\t\t// start building new tag\n\t\ttag = new HTMLTag ();\n\t\t\t\t\n\t\t// get any text preceding the tag itself\n\t\thtmlChar.setFieldType (HTMLContext.TEXT);\n\t\tgetNextField();\n\t\ttag.setPrecedingText (context.field.toString());\n\t\tif (htmlChar.character == '<') {\n\t\t\tgetNextCharacter();\n\t\t}\n\t\t\n\t\t// see if this is an ending tag\n\t\tif (htmlChar.character == '/') {\n\t\t\ttag.setEnding();\n\t\t\tgetNextCharacter();\n\t\t}\n\t\t\n\t\t// get the name of the tag\n\t\thtmlChar.setFieldType (HTMLContext.TAG_NAME);\n\t\tgetNextField();\n\t\ttag.setName (context.field.toString());\n\t\t\n\t\t// check to see if the tag is a comment\n\t\tif (tag.getName().equals (\"!--\")) {\n attribute = new HTMLAttribute (\"!==\");\n htmlChar.setFieldType (HTMLContext.COMMENT);\n getNextField();\n for (int i = 0; i < 2; i++) {\n if (context.field.length() > 0\n && context.field.charAt (context.field.length() - 1) == '-') {\n context.field.setLength (context.field.length() - 1);\n }\n }\n attribute.setValue (context.field.toString());\n\t\t\ttag.setAttribute (attribute);\n\t\t}\n else {\n\t\t\n // Collect and store all the attributes\n while (! htmlChar.endsTag) {\n htmlChar.setFieldType (HTMLContext.ATTRIBUTE_NAME);\n getNextCharacter();\n getNextField();\n if (context.field.length() > 0) {\n attribute = new HTMLAttribute (context.field.toString());\n if (htmlChar.character == '=') {\n getNextCharacter();\n htmlChar.setFieldType (HTMLContext.ATTRIBUTE_VALUE);\n getNextField();\n attribute.setValue (context.field.toString());\n }\n tag.setAttribute (attribute);\n }\n }\n }\n\n // evaluate block properties of tag\n if ((! tag.isEnding())\n && (tag.isBlockTag())) {\n context.lastOpenBlock = tag.getName();\n }\n else\n if (tag.isEnding()\n && tag.getName().equals (context.lastOpenBlock)) {\n context.lastOpenBlock = \"\";\n }\n \n // evaluate list properties of tag\n int listTagType = 0;\n if (tag.getName().equals (\"ol\")\n || tag.getName().equals (\"ul\")\n || tag.getName().equals (\"dl\")) {\n listTagType = 1;\n }\n else\n if (tag.getName().equals (\"li\")\n || tag.getName().equals (\"dt\")\n || tag.getName().equals (\"dd\")) {\n listTagType = 2;\n tag.setListItemStart (true);\n }\n \n tag.setListLevel (context.listLevel);\n tag.setListItemTag (context.listItemTag);\n if (context.listItemTag.length() > 0) {\n if (listTagType > 0) {\n context.listItemTag = \"\";\n tag.setListItemEnd (true);\n }\n }\n \n if (listTagType == 1) {\n context.defTermActive = false;\n if (tag.isEnding()) {\n if (context.listLevel > 0) {\n context.listLevel--;\n }\n }\n else {\n context.listLevel++;\n }\n }\n \n tag.setDefTermActive (context.defTermActive);\n \n if (listTagType == 2) {\n context.listItemTag = tag.getName();\n if (tag.getName().equals(\"dt\")) {\n context.defTermActive = true;\n }\n }\n \n // evaluate heading properties of tag\n if (tag.isHeadingTag()) {\n context.headingLevel = tag.getHeadingLevel();\n } else {\n tag.setHeadingLevel (context.headingLevel);\n }\n \n // Check for preformatting\n if (tag.getName().equals (\"pre\")) {\n context.preformatted = (! tag.isEnding());\n }\n \n // return results\n\t\tif (htmlChar.character == '>') {\t\t\t\n getNextCharacter();\n return tag;\n }\n else \n if (tag.getPrecedingText().length() > 0) {\n return tag;\n\t\t} \n else {\n\t\t\treturn null;\n\t\t}\n\t}", "public Bacteria getAtIndex(int i) {\n\t\treturn this.inds.get(i);\n\t}", "@java.lang.Override\n public io.envoyproxy.envoy.type.tracing.v3.CustomTag getCustomTags(int index) {\n return customTags_.get(index);\n }", "public void read( int readIndex, byte[] array, int firstIndex,\n\t\t\tint count );", "@java.lang.Override\n public io.envoyproxy.envoy.type.tracing.v3.CustomTagOrBuilder getCustomTagsOrBuilder(\n int index) {\n return customTags_.get(index);\n }", "public int getTag(int position) {\r\n return dataTag.get(position);\r\n }", "Map<String, String> Read_File(XmlPullParser xmlPullParser, List<Tags_To_Read> tags, String account_Name) throws NullPointerException, XML_Reader_Exception;", "private void readInterfaces() throws IOException, ClassFormatException {\n final int interfaces_count = dataInputStream.readUnsignedShort();\n interfaces = new int[interfaces_count];\n for (int i = 0; i < interfaces_count; i++) {\n interfaces[i] = dataInputStream.readUnsignedShort();\n }\n }", "public io.envoyproxy.envoy.type.tracing.v3.CustomTag getCustomTags(int index) {\n if (customTagsBuilder_ == null) {\n return customTags_.get(index);\n } else {\n return customTagsBuilder_.getMessage(index);\n }\n }", "public Integer get(int i){\n\t\treturn body[i];\n\t}", "protected int next() throws IOException, ExifInvalidFormatException {\n if (!mContainExifData) {\n return EVENT_END;\n }\n int offset = mTiffStream.getReadByteCount();\n int endOfTags = mIfdStartOffset + OFFSET_SIZE + TAG_SIZE * mNumOfTagInIfd;\n if (offset < endOfTags) {\n mTag = readTag();\n if (mTag == null) {\n return next();\n }\n if (mNeedToParseOffsetsInCurrentIfd) {\n checkOffsetOrImageTag(mTag);\n }\n return EVENT_NEW_TAG;\n } else if (offset == endOfTags) {\n // There is a link to ifd1 at the end of ifd0\n if (mIfdType == IfdId.TYPE_IFD_0) {\n long ifdOffset = readUnsignedLong();\n if (isIfdRequested(IfdId.TYPE_IFD_1) || isThumbnailRequested()) {\n if (ifdOffset != 0) {\n registerIfd(IfdId.TYPE_IFD_1, ifdOffset);\n }\n }\n } else {\n int offsetSize = 4;\n // Some camera models use invalid length of the offset\n if (mCorrespondingEvent.size() > 0) {\n offsetSize = mCorrespondingEvent.firstEntry().getKey() -\n mTiffStream.getReadByteCount();\n }\n if (offsetSize < 4) {\n Timber.w(\"Invalid size of link to next IFD: %s\", offsetSize);\n } else {\n long ifdOffset = readUnsignedLong();\n if (ifdOffset != 0) {\n Timber.w(\"Invalid link to next IFD: %s\", ifdOffset);\n }\n }\n }\n }\n while (mCorrespondingEvent.size() != 0) {\n Entry<Integer, Object> entry = mCorrespondingEvent.pollFirstEntry();\n Object event = entry.getValue();\n try {\n skipTo(entry.getKey());\n } catch (IOException e) {\n Timber.w(\"Failed to skip to data at: \" + entry.getKey() +\n \" for \" + event.getClass().getName() + \", the file may be broken.\");\n continue;\n }\n if (event instanceof IfdEvent) {\n mIfdType = ((IfdEvent) event).ifd;\n mNumOfTagInIfd = mTiffStream.readUnsignedShort();\n mIfdStartOffset = entry.getKey();\n\n if (mNumOfTagInIfd * TAG_SIZE + mIfdStartOffset + OFFSET_SIZE > mApp1End) {\n Timber.w(\"Invalid size of IFD %s\", mIfdType);\n return EVENT_END;\n }\n\n mNeedToParseOffsetsInCurrentIfd = needToParseOffsetsInCurrentIfd();\n if (((IfdEvent) event).isRequested) {\n return EVENT_START_OF_IFD;\n } else {\n skipRemainingTagsInCurrentIfd();\n }\n } else if (event instanceof ImageEvent) {\n mImageEvent = (ImageEvent) event;\n return mImageEvent.type;\n } else {\n ExifTagEvent tagEvent = (ExifTagEvent) event;\n mTag = tagEvent.tag;\n if (mTag.getDataType() != ExifTag.TYPE_UNDEFINED) {\n readFullTagValue(mTag);\n checkOffsetOrImageTag(mTag);\n }\n if (tagEvent.isRequested) {\n return EVENT_VALUE_OF_REGISTERED_TAG;\n }\n }\n }\n return EVENT_END;\n }", "@DISPID(134)\r\n\t// = 0x86. The runtime will prefer the VTID if present\r\n\t@VTID(129)\r\n\tasci.activebatch.ITags tags();", "public long get(int i) {\n return read(i);\n }", "public void testTag() throws Exception {\n IProject project = createProject(\"testTag\", new String[] { \"changed.txt\", \"deleted.txt\", \"folder1/\", \"folder1/a.txt\", \"folder1/b.txt\", \"folder1/subfolder1/c.txt\" });\n \n tag(asResourceMapping(new IResource[] { project }, IResource.DEPTH_ONE), new CVSTag(\"v1\", CVSTag.VERSION));\n tag(asResourceMapping(new IResource[] { project.getFolder(\"folder1\") }, IResource.DEPTH_ONE), new CVSTag(\"v2\", CVSTag.VERSION));\n tag(asResourceMapping(new IResource[] { project.getFile(\"folder1/subfolder1/c.txt\") }, IResource.DEPTH_ZERO), new CVSTag(\"v3\", CVSTag.VERSION));\n tag(asResourceMapping(new IResource[] { project}, IResource.DEPTH_INFINITE), new CVSTag(\"v4\", CVSTag.VERSION));\n }", "private void readIndex() throws IOException {\n\t\t\tif (this.keys != null)\n\t\t\t\treturn;\n\t\t\tkeys = new HashMap<K, Long>(1024);\n\t\t\ttry {\n\t\t\t\twhile (index.hasNext()) {\n\t\t\t\t\tPair<K, Long> pair;// = new Pair<K, Long>(index.getSchema());\n\t\t\t\t\tpair = index.next();\n\t\t\t\t\tkeys.put(pair.key(), pair.value());\n\t\t\t\t\tif (firstKey == null)\n\t\t\t\t\t\tfirstKey = pair.key();\n\t\t\t\t\tfinalKey = pair.key();\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\n\t\t\t}finally {\n\t\t\t\tindexClosed = true;\n\t\t\t\tindex.close();\n\t\t\t}\n\t\t}", "int getTagNo();", "private void incTag() {\n long id = tagId(tag[th()]); // 1\n tag[th()] = newTag(id+1); // 2\n }", "public Object get(int i) {\n return elementAt(i);\n }", "public int[] getTags() {\n int[] tags = new int[fieldIndex.size()];\n Iterator iter = fieldIndex.keySet().iterator();\n int i = 0;\n\n while (iter.hasNext()) {\n tags[i++] = (Integer) iter.next();\n }\n\n return tags;\n }", "public Token tokenAt(int i) {\n\treturn tokens[i];\n}", "@Override\n public E get(int i) throws IndexOutOfBoundsException {\n validIndex(i);\n return data[i];\n }", "public io.envoyproxy.envoy.type.tracing.v3.CustomTagOrBuilder getCustomTagsOrBuilder(\n int index) {\n if (customTagsBuilder_ == null) {\n return customTags_.get(index); } else {\n return customTagsBuilder_.getMessageOrBuilder(index);\n }\n }", "boolean onTag(ByteBuffer buffer, int tagIndex, int tagLen, int valueLen);", "private void initMetadata() throws IOException {\n \n // start by reading the file header\n in.seek(0);\n byte[] toRead = new byte[4];\n in.read(toRead);\n long order = batoi(toRead); // byte ordering\n little = toRead[2] != 0xff || toRead[3] != 0xff;\n metadata.put(\"Byte Order\", new Boolean(little));\n \n in.skipBytes(4);\n in.read(toRead);\n long version = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Version\", new Long(version));\n \n byte[] er = new byte[2];\n in.read(er);\n short count = DataTools.bytesToShort(er, little);\n metadata.put(\"Count\", new Short(count));\n \n in.skipBytes(2);\n \n in.read(toRead);\n long offset = DataTools.bytesToLong(toRead, little);\n \n // skip to first tag\n in.seek(offset);\n \n // read in each tag and its data\n \n for (int i=0; i<count; i++) {\n in.read(er);\n short tag = DataTools.bytesToShort(er, little);\n in.skipBytes(2);\n \n in.read(toRead);\n offset = DataTools.bytesToLong(toRead, little);\n \n in.read(toRead);\n long fmt = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Format\", new Long(fmt));\n \n in.read(toRead);\n long numBytes = DataTools.bytesToLong(toRead, little);\n metadata.put(\"NumBytes\", new Long(numBytes));\n \n if (tag == 67 || tag == 68) {\n byte[] b = new byte[1];\n in.read(b);\n boolean isOpenlab2;\n if (b[0] == '0') isOpenlab2 = false;\n else isOpenlab2 = true;\n metadata.put(\"isOpenlab2\", new Boolean(isOpenlab2));\n \n in.skipBytes(2);\n in.read(er);\n short layerId = DataTools.bytesToShort(er, little);\n metadata.put(\"LayerID\", new Short(layerId));\n \n in.read(er);\n short layerType = DataTools.bytesToShort(er, little);\n metadata.put(\"LayerType\", new Short(layerType));\n \n in.read(er);\n short bitDepth = DataTools.bytesToShort(er, little);\n metadata.put(\"BitDepth\", new Short(bitDepth));\n \n in.read(er);\n short opacity = DataTools.bytesToShort(er, little);\n metadata.put(\"Opacity\", new Short(opacity));\n \n // not sure how many bytes to skip here\n in.skipBytes(10);\n \n in.read(toRead);\n long type = DataTools.bytesToLong(toRead, little);\n metadata.put(\"ImageType\", new Long(type));\n \n // not sure how many bytes to skip\n in.skipBytes(10);\n \n in.read(toRead);\n long timestamp = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Timestamp\", new Long(timestamp));\n \n in.skipBytes(2);\n \n if (isOpenlab2 == true) {\n byte[] layerName = new byte[127];\n in.read(layerName);\n metadata.put(\"LayerName\", new String(layerName));\n \n in.read(toRead);\n long timestampMS = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Timestamp-MS\", new Long(timestampMS));\n \n in.skipBytes(1);\n byte[] notes = new byte[118];\n in.read(notes);\n metadata.put(\"Notes\", new String(notes));\n }\n else in.skipBytes(123);\n }\n else if (tag == 69) {\n in.read(toRead);\n long platform = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Platform\", new Long(platform));\n \n in.read(er);\n short units = DataTools.bytesToShort(er, little);\n metadata.put(\"Units\", new Short(units));\n \n in.read(er);\n short imageId = DataTools.bytesToShort(er, little);\n metadata.put(\"ID\", new Short(imageId));\n in.skipBytes(1);\n \n byte[] toRead2 = new byte[8];\n double xOrigin = DataTools.readDouble(in, little);\n metadata.put(\"XOrigin\", new Double(xOrigin));\n double yOrigin = DataTools.readDouble(in, little);\n metadata.put(\"YOrigin\", new Double(yOrigin));\n double xScale = DataTools.readDouble(in, little);\n metadata.put(\"XScale\", new Double(xScale));\n double yScale = DataTools.readDouble(in, little);\n metadata.put(\"YScale\", new Double(yScale));\n in.skipBytes(1);\n \n byte[] other = new byte[31];\n in.read(other);\n metadata.put(\"Other\", new String(other));\n }\n \n // Initialize OME metadata\n \n if (ome != null) {\n OMETools.setBigEndian(ome, !little);\n if (metadata.get(\"BitDepth\") != null) {\n int bitDepth = ((Integer) metadata.get(\"BitDepth\")).intValue();\n String type;\n \n if (bitDepth <= 8) type = \"int8\";\n else if (bitDepth <= 16) type = \"int16\";\n else type = \"int32\";\n \n OMETools.setPixelType(ome, type);\n }\n if (metadata.get(\"Timestamp\") != null) {\n OMETools.setCreationDate(ome, (String) metadata.get(\"Timestamp\"));\n }\n \n if (metadata.get(\"XOrigin\") != null) {\n Double xOrigin = (Double) metadata.get(\"XOrigin\");\n OMETools.setStageX(ome, xOrigin.floatValue());\n }\n \n if (metadata.get(\"YOrigin\") != null) {\n Double yOrigin = (Double) metadata.get(\"YOrigin\");\n OMETools.setStageY(ome, yOrigin.floatValue());\n }\n \n if (metadata.get(\"XScale\") != null) {\n Double xScale = (Double) metadata.get(\"XScale\");\n OMETools.setPixelSizeX(ome, xScale.floatValue());\n }\n \n if (metadata.get(\"YScale\") != null) {\n Double yScale = (Double) metadata.get(\"YScale\");\n OMETools.setPixelSizeY(ome, yScale.floatValue());\n }\n }\n in.seek(offset);\n }\n }", "public short elementIdAt(int i)\n\t{\n\t\treturn m_elems[i];\n\t}", "@Override\n public void readFromNBT(NBTTagCompound nbt)\n {\n super.readFromNBT(nbt);\n pokedexNb = nbt.getInteger(\"pokedexNb\");\n time = nbt.getInteger(\"time\");\n NBTBase temp = nbt.getTag(\"Inventory\");\n if (temp instanceof NBTTagList)\n {\n NBTTagList tagList = (NBTTagList) temp;\n for (int i = 0; i < tagList.tagCount(); i++)\n {\n NBTTagCompound tag = tagList.getCompoundTagAt(i);\n byte slot = tag.getByte(\"Slot\");\n\n if (slot >= 0 && slot < inventory.length)\n {\n inventory[slot] = ItemStack.loadItemStackFromNBT(tag);\n }\n }\n }\n }", "protected String getNextTag() throws IOException {\n int readChar = -1;\n StringBuffer buff = new StringBuffer();\n String retVal = null;\n boolean foundTag = false;\n\n while ((readChar = this.mReader.read()) != -1) {\n if (readChar == TAG_START) {\n if (this.mParseState == ParseState.TAG_READ) {\n if( buff.indexOf(\"<![CDATA[\") == 0 )\n this.mParseState = ParseState.CDATA;\n else if( buff.indexOf(\"<!--\") == 0 )\n this.mParseState = ParseState.COMMENT;\n } else if (this.mParseState == ParseState.SCAN) {\n this.mParseState = ParseState.TAG_READ;\n }\n\n buff.append((char) readChar);\n } else if (readChar == TAG_END) {\n buff.append((char) readChar);\n\n if (this.mParseState == ParseState.CDATA) {\n if (buff.lastIndexOf(\"]]>\") != -1) {\n foundTag = true;\n this.mParseState = ParseState.SCAN;\n break;\n }\n } else if( this.mParseState == ParseState.COMMENT) {\n if( buff.lastIndexOf(\"-->\") != -1) {\n foundTag = true;\n this.mParseState = ParseState.SCAN;\n break;\n }\n } else {\n foundTag = true;\n this.mParseState = ParseState.SCAN;\n break;\n }\n } else if (this.mParseState != ParseState.SCAN) {\n buff.append((char) readChar);\n } else if (this.mState == State.WRITE) {\n this.mCurrentOutput.append((char) readChar);\n }\n }\n\n if (foundTag) {\n retVal = buff.toString();\n }\n\n return retVal;\n }", "int readerIndex();", "public void init(IndexReader indexReader, String params) throws IOException\n {\n // Record the input\n this.params = params;\n \n // Break the string of params into a list of fields.\n StringTokenizer t = new StringTokenizer(params, \" \\t,;|\");\n String[] fields = new String[t.countTokens()];\n for (int i = 0; i < fields.length; i++)\n fields[i] = t.nextToken();\n \n // And fetch the doc/tag data for those fields.\n data = FRBRData.getCachedTags(indexReader, fields);\n }", "public String tag(int k) {\n return mTags.get(k);\n }", "@Override\r\n\tprotected void jumpToItem(int itemIndex) throws Exception {\r\n\t\tfor (int i = 0; i < itemIndex; i++) {\r\n\t\t\treadToStartFragment();\r\n\t\t\treadToEndFragment();\r\n\t\t}\r\n\t}", "public interface TagDataReader {\r\n WritableMap getTagMap();\r\n}", "private void readAttributes() throws IOException, ClassFormatException {\n final int attributes_count = dataInputStream.readUnsignedShort();\n attributes = new Attribute[attributes_count];\n for (int i = 0; i < attributes_count; i++) {\n attributes[i] = Attribute.readAttribute(dataInputStream, constant_pool);\n }\n }", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic Tags read(String tagName) {\n\t\tString query = \"from Tags where name = '\"+tagName+\"'\";\n\t\tList<Tags> tags =(List<Tags>) entityMgr.createQuery(query)\n\t\t\t\t\t\t\t\t\t\t\t\t.getResultList();\n\t\tif(tags == null) return null;\n\t\treturn tags.get(0);\n\t}", "private void fileToPoSTags(String filePath,int version){\n Log.log(\"Reading TreeBank file <\" + filePath +\">\");\n\n FileReader fr = null;\n BufferedReader br = null;\n\n try{\n fr = new FileReader(filePath);\n br = new BufferedReader(fr);\n\n String currentLine;\n String[] columns;\n\n Tag tag1 = null;\n Tag tag2;\n String word;\n\n Integer numRow;\n while((currentLine = br.readLine()) != null){\n columns = currentLine.split(\"\\t\");\n numRow = getIntegerString(columns[0]);\n if(numRow != null && numRow >= 1){\n if(numRow == 1) {\n tag1 = Tag.valueOf(\"START\");\n saveTag(tag1);\n }\n try{\n tag2 = Tag.valueOf(columns[3]);\n saveTag(tag2);\n word = columns[1];\n switch (version){\n case 1:\n savePoSTag(new PoSTag(word.toLowerCase(),tag2));\n break;\n case 2:\n if(!tag2.equals(Tag.PROPN))\n savePoSTag(new PoSTag(word.toLowerCase(),tag2));\n else if(Character.isUpperCase(word.charAt(0)))\n savePoSTag(new PoSTag(word,tag2));\n break;\n case 3:\n\n if(tag2.equals(Tag.PROPN))\n savePoSTag(new PoSTag(word,tag2));\n else{\n if(Character.isUpperCase(word.charAt(0))){\n savePoSTag(new PoSTag(word,tag2));\n savePoSTag(new PoSTag(word.toLowerCase(),tag2));\n }else{\n savePoSTag(new PoSTag(word,tag2));\n savePoSTag(new PoSTag(\n word.substring(0,1).toUpperCase()\n +word.substring(1),tag2));\n }\n\n }\n\n break;\n case 4:\n\n if(!tag2.equals(Tag.PROPN))\n savePoSTag(new PoSTag(word,tag2));\n savePoSTag(new PoSTag(word,tag2));\n break;\n case 5:\n\n if(!tag2.equals(Tag.PROPN))\n savePoSTag(new PoSTag(word.toLowerCase(),tag2));\n savePoSTag(new PoSTag(word,tag2));\n break;\n\n }\n saveBigram(new BiGram(tag1,tag2));\n tag1 = tag2;\n }catch (IllegalArgumentException e){\n e.printStackTrace();\n }\n }\n }\n\n }catch (IOException e){\n e.printStackTrace();\n }finally {\n UtilitiesIO.closeFile(fr,br);\n }\n }", "public void readIn(ArrayList<String> lines, int idx){\n\t\tfor (int i=idx+1;i<lines.size();i++){\n\t\t\tString[] parts = lines.get(i).split(\" \");\n\t\t\tif (parts[0].charAt(0) != '-'){\n\t\t\t\ti = lines.size();\n\t\t\t}\n\t\t\tswitch (parts[0]){\n\t\t\t\tcase \"-TileID:\":\n\t\t\t\t\tthis.setTile(Game.getInstance().getTileContained(Integer.parseInt(parts[1])));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-Chance:\":\n\t\t\t\t\tthis.chance = Integer.parseInt(parts[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: break;\n\t\t\t}\n\t\t}\n\t}", "public List<ITag> getTags ();", "public interface ITaggedDataFactory\n{\n\t/** \n\t Get data for a specific tag value.\n\t \n\t @param tag The tag ID to find.\n\t @param data The data to search.\n\t @param offset The offset to begin extracting data from.\n\t @param count The number of bytes to extract.\n\t @return The located <see cref=\"ITaggedData\">value found</see>, or null if not found.\n\t*/\n\tITaggedData Create(short tag, byte[] data, int offset, int count);\n}", "public int getTagStart (int tagIndex) {\n int tagCount = -1;\n int i = 0;\n int start = 0;\n int end = 0;\n while (i < tags.length() && tagCount < tagIndex) {\n start = indexOfNextWordStart (tags, i, slashToSeparate);\n end = indexOfNextSeparator (tags, start, false, true, slashToSeparate);\n tagCount++;\n if (tagCount < tagIndex) {\n i = end + 1;\n }\n }\n if (tagCount < tagIndex) {\n return tags.length();\n } else {\n return start;\n }\n }", "private void reset(int i) {\n long x = data[i];\n if (isTag(x))\n cas(i, x, save[threadId(x)]);\n }", "private void posRead() throws IOException {\n\t\tFile file = new File(fullFileName());\n\t\tString line;\n\t\tBufferedReader reader = new BufferedReader(new FileReader(file));\n\t\tStringBuffer fileText = new StringBuffer();\n\t\twhile((line = reader.readLine()) != null) {\n\t\t\tStringTokenizer st = new StringTokenizer(line);\n\t\t\twhile (st.hasMoreTokens()) {\n \t\tString tokenAndPos = st.nextToken();\n \t\tint slashIndex = tokenAndPos.lastIndexOf('/');\n \t\tif (slashIndex <= 0) throw new IOException(\"invalid data\");\n \t\tString token = tokenAndPos.substring(0,slashIndex);\n \t\tString pos = tokenAndPos.substring(1+slashIndex).intern();\n \t\tint start = this.length();\n \t\tthis.append(token);\n \t\tif (st.hasMoreTokens())\n \t\t\tthis.append(\" \");\n \t\telse\n \t\t\tthis.append(\" \\n\");\n \t\tint end = this.length();\n \t\tSpan span = new Span(start,end);\n \t\tthis.annotate(\"token\", span, new FeatureSet());\n \t\tthis.annotate(\"constit\", span, new FeatureSet(\"cat\", pos));\n \t}\n\t\t}\n\t}", "protected void readFullTagValue(ExifTag tag) throws IOException {\n short type = tag.getDataType();\n if (type == ExifTag.TYPE_ASCII || type == ExifTag.TYPE_UNDEFINED ||\n type == ExifTag.TYPE_UNSIGNED_BYTE) {\n int size = tag.getComponentCount();\n if (mCorrespondingEvent.size() > 0) {\n if (mCorrespondingEvent.firstEntry().getKey() < mTiffStream.getReadByteCount()\n + size) {\n Object event = mCorrespondingEvent.firstEntry().getValue();\n if (event instanceof ImageEvent) {\n // Tag value overlaps thumbnail, ignore thumbnail.\n Timber.w(\"Thumbnail overlaps value for tag: \\n\" + tag.toString());\n Entry<Integer, Object> entry = mCorrespondingEvent.pollFirstEntry();\n Timber.w(\"Invalid thumbnail offset: \" + entry.getKey());\n } else {\n // Tag value overlaps another tag, shorten count\n if (event instanceof IfdEvent) {\n Timber.w(\"Ifd \" + ((IfdEvent) event).ifd\n + \" overlaps value for tag: \\n\" + tag.toString());\n } else if (event instanceof ExifTagEvent) {\n Timber.w(\"Tag value for tag: \\n\"\n + ((ExifTagEvent) event).tag.toString()\n + \" overlaps value for tag: \\n\" + tag.toString());\n }\n size = mCorrespondingEvent.firstEntry().getKey()\n - mTiffStream.getReadByteCount();\n Timber.w(\"Invalid size of tag: \\n\" + tag.toString()\n + \" setting count to: \" + size);\n tag.forceSetComponentCount(size);\n }\n }\n }\n }\n switch (tag.getDataType()) {\n case ExifTag.TYPE_UNSIGNED_BYTE:\n case ExifTag.TYPE_UNDEFINED: {\n byte buf[] = new byte[tag.getComponentCount()];\n read(buf);\n tag.setValue(buf);\n }\n break;\n case ExifTag.TYPE_ASCII:\n tag.setValue(readString(tag.getComponentCount()));\n break;\n case ExifTag.TYPE_UNSIGNED_LONG: {\n long value[] = new long[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readUnsignedLong();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_UNSIGNED_RATIONAL: {\n Rational value[] = new Rational[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readUnsignedRational();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_UNSIGNED_SHORT: {\n int value[] = new int[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readUnsignedShort();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_LONG: {\n int value[] = new int[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readLong();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_RATIONAL: {\n Rational value[] = new Rational[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readRational();\n }\n tag.setValue(value);\n }\n break;\n }\n if (LOGV) {\n Timber.v(\"\\n\" + tag.toString());\n }\n }", "private synchronized void tags(ViewHolder holder, int position){\n holder.tagsLL.removeAllViews();\n\n int count = 0;\n while (count < 3) {\n String tagName = \"\";\n switch (count) {\n case 0:\n tagName = tag1ArrList.get(position);\n break;\n case 1:\n tagName = tag2ArrList.get(position);\n break;\n case 2:\n tagName = tag3ArrList.get(position);\n break;\n }\n if (! tagName.equals(\"\")) {\n final TextView tagTV = Tags.newTagView(context, userUIPreferences.textSize, userUIPreferences.tagsTextColor, userUIPreferences.tagsTVParams, userUIPreferences.tagsBackgroundDrawable,\n userUIPreferences.fontStyle, userUIPreferences.userSelectedFontTF);\n tagTV.setText(tagName.replaceAll(\"_\", \" \"));\n holder.tagsLL.addView(tagTV);\n }\n else{\n break;\n }\n count ++;\n }\n }", "@Test\n public void test2() throws IOException {\n FileStore files = new FileStoreMemory();\n files.put(\"test.txt\", TestData.FILE_CONTENT.getBytes());\n BlockStore blocks = new BlockStoreMemory();\n\n CapturePrintStream out = CapturePrintStream.create();\n\n List<String> args = Arrays.asList(\"test.txt\");\n new StoreTagPutMain(blocks, files, out, args).run();\n\n out.flush();\n\n List<Tag> tags = tags(out);\n assertEquals(1, tags.size());\n assertEquals(\"6\", tags.get(0).get(\"size\"));\n assertEquals(\"sha-256:5891b5b522d5df086d0ff0b110fbd9d2\"\n + \"1bb4fc7163af34d08286a2e846f6be03\", tags.get(0).get(\"hash\"));\n }", "private String readFile(String fileName) {\n//Initialize\nString line = null;\nString allContent = \"\";\nBufferedReader fileReader = null;\n \nwhile (true) {\ntry {\nfileReader = new BufferedReader (new FileReader (fileName));\n \n//Replace tags with indicated content\nwhile((line = fileReader.readLine()) != null) {\nline = replaceTags(line);\nallContent += line;\n}\n} catch (Exception e) {\nSystem.err.println(\"Read error: \"+e);\nbreak;\n//Close BufferedReader if initialized\n}//end catch\nbreak;\n}//end while loop\n \nfileReadSuccessful = true;\nreturn allContent;\n}", "public String[] getElementAnnotation(int index, String attr);", "public br.pucrio.dslmetrics.core.mtbl.parsers.mtblfile.MetricDescriptionType getMetricDescriptionArray(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n br.pucrio.dslmetrics.core.mtbl.parsers.mtblfile.MetricDescriptionType target = null;\n target = (br.pucrio.dslmetrics.core.mtbl.parsers.mtblfile.MetricDescriptionType)get_store().find_element_user(METRICDESCRIPTION$0, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n return target;\n }\n }", "public IteratorForXML(String i, String tag)\r\n/* 25: */ {\r\n/* 26:30 */ this(i, tag, tag);\r\n/* 27: */ }", "public int getTagEnd (int tagIndex) {\n int tagCount = -1;\n int i = 0;\n int start = 0;\n int end = 0;\n while (i < tags.length() && tagCount < tagIndex) {\n start = indexOfNextWordStart (tags, i, slashToSeparate);\n end = indexOfNextSeparator (tags, start, false, true, slashToSeparate);\n tagCount++;\n if (tagCount < tagIndex) {\n i = end + 1;\n }\n }\n return end;\n }", "java.lang.String getTag();", "java.lang.String getTag();", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic Collection<Tags> readAll(String username) {\n\t\tString query = \"from Tags where username='\"+username+\"' OR username='default'\";\n\t\tCollection<Tags> tags = (Collection<Tags>)entityMgr.createQuery(query).getResultList();\n\t\treturn tags;\n\t}", "public int getTag()\n {\n return this.m_descriptor[0] & 0xFF;\n }", "public com.walgreens.rxit.ch.cda.StrucDocTbody getTbodyArray(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocTbody target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocTbody)get_store().find_element_user(TBODY$10, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n return target;\n }\n }", "public void readFile(String fileName)\r\n {\n String key = new String();\r\n String value = new String();\r\n\r\n boolean readInfo = false;\r\n String out =\"\";\r\n String infoTag = \"\";\r\n String infoTagContent = \"\";\r\n\r\n try{\r\n System.out.println(\"Readig file \"+fileName+\" ...\");\r\n BufferedReader filereader = new BufferedReader(new FileReader(fileName));\r\n\r\n String line = new String();\r\n line = filereader.readLine();\r\n\r\n while(line != null){\r\n infoTag = \"\";\r\n infoTagContent = \"\";\r\n\r\n if((line.indexOf(\"=\") != -1) && (line.indexOf(\"#\") == -1))\r\n {\r\n key = line.substring(0, line.indexOf(\"=\"));\r\n value = line.substring(line.indexOf(\"=\")+1);\r\n\r\n key = key.trim();\r\n value = value.trim();\r\n\r\n if(key.equals(\"PREFIX\")){\r\n this.tagPrefix = value;\r\n } else {\r\n value = tagPrefix+\".\"+value;\r\n tagHash.put(key, value);\r\n }\r\n\r\n readInfo = false;\r\n infoHash.put(key, out);\r\n out = \"\";\r\n }\r\n\r\n\r\n if((line.indexOf(\"#\") == 0) && (line.indexOf(\"@\") != -1) && (line.indexOf(\"=\") != -1))\r\n {\r\n readInfo = true;\r\n infoTag = line.substring(line.indexOf(\"@\"), line.indexOf(\"=\"));\r\n infoTag.trim();\r\n infoTagContent = line.substring(line.indexOf(\"=\")+1);\r\n if(infoTagContent.trim().length() > 0) infoTagContent = infoTagContent+NL;\r\n out = out+infoTag+\": \"+NL+infoTagContent;\r\n }else if((line.indexOf(\"#\") == 0) && readInfo){\r\n // alreadey reading a tagInfo, means NL between entries\r\n out = out+line.substring(line.indexOf(\"#\")+1)+NL;\r\n }\r\n\r\n line = filereader.readLine();\r\n }\r\n\r\n filereader.close();\r\n\r\n //System.out.println(tagHash);\r\n\r\n }catch (Exception e){\r\n System.out.println(\"Exception in readFile: \"+e);\r\n }\r\n }", "public void readContent(BinaryDataReader dataReader) throws IOException\n\t{\n\t\t// parse tag data\n\t\tswitch (this.type)\n\t\t{\n\t\tcase BYTE:\n\t\t\tthis.content = Integer.valueOf(value);\n\t\t\tbreak;\n\t\tcase SHORT:\n\t\t\tthis.content = Integer.valueOf(value);\n\t\t\tbreak;\n\t\tcase LONG:\n\t\t\tthis.content = Integer.valueOf(value);\n\t\t\tbreak;\n\t\tcase ASCII:\n\t\t\tthis.content = readAscii(dataReader);\n\t\t\tbreak;\n\t\tcase RATIONAL:\n\t\t\t// convert tag value to long offset for reading large buffer\n\t\t\tthis.content = readRational(dataReader);\n\t\t\tbreak;\n\t\t\t\n\t\tcase UNKNOWN:\n\t\t\tSystem.err.println(\"Could not interpret tag with code: \"\n\t\t\t\t\t+ this.code + \" (\" + this.name + \")\");\n\t\t\tbreak;\n\t\t}\t\t\n\t}", "public TagInfo[] getTags() {\n/* 164 */ return this.tags;\n/* */ }", "public void readFields(DataInput in) throws IOException {\n\t\tid.readFields(in);\n\t\ttag.readFields(in);\n\t}", "public long readTag(){\n if (!checkOpen()){\r\n return 0;\r\n }\r\n // arrays will hold return values from various calls to reader\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 return 0;\r\n }\r\n System.out.println(\"Tagtype:\"+pTAG[0] + \" SN[0]:\" + Integer.toHexString(pSN[0]) + \" return= \" + tag);\r\n long serial = 0;\r\n for(int i=0;i<pLen[0];i++) {\r\n // shift and bitwise-OR the bytes into one 64-bits integer\r\n serial = (serial << 8 ); // shift left 8 bits\r\n serial = serial | (pSN[i] & 0xFF); // bitwise OR byte into int\r\n }\r\n System.out.printf(\" serial = %d hex: %X\",serial, serial);\r\n message = \"String read\";\r\n // test card read/write+login functions; only with new cards\r\n //writeString(\"Hello RFID card\");\r\n //System.err.println(readString());\r\n return (int)serial;\r\n }", "List<Tag> load();", "private void readIcons(){\n\t\tString tag = \"\";\n\t\t\n\t\t//Handles tags that have no related icon\n\t\tImage unknownImg = null;\n\t\ttry {\n\t\t\tunknownImg = ImageIO.read(new File(ICON_FILE_PATH + \"Unknown.png\"));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t\t\n\t\tfor(LinkedList<Node> list : targets){\n\t\t\tfor(Node node : list){\n\t\t\t\ttag = node.getTag();\n\t\t\t\tif(!iconMap.containsKey(tag)){\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tImage img = ImageIO.read(new File(ICON_FILE_PATH + tag + \".png\"));\n\t\t\t\t\t\ticonMap.put(tag, img);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\ticonMap.put(tag, unknownImg);\n\t\t\t\t\t\tSystem.err.println(tag + \" tag has no related icon\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(Node node : nonTargetNodes){\n\t\t\ttag = node.getTag();\n\t\t\tif(!iconMap.containsKey(tag)){\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tImage img = ImageIO.read(new File(ICON_FILE_PATH + tag + \".png\"));\n\t\t\t\t\ticonMap.put(tag, img);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\ticonMap.put(tag, unknownImg);\n\t\t\t\t\tSystem.err.println(tag + \" tag has no related icon\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public Tag[][] mainTags(final String site, final int orgaoID)\r\n\t\t\tthrows IOException, ClassNotFoundException, SQLException, Exception {\r\n\r\n\t\tmains(site, orgaoID, true);\r\n\r\n\t\treturn this.tagArray;\r\n\r\n\t}", "private void snapshot\n (int[] i, int i0, int i1, long[] V) {\n int I = i.length;\n long[] va = V;\n long[] vb = new long[I];\n long[] ta = new long[I];\n long[] tb = new long[I];\n do {\n collectTags(i, i0, i1, ta);\n collectValues(i, i0, i1, va);\n collectValues(i, i0, i1, vb);\n collectTags(i, i0, i1, tb);\n } while(\n Arrays.compare(ta, i0, i1, tb, i0, i1) != 0 ||\n Arrays.compare(va, i0, i1, vb, i0, i1) != 0\n );\n }", "public int readFromFile(int index) throws IOException {\n FileReader file = (FileReader) filePtrs.get(index);\n int i16 = file.read(); // UTF-16 as int\n char c16 = (char)i16; // UTF-16\n if (Character.isHighSurrogate(c16))\n {\n int low_i16 = file.read(); // low surrogate UTF-16 as int\n char low_c16 = (char)low_i16;\n return Character.toCodePoint(c16, low_c16);\n }\n return i16;\n }", "UniqueTagList getTags();", "public int getTagNumber() {\n return tagNumber;\n }", "ITaggedData Create(short tag, byte[] data, int offset, int count);", "public com.walgreens.rxit.ch.cda.PN getNameArray(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.PN target = null;\n target = (com.walgreens.rxit.ch.cda.PN)get_store().find_element_user(NAME$8, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n return target;\n }\n }", "public T get(int i) {\n // we add values.length to head-i to avoid negative indices\n return values[(head-i+values.length) % values.length];\n }", "public void afterRead(int i) throws IOException {\n if (i == -1) {\n close();\n }\n }", "public Tag readTag() {\n Tag tag = null;\n if(currentFrame >= frames.size()) {\n return tag;\n }\n\n try {\n lock.acquire();\n\n //get the current frame\n MP4Frame frame = frames.get(currentFrame);\n if (frame != null) {\n// LogU.d(\"currentFrame= \" + currentFrame + \" frame \"+ frame);\n int sampleSize = frame.getSize();\n int time = (int) Math.round(frame.getTime() * 1000.0);\n //Log.d(TAG,\"Read tag - dst: {} base: {} time: \" + new Object[]{frameTs, baseTs, time});\n long samplePos = frame.getOffset();\n //Log.d(TAG,\"Read tag - samplePos \" + samplePos);\n //determine frame type and packet body padding\n byte type = frame.getType();\n\n //create a byte buffer of the size of the sample\n ByteBuffer data = ByteBuffer.allocate(sampleSize);\n try {\n //prefix is different for keyframes\n\n // do we need to add the mdat offset to the sample position?\n dataSource.position(samplePos);\n // read from the channel\n dataSource.read(data);\n } catch (IOException e) {\n e.printStackTrace();\n }\n // chunk the data\n ByteBuffer payload = ByteBuffer.wrap(data.array());\n // create the tag\n tag = new Tag(type, time, payload.limit(), payload, prevFrameSize);\n // set the frame / tag size\n prevFrameSize = tag.getBodySize();\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n lock.release();\n }\n LogU.d(\"read tag currentFrame \"+ currentFrame + \" finish frame size \" + tag.getBodySize());\n return tag;\n }" ]
[ "0.6620618", "0.59546685", "0.56758296", "0.56448567", "0.5574829", "0.54370224", "0.5373207", "0.53572035", "0.53468066", "0.53097093", "0.52176154", "0.51628715", "0.51301086", "0.5096417", "0.5088122", "0.5004801", "0.5002571", "0.49134287", "0.48991555", "0.48986217", "0.4880729", "0.4865667", "0.4859478", "0.4838587", "0.48277017", "0.48167711", "0.48007333", "0.47969735", "0.47923353", "0.47789335", "0.47547674", "0.4731063", "0.46998727", "0.46566826", "0.46551493", "0.46377724", "0.46298438", "0.46114787", "0.46069896", "0.4597745", "0.45901334", "0.4589671", "0.4584521", "0.45789438", "0.45775175", "0.45637533", "0.45353612", "0.4527379", "0.45159286", "0.45084897", "0.4507464", "0.45057213", "0.45025903", "0.45006043", "0.44988978", "0.44881135", "0.44860247", "0.44697994", "0.4460867", "0.44539866", "0.4441004", "0.44358677", "0.4431302", "0.4429418", "0.44285586", "0.442509", "0.44247186", "0.44173145", "0.44166052", "0.44157553", "0.44123444", "0.4410901", "0.44069165", "0.4403972", "0.43983802", "0.43918654", "0.43820733", "0.43807054", "0.43540567", "0.43540567", "0.4344923", "0.4335334", "0.43326226", "0.43316442", "0.4329106", "0.43194056", "0.43183112", "0.43174794", "0.43162122", "0.43014386", "0.4297446", "0.42943966", "0.42913663", "0.42726472", "0.426452", "0.42601112", "0.42588276", "0.42579827", "0.42538118", "0.4252128" ]
0.58429945
2
Reads values at indices is. 1. For each index, read its value.
private void collectValues (int[] i, int i0, int i1, long[] V) { for (int o=i0; o<i1; o++) // 1 V[o] = read(i[o]); // 1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract int readInternal(int index);", "int getRequestedValues(int index);", "protected E readValue(LineReader reader, long indexElement) throws IOException {\n int length = (int) getValueLength(indexElement);\n if (length == 0) {\n return getValueConverter().bytesToValue(buffer, 0);\n }\n long valPos = getValuePosition(indexElement);\n if (log.isTraceEnabled()) {\n log.trace(\"readValue: Retrieving value of length \" + length + \" from file at position \" + valPos);\n }\n synchronized (this) {\n reader.seek(valPos);\n if (buffer.length < length) {\n buffer = new byte[length];\n }\n reader.readFully(buffer, 0, length);\n }\n/* for (int i = 0 ; i < length ; i++) {\n System.out.println(buffer[i]);\n }\n */\n return getValueConverter().bytesToValue(buffer, length);\n }", "int get(int index)\n\t{\n\t\treturn inputArray[index];\n\t}", "public int[] readAllInts(){\n\t\tString[] fields=readAllStrings();\n\t\tint[] vals=new int[fields.length];\n\t\tfor (int i=0;i<fields.length;i++){\n\t\t\tvals[i]=Integer.parseInt(fields[i]);\n\t\t}\n\t\treturn vals;\n\t}", "public void readValues() {\n\t\tfor (int i = 0; i < 7; i++) {\n\t\t\tfor (int j = 0; j < 7; j++) {\n\t\t\t\tarray.setElement(i, j, Integer.parseInt(lblCenter[i][j].getText()));\n\t\t\t}\n\t\t\tleftCol.setElement(i, Integer.parseInt(tfWest[i].getText()));\n\t\t\tbottomRow.setElement(i, Integer.parseInt(tfSouth[i].getText()));\n\t\t}\n\t}", "private void readIndex() throws IOException {\n\t\t\tif (this.keys != null)\n\t\t\t\treturn;\n\t\t\tkeys = new HashMap<K, Long>(1024);\n\t\t\ttry {\n\t\t\t\twhile (index.hasNext()) {\n\t\t\t\t\tPair<K, Long> pair;// = new Pair<K, Long>(index.getSchema());\n\t\t\t\t\tpair = index.next();\n\t\t\t\t\tkeys.put(pair.key(), pair.value());\n\t\t\t\t\tif (firstKey == null)\n\t\t\t\t\t\tfirstKey = pair.key();\n\t\t\t\t\tfinalKey = pair.key();\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\n\t\t\t}finally {\n\t\t\t\tindexClosed = true;\n\t\t\t\tindex.close();\n\t\t\t}\n\t\t}", "public int getRequestedValues(int index) {\n return requestedValues_.get(index);\n }", "default V item( int... indices ) {\n LogUtil.nullArgCheck( indices, \"indices\", int[].class, \"Cannot find nd-array value without indices!\" );\n if ( indices.length == 0 ) throw new IllegalArgumentException(\"Index array may not be empty!\");\n if ( indices.length < this.rank() ) {\n if ( indices.length == 1 ) return getDataAt( getNDConf().indexOfIndex( indices[0] ) );\n else {\n int[] allIndices = new int[this.rank()]; // We do some 0 padding to make sure we have the correct number of indices.\n System.arraycopy( indices, 0, allIndices, 0, indices.length );\n return getDataAt( getNDConf().indexOfIndices( allIndices ) );\n }\n }\n return getDataAt( getNDConf().indexOfIndices( indices ) );\n }", "abstract public Object getValue(int index);", "com.google.protobuf.ByteString getValuesBytes(int index);", "public int getRequestedValues(int index) {\n return requestedValues_.get(index);\n }", "@Override\r\n\tpublic double getValue(int index) {\n\t\tif (data==null) return 0;\r\n\t\t\r\n\t\tdouble d = 0;\r\n\t\tint begin=index+pos;\r\n\t\tif (begin<0) begin=0;\r\n\t\tif (begin>data.size()-1) begin = data.size()-1;\r\n\t\td = data.get(begin).getOpen();\r\n\t\t\r\n\t\treturn d;\r\n\t}", "Nda<V> get( int... indices );", "int getStateValues(int index);", "Nda<V> getAt( int... indices );", "final int getIntPropertyValue(int index) {\n return mValues[index];\n }", "public Object getValue(int index);", "public long getVal(int index){\n \t\treturn regFile[index].getValue();\n \t}", "@Override\n public int read(int[] coordinates) {\n\n coordinates[0] = (int) x.get();\n coordinates[1] = (int) y.get();\n\n return 1;\n }", "public static int[] readInts() {\n return readAllInts();\n }", "private void readSparseVectorArrays(\n int[] indices, double[] values, DataInputView source, int len) throws IOException {\n for (int i = 0; i < len; i++) {\n indices[i] = source.readInt();\n values[i] = source.readDouble();\n }\n }", "public long [] getData(Long index);", "public int getData(int index) {\n return data_.get(index);\n }", "float get(int idx);", "protected int[] readIntArray(BinaryDataReader dataReader) throws IOException\n\t{\n\t\tlong offset = ((long) this.value) & 0xffffffffL;\n\n\t\t// allocate memory for result\n\t\tint[] res = new int[this.count];\n\n\t\t// save pointer location\n\t\tlong saveLoc = dataReader.getFilePointer();\n\n\t\t// fill up array\n\t\tdataReader.seek(offset);\n\t\tfor (int c = 0; c < this.count; c++)\n\t\t{\n\t\t\tres[c] = dataReader.readInt();\n\t\t}\n\t\t\n\t\t// restore pointer and return result\n\t\tdataReader.seek(saveLoc);\n\t\treturn res;\n\t}", "public int getData(int index) {\n return data_.get(index);\n }", "public int getStateValues(int index) {\n return stateValues_.get(index);\n }", "public int read(int i);", "protected int _getInt(int index)\r\n/* 378: */ {\r\n/* 379:392 */ return HeapByteBufUtil.getInt(this.array, index);\r\n/* 380: */ }", "public int get(int index) {\n\t\treturn r[index];\n\t}", "public int read(float[] f) throws IOException {\n\t\treturn read(f, 0, f.length);\n\t}", "java.lang.String getValues(int index);", "public int read(int[] i) throws IOException {\n\t\treturn read(i, 0, i.length);\n\t}", "public int getStateValues(int index) {\n return stateValues_.get(index);\n }", "public E get(int index) {\r\n\t\tif (indices.get(index) == null) {\r\n\t\t\tthrow new NoSuchElementException();\r\n\t\t} else {\r\n\t\t\treturn indices.get(index).data;\t\t\r\n\t\t}\r\n\t}", "public void getIndices (short[] indices) {\r\n \t\tif (indices.length < getNumIndices())\r\n \t\t\tthrow new IllegalArgumentException(\"not enough room in indices array, has \" + indices.length + \" floats, needs \"\r\n \t\t\t\t+ getNumIndices());\r\n \t\tint pos = getIndicesBuffer().position();\r\n \t\tgetIndicesBuffer().position(0);\r\n \t\tgetIndicesBuffer().get(indices, 0, getNumIndices());\r\n \t\tgetIndicesBuffer().position(pos);\r\n \t}", "float getIn(int index);", "public int getDataFromGivenIndex(int index){\n //Index validation\n checkIndex(index);\n return getNodeFromGivenIndex(index).data;\n }", "public int getDataMemory(int index)\n {\n int retValue = 0;\n try { retValue = data_memory[index].intValue(); }\n catch (ArrayIndexOutOfBoundsException OOB) { }\n return retValue;\n }", "public int getValueAtIndex(int index) {\n if (index < arraySize)\n return theArray[index];\n\n return 0;\n }", "@Override\n\tpublic int get(int index) throws IndexOutOfBoundsException {\n\t\tif(checkIndex(index, size)) { //check if index is valid\n\t\t\treturn values[index]; //return the value at index\n\t\t}else {\n\t\t\tthrow new IndexOutOfBoundsException(\"Highest index: \" + size);\n\t\t}\t\n\t}", "public int get(int index);", "public Object get( int index )\n {\n\treturn _data[index];\n }", "Value get(int index) throws ExecutionException;", "public int get(int index) {\n return array[index];\n }", "private long read(int i) {\n while (true) {\n long x = data[i];\n if (!isTag(x)) return value(x);\n reset(i);\n }\n }", "public int readValue() { \n\t\treturn (port.readRawValue() - offset); \n\t}", "int get(int idx);", "abstract int get(int index);", "@Override\n public E get(int index) {\n // todo: Students must code\n checkRange(index); // throws IndexOOB Exception if out of range\n return data[calculate(index)];\n }", "int readerIndex();", "@Override\n public int get(int index) {\n checkIndex(index);\n return getEntry(index).value;\n }", "Index getIndices(int index);", "public int[] getData(int index) {\n // retrieve the length \n int l = theList.get(index);\n // now retrieve the characters for this data block\n int data[] = new int[l];\n for(int i=0; i<l; i++) {\n data[i] = theList.get(index+1+i);\n }\n return data;\n }", "E getData(int index);", "public int[] getAsSRational(int index) {\n return ((int[][])data)[index];\n }", "public int getElementArray1(int index)\n {\n return array1[index];\n }", "@Override\n public E get(int index) {\n this.rangeCheck(index);\n return (E) this.values[index];\n }", "@Override\n\tpublic Object getValueAt(int arg0, int arg1) {\n\t\treturn dataAll[arg0][arg1];\n\t}", "private Map<BngCounterType, PiCounterCellData> readCounters(\n long index,\n Set<BngCounterType> counters) throws BngProgrammableException {\n Map<BngCounterType, PiCounterCellData> readValues = Maps.newHashMap();\n Set<PiCounterCellId> counterCellIds = counters.stream()\n .filter(c -> !UNSUPPORTED_COUNTER.contains(c))\n .map(c -> PiCounterCellId.ofIndirect(COUNTER_MAP.get(c), index))\n .collect(Collectors.toSet());\n // Check if there is any counter to read.\n if (counterCellIds.size() != 0) {\n Set<PiCounterCellHandle> counterCellHandles = counterCellIds.stream()\n .map(cId -> PiCounterCellHandle.of(this.deviceId, cId))\n .collect(Collectors.toSet());\n\n // Query the device.\n Collection<PiCounterCell> counterEntryResponse = client.read(\n p4DeviceId, pipeconf)\n .handles(counterCellHandles).submitSync()\n .all(PiCounterCell.class);\n\n if (counterEntryResponse.size() == 0) {\n throw new BngProgrammableException(\n String.format(\"Error in reading counters %s\", counters.toString()));\n }\n readValues.putAll(counterEntryResponse.stream().collect(\n Collectors.toMap(counterCell -> COUNTER_MAP.inverse()\n .get(counterCell.cellId().counterId()),\n PiCounterCell::data)));\n }\n return readValues;\n }", "public static int[] getindex(int[] values) {\n\t \n\t \n\t \n\t int[] b = {64,128,192,256};\n\t \n\t int redindex = 0;\n\t int greenindex=0;\n\t int blueindex=0;\n\t \n\t for(int i=0; i<indexlevel8.length;i++) {\n\t if(values[0] <= indexlevel8[i]) { redindex = i; break;}\n\t }\n\t \n\t for(int i=0; i<indexlevel8.length;i++) {\n\t\t if(values[1] <= indexlevel8[i]) { greenindex = i; break;}\n\t\t }\n\t \n\t for(int i=0; i<b.length;i++) {\n\t\t if(values[2] <= b[i]) { blueindex = i; break;}\n\t }\n\t \n\t values[0] = redindex*32+16;\n\t values[1] = greenindex*32+16;\n\t values[2] = blueindex*64+32;\n\t \n\t \n\t return values; // the values of the lookup table for 8bit scale\n }", "public long getValue(int index) {\n return value_.getLong(index);\n }", "public long get(int i) {\n return read(i);\n }", "boolean getIsIndexOnValues();", "public double get(int index) {\n\t\treturn 0;\n\t}", "@Override\n public int[] getInts(int index, int length) throws ArrayIndexOutOfBoundsException {\n if (length == 0) {\n return new int[0];\n }\n \n List<Value> values = array.getValues(index, length);\n int[] result = new int[values.size()];\n for (int i = 0; i < result.length; i++) {\n result[i] = ((IntegerValue)values.get(i)).intValue();\n }\n return result;\n }", "public long getValue(int index) {\n return value_.getLong(index);\n }", "public int getAsInt(int index) {\n switch (type) {\n case TIFFTag.TIFF_BYTE: case TIFFTag.TIFF_UNDEFINED:\n return ((byte[])data)[index] & 0xff;\n case TIFFTag.TIFF_SBYTE:\n return ((byte[])data)[index];\n case TIFFTag.TIFF_SHORT:\n return ((char[])data)[index] & 0xffff;\n case TIFFTag.TIFF_SSHORT:\n return ((short[])data)[index];\n case TIFFTag.TIFF_SLONG:\n return ((int[])data)[index];\n case TIFFTag.TIFF_LONG: case TIFFTag.TIFF_IFD_POINTER:\n return (int)((long[])data)[index];\n case TIFFTag.TIFF_FLOAT:\n return (int)((float[])data)[index];\n case TIFFTag.TIFF_DOUBLE:\n return (int)((double[])data)[index];\n case TIFFTag.TIFF_SRATIONAL:\n int[] ivalue = getAsSRational(index);\n return (int)((double)ivalue[0]/ivalue[1]);\n case TIFFTag.TIFF_RATIONAL:\n long[] lvalue = getAsRational(index);\n return (int)((double)lvalue[0]/lvalue[1]);\n case TIFFTag.TIFF_ASCII:\n String s = ((String[])data)[index];\n return (int)Double.parseDouble(s);\n default:\n throw new ClassCastException();\n }\n }", "public int get(int index) {\n\t\treturn nodeAt(index).data;\n\t}", "public int get(int index) {\n if(index>-1 && index<len) {\n SingleNode iSingleNode = head;\n for(int i=0; i<index; i++) {\n\n iSingleNode = iSingleNode.next;\n }\n return iSingleNode.data;\n }\n return 0;\n }", "com.google.api.servicecontrol.v1.MetricValue getMetricValues(int index);", "public float getVal() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 8);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 8);\n\t\t}\n\t}", "public float getSignalValue(int index);", "public int getElementAtIndex(int index){\r\n return mArray[index];\r\n }", "public static int[] getValues(int states) throws IllegalArgumentEvent {\r\n\t\tint[] values = new int[9];\r\n\t\tint i = 0;\r\n\t\tfor(i = 0; i < 9; i++){\r\n\t\t\tvalues[i] = getValue(states, i);\r\n\t\t}\r\n\t\treturn values;\r\n\t}", "public float get(int index) {\n return storage[index];\n }", "public float get(int index) {\r\n RangeCheck(index);\r\n return elementData[index];\r\n }", "public int getInt(int index) throws ArrayIndexOutOfBoundsException\n\t{\n\t\treturn bytes[index] & 0xFF;\n\t}", "public T get(int i) {\n // we add values.length to head-i to avoid negative indices\n return values[(head-i+values.length) % values.length];\n }", "public RTWValue getAsValue(int i);", "public IntSet get(int index){\n\t\tif(index<0 || index>=contents.size()){\n\t\t\treturn null;\n\t\t}\n\t\treturn contents.get(index);\n\t}", "public double[] getData(int index) {\n\t\treturn m_Data[index];\n\t}", "public Object getValueAt(int index);", "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}", "Nda<V> getAt( Number i );", "public int getInt(int index)\r\n/* 372: */ {\r\n/* 373:386 */ ensureAccessible();\r\n/* 374:387 */ return _getInt(index);\r\n/* 375: */ }", "Nda<V> get( int i );", "int get(int i) {\n int numPosition = i / MAX_BITS;\n int intPosition = i % MAX_BITS;\n long val = values[numPosition] & (1 << intPosition);\n return (int) (val >> intPosition);\n }", "@Override\n public int[] getAttributeIndexToRead()\n {\n java.util.ArrayList<Integer> attributes = new java.util.ArrayList<Integer>();\n //LN is static and read only once.\n if (LogicalName == null || LogicalName.compareTo(\"\") == 0)\n {\n attributes.add(1);\n }\n //ScalerUnit\n if (!isRead(3))\n {\n attributes.add(3);\n }\n //Value\n if (canRead(2))\n {\n attributes.add(2);\n } \n return toIntArray(attributes);\n }", "byte get(int index);", "protected int[] readShortArray(BinaryDataReader dataReader) throws IOException\n\t{\n\t\tlong offset = ((long) this.value) & 0xffffffffL;\n\n\t\t// allocate memory for result\n\t\tint[] res = new int[this.count];\n\n\t\t// save pointer location\n\t\tlong saveLoc = dataReader.getFilePointer();\n\n\t\t// fill up array\n\t\tdataReader.seek(offset);\n\t\tfor (int c = 0; c < this.count; c++)\n\t\t{\n\t\t\tres[c] = dataReader.readShort();\n\t\t}\n\t\t\n\t\t// restore pointer and return result\n\t\tdataReader.seek(saveLoc);\n\t\treturn res;\n\t}", "public double[] getValues(String nodeType, int index)\r\n {\r\n\treturn getValues(nodeType, new NodeFilter()\r\n\t { public final boolean accept(Node n) { return true; }},\r\n\t\t\t index);\r\n }", "public int read(double[] d) throws IOException {\n\t\treturn read(d, 0, d.length);\n\t}", "private void readValue(Scanner scanner, int i) throws BadDataException\n {\n\tString message = \"Data value expected, but find no integer.\" ;\n\t//-----------Start below here. To do: approximate lines of code = 2\n\t// 3. if there is no integer next in the file, throw a BadDataException with the message above; \n\t if (!scanner.hasNextInt())\n \t throw new BadDataException(message);\n //4. read the next integer into the array called data.\n\t\tdata[i] = scanner.nextInt();\n\t//-----------------End here. Please do not remove this comment. Reminder: no changes outside the todo regions.\n }", "int getInt(int index) throws PropertyException {\n return this.getNumber(index).intValue();\n }", "@Override\n\tpublic Object getValueAt(int arg0, int arg1) {\n\t\treturn data[arg0][arg1];\n\t}", "@Override\n\tpublic Object getValueAt(int arg0, int arg1) {\n\t\treturn data[arg0][arg1];\n\t}", "protected long[] loadIndex() throws IOException {\n checkBase();\n log.debug(String.format(\"Loading indexes for pool '%s' at location '%s'\", poolName, location));\n if (!location.exists()) {\n throw new IOException(String.format(\"The folder '%s' for pool '%s' does not exist\", location, poolName));\n }\n\n FileInputStream indexIn = new FileInputStream(new File(location, poolName + INDEX_POSTFIX));\n BufferedInputStream indexBuf = new BufferedInputStream(indexIn);\n ObjectInputStream index = new ObjectInputStream(indexBuf);\n int version = index.readInt();\n if (version != VERSION) {\n throw new IOException(String.format(\n \"The version for the pool '%s' at location '%s' was %d. This loader only supports version %d\", \n poolName, location, version, VERSION));\n }\n int size = index.readInt();\n log.debug(String.format(\"Starting load of %d index data (longs)\", size));\n long[] indexData = new long[size];\n long feedback = Math.max(size / 100, 1);\n Profiler profiler = new Profiler();\n profiler.setExpectedTotal(size);\n for (int i = 0; i < size; i++) {\n if (i % feedback == 0) {\n if (log.isTraceEnabled()) {\n log.trace(\"Loaded \" + i + \"/\" + size + \" index values. ETA: \" + profiler.getETAAsString(true));\n }\n }\n indexData[i] = index.readLong();\n }\n log.trace(\"loadIndex: Closing streams\");\n index.close();\n indexBuf.close();\n indexIn.close();\n log.debug(String.format(\"Finished loading of %d index data from pool '%s' at location '%s' in %s\", \n size, poolName, location, profiler.getSpendTime()));\n return indexData;\n }", "public void read( int readIndex, byte[] array, int firstIndex,\n\t\t\tint count );" ]
[ "0.6395187", "0.59512615", "0.59042", "0.5831532", "0.5817545", "0.5797822", "0.57278246", "0.5724609", "0.57092583", "0.5687432", "0.5685664", "0.5673479", "0.56610715", "0.56591547", "0.56503284", "0.56294465", "0.56141096", "0.5580075", "0.55761987", "0.5559043", "0.5549327", "0.55182385", "0.55015105", "0.54951954", "0.5492254", "0.5490583", "0.54879683", "0.54847276", "0.5473681", "0.5469579", "0.5456076", "0.5452604", "0.54508084", "0.54276276", "0.54167795", "0.5414589", "0.5404541", "0.53678644", "0.5363908", "0.53547", "0.535355", "0.5345868", "0.5318723", "0.52873105", "0.5278982", "0.5275906", "0.5275239", "0.52638143", "0.5259251", "0.525648", "0.5248058", "0.52225924", "0.5217382", "0.51923305", "0.51816404", "0.51794046", "0.5169588", "0.51656985", "0.51622415", "0.51568186", "0.5150725", "0.5149206", "0.5138952", "0.5138459", "0.5137506", "0.51307917", "0.51299506", "0.51255876", "0.5124132", "0.51187384", "0.510841", "0.5100772", "0.50850374", "0.50796634", "0.507692", "0.5073763", "0.507066", "0.50670487", "0.50600845", "0.5055905", "0.5045657", "0.50284195", "0.5027254", "0.5026731", "0.5011634", "0.5009532", "0.5009489", "0.500935", "0.50001025", "0.49983087", "0.49979815", "0.4991999", "0.499195", "0.49908158", "0.4990803", "0.49884614", "0.4982535", "0.4982535", "0.49719217", "0.4962687" ]
0.61075944
1
Store conditional if item at i is tag. 1. Try replace tag at i with item.
private boolean sc(int i, long y) { return cas(i, tag[th()], y); // 1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "default boolean putTagIfRegexFound(TaggedItemsArray tiarray) {\n Iterator<String> itr = tiarray.getIterator();\n boolean anyRegexFound = false;\n\n while (itr.hasNext()) {\n String item = itr.next();\n\n if (match(item)) {\n tiarray.modify(item, getTag());\n anyRegexFound = true;\n }\n }\n\n return anyRegexFound;\n }", "public void updateItemTag(int index, String tag) {\n int correctIndex = index - 1;\n this.listItems.get(correctIndex).addNewTagMutable(tag);\n }", "private void incTag() {\n long id = tagId(tag[th()]); // 1\n tag[th()] = newTag(id+1); // 2\n }", "public void tagOneBased() {\n for (Item e: items) {\n e.setTag(new Integer(e.getId()+1));\n }\n }", "public void checkForTag(int i) {\n if (wordsOfInput[i].indexOf('#') == 0) {\n if ((!containsStartDate || !containsStartTime) && index > i) {\n index = i;\n tpsIndex = i;\n }\n String tag = wordsOfInput[i].substring(1);\n tags.add(tag);\n }\n }", "private synchronized void tags(ViewHolder holder, int position){\n holder.tagsLL.removeAllViews();\n\n int count = 0;\n while (count < 3) {\n String tagName = \"\";\n switch (count) {\n case 0:\n tagName = tag1ArrList.get(position);\n break;\n case 1:\n tagName = tag2ArrList.get(position);\n break;\n case 2:\n tagName = tag3ArrList.get(position);\n break;\n }\n if (! tagName.equals(\"\")) {\n final TextView tagTV = Tags.newTagView(context, userUIPreferences.textSize, userUIPreferences.tagsTextColor, userUIPreferences.tagsTVParams, userUIPreferences.tagsBackgroundDrawable,\n userUIPreferences.fontStyle, userUIPreferences.userSelectedFontTF);\n tagTV.setText(tagName.replaceAll(\"_\", \" \"));\n holder.tagsLL.addView(tagTV);\n }\n else{\n break;\n }\n count ++;\n }\n }", "private boolean isTag(String item) {\n return storiesToTags.keySet().contains(item);\n }", "private void setHasTag(int value) {\n \n hasTag_ = value;\n }", "private void saveTag(Tag tag){\n Long num = tagMap.get(tag);\n tagMap.put(tag, (num == null) ? (long)1 : num+1);\n }", "private void collectTags\n (int[] i, int i0, int i1, long[] T) {\n for (int o=i0; o<i1; o++) // 1\n T[o] = data[i[o]]; // 1\n }", "public boolean alreadyAnnotated(String indeces, String tag, String word) {\n if (taggedItems.containsKey(indeces)) {\n if (!tag.equals(taggedItems.get(indeces)))\n System.out.println(\"Conflict : \" + word + \" Old tag: \" + taggedItems.get(indeces) + \" New tag: \" + tag);\n return true;\n } else\n return false;\n }", "@Test\n public void updateComponentTag() {\n UpdateTagRequest updateComponentRequest = new UpdateTagRequest();\n // String key = (String) tagToUpdate2.keySet().toArray()[0];\n updateComponentRequest.setTagKey(TAG_2.getName());\n updateComponentRequest.setTagValue(TAG_2.getValue());\n\n componentController.upsertTag(indexedNodeType.getId(), updateComponentRequest);\n tmpIndexedNodeType = dao.findById(NodeType.class, indexedNodeType.getId());\n\n assertEquals(\"Tags map size should'nt change\", tmpIndexedNodeType.getTags().size(), indexedNodeType.getTags().size());\n int index = tmpIndexedNodeType.getTags().indexOf(TAG_2);\n int index2 = indexedNodeType.getTags().indexOf(TAG_2);\n assertNotEquals(\"tag2 tag value has changed\", tmpIndexedNodeType.getTags().get(index).getValue(), indexedNodeType.getTags().get(index2).getValue());\n assertEquals(\"tag2 tag value should be the same as TAG_2\", tmpIndexedNodeType.getTags().get(index).getValue(), TAG_2.getValue());\n\n }", "private void reset(int i) {\n long x = data[i];\n if (isTag(x))\n cas(i, x, save[threadId(x)]);\n }", "public boolean replaceKey(int i, T element) {\r\n\t\tif (i < 0 || i > theHeap.size() - 1) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif ((Integer) element <= 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\ttheHeap.set(i, (T) element);\r\n\r\n\t\tif (i != 0 && (compare(getValue((i - 1) >> 1), getValue(i)) > 0)) {\r\n\t\t\tsiftUp();\r\n\t\t} else {\r\n\t\t\tsiftDown(i);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private void removeItem(int item) {\n\t\tboolean flag = false;\r\n\t\tfor(int i=0; i<index; i++) {\r\n\t\t\tif(products[i].getTag() == item) {\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"없어진 상품:\"+products[i].toString());\r\n\t\t\t\tproducts[i] = null;\r\n\t\t\t\tindex--;\r\n\t\t\t\tflag = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(flag == false)\r\n\t\t\tSystem.out.println(\"해당하는 상품이 없습니다.\");\r\n\t}", "public void setItem(Object item, int i)\n {\n items.setElementAt(item, i);\n }", "private void UpdateTagsList()\r\n\t{ \r\n\t\t // for every element in our checkboxes from the view array\r\n\t\t for (CheckBox checkBox : this.CBlist) \r\n\t\t {\r\n\t\t\t // if it is checked\r\n\t\t\t if(checkBox.isChecked())\r\n\t\t\t {\r\n\t\t\t\t // Update the values on the local indication array\r\n\t\t\t\t hmTags.put(checkBox.getText().toString(), true);\r\n\t\t\t }\r\n\t\t }\t\t\t\r\n\t}", "@Override\n\tpublic int update(Tags tag) {\n\t\treturn 0;\n\t}", "@Override\n public void setTag(int t) {\n this.tag = t;\n\n }", "int insertSelective(TagData record);", "public Item swapItem(Item i){\r\n if(size()!=1) throw new IllegalStateException(\"Trying to swap item of\"\r\n + \"large container\");\r\n add(i);\r\n return remove(0);\r\n }", "private void removeTagAndContent(ArrayList p_tags, HtmlObjects.Tag p_tag)\n {\n int i_start = 0;\n int i_end = 0;\n\n loop: for (int i = 0, max = p_tags.size(); i < max; i++)\n {\n Object o = p_tags.get(i);\n\n if (o == p_tag)\n {\n i_start = i;\n\n for (int j = i + 1; j < max; j++)\n {\n Object o1 = p_tags.get(j);\n\n if (o1 instanceof HtmlObjects.EndTag)\n {\n HtmlObjects.EndTag etag = (HtmlObjects.EndTag) o1;\n\n if (p_tag.tag.equalsIgnoreCase(etag.tag)\n && p_tag.partnerId == etag.partnerId)\n {\n i_end = j;\n break loop;\n }\n }\n }\n }\n }\n\n if (i_start >= 0 && i_end > i_start)\n {\n p_tags.subList(i_start, i_end + 1).clear();\n }\n }", "void updateTags();", "public void addTag(String t) {\n\t\tif (!tagList.containsKey(t)) {\n\t\t\ttagList.put(t, 0);\n\t\t} else {\n\t\t\tSystem.out.print(\"Tag already exists!\");\n\t\t}\n\t}", "private void removeInsTag(ArrayList p_tags, HtmlObjects.Tag p_tag)\n {\n int i_start = 0;\n int i_end = 0;\n\n loop: for (int i = 0, max = p_tags.size(); i < max; i++)\n {\n Object o = p_tags.get(i);\n\n if (o == p_tag)\n {\n i_start = i;\n\n for (int j = i + 1; j < max; j++)\n {\n Object o1 = p_tags.get(j);\n\n if (o1 instanceof HtmlObjects.EndTag)\n {\n HtmlObjects.EndTag etag = (HtmlObjects.EndTag) o1;\n\n if (p_tag.tag.equalsIgnoreCase(etag.tag)\n && p_tag.partnerId == etag.partnerId)\n {\n i_end = j;\n break loop;\n }\n }\n }\n }\n }\n\n if (i_start >= 0 && i_end > i_start)\n {\n p_tags.subList(i_end - 1, i_end + 1).clear();\n p_tags.subList(i_start, i_start + 2).clear();\n }\n }", "int insertSelective(ArticleTag record);", "public void setItem(Item item) throws Exception {\n\t\tfor(int i = 0; i < last; ++i)\n\t\t\tif(list[i].getCode() == item.getCode()) {\n\t\t\t\tlist[i].increment(item.getCount());\n\t\t\t\treturn;\n\t\t\t}\n\t\tif(last < size)\n\t\t\tlist[last++] = item;\n\t\telse\n\t\t\tthrow new Exception(\"list full\");\n\t}", "@Override\n public boolean removeItem(Object itemId)\n {\n try\n {\n TLogger.debug(\"Entry in TagTable - removeItem\");\n if(itemId instanceof Tag)\n {\n Tag one = (Tag)itemId;\n Collection allItems = this.getItemIds();\n for(Object existingItem : allItems)\n {\n Tag two = (Tag)existingItem;\n if(one.getTagId().equals(two.getTagId()))\n {\n return super.removeItem(two);\n }\n }\n }\n }\n catch(Exception exception)\n {\n TLogger.error(\"Exception in TagTable - removeItem\",exception);\n }\n finally\n {\n TLogger.debug(\"Exit in TagTable - removeItem\");\n }\n return super.removeItem(itemId);\n }", "void insertTagContent(TemplateTag tag){\r\n \t\tif(tag.found){\r\n \t\t\ttemplateParts.set(tag.templatePosition,tag.getContent());\r\n \t\t}\r\n \t}", "public void onBindViewHolder(@NonNull a aVar, int i) {\n String str;\n StringBuilder sb;\n i iVar = this.f3019d.get(i);\n int i2 = b.f3030a[iVar.b().ordinal()];\n if (i2 != 1) {\n if (i2 == 2) {\n aVar.f3021b.setText(R.string.hints_virus_apk_list_item_summary);\n sb = new StringBuilder();\n sb.append(\"apk_icon://\");\n str = iVar.a();\n }\n aVar.f3020a.setText(iVar.d());\n aVar.f3022c.setTag(iVar);\n aVar.f3022c.setChecked(iVar.e());\n aVar.f3022c.setOnCheckedChangeListener(new d(this, iVar));\n aVar.itemView.setOnClickListener(new e(this, aVar));\n }\n aVar.f3021b.setText(R.string.hints_virus_app_list_item_summary);\n sb = new StringBuilder();\n sb.append(\"pkg_icon://\");\n str = iVar.c();\n sb.append(str);\n r.a(sb.toString(), aVar.f3023d, r.f);\n aVar.f3020a.setText(iVar.d());\n aVar.f3022c.setTag(iVar);\n aVar.f3022c.setChecked(iVar.e());\n aVar.f3022c.setOnCheckedChangeListener(new d(this, iVar));\n aVar.itemView.setOnClickListener(new e(this, aVar));\n }", "@Override\r\n\t\t\tpublic Object getItem(int i) {\n\t\t\t\treturn i;\r\n\t\t\t}", "@Override\n\tpublic void saveTag(Tag newTag) throws Exception {\n\n\t}", "public boolean item(int i) {\n\t\treturn x[i] == 1;\n\t}", "boolean onTag(ByteBuffer buffer, int tagIndex, int tagLen, int valueLen);", "public void setItem(@NotNull Usable usable, int i) {\n checkIndex(i);\n\n if (items[i] == null) {\n size++;\n }\n\n items[i] = usable;\n }", "private boolean replaceCommentInItems(int commentPosition, @NonNull GitHubComment comment) {\n Object item = items.get(commentPosition);\n boolean result = false;\n if (item instanceof GitHubComment) {\n items.set(commentPosition, comment);\n result = true;\n }\n return result;\n }", "public void smeltItem()\n {\n if (this.canSmelt())\n {\n ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);\n\n if (this.furnaceItemStacks[2] == null)\n {\n this.furnaceItemStacks[2] = var1.copy();\n }\n else if (this.furnaceItemStacks[2].isItemEqual(var1))\n {\n ++this.furnaceItemStacks[2].stackSize;\n }\n\n --this.furnaceItemStacks[0].stackSize;\n\n if (this.furnaceItemStacks[0].stackSize <= 0)\n {\n this.furnaceItemStacks[0] = null;\n }\n }\n }", "public void addTag(String singleTag) {\n \t\tif (!this.tags.contains(singleTag))\n \t\t\tthis.tags.add(singleTag);\n \t}", "public void replaceValueInEntry(int i, @NullableDecl V v, boolean z) {\n Preconditions.checkArgument(i != -1);\n int smearedHash = Hashing.smearedHash(v);\n int findEntryByValue = findEntryByValue(v, smearedHash);\n if (findEntryByValue != -1) {\n if (z) {\n removeEntryValueHashKnown(findEntryByValue, smearedHash);\n if (i == this.size) {\n i = findEntryByValue;\n }\n } else {\n throw new IllegalArgumentException(\"Value already present in map: \" + v);\n }\n }\n deleteFromTableVToK(i, Hashing.smearedHash(this.values[i]));\n this.values[i] = v;\n insertIntoTableVToK(i, smearedHash);\n }", "public void setTag(int tag) {\n this.tag = tag;\n }", "void removeTag(String tag){tags.remove(tag);}", "@SuppressWarnings (\"unchecked\") public void add(int i,String item){\n if(item==null)\n return;\n items.add(i,item.trim());\n }", "void addTag(String tag){tags.add(tag);}", "public void tickTag(int position) {\r\n dataTag.set(position, dataTag.get(position) + 1);\r\n }", "public boolean setTag(int tag)\n {\n if (tag < 0) {\n return false;\n }\n\n tag_ = tag;\n return true;\n }", "public boolean addTag(String newTag) {\n if (tags.contains(newTag)){\n return false;\n }\n tags.add(newTag);\n saveTags();\n return true;\n }", "private void clearHasTag() {\n \n hasTag_ = 0;\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Log.i(TAG, canoptcnt + \"\");\n if(isClickableLabel(canoptcnt)){\n ItemTagVo itemTagVo = habitList.get(position);\n int count = itemTagVo.getIsopt();\n if(count == 1){\n DialogUtil.getInstance().showCustomToast(GuestLabelEditActivity.this,\"同个客户相同标签只能贴一次\",Gravity.CENTER);\n }else {\n int tagId = itemTagVo.getTagid();\n if(isSelectedMore(tagId,canoptcnt)){\n Boolean isSelect = true;\n if (mSelectMap != null\n && mSelectMap.containsKey(tagId)){\n isSelect = !mSelectMap.get(tagId);\n }\n mSelectMap.put(tagId, isSelect);\n habitAdapter.setSelectMap(mSelectMap);\n if(isSelectedLabel()){\n confirmBtn.setVisibility(View.VISIBLE);\n }else {\n confirmBtn.setVisibility(View.GONE);\n }\n habitAdapter.notifyDataSetChanged();\n }else {\n DialogUtil.getInstance().showCustomToast(GuestLabelEditActivity.this,\"超过当天打标签上限\",Gravity.CENTER);\n }\n }\n }else {\n DialogUtil.getInstance().showCustomToast(GuestLabelEditActivity.this,\"超过当天打标签上限\",Gravity.CENTER);\n }\n }", "public void put(Item item) {\n for (; ; ) {\n\n if (!isResizing.get()) {\n //if a resize is currently not happening\n\n if (itemCount.get() > (0.75f * items.length)) {\n isResizing.getAndSet(true);\n resize();\n isResizing.getAndSet(false);\n }\n\n\n int index = item.hash() & (items.length - 1);\n Item current = items[index];\n\n if (current == null) {\n itemCount.compareAndSet(itemCount.get(), itemCount.get() + 1);\n items[index] = item;\n System.out.println(\"Successfully added: \" + item.toString());\n\n break;\n } else {\n itemCount.compareAndSet(itemCount.get(), itemCount.get() + 1);\n System.out.println(\"Successfully added: \" + item.toString());\n current.addToEnd(item);\n break;\n }\n\n }\n }\n\n }", "public void insert(Item item, int i){\n assert (count+1<=capacity);\n\n assert (i+1>=1&&i+1<=capacity);\n\n i+=1;\n\n data[i] = item;\n count++;\n\n indexes[count] = i;\n rev[i] = count;\n\n shiftUp(count);\n }", "@Override\n\tpublic void replaceAt(int index, int e) {\n\t\t\n\t}", "private void processTags() {\r\n tagNames.stream().map(name -> {\r\n tags.get(name).checkMembers();\r\n return name;\r\n }).forEach(name -> {\r\n if (!tags.get(name).hasMembers()) {\r\n menu.remove(tags.get(name).getMenu());\r\n tags.remove(name);\r\n tagNames.remove(name);\r\n } else {\r\n menu.add(tags.get(name).getMenu());\r\n }\r\n });\r\n }", "protected /*override*/ void InsertItem(int index, Condition item)\r\n { \r\n CheckSealed();\r\n ConditionValidation(item); \r\n super.InsertItem(index, item); \r\n }", "public void updateToNBTTagStorage () {\r\n\t\t// no book saved?\r\n\t\tif (storage.getBoolean(\"isBook\") == null || storage.getBoolean(\"isBook\") == false)\r\n\t\t\treturn;\r\n\t\t\r\n\t\tNBTTagCompound\ttag\t\t= new NBTTagCompound();\r\n\t\tString \t\t\tauthor\t= storage.getString\t(\"book-author\"\t);\r\n\t\tString\t\t\ttitle\t= storage.getString\t(\"book-title\"\t);\r\n\t\tint\t\t\t\tpages\t= storage.getInteger(\"book-pages\"\t);\r\n\t\tNBTTagList\t\tlist\t= new NBTTagList();\r\n\t\t\r\n\t\tfor (int i = 0; i < pages; i++) {\r\n\t\t\tString\t\t\tsiteContent\t= storage.getString(\"book-page-\"+i);\r\n\t\t\tNBTTagString\ttString\t\t= new NBTTagString(siteContent);\r\n\t\t\t\r\n\t\t\ttString.data\t= siteContent;\r\n\t\t\t\r\n\t\t\tlist.add(tString);\r\n\t\t}\r\n\t\t\r\n\t\ttag.setString\t(\"author\", \tauthor);\r\n\t\ttag.setString\t(\"title\",\ttitle);\r\n\t\ttag.set\t\t\t(\"pages\", \tlist);\r\n\t\tsetNBTTagCompound(tag);\r\n\t}", "public void selectTag(String t) {\n\t\tif (!selectedTags.contains(t)) {\n\t\t\tthis.selectedTags.add(t);\n\t\t} else {\n\t\t\tSystem.out.println(\"Tag already selected!\");\n\t\t}\n\t}", "public void setData(Item i)\r\n\t{\r\n\t\ttheItem = i;\r\n\t}", "public void replaceKeyInEntry(int i, @NullableDecl K k, boolean z) {\n int i2;\n int i3;\n Preconditions.checkArgument(i != -1);\n int smearedHash = Hashing.smearedHash(k);\n int findEntryByKey = findEntryByKey(k, smearedHash);\n int i4 = this.lastInInsertionOrder;\n if (findEntryByKey == -1) {\n i2 = i4;\n i3 = -2;\n } else if (z) {\n i2 = this.prevInInsertionOrder[findEntryByKey];\n i3 = this.nextInInsertionOrder[findEntryByKey];\n removeEntryKeyHashKnown(findEntryByKey, smearedHash);\n if (i == this.size) {\n i = findEntryByKey;\n }\n } else {\n throw new IllegalArgumentException(\"Key already present in map: \" + k);\n }\n if (i2 == i) {\n i2 = this.prevInInsertionOrder[i];\n } else if (i2 == this.size) {\n i2 = findEntryByKey;\n }\n if (i3 == i) {\n findEntryByKey = this.nextInInsertionOrder[i];\n } else if (i3 != this.size) {\n findEntryByKey = i3;\n }\n setSucceeds(this.prevInInsertionOrder[i], this.nextInInsertionOrder[i]);\n deleteFromTableKToV(i, Hashing.smearedHash(this.keys[i]));\n this.keys[i] = k;\n insertIntoTableKToV(i, Hashing.smearedHash(k));\n setSucceeds(i2, i);\n setSucceeds(i, findEntryByKey);\n }", "public boolean replace(int j, String w){\n MyNode p=head;\n if((j<size)&&(j>=0)){//checks if the size is in array index limits\n for(int i=0;i<j;i++){//goes through the array till that locaiton i specified\n p=p.next;\n }\n p.next=new MyNode(w,p.next.next);//replaces with new node with string\n \n return true;\n }\n else\n return false;//returns false if index not valid\n }", "public void setMyTag(int theTag)\n\t{\n\t\tmyTag = theTag;\n\t}", "private void assignPairingStatus(ArrayList p_segment)\n {\n ArrayList tags = new ArrayList(p_segment);\n Object o1, o2;\n int i_start, i_end, i_max;\n int i_level, i_partner = 1;\n HtmlObjects.Tag t_start, t_tag;\n HtmlObjects.EndTag t_end;\n HtmlObjects.CFTag t_CFstart, t_CFtag;\n\n i_start = 0;\n i_max = tags.size();\n outer: while (i_start < i_max)\n {\n o1 = tags.get(i_start);\n\n if (o1 instanceof HtmlObjects.Tag)\n {\n t_start = (HtmlObjects.Tag) o1;\n\n // don't consider tags that are already closed (<BR/>)\n if (t_start.isClosed)\n {\n tags.remove(i_start);\n --i_max;\n continue outer;\n }\n\n // handle recursive tags\n i_level = 0;\n\n // see if the current opening tag has a closing tag\n for (i_end = i_start + 1; i_end < i_max; ++i_end)\n {\n o2 = tags.get(i_end);\n\n if (o2 instanceof HtmlObjects.Tag)\n {\n t_tag = (HtmlObjects.Tag) o2;\n\n if (t_start.tag.equalsIgnoreCase(t_tag.tag))\n {\n ++i_level;\n continue;\n }\n }\n else if (o2 instanceof HtmlObjects.EndTag)\n {\n t_end = (HtmlObjects.EndTag) o2;\n\n if (t_start.tag.equalsIgnoreCase(t_end.tag))\n {\n if (i_level > 0)\n {\n --i_level;\n continue;\n }\n\n // found a matching buddy in this segment\n t_start.isPaired = t_end.isPaired = true;\n t_start.partnerId = t_end.partnerId = i_partner;\n i_partner++;\n tags.remove(i_end);\n tags.remove(i_start);\n i_max -= 2;\n continue outer;\n }\n }\n }\n\n // done with this tag, don't consider again\n tags.remove(i_start);\n --i_max;\n continue outer;\n }\n else if (o1 instanceof HtmlObjects.CFTag)\n {\n t_CFstart = (HtmlObjects.CFTag) o1;\n\n // don't consider tags that are already closed (<BR/>)\n if (t_CFstart.isClosed)\n {\n tags.remove(i_start);\n --i_max;\n continue outer;\n }\n\n // handle recursive tags\n i_level = 0;\n\n // see if the current opening tag has a closing tag\n for (i_end = i_start + 1; i_end < i_max; ++i_end)\n {\n o2 = tags.get(i_end);\n\n if (o2 instanceof HtmlObjects.CFTag)\n {\n t_CFtag = (HtmlObjects.CFTag) o2;\n\n if (t_CFstart.tag.equalsIgnoreCase(t_CFtag.tag))\n {\n ++i_level;\n continue;\n }\n }\n else if (o2 instanceof HtmlObjects.EndTag)\n {\n t_end = (HtmlObjects.EndTag) o2;\n\n if (t_CFstart.tag.equalsIgnoreCase(t_end.tag))\n {\n if (i_level > 0)\n {\n --i_level;\n continue;\n }\n\n // found a matching buddy in this segment\n t_CFstart.isPaired = t_end.isPaired = true;\n t_CFstart.partnerId = t_end.partnerId = i_partner;\n i_partner++;\n tags.remove(i_end);\n tags.remove(i_start);\n i_max -= 2;\n continue outer;\n }\n }\n }\n\n // done with this tag, don't consider again\n tags.remove(i_start);\n --i_max;\n continue outer;\n }\n else if (!(o1 instanceof HtmlObjects.EndTag))\n {\n // don't consider non-tag tags in the list\n tags.remove(i_start);\n --i_max;\n continue outer;\n }\n\n ++i_start;\n }\n }", "private long read(int i) {\n while (true) {\n long x = data[i];\n if (!isTag(x)) return value(x);\n reset(i);\n }\n }", "public interface IRegexFinder {\n String getTag();\n\n // Put tag for a item in tiarray if the item match to a regex.\n default boolean putTagIfRegexFound(TaggedItemsArray tiarray) {\n Iterator<String> itr = tiarray.getIterator();\n boolean anyRegexFound = false;\n\n while (itr.hasNext()) {\n String item = itr.next();\n\n if (match(item)) {\n tiarray.modify(item, getTag());\n anyRegexFound = true;\n }\n }\n\n return anyRegexFound;\n }\n\n // Returns kind / name of regex finder.\n String whoAmI();\n\n boolean match(String toCheck);\n}", "protected static boolean write2Tag(GroupTagModel model, Tag tag)\n\t\t\tthrows IOException, FormatException, NfcTagException {\n\n\t\t// check id uniqueness\n\t\tif (null == model)\n\t\t\tthrow new NfcTagException(\n\t\t\t\t\tCommonTagErrors.ErrorMsg.TAG_MODEL_NOT_INIT);\n\n\t\tString id = model.getId();\n\n\t\t// throw exception in case user has not defined tag id.\n\t\tif (null == id || \"\".equals(model.getId()))\n\t\t\tthrow new NfcTagException(CommonTagErrors.ErrorMsg.TAG_ID_UNDEFINED);\n\n\t\t// id prefix check\n\t\tif (!id.startsWith(TagConstants.TAG_TYPE_GROUP_PREFIX))\n\t\t\tmodel.setId(TagConstants.TAG_TYPE_GROUP_PREFIX + model.getId());\n\n\t\t// finally create group tag\n\t\tNdefRecord records[] = new NdefRecord[NO_OF_RECORDS];\n\n\t\tshort index = 0;\n\t\trecords[index] = TextRecord.createRecord(model.getId());\n\t\trecords[++index] = TextRecord.createRecord(\"\" + model.getPermission());\n\n\t\t// explicitly converting integer to string to store into tags\n\t\trecords[++index] = TextRecord.createRecord(\"\" + model.getCapacity());\n\n\t\t// explicitly converting integer to string to store into tags\n\t\trecords[++index] = TextRecord.createRecord(\"\" + model.getOccupied());\n\t\trecords[++index] = TextRecord.createRecord(model.getData());\n\n\t\tNdefMessage group_msg = new NdefMessage(records);\n\t\tNfcReadWrite.writeToNfc(group_msg, tag);\n\t\treturn true;\n\t}", "protected /*override*/ void SetItem(int index, Condition item) \r\n {\r\n CheckSealed(); \r\n ConditionValidation(item); \r\n super.SetItem(index, item);\r\n }", "boolean removAble(InputItem item);", "private void saveMissingTagAndBiGram(){\n BiGram newBiGram;\n for(Tag tag1 : Tag.values()){\n if(!tagMap.containsKey(tag1))\n tagMap.put(tag1, (long)1);\n for (Tag tag2 :Tag.values()){\n newBiGram = new BiGram(tag1, tag2);\n if(!biGramMap.containsKey(newBiGram))\n biGramMap.put(newBiGram, (long)1);\n }\n }\n }", "private void checkTagInSet(String tag, int setNum, boolean useVictimCache) {\n\t\tList<String> list = sets.get(setNum);\n\t\t\n\t\tif(useVictimCache && list.size()==associativeNum) {\n\t\t\tint foundTagInCache = findTag(setNum, tag);\n\t\t\tif(foundTagInCache != -1) {\n\t\t\t\tlist.remove(foundTagInCache);\n\t\t\t\tlist.add(tag);\n\t\t\t\tnumHits++;\n\t\t\t} else { //check in victim cache\n\t\t\t\t\tint foundTagInVictim = vCache.findTag(tag);\n\t\t\t\t\tif(foundTagInVictim != -1) {\n\t\t\t\t\t//Swap this element with LRU element in CPU cache\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tString temp = list.remove(0);\n\t\t\t\t\t\tlist.add(tag);\n\t\t\t\t\t\tvCache.removeTag(foundTagInVictim);\n\t\t\t\t\t\tvCache.addToVCache(temp);\n\t\t\t\t\t\tnumHits++;\n\t\t\t}else { //Fetch from main memory into CPU cache and the block evicted from CPU cache\n\t\t\t\t\t// should be stored in victim cache\n\t\t\t\t\tif(list.size() == associativeNum) {\n\t\t\t\t\t\tvCache.addToVCache(list.remove(0));\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tlist.add(tag);\n\t\t\t\t\tnumMiss++;\n\t\t\t\t}\n\t\t\t}\n\t\t} else { //Not to use Victim Cache\n\t\t\t// Find the tag in the list and if found, remove it from its place and then insert it at the \n\t\t\t// end of list.\n\t\t\tint foundTagInCache = findTag(setNum, tag);\n\t\t\tif(foundTagInCache != -1) {\n\t\t\t\tlist.remove(foundTagInCache);\n\t\t\t\tnumHits++;\n\t\t\t} else { //insert the tag in the list\n\t\t\t\tif(list.size() == associativeNum) { // Use LRU policy to remove the oldest tag and insert new tag\n\t\t\t\t\t// at the end of list\n\t\t\t\t\tlist.remove(0);\n\t\t\t\t}\n\t\t\t\tnumMiss++;\n\t\t\t}\n\t\t\tlist.add(tag);\n\t\t}\n\t}", "public T set(int i, T t) {\n if (i < 0 || i >= size) // if there is no index i in list\n throw new IndexOutOfBoundsException(\"Treated index: \" + i + \" | Size of the Dynamic Array \" + size()); // cause IndexOutOfBoundException\n T previousValue = (T) elements[i]; // store previous value of element with index i\n elements[i] = t; // set element with index i to t\n return previousValue; // return previous value of element with index i\n }", "private void updateIfNeeded(int i, int j, int newVal) {\n\t\tint value = buffer.get(i, j);\n\t\tif (newVal < value) {\n\t\t\tbuffer.set(i, j, newVal);\n\t\t}\n\t}", "@Override\r\n\tpublic void addTag(String photoId, String tagType, String tagValue) {\r\n\t\tList<IAlbum> albums=model.getUser(userId).getAlbums();\r\n\t\tIPhoto getMe=null;\r\n\t\tboolean working=false;\r\n\t\t/*for only the current photo*/\r\n\t/*\tIAlbum temp= photoListGui.getCurrentAlbum();\r\n\t\tList<IPhoto> photoList=temp.getPhotoList();\r\n\t\tInteractiveControl.PhotoCompareForNames comparePower2=new InteractiveControl.PhotoCompareForNames();\r\n\t\tCollections.sort(photoList, comparePower2);\r\n\t\t\t\tint index=Collections.binarySearch(photoList, photoId);\r\n\t\t\tif(index>=0){\r\n\t\t\t\tgetMe=photoList.get(index);\r\n\t\t\t\tswitch(tagType.toLowerCase()){\r\n\t\t\t\tcase \"location\": \r\n\t\t\t\t\tString check=getMe.getLocationTag();\r\n\t\t\t\t\tif((check==null|| check.isEmpty())){\r\n\t\t\t\t\t\tgetMe.setLocationTag(tagValue);\r\n\t\t\t\t\t\tString success=\"Added tag:\\n\"+photoId+\"\\n\"+tagType+\":\"+tagValue+\"\";\r\n\t\t\t\t\t\tsetErrorMessage(success);\t\r\n\t\t\t\t\t\tshowError();\r\n\t\t\t\t\t\tphotoListGui.setLocationTagLabel(tagValue);\r\n\t\t\t\t\t\tworking=true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(!check.isEmpty()){\r\n\t\t\t\t\t\tJButton showTextButton=new JButton();\r\n\t\t\t\t\t\tString error=\"Tag already exists for \"+photoId+\" \"+tagType+\":\"+tagValue+\"\";\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(showTextButton,error);\r\n\t\t\t\t\t\tcallTagGui((Photo)getMe);\r\n\t\t\t\t\t\tsetErrorMessage(error);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(!(check.equals(tagValue))){\r\n\t\t\t\t\t\tgetMe.setLocationTag(tagValue);\r\n\t\t\t\t\t\tString success=\"Added tag:\\n\"+photoId+\"\\n\"+tagType+\":\"+tagValue+\"\";\r\n\t\t\t\t\t\tsetErrorMessage(success);\r\n\t\t\t\t\t\tJButton showTextButton=new JButton();\r\n\t\t\t\t\t\tshowError();String error=\"Tag already exists for \"+photoId+\" \"+tagType+\":\"+tagValue+\"\";\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(showTextButton,error);\r\n\t\t\t\t\t\tcallTagGui((Photo)getMe);\r\n\t\t\t\t\t\tsetErrorMessage(error);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tString error=\"Tag already exists for \"+photoId+\" \"+tagType+\":\"+tagValue+\"\";\r\n\t\t\t\t\t\tsetErrorMessage(error);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\tcase \"person\":\r\n\t\t\t\t\tif(getMe.getPeopleTags().contains(tagValue)){\r\n\t\t\t\t\t\tString error=\"Tag already exists for \"+photoId+\" \"+tagType+\":\"+tagValue+\"\";\r\n\t\t\t\t\t\tJButton showTextButton=new JButton();\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(showTextButton,error);\r\n\t\t\t\t\t\tcallTagGui((Photo)getMe);\r\n\t\t\t\t\t\tsetErrorMessage(error);\r\n\t\t\t\t\t\tshowError();\t\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgetMe.personTag(tagValue);\r\n\t\t\t\t\tString success2=\"Added tag:\\n\"+photoId+\"\\n\"+tagType+\":\"+tagValue+\"\";\r\n\t\t\t\t\tsetErrorMessage(success2);\r\n\t\t\t\t\tshowError();\r\n\t\t\t\t\tphotoListGui.updateTagList();\r\n\t\t\t\t\tbreak; \r\n\t\t\t\tdefault:\r\n\t\t\t\t\tString error=\"Error: Not a real tag\";\r\n\t\t\t\t\tsetErrorMessage(error);\r\n\t\t\t\t\tshowError();\t\r\n\t\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t}*/\r\n\t\t/*below if for all the photos*/\r\n\t\touterLoop:\r\n\t\tfor (int i=0; i<model.getUser(userId).getAlbums().size(); i++){\r\n\t\t\tIAlbum temp= albums.get(i);\r\n\t\t\tList<IPhoto> photoList=temp.getPhotoList();\r\n\t\t\tInteractiveControl.PhotoCompareForNames comparePower2=new InteractiveControl.PhotoCompareForNames();\r\n\t\t\tCollections.sort(photoList, comparePower2);\r\n\t\t\t\t\tint index=Collections.binarySearch(photoList, photoId);\r\n\t\t\t\tif(index>=0){\r\n\t\t\t\t\tgetMe=photoList.get(index);\r\n\t\t\t\t\tswitch(tagType.toLowerCase()){\r\n\t\t\t\t\tcase \"location\": \r\n\t\t\t\t\t\tString check=getMe.getLocationTag();\r\n\t\t\t\t\t\tif((check==null|| check.isEmpty())){\r\n\t\t\t\t\t\t\tgetMe.setLocationTag(tagValue);\r\n\t\t\t\t\t\t\tString success=\"Added tag:\\n\"+photoId+\"\\n\"+tagType+\":\"+tagValue+\"\";\r\n\t\t\t\t\t\t\tsetErrorMessage(success);\t\r\n\t\t\t\t\t\t\tshowError();\r\n\t\t\t\t\t\t\tphotoListGui.setLocationTagLabel(tagValue);\r\n\t\t\t\t\t\t\tworking=true;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(!check.isEmpty()){\r\n\t\t\t\t\t\t\tJButton showTextButton=new JButton();\r\n\t\t\t\t\t\t\tString error=\"Tag already exists for \"+photoId+\" \"+tagType+\":\"+tagValue+\"\";\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(showTextButton,error);\r\n\t\t\t\t\t\t\tcallTagGui((Photo)getMe);\r\n\t\t\t\t\t\t\tsetErrorMessage(error);\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(!(check.equals(tagValue))){\r\n\t\t\t\t\t\t\tgetMe.setLocationTag(tagValue);\r\n\t\t\t\t\t\t\tString success=\"Added tag:\\n\"+photoId+\"\\n\"+tagType+\":\"+tagValue+\"\";\r\n\t\t\t\t\t\t\tsetErrorMessage(success);\r\n\t\t\t\t\t\t\tJButton showTextButton=new JButton();\r\n\t\t\t\t\t\t\tshowError();String error=\"Tag already exists for \"+photoId+\" \"+tagType+\":\"+tagValue+\"\";\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(showTextButton,error);\r\n\t\t\t\t\t\t\tcallTagGui((Photo)getMe);\r\n\t\t\t\t\t\t\tsetErrorMessage(error);\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\tString error=\"Tag already exists for \"+photoId+\" \"+tagType+\":\"+tagValue+\"\";\r\n\t\t\t\t\t\t\tsetErrorMessage(error);\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tcase \"person\":\r\n\t\t\t\t\t\tif(getMe.getPeopleTags().contains(tagValue)){\r\n\t\t\t\t\t\t\tString error=\"Tag already exists for \"+photoId+\" \"+tagType+\":\"+tagValue+\"\";\r\n\t\t\t\t\t\t\tJButton showTextButton=new JButton();\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(showTextButton,error);\r\n\t\t\t\t\t\t\tcallTagGui((Photo)getMe);\r\n\t\t\t\t\t\t\tsetErrorMessage(error);\r\n\t\t\t\t\t\t\tshowError();\t\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tgetMe.personTag(tagValue);\r\n\t\t\t\t\t\tString success2=\"Added tag:\\n\"+photoId+\"\\n\"+tagType+\":\"+tagValue+\"\";\r\n\t\t\t\t\t\tsetErrorMessage(success2);\r\n\t\t\t\t\t\tshowError();\r\n\t\t\t\t\t\tphotoListGui.updateTagList();\r\n\t\t\t\t\t\tbreak; \r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tString error=\"Error: Not a real tag\";\r\n\t\t\t\t\t\tsetErrorMessage(error);\r\n\t\t\t\t\t\tshowError();\t\r\n\t\t\t\t\t\treturn ;\r\n\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t}\r\n\t\tif(getMe==null){\r\n\t\t\tString error=\"Photo \"+photoId+\" does not exist\";\r\n\t\t\tsetErrorMessage(error);\r\n\t\t\tshowError();\t\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t/*random guesses atm in how to access these data structures*/\r\n\t\t\r\n\t\t/*if(check.equals(tagType)){\r\n\t\t\tString error=\"Tag already exists for <\"+photoId+\"> <\"+tagType+\":<\"+tagValue+\">\";\r\n\t\t\tcmd.setErrorMessage(error);\r\n\t\t\tcmd.showError();\r\n\t\t}\r\n\t\tgetMe.setTagInjective(check);\r\n\t\tString success=\"Added tag:\\n<\"+photoId+\"> <\"+tagType+\">:<\"+tagValue+\">\";\r\n\t\tcmd.setErrorMessage(success);\r\n\t\tcmd.showError();*/\r\n\t}", "public int replace (byte[] buffer, int oldTag, Params params)\n throws IOException,IllegalArgumentException\n {\n return replaceTagPar (buffer, 0, buffer.length, oldTag, params);\n }", "private void setElement(int index, E element) {\n// if (getElement(index) != null) {\n// setContents.remove(getElement(index));\n// }\n while (index >= contents.size()) {\n contents.add(null);\n }\n contents.set(index, element);\n// contents.put(index, element);\n backwards.put(element, index);\n\n// if (element != null) {\n// setContents.add(getElement(index));\n// }\n }", "public void visit(int i) {\r\n visited[i] = visitedToken;\r\n }", "void processTag(XMLNode tag) throws Exception {\n if(tag.type()== XMLNode.Type.TAG){\n state.traceTagBegin(tag.getTag()==null?\"process\":tag.getTag(),null);\n tagstk[tagstkptr++] = tag.getTag();\n \n dataloader.beginTag(tagstk, tagstkptr, tag.getTag(), tag.getAttribs());\n if(tag.getTags()!= null) for(XMLNode nextTag : tag.getTags()){\n processTag(nextTag);\n }\n ((LoadDatamapData)dataloader).endTag(tagstk, tagstkptr, tag, tag.getBody(), tag.getAttribs());\n \n tag.clearRef();\n \n tagstkptr--;\n tagstk[tagstkptr]= null;\n state.traceTagEnd();\n }\n }", "public void adjustItem(int i, View view, boolean z) {\n int i2;\n ViewGroup.LayoutParams layoutParams = view.getLayoutParams();\n if (i == this.mSrcPos || i == this.mFirstExpPos || i == this.mSecondExpPos) {\n i2 = calcItemHeight(i, view, z);\n } else {\n i2 = -2;\n }\n if (i2 != layoutParams.height) {\n layoutParams.height = i2;\n view.setLayoutParams(layoutParams);\n }\n if (i == this.mFirstExpPos || i == this.mSecondExpPos) {\n if (i < this.mSrcPos) {\n ((DragSortItemView) view).setGravity(80);\n } else if (i > this.mSrcPos) {\n ((DragSortItemView) view).setGravity(48);\n }\n }\n int visibility = view.getVisibility();\n int i3 = 0;\n if (i == this.mSrcPos && this.mFloatView != null) {\n i3 = 4;\n }\n if (i3 != visibility) {\n view.setVisibility(i3);\n }\n }", "public native String replaceItem(String newItem, Number index);", "private void addTagName(TagHolder holder, List<CommonToken> tokens, int tokenIndex) \n\t{\n\t\ttokenIndex++;\n\t\tfor (;tokenIndex<tokens.size(); tokenIndex++)\n\t\t{\n\t\t\tCommonToken tok=tokens.get(tokenIndex);\n\t\t\tif (tok.getType()==MXMLLexer.GENERIC_ID)\n\t\t\t{\n\t\t\t\tholder.setTagName(tok.getText());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (tok.getText()!=null && tok.getText().trim().length()>0)\n\t\t\t{\n\t\t\t\t//kick out if non whitespace hit; ideally, we shouldn't ever hit here\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public void changeHasTagBoost()\r\n\t{\r\n\t\thasTagBoost = !hasTagBoost;\r\n\t}", "public void setToTag(String tag) throws ParseException,NullPointerException;", "private void checkOffsetOrImageTag(ExifTag tag) {\n // Some invalid formattd image contains tag with 0 size.\n if (tag.getComponentCount() == 0) {\n return;\n }\n short tid = tag.getTagId();\n int ifd = tag.getIfd();\n if (tid == TAG_EXIF_IFD && checkAllowed(ifd, ExifInterface.TAG_EXIF_IFD)) {\n if (isIfdRequested(IfdId.TYPE_IFD_EXIF)\n || isIfdRequested(IfdId.TYPE_IFD_INTEROPERABILITY)) {\n registerIfd(IfdId.TYPE_IFD_EXIF, tag.getValueAt(0));\n }\n } else if (tid == TAG_GPS_IFD && checkAllowed(ifd, ExifInterface.TAG_GPS_IFD)) {\n if (isIfdRequested(IfdId.TYPE_IFD_GPS)) {\n registerIfd(IfdId.TYPE_IFD_GPS, tag.getValueAt(0));\n }\n } else if (tid == TAG_INTEROPERABILITY_IFD\n && checkAllowed(ifd, ExifInterface.TAG_INTEROPERABILITY_IFD)) {\n if (isIfdRequested(IfdId.TYPE_IFD_INTEROPERABILITY)) {\n registerIfd(IfdId.TYPE_IFD_INTEROPERABILITY, tag.getValueAt(0));\n }\n } else if (tid == TAG_JPEG_INTERCHANGE_FORMAT\n && checkAllowed(ifd, ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT)) {\n if (isThumbnailRequested()) {\n registerCompressedImage(tag.getValueAt(0));\n }\n } else if (tid == TAG_JPEG_INTERCHANGE_FORMAT_LENGTH\n && checkAllowed(ifd, ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT_LENGTH)) {\n if (isThumbnailRequested()) {\n mJpegSizeTag = tag;\n }\n } else if (tid == TAG_STRIP_OFFSETS && checkAllowed(ifd, ExifInterface.TAG_STRIP_OFFSETS)) {\n if (isThumbnailRequested()) {\n if (tag.hasValue()) {\n for (int i = 0; i < tag.getComponentCount(); i++) {\n if (tag.getDataType() == ExifTag.TYPE_UNSIGNED_SHORT) {\n registerUncompressedStrip(i, tag.getValueAt(i));\n } else {\n registerUncompressedStrip(i, tag.getValueAt(i));\n }\n }\n } else {\n mCorrespondingEvent.put(tag.getOffset(), new ExifTagEvent(tag, false));\n }\n }\n } else if (tid == TAG_STRIP_BYTE_COUNTS\n && checkAllowed(ifd, ExifInterface.TAG_STRIP_BYTE_COUNTS)\n && isThumbnailRequested() && tag.hasValue()) {\n mStripSizeTag = tag;\n }\n }", "public int replace (byte[] buffer, int oldTag, int newTag, short priority, long enqueueTimeout, long retryTimeout)\n throws IOException,IllegalArgumentException\n {\n return replaceTagPrioEnqueRetr (buffer, 0, buffer.length, oldTag, newTag, priority, enqueueTimeout, retryTimeout);\n }", "int insertSelective(GrpTagKey record);", "private void moveTileItemToOther(int i) {\n if (this.mTiles.size() > this.mSpanCount * 2) {\n ((SystemUIStat) Dependency.get(SystemUIStat.class)).handleControlCenterEvent(new QuickTilesRemovedEvent(this.mTiles.get(i).spec));\n this.mQSControlCustomizer.addInTileAdapter(this.mTiles.get(i), false);\n this.mTiles.remove(i);\n notifyItemRemoved(i);\n saveSpecs(this.mHost, false);\n }\n }", "public int replace (boolean reliable, boolean sequenced,\n byte[] buffer,\n int offset, int length,\n int oldTag, int newTag,\n short priority,\n long enqueueTimeout, long retryTimeout)\n throws IOException,IllegalArgumentException,IndexOutOfBoundsException\n {\n if (offset < 0) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n if (length < 0) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n if ((offset + length) > buffer.length) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n return replaceNative (reliable, sequenced, buffer, offset, length,oldTag, newTag, priority, enqueueTimeout, retryTimeout);\n }", "@Override\n\tpublic void replace(Object data, int index) throws IndexOutOfBoundsException {\n\t\t// Check for valid size first\n\t\tif (index > this.size() || index < 0) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\n\t\t// traverse through list\n\t\tNode current = head;\n\t\tint currentIndexPosistion = 0;\n\n\t\twhile (!(current == null) && currentIndexPosistion < index) {\n\t\t\tcurrentIndexPosistion++;\n\t\t\tcurrent = current.getNext();\n\t\t}\n\t\tcurrent.setElement(data);\n\t}", "public void setTag(Object tag)\n {\n fTag = tag;\n }", "private void checkToList(ItemData itemMain) {\n int index = 0;\n for (ItemData i : itemDataList){\n int loc = Integer.parseInt(i.getscore().toString());\n int var = Integer.parseInt(itemMain.getscore().toString());\n if(var < 10 && loc == 0){\n itemMain.setimagePosition(i.getimagePosition());\n itemDataList.add(index,itemMain);\n /*\n Collections.sort(itemDataList, new Comparator<ItemData>() {\n @Override\n public int compare(ItemData t0, ItemData t1) {\n int loc = Integer.parseInt(t0.getscore().toString());\n int var = Integer.parseInt(t1.getscore().toString());\n return var - loc;\n }\n });\n */\n break;\n }\n index++;\n }\n\n }", "public abstract boolean prependVisibleItems(int i, boolean z);", "<E> void poke(ArrayList<E> list, int pos, E val) {\n for (int i = list.size(); i <= pos; ++i) {\n list.add(i, null);\n }\n list.set(pos, val);\n }", "@Override\n public E set(int i, E e) throws IndexOutOfBoundsException {\n checkRange(i);\n E previousValue = get(i);\n\n if (size == 1) {\n storage = e;\n } else if (size <= 5) {\n ((E[]) storage)[i] = e;\n } else {\n ((ArrayList<E>) storage).set(i, e);\n }\n\n return previousValue;\n }", "public void setImageViewTagUnique(boolean unique) {\r\n\t\tmIsTagUnique = unique;\r\n\t}", "public boolean set(O o, int index)\r\n {\r\n if (index >= count || index < 0) return false;\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=index-1;i++)\r\n {\r\n vi = vi.getNext();\r\n }\r\n \r\n vi.setObject(o);\r\n return true;\r\n \r\n }", "public int replace (byte []buffer, int offset, int length, int oldTag, int newTag, short priority, long enqueueTimeout, long retryTimeout)\n throws IOException,IllegalArgumentException,IndexOutOfBoundsException\n {\n if (offset < 0) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n if (length < 0) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n if ((offset + length) > buffer.length) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n return replaceTagPrioEnqueRetr (buffer, offset, length, oldTag, newTag, priority, enqueueTimeout, retryTimeout);\n }", "public void swapItemFromInventoryToOther(@NotNull Usable item, Usable other) {\n for (int i = 0; i < size; i++) {\n if (item == items[i]) {\n this.removeItem(i);\n if (other != null) {\n this.setItem(other, i);\n }\n return;\n }\n }\n }", "public void addTag(Tag t);", "boolean replace(int pos, SNode node);", "public int replace (byte[] buffer, int oldTag, int newTag)\n throws IOException,IllegalArgumentException\n {\n return replaceNative (buffer, 0, buffer.length, oldTag, newTag);\n }", "private static void notifyListenersOfTag(Tag tag){\n ArrayList<TagListener> listenersOfTag = tagListeners.get(tag);\n if(listenersOfTag!=null){\n for(TagListener listener : listenersOfTag){\n try {\n listener.onTagUpdated(tag);\n }catch (NullPointerException e){\n e.printStackTrace();\n }\n }\n }\n }", "@Override\n\tprotected String openTag(String tag) {\n\t\t// store position of parser for openening tag only if\n\t\t// it the first openened, e.g. <b>text<b>text2</b> will draw\n\t\t// text and text2 in bold weight\n\t\tif (!tags.containsKey(tag)) {\n\t\t\ttags.put(tag, Integer.valueOf(clearedText.length()));\n\t\t}\n\t\treturn \"\";\n\t}", "public final /* synthetic */ void mo85411a(int i, MicroAppInfo microAppInfo, String str) {\n if (i != 0) {\n this.f86955a.remove(i);\n this.f86955a.add(0, microAppInfo);\n notifyDataSetChanged();\n }\n }", "public static void freeTag(int tag) {\n\t\tsynchronized (reservedTags) {\n\t\t\treservedTags.remove((Integer) tag);\n\t\t}\n\t}" ]
[ "0.6807356", "0.63077456", "0.6099721", "0.5926232", "0.58388346", "0.58203155", "0.5551731", "0.54535824", "0.53564084", "0.5351927", "0.53518456", "0.53187037", "0.5305047", "0.5295269", "0.5292731", "0.52396405", "0.52059925", "0.51353705", "0.50580555", "0.5053795", "0.5046071", "0.5000176", "0.4957327", "0.49324748", "0.49135855", "0.48926365", "0.4887879", "0.4875361", "0.48750663", "0.48656094", "0.48548666", "0.48490047", "0.48481634", "0.48436552", "0.48247546", "0.4820939", "0.48003048", "0.4799533", "0.47989547", "0.479572", "0.47944987", "0.47815248", "0.47697774", "0.47591254", "0.47416955", "0.47369018", "0.47312406", "0.47150156", "0.47147092", "0.4713454", "0.47116816", "0.47115478", "0.4708288", "0.46992788", "0.46903512", "0.46798038", "0.46795502", "0.46725145", "0.4670185", "0.4667859", "0.4660329", "0.46536955", "0.4652707", "0.4652293", "0.4631192", "0.46306434", "0.46178925", "0.4617483", "0.46142033", "0.46062043", "0.45998618", "0.45959234", "0.45909956", "0.45891482", "0.4586086", "0.45816857", "0.45672446", "0.45658764", "0.4565705", "0.45627135", "0.45612454", "0.45485452", "0.45478383", "0.45463783", "0.4539147", "0.45304245", "0.45274884", "0.45273453", "0.45233133", "0.45191655", "0.45144346", "0.4513889", "0.45089924", "0.45058078", "0.45004714", "0.44964778", "0.44946814", "0.44845277", "0.4482648", "0.44795474", "0.44741446" ]
0.0
-1
Load linked value at i. 1. Increment current tag. 2. Read value at i. 3. Save the value. 4. Try replacing it with tag. 5. Otherwise, retry.
private long ll(int i) { while (true) { incTag(); long x = read(i); save[th()] = x; if (cas(i, x, tag[th()])) return x; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private long read(int i) {\n while (true) {\n long x = data[i];\n if (!isTag(x)) return value(x);\n reset(i);\n }\n }", "private void incTag() {\n long id = tagId(tag[th()]); // 1\n tag[th()] = newTag(id+1); // 2\n }", "private void reset(int i) {\n long x = data[i];\n if (isTag(x))\n cas(i, x, save[threadId(x)]);\n }", "private void saveTag(Tag tag){\n Long num = tagMap.get(tag);\n tagMap.put(tag, (num == null) ? (long)1 : num+1);\n }", "private void findNewNextInStack() {\n if (stack.empty()) {\n next = Chunk.NONE;\n return;\n }\n next = stack.pop();\n long valueReference = INVALID_VALUE_REFERENCE;\n if (next != Chunk.NONE) {\n valueReference = getEntryFieldLong(next, OFFSET.VALUE_REFERENCE);\n }\n while (next != Chunk.NONE && valueReference == INVALID_VALUE_REFERENCE) {\n if (!stack.empty()) {\n next = stack.pop();\n if (next != Chunk.NONE) {\n valueReference = getEntryFieldLong(next, OFFSET.VALUE_REFERENCE);\n }\n } else {\n next = Chunk.NONE;\n return;\n }\n }\n }", "public static void setNumber(RandomAccessFile raf, int i, int value) throws IOException {\n raf.seek(4 * i);\n raf.writeInt(value);\n }", "public void modify(int i, long value) {\n tree[i + N] = function(tree[i + N], value);\n for (i += N; i > 1; i >>= 1) {\n tree[i >> 1] = function(tree[i], tree[i ^ 1]);\n }\n }", "protected void assignCurrentValue() {\n\t\tcurrentValue = new Integer(counter + incrValue);\n\t}", "@Override\n public void update(int i, E value) {\n if(!hasWork()) {\n throw new NoSuchElementException();\n }\n if(i < 0 || i >= size()) {\n throw new IndexOutOfBoundsException();\n }\n array[(front + i) % capacity()] = value;\n }", "public amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value insertNewValue(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value target = null;\n target = (amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value)get_store().insert_element_user(VALUE$0, i);\n return target;\n }\n }", "public void loadObject(long i, O object) throws OBException {\r\n try{\r\n byte[] data = A.getValue(i);\r\n object.load(data);\r\n }catch(IOException e){\r\n throw new OBStorageException(e);\r\n }\r\n }", "public void removeValue(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(VALUE$0, i);\n }\n }", "public void update(int i, int val) {\n tree.updateTree(tree.root, i, val);\n }", "public void add(int i) {\n\t\t\tthis.val =i;\n\t\t\t\n\t\t}", "public long get(int i) {\n return read(i);\n }", "public void addValue(int i) {\n value = value + i;\n }", "@Override // ohos.com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase\r\n public int getNextNodeIdentity(int i) {\r\n int i2 = i + 1;\r\n while (i2 >= this.m_size) {\r\n if (this.m_incrementalSAXSource == null) {\r\n return -1;\r\n }\r\n nextNode();\r\n }\r\n return i2;\r\n }", "public T get(int i) {\n // we add values.length to head-i to avoid negative indices\n return values[(head-i+values.length) % values.length];\n }", "void set(int i, int val) {\n int numPosition = i / MAX_BITS;\n int intPosition = i % MAX_BITS;\n\n if (val == 1)\n values[numPosition] |= (1 << intPosition);\n else\n values[numPosition] = values[numPosition]&~(1 << intPosition);\n }", "public void put(DNA key, long value) {\n total_in++;\n if(this.debug)\n System.out.println(\"ExtHash::put >> insertando cadena: \" + key.toString() + \", hashCode: \" + key.hashCode());\n\n Node actual_node = this.getReference(key);\n if(this.debug)\n System.out.println(\"ExtHash::put >> altura del nodo: \" + actual_node.getAltura());\n\n int reference_page = actual_node.getReference();\n ArrayList<Integer> content = this.fm.read(reference_page); this.in_counter++;\n\n int last_page = reference_page;\n ArrayList<Integer> last_content = content;\n\n int total_elements = 0, altura = actual_node.getAltura();\n while(true) {\n\n if(this.debug)\n System.out.println(\"ExtHash::put >> referencia a pagina: \" + reference_page);\n\n if(this.debug) {\n System.out.println(\"ExtHash::put >> contenido de la pagina:\");\n for(int i=0; i<content.size(); i++)\n System.out.println(\" \" + content.get(i));\n }\n\n total_elements += last_content.get(0);\n if(last_content.get(0) != B-2) {\n if(this.debug)\n System.out.println(\"ExtHash::put >> insertando en: \" + last_page);\n\n ArrayList<Integer> new_content = new ArrayList<>();\n\n new_content.add(last_content.get(0) + 1);\n for(int i=1; i<=last_content.get(0); i++)\n new_content.add(last_content.get(i));\n\n new_content.add(key.hashCode());\n\n if(new_content.get(0) == B-2) {\n total_active_block++;\n new_content.add(this.last);\n\n ArrayList<Integer> last = new ArrayList<>();\n last.add(0);\n this.fm.write(last, this.last); this.out_counter++;\n\n this.last++;\n\n }\n\n if(this.debug) {\n System.out.println(\"ExtHash::put >> contenido en pagina despues de insercion:\");\n for(int i=0; i<new_content.size(); i++)\n System.out.println(\" \" + new_content.get(i));\n }\n\n this.fm.write(new_content, reference_page); this.out_counter++;\n\n total_elements++; // por el elmento que se inserto.\n break;\n\n }\n if(this.debug)\n System.out.println(\"ExtHash::put >> acceciendo a siguiente pagina\");\n\n last_page = last_content.get(B-1);\n last_content = this.fm.read(last_page); this.in_counter++;\n }\n\n // se lleno la pagina y aun no se llega al final del hashing.\n if(total_elements >= B - 2 && altura < 30){\n if(this.debug)\n System.out.println(\"ExtHash::put >> limite de pagina, iniciando duplicacion\");\n\n this.duplicate(actual_node);\n }\n }", "protected void modify(int i) {\n\n\t\tvalue += i;\n\t\tlabel.setText(Integer.toString(value));\n\t\t\n\t}", "public void read(Integer i) {\n\n Object[][] obj = readItems(i);\n\n for (View v : views) {\n v.update(obj);\n }\n\n }", "public void replaceValueInEntry(int i, @NullableDecl V v, boolean z) {\n Preconditions.checkArgument(i != -1);\n int smearedHash = Hashing.smearedHash(v);\n int findEntryByValue = findEntryByValue(v, smearedHash);\n if (findEntryByValue != -1) {\n if (z) {\n removeEntryValueHashKnown(findEntryByValue, smearedHash);\n if (i == this.size) {\n i = findEntryByValue;\n }\n } else {\n throw new IllegalArgumentException(\"Value already present in map: \" + v);\n }\n }\n deleteFromTableVToK(i, Hashing.smearedHash(this.values[i]));\n this.values[i] = v;\n insertIntoTableVToK(i, smearedHash);\n }", "public void set(int i, long v) {\n data[i] = newValue(v);\n }", "public void setValue(String val, int idx) {\n lock.lock();\n try {\n binData[idx] = val;\n data[idx].add(val);\n }\n finally {\n lock.unlock();\n }\n }", "public void push(int value){\n //To be written by student\n localSize++;\n top++;\n if(localSize>A.getSize()){\n A.doubleSize();\n try{\n A.modifyElement(value,top);\n }catch(Exception c){c.printStackTrace();}\n }\n else{try{\n A.modifyElement(value,top);\n }catch(Exception a){a.printStackTrace();} }\n }", "public void loadValue() {\n int loadInt = assignedDataObject.getInt(name);\n Integer iv = new Integer(loadInt);\n editBeginValue = iv.toString();\n if (!showZero & loadInt == 0) editBeginValue = \"\";\n if (loadInt == 0 & assignedDataObject.getMode() == DataObject.INSERTMODE) editBeginValue = new Integer(defaultValue).toString();\n this.setText(editBeginValue);\n }", "public int addValue(int i) {\n return foldIn(i);\n }", "public void put(int key, int value) {\n int hashCode = key%nodes.length;\n if (nodes[hashCode]==null)\n nodes[hashCode] = new ListNode(-1,-1);\n ListNode pre = findPrev(key);\n if (pre.next==null){\n pre.next = new ListNode(key,value);\n size++;\n }\n else\n pre.next.val = value;\n\n if (size/nodes.length>LOAD_FACTOR){\n rehash();\n }\n }", "public void insert(String i) {\n if (c == null) {\n c = new btNode(i, null, null);\n how_many++;\n return;\n }\n\n btNode p = c;\n btNode prev = p;\n while (p != null && !p.info.equals(i)) {\n prev = p;\n if (p.info.compareTo(i) < 0) {\n p = p.rt;\n } else {\n p = p.lt;\n }\n }\n\n if (p == null) {\n if (prev.info.compareTo(i) < 0) {\n prev.rt = new btNode(i, null, null);\n } else {\n prev.lt = new btNode(i, null, null);\n }\n how_many++;\n } else {\n p.how_many++;\n }\n }", "public SkipListNode<K> setNext(int i, SkipListNode<K> node)\n {\n\treturn next.set(i,node);\n }", "private void UpdateAddNestedValue(){\n notebookRef.document(\"IpWOjXtIgGJ2giKF4VTp\")\r\n// .update(KEY_Tags+\".tag1\", false);\r\n\r\n // ****** For Practice If we have nested over nested values likke:\r\n // tags-> tag1-> nested_tag-> nested_tag2 :true we write like\r\n .update(\"tags.tag1.nested_tag.nested_tag2\", true);\r\n\r\n }", "@Override\n public void update(int i, E value) {\n if(!hasWork()) {\n throw new NoSuchElementException(\"The worklist is empty\");\n }\n // if i is less than 0 or greater than size of worklist, throw exception\n if(i < 0 || i >= array.length) {\n throw new IndexOutOfBoundsException(\"This index does not exist\");\n }\n // update value\n array[i] = value;\n }", "public void setData(int i, int value) {\n data[i] = value;\n }", "public void pushBack(int val) {\n\n\t\tDLNode a;\n\t\tif (val == Integer.MIN_VALUE) {\n\t\t\ta = new DLNode();\n\t\t} else {\n\t\t\ta = new DLNode(val);\n\t\t}\n\t\tif (head == null) {\n\t\t\thead = tail = a;\n\t\t\tif (a.val == Integer.MIN_VALUE) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telements++;\n\t\t\treturn;\n\t\t}\n\t\ta.prev = tail;\n\t\ttail.next = a;\n\t\ttail = a;\n\t\tif (a.val == Integer.MIN_VALUE) {\n\t\t\treturn;\n\t\t}\n\t\telements++;\n\n\t}", "@Override\n public E set(int i, E e) throws IndexOutOfBoundsException {\n checkRange(i);\n E previousValue = get(i);\n\n if (size == 1) {\n storage = e;\n } else if (size <= 5) {\n ((E[]) storage)[i] = e;\n } else {\n ((ArrayList<E>) storage).set(i, e);\n }\n\n return previousValue;\n }", "private void loadOldTags() throws IOException {\n File fileAnnotation = new File(filePathAnnDestination);\n if (!fileAnnotation.exists()) {\n fileAnnotation.createNewFile();\n }\n FileReader fr = new FileReader(fileAnnotation);\n\n\n\n\n BufferedReader br = new BufferedReader(fr);\n String line;\n\n while ((line = br.readLine()) != null) {\n String[] annotations = line.split(\"[ \\t]\");\n String word = line.substring(line.lastIndexOf('\\t') + 1);\n String[] words = word.split(\" \");\n\n int start = Integer.parseInt(annotations[2]);\n if (words.length != 0) {\n for (int i = 0; i < words.length; i++) {\n int end = start + words[i].length();\n taggedItems.put(start + \"-\" + end, annotations[1]);\n System.out.println(\"Loading old tags: \" + start + \"-\" + end + \"\\t\" + annotations[1]);\n start = end + 1;\n }\n }\n taggedItems.put(annotations[2] + \"-\" + annotations[3], annotations[1]);\n\n noOfTagsAlready = Integer.parseInt(annotations[0].substring(1));\n if (noOfTagsAlreadyMax < noOfTagsAlready)\n noOfTagsAlreadyMax = noOfTagsAlready;\n }\n br.close();\n fr.close();\n System.out.println(\"Loaded tags\");\n }", "void loadNext();", "private int setValue(final PdfObject pdfObject,int i, final byte[] raw, final int length, final boolean map) {\n final boolean ignoreRecursion=pdfObject.ignoreRecursion();\n \n if(debugFastCode) {\n System.out.println(padding + pdfObject.getObjectRefAsString() + \" =================Reading value for key=\" + PDFkey + \" (\" + PDFkeyInt + \") type=\" + PdfDictionary.showAsConstant(pdfKeyType) + \" ignorRecursion=\" + ignoreRecursion + ' ' + pdfObject);\n }\n \n //resolve now in this case as we need to ensure all parts present\n if(pdfKeyType==PdfDictionary.VALUE_IS_UNREAD_DICTIONARY && pdfObject.isDataExternal()) {\n pdfKeyType = PdfDictionary.VALUE_IS_DICTIONARY;\n }\n \n \n switch(pdfKeyType){\n \n //read text stream (this is text) and also special case of [] in W in CID Fonts\n case PdfDictionary.VALUE_IS_TEXTSTREAM:{\n i = TextStream.setTextStreamValue(pdfObject, i, raw, ignoreRecursion,PDFkeyInt, objectReader);\n break;\n \n }case PdfDictionary.VALUE_IS_NAMETREE:{\n i = Name.setNameTreeValue(pdfObject, i, raw, length, ignoreRecursion,PDFkeyInt,objectReader);\n break;\n \n //readDictionary keys << /A 12 0 R /B 13 0 R >>\n }case PdfDictionary.VALUE_IS_DICTIONARY_PAIRS:{\n i = Dictionary.setDictionaryValue(pdfObject, i, raw, length, ignoreRecursion,objectReader,PDFkeyInt);\n break;\n \n //Strings\n }case PdfDictionary.VALUE_IS_STRING_ARRAY:{\n final Array objDecoder=new Array(objectReader,i, endPt, PdfDictionary.VALUE_IS_STRING_ARRAY);\n i=objDecoder.readArray(ignoreRecursion, raw, pdfObject, PDFkeyInt);\n break;\n \n //read Object Refs in [] (may be indirect ref)\n }case PdfDictionary.VALUE_IS_BOOLEAN_ARRAY:{\n final Array objDecoder=new Array(objectReader, i, endPt, PdfDictionary.VALUE_IS_BOOLEAN_ARRAY);\n i=objDecoder.readArray(false, raw, pdfObject, PDFkeyInt);\n break;\n \n //read Object Refs in [] (may be indirect ref)\n }case PdfDictionary.VALUE_IS_KEY_ARRAY:{\n final Array objDecoder=new Array(objectReader, i, endPt, PdfDictionary.VALUE_IS_KEY_ARRAY);\n i=objDecoder.readArray(ignoreRecursion, raw, pdfObject, PDFkeyInt);\n break;\n \n //read numbers in [] (may be indirect ref)\n }case PdfDictionary.VALUE_IS_MIXED_ARRAY:{\n final Array objDecoder=new Array(objectReader, i, endPt, PdfDictionary.VALUE_IS_MIXED_ARRAY);\n i=objDecoder.readArray(ignoreRecursion, raw, pdfObject, PDFkeyInt);\n break;\n \n //read numbers in [] (may be indirect ref) same as Mixed but allow for recursion and store as objects\n }case PdfDictionary.VALUE_IS_OBJECT_ARRAY:{\n final Array objDecoder=new Array(objectReader, i, endPt, PdfDictionary.VALUE_IS_OBJECT_ARRAY);\n i=objDecoder.readArray(false, raw, pdfObject, PDFkeyInt);\n break;\n \n //read numbers in [] (may be indirect ref)\n }case PdfDictionary.VALUE_IS_DOUBLE_ARRAY:{\n final Array objDecoder=new Array(objectReader, i, endPt, PdfDictionary.VALUE_IS_DOUBLE_ARRAY);\n i=objDecoder.readArray(false, raw, pdfObject,PDFkeyInt);\n break;\n \n //read numbers in [] (may be indirect ref)\n }case PdfDictionary.VALUE_IS_INT_ARRAY:{\n final Array objDecoder=new Array(objectReader, i, endPt, PdfDictionary.VALUE_IS_INT_ARRAY);\n i=objDecoder.readArray(false, raw, pdfObject, PDFkeyInt);\n break;\n \n //read numbers in [] (may be indirect ref)\n }case PdfDictionary.VALUE_IS_FLOAT_ARRAY:{\n final Array objDecoder=new Array(objectReader, i, endPt, PdfDictionary.VALUE_IS_FLOAT_ARRAY);\n i=objDecoder.readArray(false, raw, pdfObject, PDFkeyInt);\n break;\n \n //read String (may be indirect ref)\n }case PdfDictionary.VALUE_IS_NAME:{\n i = Name.setNameStringValue(pdfObject, i, raw, map,PDFkey, PDFkeyInt, objectReader);\n break;\n \n //read true or false\n }case PdfDictionary.VALUE_IS_BOOLEAN:{\n i = BooleanValue.set(pdfObject, i, raw, PDFkeyInt);\n break;\n \n //read known set of values\n }case PdfDictionary.VALUE_IS_STRING_CONSTANT:{\n i = StringValue.setStringConstantValue(pdfObject, i, raw,PDFkeyInt);\n break;\n \n //read known set of values\n }case PdfDictionary.VALUE_IS_STRING_KEY:{\n i = StringValue.setStringKeyValue(pdfObject, i, raw,PDFkeyInt);\n break;\n \n //read number (may be indirect ref)\n }case PdfDictionary.VALUE_IS_INT:{\n \n //roll on\n i++;\n \n //move cursor to start of text\n while(raw[i]==10 || raw[i]==13 || raw[i]==32 || raw[i]==47) {\n i++;\n }\n \n i = NumberValue.setNumberValue(pdfObject, i, raw, PDFkeyInt,objectReader);\n break;\n \n //read float number (may be indirect ref)\n }case PdfDictionary.VALUE_IS_FLOAT:{\n i = FloatValue.setFloatValue(pdfObject, i, raw, length,PDFkeyInt,objectReader);\n break;\n \n //read known Dictionary object which may be direct or indirect\n }case PdfDictionary.VALUE_IS_UNREAD_DICTIONARY:{\n i = setUnreadDictionaryValue(pdfObject, i, raw);\n break;\n \n }case PdfDictionary.VALUE_IS_VARIOUS:{\n if(raw.length-5>0 && raw[i+1]=='n' && raw[i+2]=='u' && raw[i+3]=='l' && raw[i+4]=='l'){ //ignore null value and skip (ie /N null)\n i += 5;\n }else{\n i = setVariousValue(pdfObject, i, raw, length, PDFkeyInt, map, ignoreRecursion,objectReader);\n }\n break;\n \n }case PdfDictionary.VALUE_IS_DICTIONARY:{\n i = setDictionaryValue(pdfObject, i, raw, ignoreRecursion);\n break;\n }\n }\n return i;\n }", "public AVLNode(int i, String val) {\r\n\t\t\tthis.key = i;\r\n\t\t\tthis.value = val;\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.size = 1;\r\n\t\t\tthis.left = new AVLNode(this); // external node\r\n\t\t\tthis.right = new AVLNode(this); // external node\r\n\t\t\tthis.parent = null;\r\n\t\t}", "private void fillPkCache(Stack s, String ename) {\n\t\tLong pkValueStart = getNextPkValueForEntityIncreaseBy(ename, 10, increaseBy());\n\t\tlong value = pkValueStart.longValue();\n\t\tlog.debug(\"filling pkCache for {}, starting at {}\", ename, value);\n\t\tfor (int i = increaseBy(); i > 0; i--) {\n\t\t\ts.push(Long.valueOf(i + value));\n\t\t}\n\t}", "public E get(int i) {\n\t\tcheckIndex(i);\n\t\tListNode<E> current = hop(i);\n\t\treturn current.value;\n\t}", "public int addValue(byte i) {\n return foldIn(i);\n }", "public ByteBuf setIntLE(int index, int value)\r\n/* 799: */ {\r\n/* 800:808 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 801:809 */ return super.setIntLE(index, value);\r\n/* 802: */ }", "private void setElement(int index, E element) {\n// if (getElement(index) != null) {\n// setContents.remove(getElement(index));\n// }\n while (index >= contents.size()) {\n contents.add(null);\n }\n contents.set(index, element);\n// contents.put(index, element);\n backwards.put(element, index);\n\n// if (element != null) {\n// setContents.add(getElement(index));\n// }\n }", "public T set(int i, T t) {\n if (i < 0 || i >= size) // if there is no index i in list\n throw new IndexOutOfBoundsException(\"Treated index: \" + i + \" | Size of the Dynamic Array \" + size()); // cause IndexOutOfBoundException\n T previousValue = (T) elements[i]; // store previous value of element with index i\n elements[i] = t; // set element with index i to t\n return previousValue; // return previous value of element with index i\n }", "public void storeIntegerVar(int index, int value) {\n\t\tstorage[index] = value;\n\t}", "void setNextValue() {\n this.value = this.value * 2;\n }", "protected synchronized void setIntegerValue(String tag, int value) {\n if (actualProperties != null) {\n actualProperties.put(tag, Integer.toString(value));\n }\n }", "public static AGG_State getReference( int i )\n {\n return( (AGG_State)( intHash.get( new Integer( i ) ) ) );\n }", "public boolean replaceKey(int i, T element) {\r\n\t\tif (i < 0 || i > theHeap.size() - 1) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif ((Integer) element <= 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\ttheHeap.set(i, (T) element);\r\n\r\n\t\tif (i != 0 && (compare(getValue((i - 1) >> 1), getValue(i)) > 0)) {\r\n\t\t\tsiftUp();\r\n\t\t} else {\r\n\t\t\tsiftDown(i);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public void storeTrials(int i) throws Exception\n {\n fileHandler.storeInt(file, i);\n }", "private void snapshot\n (int[] i, int i0, int i1, long[] V) {\n int I = i.length;\n long[] va = V;\n long[] vb = new long[I];\n long[] ta = new long[I];\n long[] tb = new long[I];\n do {\n collectTags(i, i0, i1, ta);\n collectValues(i, i0, i1, va);\n collectValues(i, i0, i1, vb);\n collectTags(i, i0, i1, tb);\n } while(\n Arrays.compare(ta, i0, i1, tb, i0, i1) != 0 ||\n Arrays.compare(va, i0, i1, vb, i0, i1) != 0\n );\n }", "public void insertionRear( int val) {\r\n\t\tif(isFull()) return;\r\n\t\tLink2 newNode = new Link2(val);\r\n\t\ttail.next = newNode;\r\n\t\ttail = newNode;\r\n\t}", "public void put(T value) {\n if (buffer.length > 0) {\n buffer[head] = value;\n\n index = head;\n\n head = (head + 1) % buffer.length;\n\n if (entries < buffer.length) {\n ++entries;\n }\n }\n\n }", "private void readValue(Scanner scanner, int i) throws BadDataException\n {\n\tString message = \"Data value expected, but find no integer.\" ;\n\t//-----------Start below here. To do: approximate lines of code = 2\n\t// 3. if there is no integer next in the file, throw a BadDataException with the message above; \n\t if (!scanner.hasNextInt())\n \t throw new BadDataException(message);\n //4. read the next integer into the array called data.\n\t\tdata[i] = scanner.nextInt();\n\t//-----------------End here. Please do not remove this comment. Reminder: no changes outside the todo regions.\n }", "@Override\n\tpublic IFieldComparator<Long> setNextReader(IAtomicReaderRef context) throws IOException {\n\t\tmCurrentReaderValues = FieldCache.DEFAULT.getLongs(\n\t\t\t\tcontext.getReader(), mField, mParser, mMissingValue != null);\n\t\treturn super.setNextReader(context);\n\t}", "Object nextValue() throws IOException;", "public void setData(Item i)\r\n\t{\r\n\t\ttheItem = i;\r\n\t}", "void setRef(int index, Ref value) throws SQLException;", "public void read(int value) {\n if (maxHeap.isEmpty() || value <= maxHeap.peek()) {\n maxHeap.add(value);\n } else {\n minHeap.add(value);\n }\n // re-order\n if (maxHeap.size() - minHeap.size() >= 2) {\n minHeap.add(maxHeap.poll());\n } else if (minHeap.size() > maxHeap.size()) {\n maxHeap.add(minHeap.poll());\n }\n }", "@Override\n public void set(int i, Node<T> e)\n {\n super.set(i, e);\n if(i == 0) \n {\n lastNode.setNext(firstNode);\n updateFirstNode();\n }\n else if(i == size - 1) lastNode = e;\n }", "@Override\n public void reinitValue(DataReader in, EntryValueShort value) throws IOException\n {\n value.reinit(in.readInt(), /* array position */\n in.readShort(), /* data value */\n in.readLong() /* SCN value */);\n }", "public org.dhis2.ns.schema.dxf2.IndicatorRefDocument.IndicatorRef insertNewIndicatorRef(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.dhis2.ns.schema.dxf2.IndicatorRefDocument.IndicatorRef target = null;\n target = (org.dhis2.ns.schema.dxf2.IndicatorRefDocument.IndicatorRef)get_store().insert_element_user(INDICATORREF$0, i);\n return target;\n }\n }", "public void set(int index, int val) {\n boolean exists = arr.get(index).get(arr.get(index).size() - 1).id == id;\n if (exists) {\n arr.get(index).get(arr.get(index).size() - 1).val = val;\n } else {\n List<Pair> list = arr.get(index);\n list.add(new Pair(id, val));\n arr.set(index, list);\n } \n }", "int get(int i) {\n int numPosition = i / MAX_BITS;\n int intPosition = i % MAX_BITS;\n long val = values[numPosition] & (1 << intPosition);\n return (int) (val >> intPosition);\n }", "@Override\r\n\tpublic Buffer setInt(int pos, int i) {\n\t\treturn null;\r\n\t}", "@Override\n public void updateLinkData(int i) throws DatabaseException {\n Map<String, Object> map = new HashMap<String, Object>();\n StringBuffer table = new StringBuffer();\n table.append(\"AD_DATA_LINK_\").append(CalendarFormat.getYM(i));\n map.put(\"table\", table.toString());\n map.put(\"statDate\", CalendarFormat.getYmd(i));\n getSqlMapClientTemplate().insert(\"statSqlMap.updateLinkData\", map);\n }", "public int getNextUnSafeSequence(){ return value++;}", "private void write(int i) {\n\t\tEditor edit = preticketint.edit();\r\n\t\tedit.putInt(\"ticketint\", i);\r\n\t\tedit.commit();\r\n\t}", "private void collectTags\n (int[] i, int i0, int i1, long[] T) {\n for (int o=i0; o<i1; o++) // 1\n T[o] = data[i[o]]; // 1\n }", "public void set(int i, int value) {\n\t\tassert i < size();\n\t\tarr[i] = value;\n\t}", "public void updateItemTag(int index, String tag) {\n int correctIndex = index - 1;\n this.listItems.get(correctIndex).addNewTagMutable(tag);\n }", "@Test\n public void updateComponentTag() {\n UpdateTagRequest updateComponentRequest = new UpdateTagRequest();\n // String key = (String) tagToUpdate2.keySet().toArray()[0];\n updateComponentRequest.setTagKey(TAG_2.getName());\n updateComponentRequest.setTagValue(TAG_2.getValue());\n\n componentController.upsertTag(indexedNodeType.getId(), updateComponentRequest);\n tmpIndexedNodeType = dao.findById(NodeType.class, indexedNodeType.getId());\n\n assertEquals(\"Tags map size should'nt change\", tmpIndexedNodeType.getTags().size(), indexedNodeType.getTags().size());\n int index = tmpIndexedNodeType.getTags().indexOf(TAG_2);\n int index2 = indexedNodeType.getTags().indexOf(TAG_2);\n assertNotEquals(\"tag2 tag value has changed\", tmpIndexedNodeType.getTags().get(index).getValue(), indexedNodeType.getTags().get(index2).getValue());\n assertEquals(\"tag2 tag value should be the same as TAG_2\", tmpIndexedNodeType.getTags().get(index).getValue(), TAG_2.getValue());\n\n }", "public void visit(int i) {\r\n visited[i] = visitedToken;\r\n }", "private void updateNextNode(SkiNode head, int nextI, int nextJ, int nextId) {\n\t\tif (!MatrixHelper.isPosValid(nextI, nextJ, map)) {\n\t\t\treturn;\n\t\t}\n\t\tif (head.v <= map[nextI][nextJ]) {\n\t\t\treturn;\n\t\t}\n\t\tif (hMap[nextI][nextJ] != 0) {\n\t\t\thead.level = Math.max(head.level, hMap[nextI][nextJ] + 1);\n\t\t} else {\n\t\t\thead.next[nextId] = new SkiNode(map[nextI][nextJ], nextI, nextJ, head);\n\t\t\tbuildSkiTree(head.next[nextId]);\n\t\t}\n\t}", "public void mo9302a(String str, int i) {\n atomicReference.set(str);\n }", "public void tagOneBased() {\n for (Item e: items) {\n e.setTag(new Integer(e.getId()+1));\n }\n }", "public void setValueArray(int i, amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value value)\n {\n synchronized (monitor())\n {\n check_orphaned();\n amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value target = null;\n target = (amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value)get_store().find_element_user(VALUE$0, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n target.set(value);\n }\n }", "protected void _setIntLE(int index, int value)\r\n/* 495: */ {\r\n/* 496:509 */ HeapByteBufUtil.setIntLE(this.array, index, value);\r\n/* 497: */ }", "public SkipListNode<K> next(int i)\n {\n\treturn next.get(i);\n }", "public void add(int i, int k) {\n for (int m = i + 1; m <= count; m++) {\n values[m] = values[m-1];\n }\n values[i] = k;\n count++;\n }", "public void tickTag(int position) {\r\n dataTag.set(position, dataTag.get(position) + 1);\r\n }", "public void valueChanged(IntegerStorage istorage);", "public void updateToNBTTagStorage () {\r\n\t\t// no book saved?\r\n\t\tif (storage.getBoolean(\"isBook\") == null || storage.getBoolean(\"isBook\") == false)\r\n\t\t\treturn;\r\n\t\t\r\n\t\tNBTTagCompound\ttag\t\t= new NBTTagCompound();\r\n\t\tString \t\t\tauthor\t= storage.getString\t(\"book-author\"\t);\r\n\t\tString\t\t\ttitle\t= storage.getString\t(\"book-title\"\t);\r\n\t\tint\t\t\t\tpages\t= storage.getInteger(\"book-pages\"\t);\r\n\t\tNBTTagList\t\tlist\t= new NBTTagList();\r\n\t\t\r\n\t\tfor (int i = 0; i < pages; i++) {\r\n\t\t\tString\t\t\tsiteContent\t= storage.getString(\"book-page-\"+i);\r\n\t\t\tNBTTagString\ttString\t\t= new NBTTagString(siteContent);\r\n\t\t\t\r\n\t\t\ttString.data\t= siteContent;\r\n\t\t\t\r\n\t\t\tlist.add(tString);\r\n\t\t}\r\n\t\t\r\n\t\ttag.setString\t(\"author\", \tauthor);\r\n\t\ttag.setString\t(\"title\",\ttitle);\r\n\t\ttag.set\t\t\t(\"pages\", \tlist);\r\n\t\tsetNBTTagCompound(tag);\r\n\t}", "protected void readFullTagValue(ExifTag tag) throws IOException {\n short type = tag.getDataType();\n if (type == ExifTag.TYPE_ASCII || type == ExifTag.TYPE_UNDEFINED ||\n type == ExifTag.TYPE_UNSIGNED_BYTE) {\n int size = tag.getComponentCount();\n if (mCorrespondingEvent.size() > 0) {\n if (mCorrespondingEvent.firstEntry().getKey() < mTiffStream.getReadByteCount()\n + size) {\n Object event = mCorrespondingEvent.firstEntry().getValue();\n if (event instanceof ImageEvent) {\n // Tag value overlaps thumbnail, ignore thumbnail.\n Timber.w(\"Thumbnail overlaps value for tag: \\n\" + tag.toString());\n Entry<Integer, Object> entry = mCorrespondingEvent.pollFirstEntry();\n Timber.w(\"Invalid thumbnail offset: \" + entry.getKey());\n } else {\n // Tag value overlaps another tag, shorten count\n if (event instanceof IfdEvent) {\n Timber.w(\"Ifd \" + ((IfdEvent) event).ifd\n + \" overlaps value for tag: \\n\" + tag.toString());\n } else if (event instanceof ExifTagEvent) {\n Timber.w(\"Tag value for tag: \\n\"\n + ((ExifTagEvent) event).tag.toString()\n + \" overlaps value for tag: \\n\" + tag.toString());\n }\n size = mCorrespondingEvent.firstEntry().getKey()\n - mTiffStream.getReadByteCount();\n Timber.w(\"Invalid size of tag: \\n\" + tag.toString()\n + \" setting count to: \" + size);\n tag.forceSetComponentCount(size);\n }\n }\n }\n }\n switch (tag.getDataType()) {\n case ExifTag.TYPE_UNSIGNED_BYTE:\n case ExifTag.TYPE_UNDEFINED: {\n byte buf[] = new byte[tag.getComponentCount()];\n read(buf);\n tag.setValue(buf);\n }\n break;\n case ExifTag.TYPE_ASCII:\n tag.setValue(readString(tag.getComponentCount()));\n break;\n case ExifTag.TYPE_UNSIGNED_LONG: {\n long value[] = new long[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readUnsignedLong();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_UNSIGNED_RATIONAL: {\n Rational value[] = new Rational[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readUnsignedRational();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_UNSIGNED_SHORT: {\n int value[] = new int[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readUnsignedShort();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_LONG: {\n int value[] = new int[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readLong();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_RATIONAL: {\n Rational value[] = new Rational[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readRational();\n }\n tag.setValue(value);\n }\n break;\n }\n if (LOGV) {\n Timber.v(\"\\n\" + tag.toString());\n }\n }", "public void store(String name, String val, String register, int i) {\r\n registerName.add(name);\r\n registerValues.add(val);\r\n registerRegister.add(register);\r\n }", "@Override\n\tpublic void saveTag(Tag newTag) throws Exception {\n\n\t}", "private static void increaseReference(Counter counter) {\n counter.advance(1);\n }", "public void insertWithReuse(int intval) {\n if (this.mi == null) {\n this.mi = new MI();\n }\n this.mi.value = intval;\n this.mi = (MI)this.insertWithOverflow(this.mi);\n }", "public void setIntegerInternal(FastJsonResponse.Field<?, ?> field, String str, int i) {\n zab(field);\n SafeParcelWriter.writeInt(this.zarb, field.getSafeParcelableFieldId(), i);\n }", "public int get(int i) {\n if (i==0) {\n return first;\n }\n return rest.get(i - 1);\n }", "public void increment(int i, ArrayList<Split> s)\n\t{\n\t\tthis.iValue += i;\n\t\t\n\t\tfor(int counter = 0; counter < s.size(); counter ++)\n\t\t{\n\t\t\tthis.incrementSplit(s.get(counter));\n\t\t}\n\t}", "void pushBack() throws IOException {\n iis.seek(iis.getStreamPosition()-bufAvail);\n bufAvail = 0;\n bufPtr = 0;\n }", "public void putValueBeforeArrayAddrIndex() {\n\t\tObj index = Tab.currentScope().findSymbol(\"@@TEMPOBJ\");\n\t\tObj address = Tab.currentScope().findSymbol(\"@@TEMPOBJ2\");\n\t\tObj value = Tab.currentScope().findSymbol(\"@@TEMPOBJ3\");\n\t\t\n\t\tCode.store(index);\n\t\tCode.store(address);\n\t\tCode.store(value);\n\t\t\n\t\tCode.load(address);\n\t\tCode.load(index);\n\t\tCode.load(value);\t\t\n\t}", "public void setTagReference(String tag, int new_reference_count) {\n\n\t\t//\n\t\t// construct new content values\n\t\t//\n\t\tContentValues values = new ContentValues();\n\n\t\t//\n\t\t// set reference count\n\t\t//\n\t\tvalues.put(TAG_FIELD_USAGE, new Integer(new_reference_count));\n\n\t\t//\n\t\t// FIXME: fix race conditions\n\t\t//\n\t\tlong affected = m_db.update(TAG_TABLE_NAME, values, TAG_FIELD_NAME\n\t\t\t\t+ \"=?\", new String[] { tag });\n\n\t\t//\n\t\t// informal debug print\n\t\t//\n\t\tLogger.i(\"DBManager::setTagReference> result \" + affected);\n\t}", "private static void caseInteger(Graph g, Value fieldValue, Vertex prev, String name) {\n\t\tField intFields = ((ObjectReference) fieldValue).referenceType().fieldByName(\"value\");\n\t\tString val = ((ObjectReference) fieldValue).getValue(intFields).toString();\n\t\t// Used the ID from the Integer class as the reference ID for the vertex\n\t\tint ID = (int) ((ObjectReference) fieldValue).uniqueID();\n\t\tVertex current = new Vertex(ID, \"Value: \" + val, false);\n\t\tg.addVertex(current);\n\t\tmakeConnection(g, maxValue, prev, current, name);\n\t\tmaxValue++;\n\t}", "private Index(int i) {\r\n _value = i;\r\n }", "@Override\n\tpublic int update(Tags tag) {\n\t\treturn 0;\n\t}", "protected final void seek(final int value) {\r\n bPtr = value;\r\n }" ]
[ "0.64113307", "0.58465874", "0.5813441", "0.55585223", "0.5141094", "0.5117945", "0.50122833", "0.4966698", "0.49596503", "0.49337506", "0.49061295", "0.48891696", "0.4885449", "0.48586708", "0.48461124", "0.48226658", "0.48048097", "0.4783981", "0.47595417", "0.47435212", "0.47386965", "0.47325218", "0.4712635", "0.46848112", "0.46810648", "0.4665575", "0.46580407", "0.46286142", "0.46283916", "0.46186572", "0.46056542", "0.46051902", "0.4584848", "0.4578085", "0.45741215", "0.4571753", "0.45679313", "0.45664093", "0.45607045", "0.45594406", "0.45590484", "0.4558734", "0.45572025", "0.45550346", "0.45512778", "0.45482534", "0.45480493", "0.4541144", "0.45401523", "0.45360446", "0.45249814", "0.45192024", "0.44894958", "0.44893667", "0.44884235", "0.44836155", "0.44823512", "0.44793513", "0.44780594", "0.44760567", "0.44744056", "0.4467385", "0.44638014", "0.44634125", "0.44565597", "0.44541267", "0.4450652", "0.44271454", "0.4426234", "0.44216788", "0.44203967", "0.4418766", "0.4412744", "0.44008052", "0.43962723", "0.43935445", "0.43933153", "0.4387779", "0.43855822", "0.43850031", "0.4379974", "0.43771973", "0.43736416", "0.4373177", "0.4371947", "0.43703386", "0.43603683", "0.43463117", "0.43455556", "0.43425056", "0.43410772", "0.4330103", "0.43213433", "0.43189698", "0.4318693", "0.43170223", "0.431657", "0.4311372", "0.43088606", "0.43040094" ]
0.5772868
3
Reads value at i. 1. Get item at i. 2. If its not a tag, return its value. 3. Otherwise, reset it and retry.
private long read(int i) { while (true) { long x = data[i]; if (!isTag(x)) return value(x); reset(i); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long get(int i) {\n return read(i);\n }", "public T get(int i) {\n // we add values.length to head-i to avoid negative indices\n return values[(head-i+values.length) % values.length];\n }", "public Integer get(int i){\n\t\treturn body[i];\n\t}", "public Object get(int i) {\n return elementAt(i);\n }", "public int read(int i);", "@Override\n public E get(int i) throws IndexOutOfBoundsException {\n validIndex(i);\n return data[i];\n }", "public Item get(int i) {\n return items[i];\n }", "public T get(int i) {\n if (i == 0) {\n return this.first;\n }\n else {\n return this.rest.get(i--);\n }\n }", "public Item get(int i) {\n return items[i - 1];\n }", "public int get(int i) {\n if (i==0) {\n return first;\n }\n return rest.get(i - 1);\n }", "private @NotNull Val finishReadingValue(@NotNull Tag tag) throws IOException, JsonFormatException {\n\n DatumType type = tag.type;\n @NotNull JsonToken token = currentToken();\n // null?\n if (token == JsonToken.VALUE_NULL) return type.createValue(null);\n // error?\n final @Nullable String firstFieldName;\n if (token == JsonToken.START_OBJECT) { // can be a record or an error\n firstFieldName = nextFieldName(); // advances to next token (field name or end object - in valid cases)\n if (JsonFormat.ERROR_CODE_FIELD.equals(firstFieldName)) return type.createValue(finishReadingError());\n } else firstFieldName = null;\n // datum\n final @NotNull Datum datum = finishReadingDatum(token, firstFieldName, type);\n return datum.asValue();\n }", "public KVPair get(int i) {\r\n\r\n if (i >= capacity())\r\n return null;\r\n\r\n return htable[i];\r\n }", "public E get(int i) {\n\t\tcheckIndex(i);\n\t\tListNode<E> current = hop(i);\n\t\treturn current.value;\n\t}", "private void readValue(Scanner scanner, int i) throws BadDataException\n {\n\tString message = \"Data value expected, but find no integer.\" ;\n\t//-----------Start below here. To do: approximate lines of code = 2\n\t// 3. if there is no integer next in the file, throw a BadDataException with the message above; \n\t if (!scanner.hasNextInt())\n \t throw new BadDataException(message);\n //4. read the next integer into the array called data.\n\t\tdata[i] = scanner.nextInt();\n\t//-----------------End here. Please do not remove this comment. Reminder: no changes outside the todo regions.\n }", "public TypeHere get(int i) {\n return items[i];\n }", "int get(int i) {\n int numPosition = i / MAX_BITS;\n int intPosition = i % MAX_BITS;\n long val = values[numPosition] & (1 << intPosition);\n return (int) (val >> intPosition);\n }", "private long ll(int i) {\n while (true) {\n incTag();\n long x = read(i);\n save[th()] = x;\n if (cas(i, x, tag[th()])) return x;\n }\n }", "public Item get(int i);", "public int get(int i)\n {\n if(integerList != null)\n return integerList[i];\n else\n return -1;\n }", "public T get(int i);", "public T get(int i)\n {\n throw new IllegalStateException();\n }", "public T get(int i)\n {\n throw new IllegalStateException();\n }", "private String next(int i) throws IOException {\r\n\t\tif(buffer!=null) {\r\n\t\t\tString s=buffer;\r\n\t\t\tbuffer=null;\r\n\t\t\treturn s;\r\n\t\t}\r\n\t\tif (i==0) {\r\n\t\t\treturn in.readLine();\r\n\t\t} else return in2.readLine();\r\n\t}", "public void testGetValue() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n test1.prev();\n test1.moveToPos(8);\n assertTrue(test1.getValue().inRange(8));\n for (int i = 0; i < 10; i++) {\n test1.next();\n }\n try {\n test1.getValue();\n }\n catch (Exception e) {\n assertTrue(e instanceof NoSuchElementException);\n }\n }", "public E get(int i) {\n\t\tif (size == 0) {\n\t\t\tthrow new IllegalArgumentException(\"List is empty, cannot retrieve item.\");\n\t\t}\n\n\t\tif (i < 0 || i >= size) {\n\t\t\tthrow new IndexOutOfBoundsException(\"Requested index is out of bounds.\");\n\t\t}\n\n\t\treturn list[i];\n\n\t}", "public T get(int i) {\n return null;\n }", "T get(int i);", "public Term get(int i) {\n\t\treturn this.elts[i];\n\t}", "public E get(int i) {\n\n\t if (i < 0 && i > num_elements)\n\t return null;\n\t \n\t return(elements[i]);\n\t }", "public String getValue(int i) {\n/* 151 */ return ((Attr)this.m_attrs.item(i)).getValue();\n/* */ }", "public RTWValue getAsValue(int i);", "protected abstract int readInternal(int index);", "default V item( int i ) { return getDataAt( indexOfIndex( i ) ); }", "Object nextValue() throws IOException;", "public Object get(int i)\n {\n if(_list!=null)\n return _list.get(i);\n return null;\n }", "public int get(int i) {\n\t\tassert i < size();\n\t\treturn arr[i];\n\t}", "E get(int i) throws IndexOutOfBoundsException;", "@Override\n\tpublic E get(int i) throws IndexOutOfBoundsException {\n\t\treturn null;\n\t}", "protected void readFullTagValue(ExifTag tag) throws IOException {\n short type = tag.getDataType();\n if (type == ExifTag.TYPE_ASCII || type == ExifTag.TYPE_UNDEFINED ||\n type == ExifTag.TYPE_UNSIGNED_BYTE) {\n int size = tag.getComponentCount();\n if (mCorrespondingEvent.size() > 0) {\n if (mCorrespondingEvent.firstEntry().getKey() < mTiffStream.getReadByteCount()\n + size) {\n Object event = mCorrespondingEvent.firstEntry().getValue();\n if (event instanceof ImageEvent) {\n // Tag value overlaps thumbnail, ignore thumbnail.\n Timber.w(\"Thumbnail overlaps value for tag: \\n\" + tag.toString());\n Entry<Integer, Object> entry = mCorrespondingEvent.pollFirstEntry();\n Timber.w(\"Invalid thumbnail offset: \" + entry.getKey());\n } else {\n // Tag value overlaps another tag, shorten count\n if (event instanceof IfdEvent) {\n Timber.w(\"Ifd \" + ((IfdEvent) event).ifd\n + \" overlaps value for tag: \\n\" + tag.toString());\n } else if (event instanceof ExifTagEvent) {\n Timber.w(\"Tag value for tag: \\n\"\n + ((ExifTagEvent) event).tag.toString()\n + \" overlaps value for tag: \\n\" + tag.toString());\n }\n size = mCorrespondingEvent.firstEntry().getKey()\n - mTiffStream.getReadByteCount();\n Timber.w(\"Invalid size of tag: \\n\" + tag.toString()\n + \" setting count to: \" + size);\n tag.forceSetComponentCount(size);\n }\n }\n }\n }\n switch (tag.getDataType()) {\n case ExifTag.TYPE_UNSIGNED_BYTE:\n case ExifTag.TYPE_UNDEFINED: {\n byte buf[] = new byte[tag.getComponentCount()];\n read(buf);\n tag.setValue(buf);\n }\n break;\n case ExifTag.TYPE_ASCII:\n tag.setValue(readString(tag.getComponentCount()));\n break;\n case ExifTag.TYPE_UNSIGNED_LONG: {\n long value[] = new long[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readUnsignedLong();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_UNSIGNED_RATIONAL: {\n Rational value[] = new Rational[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readUnsignedRational();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_UNSIGNED_SHORT: {\n int value[] = new int[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readUnsignedShort();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_LONG: {\n int value[] = new int[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readLong();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_RATIONAL: {\n Rational value[] = new Rational[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readRational();\n }\n tag.setValue(value);\n }\n break;\n }\n if (LOGV) {\n Timber.v(\"\\n\" + tag.toString());\n }\n }", "public T item() throws IOException, NoSuchElementException;", "private StackManipulation getCurrentRowFieldValue(int i) {\n StackManipulation readRow = localVariables.readVariable(currentSelectRowArg, Row.class);\n StackManipulation getValue =\n new StackManipulation.Compound(\n localVariables.readVariable(currentSelectRowArg, Row.class),\n IntegerConstant.forValue(i),\n MethodInvocation.invoke(\n ROW_LOADED_TYPE\n .getDeclaredMethods()\n .filter(\n ElementMatchers.named(\"getValue\")\n .and(ElementMatchers.takesArguments(int.class)))\n .getOnly()));\n\n return new ShortCircuitReturnNull(readRow, getValue);\n }", "public int get(int i) throws ArrayIndexOutOfBoundsException {\n if (i >= 0 && i < count) {\n return list[i];\n } else {\n throw new ArrayIndexOutOfBoundsException();\n }\n }", "public int get(int i) {\n // YOUR CODE HERE\n return 1;\n }", "@Override\n\tpublic E get(int i) {\n\t\tif (i < 0 || i >= this.numberOfElements) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\telse {\n\t\t\treturn this.arrayList[i];\n\t\t}\n\t}", "public int getElementAt(int i)\n\t{\n\t\tint elem = 0;\n\t\tint index = -1;\n\t\tSinglyLinkedListNode nextNode = head;\n\t\tSinglyLinkedListNode prevNode = null;\n\t\tif((i < 0 || i >= size()))\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\twhile(true)\n\t\t{\n\t\t\tindex = index + 1;\n\t\t\tif(index == i)\n\t\t\t{\n\t\t\t\telem = nextNode.getData();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprevNode = nextNode;\n\t\t\t\tnextNode = prevNode.getNext();\n\t\t\t}\n\t\t}\t\t\n\t\treturn elem;\n\t}", "public Integer getItem(int i) {\n return this.f2227a.get(i);\n }", "public Object getRaw(int i);", "@Override\n public E peek(int i) {\n if(!hasWork()) {\n throw new NoSuchElementException();\n }\n if(i < 0 || i >= size()) {\n throw new IndexOutOfBoundsException();\n }\n return array[(front + i) % capacity()];\n }", "E get(int i) {\r\n @SuppressWarnings(\"unchecked\")\r\n final E e = (E)arr[i];\r\n return e;\r\n }", "@SuppressWarnings(\"unchecked\")\n public T get(int i) {\n if (i < 0 || i >= size) // if there is no index i in list\n throw new IndexOutOfBoundsException(\"Treated index: \" + i + \" | Size of the Dynamic Array \" + size()); // cause IndexOutOfBoundException\n return (T) elements[i]; // return element with index i\n }", "@Override\n public E get(int i) throws IndexOutOfBoundsException {\n checkRange(i);\n\n if (size == 1) {\n return (E) storage;\n } else if (size <= 5) {\n return ((E[]) storage)[i];\n } else {\n return ((ArrayList<E>) storage).get(i);\n }\n }", "public T getValue(int i) {\r\n\t\treturn theHeap.get(i);\r\n\t}", "public String get(int i) {\n Object obj = this.f51596a.get(i);\n C32569u.m150513a(obj, \"get(...)\");\n return (String) obj;\n }", "public int iterativeGet(int i) {\n int val = 0;\n val = this.first;\n IntList p = this.rest;\n while (i > 0) {\n val = p.first;\n p = p.rest;\n i--;\n }\n return val;\n }", "public T get(final int i){\n if(i >= pattern.size()){\n throw new IndexOutOfBoundsException(\"pattern has only \" + pattern.size() + \" elements\");\n }\n return pattern.get(i);\n }", "@Override public int read() throws IOException {\r\n\t\tif (closed) throw new IOException(\"Reader closed\");\r\n\t\tint r = -1;\r\n\t\twhile (r == -1){\r\n\t\t\tReader in = getCurrentReader();\r\n\t\t\tif (in == null){\r\n\t\t\t\tif (doneAddingReaders) return -1;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t} catch (InterruptedException iox){\r\n\t\t\t\t\tthrow new IOException(\"Interrupted\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tr = in.read();\r\n\t\t\t\tif (r == -1) advanceToNextReader();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn r;\r\n\t}", "public String getValue(int i){\n if(i >= chain.length) return apargs[i-chain.length];\n else return chain[i].toString();\n }", "@Override\n public Integer next() {\n if(peekedVal != null ){\n Integer next = peekedVal;\n peekedVal = null;\n return next;\n }\n if(!iter.hasNext()){\n throw new NoSuchElementException();\n }\n return iter.next();\n\n }", "public Tag readTag() throws IOException {\n/* 78 */ char[] arrayOfChar = new char[1024];\n/* */ \n/* 80 */ int j = -1;\n/* */ \n/* 82 */ Integer integer1 = null;\n/* 83 */ Integer integer2 = null;\n/* */ \n/* 85 */ int i = read(2);\n/* 86 */ if (i < 0) {\n/* 87 */ throw new IOException(\"stop.\");\n/* */ }\n/* 89 */ if (i > arrayOfChar.length) {\n/* 90 */ throw new IOException(\"Invalid tag length.\");\n/* */ }\n/* 92 */ while (i > 0) {\n/* 93 */ j = read(2);\n/* 94 */ int k = read(2);\n/* 95 */ switch (j) {\n/* */ case 1:\n/* 97 */ integer1 = new Integer(read(4));\n/* 98 */ integer2 = new Integer(read(4));\n/* */ break;\n/* */ } \n/* */ \n/* 102 */ i -= 4 + k;\n/* */ } \n/* 104 */ return new Tag(i, j, integer1, integer2);\n/* */ }", "public final i getItem(int i) {\n return (i) this.kLz.get(i);\n }", "private void reset(int i) {\n long x = data[i];\n if (isTag(x))\n cas(i, x, save[threadId(x)]);\n }", "public T returnItem(int i) {\n return a[i];\n }", "public static Object get(ArrayQueueADT arrayQueue, int i) {\n assert i >= 0;\n return arrayQueue.elements[(arrayQueue.head + i) % arrayQueue.elements.length];\n }", "@Override\r\n\t\t\tpublic Object getItem(int i) {\n\t\t\t\treturn i;\r\n\t\t\t}", "protected E readValue(LineReader reader, long indexElement) throws IOException {\n int length = (int) getValueLength(indexElement);\n if (length == 0) {\n return getValueConverter().bytesToValue(buffer, 0);\n }\n long valPos = getValuePosition(indexElement);\n if (log.isTraceEnabled()) {\n log.trace(\"readValue: Retrieving value of length \" + length + \" from file at position \" + valPos);\n }\n synchronized (this) {\n reader.seek(valPos);\n if (buffer.length < length) {\n buffer = new byte[length];\n }\n reader.readFully(buffer, 0, length);\n }\n/* for (int i = 0 ; i < length ; i++) {\n System.out.println(buffer[i]);\n }\n */\n return getValueConverter().bytesToValue(buffer, length);\n }", "Object get(int i);", "public item getI() {\n return i;\n }", "public DataBag getBagField(int i) {\n Datum field = getField(i); // throws exception if field doesn't exist\n\n if (field instanceof DataBag) {\n return (DataBag) field;\n }\n\n throw newTupleAccessException(field, \"bag\", i);\n }", "public String queueArrayGetValue(int i){\n\t\treturn queueArray[i][1];\n\t}", "public void read(Integer i) {\n\n Object[][] obj = readItems(i);\n\n for (View v : views) {\n v.update(obj);\n }\n\n }", "public Integer peek() {\n if(peekedVal == null){\n if(!iter.hasNext()){\n throw new NoSuchElementException();\n }\n peekedVal = iter.next();\n }\n return peekedVal;\n }", "public Item get(int index) {\n int track = nextFirst; //It does not modify nextFirst\n track = moveForward(track, index + 1);\n return items[track];\n }", "protected synchronized int getIntegerValue(String tag) {\n int returnInt = 0;\n if (actualProperties != null) {\n returnInt = Integer.decode(actualProperties.getProperty(tag, \"0\"));\n }\n return returnInt;\n }", "public abstract VALUEIN getCurrentValue() throws IOException, \n InterruptedException;", "public T get() {\r\n\t\tif (value == null) {\r\n\t\t\tthrow new NoSuchElementException(\"No value present\");\r\n\t\t}\r\n\t\treturn value;\r\n\t}", "public int _dataOrQName(int i) {\r\n if (i < this.m_size) {\r\n return this.m_dataOrQName.elementAt(i);\r\n }\r\n while (nextNode()) {\r\n if (i < this.m_size) {\r\n return this.m_dataOrQName.elementAt(i);\r\n }\r\n }\r\n return -1;\r\n }", "public long readTag(){\n if (!checkOpen()){\r\n return 0;\r\n }\r\n // arrays will hold return values from various calls to reader\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 return 0;\r\n }\r\n System.out.println(\"Tagtype:\"+pTAG[0] + \" SN[0]:\" + Integer.toHexString(pSN[0]) + \" return= \" + tag);\r\n long serial = 0;\r\n for(int i=0;i<pLen[0];i++) {\r\n // shift and bitwise-OR the bytes into one 64-bits integer\r\n serial = (serial << 8 ); // shift left 8 bits\r\n serial = serial | (pSN[i] & 0xFF); // bitwise OR byte into int\r\n }\r\n System.out.printf(\" serial = %d hex: %X\",serial, serial);\r\n message = \"String read\";\r\n // test card read/write+login functions; only with new cards\r\n //writeString(\"Hello RFID card\");\r\n //System.err.println(readString());\r\n return (int)serial;\r\n }", "public Object get (int i)\r\n {\r\n }", "@Override\n public Object getValueAt( Object node, int i )\n {\n return node;\n }", "public Object getItem(int i)\n {\n return items.elementAt(i);\n }", "public amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value getValueArray(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value target = null;\n target = (amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value)get_store().find_element_user(VALUE$0, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n return target;\n }\n }", "public int read(int[] i) throws IOException {\n\t\treturn read(i, 0, i.length);\n\t}", "@Override\n\tpublic CompletableFuture<Integer> fetchRemoteValue(String s, int i) {\n\t\treturn CompletableFuture.completedFuture(33);\n\t}", "@Override\n\tpublic ReadRecord readItem() throws Exception {\n\t\tif (failimmediate){\n\t\t\tthrow new Exception(\"read fail immediate\");\n\t\t}\n\t\telse {\n\t\t\treturn new ReadRecord();\n\t\t}\n\t}", "public ItemStack get(int paramInt)\r\n/* 26: */ {\r\n/* 27: 41 */ return this.a[paramInt];\r\n/* 28: */ }", "private void read() {\n\t\tticketint = preticketint.getInt(\"ticketint\", 0);\r\n\t\tLog.d(\"ticketint\", \"ticketint\" + \"read\" + ticketint);\r\n\t}", "T get(int position);", "public E get(int index)\n {\n if (index >= 0 && index < size)\n return data[index];\n else\n throw new NoSuchElementException();\n }", "protected Bloque get(int i){\n return (Bloque)data.get(i);\n }", "public Interval<T> get(int i) {\n return intervals.get(i - 1);\n }", "abstract int get(int index);", "@Override\n public Integer get() {\n return ++counter;\n }", "public Integer at(int i){\n\t\tint cont = 0;\n\t\tNodo aux = first;\n\t\twhile(i<this.size()){\n\t\t\tif(cont == i){\n\t\t\t\treturn aux.getInfo();\n\t\t\t}else{\n\t\t\t\taux = aux.getNext();\n\t\t\t\tcont++;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public int getTag(int position) {\r\n return dataTag.get(position);\r\n }", "@Override\r\n\tpublic Text getCurrentValue() throws IOException, InterruptedException {\n\t\treturn this.value;\r\n\t}", "public Result getCurrentValue() throws IOException, InterruptedException {\n return value;\n }", "public Object get(int propID, int i) throws SL_Exception\n {\n switch(propID)\n {\n default:\n return super.get(propID, i);\n }\n }", "private int get(int pos) {\n if (pos != 0) {\n return this.nextNode.get(pos - 1);\n } else {\n return this.value;\n }\n }", "public int read() throws IOException {\n ensureOpen();\n return read(singleByteBuf, 0, 1) == -1 ? -1 : Byte.toUnsignedInt(singleByteBuf[0]);\n }", "public Trade get(int i) throws NullPointerException,IndexOutOfBoundsException{\n try {\n return trades.get(i);\n }catch (IndexOutOfBoundsException e){\n e.printStackTrace();\n return null;\n }\n }" ]
[ "0.640685", "0.59254616", "0.5794415", "0.5793183", "0.57923067", "0.5761843", "0.5739995", "0.57387674", "0.5701768", "0.5658459", "0.56240356", "0.5589505", "0.55886114", "0.55727154", "0.55512244", "0.55455184", "0.5519008", "0.54907763", "0.54428345", "0.54427034", "0.54392207", "0.54392207", "0.54373", "0.5429126", "0.53982854", "0.5394373", "0.5391197", "0.5345646", "0.5334582", "0.53177446", "0.53049994", "0.5301947", "0.5288462", "0.52877635", "0.5282123", "0.5248982", "0.52156126", "0.51988345", "0.5190961", "0.5187336", "0.5149447", "0.51295877", "0.5129463", "0.51252794", "0.5113957", "0.51113296", "0.50875", "0.50669336", "0.5064112", "0.50558925", "0.50280493", "0.5011027", "0.499162", "0.49890265", "0.4985606", "0.49783653", "0.49766695", "0.49732202", "0.4968187", "0.49423409", "0.4939979", "0.49304768", "0.49220744", "0.49195075", "0.49167937", "0.4895145", "0.4892562", "0.48801547", "0.48725456", "0.4866989", "0.48484668", "0.48390558", "0.48336223", "0.4819932", "0.48179597", "0.4809931", "0.48047984", "0.47972345", "0.4795452", "0.47942477", "0.47942153", "0.4792916", "0.47797605", "0.47610766", "0.47609255", "0.47455427", "0.4738995", "0.47389066", "0.473394", "0.4733284", "0.4700647", "0.4697445", "0.46906736", "0.46889746", "0.46864492", "0.4674255", "0.46704838", "0.4656215", "0.46524173", "0.46457872" ]
0.80115867
0
Resets item at i to value. 1. Check if item is a tag. 1a. If so, try replacing with saved value.
private void reset(int i) { long x = data[i]; if (isTag(x)) cas(i, x, save[threadId(x)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setData(Item i)\r\n\t{\r\n\t\ttheItem = i;\r\n\t}", "public void setItem(Object item, int i)\n {\n items.setElementAt(item, i);\n }", "public Item swapItem(Item i){\r\n if(size()!=1) throw new IllegalStateException(\"Trying to swap item of\"\r\n + \"large container\");\r\n add(i);\r\n return remove(0);\r\n }", "public T set(int i, T t) {\n if (i < 0 || i >= size) // if there is no index i in list\n throw new IndexOutOfBoundsException(\"Treated index: \" + i + \" | Size of the Dynamic Array \" + size()); // cause IndexOutOfBoundException\n T previousValue = (T) elements[i]; // store previous value of element with index i\n elements[i] = t; // set element with index i to t\n return previousValue; // return previous value of element with index i\n }", "public void reset(){\n\t\tthis.currentIndex = 0;\n\t}", "void set(int i, int val) {\n int numPosition = i / MAX_BITS;\n int intPosition = i % MAX_BITS;\n\n if (val == 1)\n values[numPosition] |= (1 << intPosition);\n else\n values[numPosition] = values[numPosition]&~(1 << intPosition);\n }", "public void reset()\n {\n setLastItem(NOTHING_HANDLED);\n for (int i = 0; i < counters.length; i++)\n {\n counters[i] = 0;\n }\n for (int j = 0; j < expected.length; j++)\n {\n expected[j] = ITEM_DONT_CARE;\n }\n }", "public abstract void reset(int index);", "public void reset() {\r\n\t\tif(this.markedStack.isEmpty()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.value = this.markedStack.pollLast();\r\n\t}", "public void updateItemTag(int index, String tag) {\n int correctIndex = index - 1;\n this.listItems.get(correctIndex).addNewTagMutable(tag);\n }", "@Override\n\t\tprotected void resetAttribute(SVGItem item) {\n\t\t}", "private void reset(){\n int j=0;\n for(int i=0; i<array.length; i++){\n if(j == itemCount) {return;}\n if(array[i]!=null){\n temp[j] = array[i];\n j++;\n }\n }\n }", "public void setItem(@NotNull Usable usable, int i) {\n checkIndex(i);\n\n if (items[i] == null) {\n size++;\n }\n\n items[i] = usable;\n }", "@Override\n public E set(int i, E e) throws IndexOutOfBoundsException {\n checkRange(i);\n E previousValue = get(i);\n\n if (size == 1) {\n storage = e;\n } else if (size <= 5) {\n ((E[]) storage)[i] = e;\n } else {\n ((ArrayList<E>) storage).set(i, e);\n }\n\n return previousValue;\n }", "public boolean replaceKey(int i, T element) {\r\n\t\tif (i < 0 || i > theHeap.size() - 1) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif ((Integer) element <= 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\ttheHeap.set(i, (T) element);\r\n\r\n\t\tif (i != 0 && (compare(getValue((i - 1) >> 1), getValue(i)) > 0)) {\r\n\t\t\tsiftUp();\r\n\t\t} else {\r\n\t\t\tsiftDown(i);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public void tagOneBased() {\n for (Item e: items) {\n e.setTag(new Integer(e.getId()+1));\n }\n }", "private void setElement(int index, E element) {\n// if (getElement(index) != null) {\n// setContents.remove(getElement(index));\n// }\n while (index >= contents.size()) {\n contents.add(null);\n }\n contents.set(index, element);\n// contents.put(index, element);\n backwards.put(element, index);\n\n// if (element != null) {\n// setContents.add(getElement(index));\n// }\n }", "public void reset(){\n value = 0;\n }", "public void reset()\n {\n // put your code here\n position = 0;\n order = \"\";\n set[0] = 0;\n set[1] = 0;\n set[2] = 0;\n }", "public final void mo4843b(int i) {\n if (this.f2227a != null && i < this.f2227a.size()) {\n this.f2227a.remove(i);\n notifyDataSetChanged();\n }\n }", "public void replaceValueInEntry(int i, @NullableDecl V v, boolean z) {\n Preconditions.checkArgument(i != -1);\n int smearedHash = Hashing.smearedHash(v);\n int findEntryByValue = findEntryByValue(v, smearedHash);\n if (findEntryByValue != -1) {\n if (z) {\n removeEntryValueHashKnown(findEntryByValue, smearedHash);\n if (i == this.size) {\n i = findEntryByValue;\n }\n } else {\n throw new IllegalArgumentException(\"Value already present in map: \" + v);\n }\n }\n deleteFromTableVToK(i, Hashing.smearedHash(this.values[i]));\n this.values[i] = v;\n insertIntoTableVToK(i, smearedHash);\n }", "public void reset() {\n index = 0;\n }", "public void removeValue(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(VALUE$0, i);\n }\n }", "public void setNilFeeAccrBVOItemArray(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n nc.vo.crd.acc.feeaccr.feeaccrbvo.FeeAccrBVO target = null;\n target = (nc.vo.crd.acc.feeaccr.feeaccrbvo.FeeAccrBVO)get_store().find_element_user(FEEACCRBVOITEM$2, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n target.setNil();\n }\n }", "public void reset() {\n \titems.clear();\n \tsetProcessCount(0);\n }", "@Override\n public E set(int i, E e) throws IndexOutOfBoundsException {\n checkIndex(i, size);\n E temp = data[i];\n data[i] = e;\n return temp;\n }", "@Override\n\tpublic void reset(int index) {\n\t\tif (sorted) {\n\t\t\tsortedReader.reset(index);\n\t\t}\n\t}", "<E> void poke(ArrayList<E> list, int pos, E val) {\n for (int i = list.size(); i <= pos; ++i) {\n list.add(i, null);\n }\n list.set(pos, val);\n }", "@Override\n void setupState(TYPE firstItem) {\n currentItem = 0;\n }", "public void reset() {\n itemCount = 0;\n stock = new VendItem[maxItems];\n totalMoney = 0;\n userMoney = 0;\n vmStatus = null;\n }", "private void resetMarked() {\n if(!data.isEmpty()) {\n data.getFirst().reset();\n }\n for(IoBuffer buf : resetCache) {\n buf.reset();\n data.addFirst(buf);\n }\n resetCache.clear();\n }", "@Override\r\n\tpublic Buffer setInt(int pos, int i) {\n\t\treturn null;\r\n\t}", "public void resetCounts() {\n // For each item in the RecyclerView\n for(int pos = 0; pos < numItems; pos++) {\n // Reset the count variable of the item\n DataStorage.listInUse.getList().get(pos).reset();\n notifyItemChanged(pos);\n }\n }", "public void setEmpty(int index);", "@Override\r\n\tpublic void reset() {\r\n\t\tthis.priorityElements = Lists.newArrayList(originalElements);\r\n\t\tCollections.shuffle(priorityElements);\r\n\t\tthis.currentElements = Lists.newArrayListWithExpectedSize(2 * originalElements.size());\r\n\t\tthis.currentElements.addAll(originalElements);\r\n\t}", "@Override\n // worst-case complexity: O(1), only assignments and array accesses\n public T set(int index, T item) {\n if (index < size && index >= 0) {\n T prev = arr[index];\n // replace the item\n arr[index] = item;\n // return the previous item at this index\n return prev;\n }\n // else throw an exception\n throw new IndexOutOfBoundsException();\n }", "public void reset() {\n this.index = this.startIndex;\n }", "void set(int index, Object element);", "boolean removAble(InputItem item);", "public void set(int i, int value) {\n\t\tassert i < size();\n\t\tarr[i] = value;\n\t}", "public void reset() {\n position = 0;\n }", "@Override\n public void update(int i, E value) {\n if(!hasWork()) {\n throw new NoSuchElementException();\n }\n if(i < 0 || i >= size()) {\n throw new IndexOutOfBoundsException();\n }\n array[(front + i) % capacity()] = value;\n }", "public void resetCurrentElement() {\r\n\t\tcurrentNode = firstNode;\r\n\t}", "@Override\n\t\tpublic void reset(int iteration) {\n\t\t\t\n\t\t}", "public void setITEM(int value) {\r\n this.item = value;\r\n }", "public void resetForNextItem(){\n\t currentItem = iterator.next();\n\t\twhile (currentItem.getTimesCorrect() > 3){\n\t\t\tcurrentItem = iterator.next();\n\t\t}\n\t\tfirstTextBox.setText(currentItem.getStimulus());\n\t\tanswerField1.setBackground(Color.WHITE);\n\t\tanswerField1.setText(\"\");\n\t\tanswerField2.setText(\"\");\n\t\tsecondTextBox.setText(\"\");\n\t\treadyToContinue = false;\n }", "private void removeItem(int item) {\n\t\tboolean flag = false;\r\n\t\tfor(int i=0; i<index; i++) {\r\n\t\t\tif(products[i].getTag() == item) {\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"없어진 상품:\"+products[i].toString());\r\n\t\t\t\tproducts[i] = null;\r\n\t\t\t\tindex--;\r\n\t\t\t\tflag = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(flag == false)\r\n\t\t\tSystem.out.println(\"해당하는 상품이 없습니다.\");\r\n\t}", "public void Reset() \r\n {\r\n _index = -1;\r\n }", "public void reset()\n {\n currentPosition = 0;\n }", "protected void refillOnChange(int firstItemPosition){\n\t\trefillInternal(firstItemPosition-1, firstItemPosition);\n\t}", "public void unAssign(){\n\t\tthis.value = 0;\n\t}", "protected void unmark(int species, int i) {\r\n\t\tthis.markers[species][i] = false;\r\n\t}", "@Override\n\tpublic void replaceAt(int index, int e) {\n\t\t\n\t}", "synchronized void reset() {\n\n // no change if called before getValue() or called twice\n lastValue = currValue = startValue;\n }", "public void setItem(Item item) throws Exception {\n\t\tfor(int i = 0; i < last; ++i)\n\t\t\tif(list[i].getCode() == item.getCode()) {\n\t\t\t\tlist[i].increment(item.getCount());\n\t\t\t\treturn;\n\t\t\t}\n\t\tif(last < size)\n\t\t\tlist[last++] = item;\n\t\telse\n\t\t\tthrow new Exception(\"list full\");\n\t}", "public void removeItem(int i) {\n checkIndex(i);\n\n if (items[i] != null) {\n size--;\n }\n items[i] = null;\n }", "public void unReset () {\n count = lastSave;\n }", "public void update(int i, int val) {\n tree.updateTree(tree.root, i, val);\n }", "private void resetRow(int i) {\n\t\tfor (int j = 0; j < width; j++) {\n\t\t\tmatrix[i][j] = UNKNOWN;\n\t\t\tpredictions[i][j] = UNKNOWN;\n\t\t}\n\t}", "void unsetValue();", "void unsetValue();", "@Override\n\tpublic E set(int i, E e) throws IndexOutOfBoundsException {\n\t\treturn null;\n\t}", "@Override\n\tpublic void resetToExisting() {\n\t\t\n\t}", "public Object set (int i, Object t)\r\n {\r\n }", "public final void Reset()\n\t{\n\t\t_curindex = -1;\n\t}", "@Override\n\tpublic void replace(Object data, int index) throws IndexOutOfBoundsException {\n\t\t// Check for valid size first\n\t\tif (index > this.size() || index < 0) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\n\t\t// traverse through list\n\t\tNode current = head;\n\t\tint currentIndexPosistion = 0;\n\n\t\twhile (!(current == null) && currentIndexPosistion < index) {\n\t\t\tcurrentIndexPosistion++;\n\t\t\tcurrent = current.getNext();\n\t\t}\n\t\tcurrent.setElement(data);\n\t}", "void setArrayElement(int index, Object value);", "void setArrayElement(int index, Object value);", "public void setEditedItem(Object item) {editedItem = item;}", "public boolean set(O o, int index)\r\n {\r\n if (index >= count || index < 0) return false;\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=index-1;i++)\r\n {\r\n vi = vi.getNext();\r\n }\r\n \r\n vi.setObject(o);\r\n return true;\r\n \r\n }", "@Override\n public void resetAllValues() {\n }", "@Override\n public void set(int i, E e) throws IndexOutOfBoundsException {\n validIndex(i);\n data[i] = e;\n }", "@Override\n\tpublic void reset(int iteration) {\n\n\t}", "private void resetValue() {\n\t\t// TODO Auto-generated method stub\n\t\tthis.quesTxt.setText(\"\");\n\t\tthis.ansTxt.setText(\"\");\n\t\tthis.quizDescTxt.setText(\"\");\n\t\tif (this.quizTypeJcb.getItemCount() > 0) { // if type number is not 0, then select first one\n\t\t\tthis.quizTypeJcb.setSelectedIndex(0);\n\t\t}\n\t}", "public void reset() {\n this.setIndex(0);\n }", "public final void mo4840a(int i) {\n this.f2228b = i;\n notifyDataSetChanged();\n }", "@Override\n public void reset() throws IOException {\n lemmaListIndex = 0;\n lemmaList = Collections.emptyList();\n tagsList.clear();\n super.reset();\n }", "public void removeSimpleType(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(SIMPLETYPE$0, i);\n }\n }", "public void reset() {\n _valueLoaded = false;\n _value = null;\n }", "public void smeltItem()\n {\n if (this.canSmelt())\n {\n ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);\n\n if (this.furnaceItemStacks[2] == null)\n {\n this.furnaceItemStacks[2] = var1.copy();\n }\n else if (this.furnaceItemStacks[2].isItemEqual(var1))\n {\n ++this.furnaceItemStacks[2].stackSize;\n }\n\n --this.furnaceItemStacks[0].stackSize;\n\n if (this.furnaceItemStacks[0].stackSize <= 0)\n {\n this.furnaceItemStacks[0] = null;\n }\n }\n }", "void unsetValueQuantity();", "@Override\n public void update(int i, E value) {\n if(!hasWork()) {\n throw new NoSuchElementException(\"The worklist is empty\");\n }\n // if i is less than 0 or greater than size of worklist, throw exception\n if(i < 0 || i >= array.length) {\n throw new IndexOutOfBoundsException(\"This index does not exist\");\n }\n // update value\n array[i] = value;\n }", "void unsetTag();", "public void setElementAt(Object obj, int index);", "public void hapusItem(Item objItem) {\n arrItem.remove(objItem); //buang item\n }", "@Override\n public void set(int i, Node<T> e)\n {\n super.set(i, e);\n if(i == 0) \n {\n lastNode.setNext(firstNode);\n updateFirstNode();\n }\n else if(i == size - 1) lastNode = e;\n }", "public void reset () {\n lastSave = count;\n count = 0;\n }", "public void reset() {\n price = 0;\n itemNumbers.clear();\n selectedOptions.clear();\n setupGUI();\n }", "public void populate(int i) {\n int i2;\n boolean z;\n boolean z2;\n boolean z3;\n boolean z4;\n boolean z5;\n String str;\n if (this.mCurItem != i) {\n i2 = this.mCurItem < i ? 66 : 17;\n this.mLastItem = this.mCurItem;\n this.mCurItem = i;\n } else {\n i2 = 2;\n }\n if (this.mAdapter == null) {\n sortChildDrawingOrder();\n } else if (this.mPopulatePending) {\n sortChildDrawingOrder();\n } else if (getWindowToken() != null) {\n this.mAdapter.startUpdate((ViewGroup) this);\n int count = this.mAdapter.getCount();\n if (count != this.mExpectedAdapterCount) {\n try {\n str = getResources().getResourceName(getId());\n } catch (NotFoundException unused) {\n str = Integer.toHexString(getId());\n }\n StringBuilder sb = new StringBuilder(\"The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: \");\n sb.append(this.mExpectedAdapterCount);\n sb.append(\", found: \");\n sb.append(count);\n sb.append(\" Pager id: \");\n sb.append(str);\n sb.append(\" Pager class: \");\n sb.append(getClass());\n sb.append(\" Problematic adapter: \");\n sb.append(this.mAdapter.getClass());\n throw new IllegalStateException(sb.toString());\n }\n int i3 = 0;\n boolean z6 = true;\n while (i3 < this.mItems.size()) {\n ItemInfo itemInfo = this.mItems.get(i3);\n int i4 = this.mCurItem - 2;\n while (true) {\n if (i4 > this.mCurItem + 2) {\n z5 = true;\n break;\n }\n if (itemInfo.position == getRealPosition(i4)) {\n z5 = false;\n break;\n }\n i4++;\n }\n if (z5) {\n this.mAdapter.destroyItem((ViewGroup) this, itemInfo.position, itemInfo.object);\n if (this.mUseRecycler) {\n recycleView((View) itemInfo.object);\n }\n this.mItems.remove(itemInfo);\n i3--;\n z6 = false;\n }\n i3++;\n }\n for (int i5 = this.mCurItem - 1; i5 >= this.mCurItem - 2; i5--) {\n if (i5 >= 0 || needRecycle()) {\n int realPosition = getRealPosition(i5);\n Iterator<ItemInfo> it = this.mItems.iterator();\n while (true) {\n if (!it.hasNext()) {\n z3 = z6;\n z4 = false;\n break;\n }\n ItemInfo next = it.next();\n if (next.position == realPosition) {\n if (this.mChangeData) {\n refreshView(next);\n z4 = true;\n z3 = false;\n } else {\n z3 = z6;\n z4 = true;\n }\n }\n }\n if (!z4) {\n addNewItem(realPosition, 0);\n z6 = false;\n } else {\n z6 = z3;\n }\n }\n }\n for (int i6 = this.mCurItem; i6 <= this.mCurItem + 2; i6++) {\n int realPosition2 = getRealPosition(i6);\n Iterator<ItemInfo> it2 = this.mItems.iterator();\n while (true) {\n if (!it2.hasNext()) {\n z = z6;\n z2 = false;\n break;\n }\n ItemInfo next2 = it2.next();\n if (next2.position == realPosition2) {\n if (this.mChangeData) {\n refreshView(next2);\n z2 = true;\n z = false;\n } else {\n z = z6;\n z2 = true;\n }\n }\n }\n if (!z2) {\n addNewItem(realPosition2, -1);\n z6 = false;\n } else {\n z6 = z;\n }\n }\n this.mChangeData = false;\n ArrayList arrayList = new ArrayList();\n for (int i7 = this.mCurItem - 2; i7 <= this.mCurItem + 2; i7++) {\n if (i7 >= 0 || needRecycle()) {\n int realPosition3 = getRealPosition(i7);\n Iterator<ItemInfo> it3 = this.mItems.iterator();\n while (true) {\n if (!it3.hasNext()) {\n break;\n }\n ItemInfo next3 = it3.next();\n if (next3.position == realPosition3) {\n arrayList.add(next3);\n break;\n }\n }\n }\n }\n this.mItems.clear();\n this.mItems.addAll(arrayList);\n ItemInfo itemInfo2 = null;\n calculatePageOffsets(null, 0, null);\n this.mAdapter.setPrimaryItem((ViewGroup) this, this.mCurItem, (Object) null);\n if (!(!z6 || this.mAdapter == null || this.mAdapter.getRealCount() != 5 || getRight() == 0 || getBottom() == 0)) {\n requestLayout();\n }\n this.mAdapter.finishUpdate((ViewGroup) this);\n int childCount = getChildCount();\n for (int i8 = 0; i8 < childCount; i8++) {\n View childAt = getChildAt(i8);\n LayoutParams layoutParams = (LayoutParams) childAt.getLayoutParams();\n layoutParams.childIndex = i8;\n if ((!layoutParams.isDecor && layoutParams.widthFactor == 0.0f) || childCount == 1) {\n ItemInfo infoForChild = infoForChild(childAt);\n if (infoForChild != null) {\n layoutParams.widthFactor = infoForChild.widthFactor;\n layoutParams.position = infoForChild.position;\n }\n }\n }\n sortChildDrawingOrder();\n if (hasFocus()) {\n View findFocus = findFocus();\n if (findFocus != null) {\n itemInfo2 = infoForAnyChild(findFocus);\n }\n if (itemInfo2 == null || itemInfo2.position != this.mCurItem) {\n for (int i9 = 0; i9 < getChildCount(); i9++) {\n View childAt2 = getChildAt(i9);\n ItemInfo infoForChild2 = infoForChild(childAt2);\n if (infoForChild2 != null && infoForChild2.position == this.mCurItem && childAt2.requestFocus(i2)) {\n break;\n }\n }\n }\n }\n scrollTo(getRate(), 0);\n }\n }", "public void setIndex(int i) {\n\t\t\n\t}", "public void delete(Item<K,V> i) {\n if (i.getL() == null && i.getR() == null) {\n if (i.getP() != null) {\n declineChild(i, null);\n } else {\n root = null;\n }\n } else if (i.getL() != null && i.getR() != null) {\n Item<K,V> s = successor(i);\n declineChild(s, s.getR());\n i.setK(s.getK());\n i.setV(s.getV());\n } else {\n Item<K,V> x = i.getL();\n if (x == null) {\n x = i.getR();\n }\n if (i.getP() != null) {\n declineChild(i, x);\n } else {\n root = x;\n x.setP(null);\n }\n }\n size -= 1;\n }", "@Override\n public T set(int index, T element) {\n if (indexCheck(index)) {\n T previousValue = (T) data[index];\n data[index] = element;\n return previousValue;\n }\n return null;\n }", "public Object set(int index, Object element) {\n\t\tif (index < 0 || index >= this.size) {\n\t\t\tthrow new IndexOutOfBoundsException(\"the index [\" + index\n\t\t\t\t\t+ \"] is not valid for this list with the size [\"\n\t\t\t\t\t+ this.size + \"].\");\n\t\t}\n\t\tObject replaced = this.storedObjects[index];\n\t\tthis.storedObjects[index] = element;\n\n\t\treturn replaced;\n\t}", "@Override\n public void updateItem(P_CK t) {\n \n }", "private void recreateModel() {\n items = null;\n didItCountAlready = false;\n }", "public Item setBack (Item item) {\n if(isEmpty()) throw new NoSuchElementException(\"Failed to setBack, because DList is empty!\") ;\n // update the value of the last actual node (the last node itself is a sentinel node)\n Item oldValue = last.prev.data; \n last.prev.data = item;\n return oldValue;\n }", "public void setValueArray(int i, amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value value)\n {\n synchronized (monitor())\n {\n check_orphaned();\n amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value target = null;\n target = (amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value)get_store().find_element_user(VALUE$0, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n target.set(value);\n }\n }", "public void set(T t, int i) {\n try {\n this.field.set(t, Integer.valueOf(i));\n } catch (IllegalAccessException e) {\n throw new AssertionError(e);\n }\n }", "public void setObject(int i, T obj);", "@Override\n\tpublic void reset() {\n\t\tfor(int i=0; i<mRemainedCounters; i++){\n\t\t\tfinal ICounter counter = this.mCounters.getFirst();\n\t\t\tcounter.reset();\n\t\t\tthis.mCounters.removeFirst();\n\t\t\tthis.mCounters.addLast(counter);\n\t\t}\n\t\tthis.mRemainedCounters = this.mCounters.size();\n\t}" ]
[ "0.5916928", "0.5900681", "0.559058", "0.55118686", "0.5487268", "0.5473462", "0.5439869", "0.54114777", "0.5376857", "0.5362751", "0.5358854", "0.5275079", "0.5269612", "0.5267863", "0.5266612", "0.52467936", "0.52265394", "0.5191399", "0.5189307", "0.5180743", "0.51797026", "0.51737773", "0.51641923", "0.51611024", "0.5151411", "0.5100255", "0.50991136", "0.50915986", "0.5084063", "0.5049516", "0.50431514", "0.50418437", "0.50330526", "0.50191206", "0.5008273", "0.500106", "0.49872532", "0.49855924", "0.49555987", "0.49533322", "0.49479648", "0.4941863", "0.49399686", "0.49216938", "0.491663", "0.49159777", "0.4911836", "0.4907043", "0.48982418", "0.48960182", "0.487347", "0.48589718", "0.48548704", "0.48539665", "0.48449185", "0.48404723", "0.48389065", "0.4838544", "0.48357624", "0.48303953", "0.48303953", "0.4827211", "0.48265362", "0.48236555", "0.48200187", "0.4817589", "0.4813562", "0.4813562", "0.48112845", "0.4801774", "0.47984695", "0.47972408", "0.47969738", "0.47899708", "0.47892308", "0.47811106", "0.4760463", "0.47538307", "0.47503924", "0.4748044", "0.47476944", "0.47457367", "0.4742262", "0.47348902", "0.47343647", "0.47311804", "0.472927", "0.47278288", "0.47224942", "0.47188327", "0.4716103", "0.47082126", "0.46953905", "0.46951538", "0.46945632", "0.46931887", "0.46914464", "0.46905035", "0.4683105", "0.46777675" ]
0.6662303
0
Simulates CAS operation. 1. Check if expected value is present. 1a. If not present, exit (fail). 1b. Otherwise, update value (success).
private boolean cas(int i, long e, long y) { synchronized (data) { if (data[i] != e) return false; // 1, 1a data[i] = y; // 1b return true; // 1b } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public boolean casValue(AbstractFuture<?> future, Object expect, Object update) {\n boolean z;\n synchronized (future) {\n if (((AbstractFuture) future).value == expect) {\n ((AbstractFuture) future).value = update;\n z = true;\n } else {\n z = false;\n }\n }\n return z;\n }", "@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public boolean casValue(AbstractFuture<?> future, Object expect, Object update) {\n return this.valueUpdater.compareAndSet(future, expect, update);\n }", "@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public boolean casValue(AbstractFuture<?> future, Object expect, Object update) {\n return UNSAFE.compareAndSwapObject(future, VALUE_OFFSET, expect, update);\n }", "public abstract boolean casValue(AbstractFuture<?> abstractFuture, Object obj, Object obj2);", "public void testCompareAndSet() {\n AtomicLong ai = new AtomicLong(1);\n assertTrue(ai.compareAndSet(1, 2));\n assertTrue(ai.compareAndSet(2, -4));\n assertEquals(-4, ai.get());\n assertFalse(ai.compareAndSet(-5, 7));\n assertEquals(-4, ai.get());\n assertTrue(ai.compareAndSet(-4, 7));\n assertEquals(7, ai.get());\n }", "@Test\n public void shouldReturnConflictIfCompareAndSetFailsBecauseAKeyAlreadyExistsExceptionIsThrown() {\n final SetValue newKeyValue = new SetValue();\n newKeyValue.setExpectedValue(null);\n newKeyValue.setNewValue(NEW_VALUE);\n\n when(distributedStore.compareAndSet(KEY, newKeyValue)).thenReturn(Futures.<KeyValue>immediateFailedFuture(new KeyAlreadyExistsException(KEY)));\n\n assertThatResourceMethodReturnsStatus(\n client().resource(REQUEST_URI).type(MediaType.APPLICATION_JSON_TYPE).entity(newKeyValue),\n \"PUT\",\n ClientResponse.Status.CONFLICT\n );\n }", "@Override\n\tpublic <T> boolean cas(String arg0, int arg1, CASOperation<T> arg2)\n\t\t\tthrows TimeoutException, InterruptedException, MemcachedException {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean cas(String arg0, int arg1, Object arg2, long arg3, long arg4)\n\t\t\tthrows TimeoutException, InterruptedException, MemcachedException {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean cas(String arg0, int arg1, Object arg2, long arg3)\n\t\t\tthrows TimeoutException, InterruptedException, MemcachedException {\n\t\treturn false;\n\t}", "<T> T cas(String variable, T expectedValue, T newValue, int... indexes) throws ClassCastException, ArrayIndexOutOfBoundsException;", "@Override\n\tpublic <T> boolean cas(String arg0, CASOperation<T> arg1)\n\t\t\tthrows TimeoutException, InterruptedException, MemcachedException {\n\t\treturn false;\n\t}", "@Override\n\tpublic <T> boolean cas(String arg0, int arg1, CASOperation<T> arg2,\n\t\t\tTranscoder<T> arg3) throws TimeoutException, InterruptedException,\n\t\t\tMemcachedException {\n\t\treturn false;\n\t}", "long getAndSet(long newValue);", "public void testGetAndSet() {\n AtomicLong ai = new AtomicLong(1);\n assertEquals(1, ai.getAndSet(0));\n assertEquals(0, ai.getAndSet(-10));\n assertEquals(-10, ai.getAndSet(1));\n }", "public boolean compareAndSet\n (int i, long e, long y) {\n return cas(i, newValue(e), newValue(y)); // 1, 2, 3\n }", "public synchronized boolean testAndSet() {\n boolean oldValue = value_;\n value_ = true;\n return oldValue;\n }", "@Override\n\tpublic <T> boolean cas(String arg0, int arg1, T arg2, Transcoder<T> arg3,\n\t\t\tlong arg4, long arg5) throws TimeoutException,\n\t\t\tInterruptedException, MemcachedException {\n\t\treturn false;\n\t}", "@Override\n\tpublic <T> boolean cas(String arg0, int arg1, GetsResponse<T> arg2,\n\t\t\tCASOperation<T> arg3, Transcoder<T> arg4) throws TimeoutException,\n\t\t\tInterruptedException, MemcachedException {\n\t\treturn false;\n\t}", "@Override\n\tpublic <T> boolean cas(String arg0, int arg1, GetsResponse<T> arg2,\n\t\t\tCASOperation<T> arg3) throws TimeoutException,\n\t\t\tInterruptedException, MemcachedException {\n\t\treturn false;\n\t}", "@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public boolean casWaiters(AbstractFuture<?> future, Waiter expect, Waiter update) {\n return UNSAFE.compareAndSwapObject(future, WAITERS_OFFSET, expect, update);\n }", "private boolean setSuccess0(V result)\r\n/* 407: */ {\r\n/* 408:494 */ if (isDone()) {\r\n/* 409:495 */ return false;\r\n/* 410: */ }\r\n/* 411:498 */ synchronized (this)\r\n/* 412: */ {\r\n/* 413:500 */ if (isDone()) {\r\n/* 414:501 */ return false;\r\n/* 415: */ }\r\n/* 416:503 */ if (result == null) {\r\n/* 417:504 */ this.result = SUCCESS;\r\n/* 418: */ } else {\r\n/* 419:506 */ this.result = result;\r\n/* 420: */ }\r\n/* 421:508 */ if (hasWaiters()) {\r\n/* 422:509 */ notifyAll();\r\n/* 423: */ }\r\n/* 424: */ }\r\n/* 425:512 */ return true;\r\n/* 426: */ }", "@Override\n\tpublic <T> boolean cas(String arg0, GetsResponse<T> arg1,\n\t\t\tCASOperation<T> arg2) throws TimeoutException,\n\t\t\tInterruptedException, MemcachedException {\n\t\treturn false;\n\t}", "public boolean set(V value2) {\n Object valueToSet;\n if (value2 == null) {\n valueToSet = NULL;\n } else {\n valueToSet = value2;\n }\n if (!ATOMIC_HELPER.casValue(this, null, valueToSet)) {\n return false;\n }\n complete(this);\n return true;\n }", "@Override\n\tpublic <T> boolean cas(String arg0, int arg1, T arg2, Transcoder<T> arg3,\n\t\t\tlong arg4) throws TimeoutException, InterruptedException,\n\t\t\tMemcachedException {\n\t\treturn false;\n\t}", "public void testGetSet() {\n AtomicLong ai = new AtomicLong(1);\n assertEquals(1, ai.get());\n ai.set(2);\n assertEquals(2, ai.get());\n ai.set(-3);\n assertEquals(-3, ai.get());\n }", "public void testCompareAndSetInMultipleThreads() throws Exception {\n final AtomicLong ai = new AtomicLong(1);\n Thread t = new Thread(new CheckedRunnable() {\n public void realRun() {\n while (!ai.compareAndSet(2, 3))\n Thread.yield();\n }});\n\n t.start();\n assertTrue(ai.compareAndSet(1, 2));\n t.join(LONG_DELAY_MS);\n assertFalse(t.isAlive());\n assertEquals(3, ai.get());\n }", "@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public boolean casWaiters(AbstractFuture<?> future, Waiter expect, Waiter update) {\n return this.waitersUpdater.compareAndSet(future, expect, update);\n }", "@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public boolean casWaiters(AbstractFuture<?> future, Waiter expect, Waiter update) {\n boolean z;\n synchronized (future) {\n if (((AbstractFuture) future).waiters == expect) {\n ((AbstractFuture) future).waiters = update;\n z = true;\n } else {\n z = false;\n }\n }\n return z;\n }", "public getValue_result(getValue_result other) {\n if (other.isSetSuccess()) {\n this.success = other.success;\n }\n }", "StoreResponse cas(Long cas_key, CACHE_ELEMENT e);", "public void testWeakCompareAndSet() {\n AtomicLong ai = new AtomicLong(1);\n do {} while (!ai.weakCompareAndSet(1, 2));\n do {} while (!ai.weakCompareAndSet(2, -4));\n assertEquals(-4, ai.get());\n do {} while (!ai.weakCompareAndSet(-4, 7));\n assertEquals(7, ai.get());\n }", "public static void main(String[] args) {\n Simple simple = new Simple(\"James\", 29);\n //AtomicReference --> creates possible ABA problem\n AtomicReference<Simple> atomicSimple= new AtomicReference<>(simple);\n System.out.println(atomicSimple.get());\n //expect false\n boolean falseResult = atomicSimple.compareAndSet(new Simple(\"Henry\", 22), new Simple(\"Andy\", 23));\n System.out.println(falseResult);\n boolean falseResult1 = atomicSimple.compareAndSet(new Simple(\"James\",29), new Simple(\"Andy\", 23));\n System.out.println(falseResult1);\n boolean result = atomicSimple.compareAndSet(simple, new Simple(\"Andy\", 23));\n System.out.println(result);\n }", "@NonBlocking\n void success(T value);", "Object setValue(Object value) throws NullPointerException;", "@Test\n public void testNotNullValues() throws Throwable {\n final byte[] rawFooValue = Tools.getBytesUtf8(\"Hello foo!\");\n final byte[] rawBarValue = Tools.getBytesUtf8(\"Hello bar!\");\n\n AsyncConsistentMap<String, byte[]> map =\n DistributedPrimitives.newNotNullMap(newPrimitive(\"testNotNullValues\"));\n\n map.get(\"foo\")\n .thenAccept(v -> assertNull(v)).join();\n map.put(\"foo\", null)\n .thenAccept(v -> assertNull(v)).join();\n map.put(\"foo\", rawFooValue).thenAccept(v -> assertNull(v)).join();\n map.get(\"foo\").thenAccept(v -> {\n assertNotNull(v);\n assertTrue(Arrays.equals(v.value(), rawFooValue));\n }).join();\n map.put(\"foo\", null).thenAccept(v -> {\n assertNotNull(v);\n assertTrue(Arrays.equals(v.value(), rawFooValue));\n }).join();\n map.get(\"foo\").thenAccept(v -> assertNull(v)).join();\n map.replace(\"foo\", rawFooValue, null)\n .thenAccept(replaced -> assertFalse(replaced)).join();\n map.replace(\"foo\", null, rawBarValue)\n .thenAccept(replaced -> assertTrue(replaced)).join();\n map.get(\"foo\").thenAccept(v -> {\n assertNotNull(v);\n assertTrue(Arrays.equals(v.value(), rawBarValue));\n }).join();\n map.replace(\"foo\", rawBarValue, null)\n .thenAccept(replaced -> assertTrue(replaced)).join();\n map.get(\"foo\").thenAccept(v -> assertNull(v)).join();\n }", "private boolean compareAndSet(long version, V newValue) {\n VersionedValue<V> result =\n versionedValue.updateAndGet(prev -> prev.getVersion()==version ?\n new VersionedValue<>(prev.getVersion() + 1, newValue) : prev);\n return result.getVersion()!=version;\n }", "@Test\r\n public void testThreaded() throws Exception {\r\n\r\n final ClientValue<Integer> value = new ClientValue<>();\r\n\r\n List<SetCheckValue> runs = new ArrayList<>();\r\n\r\n for (int i = 0; i < 500; i++) {\r\n runs.add(new SetCheckValue(value, i, false));\r\n }\r\n runAll(runs);\r\n checkForSuccess(runs);\r\n for (int i = 0; i < 500; i++) {\r\n runs.add(new SetCheckValue(value, i, true));\r\n }\r\n\r\n runAll(runs);\r\n checkForSuccess(runs);\r\n }", "@Test\n public void testCoh3710_containsValue()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run()\n {\n assertFalse(getNamedCache(getCacheName0()).containsValue(Integer.valueOf(1)));\n }\n });\n }", "static private <T> boolean setIfDifferent(Channel<T> ch, T value) throws CAException, TimeoutException {\n if (!value.equals(ch.getFirst())) {\n ch.setValue(value);\n return true;\n } else {\n return false;\n }\n }", "@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public boolean casListeners(AbstractFuture<?> future, Listener expect, Listener update) {\n return this.listenersUpdater.compareAndSet(future, expect, update);\n }", "public void testAddAndGet() {\n AtomicLong ai = new AtomicLong(1);\n assertEquals(3, ai.addAndGet(2));\n assertEquals(3, ai.get());\n assertEquals(-1, ai.addAndGet(-4));\n assertEquals(-1, ai.get());\n }", "@Test\n public void shouldReturnBadRequestIfPutMethodIsMadeAndNeitherNewValueNorExpectedValueAreSetInSetValue() {\n SetValue emptyValue = new SetValue();\n assertThatResourceMethodReturnsStatus(\n client().resource(REQUEST_URI).type(MediaType.APPLICATION_JSON_TYPE).entity(emptyValue),\n \"PUT\",\n ClientResponse.Status.BAD_REQUEST);\n }", "static void perform_xchg(String passed){\n\t\tint type = type_of_xchg(passed);\n\t\tif(type==1)\n\t\t\txchg_de_with_hl(passed);\n\t}", "@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public boolean casListeners(AbstractFuture<?> future, Listener expect, Listener update) {\n boolean z;\n synchronized (future) {\n if (((AbstractFuture) future).listeners == expect) {\n ((AbstractFuture) future).listeners = update;\n z = true;\n } else {\n z = false;\n }\n }\n return z;\n }", "boolean isValueLocked();", "@Test\n public void testPut_ExistingNoChange() {\n map.put(\"Hello\", \"World\");\n configureAnswer();\n\n testObject.put(\"Hello\", \"World\");\n\n verifyZeroInteractions(helper);\n }", "public boolean compareAndSet\n (int[] i, long[] e, long y) {\n int I = i.length; // 1\n long[] x = new long[I]; // 1\n for (int o=0; o<I; o++) // 1\n x[o] = newValue(e[o]); // 1\n return kcss(i, x, newValue(y)); // 2, 3\n }", "boolean casEntriesArrayInt(int item, OFFSET offset, int expected, int value) {\n return unsafe.compareAndSwapInt(entries,\n Unsafe.ARRAY_INT_BASE_OFFSET + (item + offset.value) * Unsafe.ARRAY_INT_INDEX_SCALE,\n expected, value);\n }", "@Test\r\n\tpublic void testPortfolioValueUpdate1() {\n\t\tassertTrue(\"Portfolio value must reflect current data\", false);\r\n\t}", "@Request(id = 19, retryable = false, response = ResponseMessageConst.BOOLEAN)\n Object putIfAbsent(String name, Data key, Data value, @Nullable Data expiryPolicy, int completionId);", "public updateUserInfo_result(updateUserInfo_result other) {\n __isset_bit_vector.clear();\n __isset_bit_vector.or(other.__isset_bit_vector);\n this.success = other.success;\n }", "@Test\n public void testCaseOfInputEqualsMatchFunction() {\n AtomicBoolean success = new AtomicBoolean(false);\n int expected = 42;\n match(expected).caseObj(Optional::ofNullable, s -> success.set(s == expected));\n\n assertTrue(success.get());\n }", "public void testIncrementAndGet() {\n AtomicLong ai = new AtomicLong(1);\n assertEquals(2, ai.incrementAndGet());\n assertEquals(2, ai.get());\n ai.set(-2);\n assertEquals(-1, ai.incrementAndGet());\n assertEquals(0, ai.incrementAndGet());\n assertEquals(1, ai.incrementAndGet());\n assertEquals(1, ai.get());\n }", "public Value putIfExists(Key key, Value value) {\r\n\t\t\tdata.reset();\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < data.size(); i++) {\r\n\t\t\t\tif (data.get().getKey().compareTo(key) == 0) {\r\n\t\t\t\t\tValue ret = data.get().getValue();\r\n\t\t\t\t\tdata.get().setValue(value);\r\n\t\t\t\t\treturn ret;\r\n\t\t\t\t}\r\n\t\t\t\tdata.next();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn null;\r\n\t\t}", "public void testValide() {\n System.out.println(\"valide\");\n Utilisateur utilisateur = null;\n ConcurrentHashMap expResult = null;\n ConcurrentHashMap result = Utilisateur.valide(utilisateur);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "boolean setValueForNode(Node node, TargetValue value) {\n\n // Assert integrity of target value. Other parts of code assume shared identities for bottom (UNDEFINED) and top\n // (NOT_A_CONSTANT) values. Maybe we should change this? But at least we don't fail silently now.\n\n assert !value.equals(TargetValue.getUnknown()) || value.equals(UNDEFINED);\n assert !value.equals(TargetValue.getBad()) || value.equals(NOT_A_CONSTANT);\n\n TargetValue oldValue = this.getValueForNode(node);\n TargetValue newValue = join(oldValue, value);\n\n // System.out.println(describe(oldValue) + \" ⊔ \" + describe(value) + \" = \" + describe(newValue) + \"\\t\" + node);\n\n this.values.put(node, newValue);\n\n return !oldValue.equals(newValue);\n }", "protected abstract boolean _setIfAbsent(String key, Object value, Date expires);", "public abstract boolean setValue(Value value, boolean asAssignment);", "@Override\n public final SoyValue resolve() {\n SoyValue localResolvedValue = resolvedValue;\n if (localResolvedValue == null) {\n localResolvedValue = compute();\n for (ValueAssertion curr = valueAssertion; curr != null; curr = curr.next) {\n curr.check(localResolvedValue);\n }\n resolvedValue = localResolvedValue;\n valueAssertion = null;\n }\n return localResolvedValue;\n }", "boolean updateValue() {\n boolean ret;\n\n if (Math.abs(curUtilityValue - nextUtilityValue) < Math.abs(curUtilityValue) * MAX_ERR_PERCENT / 100)\n ret = true;\n else {\n ret = false;\n // System.out.println(\" no match cell: x: \"+x+\" y: \"+y);\n }\n curUtilityValue = nextUtilityValue;\n return ret;\n\n }", "@Test\n public void reentrantCallAfterPut() {\n byte[] data = ABIUtil.encodeMethodArguments(\"resetStorage\");\n byte[] txDataMethodArguments = ABIUtil.encodeMethodArguments(\"reentrantCallAfterPut\", dappAddr, data);\n AvmRule.ResultWrapper resultWrapper = avmRule.call(from, dappAddr, BigInteger.ZERO, txDataMethodArguments, energyLimit, energyPrice);\n Assert.assertTrue(resultWrapper.getReceiptStatus().isSuccess());\n long costWithoutResettingStorage = 164702;\n long executionCost = costWithoutResettingStorage + 29 * 5 +\n 5 * RuntimeMethodFeeSchedule.BlockchainRuntime_avm_resetStorage;\n Assert.assertEquals(executionCost - 5 * RuntimeMethodFeeSchedule.BlockchainRuntime_avm_deleteStorage_refund, energyLimit - resultWrapper.getTransactionResult().getEnergyRemaining());\n\n byte[] key = new byte[32];\n key[0] = 0x1;\n txDataMethodArguments = ABIUtil.encodeMethodArguments(\"getStorage\", key);\n resultWrapper = avmRule.call(from, dappAddr, BigInteger.ZERO, txDataMethodArguments, energyLimit, energyPrice);\n Assert.assertTrue(resultWrapper.getReceiptStatus().isSuccess());\n Assert.assertArrayEquals(null, (byte[]) resultWrapper.getDecodedReturnData());\n }", "@Test\n public void testPut_Existing() {\n map.put(\"Hello\", \"Old World\");\n configureAnswer();\n\n testObject.put(\"Hello\", \"World\");\n\n verify(helper).fireReplace(entry(\"Hello\", \"Old World\"), entry(\"Hello\", \"World\"));\n\n verifyNoMoreInteractions(helper);\n }", "@Test\n public void testPut_NonExisting() {\n configureAnswer();\n\n testObject.put(\"Hello\", \"World\");\n\n verify(helper).fireAdd(entry(\"Hello\", \"World\"));\n\n verifyNoMoreInteractions(helper);\n }", "public abstract boolean casWaiters(AbstractFuture<?> abstractFuture, Waiter waiter, Waiter waiter2);", "void setValueLocked(boolean valueLocked);", "private void checkAndSet() {\n if (value == null) {\n throw new IllegalArgumentException(EXC_NodeCannotBeNull());\n }\n\n if (equalNodes(value, selectedNodes)) {\n return;\n }\n\n List<Node> validNodes = null;\n for (int i = 0; i < value.length; i++) {\n if (value[i] == null) {\n throw new IllegalArgumentException(EXC_NoElementOfNodeSelectionMayBeNull());\n }\n \n if (!isUnderRoot(value[i])) {\n if (validNodes == null) {\n validNodes = new ArrayList<Node>(value.length);\n for (int j = 0; j < i; j++) {\n validNodes.add(value[j]);\n }\n }\n } else if (validNodes != null) {\n validNodes.add(value[i]);\n }\n }\n if (validNodes != null) {\n newValue = validNodes.toArray(new Node[validNodes.size()]);\n if (equalNodes(newValue, selectedNodes)) {\n return;\n } \n } else {\n newValue = value;\n }\n\n if ((newValue.length != 0) && (vetoableSupport != null)) {\n try {\n // we send the vetoable change event only for non-empty selections\n vetoableSupport.fireVetoableChange(PROP_SELECTED_NODES, selectedNodes, newValue);\n } catch (PropertyVetoException ex) {\n veto = ex;\n return;\n }\n }\n updateSelection();\n }", "public void validate(String key, Value oldValue, Value newValue, PutResult result);", "@Test\n @Transactional\n public void test_pessimistic_lock__separate_transactions__forUpdate_doesnot_update() throws InterruptedException {\n AtomicLong waited = new AtomicLong(-1);\n AtomicBoolean expectedValueFound = new AtomicBoolean(false);\n URI atomURI = newAtomURI();\n executeInSeparateThreadAndWaitForResult(() -> {\n Atom atom = new Atom();\n atom.setAtomURI(atomURI);\n atom.setState(AtomState.ACTIVE);\n AtomMessageContainer container = new AtomMessageContainer(atom, atom.getAtomURI());\n atom = atomRepository.save(atom);\n });\n Thread parallelThread1 = new Thread(() -> helper.doInSeparateTransaction(() -> {\n Optional<Atom> b = atomRepository.findOneByAtomURIForUpdate(atomURI);\n logger.debug(\"read in other thread: \" + b);\n }));\n parallelThread1.start();\n Thread.sleep(100);\n Thread parallelThread2 = new Thread(() -> helper.doInSeparateTransaction(() -> {\n Optional<Atom> a = atomRepository.findOneByAtomURIForUpdate(atomURI);\n logger.debug(\"read in yet another thread: \" + a);\n logger.debug(\"blocking...\");\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n a.get().setCreationDate(new Date(1));\n atomRepository.save(a.get());\n }));\n parallelThread2.start();\n Thread.sleep(100);\n Thread parallelThread3 = new Thread(() -> helper.doInSeparateTransaction(() -> {\n Optional<Atom> b = atomRepository.findOneByAtomURI(atomURI);\n logger.debug(\"acquiring exclusive lock...\");\n long now = System.currentTimeMillis();\n b = atomRepository.findOneByAtomURIForUpdate(atomURI);\n logger.debug(\"read in the third thread: \" + b);\n logger.debug(\"waited: \" + (System.currentTimeMillis() - now));\n waited.set(System.currentTimeMillis() - now);\n expectedValueFound.set(b.get().getCreationDate().getTime() != 1);\n }));\n parallelThread3.start();\n logger.debug(\"waiting for parallel threads to finish\");\n parallelThread1.join();\n parallelThread2.join();\n parallelThread3.join();\n Assert.assertTrue(\"thread should have been blocked at least 500ms\", waited.get() > 500);\n Assert.assertTrue(\"thread3 did not get update by thread2\", expectedValueFound.get());\n }", "@Test(timeout = 30_000)\n public void setAndWait(TestContext should) {\n final int runs = 10;\n final Async test = should.async(runs);\n\n Redis.createClient(rule.vertx(), options).connect().onComplete(should.asyncAssertSuccess(cluster -> {\n for (int i = 0; i < runs; i++) {\n cluster.send(cmd(SET).arg(\"key\").arg(\"value\")).onComplete(should.asyncAssertSuccess(setResponse -> {\n should.assertEquals(\"OK\", setResponse.toString().toUpperCase());\n\n cluster.send(cmd(WAIT).arg(1).arg(2000)).onComplete(should.asyncAssertSuccess(waitResponse -> {\n should.assertEquals(1, waitResponse.toInteger());\n test.countDown();\n }));\n }));\n }\n }\n ));\n }", "private int ensureValue(Info info, Object value) {\n if (value == null) throw new IllegalArgumentException(\"State value cannot be null.\");\r\n\r\n int index = info.states.indexOf(value);\r\n if (index != -1) return index;\r\n if (info == getRoot()) {\r\n // Add state to root node\r\n info.states.add(value);\r\n info.countTable.resize(new int[] { info.states.size() }, countInitializer);\r\n\r\n // Ensure sums is well defined\r\n // info.sums[0] += countInitializer;\r\n \r\n // Iterate resizing lower nodes\r\n for (Iterator<Tree.Node<Info>> it = tree.getRoot().iterator(); it.hasNext();) {\r\n Tree.Node<Info> childNode = it.next();\r\n Info childInfo = childNode.getData();\r\n childNode.getData().countTable.resize(new int[] { info.states.size(), childInfo.states.size() }, countInitializer);\r\n // childInfo.sums = ArrayUtils.add(childInfo.sums, countInitializer);\r\n }\r\n }\r\n else {\r\n info.states.add(value);\r\n info.countTable.resize(new int[] { getRoot().states.size(), info.states.size() }, countInitializer);\r\n }\r\n \r\n return info.states.size() - 1;\r\n }", "@Override\r\n\t\tpublic boolean contains(E value) {\n\t\t\tsynchronized (mutex) {\r\n\t\t\t\treturn pair.contains(value);\r\n\t\t\t}\r\n\t\t}", "@Test\r\n\tpublic void testPortfolioValueUpdate2() {\n\t\tassertTrue(\"Portfolio value must reflect current data\", false);\r\n\t}", "@Test\n public void testSet() throws InterruptedException {\n\n final String k = \"mLock\";\n final String v = \"mValue\";\n\n// long l = 10;\n// Boolean isGetLock = redisTemplate.opsForValue().setIfAbsent(k, v, l, TimeUnit.SECONDS);\n// if (isGetLock) {\n// System.out.println(Thread.currentThread().getName() + \"获得锁成功\");\n// }\n\n\n// redisTemplate.opsForValue().set(\"k6\", \"v6\");\n// Duration duration = Duration.ofSeconds(10);\n// redisTemplate.expire(k, duration);\n// TimeUnit.SECONDS.sleep(10);\n// for (int i = 0; i < 100; i++) {\n// new Thread(() -> {\n// Boolean isGetLock = redisTemplate.opsForValue().setIfAbsent(k, v, 100, TimeUnit.SECONDS);\n//\n// if (isGetLock) {\n// System.out.println(Thread.currentThread().getName() + \"获得锁成功\");\n// } else {\n// System.out.println(Thread.currentThread().getName() + \"获得锁失败\");\n// }\n// }, \"thread-\" + i).start();\n// }\n\n for (int i = 0; i < 100; i++) {\n String key = \"kk\" +i;\n String value = \"vv\" + i;\n\n redisTemplate.opsForValue().set(key, value);\n// new Thread(new Task(key, value, redisTemplate)).start();\n// new Thread(() -> {\n// System.out.println(\"set \" + key + \":\" +value);\n// redisTemplate.opsForValue().set(key, value);\n//\n// if(key.equals(\"kk99\")) {\n// System.out.println(\"haha\");\n// }\n// }).start();\n }\n }", "public void testGetAndIncrement() {\n AtomicLong ai = new AtomicLong(1);\n assertEquals(1, ai.getAndIncrement());\n assertEquals(2, ai.get());\n ai.set(-2);\n assertEquals(-2, ai.getAndIncrement());\n assertEquals(-1, ai.getAndIncrement());\n assertEquals(0, ai.getAndIncrement());\n assertEquals(1, ai.get());\n }", "boolean isSetValue();", "boolean isSetValue();", "public void testGetLazySet() {\n AtomicLong ai = new AtomicLong(1);\n assertEquals(1, ai.get());\n ai.lazySet(2);\n assertEquals(2, ai.get());\n ai.lazySet(-3);\n assertEquals(-3, ai.get());\n }", "@Override\r\n\tpublic boolean pushValuesForward() {\r\n\t\tboolean mod = false;\r\n\r\n\t\tValue in0 = getDataPorts().get(0).getValue();\r\n\r\n\t\tint newSize = in0.getSize();\r\n\t\tboolean isSigned = in0.isSigned();\r\n\r\n\t\tValue newValue = new Value(newSize, isSigned);\r\n\r\n\t\tfor (int i = 0; i < newSize; i++) {\r\n\t\t\tBit bit = in0.getBit(i);\r\n\r\n\t\t\tif (!bit.isCare()) {\r\n\t\t\t\t/*\r\n\t\t\t\t * Don't-cares will be ignored going forward.\r\n\t\t\t\t */\r\n\t\t\t\tnewValue.setBit(i, Bit.DONT_CARE);\r\n\t\t\t} else if (bit.isConstant()) {\r\n\t\t\t\t/*\r\n\t\t\t\t * Push the inversion of the constant.\r\n\t\t\t\t */\r\n\t\t\t\tnewValue.setBit(i, bit.isOn() ? Bit.ZERO : Bit.ONE);\r\n\t\t\t} else {\r\n\t\t\t\t/*\r\n\t\t\t\t * Otherwise just push a generic CARE until we're sure that\r\n\t\t\t\t * there's a Value on the result Bus.\r\n\t\t\t\t */\r\n\t\t\t\tnewValue.setBit(0, Bit.CARE);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// update all bits above the carry out bit to be signed\r\n\t\t// extended of carry out bit\r\n\t\tif (getResultBus().getValue() != null) {\r\n\t\t\tif (!in0.isConstant()) {\r\n\t\t\t\tint compactedSize = Math.min(newSize, in0.getCompactedSize());\r\n\t\t\t\tBit carryoutBit = getResultBus().getValue().getBit(\r\n\t\t\t\t\t\tcompactedSize - 1);\r\n\r\n\t\t\t\tfor (int i = compactedSize; i < newSize; i++) {\r\n\t\t\t\t\tif (newValue.getBit(i) != Bit.DONT_CARE)\r\n\t\t\t\t\t\tnewValue.setBit(i, carryoutBit);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tmod |= getResultBus().pushValueForward(newValue);\r\n\r\n\t\tfor (int i = 0; i < newSize; i++) {\r\n\t\t\tBit bit = in0.getBit(i);\r\n\t\t\tif (!bit.isGlobal()) {\r\n\t\t\t\t/*\r\n\t\t\t\t * Set the inversion shortcut if appropriate.\r\n\t\t\t\t */\r\n\t\t\t\tgetResultBus().getValue().getBit(i).setInvertedBit(bit);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn mod;\r\n\t}", "@Test\n public void testPutAll_ExistingNoChange() {\n Map<String, String> toAdd = fillMap(1, 10);\n\n map.putAll(toAdd);\n\n Map<String, String> toUpdate = fillMap(1, 10);\n\n configureAnswer();\n testObject.putAll(toUpdate);\n\n verifyZeroInteractions(helper);\n }", "@Test\n public void testOtherwise() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).otherwise(s -> success.set(true));\n\n assertTrue(success.get());\n }", "public void testFairBlockingPut() {\n Thread t = new Thread(new Runnable() {\n public void run() {\n try {\n SynchronousQueue q = new SynchronousQueue(true);\n q.put(zero);\n threadShouldThrow();\n } catch (InterruptedException ie){\n }\n }});\n t.start();\n try {\n Thread.sleep(SHORT_DELAY_MS);\n t.interrupt();\n t.join();\n }\n catch (InterruptedException ie) {\n\t unexpectedException();\n }\n }", "public void produce(@Nullable V value) {\n synchronized (LOCK) {\n // Look for a non-cancelled future\n while (myWaitingFutures.size() >= 1) {\n SettableFuture<V> future = myWaitingFutures.remove();\n if (future.set(value)) {\n return;\n }\n }\n\n // If none found, enqueue the value for later\n myValues.add(new Entry(value));\n }\n }", "public like_result(like_result other) {\n __isset_bit_vector.clear();\n __isset_bit_vector.or(other.__isset_bit_vector);\n this.success = other.success;\n }", "public final void add(@NotNull T value) {\n\t\tObject priorValue;\n\t\tboolean replaced;\n\t\tdo {\n\t\t\tpriorValue = this.value.get();\n\t\t\tObject newValue = combine(priorValue, value);\n\t\t\treplaced = this.value.compareAndSet(priorValue, newValue);\n\t\t} while (!replaced);\n\t}", "@Test\n public void testCaseOfGetsSameObjectAsInput() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseOf(i -> true, s -> success.set(true));\n\n assertTrue(success.get());\n }", "@Test\n public void testTransactional() throws Throwable {\n final List<MagicKey> keys = init();\n final CountDownLatch l = new CountDownLatch(1);\n final AtomicBoolean rollback = new AtomicBoolean(false);\n\n Future<Void> future = fork(() -> {\n try {\n // start a transaction on c1.\n TransactionManager t1 = TestingUtil.getTransactionManager(c1);\n t1.begin();\n c1.put(keys.get(0), \"transactionally_replaced\");\n Transaction tx = t1.getTransaction();\n tx.enlistResource(new XAResourceAdapter() {\n public int prepare(Xid id) {\n // this would be called *after* the cache prepares.\n try {\n log.debug(\"Unblocking commit\");\n l.await();\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n }\n return XAResource.XA_OK;\n }\n });\n t1.commit();\n } catch (Exception e) {\n log.error(\"Error committing transaction\", e);\n rollback.set(true);\n throw new RuntimeException(e);\n }\n });\n\n log.info(\"Invoking rehash event\");\n performRehashEvent(true);\n l.countDown();\n future.get(30, TimeUnit.SECONDS);\n\n //ownership can only be verified after the rehashing has completed\n waitForRehashCompletion();\n log.info(\"Rehash complete\");\n\n //only check for these values if tx was not rolled back\n if (!rollback.get()) {\n // the ownership of k1 might change during the tx and a cache might end up with it in L1\n assertOwnershipAndNonOwnership(keys.get(0), true);\n assertOwnershipAndNonOwnership(keys.get(1), false);\n assertOwnershipAndNonOwnership(keys.get(2), false);\n assertOwnershipAndNonOwnership(keys.get(3), false);\n\n // checking the values will bring the keys to L1, so we want to do it after checking ownership\n assertOnAllCaches(keys.get(0), \"transactionally_replaced\");\n assertOnAllCaches(keys.get(1), \"v0\");\n assertOnAllCaches(keys.get(2), \"v0\");\n assertOnAllCaches(keys.get(3), \"v0\");\n }\n }", "public V setValue(V value);", "public updateAresta_result(updateAresta_result other) {\n __isset_bitfield = other.__isset_bitfield;\n this.success = other.success;\n if (other.isSetKnf()) {\n this.knf = new KeyNotFound(other.knf);\n }\n if (other.isSetRiu()) {\n this.riu = new ResourceInUse(other.riu);\n }\n }", "@Test\n public void tc_VerifyExists_MemorizedValue() throws Exception\n {\n EN.BeginTest( TestName );\n\n // Testscript in Schlüsselwort-Notation\n EN.SelectWindow( \"Rechner\" );\n\n // Soll/Ist-Vergleich: Ist das Richtige Fenster gesetzt?\n // Check the Name, Called Method and Value of Actuel object\n assertEquals( \"NO VALUE\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n assertEquals( \"Rechner\", myClipBoard.getObjectName() );\n assertEquals( \"SelectWindow()\", myClipBoard.getMethod() );\n\n // Set Value in \"Memory\"\n OKW_Memorize_Sngltn.getInstance().set( \"Key1\", \"YES\" );\n\n // Wert in \"All_MethodsObj\" setzen.\n EN.SetValue( \"All_MethodsObj\", \"YES\" );\n // Prüfung des Schlüsselwortes?\n EN.VerifyExists( \"All_MethodsObj\", \"${Key1}\" );\n\n // Check the Name, Called Method and Value of Actuel object\n assertEquals( \"YES\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n\n assertEquals( \"Rechner.All_MethodsObj\", myClipBoard.getObjectName() );\n assertEquals( \"VerifyExists()\", myClipBoard.getMethod() );\n }", "public void setElseValue(Object pValue);", "@Override\n protected boolean tryAcquire(long value) {\n return counter.longValue() > value;\n }", "private void verifyValueForCredential(CredentialsPage cp, Control element, String expected) {\n cp.configure();\n assert(element.exists());\n assertThat(element.resolve().getAttribute(\"value\"), containsString(expected));\n }", "public V put(K key, V value) {\r\n\t\t// if (this.contains(key)){\r\n\t\t// return this.changeValue(key, value);\r\n\t\t// } else {\r\n\t\treturn linearProbing(key, value);\r\n\t}", "@Test\n public void testPutReturnsCorrectVersion() throws Exception {\n initialiseOptimisticPersister();\n\n // Configure attributes for database to return - the get is used for logging\n // only, so does not really matter.\n GetAttributesRequest simpleDBRequest = new GetAttributesRequest(testSimpleDBDomainName,\n testItemName);\n simpleDBRequest.setConsistentRead(true);\n GetAttributesResult getAttributesResult = new GetAttributesResult();\n mockery.checking(new Expectations() {\n {\n allowing(mockSimpleDBClient).getAttributes(with(equal(simpleDBRequest)));\n will(returnValue(getAttributesResult));\n }\n });\n\n mockery.checking(new Expectations() {\n {\n allowing(mockSimpleDBClient).putAttributes(with(anything()));\n }\n });\n\n ReplaceableAttribute testAttribute = new ReplaceableAttribute();\n testAttribute.setName(\"Name\");\n testAttribute.setValue(\"Value\");\n\n int initialVersion = 42; // Arbitrary\n\n // ACT\n int finalVersion = optimisticPersister.put(testItemName, Optional.of(initialVersion),\n testAttribute);\n\n // ASSERT\n assertTrue(\"The returned version should be one higher than the initial version\",\n finalVersion == (initialVersion + 1));\n }", "private void setCupStatusCold(final Function<Boolean, Void> resultCallback) {\n\n cupState.setCupStatus(0);\n WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();\n transaction.put( LogicalDatastoreType.OPERATIONAL,\n CupMapper.getCupIid(),\n buildOperationalCup());\n\n Futures.addCallback(transaction.submit(), new FutureCallback<Void>() {\n @Override\n public void onSuccess(final Void result) {\n notifyCallback(true);\n }\n\n @Override\n public void onFailure(final Throwable t) {\n // We shouldn't get an OptimisticLockFailedException (or any ex)\n // as no\n // other component should be updating the operational state.\n LOG.error(\"Failed to update cup status\", t);\n resetCupData();\n notifyCallback(false);\n }\n\n void notifyCallback(final boolean result) {\n if (resultCallback != null) {\n resultCallback.apply(result);\n }\n }\n });\n }", "public int setValue (int val);", "public boolean trySuccess(V result)\r\n/* 321: */ {\r\n/* 322:406 */ if (setSuccess0(result))\r\n/* 323: */ {\r\n/* 324:407 */ notifyListeners();\r\n/* 325:408 */ return true;\r\n/* 326: */ }\r\n/* 327:410 */ return false;\r\n/* 328: */ }", "public final std.pair<RValue, Value /*P*/ > EmitAtomicCompareExchange(LValue Obj, RValue Expected, RValue Desired, SourceLocation Loc, \n AtomicOrdering Success/*= AtomicOrdering::SequentiallyConsistent*/, AtomicOrdering Failure/*= AtomicOrdering::SequentiallyConsistent*/, boolean IsWeak/*= false*/, \n AggValueSlot Slot/*= AggValueSlot::ignored()*/) {\n assert (!Expected.isAggregate() || Expected.getAggregateAddress().getElementType() == Obj.getAddress().getElementType());\n assert (!Desired.isAggregate() || Desired.getAggregateAddress().getElementType() == Obj.getAddress().getElementType());\n AtomicInfo Atomics/*J*/= new AtomicInfo(/*Deref*/$this(), Obj);\n \n return Atomics.EmitAtomicCompareExchange(new RValue(Expected), new RValue(Desired), Success, Failure, \n IsWeak);\n}", "boolean update(T t);", "boolean hasVal();" ]
[ "0.73448515", "0.72834057", "0.7231664", "0.6825193", "0.6175122", "0.61054975", "0.60983646", "0.60737884", "0.60401237", "0.60151803", "0.6011183", "0.59364873", "0.5896193", "0.5787028", "0.56849784", "0.56840396", "0.56789804", "0.5676162", "0.5671358", "0.5628651", "0.5599953", "0.5598502", "0.556635", "0.55634516", "0.5459219", "0.54155284", "0.5404962", "0.5386575", "0.5345742", "0.53363454", "0.5308652", "0.52905124", "0.5249419", "0.5160778", "0.51524585", "0.51429844", "0.5111238", "0.510916", "0.510198", "0.5063512", "0.5047007", "0.50459635", "0.50136864", "0.49671423", "0.49660414", "0.49655908", "0.4946762", "0.49386618", "0.4932236", "0.49211997", "0.49130496", "0.49083114", "0.49072066", "0.48938233", "0.48823506", "0.48788077", "0.48751363", "0.4870378", "0.4859973", "0.48570922", "0.48471493", "0.48451734", "0.48420998", "0.48202616", "0.48129123", "0.47964877", "0.47620675", "0.47231016", "0.47151676", "0.4701599", "0.4696524", "0.4695625", "0.46762088", "0.46750453", "0.46644443", "0.46644443", "0.46560013", "0.46536735", "0.46512765", "0.4645054", "0.4634965", "0.46249667", "0.4624076", "0.46212837", "0.46184278", "0.46138588", "0.46116334", "0.46062684", "0.4602028", "0.45976952", "0.45969915", "0.45942092", "0.4592113", "0.45857164", "0.45825812", "0.45814306", "0.4580418", "0.45788535", "0.45774832", "0.45742184" ]
0.59291583
12
Increments this thread's tag. 1. Get current tag id. 2. Increment tag id.
private void incTag() { long id = tagId(tag[th()]); // 1 tag[th()] = newTag(id+1); // 2 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private synchronized void increment() {\n count++;\n atomicInteger.incrementAndGet();\n }", "public /*synchronized*/ void increment() {\n counter++;\n }", "public void setTag(int tag) {\n this.tag = tag;\n }", "private void saveTag(Tag tag){\n Long num = tagMap.get(tag);\n tagMap.put(tag, (num == null) ? (long)1 : num+1);\n }", "@Override\n public void setTag(int t) {\n this.tag = t;\n\n }", "public void setMyTag(int theTag)\n\t{\n\t\tmyTag = theTag;\n\t}", "public static synchronized void increment() {\n counter++;\n }", "public static void increment() {\n\t\tcount.incrementAndGet();\n//\t\tcount++;\n\t}", "public void increment() {\n sync.increment();\n }", "private synchronized void increment() {\n ++count;\n }", "public static synchronized void increment() {\r\n\t\tcount++;\r\n\t}", "public void addTag(Tag t);", "public void addCount(String t) {\n\t\tif (tagList.containsKey(t)) {\n\t\t\tInteger previousCount = tagList.get(t);\n\t\t\ttagList.put(t, previousCount + 1);\n\t\t} else {\n\t\t\tSystem.out.print(\"Tag does not exist!\");\n\t\t}\n\t}", "public void increase() {\r\n\t\t\tsynchronized (activity.getTaskTracker()) {\r\n\t\t\t\tactivity.getTaskTracker().count++;\r\n\t\t\t\tLog.d(LOGTAG, \"Incremented task count to \" + count);\r\n\t\t\t}\r\n\t\t}", "public void tickTag(int position) {\r\n dataTag.set(position, dataTag.get(position) + 1);\r\n }", "public static synchronized void increment(){\n count++;\n }", "private static long newTag(long id) {\n long th = Thread.currentThread().getId();\n return (1L<<63) | (th<<48) | id; // 1, 2, 3\n }", "public void inc(){\n this.current += 1;\n }", "@Override\n public synchronized void increment() {\n count++;\n }", "public int getTag() {\n return tag;\n }", "public int getTagNum() {\n return Integer.parseInt(getTag());\n }", "public void increment() {\n increment(1);\n }", "public String getTag() {\n return tagNum;\n }", "@CallSuper\n public long incrementAndGet() {\n return addAndGet(1);\n }", "public Tag(String tag) {\n\t\tthis.tag = tag;\n\t}", "@Override\n\tpublic int update(Tags tag) {\n\t\treturn 0;\n\t}", "public int tag () { return MyTag; }", "long incrementAndGet();", "public final long incrementAndGet() {\n\t\treturn ++value;\n\t}", "public void addTag(String tag) {\n this.tag = tag;\n }", "private void incrementCounter()\r\n\t{\r\n\t\tthis.counter++;\r\n\t}", "public void inc() {\n inc(1);\n }", "public Long getTagId() {\r\n return tagId;\r\n }", "@Override\n public void addTag(@NonNull String tag) {\n if (getLogger().isDebugEnabled()) {\n getLogger().debug(\"addTag {}\", tag);\n }\n\n sendSynchronously(restApiClient::addTag, createTagRequest(tag));\n }", "public int getMyTag()\n\t{\n\t\treturn myTag;\n\t}", "public Integer getTagId() {\n return tagId;\n }", "public Integer getTagId() {\n return tagId;\n }", "public void addTag (@Nonnull ITag tag);", "public void setTag(String tag) {\r\n this.tag = tag;\r\n }", "int getTagNo();", "private synchronized void incrementCount()\n\t{\n\t\tcount++;\n\t}", "public void setTag( String tag )\n {\n this.tag = tag;\n }", "void incrementRefCount(Long id) throws RemoteException;", "@Override\n public int getTag() {\n return this.tag;\n }", "public void increment() {\n mNewNotificationCount.setValue(mNewNotificationCount.getValue() + 1);\n }", "protected synchronized void increaseThreadsNumber() {\r\n threadNumber++;\r\n }", "long getAndIncrement();", "public String getAndIncrement() {\n Integer value = transactionId.get();\n transactionId.set(value + 1);\n return String.format(\"T_%08d\", value);\n }", "public void increment() {\n\t\tsynchronized (this) {\n\t\t\tCounter.count++;\n\t\t\tSystem.out.print(Counter.count + \" \");\n\t\t}\n\t\n\t}", "public void IncrementCounter()\r\n {\r\n \tsetCurrentValue( currentValue.add(BigInteger.ONE)); \r\n \r\n log.debug(\"counter now: \" + currentValue.intValue() );\r\n \r\n }", "public void setTag(String tag);", "public void addTag(String t) {\n\t\tif (!tagList.containsKey(t)) {\n\t\t\ttagList.put(t, 0);\n\t\t} else {\n\t\t\tSystem.out.print(\"Tag already exists!\");\n\t\t}\n\t}", "public String getTagId() {\n return tagId;\n }", "public void increment(){\n\t\twordCount += 1;\n\t}", "public void setTag(String tag) {\n this.tag = tag;\n }", "public void setTag(String tag) {\n this.tag = tag;\n }", "void increment(String[] tags, Double amount, String name, String description);", "public int getTagNumber() {\n return tagNumber;\n }", "private long increment() {\n\t\tlong ts = latestTimestamp.incrementAndGet();\n\t\treturn ts;\n\t}", "void updateTags();", "public void setTag(Object tag)\n {\n fTag = tag;\n }", "public void increment() {\n this.data++;\n }", "public void tickTag(String specificData) {\r\n dataTag.set(this.getPosition(specificData),\r\n dataTag.get(this.getPosition(specificData)) + 1);\r\n }", "public static synchronized void inccount()\r\n\t{\r\n\t\tcount++;\r\n\t}", "public void setTagId(Integer tagId) {\n this.tagId = tagId;\n }", "public void setTagId(Integer tagId) {\n this.tagId = tagId;\n }", "void setTag(java.lang.String tag);", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tcounter.increment();\n\t\t\t\t}", "public final long getAndIncrement() {\n\t\treturn value++;\n\t}", "public void incCounter()\n {\n counter++;\n }", "public void inc(int index) {\r\n\t\tthis.vclock.set(index, this.vclock.get(index)+1);\r\n\t}", "public synchronized void incrementCount() {\r\n\t\tcount++;\r\n\t\tnotifyAll();\r\n\t}", "public Long getTagid() {\n return tagid;\n }", "public void inc(String name) {\n inc(name, 1);\n }", "public void addTag(String singleTag) {\n \t\tif (!this.tags.contains(singleTag))\n \t\t\tthis.tags.add(singleTag);\n \t}", "Term incrementTerm() {\n Term prior = currentTerm;\n long nextTerm = currentTerm.getNumber() + 1;\n currentTerm = Term.newBuilder()\n .setNumber(nextTerm)\n .build();\n return prior;\n }", "public synchronized void add() {\ncounter += 1;\n}", "public String getTag() {\r\n return tag;\r\n }", "public String getTag()\n\t{\n\t\treturn tag;\n\t}", "public String getTag()\n\t{\n\t\treturn tag;\n\t}", "public void setTagId(Long tagId) {\r\n this.tagId = tagId;\r\n }", "public void tagOneBased() {\n for (Item e: items) {\n e.setTag(new Integer(e.getId()+1));\n }\n }", "public boolean addTag(Tag tag){\n return addTagUC.addTag(mCurrentAccount, tag);\n }", "public void incrementCount(){\n count+=1;\n }", "public String getTag() {\n\t\treturn tag;\n\t}", "void incrementAddedCount() {\n addedCount.incrementAndGet();\n }", "void addTag(String tag){tags.add(tag);}", "public String getTag() {\n return tag;\n }", "public String getTag() {\n return tag;\n }", "public void incCounter(){\n counter++;\n }", "public GTag getTag() {\r\n\t\treturn tag;\r\n\t}", "public static void PropertyAddTag(MAILBOX_TAG tag, int va1) {\n _PropertyAddTag2(tag.getId(), va1);\n }", "public void xsetIdTag(ocpp.IdToken idTag)\n {\n synchronized (monitor())\n {\n check_orphaned();\n ocpp.IdToken target = null;\n target = (ocpp.IdToken)get_store().find_element_user(IDTAG$0, 0);\n if (target == null)\n {\n target = (ocpp.IdToken)get_store().add_element_user(IDTAG$0);\n }\n target.set(idTag);\n }\n }", "public void incrementCount() {\n\t\tcount++;\n\t}", "public void setTagid(Long tagid) {\n this.tagid = tagid;\n }", "public void increment(){\n value+=1;\n }", "public void incrementCount() {\n count++;\n }", "public String getTag() {\n return tag;\n }", "public void increment() { this.progressBar.setValue(++this.progressValue); }", "public String getTag() {\n return this.tag;\n }" ]
[ "0.59536105", "0.5922107", "0.58343637", "0.5807849", "0.57800335", "0.57747287", "0.5727801", "0.57258034", "0.5719068", "0.5659756", "0.56092906", "0.5597938", "0.55936205", "0.5579554", "0.55135053", "0.5498492", "0.54973096", "0.54776525", "0.5451356", "0.54141563", "0.5385565", "0.53501135", "0.5348571", "0.5334027", "0.53326416", "0.53003836", "0.5277568", "0.52419764", "0.52390283", "0.52269346", "0.52250844", "0.5215647", "0.5205748", "0.5204388", "0.5197175", "0.51971596", "0.51971596", "0.5175553", "0.51519686", "0.51407224", "0.5136918", "0.51268476", "0.51255375", "0.5124614", "0.51209927", "0.51121795", "0.5102962", "0.5095763", "0.50939023", "0.50910974", "0.50892675", "0.5087387", "0.5085635", "0.50852513", "0.50830466", "0.50830466", "0.50724405", "0.50695705", "0.50661045", "0.50640154", "0.5055257", "0.50454974", "0.5040318", "0.50312525", "0.50254077", "0.50254077", "0.5023627", "0.50002056", "0.49902922", "0.49833003", "0.49829155", "0.4981975", "0.4979136", "0.49546906", "0.4949232", "0.4943563", "0.4938476", "0.4935543", "0.49309158", "0.49309158", "0.49280688", "0.4921597", "0.49199525", "0.4912864", "0.49112928", "0.4910919", "0.4908573", "0.4904576", "0.4904576", "0.49024475", "0.4900608", "0.4900552", "0.48968402", "0.48883462", "0.48843676", "0.4877973", "0.48764548", "0.48718905", "0.48710275", "0.486247" ]
0.7292681
0
Gets current threadid as integer.
private static int th() { return (int) Thread.currentThread().getId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long threadId();", "public int getThreadId() {\n\n return threadId.get();\n\n }", "public Integer getThreadId() {\n\t\treturn threadId;\n\t}", "long getThreadId();", "public long getThreadId() {\n return threadId;\n }", "public long getThreadId() {\n return threadId_;\n }", "public long getThreadId() {\n return threadId_;\n }", "public abstract int getThreadNumber();", "String getThreadId();", "public Long getThreadId() {\n return threadId;\n }", "public long getNextThreadID() {\n return (Long) getProperty(\"nextThreadID\");\n }", "private static int threadId(long x) {\n return (int) ((x>>>48) & 0x7FFFL); // 1\n }", "public static int getCurrentId() {\n return currentId;\n }", "public static Number getCurrentUserID() {\n User currentUser = getCurrentUser();\n if (currentUser != null)\n return currentUser.id;\n return null;\n }", "public long getAeThreadId() {\n\t\treturn threadId;\n\t}", "public int getThreadPoolNumericId(String threadpoolId);", "public String getThread()\n\t{\n\t\treturn this.thread;\n\t}", "public String getThreadKey() {\n\t\treturn Integer.toString(this.hashCode());\n\t}", "public static int getCurrentStepNumber() {\n return threadStepNumber.get();\n }", "protected Integer getCurrentUtilityId() {\n Authentication auth = SecurityContextHolder.getContext().getAuthentication();\n AuthenticatedUser user = null;\n\n if (auth.getPrincipal() instanceof AuthenticatedUser) {\n user = (AuthenticatedUser) auth.getPrincipal();\n }\n\n if (user != null) {\n return user.getUtilityId();\n }\n\n return null;\n }", "public String getThreadPoolStringId(int numericIdForThreadpool);", "public static int getPID() {\n return Integer.parseInt(ManagementFactory.getRuntimeMXBean().getName().split(\"@\")[0]);\n }", "public int getTID();", "public Integer getThreadPostId() {\n\t\treturn threadPostId;\n\t}", "public long getUser_id() {\n\t\treturn _forumUser.getUser_id();\n\t}", "public static long getThreadIdFromAddress(Context context, String address) {\r\n \t\tif (address == null)\r\n \t\t\treturn 0;\r\n \r\n \t\tString THREAD_RECIPIENT_QUERY = \"recipient\";\r\n \r\n \t\tUri.Builder uriBuilder = THREAD_ID_CONTENT_URI.buildUpon();\r\n \t\turiBuilder.appendQueryParameter(THREAD_RECIPIENT_QUERY, address);\r\n \r\n \t\tlong threadId = 0;\r\n \r\n \t\tCursor cursor = context.getContentResolver().query(uriBuilder.build(), new String[] { SMS_ID }, null, null,\r\n \t\t\t\tnull);\r\n \t\tif (cursor != null) {\r\n \t\t\ttry {\r\n \t\t\t\tif (cursor.moveToFirst()) {\r\n \t\t\t\t\tthreadId = cursor.getLong(0);\r\n \t\t\t\t}\r\n \t\t\t} finally {\r\n \t\t\t\tcursor.close();\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn threadId;\r\n \t}", "static String getMyPid() {\n String pid = \"0\";\n try {\n final String nameStr = ManagementFactory.getRuntimeMXBean().getName();\n\n // XXX (bjorn): Really stupid parsing assuming that nameStr will be of the form\n // \"pid@hostname\", which is probably not guaranteed.\n pid = nameStr.split(\"@\")[0];\n } catch (RuntimeException e) {\n // Fall through.\n }\n return pid;\n }", "public long getId_forum() {\n\t\treturn _forumUser.getId_forum();\n\t}", "public int getCurrentUserId() {\n int i;\n synchronized (this.mLock) {\n i = this.mCurrentUserId;\n }\n return i;\n }", "int get_int(ThreadContext tc, RakudoObject classHandle);", "public String getSessionId() {\n HttpSession session = (HttpSession) _currentSession.get();\n if (session == null) {\n return null;\n }\n return session.getId();\n }", "public long getId_forum_user() {\n\t\treturn _forumUser.getId_forum_user();\n\t}", "private static long getGlobalId() {\n return globalId++;\n }", "java.lang.String getWorkerId();", "public int getTid();", "@NativeType(\"pid_t\")\n public static long getpid() {\n long __functionAddress = Functions.getpid;\n return invokeP(__functionAddress);\n }", "public io.dstore.values.IntegerValue getForumId() {\n if (forumIdBuilder_ == null) {\n return forumId_ == null ? io.dstore.values.IntegerValue.getDefaultInstance() : forumId_;\n } else {\n return forumIdBuilder_.getMessage();\n }\n }", "public static int getIdCounter() {\n return idCounter;\n }", "public static String getPid() {\n\t\tString name = ManagementFactory.getRuntimeMXBean().getName(); \n\t\t// get pid \n\t\treturn name.split(\"@\")[0];\n\t}", "public static int getIdcounter() {\n return idcounter;\n }", "public int getThreadUsed();", "public static String getUserForCurrentThread() {\r\n return userPerThread.get();\r\n }", "public int get_int() {\n return local_int;\n }", "public static int getIdNumber() {\n return idNumber;\n }", "public io.dstore.values.IntegerValue getForumId() {\n return forumId_ == null ? io.dstore.values.IntegerValue.getDefaultInstance() : forumId_;\n }", "public static int getLatestTaskId() {\n\n int id = 0;\n try {\n List<Task> list = Task.listAll(Task.class);\n int size = list.size();\n Task task = list.get(size - 1);\n id = task.getTaskId();\n\n } catch (Exception e) {\n id=0;\n }\n return id;\n\n }", "public abstract long getProcessID();", "public long getTraceId() {\n\t\treturn this.traceInformation.getTraceId();\n\t}", "public long getMemberId() {\n return _sTransaction.getMemberId();\n }", "public Integer getTid() {\r\n return tid;\r\n }", "public int getCurrentServerId() {\n return currentServerId;\n }", "public static int getThreadCount() {\r\n\t\treturn THREAD_MX_BEAN.getThreadCount();\r\n\t}", "public int getId() {\n if (!this.registered)\n return -1;\n return id;\n }", "public static final int getProcessId() {\n\t\treturn ID;\n\t}", "public Integer getClassid() {\r\n return classid;\r\n }", "public int getCurrentOperationId(){\n int nmr = 1;\n operationLock.lock();\n try (\n Statement s = rawDataSource.getConnection().createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n ResultSet res = s.executeQuery(\n \"SELECT OP_ID FROM APP.OPERATIONS ORDER BY OP_ID ASC\")) {\n\n if (res.last()) {\n nmr = Integer.parseInt(res.getString(\"OP_ID\")) + 1;\n }\n } catch (SQLException ex) {\n return nmr;\n }\n\n operationLock.unlock();\n return nmr;\n }", "public Integer getClassid() {\n return classid;\n }", "private int getRequestCode() {\n return Thread.currentThread().hashCode();\n }", "public int getCurrentTurnID() {\n return rounds.get(currentRound).getTurnID();\n }", "double get_num(ThreadContext tc, RakudoObject classHandle);", "private static int findRenderThreadId(@NotNull ProcessModel process) {\n Optional<ThreadModel> renderThread =\n process.getThreads().stream().filter((thread) -> thread.getName().equalsIgnoreCase(RENDER_THREAD_NAME)).findFirst();\n return renderThread.map(ThreadModel::getId).orElse(INVALID_PROCESS);\n }", "public String getCurrentRequestId()\n\t{\n\t\tString reqID = (String) MDC.get(REQUEST_ID);\n\t\tif (reqID == null || \"\".equals(reqID))\n\t\t{\n\t\t\treqID = \"RID_\" + UUID.randomUUID().toString();\n\t\t\tMDC.put(REQUEST_ID, reqID);\n\t\t}\n\t\treturn reqID;\n\t}", "public Long getWaiting_thread_id() {\n return waiting_thread_id;\n }", "public static int getCurrentUserId() {\n return session.get().getUserId();\n }", "public Integer getId() {\n return id.get();\n }", "private String getCurrentUserId() {\n\t\tUser currentUser = UserDirectoryService.getCurrentUser();\n \tString currentUserId = currentUser.getId();\n\t\treturn currentUserId;\n\t}", "public java.lang.String getTid() {\n java.lang.Object ref = tid_;\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 tid_ = s;\n return s;\n }\n }", "int getpid();", "public long getId() {\n\t\treturn getTo(true).getId();\n\t}", "public int getAD_Tree_Activity_ID() {\n\t\tInteger ii = (Integer) get_Value(\"AD_Tree_Activity_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "long getInstanceID();", "public int getCurrentOrTargetUserId() {\n int i;\n synchronized (this.mLock) {\n i = this.mTargetUserId != -10000 ? this.mTargetUserId : this.mCurrentUserId;\n }\n return i;\n }", "public java.lang.Integer getId () {\n\t\treturn _id;\n\t}", "Integer getID();", "Integer getID();", "public java.lang.String getTid() {\n java.lang.Object ref = tid_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n tid_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public int getId(){\n if (ID != null) {\n int i = Integer.parseInt(ID);\n return i;\n }\n return 0;\n }", "long getUID();", "public long getId() {\n return session.getId();\n }", "public long getPrimaryKey() {\n\t\treturn _forumUser.getPrimaryKey();\n\t}", "public int getMemberId() {\n\t\treturn memberIDCounter++;\n\t}", "java.lang.String getTid();", "java.lang.String getTid();", "public int getParentThreads() {\n\t\tfinal String key = ConfigNames.PARENT_THREADS.toString();\n\n\t\tif (getJson().isNull(key)) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn getJson().getInt(key);\n\t}", "public final int getNbThread() {\n return nbThread;\n }", "public String getThreadName() {\n return threadName;\n }", "IPID getPID();", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Integer getNumberOfThreads() {\n return (java.lang.Integer)__getInternalInterface().getFieldValue(NUMBEROFTHREADS_PROP.get());\n }", "public int id() {\n return _num;\n }", "public static Integer getPuzzleId(Context context) {\n SharedPreferences prefs = context.getSharedPreferences(PREF, Context.MODE_PRIVATE);\n Integer NumValue = Integer.parseInt(prefs.getString(\"PuzzleId\", \"0\"));\n return NumValue;\n }", "public Integer getClassId() {\r\n return classId;\r\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Integer getNumberOfThreads() {\n return (java.lang.Integer)__getInternalInterface().getFieldValue(NUMBEROFTHREADS_PROP.get());\n }", "public java.lang.Integer getId () {\n\t\treturn id;\n\t}", "public java.lang.Integer getId () {\n\t\treturn id;\n\t}", "public java.lang.Integer getId () {\n\t\treturn id;\n\t}", "public java.lang.Integer getId () {\n\t\treturn id;\n\t}", "public java.lang.Integer getId () {\n\t\treturn id;\n\t}", "public java.lang.Integer getId () {\n\t\treturn id;\n\t}", "public java.lang.Integer getId () {\n\t\treturn id;\n\t}", "public java.lang.Integer getId () {\n\t\treturn id;\n\t}" ]
[ "0.79685843", "0.7481376", "0.7284299", "0.71033156", "0.70870566", "0.70783466", "0.69861764", "0.697478", "0.696792", "0.69501776", "0.69081473", "0.67227006", "0.6573724", "0.64760506", "0.64643717", "0.6304734", "0.62492263", "0.6232111", "0.6150075", "0.60854715", "0.6025594", "0.6021203", "0.60064656", "0.5987201", "0.5978532", "0.5936579", "0.5903146", "0.5903123", "0.5897655", "0.5889663", "0.5877684", "0.58644503", "0.58635145", "0.5851873", "0.58355695", "0.5798117", "0.5786101", "0.5778624", "0.5777929", "0.57696414", "0.576518", "0.57609725", "0.57536405", "0.57484037", "0.5743044", "0.5731531", "0.5724231", "0.5707341", "0.56897324", "0.56852216", "0.5682748", "0.56786215", "0.56776386", "0.56716835", "0.5668745", "0.56659085", "0.5655884", "0.5655123", "0.5648962", "0.5648814", "0.5639413", "0.5613613", "0.5607075", "0.5596025", "0.5593656", "0.5590412", "0.5586312", "0.5585135", "0.558213", "0.55802214", "0.55797315", "0.5571272", "0.5564429", "0.5557982", "0.5557982", "0.5552617", "0.55509824", "0.5547795", "0.5544874", "0.5535688", "0.5527174", "0.55217326", "0.55217326", "0.5512413", "0.5512226", "0.5505363", "0.5498942", "0.54926425", "0.549043", "0.54839337", "0.54818726", "0.54763025", "0.54758835", "0.54758835", "0.54758835", "0.54758835", "0.54758835", "0.54758835", "0.54758835", "0.54758835" ]
0.74022233
2
SUPPORT Gets length of array.
public int length() { return data.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getArrayLength();", "int getArrayLength();", "long arrayLength();", "public int arraySize();", "public int getLength(){\r\n\t \treturn arraySize;\r\n\t }", "public static int arrayLength(final Object array) {\r\n if (GWT.isProdMode()) {\r\n return jsniLength(array);\r\n } else {\r\n return Array.getLength(array);\r\n }\r\n }", "public int size() {\n\t\treturn array.length();\n\t}", "int size() {\n\t\treturn array.length;\n\t}", "public int size() {\n //encapsulate\n int size = this.array.length;\n return size;\n }", "public int getSize() {\r\n return array.length;\r\n }", "public int size()\n\t{\n\t\treturn arraySize;\n\t}", "int size()\n\t{\n\t\t//If array is null then return -1\n\t\tif(inputArray == null)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\t//If the array is not null then return the length of the array\n\t\treturn inputArray.length;\n\t}", "@Override\n public int size() {\n return array.length;\n }", "public int arrayCount()\n\t{\n\t\treturn _arrayCount;\n\t}", "public static boolean isArray_length() {\n return false;\n }", "public int length(){ return this.isUpgraded ? this.linkArray.length() : this.nativeArray.size(); }", "public static boolean isArray_estLength() {\n return false;\n }", "int sizeOfDescriptionArray();", "public int getLength(){\n\t\treturn data.length;\n\t}", "@Override\n public synchronized int getSize() {\n return mArray.size();\n }", "public org.python.types.Int __len__();", "public int getLength();", "public int getLength();", "public int getLength();", "public int size() {\n return a.length;\n }", "int sizeOfBridgeElementArray();", "public int length() {\n return size();\n }", "public int size() {\r\n return length;\r\n }", "public int get_length();", "public int getLength() {\n\t\treturn data.length;\n\t\t\n\t}", "private int length() { return length; }", "public int sizeOfDeviceArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(DEVICE$12);\n }\n }", "public int length()\n\t{\n\t\tint total_length=0;\n\t\tfor(int iterator=0; iterator<data.length;iterator++)\n\t\t{\n\t\t\tif(data[iterator]!=0)\n\t\t\t{\n\t\t\t\ttotal_length++;\n\t\t\t}\n\t\t}\n\t\treturn total_length;\n\t}", "int sizeOfTrafficVolumeArray();", "public int length()\n\t{\n\t\treturn length;\n\t}", "public int length() {\n \treturn length;\n }", "public int getLength()\n\t{\n\t\treturn (int) length;\n\t}", "protected int getArraySize(){\r\n\t \treturn numElems;\r\n\t \t//return arraySize;\r\n\t }", "int sizeOfReferenceRangeArray();", "public int length() {\n return data.length;\n }", "public abstract int sizeOf(byte[] array, int offset, int length);", "public int length() {\n\t\treturn value.length;\n\t}", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "public int length() {\n\t\treturn size;\r\n\t}", "public int getLength() {\n\t\treturn this.length;\n\t}", "public int getLength()\n\t{\n\t\treturn length;\n\t}", "public int getLength()\n\t{\n\t\treturn length;\n\t}", "public int length();", "public int length();", "public int length();", "public int length();", "public int length();", "public int getLength() {\r\n return length;\r\n }", "public int getLength() {\r\n return length;\r\n }", "public int getLength() {\r\n return length;\r\n }", "public int getLength() {\n return this.length;\n }", "public int getLength() {\n return this.length;\n }", "int length()\n\t{\n\t\treturn length;\n\t}", "public int size()\n \t{\n \t\treturn getLength();\n \t}", "UINT SafeArrayGetElemsize(SAFEARRAY psa);", "public int getLength() {\n\t\treturn boardArray.size();\n\t}", "protected String getArraySize()\n {\n return arraySize;\n }", "public int getLength()\n {\n\treturn length;\n }", "public int getLength() { return dataLength; }", "public int sizeOfValueArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(VALUE$0);\n }\n }", "public int getTrueSize() {\n int len = ArrayFuncs.computeSize(dataArray);\n return len;\n }", "public int getLength() {\r\n\t\treturn length;\r\n\t}", "public int size(){\n return length;\n }", "@Test\n\tpublic void testLength()throws Exception {\n\n\t\t\t SET setarray= new SET( new int[]{6,7,8,10});\n\t\t\t int returnedValue =setarray.Size(); \n\t\t\t int expectedValue = 4;\n\t\t\t Assert.assertEquals( expectedValue, returnedValue );\n\t}", "public int length() {\n\t\treturn length;\n\t}", "public int length() {\n\t\treturn length;\n\t}", "public int sizeOfSubArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(SUB$2);\n }\n }", "public int size() {\n return len;\n }", "public int length()\n {\n if(integerList == null)\n return 0;\n else\n return integerList.length;\n }", "private int length() {\n\t\treturn this.lenght;\n\t}", "public int length() {\n return length;\n }", "public int length() {\n return length;\n }", "public int length() {\n return length;\n }", "public int getLength() {\n return length;\n }", "public int getLength() {\n return length;\n }", "public int getLength() {\n return length;\n }", "public int getLength() { return length;\t}", "public int getLength()\n {\n return length;\n }", "public Integer getLength() {\n return _length;\n }", "public Integer getLength() {\n return _length;\n }", "public int length() {\n \t \n \t //return the length\n \t return(len);\n }", "public long getLength();", "public long getLength();", "public int returnSize()\r\n {\r\n \treturn length;\r\n }", "public int getLength() {\n\t\treturn length;\n\t}", "public int getLength() {\n\t\treturn length;\n\t}" ]
[ "0.91011924", "0.91011924", "0.87445927", "0.82959366", "0.8289501", "0.8181611", "0.8039728", "0.7978121", "0.7805624", "0.7768495", "0.7740403", "0.7732292", "0.76277864", "0.75192076", "0.7436163", "0.7382625", "0.7329217", "0.73137355", "0.7288477", "0.7236494", "0.7233668", "0.72276074", "0.72276074", "0.72276074", "0.7223633", "0.7201633", "0.7172136", "0.7146207", "0.714069", "0.7138413", "0.71367204", "0.70879287", "0.70872456", "0.70865333", "0.70786566", "0.70719653", "0.7069801", "0.7067178", "0.7063321", "0.7063109", "0.7057953", "0.70566696", "0.70540696", "0.70540696", "0.70540696", "0.70540696", "0.70540696", "0.70540696", "0.70540696", "0.70540696", "0.70540696", "0.70540696", "0.7038649", "0.7037887", "0.70355123", "0.70355123", "0.7034355", "0.7034355", "0.7034355", "0.7034355", "0.7034355", "0.7021664", "0.7021664", "0.7021664", "0.7011449", "0.7011449", "0.7010708", "0.7010205", "0.700834", "0.70054805", "0.699863", "0.6998388", "0.6997617", "0.69965994", "0.699557", "0.69898623", "0.6985625", "0.6983707", "0.69813883", "0.69813883", "0.6979921", "0.69763595", "0.6967763", "0.69615084", "0.695822", "0.695822", "0.695822", "0.6955011", "0.6955011", "0.695107", "0.69487965", "0.6946228", "0.69407034", "0.69407034", "0.6935733", "0.6935281", "0.6935281", "0.6934997", "0.6934808", "0.6934808" ]
0.7129523
31
Gets iterator to values in array.
@Override public Iterator<Long> iterator() { Collection<Long> c = new ArrayList<>(); synchronized (data) { for (int i=0; i<data.length; i++) c.add(get(i)); } return c.iterator(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public native IterableIterator<V> values();", "public Iterator<T> iterator() {\r\n return new ArrayIterator(elements, size);\r\n }", "public Iterator<T> iterator(){\r\n\t\treturn new ChainedArraysIterator();\r\n\t}", "public ArrayIntListIterator iterator() {\n\t return new ArrayIntListIterator(this);\n\t }", "public Iterator<Item> iterator() {\n return new ArrayIterator();\n }", "public Iterator<Item> iterator() {\n return new ArrayIterator();\n }", "public Iterator<Item> iterator() {\n return new ArrayIterator();\n }", "public Iterator<Item> iterator() {\n return new ArrayIterator();\n }", "public Iterator<Item> iterator(){\n return new ArrayIterator();\n }", "public Iterator<Entry> iterator() {\n return new ArrayIterator<Entry>(fEntries);\n }", "public Iterator<Item> iterator() {\n Item[] temp = (Item[]) new Object[size];\n System.arraycopy(array, 0, temp, 0, size);\n return (new RandomIterator(temp));\n }", "@Override\n public Iterator<Integer> iterator() {\n return new Iterator<>() {\n int i = 0;\n\n @Override\n public boolean hasNext() {\n return i < Set.this.count;\n }\n\n @Override\n public Integer next() {\n return Set.this.arr[i++];\n }\n };\n }", "public Iterator<V> values();", "public Iterator<V> values();", "@Override\n public Iterator<Value> iterator()\n {\n return values.iterator();\n }", "public Iterator<Coord> iterator() {\n\t\treturn new CoordListIterator(array, index);\n\t}", "IArray getArrayNext() throws InvalidRangeException;", "public Iterator getValues() {\n synchronized (values) {\n return Collections.unmodifiableList(new ArrayList(values)).iterator();\n }\n }", "public abstract ucar.array.RangeIterator getRangeIterator();", "public T iterator();", "public Iterator<T> getIterator();", "@Override\n\tpublic Iterator<T> iterator() {\n\t\treturn new CircularArrayIterator<T>(this);\n\t}", "public Iterator getIterator() {\n return myElements.iterator();\n }", "@Override\n\tpublic final Iterator<T> iterator() {\n\t\treturn new IteratorImpl<>(value.get());\n\t}", "@Override\n\tpublic Iterator<T> iterator() {\n\t\treturn new CircularArrayIterator<T>(items);\n\t}", "@Override\n public Iterator<E> iterator() {\n return new Iterator<E>() {\n private int nextIndex = 0;\n private int lastNextIndex = -1;\n private int rest = size();\n\n @Override\n public boolean hasNext() {\n return rest > 0;\n }\n\n @Override\n public E next() {\n if(!hasNext()){\n throw new NoSuchElementException();\n }\n rest--;\n lastNextIndex = nextIndex++;\n siftDown(nextIndex);\n\n return (E) array[lastNextIndex];\n }\n\n @Override\n public void remove() {\n if (lastNextIndex == -1) {\n throw new IllegalStateException();\n }\n removeElement(lastNextIndex);\n nextIndex--;\n lastNextIndex = -1;\n }\n };\n }", "public Iterator<Integer> iterator() {\n\t\treturn new WrappedIntIterator(intIterator());\n\t}", "public Iterator<Item> iterator() {\n return new RandomArrayIterator();\n }", "Iterator<T> iterator();", "public native IterableIterator<Tuple<K, V>> entries();", "@Override\n public Iterator<Map.Entry<K, V>> iterator() {\n return new ArrayMapIterator<>(this.entries);\n }", "public T[] next();", "public Iterator<Object[]> getIterator()\n\t{\n\t\tinit();\n\t\t\n\t\treturn new SimpleIterator();\n\t}", "public Iterator<T> iterator();", "public Iterator<T> iterator();", "public Iterator<T> iterator();", "public Iterator<T> iterator();", "public Iterator<V> getValueIterator()\n {\n Iterator<V> myIterator = new ValueIterator(this);\n return myIterator; \n }", "public Iterator<Item> iterator() {\n return new RandomizedArrayIterator();\n }", "@Override\n public Iterator<Map.Entry<K, V>> iterator() {\n return new ArrayMapIterator<>(this.entries, this.size);\n }", "@Override\n public Iterator<E> iterator() {\n return new ArrayIterator(); // create a new instance of the inner class\n }", "public Iterator<Type> iterator();", "public Iterator getIterator(int i) {\r\n return table[i].iterator();\r\n }", "public Iterator<K> iterator()\n {\n return (new HashSet<K>(verts)).iterator();\n }", "public Iterator iterator() {\n\t return new EntryIterator(set.iterator());\n\t}", "public Iterator<E> iterator();", "public Iterator<E> iterator();", "public Iterator<E> iterator();", "@Override\n public Iterator<Object> iterator() {\n return new Iterator<Object>() {\n\n private int i = 0;\n\n @Override\n public boolean hasNext() {\n return i < data.length;\n }\n\n @Override\n public Object next() {\n Object result = data[i];\n i = i + 1;\n return result;\n }\n\n @Override\n public void remove() {\n throw new UnsupportedOperationException(\"Tuples are immutable\");\n }\n };\n }", "public IndexRecord getIterator() {\n return (iter == -1 ? null : data[iter]);\n}", "@SuppressWarnings(\"unchecked\")\n private <X> Iterator<X> itx(Iterator<X>[] ita) {\n if (ita == null || ita.length == 0) \n return (Iterator<X>)Arrays.stream(ofDim(Iterator.class,0)).iterator();\n return new Iterator<X>() {\n private int i = 0;\n public boolean hasNext() {\n while ( i < ita.length && !ita[i].hasNext()) i++;\n return i < ita.length;\n }\n public X next() {\n while ( i < ita.length && !ita[i].hasNext()) i++;\n return ita[i].next();\n }\n };\n }", "public Iterator<Object[]> getMetricValueIterator()\n\t{\n\t\tinit();\n\t\t\n\t\treturn new MetricValueIterator();\n\t}", "Iterator<E> iterator();", "Iterator<E> iterator();", "T[] getValues();", "@Override\n public Iterator<E> iterator() {\n\n Iterator<E> myIt = new Iterator<E>() {\n\n private int currIndex = head;\n\n @Override\n public boolean hasNext() {\n if (currIndex < ringArray.length && ringArray[currIndex] != null) { //Checking if we got to the end and if there are no null elements\n return false;\n }\n return true;\n }\n\n @Override\n public E next() {\n if (!hasNext()) //If there isnt another element then throw an exception\n throw new NoSuchElementException(\"No element\");\n Object nextElement = ringArray[currIndex]; //Getting the next element\n currIndex--; //Decrease the current index by one\n if (currIndex < 0) //If we get to the beginning of the\n currIndex = ringArray.length - 1;\n return (E) nextElement;\n }\n\n @Override\n public void remove() throws UnsupportedOperationException {\n throw new UnsupportedOperationException(\"Remove is not supported\");\n }\n };\n return myIt;\n }", "@Override\n\tpublic Iterator getValueIterator() {\n\t\treturn new ValueIterator();\n\t}", "public Iterator<K> iterator()\n {\n\treturn (new HashSet<K>(verts)).iterator();\n }", "public Iterator<E> iterator() {\n return new SortedArraySetIterator(this);\n }", "public Iterator iterator () {\n return new MyIterator (first);\n }", "public T[] next(){\n\n if(hasNext()){\n int numElements = Math.min(window,lst.length - currentIndex);\n ArrayList<T> returnElements = new ArrayList<T>(numElements);\n for(int i = currentIndex; i < currentIndex + window && i < lst.length; i++ ){\n returnElements.add(lst[i]);\n if(i == lst.length-1){\n hasMore = Boolean.FALSE;\n }\n }\n currentIndex += step;\n return returnElements.toArray((T[]) Array.newInstance(returnElements.get(0).getClass(),0));\n }else{\n throw new NoSuchElementException(\"no elements to iterate \");\n }\n\n }", "public Iterable<V> values();", "public Iterator<Integer> fromA() {return this.fromA.iterator();}", "@Override public java.util.Iterator<Function> iterator() {return new JavaIterator(begin(), end()); }", "public Iterator<GPoint> iterator() {\n\t\treturn points.iterator();\n\t}", "@Override\n\t\t\tpublic Iterator<Integer> iterator() {\n\t\t\t\treturn new Iterator<Integer>() {\n\n\t\t\t\t\tint index = -1;\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void remove() {\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic Integer next() {\n\t\t\t\t\t\tif (index >= length)\n\t\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t\treturn offset + index * delta;\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean hasNext() {\n\t\t\t\t\t\treturn ++index < length;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}", "public int[] getIntArray() {\r\n\t\t\r\n\t\treturn (value.getIntArray());\r\n\t}", "@Override\n public Iterator<T> iterator() {\n return new Iterator<T>(){\n private int ci = 0;\n \n /**\n * Checks if ArrayList has next element \n * @return \n */\n public boolean hasNext(){\n return ci < size;\n }\n \n /**\n * Returns next element and moves iterator forward\n * @return \n */\n public T next(){\n return (T)data[ci++];\n }\n \n /**\n * Does nothing\n */\n public void remove(){\n \n }\n };\n }", "public Iterator<E> iterator() {\r\n return this.map.values().iterator();\r\n }", "public OpIterator iterator() {\n // some code goes here\n // throw new\n // UnsupportedOperationException(\"please implement me for lab2\");\n return new InterAggrIterator();\n }", "Iterator<IntFloatEntry> iterator();", "@Override\n Iterator<T> iterator();", "public static int[] getValues(vtkCellArray array)\n\t{\n\t\tarray.Squeeze();\n\t\tvtkIdTypeArray data = array.GetData();\n\t\tint[] toReturn = getValues(data);\n\t\treturn toReturn;\n\t}", "@Override\n public Iterator iterator() {\n return new PairIterator();\n }", "@Override\r\n Iterator<E> iterator();", "Iterator<K> iterator();", "@Override\n @Nonnull Iterator<T> iterator();", "public int toArray(X[] A, int i);", "@Override\n public Iterator<Pair<K, V>> iterator() {\n return new Iterator<Pair<K, V>>() {\n private int i = 0, j = -1;\n private boolean _hasNext = true;\n\n @Override\n public boolean hasNext() {\n return _hasNext;\n }\n\n @Override\n public Pair<K, V> next() {\n Pair<K, V> r = null;\n if (j >= 0) {\n List<Pair<K, V>> inl = l.get(i);\n r = inl.get(j++);\n if (j > inl.size())\n j = -1;\n }\n else {\n for (; i < l.size(); ++i) {\n List<Pair<K, V>> inl = l.get(i);\n if (inl == null)\n continue;\n r = inl.get(0);\n j = 1;\n }\n }\n if (r == null)\n _hasNext = false;\n return r;\n }\n };\n }", "int[] getInts();", "@Override\n public int[] toArray() {\n int[] result = new int[size];\n Entry tmp = first;\n for (int i = 0; i < size; i++) {\n result[i] = tmp.value;\n tmp = tmp.next;\n }\n return result;\n }", "private Iterator<Integer> getIterator(Iterator<Iterator<Integer>> iter) {\n Iterator<Integer> iterator = null;\n while (iter.hasNext()) {\n iterator = iter.next();\n break;\n }\n return iterator;\n }", "IArray getArrayCurrent() throws InvalidRangeException;", "public IndexRecord getIteratorNext() {\n iter = (iter == next - 1 ? -1: iter + 1);\n return (iter == -1 ? null : data[iter]);\n }", "public Object getValueArray(int offset, int length);", "public T next(){\r\n return itrArr[position++];\r\n }", "public Iterator<E> iterator() {\n\t\treturn new Itr();\n\t}", "public Iterator<E> elementIterator() {\n return new EnumMultiset<E>.Itr<E>() {\n /* access modifiers changed from: package-private */\n public E output(int i) {\n return EnumMultiset.this.enumConstants[i];\n }\n };\n }", "public Iterator<String> iterator();", "public Iterator<T> getIterator() {\n return new Iterator(this);\n }", "public Iterator<T> getPageElements();", "@Override\r\n\t\tpublic Item next() {\r\n\t\t\treturn arr[index++];\r\n\t\t}", "public Iterator<JacksonJrValue> elements() {\n return _values.iterator();\n }", "@Override\n\t\t\tpublic Iterator<T> iterator() {\n\t\t\t\treturn convertData(data.iterator(), targetClass);\n\t\t\t}", "public Object next()\n/* */ {\n/* 93 */ if (this.m_offset < this.m_array.length) {\n/* 94 */ Object localObject = this.m_array[this.m_offset];\n/* 95 */ advance();\n/* 96 */ return localObject;\n/* */ }\n/* 98 */ throw new NoSuchElementException();\n/* */ }", "public Iterator<V> iterator()\n {\n return new Iterator<V>()\n {\n public boolean hasNext()\n {\n // STUB\n return false;\n } // hasNext()\n\n public V next()\n {\n // STUB\n return null;\n } // next()\n\n public void remove()\n throws UnsupportedOperationException\n {\n throw new UnsupportedOperationException();\n } // remove()\n }; // new Iterator<V>\n }", "public ChainedArraysIterator(){\r\n\t\t\tcurrentNode = beginMarker.next;\r\n\t\t\tcurrent = currentNode.getFirst();\r\n\t\t\tidx = 0;\r\n\t\t\texpectedModCount=modCount;\r\n\t\t}", "@Override\r\n\tpublic Iterator<K> iterator() {\n\t\treturn keys.iterator();\r\n\t}", "public Iterator<? extends E> iterator() {\n return (Iterator<? extends E>) Arrays.asList(queue).subList(startPos, queue.length).iterator();\n }", "public IntIterator intIterator() {\n\t\treturn new BufferedEWAHintIterator(this);\n\t}" ]
[ "0.7072829", "0.7065628", "0.7058512", "0.7046417", "0.70244884", "0.70244884", "0.70244884", "0.70244884", "0.70141935", "0.68617016", "0.6710035", "0.65834284", "0.65739065", "0.65739065", "0.65614724", "0.644533", "0.6417818", "0.64054257", "0.635984", "0.6313415", "0.628357", "0.62683696", "0.62214696", "0.6169954", "0.61683923", "0.61531335", "0.6094359", "0.608606", "0.60817415", "0.6081469", "0.60763943", "0.6073554", "0.6070351", "0.6053", "0.6053", "0.6053", "0.6053", "0.60445374", "0.60364985", "0.60189235", "0.5975046", "0.59495026", "0.59436715", "0.5942222", "0.5904804", "0.5891032", "0.5891032", "0.5891032", "0.58766615", "0.5859498", "0.584344", "0.5831744", "0.5825308", "0.5825308", "0.58134216", "0.58042246", "0.57899374", "0.57893515", "0.5785439", "0.5772018", "0.5738655", "0.5730497", "0.5716439", "0.57074916", "0.56981725", "0.5696671", "0.5693177", "0.5683791", "0.5673381", "0.5669902", "0.5645127", "0.56142515", "0.560147", "0.5599975", "0.5576172", "0.55748796", "0.55683875", "0.55515313", "0.5539989", "0.5517293", "0.5515406", "0.5510803", "0.5494908", "0.5484179", "0.5477474", "0.5473366", "0.54718906", "0.54717076", "0.5469209", "0.54682106", "0.54663694", "0.54628617", "0.5454137", "0.5447355", "0.5446072", "0.54437774", "0.54433423", "0.5436521", "0.5430595", "0.5426227" ]
0.5989002
40
Converts array to string.
@Override public String toString() { StringBuilder s = new StringBuilder("{"); for (Long v : this) s.append(v).append(", "); if (s.length()>1) s.setLength(s.length()-2); return s.append("}").toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized String toString()\n\t{\n\t\treturn Arrays.toString(array);\n\t}", "private static String arrayToString(int[] array) {\n\n String arrayOutput = \"\";\n\n // seperate the elements of the array and add each to the outputstring\n for (int position = 0; position < array.length; position++) {\n\n arrayOutput += array[position] + \", \";\n }\n\n // trim the outputstring of the last seperation char\n arrayOutput = arrayOutput.substring(0, (arrayOutput.length() - 1));\n\n // output the string of the integer array\n return arrayOutput;\n }", "public String toString() {\n String[] collect = new String[this.array.length];\n for (int i = 0; i < this.array.length; i++) {\n collect[i] = String.valueOf(this.array[i]);\n }\n return \"[\" + String.join(\";\", collect) + \"]\";\n }", "public static String arrayToString(int[] arr){\n\t\tStringBuffer ans = new StringBuffer();\n\t\tfor(int i=0;i<arr.length;i++)ans.append(arr[i]);\n\t\treturn ans.toString();\n\t}", "public String toString() {\n int iMax = array.length - 1;\n if (iMax == -1)\n return \"[]\";\n\n StringBuilder b = new StringBuilder();\n b.append('[');\n for (int i = 0; ; i++) {\n b.append(getRaw(byteOffset(i)));\n if (i == iMax)\n return b.append(']').toString();\n b.append(',').append(' ');\n }\n }", "public static String toString(double[] array)\r\n\t{\r\n\t\tString str = \"[ \";\r\n\t\tfor (int i = 0; i < array.length; i++)\r\n\t\t\tstr += String.valueOf(array[i]) + \" \";\r\n\t\treturn str + \"]\";\r\n\t}", "@Override\n public String toString() {\n String arrString = \"\";\n \n //loop to add all the elements\n for (int i = 0; i < this.array.length; i++) {\n arrString = arrString + \" \" + this.array[i];\n }\n \n return arrString;\n }", "public static String arrayAsString(int array[]) {\n\tString ret = \"\";\n\tfor(int i = 0; i < array.length; i++) {\n\t if(i == array.length-1) {\n\t\tret += array[i];\n\t } else {\n\t\tret += array[i] + \" \";\n\t }\n\t}\n\treturn ret;\n }", "@Override\n\tpublic String toString() {\n\t\tString s = \"\";\n\t\ts += \"[\";\n\t\tif (size() > 0) {\n\t\t\ts += arr[0];\n\t\t\tfor (int i = 1; i < arr.length; i++) {\n\t\t\t\ts += \", \" + arr[i];\n\t\t\t}\n\t\t}\n\t\ts += \"]\";\n\t\treturn s;\n\t}", "public String toString() {\n\t\tString s = \"\";\n\t\tfor (Coord x : array)\n\t\t\ts += x;\n\t\treturn s;\n\t}", "public static <T> String arrayToString(T[] list) {\n\t\treturn arrayToString(list, o->o.toString());\n\t}", "public String toString(){\n\treturn Arrays.toString(a);\n }", "public static String arrayToString (int[][] a){\r\n\t\tString toString = \"\";\r\n\t\tfor (int r=0 ;r<a.length;r++) {\r\n\t\t\tfor (int c=0;c<a[0].length;c++) {\r\n\t\t\t\ttoString+=a[r][c];\r\n\t\t\t\t\tif (c<a[0].length-1)\r\n\t\t\t\t\ttoString+=\" \";\r\n\t\t\t}\r\n\t\t\t\t\tif (r<a.length-1)\r\n\t\t\t\t\ttoString+=\"\\n\";\r\n\t\t}\r\n\t\treturn toString;\r\n\t}", "private String arrayToString(double[] a) {\n StringBuffer buffy = new StringBuffer();\n for (int i=0; i<a.length; i++) {\n buffy.append(a[i]+\"\\t\");\n }\n return buffy.toString();\n }", "private String arrayToString(double[] a) {\n StringBuffer buffy = new StringBuffer();\n for (int i=0; i<a.length; i++) {\n buffy.append(a[i]+\"\\t\");\n }\n return buffy.toString();\n }", "public static final <T> StrBuilder ARRAY_TO_STRING(T[][] ar){\n\t\tStrBuilder ret = new StrBuilder(50);\n\t\tfor(int row=0; row<ar.length; row++){ //TODO not null save\n\t\t\tif(ar[row]==null){\n\t\t\t\tret.append(\"[\").append(row).appendln(\"]: null\");\n\t\t\t}\n\t\t\telse if(ar[row].length==0){\n\t\t\t\tret.append(\"[\").append(row).appendln(\"]: 0\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfor(int col=0; col<ar[row].length; col++){\n\t\t\t\t\tret.append(\"[\").append(row).append(\"][\").append(col).append(\"]: \");\n\t\t\t\t\tif(ar[row][col]==null){\n\t\t\t\t\t\tret.appendln(\"null\");\n\t\t\t\t\t}\n\t\t\t\t\telse if(\"\".equals(ar[row][col])){\n\t\t\t\t\t\tret.appendln(\"0\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tret.appendln(ar[row][col]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "private static String toString(final String...array) {\n if ((array == null) || (array.length <= 0)) return \"&nbsp;\";\n final StringBuilder sb = new StringBuilder();\n for (int i=0; i<array.length; i++) {\n if (i > 0) sb.append(\", \");\n sb.append(array[i]);\n }\n return sb.toString();\n }", "public String toString() {\n\t\tString str = new String ();\n\t\tfor (int i = 0; i <size; i++)\n\t\t{\n\t\t\tstr +=\"(\" + i +\")\" + arr[i] + \"\\n\";\n\t\t}\n\t\treturn str;\n\t}", "public String toString(){\r\n\t \tString str = \"\";\r\n\t \tint i=0;\r\n\t \tfor(; i < numElems-1; i++){\r\n\t \t\tstr += array[i].toString();\r\n\t \t\tstr += \", \";\r\n\t \t}\r\n\t \tstr += array[numElems-1];\r\n\t \treturn str;\r\n\t }", "public String getArrayValues(){\n String tempString = \"\";\r\n for(int y = 0; y < this.arraySize; y++){\r\n tempString += \" \"+this.arr[y]+\" \";\r\n }\r\n return tempString;\r\n }", "public String toString()\r\n {\r\n String result = \"\";\r\n for ( int i = 0; i < SIZE; i++)\r\n {\r\n result = myArray[i] + result;\r\n }\r\n return result;\r\n \r\n }", "public static String arrayToString(int[] mySortingArray) {\r\n\t\tStringBuilder sb = new StringBuilder(\"{\");\r\n\t\tString comma = null;\r\n\r\n\t\tfor (int element : mySortingArray) {\r\n\t\t\tsb.append((comma == null ? \"\" : comma) + element);\r\n\t\t\tcomma = \",\";\r\n\t\t}\r\n\t\tsb.append(\"}\");\r\n\t\treturn sb.toString();\r\n\t}", "@Override\n public String toString(){\n String result = \"\";\n for(int i = 0; i < numItems; i++){\n result += arr[i] + \" \";\n }\n return result;\n }", "public static String toString(int[] theArray) {\n String str = \"{\";\n\n for (int i = 0; i < theArray.length; i++) {\n str+=theArray[i];\n //adds a comma after every number except the last one\n if(i+1 < theArray.length) {\n str += \",\";\n }\n }\n str += \"}\";\n return str;\n }", "public static String arrayToString(int[][] a) {\n\t\tString toString = \"\";\n\t\tfor (int row = 0; row < a.length; row++) {\n\t\t\tfor (int column = 0; column < a[row].length; column++) {\n\t\t\t\ttoString += a[row][column];\n\t\t\t\tif (!(column == a[row].length - 1)) {\n\t\t\t\t\ttoString += \" \";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!(row == a.length - 1)) {\n\t\t\t\ttoString += \"\\n\";\n\t\t\t}\n\t\t}\n\t\treturn toString;\n\t}", "public void toString(final int[] array) {\n String s = \"\";\n for (int p = 0; p < array.length - 1; p++) {\n s += array[p] + \",\";\n }\n s = s + array[array.length - 1];\n System.out.println(s);\n }", "public String ArrayToString(ArrayList<Card> Arr){\n String ArrayContents1 = \"\"; //contents of array\n for(int i =0; i< Arr.size(); i++){\n Card card = Arr.get(i);\n\n String cardNameString = card.getCardName();\n ArrayContents1= ArrayContents1 + \", \" + cardNameString;\n }\n return ArrayContents1;\n }", "public static String intArrayToString(int[] intArray) {\n String ret = \"\";\n for (int i = 0; i < intArray.length; i++) {\n if (ret.length() > 0)\n ret = ret + \",\" + Integer.toString(intArray[i]);\n else\n ret = Integer.toString(intArray[i]);\n }\n return ret;\n }", "public static String ToString(Object[] s) {\n\t\tString ret = \"\";\n\t\tfor (int i = 0; i < s.length; i++)\n\t\t\tret += s[i];\n\t\treturn ret;\n\t}", "@Override\n public String toString() {\n if (arrayLen != 1) {\n setLength(stringArray, arrayLen);\n String s = join(stringArray);\n // Create a new array to allow everything to get GC'd.\n stringArray = new String[] {s};\n arrayLen = 1;\n }\n return stringArray[0];\n }", "public String toString() {\n\t\treturn Arrays.toString(data);\n\t}", "public String toString(){\r\n\t\treturn Arrays.toString(ray)+\"\";\r\n\t}", "@Override\n\tpublic String toString() {\n\t\tif (size() == 0) {\n\t\t\treturn \"[]\";\n\t\t} else if (size() == 1) {\n\t\t\treturn \"[\" + arr[0] + \"]\";\n\t\t} else {\n\t\t\t// size() >= 2\n\t\t\tString result = \"[\" + arr[0];\n\t\t\tfor (int i = 1; i < end; ++i) {\n\t\t\t\tresult += \", \" + arr[i];\n\t\t\t}\n\t\t\treturn result + \"]\";\n\t\t}\n\t}", "public String toString()\n {\n // create a counter called count\n int count = 0;\n // create empty string for concatenation purposes\n String retString = \"\";\n while(count < size)\n {\n // appending to retString\n retString += arr[count] + \" \";\n // increment count\n count++;\n }\n return retString;\n }", "public static String toString(boolean[] array)\r\n\t{\r\n\t\tString str = \"[ \";\r\n\t\tfor (int i = 0; i < array.length; i++)\r\n\t\t\tif (array[i])\r\n\t\t\t\tstr += \"1\" + \"\";\r\n\t\t\telse\r\n\t\t\t\tstr += \"0\" + \"\";\r\n\t\treturn str + \"]\";\r\n\t}", "public String toString()\n\t{\n\t\t// For empty array\n\t\tif(length() < 1)\n\t\t\tSystem.out.print(\"\");\n\t\tString output = \"\";\n\n\t\tfor(int index = 0; index < length(); index++)\n\t\t{\n\t\t\toutput = output + data[index];\n\t\t\tif(index+1 < length())\n\t\t\t{\n\t\t\t\toutput = output + \" \";\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}", "public static <T> String arrayToString(T[] list, Function<T,String> stringer) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"[\");\n\t\tfor (T i : list) {\n\t\t\tsb.append(stringer.apply(i));\n\t\t\tsb.append(\",\");\n\t\t}\n\t\tif (list.length>0)\n\t\t\tsb.deleteCharAt(sb.length()-1);\n\t\tsb.append(\"]\");\n\t\treturn sb.toString();\n\t}", "public static String[] toStringArray(int arr[])\n {\n String[] sArray = new String[arr.length];\n for(int i=0;i< arr.length;i++){\n sArray[i]=arr[i]+\"\";\n }\n return sArray;\n }", "public static <T> String toString(T[] collection) {\n return toString(Arrays.asList(collection));\n }", "public static String byteArrayToString(byte[] array) {\n\t\tStringBuilder str = new StringBuilder();\n\t\t\n\t\t//iterate through whole array, convert each element from the array to hexadecimal string form, put a space between elements\n\t\tfor(byte b : array) {\n\t\t\tstr.append(String.format(\"%02X\", b));\n\t\t\tstr.append(\" \");\n\t\t}\n\t\treturn str.toString();\n\t}", "public static <E> String[] toStringArray(final E[] array) {\n String[] stringList = null;\n if (array != null) {\n stringList = new String[array.length];\n for (int i = 0; i < array.length; i++) {\n if (array[i] != null) {\n stringList[i] = array[i].toString();\n } else {\n stringList[i] = null;\n }\n }\n }\n return stringList;\n }", "public String print(int[] array)\n {\n StringBuilder inputSB = new StringBuilder();\n String input;\n\n for(int i = 0; i < array.length; i++)\n {\n inputSB.append(array[i]);\n if(i != (array.length - 1))\n {\n inputSB.append(\",\");\n }\n }\n\n input = inputSB.toString();\n return input;\n }", "public static String arrayToString(boolean[] a){\n\t\tString output = \"\";\n\t\tfor(int i=0; i<a.length; i++){\n\t\t\tif (a[i])\n\t\t\t\toutput=output+\"1\";\n\t\t\telse\n\t\t\t\toutput=output+\"0\";\n\t\t}\n\t\treturn output;\n\t}", "@Override\n public final String toString() {\n final int[] temp = new int[size];\n for (int i = 0; i < size; i++) {\n temp[i] = arrayList[i];\n }\n return Arrays.toString(temp);\n }", "public static String arrayToString(double[] a, String div){\n\t\tString output = \"\";\n\t\tfor(int i=0; i<a.length; i++){\n\t\t\toutput=output+\"\"+a[i];\n\t\t\tif (i<a.length-1)\n\t\t\t\toutput=output+div;\n\t\t}\n\t\treturn output;\n\t}", "public static String[] toStringArray(int arr[])\r\n\t{\r\n\t\tint length = arr.length;\r\n\t\tString[] result = new String[length];\r\n\t\tfor (int i = 0; i < length; ++i) {\r\n\t\t\tresult[i] = String.valueOf(arr[i]);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "private static String compileArray(float[] array) {\n String arrayString = \"\\\"\";\n for (float number : array) {\n arrayString += Model.formatFloat(number) + \", \";\n }\n arrayString = arrayString.substring(0, arrayString.length() - 2);\n arrayString += \"\\\"\";\n return arrayString;\n }", "private static String getToString(Object[] arr, String delim) {\n\t\tif (arr.length == 0) return \"\"; \n\t\t\n\t\tStringBuilder sb = new StringBuilder(\"[\");\n\t\t\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tif (i > 0) sb.append(delim);\n\t\t\tsb.append(arr[i] == null ? \"\" : arr[i]);\n\t\t}\n\n\t\tsb.append(\"]\");\n\t\treturn sb.toString();\n\t}", "public String toString() {\n int[] d = new int[size];\n for (int k=0; k<size; k++)\n d[k] = data[k];\n return Arrays.toString(d);\n }", "public static String[] objectArrayToStringArray(Object[] a) {\n String[] r = new String[a.length];\n\n for (int i = 0; i < a.length; i++) {\n r[i] = (String) a[i];\n }\n\n return r;\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"\\nContents of SimpleArray:\\n\" + Arrays.toString(array);\n\t}", "public String toString(ArrayList<Integer> arr) {\n\t\tString mssg = \"\";\n\t\tfor(int i = 0; i < arr.size(); i++) {\n\t\t\tmssg += arr.get(i) + \" \";\n\t\t}\n\t\treturn mssg;\n\t}", "public String toString() {\r\n\t\tString elements = \"<\";\r\n\t\t\r\n\t\tfor(int i = 0; i < count; i++) {\r\n\t\t\telements += \" \" + array[i];\r\n\t\t\t}\r\n\t\t\r\n\t\t\telements += \" >\";\r\n\t\t\treturn elements;\r\n\t }", "public String tojstring() {\n return array[index].tojstring();\n }", "public static String arrayToString(int[] a, String div){\n\t\tString output = \"\";\n\t\tfor(int i=0; i<a.length; i++){\n\t\t\toutput=output+\"\"+a[i];\n\t\t\tif (i<a.length-1)\n\t\t\t\toutput=output+div;\n\t\t}\n\t\treturn output;\n\t}", "public String toString() {\n String sorted = \"[\";\n for (int i = 0; i < size - 1; i++) {\n sorted = sorted + array[i] + \", \";\n }\n sorted = sorted + array[size - 1] + \"]\";\n return sorted;\n }", "public static String[] intArrayToStringArray(int[] intArray) {\n\t\t// input primitive integer array\n\t\tString strArray[] = Arrays.stream(intArray).mapToObj(String::valueOf).toArray(String[]::new);\n\t\treturn strArray;\n\t}", "public String RoutesArrayToString(ArrayList<Route> arrayToConvert) {\n String resultString = \"\";\n StringBuilder resultStringBuilder = new StringBuilder(resultString);\n for (int i = 0; i < arrayToConvert.size(); i++) {\n if (arrayToConvert.get(i).getAirlineID() >= 0) {\n String routeString =\n arrayToConvert.get(i).getSourceAirport()\n + \" to \"\n + arrayToConvert.get(i).getDestinationAirport();\n if (i == arrayToConvert.size() - 1) {\n resultStringBuilder.append(routeString);\n } else {\n resultStringBuilder.append(routeString).append(\", \");\n }\n }\n }\n resultString = resultStringBuilder.toString();\n return resultString;\n }", "private String convertToString(ArrayList<String> arr, char sep) {\n StringBuilder builder = new StringBuilder();\n // Append all Integers in StringBuilder to the StringBuilder.\n for (String str : arr) {\n builder.append(str);\n builder.append(sep);\n }\n // Remove last delimiter with setLength.\n builder.setLength(builder.length() - 1);\n return builder.toString();\n }", "private String longsToStr(int[] longs) { // convert array of longs back to string\n String result = \"\";\n// int[] a = new int[longs.length];\n for (int i = 0; i < longs.length; i++) {\n // a[i] = longToStr(longs[i]);\n // result += a[i];\n result += longToStr(longs[i]);\n }\n return result; // use Array.join() rather than repeated string appends for efficiency\n }", "private String[] numberToStringArray(Number[] values) {\n String[] retVal = null;\n if (values != null) {\n retVal = new String[values.length];\n Arrays.fill(retVal, \"\");\n for (int i = 0; i < values.length; i++) {\n Number n = values[i];\n if ((n.doubleValue() != -9999)\n && (!Double.isNaN(n.doubleValue()))) {\n retVal[i] = n.toString();\n }\n }\n }\n return retVal;\n }", "public String toString(){\r\n\t\tString theString= \"\";\r\n\t\t\r\n\t\t//loop through and add values to the string\r\n\t\tfor (int i = 0; i < this.data.length; i++)\r\n\t\t{\r\n\t\t\ttheString = theString + this.data[i];\r\n\t\t\tif (i != this.data.length - 1)\r\n\t\t\t{\r\n\t\t\t\ttheString = theString + \", \";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn \"[\" + theString + \"]\";\r\n\t}", "public String toString() { \n\t\t String str=\"\";\n\t\t for(int i=0; i< size; i++)\n\t\t\t str += data[i]+\" \";\n\t\t return str;\n\t }", "public String toString()\n {\n\n String elem;\n StringBuilder s = new StringBuilder();\n for(int i = 0 ; i < n ; i++)\n {\n elem = Integer.toString(array1[i]);\n s.append(elem);\n if(i < (n-1))\n s.append(',');\n }\n s.append('|');\n for(int i = 0 ; i < n ; i++)\n {\n elem = Integer.toString(array2[i]);\n s.append(elem);\n if(i < (n-1))\n s.append(',');\n }\n return s.toString();\n }", "public String toString() {\n\t \tif(size == 0) {\n\t \t\treturn \"[]\";\n\t \t}else {\n\t \t\t\n\t \t\tString result = \"[\" + elementData[0];\n\t \t\tfor(int i = 1; i < size; i++) {\n\t \t\t\tresult += \", \" + elementData[i];\n\t \t\t}\n\t \t\t\n\t \t\tresult += \"]\";\n\t \t\t\n\t \t\treturn result;\n\t \t}\n\t }", "@Override\n\tpublic String toString() {\n\t\treturn JSONFormatter.formatArray(this, 0, false).toString();\n\t}", "public static String convertCoordinatesArrayToString(ArrayList<LatLng> coordsArray){\n String result = \"\";\n LatLng coord;\n for (int i=0; i < coordsArray.size(); i+=1) {\n coord = coordsArray.get(i);\n result += coord.latitude + \",\";\n result += coord.longitude;\n if (i+1 < coordsArray.size()){\n result += \",\";\n }\n }\n return result;\n }", "private static String dumpArrayString(Object[] arguments) {\n StringBuilder argBuf = new StringBuilder(\"[\");\n for (int i = 0; i < arguments.length; i++) {\n if (i > 0) {\n argBuf.append(\", \");\n }\n argBuf.append(DefaultGroovyMethods.dump(arguments[i]));\n }\n argBuf.append(\"]\");\n return argBuf.toString();\n }", "public static String arrayToString(String[] a, String div){\n\t\tString output = \"\";\n\t\tfor(int i=0; i<a.length; i++){\n\t\t\tif (a[i].equals(\"\"))\n\t\t\t\ta[i] = \"<-_->\";\n\t\t\toutput=output+a[i];\n\t\t\tif (i<a.length-1)\n\t\t\t\toutput=output+div;\n\t\t}\n\t\t//what the fuck is this a java bug????????\n\t\tfor(int i=0; i<a.length; i++){\n\t\t\tif (a[i].equals(\"<-_->\"))\n\t\t\t\ta[i] = \"\";\n\t\t}\n\t\treturn output;\n\t}", "public static String toString(String format, int[] array)\r\n\t{\r\n\t\tString str = \"[ \";\r\n\t\tfor (int i = 0; i < array.length; i++)\r\n\t\t\tstr += String.format(format, array[i]) + \" \";\r\n\t\treturn str + \"]\";\r\n\t}", "String arryToSinglelineString(int[] array,int N) {\n\t\tString str=\"\"; \n\t\tfor(int i=0;i<N;i++)\n\t\t\tstr=str+String.valueOf(array[i])+\" \";\n\t\treturn \"{\"+str+ \"}\";\n\t}", "public static String toString(String format, double[] array)\r\n\t{\r\n\t\tString str = \"[ \";\r\n\t\tfor (int i = 0; i < array.length; i++)\r\n\t\t\tstr += String.format(format, array[i]) + \" \";\r\n\t\treturn str + \"]\";\r\n\t}", "static String printArray(int[] numbers) {\n\t\tint index = 0;\r\n\t\tString array = \"\";\r\n\t\twhile (index < numbers.length) {\r\n\t\t\tarray = array + numbers[index] + \" \";\r\n\t\t\tindex++;\r\n\t\t}\r\n\t\tprintln(array);\r\n\t\treturn array;\r\n\t}", "private String arrayToString(TOP fsIn, int arrayType) throws SAXException {\n if (fsIn == null) {\n return null;\n }\n\n StringBuilder buf = new StringBuilder();\n CommonArrayFS fs = (CommonArrayFS) fsIn;\n String elemStr = null;\n\n // FS arrays: handle shared data items\n if (fs instanceof FSArray) {\n List<XmiArrayElement> ootsArrayElementsList = cds.sharedData == null ? null\n : cds.sharedData.getOutOfTypeSystemArrayElements((FSArray) fs);\n int ootsIndex = 0;\n\n int j = -1;\n for (TOP elemFS : ((FSArray) fs)._getTheArray()) {\n j++;\n if (elemFS == null) { // null case\n // special NULL object with xmi:id=0 is used to represent\n // a null in an FSArray\n elemStr = \"0\";\n // However, this null array element might have been a reference to an\n // out-of-typesystem FS, so check the ootsArrayElementsList\n if (ootsArrayElementsList != null) {\n\n while (ootsIndex < ootsArrayElementsList.size()) {\n XmiArrayElement arel = ootsArrayElementsList.get(ootsIndex++);\n if (arel.index == j) {\n elemStr = arel.xmiId;\n break;\n }\n }\n }\n\n } else { // not null\n String xmiId = cds.getXmiId(elemFS);\n if (cds.isFiltering) { // return as null any references to types not in target TS\n String typeName = elemFS._getTypeImpl().getName();\n if (cds.filterTypeSystem_inner.getType(typeName) == null) {\n xmiId = \"0\";\n }\n }\n elemStr = xmiId;\n }\n\n if (buf.length() > 0) {\n buf.append(' ');\n }\n buf.append(elemStr);\n } // end of loop over FS Array elements\n\n return buf.toString();\n\n } else if (fs instanceof ByteArray) {\n\n // special case for byte arrays: serialize as hex digits\n byte[] ba = ((ByteArray) fs)._getTheArray();\n\n char[] r = new char[ba.length * 2];\n\n int i = 0;\n for (byte b : ba) {\n r[i++] = INT_TO_HEX[(b & 0xF0) >>> 4];\n r[i++] = INT_TO_HEX[b & 0x0F];\n }\n return new String(r);\n } else {\n // is not FSarray, is not ByteArray, is not String Array\n // CommonArrayFS fs;\n // String[] fsvalues;\n //\n // switch (arrayType) {\n // case LowLevelCAS.TYPE_CLASS_INTARRAY:\n // fs = new IntArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_FLOATARRAY:\n // fs = new FloatArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_BOOLEANARRAY:\n // fs = new BooleanArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_SHORTARRAY:\n // fs = new ShortArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_LONGARRAY:\n // fs = new LongArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_DOUBLEARRAY:\n // fs = new DoubleArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_BYTEARRAY:\n // fs = new ByteArrayFSImpl(addr, cds.cas);\n // break;\n // default: {\n // return \"\";\n // }\n // }\n\n // if (arrayType == LowLevelCAS.TYPE_CLASS_STRINGARRAY) { // this method never called for\n // StringArrays\n // StringArrayFS strFS = new StringArrayFSImpl(addr, cds.cas);\n // fsvalues = strFS.toArray();\n // } else {\n String[] fsvalues = fs.toStringArray();\n // }\n\n for (String s : fsvalues) {\n if (buf.length() > 0) {\n buf.append(' ');\n }\n buf.append(s);\n }\n return buf.toString();\n }\n }", "@Override\n public String toString()\n {\n return Arrays.toString(this.toArray());\n }", "private static String toString (byte[] ba) {\r\n return toString(ba, 0, ba.length);\r\n }", "public static String byteArrayToBinaryString(byte[] array) {\n\t\tStringBuilder str = new StringBuilder();\n\t\tfor(byte b : array) {\n\t\t\tstr.append((\"00000000\"+Integer.toBinaryString(b)).substring(Integer.toBinaryString(b).length()));\n\t\t\tstr.append(\" \");\n\t\t}\n\t\treturn str.toString();\n\t}", "public static String toString(final Object[] objs) {\r\n\t\tfinal StringBuilder sb = new StringBuilder();\r\n\t\tsb.append('[');\r\n\t\tif (objs != null) {\r\n\t\t\tint i = 0;\r\n\t\t\tfor (final Object obj : objs) {\r\n\t\t\t\tsb.append(obj.toString());\r\n\t\t\t\tif (i < (objs.length - 1)) {\r\n\t\t\t\t\tsb.append(',');\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tsb.append(']');\r\n\t\treturn sb.toString();\r\n\t}", "public String toString() {\r\n\t\tString salida = \"El inicio de la subsecuencia maxima es \" + izq\r\n\t\t\t\t+ \", el final \" + der + \", la suma maxima es \" + sumaMax\r\n\t\t\t\t+ \" y los datos son \";\r\n\t\tfor (int a : array)\r\n\t\t\tsalida += a + \" \";\r\n\t\treturn salida;\r\n\t}", "public static String toByteString(byte[] array) {\n StringBuilder sb = new StringBuilder(\"{\");\n for (int i = 0; i < array.length; i++) {\n if (i > 0)\n sb.append(\" \");\n sb.append(toByteString(array[i]));\n }\n return sb.append(\"}\").toString();\n }", "@Override\n public String toString() {\n double[][] temp = matx.getArray();\n String tempstr = \"[\";\n for (int i = 0; i < temp.length; i++) {\n for (int j = 0; j < temp.length; j++) {\n tempstr += (int) temp[i][j] + \", \";\n }\n tempstr = tempstr.substring(0, tempstr.length() - 2);\n tempstr += \"]\\n[\";\n }\n return tempstr.substring(0, tempstr.length() - 2);\n }", "public String toString() {\n if (N == 0) return \"[ ]\";\n String s = \"\";\n s = s + \"[ \";\n for (int i = 0; i <= N; i++)\n s = s + a[i] + \" \";\n s = s + \"]\";\n return s;\n }", "public String toString()\n\t{\n\t\tSystem.out.print(\"Array list contains: [ \");\n\t\tfor(int i=0; i<size; i++)\n\t\t\tSystem.out.print(myArray[i]+ \", \");\n\t\treturn\" ]\";\n\t}", "public String toString() {\n\t\tString str = \"\";\n\t\tfor(int i = 0;i < data.length;i++) {\n\t\t\tstr = str + data[i];\n\t\t}\n\t\tif(overflow) {\n\t\t\treturn \"Overflow\";\n\t\t}else {\n\t\t\treturn str;\n\t\t}\n\t}", "public static String arrayToCommaSeparatedString(String[] arr) {\n return arrayToSeparatedString(arr, ',');\n }", "public String toString() {\n String result = \"[\";\n if (!isEmpty()) {\n result += elementData[1];\n for (int i = 2; i <= size; i++) {\n result += \", \" + elementData[i];\n }\n }\n return result + \"]\";\n }", "static void writearray(String[]array) {\n\t\t for (int i = 0; i < array.length; i++) {\n\t\t\tSystem.out.println(array[i]);\n\t\t}\n\t}", "public static String cardsToString(int[] cards){\n //check for null array\n if(cards == null){\n return \"[]\";\n }\n //string buffer with open brackets\n StringBuffer sb = new StringBuffer(\"[\");\n //add the individual string cards to the string buffer\n for(int i = 0; i < cards.length; i++){\n sb.append(cardToString(cards[i]));\n //add a comma after all of the cards except the last one\n if(i != cards.length - 1){\n sb.append(\", \");\n }\n }\n //add close bracket\n sb.append(\"]\");\n return sb.toString();\n }", "public static String serializeForSQL(long arr[]){\n\t\tString ret = \"\";\n\t\tif (arr != null){\n\t\t\tfor (int i = 0; i < arr.length; i++){\n\t\t\tif (i != 0){\n\t\t\t\tret += \",\";\n\t\t\t}\n\t\t\tret += arr[i];\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "private String byteToString(byte[] bytes) {\n String bytesInStringForm = \"\";\n for (int byteChecked = 0; byteChecked < bytes.length; byteChecked++) {\n bytesInStringForm += (Integer.toString(bytes[byteChecked]));\n bytesInStringForm += (\",\");\n }\n return bytesInStringForm;\n }", "public String toString(){\r\n\t\tString ret = \"MatrixArray:\\n\";\r\n\t\tfor (int i = 0; i < this.MA.length; i++) {\r\n\t\t\tfor (int j = 0; j < this.MA[i].length; j++){\r\n\t\t\t\tif (j > 0) {\r\n\t\t\t\t\tret += \", \";\r\n\t\t }\r\n\t\t ret += String.valueOf(this.MA[i][j]);\r\n\t\t\t}\r\n\t\t\tret += \"\\n\";\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "public String[] toStrings();", "public static String toHexString(byte[] array) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"0x\").append(DatatypeConverter.printHexBinary(array));\n return sb.toString();\n }", "public static String doubleArrayToString (double[] arr, int d) {\n\t\tString str = \"\";\n\t\tif (d == 0) return str;\n\n\t\tstr += arr[0];\n\t\tfor (int i=1; i<d; i++) {\n\t\t\tstr += \"\\t\" + arr[i];\n\t\t}\n\t\treturn str;\n\t}", "public static String join(String[] array)\n {\n if( array.length == 0 ) return Constants.BLANK;\n StringBuilder sb = new StringBuilder();\n for( String s : array )\n sb.append(s);\n return sb.toString();\n }", "public static String toString(int[][] a) {\r\n\t\tint rowNum = a.length;\r\n\t\tint colNum = a[0].length;\r\n\t\tString ret = \"\";\r\n\t\tfor (int i = 0; i < rowNum; i++) {\r\n\t\t\tfor (int j = 0; j < colNum; j++) {\r\n\t\t\t\tif (colNum == 0) {\r\n\t\t\t\t\tret += \"\\n\";\r\n\t\t\t\t}\r\n\t\t\t\tret += \"\\t\" + a[i][j];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "private static String classArrayToString(Class[] pts) {\n StringBuilder result = new StringBuilder();\n for (int i = 0; i < pts.length; i++) {\n result.append(getTypeName(pts[i]));\n if (i < pts.length - 1)\n result.append(\",\");\n }\n return result.toString();\n }", "public static String toHexString(byte[] array) {\n return DatatypeConverter.printHexBinary(array).toUpperCase();\n }", "public String toString() {\n String temp = \"\";\n temp += \"[ \";\n for (int i = 0; i < elements.length - 1; i++) {\n temp += elements[i] + \",\";\n }\n temp += elements[this.elements.length - 1];\n temp += \" ]\\n\";\n return temp;\n }", "public static String listArray(int num[]) {\n String out = \"{\"; //prints out { for beginingg output of an array output\n for (int j = 0; j < num.length; j++) { //loops through array \n if (j > 0) { //if the indice is greater than 0, print a comma to seperate the array elements neatly\n out += \", \";\n }\n out += num[j]; //assigns the value of the array at num[j] to out\n }\n out += \"} \"; //ending part of 'out' String\n return out; //return out string \n }", "public String toString() {\n return Arrays.toString(id);\n }" ]
[ "0.79585475", "0.78600836", "0.78155077", "0.7719349", "0.7716896", "0.76320136", "0.7611363", "0.746796", "0.73619395", "0.7339264", "0.73032105", "0.7258431", "0.720171", "0.7166513", "0.7166513", "0.7164559", "0.71223813", "0.7117461", "0.70923734", "0.7058415", "0.70444286", "0.7033021", "0.6980493", "0.6979827", "0.6978109", "0.69322824", "0.69207895", "0.6911847", "0.6904986", "0.68997985", "0.6867917", "0.6857002", "0.68485636", "0.6843718", "0.68418145", "0.68409526", "0.68342566", "0.68321323", "0.6808971", "0.67953104", "0.6778697", "0.6764922", "0.6742421", "0.6730984", "0.6715388", "0.6710546", "0.6689646", "0.6682948", "0.6676881", "0.66647065", "0.6659778", "0.6644054", "0.6618744", "0.6618512", "0.6581232", "0.6529199", "0.64970183", "0.64912105", "0.6469453", "0.6462974", "0.6432306", "0.64245623", "0.64025974", "0.6376647", "0.6324071", "0.6322518", "0.62978244", "0.6292325", "0.6285738", "0.62623423", "0.62602985", "0.62511975", "0.62485516", "0.6246126", "0.62111133", "0.6201757", "0.6192403", "0.6187752", "0.6171884", "0.6159432", "0.6148585", "0.61432403", "0.6125635", "0.6124458", "0.61147904", "0.6110399", "0.61103237", "0.6101632", "0.6086773", "0.60821736", "0.60814244", "0.6036449", "0.6033811", "0.6019518", "0.6003525", "0.6001806", "0.5994264", "0.59859544", "0.59796935", "0.59565294", "0.59400153" ]
0.0
-1
VALUE Creates new value. 1. Clear b63.
private static long newValue(long v) { return (v<<1) >>> 1; // 1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void resetCValue();", "public void reset(){\n value = 0;\n }", "public void mo9126b() {\n this.f1298a = null;\n mo9252b(false);\n this.f1299b = 0;\n this.f1300c = null;\n }", "public Builder clearValue() {\n \n value_ = 0L;\n onChanged();\n return this;\n }", "public void m65930c() {\n this.f56361c = 0;\n }", "public Builder clearValue() {\n \n value_ = 0;\n onChanged();\n return this;\n }", "public void unAssign(){\n\t\tthis.value = 0;\n\t}", "void unsetValue();", "void unsetValue();", "public void unsetValue()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(VALUE$12);\n }\n }", "public GenerateurImpl() {\n\t\tsuper();\n\t\tthis.value = 0;\n\t}", "public DoubleValue() {\n this.value = 0;\n }", "public Integer newValue(){\n\t\treturn 0;\r\n\t}", "public Builder clearValue() {\n bitField0_ = (bitField0_ & ~0x00000002);\n value_ = 0F;\n onChanged();\n return this;\n }", "private byte getValue() {\n\t\treturn value;\n\t}", "public Builder clearValue() {\n \n value_ = getDefaultInstance().getValue();\n onChanged();\n return this;\n }", "public void resetCurrentValue()\r\n\t{\r\n\t\tborder=2;\r\n\t}", "public Builder clearValue() {\n value_ = getDefaultInstance().getValue();\n onChanged();\n return this;\n }", "public Builder clearPValue() {\n \n pValue_ = 0D;\n onChanged();\n return this;\n }", "public Builder clearRealValue() {\n if (typeCase_ == 4) {\n typeCase_ = 0;\n type_ = null;\n onChanged();\n }\n return this;\n }", "@Override\r\n\tpublic void unsetGetValue() {\n\t\t\r\n\t}", "Field() {\n value = 0;\n }", "public Builder clearValue() {\n\n value_ = getDefaultInstance().getValue();\n onChanged();\n return this;\n }", "@Override\n public void setValue(Binary value) throws ValueFormatException,\n VersionException, LockException, ConstraintViolationException,\n RepositoryException {\n \n }", "public void aendereWert (int value) {\n\t\tvalue = 0 ;\n\t}", "public int getValue() {\n/* 450 */ return this.value;\n/* */ }", "public Builder clearStateValue1() {\n \n stateValue1_ = 0;\n onChanged();\n return this;\n }", "public Builder clearValue() {\n bitField0_ = (bitField0_ & ~0x00000004);\n value_ = 0D;\n onChanged();\n return this;\n }", "public void method_2244() {\r\n this.field_1858 = 0;\r\n }", "public CalculatorValue(){\n\t\tvalue=0.0;\n\t\terrorTerm=0.0;\n\t\tthis.units=\"\";\n\t}", "private void clearAll(byte value) {\n for (int i = 0; i < size; i++) {\n data[i] = (byte) (value & 0xff);\n }\n }", "public final void set () {\t\n\t\tsymbol = null;\t\n\t\tmksa = underScore; factor = 1;\n\t\tvalue = 0./0.;\t\t\t// NaN\n\t\toffset = 0.;\n\t}", "public BwValue mkValue() {\n\t\treturn new BwValue(this.sT);\n\t}", "public void mo23447a() {\n this.f19967a = false;\n this.f19968b = 0;\n this.f19969c = 0;\n }", "public Builder clearValue() {\n \n value_ = getDefaultInstance().getValue();\n onChanged();\n return this;\n }", "public Builder clearValue() {\n \n value_ = getDefaultInstance().getValue();\n onChanged();\n return this;\n }", "@Override\n public int value() {\n return 0;\n }", "public final void mo1641b() {\n super.mo1641b();\n this.f1472a = 0.0f;\n }", "public Builder clearMPValue() {\n bitField0_ = (bitField0_ & ~0x00000004);\n mPValue_ = 0;\n onChanged();\n return this;\n }", "private Value() {\n\t}", "public Builder clearBasisValue() {\n if (basisValueBuilder_ == null) {\n if (typeCase_ == 13) {\n typeCase_ = 0;\n type_ = null;\n onChanged();\n }\n } else {\n if (typeCase_ == 13) {\n typeCase_ = 0;\n type_ = null;\n }\n basisValueBuilder_.clear();\n }\n return this;\n }", "public int setValue (int val);", "public void clear()\n \t{\n \t\tint byteLength = getLengthInBytes();\n \t\tfor (int ix=0; ix < byteLength; ix++)\n value[ix] = 0;\n \t}", "protected Value() {\n flags = 0;\n num = null;\n str = null;\n object_labels = getters = setters = null;\n excluded_strings = included_strings = null;\n functionPartitions = null;\n functionTypeSignatures = null;\n var = null;\n hashcode = 0;\n }", "void setValue(byte value) {\n this.value = value;\n blockDrawables.get(selected).setValue(value);\n }", "public byte getValue() {\n return value;\n }", "public Builder clearValue() {\n bitField0_ = (bitField0_ & ~0x00000001);\n value_ = 0;\n onChanged();\n return this;\n }", "public void mo42980c() {\n byte[] f = getCopyBytes();\n if (f == null) {\n this.f12199g = 0;\n } else {\n this.f12199g = Arrays.hashCode(f);\n }\n }", "public byte value() {\n return value;\n }", "@Override\n public byte byteValue() {\n return value;\n }", "@Override\n public double getValue() {\n return 0;\n }", "@Override\n public void setDefault() {\n value = new byte[] {0x40};\n }", "synchronized byte getCurrentValueHi()\n {\n int cv = getCurrentValue();\n cv >>= 8;\n return (byte)cv;\n }", "public Value() {}", "public BabbleValue() {}", "public synchronized void mo3818b() {\n this.f582c = null;\n this.f583d = 0;\n this.f584e = 0;\n }", "public final void m83c() {\n synchronized (this.aa) {\n this.f89A = UUID.randomUUID().toString();\n }\n }", "public void setValue(int new_value){\n this.value=new_value;\n }", "public Builder clearValue() {\n bitField0_ = (bitField0_ & ~0x00000002);\n value_ = getDefaultInstance().getValue();\n onChanged();\n return this;\n }", "public Builder clearValue() {\n bitField0_ = (bitField0_ & ~0x00000002);\n value_ = getDefaultInstance().getValue();\n onChanged();\n return this;\n }", "protected int value() {\n System.out.print(\"Cloth Value: \");\n return finalValue;\n }", "void xsetValue(gov.nih.nlm.ncbi.www.MedlineSiDocument.MedlineSi.Type.Value value);", "public void createValue() {\r\n value = new qa.gov.mol.ProcessAcknowledgment();\r\n }", "synchronized void reset() {\n\n // no change if called before getValue() or called twice\n lastValue = currValue = startValue;\n }", "synchronized byte getCurrentValueLo()\n {\n return (byte)getCurrentValue();\n }", "public void createValue() {\n value = new GisInfoCaptureDO();\n }", "public void set(int value) {\n this.value = BigInteger.valueOf(value).toByteArray();\n }", "final void mo6078b() {\n if (this.f2346p == null) {\n C0926z c0926z = this.f2341d == Integer.class ? f2331i : this.f2341d == Float.class ? f2332j : null;\n this.f2346p = c0926z;\n }\n if (this.f2346p != null) {\n this.f2342e.f2296f = this.f2346p;\n }\n }", "protected void setValue0(T value) {\n\t\t// Preconditions\n\t\tif (value == null) {\n\t\t\tthrow new NullPointerException(\"Value cannot be null\");\n\t\t}\n\n\t\tthis.value = value;\n\t}", "void setNextValue() {\n this.value = this.value * 2;\n }", "public Builder clearValue() {\n bitField0_ = (bitField0_ & ~0x00000001);\n value_ = getDefaultInstance().getValue();\n onChanged();\n return this;\n }", "public void createValue() {\n value = new AES_GetBusa_Lib_1_0.AES_GetBusa_Request();\n }", "void setValue(int value);", "public void setZero() {\n\t\tset((byte) (get() | (1 << 7)));\n\t}", "public Builder clearValue() {\n value_ = emptyLongList();\n bitField0_ = (bitField0_ & ~0x00000001);\n onChanged();\n return this;\n }", "public Value(){}", "public void m9010e() {\n if (this.f7525d != null) {\n this.f7525d.clear();\n }\n }", "public void apply() { writable.setValue(value); }", "public void set()\n\t{\n\t\tbitHolder.setValue(1);\n\t}", "public void setValue(int param1Int) {\n/* 294 */ this.s.setValue(-param1Int);\n/* */ }", "public MyDouble() {\n this.setValue(0);\n }", "public void mo4351b() {\n this.f3147b = -1;\n this.f3148c = Integer.MIN_VALUE;\n this.f3149d = false;\n this.f3150e = false;\n }", "public void mo105475a() {\n this.f83728b = null;\n this.f83729c = 0;\n }", "public void clear()\n\t{\n\t\tbitHolder.setValue(0);\n\t}", "public void setIsDefault(Byte value) {\n set(3, value);\n }", "public void addValue() {\n addValue(1);\n }", "public void setValue(int value) {\n\t\tthis.removeAllPCData();\n\t\ttry {\n\t\t\tthis.appendChild(new XPCData(Integer.toString(value)));\n\t\t} catch (Exception e) {\n\t\t\t//ignoring this because it shouldn't break\n\t\t}\n\t}", "public void setValueNull()\n\t{\n\t\tallValues.clear();\n\t}", "public void m9735d() {\r\n this.f6261j = bw.m10080b(this.f6261j, 0);\r\n }", "public Builder clearStateValue2() {\n \n stateValue2_ = 0;\n onChanged();\n return this;\n }", "public int value() { \n return this.value; \n }", "public Builder clearStateValue3() {\n \n stateValue3_ = 0;\n onChanged();\n return this;\n }", "public int getValue() \n {\n return value;\n }", "public final void mo23963b() {\n this.f26309d = 0;\n this.f26307b = 0;\n C6202e.m19259a().f18259a = false;\n C6269c.m19445a().mo15060a(true, 0);\n }", "public void resetValor();", "com.google.protobuf.ByteString\n getValBytes();", "public void m9125k() {\r\n this.f6009c = null;\r\n }", "public int getValue()\r\n/* 21: */ {\r\n/* 22: 71 */ return this.value;\r\n/* 23: */ }", "public void setValue(int value);", "public final void mo5021a() {\n this.f2434k = null;\n }", "void unsetValueQuantity();" ]
[ "0.6238906", "0.6133524", "0.5975648", "0.5946568", "0.5867244", "0.5863616", "0.57927525", "0.5787862", "0.5787862", "0.5785962", "0.5784389", "0.5781266", "0.57715535", "0.5742912", "0.57146573", "0.57131153", "0.57002056", "0.5687812", "0.5684971", "0.5678481", "0.5665581", "0.56618655", "0.56525296", "0.5649408", "0.56270283", "0.561872", "0.5615803", "0.5614289", "0.5613784", "0.5609046", "0.56068367", "0.56041795", "0.55905026", "0.55803436", "0.5551685", "0.5551685", "0.5535835", "0.55278957", "0.55186695", "0.551269", "0.55088943", "0.55086505", "0.5503551", "0.5495928", "0.5488917", "0.54874575", "0.5481767", "0.548035", "0.54737747", "0.54681563", "0.5465373", "0.5460103", "0.5456756", "0.54552925", "0.5440524", "0.54392594", "0.5437789", "0.54277116", "0.5423059", "0.5423059", "0.541836", "0.5413867", "0.5401007", "0.53976345", "0.5396197", "0.539369", "0.53851414", "0.538308", "0.5381918", "0.5377588", "0.5374665", "0.5369094", "0.536544", "0.53625405", "0.5359521", "0.5357514", "0.53556997", "0.5350306", "0.5347008", "0.5342949", "0.53351194", "0.5334901", "0.53334105", "0.53328633", "0.53274065", "0.53255236", "0.53182995", "0.53140664", "0.5303182", "0.5301285", "0.53001654", "0.52945524", "0.52934575", "0.5288431", "0.528801", "0.52868325", "0.5282464", "0.52789694", "0.5271226", "0.5269664", "0.52674127" ]
0.0
-1
Checks if item is a value. 1. Check is b63 is not set.
private static boolean isValue(long x) { return x >= 0L; // 1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isValue() {\n switch(this.getType()) {\n case CONSTANT_INTEGER : \n case CONSTANT_FLOAT :\n case CONSTANT_DOUBLE : \n case CONSTANT_LONG : \n case CONSTANT_STRING:\n return true ;\n default :\n return false;\n }\n }", "private boolean isVal() {\n\t\treturn look.type == Tag.BOOLEAN || look.type == Tag.NUMBER\n\t\t\t\t|| look.type == Tag.STRING || look.type == Tag.NULL;\n\n\t}", "boolean isValue();", "public boolean isValue() {\n return false;\n }", "public boolean hasValue() { return false; }", "public boolean hasValue() {\n return valueBuilder_ != null || value_ != null;\n }", "public boolean isValue() {\n return value;\n }", "public boolean hasValue() {\n return value_ != null;\n }", "public boolean isValue() {\n return value;\n }", "default boolean hasValue() {\n\t\t\treturn getValue() != null;\n\t\t}", "@Override\n\t\t\tpublic boolean containsValue(Object value) {\n\t\t\t\treturn false;\n\t\t\t}", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "boolean hasValue();", "@Override\n\tpublic boolean containsValue(Object value) {\n\t\treturn false;\n\t}", "public boolean validateValue(Object value) {\n return true;\n }", "public boolean checkValueTypeValidity(Object value) {\n\t\treturn propType.checkValueTypeValidity(value);\n\t}", "public boolean hasValue() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public abstract Value validateValue(Value value);", "boolean isSetValueQuantity();", "public boolean containsValue(Object v) {\n/* 119 */ return false;\n/* */ }", "public boolean hasValue() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasValue() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasValue() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean containsValue(Object value) {\n\t\treturn false;\r\n\t}", "public boolean hasValue() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasValue() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean isValidItem() {\n return validItem;\n }", "public boolean hasValue() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "@java.lang.Override\n public boolean hasVal() {\n return val_ != null;\n }", "public boolean hasValue() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasValue() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean isSetInt_vals() {\n return this.int_vals != null;\n }", "static boolean scalar_value(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"scalar_value\")) return false;\n boolean r;\n r = consumeToken(b, NUMBER);\n if (!r) r = consumeToken(b, BOOLEAN);\n if (!r) r = consumeToken(b, STRING);\n return r;\n }", "public boolean hasValue() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasValue() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasValue() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "@Override\n\tpublic boolean containsValue(Object arg0) {\n\t\treturn false;\n\t}", "public boolean isSetValue() {\n return this.value != null;\n }", "boolean hasVal();", "boolean hasVal();", "@Override\n public boolean hasVal() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean isSetValue() {\n return this.value != null;\n }", "public final boolean hasTerminalValue ()\r\n {\r\n return isSpecialForm() && specialForm().isValue();\r\n }", "@Override\n public boolean hasVal() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "@Override\n public Bln item(final QueryContext qc, final InputInfo ii) throws QueryException {\n if(single) {\n final Item item = expr.item(qc, info);\n return Bln.get(!item.isEmpty() && eval(item));\n }\n\n // iterative evaluation\n final Iter iter = expr.atomIter(qc, info);\n for(Item item; (item = qc.next(iter)) != null;) {\n if(eval(item)) return Bln.TRUE;\n }\n return Bln.FALSE;\n }", "boolean isSimpleValue();", "public boolean isSetValue()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(VALUE$12) != null;\n }\n }", "public boolean isValue() {\n return TYPE != TokenType.OPERATOR;\n }", "boolean shouldReadValue();", "public boolean HasOneValueInTheSpace()\n {\n return _valuesToPut.size() == 1;\n }", "boolean hasCustomValue();", "public static boolean isValue(String v) {\n return isNotBlank(v);\n }", "public void test_containsTypedValue_accuracy() {\n instance.addTypedValue(typedValue);\n assertTrue(\"The TypedValue is not added properly.\", instance.containsTypedValue(typedValue));\n }", "private void checkValue(TreeItem parent, String type, String id, Value tmp) {\n \t\tif (tmp instanceof IntegerValue || tmp instanceof BooleanValue) {\n \t\t\tthis.varView.addTreeItem(parent, type, id, tmp.toString());\n \t\t}\n \t\telse if (tmp instanceof ArrayValue) {\n TreeItem item = this.varView.addTreeItem(parent, type, id, \"-\");\n \t\t\tfor (int i = 0; i < ((ArrayValue) tmp).getValues().length; i++) {\n \t\t\t\tString newId = id + \"[\" + i + \"]\";\n \t\t\t\tthis.checkValue(item, ((ArrayValue) tmp).getValues()[i].getType().toString(), \n \t\t\t\t\t\tnewId, ((ArrayValue) tmp).getValues()[i]);\n \t\t\t}\n \t\t}\n \t}", "public boolean hasVal() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "@Override\n\tpublic boolean hasValue(Attribute attribute) {\n\t\treturn false;\n\t}", "public boolean checkValue(Object obj) {\n\treturn (obj instanceof Long) || (obj == null) ;\n }", "boolean containsValue(Object value);", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof AssemblingSchemaItemValue)) {\n return false;\n }\n AssemblingSchemaItemValue other = (AssemblingSchemaItemValue) object;\n if ((this.itemValueId == null && other.itemValueId != null) || (this.itemValueId != null && !this.itemValueId.equals(other.itemValueId))) {\n return false;\n }\n return true;\n }", "public boolean needsValueField() {\n/* 227 */ for (CEnumConstant cec : this.members) {\n/* 228 */ if (!cec.getName().equals(cec.getLexicalValue()))\n/* 229 */ return true; \n/* */ } \n/* 231 */ return false;\n/* */ }", "public boolean isValuePlaced(int value)\n {\n return (getPositionForValue(value)!=null);\n }", "public boolean hasValue() {\n return result.hasValue();\n }", "public boolean hasValue() {\n return result.hasValue();\n }", "public boolean hasVal() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "public boolean hasVal() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasValue() throws SdpParseException {\n\t\tNameValue nameValue = getAttribute();\n\t\tif (nameValue == null)\n\t\t\treturn false;\n\t\telse {\n\t\t\tObject value = nameValue.getValue();\n\t\t\tif (value == null)\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn true;\n\t\t}\n\t}", "public boolean isCValueValid();", "public boolean isEmptyValue() {\r\n if(value == null){\r\n return true;\r\n }\r\n if(value.isEmpty()){\r\n return true;\r\n }\r\n if(value.size() == 1){\r\n if(value.get(0)!=null){\r\n return value.get(0).length() == 0;\r\n }else{\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "boolean allowsValue (final String str, final ValidationContext vc)\n {\n try\n {\n getValue (str, vc);\n return true;\n }\n catch (final DatatypeException e)\n {\n return false;\n }\n }", "boolean containsValue(Object value) throws NullPointerException;", "public boolean hasMoneyValue() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "boolean hasValue(PropertyValue<?, ?> value);", "public boolean hasMoneyValue() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "@Override\r\n\tprotected Object getValue(Object element) {\r\n\t\treturn true;\r\n\t}", "private void checkValue(Tree parent, String type, String id, Value tmp) {\n \t\tif (tmp instanceof IntegerValue || tmp instanceof BooleanValue) {\n \t\t\tthis.varView.addTreeItem(parent, type, id, tmp.toString());\n \t\t}\n \t\telse if (tmp instanceof ArrayValue) {\n \t\t\tTreeItem item = this.varView.addTreeItem(parent, type, id, \"-\");\n \t\t\tfor (int i = 0; i < ((ArrayValue) tmp).getValues().length; i++) {\n \t\t\t\tString newId = id + \"[\" + i + \"]\";\n \t\t\t\tthis.checkValue(item, ((ArrayValue) tmp).getValues()[i].getType().toString(), \n \t\t\t\t\t\tnewId, ((ArrayValue) tmp).getValues()[i]);\n \t\t\t}\n \t\t}\n \t}", "boolean hasVarValue();", "private boolean hasValue (String s) { return s != null && s.length() != 0; }", "protected boolean isValueAllowed(T value)\n\t{\n\t\tif(value == null)\n\t\t\treturn false;\n\t\t\n\t\tif(specifics.isEmpty())\n\t\t\treturn true;\n\t\t\n\t\tfor(Class<? extends Object> clazz : specifics)\n\t\t{\n\t\t\tif(clazz.isInstance(value))\n\t\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean hasMoneyValue() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMoneyValue() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasValueCharacteristicId() {\n return valueCharacteristicIdBuilder_ != null || valueCharacteristicId_ != null;\n }", "public boolean hasValue(String value) {\r\n\t\tfor(Attribute curAttr: valInstances) {\r\n\t\t\tif(value.equals(curAttr.getVal())) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private SettingsContainer valueChecker() {\n String generationCount = jTextFieldGenerationsCount.getText();\n String refreshTime = jTextFieldRefreshTime.getText();\n return checkSettingsFieldsValue(settingsContainer, jLabelCommunicats,\n generationCount, refreshTime);\n }", "<T> boolean shouldWriteValue(T value);", "boolean hasMoneyValue();", "boolean hasMoneyValue();", "protected final void checkValue (String value) throws InvalidArgumentException {\n TreeUtilities.checkAttributeValue (value);\n }", "public boolean hasMPValue() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }" ]
[ "0.65563506", "0.654302", "0.63785005", "0.62994814", "0.6216998", "0.62051463", "0.61656755", "0.6156156", "0.6097453", "0.6092728", "0.60890806", "0.6049937", "0.6049937", "0.6049937", "0.6049937", "0.6049937", "0.6049937", "0.6049937", "0.6049937", "0.6049937", "0.6049937", "0.6049937", "0.6049937", "0.6049937", "0.6049937", "0.60405433", "0.5960975", "0.59501237", "0.5873343", "0.5871782", "0.5853755", "0.5852164", "0.5832867", "0.5832867", "0.5832867", "0.58262086", "0.5812224", "0.5812224", "0.58105105", "0.580961", "0.5802611", "0.58005273", "0.58005273", "0.57775074", "0.5767268", "0.5759883", "0.5759883", "0.5759385", "0.5720541", "0.5717893", "0.56965274", "0.56965274", "0.56714064", "0.56575185", "0.5617184", "0.5608267", "0.560021", "0.5595391", "0.55930775", "0.5591456", "0.55802757", "0.5579939", "0.5560297", "0.5553427", "0.554238", "0.5539867", "0.553854", "0.5526277", "0.5517286", "0.55111736", "0.5504342", "0.54962355", "0.54951113", "0.5489036", "0.5489036", "0.54828304", "0.5474583", "0.54703975", "0.54459375", "0.5440722", "0.54352933", "0.53818303", "0.53674865", "0.53641236", "0.5362571", "0.53615946", "0.5358651", "0.53572786", "0.5356638", "0.53385216", "0.5332599", "0.5328327", "0.53224254", "0.5313293", "0.5299345", "0.5296753", "0.5292607", "0.5292607", "0.529167", "0.52886236" ]
0.55362046
67
Gets value from item (value). 1. Copy sign from b62.
private static long value(long x) { return (x<<1) >> 1; // 1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Money getItemValue();", "Object getValueFrom();", "private byte getValue() {\n\t\treturn value;\n\t}", "public abstract Object getValue(Object itemInstance) throws\n InvocationTargetException, IllegalAccessException;", "public static int getValueForItem(int item) {\n\t\t\tfor (Tiara tiara : values()) {\n\t\t\t\tif (tiara.getItem() == item)\n\t\t\t\t\treturn tiara.getValue();\n\t\t\t}\n\t\t\treturn -1;\n\t\t}", "protected E value(Position<Item<E>> p) {\n return p.getElement().getValue();\n }", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "protected abstract T getValue(ByteBuffer b);", "@Deprecated\n/* */ public byte getValue() {\n/* 58 */ return this.value;\n/* */ }", "public Object getValue() { return _value; }", "public byte getValueAt(int position) {\r\n\r\n\t\tif (position >= values.length) {\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Index must be less than \" + values.length);\r\n\t\t}\r\n\r\n\t\treturn values[position];\r\n\t}", "public String getItemValue() {\n return itemValue;\n }", "abstract public Object getValue(int index);", "public S getValue() { return value; }", "public CompoundValue getValue(Object key);", "public int getValue() {\n/* 450 */ return this.value;\n/* */ }", "public int getValue()\r\n/* 21: */ {\r\n/* 22: 71 */ return this.value;\r\n/* 23: */ }", "@Override\n public byte byteValue() {\n return value;\n }", "ItemStack getItem();", "byte toStringValue() {\n return (byte) String.valueOf(value).charAt(0);\n }", "V getValue();", "V getValue();", "V getValue();", "Integer getValue();", "Integer getValue();", "public ItemStack get(int paramInt)\r\n/* 26: */ {\r\n/* 27: 41 */ return this.a[paramInt];\r\n/* 28: */ }", "public Object getValue(int index);", "@Override\n public V getValue() {\n return m_value;\n }", "public int getKeyBuyItem() {\r\n return getKeyShoot();\r\n }", "public Object getValue() { return this.value; }", "public byte getValue() {\n return value;\n }", "private int get(int pos) {\n if (pos != 0) {\n return this.nextNode.get(pos - 1);\n } else {\n return this.value;\n }\n }", "@Override\n \tpublic IValue getValue() {\n \t\treturn this;\n \t}", "@Override\n\t\tpublic V getValue(){\n\t\t\treturn value;\n\t\t}", "public Object getValue();", "public Object getValue();", "public Object getValue();", "public Object getValue();", "public Object getValue();", "public RTWValue getAsValue(int i);", "public Integer getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "public int getValue();", "public int getValue();", "int getValue();", "int getValue();", "int getValue();", "int getValue();", "int getValue();", "public abstract Value getValue();", "public String getValue() {\n/* 99 */ return this.value;\n/* */ }", "public /*byte[]*/String BinaryCaster(Object item){\n String Sitem = Integer.toBinaryString((int)item);\n //byte[] b = new byte[Sitem.length()];\n //for(int i=0;i<Sitem.length();i++){\n // b[i] = (byte)Sitem.charAt(i);\n //}\n //return b;\n return Sitem;\n }", "public Object getValue(){\n \treturn this.value;\n }", "public long UnSigndCatster(Object item){\n long x = Integer.toUnsignedLong((int)item);\n //String s = item.toString();\n //long x = Integer.parseUnsignedInt(s);\n return x;\n }", "public int getValue()\n\t{\n\t\treturn bitHolder.getValue();\n\t}", "public Object getValue()\n {\n\treturn value;\n }", "public int getValue ()\r\n\t{\r\n\t\treturn (m_value);\r\n\t}", "@Override\r\n public Object getValue() {\r\n return value;\r\n }", "public int getValue() \n {\n return value;\n }", "public int getValue(){\n return this.value;\n }", "public final int getUByte(int index) { return bb.get(index) & 0xff; }", "public abstract Object getValue();", "public abstract Object getValue();", "public abstract Object getValue();", "@Override\r\n\t\tpublic V getValue() {\n\t\t\treturn pair.getSecond();\r\n\t\t}", "V getValue() {\n return value;\n }", "@Override\n public Object getValue()\n {\n return value;\n }", "@Override\n\tpublic Integer getValue() {\n\t\treturn value;\n\t}", "@Override\n\tpublic Integer getValue() {\n\t\treturn value;\n\t}", "public int getITEM() {\r\n return item;\r\n }", "protected Object doGetValue() {\n\t\treturn value;\n\t}", "protected abstract V getValue(E entry);", "public int getValue() \n {\n return value;\n }", "@Override\n\t\tpublic V getValue() {\n\t\t\treturn v;\n\t\t}", "public int getKeySellItem() {\r\n return getKeyShoot();\r\n }", "@Override\n public T getValue() {\n return entry.getValue().getValue();\n }", "public int getValue()\r\n {\r\n return value;\r\n }", "public int value() { \n return this.value; \n }", "public String getValue() {\r\n\t\tAllowedKey tp = this.getAllowedKey();\r\n\t\tKeyMask km = this.getKeyMask();\r\n\r\n\t\tif (tp == TextFieldExt.AllowedKey.AK_SOLO_NUMEROS) {\r\n\t\t\tif (km == TextFieldExt.KeyMask.KM_Moneda)\r\n\t\t\t\treturn StringTools.parseFromQuantityToNumber(this.getText().trim());\r\n\t\t\telse {\r\n\t\t\t\tif (km == TextFieldExt.KeyMask.KM_Numero)\r\n\t\t\t\t\treturn StringTools.parseFromQuantityToNumber(this.getText().trim());\r\n\t\t\t\telse\r\n\t\t\t\t\treturn this.getText().trim();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (tp == TextFieldExt.AllowedKey.AK_NUMEROS_CON_FRACCION) {\r\n\t\t\t\tif (km == TextFieldExt.KeyMask.KM_Moneda)\r\n\t\t\t\t\treturn StringTools.parseFromQuantityToNumber(this.getText().trim());\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (km == TextFieldExt.KeyMask.KM_Numero)\r\n\t\t\t\t\t\treturn StringTools.parseFromQuantityToNumber(this.getText().trim());\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn this.getText().trim();\r\n\t\t\t\t}\r\n\t\t\t} else\r\n\t\t\t\treturn this.getText().trim();\r\n\t\t}\r\n\t}", "public Object getValue()\r\n {\r\n return this.value;\r\n }", "public V getValue();", "public Object getValue()\r\n\t{\r\n\t\treturn m_value;\r\n\t}", "public final Object getValue()\n {\n return m_Value;\n }", "public byte value() {\n return value;\n }", "public int get(int symbol);", "public int getValue()\n {\n return value;\n }" ]
[ "0.6704587", "0.6064473", "0.59751713", "0.5930428", "0.5915849", "0.5877905", "0.5853176", "0.5853176", "0.5853176", "0.5853176", "0.5853176", "0.5853176", "0.5853176", "0.5773989", "0.5706361", "0.57002443", "0.56915605", "0.56902593", "0.5676652", "0.5672412", "0.56678694", "0.5665182", "0.5658683", "0.5657158", "0.56496996", "0.56424314", "0.5627218", "0.5627218", "0.5627218", "0.5625932", "0.5625932", "0.56165534", "0.5607939", "0.5605451", "0.56015116", "0.55928254", "0.55867314", "0.5582799", "0.55810964", "0.55801123", "0.55789936", "0.55789936", "0.55789936", "0.55789936", "0.55789936", "0.55756485", "0.5571832", "0.55664164", "0.55664164", "0.55664164", "0.55664164", "0.55664164", "0.55664164", "0.55664164", "0.55664164", "0.55664164", "0.55664164", "0.5566334", "0.5566334", "0.5555329", "0.5555329", "0.5555329", "0.5555329", "0.5555329", "0.55381596", "0.5536337", "0.55358356", "0.55273426", "0.55247355", "0.55232775", "0.55138415", "0.5512946", "0.54992723", "0.5494685", "0.54923", "0.54915315", "0.54868656", "0.54868656", "0.54868656", "0.54779166", "0.54738754", "0.5472962", "0.5464926", "0.5464926", "0.5464016", "0.54626757", "0.5460904", "0.5449982", "0.5449963", "0.544967", "0.54471284", "0.54457736", "0.5440432", "0.5439177", "0.54355454", "0.54354405", "0.5429659", "0.5425224", "0.5415985", "0.5413807", "0.5412988" ]
0.0
-1
TAG Creates a new tag. 1. Set b63. 2. Set threadid from b62b48. 3. Set tagid from b47b0.
private static long newTag(long id) { long th = Thread.currentThread().getId(); return (1L<<63) | (th<<48) | id; // 1, 2, 3 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Tag createTag();", "public Tag(String tag) {\n\t\tthis.tag = tag;\n\t}", "public JdwpId (byte tag)\r\n {\r\n _tag = tag;\r\n }", "@Override\n public void setTag(int t) {\n this.tag = t;\n\n }", "public void setTag(int tag) {\n this.tag = tag;\n }", "private void incTag() {\n long id = tagId(tag[th()]); // 1\n tag[th()] = newTag(id+1); // 2\n }", "public void setTid(int tid);", "void setTag(java.lang.String tag);", "public void setMyTag(int theTag)\n\t{\n\t\tmyTag = theTag;\n\t}", "public void setTag(String tag);", "public Tag(String str) {\n\t}", "public TagRecord(Long id, String uuid, String libelle, Long version, Timestamp dateCreation, String userCreation, Timestamp dateModification, String userModification) {\n super(Tag.TAG);\n\n set(0, id);\n set(1, uuid);\n set(2, libelle);\n set(3, version);\n set(4, dateCreation);\n set(5, userCreation);\n set(6, dateModification);\n set(7, userModification);\n }", "public void setTag(String tag) {\r\n this.tag = tag;\r\n }", "public void setTag( String tag )\n {\n this.tag = tag;\n }", "public void setTag(Object tag)\n {\n fTag = tag;\n }", "public void setTagid(Long tagid) {\n this.tagid = tagid;\n }", "public void setToTag(String tag) throws ParseException,NullPointerException;", "public ETag create(String tag, boolean isWeak);", "public void setTag(String tag) {\n this.tag = tag;\n }", "public void setTag(String tag) {\n this.tag = tag;\n }", "public ETag create(String tag, boolean isWeak, boolean isWildcard);", "public void addTag(Tag t);", "public long createTag(Tag tag) {\n SQLiteDatabase db = this.getWritableDatabase();\n \n ContentValues values = new ContentValues();\n values.put(KEY_TAG_NAME, tag.getOblast());\n values.put(KEY_CREATED_AT, getDateTime());\n \n // insert row\n long tag_id = db.insert(TABLE_TAG, null, values);\n \n return tag_id;\n }", "protected GeneTAG() {/* intentionally empty block */}", "public Builder setTidBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n tid_ = value;\n onChanged();\n return this;\n }", "public TagRecord() {\n super(Tag.TAG);\n }", "public void setTagId(Long tagId) {\r\n this.tagId = tagId;\r\n }", "public void addTag(String t) {\n\t\tif (!tagList.containsKey(t)) {\n\t\t\ttagList.put(t, 0);\n\t\t} else {\n\t\t\tSystem.out.print(\"Tag already exists!\");\n\t\t}\n\t}", "protected void initTag()\n {\n }", "public Tag() {\n\t}", "public Tag() {\n\t}", "public ETag create(String tag);", "public Builder setTag(\n int index, org.multibit.hd.core.protobuf.MBHDContactsProtos.Tag value) {\n if (tagBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureTagIsMutable();\n tag_.set(index, value);\n onChanged();\n } else {\n tagBuilder_.setMessage(index, value);\n }\n return this;\n }", "public NBT_Tag(String name) {\nthis.id = 0; //overwritten\nthis.name = name;\n}", "public void setTid(Integer tid) {\r\n this.tid = tid;\r\n }", "public Builder setTraceTag(long value) {\n bitField0_ |= 0x00004000;\n traceTag_ = value;\n onChanged();\n return this;\n }", "public int tag () { return MyTag; }", "public Builder setTag(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n tag_ = value;\n onChanged();\n return this;\n }", "public GeneTAG(int addr, TOP_Type type) {\n super(addr, type);\n readObject();\n }", "public Builder setTagBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n tag_ = value;\n onChanged();\n return this;\n }", "public Tag(String name) {\n this.name = name;\n }", "Tag(String name){\r\n this.tagName = name;\r\n }", "public void setTagId(Integer tagId) {\n this.tagId = tagId;\n }", "public void setTagId(Integer tagId) {\n this.tagId = tagId;\n }", "public void addTag(String tag) {\n this.tag = tag;\n }", "public Tag(String name) {\n tagName = name;\n }", "public HashTag() {}", "protected void tag (int ltagStart) throws HTMLParseException {\r\n Tag tag = new Tag ();\r\n Token token = new Token (tag, false);\r\n switch (nextToken) {\r\n case STRING:\r\n tag.setType (stringValue);\r\n match (STRING);\r\n arglist (tag);\r\n if (tagmode) {\r\n block.setRest (lastTagStart);\r\n } else {\r\n token.setStartIndex (ltagStart);\r\n //block.addToken (token);\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(token);\r\n }\r\n break;\r\n case MT:\r\n tagmode = false;\r\n match (MT);\r\n break;\r\n case END:\r\n block.setRest (lastTagStart);\r\n tagmode = false;\r\n return;\r\n default:\r\n arglist (tag);\r\n }\r\n }", "T newTagEntity(String tag);", "public Gateway setTid(java.lang.String tid) {\n return genClient.setOther(tid, CacheKey.tid);\n }", "void addTag(String name, String value);", "public Builder addTag(org.multibit.hd.core.protobuf.MBHDContactsProtos.Tag value) {\n if (tagBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureTagIsMutable();\n tag_.add(value);\n onChanged();\n } else {\n tagBuilder_.addMessage(value);\n }\n return this;\n }", "public void setTag(Tag tag) {\n\t\tProgramTags newTag = program.getTagIfPresent(tag); // throws if no such tag in program\n\t\tsetTag(newTag);\n\t}", "private void makeTag(String query, String tag) {\n\t\t\n\t\tString Originalquery = savedSearches.getString(tag, null);\n\t\t\n\t\t// Getting Sharedprefernces.editor to store new tag/query pair\n\t\tSharedPreferences.Editor preferncesEditor = savedSearches.edit();\n\t\tpreferncesEditor.putString(tag, query);\n\t\tpreferncesEditor.apply(); // Stores the updated prefernces\n\t\t\n\t\tif (Originalquery==null) {\n\t\t\trefreshButtons(tag); // Adds new button for this tag\n\t\t}\n\t\t\n\t\t\n\t}", "public void setTag(ProgramTags tag) {\n\t\tthis.tag = program.getTagIfPresent(tag.getTag());\n\t}", "public static void setTag(String string) {\n\t\ttags.put(last[0], string);\n\t}", "public NBTTagCompound writeToNBT(NBTTagCompound tag)\r\n/* 158: */ {\r\n/* 159:159 */ tag.setByte(\"Id\", (byte)getID());\r\n/* 160:160 */ tag.setByte(\"Amplifier\", (byte)getAmplifier());\r\n/* 161:161 */ tag.setInt(\"Duration\", getDuration());\r\n/* 162:162 */ tag.setBoolean(\"Ambient\", getAmbient());\r\n/* 163:163 */ tag.setBoolean(\"ShowParticles\", getShowParticles());\r\n/* 164:164 */ return tag;\r\n/* 165: */ }", "public void setTagId(String tagId) {\n this.tagId = tagId;\n }", "public Builder setTid(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n tid_ = value;\n onChanged();\n return this;\n }", "void tag1() { }", "public Tag(String name) {\n\t\tthis.name = name;\n\t}", "public Tag(int tagId, String tagName, String tagDescription) {\n this.tagId = tagId;\n this.tagName = tagName;\n this.tagDescription = tagDescription;\n }", "void addTag(String tag){tags.add(tag);}", "public IMTag createOpeningMTag (String id,\r\n\t\tString type);", "@Override\n\tpublic void saveTag(Tag newTag) throws Exception {\n\n\t}", "public void addTag(String tag) {\n\n\t\t//\n\t\t// check if it already exists\n\t\t//\n\t\tif (getTagId(tag) != -1)\n\t\t\treturn;\n\n\t\t//\n\t\t// construct new content values\n\t\t//\n\t\tContentValues values = new ContentValues();\n\n\t\t//\n\t\t// put file path into it\n\t\t//\n\t\tvalues.put(TAG_FIELD_NAME, tag);\n\n\t\t//\n\t\t// construct date format\n\t\t//\n\t\tSimpleDateFormat date_format = new SimpleDateFormat(\n\t\t\t\t\"yyyy-MM-dd HH:mm:ss\");\n\n\t\t//\n\t\t// format date\n\t\t//\n\t\tString date = date_format.format(new Date());\n\n\t\t//\n\t\t// insert date\n\t\t//\n\t\tvalues.put(TAG_FIELD_CREATE_DATE, date);\n\n\t\t//\n\t\t// set reference count to one\n\t\t//\n\t\tvalues.put(TAG_FIELD_USAGE, new Integer(1));\n\n\t\t//\n\t\t// now execute the insert\n\t\t//\n\t\tlong rows_affected = m_db.insert(TAG_TABLE_NAME, null, values);\n\n\t\t//\n\t\t// informal debug message\n\t\t//\n\t\tLogger.i(\"DBManager::addTag> Date: \" + date + \" rows_affected: \"\n\t\t\t\t+ rows_affected);\n\t}", "private void setHasTag(int value) {\n \n hasTag_ = value;\n }", "public String getTAG() {\r\n return TAG;\r\n }", "boolean onTag(ByteBuffer buffer, int tagIndex, int tagLen, int valueLen);", "public TagAttributeHandlerBuilder tag(String tag) {\n this.tag = tag;\n return this;\n }", "private void saveTag(Tag tag){\n Long num = tagMap.get(tag);\n tagMap.put(tag, (num == null) ? (long)1 : num+1);\n }", "public Long getTagid() {\n return tagid;\n }", "public void xsetIdTag(ocpp.IdToken idTag)\n {\n synchronized (monitor())\n {\n check_orphaned();\n ocpp.IdToken target = null;\n target = (ocpp.IdToken)get_store().find_element_user(IDTAG$0, 0);\n if (target == null)\n {\n target = (ocpp.IdToken)get_store().add_element_user(IDTAG$0);\n }\n target.set(idTag);\n }\n }", "public Tag(UUID id, String name, UUID tagTypeId, boolean deleted, long touchedAt) {\r\n\t\tthis.id = id;\r\n\t\tthis.tagTypeId = tagTypeId;\r\n\t\tthis.name = name;\r\n\t\tthis.deleted = deleted;\r\n\t\tthis.touchedAt = touchedAt;\r\n\t}", "public void setFromTag(String tag) throws ParseException,NullPointerException;", "private static long tagId(long x) {\n return x & 0xFFFFFFFFFFFFL; // 1\n }", "public void setTag(String tagName, Object value);", "public void addNew() {\n\t\t\n\t\tTag t = new Tag();\n\t\tt.setName(name);\n\t\tt.setColor(color);\n\t\t\n\t\tDAO.getInstance().addTag(t);\n\t\t\n\t\tname = null;\n\t\tcolor = null;\n\t\t\n\t}", "public Long getTagId() {\r\n return tagId;\r\n }", "public Tag(String key, String value) {\n setKey(key);\n setValue(value);\n }", "static void openTag(String name) { openTag(name,true); }", "public void setTAG(String TAG) {\r\n this.TAG = TAG == null ? null : TAG.trim();\r\n }", "public String getTag() {\n return tagNum;\n }", "public Tags (String tags) {\n set (tags);\n }", "@Override\n\tpublic int create(Tags tag) {\n\t\tentityMgr.persist(tag);\n\t\treturn 0;\n\t}", "public static void setTag(Tag tag, String newValue){\n makeInstance();\n //set the new tag value\n settingsFile.setTag(tag, newValue);\n //notify all of the listeners of the modified tag that its value changed\n notifyListenersOfTag(tag);\n }", "public int getTag() {\n return tag;\n }", "public String getTagId() {\n return tagId;\n }", "public Taginstance() {\n\t\tthis(\"taginstance\", null);\n\t}", "public void tagCreated(TagEvent event) {\n createdEvent = event;\n }", "public java.lang.String getTag() {\n java.lang.Object ref = tag_;\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 tag_ = s;\n return s;\n }\n }", "java.lang.String getTid();", "java.lang.String getTid();", "public TopicLabelLayout(Context context, AttributeSet attributeSet, int i) {\n super(context, attributeSet, i);\n C32569u.m150519b(context, C6969H.m41409d(\"G6A8CDB0EBA28BF\"));\n C32569u.m150519b(attributeSet, C6969H.m41409d(\"G6897C108AC\"));\n }", "protected void tag(ResourceMapping mapping, CVSTag tag) throws CoreException {\n tag(new ResourceMapping[] { mapping }, tag, false);\n assertTagged(mapping, tag);\n }", "public void setTagId(String tagId) {\n this.tagId = tagId == null ? null : tagId.trim();\n }", "void create(MetaTag metaTag);", "@POST\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"/{id}/tag/\")\n @javax.transaction.Transactional\n public void assignTag(@PathParam(\"id\") final long id, final int tagId) {\n service.assignTag(id, tagId);\n }", "@POST\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n @RolesAllowed({\"admin\"})\n public Tag create(Tag tag, @Context UriInfo uriInfo) {\n Long taskId = (uriInfo.getPathSegments().size() != 1?\n Long.valueOf(uriInfo.getPathSegments().get(3).getPath())\n :null);\n\n if (taskId != null) {\n Task task = em.find(Task.class, taskId);\n\n if (task == null) {\n throw new InvalidParentException(String.format(\"Task with ID %s not found for this tag!\", taskId));\n }\n\n task.getTags().add(tag);\n }\n\n em.persist(tag);\n\n return tag;\n }", "public void setToTag(String tag) {\n try{\n toHeader.setTag(tag);\n }\n catch(ParseException e) {}\n }" ]
[ "0.65284795", "0.63976854", "0.6372836", "0.62924385", "0.61944634", "0.6114447", "0.6089878", "0.60440415", "0.6040033", "0.60079265", "0.6000383", "0.5955651", "0.5932044", "0.5931685", "0.59286344", "0.59278715", "0.58983713", "0.5866299", "0.58457726", "0.58457726", "0.5829211", "0.58219755", "0.5773355", "0.5771703", "0.57682586", "0.5752114", "0.57326746", "0.57200146", "0.57038367", "0.5688725", "0.5688725", "0.56506276", "0.563301", "0.56320244", "0.5629423", "0.5620605", "0.5615101", "0.5591289", "0.55764973", "0.55524915", "0.5547377", "0.5544282", "0.55383015", "0.55383015", "0.5513567", "0.55089074", "0.5499025", "0.5489582", "0.54847115", "0.5468397", "0.5468307", "0.54576755", "0.5449755", "0.544269", "0.54387087", "0.542739", "0.5421035", "0.54089373", "0.54046845", "0.5401813", "0.5381725", "0.5371338", "0.53664184", "0.5365342", "0.5317311", "0.53162014", "0.53142035", "0.5312894", "0.5286842", "0.5285229", "0.5283345", "0.52717566", "0.52696055", "0.5256946", "0.52542377", "0.52452356", "0.5243941", "0.5234093", "0.5224935", "0.5222072", "0.5220638", "0.5216487", "0.5215725", "0.5214524", "0.5208113", "0.5203652", "0.520123", "0.51987576", "0.51950175", "0.519378", "0.5186107", "0.5185673", "0.5185673", "0.5175563", "0.51706403", "0.51593566", "0.51566803", "0.5145635", "0.5143391", "0.51414114" ]
0.6769056
0
Checks if item is a tag. 1. Check if b63 is set.
private static boolean isTag(long x) { return x < 0L; // 1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isTag(String item) {\n return storiesToTags.keySet().contains(item);\n }", "private void assertStreamItemViewHasTag(StreamItemEntry streamItem) {\n Object tag = mView.getTag();\n assertNotNull(\"should have a tag\", tag);\n assertTrue(\"should be a StreamItemEntry\", tag instanceof StreamItemEntry);\n StreamItemEntry streamItemTag = (StreamItemEntry) tag;\n // The streamItem itself should be in the tag.\n assertSame(streamItem, streamItemTag);\n }", "boolean hasTigTag();", "public static boolean isTag(int symbol) {\n return symbol < 0;\n }", "public int getHasTag() {\n return hasTag_;\n }", "boolean isSetTag();", "public boolean isItemValid(ItemStack itemstack)\n {\n return itemstack.getItem() == Items.water_bucket;\n }", "private void setHasTag(int value) {\n \n hasTag_ = value;\n }", "@Override\n public boolean isTagged() {\n for (List<String> t : tags.values()) {\n if(!t.isEmpty()) return true;\n }\n return false;\n }", "public boolean isSetTag() {\n return this.tag != null;\n }", "public boolean hasTags() {\n return fieldSetFlags()[4];\n }", "boolean hasTag(Tag tag);", "private Boolean isTag(String tagID) {\n\t\t\n\t\tif (tagManager.resolve(tagID) != null) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tlog.warn(DEBUG_PREFIX + \"Tag ID passed in tags argument is invalid: \" + tagID);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "public boolean checkTag(String tagToCheck){\r\n \t\treturn tags.containsKey(tagToCheck);\r\n \t}", "boolean hasTagValue();", "boolean hasTags();", "public int getHasTag() {\n return instance.getHasTag();\n }", "private static boolean hasTag(String value) {\n return value.contains(\"<\") || value.contains(\">\");\n }", "public boolean hasBonusItemDrop() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "public boolean hasBonusItemDrop() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "public boolean isBreedingItem(ItemStack stack) {\n return TEMPTATION_ITEMS.test(stack);\n }", "boolean hasBonusItemDrop();", "public boolean isItemValid(ItemStack var1)\n {\n return canHoldPotion(var1);\n }", "public static boolean ItemType(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"ItemType\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, ITEM_TYPE, \"<item type>\");\n r = KindTest(b, l + 1);\n if (!r) r = GeneralItemType(b, l + 1);\n if (!r) r = FunctionTest(b, l + 1);\n if (!r) r = MapTest(b, l + 1);\n if (!r) r = ArrayTest(b, l + 1);\n if (!r) r = AtomicOrUnionType(b, l + 1);\n if (!r) r = ParenthesizedItemType(b, l + 1);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "@Override\n\tpublic boolean isBreedingItem(ItemStack item) {\n\t\treturn getBreed().getBreedingItem() == item.getItem();\n\t}", "public boolean usesItem(Item item){\n for (char c : item.getName().toCharArray()){\n if(!content.contains( String.valueOf(c) )){\n return false;\n }else {\n// count++;\n }\n }\n\n// System.out.println(item + \" est utilisé \" + count + \" fois\");\n\n return true;\n\n\n// return content.contains(item);\n }", "@Override\n public boolean removeItem(Object itemId)\n {\n try\n {\n TLogger.debug(\"Entry in TagTable - removeItem\");\n if(itemId instanceof Tag)\n {\n Tag one = (Tag)itemId;\n Collection allItems = this.getItemIds();\n for(Object existingItem : allItems)\n {\n Tag two = (Tag)existingItem;\n if(one.getTagId().equals(two.getTagId()))\n {\n return super.removeItem(two);\n }\n }\n }\n }\n catch(Exception exception)\n {\n TLogger.error(\"Exception in TagTable - removeItem\",exception);\n }\n finally\n {\n TLogger.debug(\"Exit in TagTable - removeItem\");\n }\n return super.removeItem(itemId);\n }", "@Override\n\tpublic boolean isTagged() {\n\t\treturn tagged;\n\t}", "public boolean isBreedingItem(ItemStack par1ItemStack)\n {\n return par1ItemStack.getItem() == Items.porkchop;\n }", "static boolean tagExists(CompoundTag tag, String key) {\n return tag.getValue().get(key) != null;\n }", "public boolean isItemValid(ItemStack par1ItemStack)\n {\n return true;\n }", "private boolean isIgnoredByTag(ExtensionContext context) {\n AnnotatedElement element = context.getElement().get();\n return isIgnoredByTag(element);\n }", "@Override\n\tpublic boolean isItemValid(ItemStack stack) {\n\t\treturn true;\n\t}", "public boolean hasTags() {\n return isTagged();\n }", "public boolean selectItem(INode node)\r\n\t{\r\n\t\tif ((node == null) || !(node instanceof PkgItem))\r\n\t\t\treturn false;\r\n\t\tPkgItem packageItem = (PkgItem)node;\r\n\t\tPackageType packageType = packageItem.getMetaPackage().getPackageType();\r\n\t\tif (packageTypeSet.contains(packageType)) {\r\n\t\t\tif ((packageType == PackageType.system_images) && (tag != null) && !tag.isEmpty()) {\r\n\t\t\t\tTypeDetails typeDetails = packageItem.getMainPackage().getTypeDetails();\r\n\t\t\t\tif (typeDetails instanceof SysImgDetailsType) {\r\n\t\t\t\t\tSysImgDetailsType sysImageType = (SysImgDetailsType)typeDetails;\r\n\t\t\t\t\t\treturn tag.equals(sysImageType.getTag().getId());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (selectGeneric) {\r\n\t\t\tfor (int i = 0; i < GENERIC_PACKAGE_TYPES.length; ++i)\r\n\t\t\t\tif (GENERIC_PACKAGE_TYPES[i] == packageType)\r\n\t\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean isDiggable() {\n return buriedItems != null;\n }", "boolean isNilTag();", "public static boolean isTagBlocked(Tag tag) {\n if (sIsTagBlockedForTesting != null) {\n return sIsTagBlockedForTesting;\n }\n\n if (tag == null) return false;\n\n IsoDep iso = IsoDep.get(tag);\n if (iso != null) {\n byte[] historicalBytes = iso.getHistoricalBytes();\n if (Arrays.equals(historicalBytes, YUBIKEY_5_SERIES_HISTORICAL_BYTES)\n || Arrays.equals(historicalBytes, YUBIKEY_NEO_HISTORICAL_BYTES)) {\n Log.w(TAG, \"YubiKey detected. Access is blocked.\");\n return true;\n }\n }\n\n return false;\n }", "@DISPID(73)\r\n\t// = 0x49. The runtime will prefer the VTID if present\r\n\t@VTID(78)\r\n\tasci.activebatch.ITags tags();", "protected boolean isItemSupported(String topic, String item, int uFmt)\n {\n return isTopicSupported(topic);\n }", "public boolean hasItem() {\n return null != item;\n }", "private void assertStreamItemViewHasNoTag() {\n Object tag = mView.getTag();\n assertNull(\"should not have a tag\", tag);\n }", "public boolean needsEqualNBTTag (Material material) {\r\n\t\tswitch (material) {\r\n\t\t\tcase WRITTEN_BOOK:\r\n\t\t\t\treturn false;\r\n\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t}", "@Override\n\tpublic boolean canHaveAsContent(Item item) {\n\t\treturn false;\n\t}", "private boolean checkTag(String tag) {\n if (tag.length() < 1) {\n return false;\n }\n char c = tag.charAt(0);\n if (!(c >= 'a' && c <= 'z')) {\n return false;\n }\n for (int i = 1; i < tag.length(); ++i) {\n c = tag.charAt(i);\n if (!(c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c == '-')) {\n return false;\n }\n }\n return true;\n }", "public boolean isSetTags() {\n return this.Tags != null;\n }", "public boolean hasItem() {\n return this.item != null;\n }", "public boolean isItem(int itemId) {\n return getKey().equals(itemId);\n }", "default boolean putTagIfRegexFound(TaggedItemsArray tiarray) {\n Iterator<String> itr = tiarray.getIterator();\n boolean anyRegexFound = false;\n\n while (itr.hasNext()) {\n String item = itr.next();\n\n if (match(item)) {\n tiarray.modify(item, getTag());\n anyRegexFound = true;\n }\n }\n\n return anyRegexFound;\n }", "public boolean alreadyAnnotated(String indeces, String tag, String word) {\n if (taggedItems.containsKey(indeces)) {\n if (!tag.equals(taggedItems.get(indeces)))\n System.out.println(\"Conflict : \" + word + \" Old tag: \" + taggedItems.get(indeces) + \" New tag: \" + tag);\n return true;\n } else\n return false;\n }", "boolean onTag(ByteBuffer buffer, int tagIndex, int tagLen, int valueLen);", "boolean hasItemId();", "boolean hasItemId();", "boolean hasItemId();", "boolean hasItemId();", "boolean hasItemId();", "boolean hasItemId();", "boolean hasItemId();", "public void checkItem() {\n Entity t = BombermanGame.checkCollisionItem(this.rectangle);\n if (t instanceof SpeedItem) {\n speed ++;\n ((SpeedItem) t).afterCollision();\n SoundEffect.sound(SoundEffect.mediaPlayerEatItem);\n }\n\n if (t instanceof FlameItem) {\n flame = true;\n ((FlameItem) t).afterCollision();\n SoundEffect.sound(SoundEffect.mediaPlayerEatItem);\n }\n\n if (t instanceof BombItem) {\n max_bomb ++;\n ((BombItem) t).afterCollision();\n SoundEffect.sound(SoundEffect.mediaPlayerEatItem);\n }\n\n if (t instanceof Portal) {\n SoundEffect.sound(SoundEffect.mediaPlayerEatItem);\n }\n }", "@java.lang.Override\n public boolean hasInventoryItemData() {\n return inventoryItemCase_ == 3;\n }", "protected boolean isTargetTag(String tag) {\n\t\treturn this.nlpTagSet.contains(tag);\n\t}", "@Override\n\tpublic boolean isItemValidForSlot(int i, ItemStack itemstack) {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean itemExists() {\n\t\treturn false;\n\t}", "public boolean saveNBTToDroppedItem() {\n return true;\n }", "public boolean isTagPresent(int tag) {\n return fieldIndex.containsKey(tag);\n }", "public boolean hasB23() {\n return ((bitField0_ & 0x00400000) == 0x00400000);\n }", "public boolean hasTagValue() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean isItemValid(ItemStack par1ItemStack)\n/* 23: */ {\n/* 24:20 */ if (isItemTwoHanded(par1ItemStack)) {\n/* 25:21 */ return false;\n/* 26: */ }\n/* 27:23 */ if ((this.rightHand.getHasStack()) && \n/* 28:24 */ (isItemTwoHanded(this.rightHand.getStack()))) {\n/* 29:25 */ return false;\n/* 30: */ }\n/* 31:27 */ return super.isItemValid(par1ItemStack);\n/* 32: */ }", "public boolean hasTagValue() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasGrabbedItem(String item) {\n return grabbedItems.contains(item);\n }", "boolean isValidForBasket(Collection<Item> items);", "@java.lang.Override\n public boolean hasInventoryItemData() {\n return inventoryItemCase_ == 3;\n }", "public boolean hasB23() {\n return ((bitField0_ & 0x00400000) == 0x00400000);\n }", "boolean isItemDisabled( final Object item );", "public void setMyTag(int theTag)\n\t{\n\t\tmyTag = theTag;\n\t}", "public boolean checkItem () {\r\n\t\tfor (Entity e : getLocation().getWorld().getEntities())\r\n\t\t{\r\n\t\t\tdouble x = e.getLocation().getX();\r\n\t\t\tdouble z = e.getLocation().getZ();\r\n\t\t\tdouble yDiff = getSpawnLocation().getY() - e.getLocation().getY();\r\n \r\n\t\t\tif (yDiff < 0)\r\n\t\t\t\tyDiff *= -1;\r\n\r\n\t\t\tif (x == getSpawnLocation().getX() && yDiff <= 1.5 && z == getSpawnLocation().getZ()) {\r\n \r\n ShowCaseStandalone.slog(Level.FINEST, \"Potential hit on checkItem()\");\r\n\t\t\t\ttry {\r\n\t\t\t\t\tItem itemE = (Item)e;\r\n\t\t\t\t\tif (ItemStackHandler.itemsEqual(itemE.getItemStack(), getItemStack(), true)) {\r\n ShowCaseStandalone.slog(Level.FINEST, \"Existing stack: \" + itemE.getItemStack().toString());\r\n itemE.getItemStack().setAmount(1); //Removes duped items, which can occur.\r\n\t\t\t\t\t\tthis.item = itemE;\r\n\t\t\t\t\t\tscs.log(Level.FINER, \"Attaching to existing item.\");\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception ex) {}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean itemIsAllowed(int itemId) {\n\t\tswitch (itemId) {\n\t\tcase 15272: // Rocktail\n\t\tcase 7060: // Tuna potato\n\t\tcase 6685:\n\t\tcase 6687:\n\t\tcase 6689:\n\t\tcase 6691: // Saradomin brew\n\t\tcase 3024:\n\t\tcase 3026:\n\t\tcase 3028:\n\t\tcase 3030: // Super restore\n\t\tcase 391: // Manta Ray\n\t\tcase 385: // Shark\n\t\tcase 229: // Vial\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean matchesTag(int tag) {\n if (super.matchesTag(tag)) {\n return true;\n }\n if (this.mLayout != null) {\n Spanned text = (Spanned) this.mLayout.getText();\n for (RCTRawText span : (RCTRawText[]) text.getSpans(0, text.length(), RCTRawText.class)) {\n if (span.getReactTag() == tag) {\n return true;\n }\n }\n }\n return false;\n }", "java.lang.String getTag();", "java.lang.String getTag();", "public boolean hasItemImageUrl() {\n return fieldSetFlags()[8];\n }", "public boolean hasItemStorage() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }", "public static ItemStack readItem(CompoundTag tag) {\n BlockDataManager blockDataManager = ((GlowServer) Bukkit.getServer()).getBlockDataManager();\n final Material[] material = {null};\n if ((!tag.readString(\"id\", id -> material[0] = ItemIds.getItem(id))\n && !tag.readShort(\"id\",\n id -> material[0] = blockDataManager.convertToBlockData(id).getMaterial()))\n || material[0] == null || material[0] == Material.AIR) {\n return null;\n }\n final byte[] count = {0};\n tag.readByte(\"Count\", x -> count[0] = x);\n if (count[0] == 0) {\n return null;\n }\n final short[] damage = {0};\n tag.readShort(\"Damage\", x -> damage[0] = x);\n ItemStack stack = new ItemStack(material[0], count[0], damage[0]);\n // This is slightly different than what tag.readItem would do, since we specify the\n // material separately.\n tag.readCompound(\"tag\",\n subtag -> stack.setItemMeta(GlowItemFactory.instance().readNbt(material[0], subtag)));\n return stack;\n }", "public boolean setTag(int tag)\n {\n if (tag < 0) {\n return false;\n }\n\n tag_ = tag;\n return true;\n }", "public boolean hasItemStorage() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }", "private void clearHasTag() {\n \n hasTag_ = 0;\n }", "public boolean containsTag(String tagName);", "public boolean isValidItem() {\n return validItem;\n }", "public boolean checkRecipe_EM(ItemStack itemStack) {\n return false;\n }", "boolean useItem(Command command) {\n HashMap newInventory = inventory.getInventory();\n Iterator iterator = newInventory.entrySet().iterator();\n String seeItem;\n String nameOfItem = \"\";\n String useItem = \"debug\";\n\n while (iterator.hasNext()) {\n HashMap.Entry liste = (HashMap.Entry) iterator.next();\n String itemName = (String) liste.getKey();\n if (itemName.equalsIgnoreCase(command.getSecondWord())) {\n useItem = itemName;\n nameOfItem = itemName;\n break;\n }\n }\n if (!nameOfItem.equals(\"\") && inventory.getUseable(nameOfItem)) {\n\n System.out.println(\"You have dropped: \" + nameOfItem);\n inventory.removeItemInventory(nameOfItem);\n player.setEnergy(player.getEnergy() + 20);\n player.setHealth(player.getHealth() + 5);\n\n return true;\n }\n return false;\n }", "public void setItTag(String itTag) {\n this.itTag = itTag == null ? null : itTag.trim();\n }", "public void checkForTag(int i) {\n if (wordsOfInput[i].indexOf('#') == 0) {\n if ((!containsStartDate || !containsStartTime) && index > i) {\n index = i;\n tpsIndex = i;\n }\n String tag = wordsOfInput[i].substring(1);\n tags.add(tag);\n }\n }", "public String getItTag() {\n return itTag;\n }", "private boolean endTagRequired(UAElement element) {\n \t\tString elementName = element.getElementName();\n \t\tif (\"a\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"p\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"div\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"script\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"textarea\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\treturn false;\n \t}", "@Override\n\tpublic boolean isItemValidForSlot(int slot, ItemStack stack){\n\t return true;\n\t}", "public boolean addTag(Tag tag){\n return addTagUC.addTag(mCurrentAccount, tag);\n }", "public boolean canExtractItem(int i, ItemStack itemstack, int j) {\n\t\t// yes as long as its not from slot 0 or the item is a bucket\n\t\treturn itemstack.getItem() == Items.bucket || j != 0;\n\t}", "public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_)\n {\n return true;\n }", "public boolean anyTagFound (Tags selTags) {\n\n boolean tagSelected = false;\n if (selTags == null || selTags.length() == 0) {\n tagSelected = true;\n } else {\n int i = 0;\n String selTag = selTags.getTag(i);\n while (selTag.length() > 0 && (! tagSelected)) {\n tagSelected = tagFound (selTag);\n if (! tagSelected) {\n i++;\n selTag = selTags.getTag(i);\n }\n } // While more item tags for comparision \n } // End if we have selection tags\n return tagSelected;\n }", "public boolean checkUserOrItemID(String iD) {\n // check for empty String\n if (iD == null || iD.strip().equals(\"\")) {\n return false;\n }\n\n if (iD.length() > 6) {\n return false;\n }\n\n try {\n Integer.parseInt(iD);\n return true;\n } catch (Exception e) {\n return false;\n }\n }" ]
[ "0.73799723", "0.615065", "0.60532004", "0.60178727", "0.59514177", "0.591808", "0.59062433", "0.58544093", "0.58091265", "0.5798871", "0.5797119", "0.57762516", "0.5735531", "0.56389135", "0.5633648", "0.5609554", "0.5608961", "0.56023216", "0.55961645", "0.5595451", "0.55864406", "0.55609107", "0.55280226", "0.5487911", "0.54771996", "0.5454955", "0.544376", "0.5427677", "0.5410691", "0.5409605", "0.53893757", "0.53878623", "0.53875345", "0.5366182", "0.5364429", "0.5326775", "0.5296968", "0.5290698", "0.5272208", "0.5249253", "0.5248881", "0.5239462", "0.5234389", "0.5229658", "0.522206", "0.5175555", "0.5169678", "0.51676714", "0.51648897", "0.5146133", "0.5145318", "0.5143679", "0.5143679", "0.5143679", "0.5143679", "0.5143679", "0.5143679", "0.5143679", "0.51165485", "0.51150304", "0.5114062", "0.5113151", "0.5111746", "0.511159", "0.51089555", "0.51024634", "0.5100981", "0.5100416", "0.5093814", "0.5093795", "0.5090181", "0.50816613", "0.50811", "0.5079012", "0.5070813", "0.5064868", "0.5049064", "0.5032763", "0.50307053", "0.50307053", "0.5026546", "0.5025323", "0.50224113", "0.502116", "0.50169164", "0.5004941", "0.50013626", "0.49986196", "0.49960512", "0.49951303", "0.49812153", "0.49767718", "0.4974024", "0.49699968", "0.49698392", "0.4968835", "0.4968499", "0.49572432", "0.49559727", "0.4950829" ]
0.5875751
7
Gets threadid from item (tag). 1. Get 15bits from b62b48.
private static int threadId(long x) { return (int) ((x>>>48) & 0x7FFFL); // 1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long threadId();", "java.lang.String getTid();", "java.lang.String getTid();", "public int getTid();", "private static long tagId(long x) {\n return x & 0xFFFFFFFFFFFFL; // 1\n }", "com.google.protobuf.ByteString\n getTidBytes();", "com.google.protobuf.ByteString\n getTidBytes();", "public Integer getTid() {\r\n return tid;\r\n }", "public int getTID();", "public com.google.protobuf.ByteString\n getTidBytes() {\n java.lang.Object ref = tid_;\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 tid_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getTidBytes() {\n java.lang.Object ref = tid_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n tid_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public Integer getThreadId() {\n\t\treturn threadId;\n\t}", "private int getItemID(String item) {\n\t\titem = item.replace(\" \", \"%20\");\n\t\t//log(\"Item: \" + item);\n \ttry {\n \tString webPage = \"http://\" + serverIP + \"/getid.php?i=\" + item;\n \t//log(\"Webpage: '\" +webPage+\"'\");\n \tURL url = new URL(webPage);\n \tURLConnection urlConnection = url.openConnection();\n \tInputStream is = urlConnection.getInputStream();\n \tInputStreamReader isr = new InputStreamReader(is);\n\n \tint numCharsRead;\n \tchar[] charArray = new char[1024];\n \tStringBuffer sb = new StringBuffer();\n \twhile ((numCharsRead = isr.read(charArray)) > 0) {\n \tsb.append(charArray, 0, numCharsRead);\n \t}\n \tString result = sb.toString();\n \t//log(\"ItemID: \" + result);\n \t//window.status.setText(\"Ready\");\n\n \treturn Integer.parseInt(result);\n \t} catch (Exception e) {\n \tlog(\"Exception occurred at getID.\" + e);\n \t}\n\n \treturn 0;\n \t}", "private static long newTag(long id) {\n long th = Thread.currentThread().getId();\n return (1L<<63) | (th<<48) | id; // 1, 2, 3\n }", "public static long getThreadIdFromAddress(Context context, String address) {\r\n \t\tif (address == null)\r\n \t\t\treturn 0;\r\n \r\n \t\tString THREAD_RECIPIENT_QUERY = \"recipient\";\r\n \r\n \t\tUri.Builder uriBuilder = THREAD_ID_CONTENT_URI.buildUpon();\r\n \t\turiBuilder.appendQueryParameter(THREAD_RECIPIENT_QUERY, address);\r\n \r\n \t\tlong threadId = 0;\r\n \r\n \t\tCursor cursor = context.getContentResolver().query(uriBuilder.build(), new String[] { SMS_ID }, null, null,\r\n \t\t\t\tnull);\r\n \t\tif (cursor != null) {\r\n \t\t\ttry {\r\n \t\t\t\tif (cursor.moveToFirst()) {\r\n \t\t\t\t\tthreadId = cursor.getLong(0);\r\n \t\t\t\t}\r\n \t\t\t} finally {\r\n \t\t\t\tcursor.close();\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn threadId;\r\n \t}", "public java.lang.String getTid() {\n java.lang.Object ref = tid_;\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 tid_ = s;\n return s;\n }\n }", "public abstract int getThreadNumber();", "public java.lang.String getTid() {\n java.lang.Object ref = tid_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n tid_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public int getThreadId() {\n\n return threadId.get();\n\n }", "long getID(Object item);", "public String getThreadKey() {\n\t\treturn Integer.toString(this.hashCode());\n\t}", "long getThreadId();", "public static long m3717b(Object obj) {\n return ((QueueItem) obj).getQueueId();\n }", "String getThreadId();", "public long getAeThreadId() {\n\t\treturn threadId;\n\t}", "public long getThreadId() {\n return threadId_;\n }", "public long getThreadId() {\n return threadId;\n }", "public void getGenericID(int seqid, String tag, String gid);", "public ULong getXbtId() {\n return (ULong) get(2);\n }", "public String getTid() {\n return tid;\n }", "public String getTid() {\n return tid;\n }", "public String getTid() {\n return tid;\n }", "public long getThreadId() {\n return threadId_;\n }", "public Long getThreadId() {\n return threadId;\n }", "public void getMsgThread(InboxFragment.MessageThreads mThread){\n\n //now, get the ThreadId, then use it to get the messages under that Id, put them in a arraylist\n\n }", "public int getTag()\n {\n return this.m_descriptor[0] & 0xFF;\n }", "public String getThreadPoolStringId(int numericIdForThreadpool);", "public byte[] getMTID () {\n\t\treturn mtid;\n\t}", "public JdwpId (byte tag)\r\n {\r\n _tag = tag;\r\n }", "int get_int(ThreadContext tc, RakudoObject classHandle);", "public int getThreadPoolNumericId(String threadpoolId);", "private T getIdentifier(Runnable runnable) {\n T id = null;\n if (runnable instanceof SerialRunnable) {\n //Grab the identifier\n id = (((SerialRunnable<T>) runnable).getIdentifier());\n }\n return id;\n }", "public Integer getMenuItemTag(MenuItem item) {\n return folderIds.get(item);\n }", "public static byte getPacketId(byte[] packet){\n assert packet.length >= 3;\n // And the ID is second byte\n return packet[1];\n }", "int getUid();", "int getUid();", "netty.framework.messages.MsgId.MsgID getMsgID();", "netty.framework.messages.MsgId.MsgID getMsgID();", "long getUid();", "long getUid();", "private static int th() {\n return (int) Thread.currentThread().getId();\n }", "public long getTagId(String tag) {\n\n\t\tCursor cursor = m_db.query(TAG_TABLE_NAME,\n\t\t\t\tnew String[] { TAG_FIELD_ID }, TAG_FIELD_NAME + \"=?\",\n\t\t\t\tnew String[] { tag }, null, null, null);\n\n\t\t//\n\t\t// get first entry of result set\n\t\t//\n\t\tString result = getFirstEntryOfResultSet(cursor);\n\n\t\t//\n\t\t// close cursor\n\t\t//\n\t\tcursor.close();\n\n\t\tif (result == null)\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn Long.parseLong(result);\n\t}", "long getTraceTag();", "long getMsgId();", "@DISPID(113)\r\n\t// = 0x71. The runtime will prefer the VTID if present\r\n\t@VTID(108)\r\n\tint queueId();", "public void setTid(Integer tid) {\r\n this.tid = tid;\r\n }", "int getItemID();", "@DISPID(1)\r\n\t// = 0x1. The runtime will prefer the VTID if present\r\n\t@VTID(7)\r\n\tint jobID();", "public long getUInt() { return bb.getInt() & 0xffff_ffffL; }", "long extractI2b2QueryId(byte[] bytes);", "private static int findRenderThreadId(@NotNull ProcessModel process) {\n Optional<ThreadModel> renderThread =\n process.getThreads().stream().filter((thread) -> thread.getName().equalsIgnoreCase(RENDER_THREAD_NAME)).findFirst();\n return renderThread.map(ThreadModel::getId).orElse(INVALID_PROCESS);\n }", "public Task getTask(Integer tid);", "com.google.protobuf.ByteString getUidBytes();", "@DISPID(62)\r\n\t// = 0x3e. The runtime will prefer the VTID if present\r\n\t@VTID(67)\r\n\tint queueId();", "io.dstore.values.IntegerValue getForumId();", "public long getNextThreadID() {\n return (Long) getProperty(\"nextThreadID\");\n }", "public Long getTagid() {\n return tagid;\n }", "UUID getTransmissionId();", "@Override\n\tpublic Integer getUid() {\n\t\treturn this.elemId;\n\t}", "long getUID();", "public Integer getRtid() {\r\n\t\treturn rtid;\r\n\t}", "public synchronized String getId(long entry) throws IOException, EOFException {\n long startOfEntry = IDX_START_OF_CONTENT + (entry * bytesPerSlot);\n idx.seek(startOfEntry);\n byte[] bytes = new byte[bytesPerId];\n int bytesRead = idx.read(bytes);\n if (bytesRead < bytesPerId || bytes[1] == '\\n')\n throw new IllegalStateException(\"No data at address \" + entry);\n return new String(bytes);\n }", "int getPacketId();", "private Integer getUniqueId(Object object) {\n/* 89 */ Integer id = this.idCache.get(object);\n/* 90 */ if (id == null) {\n/* 91 */ id = Integer.valueOf(this.uidGenerator.incrementAndGet());\n/* 92 */ Integer existing = this.idCache.putIfAbsent(object, id);\n/* 93 */ if (existing != null) {\n/* 94 */ return existing;\n/* */ }\n/* */ } \n/* 97 */ return id;\n/* */ }", "@Override\n\tpublic Integer getUid() {\n\t\treturn this.siacRBilElemTipoClassTipElemCode;\n\t}", "io.dstore.values.IntegerValueOrBuilder getForumIdOrBuilder();", "public int getMyTag()\n\t{\n\t\treturn myTag;\n\t}", "Object getMessageId();", "long getMessageId(int index);", "public int getTagNum() {\n return Integer.parseInt(getTag());\n }", "org.multibit.hd.core.protobuf.MBHDContactsProtos.Tag getTag(int index);", "public long readTag(){\n if (!checkOpen()){\r\n return 0;\r\n }\r\n // arrays will hold return values from various calls to reader\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 return 0;\r\n }\r\n System.out.println(\"Tagtype:\"+pTAG[0] + \" SN[0]:\" + Integer.toHexString(pSN[0]) + \" return= \" + tag);\r\n long serial = 0;\r\n for(int i=0;i<pLen[0];i++) {\r\n // shift and bitwise-OR the bytes into one 64-bits integer\r\n serial = (serial << 8 ); // shift left 8 bits\r\n serial = serial | (pSN[i] & 0xFF); // bitwise OR byte into int\r\n }\r\n System.out.printf(\" serial = %d hex: %X\",serial, serial);\r\n message = \"String read\";\r\n // test card read/write+login functions; only with new cards\r\n //writeString(\"Hello RFID card\");\r\n //System.err.println(readString());\r\n return (int)serial;\r\n }", "public int getRecordId(int reschtid){\r\n\r\n\t\tIndex ind = chtidA.getIndex();\r\n\t\tfor (int i=0; i<(int)ind.getSize(); i++){\r\n\t\t\tint chtid = chtidA.getInt(ind.set(i));\r\n\t\t\tif (chtid == reschtid) return i;\r\n\t\t}\t\r\n\t\t\t \r\n\t\treturn -1;\r\n\t}", "long getMessageID();", "long getMessageID();", "@Override\n\tprotected Set<Integer> getItemIds() {\n\t\t\n\t\tBnetDistributedKB bdKb = (BnetDistributedKB)kb;\n\t\t\n\t\treturn bdKb.itemIds;\n\t}", "@Override\n\tprotected Set<Integer> getItemIds() {\n\t\t\n\t\tBnetDistributedKB bdKb = (BnetDistributedKB)kb;\n\t\t\n\t\treturn bdKb.itemIds;\n\t}", "public int getTileId() {\n\t\treturn tileId;\n\t}", "public Integer getItemid() {\n return itemid;\n }", "public Integer getItemid() {\n return itemid;\n }", "private String getMyNodeId() {\n TelephonyManager tel = (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE);\n String nodeId = tel.getLine1Number().substring(tel.getLine1Number().length() - 4);\n return nodeId;\n }", "int getMsgid();", "public int uid2id(String uid) {\n UUID what=UUID.fromString(uid);\n for (T item : cache.get()) {\n try {\n if (getUidMethod.invoke(item).equals(what)) {\n return (Integer) getIdMethod.invoke(item);\n }\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }\n return -1;\n }", "public Integer getPollItemId() {\n final List<BwXproperty> props = getXproperties(BwXproperty.pollItemId);\n\n if (Util.isEmpty(props)) {\n return null;\n }\n\n if (props.size() > 1) {\n return null;\n }\n\n final BwXproperty p = props.get(0);\n final PollItmId pid = new PollItmId(p.getValue());\n\n return pid.getId();\n }", "private CAUEntry findElementWithTID(CAUList ulist, int tid){\n\t\tList<CAUEntry> list = ulist.CAUEntries;\n\t\t\n\t\t// perform a binary search to check if the subset appears in level k-1.\n int first = 0;\n int last = list.size() - 1;\n \n // the binary search\n while( first <= last )\n {\n \tint middle = ( first + last ) >>> 1; // divide by 2\n\n if(list.get(middle).tid < tid){\n \tfirst = middle + 1; // the itemset compared is larger than the subset according to the lexical order\n }\n else if(list.get(middle).tid > tid){\n \tlast = middle - 1; // the itemset compared is smaller than the subset is smaller according to the lexical order\n }\n else{\n \treturn list.get(middle);\n }\n }\n\t\treturn null;\n\t}", "public Integer getThreadPostId() {\n\t\treturn threadPostId;\n\t}", "private String getNextQueueIdentifier() {\n String qid = PropertyUtils.genGUID(25);\n updateCachedCounts();\n return qid;\n }", "long getMessageId();", "long getMessageId();", "public String getRfidTagNum() {\n return rfidTagNum;\n }" ]
[ "0.6393398", "0.61544275", "0.61544275", "0.61284894", "0.6008876", "0.59830266", "0.5896364", "0.58184683", "0.57986015", "0.5774842", "0.576788", "0.5761801", "0.5755879", "0.5740641", "0.5705054", "0.56948537", "0.56288266", "0.5626947", "0.5609023", "0.5593505", "0.556947", "0.55690426", "0.5559133", "0.5531561", "0.5488305", "0.54761976", "0.547418", "0.5462931", "0.5459612", "0.5401901", "0.5401901", "0.5401901", "0.5397494", "0.53609544", "0.5319488", "0.5305896", "0.5275933", "0.5242972", "0.52208537", "0.51916796", "0.5176221", "0.5142488", "0.51403195", "0.512699", "0.5124188", "0.5124188", "0.5115565", "0.5115565", "0.51042324", "0.51042324", "0.5103977", "0.50946176", "0.50918394", "0.50917196", "0.5078556", "0.5069681", "0.5067953", "0.50604695", "0.50499016", "0.5047898", "0.50453526", "0.50392693", "0.50386316", "0.5038096", "0.5030277", "0.50282556", "0.5022482", "0.49768287", "0.49724895", "0.4967041", "0.4963257", "0.49628192", "0.49562496", "0.49489602", "0.49307984", "0.49236226", "0.49161094", "0.49086624", "0.4904481", "0.49023283", "0.48995647", "0.4897738", "0.48958492", "0.4884432", "0.4884432", "0.4884086", "0.4884086", "0.4874668", "0.48741373", "0.48741373", "0.4872252", "0.48639256", "0.48558074", "0.48464626", "0.4841607", "0.4820744", "0.48130557", "0.4812339", "0.4812339", "0.48045963" ]
0.6627587
0
Gets tagid from item (tag). 1. Get 48bits from b47b0.
private static long tagId(long x) { return x & 0xFFFFFFFFFFFFL; // 1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getItemID(String item) {\n\t\titem = item.replace(\" \", \"%20\");\n\t\t//log(\"Item: \" + item);\n \ttry {\n \tString webPage = \"http://\" + serverIP + \"/getid.php?i=\" + item;\n \t//log(\"Webpage: '\" +webPage+\"'\");\n \tURL url = new URL(webPage);\n \tURLConnection urlConnection = url.openConnection();\n \tInputStream is = urlConnection.getInputStream();\n \tInputStreamReader isr = new InputStreamReader(is);\n\n \tint numCharsRead;\n \tchar[] charArray = new char[1024];\n \tStringBuffer sb = new StringBuffer();\n \twhile ((numCharsRead = isr.read(charArray)) > 0) {\n \tsb.append(charArray, 0, numCharsRead);\n \t}\n \tString result = sb.toString();\n \t//log(\"ItemID: \" + result);\n \t//window.status.setText(\"Ready\");\n\n \treturn Integer.parseInt(result);\n \t} catch (Exception e) {\n \tlog(\"Exception occurred at getID.\" + e);\n \t}\n\n \treturn 0;\n \t}", "public int getTagNum() {\n return Integer.parseInt(getTag());\n }", "public int getTag()\n {\n return this.m_descriptor[0] & 0xFF;\n }", "public int getSlotForId(int itemId) {\n\t\tif (summonedFamiliar.familiarType == FamiliarType.BOB) {\n\t\t\tfor (int i = 0; i < burdenedItems.length; i++) {\n\t\t\t\tif ((burdenedItems[i] + 1) == itemId)\n\t\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public Integer getTagId() {\n return tagId;\n }", "public Integer getTagId() {\n return tagId;\n }", "int getTagNo();", "public Long getTagid() {\n return tagid;\n }", "int getItemID();", "public int getMyTag()\n\t{\n\t\treturn myTag;\n\t}", "org.multibit.hd.core.protobuf.MBHDContactsProtos.Tag getTag(int index);", "public void getGenericID(int seqid, String tag, String gid);", "public Long getTagId() {\r\n return tagId;\r\n }", "public long getTagId(String tag) {\n\n\t\tCursor cursor = m_db.query(TAG_TABLE_NAME,\n\t\t\t\tnew String[] { TAG_FIELD_ID }, TAG_FIELD_NAME + \"=?\",\n\t\t\t\tnew String[] { tag }, null, null, null);\n\n\t\t//\n\t\t// get first entry of result set\n\t\t//\n\t\tString result = getFirstEntryOfResultSet(cursor);\n\n\t\t//\n\t\t// close cursor\n\t\t//\n\t\tcursor.close();\n\n\t\tif (result == null)\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn Long.parseLong(result);\n\t}", "public String getTagId() {\n return tagId;\n }", "public Integer getItemid() {\n return itemid;\n }", "public Integer getItemid() {\n return itemid;\n }", "long getID(Object item);", "public int getTag() {\n return tag;\n }", "com.google.protobuf.ByteString\n getTagBytes();", "public JdwpId (byte tag)\r\n {\r\n _tag = tag;\r\n }", "public String getTag() {\n return tagNum;\n }", "@Override\n\tprotected Set<Integer> getItemIds() {\n\t\t\n\t\tBnetDistributedKB bdKb = (BnetDistributedKB)kb;\n\t\t\n\t\treturn bdKb.itemIds;\n\t}", "@Override\n\tprotected Set<Integer> getItemIds() {\n\t\t\n\t\tBnetDistributedKB bdKb = (BnetDistributedKB)kb;\n\t\t\n\t\treturn bdKb.itemIds;\n\t}", "public ULong getXbtId() {\n return (ULong) get(2);\n }", "public int getTag(int position) {\r\n return dataTag.get(position);\r\n }", "public Integer getMenuItemTag(MenuItem item) {\n return folderIds.get(item);\n }", "public org.multibit.hd.core.protobuf.MBHDContactsProtos.Tag getTag(int index) {\n return tag_.get(index);\n }", "public String getItemID() {\n\t return this.itemID;\n\t}", "public int tag () { return MyTag; }", "public int getItem_id() {\r\n\t\treturn item_id;\r\n\t}", "java.lang.String getTag();", "java.lang.String getTag();", "public int getItemID()\n {\n return itemID;\n }", "public com.google.protobuf.ByteString\n getTagBytes() {\n java.lang.Object ref = tag_;\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 tag_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public static String getTagID(String str){\n\t\tString tag = str.substring(0, 8);\n\t\tString regEx = \"(\\\\d{1}|[A-F])+(\\\\d{1}|[A-F])+(\\\\d{1}|[A-F])+(\\\\d{1}|[A-F])+(\\\\d{1}|[A-F])+(\\\\d{1}|[A-F])+(\\\\d{1}|[A-F])+(\\\\d{1}|[A-F])\";\n\t\tPattern pattern = Pattern.compile(regEx);\n\t\tMatcher matcher = pattern.matcher(tag);\n\t\t\n\n\t\tif(!matcher.find()){\n\t\t\t\n\t\t\treturn \"\";\n\t\t}\n\t\n\t\treturn tag;\n\t}", "public com.google.protobuf.ByteString\n getTagBytes() {\n java.lang.Object ref = tag_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n tag_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public int idDropped(int par1, EaglercraftRandom par2Random, int par3) {\n\t\treturn Item.sign.itemID;\n\t}", "public String getRfidTagNum() {\n return rfidTagNum;\n }", "@Override\n public int getTag() {\n return this.tag;\n }", "public long readTag(){\n if (!checkOpen()){\r\n return 0;\r\n }\r\n // arrays will hold return values from various calls to reader\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 return 0;\r\n }\r\n System.out.println(\"Tagtype:\"+pTAG[0] + \" SN[0]:\" + Integer.toHexString(pSN[0]) + \" return= \" + tag);\r\n long serial = 0;\r\n for(int i=0;i<pLen[0];i++) {\r\n // shift and bitwise-OR the bytes into one 64-bits integer\r\n serial = (serial << 8 ); // shift left 8 bits\r\n serial = serial | (pSN[i] & 0xFF); // bitwise OR byte into int\r\n }\r\n System.out.printf(\" serial = %d hex: %X\",serial, serial);\r\n message = \"String read\";\r\n // test card read/write+login functions; only with new cards\r\n //writeString(\"Hello RFID card\");\r\n //System.err.println(readString());\r\n return (int)serial;\r\n }", "public java.lang.String getTag() {\n java.lang.Object ref = tag_;\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 tag_ = s;\n return s;\n }\n }", "public static byte getPacketId(byte[] packet){\n assert packet.length >= 3;\n // And the ID is second byte\n return packet[1];\n }", "public int getTagNumber() {\n return tagNumber;\n }", "public byte getFieldAsByte(int tag) {\n return getFieldAsByte(tag, 0);\n }", "public java.lang.String getIdTag()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(IDTAG$0, 0);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "java.lang.String getBidid();", "public long getSuburItemId();", "public String getItemIdentifier();", "org.apache.xmlbeans.XmlString xgetTag();", "public String getTagKey() {\n return tagKey;\n }", "public java.lang.String getTag() {\n java.lang.Object ref = tag_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n tag_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "int getItemId() {\n return m_itemId;\n }", "public static __Tag getTagSub(String tag) {\n\t return map.get(tag);\n\t}", "public static __Tag getTagSub(String tag) {\n\t return map.get(tag);\n\t}", "public final int getByte() throws IOException {\r\n b3 = 0;\r\n\r\n b3 = (tagBuffer[bPtr] & 0xff);\r\n bPtr += 1;\r\n\r\n return b3;\r\n }", "abstract int getItemID(int level);", "public org.multibit.hd.core.protobuf.MBHDContactsProtos.Tag getTag(int index) {\n if (tagBuilder_ == null) {\n return tag_.get(index);\n } else {\n return tagBuilder_.getMessage(index);\n }\n }", "public String getItemId() {\r\n return itemId;\r\n }", "public ocpp.IdTagInfo getIdTagInfo()\n {\n synchronized (monitor())\n {\n check_orphaned();\n ocpp.IdTagInfo target = null;\n target = (ocpp.IdTagInfo)get_store().find_element_user(IDTAGINFO$0, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "public static ItemStack readItem(CompoundTag tag) {\n BlockDataManager blockDataManager = ((GlowServer) Bukkit.getServer()).getBlockDataManager();\n final Material[] material = {null};\n if ((!tag.readString(\"id\", id -> material[0] = ItemIds.getItem(id))\n && !tag.readShort(\"id\",\n id -> material[0] = blockDataManager.convertToBlockData(id).getMaterial()))\n || material[0] == null || material[0] == Material.AIR) {\n return null;\n }\n final byte[] count = {0};\n tag.readByte(\"Count\", x -> count[0] = x);\n if (count[0] == 0) {\n return null;\n }\n final short[] damage = {0};\n tag.readShort(\"Damage\", x -> damage[0] = x);\n ItemStack stack = new ItemStack(material[0], count[0], damage[0]);\n // This is slightly different than what tag.readItem would do, since we specify the\n // material separately.\n tag.readCompound(\"tag\",\n subtag -> stack.setItemMeta(GlowItemFactory.instance().readNbt(material[0], subtag)));\n return stack;\n }", "public static int getTaggedInt(String tag, Element el)\n\t{\n\t\tString s = getTaggedString(tag, el);\n\t\t//if(s==\"\") {flag=1; errtag += tag; return 0;}\n\t\t//try {\n\t\treturn Integer.parseInt(s.trim());\n\t\t/*} catch (NumberFormatException e) {\n\t\t\tflag = 1;\n\t\t\terrtag += tag;\n\t\t\t\n\t\t\treturn 0;\n\t\t}*/\n\t}", "public int getItemId() {\n return itemId;\n }", "public int getItemId()\r\n {\r\n return _itemId;\r\n }", "com.google.protobuf.ByteString\n getBididBytes();", "public void setMyTag(int theTag)\n\t{\n\t\tmyTag = theTag;\n\t}", "String getTag();", "public String getItemId() {\n return itemId;\n }", "public String getTankID(ItemStack container) {\n \tString key = getBlockTank().getTankNBTName();\n \tif(container.getTagCompound() == null || !container.getTagCompound().hasKey(key)) {\n // In this case, the tank is invalid!\n \t\tcontainer.setTagCompound(new NBTTagCompound());\n container.getTagCompound().setTag(key, new NBTTagCompound());\n \t\tcontainer.getTagCompound().getCompoundTag(key).setString(WorldSharedTank.NBT_TANKID, \"invalid\");\n \t}\n return container.getTagCompound().getCompoundTag(key).getString(WorldSharedTank.NBT_TANKID);\n }", "public String getDPTag(String key)\r\n {\n return tagHash.get(key).toString();\r\n }", "public byte[] tag();", "static ItemsIconId retrieveItemsIconId(ComprehensionTlv ctlv) throws ResultException {\n CatLog.d(\"ValueParser\", \"retrieveItemsIconId:\");\n ItemsIconId id = new ItemsIconId();\n byte[] rawValue = ctlv.getRawValue();\n int valueIndex = ctlv.getValueIndex();\n boolean z = true;\n int numOfItems = ctlv.getLength() - 1;\n id.recordNumbers = new int[numOfItems];\n int valueIndex2 = valueIndex + 1;\n try {\n if ((rawValue[valueIndex] & 255) != 0) {\n z = false;\n }\n id.selfExplanatory = z;\n int index = 0;\n while (index < numOfItems) {\n int index2 = index + 1;\n int valueIndex3 = valueIndex2 + 1;\n try {\n id.recordNumbers[index] = rawValue[valueIndex2];\n index = index2;\n valueIndex2 = valueIndex3;\n } catch (IndexOutOfBoundsException e) {\n throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD);\n }\n }\n return id;\n } catch (IndexOutOfBoundsException e2) {\n throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD);\n }\n }", "String getBlipIdByElement(T element);", "long extractI2b2QueryId(byte[] bytes);", "private int getEntryFieldInt(int item, OFFSET offset) {\n switch (offset) {\n case KEY_LENGTH:\n // return two low bytes of the key length index int\n return (entries[item + offset.value] & KEY_LENGTH_MASK);\n case KEY_BLOCK:\n // offset must be OFFSET_KEY_BLOCK, return 2 high bytes of the int inside key length\n // right-shift force, fill empty with zeroes\n return (entries[item + offset.value] >>> KEY_BLOCK_SHIFT);\n case VALUE_LENGTH:\n return (entries[item + offset.value] & VALUE_LENGTH_MASK);\n case VALUE_BLOCK:\n return (entries[item + offset.value] >>> VALUE_BLOCK_SHIFT);\n default:\n return entries[item + offset.value];\n }\n }", "public long getItemShopBasketId();", "public static int getElanTagFromMetadata(Uint64 metadata) {\n return metadata.toJava().and(MetaDataUtil.METADATA_MASK_SERVICE.toJava()).shiftRight(24).intValue();\n }", "int getBId();", "@Override\n public long getItemId(int position) {\n return ((Integer)((View) getItem(position)).getTag()).longValue();\n }", "public int getID(OrderItem oi){\n int id;\n id=findID(oi);\n return id;\n }", "public String getTagNum(String tagName) {\n\t\treturn tagNameToNumber.get(tagName);\n\t\t// return tagName;\n\t}", "com.google.protobuf.ByteString\n getTidBytes();", "CharacterTypeInItemVariant getAttribute(Integer id);", "@java.lang.Override\n public long getItemId() {\n return itemId_;\n }", "public Tag readTag() throws IOException {\n/* 78 */ char[] arrayOfChar = new char[1024];\n/* */ \n/* 80 */ int j = -1;\n/* */ \n/* 82 */ Integer integer1 = null;\n/* 83 */ Integer integer2 = null;\n/* */ \n/* 85 */ int i = read(2);\n/* 86 */ if (i < 0) {\n/* 87 */ throw new IOException(\"stop.\");\n/* */ }\n/* 89 */ if (i > arrayOfChar.length) {\n/* 90 */ throw new IOException(\"Invalid tag length.\");\n/* */ }\n/* 92 */ while (i > 0) {\n/* 93 */ j = read(2);\n/* 94 */ int k = read(2);\n/* 95 */ switch (j) {\n/* */ case 1:\n/* 97 */ integer1 = new Integer(read(4));\n/* 98 */ integer2 = new Integer(read(4));\n/* */ break;\n/* */ } \n/* */ \n/* 102 */ i -= 4 + k;\n/* */ } \n/* 104 */ return new Tag(i, j, integer1, integer2);\n/* */ }", "@DISPID(73)\r\n\t// = 0x49. The runtime will prefer the VTID if present\r\n\t@VTID(78)\r\n\tasci.activebatch.ITags tags();", "String convertTag(String tag);", "private synchronized int generateItemID(){\r\n\t\tint i;\r\n\t\tfor(i = 1; items.containsKey(i) || finishedItems.containsKey(i);i++);\r\n\t\treturn i;\r\n\t}", "public String getItTag() {\n return itTag;\n }", "public Long getItemId() {\r\n return itemId;\r\n }", "public String getTag()\n\t{\n\t\treturn tag;\n\t}", "public String getTag()\n\t{\n\t\treturn tag;\n\t}", "public synchronized int getID(String codeItemID) {\n\n\t\tmaxSequence = this.getIDFromDb(codeItemID);\n\t\treturn maxSequence;\n\t}", "@Override\n public boolean removeItem(Object itemId)\n {\n try\n {\n TLogger.debug(\"Entry in TagTable - removeItem\");\n if(itemId instanceof Tag)\n {\n Tag one = (Tag)itemId;\n Collection allItems = this.getItemIds();\n for(Object existingItem : allItems)\n {\n Tag two = (Tag)existingItem;\n if(one.getTagId().equals(two.getTagId()))\n {\n return super.removeItem(two);\n }\n }\n }\n }\n catch(Exception exception)\n {\n TLogger.error(\"Exception in TagTable - removeItem\",exception);\n }\n finally\n {\n TLogger.debug(\"Exit in TagTable - removeItem\");\n }\n return super.removeItem(itemId);\n }", "public void setTagid(Long tagid) {\n this.tagid = tagid;\n }", "public String getItemcode() {\n return itemcode;\n }", "@java.lang.Override\n public long getItemId() {\n return itemId_;\n }", "private byte getMultHashMapTypeFromAtt(final Att item) {\n \n \t\tif (item.getType().equals(STRING_TYPE)) {\n \t\t\treturn MultiHashMapDefinition.TYPE_STRING;\n \t\t} else if (item.getType().equals(INT_TYPE)) {\n \t\t\treturn MultiHashMapDefinition.TYPE_INTEGER;\n \t\t} else if (item.getType().equals(FLOAT_TYPE)) {\n \t\t\treturn MultiHashMapDefinition.TYPE_FLOATING_POINT;\n \t\t} else if (item.getType().equals(BOOLEAN_TYPE)) {\n \t\t\treturn MultiHashMapDefinition.TYPE_BOOLEAN;\n \t\t}\n \n \t\t// outta here\n \t\treturn -1;\n \t}", "public String getTag();", "public java.lang.String getBidid() {\n java.lang.Object ref = bidid_;\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 bidid_ = s;\n }\n return s;\n }\n }" ]
[ "0.6207399", "0.61789507", "0.61638314", "0.6151035", "0.6074379", "0.6074379", "0.5985567", "0.5979336", "0.5942301", "0.5932127", "0.5915383", "0.58425045", "0.58396393", "0.58330464", "0.5829172", "0.58270055", "0.58270055", "0.5806689", "0.57950807", "0.5769195", "0.57270765", "0.5713377", "0.57005495", "0.57005495", "0.5683528", "0.56592333", "0.5644163", "0.56377107", "0.56155145", "0.5597848", "0.5569172", "0.55381984", "0.55381984", "0.55339885", "0.5514488", "0.55113524", "0.5494368", "0.5489341", "0.5471787", "0.54627377", "0.54500103", "0.54470205", "0.54433376", "0.5434421", "0.54227215", "0.54090834", "0.5389675", "0.53848445", "0.53689855", "0.53535193", "0.5353294", "0.53434956", "0.53293496", "0.53236586", "0.53236586", "0.53173107", "0.529308", "0.5277289", "0.5245742", "0.52453494", "0.5239802", "0.52174664", "0.52168494", "0.52092427", "0.52077484", "0.5205597", "0.5201242", "0.5195967", "0.5187811", "0.5184433", "0.51794577", "0.51710755", "0.5167607", "0.5166591", "0.5148125", "0.51472944", "0.5146575", "0.51394266", "0.5130926", "0.512362", "0.5122762", "0.5115156", "0.51104593", "0.5110195", "0.5107039", "0.5106067", "0.51037025", "0.5100335", "0.5095744", "0.5087634", "0.5080252", "0.5080252", "0.5071287", "0.50711465", "0.5070163", "0.5070029", "0.5069872", "0.50656784", "0.5062336", "0.50610304" ]
0.622333
0
Constructor initializes inputs and output to random binary values, intializes control to 15, initializes zero flag to false. Inputs and output arrays should have length INT_LENGTH.
public ALU() { // PROGRAM 1: Student must complete this method //declare input(s) and output arrays inputA = new boolean[INT_LENGTH]; inputB = new boolean[INT_LENGTH]; output = new boolean[INT_LENGTH]; //initializes zeroFlag and control zeroFlag = false; control = 15; //initialize each array with random boolean values for (int i = 0; i < INT_LENGTH; i++) { inputA[i] = random.nextBoolean(); inputB[i] = random.nextBoolean(); output[i] = random.nextBoolean(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BinaryNumber(int length){\n\t\tdata = new int[length];\n\t\tfor (int i=0; i<length; i++){\n\t\t\tdata[i] = 0;\n\t\t}\n\t}", "static void initBin(int[] binToInt)\n {\n for(int i = 0; i < 32; i++)\n {\n binToInt[i] = 0;\n }\n }", "public Binary() { \n\t_decNum = 0;\n\t_binNum = \"0\";\n }", "static void inputBin(int [] binToInt)\n {\n InputStreamReader instr = new InputStreamReader(System.in);\n BufferedReader stdin = new BufferedReader(instr);\n StringTokenizer stok;\n int num;\n String value;\n try\n {\n System.out.println(\"Input a 32 digit binary code. \");\n System.out.println();\n value = stdin.readLine();\n System.out.println();\n stok = new StringTokenizer(value);\n while (stok.hasMoreTokens())\n {\n for(int i = 0; i < 32; i++)\n {\n num = Integer.parseInt(stok.nextToken());\n int z = num;\n if (z == 0 || z == 1)\n {\n binToInt[i] = z;\n if(z == 1)\n {\n if(i == 0 || i == 8 || i == 16 || i == 24)\n {\n binToInt[i] = 128;\n }\n if(i == 1 || i == 9 || i == 17 || i == 25)\n {\n binToInt[i] = 64;\n }\n if(i == 2 || i == 10 || i == 18 || i == 26)\n {\n binToInt[i] = 32;\n }\n if(i == 3 || i == 11 || i == 19 || i == 27)\n {\n binToInt[i] = 16;\n }\n if(i == 4 || i == 12 || i == 20 || i == 28)\n {\n binToInt[i] = 8;\n }\n if(i == 5 || i == 13 || i == 21 || i == 29)\n {\n binToInt[i] = 4;\n }\n if(i == 6 || i == 14 || i == 22 || i == 30)\n {\n binToInt[i] = 2;\n }\n if(i == 7 || i == 15 || i == 23 || i == 31)\n {\n binToInt[i] = 1;\n }\n }\n if(z == 0)\n {\n binToInt[i] = 0;\n }\n }\n if(z > 1)\n {\n System.out.println(\"*Error only input 1's and 0's* Restart Program.\");\n }\n }\n } \n }catch (IOException ioe)\n {\n System.exit(-1);\n }\n }", "public BinaryNumber(int length) {\n\t\tdata = new int[length];\n\t\tfor(int i = 0;i < length;i++) {\n\t\t\tdata[i] = 0;\n\t\t}\n\t}", "public IntArrays()\n\t{\n\t\tthis(10);\n\t}", "public Generator() {\n identificationNumbers = new int[100][31];\n }", "public Individual(int integerSize, int integerCount, boolean signedInt)\r\n\t{\r\n\t\tintSize = integerSize;\r\n\t\tintCount = integerCount;\r\n\t\tbinary = new boolean[integerSize * integerCount];\r\n\t\tthis.signedInt = signedInt;\r\n\t}", "public BinaryArray(int[] binaries) {\n this.binaries = binaries;\n }", "@Test\n public void testProbInputBinaryData() throws Exception {\n /* Test with valid value */\n int[] result = NoiseGenerator.randomBinaryData(5,0.5);\n Assert.assertFalse(result == null);\n\n /* Test with invalid value */\n result = NoiseGenerator.randomBinaryData(5,-0.1);\n Assert.assertTrue(result == null);\n\n }", "public void randomiseBinary()\r\n\t{\r\n\t\tfor (int i = 0; i < binary.length; i++)\r\n\t\t\tbinary[i] = Math.random() >= 0.5;\r\n\t}", "public static int[] init(int in){\n int[] cells = new int[16];\n\n for(int i = 0; i < 16; i++){\n cells[i] = 1;\n }\n\n //sets the index passed-in to be 0\n cells[in] = 0;\n cells[15] = 14;\n\n return cells;\n }", "RandomArrayGenerator() {\n this.defaultLaenge = 16;\n }", "public IntMap()\r\n {\r\n this(16);\r\n }", "public IntegerRegFile()\n {\n //REGISTER FILE INITIALIZATION (with dummy values)\n registerFile = new int[32]; //create 32 integer registers\n for (int i = 0; i < registerFile.length; i++) {\n registerFile[i] = i + (i/2);\n }\n }", "public DataInt() {\n }", "@Test\n public void testSizeRandomBinaryData() throws Exception {\n /* Test with valid value */\n int[] result = NoiseGenerator.randomBinaryData(5,0.50);\n Assert.assertFalse(result == null);\n\n /* Test with invalid value */\n result = NoiseGenerator.randomBinaryData(-1,0.50);\n Assert.assertTrue(result == null);\n }", "public static void main(String[]args){\n \r\n print_binary(15);//Print the integer in binary form using interations\r\n }", "public Binary( int n ) {\n\t_decNum = n;\n\t_binNum = decToBin(n);\n }", "private static char[] initNum() {\n\t\tchar[] values = {'0', '1', '2', '3', '4', '5',\n\t\t\t\t'6', '7', '8', '9'};\n\t\tchar[] answer = new char[4];\n\t\t\n\t\tint countReady = 0;\n\t\t\n\t\twhile(countReady != 4) {\n\t\t\tint tempChar = rndChar();\n\t\t\tif(values[tempChar] != 'x') {\n\t\t\t\tanswer[countReady] = values[tempChar];\n\t\t\t\tvalues[tempChar] = 'x';\n\t\t\t\tcountReady++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn answer;\n\t}", "public CbaTinyInt build() {\n return new CbaTinyInt(this);\n }", "public Logic() {\n\t\tarr = new int [8][8];\n\t\tcreateNewGame();\n\t}", "public ToZeroRampGenerator() { \r\n }", "public MutableInt() {}", "public GameViewController(int[] input) {\n\t\tinputs = input;\n\t}", "public BrickletIO16(String uid, IPConnection ipcon) {\n\t\tsuper(uid, ipcon);\n\n\t\tapiVersion[0] = 2;\n\t\tapiVersion[1] = 0;\n\t\tapiVersion[2] = 0;\n\t\tresponseExpected[IPConnection.unsignedByte(FUNCTION_SET_PORT)] = RESPONSE_EXPECTED_FLAG_FALSE;\n\t\tresponseExpected[IPConnection.unsignedByte(FUNCTION_GET_PORT)] = RESPONSE_EXPECTED_FLAG_ALWAYS_TRUE;\n\t\tresponseExpected[IPConnection.unsignedByte(FUNCTION_SET_PORT_CONFIGURATION)] = RESPONSE_EXPECTED_FLAG_FALSE;\n\t\tresponseExpected[IPConnection.unsignedByte(FUNCTION_GET_PORT_CONFIGURATION)] = RESPONSE_EXPECTED_FLAG_ALWAYS_TRUE;\n\t\tresponseExpected[IPConnection.unsignedByte(FUNCTION_SET_DEBOUNCE_PERIOD)] = RESPONSE_EXPECTED_FLAG_TRUE;\n\t\tresponseExpected[IPConnection.unsignedByte(FUNCTION_GET_DEBOUNCE_PERIOD)] = RESPONSE_EXPECTED_FLAG_ALWAYS_TRUE;\n\t\tresponseExpected[IPConnection.unsignedByte(FUNCTION_SET_PORT_INTERRUPT)] = RESPONSE_EXPECTED_FLAG_TRUE;\n\t\tresponseExpected[IPConnection.unsignedByte(FUNCTION_GET_PORT_INTERRUPT)] = RESPONSE_EXPECTED_FLAG_ALWAYS_TRUE;\n\t\tresponseExpected[IPConnection.unsignedByte(FUNCTION_SET_PORT_MONOFLOP)] = RESPONSE_EXPECTED_FLAG_FALSE;\n\t\tresponseExpected[IPConnection.unsignedByte(FUNCTION_GET_PORT_MONOFLOP)] = RESPONSE_EXPECTED_FLAG_ALWAYS_TRUE;\n\t\tresponseExpected[IPConnection.unsignedByte(FUNCTION_SET_SELECTED_VALUES)] = RESPONSE_EXPECTED_FLAG_FALSE;\n\t\tresponseExpected[IPConnection.unsignedByte(FUNCTION_GET_IDENTITY)] = RESPONSE_EXPECTED_FLAG_ALWAYS_TRUE;\n\t\tresponseExpected[IPConnection.unsignedByte(CALLBACK_INTERRUPT)] = RESPONSE_EXPECTED_FLAG_ALWAYS_FALSE;\n\t\tresponseExpected[IPConnection.unsignedByte(CALLBACK_MONOFLOP_DONE)] = RESPONSE_EXPECTED_FLAG_ALWAYS_FALSE;\n\n\t\tcallbacks[CALLBACK_INTERRUPT] = new CallbackListener() {\n\t\t\tpublic void callback(byte[] data) {\n\t\t\t\tByteBuffer bb = ByteBuffer.wrap(data, 8, data.length - 8);\n\t\t\t\tbb.order(ByteOrder.LITTLE_ENDIAN);\n\n\t\t\t\tchar port = (char)(bb.get());\n\t\t\t\tshort interruptMask = IPConnection.unsignedByte(bb.get());\n\t\t\t\tshort valueMask = IPConnection.unsignedByte(bb.get());\n\n\t\t\t\tfor(InterruptListener listener: listenerInterrupt) {\n\t\t\t\t\tlistener.interrupt(port, interruptMask, valueMask);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tcallbacks[CALLBACK_MONOFLOP_DONE] = new CallbackListener() {\n\t\t\tpublic void callback(byte[] data) {\n\t\t\t\tByteBuffer bb = ByteBuffer.wrap(data, 8, data.length - 8);\n\t\t\t\tbb.order(ByteOrder.LITTLE_ENDIAN);\n\n\t\t\t\tchar port = (char)(bb.get());\n\t\t\t\tshort selectionMask = IPConnection.unsignedByte(bb.get());\n\t\t\t\tshort valueMask = IPConnection.unsignedByte(bb.get());\n\n\t\t\t\tfor(MonoflopDoneListener listener: listenerMonoflopDone) {\n\t\t\t\t\tlistener.monoflopDone(port, selectionMask, valueMask);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}", "public static void main(String[]args)\n {\n /*prompt user to input non-negative integer*/\n \n System.out.println(\"Please enter a non-negative integer value:\");\n Scanner keyboard = new Scanner(System.in);\n \n int input = keyboard.nextInt();\n \n /*keep prompting user until they enter an acceptable (non-negative) \n value*/\n if (input < 0)\n { while(input < 0)\n {\n System.out.println(\"Please enter a non-negative integer value:\");\n input = keyboard.nextInt();\n }\n }\n \n /* call convertToBinary on the acceptable integer that is input by the user, store \n this binary value in an int variable named binaryConversion\n */\n int binaryConversion = convertToBinary(input);\n \n //System.out.println(\"Binary conversion is: \" + binaryConversion);\n \n /* to easily count the number of ones in the binary number, convert \n binaryConversion to a string using Integer wrapper class*/\n \n String binaryString = Integer.toString(binaryConversion);\n //System.out.println(\"Binary string is: \" + binaryString);\n \n /*initialize number of ones to 0, then accumulate using a for loop; check \n each index value using the string method charAt(index) to see if the character\n at that index is a 1; if so, add one to numOnes*/\n \n int numOnes = 0;\n for (int i = 0; i < binaryString.length();i ++)\n { if (binaryString.charAt(i) == '1')\n numOnes ++;\n }\n \n /*if numOnes is divisible by two, it's even, which means the input decimal \n number has even parity\n */\n if (numOnes%2 == 0)\n System.out.println(\"The number \" + input + \" has EVEN parity.\");\n \n /*if numOnes is NOT divisible by two, it's odd, which means the input decimal \n number has ODD parity\n */\n \n else \n System.out.println(\"The number \" + input + \" has ODD parity.\");\n }", "public void testNIO_int_array() throws Exception {\n int[] intArray = new int[8];\n IntBuffer ib = IntBuffer.wrap(intArray);\n intBufferTest(ib);\n }", "private Bits32() {\r\n }", "@Test\r\n\tpublic void testPositiveGenerateIntegerSequences_8() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tcollector.checkThat(roc.generateIntegerSequences(4, LENGTH, MIN, MAX, REPLACEMENT, BASE), notNullValue());\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "private final int initializeInt() {\n\t\treturn 0;\r\n\t}", "public byte[] initialValue() {\n return new byte[]{(byte) -1, (byte) -40, (byte) -1, (byte) -37, (byte) 0, (byte) 67, (byte) 0, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -64, (byte) 0, (byte) 17, (byte) 8, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 3, (byte) 1, (byte) 34, (byte) 0, (byte) 2, (byte) 17, (byte) 0, (byte) 3, (byte) 17, (byte) 0, (byte) -1, (byte) -60, (byte) 0, (byte) 31, (byte) 0, (byte) 0, (byte) 1, (byte) 5, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) -1, (byte) -60, (byte) 0, (byte) -75, (byte) 16, (byte) 0, (byte) 2, (byte) 1, (byte) 3, (byte) 3, (byte) 2, (byte) 4, (byte) 3, (byte) 5, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 0, (byte) 1, (byte) 125, (byte) 1, (byte) 2, (byte) 3, (byte) 0, (byte) 4, (byte) 17, (byte) 5, (byte) 18, (byte) 33, (byte) 49, (byte) 65, (byte) 6, (byte) 19, (byte) 81, (byte) 97, (byte) 7, (byte) 34, (byte) 113, (byte) 20, (byte) 50, (byte) -127, (byte) -111, (byte) -95, (byte) 8, (byte) 35, (byte) 66, (byte) -79, (byte) -63, (byte) 21, (byte) 82, (byte) -47, (byte) -16, (byte) 36, (byte) 51, (byte) 98, (byte) 114, (byte) -126, (byte) 9, (byte) 10, (byte) 22, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 37, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 52, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) -125, (byte) -124, (byte) -123, (byte) -122, (byte) -121, (byte) -120, (byte) -119, (byte) -118, (byte) -110, (byte) -109, (byte) -108, (byte) -107, (byte) -106, (byte) -105, (byte) -104, (byte) -103, (byte) -102, (byte) -94, (byte) -93, (byte) -92, (byte) -91, (byte) -90, (byte) -89, (byte) -88, (byte) -87, (byte) -86, (byte) -78, (byte) -77, (byte) -76, (byte) -75, (byte) -74, (byte) -73, (byte) -72, (byte) -71, (byte) -70, (byte) -62, (byte) -61, (byte) -60, (byte) -59, (byte) -58, (byte) -57, (byte) -56, (byte) -55, (byte) -54, (byte) -46, (byte) -45, (byte) -44, (byte) -43, (byte) -42, (byte) -41, (byte) -40, (byte) -39, (byte) -38, (byte) -31, (byte) -30, (byte) -29, (byte) -28, (byte) -27, (byte) -26, (byte) -25, (byte) -24, (byte) -23, (byte) -22, (byte) -15, (byte) -14, (byte) -13, (byte) -12, (byte) -11, (byte) -10, (byte) -9, (byte) -8, (byte) -7, (byte) -6, (byte) -1, (byte) -60, (byte) 0, (byte) 31, (byte) 1, (byte) 0, (byte) 3, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) -1, (byte) -60, (byte) 0, (byte) -75, (byte) 17, (byte) 0, (byte) 2, (byte) 1, (byte) 2, (byte) 4, (byte) 4, (byte) 3, (byte) 4, (byte) 7, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 1, (byte) 2, (byte) 119, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 17, (byte) 4, (byte) 5, (byte) 33, (byte) 49, (byte) 6, (byte) 18, (byte) 65, (byte) 81, (byte) 7, (byte) 97, (byte) 113, (byte) 19, (byte) 34, (byte) 50, (byte) -127, (byte) 8, (byte) 20, (byte) 66, (byte) -111, (byte) -95, (byte) -79, (byte) -63, (byte) 9, (byte) 35, (byte) 51, (byte) 82, (byte) -16, (byte) 21, (byte) 98, (byte) 114, (byte) -47, (byte) 10, (byte) 22, (byte) 36, (byte) 52, (byte) -31, (byte) 37, (byte) -15, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) -126, (byte) -125, (byte) -124, (byte) -123, (byte) -122, (byte) -121, (byte) -120, (byte) -119, (byte) -118, (byte) -110, (byte) -109, (byte) -108, (byte) -107, (byte) -106, (byte) -105, (byte) -104, (byte) -103, (byte) -102, (byte) -94, (byte) -93, (byte) -92, (byte) -91, (byte) -90, (byte) -89, (byte) -88, (byte) -87, (byte) -86, (byte) -78, (byte) -77, (byte) -76, (byte) -75, (byte) -74, (byte) -73, (byte) -72, (byte) -71, (byte) -70, (byte) -62, (byte) -61, (byte) -60, (byte) -59, (byte) -58, (byte) -57, (byte) -56, (byte) -55, (byte) -54, (byte) -46, (byte) -45, (byte) -44, (byte) -43, (byte) -42, (byte) -41, (byte) -40, (byte) -39, (byte) -38, (byte) -30, (byte) -29, (byte) -28, (byte) -27, (byte) -26, (byte) -25, (byte) -24, (byte) -23, (byte) -22, (byte) -14, (byte) -13, (byte) -12, (byte) -11, (byte) -10, (byte) -9, (byte) -8, (byte) -7, (byte) -6, (byte) -1, (byte) -38, (byte) 0, (byte) 12, (byte) 3, (byte) 1, (byte) 0, (byte) 2, (byte) 17, (byte) 3, (byte) 17, (byte) 0, (byte) 63, (byte) 0, (byte) -114, (byte) -118, (byte) 40, (byte) -96, (byte) 15, (byte) -1, (byte) -39};\n }", "private static BitSet makeBitSet( int... args ) {\n\tBitSet result = new BitSet( MAX_OPCODE + 1 ) ;\n\tfor (int value : args )\n\t result.set( value ) ;\n\treturn result ;\n }", "public Code()\n\t{\n\t\tbits = new ArrayList<Boolean>();\n\t}", "public ArrayListOfIntsWritable()\n {\n super();\n }", "@RepeatedTest(20)\n void transformtoBinaryTest() {\n assertEquals(bi.transformtoBinary(),bi);\n assertEquals(i.transformtoBinary(), new Binary(i.intToBinary(seed)));\n\n //Nulls\n assertEquals(f.transformtoBinary(),Null);\n assertEquals(st.transformtoBinary(),Null);\n assertEquals(bot.transformtoBinary(),Null);\n assertEquals(bof.transformtoBinary(),Null);\n assertEquals(Null.transformtoBinary(),Null);\n\n }", "public static void init() {\n init(block -> IntStream.range(0, 16));\n }", "public static int[] createZeroBasedSequence(int length) {\n\t\tint[] sequence = new int[length];\n\t\tfor (int i = 0; i < sequence.length; i++) {\n\t\t\tsequence[i] = i;\n\t\t}\n\t\treturn sequence;\n\t}", "static void findI1s(final int length, int[] B) {\r\n\t final long max = 1 << length;\r\n\t for (long i = 0; i < max; i++) {\r\n\t long currentNumber = i;\r\n\t final int[] buffer = new int[length];\r\n\t boolean[] I1 = new boolean[length]; // I1 to be passed to next method\r\n\t int bufferPosition = buffer.length;\r\n\t while (bufferPosition > 0) {\r\n\t buffer[--bufferPosition] = (int) (currentNumber & 1);\r\n\t currentNumber >>>= 1;\r\n\t }\r\n\t for(int x = 0; x < buffer.length; x++) {\r\n\t \tif(buffer[x] == 1) {\r\n\t \t\tI1[x] = true;\r\n\t \t}\r\n\t \telse {\r\n\t \t\tI1[x] = false;\r\n\t \t}\r\n\t \tSystem.out.print(buffer[x]);\r\n\t }\r\n\t\t System.out.println();\r\n\t }\r\n\t}", "public BinaryMatrixNew() {\n\t\t\tsuper(Matrixes.<R, C>newValidating(PredicateUtils.inBetween(0d, 1d)));\n\t\t}", "private Binomial(int n) {\n N = n;\n }", "public static void initIntegerArray(int[] arr) {\r\n\t\tRandom ra = new Random();\r\n\t\tfor (int i = 0; i < arr.length; i++) {\r\n\t\t\tarr[i] = ra.nextInt(arr.length); \r\n\t\t}\r\n\t\tfor (int i = 0; i < arr.length; i++) {\r\n\t\t\tif (arr[i] - ra.nextInt(arr.length) <5) {\r\n\t\t\t\tarr[i] = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public IntRAC() {\n\t\tcodebook = new ArrayList<int[]>();\n\t\tthis.threshold = 128;\n\t\tthis.nDims = -1;\n\t\tthis.totalSamples = 0;\n\t}", "public BitTwiddle() {\r\n\t\t}", "public static void main(int a) {\n// System.out.println(~43);\n int bit []=new int[8];\n for (int i = 7; i >=0;){\n\n\n\n }\n\n}", "private static int[] createArray() {\n\t\trnd = new Random();\r\n\t\trandomArray = new int[8];\r\n\t\tfor (int i = 0; i < 8; i++) {\r\n\t\t\trandomArray[i] = rnd.nextInt(45);\r\n\t\t}\r\n\t\treturn randomArray;\r\n\t}", "public Int() {\n this(0);\n }", "public LogicalVector(Boolean[] values) {\r\n this.values = new int[values.length];\r\n for (int i = 0; i != values.length; ++i) {\r\n this.values[i] = values[i] ? 1 : 0;\r\n }\r\n }", "public IntegerGenotype create() \r\n\t{\n\t\tIntegerGenotype genotype = new IntegerGenotype(1,3);\r\n\t\tgenotype.init(new Random(), Data.numeroCuardillas); \r\n\t\t\r\n\t\treturn genotype;\r\n\t}", "@Override\n int[] createInitialState(final byte[] nonce, int counter) {\n int[] state = new int[Snuffle.BLOCK_SIZE_IN_INTS];\n ChaCha20Base.setSigma(state);\n ChaCha20Base.setKey(state, key.getBytes());\n state[12] = counter;\n System.arraycopy(toIntArray(ByteBuffer.wrap(nonce)), 0, state, 13, nonceSizeInBytes() / 4);\n return state;\n }", "public AbstractBinaryInteraction() {\n\n\t}", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_8() {\n\t\tint i = 1;\r\n\t\t\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(4, LENGTH, MIN, MAX, REPLACEMENT, BASE, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[][].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "private static int[] arrayInitializer(int length) {\n int[] myArray = new int[length];\n Random rand = new Random();\n for (int i = 0; i < length; i++) {\n myArray[i] = rand.nextInt(1000);\n }\n return myArray;\n }", "public static int[][] init() {\n int[][] arr={\n {0,1,0,1,0,0,0},\n {0,0,1,0,0,1,0},\n {1,0,0,1,0,1,0},\n {0,0,1,0,0,1,0},\n {0,0,1,1,0,1,0},\n {1,0,0,0,0,0,0}\n };\n return arr;\n }", "protected void bInit()\r\n {\r\n \tSystem.out.println(\"|bInit| : expected_seq_num is: \"+expected_seq_num+\".\"); \r\n \tfor(int i=0;i<5;i++)\r\n \t\t{\r\n \t\t\tisAckedWindow[i] =ACK_NAKed;\r\n \t\t}\r\n \texpected_seq_num = FirstSeqNo;\r\n \tint check = makeCheckSum(FirstSeqNo,ACK_ACKed,DATA_EMPTY);\r\n \tpacketBuffer = new Packet (-1,ACK_ACKed,check,DATA_EMPTY);\r\n \tSystem.out.println(\"|bInit| : packet with seq number:\"+Integer.toString(packetBuffer.getSeqnum())+\" is stored in Buffer\"); \r\n \t//\tstate_receiver = STATE_WAIT_FOR_0_FROM_BELOW;\r\n }", "public void binarycon()\n \t {\n\n\t int i,j,k,t;\n \t int temp[]=new int[10];\n\t int m=0;\n for(i=0;i<600000;i++)\n binary[i]=0;\n int b[]=new int[32];\n int dum;\n dum=max;\n i=0;\n while(dum!=0)\n {\n b[i]=dum%2;\n i=i+1;\n dum/=2;\n }\n j=24-i;\n for(k=j,t=i-1;k<(i+j);k++,t--)\n binary[k]=b[t];\n dum=73;\n i=0;\n while(dum!=0)\n {\n b[i]=dum%2;\n i=i+1;\n dum/=2;\n }\n j=32-i;\n for(k=j,t=i-1;k<32;k++,t--)\n binary[k]= b[t];\n m=32;\n for( i=0 ; i < max ; i++)\n \t {\n j=0;\n while( bytes[i]!= 0 )\n {\n temp[j++]=bytes[i]%2;\n bytes[i]=bytes[i]/2;\n\n\n\n }\n for( k=0;k<8-j ; k++)\n binary[m++]=0;\n for(k=j-1; k >=0 ; k--)\n binary[m++]=temp[k];\n }\n \t maxbinary=m;\n }", "@Test\n public void testPropEdgeCaseBinaryData() throws Exception {\n /* Test with value greater than p = 1.0 */\n int[] result = NoiseGenerator.randomBinaryData(10,1.10);\n Assert.assertTrue(result == null);\n }", "public BinID3(String[] label, boolean[][] input, String[] output,\r\n\t\t\tString[] classes) {\r\n\t\tthis.input = input;\r\n\t\tthis.output = output;\r\n\t\tthis.label = label;\r\n\t\tthis.classes = classes;\r\n\t}", "public Weight( int[] init )\n {\n // Construct the array the same length\n // as that referenced by init.\n data = new int[init.length];\n\n // Copy values from the\n // input data to data.\n for ( int j = 0; j < init.length; j++ )\n {\n data[j] = init[j];\n }\n }", "public BinaryPulseNeuralFunction() {\n super();\n }", "public ICMGenerator() {\n super(Registry.ICM_PRNG);\n }", "public InnovationGenerator() {\n this.atomicInteger = new AtomicInteger();\n }", "public Happy_Number()\r\n\t{\r\n\t\tnumberHolder = new int[20];\r\n\t\tfor(int ii = 0; ii < numberHolder.length; ii++)\r\n\t\t{\r\n\t\t\tnumberHolder[ii] = 0;\r\n\t\t}\r\n\t}", "public boolean getZeroFlag() {\n // PROGRAM 1: Student must complete this method\n // return value is a placeholder, student should replace with correct return\n int zero = 0; //integer to keep track of how many '1's are in the output array\n for (int i = 0; i < output.length; i++) {\n if (output[i]) { //when we come across a 1, add 1 to the zero integer.\n zero += 1;\n }\n }\n if (zero > 0) { //if the method caught any '1's, then the output binary number is not 0.\n zeroFlag = false;\n } else {\n zeroFlag = true; //otherwise, it is\n }\n return zeroFlag; //return the zeroFlag\n }", "Bolsa(int n) {\r\n\t\tbolsa = new int[n];\r\n\t\tRandom rnd=new Random();\r\n\t\tbolsa[n-1] = 1;\r\n\t}", "public Code(ArrayList<Boolean> bits)\n\t{\n\t\tthis.bits = bits;\n\t}", "public FormatableBitSet(int numBits)\n \t{\n \t\tinitializeBits(numBits);\n \t}", "public Register(int size, int decimalData) {\r\n\r\n registerArray = new int[size];\r\n String stringBinary = Integer.toBinaryString(decimalData);\r\n while (stringBinary.length() < size) {\r\n stringBinary = \"0\" + stringBinary;\r\n }\r\n String[] stringArray = stringBinary.split(\"\");\r\n\r\n for (int i = 0; i < stringArray.length; i++) {\r\n registerArray[i] = Integer.parseInt(stringArray[i]);\r\n }\r\n }", "public static byte[] genIndividuo(int nB){\n byte nInd[] = new byte[nB];\n Random r = new Random();\n float aux;\n for(int i=0;i<nB;i++){\n aux = r.nextFloat();\n if(aux < 0.5)\n nInd[i] = 0;\n else\n nInd[i] = 1;\n }\n return nInd;\n }", "public ProbIA5Board(int []init) {\n board = new int[init.length];\n\n for (int i = 0; i< init.length; i++) {\n board[i] = init[i];\n }\n }", "@Test\n public void encodeAsIntArray()\n {\n int value = 5;\n BinaryEncoder encoder = new BinaryEncoder(16);\n int[] result = encoder.encodeAsIntArray(value);\n if (IS_VERBOSE)\n {\n System.out.println(\"result = \" + Arrays.toString(result));\n }\n assertNotNull(result);\n assertEquals(4, result.length);\n assertEquals(0, result[0]);\n assertEquals(1, result[1]);\n assertEquals(0, result[2]);\n assertEquals(1, result[3]);\n\n value = 5;\n encoder = new BinaryEncoder(0, 16, 2);\n result = encoder.encodeAsIntArray(value);\n if (IS_VERBOSE)\n {\n System.out.println(\"result = \" + Arrays.toString(result));\n }\n assertNotNull(result);\n assertEquals(3, result.length);\n assertEquals(0, result[0]);\n assertEquals(1, result[1]);\n assertEquals(0, result[2]);\n\n value = 5;\n encoder = new BinaryEncoder(0, 8, 0.1);\n result = encoder.encodeAsIntArray(value);\n if (IS_VERBOSE)\n {\n System.out.println(\"result = \" + Arrays.toString(result));\n }\n assertNotNull(result);\n assertEquals(7, result.length);\n assertEquals(0, result[0]);\n assertEquals(1, result[1]);\n assertEquals(1, result[2]);\n assertEquals(0, result[3]);\n assertEquals(0, result[4]);\n assertEquals(1, result[5]);\n assertEquals(0, result[6]);\n }", "public SequenceNumberTest() {}", "public DynamicArray() {\n this(16);\n }", "public Climber (int motorIDInput) {\n // speed = Robot.m_oi.getSpeed();\n speed = 0.0;\n climbState = 0;\n\n talonMotor = new WPI_TalonSRX(motorIDInput);\n talonMotor.setInverted(false);\n\n if (printDebug) {\n System.out.println(\"Climb: initialized constructor\");\n }\n }", "private static int createBitVector(String str) {\n\t\tint bitVector = 0;\n\t\tfor(char c : str.toCharArray()) {\n\t\t\tint x = getCharNum(c);\n\t\t\tbitVector = toggle(bitVector, x);\n\t\t}\n\t\treturn bitVector;\n\t}", "private byte[] intToBits(int number, int n) {\n\t\tbyte[] bits = new byte[n];\n\t\t\n\t\tString bitString = Integer.toBinaryString(number);\n\t\twhile (bitString.length() < n) {\n\t\t\tbitString = \"0\" + bitString;\n\t\t}\n\t\t\n\t\tfor(int i = 0, maxLen = bits.length; i < maxLen; i++) {\n\t\t\tbits[i] = (byte) (bitString.charAt(i) == 1 ? 1 : 0);\n\t\t}\n\t\t\n\t\treturn bits;\n\t}", "public IntegerSetTest (Integer[][] input) { \r\n\t \r\n\t\tthis.list1 = input[0]; \r\n\t\tthis.unique = input[1];\r\n\t\tthis.list2 = input[2];\r\n\t\tthis.unique2 = input[3];\r\n\t\tthis.intersection = input[4];\r\n\t\tthis.union = input[5];\r\n\t\t}", "public static void randomInit(int r) { }", "public Register(int size, int[] intArrData) {\r\n\r\n registerArray = new int[size];\r\n\r\n for (int i = 0; i < intArrData.length; i++) {\r\n registerArray[i] = intArrData[i];\r\n }\r\n }", "public Register() {\n\t\tr = new int[32];\n\t\tfor(int i = 0; i < r.length; i++)\n\t\t\tr[i] = 0;\n\t\tHI = 0;\n\t\tLO = 0;\n\t\tpc = 0;\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n bin1 = new hellofx.Bin();\n bin3 = new hellofx.Bin();\n bin4 = new hellofx.Bin();\n bin5 = new hellofx.Bin();\n bin10 = new hellofx.Bin();\n bin12 = new hellofx.Bin();\n bin14 = new hellofx.Bin();\n bin15 = new hellofx.Bin();\n bin16 = new hellofx.Bin();\n bin17 = new hellofx.Bin();\n bin18 = new hellofx.Bin();\n bin20 = new hellofx.Bin();\n bin22 = new hellofx.Bin();\n bin23 = new hellofx.Bin();\n bin24 = new hellofx.Bin();\n bin25 = new hellofx.Bin();\n bin26 = new hellofx.Bin();\n bin27 = new hellofx.Bin();\n bin28 = new hellofx.Bin();\n bin29 = new hellofx.Bin();\n bin30 = new hellofx.Bin();\n bin32 = new hellofx.Bin();\n bin33 = new hellofx.Bin();\n bin34 = new hellofx.Bin();\n bin35 = new hellofx.Bin();\n bin11 = new hellofx.Bin();\n bin13 = new hellofx.Bin();\n bin19 = new hellofx.Bin();\n bin21 = new hellofx.Bin();\n bin31 = new hellofx.Bin();\n bin36 = new hellofx.Bin();\n bin37 = new hellofx.Bin();\n bin38 = new hellofx.Bin();\n bin39 = new hellofx.Bin();\n bin40 = new hellofx.Bin();\n bin41 = new hellofx.Bin();\n bin42 = new hellofx.Bin();\n bin43 = new hellofx.Bin();\n bin44 = new hellofx.Bin();\n bin45 = new hellofx.Bin();\n bin46 = new hellofx.Bin();\n bin47 = new hellofx.Bin();\n bin48 = new hellofx.Bin();\n bin49 = new hellofx.Bin();\n bin50 = new hellofx.Bin();\n bin51 = new hellofx.Bin();\n bin52 = new hellofx.Bin();\n bin53 = new hellofx.Bin();\n bin54 = new hellofx.Bin();\n bin55 = new hellofx.Bin();\n bin56 = new hellofx.Bin();\n bin57 = new hellofx.Bin();\n bin58 = new hellofx.Bin();\n bin59 = new hellofx.Bin();\n bin60 = new hellofx.Bin();\n bin61 = new hellofx.Bin();\n bin62 = new hellofx.Bin();\n bin63 = new hellofx.Bin();\n bin64 = new hellofx.Bin();\n bin65 = new hellofx.Bin();\n bin66 = new hellofx.Bin();\n bin67 = new hellofx.Bin();\n bin68 = new hellofx.Bin();\n bin69 = new hellofx.Bin();\n bin70 = new hellofx.Bin();\n bin71 = new hellofx.Bin();\n bin72 = new hellofx.Bin();\n bin73 = new hellofx.Bin();\n bin74 = new hellofx.Bin();\n bin75 = new hellofx.Bin();\n bin76 = new hellofx.Bin();\n bin77 = new hellofx.Bin();\n bin78 = new hellofx.Bin();\n bin79 = new hellofx.Bin();\n bin80 = new hellofx.Bin();\n bin81 = new hellofx.Bin();\n bin82 = new hellofx.Bin();\n bin83 = new hellofx.Bin();\n bin84 = new hellofx.Bin();\n bin85 = new hellofx.Bin();\n bin86 = new hellofx.Bin();\n bin87 = new hellofx.Bin();\n bin88 = new hellofx.Bin();\n bin89 = new hellofx.Bin();\n bin90 = new hellofx.Bin();\n bin91 = new hellofx.Bin();\n bin92 = new hellofx.Bin();\n bin93 = new hellofx.Bin();\n bin94 = new hellofx.Bin();\n bin95 = new hellofx.Bin();\n bin96 = new hellofx.Bin();\n bin97 = new hellofx.Bin();\n bin98 = new hellofx.Bin();\n bin99 = new hellofx.Bin();\n bin100 = new hellofx.Bin();\n bin101 = new hellofx.Bin();\n bin102 = new hellofx.Bin();\n bin103 = new hellofx.Bin();\n bin104 = new hellofx.Bin();\n bin105 = new hellofx.Bin();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setPreferredSize(new java.awt.Dimension(666, 489));\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin66, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin68, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin71, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin73, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin74, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin76, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin84, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin86, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin90, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin92, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin93, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin95, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin100, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin101, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin103, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin70, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin63, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin75, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin60, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(bin88, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin81, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(bin94, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin72, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin102, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin99, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin56, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin57, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin59, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin62, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin64, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin67, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin78, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin80, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin87, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin91, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin96, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin98, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin79, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin82, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin89, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin58, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin105, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin65, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin104, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(bin83, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin69, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(bin97, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin61, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin85, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin77, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin26, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin27, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin29, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin32, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin33, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin35, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(bin24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(bin28, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin34, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin30, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin36, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin38, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin39, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin41, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin44, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin46, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin50, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin52, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin53, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin55, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin45, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin47, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin51, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin40, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(bin48, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin42, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(bin54, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin37, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(bin49, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bin43, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin26, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin27, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin28, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin29, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin30, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin32, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin33, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin34, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin35, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin38, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin39, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin40, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin41, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin36, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin37, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin52, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin53, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin54, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin55, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin42, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin44, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin46, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin48, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin50, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin43, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin45, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin47, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin49, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin51, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin60, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin73, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin74, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin75, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin76, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin63, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin66, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin68, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin70, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin71, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin72, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin92, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin93, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin94, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin95, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin81, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin84, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin86, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin88, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin90, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin99, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin100, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin101, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin102, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin103, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin104, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin62, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin64, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin65, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin67, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin105, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin56, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin57, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin58, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin59, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin61, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin91, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin96, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin97, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin98, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin69, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin78, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin80, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin83, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin87, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bin77, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin79, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin82, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin85, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bin89, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 414, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 414, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n\n pack();\n }", "public static void main(String[] args) throws IOException {\r\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n int t = Integer.parseInt(br.readLine().trim());\r\n while (t > 0) {\r\n\r\n int n = Integer.parseInt(br.readLine().trim());\r\n\r\n System.out.println(\"output: \"+setBits(n));\r\n\r\n t--;\r\n }\r\n }", "private void createFlags() {\n if (flags!=null) return;\n flags = JCSystem.makeTransientBooleanArray(NUMFLAGS, JCSystem.CLEAR_ON_RESET);\n setValidatedFlag(false);\n }", "protected void setAll() {\n for (int i=0; i <= (Numbers.INTEGER_WIDTH*8-2); i++) {\n \tthis.setBitAt(i);\n } \t\n }", "@Override\n\tprotected void initDefaultCommand() {\n\t\tfor(int i=0; i<10; i++){\n\t\t\tlimSwitches[i]= new DigitalInput(i);\n\t\t}\n\t\t\n\t\tlowerLeft.setInverted(true);\n\t\tintakeMotor.setInverted(true);\n\t\t\n\t}", "public void build() {\n boolean debugGates = this.debugDepth > 0 ? this.inDebuggerMode : false;\n if (this.outputs.size() != 1 << this.input.getSize()) {\n throw new BitStreamInputSizeMismatch(this);\n }\n\n List<BitStream> splitterInput = new ArrayList<>();\n splitterInput.add(this.input);\n\n List<BitStream> splitterOutput = new ArrayList<>();\n for (int i = 0; i < this.input.getSize(); i++) {\n splitterOutput.add(new BitStream(1));\n }\n\n Splitter inputSplitter = new Splitter(splitterInput, splitterOutput, \"inputSplitter\", debugGates);\n\n for (int i = 0; i < this.outputs.size(); i++) {\n List<BitStream> andInputs = new ArrayList<>();\n for (BitStream splitterOut : splitterOutput) {\n andInputs.add(splitterOut);\n }\n\n String indexInBinary = DataConverter.convertUnsignedDecToBin(i);\n indexInBinary = this.padZeros(indexInBinary, this.input.getSize());\n\n for (int j = indexInBinary.length() - 1; j >= 0; j--) {\n if (indexInBinary.charAt(j) == '0') {\n BitStream notOut = new BitStream(1);\n NOT not = new NOT(andInputs.get(j), notOut,\n \"not\" + i + (indexInBinary.length() - 1 - j), debugGates);\n andInputs.set(j, notOut);\n }\n }\n\n MultiAND and = new MultiAND(andInputs, this.outputs.get(i), \"and\" + i, debugGates);\n }\n }", "@Test\n public void testConstructor3()\n {\n final BinaryEncoder encoder = new BinaryEncoder(0, 16, 1.0);\n assertThat(encoder.getMin(), is(0.0));\n assertThat(encoder.getMax(), is(16.0));\n assertThat(encoder.getDelta(), is(1.0));\n assertThat(encoder.getLength(), is(4));\n }", "public void initialize(IHD ihd_1){\n ihd1 = ihd_1;\n ihd2 = ihd_1;\n input1 = 0;\n input2 = 0;\n output1 = false;\n output2 = false;\n IHD_limit = 5;\n }", "public static void main(String[] args) {\n\t\tint[] binary=new int[16];\r\n\t\t// 0,1만 저장\r\n\t\t// 사용자가 요청한 정수 \r\n\t\tint user=0;\r\n\t\tint index=15; // 저장을 뒤에서부터 하겠음 -> 16 뒤부터라 index가 15 // 배열제어\r\n\t\t\r\n\t\tScanner scan=new Scanner(System.in);\r\n\t\tSystem.out.print(\"정수 입력(0~32767):\");\r\n\t\tuser=scan.nextInt();\r\n\t\tSystem.out.println(\"======= Lib이용 ======\");\r\n\t\tSystem.out.println(Integer.toBinaryString(user));\r\n\t\t// 라이브러리 만들어서 처리 \r\n\t\t\r\n\t\twhile(true) // 종료시점 => break 없으면 무한루프 돌아감\r\n\t\t{\r\n\t\t\tbinary[index]=user%2; // 2로나누고 \r\n\t\t\tuser=user/2; // 1/2=0 이런식으로 다시 저장하는게 2진법 구하는방법\r\n\t\t\tif(user==0)break; // 0이되면 끝낸다\r\n\t\t\tindex--;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// 결과 출력\r\n\t\tfor(int i=0;i<16;i++) {\r\n\t\t\tif(i%4==0 && i!=0) // i%4==0 && i!=0 이런 조건주는 연습을 해라 ★★\r\n\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\tSystem.out.print(binary[i]);\t\t\t\r\n\t\t\t// 4개 출력하고 공백으로 띄어라 (0%4=0)\r\n\t\t}\r\n\t\r\n\t}", "public static IntegerVarArray make(int[] buffer) {\n\t\treturn new IntegerVarArray(buffer);\n\t}", "public void setInBin(int n) {\n inBin=Translate.decTobinN(n, 4);\n }", "private RunLengthEncoder() {\r\n }", "@Override\n protected void initialize() {\n armPID_SetZero.setSetpoint(0);\n armPID_SetZero.getPIDController().setPID(0.00003, 0.00000005, 0.000025);\n armPID_SetZero.setOutputRange(-0.475, 0.475);\n armPID_SetZero.disable();\n\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\r\n\tpublic void testPositiveGenerateIntegerSequences_9() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tint[][] response = roc.generateIntegerSequences(4, LENGTH, MIN, MAX, \r\n\t\t\t\t\t\tREPLACEMENT, identifier);\r\n\t\t\t\tcollector.checkThat(response, notNullValue());\r\n\t\t\t\t\r\n\t\t\t\tint[][] response2 = roc.generateIntegerSequences(4, LENGTH, MIN, MAX, \r\n\t\t\t\t\t\tREPLACEMENT, identifier);\r\n\t\t\t\tcollector.checkThat(response, equalTo(response2));\r\n\t\t\t\t\r\n\t\t\t\tresponse = roc.generateIntegerSequences(4, LENGTH, MIN, MAX, \r\n\t\t\t\t\t\tREPLACEMENT, date);\r\n\t\t\t\tcollector.checkThat(response, notNullValue());\r\n\t\t\t\t\r\n\t\t\t\tresponse2 = roc.generateIntegerSequences(4, LENGTH, MIN, MAX, \r\n\t\t\t\t\t\tREPLACEMENT, date);\r\n\t\t\t\tcollector.checkThat(response, equalTo(response2));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "BaseConnet(){\n// pool = ThreadPool.getInstance();\n// sc = SendCommand.getInstance();\n HEART_CMD = new byte[]{\n\n WiStaticComm.UTRAL_H0,\n WiStaticComm.UTRAL_H1,\n WiStaticComm.UTRAL_H2,\n 0x00,\n 0x13,\n 0x00,\n 0x06,\n 0x01,\n 0x00,\n 0x00,\n 0x52,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x0A,\n (byte) 0xF4,\n (byte) 0xAA,\n 0x40\n };\n byte checkSum = HEART_CMD[0];\n for (int i = 1; i < 19; i++)\n {\n if (i != 19 - 5)\n checkSum ^= HEART_CMD[i];\n\n }\n HEART_CMD[19 - 5] = checkSum;\n }", "public ulsinArray(int length) {\n intArr = new int[length];\n }", "public static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\r\n\t\t//변수\r\n\t\tint input=0; // 사용자 입력한 값을 받는 변수\r\n\t\tSystem.out.println(\"정수 입력:\");\r\n\t\tinput=scan.nextInt();\r\n\t\t//System.out.println(Integer.toBinaryString(input));\r\n\t\tint[] binary=new int[16];\r\n\t\t// 배열의 위치\r\n\t\tint index=15; // 배열 => 값을 변경 ==> 위치 (뒤(length-1),앞(0))\r\n\t\t/*\r\n\t\t * \t10%2 ==> 0\r\n\t\t * \t5%2==1\r\n\t\t * \t2%2==0\r\n\t\t * \t1%2==1 1/2=0\r\n\t\t */\r\n\t\twhile(true)\r\n\t\t{\r\n\t\t\tbinary[index]=input%2;\r\n\t\t\tinput=input/2; // input/=2\r\n\t\t\tif(input==0) // 1/2=0\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tindex--;\r\n\t\t}\r\n\t\t\r\n\t\t// 출력\r\n\t\tfor(int i=0;i<16;i++)\r\n\t\t{\r\n\t\t\tif(i%4==0 && i!=0)\r\n\t\t\t\tSystem.out.print(\" \");\r\n\t\t\tSystem.out.print(binary[i]);\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws Exception {\n /////\n /////\n /////\n /////\n /////\n ///// the easy way \n /////\n /////\n /////\n /////\n /////\n /////\n /////\n /////\n\n Scanner inputs = new Scanner(System.in);\n System.out.println(\"enter a number to to turn into binary form\");\n int n ;\n n = inputs.nextInt();\n int[] b= new int[100];\n int i =0;\n while(n > 0)\n \n {\n b[i++] = n%2;\n n = n/2;\n } \n b = Arrays.copyOfRange(b, 0, i-1);\n System.out.println(Arrays.toString(b).replace(\",\", \"\").replace(\"[\", \"\").replace(\"]\", \"\") );\n // System.out.println(\"at first array was \");\n // System.out.println(\"array reverse is \");\n\n // /////\n // /////\n // /////\n // /////\n // /////\n // /////\n // ///// the HARD way \n // /////\n // /////\n // /////\n // /////\n // /////\n // /////\n // /////\n // /////\n // for (int i = 0; i < n/2; i++) {\n // int x = data[i];\n // int y = data[n-i-1];\n // x = x - y;\n // y =x+y;\n // x = y-x;\n // data[i] = x;\n // data[n-i-1] = y;\n // }\n \n // System.out.println(\"HARD IS \"+Arrays.toString(data) );\n\n\n inputs.close();\n\n }", "public static int[] constructor(int n) {\r\n int v[] = new int[n];\r\n\r\n for (int i = 0; i < v.length; i++) {\r\n int dato = (int) (Math.random() * 20);\r\n v[i] = dato;\r\n }\r\n return v;\r\n }" ]
[ "0.6007201", "0.59400815", "0.5789918", "0.5785027", "0.57398343", "0.56520087", "0.53824604", "0.53664917", "0.5286629", "0.5279097", "0.5231621", "0.52277476", "0.5200973", "0.51964515", "0.5189674", "0.51553047", "0.51188374", "0.5023905", "0.5020833", "0.50037587", "0.4998074", "0.49945873", "0.49908906", "0.4977745", "0.49730867", "0.49701127", "0.4964741", "0.49585178", "0.4940174", "0.4939549", "0.49348423", "0.49191844", "0.49060717", "0.4883763", "0.4878474", "0.48765835", "0.48645416", "0.48552975", "0.4852789", "0.48439702", "0.48383695", "0.483266", "0.48259073", "0.48245198", "0.48225328", "0.4796516", "0.4792701", "0.477045", "0.47693768", "0.47635612", "0.4756587", "0.47512716", "0.4749454", "0.47425485", "0.47409165", "0.47364756", "0.47257686", "0.47243115", "0.47230285", "0.47104228", "0.4708298", "0.47076997", "0.46951166", "0.46938515", "0.4687408", "0.46806043", "0.46683127", "0.46605214", "0.46540835", "0.4652135", "0.46511143", "0.4650546", "0.46470204", "0.4645037", "0.46383855", "0.4636357", "0.46190965", "0.46185622", "0.46110564", "0.4606288", "0.46046144", "0.4602342", "0.45997778", "0.45851827", "0.45847726", "0.45837387", "0.4581745", "0.45779282", "0.4574359", "0.45725536", "0.4566915", "0.45404", "0.4540049", "0.4535535", "0.4532639", "0.45295793", "0.4526643", "0.45260587", "0.45233217", "0.45230627" ]
0.6796785
0
Sets the value of inputA.
public void setInputA(boolean[] b) { // PROGRAM 1: Student must complete this method //if param array != INT_LENGTH, throw exception if (b.length != INT_LENGTH) { throw new IllegalArgumentException("Invalid array length"); } else { //otherwise, place the parameter array's data into inputA for (int i = 0; i < b.length; i++) { inputA[i] = b[i]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setValue(A value) {this.value = value; }", "public void setInput(Input input) {\n this.input = input;\n }", "public void setInput(boolean inputA, boolean inputB) {\n mAndGate.setInput(inputA, inputB);\n mXorGate.setInput(inputA, inputB);\n }", "public void setInput(String input);", "public void setA(double a){\n this.a=a;\n }", "private void setA(float dA) {\n EditText field = (EditText) findViewById(R.id.valA);\n SeekBar sb = (SeekBar) findViewById(R.id.seekA);\n\n a = dA;\n if (a <= 0) {\n a = 0.001f;\n }\n\n field.setText(String.valueOf(a));\n if (a * 1000 - 1 <= sb.getMax()) {\n sb.setProgress((int)(a * 1000 - 1));\n }\n }", "public void SetA(byte num) {\r\n\t\tm_numA = num;\r\n\t}", "@Override\n\tpublic void setInput(Input arg0) {\n\t\t\n\t}", "@Override\n\tpublic void setInput(Input arg0) {\n\n\t}", "public void setA(double value) {\n this.a = value;\n }", "public void setInput1(int input1) {\n this.input1 = input1;\n }", "public Builder setA(int value) {\n \n a_ = value;\n onChanged();\n return this;\n }", "public Builder setA(int value) {\n \n a_ = value;\n onChanged();\n return this;\n }", "public void setGivenNum(double input) {\n givenNum = input;\n }", "public void setInput(String input) { this.input = input; }", "public void setInput(Input param) {\r\n localInputTracker = param != null;\r\n\r\n this.localInput = param;\r\n }", "public void setStateA(long stateA) {\n this.stateA = stateA;\n }", "public void setA ( boolean a ) {\n\n\tthis.a = a;\n }", "public void setX(int a)\n {\n x = a;\n }", "public void setInputValue(int inputValue) {\n\t\tif (inputValue < 0) {\n\t\t\tthis.setError(1);\n\t\t\tthis.setProcessable(false);\n\t\t} else {\n\t\t\tthis.inputValue = inputValue;\n\n\t\t}\n\n\t}", "public void setInput(InputHandler input) {\r\n\t\tthis.input = input;\r\n\t}", "public void setInput(String input){\n this.input = input;\n }", "synchronized void giveInput(int input) {\n this.input = input;\n inputGiven = true;\n notifyAll();\n }", "public abstract void setInput(boolean value);", "public void setInput(String M)\t\n\t{\t//start of setInput method\n\t\tinputMsg = M;\n\t}", "public void setA1(int a1)\n {\n this.a1 = a1;\n }", "public void setInput( float inputs[] ) {\n\t\t// Put input assignment code here\n }", "public void setAOA(float AOA);", "public void setA(final String a) {\r\n if (!OpbComparisonHelper.isEqual(this.a, a)) {\r\n // If the new value is different, save it\r\n this.a = a;\r\n // and make the \"on change\" calls\r\n aChanged();\r\n }\r\n }", "public void setOperandA(int val);", "public void setInput1(final String input1) {\n this.input1 = input1;\n }", "public void setInput(String input) {\n\t\t\tthis.input = input;\n\t\t}", "public Builder setA(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n a_ = value;\n onChanged();\n return this;\n }", "public Builder setA(float value) {\n bitField0_ |= 0x00000001;\n a_ = value;\n onChanged();\n return this;\n }", "public void setInput(byte[] acImageR, byte[] acImageG, byte[] acImageB, byte[] acImageA) {\r\n super.setInput(acImageR, acImageG, acImageB, acImageA);\r\n\r\n // Reset the intensity image which corresponds to the RGB channels\r\n // so that it can be recomputed.\r\n m_acImageI = null;\r\n\r\n // Input color values are scaled by alpha values representing opacity.\r\n for (int i = 0; i < acImageA.length; i++) {\r\n m_acImageR[i] = (byte) ( ( (int) (m_acImageR[i] & 0x0ff)) * ( (int) (m_acImageA[i] & 0x0ff)) / 255);\r\n m_acImageG[i] = (byte) ( ( (int) (m_acImageG[i] & 0x0ff)) * ( (int) (m_acImageA[i] & 0x0ff)) / 255);\r\n m_acImageB[i] = (byte) ( ( (int) (m_acImageB[i] & 0x0ff)) * ( (int) (m_acImageA[i] & 0x0ff)) / 255);\r\n }\r\n }", "public void setInput(byte[] input) {\n this.input = input;\n }", "public void setNodeA(int x){\n this.nodeA = x;\n }", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public void setInput(boolean input) {\n this.input = input;\n }", "public void setAceValue()\n {\n Scanner scanner = new Scanner(System.in); // Create a Scanner object\n System.out.print(\"Do you want the value of the Ace cards to be 1 or 11? \");\n aceValue = scanner.nextInt(); // Read user input\n }", "void setInput(com.indosat.eai.catalist.standardInputOutput.DummyInputType input);", "public void setA(Polynomial a){\n this.a = a;\n }", "public void setDataA(LocalDate dataA) \r\n\t\t{\r\n\t\t\tDataA = dataA;\r\n\t\t}", "public void setInputNum(Integer inputNum) {\r\n this.inputNum = inputNum;\r\n }", "public void setInput(int value) {\n\t\tnumberInputField.setValue(value);\n\t}", "public void set(int i, A o);", "void setValue(V value);", "public abstract void inputChange( int value );", "public static void setInput(Input i) {\r\n \tif (input!=null)\r\n \t\tinput.removeListener(INPUT_LISTENER);\r\n input = i;\r\n input.removeListener(INPUT_LISTENER);\r\n input.addPrimaryListener(INPUT_LISTENER);\r\n }", "protected abstract void setValue(V value);", "@Override\n\tpublic void set() {\n\t\tSystem.out.println(\"A==========set\");\n\t}", "ListeningFuture<Boolean> setInput(String input);", "public void setRealCell(String inputVal){\n\t\tuserInput = inputVal;\n\t}", "public void setValue(T element) {\n\t\t\n\t}", "public void setSideA(double sideA)\r\n\t{\r\n\t\tthis.sideA=sideA;\r\n\t\t\r\n\t}", "public V setValue(V value);", "public void setInput(double x)\n {\n if(domain.contains(x))\n this.x = x;\n else\n throw new BadParameterException(\"The input value \"+x+\" was rejected \"\n + \"as it is outside of the domain for this input: \"\n + \"[\"+domain.getLeft()+\", \"+domain.getRight()+\"].\");\n }", "public void set(float signal);", "void setElementValue(SetElementValue cmd);", "public abstract boolean setValue(Value value, boolean asAssignment);", "void setValue(int value);", "public void setValue(AXValue value) {\n this.value = value;\n }", "public void setInputUrlValue(String value){\n WebElement urlField = driver.findElement(inputUrlLocator); \n setValue(urlField, value);\n \n }", "protected void forwardToInput(T value) {\n inputModel.setValue(value);\n }", "private void passB() {\n // PROGRAM 1: Student must complete this method\n //place inputB data into output\n for (int i = 0; i < output.length; i++) {\n output[i] = inputB[i];\n }\n }", "public abstract void setValue(int value);", "@Override // kotlin.jvm.functions.Function0\n public Unit invoke() {\n RdsInputItemPresenterImpl.access$setupNewValue(this.a, this.b, \"\", this.c);\n return Unit.INSTANCE;\n }", "void setAa(gov.nih.nlm.ncbi.www.CodeBreakDocument.CodeBreak.Aa aa);", "public void set(int[] ai);", "String setValue();", "public void set(String key, double valueInput) {\n\t\tset(key, Double.toString(valueInput));\n\t}", "public void setGpa(){\n System.out.println(\"Enter the student's GPA: \");\n this.gpa = input.nextDouble();\n }", "@Test\n public void testSetA() {\n final double expected[] = getMatrix().getA();\n final Matrix33d m = new Matrix33d();\n m.setA(Arrays.copyOf(expected, expected.length));\n for (int i = 0; i < expected.length; i++) {\n assertEquals(m.getA()[i], expected[i]);\n }\n }", "public void setXY(double anX, double aY) { setX(anX); setY(aY); }", "public abstract void setValue(T value);", "public void setValues() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tfor (int count = 0; count < data.size(); count++) {\n\t\t\tSystem.out.println(\"Enter an integer for grade #\" + (count+1) );\n\t\t\tdata.set(scan.nextInt(), count);\n\t\t}\n\t}", "public void setInput(int index, Condition condition) {\n Log.d(\"STATE\", \"SETTING INPUT\");\n if (inputs.size() > index) {\n inputs.set(index, condition);\n } else {\n inputs.add(condition);\n }\n }", "public Value(String inputValue) {\n this.inputValue = inputValue;\n }", "public void setValueToInputField(By locator, String value){\n\t\twebAction(locator).sendKeys(value);\n\t}", "void setValue(T value);", "void setValue(T value);", "public void setInputB(boolean[] b) {\n // PROGRAM 1: Student must complete this method\n //if param array != INT_LENGTH, throw exception\n if (b.length != INT_LENGTH) {\n throw new IllegalArgumentException(\"Invalid array length\");\n } else {\n //otherwise, place the parameter array's data into inputB\n for (int i = 0; i < b.length; i++) {\n inputB[i] = b[i];\n }\n }\n }", "@Override\r\n\t\tpublic void setAO(int address, int value) throws IOServiceException {\n\r\n\t\t}", "public void setValue(Object value);", "public void setTo( T a ) {\n if (a.getType() == getType())\n mat.setTo(a.getMatrix());\n else {\n setMatrix(a.mat.copy());\n }\n }", "public abstract double set\r\n ( DataID dID // input\r\n , double value // input\r\n );", "public void setCurrentInput(String currentInput){\n\t\tthis.currentInput = currentInput;\n\t}", "public int setValue (int val);", "public void setidInput(int idi) {\r\n idInput = idi;\r\n }", "public void setInIn(InputInteractions inIn) {\r\n\t\t// assegna le interazioni di input\r\n\t\tthis.InIn = inIn;\r\n\t}", "void setValue(double value);", "public void setInput(List<List<String>> input) {\n\t\ttableViewer.setInput(input);\n\t\tthis.input = input;\n\t\tfireTableModified();\n\t}", "@Override\r\n\tpublic void setValue(String x) {\r\n\t\tthis.elementWrapper.setAttribute(this.attribute, x);\r\n\t}", "public void setValue(int value);", "public void setInput(SVIResource in) throws Exception;", "public void setA2(int a2)\n {\n this.a2 = a2;\n }", "void setInternal(ATTRIBUTES attribute, Object iValue);", "public void setValue(Object value) { this.value = value; }", "public boolean setInput(ArrayList<Double> inputs){\n if(inputs.size() != inputSize)return false;\n this.inputs = inputs;\n return true;\n }", "public void setValue(int value)\n {\n // we have assumed value 1 for X and 10 for O\n this.value = value;\n }" ]
[ "0.70573723", "0.6414479", "0.6412719", "0.6384514", "0.6377362", "0.62760174", "0.62078065", "0.61888963", "0.61637926", "0.6157049", "0.6006681", "0.5949254", "0.5949254", "0.59142953", "0.5887061", "0.58558685", "0.58217704", "0.5809325", "0.5807091", "0.5796937", "0.5752082", "0.57412356", "0.573548", "0.57324517", "0.5713565", "0.56637025", "0.56519365", "0.5647732", "0.5600476", "0.55927974", "0.55879754", "0.55786455", "0.5574995", "0.55577266", "0.5506812", "0.54924005", "0.5485591", "0.54697996", "0.54595625", "0.5457859", "0.54525137", "0.5449005", "0.54249734", "0.5408446", "0.5406479", "0.53903073", "0.5372308", "0.53454095", "0.5336892", "0.5313467", "0.52874297", "0.5252481", "0.52386475", "0.523453", "0.5203651", "0.5199986", "0.5188363", "0.5175568", "0.5171716", "0.5166781", "0.5161228", "0.5155992", "0.51534885", "0.51386917", "0.5131699", "0.51283836", "0.51271063", "0.5124645", "0.51241046", "0.5120244", "0.51178557", "0.5114955", "0.51115274", "0.51084536", "0.5100807", "0.5097225", "0.5085138", "0.50837374", "0.5077273", "0.5075909", "0.5075909", "0.5070221", "0.50654864", "0.50616074", "0.5053537", "0.5045214", "0.5030814", "0.50292474", "0.5025051", "0.5016678", "0.5008669", "0.50074846", "0.5001921", "0.49953762", "0.4993172", "0.49907085", "0.4982102", "0.49815112", "0.49546844", "0.49536157" ]
0.60000706
11
Sets the value of inputB.
public void setInputB(boolean[] b) { // PROGRAM 1: Student must complete this method //if param array != INT_LENGTH, throw exception if (b.length != INT_LENGTH) { throw new IllegalArgumentException("Invalid array length"); } else { //otherwise, place the parameter array's data into inputB for (int i = 0; i < b.length; i++) { inputB[i] = b[i]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setInput(boolean inputA, boolean inputB) {\n mAndGate.setInput(inputA, inputB);\n mXorGate.setInput(inputA, inputB);\n }", "public void setB(double b){\n this.b=b;\n }", "private void passB() {\n // PROGRAM 1: Student must complete this method\n //place inputB data into output\n for (int i = 0; i < output.length; i++) {\n output[i] = inputB[i];\n }\n }", "public void setInputA(boolean[] b) {\n // PROGRAM 1: Student must complete this method\n //if param array != INT_LENGTH, throw exception\n if (b.length != INT_LENGTH) {\n throw new IllegalArgumentException(\"Invalid array length\");\n } else {\n //otherwise, place the parameter array's data into inputA\n for (int i = 0; i < b.length; i++) {\n inputA[i] = b[i];\n }\n }\n }", "public void setB(double value) {\n this.b = value;\n }", "public void setOperandB(int val);", "public void setBNumber(int B_numberIn){\n\t\tB_number = B_numberIn;\n\t}", "public void setValue(A value) {this.value = value; }", "public void setB_(double b_) {\n\t\tthis.b_ = b_;\n\t}", "public void setB(Polynomial b){\n this.b = b;\n }", "public void setB(boolean b) {\n\tthis.b = b;\n }", "public void setStateB(long stateB) {\n this.stateB = stateB;\n }", "public Builder setB(int value) {\n \n b_ = value;\n onChanged();\n return this;\n }", "public Builder setB(int value) {\n \n b_ = value;\n onChanged();\n return this;\n }", "public void SetB(byte num) {\r\n\t\tm_numB = num;\r\n\t}", "public Builder setB(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n b_ = value;\n onChanged();\n return this;\n }", "public void set(double inR, double inG, double inB) {\n\n\t\tthis.r = inR;\n\t\tthis.g = inG;\n\t\tthis.b = inB;\n\n\t}", "public void setB1(int b1)\n {\n this.b1 = b1;\n }", "public void setInput(Input input) {\n this.input = input;\n }", "private void setB(float dB) {\n EditText field = (EditText) findViewById(R.id.valB);\n SeekBar sb = (SeekBar) findViewById(R.id.seekB);\n\n b = dB;\n if (b < 1) {\n b = 1.0f;\n } else if (b > 2) {\n b = 2.0f;\n }\n\n field.setText(String.valueOf(b));\n\n if ((b - 1) * 100 <= sb.getMax()) {\n sb.setProgress((int)((b - 1) * 100));\n }\n }", "public abstract void setInput(boolean value);", "public void setInput(String input);", "@Override\n\tpublic void setInput(Input arg0) {\n\t\t\n\t}", "public void setInputValue(int inputValue) {\n\t\tif (inputValue < 0) {\n\t\t\tthis.setError(1);\n\t\t\tthis.setProcessable(false);\n\t\t} else {\n\t\t\tthis.inputValue = inputValue;\n\n\t\t}\n\n\t}", "public void setSideB(double sideB)\r\n\t{\r\n\t\tthis.sideB=sideB;\r\n\t\t\r\n\t}", "@Override\n\tpublic void setInput(Input arg0) {\n\n\t}", "public Builder setB(int value) {\n bitField0_ |= 0x00000001;\n b_ = value;\n onChanged();\n return this;\n }", "public void setB(String b) {\n this.b = b == null ? null : b.trim();\n }", "public void setInput(byte[] input) {\n this.input = input;\n }", "public void setInput2(int input2) {\n this.input2 = input2;\n }", "public Builder setB(float value) {\n bitField0_ |= 0x00000002;\n b_ = value;\n onChanged();\n return this;\n }", "public void setInput1(int input1) {\n this.input1 = input1;\n }", "public void setVariableB(int value, String comment) {\r\n if (value >=0 && value <= 127) {\r\n sliderB.setValue(value);\r\n labelB.setText(\" variableB = \" + value + \" \");\r\n variableB = value;\r\n }\r\n if (comment.length() > 18) {\r\n commentLabB.setText(\" \" + comment.substring(0, 16) + \"...\");\r\n } else commentLabB.setText(\" \" + comment +\" \");\r\n }", "abstract B setM1(M1 m1);", "abstract B setM1(M1 m1);", "public void setGivenNum(double input) {\n givenNum = input;\n }", "public void setInput(String M)\t\n\t{\t//start of setInput method\n\t\tinputMsg = M;\n\t}", "public void setInput(String input) { this.input = input; }", "public void setB2(int b2)\n {\n this.b2 = b2;\n }", "protected abstract void setValue(V value);", "public void setInput(byte[] acImageR, byte[] acImageG, byte[] acImageB, byte[] acImageA) {\r\n super.setInput(acImageR, acImageG, acImageB, acImageA);\r\n\r\n // Reset the intensity image which corresponds to the RGB channels\r\n // so that it can be recomputed.\r\n m_acImageI = null;\r\n\r\n // Input color values are scaled by alpha values representing opacity.\r\n for (int i = 0; i < acImageA.length; i++) {\r\n m_acImageR[i] = (byte) ( ( (int) (m_acImageR[i] & 0x0ff)) * ( (int) (m_acImageA[i] & 0x0ff)) / 255);\r\n m_acImageG[i] = (byte) ( ( (int) (m_acImageG[i] & 0x0ff)) * ( (int) (m_acImageA[i] & 0x0ff)) / 255);\r\n m_acImageB[i] = (byte) ( ( (int) (m_acImageB[i] & 0x0ff)) * ( (int) (m_acImageA[i] & 0x0ff)) / 255);\r\n }\r\n }", "B setM1(M1 m1);", "B setM1(M1 m1);", "public void setInput( float inputs[] ) {\n\t\t// Put input assignment code here\n }", "public void setOperandA(int val);", "public Input(final MatrixStore<Double> Q, final MatrixStore<Double> C, final MatrixStore<Double> A, final MatrixStore<Double> B) {\n\n super();\n\n myQ = Q;\n myC = C;\n myA = A;\n myB = B;\n }", "void setValue(V value);", "public void set(int addr, byte b) {\n data[addr - start] = b;\n }", "public void setInput(boolean input) {\n this.input = input;\n }", "public void setInput(String input){\n this.input = input;\n }", "public void setInput(InputHandler input) {\r\n\t\tthis.input = input;\r\n\t}", "synchronized void giveInput(int input) {\n this.input = input;\n inputGiven = true;\n notifyAll();\n }", "public void B(m0 m02) {\n this.n = m02;\n synchronized (this) {\n long l10 = this.u;\n long l11 = 8;\n this.u = l10 |= l11;\n }\n int n10 = d.v.a.d.N0;\n this.notifyPropertyChanged(n10);\n super.requestRebind();\n }", "public V setValue(V value);", "public void setInputUrlValue(String value){\n WebElement urlField = driver.findElement(inputUrlLocator); \n setValue(urlField, value);\n \n }", "public void setInput1(final String input1) {\n this.input1 = input1;\n }", "public void setBSCA_ProfitPriceStdEntered (BigDecimal BSCA_ProfitPriceStdEntered);", "public void incB() {\n this.countB++;\n }", "protected void forwardToInput(T value) {\n inputModel.setValue(value);\n }", "public void setParameter(float b) {\r\n\t\tthis.b = b;\r\n\t}", "@Override // kotlin.jvm.functions.Function0\n public Unit invoke() {\n RdsInputItemPresenterImpl.access$setupNewValue(this.a, this.b, \"\", this.c);\n return Unit.INSTANCE;\n }", "public void setBSCA_ProfitPriceLimitEntered (BigDecimal BSCA_ProfitPriceLimitEntered);", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public void setB(String units,float value){\r\n\t\t//this.addChild(new PointingMetadata(\"lat\",\"\"+latitude));\r\n\t\tthis.setFloatField(\"b\", value);\r\n\t\tthis.setUnit(\"b\", units);\r\n\t}", "private void setBId(int value) {\n \n bId_ = value;\n }", "void setElementValue(SetElementValue cmd);", "private void assignJValuesToInputBranch()\r\n\t{\r\n\t\tfor (int j = lowestJValue; j <= highestJValue; j++) {\r\n\t\t\tinputBranchWithJ.put(j, inputBranchArray.get(j - lowestJValue));\r\n\t\t}\r\n\r\n\t\tif (isEType) {\r\n\t\t\tsetupAssociatedBranchesEType(inputBranchWithJ);\r\n\t\t} else {\r\n\t\t\tsetupAssociatedBranchesAType(inputBranchWithJ);\r\n\t\t}\r\n\r\n\t}", "public void setInput(Input param) {\r\n localInputTracker = param != null;\r\n\r\n this.localInput = param;\r\n }", "public Builder setNumb(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n numb_ = value;\n onChanged();\n return this;\n }", "ListeningFuture<Boolean> setInput(String input);", "public void set(boolean bol);", "public void setInputNum(Integer inputNum) {\r\n this.inputNum = inputNum;\r\n }", "public void SetA(byte num) {\r\n\t\tm_numA = num;\r\n\t}", "public void setBlock(int b, int block[][]){\n\t\tfor (int i = 0; i < size; i++){\n\t\t\tfor (int j = 0; j < size; j++){\n\t\t\t\tnumbers[i+size*(b/size)][j+size*(b%size)] =\n\t\t\t\t\tblock[i][j];\n\t\t\t}\n\t\t}\n\t}", "public abstract boolean setValue(Value value, boolean asAssignment);", "public void set(float signal);", "public void setValue2(Object value2) { this.value2 = value2; }", "private void setBid() {\r\n int bid;\r\n int carInList;\r\n Car temp;\r\n input = new Scanner(System.in);\r\n\r\n cars.getListings();\r\n System.out.println(\"Which vehicle would you like to bid on?\");\r\n\r\n carInList = input.nextInt();\r\n temp = cars.getCar(carInList);\r\n\r\n System.out.println(\"How much would you like to place on the bid?\");\r\n bid = input.nextInt();\r\n\r\n if (bid <= temp.getBidPrice()) {\r\n System.out.println(\"Your bid has to be higher than the current bid price\");\r\n } else {\r\n temp.setBidPrice(bid);\r\n System.out.println(\"Your bid price of \" + temp.getBidPrice() + \" has been set.\");\r\n System.out.println(\"Please check back later to see if you have won the bid\");\r\n }\r\n }", "private void setA(float dA) {\n EditText field = (EditText) findViewById(R.id.valA);\n SeekBar sb = (SeekBar) findViewById(R.id.seekA);\n\n a = dA;\n if (a <= 0) {\n a = 0.001f;\n }\n\n field.setText(String.valueOf(a));\n if (a * 1000 - 1 <= sb.getMax()) {\n sb.setProgress((int)(a * 1000 - 1));\n }\n }", "public abstract void inputChange( int value );", "public Value(String inputValue) {\n this.inputValue = inputValue;\n }", "public void setInput(int value) {\n\t\tnumberInputField.setValue(value);\n\t}", "void setData(int x,int y)\n\t{\n\ta=x;\n\tb=y;\n\t}", "public void setRealCell(String inputVal){\n\t\tuserInput = inputVal;\n\t}", "public void setBikeNum(int NewValue){\n bike = NewValue;\n }", "void setBuffer(byte[] b)\n {\n buffer = b;\n }", "public void set(String key, double valueInput) {\n\t\tset(key, Double.toString(valueInput));\n\t}", "public double getB(){\n return b;\n }", "public void setInput2(final String input2) {\n this.input2 = input2;\n }", "public void setBh(Integer bh) {\r\n this.bh = bh;\r\n }", "public void setInput(String input) {\n\t\t\tthis.input = input;\n\t\t}", "float getB();", "void setInput(com.indosat.eai.catalist.standardInputOutput.DummyInputType input);", "void updateValue( float time ) {\n\tboolean newVal = in1 & in2;\n\tif (newVal != value) {\n\t value = newVal;\n\t Simulator.schedule(\n\t new Simulator.Event(\n\t\ttime + (delay * 0.95f)\n\t\t+ PRNG.randomFloat( delay * 0.1f ) ) {\n\t\t void trigger() {\n\t\t\toutputChangeEvent( this.time );\n\t\t }\n\t\t}\n\t );\n\t}\n }", "public void setBina(Bina bina) {\r\n\t\tthis.bina = bina;\r\n\t}", "public void setVariableB(int value) {\r\n setVariableB(value, \"No Comment\");\r\n }", "ClassB initClassB(ClassB iClassB)\n {\n iClassB.updateElementValue(\"ClassB\");\n return iClassB;\n }", "public abstract void setValue(T value);", "public void setStateA(long stateA) {\n this.stateA = stateA;\n }", "public void setA(double a){\n this.a=a;\n }" ]
[ "0.6732997", "0.6530806", "0.649835", "0.64219934", "0.6369582", "0.62230724", "0.62067705", "0.60708976", "0.5938553", "0.58996785", "0.5896368", "0.5859144", "0.583817", "0.583817", "0.5810458", "0.5725244", "0.5693868", "0.56702936", "0.5658017", "0.56394106", "0.5618066", "0.56125206", "0.55812186", "0.55673724", "0.55545276", "0.5538295", "0.54895985", "0.5466359", "0.5445393", "0.5393172", "0.5391385", "0.53878945", "0.5270566", "0.52005345", "0.52005345", "0.51993054", "0.51969486", "0.51839894", "0.5172016", "0.5161485", "0.5133723", "0.5125563", "0.5125563", "0.5117349", "0.51078534", "0.50996166", "0.5092161", "0.5086694", "0.50774217", "0.5063893", "0.5045204", "0.50359535", "0.5035463", "0.5028203", "0.50281775", "0.5025431", "0.5016658", "0.5012771", "0.5010876", "0.5007201", "0.49961227", "0.49934033", "0.49790832", "0.4973754", "0.49649912", "0.4960125", "0.4955395", "0.4942879", "0.49370474", "0.4926885", "0.49196577", "0.4903404", "0.4900276", "0.48967707", "0.48891494", "0.48846534", "0.48844236", "0.48830754", "0.48810226", "0.48807615", "0.4879189", "0.48787904", "0.4877692", "0.48771647", "0.48641858", "0.48602855", "0.4858717", "0.4858386", "0.4858078", "0.48569563", "0.4856275", "0.48561275", "0.4854358", "0.48460945", "0.4834848", "0.48332444", "0.481782", "0.4816784", "0.48139793", "0.48128775" ]
0.67057335
1
Sets the value of the control line to one of the following values. Note that we are not implementing all possible control line values. 0 for AND; 1 for OR; 2 for ADD; 6 for SUBTRACT; 7 for PASS INPUT B.
public void setControl(int c) { // PROGRAM 1: Student must complete this method //if c is on of the accepted controls, set control to c. if (c == 0 || c == 1 || c == 2 || c == 6 || c == 7) { control = c; } else { //otherwise, throw exception throw new IllegalArgumentException("Control value invalid"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void SetInputPolarity(byte values) throws IOException {\n mDevice.writeRegByte( IPOL, values );\n }", "public void setControls() {\r\n System.out.println(\"wire data is \" + this.controllerWire.getData());\r\n String operation = this.controlMemory.get(this.controllerWire.getData());\r\n System.out.println(\"Setting the controls for \" + operation);\r\n if (operation.equalsIgnoreCase(\"add\")) {\r\n //alu.setControl(1);\r\n this.ALUControl.setData(1);\r\n this.ALU_MUXControl.setData(0);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n //aluMUX.setSelect(0);\r\n //regMUX.setSelect(0);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"addi\")) {\r\n //alu.setControl(1);\r\n this.ALUControl.setData(1);\r\n this.ALU_MUXControl.setData(1);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"sub\")) {\r\n //alu.setControl(2);\r\n this.ALUControl.setData(2);\r\n this.ALU_MUXControl.setData(0);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"lw\")) {\r\n// alu.setControl(8); // TODO \r\n this.ALUControl.setData(8);\r\n this.REG_MUXControl.setData(1);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.readWire.setData(1);\r\n memory.setReadWire(this.readWire);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"sw\")) {\r\n //alu.setControl(9); // TODO\r\n this.ALUControl.setData(9);\r\n //regMUX.setSelect(1);\r\n this.writeWire.setData(1);\r\n memory.setWriteWire(writeWire);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(0);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"sll\")) {\r\n //alu.setControl(6);\r\n this.ALUControl.setData(6);\r\n this.ALU_MUXControl.setData(1);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"srl\")) {\r\n //alu.setControl(5);\r\n this.ALUControl.setData(5);\r\n this.ALU_MUXControl.setData(1);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"and\")) {\r\n //alu.setControl(4);\r\n this.ALUControl.setData(4);\r\n this.ALU_MUXControl.setData(0);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"andi\")) {\r\n //alu.setControl(4);\r\n this.ALUControl.setData(4);\r\n this.ALU_MUXControl.setData(1);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"or\")) {\r\n //alu.setControl(3);\r\n this.ALUControl.setData(3);\r\n this.ALU_MUXControl.setData(0);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"ori\")) {\r\n //alu.setControl(3);\r\n this.ALUControl.setData(3);\r\n this.ALU_MUXControl.setData(1);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"nor\")) {\r\n //alu.setControl(7);\r\n this.ALUControl.setData(7);\r\n this.ALU_MUXControl.setData(0);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"beq\")) {\r\n this.PC_MUXControl.setData(0);\r\n this.ALUControl.setData(10);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.ALU_MUXControl.setData(0);\r\n this.registerWrite.setData(0);\r\n registers.setRegWriteControl(this.registerWrite);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n } else if (operation.equalsIgnoreCase(\"bne\")) {\r\n this.PC_MUXControl.setData(0);\r\n this.ALUControl.setData(11);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.ALU_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n this.registerWrite.setData(0);\r\n registers.setRegWriteControl(this.registerWrite);\r\n\r\n } else if (operation.equalsIgnoreCase(\"jr\")) {\r\n this.PC_MUXControl.setData(1);\r\n this.ALUControl.setData(12);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.ALU_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n this.registerWrite.setData(0);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"j\")) {\r\n this.PC_MUXControl.setData(1);\r\n this.ALUControl.setData(12);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.ALU_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n this.registerWrite.setData(0);\r\n registers.setRegWriteControl(this.registerWrite);\r\n\r\n } else if (operation.equalsIgnoreCase(\"jal\")) {\r\n this.PC_MUXControl.setData(1);\r\n this.ALUControl.setData(16);\r\n this.PC_MUXControl.setData(1);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.ALU_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n this.REG_MUXControl.setData(0);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n\r\n } else if (operation.equalsIgnoreCase(\"slt\")) {\r\n this.ALUControl.setData(13);\r\n this.ALU_MUXControl.setData(0);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"slti\")) {\r\n this.ALUControl.setData(13);\r\n this.ALU_MUXControl.setData(1);\r\n this.REG_MUXControl.setData(0);\r\n this.PC_MUXControl.setData(0);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n } else if (operation.equalsIgnoreCase(\"sltu\")) {\r\n this.ALUControl.setData(14);\r\n this.ALU_MUXControl.setData(0);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n } else if (operation.equalsIgnoreCase(\"sltui\")) {\r\n this.ALUControl.setData(14);\r\n this.ALU_MUXControl.setData(1);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n } else if (operation.equalsIgnoreCase(\"beq\")) {\r\n this.ALUControl.setData(14);\r\n this.ALU_MUXControl.setData(1);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n this.registerWrite.setData(0);\r\n registers.setRegWriteControl(this.registerWrite);\r\n }\r\n instructionMemory.wiresLog.get(instructionMemory.COMMANDS_COUNTER).get(1).add(\"ALU CONTROL: \" + this.ALUControl.toString());\r\n instructionMemory.wiresLog.get(instructionMemory.COMMANDS_COUNTER).get(1).add(\"ALU MUX CONTROL: \" + this.ALU_MUXControl.toString());\r\n instructionMemory.wiresLog.get(instructionMemory.COMMANDS_COUNTER).get(1).add(\"PC MUX CONTROL: \" + this.PC_MUXControl.toString());\r\n instructionMemory.wiresLog.get(instructionMemory.COMMANDS_COUNTER).get(1).add(\"REG MUX CONTROL: \" + this.REG_MUXControl.toString());\r\n instructionMemory.wiresLog.get(instructionMemory.COMMANDS_COUNTER).get(1).add(\"MEMORY READ: \" + this.readWire.toString());\r\n instructionMemory.wiresLog.get(instructionMemory.COMMANDS_COUNTER).get(1).add(\"MEMORY WRITE: \" + this.writeWire.toString());\r\n instructionMemory.wiresLog.get(instructionMemory.COMMANDS_COUNTER).get(1).add(\"REGISTER WRITE: \" + this.registerWrite.toString());\r\n this.setRegisterWriteControl();\r\n }", "private void adjustBooleanControl(BooleanControl control, boolean value) {\n \t\tcontrol.setValue(value);\n \t}", "public void control()\n {\n if(this.listOperator.contains(this.operator))\n {\n\n if(this.operator.equals(\"=\")) // If the operator is \"=\"\n {\n // We ask to the model to display the result\n this.calc.getResult();\n }\n else // Else, we give the operator to the model\n {\n this.calc.setOperator(this.operator);\n }\n }\n \n // If the number is ok\n if(this.number.matches(\"^[0-9.]+$\"))\n {\n this.calc.setNumber(this.number);\n }\n\n this.operator = \"\";\n this.number = \"\";\n }", "public void setAndOr (String AndOr);", "public void setControlVars(java.util.List<Object> controlValues);", "public void activate() {\n // PROGRAM 1: Student must complete this method\n if (control == 0) { // run and()\n \t\tand();\n \t} else if (control == 1) { //run or()\n \t\tor();\n \t} else if (control == 2) { //run add()\n \t\tadd();\n \t} else if (control == 6) { //run sub()\n \t\tsub();\n \t} else if (control == 7) { //run passB()\n \t\tpassB();\n \t} else {\n \t\tthrow new RuntimeException(\"invalid control\"); //otherwise, there was an invalid control\n \t}\n }", "public Formula encodeControl() {\n\t\tConjunction result = new Conjunction(\"control\");\n\t\tSet<CArgument> controlArgs = CAF.getArgumentsByType(CArgument.Type.CONTROL);\n\t\tif(controlArgs.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\tfor(CArgument a : controlArgs) {\n\t\t\tString name = \"on_\" + a.getName() + \"_\" + \"acc_\" + a.getName();\n\t\t\tAtom left = new Atom(\"on_\" + a.getName());\n\t\t\tAtom right = new Atom(\"acc_\" + a.getName());\n\t\t\tEquivalence equiv = new Equivalence(name, left, right);\n\t\t\tresult.addSubformula(equiv);\n\t\t}\n\t\treturn result;\n\t}", "void setNextValue() {\n this.value = this.value * 2;\n }", "protected final void operationORA(final int data) {\r\n this.ac |= data;\r\n this.zeroFlag = this.ac == 0;\r\n this.signFlag = this.ac >= 0x80;\r\n }", "public void setInitialValue(int pipVal) {\r\n\t\tif (pipVal == 0) {\r\n\t\t\t// this is an ace\r\n\t\t\tthis.value = 11;\r\n\t\t} else if (pipVal >= 9) {\r\n\t\t\tthis.value = 10;\r\n\t\t} else {\r\n\t\t\tthis.value = pipVal + 1;\r\n\t\t}\r\n\t}", "protected final void operationAND(final int data) {\r\n this.ac &= data;\r\n this.zeroFlag = this.ac == 0;\r\n this.signFlag = this.ac >= 0x80;\r\n }", "public void enableThreeAndFour() {\n\t\tans3.setEnabled(true);\n\t\tans4.setEnabled(true);\n\t\tanswer3.setEnabled(true);\n\t\tanswer4.setEnabled(true);\n\t}", "public void change () {\n\t\tswitch (setting) {\n\t\tcase OFF:\n\t\t\tsetting=possibleSettings.LOW;\n\t\tcase LOW:\n\t\t\tsetting=possibleSettings.MEDIUM;\n\t\tcase MEDIUM:\n\t\t\tsetting=possibleSettings.HIGH;\n\t\tcase HIGH:\n\t\t\tsetting=possibleSettings.OFF;\n\t\t\n\t\t}\n\t\t//assert setting()==OFF || setting()==LOW || setting()==MEDIUM || setting()==HIGH;\n\t\t//setting = (setting + 1) % 4;\n\t}", "void setControlPosition(org.landxml.schema.landXML11.TrafficControlPosition.Enum controlPosition);", "private void testAndUpdateControlFields(int startFieldNr) {\n\t\t\n\t\tboolean consistent = true;\n\t\t\n\t\t//test and correct y\n\t\tfor (int i = 0; i < _controlPoints.length; i++) {\n\t\t\tif (parseTextFieldValue(_controlPoints[i][1]) == -1.0f) {\n\t\t\t\tconsistent = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//test and correct x at startFieldNr and above\n\t\tfor (int i = startFieldNr; i >= 0; i--) {\n\t\t\tfloat value1 = parseTextFieldValue(_controlPoints[i][0]);\n\t\t\tif (value1 == -1.0f) {\n\t\t\t\t//check field value\n\t\t\t\tconsistent = false;\n\t\t\t} else {\n\t\t\t\t//field value ok check if it is greater than the field above\n\t\t\t\tif (i > 0) {\n\t\t\t\t\tfloat value2 = parseTextFieldValue(_controlPoints[i-1][0]);\n\t\t\t\t\tif (value2 > value1) {\n\t\t\t\t\t\t//value 2 has to be <= value1 change it\n\t\t\t\t\t\t_controlPoints[i-1][0].setText(String.valueOf(value1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t//test and correct x at startFieldNr and below\n\t\tfor (int i = startFieldNr; i < _controlPoints.length; i++) {\n\t\t\tfloat value1 = parseTextFieldValue(_controlPoints[i][0]);\n\t\t\tif (value1 == -1.0f) {\n\t\t\t\t//check field value\n\t\t\t\tconsistent = false;\n\t\t\t} else {\n\t\t\t\t//field value ok check if it is smaller than the field below\n\t\t\t\tif (i < (_controlPoints.length-1)) {\n\t\t\t\t\tfloat value2 = parseTextFieldValue(_controlPoints[i+1][0]);\n\t\t\t\t\tif (value2 < value1) {\n\t\t\t\t\t\t//value 2 has to be >= value1 change it\n\t\t\t\t\t\t_controlPoints[i+1][0].setText(String.valueOf(value1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t_isConsistent = consistent;\n\t\t_changeListener.pointsChanged(consistent);\n\t}", "public void operatorControl() {\n myRobot.setSafetyEnabled(true);\n while (isOperatorControl() && isEnabled()) {\n \tmyRobot.tankDrive(controller, 2, controller, 5);\n Timer.delay(0.005);\t\t// wait for a motor update time\n }\n }", "public void setOperandB(int val);", "private void setControls(char functionType){\r\n if (functionType == 'I' ) {\r\n setControlsEnabled(true);\r\n txtRolodexId.setEditable(false);\r\n txtLastUpdate.setEditable(false);\r\n txtUpdateUser.setEditable(false);\r\n }else if (functionType == 'M') {\r\n setControlsEnabled(true);\r\n txtRolodexId.setEditable(false);\r\n txtLastUpdate.setEditable(false);\r\n txtUpdateUser.setEditable(false);\r\n }else if (functionType == 'V') {\r\n setControlsEnabled(false);\r\n btnOK.setEnabled(false);\r\n btnCancel.setEnabled(true);\r\n btnSponsor.setEnabled(false);\r\n txtComments.setOpaque(false);\r\n }else if (functionType == 'C') {\r\n setControlsEnabled(true);\r\n txtRolodexId.setText(\"\");\r\n txtLastUpdate.setText(\"\");\r\n txtUpdateUser.setText(\"\");\r\n txtRolodexId.setEditable(false);\r\n txtLastUpdate.setEditable(false);\r\n txtUpdateUser.setEditable(false);\r\n }else if (functionType == 'N') {\r\n setControlsEnabled(false);\r\n txtComments.setOpaque(false);\r\n }\r\n \r\n \r\n }", "public void setOperandA(int val);", "public void setInput(boolean inputA, boolean inputB) {\n mAndGate.setInput(inputA, inputB);\n mXorGate.setInput(inputA, inputB);\n }", "@Override\n public void valueChanged(Boolean control_val) {\n if (!control_val){\n playbackDirection.setValue(PLAY_FORWARD);\n }\n else{\n playbackDirection.setValue(PLAY_REVERSE);\n }\n // Write your DynamicControl code above this line\n }", "void setControlType(org.landxml.schema.landXML11.TrafficControlType.Enum controlType);", "private void setControlsEnabled(boolean value){\r\n txtRolodexId.setEditable(value);\r\n txtLastUpdate.setEditable(value);\r\n txtUpdateUser.setEditable(value);\r\n txtLastName.setEditable(value);\r\n txtFirstName.setEditable(value);\r\n txtMiddleName.setEditable(value);\r\n txtSuffix.setEditable(value);\r\n txtPrefix.setEditable(value);\r\n txtTitle.setEditable(value);\r\n txtSponsorCode.setEditable(value);\r\n txtOrganization.setEditable(value);\r\n txtAddress1.setEditable(value);\r\n txtAddress2.setEditable(value);\r\n txtAddress3.setEditable(value);\r\n txtCity.setEditable(value);\r\n txtCounty.setEditable(value);\r\n //Modified for case#3278 - State Combobox is made non editable\r\n cmbState.setEditable(false);\r\n cmbState.setEnabled(value);\r\n cmbState.setForeground(Color.black);\r\n cmbCountry.setEnabled(value);\r\n txtPostalCode.setEditable(value);\r\n txtPhone.setEditable(value);\r\n txtEMail.setEditable(value);\r\n txtFax.setEditable(value);\r\n txtComments.setEditable(value);\r\n }", "@Override\n public void setRedstoneInput(final short value) {\n final World world = getCasing().getCasingWorld();\n if (world.isClient) {\n return;\n }\n\n // Clamp to valid redstone range.\n final short validatedValue = (short)Math.max(0, Math.min(15, value));\n if (validatedValue == input) {\n return;\n }\n\n input = validatedValue;\n\n // If the value changed, make sure we're saved.\n getCasing().markDirty();\n\n // The value changed, cancel our output to make sure it's up-to-date.\n cancelWrite();\n\n // Update client representation.\n sendData();\n }", "@Override\n\tpublic void setOperands(int first, int second, int third) {\n\t\tthis.first = first;\n\t\tthis.second = second;\n\t\tthis.third = third;\n\t}", "public void set(ControlMode controlMode, double value)\n {\n switch (controlMode)\n {\n case Throttle:\n super.set(value);\n// System.out.printf(\"Port: %d value %f\\n\", port, value);\n break;\n case Position:\n super.getPIDController().setReference(value, ControlType.kPosition);\n break;\n case Velocity:\n super.getPIDController().setReference(value, ControlType.kVelocity);\n break;\n }\n }", "public void enableChoice(int x, int y, int value)\n {\n _cells[x][y].enableValue(value);\n }", "public void setBothValue(String value) {\r\n\t\ttxtPassword.setValue(value);\r\n\t\ttxtRetypePassword.setValue(value);\r\n\t}", "public void set(int value) {\n\t\ttem = value;\n\t\tSystem.out.println(\"\\tAir conditioner is set to \" + tem +\" degrees\");\n\t}", "protected void acceptValuesInInteractiveControlPanel()\n\t{\n\t\tsuper.acceptValuesInInteractiveControlPanel();\n\t\t\n\t\taHat = aHatPanel.getVector3D();\n\t\tuHat = uHatPanel.getVector3D();\n\t\tvHat = vHatPanel.getVector3D();\n\t\tetaU = etaPanel.getVector2D().x;\n\t\tetaV = etaPanel.getVector2D().y;\n\t\tdeltaU = deltaPanel.getVector2D().x;\n\t\tdeltaV = deltaPanel.getVector2D().y;\n\t\t\n\t\tif(apertureParametersTabbedPane.getSelectedComponent().equals(zeroParametersLabel)) alphaChoice = AlphaChoice.ZERO;\n\t\telse if(apertureParametersTabbedPane.getSelectedComponent().equals(manualParametersPanel)) alphaChoice = AlphaChoice.MANUAL;\n\t\telse if(apertureParametersTabbedPane.getSelectedComponent().equals(optimisedParametersPanel)) alphaChoice = AlphaChoice.OPTIMISED;\n\n\t\tsigma1U = sigma1Panel.getVector2D().x;\n\t\tsigma1V = sigma1Panel.getVector2D().y;\n\t\tsigma2U = sigma2Panel.getVector2D().x;\n\t\tsigma2V = sigma2Panel.getVector2D().y;\n\t\talpha1U = alpha1Panel.getVector2D().x;\n\t\talpha1V = alpha1Panel.getVector2D().y;\n\t\talpha2U = alpha2Panel.getVector2D().x;\n\t\talpha2V = alpha2Panel.getVector2D().y;\n\t\tpointAtFOVCentre = pointAtFOVCentrePanel.getVector3D();\n//\t\tparallelityParameter = parallelityParameterPanel.getNumber();\n//\t\tJComboBox alphaChoiceComboBox;\n\t\tapertureCentre = apertureCentrePanel.getVector3D();\n\t\tbrightnessFactor = brightnessFactorPanel.getNumber();\n\t}", "public void setCR(int cR)\r\n/* 44: */ {\r\n/* 45: 44 */ this.CR = cR;\r\n/* 46: */ }", "TravelLength ControlInput(TravelLength input);", "public void setKControl(double[] kControl) {\n this.kControl = kControl;\n }", "public void setOR(boolean value) {\n this.OR = value;\n }", "public void operatorControl() {\n \tmyRobot.setSafetyEnabled(true);\n while (isOperatorControl() && isEnabled()) {\n \tdouble x = stick2.getRawAxis(0);\n \tdouble y = stick2.getRawAxis(1);\n \tdouble rot = stick.getRawAxis(0);\n \tSmartDashboard.putNumber(\"x1\", x);\n SmartDashboard.putNumber(\"y1\", y);\n SmartDashboard.putNumber(\"rot1\", rot);\n \tif(Math.abs(x) < .2)\n \t\tx = 0;\n \tif(Math.abs(y) < .2)\n \t\ty = 0;\n \tif(Math.abs(rot) < .2)\n \t\trot = 0;\n \tmyRobot.mecanumDrive_Cartesian(x*-1, y*-1,rot*-1, gyro.getAngle());\n double current1 = pdp.getCurrent(0);\n double current2 = pdp.getCurrent(13);\n double current3 = pdp.getCurrent(15);\n double current4 = pdp.getCurrent(12);\n SmartDashboard.putNumber(\"Front Left current\", current1);\n SmartDashboard.putNumber(\"back Left current\", current2);\n SmartDashboard.putNumber(\"Front right current\", current3);\n SmartDashboard.putNumber(\"back right current\", current4);\n SmartDashboard.putNumber(\"x\", x);\n SmartDashboard.putNumber(\"y\", y);\n SmartDashboard.putNumber(\"rot\", rot);\n SmartDashboard.putNumber(\"Gyro\", gyro.getAngle());\n \tTimer.delay(0.005);\t\t// wait for a motor update time\n }\n }", "public static void changeStepValue(int v){\n\t\tif(px<0)\n\t\t\tpx = -v;\n\t\telse if(px>=0)\n\t\t\tpx = v;\n\t\tif(py<0)\n\t\t\tpy = -v;\n\t\telse if (py>=0)\n\t\t\tpy = v;\n\t\t\t\n\t}", "public void testX1andX2orNotX1() {\n \tCircuit circuit = new Circuit();\n \t\n \tBoolean b1 = Boolean.TRUE;\n \tBoolean b2 = Boolean.FALSE;\n \tAnd and = (And) circuit.getFactory().getGate(Gate.AND);\n\t\tNot not = (Not) circuit.getFactory().getGate(Gate.NOT);\n\t\tOr or = (Or) circuit.getFactory().getGate(Gate.OR);\n\t\tand.setLeftInput(b1);\n\t\tand.setRightInput(b2);\n\t\tand.eval();\n\t\tnot.setInput(b1);\n\t\tnot.eval();\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n\t\tassertEquals(Boolean.FALSE, or.eval());\n\t\tassertEquals(Boolean.FALSE, circuit.eval());\n//\t\t==========================================\n\t\tb1 = Boolean.FALSE;\n \tb2 = Boolean.TRUE;\n// \tand.eval();\n// \tnot.eval();\n \tassertEquals(Boolean.FALSE, circuit.eval());\n// \t============================================\n \tDouble d1 = 0.0;\n \tDouble d2 = 1.0;\n \tand.setLeftInput(d1);\n\t\tand.setRightInput(d2);\n\t\tnot.setInput(d1);\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(1.0), or.eval());\n// \t============================================\n \td1 = 0.5;\n \td2 = 0.5;\n \tand.setLeftInput(d1);\n\t\tand.setRightInput(d2);\n \tand.eval();\n \tnot.setInput(d1);\n \tnot.eval();\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(0.625), or.eval());\n// \t============================================\n \ttry {\n \td1 = 0.5;\n \td2 = 2.0;\n \tand.setLeftInput(d1);\n \t\tand.setRightInput(d2);\n \tand.eval();\n \tnot.setInput(d1);\n \tnot.eval();\n \t\tor.setLeftInput(and.getOutput());\n \t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(0.625), or.eval());\n \t} catch (IllegalArgumentException e) {\n \t\tSystem.err.println(\"IllegalArgumentException: \" + e.getMessage());\n \t}\n\n }", "public void SimulateLogic() {\n int ix;\n if (IPin[LT].getLevel() == 5) { // Lamp test\n for (ix = 0; ix < 7; ix++) {\n OPin[ix].Level = 5;\n }\n return;\n }\n if (IPin[BI].getLevel() == 5) { // Blank input\n for (ix = 0; ix < 7; ix++) {\n OPin[ix].Level = 0;\n }\n return;\n }\n if (IPin[LE].getLevel() == 5) { // Latch enable\n ActVal = 0;\n if (IPin[A].getLevel() == 5) ActVal += 1;\n if (IPin[B].getLevel() == 5) ActVal += 2;\n if (IPin[C].getLevel() == 5) ActVal += 4;\n if (IPin[D].getLevel() == 5) ActVal += 8;\n }\n\n for (ix = 0; ix < 7; ix++) {\n OPin[ix].Level = SegLev[ActVal] [ix];\n }\n }", "public void operatorControl() {\n \tdouble ctrlThresh = .2; \n \tdouble minPower = .05; \n \tdouble maxPower = .75; \n \tdouble recip = (1 - ctrlThresh); \n \tdouble mult = (maxPower - minPower); \n \tdouble right; \n \tdouble strafe; \n \tdouble rotate; \n \tdouble rightAxis; \n \tdouble strafeAxis; \n \tdouble rotateAxis; \n \t// \tboolean leftLeft; \n \t// \tboolean leftRight; \n \tdouble rightDir; \n \tdouble strafeDir; \n \tdouble rotateDir; \n \tdouble rightPower; \n \tdouble rotatePower; \n \tdouble strafePower; \n \t\n \tint winchCount;\n \tboolean winchDirection;\n \n \t// \tdouble frontLeftPower; \n \t// \tdouble frontRightPower; \n \t// \tdouble backLeftPower; \n \t// \tdouble backRightPower; \n \n \t//myRobot.setSafetyEnabled(true); \n \t\n \tAccelerometer test = new BuiltInAccelerometer();\n \t\n \twhile (isOperatorControl() && isEnabled()) { \n \t\t// ACCEL TEST CODE\n// \t\tSystem.out.println(test.getX() + \", \" + test.getY() + \", \" + test.getZ());\n \t\t// END ACCEL TEST CODE\n \n \t\t// ********** BEGIN DRIVING CODE ********** \n \t\t// Code for driving using omniwheels and two wheels for strafing \n \t\t// Diagram for the wheels of the robot below. \n \n \t\t// L S R \n \t\t// /--------------------------\\ \n \t\t//\t ||------------------------|| \n \t\t// || [][] || \n \t\t// || [] [] || \n \t\t// || [] [] || \n \t\t// || || \n \t\t// || || \n \t\t// || || \n \t\t// || || \n \t\t// || || \n \t\t// || [] [] || \n \t\t// || [] [] || \n \t\t// || [][] || \n \t\t// ||------------------------|| \n \t\t// \\--------------------------/ \n \t\t// \n \t\t// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ \n \n \t\tctrlThresh = .2; // the point at which we want to sense joystick action \n \t\trecip = 1-ctrlThresh; \t\t // = 0.8 \n \n \t\trightAxis = rightStick.getRawAxis(1);\t\t\t\t// right joystick, y (up/down) axis\n \t\t\n \t\t//System.out.println(\"\"+rightAxis);\n \t\tstrafeAxis = rightStick.getRawAxis(0);\t\t\t\t// right joystick, x (left/right) axis; this is \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/// arbitrary and could have been the left stick\n \t\trotateAxis = rightStick.getRawAxis(4);\t\t\t\t\t// left joystick, y axis\n \n \t\trightDir = rightAxis/Math.abs(rightAxis);\t\t\t// forward or backward (+1 or -1)\n \t\tstrafeDir = strafeAxis/Math.abs(strafeAxis); \t// \t\t\t'' \n \t\trotateDir = rotateAxis/Math.abs(rotateAxis); // \t\t\t'' \n \n \t\tright = 0; // right input formatted for range of detected values [0.2,1] \n \t\trotate = 0; // left input formatted \n \t\tstrafe = 0; // strafe input formatted \n \n \t\tif(Math.abs(rightAxis) > ctrlThresh) \t// user moved stick beyond threshold \n \t\t{right = (rightAxis-ctrlThresh*rightDir)/recip;} // format right: scale back, set direction, proportion it \n \t\tif(Math.abs(strafeAxis) > ctrlThresh) \n \t\t{strafe = (strafeAxis-ctrlThresh*strafeDir)/recip;} // format left... \n \t\tif(Math.abs(rotateAxis) > ctrlThresh) \n \t\t{rotate = (rotateAxis-ctrlThresh*rotateDir)/recip;}\t\t// format strafe... \n \n \n \t\trightDir = right/Math.abs(right); \n \t\trightPower = (Math.abs(right*mult) + minPower) * rightDir; \t\t// re-proportion for power's range, strip direction,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/// and then add back threshold and direction. \n \t\trotateDir = rotate/Math.abs(rotate); \n \t\trotatePower = (Math.abs(rotate*mult) + minPower) * rotateDir;\t\t\t// \t\t'' \n \n \t\tstrafeDir = strafe/Math.abs(strafe); \n \t\tstrafePower = (Math.abs(strafe*mult) + minPower) * strafeDir;\t// \t\t'' \n \n \t\tif(Math.abs(rightPower)>0.2){\n \t\t\tfrontRight.set(rightPower);\t\t\t\t\t\t// set all the motors with the powers we \n \t\t\tbackRight.set(rightPower);\t\t\t\t\t\t/// calculated above : drive! \n \t\t\tfrontLeft.set(-1*rightPower); \n \t\t\tbackLeft.set(-1*rightPower);\n \t\t}\n \t\telse{\n \t\t\tfrontRight.set(rotatePower);\n \t\t\tbackRight.set(rotatePower);\n \t\t\tfrontLeft.set(rotatePower);\n \t\t\tbackLeft.set(rotatePower);\n \t\t}\n \t\t\n// \t\tfrontStrafe.set(strafePower); \n// \t\tbackStrafe.set(-1*strafePower); \n \n// \t\tmyRobot.tankDrive(leftStick, rightStick); \n \t\t \n \t\t// ********** END OF DRIVING CODE ********** \n \t\t//======================================================================= \n \t\t// ************ BEGIN WINCH CODE *********** \n \t\t// We need to code the winch to help raise and lower the elevator \n \t\t// This is just one option between the winch and the lead screw. \n \t\t \n \t\t\n \t\t//second winch test\n \t\t/*\n \t\twinchCount = winchEncoder.get();\t\t\t\t// get the pulse count from the encoder\n \t \tSystem.out.println(\"Count: \"+ winchCount);\t\t// print the pulse count \n \t \tif(winchCount<240){\n \t \t\t\n \t \t\twinchCim1.set(.1);\n \t \t\twinchCim2.set(.1);\n \t \t}\n \t \telse{\n \t \t\twinchCim1.set(0);\n \t \t\twinchCim2.set(0);\n \t \t\t\n \t \t}\n \t if(rightStick.getRawButton(5)) \n { \n\t\t\t winchEncoder.reset();// reset the pulse count\n\t\t\t winchCount = 0;\n\t\t\t winchCim1.set(0);\n\t\t\t winchCim2.set(0);\n\t\t\t \n } */ //end of second winch test \n \t \t\n \t\t\n \t\t if(rightStick.getRawButton(5)) \n { \n \t\t\t //winchEncoder.reset();// reset the pulse count\n \tSystem.out.println(\"A\");\n \t winchCim1.set(.5); \t// set winchCim1 to 0.5 power (upwards) \n \t winchCim2.set(.5); \t\t\t\t\t\t\t// set winchCim2 to 0.5 power\n \t\t\t \n } \n \t\telse if(rightStick.getRawButton(4))\n \t\t{\n \t\t\tSystem.out.println(\"B\");\n \t\t\t//winchEncoder.reset();\t\t\t\t\t\t\t// reset the pulse count\n \t \twinchCim1.set(-.3); // set winchCim1 to -0.5 power (downwards) \n \t \twinchCim2.set(-.3);\t \t\t\t\t\t\t\t// set winchCim2 to -0.5 power\n \t\t}\n \n \t \telse// if(rightStick.getRawButton(2)) \n { \n \t winchCim1.set(0); \t\t\t\t\t\t\t// set winchCim1 to 0 power (off/stop) \n \t winchCim2.set(0);\t\t\t\t\t\t\t\t// set winchCim2 to 0 pwoer (off/stop)\n// \t winchCount = winchEncoder.get();\t\t\t\t// get the pulse count from the encoder\n// \t System.out.println(\"Count: \"+ winchCount);\t\t// print the pulse count \n } \n \n \t\t// ********** END OF WINCH CODE ********** \n \t\t//======================================================================= \n \t\t \n \t\t \n \t\tTimer.delay(0.005);\t\t// wait for a motor update time \n } \n }", "public void setCriteria(Byte value) {\n set(12, value);\n }", "public void setCurve (double x1, double y1, double ctrlx, double ctrly, double x2, double y2) {\n this.x1 = x1;\n this.y1 = y1;\n this.ctrlx = ctrlx;\n this.ctrly = ctrly;\n this.x2 = x2;\n this.y2 = y2;\n }", "@And(\"^I pass control to another window$\")\n\tpublic void switchControl(){\n\t\tString result = selenium.switchControl();\n\t\tAssert.assertEquals(selenium.result_pass, result);\n\t}", "private Conjunction(String newValue)\r\n\t{\r\n\t\tthis.value = newValue;\r\n\t}", "private void setMultipleChecks() {\r\n\r\n checkNemenyi.setEnabled(true);\r\n checkShaffer.setEnabled(true);\r\n checkBergman.setEnabled(true);\r\n\r\n checkIman.setEnabled(true);\r\n checkHolm.setEnabled(true);\r\n }", "private void setValueToRule() {\n\t\t\n\t\tif(!currRule.isEmpty()) {\n\t\t\tAntiSpamFilterControl.setWeigthByRuleManual(currRule, Double.parseDouble(manualRuleValue.getText()));\n\t\t}\n\t\t\n\t\tif(manualCBRules.isValid()) {\n\t\t\tcurrRule = manualCBRules.getSelectedItem().toString();\n\t\t}\n\t\tmanualRuleValue.setText(AntiSpamFilterControl.getWeigthByRule(currRule, true) + \"\");\n\t}", "@Override\n public void valueChanged(double control_val) {\n playbackRate.setValue((float)control_val);\n // Write your DynamicControl code above this line\n }", "public void setValue(int v) {\n if (!frozen) {\n //if (v > 0 || v <= numSides) {\n if (0 < v && v <= numSides) {\n value = v;\n getValue();\n } else {\n value = v;\n System.out.println(\"Attempted to set value to \" + value + \" , assumed 1.\");\n this.value = 1;\n getValue();\n }\n }\n }", "static void ori_with_acc(String passed){\n\t\tint val1 = hexa_to_deci(registers.get('A'));\n\t\tint val2 = hexa_to_deci(passed.substring(4));\n\t\tval1 = val1|val2;\n\t\tregisters.put('A',decimel_to_hexa_8bit(val1));\n\t\tmodify_status(registers.get('A'));\n\t}", "public void setRule(int r)\n { \n rule = r;\n repaint();\n }", "public void setOperator(String value) {\r\n\t\tif (!\"\".equals(firstNumber.toString())\r\n\t\t\t\t&& \"\".equals(secondNumber.toString())) {\r\n\t\t\toperator = value;\r\n\t\t}\r\n\t}", "private void setRightValue()\n\t{\t\n\t\tString[] split = null;\t//String array created to hold individual Strings generated by the\n\t\t\t\t\t\t\t\t//split method\n\t\t\n\t\t/* Determines the arithmetic symbol that is being used in calculation\t*/\n\t\tif(Fun != null)\n\t\t{\n\t\t\tstrParse = entry.getText();\n\t\t\tswitch (Fun)\n\t\t\t{\n\t\t\t\tcase ADD:\n\t\t\t\t\tsplit = strParse.split (\"\\\\+\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase SUBTRACT:\n\t\t\t\t\tsplit = strParse.split (\"\\\\-\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase DIVIDE:\n\t\t\t\t\tsplit = strParse.split (\"\\\\/\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase MULTIPLY:\n\t\t\t\t\tsplit = strParse.split (\"\\\\*\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\trightValue = Double.parseDouble (split[1]);\n\t\t\t\tcalc.setRightValue (rightValue);\n\t\t\t}\n\t\t\tcatch(Exception ex)\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t}//end if\n\t\t\n\t}", "public void setTrueValue(int newValue)\n {\n\t// Local constants\n\n\t// Local variables\n\n\t/************ Start setTrueValue Method ***************/\n\n\t// Set true value of card\n trueValue = newValue;\n\n }", "@Override\npublic void setControlXControlY(int newControlXValue, int newControlYValue) {\n\tsetControlX(newControlXValue);\n\tsetControlY(newControlYValue);\n\t\n}", "public void setValue(int value)\n {\n // we have assumed value 1 for X and 10 for O\n this.value = value;\n }", "void setStraight(boolean straight);", "private void control()\r\n\t\t{\n\t\tspinMin.addChangeListener(createMinListener());\r\n\t\tspinMax.addChangeListener(createMaxListener());\r\n\t\t}", "public void set(float signal);", "public void setCanMove(double cmd){\n \tleftCanMotor.set(cmd);\n \trightCanMotor.set(cmd); \n }", "public void operatorControl() {\n for (int i = 0; i < autoControllers.size(); i++) {\n ((EventController) autoControllers.elementAt(i)).disable();\n }\n for (int i = 0; i < teleopControllers.size(); i++) {\n ((EventController) teleopControllers.elementAt(i)).enable();\n }\n \n }", "private void checkBaselineInput(){\n String typedText=baselineStation1Text.getText();\n String typedText2=baselineStation2Text.getText();\n if(!typedText.equals(\"\") && !typedText2.equals(\"\")){\n this.addBaseLineButton.setEnabled(true);\n }else{\n this.addBaseLineButton.setEnabled(false);\n }\n }", "public abstract void setInput(boolean value);", "public void setRMTIndicator(Record inputRecord);", "public void setSettable(){\n\t\tString letter;\n\t\tletter = JOptionPane.showInputDialog(getFrame(), \"Enter the settable rate of the simulation\");\n\t\twhile(letter==null || letter.equals(\"\")){\n\t\t\tletter = JOptionPane.showInputDialog(getFrame(), \"Enter the settable rate of the simulation\");\n\t\t\t\n\t\t}\n\t\trate=Integer.parseInt(letter);\n\t}", "final void habilitarcampos(boolean valor){\n TXT_CodCliente.setEnabled(valor);\n TXT_Aparelho.setEnabled(valor);\n TXT_Valor.setEnabled(valor);\n TXT_Informacao.setEnabled(valor); \n TXT_CodServico.setEnabled(valor); \n TXT_Clientes.setEnabled(valor); \n TXT_Serial.setEnabled(valor);\n TXT_Data.setEnabled(valor);\n}", "public LogicalOperator() {\n this.logical = Logical.And;\n }", "public void setControlKeyState( final int keyIndex, final boolean state ) throws RemoteException {\r\n controlKeyStates[ keyIndex ] = state;\r\n }", "public void setRegisterWriteControl() {\r\n // registers.setRegWrite();\r\n //this.registerWrite.setData(1);\r\n //registers.setRegWriteControl(this.registerWrite);\r\n }", "public static void Turno(){\n\t\tif (pl1){\n\t\t\tpl1=false;\n\t\t\tpl2=true;\t\n\t\t\tvalore = 1;\n\t\t}\n\t\telse{\n\t\t\tpl1=true;\n\t\t\tpl2=false;\n\t\t\tvalore = 2;\n\t\t}\n\t}", "public void onboard_control_sensors_enabled_SET(@MAV_SYS_STATUS_SENSOR int src)\n { set_bits(- 1 + src, 26, data, 178); }", "public void setNumAyuAtracc(int num);", "public com.opentext.bn.converters.avro.entity.DocumentEvent.Builder setControlNumberLevel1(java.lang.String value) {\n validate(fields()[5], value);\n this.controlNumberLevel1 = value;\n fieldSetFlags()[5] = true;\n return this;\n }", "public boolean setOperand(int operandNumber, String operandValue);", "void setValue(Adjustable adj, int v);", "private void controlLift()\n {\n if (gamepad1.dpad_up) {\n liftMotor.setPower(-0.5);\n } else if (gamepad1.dpad_down) {\n liftMotor.setPower(0.5);\n } else {++backInc;\n liftMotor.setPower(0);\n }\n }", "void\t\tsetCommandSensitivity(String command, boolean flag);", "private void setKeyCode() {\n if (key.equals(KeyCode.W) || key.equals(KeyCode.UP)) {\n key = KeyCode.UP;\n right_key = true;\n } else if (key.equals(KeyCode.S) || key.equals(KeyCode.DOWN)) {\n key = KeyCode.DOWN;\n right_key = true;\n } else if (key.equals(KeyCode.A) || key.equals(KeyCode.LEFT)) {\n key = KeyCode.LEFT;\n right_key = true;\n } else if (key.equals(KeyCode.D) || key.equals(KeyCode.RIGHT)) {\n key = KeyCode.RIGHT;\n right_key = true;\n } else {\n key = KeyCode.PLUS;\n }\n }", "public void manualControl(double power){\n leftMotor.set(power);\n rightMotor.set(power);\n }", "public void setOp ( boolean value ) {\n\t\texecute ( handle -> handle.setOp ( value ) );\n\t}", "public com.example.DNSLog.Builder setOR(boolean value) {\n validate(fields()[16], value);\n this.OR = value;\n fieldSetFlags()[16] = true;\n return this;\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) { //the radio button changes the values of the modes\r\n\t\t\t\tif(add == false){//if its negative, set it to positive\r\n\t\t\t\t\tadd = true;\r\n\t\t\t\t\tSystem.out.println(add);\r\n\t\t\t\t}\r\n\t\t\t\telse if(add == true){\r\n\t\t\t\t\tadd = false;\r\n\t\t\t\t\tSystem.out.println(add);\r\n\t\t\t\t}\r\n\t\t\t}", "protected final void operationEOR(final int data) {\r\n this.ac ^= data;\r\n this.zeroFlag = this.ac == 0;\r\n this.signFlag = this.ac >= 0x80;\r\n }", "private void updateControlValues(RangeSlider rs, String parameter)\n\t{\n\t\tMap<String, Double> parameterValues_low\t\t= new HashMap<String, Double>();\n\t\tMap<String, Double> parameterValues_high\t= new HashMap<String, Double>();\n\t\t\n\t\tfor (String param : rangeSliders.keySet()) {\n\t\t\tparameterValues_low.put(param, rs.getLowValue() >= rangeSliders.get(param).getMin() ? rs.getLowValue() : rangeSliders.get(param).getMin());\n\t\t\tparameterValues_high.put(param, rs.getHighValue() <= rangeSliders.get(param).getMax() ? rs.getHighValue() : rangeSliders.get(param).getMax());\n\t\t}\n\t\t\t\n \tswitch (parameter) \n \t{\n \t\tcase \"alpha\":\n \t\t\talpha_min_textfield.setText(String.valueOf(parameterValues_low.get(\"alpha\")));\n \talpha_max_textfield.setText(String.valueOf(parameterValues_high.get(\"alpha\")));\n \t\tbreak;\n \t\t\n \t\tcase \"eta\":\n \t \teta_min_textfield.setText(String.valueOf(parameterValues_low.get(\"eta\")));\n \teta_max_textfield.setText(String.valueOf(parameterValues_high.get(\"eta\")));\n \tbreak;\n \t\t\n \t\tcase \"kappa\":\n \t\t\tkappa_min_textfield.setText(String.valueOf(parameterValues_low.get(\"kappa\")));\n \tkappa_max_textfield.setText(String.valueOf(parameterValues_high.get(\"kappa\")));\n \tbreak;\t\n \t}\n\t}", "private void set_y(int RHS)\n {\n try\n {\n set_reg(28,Utils.get_lobyte(RHS));\n set_reg(29,Utils.get_hibyte(RHS));\n }\n catch(RuntimeException e) { }\n }", "public LogicGateAND() {\r\n\t\t// Initialize input and output ports\r\n\t\tsuper(Operators.AND, new IDynamicInterface(2), new IFixedInterface(new IPort()));\r\n\t}", "public void executeBR(){\n\t\tBitString conditions = mIR.substring(4, 3);\n\t\tBitString setInstruction = mIR.substring(7, 9);\n\t\tboolean ccMatch = false;\n\t\tfor (int i = 0; i < conditions.getLength() ; i++) {\n\t\t\tif(conditions.substring(i, 1).getValue() + mCC.substring(i, 1).getValue() == 2){\n\t\t\t\tccMatch = true;\n\t\t\t}\n\t\t}\n\n\t\tif(ccMatch){\n\t\t\tmPC.setValue(mPC.getValue() + setInstruction.getValue2sComp());\n\t\t}\n\t}", "protected void initValuesFromControlRecord() {\n int count = getControlRecords().size();\n for (int i = 0; i < count; i++) {\n setCurrentNbaMibPlanFControl((NbaMibPlanFControl) getControlRecords().get(i));\n if (getCurrentNbaMibPlanFControl().getOrganizationCode().equalsIgnoreCase(getCurrentCarrierCode())) {\n break;\n }\n }\n setStartDate(getCurrentNbaMibPlanFControl().getHighWaterDate());\n setStartRecord(getCurrentNbaMibPlanFControl().getNextRecord());\n }", "@Test\r\n public void deriveFromBinaryXorAssignmentExpressionWithSIUnits() throws IOException {\n check(\"varI_M^=9\", \"(int,m)\");\r\n //example with long m &= int\r\n check(\"varL_KMe2perH^=9\", \"(long,km^2/h)\");\r\n }", "public com.opentext.bn.converters.avro.entity.DocumentEvent.Builder setControlNumber(java.lang.String value) {\n validate(fields()[4], value);\n this.controlNumber = value;\n fieldSetFlags()[4] = true;\n return this;\n }", "public void setValue(String... values) throws DeviceOptionException;", "public void Possible_Answer_Set(int Starting_Value)\r\n\t{\r\n\t\t/*\r\n\t\t * Starts by checking if the Cell has an Answer or not\r\n\t\t * If it does have an answer all other values in the Possible_Answer array are set to false and only the Answer is set to true.\r\n\t\t * If it does not have an answer all values are set to true, this would only accure at the beginning of the program, \r\n\t\t * there is nothing that sets Possible_Answer values to 'true' after this point.\r\n\t\t */\r\n\t\tif(Starting_Value == 0)\r\n\t\t\tfor(int i = 0; i < 9; i++)\r\n\t\t\t\t\tPossible_Answers[i] = true;\r\n\t\telse\r\n\t\t\tfor(int i = 0; i < 9; i++)\r\n\t\t\t\tif(Starting_Value-1==i)\r\n\t\t\t\t\tPossible_Answers[i] = true;\r\n\t\t\t\telse\r\n\t\t\t\t\tPossible_Answers[i] = false;\r\n\t}", "public void set_constant(double cutoff)\r\n\t{\r\n\t\tthis.switchValue = (int)cutoff;\t\r\n\t}", "private double logicalAnd() {\n\t\tdouble q = p<=0.5?p:1-p;\n\t\treturn num * configMap.get('r') + (num-1) * configMap.get('l') + num * configMap.get('f') + configMap.get('t') + q * configMap.get('m') + p * configMap.get('a');\n\t}", "public void enableControls() \n\t{\n\t\tfor (MutablePocket thisPocket: playerPockets) // Enable each control in turn\n\t\t{\n\t\t\tthisPocket.enablePocket();\n\t\t}\n\n\t\tfor(ImmutablePocket thisPocket: goalPockets)\n\t\t{\n\t\t\tthisPocket.enablePocket();\n\t\t}\n\n\t}", "public void setNewNumbers() {\n // select a new operator\n if (charOperators.length == 0) {\n JOptionPane.showMessageDialog(null, \"Must have at least one operation checked. See the Settings menu.\", \"No operations selected\", JOptionPane.ERROR_MESSAGE);\n chkBoxOperators[0].setSelected(true);\n return;\n }\n currentOperator = charOperators[(int)(Math.random() * charOperators.length)];\n opLabel.setText(\"\" + currentOperator);\n \n // get new numbers\n int newLeft = Integer.MIN_VALUE, newRight = Integer.MIN_VALUE;\n \n newLeft = (isFixedTimetable && (inGame||inTest)) ? chosenFixedValue : getNumber(1, timetablepro.TimetablePro.MAX_TIMETABLE);\n\n if (inTest){\n newRight = grabANewNumberForTest();\n } else {\n newRight = getNumber(1, timetablepro.TimetablePro.MAX_TIMETABLE);\n while (rightNumPanel.num == newRight) {\n newRight = getNumber(1, timetablepro.TimetablePro.MAX_TIMETABLE);\n }\n }\n rightNumPanel.num = newRight;\n \n switch (currentOperator) {\n case MINUS: newLeft += newRight; break;\n case DIVIDE: newLeft *= newRight; break;\n }\n \n leftNumPanel.num = newLeft;\n rightNumPanel.num = newRight;\n //out.println(newLeft + \"< >\"+ newRight);\n mainFrame.repaint();\n }", "private void setOneAllChecks() {\r\n\r\n checkIman.setEnabled(true);\r\n checkBonferroni.setEnabled(true);\r\n checkHolm.setEnabled(true);\r\n checkHochberg.setEnabled(true);\r\n checkHommel.setEnabled(true);\r\n checkHolland.setEnabled(true);\r\n checkRom.setEnabled(true);\r\n checkFinner.setEnabled(true);\r\n checkLi.setEnabled(true);\r\n\r\n }", "public void updateOperations() {\n String temp = \"\";\n \n if (chkBoxOperators[0].isSelected()) temp += PLUS;\n if (chkBoxOperators[1].isSelected()) temp += MINUS;\n if (chkBoxOperators[2].isSelected()) temp += TIMES;\n if (chkBoxOperators[3].isSelected()) temp += DIVIDE;\n \n charOperators = temp.toCharArray();\n if (temp.indexOf(currentOperator) == -1) setNewNumbers();\n \n }", "void setValue(int value) {\n if (isPowerOfTwo(value)) {\n this.value = value;\n } else {\n throw new IllegalArgumentException(\"Value has to be a power of 2\");\n }\n }", "private void passAND() {\n\t\tif (currentIndex >= data.length || (data[currentIndex] != 'a' && data[currentIndex] != 'A')) {\n\t\t\tthrow new LexerException(\"Ulaz ne valja!\");\n\t\t}\n\t\tcurrentIndex++;\n\t\tif (currentIndex >= data.length || (data[currentIndex] != 'n' && data[currentIndex] != 'N')) {\n\t\t\tthrow new LexerException(\"Ulaz ne valja!\");\n\t\t}\n\t\tcurrentIndex++;\n\t\tif (currentIndex >= data.length || (data[currentIndex] != 'd' && data[currentIndex] != 'D')) {\n\t\t\tthrow new LexerException(\"Ulaz ne valja!\");\n\t\t}\n\t\tcurrentIndex++;\n\t}", "void xsetControlPosition(org.landxml.schema.landXML11.TrafficControlPosition controlPosition);" ]
[ "0.55590194", "0.55261153", "0.5482778", "0.5428404", "0.53892684", "0.53877497", "0.52125174", "0.5206115", "0.5185807", "0.5141273", "0.5106164", "0.5057405", "0.5028936", "0.50115436", "0.49964923", "0.4989888", "0.49833155", "0.4978429", "0.4945115", "0.49420318", "0.49008253", "0.489342", "0.48912764", "0.48887053", "0.48886722", "0.48585615", "0.4858534", "0.48358777", "0.482104", "0.4798872", "0.47881693", "0.47795042", "0.47793874", "0.47789115", "0.47646174", "0.47368476", "0.47297025", "0.47208276", "0.4699966", "0.46942943", "0.46848157", "0.4672397", "0.46695894", "0.46647128", "0.46582672", "0.4656074", "0.46464556", "0.46352595", "0.46279466", "0.46059182", "0.4604444", "0.46026623", "0.45888397", "0.45813248", "0.45802638", "0.45344543", "0.45339373", "0.4525512", "0.45250607", "0.45219857", "0.4500328", "0.4492049", "0.44912413", "0.4484731", "0.44846192", "0.44822088", "0.44789088", "0.44770497", "0.44769934", "0.44747996", "0.44738418", "0.44731104", "0.44685075", "0.44679227", "0.44551542", "0.44542688", "0.44437838", "0.4443458", "0.44406685", "0.44395846", "0.44384906", "0.44373006", "0.44353586", "0.443503", "0.4434719", "0.44330832", "0.4430921", "0.44299677", "0.44287306", "0.4424836", "0.4416987", "0.4414276", "0.44094762", "0.44014892", "0.4399794", "0.43996948", "0.4399391", "0.43964547", "0.4396016", "0.4395672" ]
0.62391496
0
Returns a copy of the value in the output.
public boolean[] getOutput() { // PROGRAM 1: Student must complete this method // return value is a placeholder, student should replace with correct return boolean[] outputCopy = new boolean[output.length]; //array to hold copy of output. for (int i = 0; i < outputCopy.length; i++) { outputCopy[i] = output[i]; //place output data into outputCopy } return outputCopy; //return copy of output }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public O copy() {\n return value();\n }", "@Override\n public double getOutput() {\n return this.inputValue;\n }", "public TestOut getOutput() {\n\treturn(output);\n }", "public String getOutput() {\n myLock.lock();\n try {\n return myOutput.toString();\n }\n finally {\n myLock.unlock();\n }\n }", "public String getOutValue(){\n return null;\n }", "public InventorySlot getOutput() {\n \t\treturn this.output;\n \t}", "@Override\r\n\tpublic LogicalValue copy() {\r\n\t\treturn new Pointer(target);\r\n\t}", "public Output getOutput() {\n\t\treturn output;\n\t}", "public Output<T> output() {\n return output;\n }", "@Override\n public N value() {\n return value;\n }", "public MutableString copy() {\r\n\t\treturn new MutableString(this.value);\r\n\t}", "public List<Value> getOutput() {\n if ( output == null ) output = new ArrayList<Value>();\n return output;\n }", "public String getOutput() {\r\n return innerStream.getString();\r\n }", "public S getValue() { return value; }", "public com.google.protobuf.ByteString\n getOutputBytes() {\n java.lang.Object ref = output_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n output_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public final T getValue() {\n return this.getValue(this.getBuffer());\n }", "public CompoundTag getCopy() {\n return data.copy();\n }", "public String getOutput() {\n return output.toString();\n }", "public String getOutput() {\n return output;\n }", "public java.lang.String getOutput() {\n java.lang.Object ref = output_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n output_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getOutputValue() {\n// System.out.println(\"geting output value from connection\");\n// System.out.println(\"out:\" + ncOutput.getName() + \" in:\" + ncInput.getName() );\n return _output.getOutputValue();\n }", "public java.lang.String getOutput() {\n java.lang.Object ref = output_;\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 output_ = s;\n return s;\n }\n }", "@Override\n\tpublic Expression copy() {\n\t\treturn null;\n\t}", "public int getOutput() {\n return Output;\n }", "public com.google.protobuf.ByteString\n getOutputBytes() {\n java.lang.Object ref = output_;\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 output_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public T value() {\n\t\treturn value;\n\t}", "public ReactiveValue<T> output() {\n\t\t/*\n\t\t * This records dependency on the state machine. No dependency is recorded on the controlled computation itself.\n\t\t */\n\t\treturn output.value();\n\t}", "V getValue() {\n return value;\n }", "public void copyTo(final T output) {\n output.mGx = mGx;\n output.mGy = mGy;\n output.mGz = mGz;\n }", "public Object getValue() { return _value; }", "public abstract Object getOutput ();", "public Object getValue() { return this.value; }", "public V value()\n\t\t{\n\t\t\treturn _value;\n\t\t}", "public IInputOutput getConstantOuput();", "public String toString() {\n return value;\r\n }", "public Object get()\n {\n return m_internalValue;\n }", "public Output<T> y() {\n return y;\n }", "String getValue()\n {\n return value.toString();\n }", "public Expression deepCopy (){\n return new LiteralExpression(_value);\n }", "public Object getInternalValue()\n {\n return m_internalValue;\n }", "public Object getValue()\n {\n\treturn value;\n }", "public StreamResult getOutput() {\n return output;\n }", "public Object getValue()\n {\n return value;\n }", "public String getPurchasecopy() {\r\n return purchasecopy;\r\n }", "@Override\n\tpublic Object getValue() {\n\t\treturn this ;\n\t}", "@Override\n\tpublic Object getValue() {\n\t\treturn this ;\n\t}", "public String toString() {\n return value;\n }", "public Object getValue()\r\n {\r\n return this.value;\r\n }", "public final Object get() {\n return getValue();\n }", "public Object getValue(){\n \treturn this.value;\n }", "public com.google.protobuf.ByteString getValue() {\n return value_;\n }", "public com.google.protobuf.ByteString getValue() {\n return value_;\n }", "@Override\n public Object getData() {\n return outputData;\n }", "public com.google.protobuf.ByteString getValue() {\n return value_;\n }", "public com.google.protobuf.ByteString getValue() {\n return value_;\n }", "public StringBuilder target() { return out; }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public String getOutput() {\n\t\treturn results.getOutput() ;\n\t}", "public byte[] getValue() {\n return v;\n }", "public T getValue()\n {\n return value;\n }", "public String getPurchasecopy() {\r\n\t\treturn purchasecopy;\r\n\t}", "public Integer getActualoutput() {\n return actualoutput;\n }", "public JsonMember copy() {\n return new JsonMember(name, value.copy());\n }", "public T getValue() {\r\n return value;\r\n }", "@Override\n \tpublic IValue getValue() {\n \t\treturn this;\n \t}", "public T copyOnWrite() {\n T r = ref;\n if(r.getRefCount() <= 1) { return r; }\n @SuppressWarnings(\"unchecked\")\n T r2 = (T)r.clone();\n r.removeRef();\n ref = r2;\n r2.addRef();\n return r2;\n }", "public Object getValue() {\r\n return value;\r\n }", "@Override\n public Object getValue()\n {\n return value;\n }", "protected V getValue() {\n return this.value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public String toString() {\n\t\treturn String.valueOf(this.currentValue);\n\t}", "public\t\tString\t\tgetValue()\n\t\t{\n\t\treturn(\"\" + getNormalizedValue());\n\t\t}", "@Override\r\n public Object getValue() {\r\n return value;\r\n }", "public V getValue() {\r\n\t\treturn value;\r\n\t}", "public final Object getSample()\n { return(this.sample); }", "public Element getOutput(){\n\t\treturn output;\n\t}", "public Object getValue() {\n return value;\n }", "public Object getValue() {\n return value;\n }", "public Object getValue() {\n return value;\n }", "public Object getValue() {\n return value;\n }", "public Object getValue() {\n return value;\n }", "public V getValue() {\n\t\treturn value;\n\t}", "public V getValue() {\n\t\treturn value;\n\t}", "public byte[] getValue() {\n return this.value;\n }", "public static Output out(Object byValue) {\n\t\treturn new Output(byValue);\n\t}", "public Object clone() {\n return this.copy();\n }", "Field getCopy();", "@Override\n\t\tpublic V getValue() {\n\t\t\treturn v;\n\t\t}", "public Object getValue() {\n\t\treturn value;\n\t}", "public Object getValue() {\n\t\treturn value;\n\t}", "@Override\n\t\tpublic V getValue(){\n\t\t\treturn value;\n\t\t}", "public Object currValue();", "private double getValue() {\n return value;\n }", "public double getValue() {\n\t\treturn(value);\n\t}", "public T getValue() {\n return value;\n }", "public T getValue() \n\t{\n\t\treturn value;\n\t}" ]
[ "0.7154235", "0.6504994", "0.63850003", "0.62761563", "0.62351114", "0.60882175", "0.6034554", "0.6022892", "0.6019883", "0.5995625", "0.596829", "0.5966049", "0.5912746", "0.590424", "0.5901872", "0.58835787", "0.5863521", "0.58551216", "0.5843357", "0.58386946", "0.58379453", "0.58358556", "0.5834165", "0.5818283", "0.5812936", "0.58116895", "0.5803839", "0.58012325", "0.5801049", "0.57860243", "0.57732284", "0.57511806", "0.5740578", "0.5725998", "0.57254016", "0.571848", "0.5718395", "0.57163644", "0.57060033", "0.56823075", "0.56822115", "0.56755495", "0.5668326", "0.566285", "0.5661304", "0.5661304", "0.5658787", "0.56584525", "0.5657934", "0.5657361", "0.5655122", "0.5655122", "0.56541085", "0.56499493", "0.56499493", "0.56389993", "0.5638636", "0.5638636", "0.56346506", "0.5625041", "0.56237805", "0.5623674", "0.56231415", "0.5618989", "0.5616503", "0.5610912", "0.56086457", "0.56081754", "0.5596298", "0.5587301", "0.5585412", "0.5585412", "0.5585412", "0.5585412", "0.5583157", "0.55819654", "0.5566864", "0.55660594", "0.5559857", "0.55558527", "0.55517095", "0.55517095", "0.55517095", "0.55517095", "0.55517095", "0.55447626", "0.55447626", "0.5543981", "0.5543301", "0.55409914", "0.55380464", "0.5537664", "0.55329543", "0.55329543", "0.5532183", "0.55318046", "0.55303746", "0.552623", "0.5521968", "0.5518553" ]
0.55774254
76
Returns the value of the zero data member. The zero data member should have been set to true if the result of the operation was zero.
public boolean getZeroFlag() { // PROGRAM 1: Student must complete this method // return value is a placeholder, student should replace with correct return int zero = 0; //integer to keep track of how many '1's are in the output array for (int i = 0; i < output.length; i++) { if (output[i]) { //when we come across a 1, add 1 to the zero integer. zero += 1; } } if (zero > 0) { //if the method caught any '1's, then the output binary number is not 0. zeroFlag = false; } else { zeroFlag = true; //otherwise, it is } return zeroFlag; //return the zeroFlag }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isZero() {return false;}", "public int ZERO() {\n return getInt(setting.ZERO);\n }", "default A isZero() {\n return satisfiesNumberCondition(new NumberCondition<>(0, EQUAL_TO));\n }", "public boolean isZero() {\n\t\treturn ((get() >> 7) & 1) == 1;\n\t}", "CompT zero();", "@Override\r\n\tprotected Integer zero() {\n\t\treturn 0;\r\n\t}", "@Override\n public S isZero() {\n rule.addConstraint(new IsEqualAccordingToCompareToConstraint<>(zero()));\n return myself;\n }", "public Number getCurrentAccessibleValue() {\n return Integer.valueOf(0);\n }", "@Override\n public double getValue() {\n return 0;\n }", "public boolean isZero()\n {\n return Native.fpaIsNumeralZero(getContext().nCtx(), getNativeObject());\n }", "public double result() {return 0;}", "boolean isZero();", "public boolean isZero() {\r\n return (this.getReal() == 0 && this.getImag() == 0) ? true : false;\r\n }", "public boolean isZero()\r\n\t{\r\n\t\tif(this.get_coefficient()==0)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Override\n\tpublic boolean\n\tisZero()\n\t{\n\t\treturn( data[0] == 0 && data[1] == 0 && data[2] == 0 );\n\t}", "@Override\n\tpublic Double get() {\n\t\treturn 0.0;\n\t}", "public boolean isZero() {\n\t\treturn x == 0.0 && y == 0.0 && z == 0.0;\n\t}", "public int baseZeroValue() {\n return this.value - 1;\n }", "public void zero();", "public float getEmptyValue() {\n return EMPTY_VALUE;\n }", "public boolean isZero() {\n return mJavaSize == 0 && mRegisteredNativeSize == 0;\n }", "public void setZero() {\n\t\tset((byte) (get() | (1 << 7)));\n\t}", "public boolean getComputeSumNull() {\n return computeSumNull_;\n }", "private TinyMT32 getZero() {\n TinyMT32 that = new TinyMT32(this);\n that.st0 = 0;\n that.st1 = 0;\n that.st2 = 0;\n that.st3 = 0;\n return that;\n }", "@Override\n public int value() {\n return 0;\n }", "public boolean getComputeSumNull() {\n return computeSumNull_;\n }", "public double t0() {\n\t\treturn 0;\n\t}", "public int getEmptyX()\n\t{\n\t\treturn x0;\n\t}", "public double getx0()\n\t{\n\t\treturn this.x0;\n\t}", "public boolean getField0() {\n return field0_;\n }", "public boolean isZero() {\r\n Vector3 veucl3 = this.getEuclidVector3();\r\n return (veucl3 == null) ? false : veucl3.isZero();\r\n }", "public boolean getField0() {\n return field0_;\n }", "protected T getValue0() {\n\t\treturn value;\n\t}", "public boolean getFlag() {\r\n\t\treturn (value.getInt() != 0);\r\n\t}", "abstract void assignZero();", "@Override\r\n\tpublic float valorFinal() {\n\t\treturn 0;\r\n\t}", "public static numero getZero()\n {\n return new numero(ZERO);\n }", "public int result() {\n return 0;\n }", "public boolean isZero() {\n\n return realPart == 0d && imaginaryPart == 0d;\n }", "public boolean isZero() {\r\n for (int i = 0; i < this.getDimension(); i++) {\r\n if (this.getComponent(i) != 0)\r\n return false;\r\n }\r\n return true;\r\n }", "public final boolean isZeroResultMessageSetted() {\n\t\treturn engine.isPropertySetted(Properties.ZERO_RESULT_MESSAGE);\n\t}", "public float totalValue() {\n return 0;\n }", "public Int0Elements getInt0Access() {\n\t\treturn pInt0;\n\t}", "public void resetZero() {\n\t\tset((byte) (get() & ~(1 << 7)));\n\t}", "public void setZero(final boolean value) {\n\t\tif (value) { \n\t\t\tsetZero();\n\t\t}\n\t\telse {\n\t\t\tresetZero();\n\t\t}\n\t}", "@Override\n\tpublic double classValue() {\n\t\treturn 0;\n\t}", "public Object getBaseValue() {\r\n return Long.valueOf(0);\r\n }", "boolean getComputeSumNull();", "public Number getMinimumAccessibleValue() {\n return Integer.valueOf(0);\n }", "public double getz0()\n\t{\n\t\treturn this.z0;\n\t}", "public boolean hasProperty0() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean zeroFinder()\n {\n return zeroFinder(0);\n }", "public boolean getValuePresent() {\r\n return ValuePresent;\r\n }", "public int getTrueValue()\n {\n\t// Local constants\n\n\t// Local variables\n\n\t/************ Start getTrueValue Method ***************/\n\n // Return true value\n return trueValue;\n\n }", "float getEmpty();", "public boolean isZero()\r\n {\r\n boolean is = true;\r\n for (int i = 0; i < SIZE; i++)\r\n {\r\n if ( this.myArray[i] != 0)\r\n {\r\n is = false;\r\n }\r\n }\r\n return is;\r\n }", "public Object getNoAccess() {\r\n return new Integer(3 / 0);\r\n }", "public Number getMaximumAccessibleValue() {\n return Integer.valueOf(0);\n }", "@Override\n\tpublic double getMetricValue() {\n\n\t\t// TODO Auto-generated method stub\n\t\treturn 0;\n\t}", "static byte getGoalZeroIdx() {\n return GOAL_ZERO_INDEX;\n }", "public boolean getValue() {\r\n\t\treturn this.value;\r\n\t}", "public boolean hasProperty0() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean getEmptyOk() {\r\n return _emptyok;\r\n }", "public int getInital_value(){\n return this.inital_value;\n }", "@Field(offset=23, length=1, paddingChar='0', align=Align.RIGHT)\n\tpublic int getZeros1() {\n\t\treturn 0;\n\t}", "Vector getZeroVector();", "public boolean hasValue() { return false; }", "public boolean getValue();", "public boolean isZeroLength() {\r\n return value.length() == 0;\r\n }", "public boolean hasVal() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@Override\r\n\tpublic int single() {\n\t\treturn 0;\r\n\t}", "public double ValidaValor(){\n\t return 0;\n }", "public Integer newValue(){\n\t\treturn 0;\r\n\t}", "public double inhoud() {\n return 0.0;\n }", "public void zero() {\n fill(0);\n }", "public final void setZero() {\n \t\n\t\tthis.m00 = 0.0F;\n\t\tthis.m01 = 0.0F;\n\t\tthis.m02 = 0.0F;\n\t\tthis.m10 = 0.0F;\n\t\tthis.m11 = 0.0F;\n\t\tthis.m12 = 0.0F;\n\t\tthis.m20 = 0.0F;\n\t\tthis.m21 = 0.0F;\n\t\tthis.m22 = 0.0F;\n }", "public double getUtility() {\n return 0.0;\n }", "@Override\r\n\tpublic int operar() {\n\t\treturn 0;\r\n\t}", "public Boolean getValue() {\n\t\treturn b;\n\t}", "public Boolean verifyTheValueTotalCostIsInZero() {\n\t\tSystem.out.println(\"Starting to verify if the value total cost is equal to zero.\");\n\t\treturn verifyIfSomeStringContainsZeroDotZeroZeroValueInside(getTextByLocator(body_value_total));\n\t}", "public boolean getValueCharacteristicIdNull() {\n return valueCharacteristicIdNull_;\n }", "boolean isZeroReference() {\n return refCount == 0;\n }", "public Boolean value() {\n return this.value;\n }", "public Boolean value() {\n return this.value;\n }", "public Boolean value() {\n return this.value;\n }", "public boolean getValueCharacteristicIdNull() {\n return valueCharacteristicIdNull_;\n }", "String getZeroString()\n {\n return \"\"+0;\n }", "public boolean hasValue() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public Token zero() {\n\t\ttry {\n\t\t\treturn new LongMatrixToken(new long[_rowCount * _columnCount],\n\t\t\t\t\t_rowCount, _columnCount, DO_NOT_COPY);\n\t\t} catch (IllegalActionException illegalAction) {\n\t\t\t// should not happen\n\t\t\tthrow new InternalErrorException(\"LongMatrixToken.zero: \"\n\t\t\t\t\t+ \"Cannot create zero matrix.\");\n\t\t}\n\t}", "public static int BIASED_ONE_OR_ZERO()\n\t{\n\t}", "public Boolean getValue() {\n return this.value;\n }", "public Boolean getValue() {\n return this.value;\n }", "public Boolean getValue() {\n return this.value;\n }", "public Vector3 zeroed() {\n return new Vector3(zeroed(x), zeroed(y), zeroed(z));\n }", "public int getValue()\n\t{\n\t\treturn bitHolder.getValue();\n\t}", "public static double nullToZero(Double d)\n {\n if(d == null)\n {\n return 0;\n }\n else\n {\n return d.doubleValue();\n }\n }", "public boolean getSum() {\n return mXorGate.getOutput();\n }", "public Boolean getValue() {\n return value;\n }", "public double getObjectiveValue() {\n\t\treturn 0;\r\n\t}", "String getZero_or_one();" ]
[ "0.7281174", "0.7194434", "0.718271", "0.7040815", "0.7000912", "0.6978562", "0.67079943", "0.65985286", "0.65974104", "0.65691566", "0.6482554", "0.64442396", "0.641664", "0.64025337", "0.6383929", "0.63578796", "0.6345269", "0.6337535", "0.6333624", "0.63254005", "0.6286931", "0.62789345", "0.62714803", "0.62384397", "0.62206525", "0.62167674", "0.621238", "0.6197776", "0.6188062", "0.61852807", "0.6145096", "0.61399156", "0.6135269", "0.607713", "0.6057627", "0.60265934", "0.60233355", "0.6004281", "0.5983317", "0.59565437", "0.59534353", "0.59461814", "0.5893968", "0.5834324", "0.581603", "0.5810176", "0.58055323", "0.57948995", "0.57727176", "0.5761571", "0.5750895", "0.57459193", "0.57400876", "0.57338935", "0.57238775", "0.57196456", "0.5717967", "0.57162994", "0.57098454", "0.5698349", "0.5698156", "0.569324", "0.5692513", "0.568839", "0.5685058", "0.56687224", "0.5668514", "0.56553525", "0.5651566", "0.5642687", "0.5633049", "0.562824", "0.56087804", "0.5605254", "0.5602772", "0.55727494", "0.55673593", "0.5566824", "0.5565601", "0.55569917", "0.5556098", "0.5551242", "0.5548879", "0.5548879", "0.5548879", "0.55430686", "0.5537331", "0.5522845", "0.55226326", "0.5517684", "0.5509822", "0.5509822", "0.5509822", "0.55038625", "0.54976666", "0.5489947", "0.54863536", "0.5485831", "0.54677474", "0.5462019" ]
0.631991
20
Returns the value of the carryFlag data member. The carryFlag data member is set to true if the ALU addition operation has a carry out of the most significant bit.
public boolean getCarryFlag() { // PROGRAM 1: Student must complete this method // return value is a placeholder, student should replace with correct return //if index of carry out in the array holding the result from add/sub operation is true, if (adder[1]) { carryFlag = true; //there is a carry out. } else { carryFlag = false; //otherwise, there is not. } return carryFlag; //return the carryFlag }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void Perform_ADC()\n {\n d = Utils.GetOperand_XXXXXXX11111XXXX(mMBR);\n r = Utils.GetOperand_XXXXXX1XXXXX1111(mMBR);\n\n dvalue = get_reg(d);\n rvalue = get_reg(r);\n result = dvalue + rvalue;\n if (get_cflag()) result+=1;\n\n set_hflag(CarryFromBit3(dvalue, rvalue, result));\n set_nflag(Utils.bit7(result));\n set_vflag(Overflow(dvalue, rvalue, result));\n set_sflag(get_nflag() ^ get_vflag());\n set_zflag(result == 0);\n set_cflag(CarryFromResult(dvalue, rvalue, result));\n\n try {set_reg(d,result); }\n catch (RuntimeException e) { }\n\n return;\n }", "@Field(11) \n\tpublic byte CombOffsetFlag() {\n\t\treturn this.io.getByteField(this, 11);\n\t}", "public String getCompAccomFlag() {\n return (String)getAttributeInternal(COMPACCOMFLAG);\n }", "public int getAdditionValue() {\r\n\t\treturn additionValue;\r\n\t}", "static int addOne(int[] a, int offset, int mlen, int carry) {\n offset = a.length-1-mlen-offset;\n long t = (a[offset] & LONG_MASK) + (carry & LONG_MASK);\n\n a[offset] = (int)t;\n if ((t >>> 32) == 0)\n return 0;\n while (--mlen >= 0) {\n if (--offset < 0) { // Carry out of number\n return 1;\n } else {\n a[offset]++;\n if (a[offset] != 0)\n return 0;\n }\n }\n return 1;\n }", "public boolean get(Flag flag) {\n return bits.get(flag.getId());\n }", "public int addValue(boolean b) {\n return foldIn(b ? 0 : 1);\n }", "public int getFlags() {\n Object value = library.getObject(entries, FLAGS);\n if (value instanceof Number) {\n return ((Number) value).intValue();\n }\n return 0;\n }", "protected final int getStatusByte() {\r\n return ((this.carryFlag ? 0x01 : 0) + (this.zeroFlag ? 0x02 : 0) + (this.interruptFlag ? 0x04 : 0) + (this.decimalFlag ? 0x08 : 0) + (this.breakFlag ? 0x10 : 0) + 0x20 + (this.overflowFlag ? 0x40 : 0) + (this.signFlag ? 0x80 : 0));\r\n }", "public Byte getOpenConcatFlag() {\n return openConcatFlag;\n }", "public int getAdc ()\n {\n return adc_;\n }", "public Integer getFLAG() {\n return FLAG;\n }", "public boolean getSum() {\n return mXorGate.getOutput();\n }", "protected final void operationADC(final int data) {\r\n int tmp;\r\n\r\n if (this.decimalFlag) {\r\n tmp = 10 * (this.ac & 0xf0) + (this.ac & 0x0f) + (10 * (data & 0xf0) + (data & 0x0f));\r\n tmp = ((tmp / 10) << 4) + tmp % 10;\r\n } else {\r\n tmp = data + this.ac + (this.carryFlag ? 1 : 0);\r\n this.overflowFlag = (((this.ac ^ data) & 0x80) == 0) && (((this.ac ^ tmp) & 0x80) != 0);\r\n }\r\n this.carryFlag = tmp > 0xff;\r\n this.ac = tmp & 0xff;\r\n this.zeroFlag = this.ac == 0;\r\n this.signFlag = this.ac >= 0x80;\r\n }", "public ADC getAdc() {\n return _adc;\n }", "public boolean \ngetFlag( int pFlagNumber ) {\n return ( (fFlagBox & (1 << pFlagNumber)) != 0 );\n}", "public boolean getFlag() {\r\n\t\treturn (value.getInt() != 0);\r\n\t}", "public Character getAdjustmentFeeFlag() {\n return adjustmentFeeFlag;\n }", "public int getValue()\n\t{\n\t\treturn bitHolder.getValue();\n\t}", "public Integer getAnalogValue() {\n return analogValueByte & 0xff;\n }", "public int getFlag()\n {\n return flag;\n }", "public Character getOperationalFlag() {\n return operationalFlag;\n }", "public Integer getUserFlags() {\r\n return userFlags;\r\n }", "protected final void operationLSRAccumulator() {\r\n this.carryFlag = (this.ac & 0x01) != 0;\r\n this.ac >>= 1;\r\n this.zeroFlag = (this.ac == 0);\r\n this.signFlag = false;\r\n }", "public int getFlags() {\n return ByteUtils.toUnsignedShort(flags);\n }", "void carry(Item specifiedItem);", "public short getFlagsCarried() {\n\n return m_flagsCarried;\n }", "public Byte getAnalogValueByte() {\n return analogValueByte;\n }", "private void addition()\n {\n\tint tempSum = 0;\n\tint carryBit = 0;\n\tsum = new Stack<String>();\n\tStack<String> longerStack = pickLongerStack(number, otherNumber);\n\twhile(!longerStack.isEmpty())\n\t{\n\t tempSum = digitOf(number) + digitOf(otherNumber) + carryBit; //adding\n\t carryBit = tempSum / 10;\n\t sum.push((tempSum % 10) + \"\"); //store the digit which is not carryBit\n\t}\n\tif(carryBit == 1) sum.push(\"1\"); //the last carry bit need to be add as very first digit of sum if there is carry bit\n }", "public int getBit() {\r\n return _bit;\r\n }", "private boolean[] addBit(boolean a, boolean b, boolean c) {\n // PROGRAM 1: Student must complete this method\n // This method may only use the Java logic operations && (logical and),\n // || (logical or), and ! (logical not). Do not use any Java arithmetic\n // operators in this method.\n boolean[] result = new boolean[2];\n result[0] = (a ^ b) ^ c; // (a xor b) xor c -> yields the sum\n result[1] = (a && b) || (a ^ b) && c; // (a and b) or (a xor b) and c -> yields the carry-out\n // return value is a placeholder, student should replace with correct return\n return result;\n }", "int getFlag();", "public long getFlags() {\n }", "public org.apache.axis.types.UnsignedInt getFlags() {\n return flags;\n }", "public static int getBit(boolean value) {\n return value ? Constants.BIT_TRUE : Constants.BIT_FALSE;\n }", "public int getSum(int a, int b) {\n\n while(b!=0){ //check till carry is not equal to zero\n int carry = a&b;\n a=a^b;\n b=carry<<1;\n }\n return a;\n }", "public short getFlag() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readShort(__io__address + 6);\n\t\t} else {\n\t\t\treturn __io__block.readShort(__io__address + 6);\n\t\t}\n\t}", "public Boolean getFlag() {\n return flag;\n }", "public boolean get(CoolingFlag cooldownFlags) {\n return cooldowns.get(cooldownFlags.ordinal());\n }", "long getFlags();", "@Override\n public int getFlag() {\n return flag_;\n }", "public int getFlag() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readInt(__io__address + 20);\n\t\t} else {\n\t\t\treturn __io__block.readInt(__io__address + 12);\n\t\t}\n\t}", "public int getFlag() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readInt(__io__address + 4);\n\t\t} else {\n\t\t\treturn __io__block.readInt(__io__address + 4);\n\t\t}\n\t}", "public int getACsum() {\n return (int)sum;\n }", "public Integer getCorrectflag() {\n return correctflag;\n }", "@Override\n public int getFlag() {\n return flag_;\n }", "static int add(int a, int b){\n int carry = 0;\n int result = 0;\n int i;\n for(i=0; a>0||b>0; i++){\n int ba = a&1;\n int bb = b&1;\n result = result|((carry^ba^bb)<<i);\n carry = (ba&bb) | (bb&carry) | (carry&ba);\n a = a>>1;\n b = b>>1;\n }\n return result|(carry<<i);\n }", "@Field(12) \n\tpublic byte CombHedgeFlag() {\n\t\treturn this.io.getByteField(this, 12);\n\t}", "public boolean getFlag() {\n\t\treturn flag;\n\t}", "public boolean getFlag(){\n\t\treturn flag;\n\t}", "public Character getCurrentFlag() {\n return currentFlag;\n }", "public int getTrueValue()\n {\n\t// Local constants\n\n\t// Local variables\n\n\t/************ Start getTrueValue Method ***************/\n\n // Return true value\n return trueValue;\n\n }", "public Character getCertifiedFlag() {\n return certifiedFlag;\n }", "public String getActiveFlag() {\n return (String) getAttributeInternal(ACTIVEFLAG);\n }", "public byte getCLA() {\n return this.apdu_buffer[CLASS];\n }", "public String getAddInt() {\n this.addInt();\n return this.addintegral;\n\n }", "public short getFlags() {\n\treturn flags;\n }", "public boolean getCarry() {\n return mAndGate.getOutput();\n }", "public Boolean getValue() {\n\t\treturn b;\n\t}", "protected final void operationCMP(final int data) {\r\n this.carryFlag = this.ac >= data;\r\n this.zeroFlag = this.ac == data;\r\n this.signFlag = ((this.ac - data) & 0xff) >= 0x80;\r\n }", "public int getFlags() {\n return flags;\n }", "public int addConditionFlagClear(int flag) {\r\n\t\tbackSteps.push(COPROC1_CONDITION_CLEAR, pc(), flag);\r\n\t\treturn flag;\r\n\t}", "public char flags_GET()\n { return (char)((char) get_bytes(data, 0, 1)); }", "public String getActiveflag() {\n return (String)getAttributeInternal(ACTIVEFLAG);\n }", "public byte getCLA() {\n\treturn (byte) (header[0] & 0xFF);\n }", "public int getSum(int a, int b) {\n if(a == 0) {\n return b;\n }\n\n if(b == 0) {\n return a;\n }\n\n int carry = 0;\n\n while(b != 0) {\n\n // If both bits are 1, we set the bit to the left (<<1) to 1 -- this is the carry step\n carry = (a & b) << 1;\n\n // If both bits are 1, this will give us 0 (we will have a carry from the step above)\n // If only 1 bit is 1, this will give us 1 (there is nothing to carry)\n a = a ^ b;\n\n b = carry;\n }\n\n return a;\n }", "public @Flags int getFlags() {\n return mFlags;\n }", "public int getFlagsNumber ()\r\n {\r\n return flagsNumber;\r\n }", "protected final byte operationROL(final byte data) {\r\n int data_ = (data & 0xff) << 1;\r\n\r\n if (this.carryFlag) {\r\n ++data_;\r\n }\r\n this.carryFlag = data_ >= 0x100;\r\n data_ &= 0xff;\r\n this.zeroFlag = data_ == 0;\r\n this.signFlag = data_ >= 0x80;\r\n\r\n return (byte)data_;\r\n }", "public int getAddCount() {\n return addCount;\n }", "public Character getActiveFlag() {\n return activeFlag;\n }", "public Short getDelFlag() {\n\t\treturn delFlag;\n\t}", "public boolean isRCODEInFlagAllZero()\n {\n if ((this.flag & 0x000F) == 0)\n {\n return true;\n }\n else return false;\n }", "public Character getRentalFlag() {\n return rentalFlag;\n }", "public Integer getDefaultFlag() {\n return defaultFlag;\n }", "public ListNode addOneH(ListNode num, boolean carry) {\n // Base Case: Number has no value, check for carried value\n if(num == null) {\n return carry ? new ListNode(1) : null;\n }\n // Number has value\n int sum = num.val + (carry ? 1 : 0);\n ListNode result = new ListNode(sum % 10);\n carry = sum > 9;\n // Recursive call in the case of a carry, otherwise chain nodes from original value\n result.next = carry ? addOneH(num.next, carry) : num.next;\n return result;\n }", "default int getCompositeBitLength() {\n return getHighBitLength() + getLowBitLength();\n }", "public boolean isCarry() {\n\t\treturn ((get() >> 4) & 1) == 1;\n\t}", "public int get_sum_a() {\n return (int)getSIntBEElement(offsetBits_sum_a(), 32);\n }", "public Byte getAuditFlag() {\n return auditFlag;\n }", "public Boolean getC8() {\n\t\treturn c8;\n\t}", "public long CRC() {\n long retval = 0;\n retval += ((data[3] << 24) + (data[2] << 16) + (data[1] << 8) + data[0]);\n retval += ((data[7] << 24) + (data[6] << 16) + (data[5] << 8) + data[4]);\n retval += ((data[11] << 24) + (data[10] << 16) + (data[9] << 8) + data[8]);\n retval += ((data[15] << 24) + (data[14] << 16) + (data[13] << 8) + data[12]);\n return retval;\n }", "public java.lang.String getContractFlag() {\n return contractFlag;\n }", "public String getUseFlag() {\n return useFlag;\n }", "protected final byte operationROR(final byte data) {\r\n int data_ = data & 0xff;\r\n\r\n if (this.carryFlag) {\r\n data_ |= 0x100;\r\n }\r\n this.carryFlag = (data_ & 0x01) != 0;\r\n data_ >>= 1;\r\n this.zeroFlag = data_ == 0;\r\n this.signFlag = data_ >= 0x80;\r\n\r\n return (byte)data_;\r\n }", "public long getCas() {\n return casValue.getCas();\n }", "public int getFECHACRREVAL() {\n return fechacrreval;\n }", "public BigDecimal getACC_CY() {\r\n return ACC_CY;\r\n }", "protected final void operationASL(final int adr) {\r\n int data = readByte(adr) & 0xff;\r\n\r\n this.carryFlag = data >= 0x80;\r\n data = (data << 1) & 0xff;\r\n writeByte(adr, (byte) data);\r\n this.zeroFlag = data == 0;\r\n this.signFlag = data >= 0x80;\r\n }", "public TCheckSumValue getCheckSumValue() {\n\n\t\treturn checkSumValue;\n\t}", "public Character getBackFeeFlag() {\n return backFeeFlag;\n }", "public boolean hasAA() {\n return fieldSetFlags()[17];\n }", "@Field(11) \n\tpublic CKSCOSStatusField CombOffsetFlag(byte CombOffsetFlag) {\n\t\tthis.io.setByteField(this, 11, CombOffsetFlag);\n\t\treturn this;\n\t}", "public Character getRenewalOpenFlag() {\n return renewalOpenFlag;\n }", "public Byte getMobileVerifyFlag() {\n return mobileVerifyFlag;\n }", "public Byte getModFlag() {\n return modFlag;\n }", "public RecordFlagEnum getFlag();", "private static int add(int x, int y) {\n\n\n while (y != 0) {\n // carry now contains common\n //set bits of x and y\n int carry = (x & y);\n\n\n // Sum of bits of x and y where at\n //least one of the bits is not set\n x = (x ^ y);\n\n\n // Carry is shifted by one so that adding\n // it to x gives the required sum\n y = (carry << 1);\n }\n\n if (x > 255)\n x = x - 255; //101011111\n\n return x;\n }", "public Boolean getSum() {\n return sum;\n }", "public Boolean getActiveFlag() {\n\t\treturn activeFlag;\n\t}" ]
[ "0.5519324", "0.54707855", "0.5412647", "0.53346694", "0.52689826", "0.5229404", "0.522481", "0.5164724", "0.5107099", "0.50992614", "0.50770825", "0.5053013", "0.5038327", "0.49975958", "0.4984728", "0.49678928", "0.49629632", "0.49564818", "0.491973", "0.49114403", "0.48977605", "0.48941648", "0.4881577", "0.4871644", "0.48493025", "0.48389292", "0.48096457", "0.48044038", "0.48021534", "0.47961408", "0.47834983", "0.47516173", "0.47424033", "0.47243646", "0.47182098", "0.4714237", "0.4709408", "0.47088146", "0.47009924", "0.46878123", "0.46652877", "0.46518415", "0.46448302", "0.4642303", "0.46210033", "0.46157905", "0.46103638", "0.46096006", "0.46081153", "0.46038678", "0.4555331", "0.45518515", "0.4525469", "0.45157775", "0.44885468", "0.44861346", "0.44859457", "0.44832692", "0.44791463", "0.4478547", "0.4460346", "0.44595933", "0.44522136", "0.44516608", "0.44456756", "0.44256863", "0.44248635", "0.44234318", "0.44214803", "0.44189242", "0.44126615", "0.4410154", "0.4405737", "0.44022378", "0.43972027", "0.43965027", "0.43930724", "0.43923777", "0.43840116", "0.43773684", "0.43746424", "0.4374553", "0.43699408", "0.43411663", "0.43398234", "0.43360552", "0.4335609", "0.4333436", "0.4332733", "0.43292683", "0.43281323", "0.43240416", "0.43230918", "0.43207538", "0.43137428", "0.43092296", "0.43061453", "0.43035236", "0.4302167", "0.429817" ]
0.67165023
0
Returns the value of the overflowFlag data member. The overflowFlag data member is set to true if the ALU addition operation has a result that is overflow when the operands are signed integers.
public boolean getOverflowFlag() { // PROGRAM 1: Student must complete this method // return value is a placeholder, student should replace with correct return if (Binary.binToSDec(inputA) > 0 && Binary.binToSDec(inputB) > 0) { //if the decimal rep of both inputs are positive, if (Binary.binToSDec(output) < 0) { // and the output is negative, overflowFlag = true; //overflow has occured } } else if (Binary.binToSDec(inputA) < 0 && Binary.binToSDec(inputB) < 0) { //if the decimal rep of both inputs are negative, if (Binary.binToSDec(output) > 0) { //and the output is positive overflowFlag = true; //overflow has occured } } else { overflowFlag = false; //otherwise, overflow has not occured. } return overflowFlag; //return the value of overflowFlag }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getAdditionValue() {\r\n\t\treturn additionValue;\r\n\t}", "public boolean isInOverflow() {\n \tif (overflow == true){\n \t\treturn true;\n \t}\n \telse{\n \t\treturn false;\n \t}\n }", "public int addValue(boolean b) {\n return foldIn(b ? 0 : 1);\n }", "public long toInt(boolean isSigned) {\r\n\t\treturn LLVMGenericValueToInt(ref, isSigned ? 1 : 0);\r\n\t}", "public int get_sum_a() {\n return (int)getSIntBEElement(offsetBits_sum_a(), 32);\n }", "public String getAddInt() {\n this.addInt();\n return this.addintegral;\n\n }", "public final int getAndAdd(int delta) {\n return unsafe.getAndAddInt(this, valueOffset, delta);\n }", "private static void checkOverflow(short value1, short value2) {\n \tif ((value1 > 0 && value2 > 0) && (value1 + value2 < 0)) {\n \t\toverflowFlag = true;\n \t} else if ((value1 < 0 && value2 < 0) && (value1 + value2 > 0)) {\n \t\toverflowFlag = true;\n \t} else {\n \t\toverflowFlag = false;\n \t}\n }", "public synchronized void overflow() {\n overflowCountStat.received();\n overflowCount++;\n }", "private boolean Overflow(int dvalue, int rvalue, int result)\n {\n return ((Utils.bit7(dvalue) && Utils.bit7(rvalue) && !Utils.bit7(result)) || (!Utils.bit7(dvalue) && !Utils.bit7(rvalue) && Utils.bit7(result)));\n }", "public int addValue(short i) {\n return foldIn(i);\n }", "public int getOverflowCounter() \n\t{\n\treturn fOverflowCounter;\n\t}", "public int get_sum_e() {\n return (int)getSIntBEElement(offsetBits_sum_e(), 32);\n }", "public int add(intHolder op)\n {\n int sum = op.getInt()+storageInt;\n return sum;\n }", "@Override\n public ImpValue plus(ImpValue iv) {\n return iv.plusBool(this);\n }", "public long getUInt() { return bb.getInt() & 0xffff_ffffL; }", "public HugeUInt add(int intArg) {\r\n HugeUInt arg = new HugeUInt(intArg);\r\n return new HugeUInt(this.add(arg));\r\n }", "BigInteger add(long val) {\n if (val == 0)\n return this;\n if (signum == 0)\n return valueOf(val);\n if (Long.signum(val) == signum)\n return new BigInteger(add(mag, Math.abs(val)), signum);\n int cmp = compareMagnitude(val);\n if (cmp == 0)\n return ZERO;\n int[] resultMag = (cmp > 0 ? subtract(mag, Math.abs(val)) : subtract(Math.abs(val), mag));\n resultMag = trustedStripLeadingZeroInts(resultMag);\n return new BigInteger(resultMag, cmp == signum ? 1 : -1);\n }", "public int getUnsignedValue() {\n return num & 0xFF;\n }", "public int getValueOfBonus() {\n return valueOfBonus;\n }", "public int getInt(){\n return new BigInteger(this.value).intValue();\n }", "public Integer getAnalogValue() {\n return analogValueByte & 0xff;\n }", "public Integer add();", "public org.apache.axis2.databinding.types.UnsignedInt getUnsignedInt() {\n return localUnsignedInt;\n }", "public final int addAndGet(int delta) {\n return unsafe.getAndAddInt(this, valueOffset, delta) + delta;\n }", "private int signBit() {\n return signum < 0 ? 1 : 0;\n }", "static int addOne(int[] a, int offset, int mlen, int carry) {\n offset = a.length-1-mlen-offset;\n long t = (a[offset] & LONG_MASK) + (carry & LONG_MASK);\n\n a[offset] = (int)t;\n if ((t >>> 32) == 0)\n return 0;\n while (--mlen >= 0) {\n if (--offset < 0) { // Carry out of number\n return 1;\n } else {\n a[offset]++;\n if (a[offset] != 0)\n return 0;\n }\n }\n return 1;\n }", "public void visitIADD(IADD o){\n\t\tif (stack().peek() != Type.INT){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'int', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t\tif (stack().peek(1) != Type.INT){\n\t\t\tconstraintViolated(o, \"The value at the stack next-to-top is not of type 'int', but of type '\"+stack().peek(1)+\"'.\");\n\t\t}\n\t}", "@Nonnull\r\n\tpublic static Observable<Integer> longToInt(@Nonnull Observable<Long> source, final boolean overflow) {\r\n\t\treturn select(source, overflow ? Functions.LONG_TO_INT_CHECKED : Functions.LONG_TO_INT);\r\n\t}", "@Override\n public IntType addToInt(IntType IntType) {\n int int1 = IntType.getValue();\n int int2 = this.asInt().getValue();\n return TypeFactory.getIntType(int1 + int2);\n }", "public int getUnsignedShort() {\n\t\treturn payload.getUnsignedShort();\n\t}", "UnsignedInt getTotal();", "public int addValue(float f) {\n return foldIn(Float.floatToIntBits(f));\n }", "public void addTrueNegative(long delta) {\n trueNegative += delta;\n }", "public float getAddHealth()\n {\n return addHealth;\n }", "private void addition()\n {\n\tint tempSum = 0;\n\tint carryBit = 0;\n\tsum = new Stack<String>();\n\tStack<String> longerStack = pickLongerStack(number, otherNumber);\n\twhile(!longerStack.isEmpty())\n\t{\n\t tempSum = digitOf(number) + digitOf(otherNumber) + carryBit; //adding\n\t carryBit = tempSum / 10;\n\t sum.push((tempSum % 10) + \"\"); //store the digit which is not carryBit\n\t}\n\tif(carryBit == 1) sum.push(\"1\"); //the last carry bit need to be add as very first digit of sum if there is carry bit\n }", "abstract boolean isOverflow();", "public int getFlags() {\n Object value = library.getObject(entries, FLAGS);\n if (value instanceof Number) {\n return ((Number) value).intValue();\n }\n return 0;\n }", "public int addValue(byte i) {\n return foldIn(i);\n }", "public Integer getUserFlags() {\r\n return userFlags;\r\n }", "private int signInt() {\n return signum < 0 ? -1 : 0;\n }", "public int getSumaAdunata() {\n return sumaAdunata_;\n }", "public boolean getSum() {\n return mXorGate.getOutput();\n }", "public int getSumaAdunata() {\n return sumaAdunata_;\n }", "public int getOneof1111() {\n if (hugeOneofCase_ == 1111) {\n return (java.lang.Integer) hugeOneof_;\n }\n return 0;\n }", "public long getSum()\n {\n long sum = 0;\n\n for(int i = 0; i < integerList.length; i++)\n {\n sum = sum + integerList[i];\n }\n\n return sum;\n }", "public static final int signedToInt(short w) {\n \t\treturn (w & 0xffff);\n \t}", "public int getOneof1111() {\n if (hugeOneofCase_ == 1111) {\n return (java.lang.Integer) hugeOneof_;\n }\n return 0;\n }", "public int getValue()\n\t{\n\t\treturn bitHolder.getValue();\n\t}", "public int getFlags() {\n return ByteUtils.toUnsignedShort(flags);\n }", "public int getInt() {\r\n\t\treturn (value.getInt());\r\n\t}", "public static int addOrSubtract(Buffer lexemes) {\n int value = multiplyOrDivide(lexemes);\n while (true) {\n Lexeme lexeme = lexemes.next();\n switch (lexeme.type) {\n case PLUS:\n value += multiplyOrDivide(lexemes);\n break;\n case MINUS:\n value -= multiplyOrDivide(lexemes);\n break;\n case END_OF_LINE:\n case CLOSE_BRACKET:\n lexemes.back();\n return value;\n default:\n throw new RuntimeException(\"Unexpected token: \" + lexeme.value\n + \" at position: \" + lexemes.getPos());\n }\n }\n }", "public Boolean getSum() {\n return sum;\n }", "boolean add(int value);", "public java.lang.Long getUnionLong() {\n return unionLong;\n }", "public int getIntegerValue() {\r\n\t\t\treturn val;\r\n\t\t}", "public static final long signedToLong(int x) {\n \t\treturn (x & 0xFFFFFFFFL);\n \t}", "public final long getAndAdd(long delta) {\n\t\tlong r = value;\n\t\tvalue += delta;\n\t\treturn r;\n\t}", "static long add(long a, long b){\n\t\treturn a+b;\n\t}", "public static long getUnsignedInt(int x) {\n return x & 0x00000000ffffffffL;\n }", "public static boolean isSigned_sum_e() {\n return true;\n }", "public org.apache.axis2.databinding.types.UnsignedLong getUnsignedLong() {\n return localUnsignedLong;\n }", "public int addValue(Object obj) {\n return foldIn((obj != null) ? obj.hashCode() : 0);\n }", "long getAndAdd(long delta);", "public java.lang.Long getUnionLong() {\n return unionLong;\n }", "public long readUnsignedIntLE()\r\n/* 847: */ {\r\n/* 848:856 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 849:857 */ return super.readUnsignedIntLE();\r\n/* 850: */ }", "public Integer getSum() {\n return sum;\n }", "private static int getFlagValue (Shape shape)\r\n {\r\n switch (shape) {\r\n case FLAG_1:\r\n case FLAG_1_UP:\r\n return 1;\r\n\r\n case FLAG_2:\r\n case FLAG_2_UP:\r\n return 2;\r\n\r\n case FLAG_3:\r\n case FLAG_3_UP:\r\n return 3;\r\n\r\n case FLAG_4:\r\n case FLAG_4_UP:\r\n return 4;\r\n\r\n case FLAG_5:\r\n case FLAG_5_UP:\r\n return 5;\r\n }\r\n\r\n logger.error(\"Illegal flag shape: {}\", shape);\r\n\r\n return 0;\r\n }", "private static int[] add(int[] x, long val) {\n int[] y;\n long sum = 0;\n int xIndex = x.length;\n int[] result;\n int highWord = (int)(val >>> 32);\n if (highWord == 0) {\n result = new int[xIndex];\n sum = (x[--xIndex] & LONG_MASK) + val;\n result[xIndex] = (int)sum;\n } else {\n if (xIndex == 1) {\n result = new int[2];\n sum = val + (x[0] & LONG_MASK);\n result[1] = (int)sum;\n result[0] = (int)(sum >>> 32);\n return result;\n } else {\n result = new int[xIndex];\n sum = (x[--xIndex] & LONG_MASK) + (val & LONG_MASK);\n result[xIndex] = (int)sum;\n sum = (x[--xIndex] & LONG_MASK) + (highWord & LONG_MASK) + (sum >>> 32);\n result[xIndex] = (int)sum;\n }\n }\n // Copy remainder of longer number while carry propagation is required\n boolean carry = (sum >>> 32 != 0);\n while (xIndex > 0 && carry)\n carry = ((result[--xIndex] = x[xIndex] + 1) == 0);\n // Copy remainder of longer number\n while (xIndex > 0)\n result[--xIndex] = x[xIndex];\n // Grow result if necessary\n if (carry) {\n int bigger[] = new int[result.length + 1];\n System.arraycopy(result, 0, bigger, 1, result.length);\n bigger[0] = 0x01;\n return bigger;\n }\n return result;\n }", "io.dstore.values.BooleanValue getComputeSum();", "@Override\n\tpublic int add(int val1, int val2) {\n\t\tthis.test++;\n\t\tSystem.out.println(this.test);\n\t\treturn val1+val2;\n\t}", "public org.apache.axis2.databinding.types.UnsignedShort getUnsignedShort() {\n return localUnsignedShort;\n }", "public org.apache.axis.types.UnsignedInt getFlags() {\n return flags;\n }", "public Integer getFLAG() {\n return FLAG;\n }", "public int getValue() {\n\t\t// Precondition -- The value is a non-negative integer.\n\t\tassert(value >= 0);\n\t\t\n\t\treturn value;\n\t}", "public boolean \ngetFlag( int pFlagNumber ) {\n return ( (fFlagBox & (1 << pFlagNumber)) != 0 );\n}", "@Override\n public long addlong(long o1, long o2) {\n return o1 + o2;\n }", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default int asInt() {\n \n return notSupportedCast(BasicTypeID.INT);\n }", "public byte getSignedValue() {\n return num;\n }", "public int getIntValue(){\n\t\treturn value.intValue();\n\t}", "public short getFlag() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readShort(__io__address + 6);\n\t\t} else {\n\t\t\treturn __io__block.readShort(__io__address + 6);\n\t\t}\n\t}", "public boolean hasIntValue() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "public long getSignificandUInt64()\n {\n Native.LongPtr res = new Native.LongPtr();\n if (!Native.fpaGetNumeralSignificandUint64(getContext().nCtx(), getNativeObject(), res))\n throw new Z3Exception(\"Significand is not a 64 bit unsigned integer\");\n return res.value;\n }", "public int getIntegerValue()\n {\n// if (val != Math.round(val))\n// System.err.println(\"IntegerYoVariable: returning a different value than what it used to be.\");\n return val;\n }", "public int evaluateAsInt();", "public final void rule__OpAdd__Alternatives() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:1953:1: ( ( '+' ) | ( '-' ) )\n int alt8=2;\n int LA8_0 = input.LA(1);\n\n if ( (LA8_0==23) ) {\n alt8=1;\n }\n else if ( (LA8_0==24) ) {\n alt8=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return ;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 8, 0, input);\n\n throw nvae;\n }\n switch (alt8) {\n case 1 :\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:1954:1: ( '+' )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:1954:1: ( '+' )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:1955:1: '+'\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getOpAddAccess().getPlusSignKeyword_0()); \n }\n match(input,23,FOLLOW_23_in_rule__OpAdd__Alternatives4123); if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getOpAddAccess().getPlusSignKeyword_0()); \n }\n\n }\n\n\n }\n break;\n case 2 :\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:1962:6: ( '-' )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:1962:6: ( '-' )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:1963:1: '-'\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getOpAddAccess().getHyphenMinusKeyword_1()); \n }\n match(input,24,FOLLOW_24_in_rule__OpAdd__Alternatives4143); if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getOpAddAccess().getHyphenMinusKeyword_1()); \n }\n\n }\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public int calcSum() {\n\t\tint sum = 0;\n\t\tfor (int count = 0; count < data.size(); count++)\n\t\t\tsum += (int)data.get(count);\n\t\treturn sum;\n\t}", "boolean isAdditionAllowed();", "public Long getIsUnionRule() {\n return this.IsUnionRule;\n }", "public int intVal() {\r\n\t\t\tassert kind == Kind.INTEGER_LITERAL;\r\n\t\t\treturn Integer.valueOf(String.copyValueOf(chars, pos, length));\r\n\t\t}", "public int intValue( )\n {\n return value;\n }", "int boolToInt(boolean a) {\n return Boolean.compare(a, false);\n }", "long getFlags();", "public int getAppendExpValue() {\n\t\treturn appendExpValue;\n\t}", "@Test(expected = IOException.class)\n\tpublic void testUint32Overflow() throws IOException {\n\t\tBinaryReader br = br(true, 0xff, 0xff, 0xff, 0xff, 0xff);\n\t\tint value = br.readNextUnsignedIntExact();\n\t\tAssert.fail(\n\t\t\t\"Should not be able to read a value that is larger than what can fit in java 32 bit int: \" +\n\t\t\t\tInteger.toUnsignedString(value));\n\t}", "public Long getAInteger() {\r\n return aInteger;\r\n }", "static public int convertBoolToInt(boolean cat){\n\t\tif(cat){\n\t\t\treturn CAT_DANGER;\n\t\t}else{\n\t\t\treturn CAT_SAFE;\n\t\t}\n\t}", "public short getLEShortA() {\n\t\tint i = payload.get() - 128 & 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}", "@Override\n public int getBasicValue() {\n return minBonus;\n }", "public boolean hasIntValue() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }" ]
[ "0.55409324", "0.49826667", "0.49211538", "0.4835413", "0.48140052", "0.4774774", "0.4746036", "0.47281006", "0.46981317", "0.46354708", "0.4632671", "0.4616954", "0.46141312", "0.4588006", "0.45664883", "0.45536268", "0.45289215", "0.4527603", "0.45247227", "0.4472815", "0.44667602", "0.44524288", "0.4444322", "0.4443921", "0.44430768", "0.44421113", "0.44287828", "0.44262758", "0.43923056", "0.43719825", "0.4371856", "0.43688247", "0.43644536", "0.434703", "0.43429148", "0.4337278", "0.43315426", "0.43074408", "0.42969254", "0.42904052", "0.4285817", "0.42821276", "0.42782274", "0.42632928", "0.42555723", "0.42547822", "0.42546844", "0.42515868", "0.42457545", "0.42374176", "0.42373747", "0.42329046", "0.42302325", "0.42283922", "0.42251486", "0.42206007", "0.42159688", "0.42114192", "0.4210173", "0.42088178", "0.42068818", "0.42027238", "0.42014223", "0.41860244", "0.41855612", "0.41736656", "0.41559026", "0.4155845", "0.41543427", "0.41486618", "0.4146281", "0.41421196", "0.4139855", "0.41358396", "0.4135002", "0.41344622", "0.41342837", "0.41338035", "0.41337663", "0.41319206", "0.41293535", "0.41279474", "0.41210636", "0.41173998", "0.41161892", "0.41151965", "0.41139016", "0.41071573", "0.41066262", "0.41045034", "0.4099667", "0.40991026", "0.40959066", "0.40953052", "0.40909678", "0.40896735", "0.40834594", "0.40779454", "0.4070119", "0.40691525" ]
0.6629941
0
Activates the ALU so that the ALU performs the operation specified by the control data member on the two input values. When this method is finished, the output data member contains the result of the operation.
public void activate() { // PROGRAM 1: Student must complete this method if (control == 0) { // run and() and(); } else if (control == 1) { //run or() or(); } else if (control == 2) { //run add() add(); } else if (control == 6) { //run sub() sub(); } else if (control == 7) { //run passB() passB(); } else { throw new RuntimeException("invalid control"); //otherwise, there was an invalid control } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tsynchronized void execute() {\n\t\t_dataOUTPipe.dataIN(op1.getText());\n\t\t_dataOUTPipe.dataIN(op2.getText());\n\t\t_dataOUTPipe.dataIN(op.getText());\n\t}", "@Override\n protected void performOperation(FixedBitSet opcode, FixedBitSet tmp1Value, FixedBitSet tmp2Value) {\n LU_OPCODE currentOperation = LU_OPCODE.fromBitSet(opcode);\n\n // Execute the logic based on the current opcode\n FixedBitSet result;\n switch (currentOperation) {\n case XOR:\n result = performXOR(tmp1Value, tmp2Value);\n break;\n case OR:\n result = performOR(tmp1Value, tmp2Value);\n break;\n case AND:\n result = performAND(tmp1Value, tmp2Value);\n break;\n case NOT:\n result = performNOT(tmp1Value);\n break;\n default: //Should not reach\n throw new IllegalStateException(\"Unexpected LU opcode: \" + currentOperation);\n\n }\n\n //Get the appropriate condition codes for this result\n ConditionCode conditionCodes = getConditionCodes(result);\n\n //Set the output\n outputBusConnection.writeValue(result);\n ccBusConnection.writeValue(conditionCodes.toBitSet());\n }", "@Override // kotlin.jvm.functions.Function0\n public Unit invoke() {\n RdsInputItemPresenterImpl.access$setupNewValue(this.a, this.b, \"\", this.c);\n return Unit.INSTANCE;\n }", "private void Perform_ADC()\n {\n d = Utils.GetOperand_XXXXXXX11111XXXX(mMBR);\n r = Utils.GetOperand_XXXXXX1XXXXX1111(mMBR);\n\n dvalue = get_reg(d);\n rvalue = get_reg(r);\n result = dvalue + rvalue;\n if (get_cflag()) result+=1;\n\n set_hflag(CarryFromBit3(dvalue, rvalue, result));\n set_nflag(Utils.bit7(result));\n set_vflag(Overflow(dvalue, rvalue, result));\n set_sflag(get_nflag() ^ get_vflag());\n set_zflag(result == 0);\n set_cflag(CarryFromResult(dvalue, rvalue, result));\n\n try {set_reg(d,result); }\n catch (RuntimeException e) { }\n\n return;\n }", "public void execute() {\n\t\t// XOR GATE OP\n\t\txor.a.set(a.get());\n\t\txor.b.set(b.get());\n\t\txor.execute();\n\t\tsum.set(xor.out.get());\n\n\t\t// AND GATE OP\n\t\tand.a.set(a.get());\n\t\tand.b.set(b.get());\n\t\tand.execute();\n\t\tcarry.set(and.out.get());\n\n\t}", "private void or() {\n // PROGRAM 1: Student must complete this method\n //loop through output array\n for (int i = 0; i < output.length; i++) {\n //take the or of index i of inputA and inputB and place result in output[i]\n output[i] = (inputA[i] | inputB[i]);\n }\n }", "private void updateOutputValues()\n {\n // TODO: You may place code here to update outputY and outputZ\n \t// Drawing code belongs in drawOnTheCanvas\n \t\n // example:\n outputY = inputA && inputC;\n }", "public void execute() {\n\t\tnot_a.in.set(a.get());\n\t\tnot_b.in.set(b.get());\n\n\t\t/* we now execute both of the NOT gates. Each one should\n\t\t * write a value to their output.\n\t\t */\n\t\tnot_a.execute();\n\t\tnot_b.execute();\n\n\n\t\t/* ----- IMPORTANT NOTE 2: -----\n\t\t *\n\t\t * We need to perform NOT twice in this component - since XOR\n\t\t * uses the NOT value of each of the inputs a,b. But we MUST\n\t\t * NOT use the same object twice! Instead, we use two\n\t\t * different NOT objects.\n\t\t *\n\t\t * In a program, this is of course a silly design. But\n\t\t * remember that we are trying to simulate hardware here - and\n\t\t * each component (such as a NOT gate) can only generate one\n\t\t * result per clock tick. So if we want to negate two different\n\t\t * signals for the same calculation, we need two differnt gates.\n\t\t */\n\n\n\t\t/* we now connect various wires to each AND gate. Each AND\n\t\t * checks for \"this value is true, the other is false\"; it does\n\t\t * this by doing the AND of one of the inputs, and the NOT of\n\t\t * the other.\n\t\t *\n\t\t * Note that it's perfectly OK to connect the same input to\n\t\t * two different devices - we just run wires to two different\n\t\t * physical places.\n\t\t */\n\t\tand1.a.set(a.get());\n\t\tand1.b.set(not_b.out.get());\n\n\t\tand2.a.set(not_a.out.get());\n\t\tand2.b.set(b.get());\n\n\t\t/* we execute the two AND gates *AFTER* their inputs are\n\t\t * in place.\n\t\t */\n\t\tand1.execute();\n\t\tand2.execute();\n\n\n\t\t/* the value of XOR is \"this and not that, or not this and that\" -\n\t\t * or, more formally,\n\t\t * (A ~B) + (~A B)\n\t\t * So our last step is to OR the result of the two AND gates\n\t\t * together. Its output is the output from our XOR gate.\n\t\t */\n\t\tor.a.set(and1.out.get());\n\t\tor.b.set(and2.out.get());\n\t\tor.execute();\n\t\tout.set(or.out.get());\n\t}", "static void ori_with_acc(String passed){\n\t\tint val1 = hexa_to_deci(registers.get('A'));\n\t\tint val2 = hexa_to_deci(passed.substring(4));\n\t\tval1 = val1|val2;\n\t\tregisters.put('A',decimel_to_hexa_8bit(val1));\n\t\tmodify_status(registers.get('A'));\n\t}", "public ALU() {\n // PROGRAM 1: Student must complete this method\n //declare input(s) and output arrays\n inputA = new boolean[INT_LENGTH];\n inputB = new boolean[INT_LENGTH];\n output = new boolean[INT_LENGTH];\n //initializes zeroFlag and control\n zeroFlag = false;\n control = 15;\n //initialize each array with random boolean values\n for (int i = 0; i < INT_LENGTH; i++) {\n inputA[i] = random.nextBoolean();\n inputB[i] = random.nextBoolean();\n output[i] = random.nextBoolean();\n }\n }", "protected final void operationORA(final int data) {\r\n this.ac |= data;\r\n this.zeroFlag = this.ac == 0;\r\n this.signFlag = this.ac >= 0x80;\r\n }", "public void setControls() {\r\n System.out.println(\"wire data is \" + this.controllerWire.getData());\r\n String operation = this.controlMemory.get(this.controllerWire.getData());\r\n System.out.println(\"Setting the controls for \" + operation);\r\n if (operation.equalsIgnoreCase(\"add\")) {\r\n //alu.setControl(1);\r\n this.ALUControl.setData(1);\r\n this.ALU_MUXControl.setData(0);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n //aluMUX.setSelect(0);\r\n //regMUX.setSelect(0);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"addi\")) {\r\n //alu.setControl(1);\r\n this.ALUControl.setData(1);\r\n this.ALU_MUXControl.setData(1);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"sub\")) {\r\n //alu.setControl(2);\r\n this.ALUControl.setData(2);\r\n this.ALU_MUXControl.setData(0);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"lw\")) {\r\n// alu.setControl(8); // TODO \r\n this.ALUControl.setData(8);\r\n this.REG_MUXControl.setData(1);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.readWire.setData(1);\r\n memory.setReadWire(this.readWire);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"sw\")) {\r\n //alu.setControl(9); // TODO\r\n this.ALUControl.setData(9);\r\n //regMUX.setSelect(1);\r\n this.writeWire.setData(1);\r\n memory.setWriteWire(writeWire);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(0);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"sll\")) {\r\n //alu.setControl(6);\r\n this.ALUControl.setData(6);\r\n this.ALU_MUXControl.setData(1);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"srl\")) {\r\n //alu.setControl(5);\r\n this.ALUControl.setData(5);\r\n this.ALU_MUXControl.setData(1);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"and\")) {\r\n //alu.setControl(4);\r\n this.ALUControl.setData(4);\r\n this.ALU_MUXControl.setData(0);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"andi\")) {\r\n //alu.setControl(4);\r\n this.ALUControl.setData(4);\r\n this.ALU_MUXControl.setData(1);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"or\")) {\r\n //alu.setControl(3);\r\n this.ALUControl.setData(3);\r\n this.ALU_MUXControl.setData(0);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"ori\")) {\r\n //alu.setControl(3);\r\n this.ALUControl.setData(3);\r\n this.ALU_MUXControl.setData(1);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"nor\")) {\r\n //alu.setControl(7);\r\n this.ALUControl.setData(7);\r\n this.ALU_MUXControl.setData(0);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"beq\")) {\r\n this.PC_MUXControl.setData(0);\r\n this.ALUControl.setData(10);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.ALU_MUXControl.setData(0);\r\n this.registerWrite.setData(0);\r\n registers.setRegWriteControl(this.registerWrite);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n } else if (operation.equalsIgnoreCase(\"bne\")) {\r\n this.PC_MUXControl.setData(0);\r\n this.ALUControl.setData(11);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.ALU_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n this.registerWrite.setData(0);\r\n registers.setRegWriteControl(this.registerWrite);\r\n\r\n } else if (operation.equalsIgnoreCase(\"jr\")) {\r\n this.PC_MUXControl.setData(1);\r\n this.ALUControl.setData(12);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.ALU_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n this.registerWrite.setData(0);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"j\")) {\r\n this.PC_MUXControl.setData(1);\r\n this.ALUControl.setData(12);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.ALU_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n this.registerWrite.setData(0);\r\n registers.setRegWriteControl(this.registerWrite);\r\n\r\n } else if (operation.equalsIgnoreCase(\"jal\")) {\r\n this.PC_MUXControl.setData(1);\r\n this.ALUControl.setData(16);\r\n this.PC_MUXControl.setData(1);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.ALU_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n this.REG_MUXControl.setData(0);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n\r\n } else if (operation.equalsIgnoreCase(\"slt\")) {\r\n this.ALUControl.setData(13);\r\n this.ALU_MUXControl.setData(0);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n } else if (operation.equalsIgnoreCase(\"slti\")) {\r\n this.ALUControl.setData(13);\r\n this.ALU_MUXControl.setData(1);\r\n this.REG_MUXControl.setData(0);\r\n this.PC_MUXControl.setData(0);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n } else if (operation.equalsIgnoreCase(\"sltu\")) {\r\n this.ALUControl.setData(14);\r\n this.ALU_MUXControl.setData(0);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n } else if (operation.equalsIgnoreCase(\"sltui\")) {\r\n this.ALUControl.setData(14);\r\n this.ALU_MUXControl.setData(1);\r\n this.registerWrite.setData(1);\r\n registers.setRegWriteControl(this.registerWrite);\r\n this.REG_MUXControl.setData(0);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n regMUX.setSelect(this.REG_MUXControl);\r\n this.PC_MUXControl.setData(0);\r\n this.pcMUX.setSelect(this.PC_MUXControl);\r\n } else if (operation.equalsIgnoreCase(\"beq\")) {\r\n this.ALUControl.setData(14);\r\n this.ALU_MUXControl.setData(1);\r\n aluMUX.setSelect(this.ALU_MUXControl);\r\n this.registerWrite.setData(0);\r\n registers.setRegWriteControl(this.registerWrite);\r\n }\r\n instructionMemory.wiresLog.get(instructionMemory.COMMANDS_COUNTER).get(1).add(\"ALU CONTROL: \" + this.ALUControl.toString());\r\n instructionMemory.wiresLog.get(instructionMemory.COMMANDS_COUNTER).get(1).add(\"ALU MUX CONTROL: \" + this.ALU_MUXControl.toString());\r\n instructionMemory.wiresLog.get(instructionMemory.COMMANDS_COUNTER).get(1).add(\"PC MUX CONTROL: \" + this.PC_MUXControl.toString());\r\n instructionMemory.wiresLog.get(instructionMemory.COMMANDS_COUNTER).get(1).add(\"REG MUX CONTROL: \" + this.REG_MUXControl.toString());\r\n instructionMemory.wiresLog.get(instructionMemory.COMMANDS_COUNTER).get(1).add(\"MEMORY READ: \" + this.readWire.toString());\r\n instructionMemory.wiresLog.get(instructionMemory.COMMANDS_COUNTER).get(1).add(\"MEMORY WRITE: \" + this.writeWire.toString());\r\n instructionMemory.wiresLog.get(instructionMemory.COMMANDS_COUNTER).get(1).add(\"REGISTER WRITE: \" + this.registerWrite.toString());\r\n this.setRegisterWriteControl();\r\n }", "private void and() {\n // PROGRAM 1: Student must complete this method\n //loop through the output array\n for (int i = 0; i < output.length; i++) {\n //take the and of index i of inputA and inputB and place result in output[i]\n output[i] = inputA[i] & inputB[i];\n }\n }", "public void activate() {\t\t\n\t\t// Put activation code here (computing output based on the network's inputs)\n }", "public void calculate()\n\t{\n\t\tString sourceUnitType = (String)this.sourceUnit.getChoice(this.sourceUnit.getSelectedIndex());\n\t\tString destUnitType = (String)this.destUnit.getChoice(this.destUnit.getSelectedIndex());\n\t\t\n\t\tdouble sourceUnitMultiplier = LengthUnits.getMultiplier(sourceUnitType);\n\t\tdouble destUnitMultiplier = LengthUnits.getMultiplier(destUnitType);\n\t\t\n\t\tdouble units = Integer.parseInt(this.input.getText());\n\t\t\n\t\tthis.outputLabel.setText(String.valueOf((units * (1 / sourceUnitMultiplier)) * destUnitMultiplier));\n\t}", "void setPendingBinaryOperation(DoubleBinaryOperator op);", "public void Activate(float a, float b, float c) {\n if(a>0 && b>0 && c>0)\n {\n Datastore2 datastore2 = (Datastore2) this.datastore;\n datastore2.setTemp_a(a);\n datastore2.setTemp_b(b);\n datastore2.setTemp_c(c);\n mda_efsm.Activate();\n }\n else\n {\n System.out.println(\"Failed. Please input value greater than 0 for all values!\");\n }\n }", "public void control()\n {\n if(this.listOperator.contains(this.operator))\n {\n\n if(this.operator.equals(\"=\")) // If the operator is \"=\"\n {\n // We ask to the model to display the result\n this.calc.getResult();\n }\n else // Else, we give the operator to the model\n {\n this.calc.setOperator(this.operator);\n }\n }\n \n // If the number is ok\n if(this.number.matches(\"^[0-9.]+$\"))\n {\n this.calc.setNumber(this.number);\n }\n\n this.operator = \"\";\n this.number = \"\";\n }", "protected final void operationEOR(final int data) {\r\n this.ac ^= data;\r\n this.zeroFlag = this.ac == 0;\r\n this.signFlag = this.ac >= 0x80;\r\n }", "public int executeOperation(){\n\t\tswitch (operation){\n\t\tcase 1: \n\t\t\treturn var1 + var2;\n\t\tcase 2: \n\t\t\treturn var1 - var2;\n\t\tcase 3: \n\t\t\treturn var1 * var2;\n\t\tcase 4: \n\t\t\treturn var1 / var2;\n\t\t default:\n\t\t\treturn 0;\n\t\t\n\t\t}\n\t}", "@Override\n\tpublic void execute(Machine m) {\n\t\tint value1 = m.getRegisters().getRegister(op1);\n\t\tint value2 = m.getRegisters().getRegister(op2);\n\t\tm.getRegisters().setRegister(result, value1 + value2);\n\t}", "protected void execute() {\n \n \n \torientation.updatePID(RobotMap.navx.getAngle());\n \tRobotMap.motorLeftOne.set(com.ctre.phoenix.motorcontrol.ControlMode.PercentOutput, 0.5*(orientation.getResult() - speed));\n \tRobotMap.motorLeftTwo.set(com.ctre.phoenix.motorcontrol.ControlMode.PercentOutput, 0.5*(orientation.getResult() - speed));\n \t\n \tRobotMap.motorRightOne.set(com.ctre.phoenix.motorcontrol.ControlMode.PercentOutput, 0.5*(orientation.getResult() + speed));\n \tRobotMap.motorRightTwo.set(com.ctre.phoenix.motorcontrol.ControlMode.PercentOutput, 0.5*(orientation.getResult() + speed));\n \tSystem.out.println(RobotMap.navx.getAngle()-desiredAngle);\n }", "protected final void operationAND(final int data) {\r\n this.ac &= data;\r\n this.zeroFlag = this.ac == 0;\r\n this.signFlag = this.ac >= 0x80;\r\n }", "@Override\n public void runOpMode() {\n RobotMain main = new RobotMain(this,hardwareMap,telemetry);\n\n //initialize controls\n imuTeleOpDualGamepad control = new imuTeleOpDualGamepad(main,gamepad1,gamepad2);\n\n waitForStart();\n\n //Pull the tail back from autonomous\n main.JewelArm.setServo(.65);\n\n //Continually run the control program in the algorithm\n while (opModeIsActive()) control.run();\n }", "@Override\n\tpublic int execute(Short operand1,Short operand2) {\n\t\tint result[] = MainFunctionUnit.getInstance().getAdder().sub(operand1, operand2);\n\n\t\tsuper.setResult((short)result[0]);\n\t\treturn result[1];\n\t}", "final private void accumulate()\n\t{\n\t\tfinal int argb = target.get().get();\n\t\taccA += ( ( argb >> 24 ) & 0xff ) * weights[ code ];\n\t\taccR += ( ( argb >> 16 ) & 0xff ) * weights[ code ];\n\t\taccG += ( ( argb >> 8 ) & 0xff ) * weights[ code ];\n\t\taccB += ( argb & 0xff ) * weights[ code ];\n\n//\t\tSystem.out.print( \"accumulating value at \" + target );\n//\t\tSystem.out.print( \"with weights [\" );\n//\t\tprintCode();\n//\t\tSystem.out.printf( \"] = %f\" + \"\\n\", weights[ code ] );\n\t}", "protected void acceptValuesInInteractiveControlPanel()\n\t{\n\t\tsuper.acceptValuesInInteractiveControlPanel();\n\t\t\n\t\taHat = aHatPanel.getVector3D();\n\t\tuHat = uHatPanel.getVector3D();\n\t\tvHat = vHatPanel.getVector3D();\n\t\tetaU = etaPanel.getVector2D().x;\n\t\tetaV = etaPanel.getVector2D().y;\n\t\tdeltaU = deltaPanel.getVector2D().x;\n\t\tdeltaV = deltaPanel.getVector2D().y;\n\t\t\n\t\tif(apertureParametersTabbedPane.getSelectedComponent().equals(zeroParametersLabel)) alphaChoice = AlphaChoice.ZERO;\n\t\telse if(apertureParametersTabbedPane.getSelectedComponent().equals(manualParametersPanel)) alphaChoice = AlphaChoice.MANUAL;\n\t\telse if(apertureParametersTabbedPane.getSelectedComponent().equals(optimisedParametersPanel)) alphaChoice = AlphaChoice.OPTIMISED;\n\n\t\tsigma1U = sigma1Panel.getVector2D().x;\n\t\tsigma1V = sigma1Panel.getVector2D().y;\n\t\tsigma2U = sigma2Panel.getVector2D().x;\n\t\tsigma2V = sigma2Panel.getVector2D().y;\n\t\talpha1U = alpha1Panel.getVector2D().x;\n\t\talpha1V = alpha1Panel.getVector2D().y;\n\t\talpha2U = alpha2Panel.getVector2D().x;\n\t\talpha2V = alpha2Panel.getVector2D().y;\n\t\tpointAtFOVCentre = pointAtFOVCentrePanel.getVector3D();\n//\t\tparallelityParameter = parallelityParameterPanel.getNumber();\n//\t\tJComboBox alphaChoiceComboBox;\n\t\tapertureCentre = apertureCentrePanel.getVector3D();\n\t\tbrightnessFactor = brightnessFactorPanel.getNumber();\n\t}", "private void activateKey(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P1\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x00)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\tswitch (buffer[ISO7816.OFFSET_P2]) {\r\n\t\tcase AUTHENTICATION:\r\n\t\t\t// activate key: key always active, do nothing\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION:\r\n\t\t\t// activate key: key always active, do nothing\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}\r\n\t}", "static void ani_with_acc(String passed){\n\t\tint val1 = hexa_to_deci(registers.get('A'));\n\t\tint val2 = hexa_to_deci(passed.substring(4));\n\t\tval1 = val1&val2;\n\t\tregisters.put('A',decimel_to_hexa_8bit(val1));\n\t\tmodify_status(registers.get('A'));\n\t}", "protected void execute() {\n \tSystem.out.println(\"Gyro: \" + Drivetrain.gyro.getAngle());\n\t\tif (degrees > 0) {\n\t\t\twhile (Drivetrain.gyro.getAngle() < degrees) {\n\t\t\t\tDrivetrain.frontRight.set(ControlMode.PercentOutput, 0.25);\n\t\t\t\tDrivetrain.rearRight.set(ControlMode.PercentOutput, 0.25);\n\t\t\t\tDrivetrain.frontLeft.set(ControlMode.PercentOutput, 0.25);\n\t\t\t\tDrivetrain.rearLeft.set(ControlMode.PercentOutput, 0.25);\n\t\t\t}\n\t\t} \n\t\telse {\n\t\t\twhile (Drivetrain.gyro.getAngle() > degrees) {\n\t\t\t\tDrivetrain.frontRight.set(ControlMode.PercentOutput, -0.25);\n\t\t\t\tDrivetrain.rearRight.set(ControlMode.PercentOutput, -0.25);\n\t\t\t\tDrivetrain.frontLeft.set(ControlMode.PercentOutput, -0.25);\n\t\t\t\tDrivetrain.rearLeft.set(ControlMode.PercentOutput, -0.25);\n\t\t\t}\n\t\t}\n }", "public void activate() {\n double dotProduct = 0;\n for (Synapse s : super.getSynapsesIn()) {\n dotProduct += s.getNeuronFrom().getOutput() * s.getWeight();\n }\n super.setOutput(sigmoidFunction(dotProduct));\n }", "public abstract void useOutput(double output);", "public abstract void useOutput(double output);", "public void setInput(boolean inputA, boolean inputB) {\n mAndGate.setInput(inputA, inputB);\n mXorGate.setInput(inputA, inputB);\n }", "public void execute(final InstructionContext env) throws JBasicException {\n\n\t\tfinal Instruction i = env.instruction;\n\t\t\n\t\t/*\n\t\t * The source addend is always the integer argument from the\n\t\t * instruction. Construct a new Value from that, and get the\n\t\t * target addend as well.\n\t\t */\n\t\tfinal Value sourceValue = new Value(i.integerOperand);\n\t\tValue targetValue = env.popForUpdate();\n\t\t\n\t\tValue newValue = null;\n\n\t\t/*\n\t\t * If the target is an array, just add the scalar value to the \n\t\t * mutable target array and declare that the new value.\n\t\t */\n\t\tif (targetValue.isType(Value.ARRAY)) {\n\t\t\t\n\t\t\ttargetValue.addElement(sourceValue);\n\t\t\tnewValue = targetValue;\n\t\t} else {\n\t\t\t/*\n\t\t\t * Based on the agreed-upon mutual type, do the right kind of math.\n\t\t\t */\n\t\t\tint bestType = Expression.bestType(targetValue, sourceValue);\n\t\t\ttargetValue.coerce(bestType);\n\t\t\t\n\t\t\tswitch (bestType) {\n\n\t\t\tcase Value.DECIMAL:\n\t\t\t\ttargetValue.setDecimal(targetValue.getDecimal().add(sourceValue.getDecimal()));\n\t\t\t\tbreak;\n\n\t\t\tcase Value.BOOLEAN:\n\t\t\t\ttargetValue.setBoolean(targetValue.getBoolean() | sourceValue.getBoolean());\n\t\t\t\tbreak;\n\n\t\t\tcase Value.DOUBLE:\n\t\t\t\ttargetValue.setDouble(targetValue.getDouble() + sourceValue.getDouble());\n\t\t\t\tbreak;\n\n\t\t\tcase Value.INTEGER:\n\t\t\t\ttargetValue.setInteger(targetValue.getInteger() + sourceValue.getInteger());\n\t\t\t\tbreak;\n\n\t\t\tcase Value.STRING:\n\t\t\t\ttargetValue = new Value(targetValue.getString() + sourceValue.getString());\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new JBasicException(Status.TYPEMISMATCH);\n\n\t\t\t}\n\t\t\tnewValue = targetValue;\n\t\t}\n\n\t\tenv.push(newValue);\n\n\t\treturn;\n\t}", "@Override\n void invokeOperation() {\n\n AcquiredAccount from, to;\n if (fromIndex < toIndex) {\n from = acquire(fromIndex, this);\n to = acquire(toIndex, this);\n } else {\n to = acquire(toIndex, this);\n from = acquire(fromIndex, this);\n }\n\n if (from != null && to != null) {\n if (amount > from.amount)\n errorMessage = \"Underflow\";\n else if (to.amount + amount > MAX_AMOUNT)\n errorMessage = \"Overflow\";\n else {\n from.newAmount = from.amount - amount;\n to.newAmount = to.amount + amount;\n }\n this.completed = true;\n }\n\n if (fromIndex < toIndex) {\n release(toIndex, this);\n release(fromIndex, this);\n } else {\n release(fromIndex, this);\n release(toIndex, this);\n }\n }", "private int caculate(Operation opt, int t1, int t2) {\n\t\tint res;\n\t\tswitch (opt) {\n\t\tcase ADD:\n\t\t\tres = t1 + t2;\n\t\t\tbreak;\n\t\tcase SUB:\n\t\t\tres = t1 - t2;\n\t\t\tbreak;\n\t\tcase MUL:\n\t\t\tres = t1 * t2;\n\t\t\tbreak;\n\t\tcase DIV:\n\t\t\tres = t1 / t2;\n\t\t\tbreak;\n\t\tcase NULL:\n\t\t\terr.error(\"No operation in caculating.\");\n\t\t\tres = 0;\n\t\tdefault:\n\t\t\tres = 0;\n\t\t\tbreak;\n\t\t}\n\t\treturn res;\n\t\t/*\n\t\t * lex.intHolder.add(res); return lex.intHolder.lastIndexOf(res);\n\t\t */\n\t}", "protected void execute() {\n\t\trightTalon.getMotionProfileStatus(status);\n\n\t\tif (status.isUnderrun) {\n\t\t\t// if either MP has underrun, stop both\n\t\t\tSystem.out.println(\"Motion profile has underrun!\");\n\t\t\tsetValue = SetValueMotionProfile.Disable;\n\t\t} else if (status.btmBufferCnt > kMinPointsInTalon) {\n\t\t\t// if we have enough points in the talon, go.\n\t\t\tsetValue = SetValueMotionProfile.Enable;\n\t\t} else if (status.activePointValid && status.isLast) {\n\t\t\t// if both profiles are at their last points, hold the last point\n\t\t\tsetValue = SetValueMotionProfile.Hold;\n\t\t}\n\n\t\trightTalon.set(ControlMode.MotionProfileArc, setValue.value);\n\t}", "public void doSwitchTest(String initialValue, String resultValue, String proc_name) \r\n throws Exception {\n \r\n loadProcedure(proc_name);\r\n ProcedureRunner runner = new ProcedureRunner(test_proc);\r\n CompositeMap context = runner.getContext();\r\n context.put(KEY_INIT, initialValue);\r\n config.addParticipant(this);\r\n runner.setConfiguration(config);\r\n //runner.setHandleManager(handle_manager);\r\n \r\n runner.run();\r\n runner.checkAndThrow();\r\n //oc_manager.getLogger().info(context.toXML());\r\n Object obj = context.get(KEY_RESULT);\r\n if(resultValue == null) assertNull(obj);\r\n else assertEquals(resultValue,obj);\r\n }", "public abstract int calculateOutput();", "public Polynomial operate(){\n Polynomial result = a.multiplyPolynomial(b);\n return result;\n }", "protected final void operationADC(final int data) {\r\n int tmp;\r\n\r\n if (this.decimalFlag) {\r\n tmp = 10 * (this.ac & 0xf0) + (this.ac & 0x0f) + (10 * (data & 0xf0) + (data & 0x0f));\r\n tmp = ((tmp / 10) << 4) + tmp % 10;\r\n } else {\r\n tmp = data + this.ac + (this.carryFlag ? 1 : 0);\r\n this.overflowFlag = (((this.ac ^ data) & 0x80) == 0) && (((this.ac ^ tmp) & 0x80) != 0);\r\n }\r\n this.carryFlag = tmp > 0xff;\r\n this.ac = tmp & 0xff;\r\n this.zeroFlag = this.ac == 0;\r\n this.signFlag = this.ac >= 0x80;\r\n }", "public void calculateOutput() {\n inputSum = 0.0;\n //for output (linear) neuron\n if (layer == 0) {\n for (int i = 0; i < inputs; ++i) {\n inputSum += weights[i] * network.getInput()[i];\n }\n }\n //for Sigmoidal neurons\n else {\n for(int i = 0; i < inputs; ++i) {\n inputSum += weights[i] * network.getNeurons()[layer - 1][i].output;\n }\n }\n if (enableConstAddend) {\n inputSum += weights[inputs];\n }\n output = activate(inputSum);\n }", "@Override\n\tprotected void end() {\n\t\thookMotor1.set(ControlMode.PercentOutput, 0);\n\t\thookMotor2.set(ControlMode.PercentOutput, 0);\n\t}", "protected void execute() {\n\t\t// get MP status from each talon\n\t\tleftTalon.getMotionProfileStatus(leftStatus);\n\t\trightTalon.getMotionProfileStatus(rightStatus);\n\n\t\t// Enable MP if not already enabled\n\t\tif ((leftStatus.btmBufferCnt > kMinPointsInTalon) && (rightStatus.btmBufferCnt > kMinPointsInTalon)) {\n\t\t\tstate = SetValueMotionProfile.Enable;\n\t\t}\n\t\tleftTalon.set(ControlMode.MotionProfile, state.value);\n\t\trightTalon.set(ControlMode.MotionProfile, state.value);\n\t\t// System.out.println(\"DriveByMotion: Execute Setting State: \" + state);\n\t\t\n\t\t// did we get an underrun condition since last time we checked?\n\t\tif (leftStatus.hasUnderrun || rightStatus.hasUnderrun) {\n\t\t\t// better log it so we know about it\n\t\t\tSystem.out.println(\"DriveByMotion: A Talon has underrun!!! Left Talon: \" + leftStatus.hasUnderrun + \" Right Talon: \" + rightStatus.hasUnderrun);\n\t\t\t// clear the error. This flag does not auto clear, so this way we never miss logging it.\n\t\t\tleftTalon.clearMotionProfileHasUnderrun(0);\n\t\t\trightTalon.clearMotionProfileHasUnderrun(0);\n\t\t}\n\t}", "@Override\n\tpublic String execute() throws Exception {\n\t\tdouble num1 = Double.parseDouble(getModel().getNum1());\n\t\tdouble num2 = Double.parseDouble(getModel().getNum2());\n\t\tdouble result = getModel().getResult();\n\t\tString tip = getModel().getTip();\n\t\tswitch(getModel().getOp()) {\n\t\t\tcase \"+\":\n\t\t\t\tresult = num1 + num2; break;\n\t\t\tcase \"-\":\n\t\t\t\tresult = num1 - num2; break;\n\t\t\tcase \"*\":\n\t\t\t\tresult = num1 * num2; break;\n\t\t\tcase \"/\":\n\t\t\t\tif(num2 == 0) {\n\t\t\t\t\ttip=\"除数不能为0,请重新输入!\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tresult = num1 / num2; break;\n\t\t}\n\t\t\n\t\tActionContext.getContext().getSession().put(\"tip\", tip);\n\t\tActionContext.getContext().getSession().put(\"result\", result);\n\t\treturn SUCCESS;\n\t}", "public void activate() {\n\t\tif (value == null) {\n\t\t\tvalue = Boolean.TRUE;\n\t\t} else if (value == Boolean.TRUE) {\n\t\t\tvalue = Boolean.FALSE;\n\t\t} else if (value == Boolean.FALSE) {\n\t\t\tvalue = null;\n\t\t}\n\t\tfireApplyEditorValue();\n\t}", "protected void execute() { \t\n \tif (isLowered != Robot.oi.getOperator().getRawButton(2)) {\n \t\tisLowered = Robot.oi.getOperator().getRawButton(2);\n \t\tif (isLowered)\n \t\t\tRobot.gearSubsystem.getRaiser().set(DoubleSolenoid.Value.kForward);\n \t\telse\n \t\t\tRobot.gearSubsystem.getRaiser().set(DoubleSolenoid.Value.kReverse);\n \t}\n \t\n \tif (Robot.oi.getOperator().getRawButton(11))\n \t\tRobot.gearSubsystem.getIntakeMotor().set(0.75);\n \telse if (Robot.oi.getOperator().getRawButton(12))\n \t\tRobot.gearSubsystem.getIntakeMotor().set(0);\n \telse if (Robot.oi.getOperator().getRawButton(10))\n \t\tRobot.gearSubsystem.getIntakeMotor().set(-0.75);\n }", "static void ora_with_reg(String passed){\n\t\tint val1 = hexa_to_deci(registers.get('A'));\n\t\tint val2 = hexa_to_deci(registers.get(passed.charAt(4)));\n\t\tval1 = val1|val2;\n\t\tregisters.put('A',decimel_to_hexa_8bit(val1));\n\t\tmodify_status(registers.get('A'));\n\t}", "public void calcOutput()\n\t{\n\t}", "public void execute() {\n if(cb) {\n Main.cb.step(Main.cpu.get8BitImm());\n }\n }", "@Override\r\n\tpublic void activate() {\n\t\tif(CID==true) {\r\n\t\t\tinter.setState(inter.getResults());\r\n\t\t}\r\n\t}", "public void updateUf() {\n ArrayList<FunctionalUnit> updateList = new ArrayList<>();\n updateList = FU.get(typeFU.GENERIC);\n for (int i = 0; i < updateList.size(); i++) {\n if (updateList.get(i).isExecFinish() == true) {\n updateList.get(i).setActive(true); \n }\n }\n updateList = FU.get(typeFU.ADD);\n for (int i = 0; i < updateList.size(); i++) {\n if (updateList.get(i).isExecFinish() == true) {\n updateList.get(i).setActive(true); \n }\n }\n updateList = FU.get(typeFU.MULT);\n for (int i = 0; i < updateList.size(); i++) {\n if (updateList.get(i).isExecFinish() == true) {\n updateList.get(i).setActive(true); \n }\n }\n }", "protected void execute() {\n \tif(RobotMap.gearIntakeRoller.getOutputCurrent() <= 5){\n \t\tRobotMap.gearIntakeRoller.set(-0.05);\n \t}\n \telse{\n \t\tRobotMap.gearIntakeRoller.set(0);\n \t}\n \t\t\n }", "protected abstract void useOutput(float output, float setpoint);", "public void operatorControl() {\n \tmyRobot.setSafetyEnabled(true);\n while (isOperatorControl() && isEnabled()) {\n \tdouble x = stick2.getRawAxis(0);\n \tdouble y = stick2.getRawAxis(1);\n \tdouble rot = stick.getRawAxis(0);\n \tSmartDashboard.putNumber(\"x1\", x);\n SmartDashboard.putNumber(\"y1\", y);\n SmartDashboard.putNumber(\"rot1\", rot);\n \tif(Math.abs(x) < .2)\n \t\tx = 0;\n \tif(Math.abs(y) < .2)\n \t\ty = 0;\n \tif(Math.abs(rot) < .2)\n \t\trot = 0;\n \tmyRobot.mecanumDrive_Cartesian(x*-1, y*-1,rot*-1, gyro.getAngle());\n double current1 = pdp.getCurrent(0);\n double current2 = pdp.getCurrent(13);\n double current3 = pdp.getCurrent(15);\n double current4 = pdp.getCurrent(12);\n SmartDashboard.putNumber(\"Front Left current\", current1);\n SmartDashboard.putNumber(\"back Left current\", current2);\n SmartDashboard.putNumber(\"Front right current\", current3);\n SmartDashboard.putNumber(\"back right current\", current4);\n SmartDashboard.putNumber(\"x\", x);\n SmartDashboard.putNumber(\"y\", y);\n SmartDashboard.putNumber(\"rot\", rot);\n SmartDashboard.putNumber(\"Gyro\", gyro.getAngle());\n \tTimer.delay(0.005);\t\t// wait for a motor update time\n }\n }", "@Override\n\tpublic double execute() {\n\t\tList<Variable> args = getArgs();\n\t\tVariable newVar = null;\n\t\tfor (int i = 0; i < args.size(); i += 2) {\n\t\t\tnewVar = new Variable(args.get(i).getKey(), args.get(i + 1).getValue());\n\t\t\tgetBackendController().setVariable(newVar);\n\t\t}\n\t\treturn newVar == null ? 0 : newVar.getValue();\n\t}", "void updateValue( float time ) {\n\tboolean newVal = in1 | in2;\n\tif (newVal != value) {\n\t value = newVal;\n\t Simulator.schedule(\n\t new Simulator.Event( time + (delay * 0.95f)\n\t\t+ PRNG.randomFloat( delay * 0.1f ) ) {\n\t\t void trigger() {\n\t\t\toutputChangeEvent( this.time );\n\t\t }\n\t\t}\n\t );\n\t}\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString set1input = textField.getText();\n\t\t\t\tString set2input = textField_1.getText();\n\t\t\t\t\n\t\t\t\tArrayList<String> list1 = new ArrayList<String>(Arrays.asList(set1input.split(\",\")));\n\t\t\t\t\n\t\t\t\tArrayList<String> list2 = new ArrayList<String>(Arrays.asList(set2input.split(\",\")));\n\t\t\t\t\n\t\t\t\t//Let this be the array where the members from both sets will be added as a result\n\t\t\t\tArrayList<String> result = new ArrayList<String>();\n\t\t\t\t\n\t\t\t\tswitch(comboBox.getSelectedItem().toString())\n\t\t\t\t{\n\t\t\t\tcase \"Union\":\n\t\t\t\t\tunion(list1, list2, result, textArea);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"Intersection\":\n\t\t\t\t\tintersection(list1, list2, result, textArea);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"Subtraction\":\n\t\t\t\t\tsubtraction(list1, list2, result, textArea);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"Product\":\n\t\t\t\t\tproduct(list1, list2, result, textArea);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"Complement\":\n\t\t\t\t\tcomplement(list1, list2, result, textArea);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"Power Set\":\n\t\t\t\t\tpowerset(list1, list2, textArea);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"Sequence Concatenation\":\n\t\t\t\t\tseqconcat(list1, list2, result, textArea);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"Sequence Filter Operation\":\n\t\t\t\t\tseqfilter(list1, list2, result, textArea);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}", "float activate(float[] input) {\n if (inputLayer.length != input.length) throw new IllegalArgumentException(\"input.length and inputLayer.length do not match\");\n\n System.arraycopy(input, 0, inputLayer, 0, inputLayer.length);\n\n // Calculate the output\n process();\n\n return outputLayer;\n }", "public void operatorControl() {\n myRobot.setSafetyEnabled(true);\n while (isOperatorControl() && isEnabled()) {\n \tmyRobot.tankDrive(controller, 2, controller, 5);\n Timer.delay(0.005);\t\t// wait for a motor update time\n }\n }", "public void handler() {\n int t = B();\n int r = (konami.cc & CC_C) | t << 1;\n CLR_NZVC();\n SET_FLAGS8(t, t, r);\n B(r);\n if (konamilog != null) {\n fprintf(konamilog, \"konami#%d rolb :PC:%d,PPC:%d,A:%d,B:%d,D:%d,DP:%d,U:%d,S:%d,X:%d,Y:%d,CC:%d,EA:%d\\n\", cpu_getactivecpu(), konami.pc, konami.ppc, A(), B(), konami.d, konami.dp, konami.u, konami.s, konami.x, konami.y, konami.cc, ea);\n }\n }", "protected void execute() {\n \tif (setPoint != 0)\n \t\tshooterWheel.shooterWheelSpeedControllerAft.setSetPoint(setPoint);\n \tshooterWheel.driveAftWheel(shooterWheel.shooterWheelSpeedControllerAft.getControlOutput());\n \t\n }", "private void operation(char operator){\n if(initialised == false){\n calc.setNum1(Double.parseDouble(txtBox.getText()));\n operatorPressed = true;\n } else { \n calc.setNum2(Double.parseDouble(txtBox.getText()));\n Decimal();\n calc.setNum1(calc.getAnswer());\n txtBox.setText(Double.toString(calc.getAnswer()));\n }\n \n calc.setOperator(operator);\n\n operatorPressed = true;\n initialised = true;\n \n }", "@Override\n public void runOpMode() {\n try {\n leftfrontDrive = hardwareMap.get(DcMotor.class, \"frontLeft\");\n leftfrontDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n rightfrontDrive = hardwareMap.get(DcMotor.class, \"frontRight\");\n rightfrontDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n leftbackDrive = hardwareMap.get(DcMotor.class, \"backLeft\");\n leftbackDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n leftbackDrive.setDirection(DcMotor.Direction.REVERSE);\n\n rightbackDrive = hardwareMap.get(DcMotor.class, \"backRight\");\n rightbackDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n lift = hardwareMap.get(DcMotor.class, \"Lift\");\n lift.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n lift.setDirection(DcMotor.Direction.REVERSE);\n\n markerArm = hardwareMap.get(Servo.class, \"markerArm\");\n\n armActivator = hardwareMap.get(DcMotor.class, \"armActivator\");\n armActivator.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n } catch (IllegalArgumentException iax) {\n bDebug = true;\n }\n\n BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();\n parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;\n parameters.accelUnit = BNO055IMU.AccelUnit.METERS_PERSEC_PERSEC;\n parameters.calibrationDataFile = \"BNO055IMUCalibration.json\";\n parameters.loggingEnabled = true;\n parameters.loggingTag = \"IMU\";\n parameters.accelerationIntegrationAlgorithm = new JustLoggingAccelerationIntegrator();\n\n imu = hardwareMap.get(BNO055IMU.class, \"imu\");\n imu.initialize(parameters);\n\n waitForStart(); //the rest of the code begins after the play button is pressed\n\n sleep(3000);\n\n drive(0.35, 0.5);\n\n turn(90.0f);\n\n drive(1.8, 0.5);\n\n turn(45.0f);\n\n drive(2.5, -0.5);\n\n sleep(1000);\n\n markerArm.setPosition(1);\n\n sleep(1000);\n\n markerArm.setPosition(0);\n\n sleep(1000);\n\n drive(2.5,.75);\n\n turn(179.0f);\n\n drive(1.5, 1.0);\n\n requestOpModeStop(); //end of autonomous\n }", "static void aci_data_with_acc(String passed){\n\t\tint sum = hexa_to_deci(registers.get('A'));\n\t\tsum+=(CS?1:0);\n\t\tsum+=hexa_to_deci(passed.substring(4));\n\t\tCS = sum>255?true:false;\n\t\tregisters.put('A',decimel_to_hexa_8bit(sum));\n\t\tmodify_status(registers.get('A'));\n\t}", "@Override // kotlin.jvm.functions.Function1\n public Unit invoke(String str) {\n RdsInputItemPresenterImpl.access$setupNewValue(this.a, this.b, str, this.c);\n return Unit.INSTANCE;\n }", "@Override\r\n\tpublic void OnResultUpPwder(int result) {\n\t}", "private float caculate(Operation opt, int t1, float f2) {\n\t\tfloat res;\n\t\tfloat tt1 = (float) t1;\n\t\tswitch (opt) {\n\t\tcase ADD:\n\t\t\tres = tt1 + f2;\n\t\t\tbreak;\n\t\tcase SUB:\n\t\t\tres = tt1 - f2;\n\t\t\tbreak;\n\t\tcase MUL:\n\t\t\tres = tt1 * f2;\n\t\t\tbreak;\n\t\tcase DIV:\n\t\t\tres = tt1 / f2;\n\t\t\tbreak;\n\t\tcase NULL:\n\t\t\terr.error(\"No operation in caculating.\");\n\t\t\tres = 0;\n\t\tdefault:\n\t\t\tres = 0;\n\t\t\tbreak;\n\t\t}\n\n\t\treturn res;\n\n\t\t/*\n\t\t * lex.floatHolder.add(res); return lex.floatHolder.lastIndexOf(res);\n\t\t */\n\t}", "public Formula encodeControl() {\n\t\tConjunction result = new Conjunction(\"control\");\n\t\tSet<CArgument> controlArgs = CAF.getArgumentsByType(CArgument.Type.CONTROL);\n\t\tif(controlArgs.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\tfor(CArgument a : controlArgs) {\n\t\t\tString name = \"on_\" + a.getName() + \"_\" + \"acc_\" + a.getName();\n\t\t\tAtom left = new Atom(\"on_\" + a.getName());\n\t\t\tAtom right = new Atom(\"acc_\" + a.getName());\n\t\t\tEquivalence equiv = new Equivalence(name, left, right);\n\t\t\tresult.addSubformula(equiv);\n\t\t}\n\t\treturn result;\n\t}", "@Override\n public void run() {\n aia.addAndGet(1,15);\n aia.decrementAndGet(1);\n\n //weakly compare the first args to current value and sets\n aia.compareAndSet(1,14,20);\n System.out.println(aia.get(1));\n }", "public void execute() {\n\n try {\n int source = data_path.IR.decimal(15, 0);\n int destination = data_path.IR.decimal(23, 16);\n\n System.out.println(\"Source: \" + source);\n data_path.master_bus.store(source);\n data_path.bank.load(destination);\n\n } catch (Exception e) {\n System.err.println(\"In Controler:LOADI0:increment_clock\");\n System.err.println(e);\n }\n }", "void setActiveOperand(double activeOperand);", "public Upcall(ORBInstance orbInstance, UpcallReturn upcallReturn,\n org.apache.yoko.orb.OCI.ProfileInfo profileInfo,\n org.apache.yoko.orb.OCI.TransportInfo transportInfo, int requestId,\n String op, org.apache.yoko.orb.CORBA.InputStream in,\n org.omg.IOP.ServiceContext[] requestSCL) {\n orbInstance_ = orbInstance;\n upcallReturn_ = upcallReturn;\n profileInfo_ = profileInfo;\n transportInfo_ = transportInfo;\n reqId_ = requestId;\n op_ = op;\n in_ = in;\n requestSCL_ = requestSCL;\n servant_ = null;\n poa_ = null;\n postinvokeCalled_ = false;\n\n userEx_ = false; // Java only\n\n logger.fine(\"Creating upcall request for operation \" + op + \" and request id \" + requestId); \n in._OB_ORBInstance(orbInstance_);\n }", "public void a() {\n Object andSet = getAndSet(this);\n if (andSet != this) {\n try {\n this.b.accept(andSet);\n } catch (Throwable th) {\n Exceptions.throwIfFatal(th);\n RxJavaPlugins.onError(th);\n }\n }\n }", "public getValue_result(getValue_result other) {\n if (other.isSetSuccess()) {\n this.success = other.success;\n }\n }", "@Override\npublic void actionPerformed(ActionEvent ae) {\nObject obj = ae.getSource(); \n\nif(obj == myCalcView.getJbt_one()){ \n myCalcView.getJtf_result().setText(myCalcView.getJtf_result().getText()+\"1\"); \n}else if(obj == myCalcView.getJbt_two()){ \n myCalcView.getJtf_result().setText(myCalcView.getJtf_result().getText()+\"2\"); \n}else if(obj == myCalcView.getJbt_plus()){ \n v1 = myCalcView.getJtf_result().getText(); \n System.out.println(\"v1 : \"+v1); \n op = \"+\"; \n myCalcView.getJtf_result().setText(\"\"); \n}else if(obj == myCalcView.getJbt_equals()){ \n v2 = myCalcView.getJtf_result().getText(); \n System.out.println(\"v1:\"+v1 +\"-> v2 : \"+v2+\" op : \"+op); \n String result = calcurate(v1,v2,op); \n myCalcView.getJtf_result().setText(result); \n}else if(obj == myCalcView.getJbt_clear()){ \n myCalcView.getJtf_result().setText(\"\"); \n} \n}", "@Override\n public void execute(ActionControl control) {\n Optional<VisionResult> optional = mVisionControl.getLatestResult(true);\n // We need to handle two cases now: we have a new result, or we don't.\n if (optional.isPresent()) {\n // if we have a new result, we can get an Analysis object from it.\n VisionResult result = optional.get();\n Analysis analysis = result.getAnalysis();\n\n // Now we can extract information from the Analysis object.\n // what information we receive/have depends on the vision code which creates the analysis,\n // so it's good to be aware of the vision code we are working with.\n double offset = analysis.getProperty(\"offset\", Double.class);\n\n // now we can do some algorithm with the robot.\n } else {\n // what we do in here depends on the type of algorithm we want. We can still operate the robot\n // based on the latest data, or we can do nothing, and more.\n }\n }", "private void passB() {\n // PROGRAM 1: Student must complete this method\n //place inputB data into output\n for (int i = 0; i < output.length; i++) {\n output[i] = inputB[i];\n }\n }", "@Override\n public void function() {\n App.memory.setMemory(op2, Memory.convertBSToBoolArr(Memory.length32(Integer.toBinaryString(\n op1 * Integer.parseInt(App.memory.getMemory(op2, 1 << 2 + 2 + 1), 2)))));\n }", "public void execute() {\n switch (this.opCode) {\n case 'a':\n this.result = this.leftVal + this.rightVal;\n break;\n case 's':\n this.result = this.leftVal - this.rightVal;\n break;\n case 'm':\n this.result = this.leftVal * this.rightVal;\n break;\n case 'd':\n this.result = this.rightVal != 0 ? this.leftVal / this.rightVal : 0.0d;\n break;\n default:\n System.out.println(\"Invalid opCode: \" + this.opCode);\n this.result = 0.0d;\n break;\n }\n numOfCalculations++;\n sumOfResults += result;\n }", "@Override\r\n\tdouble alan() {\n\t\tSystem.out.println(\"Ucgenin Alani : \");\r\n\t\treturn kenar1 * kenar2 /2;\r\n\t}", "private void sub() {\n // PROGRAM 1: Student must complete this method\n // This method must use the addBit method for bitwise subtraction.\n //invert bits of inputB\n for (int i = 0; i < inputB.length; i++) {\n if (!inputB[i]) {\n inputB[i] = true; //set each 0 bit to 1\n } else {\n inputB[i] = false; //set each 1 bit to 0\n }\n }\n adder = addBit(inputA[0], inputB[0], true); //place first iteration of addBit with a carry-in bit into adder.\n output[0] = adder[0]; //place first sum into output[0]\n //loop thru output starting at index 1 since we already computed\n for (int i = 1; i < output.length; i++) {\n cin = adder[1]; // set cin equal to carryout\n adder = addBit(inputA[i], inputB[i], cin); //call addBit with index i of inputA and inputB and cin\n output[i] = adder[0]; //place sum into output[i]\n }\n }", "static void sui_with_acc(String passed){\n\t\tint subt = hexa_to_deci(registers.get('A'));\n\t\tint minu = hexa_to_deci(passed.substring(4));\n\t\tminu = 256-minu;\n\t\tminu%=256;\n\t\tsubt+=minu;\n\t\tCS = subt>255?true:false;\n\t\tregisters.put('A', decimel_to_hexa_8bit(subt));\n\t\tmodify_status(registers.get('A'));\n\t}", "public updateUserInfo_result(updateUserInfo_result other) {\n __isset_bit_vector.clear();\n __isset_bit_vector.or(other.__isset_bit_vector);\n this.success = other.success;\n }", "public double calculateValue () {\n return double1 * double2;\n }", "@Override\n protected void execute() {\n if (mClaw.getTargetMode() == TargetMode.CARGO) {\n // If the claw is in automatic mode (i.e. no input), determine the speeds\n if (mClaw.getControlMode() == ControlMode.AUTO) {\n // If there is cargo loaded, HOLD it\n if (mClaw.cargoLeftPresent() && mClaw.cargoRightPresent()) {\n mClaw.setSpinMode(SpinMode.HOLD);\n }\n else {\n mClaw.setSpinMode(SpinMode.STOP);\n }\n }\n // Otherwise we just use the ensureMode functionality to correctly spin\n }\n else if (mClaw.getTargetMode() == TargetMode.HATCH) {\n // If the claw is in automatic mode (i.e. no input), determine the speeds\n if (mClaw.getControlMode() == ControlMode.AUTO) {\n // If there is cargo loaded, HOLD it\n if (mClaw.hatchLeftPresent() && mClaw.hatchRightPresent()) {\n mClaw.setSpinMode(SpinMode.HOLD);\n }\n else {\n mClaw.setSpinMode(SpinMode.STOP);\n }\n }\n // Otherwise we just use the ensureMode functionality to correctly spin\n }\n\n // Make the appropriate adjustments\n mClaw.ensureMode();\n }", "protected void execute() {\n\t\tRobotMap.leftMaster.set(ControlMode.PercentOutput, vision.blockCheck() * turnMultiplier(\"left\"));\n\t\tRobotMap.rightMaster.set(ControlMode.PercentOutput, vision.blockCheck() * turnMultiplier(\"right\"));\n\t}", "private float caculate(Operation opt, float f1, int t2) {\n\t\tfloat res;\n\t\tfloat tt2 = (float) t2;\n\t\tswitch (opt) {\n\t\tcase ADD:\n\t\t\tres = f1 + tt2;\n\t\t\tbreak;\n\t\tcase SUB:\n\t\t\tres = f1 - tt2;\n\t\t\tbreak;\n\t\tcase MUL:\n\t\t\tres = f1 * tt2;\n\t\t\tbreak;\n\t\tcase DIV:\n\t\t\tres = f1 / tt2;\n\t\t\tbreak;\n\t\tcase NULL:\n\t\t\terr.error(\"No operation in caculating.\");\n\t\t\treturn 0;\n\t\tdefault:\n\t\t\tres = 0;\n\t\t\tbreak;\n\t\t}\n\t\treturn res;\n\n\t\t/*\n\t\t * lex.floatHolder.add(res); return lex.floatHolder.lastIndexOf(res);\n\t\t */\n\t}", "public int calculate(int a,int b) {\n\t\treturn strategy.caculate(a, b);\n\t}", "private void doActivation() {\n OnFieldActivated activateEvent = new OnFieldActivated(this::finishReset);\n activateEvent.beginTask();\n DefenceField.getShrineEntity().send(activateEvent);\n activateEvent.finishTask();\n }", "UOp createUOp();", "public void raise(){\r\n elevatorTalon1.set(basePWM);\r\n elevatorTalon2.set(basePWM * pwmModifier);\r\n }", "protected void execute() {\n buttonOpenValue = Robot.m_oi_pilot.joystick.getRawButton(1);\n buttonCloseValue = Robot.m_oi_pilot.joystick.getRawButton(2);\n\n if(buttonOpenValue){\n direction = DoubleSolenoid.Value.kForward;\n }\n else if(buttonCloseValue){\n direction = DoubleSolenoid.Value.kReverse;\n }\n else{\n direction = DoubleSolenoid.Value.kOff;\n }\n //Robot.m_pneumatics.runSolenoid(direction);\n }", "protected abstract double operation(double val);", "@Override\r\n\t\t\t\tpublic Integer call(Integer v1, Integer v2) throws Exception {\n\t\t\t\t\treturn v1+v2;\r\n\t\t\t\t}", "void updateValue( float time ) {\n\tboolean newVal = in1 & in2;\n\tif (newVal != value) {\n\t value = newVal;\n\t Simulator.schedule(\n\t new Simulator.Event(\n\t\ttime + (delay * 0.95f)\n\t\t+ PRNG.randomFloat( delay * 0.1f ) ) {\n\t\t void trigger() {\n\t\t\toutputChangeEvent( this.time );\n\t\t }\n\t\t}\n\t );\n\t}\n }", "double calculateAxon(ActivationFunction activationFunction);", "public void testX1andX2orNotX1() {\n \tCircuit circuit = new Circuit();\n \t\n \tBoolean b1 = Boolean.TRUE;\n \tBoolean b2 = Boolean.FALSE;\n \tAnd and = (And) circuit.getFactory().getGate(Gate.AND);\n\t\tNot not = (Not) circuit.getFactory().getGate(Gate.NOT);\n\t\tOr or = (Or) circuit.getFactory().getGate(Gate.OR);\n\t\tand.setLeftInput(b1);\n\t\tand.setRightInput(b2);\n\t\tand.eval();\n\t\tnot.setInput(b1);\n\t\tnot.eval();\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n\t\tassertEquals(Boolean.FALSE, or.eval());\n\t\tassertEquals(Boolean.FALSE, circuit.eval());\n//\t\t==========================================\n\t\tb1 = Boolean.FALSE;\n \tb2 = Boolean.TRUE;\n// \tand.eval();\n// \tnot.eval();\n \tassertEquals(Boolean.FALSE, circuit.eval());\n// \t============================================\n \tDouble d1 = 0.0;\n \tDouble d2 = 1.0;\n \tand.setLeftInput(d1);\n\t\tand.setRightInput(d2);\n\t\tnot.setInput(d1);\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(1.0), or.eval());\n// \t============================================\n \td1 = 0.5;\n \td2 = 0.5;\n \tand.setLeftInput(d1);\n\t\tand.setRightInput(d2);\n \tand.eval();\n \tnot.setInput(d1);\n \tnot.eval();\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(0.625), or.eval());\n// \t============================================\n \ttry {\n \td1 = 0.5;\n \td2 = 2.0;\n \tand.setLeftInput(d1);\n \t\tand.setRightInput(d2);\n \tand.eval();\n \tnot.setInput(d1);\n \tnot.eval();\n \t\tor.setLeftInput(and.getOutput());\n \t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(0.625), or.eval());\n \t} catch (IllegalArgumentException e) {\n \t\tSystem.err.println(\"IllegalArgumentException: \" + e.getMessage());\n \t}\n\n }", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t/* If the user clicks the Begin button */\n\t\tif (arg0.getActionCommand().equals(\"Begin\")){\n\n\t\t\t/* And both source/initial and target configurations are loaded */\n\t\t\tif(loaded==1){\n\n\t\t\t\t/* Enable/disable GUI components appropriately */\n\t\t\t\tstartcheck.setEnabled(false);\n\t\t\t\tstopcheck.setEnabled(true);\n\t\t\t\tclose.setEnabled(false);\n\t\t\t\tpath1.setEnabled(false);\n\t\t\t\tpath2.setEnabled(false);\n\t\t\t\tresult.setText(\"N/A\");\n\t\t\t\tautomata.setEnabled(false);\n\t\t\t\tload.setEnabled(false);\n\t\t\t\trepeat.setEnabled(false);\n\n\t\t\t\t/* Wake up the execution updater thread */\n\t\t\t\tunPause();\n\n\t\t\t\t/* Block the GUI until the updater thread has paused */\n\t\t\t\twhile(updater.getState()==Thread.State.WAITING){\n\t\t\t\t\tThread.yield();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* If the user clicks the End button */\n\t\telse if (arg0.getActionCommand().equals(\"End\")){\n\n\t\t\t/* Set the global run variable to false, forcing\n\t\t\t * the execution thread to stop */\n\t\t\tpause();\n\n\t\t\t/* Block the GUI until the updater thread has paused */\n\t\t\twhile(updater.getState()!=Thread.State.WAITING){\n\t\t\t\tThread.yield();\n\t\t\t}\n\n\t\t\t/* Enable/disable GUI components appropriately */\n\t\t\tstopcheck.setEnabled(false);\n\t\t\tstartcheck.setEnabled(true);\n\t\t\tclose.setEnabled(true);\t\t\n\t\t\tpath1.setEnabled(true);\n\t\t\tpath2.setEnabled(true);\n\t\t\tautomata.setEnabled(true);\n\t\t\tload.setEnabled(true);\n\t\t\trepeat.setEnabled(true);\n\t\t}\n\n\t\t/* If the user clicks the Close button */\n\t\telse if (arg0.getActionCommand().equals(\"Close\")){\n\n\t\t\t/* Re-enable the main window and destroy this one */\n\t\t\tMainFrame.instance.setEnabled(true);\n\t\t\tthis.dispose();\n\t\t}\n\n\t\t/* If the user clicks the Load button */\n\t\telse if (arg0.getActionCommand().equals(\"Load\")){\n\n\t\t\t/* And if valid source and target configurations are both selected */\n\t\t\tif(path1.getSelectedIndex()!=-1 && path2.getSelectedIndex()!=-1){\n\n\t\t\t\t/* Load the two configurations into program memory */\n\t\t\t\tloadEnds(path1.getSelectedItem().toString()+\".con\",\n\t\t\t\t\t\tpath2.getSelectedItem().toString()+\".con\");\n\t\t\t\tloaded=1;\n\t\t\t\tresult.setText(\"N/A\");\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.57163084", "0.56414783", "0.5558725", "0.53352106", "0.53010386", "0.51848817", "0.5101903", "0.50274044", "0.502605", "0.49785203", "0.4962189", "0.49446362", "0.48960522", "0.4833025", "0.48031053", "0.47201014", "0.4698168", "0.46763283", "0.4651712", "0.46495292", "0.4646099", "0.4645469", "0.46171713", "0.45864022", "0.45701534", "0.45659265", "0.45501307", "0.45469496", "0.4533956", "0.4531305", "0.4523654", "0.45119676", "0.45119676", "0.45113197", "0.45107272", "0.45057657", "0.45029145", "0.45026654", "0.44998437", "0.44941318", "0.44916856", "0.44727907", "0.44650197", "0.44429785", "0.44317824", "0.44243473", "0.44232744", "0.44197318", "0.43989933", "0.43953294", "0.43815243", "0.43743682", "0.43725237", "0.43610746", "0.43500727", "0.4349864", "0.43435162", "0.43292928", "0.4320733", "0.4317725", "0.43161166", "0.43106657", "0.43098968", "0.43038058", "0.43036938", "0.4298577", "0.42952105", "0.42862988", "0.42817947", "0.428013", "0.427501", "0.4271455", "0.42706776", "0.42694122", "0.42648977", "0.42647335", "0.42599425", "0.42586377", "0.42575997", "0.42556834", "0.4250908", "0.4248264", "0.42460802", "0.42415813", "0.42411733", "0.42397717", "0.42397282", "0.4238373", "0.42381662", "0.42287606", "0.4227504", "0.42259198", "0.42258102", "0.4222696", "0.4220264", "0.42193276", "0.42190513", "0.4214247", "0.4213907", "0.42044774" ]
0.55790716
2
Performs the bitwise AND operation: output = inputA AND inputB
private void and() { // PROGRAM 1: Student must complete this method //loop through the output array for (int i = 0; i < output.length; i++) { //take the and of index i of inputA and inputB and place result in output[i] output[i] = inputA[i] & inputB[i]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@OperationMeta(opType = OperationType.INFIX)\n public static boolean and(boolean b1, boolean b2) {\n return b1 & b2;\n }", "public Object visitBitwiseAndExpression(GNode n) {\n Object a, b, result;\n \n nonboolean = true;\n \n dostring = true;\n \n a = dispatch(n.getGeneric(0));\n b = dispatch(n.getGeneric(1));\n \n dostring = false;\n \n if (a instanceof Long && b instanceof Long) {\n result = (Long) a & (Long) b;\n }\n else {\n result = parens(a) + \" & \" + parens(b);\n }\n \n return result;\n }", "private Term parseBitwiseAnd(final boolean required) throws ParseException {\n Term t1 = parseAdd(required);\n while (t1 != null) {\n int tt = _tokenizer.next();\n if (tt == '&') {\n Term t2 = parseAdd(true);\n if ((t1.isI() && t2.isI()) || !isTypeChecking()) {\n t1 = new Term.AndI(t1, t2);\n } else {\n reportTypeErrorI2(\"'&'\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "public static BinaryExpression and(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public bit and(bit other)\n\t{\n\t\tbit andBit = new bit();\n\t\t\n\t\tif(bitHolder.getValue() == other.getValue())\n\t\t{\n\t\t\tif(bitHolder.getValue() == 0)\n\t\t\t{\n\t\t\t\tandBit.setValue(0);\n\t\t\t}else {\n\t\t\tandBit.setValue(1);\n\t\t\t}\n\t\t}else\n\t\t{\n\t\t\tandBit.setValue(0);\n\t\t}\n\t\t\n\t\treturn andBit;\n\t}", "static void andOp(){\n Scanner scanner = new Scanner(System.in);\n\n System.out.print(\"Ingrese el primer numero binario: \");\n String bin1 = scanner.nextLine();\n\n System.out.print(\"Ingrese el segundo numero binario: \");\n String bin2 = scanner.nextLine();\n\n int A = Integer.parseInt(bin1,2);\n int B = Integer.parseInt(bin2,2);\n\n System.out.print(\"A & B = \" + (A & B));\n }", "public static BinaryExpression andAlso(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "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 }", "@ZenCodeType.Operator(ZenCodeType.OperatorType.AND)\n default IData and(IData other) {\n \n return notSupportedOperator(OperatorType.AND);\n }", "public static Object and(Object val1, Object val2) {\n\t\tif (isBool(val1) && isBool(val2)) {\n\t\t\treturn ((Boolean) val1) & ((Boolean) val2);\n\t\t} else if (isInt(val1) && isInt(val2)) {\n\t\t\treturn ((BigInteger) val1).and((BigInteger) val2);\n\t\t}\n\t\tthrow new OrccRuntimeException(\"type mismatch in and\");\n\t}", "protected final void operationAND(final int data) {\r\n this.ac &= data;\r\n this.zeroFlag = this.ac == 0;\r\n this.signFlag = this.ac >= 0x80;\r\n }", "public void executeAnd(){\n\t\tBitString destBS = mIR.substring(4, 3);\n\t\tBitString operand1 = mRegisters[mIR.substring(7, 3).getValue()];\n\t\tchar[] andSolution = new char[16];\n\t\tBitString operand2 = new BitString();\n\t\tif(mIR.substring(10, 1).getValue() == 1){ //immediate mode\n\t\t\toperand2 = mIR.substring(11, 5); //imma5\n\t\t\tif(operand2.getValue2sComp() < 0){\n\t\t\t\tBitString negativeExtend = new BitString();\n\t\t\t\tnegativeExtend.setBits(\"11111111111\".toCharArray());\n\t\t\t\tnegativeExtend.append(operand2);\n\t\t\t\toperand2 = negativeExtend;\n\t\t\t} else {\n\t\t\t\tBitString positiveExtended = new BitString();\n\t\t\t\tpositiveExtended.setBits(\"00000000000\".toCharArray());\n\t\t\t\toperand2 = positiveExtended.append(operand2);\n\t\t\t}\n\t\t} else { \t\t\t\t\t\t\t\t\t\t\t\t//register mode\n\t\t\toperand2 = mRegisters[mIR.substring(13, 3).getValue()];\n\t\t}\n\n\n\t\tfor (int i = 0; i < operand1.getLength(); i++) {\n\t\t\tif(operand1.substring(i, 1).getValue() + operand2.substring(i, 1).getValue() ==2){\n\t\t\t\tandSolution[i] = '1';\n\t\t\t} else {\n\t\t\t\tandSolution[i] = '0';\n\t\t\t}\n\t\t}\n\n\t\tmRegisters[destBS.getValue()].setBits(andSolution);\n\n\t\tsetConditionalCode(mRegisters[destBS.getValue()]);\n\t}", "@Override\n\tpublic void visit(BitwiseAnd arg0) {\n\n\t}", "@Override\n\tpublic void visit(BitwiseAnd arg0) {\n\t\t\n\t}", "public static BinaryExpression and(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }", "public Object visitLogicalAndExpression(GNode n) {\n if (dostring) {\n Object a = dispatch(n.getGeneric(0));\n Object b = dispatch(n.getGeneric(1));\n \n if (a instanceof Long && b instanceof Long) {\n return (Long) a & (Long) b;\n }\n else {\n return parens(a) + \" && \" + parens(b);\n }\n }\n else {\n BDD a, b, bdd;\n \n a = ensureBDD(dispatch(n.getGeneric(0)));\n b = ensureBDD(dispatch(n.getGeneric(1)));\n \n bdd = a.andWith(b);\n \n return bdd;\n }\n }", "@Override\n public ILogical and(ILogical operador) {\n return operador.andBinary(this);\n }", "public BufferedImage AND(BufferedImage timg, BufferedImage timg1) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray1 = convertToArray(timg);\n int[][][] ImageArray2 = convertToArray(timg1);\n int[][][] ImageArray3 = convertToArray(timg1);\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n\n int a1 = ImageArray1[x][y][0]; //a\n int r1 = ImageArray1[x][y][1]; //r for first image\n int g1 = ImageArray1[x][y][2]; //g\n int b1 = ImageArray1[x][y][3]; //b\n\n int a2 = ImageArray2[x][y][0];\n int r2 = ImageArray2[x][y][1]; //r for second image\n int g2 = ImageArray2[x][y][2]; //g\n int b2 = ImageArray2[x][y][3]; //b\n\n ImageArray3[x][y][0] = a1 & a2;\n ImageArray3[x][y][1] = r1 & r2;\n ImageArray3[x][y][2] = g1 & g2;\n ImageArray3[x][y][3] = b1 & b2;\n\n }\n }\n return convertToBimage(ImageArray3);\n }", "public static BinaryExpression andAlso(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }", "public final void ruleOpAnd() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:445:2: ( ( '&&' ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:446:1: ( '&&' )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:446:1: ( '&&' )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:447:1: '&&'\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getOpAndAccess().getAmpersandAmpersandKeyword()); \n }\n match(input,14,FOLLOW_14_in_ruleOpAnd886); if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getOpAndAccess().getAmpersandAmpersandKeyword()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public static BinaryExpression andAssign(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public static Filter and(Filter filterA, Filter filterB) {\r\n return new AndFilter(filterA, filterB);\r\n }", "public static int[] bwand(BinaryNumber bn1, BinaryNumber bn2) {\n\t\tif (bn1.getLength() !=bn2.getLength()) {\n\t\t\tSystem.out.println(\"can't be doin that. Make them the same length.\");\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tint[] and = new int[bn1.length];\n\t\tfor(int i = 0;i < bn1.length;i++) {\n\t\t\tif(bn1.data[i] + bn2.data[i] == 2) {\n\t\t\t\tand[i] = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tand[i] = 0;\n\t\t\t}\n\t\t}\n\t\treturn and;\n\t}", "Expression andExpression() throws SyntaxException {\r\n\t\tToken first = t;\r\n\t\tExpression e0 = eqExpression();\r\n\t\twhile(isKind(OP_AND)) {\r\n\t\t\tToken op = consume();\r\n\t\t\tExpression e1 = eqExpression();\r\n\t\t\te0 = new ExpressionBinary(first, e0, op, e1);\r\n\t\t}\r\n\t\treturn e0;\r\n\t}", "private static void andify(List<ExternalizedStateComponent> inputs, ExternalizedStateComponent output, ExternalizedStateConstant trueProp) {\n\t\tfor(ExternalizedStateComponent c : inputs) {\n\t\t\tif(c instanceof ExternalizedStateConstant && !((ExternalizedStateConstant)c).getValue()) {\n\t\t\t\t//Connect false (c) to the output\n\t\t\t\toutput.addInput(c);\n\t\t\t\tc.addOutput(output);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t//For reals... just skip over any true constants\n\t\tExternalizedStateAnd and = new ExternalizedStateAnd();\n\t\tfor(ExternalizedStateComponent in : inputs) {\n\t\t\tif(!(in instanceof ExternalizedStateConstant)) {\n\t\t\t\tin.addOutput(and);\n\t\t\t\tand.addInput(in);\n\t\t\t}\n\t\t}\n\t\t//What if they're all true? (Or inputs is empty?) Then no inputs at this point...\n\t\tif(and.getInputs().isEmpty()) {\n\t\t\t//Hook up to \"true\"\n\t\t\ttrueProp.addOutput(output);\n\t\t\toutput.addInput(trueProp);\n\t\t\treturn;\n\t\t}\n\t\t//If there's just one, on the other hand, don't use the and gate\n\t\tif(and.getInputs().size() == 1) {\n\t\t\tExternalizedStateComponent in = and.getSingleInput();\n\t\t\tin.removeOutput(and);\n\t\t\tand.removeInput(in);\n\t\t\tin.addOutput(output);\n\t\t\toutput.addInput(in);\n\t\t\treturn;\n\t\t}\n\t\tand.addOutput(output);\n\t\toutput.addInput(and);\n\t}", "public final void mAND() throws RecognitionException {\n try {\n int _type = AND;\n // /Users/benjamincoe/HackWars/C.g:217:5: ( '&&' )\n // /Users/benjamincoe/HackWars/C.g:217:7: '&&'\n {\n match(\"&&\"); \n\n\n }\n\n this.type = _type;\n }\n finally {\n }\n }", "public BufferedImage bitwiseAND(BufferedImage image, BufferedImage image1) {\r\n int[][][] arr = convertToArray(image);\r\n int[][][] arr1 = convertToArray(image1);\r\n\r\n int width = arr.length, height = arr[0].length;\r\n int width1 = arr1.length, height1 = arr1[0].length;\r\n\r\n int x = (width < width1) ? width : width1; //get area to add\r\n int y = (height < height1) ? height : height1;\r\n\r\n for (int i = 0; i < y; i++) {\r\n for (int j = 0; j < x; j++) {\r\n arr[j][i][1] = arr[j][i][1] & arr1[j][i][1] & 0xff;\r\n arr[j][i][2] = arr[j][i][2] & arr1[j][i][2] & 0xff;\r\n arr[j][i][3] = arr[j][i][3] & arr1[j][i][3] & 0xff;\r\n }\r\n }\r\n return convertToBimage(arr);\r\n }", "public static RuntimeValue and(RuntimeValue left, RuntimeValue right) throws RuntimeException {\n if (isDiscreteBoolSamples(left, right)) {\n return new RuntimeValue(\n RuntimeValue.Type.DISCRETE_BOOL_SAMPLE,\n Operators.and(left.getDiscreteBoolSample(), right.getDiscreteBoolSample())\n );\n }\n\n throw new RuntimeException(\"AND-ing incompatible types\");\n }", "public LogicGateAND() {\r\n\t\t// Initialize input and output ports\r\n\t\tsuper(Operators.AND, new IDynamicInterface(2), new IFixedInterface(new IPort()));\r\n\t}", "public final void ruleOpAnd() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:642:2: ( ( '&&' ) )\r\n // InternalDroneScript.g:643:2: ( '&&' )\r\n {\r\n // InternalDroneScript.g:643:2: ( '&&' )\r\n // InternalDroneScript.g:644:3: '&&'\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getOpAndAccess().getAmpersandAmpersandKeyword()); \r\n }\r\n match(input,15,FOLLOW_2); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getOpAndAccess().getAmpersandAmpersandKeyword()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public void setInput(boolean inputA, boolean inputB) {\n mAndGate.setInput(inputA, inputB);\n mXorGate.setInput(inputA, inputB);\n }", "public final void rule__BoolOperation__Group_8_1__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBSQL2Java.g:1881:1: ( ( '&' ) )\n // InternalBSQL2Java.g:1882:1: ( '&' )\n {\n // InternalBSQL2Java.g:1882:1: ( '&' )\n // InternalBSQL2Java.g:1883:2: '&'\n {\n before(grammarAccess.getBoolOperationAccess().getAmpersandKeyword_8_1_0()); \n match(input,33,FOLLOW_2); \n after(grammarAccess.getBoolOperationAccess().getAmpersandKeyword_8_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(rangeBitwiseAnd(10, 13));\r\n\t}", "public final void ruleOpAnd() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:528:2: ( ( '&&' ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:529:1: ( '&&' )\r\n {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:529:1: ( '&&' )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:530:1: '&&'\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getOpAndAccess().getAmpersandAmpersandKeyword()); \r\n }\r\n match(input,17,FOLLOW_17_in_ruleOpAnd1066); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getOpAndAccess().getAmpersandAmpersandKeyword()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public <V extends Number> FluentExp<V> bitAnd (V value)\n {\n return new BitAnd<V>(this, value);\n }", "public static Object logicAnd(Object val1, Object val2) {\n\t\tif (isBool(val1) && isBool(val2)) {\n\t\t\treturn ((Boolean) val1) && ((Boolean) val2);\n\t\t}\n\t\tthrow new OrccRuntimeException(\"type mismatch in logicAnd\");\n\t}", "public String getAndOr();", "private Term parseLogicalAnd(final boolean required) throws ParseException {\n Term t1 = parseComparison(required);\n while (t1 != null) {\n /*int tt =*/ _tokenizer.next();\n if (isSpecial(\"&&\") || isKeyword(\"and\")) {\n Term t2 = parseComparison(true);\n if ((t1.isB() && t2.isB()) || !isTypeChecking()) {\n t1 = new Term.AndB(t1, t2);\n } else {\n reportTypeErrorB2(\"'&&' or 'and'\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "public ExpressionSearch and(Search srch)\n\t{\n\t\treturn new ExpressionSearch(true).addOps(this, srch);\n\t}", "@Test\n\tpublic void explicitANDTest() {\n\t\tString query = \"hello goodbye\";\n\t\tString query2 = \"hello goodbye hello\";\n\t\tString query3 = \"( hello ( goodbye | hello bye ) )\";\n\t\t\n\t\tString queryResults = \"hello & goodbye\";\n\t\tString query2Results = \"hello & goodbye & hello\";\n\t\tString query3Results = \"( hello & ( goodbye | hello & bye ) )\";\n\n\t\tassertEquals(queryResults, String.join(\" \", queryTest.addExplicitAND(query.split(\" \"))));\n\t\tassertEquals(query2Results, String.join(\" \", queryTest.addExplicitAND(query2.split(\" \"))));\n\t\tassertEquals(query3Results, String.join(\" \", queryTest.addExplicitAND(query3.split(\" \"))));\n\t}", "public final void rule__XAndExpression__FeatureAssignment_1_0_0_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:12207:1: ( ( ( ruleOpAnd ) ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:12208:1: ( ( ruleOpAnd ) )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:12208:1: ( ( ruleOpAnd ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:12209:1: ( ruleOpAnd )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXAndExpressionAccess().getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0()); \n }\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:12210:1: ( ruleOpAnd )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:12211:1: ruleOpAnd\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXAndExpressionAccess().getFeatureJvmIdentifiableElementOpAndParserRuleCall_1_0_0_1_0_1()); \n }\n pushFollow(FOLLOW_ruleOpAnd_in_rule__XAndExpression__FeatureAssignment_1_0_0_124487);\n ruleOpAnd();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXAndExpressionAccess().getFeatureJvmIdentifiableElementOpAndParserRuleCall_1_0_0_1_0_1()); \n }\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXAndExpressionAccess().getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final EObject ruleBitwiseOrExpression() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_2=null;\r\n EObject this_BitwiseAndExpression_0 = null;\r\n\r\n EObject lv_rightOperand_3_0 = null;\r\n\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2812:28: ( (this_BitwiseAndExpression_0= ruleBitwiseAndExpression ( () otherlv_2= '|' ( (lv_rightOperand_3_0= ruleBitwiseAndExpression ) ) )* ) )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2813:1: (this_BitwiseAndExpression_0= ruleBitwiseAndExpression ( () otherlv_2= '|' ( (lv_rightOperand_3_0= ruleBitwiseAndExpression ) ) )* )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2813:1: (this_BitwiseAndExpression_0= ruleBitwiseAndExpression ( () otherlv_2= '|' ( (lv_rightOperand_3_0= ruleBitwiseAndExpression ) ) )* )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2814:5: this_BitwiseAndExpression_0= ruleBitwiseAndExpression ( () otherlv_2= '|' ( (lv_rightOperand_3_0= ruleBitwiseAndExpression ) ) )*\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getBitwiseOrExpressionAccess().getBitwiseAndExpressionParserRuleCall_0()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleBitwiseAndExpression_in_ruleBitwiseOrExpression6455);\r\n this_BitwiseAndExpression_0=ruleBitwiseAndExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_BitwiseAndExpression_0; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2822:1: ( () otherlv_2= '|' ( (lv_rightOperand_3_0= ruleBitwiseAndExpression ) ) )*\r\n loop45:\r\n do {\r\n int alt45=2;\r\n int LA45_0 = input.LA(1);\r\n\r\n if ( (LA45_0==51) ) {\r\n alt45=1;\r\n }\r\n\r\n\r\n switch (alt45) {\r\n \tcase 1 :\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2822:2: () otherlv_2= '|' ( (lv_rightOperand_3_0= ruleBitwiseAndExpression ) )\r\n \t {\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2822:2: ()\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2823:5: \r\n \t {\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t current = forceCreateModelElementAndSet(\r\n \t grammarAccess.getBitwiseOrExpressionAccess().getBitwiseOrExpressionLeftOperandAction_1_0(),\r\n \t current);\r\n \t \r\n \t }\r\n\r\n \t }\r\n\r\n \t otherlv_2=(Token)match(input,51,FOLLOW_51_in_ruleBitwiseOrExpression6476); if (state.failed) return current;\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t \tnewLeafNode(otherlv_2, grammarAccess.getBitwiseOrExpressionAccess().getVerticalLineKeyword_1_1());\r\n \t \r\n \t }\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2832:1: ( (lv_rightOperand_3_0= ruleBitwiseAndExpression ) )\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2833:1: (lv_rightOperand_3_0= ruleBitwiseAndExpression )\r\n \t {\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2833:1: (lv_rightOperand_3_0= ruleBitwiseAndExpression )\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2834:3: lv_rightOperand_3_0= ruleBitwiseAndExpression\r\n \t {\r\n \t if ( state.backtracking==0 ) {\r\n \t \r\n \t \t newCompositeNode(grammarAccess.getBitwiseOrExpressionAccess().getRightOperandBitwiseAndExpressionParserRuleCall_1_2_0()); \r\n \t \t \r\n \t }\r\n \t pushFollow(FOLLOW_ruleBitwiseAndExpression_in_ruleBitwiseOrExpression6497);\r\n \t lv_rightOperand_3_0=ruleBitwiseAndExpression();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return current;\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t \t if (current==null) {\r\n \t \t current = createModelElementForParent(grammarAccess.getBitwiseOrExpressionRule());\r\n \t \t }\r\n \t \t\tset(\r\n \t \t\t\tcurrent, \r\n \t \t\t\t\"rightOperand\",\r\n \t \t\tlv_rightOperand_3_0, \r\n \t \t\t\"BitwiseAndExpression\");\r\n \t \t afterParserOrEnumRuleCall();\r\n \t \t \r\n \t }\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop45;\r\n }\r\n } while (true);\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }", "public final void rule__AstExpressionBitand__OperatorAssignment_1_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:25224:1: ( ( ( '&' ) ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:25225:1: ( ( '&' ) )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:25225:1: ( ( '&' ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:25226:1: ( '&' )\n {\n before(grammarAccess.getAstExpressionBitandAccess().getOperatorAmpersandKeyword_1_1_0()); \n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:25227:1: ( '&' )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:25228:1: '&'\n {\n before(grammarAccess.getAstExpressionBitandAccess().getOperatorAmpersandKeyword_1_1_0()); \n match(input,93,FOLLOW_93_in_rule__AstExpressionBitand__OperatorAssignment_1_150679); \n after(grammarAccess.getAstExpressionBitandAccess().getOperatorAmpersandKeyword_1_1_0()); \n\n }\n\n after(grammarAccess.getAstExpressionBitandAccess().getOperatorAmpersandKeyword_1_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final EObject entryRuleBitwiseAndExpression() throws RecognitionException {\r\n EObject current = null;\r\n\r\n EObject iv_ruleBitwiseAndExpression = null;\r\n\r\n\r\n try {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2859:2: (iv_ruleBitwiseAndExpression= ruleBitwiseAndExpression EOF )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2860:2: iv_ruleBitwiseAndExpression= ruleBitwiseAndExpression EOF\r\n {\r\n if ( state.backtracking==0 ) {\r\n newCompositeNode(grammarAccess.getBitwiseAndExpressionRule()); \r\n }\r\n pushFollow(FOLLOW_ruleBitwiseAndExpression_in_entryRuleBitwiseAndExpression6535);\r\n iv_ruleBitwiseAndExpression=ruleBitwiseAndExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n current =iv_ruleBitwiseAndExpression; \r\n }\r\n match(input,EOF,FOLLOW_EOF_in_entryRuleBitwiseAndExpression6545); if (state.failed) return current;\r\n\r\n }\r\n\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }", "public final void rule__AstExpressionAnd__OperatorAlternatives_1_1_0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2818:1: ( ( '&&' ) | ( 'and' ) )\n int alt13=2;\n int LA13_0 = input.LA(1);\n\n if ( (LA13_0==17) ) {\n alt13=1;\n }\n else if ( (LA13_0==18) ) {\n alt13=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 13, 0, input);\n\n throw nvae;\n }\n switch (alt13) {\n case 1 :\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2819:1: ( '&&' )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2819:1: ( '&&' )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2820:1: '&&'\n {\n before(grammarAccess.getAstExpressionAndAccess().getOperatorAmpersandAmpersandKeyword_1_1_0_0()); \n match(input,17,FOLLOW_17_in_rule__AstExpressionAnd__OperatorAlternatives_1_1_06085); \n after(grammarAccess.getAstExpressionAndAccess().getOperatorAmpersandAmpersandKeyword_1_1_0_0()); \n\n }\n\n\n }\n break;\n case 2 :\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2827:6: ( 'and' )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2827:6: ( 'and' )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2828:1: 'and'\n {\n before(grammarAccess.getAstExpressionAndAccess().getOperatorAndKeyword_1_1_0_1()); \n match(input,18,FOLLOW_18_in_rule__AstExpressionAnd__OperatorAlternatives_1_1_06105); \n after(grammarAccess.getAstExpressionAndAccess().getOperatorAndKeyword_1_1_0_1()); \n\n }\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "IRequirement and(IRequirement requirement);", "public final void mRULE_AND() throws RecognitionException {\n try {\n int _type = RULE_AND;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../org.sqlproc.meta/src-gen/org/sqlproc/meta/parser/antlr/internal/InternalProcessorMeta.g:12791:10: ( '&' '&' )\n // ../org.sqlproc.meta/src-gen/org/sqlproc/meta/parser/antlr/internal/InternalProcessorMeta.g:12791:12: '&' '&'\n {\n match('&'); \n match('&'); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public void execute() {\n\t\tnot_a.in.set(a.get());\n\t\tnot_b.in.set(b.get());\n\n\t\t/* we now execute both of the NOT gates. Each one should\n\t\t * write a value to their output.\n\t\t */\n\t\tnot_a.execute();\n\t\tnot_b.execute();\n\n\n\t\t/* ----- IMPORTANT NOTE 2: -----\n\t\t *\n\t\t * We need to perform NOT twice in this component - since XOR\n\t\t * uses the NOT value of each of the inputs a,b. But we MUST\n\t\t * NOT use the same object twice! Instead, we use two\n\t\t * different NOT objects.\n\t\t *\n\t\t * In a program, this is of course a silly design. But\n\t\t * remember that we are trying to simulate hardware here - and\n\t\t * each component (such as a NOT gate) can only generate one\n\t\t * result per clock tick. So if we want to negate two different\n\t\t * signals for the same calculation, we need two differnt gates.\n\t\t */\n\n\n\t\t/* we now connect various wires to each AND gate. Each AND\n\t\t * checks for \"this value is true, the other is false\"; it does\n\t\t * this by doing the AND of one of the inputs, and the NOT of\n\t\t * the other.\n\t\t *\n\t\t * Note that it's perfectly OK to connect the same input to\n\t\t * two different devices - we just run wires to two different\n\t\t * physical places.\n\t\t */\n\t\tand1.a.set(a.get());\n\t\tand1.b.set(not_b.out.get());\n\n\t\tand2.a.set(not_a.out.get());\n\t\tand2.b.set(b.get());\n\n\t\t/* we execute the two AND gates *AFTER* their inputs are\n\t\t * in place.\n\t\t */\n\t\tand1.execute();\n\t\tand2.execute();\n\n\n\t\t/* the value of XOR is \"this and not that, or not this and that\" -\n\t\t * or, more formally,\n\t\t * (A ~B) + (~A B)\n\t\t * So our last step is to OR the result of the two AND gates\n\t\t * together. Its output is the output from our XOR gate.\n\t\t */\n\t\tor.a.set(and1.out.get());\n\t\tor.b.set(and2.out.get());\n\t\tor.execute();\n\t\tout.set(or.out.get());\n\t}", "public <V extends Number> FluentExp<V> bitAnd (SQLExpression<V> expr)\n {\n return new BitAnd<V>(this, expr);\n }", "public static BinaryExpression andAssign(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }", "public final void rule__XAndExpression__FeatureAssignment_1_0_0_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:17456:1: ( ( ( ruleOpAnd ) ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:17457:1: ( ( ruleOpAnd ) )\r\n {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:17457:1: ( ( ruleOpAnd ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:17458:1: ( ruleOpAnd )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXAndExpressionAccess().getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0()); \r\n }\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:17459:1: ( ruleOpAnd )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:17460:1: ruleOpAnd\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXAndExpressionAccess().getFeatureJvmIdentifiableElementOpAndParserRuleCall_1_0_0_1_0_1()); \r\n }\r\n pushFollow(FOLLOW_ruleOpAnd_in_rule__XAndExpression__FeatureAssignment_1_0_0_135247);\r\n ruleOpAnd();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXAndExpressionAccess().getFeatureJvmIdentifiableElementOpAndParserRuleCall_1_0_0_1_0_1()); \r\n }\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXAndExpressionAccess().getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public int rangeBitwiseAnd(int m, int n) {\n \tint mask = 0xffffffff;\n \twhile((m&mask) != (n&mask)){\n \t\tmask <<= 1;\n \t}\n \treturn mask&m;\n }", "public void setAnd(boolean and) {\n reqIsAnd = and;\n }", "public final void rule__PredicateAnd__Group_1__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3667:1: ( ( '&&' ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3668:1: ( '&&' )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3668:1: ( '&&' )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3669:1: '&&'\n {\n before(grammarAccess.getPredicateAndAccess().getAmpersandAmpersandKeyword_1_1()); \n match(input,28,FOLLOW_28_in_rule__PredicateAnd__Group_1__1__Impl7218); \n after(grammarAccess.getPredicateAndAccess().getAmpersandAmpersandKeyword_1_1()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final CQLParser.andExpression_return andExpression() throws RecognitionException {\n CQLParser.andExpression_return retval = new CQLParser.andExpression_return();\n retval.start = input.LT(1);\n\n Object root_0 = null;\n\n Token AND88=null;\n CQLParser.relationalExpression_return relationalExpression87 = null;\n\n CQLParser.relationalExpression_return relationalExpression89 = null;\n\n\n Object AND88_tree=null;\n\n errorMessageStack.push(\"AND expression\"); \n try {\n // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:373:2: ( relationalExpression ( AND relationalExpression )* )\n // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:373:4: relationalExpression ( AND relationalExpression )*\n {\n root_0 = (Object)adaptor.nil();\n\n pushFollow(FOLLOW_relationalExpression_in_andExpression1729);\n relationalExpression87=relationalExpression();\n\n state._fsp--;\n\n adaptor.addChild(root_0, relationalExpression87.getTree());\n // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:373:25: ( AND relationalExpression )*\n loop23:\n do {\n int alt23=2;\n int LA23_0 = input.LA(1);\n\n if ( (LA23_0==AND) ) {\n alt23=1;\n }\n\n\n switch (alt23) {\n \tcase 1 :\n \t // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:373:26: AND relationalExpression\n \t {\n \t AND88=(Token)match(input,AND,FOLLOW_AND_in_andExpression1732); \n \t AND88_tree = (Object)adaptor.create(AND88);\n \t root_0 = (Object)adaptor.becomeRoot(AND88_tree, root_0);\n\n \t pushFollow(FOLLOW_relationalExpression_in_andExpression1735);\n \t relationalExpression89=relationalExpression();\n\n \t state._fsp--;\n\n \t adaptor.addChild(root_0, relationalExpression89.getTree());\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop23;\n }\n } while (true);\n\n\n }\n\n retval.stop = input.LT(-1);\n\n retval.tree = (Object)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n errorMessageStack.pop();\n }\n \t\n \tcatch(RecognitionException re)\n \t{\t\n \t\treportError(re);\n \t\tthrow re;\n \t}\n finally {\n }\n return retval;\n }", "public int rangeBitwiseAnd(int m, int n) {\n int i = 0;\n while (m != n) {\n m >>= 1;\n n >>= 1;\n i++;\n }\n return (n << i);\n }", "public final void rule__XAndExpression__FeatureAssignment_1_0_0_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:17479:1: ( ( ( ruleOpAnd ) ) )\r\n // InternalDroneScript.g:17480:2: ( ( ruleOpAnd ) )\r\n {\r\n // InternalDroneScript.g:17480:2: ( ( ruleOpAnd ) )\r\n // InternalDroneScript.g:17481:3: ( ruleOpAnd )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXAndExpressionAccess().getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0()); \r\n }\r\n // InternalDroneScript.g:17482:3: ( ruleOpAnd )\r\n // InternalDroneScript.g:17483:4: ruleOpAnd\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXAndExpressionAccess().getFeatureJvmIdentifiableElementOpAndParserRuleCall_1_0_0_1_0_1()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleOpAnd();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXAndExpressionAccess().getFeatureJvmIdentifiableElementOpAndParserRuleCall_1_0_0_1_0_1()); \r\n }\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXAndExpressionAccess().getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public static void main(String[] args) {\n\t\tBitSet bits1 = new BitSet(16);\n\t\tBitSet bits2 = new BitSet(16);\n\n\t\t// set some bits\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tif ((i % 2) == 0) bits1.set(i);\n\t\t\tif ((i % 5) != 0) bits2.set(i);\n\t\t}\n\t\tSystem.out.println(\"Initial pattern in bits1: \");\n\t\tSystem.out.println(bits1);\n\t\tSystem.out.println(\"\\nInitial pattern in bits2: \");\n\t\tSystem.out.println(bits2);\n\n\t\t// AND bits\n\t\tbits2.and(bits1);\n\t\tSystem.out.println(\"\\nbits2 AND bits1: \");\n\t\tSystem.out.println(bits2);\n\n\t\t// OR bits\n\t\tbits2.or(bits1);\n\t\tSystem.out.println(\"\\nbits2 OR bits1: \");\n\t\tSystem.out.println(bits2);\n\n\t\t// XOR bits\n\t\tbits2.xor(bits1);\n\t\tSystem.out.println(\"\\nbits2 XOR bits1: \");\n\t\tSystem.out.println(bits2);\n\t}", "public static boolean bitwiseOperator(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"bitwiseOperator\")) return false;\n if (!nextTokenIs(b, \"<bitwise operator>\", AND, OR, XOR)) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, BITWISE_OPERATOR, \"<bitwise operator>\");\n r = consumeToken(b, AND);\n if (!r) r = consumeToken(b, XOR);\n if (!r) r = consumeToken(b, OR);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "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}", "@Test\n public void test1(){\n assertEquals(true, Program.and(true, true));\n }", "public TribitByte and(TribitByte other){\n Objects.requireNonNull(other);\n Tribit[] and = Stream.iterate(0, i -> i + 1)\n .limit(LENGTH)\n .map(i -> Tribit.and(value[i], other.value[i]))\n .toArray(Tribit[]::new);\n return new TribitByte(and);\n }", "public final void rule__BoolOperation__Group__15__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBSQL2Java.g:1557:1: ( ( '&' ) )\n // InternalBSQL2Java.g:1558:1: ( '&' )\n {\n // InternalBSQL2Java.g:1558:1: ( '&' )\n // InternalBSQL2Java.g:1559:2: '&'\n {\n before(grammarAccess.getBoolOperationAccess().getAmpersandKeyword_15()); \n match(input,33,FOLLOW_2); \n after(grammarAccess.getBoolOperationAccess().getAmpersandKeyword_15()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "protected void sequence_AND(ISerializationContext context, AND semanticObject) {\n\t\tif (errorAcceptor != null) {\n\t\t\tif (transientValues.isValueTransient(semanticObject, SiddhiPackage.eINSTANCE.getAND_And()) == ValueTransient.YES)\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SiddhiPackage.eINSTANCE.getAND_And()));\n\t\t}\n\t\tSequenceFeeder feeder = createSequencerFeeder(context, semanticObject);\n\t\tfeeder.accept(grammarAccess.getANDAccess().getAndAndKeyword_0(), semanticObject.getAnd());\n\t\tfeeder.finish();\n\t}", "@OperationMeta(opType = OperationType.INFIX)\n public static boolean or(boolean b1, boolean b2) {\n return b1 | b2;\n }", "public final EObject ruleBitwiseAndExpression() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_2=null;\r\n EObject this_LogicalRelationExpression_0 = null;\r\n\r\n EObject lv_rightOperand_3_0 = null;\r\n\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2870:28: ( (this_LogicalRelationExpression_0= ruleLogicalRelationExpression ( () otherlv_2= '&' ( (lv_rightOperand_3_0= ruleLogicalRelationExpression ) ) )* ) )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2871:1: (this_LogicalRelationExpression_0= ruleLogicalRelationExpression ( () otherlv_2= '&' ( (lv_rightOperand_3_0= ruleLogicalRelationExpression ) ) )* )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2871:1: (this_LogicalRelationExpression_0= ruleLogicalRelationExpression ( () otherlv_2= '&' ( (lv_rightOperand_3_0= ruleLogicalRelationExpression ) ) )* )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2872:5: this_LogicalRelationExpression_0= ruleLogicalRelationExpression ( () otherlv_2= '&' ( (lv_rightOperand_3_0= ruleLogicalRelationExpression ) ) )*\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getBitwiseAndExpressionAccess().getLogicalRelationExpressionParserRuleCall_0()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleLogicalRelationExpression_in_ruleBitwiseAndExpression6592);\r\n this_LogicalRelationExpression_0=ruleLogicalRelationExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_LogicalRelationExpression_0; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2880:1: ( () otherlv_2= '&' ( (lv_rightOperand_3_0= ruleLogicalRelationExpression ) ) )*\r\n loop46:\r\n do {\r\n int alt46=2;\r\n int LA46_0 = input.LA(1);\r\n\r\n if ( (LA46_0==52) ) {\r\n alt46=1;\r\n }\r\n\r\n\r\n switch (alt46) {\r\n \tcase 1 :\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2880:2: () otherlv_2= '&' ( (lv_rightOperand_3_0= ruleLogicalRelationExpression ) )\r\n \t {\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2880:2: ()\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2881:5: \r\n \t {\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t current = forceCreateModelElementAndSet(\r\n \t grammarAccess.getBitwiseAndExpressionAccess().getBitwiseAndExpressionLeftOperandAction_1_0(),\r\n \t current);\r\n \t \r\n \t }\r\n\r\n \t }\r\n\r\n \t otherlv_2=(Token)match(input,52,FOLLOW_52_in_ruleBitwiseAndExpression6613); if (state.failed) return current;\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t \tnewLeafNode(otherlv_2, grammarAccess.getBitwiseAndExpressionAccess().getAmpersandKeyword_1_1());\r\n \t \r\n \t }\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2890:1: ( (lv_rightOperand_3_0= ruleLogicalRelationExpression ) )\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2891:1: (lv_rightOperand_3_0= ruleLogicalRelationExpression )\r\n \t {\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2891:1: (lv_rightOperand_3_0= ruleLogicalRelationExpression )\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2892:3: lv_rightOperand_3_0= ruleLogicalRelationExpression\r\n \t {\r\n \t if ( state.backtracking==0 ) {\r\n \t \r\n \t \t newCompositeNode(grammarAccess.getBitwiseAndExpressionAccess().getRightOperandLogicalRelationExpressionParserRuleCall_1_2_0()); \r\n \t \t \r\n \t }\r\n \t pushFollow(FOLLOW_ruleLogicalRelationExpression_in_ruleBitwiseAndExpression6634);\r\n \t lv_rightOperand_3_0=ruleLogicalRelationExpression();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return current;\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t \t if (current==null) {\r\n \t \t current = createModelElementForParent(grammarAccess.getBitwiseAndExpressionRule());\r\n \t \t }\r\n \t \t\tset(\r\n \t \t\t\tcurrent, \r\n \t \t\t\t\"rightOperand\",\r\n \t \t\tlv_rightOperand_3_0, \r\n \t \t\t\"LogicalRelationExpression\");\r\n \t \t afterParserOrEnumRuleCall();\r\n \t \t \r\n \t }\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop46;\r\n }\r\n } while (true);\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }", "public static void main(String[] args) {\n\t\t\n\t\tint a=10;\n\t\tint b=20;\n\t\t\n\t\tint c=a&b; //Here sigle (&)And operator represents bitwise operator.\n\t\tint d=a|b; //Here Single (|)or operator represents bitwise operator.\n\t\t\n\t\tSystem.out.println(c);\n\t\tSystem.out.println(d);\n\n\t}", "public final void rule__AstExpressionBitxor__RightAssignment_1_2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:25209:1: ( ( ruleAstExpressionBitand ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:25210:1: ( ruleAstExpressionBitand )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:25210:1: ( ruleAstExpressionBitand )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:25211:1: ruleAstExpressionBitand\n {\n before(grammarAccess.getAstExpressionBitxorAccess().getRightAstExpressionBitandParserRuleCall_1_2_0()); \n pushFollow(FOLLOW_ruleAstExpressionBitand_in_rule__AstExpressionBitxor__RightAssignment_1_250643);\n ruleAstExpressionBitand();\n\n state._fsp--;\n\n after(grammarAccess.getAstExpressionBitxorAccess().getRightAstExpressionBitandParserRuleCall_1_2_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public FluentExp<Boolean> and (SQLExpression<Boolean> expr)\n {\n return Ops.and(this, expr);\n }", "Expr join() throws IOException {\n\t\tExpr e = equality();\n\t\twhile (look.tag == Tag.AND) {\n\t\t\tToken tok = look;\n\t\t\tmove();\n\t\t\te = new And(tok, e, equality());\n\t\t}\n\t\treturn e;\n\t}", "public void testAND2() throws Exception {\n\t\tObject retval = execLexer(\"AND\", 226, \"&\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.FAIL, retval);\n\t\tObject expecting = \"FAIL\";\n\n\t\tassertEquals(\"testing rule \"+\"AND\", expecting, actual);\n\t}", "public AndFilter(final Filter left, final Filter right) {\r\n this(CollectionUtil.newList(left, right));\r\n }", "public static Predicate and(Predicate... predicates)\n {\n return new LogicPredicate(Type.AND, predicates);\n }", "@Test\n public void testPredicateAnd() {\n Predicate<Integer> isEven = (x) -> (x % 2) == 0;\n Predicate<Integer> isDivSeven = (x) -> (x % 7) == 0;\n\n Predicate<Integer> evenOrDivSeven = isEven.and(isDivSeven);\n\n assertTrue(evenOrDivSeven.apply(14));\n assertFalse(evenOrDivSeven.apply(21));\n assertFalse(evenOrDivSeven.apply(8));\n assertFalse(evenOrDivSeven.apply(5));\n }", "public final void rule__BoolOperation__Group_17__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBSQL2Java.g:1935:1: ( ( '&' ) )\n // InternalBSQL2Java.g:1936:1: ( '&' )\n {\n // InternalBSQL2Java.g:1936:1: ( '&' )\n // InternalBSQL2Java.g:1937:2: '&'\n {\n before(grammarAccess.getBoolOperationAccess().getAmpersandKeyword_17_0()); \n match(input,33,FOLLOW_2); \n after(grammarAccess.getBoolOperationAccess().getAmpersandKeyword_17_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "@SafeVarargs\n public static AndSpecification and( Specification<Composite> left,\n Specification<Composite> right,\n Specification<Composite>... optionalRight\n )\n {\n return new AndSpecification( prepend( left, prepend( right, Arrays.asList( optionalRight ) ) ) );\n }", "@Test\n public void testAnd() {\n if (true && addValue()) {\n assertThat(flag, equalTo(1));\n }\n\n // first expression is not satisfied conditions, then second expression not invoke\n if (false && addValue()) {\n assertThat(flag, equalTo(1));\n }\n }", "private double logicalAnd() {\n\t\tdouble q = p<=0.5?p:1-p;\n\t\treturn num * configMap.get('r') + (num-1) * configMap.get('l') + num * configMap.get('f') + configMap.get('t') + q * configMap.get('m') + p * configMap.get('a');\n\t}", "public static void main(String[] args) {\n unaryAndBinaryOperator();\n }", "public final void rule__AstExpressionBitxor__Group__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:17347:1: ( ( ruleAstExpressionBitand ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:17348:1: ( ruleAstExpressionBitand )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:17348:1: ( ruleAstExpressionBitand )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:17349:1: ruleAstExpressionBitand\n {\n before(grammarAccess.getAstExpressionBitxorAccess().getAstExpressionBitandParserRuleCall_0()); \n pushFollow(FOLLOW_ruleAstExpressionBitand_in_rule__AstExpressionBitxor__Group__0__Impl34918);\n ruleAstExpressionBitand();\n\n state._fsp--;\n\n after(grammarAccess.getAstExpressionBitxorAccess().getAstExpressionBitandParserRuleCall_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public And(Formula f1, Formula f2) {\n\t\tsuper(f1, f2);\n\t}", "public Operation zCombinedAnd(Operation op)\r\n {\r\n if (op.equals(this))\r\n {\r\n return this;\r\n }\r\n return null;\r\n }", "public static void main(String[] args) {\n\t\tint x = Integer.parseInt(args[0]), y = Integer.parseInt(args[1]);\n\t\tint z1 = x & y ; // and \n\t\tint z2 = x | y ; // or \n\t\tint z3 = x ^ y ; // xor \n\t\tint z4 = ~x ; // not \n\t\tSystem.out.print(\"x = \" + Integer.toBinaryString(x)\n\t\t\t\t+ \"\\ny = \" + Integer.toBinaryString(y)\n\t\t\t\t+ \"\\nz = x & y: \" + z1\n\t\t\t\t+ \"\\nz = x | y: \" + z2\n\t\t\t\t+ \"\\nz = x ^ y: \" + z3\n\t\t\t\t+ \"\\nz = ~x: \" + z4);\n\n\t}", "private int addBinary(int a, int b) {\n if (b == 0) {\r\n return a;\r\n }\r\n \r\n // XOR is like doing a sum without carrying the remainders\r\n int sum = a ^ b;\r\n \r\n // AND shifted left is like getting just the remainders\r\n int carry = (a & b) << 1;\r\n \r\n return addBinary(sum, carry);\r\n }", "Formula contains(Expression p0, Expression p1) {\n\t\tfinal Formula f0 = implicitMask(p0).gte(implicitMask(p1));\n\t\tfinal Formula f1 = addr(p0).and(explicitMask(p0)).eq(addr(p1).and(explicitMask(p0)));\n\t\treturn f0.and(f1);\n\t}", "public static void main(String[] args) {\nboolean a, b, c;\na =true;\nb = false;\nc =a && b;\n\nSystem.out.println(\"c = a&&B:\" + c);\nc = a||b;\nSystem.out.println(\"c = a||b:\" + c);\nc = a==b;\nSystem.out.println(\"c = a==b:\" + c);\nc = a!=b;\nSystem.out.println(\"c = a!=b:\" + c);\n\n\n\n\t}", "private void or() {\n // PROGRAM 1: Student must complete this method\n //loop through output array\n for (int i = 0; i < output.length; i++) {\n //take the or of index i of inputA and inputB and place result in output[i]\n output[i] = (inputA[i] | inputB[i]);\n }\n }", "public static TreeNode makeAnd(List<TreeNode> nodes) {\n return new AndNode(nodes);\n }", "public void visita(And and) {\n and.getOperando(0).accept(this);\r\n Resultado resIzq = new Resultado(resParcial.getResultado());\r\n if (resIzq.equals(Resultado.COD_TRUE)) {\r\n resIzq.setEjemplo(resParcial.getEjemplo());\r\n } else {\r\n resIzq.setContraejemplo(resParcial.getContraejemplo());\r\n }\r\n and.getOperando(1).accept(this);\r\n Resultado resDer = new Resultado(resParcial.getResultado());\r\n if (resDer.equals(Resultado.COD_TRUE)) {\r\n resDer.setEjemplo(resParcial.getEjemplo());\r\n } else {\r\n resDer.setContraejemplo(resParcial.getContraejemplo());\r\n }\r\n Resultado resAND;\r\n try {\r\n boolean part1 = Boolean.parseBoolean(resIzq.getResultado());\r\n boolean part2 = Boolean.parseBoolean(resDer.getResultado());\r\n part1 = part1 && part2;\r\n resAND = new Resultado(String.valueOf(part1));\r\n if (part1) {\r\n resAND.setEjemplo(resIzq.getEjemplo());\r\n } else if (part2) {\r\n resAND.setContraejemplo(resIzq.getContraejemplo());\r\n } else {\r\n resAND.setContraejemplo(resDer.getContraejemplo());\r\n }\r\n } catch (Exception e) {\r\n if ((resIzq.getResultado().equals(Resultado.COD_FALSE)) ||\r\n (resDer.getResultado().equals(Resultado.COD_FALSE))) {\r\n resAND = new Resultado(Resultado.COD_FALSE);\r\n } else {\r\n resAND = new Resultado(Resultado.COD_MAYBEF);\r\n }\r\n }\r\n resParcial = resAND;\r\n\r\n }", "public final void mT__62() throws RecognitionException {\n try {\n int _type = T__62;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalEsm.g:56:7: ( 'AND' )\n // InternalEsm.g:56:9: 'AND'\n {\n match(\"AND\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public final void mT__89() throws RecognitionException {\r\n try {\r\n int _type = T__89;\r\n int _channel = DEFAULT_TOKEN_CHANNEL;\r\n // ../org.openmodelica.modelicaml.editor.xtext.modification.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/modification/ui/contentassist/antlr/internal/InternalModification.g:86:7: ( 'and' )\r\n // ../org.openmodelica.modelicaml.editor.xtext.modification.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/modification/ui/contentassist/antlr/internal/InternalModification.g:86:9: 'and'\r\n {\r\n match(\"and\"); \r\n\r\n\r\n }\r\n\r\n state.type = _type;\r\n state.channel = _channel;\r\n }\r\n finally {\r\n }\r\n }", "public int rangeBitwiseAnd(int m, int n) {\n\t \tint ans = 0;\n\t for (int i = 0; i < 32; ++ i) {\n \t\tif (1 == ((m >> i) & 1)) {\n \t\t\tif (((m & ~0 << (i + 1)) | (~0 >>> (31 - i))) >= n) {\n \t\t\t\tans |= 1 << i;\n \t\t\t}\n \t\t}\n\t }\n\t System.out.println(ans);\n\t return ans;\n\t }", "public final void mK_AND() throws RecognitionException {\n try {\n int _type = K_AND;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:482:6: ( A N D )\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:482:16: A N D\n {\n mA(); \n mN(); \n mD(); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public final PythonParser.and_expr_return and_expr() throws RecognitionException {\n PythonParser.and_expr_return retval = new PythonParser.and_expr_return();\n retval.start = input.LT(1);\n\n PythonTree root_0 = null;\n\n Token op=null;\n List list_right=null;\n PythonParser.shift_expr_return left = null;\n\n PythonParser.shift_expr_return right = null;\n right = null;\n PythonTree op_tree=null;\n RewriteRuleTokenStream stream_AMPER=new RewriteRuleTokenStream(adaptor,\"token AMPER\");\n RewriteRuleSubtreeStream stream_shift_expr=new RewriteRuleSubtreeStream(adaptor,\"rule shift_expr\");\n try {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1170:5: (left= shift_expr ( (op= AMPER right+= shift_expr )+ | -> $left) )\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1170:7: left= shift_expr ( (op= AMPER right+= shift_expr )+ | -> $left)\n {\n pushFollow(FOLLOW_shift_expr_in_and_expr5030);\n left=shift_expr();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_shift_expr.add(left.getTree());\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1171:9: ( (op= AMPER right+= shift_expr )+ | -> $left)\n int alt93=2;\n int LA93_0 = input.LA(1);\n\n if ( (LA93_0==AMPER) ) {\n alt93=1;\n }\n else if ( (LA93_0==EOF||LA93_0==NEWLINE||LA93_0==NAME||(LA93_0>=AND && LA93_0<=AS)||LA93_0==FOR||LA93_0==IF||(LA93_0>=IN && LA93_0<=IS)||(LA93_0>=NOT && LA93_0<=ORELSE)||(LA93_0>=RPAREN && LA93_0<=COMMA)||(LA93_0>=SEMI && LA93_0<=DOUBLESLASHEQUAL)||(LA93_0>=LESS && LA93_0<=CIRCUMFLEX)||LA93_0==RBRACK||(LA93_0>=RCURLY && LA93_0<=BACKQUOTE)) ) {\n alt93=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 93, 0, input);\n\n throw nvae;\n }\n switch (alt93) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1171:11: (op= AMPER right+= shift_expr )+\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1171:11: (op= AMPER right+= shift_expr )+\n int cnt92=0;\n loop92:\n do {\n int alt92=2;\n int LA92_0 = input.LA(1);\n\n if ( (LA92_0==AMPER) ) {\n alt92=1;\n }\n\n\n switch (alt92) {\n \tcase 1 :\n \t // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1171:12: op= AMPER right+= shift_expr\n \t {\n \t op=(Token)match(input,AMPER,FOLLOW_AMPER_in_and_expr5045); if (state.failed) return retval; \n \t if ( state.backtracking==0 ) stream_AMPER.add(op);\n\n \t pushFollow(FOLLOW_shift_expr_in_and_expr5049);\n \t right=shift_expr();\n\n \t state._fsp--;\n \t if (state.failed) return retval;\n \t if ( state.backtracking==0 ) stream_shift_expr.add(right.getTree());\n \t if (list_right==null) list_right=new ArrayList();\n \t list_right.add(right.getTree());\n\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt92 >= 1 ) break loop92;\n \t if (state.backtracking>0) {state.failed=true; return retval;}\n EarlyExitException eee =\n new EarlyExitException(92, input);\n throw eee;\n }\n cnt92++;\n } while (true);\n\n\n }\n break;\n case 2 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1174:8: \n {\n\n // AST REWRITE\n // elements: left\n // token labels: \n // rule labels: retval, left\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n RewriteRuleSubtreeStream stream_left=new RewriteRuleSubtreeStream(adaptor,\"rule left\",left!=null?left.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1174:8: -> $left\n {\n adaptor.addChild(root_0, stream_left.nextTree());\n\n }\n\n retval.tree = root_0;}\n }\n break;\n\n }\n\n\n }\n\n retval.stop = input.LT(-1);\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (PythonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n if ( state.backtracking==0 ) {\n\n if (op != null) {\n retval.tree = actions.makeBinOp((left!=null?((PythonTree)left.tree):null), operatorType.BitAnd, list_right);\n }\n\n }\n }\n\n catch (RecognitionException re) {\n errorHandler.reportError(this, re);\n errorHandler.recover(this, input,re);\n retval.tree = (PythonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n }\n finally {\n }\n return retval;\n }", "static int add(int a, int b){\n int carry = 0;\n int result = 0;\n int i;\n for(i=0; a>0||b>0; i++){\n int ba = a&1;\n int bb = b&1;\n result = result|((carry^ba^bb)<<i);\n carry = (ba&bb) | (bb&carry) | (carry&ba);\n a = a>>1;\n b = b>>1;\n }\n return result|(carry<<i);\n }", "public final void andExpression() throws RecognitionException {\n int andExpression_StartIndex = input.index();\n try { dbg.enterRule(getGrammarFileName(), \"andExpression\");\n if ( getRuleLevel()==0 ) {dbg.commence();}\n incRuleLevel();\n dbg.location(761, 1);\n\n try {\n if ( state.backtracking>0 && alreadyParsedRule(input, 112) ) { return ; }\n // Java.g:762:5: ( equalityExpression ( '&' equalityExpression )* )\n dbg.enterAlt(1);\n\n // Java.g:762:9: equalityExpression ( '&' equalityExpression )*\n {\n dbg.location(762,9);\n pushFollow(FOLLOW_equalityExpression_in_andExpression4476);\n equalityExpression();\n\n state._fsp--;\n if (state.failed) return ;\n dbg.location(762,28);\n // Java.g:762:28: ( '&' equalityExpression )*\n try { dbg.enterSubRule(133);\n\n loop133:\n do {\n int alt133=2;\n try { dbg.enterDecision(133);\n\n int LA133_0 = input.LA(1);\n\n if ( (LA133_0==43) ) {\n alt133=1;\n }\n\n\n } finally {dbg.exitDecision(133);}\n\n switch (alt133) {\n \tcase 1 :\n \t dbg.enterAlt(1);\n\n \t // Java.g:762:30: '&' equalityExpression\n \t {\n \t dbg.location(762,30);\n \t match(input,43,FOLLOW_43_in_andExpression4480); if (state.failed) return ;\n \t dbg.location(762,34);\n \t pushFollow(FOLLOW_equalityExpression_in_andExpression4482);\n \t equalityExpression();\n\n \t state._fsp--;\n \t if (state.failed) return ;\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop133;\n }\n } while (true);\n } finally {dbg.exitSubRule(133);}\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n if ( state.backtracking>0 ) { memoize(input, 112, andExpression_StartIndex); }\n }\n dbg.location(763, 5);\n\n }\n finally {\n dbg.exitRule(getGrammarFileName(), \"andExpression\");\n decRuleLevel();\n if ( getRuleLevel()==0 ) {dbg.terminate();}\n }\n\n return ;\n }", "public final EObject ruleAnd() throws RecognitionException {\n EObject current = null;\n\n Token lv_operator_2_0=null;\n EObject this_RelationalExpression_0 = null;\n\n EObject lv_right_3_0 = null;\n\n\n enterRule(); \n \n try {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3903:28: ( (this_RelationalExpression_0= ruleRelationalExpression ( () ( (lv_operator_2_0= '&&' ) ) ( (lv_right_3_0= ruleRelationalExpression ) ) )* ) )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3904:1: (this_RelationalExpression_0= ruleRelationalExpression ( () ( (lv_operator_2_0= '&&' ) ) ( (lv_right_3_0= ruleRelationalExpression ) ) )* )\n {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3904:1: (this_RelationalExpression_0= ruleRelationalExpression ( () ( (lv_operator_2_0= '&&' ) ) ( (lv_right_3_0= ruleRelationalExpression ) ) )* )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3905:5: this_RelationalExpression_0= ruleRelationalExpression ( () ( (lv_operator_2_0= '&&' ) ) ( (lv_right_3_0= ruleRelationalExpression ) ) )*\n {\n \n newCompositeNode(grammarAccess.getAndAccess().getRelationalExpressionParserRuleCall_0()); \n \n pushFollow(FOLLOW_ruleRelationalExpression_in_ruleAnd8765);\n this_RelationalExpression_0=ruleRelationalExpression();\n\n state._fsp--;\n\n \n current = this_RelationalExpression_0; \n afterParserOrEnumRuleCall();\n \n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3913:1: ( () ( (lv_operator_2_0= '&&' ) ) ( (lv_right_3_0= ruleRelationalExpression ) ) )*\n loop35:\n do {\n int alt35=2;\n int LA35_0 = input.LA(1);\n\n if ( (LA35_0==59) ) {\n alt35=1;\n }\n\n\n switch (alt35) {\n \tcase 1 :\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3913:2: () ( (lv_operator_2_0= '&&' ) ) ( (lv_right_3_0= ruleRelationalExpression ) )\n \t {\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3913:2: ()\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3914:5: \n \t {\n\n \t current = forceCreateModelElementAndSet(\n \t grammarAccess.getAndAccess().getBooleanOperationLeftAction_1_0(),\n \t current);\n \t \n\n \t }\n\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3919:2: ( (lv_operator_2_0= '&&' ) )\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3920:1: (lv_operator_2_0= '&&' )\n \t {\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3920:1: (lv_operator_2_0= '&&' )\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3921:3: lv_operator_2_0= '&&'\n \t {\n \t lv_operator_2_0=(Token)match(input,59,FOLLOW_59_in_ruleAnd8792); \n\n \t newLeafNode(lv_operator_2_0, grammarAccess.getAndAccess().getOperatorAmpersandAmpersandKeyword_1_1_0());\n \t \n\n \t \t if (current==null) {\n \t \t current = createModelElement(grammarAccess.getAndRule());\n \t \t }\n \t \t\tsetWithLastConsumed(current, \"operator\", lv_operator_2_0, \"&&\");\n \t \t \n\n \t }\n\n\n \t }\n\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3934:2: ( (lv_right_3_0= ruleRelationalExpression ) )\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3935:1: (lv_right_3_0= ruleRelationalExpression )\n \t {\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3935:1: (lv_right_3_0= ruleRelationalExpression )\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3936:3: lv_right_3_0= ruleRelationalExpression\n \t {\n \t \n \t \t newCompositeNode(grammarAccess.getAndAccess().getRightRelationalExpressionParserRuleCall_1_2_0()); \n \t \t \n \t pushFollow(FOLLOW_ruleRelationalExpression_in_ruleAnd8826);\n \t lv_right_3_0=ruleRelationalExpression();\n\n \t state._fsp--;\n\n\n \t \t if (current==null) {\n \t \t current = createModelElementForParent(grammarAccess.getAndRule());\n \t \t }\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"right\",\n \t \t\tlv_right_3_0, \n \t \t\t\"RelationalExpression\");\n \t \t afterParserOrEnumRuleCall();\n \t \t \n\n \t }\n\n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop35;\n }\n } while (true);\n\n\n }\n\n\n }\n\n leaveRule(); \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "public static final UnboundRecordFilter and( final UnboundRecordFilter filter1, final UnboundRecordFilter filter2 ) {\n Objects.requireNonNull(filter1, \"filter1 cannot be null\");\n Objects.requireNonNull(filter2, \"filter2 cannot be null\");\n return new UnboundRecordFilter() {\n @Override\n public RecordFilter bind(Iterable<ColumnReader> readers) {\n return new AndRecordFilter( filter1.bind(readers), filter2.bind( readers) );\n }\n };\n }", "public final Expr andExpr() throws RecognitionException {\r\n Expr result = null;\r\n\r\n int andExpr_StartIndex = input.index();\r\n\r\n Expr lhs =null;\r\n\r\n Expr rhs =null;\r\n\r\n\r\n try {\r\n if ( state.backtracking>0 && alreadyParsedRule(input, 17) ) { return result; }\r\n\r\n // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:157:5: (lhs= relExpr ( '&&' rhs= relExpr )* )\r\n // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:157:9: lhs= relExpr ( '&&' rhs= relExpr )*\r\n {\r\n pushFollow(FOLLOW_relExpr_in_andExpr789);\r\n lhs=relExpr();\r\n\r\n state._fsp--;\r\n if (state.failed) return result;\r\n\r\n if ( state.backtracking==0 ) { result =lhs; }\r\n\r\n // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:157:46: ( '&&' rhs= relExpr )*\r\n loop12:\r\n do {\r\n int alt12=2;\r\n int LA12_0 = input.LA(1);\r\n\r\n if ( (LA12_0==20) ) {\r\n alt12=1;\r\n }\r\n\r\n\r\n switch (alt12) {\r\n \tcase 1 :\r\n \t // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:157:48: '&&' rhs= relExpr\r\n \t {\r\n \t match(input,20,FOLLOW_20_in_andExpr795); if (state.failed) return result;\r\n\r\n \t pushFollow(FOLLOW_relExpr_in_andExpr799);\r\n \t rhs=relExpr();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return result;\r\n\r\n \t if ( state.backtracking==0 ) { result = new And(result, rhs); }\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop12;\r\n }\r\n } while (true);\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n if ( state.backtracking>0 ) { memoize(input, 17, andExpr_StartIndex); }\r\n\r\n }\r\n return result;\r\n }", "public static String xor(String firstInput, String secondInput) { \n StringBuilder result = new StringBuilder();\n\n for (int i = 0; i < firstInput.length(); i++) {\n if (firstInput.charAt(i) == secondInput.charAt(i)) {\n result.append(\"0\");\n } else {\n result.append(\"1\");\n }\n }\n\n return result.toString();\n }" ]
[ "0.7276504", "0.7140312", "0.6955346", "0.6945251", "0.69075805", "0.6867506", "0.6821126", "0.65396816", "0.65042126", "0.64769113", "0.6445455", "0.64368415", "0.6429882", "0.64103377", "0.63971907", "0.6367072", "0.6353654", "0.6350993", "0.63087034", "0.6251024", "0.62472415", "0.62280715", "0.6206546", "0.6180229", "0.6165139", "0.61008626", "0.6042599", "0.6033951", "0.5987452", "0.59492636", "0.5906476", "0.58901703", "0.58540565", "0.5853142", "0.57799447", "0.57644063", "0.5756942", "0.57500505", "0.57471263", "0.57435405", "0.57425076", "0.57358474", "0.5714257", "0.57131493", "0.5707302", "0.57058823", "0.56688285", "0.5668227", "0.5632138", "0.56239927", "0.5614544", "0.55893445", "0.55627203", "0.55532944", "0.55380356", "0.55284226", "0.5520916", "0.55084044", "0.54957014", "0.54918015", "0.5489708", "0.5481368", "0.5455412", "0.54539543", "0.5453735", "0.54518366", "0.54452026", "0.54409826", "0.5438258", "0.54369825", "0.5430083", "0.5419286", "0.5401995", "0.5396898", "0.5392914", "0.5376362", "0.5339254", "0.53309196", "0.5323565", "0.5315176", "0.53124285", "0.53101975", "0.530479", "0.5300862", "0.52842605", "0.5233983", "0.52187026", "0.521085", "0.5207798", "0.5176592", "0.5175414", "0.5174375", "0.51736194", "0.51730525", "0.51510847", "0.5147768", "0.51381814", "0.5135746", "0.51321566", "0.51296633" ]
0.75343794
0
Performs the bitwise OR operation: output = inputA OR inputB
private void or() { // PROGRAM 1: Student must complete this method //loop through output array for (int i = 0; i < output.length; i++) { //take the or of index i of inputA and inputB and place result in output[i] output[i] = (inputA[i] | inputB[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public ILogical or(ILogical operador) {\n return operador.orBinary(this);\n }", "private Term parseBitwiseOr(final boolean required) throws ParseException {\n Term t1 = parseBtwiseXOr(required);\n while (t1 != null) {\n int tt = _tokenizer.next();\n if (tt == '|') {\n Term t2 = parseBtwiseXOr(true);\n if ((t1.isI() && t2.isI()) || !isTypeChecking()) {\n t1 = new Term.OrI(t1, t2);\n } else {\n reportTypeErrorI2(\"'|'\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "public Object visitBitwiseOrExpression(GNode n) {\n Object a, b, result;\n \n nonboolean = true;\n \n dostring = true;\n \n a = dispatch(n.getGeneric(0));\n b = dispatch(n.getGeneric(1));\n \n dostring = false;\n \n if (a instanceof Long && b instanceof Long) {\n result = (Long) a | (Long) b;\n }\n else {\n result = parens(a) + \" | \" + parens(b);\n }\n \n return result;\n }", "@OperationMeta(opType = OperationType.INFIX)\n public static boolean or(boolean b1, boolean b2) {\n return b1 | b2;\n }", "private Expr or() { // This uses the same recursive matching structure as other binary operators.\n Expr expr = and(); // OR takes precedence over AND.\n while(match(OR)) {\n Token operator = previous();\n Expr right = and();\n expr = new Expr.Logical(expr, operator, right);\n }\n return expr;\n }", "String getOr_op();", "@ZenCodeType.Operator(ZenCodeType.OperatorType.OR)\n default IData or(IData other) {\n \n return notSupportedOperator(OperatorType.OR);\n }", "public static final int[] get_OR_OR(){\n\t\treturn get_AND_AND();\n\t}", "public boolean getOR() {\n return OR;\n }", "private static void orify(Collection<ExternalizedStateComponent> inputs, ExternalizedStateComponent output, ExternalizedStateConstant falseProp) {\n\t\t//TODO: Look for already-existing ors with the same inputs?\n\t\t//Or can this be handled with a GDL transformation?\n\n\t\t//Special case: An input is the true constant\n\t\tfor(ExternalizedStateComponent in : inputs) {\n\t\t\tif(in instanceof ExternalizedStateConstant && ((ExternalizedStateConstant) in).getValue()) {\n\t\t\t\t//True constant: connect that to the component, done\n\t\t\t\tin.addOutput(output);\n\t\t\t\toutput.addInput(in);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t//Special case: An input is \"or\"\n\t\t//I'm honestly not sure how to handle special cases here...\n\t\t//What if that \"or\" gate has multiple outputs? Could that happen?\n\n\t\t//For reals... just skip over any false constants\n\t\tExternalizedStateOr or = new ExternalizedStateOr();\n\t\tfor(ExternalizedStateComponent in : inputs) {\n\t\t\tif(!(in instanceof ExternalizedStateConstant)) {\n\t\t\t\tin.addOutput(or);\n\t\t\t\tor.addInput(in);\n\t\t\t}\n\t\t}\n\t\t//What if they're all false? (Or inputs is empty?) Then no inputs at this point...\n\t\tif(or.getInputs().isEmpty()) {\n\t\t\t//Hook up to \"false\"\n\t\t\tfalseProp.addOutput(output);\n\t\t\toutput.addInput(falseProp);\n\t\t\treturn;\n\t\t}\n\t\t//If there's just one, on the other hand, don't use the or gate\n\t\tif(or.getInputs().size() == 1) {\n\t\t\tExternalizedStateComponent in = or.getSingleInput();\n\t\t\tin.removeOutput(or);\n\t\t\tor.removeInput(in);\n\t\t\tin.addOutput(output);\n\t\t\toutput.addInput(in);\n\t\t\treturn;\n\t\t}\n\t\tor.addOutput(output);\n\t\toutput.addInput(or);\n\t}", "public boolean getOR() {\n return OR;\n }", "public bit or(bit other)\n\t{\n\t\tbit orBit = new bit();\n\t\t\n\t\tif(bitHolder.getValue() == 1)\n\t\t{\n\t\t\torBit.setValue(1);\n\t\t}else if(other.getValue() == 1)\n\t\t{\n\t\t\torBit.setValue(1);\n\t\t}else\n\t\t{\n\t\t\torBit.setValue(0);\n\t\t}\n\t\t\n\t\treturn orBit;\n\t}", "private Term parseBtwiseXOr(final boolean required) throws ParseException {\n Term t1 = parseBitwiseAnd(required);\n while (t1 != null) {\n int tt = _tokenizer.next();\n if (tt == '^') {\n Term t2 = parseBitwiseAnd(true);\n if ((t1.isI() && t2.isI()) || !isTypeChecking()) {\n t1 = new Term.XOrI(t1, t2);\n } else {\n reportTypeErrorI2(\"'^'\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "Expression orExpression() throws SyntaxException {\r\n\t\tToken first = t;\r\n\t\tExpression e0 = andExpression();\r\n\t\twhile(isKind(OP_OR)) {\r\n\t\t\tToken op = consume();\r\n\t\t\tExpression e1 = andExpression();\r\n\t\t\te0 = new ExpressionBinary(first, e0, op, e1);\r\n\t\t}\r\n\t\treturn e0;\r\n\t}", "public Object visitLogicalOrExpression(GNode n) {\n if (dostring) {\n Object a = dispatch(n.getGeneric(0));\n Object b = dispatch(n.getGeneric(1));\n \n if (a instanceof Long && b instanceof Long) {\n return (Long) a | (Long) b;\n }\n else {\n return parens(a) + \" || \" + parens(b);\n }\n }\n else {\n BDD a, b, bdd;\n \n a = ensureBDD(dispatch(n.getGeneric(0)));\n b = ensureBDD(dispatch(n.getGeneric(1)));\n \n bdd = a.orWith(b);\n \n return bdd;\n }\n }", "public static BinaryExpression exclusiveOr(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public void setOR(boolean value) {\n this.OR = value;\n }", "private Term parseLogicalOr(final boolean required) throws ParseException {\n Term t1 = parseLogicalAnd(required);\n while (t1 != null) {\n /*int tt =*/ _tokenizer.next();\n if (isSpecial(\"||\") || isKeyword(\"or\")) {\n Term t2 = parseLogicalAnd(true);\n if ((t1.isB() && t2.isB()) || !isTypeChecking()) {\n t1 = new Term.OrB(t1, t2);\n } else {\n reportTypeErrorB2(\"'||' or 'or'\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "public static BinaryExpression or(Expression expression0, Expression expression1) {\n return makeBinary(ExpressionType.Or, expression0, expression1);\n }", "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 static Object or(Object val1, Object val2) {\n\t\tif (isBool(val1) && isBool(val2)) {\n\t\t\treturn ((Boolean) val1) | ((Boolean) val2);\n\t\t} else if (isInt(val1) && isInt(val2)) {\n\t\t\treturn ((BigInteger) val1).or((BigInteger) val2);\n\t\t}\n\t\tthrow new OrccRuntimeException(\"type mismatch in or\");\n\t}", "public String getAndOr();", "public static final int[] get_OR(){\n\t\treturn get_AND();\n\t}", "@Override\n\tpublic void visit(OrExpression arg0) {\n\t\t\n\t}", "@Override\n\tpublic void visit(OrExpression arg0) {\n\n\t}", "public static Filter or(Filter filterA, Filter filterB) {\r\n return new OrFilter(filterA, filterB);\r\n }", "public static BinaryExpression exclusiveOr(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }", "public boolean hasOR() {\n return fieldSetFlags()[16];\n }", "public int subarrayBitwiseORs(int[] A) {\n HashSet<Integer> ans = new HashSet<>();\n HashSet<Integer> tmp1 = new HashSet<>();\n for(int x : A) {\n HashSet<Integer> tmp2 = new HashSet<>();\n tmp2.add(x);\n \n // Now OR x with every contiguous combination with x at the end\n // ie {1,2,x} --> {1|2|x}, {2|x}, {x}\n //\n // A = {1,2,4}\n // x = 4\n // tmp1 = { [2]=2, [1|2]=3 }\n // tmp2 = { 4=4, 4|[2]=6, 4|[1|2]=7 }\n // ans = { [1]=1, [2]=2, [1|2]=3, [4]=4, [2|4]=6, [1|2|4]=7 }\n for(int y : tmp1) {\n tmp2.add(x | y);\n }\n ans.addAll(tmp2);\n tmp1 = tmp2;\n }\n return ans.size();\n }", "protected final void operationEOR(final int data) {\r\n this.ac ^= data;\r\n this.zeroFlag = this.ac == 0;\r\n this.signFlag = this.ac >= 0x80;\r\n }", "public final void mT__88() throws RecognitionException {\r\n try {\r\n int _type = T__88;\r\n int _channel = DEFAULT_TOKEN_CHANNEL;\r\n // ../org.openmodelica.modelicaml.editor.xtext.modification.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/modification/ui/contentassist/antlr/internal/InternalModification.g:85:7: ( 'or' )\r\n // ../org.openmodelica.modelicaml.editor.xtext.modification.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/modification/ui/contentassist/antlr/internal/InternalModification.g:85:9: 'or'\r\n {\r\n match(\"or\"); \r\n\r\n\r\n }\r\n\r\n state.type = _type;\r\n state.channel = _channel;\r\n }\r\n finally {\r\n }\r\n }", "public ExpressionSearch or(Search srch)\n\t{\n\t\treturn new ExpressionSearch(false).addOps(this, srch);\n\t}", "public UnmodifiableBitSet orBitSet(BitSet bs){\n\t\tUnmodifiableBitSet nbs = (UnmodifiableBitSet)this.clone();\n\t\tnbs.orBitSetInn(bs);\n\t\treturn nbs;\n\t}", "@Override\n\tpublic void visit(BitwiseOr arg0) {\n\n\t}", "OrExpr createOrExpr();", "@Override\n\tpublic void visit(BitwiseOr arg0) {\n\t\t\n\t}", "IRequirement or(IRequirement constraint);", "public final void mOR() throws RecognitionException {\n try {\n int _type = OR;\n // /Users/benjamincoe/HackWars/C.g:218:4: ( '||' )\n // /Users/benjamincoe/HackWars/C.g:218:6: '||'\n {\n match(\"||\"); \n\n\n }\n\n this.type = _type;\n }\n finally {\n }\n }", "public void setAndOr (String AndOr);", "public static BinaryExpression or(Expression expression0, Expression expression1, Method method) {\n return makeBinary(ExpressionType.Or, expression0, expression1, false, method);\n }", "@Override\npublic final void accept(TreeVisitor visitor) {\n visitor.visitWord(OpCodes.OR_NAME);\n if (ops != null) {\n for (int i = 0; i < ops.length; i++) {\n ops[i].accept(visitor);\n }\n } else {\n visitor.visitConstant(null, \"?\");\n }\n visitor.visitEnd();\n }", "public <V extends Number> FluentExp<V> bitOr (V value)\n {\n return new BitOr<V>(this, value);\n }", "public TribitByte or(TribitByte other){\n Objects.requireNonNull(other);\n Tribit[] or = Stream.iterate(0, i -> i + 1)\n .limit(LENGTH)\n .map(i -> Tribit.or(value[i], other.value[i]))\n .toArray(Tribit[]::new);\n return new TribitByte(or);\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "Expr bool() throws IOException {\n\t\tExpr e = join();\n\t\twhile (look.tag == Tag.OR) {\n\t\t\tToken tok = look;\n\t\t\tmove();\n\t\t\te = new Or(tok, e,join());\n\t\t}\n\t\treturn e;\n\t}", "public <V extends Number> FluentExp<V> bitOr (SQLExpression<V> expr)\n {\n return new BitOr<V>(this, expr);\n }", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\r\n\t\tCriteria criteria = createCriteriaInternal();\r\n\t\toredCriteria.add(criteria);\r\n\t\treturn criteria;\r\n\t}", "public Criteria or() {\r\n\t\tCriteria criteria = createCriteriaInternal();\r\n\t\toredCriteria.add(criteria);\r\n\t\treturn criteria;\r\n\t}", "public Criteria or() {\r\n\t\tCriteria criteria = createCriteriaInternal();\r\n\t\toredCriteria.add(criteria);\r\n\t\treturn criteria;\r\n\t}", "public Criteria or() {\r\n\t\tCriteria criteria = createCriteriaInternal();\r\n\t\toredCriteria.add(criteria);\r\n\t\treturn criteria;\r\n\t}", "public Criteria or() {\r\n\t\tCriteria criteria = createCriteriaInternal();\r\n\t\toredCriteria.add(criteria);\r\n\t\treturn criteria;\r\n\t}", "public com.example.DNSLog.Builder setOR(boolean value) {\n validate(fields()[16], value);\n this.OR = value;\n fieldSetFlags()[16] = true;\n return this;\n }", "public void testBasic() {\n BitSet bitSet1 = new BitSet(4);\n bitSet1.flip(0);\n bitSet1.flip(1);\n BitSet bitSet2 = new BitSet(4);\n bitSet2.flip(0);\n bitSet2.flip(2);\n\n BitField bitField1 = new BitFieldSet(bitSet1, 4);\n BitField bitField2 = new BitFieldSet(bitSet2, 4);\n\n OrView orView = new OrView(bitField1, bitField2);\n Assert.assertEquals(true, orView.get(0));\n Assert.assertEquals(true, orView.get(1));\n Assert.assertEquals(true, orView.get(2));\n Assert.assertEquals(false, orView.get(3));\n \n Assert.assertEquals(0, orView.nextSetBit(0));\n Assert.assertEquals(1, orView.nextSetBit(1));\n Assert.assertEquals(2, orView.nextSetBit(2));\n Assert.assertEquals(-1, orView.nextSetBit(3));\n \n Assert.assertEquals(3, orView.nextClearBit(0));\n Assert.assertEquals(3, orView.nextClearBit(1));\n Assert.assertEquals(3, orView.nextClearBit(2));\n Assert.assertEquals(3, orView.nextClearBit(3));\n }", "public int[] exclusive_or(int[] array1, int[] array2) {\n int L = array1.length;\n int R = array2.length;\n int[] r_array = new int[L];\n int[] e_array = { -4, -4, -4, -4 }; // -4 dient der Fehlererkennung\n\n if (L == R && L > 0) {\n for (int i = 0; i < L; i++) {\n r_array[i] = array1[i] ^ array2[i];\n }\n return r_array;\n } else\n return e_array;\n }", "public final void rule__XOrExpression__FeatureAssignment_1_0_0_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:12173:1: ( ( ( ruleOpOr ) ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:12174:1: ( ( ruleOpOr ) )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:12174:1: ( ( ruleOpOr ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:12175:1: ( ruleOpOr )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXOrExpressionAccess().getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0()); \n }\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:12176:1: ( ruleOpOr )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:12177:1: ruleOpOr\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXOrExpressionAccess().getFeatureJvmIdentifiableElementOpOrParserRuleCall_1_0_0_1_0_1()); \n }\n pushFollow(FOLLOW_ruleOpOr_in_rule__XOrExpression__FeatureAssignment_1_0_0_124417);\n ruleOpOr();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXOrExpressionAccess().getFeatureJvmIdentifiableElementOpOrParserRuleCall_1_0_0_1_0_1()); \n }\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXOrExpressionAccess().getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public void setOr(boolean or) {\n this.or = or;\n }", "public final void mT__58() throws RecognitionException {\n try {\n int _type = T__58;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalEsm.g:52:7: ( 'OR' )\n // InternalEsm.g:52:9: 'OR'\n {\n match(\"OR\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public Object visitBitwiseXorExpression(GNode n) {\n Object a, b, result;\n \n nonboolean = true;\n \n dostring = true;\n \n a = dispatch(n.getGeneric(0));\n b = dispatch(n.getGeneric(1));\n \n dostring = false;\n \n if (a instanceof Long && b instanceof Long) {\n result = (Long) a ^ (Long) b;\n }\n else {\n result = parens(a) + \" ^ \" + parens(b);\n }\n \n return result;\n }", "StatementChain or(ProfileStatement... statements);", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }", "public Criteria or() {\n Criteria criteria = createCriteriaInternal();\n oredCriteria.add(criteria);\n return criteria;\n }" ]
[ "0.70683086", "0.69800913", "0.68565863", "0.6838826", "0.68363154", "0.6614165", "0.65148", "0.64964986", "0.6473305", "0.6419048", "0.6416215", "0.6406749", "0.63911206", "0.63716906", "0.6368775", "0.63478225", "0.62913644", "0.62405956", "0.6212636", "0.61893225", "0.6174982", "0.6075452", "0.60634446", "0.60617095", "0.6008724", "0.59997773", "0.59657097", "0.59594613", "0.58714795", "0.586836", "0.5769221", "0.57685894", "0.5763919", "0.573695", "0.57358146", "0.572401", "0.57233053", "0.5720265", "0.57084686", "0.5698176", "0.5666988", "0.56594926", "0.5653152", "0.5650219", "0.56488246", "0.5647597", "0.564736", "0.564736", "0.564736", "0.564736", "0.564736", "0.564736", "0.564736", "0.564736", "0.564736", "0.564736", "0.564736", "0.56434155", "0.56434155", "0.56434155", "0.56434155", "0.56434155", "0.5640536", "0.5640061", "0.56396496", "0.5634687", "0.56278014", "0.56262994", "0.5621454", "0.5602913", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824", "0.5594824" ]
0.8238394
0
Performs the addition operation using ripplecarry addition of each bit: output = inputA + inputB
private void add() { // PROGRAM 1: Student must complete this method // This method must use the addBit method for bitwise addition. adder = addBit(inputA[0],inputB[0], false); //begin adding, no carry in output[0] = adder[0]; //place sum of first addBit iteration into output[0] //loop thru output beginning at index 1 (since we already computed index 0) for (int i = 1; i < output.length; i++) { cin = adder[1]; //set carry-out bit of addBit() iteration to cin adder = addBit(inputA[i], inputB[i], cin); //call addBit with index i of inputA and inputB and cin and place into adder. output[i] = adder[0]; //place sum into output[i] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static int add(int a, int b){\n int carry = 0;\n int result = 0;\n int i;\n for(i=0; a>0||b>0; i++){\n int ba = a&1;\n int bb = b&1;\n result = result|((carry^ba^bb)<<i);\n carry = (ba&bb) | (bb&carry) | (carry&ba);\n a = a>>1;\n b = b>>1;\n }\n return result|(carry<<i);\n }", "private int addBinary(int a, int b) {\n if (b == 0) {\r\n return a;\r\n }\r\n \r\n // XOR is like doing a sum without carrying the remainders\r\n int sum = a ^ b;\r\n \r\n // AND shifted left is like getting just the remainders\r\n int carry = (a & b) << 1;\r\n \r\n return addBinary(sum, carry);\r\n }", "public int sumTwo(int a, int b) {\n\t\twhile (b != 0) {\n\t\t\tint sum = a ^ b;\n\t\t\tint carry = (a & b) << 1;\n\t\t\ta = sum; \n\t\t\tb = carry; \n\t\t}\n\t\treturn a;\n\t}", "private void addition()\n {\n\tint tempSum = 0;\n\tint carryBit = 0;\n\tsum = new Stack<String>();\n\tStack<String> longerStack = pickLongerStack(number, otherNumber);\n\twhile(!longerStack.isEmpty())\n\t{\n\t tempSum = digitOf(number) + digitOf(otherNumber) + carryBit; //adding\n\t carryBit = tempSum / 10;\n\t sum.push((tempSum % 10) + \"\"); //store the digit which is not carryBit\n\t}\n\tif(carryBit == 1) sum.push(\"1\"); //the last carry bit need to be add as very first digit of sum if there is carry bit\n }", "public int getSum(int a, int b) {\n\n while(b!=0){ //check till carry is not equal to zero\n int carry = a&b;\n a=a^b;\n b=carry<<1;\n }\n return a;\n }", "private int[] add(int[] a, int[] b)\n {\n int tI = a.length - 1;\n int vI = b.length - 1;\n long m = 0;\n\n while (vI >= 0)\n {\n m += (((long)a[tI]) & IMASK) + (((long)b[vI--]) & IMASK);\n a[tI--] = (int)m;\n m >>>= 32;\n }\n\n while (tI >= 0 && m != 0)\n {\n m += (((long)a[tI]) & IMASK);\n a[tI--] = (int)m;\n m >>>= 32;\n }\n\n return a;\n }", "private int[] add(int[] a, int[] b)\n {\n int tI = a.length - 1;\n int vI = b.length - 1;\n long m = 0;\n\n while (vI >= 0)\n {\n m += (((long)a[tI]) & IMASK) + (((long)b[vI--]) & IMASK);\n a[tI--] = (int)m;\n m >>>= 32;\n }\n\n while (tI >= 0 && m != 0)\n {\n m += (((long)a[tI]) & IMASK);\n a[tI--] = (int)m;\n m >>>= 32;\n }\n\n return a;\n }", "public static int getSum(int a, int b) {\n// Integer.toBinaryString(a) ^ Integer.toBinaryString(b);\n return a ^ b;\n }", "private static int add(int x, int y) {\n\n\n while (y != 0) {\n // carry now contains common\n //set bits of x and y\n int carry = (x & y);\n\n\n // Sum of bits of x and y where at\n //least one of the bits is not set\n x = (x ^ y);\n\n\n // Carry is shifted by one so that adding\n // it to x gives the required sum\n y = (carry << 1);\n }\n\n if (x > 255)\n x = x - 255; //101011111\n\n return x;\n }", "private void sub() {\n // PROGRAM 1: Student must complete this method\n // This method must use the addBit method for bitwise subtraction.\n //invert bits of inputB\n for (int i = 0; i < inputB.length; i++) {\n if (!inputB[i]) {\n inputB[i] = true; //set each 0 bit to 1\n } else {\n inputB[i] = false; //set each 1 bit to 0\n }\n }\n adder = addBit(inputA[0], inputB[0], true); //place first iteration of addBit with a carry-in bit into adder.\n output[0] = adder[0]; //place first sum into output[0]\n //loop thru output starting at index 1 since we already computed\n for (int i = 1; i < output.length; i++) {\n cin = adder[1]; // set cin equal to carryout\n adder = addBit(inputA[i], inputB[i], cin); //call addBit with index i of inputA and inputB and cin\n output[i] = adder[0]; //place sum into output[i]\n }\n }", "public int getSumLoop(int a, int b) {\n while (b != 0) {\n int temp = a ^ b;\n b = (a & b) << 1;\n a = temp;\n }\n return a;\n }", "@Override\r\n\tpublic int plus(int left, int right) {\n\t\treturn left + right; \r\n\t\t//return 0;\r\n\t}", "public int getSum(int a, int b) {\n if(a == 0) {\n return b;\n }\n\n if(b == 0) {\n return a;\n }\n\n int carry = 0;\n\n while(b != 0) {\n\n // If both bits are 1, we set the bit to the left (<<1) to 1 -- this is the carry step\n carry = (a & b) << 1;\n\n // If both bits are 1, this will give us 0 (we will have a carry from the step above)\n // If only 1 bit is 1, this will give us 1 (there is nothing to carry)\n a = a ^ b;\n\n b = carry;\n }\n\n return a;\n }", "public int addition(int a, int b){\n return a + b;\n }", "public int addition(int a, int b){\r\n\t\treturn a+b;\r\n\t}", "public int add(int x, int y) {\n int n1 = x;\n int n2 = y;\n int carry = x & y; //the AND operator returns a bit string representing the positions where addition carries over\n if (n2 == 0) {\n return n1;\n }\n return add(n1 ^ n2, carry << 1);\n }", "public static String addBinary(String a, String b){\n\t\tint size_a = a.length(), size_b = b.length();\n\t\tint i = size_a-1, j = size_b-1, carryon = 0;\n\t\tint aa, bb;\n\t\tString result = \"\";\n\t\twhile(i > -1 || j > -1 || carryon != 0){\n\t\t\taa = (i > -1) ? Integer.parseInt(a.substring(i,i+1)) : 0;\n\t\t\tbb = (j > -1) ? Integer.parseInt(b.substring(j,j+1)) : 0;\n\t\t\tresult = (aa+bb+carryon)%2 + result;\n\t\t\tcarryon = (aa+bb+carryon)/2;\n\t\t\ti--;\n\t\t\tj--;\n\t\t}\n\t\treturn result;\n\t}", "private boolean[] addBit(boolean a, boolean b, boolean c) {\n // PROGRAM 1: Student must complete this method\n // This method may only use the Java logic operations && (logical and),\n // || (logical or), and ! (logical not). Do not use any Java arithmetic\n // operators in this method.\n boolean[] result = new boolean[2];\n result[0] = (a ^ b) ^ c; // (a xor b) xor c -> yields the sum\n result[1] = (a && b) || (a ^ b) && c; // (a and b) or (a xor b) and c -> yields the carry-out\n // return value is a placeholder, student should replace with correct return\n return result;\n }", "public String addBinary(String a, String b) {\n StringBuilder result = new StringBuilder();\n int carr = 0;\n for (int i = a.length() - 1, j = b.length() - 1; i >= 0 || j >= 0; i--, j--) {\n int ai = i >= 0 ? a.charAt(i) - '0' : 0;\n int bi = j >= 0 ? b.charAt(j) - '0' : 0;\n int sum = carr + ai + bi;\n result.append(sum & 1);\n carr = (sum >>> 1) & 1;\n }\n result.append(carr > 0 ? carr : \"\");\n return result.reverse().toString();\n }", "public static String Add_pandy(String a, String b)\n\t{\n\t\tString ans = \"\";\n\t\tif (a.length() != b.length())\n\t\t{\n\t\t\tint len1 = a.length();\n\t\t\tint len2 = b.length();\n\t\t\tint lenght_max = Math.max(len1, len2);\n\n\t\t\tfor (int i = 0; i < lenght_max - len1; i++)\n\t\t\t{\n\t\t\t\ta = \"0\" + a;\n\t\t\t}\n\t\t\tfor (int i = 0; i < lenght_max - len2; i++)\n\t\t\t{\n\t\t\t\tb = \"0\" + b;\n\t\t\t}\n\t\t}\n\n\t\tint carry = 0;\n\t\tint tem = 0;\n\t\tfor (int i = a.length() - 1; i >= 0; i--)\n\t\t{\n\t\t\ttem = Integer.parseInt(String.valueOf(a.charAt(i)))\n\t\t\t\t\t+ Integer.parseInt(String.valueOf(b.charAt(i))) + carry;\n\t\t\tif (tem >= 10)\n\t\t\t\tcarry = 1;\n\t\t\telse\n\t\t\t\tcarry = 0;\n\t\t\tans = String.valueOf(tem % 10) + ans;\n\t\t}\n\t\tif (carry == 1)\n\t\t\tans = String.valueOf(carry) + ans;\n\n\t\t// System.out.println(a);\n\t\t// System.out.println(b);\n\n\t\treturn ans;\n\t}", "public int getSum(int a, int b) {\n return b == 0 ? a : getSum(a ^ b, (a & b) << 1);\n }", "private static int[] add(int[] x, int[] y) {\n // If x is shorter, swap the two arrays\n if (x.length < y.length) {\n int[] tmp = x;\n x = y;\n y = tmp;\n }\n\n int xIndex = x.length;\n int yIndex = y.length;\n int result[] = new int[xIndex];\n long sum = 0;\n if (yIndex == 1) {\n sum = (x[--xIndex] & LONG_MASK) + (y[0] & LONG_MASK) ;\n result[xIndex] = (int)sum;\n } else {\n // Add common parts of both numbers\n while (yIndex > 0) {\n sum = (x[--xIndex] & LONG_MASK) +\n (y[--yIndex] & LONG_MASK) + (sum >>> 32);\n result[xIndex] = (int)sum;\n }\n }\n // Copy remainder of longer number while carry propagation is required\n boolean carry = (sum >>> 32 != 0);\n while (xIndex > 0 && carry)\n carry = ((result[--xIndex] = x[xIndex] + 1) == 0);\n\n // Copy remainder of longer number\n while (xIndex > 0)\n result[--xIndex] = x[xIndex];\n\n // Grow result if necessary\n if (carry) {\n int bigger[] = new int[result.length + 1];\n System.arraycopy(result, 0, bigger, 1, result.length);\n bigger[0] = 0x01;\n return bigger;\n }\n return result;\n }", "public static String addBinaryNumbers(String num1, String num2) {\r\n\t\tif (num1 == null || num2 == null)\r\n\t\t\treturn null;\r\n\t\t\r\n\t\tint index1 = num1.length() - 1;\r\n\t\tint index2 = num2.length() - 1;\r\n\t\tboolean carry = false;\r\n\t\tString result = \"\";\r\n\t\t\r\n\t\twhile(index1 >= 0 && index2 >= 0) {\r\n\t\t\tint sum = Integer.parseInt(num1.substring(index1, index1 + 1)) + Integer.parseInt(num2.substring(index2, index2 + 1));\r\n\t\t\tif (sum == 0) {\r\n\t\t\t\tif (carry) {\r\n\t\t\t\t\tresult += '1';\r\n\t\t\t\t\tcarry = false;\r\n\t\t\t\t} else\r\n\t\t\t\t\tresult += '0';\r\n\t\t\t} else if (sum == 1) {\r\n\t\t\t\tif (carry)\r\n\t\t\t\t\tresult += '0';\r\n\t\t\t\telse\r\n\t\t\t\t\tresult += '1';\r\n\t\t\t} else { // sum == 2\r\n\t\t\t\tif (carry)\r\n\t\t\t\t\tresult += '1';\r\n\t\t\t\telse {\r\n\t\t\t\t\tresult += '0';\r\n\t\t\t\t\tcarry = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex1--;\r\n\t\t\tindex2--;\r\n\t\t}\r\n\t\t\r\n\t\twhile(index1 >= 0) {\r\n\t\t\tif (num1.charAt(index1) == '0') {\r\n\t\t\t\tif (carry) {\r\n\t\t\t\t\tresult += '1';\r\n\t\t\t\t\tcarry = false;\r\n\t\t\t\t} else\r\n\t\t\t\t\tresult += '0';\r\n\t\t\t} else { // num1.charAt(index1) == '1'\r\n\t\t\t\tif (carry)\r\n\t\t\t\t\tresult += '0';\r\n\t\t\t\telse\r\n\t\t\t\t\tresult += '1';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex1--;\r\n\t\t}\r\n\t\t\r\n\t\twhile(index2 >= 0) {\r\n\t\t\tif (num2.charAt(index2) == '0') {\r\n\t\t\t\tif (carry) {\r\n\t\t\t\t\tresult += '1';\r\n\t\t\t\t\tcarry = false;\r\n\t\t\t\t} else\r\n\t\t\t\t\tresult += '0';\r\n\t\t\t} else { // num2.charAt(index2) == '1'\r\n\t\t\t\tif (carry)\r\n\t\t\t\t\tresult += '0';\r\n\t\t\t\telse\r\n\t\t\t\t\tresult += '1';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex2--;\r\n\t\t}\r\n\t\t\r\n\t\tif (carry)\r\n\t\t\tresult += '1';\r\n\t\t\r\n\t\t// reverse result string\r\n\t\tString reverseResult = \"\";\r\n\t\tfor (int i = result.length() - 1; i >= 0; i--)\r\n\t\t\treverseResult += result.charAt(i);\r\n\t\t\r\n\t\treturn reverseResult;\r\n\t}", "public String addBinary(String a, String b) {\n StringBuilder ans = new StringBuilder();\n int carry = 0, tempRes = 0;\n int indexA = a.length() - 1, indexB = b.length() - 1;\n while (indexA >= 0 || indexB >= 0) {\n int digitA = 0, digitB = 0;\n if (indexA >= 0) digitA = a.charAt(indexA) - '0';\n if (indexB >= 0) digitB = b.charAt(indexB) - '0';\n tempRes = digitA + digitB + carry;\n carry = tempRes / 2;\n char ch = (char) (tempRes % 2 + '0');\n ans.insert(0, ch);\n indexA--;\n indexB--;\n }\n if (carry > 0) {\n char ch = (char) (carry + '0');\n ans.insert(0, ch);\n }\n return ans.toString();\n }", "public int addition(int a, int b){\r\n int result = a+b;\r\n return result;\r\n }", "public abstract T accumulate(T left, T right);", "private long calcSum(int a, int b) {\n return (new Long(a) + new Long(b));\n }", "public int addTwoNumbers(int a, int b) {\n return a + b;\n }", "@Override\n\t\t\tpublic Integer apply(Integer num1, Integer num2) {\n\t\t\t\treturn num1+num2;\n\t\t\t}", "@Override\r\n\tpublic int add(int a,int b) {\n\t\treturn a+b;\r\n\t}", "@Override\n\tpublic int add(int a, int b) {\n\t\treturn a+b;\n\t}", "public int sum(int a, int b) {\n\t\treturn a + b;\n\t}", "public static BinaryExpression add(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "@Test\n\tpublic void testAddition() {\n\t\tint tmpRndVal = 0;\n\t\tint tmpRndVal2 = 0;\n\t\tint tmpResult = 0;\n\t\t\n\t\t//testing with negative numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = RandomNegativeNumbers();\n\t\t\ttmpRndVal2 = RandomNegativeNumbers();\n\t\t\ttmpResult = tmpRndVal + tmpRndVal2;\n\t\t\tassertEquals(bc.addition(tmpRndVal, tmpRndVal2), tmpResult);\n\t\t}\n\t\t\n\t\t//testing with positive numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = RandomPositiveNumbers();\n\t\t\ttmpRndVal2 = RandomPositiveNumbers();\n\t\t\ttmpResult = tmpRndVal + tmpRndVal2;\n\t\t\tassertEquals(bc.addition(tmpRndVal, tmpRndVal2), tmpResult);\n\t\t}\n\t\t\n\t\t//testing with zero\n\t\tint zero = 0;\n\t\tint tmpVal = 7;\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tassertTrue( ((bc.addition(tmpVal, zero) == zero) \n\t\t\t\t\t|| (bc.addition(zero, zero) == zero)\n\t\t\t\t\t|| (bc.addition(zero, tmpVal) == zero) ));\n\t\t}\n\t\t\n\t}", "private void and() {\n // PROGRAM 1: Student must complete this method\n //loop through the output array\n for (int i = 0; i < output.length; i++) {\n //take the and of index i of inputA and inputB and place result in output[i]\n output[i] = inputA[i] & inputB[i];\n }\n }", "public static int Add(int a, int b){\n\t\t\treturn (a+b);\n\t\t\t\n\t\t}", "private void Perform_ADC()\n {\n d = Utils.GetOperand_XXXXXXX11111XXXX(mMBR);\n r = Utils.GetOperand_XXXXXX1XXXXX1111(mMBR);\n\n dvalue = get_reg(d);\n rvalue = get_reg(r);\n result = dvalue + rvalue;\n if (get_cflag()) result+=1;\n\n set_hflag(CarryFromBit3(dvalue, rvalue, result));\n set_nflag(Utils.bit7(result));\n set_vflag(Overflow(dvalue, rvalue, result));\n set_sflag(get_nflag() ^ get_vflag());\n set_zflag(result == 0);\n set_cflag(CarryFromResult(dvalue, rvalue, result));\n\n try {set_reg(d,result); }\n catch (RuntimeException e) { }\n\n return;\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 }", "public Integer addStuffTogether(ArrayList<Integer> original1, ArrayList<Integer> original2) {\n Integer sum = 0;\n for (Integer i : original1) {\n sum += i;\n }\n for (Integer i : original2) {\n sum += i;\n }\n return sum;\n }", "private static String wrapAdd(String lhsString, int rhs) {\n int lhs = Integer.parseInt(lhsString, 2);\n int result = lhs + rhs;\n String bitString = zeroPaddedBitString(result);\n return bitString.substring(BITS_IN_INTEGER - lhsString.length());\n }", "public Integer add(Integer a, Integer b) {\n\t\treturn a + b;\n\t}", "BaseNumber add(BaseNumber operand);", "public int add(int a, int b) //add method take two int values and returns the sum\n {\n int sum = a + b;\n return sum;\n }", "public int[] plusOne(int[] digits) {\n\t\tint carry = 0;\n\t\tdigits[digits.length - 1] += 1;\n\t\tfor (int i = digits.length - 1; i >= 0; i--) {\n\t\t\tdigits[i] = digits[i] + carry;\n\t\t\tcarry = digits[i] / 10;\n\t\t\tdigits[i] %= 10;\n\t\t}\n\t\tif (carry == 0) {\n\t\t\treturn digits;\n\t\t} else {\n\t\t\tint[] newDigits = new int[digits.length + 1];\n\t\t\tfor (int i = 0; i < digits.length; i++) {\n\t\t\t\tnewDigits[i + 1] = digits[i];\n\t\t\t\tnewDigits[0] = carry;\n\t\t\t}\n\t\t\treturn newDigits;\n\t\t}\n\t}", "public static String addBinary(String a, String b) {\n \tint m = a.length();\n \tint n = b.length();\n \tint l = (m-n) > 0 ? m:n;\n \tint[] sum = new int[l+1];\n \tfor (int i=0;i<l;i++){\n \t\tint a_value = (i < m) ? a.charAt(m -1 - i) - '0': 0;\n \t\tint b_value = (i < n) ? b.charAt(n -1 - i) - '0': 0;\n \t\tint tmp = a_value + b_value;\n \t\tsum[l - i - 1] = (sum[l - i] + tmp)/2;\n \t\tsum[l - i] = (sum[l - i] + tmp )% 2;\n \t}\n \t\n \tString result = Arrays.toString(sum);\n \tStringBuilder sb = new StringBuilder();\n \tfor (int i=0;i<sum.length;i++){\n \t\tif (i==0 && sum[i] == 0) continue;\n \t\tsb.append(sum[i]);\n \t}\n\n \tSystem.out.println(\"result is \" + result);\n \tSystem.out.println(\"result is in String \" + sb);\n\n \t\n \treturn sb.toString();\n \n }", "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 void add(int[] n1, int[] n2, int[] sum) {\n\t\tint b = n1.length-1;\n\t\tint carry = 0;\n\t\twhile (b >= 0) {\n\t\t\tint s = n1[b] + n2[b] + carry;\n\t\t\tsum[b+1] = s % 10;\n\t\t\tif (s > 9) { carry = 1; } else { carry = 0; }\n\t\t\tb--;\n\t\t}\n\t\t\n\t\tsum[0] = carry;\n\t}", "private Term parseBitwiseAnd(final boolean required) throws ParseException {\n Term t1 = parseAdd(required);\n while (t1 != null) {\n int tt = _tokenizer.next();\n if (tt == '&') {\n Term t2 = parseAdd(true);\n if ((t1.isI() && t2.isI()) || !isTypeChecking()) {\n t1 = new Term.AndI(t1, t2);\n } else {\n reportTypeErrorI2(\"'&'\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "protected static void performReduceWithABinaryOperator() {\n Integer sum = Stream.of(1, 2, 3, 4, 5).reduce(0, Integer::sum);\n\n Integer minValue = Stream.of(5, 4, 9, 2, 1).reduce(Integer.MIN_VALUE, Integer::max);\n\n String concatenation = Stream.of(\"str \", \"= \", \"alt \", \"string\")\n // the first parameter becomes the target of the concat method and the second one is the argument to concat\n // the target, the parameter and the result are of the same type and this can be considered a binary\n // operator for the reduce method\n .reduce(\"\", String::concat);\n System.out.println(concatenation);\n }", "public double add(int a, int b){\r\n return a + b;\r\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n\t\t \n\t\t ListNode result = null;\n\t\t \n\t\t ListNode temp = null;\n\t\t \n\t\t int sum = 0;\n\t\t \n\t\t int carryOver = 0;\n\t\t \n\t\t while(l1 != null || l2 != null)\n\t\t {\n\t\t\t int l1Num = 0;\n\t\t\t int l2Num = 0;\n\t\t\t \n\t\t\t if(l1 != null)\n\t\t\t {\n\t\t\t\t l1Num = l1.val;\n\t\t\t\t l1 = l1.next;\n\t\t\t }\n\t\t\t \n\t\t\t if(l2 != null)\n\t\t\t {\n\t\t\t\t l2Num = l2.val;\n\t\t\t\t l2 = l2.next;\n\t\t\t }\n\t\t\t \n\t\t\t sum = carryOver + l1Num + l2Num;\n\t\t\t \n\t\t\t carryOver = sum / 10;\n\t\t\t \n\t\t\t ListNode node = new ListNode(sum % 10);\n\t\t\t \n\t\t\t if(result == null)\n\t\t\t {\n\t\t\t\t result = node;\n\t\t\t\t temp = node;\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t temp.next = node;\n\t\t\t\t temp = node;\n\t\t\t }\n\t\t\t \n\t\t }\n\t\t \n\t\t if(carryOver > 0)\n\t\t {\n\t\t\t ListNode carryNode = new ListNode(carryOver);\n\t\t\t temp.next = carryNode;\n\t\t }\n\t\t // Find out the sum , have a carry over in case \n\t\t \n\t\t // create output links \n\t\t return result;\n\t }", "public static void main(String [] args){\n\t\tint [] A = {0,1,1,1}; //1110\r\n\t\tint [] B = {1,0,1,0};\r\n\t\tint [] C = new Hw2p1q4().binarySum(A, B, A.length);\r\n\t\tfor(int i=A.length; i>=0; i--){\r\n\t\t\tSystem.out.print(C[i]);\r\n\t\t}\r\n\t}", "public void add()\r\n {\r\n resultDoubles = Operations.addition(leftOperand, rightOperand);\r\n resultResetHelper();\r\n }", "@Override\r\n\tpublic int calculate(int a, int b) {\n\t\treturn (a + b) * 2;\r\n\t}", "public static void main(String[] args) {\n int[] digits = {1, 2, 3};\n int[] digits2 = {9, 9, 9};\n System.out.println(Arrays.toString(plusOne(digits)));\n System.out.println(Arrays.toString(plusOne(digits2)));\n }", "public int[] addNegabinary2(int[] arr1, int[] arr2) {\n LinkedList<Integer> list = new LinkedList<>();\n int n = Math.max(arr1.length, arr2.length);\n for (int i = 0, carry = 0; i < n || carry != 0; i++) {\n int b1 = (i < arr1.length) ? arr1[arr1.length - i - 1] : 0;\n int b2 = (i < arr2.length) ? arr2[arr2.length - i - 1] : 0;\n int sum = b1 + b2 + carry;\n list.push(Math.abs(sum) % 2);\n carry = (sum < 0) ? 1 : (sum > 1) ? -1 : 0;\n }\n for (; list.size() > 1 && list.get(0) == 0; list.pop()) {}\n return list.stream().mapToInt(i->i).toArray();\n }", "public static String addBinary(String a, String b) {\r\n\r\n \r\n \tlong a1=0,b1=0;\r\n \tString s2 = \"\";\r\n \tfor(int i =a.length()-1, j=0 ; (a.length()-j)!=0;i--,j++) {\r\n \t\tint d = a.charAt(i);\r\n \t\tif(d==48)\r\n \t\t\td = 0;\r\n \t\telse\r\n \t\t\td = 50-d;\r\n \t\r\n \t\ta1 = (long) (a1+d*(Math.pow(2, j)));\r\n \t\t\r\n \t}\r\n \tfor(int i =b.length()-1, j=0 ; (b.length()-j)!=0;i--,j++) {\r\n \t\tint d = b.charAt(i);\r\n \t\tif(d==48)\r\n \t\t\td=0;\r\n \t\telse\r\n \t\t\td=50-d;\r\n \t\tb1 = (long) (b1+d*(Math.pow(2, j)));\r\n \t\t\r\n \t}\r\n \tSystem.out.println(a1+\" \"+b1);\r\n \tlong ans1 = a1+b1;\r\n \tif(ans1 == 0)\r\n \t\ts2 = \"0\";\r\n \telse\r\n \twhile(ans1>0) {\r\n \t\tlong rem = ans1%2;\r\n \t\ts2 = rem+s2;\r\n \t\tans1=ans1/2;\r\n \t}\r\n \t\r\n return s2;\r\n }", "public static int addNums(int a, int b) {\n int result = a + b;\n return(result);\n }", "@Override\r\n\tprotected Integer add(Integer x1, Integer x2) {\n\t\treturn x2+x1;\r\n\t}", "public static String add(String num1,String num2)\n\t{\n\t\t\n\t\tString num3=\"\";\n\t\tint res, carry=0;\n\t\t\n\t\t\n\t\t//appending zeros to num1 if length of num1 is less\n\t\tif(num1.length()<num2.length())\n\t\t{\n\t\t\tint n=num2.length()-num1.length();\n\t\t\twhile(n!=0)\n\t\t\t{\n\t\t\t\tnum1=\"0\"+num1;\n\t\t\t\tn--;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//appending zeros to num2 if length of num2 is less\n\t\telse if(num2.length()<num1.length())\n\t\t{\n\t\t\tint n=num1.length()-num2.length();\n\t\t\twhile(n!=0)\n\t\t\t{\n\t\t\t\tnum2=\"0\"+num2;\n\t\t\t\tn--;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//running the loop till strings are not null\n\t\twhile(num1.length()!=0)\n\t\t{\n\t\t\t\n\t\t\tchar c1=num1.charAt(num1.length()-1);\n\t\t\tchar c2=num2.charAt(num2.length()-1);\n\t\t\t\n\t\t\t//convert c1 and c2 into integer and then add\n\t\t\tres=Integer.parseInt(\"\"+c1)+ Integer.parseInt(\"\"+c2)+carry;\t\t\n\t\t\t\n\t\t\t//if we get a 2 digit number after addition then breaking the carry and storing the units part\n\t\t\tif(res/10!=0)\n\t\t\t{\n\t\t\t\tnum3=(res%10)+num3;\n\t\t\t\tcarry=res/10;\n\t\t\t}\n\t\t\t\n\t\t\telse\t\n\t\t\t{\n\t\t\t\tnum3=res+num3;\t\n\t\t\t\tcarry=0;\n\t\t\t}\n\t\t\n\t\t\t//truncating the last digit of num1 and num2\n\t\t\tnum1=num1.substring(0,num1.length()-1);\n\t\t\tnum2=num2.substring(0,num2.length()-1);\n\t\t}\n\t\t\n\t\tif(carry!=0)\n\t\tnum3=carry+num3;\n\t\t//System.out.println(\"num3= \"+num3);\n\t\treturn num3;\n\t}", "@Override\n public BinaryOperator<List<Integer>> combiner() {\n return (resultList1, resultList2) -> {\n Integer currentTotal1 = resultList1.get(0);\n Integer currentTotal2 = resultList2.get(0);\n currentTotal1 += currentTotal2;\n resultList1.set(0, currentTotal1);\n return resultList1;\n };\n }", "public static Seq plus(Jumble j1, Jumble j2){\n int new_size = (j1.count < j2.count) ? j1.count : j2.count;\n int new_arr[] = new int[new_size];\n for(int i = 0; i < new_size; i++) {\n new_arr[i] = j1.values[i] + j2.values[i]; //add each corresponding element\n }\n return new Jumble(new_arr); // the Jumble constructor does copy \n }", "public String addBinary(String a, String b) {\n\t\tint alen = a.length();\n\t\tint blen = b.length();\n int rslen = alen;\n\t\tif(blen > rslen)\n\t\t\trslen = blen;\n\t\trslen++;\n\t\tint[] rs = new int[rslen];\n\t\tfor(int i = 0; i < rslen; i++){\n\t\t\trs[i] = 0;\n\t\t}\n\t\tint next = 0;\n\t\tString result;\n\t\tfor(int i = rslen-1; i >= 0; i--){\n\t\t\talen--;\n\t\t\tblen--;\n\t\t\tint ae = 0;\n\t\t\tint be = 0;\n\t\t\t\n\t\t\tif(alen >= 0)\n\t\t\t\tae = (a.charAt(alen) - '0');\n\t\t\t\n\t\t\tif(blen >= 0)\n\t\t\t\tbe = (b.charAt(blen) - '0');\n\t\t\t\n\t\t\tint curr = ae + be + next;\n\t\t\tif(curr >= 2){\n\t\t\t\tnext = 1;\n\t\t\t\tcurr = curr - 2;\n\t\t\t} else\n\t\t\t\tnext = 0;\n\t\t\trs[i] = curr;\n\t\t}\n\t\t\n\t\tStringBuilder st = new StringBuilder();\n\t\tfor(int i = 0; i < rslen; i++){\n\t\t\tst.append(rs[i]);\n\t\t}\n\t\tresult = st.toString();\n\t\tif(rs[0] == 0){\n\t\t\tresult = result.substring(1);\n\t\t}\n\t\t\n\t\treturn result;\n\t\t\n }", "private int Sum1(int x) {\n int a = ROTR(6, x);\n int b = ROTR(11, x);\n int c = ROTR(25, x);\n int ret = a ^ b ^ c;\n return ret;\n }", "protected int sumIterative(int a, int b){\n int result = a;\n while (b != 0){\n if (b > 0){\n result++;\n b--;\n } else {\n result--;\n b++;\n }\n }\n return result;\n }", "private int additionWithoutCarrying(int param1, int param2) {\n String num1 = String.valueOf(param1);\n String num2 = String.valueOf(param2);\n int tamanioNum1 = num1.length();\n int tamanioNum2 = num2.length();\n\n //2. build a formatter in order to pad with zeroes in the left\n String formatter = \"%0\" + Math.max(tamanioNum1, tamanioNum2) + \"d\";\n num2 = String.format(formatter, param2);\n num1 = String.format(formatter, param1);\n\n //3. construct a StringBuilder which saves the result as a string. Also, a simple integer to perform the\n // real arithmetic sum.\n StringBuilder resultBadSum = new StringBuilder();\n int digitSum;\n\n //4. for each String position I sum up the digits and ask if it's greater than 10 (more than 1 digit); if so,\n //I save only the right-most digit.\n for (int i = 0; i < Math.max(tamanioNum1, tamanioNum2); i++) {\n digitSum = Integer.parseInt(String.valueOf(num1.charAt(i)))\n + Integer.parseInt(String.valueOf(num2.charAt(i)));\n if (digitSum < 10) {\n resultBadSum.append(digitSum);\n } else {\n resultBadSum.append(digitSum % 10); //% 10 preserves only the last digit.\n }\n }\n\n return Integer.parseInt(resultBadSum.toString());\n }", "public int add(int a, int b) {\n return a + b;\n }", "public int add(int a, int b) {\n return a + b;\n }", "public int add(int a, int b) {\n int sum = a+b;\n return sum;\n }", "public static Digit plus(Digit first, Digit second){\n return Operations.plus(first.copy(), second.copy());\n }", "public static int sum (int a, int b) {\n\t\t\n\t\treturn a + b;\n\t}", "static void resta(){\n Scanner scanner = new Scanner(System.in);\n\n System.out.print(\"Ingrese el primer numero binario: \");\n String bin1 = scanner.nextLine();\n\n System.out.print(\"Ingrese el segundo numero binario: \");\n String bin2 = scanner.nextLine();\n\n int A = Integer.parseInt(bin1,2);\n int B = Integer.parseInt(bin2,2);\n\n Long suma = (long) A + (~B + 1);\n\n System.out.println(\"\\nLa resta es: \" + Long.toBinaryString(suma)); \n \n scanner.close();\n }", "public int [] binarySum(int[] A, int[] B, int n){\n\t\tint [] C = new int [n+1];\r\n\t\tArrays.fill(C, 0); //init array C with 0s\r\n\t\t\r\n\t\tfor(int i =0; i< n; i++){\r\n\t\t\t//sum for the two binary ints and carry\r\n\t\t\tint sum = A[i] + B[i] + C[i];\r\n\t\t\tC[i] = sum % 2; //current digit\r\n\t\t\tC[i+1] = sum / 2; //carry bits, to next digit\r\n\t\t}\r\n\t\treturn C;\r\n\t}", "static long add(long a, long b){\n\t\treturn a+b;\n\t}", "public static BinaryExpression andAlso(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public static int addInt(int a, int b){\r\n\t\treturn a+b;\r\n\t}", "public BigInt plus(BigInt rhs) throws BigIntException {\n if (null == rhs) {\n throw new BigIntException(\"null parameter\");\n }\n\n if (isPositive && !rhs.isPositive) {\n // x+(-y)=x-y\n return minus(new BigInt(rhs.number, true));\n } else if (!isPositive && !rhs.isPositive) {\n // -x-y=-(x+y)\n BigInt num1 = new BigInt(number, true);\n BigInt num2 = new BigInt(rhs.number, true);\n\n BigInt result = num1.plus(num2);\n result.swapSign();\n\n return result;\n } else if (!isPositive && rhs.isPositive) {\n // -x+y=y-x\n return rhs.minus(new BigInt(number, true));\n }\n\n // x+y\n int length = Math.max(number.size(), rhs.number.size());\n\n int digitSum = 0;\n ArrayList<Integer> sum = new ArrayList<Integer>();\n for (int i = 0; i < length; ++i) {\n // Calculate the digits sum including the carry from the last sum\n digitSum += getDigit(i) + rhs.getDigit(i);\n\n sum.add(digitSum % 10);\n digitSum = Math.floorDiv(digitSum, 10);\n }\n\n // We got a carry at the end so we need to add another '1' digit\n if (0 != digitSum) {\n sum.add(1);\n }\n\n return new BigInt(sum, true);\n }", "public int[] addNegabinary(int[] arr1, int[] arr2) {\n Stack<Integer> stack = new Stack<>();\n for (int sum = 0, i = arr1.length - 1, j = arr2.length - 1;\n i >= 0 || j >= 0 || sum != 0; sum = -(sum >> 1)) {\n sum += (i >= 0) ? arr1[i--] : 0;\n sum += (j >= 0) ? arr2[j--] : 0;\n stack.push(sum & 1);\n }\n for (; !stack.isEmpty() && stack.peek() == 0; stack.pop()) {}\n int[] res = new int[stack.size()];\n for (int k = 0; !stack.isEmpty(); k++) {\n res[k] = stack.pop();\n }\n return (res.length == 0) ? new int[1] : res;\n }", "public static NumberP Addition(NumberP first, NumberP second)\n {\n return OperationsManaged.PerformArithmeticOperation\n (\n first, second, ExistingOperations.Addition\n ); \t\n }", "public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n if (l1 == null) return l2;\n if (l2 == null) return l1;\n\n // create results head pointer with dummy node\n final ListNode results = new ListNode(0);\n // create and point results pointer to the head\n ListNode resultsPointer = results;\n\n // value to keep reminder from previous sum operation\n int carry = 0;\n\n // iterate numbers until we process both completely\n while (l1 != null || l2 != null) {\n // one of the numbers can be longer, that's why adding zeros to shorter number\n final int digit1 = l1 != null ? l1.val : 0;\n final int digit2 = l2 != null ? l2.val : 0;\n // just simple math https://en.wikipedia.org/wiki/Carry_(arithmetic)\n final int sum = digit1 + digit2 + carry;\n final int result = sum % 10;\n carry = sum / 10;\n\n // save result in results list\n resultsPointer.next = new ListNode(result);\n resultsPointer = resultsPointer.next;\n\n // move numbers to the next digits, if number has more digits\n if (l1 != null) l1 = l1.next;\n if (l2 != null) l2 = l2.next;\n }\n\n // if there is carry left, just add it to result\n if (carry > 0) {\n resultsPointer.next = new ListNode(carry);\n }\n\n // remove first dummy node\n return results.next;\n }", "int method01(int a, int b) {\n\n\t\ta = a + b;\n\t\treturn a;\n\t}", "public static String addStrings(String nums1, String nums2) {\n int i = nums1.length() - 1;\n int j = nums2.length() - 1;\n StringBuilder sb = new StringBuilder();\n int carry = 0;\n\n while (i >= 0 || j >= 0) {\n int sum = carry;\n if (i >= 0) {\n sum += nums1.charAt(i--) - '0';\n }\n if (j >= 0) {\n sum += nums2.charAt(j--) - '0';\n }\n sb.append(sum % 10);\n carry = sum / 10;\n }\n if (carry != 0) {\n sb.append(carry);\n }\n return sb.reverse().toString();\n }", "private static BigInteger forceAdd(BigInteger first, BigInteger second) {\n\t\tBigInteger i = new BigInteger();\n\t\tint sign1 = first.sign(), sign2 = second.sign();\n\t\ti.front = new DigitNode(0, null); // dummy\n\t\tfor(DigitNode n1 = first.front, n2 = second.front, n = i.front; n1 != null || n2 !=null; n = n.next) {\n\t\t\tint value = 0;\n\t\t\tif (n1 != null) {\n\t\t\t\tvalue += n1.digit*sign1;\n\t\t\t\tn1 = n1.next;\n\t\t\t}\n\t\t\tif (n2 != null) {\n\t\t\t\tvalue += n2.digit*sign2;\n\t\t\t\tn2 = n2.next;\n\t\t\t}\n\t\t\tn.next = new DigitNode(value, null);\n\t\t\tif (value != 0) i.negative = (value < 0);\n\t\t\ti.numDigits++;\n\t\t}\n\t\ti.front = i.front.next; //skip the dummy\n\t\treturn i;\n\t}", "public static final ListNode<java.lang.Integer> Add (\n\t\tfinal ListNode<java.lang.Integer> headNode1,\n\t\tfinal ListNode<java.lang.Integer> headNode2)\n\t{\n\t\tint carry = 0;\n\t\tListNode<java.lang.Integer> node1 = headNode1;\n\t\tListNode<java.lang.Integer> node2 = headNode2;\n\t\tListNode<java.lang.Integer> additionHeadNode = null;\n\t\tListNode<java.lang.Integer> additionPrevNode = null;\n\n\t\twhile (null != node1 && null != node2) {\n\t\t\tint sum = carry + node1.value() + node2.value();\n\n\t\t\tListNode<java.lang.Integer> additionNode = new ListNode<java.lang.Integer> (sum % 10, null);\n\n\t\t\tif (null != additionPrevNode) additionPrevNode.setNext (additionNode);\n\n\t\t\tif (null == additionHeadNode) additionHeadNode = additionNode;\n\n\t\t\tadditionPrevNode = additionNode;\n\t\t\tcarry = sum / 10;\n\n\t\t\tnode1 = node1.next();\n\n\t\t\tnode2 = node2.next();\n\t\t}\n\n\t\twhile (null != node1) {\n\t\t\tint sum = carry + node1.value();\n\n\t\t\tListNode<java.lang.Integer> additionNode = new ListNode<java.lang.Integer> (sum % 10, null);\n\n\t\t\tif (null != additionPrevNode) additionPrevNode.setNext (additionNode);\n\n\t\t\tif (null == additionHeadNode) additionHeadNode = additionNode;\n\n\t\t\tadditionPrevNode = additionNode;\n\t\t\tcarry = sum / 10;\n\n\t\t\tnode1 = node1.next();\n\t\t}\n\n\t\twhile (null != node2) {\n\t\t\tint sum = carry + node2.value();\n\n\t\t\tListNode<java.lang.Integer> additionNode = new ListNode<java.lang.Integer> (sum % 10, null);\n\n\t\t\tif (null != additionPrevNode) additionPrevNode.setNext (additionNode);\n\n\t\t\tif (null == additionHeadNode) additionHeadNode = additionNode;\n\n\t\t\tadditionPrevNode = additionNode;\n\t\t\tcarry = sum / 10;\n\n\t\t\tnode2 = node2.next();\n\t\t}\n\n\t\treturn additionHeadNode;\n\t}", "public void executeAdd(){\n\t\tBitString destBS = mIR.substring(4, 3);\n\t\tBitString firstOperand = mIR.substring(7, 3);\n\t\tint sum;\n\t\tif(mIR.substring(10, 1).getValue() == 1){\n\t\t\tint imma5 = mIR.substring(11, 5).getValue2sComp();\n\t\t\tsum = imma5 + mRegisters[firstOperand.getValue()].getValue2sComp();\n\t\t} else {\n\t\t\tBitString secondOperand = mIR.substring(13, 3);\n\t\t\tsum = mRegisters[secondOperand.getValue()].getValue2sComp() + mRegisters[firstOperand.getValue()].getValue2sComp();\n\t\t}\n\n\t\tmRegisters[destBS.getValue()].setValue(sum);\n\n\t\tsetConditionalCode(mRegisters[destBS.getValue()]);\n\n\n\t}", "public void polyAdd_S(GrowQueue_I8 polyA , GrowQueue_I8 polyB , GrowQueue_I8 output ) {\n\t\toutput.resize(Math.max(polyA.size,polyB.size));\n\t\tint M = Math.min(polyA.size, polyB.size);\n\n\t\tfor (int i = M; i < polyA.size; i++) {\n\t\t\toutput.data[i] = polyA.data[i];\n\t\t}\n\t\tfor (int i = M; i < polyB.size; i++) {\n\t\t\toutput.data[i] = polyB.data[i];\n\t\t}\n\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\toutput.data[i] = (byte)((polyA.data[i]&0xFF) ^ (polyB.data[i]&0xFF));\n\t\t}\n\t}", "@Override\n\t\tpublic int add(int a, int b) throws RemoteException {\n\t\t\tLog.i(TAG, \"add a = \" + a + \", b = \" + b);\n\t\t\treturn a+b;\n\t\t}", "public static double add(int left, int right){\n return left + right;\n }", "public Integer call(Integer a, Integer b) throws Exception {\n\t\t\t\treturn a+b;\n\t\t\t}", "public static int plus(int value1, int value2){\r\n return value1 + value2;\r\n }", "public static int add(int a, int b)\n\t{\n\t\treturn a + b;\n\t}", "public static void main(String[] args) {\n unaryAndBinaryOperator();\n }", "public int addNum(int a, int b){\n return a+b;\n }", "public static int sum(int a, int b) {\n return a + b;\n }", "default int sumOfAll(int a, int b) {\n\t\t\treturn 0;\n\t\t}", "public T plus( T B ) {\n convertType.specify(this, B);\n T A = convertType.convert(this);\n B = convertType.convert(B);\n\n T ret = A.createMatrix(mat.getNumRows(), mat.getNumCols(), A.getType());\n\n A.ops.plus(A.mat, B.mat, ret.mat);\n\n return ret;\n }", "public static int Sum(int a, int b)\r\n\t{\n\tint sum=a+b;\r\n\treturn sum;\r\n\t}", "public Integer add(Integer first, Integer second){\n return first + second;\n }", "private static List<Integer> addOnePlus(List<Integer> input) {\n\n\t\tint size = input.size();\n\t\tinput.set(size-1, input.get(size-1)+1);//last element of input is updated/replaced by (original value + 1)\n\n\t\tfor(int i=size-1; i>0 && input.get(i)==10; i--) {\n\t\t\tinput.set(i, 0);\n\t\t\tinput.set(i-1, input.get(i-1)+1);\n\t\t}\n\n\t\tif(input.get(0) == 10) {\n\t\t\tinput.set(0, 0);\n\t\t\tinput.add(0, 1);//add 1 at index0 ,shift all elements after to right\n\t\t}\n\n\t\treturn input;//this modifies the original input\n\t}", "@Override\r\n\tpublic int add(int a, int b) {\n\t\tSystem.out.println(a+b);\r\n\t\treturn a+b;\r\n\t}" ]
[ "0.71446186", "0.6458419", "0.63771933", "0.6371818", "0.6343794", "0.63301194", "0.63301194", "0.629415", "0.62539756", "0.6170459", "0.6083405", "0.6037304", "0.5977542", "0.5964282", "0.5926975", "0.59137744", "0.59017044", "0.5898584", "0.58976144", "0.58948195", "0.58924896", "0.58916247", "0.58834094", "0.5869257", "0.5867812", "0.569353", "0.56478363", "0.5613165", "0.55634356", "0.5562813", "0.55584264", "0.5555034", "0.55506325", "0.5534325", "0.5506791", "0.5503726", "0.55009615", "0.54981947", "0.54968226", "0.54920644", "0.5489252", "0.5486062", "0.54795873", "0.5452372", "0.54521275", "0.5438273", "0.5417501", "0.5412238", "0.54102755", "0.5390308", "0.5376465", "0.53717345", "0.53712326", "0.53710735", "0.5359441", "0.534278", "0.5334401", "0.53218347", "0.53139365", "0.5308828", "0.5306336", "0.53055185", "0.530291", "0.5295726", "0.52915454", "0.52819484", "0.52812386", "0.52812386", "0.52798545", "0.5274981", "0.5264361", "0.52612334", "0.52607197", "0.5257977", "0.52557003", "0.5254779", "0.5251191", "0.5242291", "0.52371275", "0.5235708", "0.5228595", "0.5222952", "0.52198917", "0.5218861", "0.51979244", "0.5183928", "0.5176264", "0.51677746", "0.5164988", "0.5161752", "0.51597", "0.51594764", "0.5152892", "0.51515144", "0.51419365", "0.51382416", "0.51366466", "0.5132233", "0.51257366", "0.5119056" ]
0.71960485
0
Performs the subtraction operation using a ripplecarry adder: output = inputA inputB In order to perform subtraction, set the first carryin to 1 and invert the bits of inputB.
private void sub() { // PROGRAM 1: Student must complete this method // This method must use the addBit method for bitwise subtraction. //invert bits of inputB for (int i = 0; i < inputB.length; i++) { if (!inputB[i]) { inputB[i] = true; //set each 0 bit to 1 } else { inputB[i] = false; //set each 1 bit to 0 } } adder = addBit(inputA[0], inputB[0], true); //place first iteration of addBit with a carry-in bit into adder. output[0] = adder[0]; //place first sum into output[0] //loop thru output starting at index 1 since we already computed for (int i = 1; i < output.length; i++) { cin = adder[1]; // set cin equal to carryout adder = addBit(inputA[i], inputB[i], cin); //call addBit with index i of inputA and inputB and cin output[i] = adder[0]; //place sum into output[i] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void subtract()\r\n {\r\n resultDoubles = Operations.subtraction(leftOperand, rightOperand);\r\n resultResetHelper();\r\n }", "public int subtraction(int a, int b){\n return a - b;\n }", "BaseNumber subtract(BaseNumber operand);", "@Override\n\tpublic double subtract(double in1, double in2) {\n\t\treturn 0;\n\t}", "void minus(int a) {\n this.result -= a; // 이렇게 result 변수가 있는 인스턴스의 주소를 사용하여 계산을 수행한다.\n }", "public T minus( T B ) {\n convertType.specify(this, B);\n T A = convertType.convert(this);\n B = convertType.convert(B);\n T ret = A.createLike();\n\n A.ops.minus(A.mat, B.mat, ret.mat);\n return ret;\n }", "int subtraction(int a, int b) {\n return a-b;\r\n }", "public void subtract() {\n\t\t\n\t}", "public static void subtract(int[] n1, int[] n2, int[] result, int[]sign) {\n\t\tint b = n1.length-1;\n\t\tint carry = 0;\n\t\t\n\t\tboolean smaller = (compareTo(n2, n1) < 0);\n//\t\t// confirm that n2 is smaller than n1. If so, we reverse. Assume that\n//\t\t// n2 is smaller.\n//\t\tboolean smaller = true;\n//\t\tfor (int i = 0; i < n1.length; i++) {\n//\t\t\tif (n2[i] == n1[i]) { \n//\t\t\t\tcontinue;\n//\t\t\t}\n//\n//\t\t\t// Must be able to report by now...\n//\t\t\tif (n2[i] > n1[i]) {\n//\t\t\t\tsmaller = false;\n//\t\t\t}\n//\t\t\tbreak;\n//\t\t}\n\t\t\n\t\twhile (b >= 0) {\n\t\t\t\n\t\t\tint s = n1[b] - n2[b];\n\t\t\tif (!smaller) { s = -s; }\n\t\t\ts += carry;\n\t\t\tif (s >= 0) {\n\t\t\t\tresult[b] = s;\n\t\t\t\tcarry = 0;\n\t\t\t} else {\n\t\t\t\tcarry = -1;\n\t\t\t\tresult[b] = s + 10;\n\t\t\t}\n\t\t\t\n\t\t\tb--;\n\t\t}\n\t\t\n\t\tif (!smaller) {\n\t\t\tsign[0] = -1;\n\t\t} else {\n\t\t\tsign[0] = carry+0;\n\t\t}\n\t}", "public Inatnum subtract(Inatnum a){//purpose: to subtract 2 values\n\t\ttry {return(this.pred().subtract(a).pred());}//take the previous value of this and the previous value of a until one of them hits zero and then return the other value\n\t\tcatch(Exception e) {System.out.println(\"Error add: \"+ e.getMessage());// otherwise return an error, this needs to be greater than or equal to a otherise we'd get a negative\n\t\t\t\t \t\t\t\t\t\t\t// and there are no negative natural numbers\n\t\treturn null;}\n\t\t\t}", "public CLImage2D subtract(CLImage2D in1, CLImage2D in2) {\n\t\treturn process(subtractImage, in1, in2);\n\t}", "public Binary negative(){\n\n Binary ret1= this.flip();\n Binary ret2= ret1.suma1();\n return ret2;\n }", "public static BinaryExpression subtract(Expression expression0, Expression expression1) {\n return makeBinary(ExpressionType.Subtract, expression0, expression1);\n }", "public int subtract(int number1, int number2)\n\t\tthrows CalculatorOperationException;", "public static Digit minus(Digit first, Digit second){\n return Operations.minus(first.copy(), second.copy());\n }", "public static <T extends Vector> T Substract(T a, T b,T result){\n if(Match(a,b)) {\n for (int i = 0; i < result.axis.length; i++) {\n result.axis[i] = a.axis[i] - b.axis[i];\n }\n return result;\n }\n return result;\n }", "private static int[] subtract(int[] big, int[] little) {\n int bigIndex = big.length;\n int result[] = new int[bigIndex];\n int littleIndex = little.length;\n long difference = 0;\n\n // Subtract common parts of both numbers\n while (littleIndex > 0) {\n difference = (big[--bigIndex] & LONG_MASK) -\n (little[--littleIndex] & LONG_MASK) +\n (difference >> 32);\n result[bigIndex] = (int)difference;\n }\n\n // Subtract remainder of longer number while borrow propagates\n boolean borrow = (difference >> 32 != 0);\n while (bigIndex > 0 && borrow)\n borrow = ((result[--bigIndex] = big[bigIndex] - 1) == -1);\n\n // Copy remainder of longer number\n while (bigIndex > 0)\n result[--bigIndex] = big[bigIndex];\n\n return result;\n }", "@Override\r\n\tpublic int sub(int a,int b) {\n\t\treturn a-b;\r\n\t}", "public int getSum(int a, int b) {\n\n while(b!=0){ //check till carry is not equal to zero\n int carry = a&b;\n a=a^b;\n b=carry<<1;\n }\n return a;\n }", "@Override\r\n\tpublic int call(int a, int b) {\n\t\treturn a-b;\r\n\t}", "private void add() {\n // PROGRAM 1: Student must complete this method\n // This method must use the addBit method for bitwise addition.\n adder = addBit(inputA[0],inputB[0], false); //begin adding, no carry in\n output[0] = adder[0]; //place sum of first addBit iteration into output[0]\n //loop thru output beginning at index 1 (since we already computed index 0)\n for (int i = 1; i < output.length; i++) {\n cin = adder[1]; //set carry-out bit of addBit() iteration to cin\n adder = addBit(inputA[i], inputB[i], cin); //call addBit with index i of inputA and inputB and cin and place into adder.\n output[i] = adder[0]; //place sum into output[i]\n }\n }", "public static BIGNUM subtract(BIGNUM bn1, BIGNUM bn2) {\n\t\tBIGNUM newbn = new BIGNUM(-bn2.NUM, bn2.E);\n\t\treturn add(bn1, newbn);\n\t}", "default int subtract(int num1, int num2) {\n\t\treturn num1-num2;\n\t}", "@Test(priority=2)\n\n\tpublic void subtractionTest() {\n\n\t\tandroidCalculator = new AndroidCalculator(driver);\n\n\t\tandroidCalculator.inputLeftAndRightFields(\"20\", \"10\");\n\t\tandroidCalculator.subtraction();\n\n\t\tAssert.assertEquals(androidCalculator.verifyResult(), 20+10);\n\t}", "public static NumberP Subtraction(NumberP first, NumberP second)\n {\n return OperationsManaged.PerformArithmeticOperation\n (\n first, second, ExistingOperations.Subtraction\n ); \t\n }", "public static void main(String[] args) {\n\t\t\r\n\t\t\r\n\t\tint a,b,c;\r\n\t\ta=10;b=20;\r\n\t\t c=a-(-b);\r\n\t\t System.out.println(\"Addition: \"+c);\r\n\t\t\t\t \r\n\r\n\t}", "static void rlc_without_carry(String passed){\n\t\tint val = hexa_to_deci(registers.get('A'));\n\t\tint bits[] = new int[8];\n\t\tfor(int i=0;i<8;i++){\n\t\t\tbits[7-i] = val%2;\n\t\t\tval/=2;\n\t\t}\n\t\tCS = bits[0]==1?true:false;\n\t\tfor(int i=0;i<7;i++)\n\t\t\tbits[i] = bits[i+1];\n\t\tbits[7] = CS?1:0;\n\t\tint dec = 0;\n\t\tfor(int i=0;i<8;i++)\n\t\t\tdec+=(bits[7-i]*Math.pow(2,i));\n\t\tregisters.put('A',decimel_to_hexa_8bit(dec));\n\t}", "static void rrc_without_carry(String passed){\n\t\tint val = hexa_to_deci(registers.get('A'));\n\t\tint bits[] = new int[8];\n\t\tfor(int i=0;i<8;i++){\n\t\t\tbits[7-i] = val%2;\n\t\t\tval/=2;\n\t\t}\n\t\tCS = bits[7]==1?true:false;\n\t\tfor(int i=7;i>0;i--)\n\t\t\tbits[i] = bits[i-1];\n\t\tbits[0] = CS?1:0;\n\t\tint dec = 0;\n\t\tfor(int i=0;i<8;i++)\n\t\t\tdec+=(bits[7-i]*Math.pow(2,i));\n\t\tregisters.put('A',decimel_to_hexa_8bit(dec));\n\t}", "public static BinaryExpression subtract(Expression expression0, Expression expression1, Method method) {\n return makeBinary(\n ExpressionType.Subtract,\n expression0,\n expression1,\n shouldLift(expression0, expression1, method),\n method);\n }", "private void subtraction()\n\t{\n\t\tFun = Function.SUBTRACT; //Function set to determine what action should be taken later.\n\t\t\n\t\t\tsetLeftValue();\n\t\t\tentry.grabFocus();\n\t\t\n\t}", "static int[] Differenz(int[] a, int[] b){\n int i = a.length - 1;\n int[] c = new int [a.length];\n Arrays.fill(c, 0);\n while (i >= 0){\n if ((a[i] - b[i]) < 0){\n c[i] = (a[i] + 10) - b[i];\n c[i-1]--;\n }\n else c[i] = a[i] - b[i];\n i--;\n }\n return c;\n }", "public double resta(double a, double b) {\n\t\treturn a-b;\n\t}", "public int[] addNegabinary(int[] arr1, int[] arr2) {\n Stack<Integer> stack = new Stack<>();\n for (int sum = 0, i = arr1.length - 1, j = arr2.length - 1;\n i >= 0 || j >= 0 || sum != 0; sum = -(sum >> 1)) {\n sum += (i >= 0) ? arr1[i--] : 0;\n sum += (j >= 0) ? arr2[j--] : 0;\n stack.push(sum & 1);\n }\n for (; !stack.isEmpty() && stack.peek() == 0; stack.pop()) {}\n int[] res = new int[stack.size()];\n for (int k = 0; !stack.isEmpty(); k++) {\n res[k] = stack.pop();\n }\n return (res.length == 0) ? new int[1] : res;\n }", "public static String subtract(String num1, String num2) {\n\t\t// *** WRITE YOUR CODE HERE ***\n\t}", "static int add(int a, int b){\n int carry = 0;\n int result = 0;\n int i;\n for(i=0; a>0||b>0; i++){\n int ba = a&1;\n int bb = b&1;\n result = result|((carry^ba^bb)<<i);\n carry = (ba&bb) | (bb&carry) | (carry&ba);\n a = a>>1;\n b = b>>1;\n }\n return result|(carry<<i);\n }", "void minus(int a, int b){\n\t\tSystem.out.println(\"Method-3 (2 different Data Types) Minus is: \" + (a-b));\n\t}", "@Override\r\n\tprotected double operate(double d1, double d2) {\n\t\tSystem.out.println(\"减法求值\");\r\n\t\treturn d1-d2;\r\n\t}", "@Test\n\tpublic void testUnaryMinusExpression() throws BcException, IOException {\n\t\tString[] params = { \"5/-1*-2\" };\n\t\tbcApp.run(params, inStream, outStream);\n\t\tassertEquals(\"10\", outStream.toString());\n\n\t}", "public Matrix minus(Matrix B) {\n Matrix A = this;\n if (B.rowCount != A.rowCount || B.columnCount != A.columnCount) throw new RuntimeException(\"Illegal matrix dimensions.\");\n Matrix C = new Matrix(rowCount, columnCount);\n for (int i = 0; i < rowCount; i++)\n for (int j = 0; j < columnCount; j++)\n C.data[i][j] = A.data[i][j] - B.data[i][j];\n return C;\n }", "public <I extends Image<?, I>> I subtract(I in1, I in2) {\n\t\tCLQueue queue = context.createDefaultQueue();\n\t\t\n\t\tCLImage2D clin1 = CLImageConversion.convert(context, in1);\n\t\tCLImage2D clin2 = CLImageConversion.convert(context, in2);\n\t\tCLImage2D clout = context.createImage2D(CLMem.Usage.Output, clin1.getFormat(), clin1.getWidth(), clin1.getHeight());\n\t\t\n\t\tCLEvent evt = process(subtractImage, queue, clin1, clin2, clout);\n\t\t\n\t\tI out = CLImageConversion.convert(queue, evt, clout, in1.newInstance(in1.getWidth(), in1.getHeight()));\n\t\t\n\t\tclin1.release();\n\t\tclin2.release();\n\t\tclout.release();\n\t\tqueue.release();\n\t\t\n\t\treturn out;\n\t}", "@Override\n\tpublic int arithmetical(int first, int second) {\n\t\treturn first - second;\n\t}", "public static double subtract(int left, int right){\n return left - right;\n }", "public static int getSum(int a, int b) {\n// Integer.toBinaryString(a) ^ Integer.toBinaryString(b);\n return a ^ b;\n }", "public static Matrix minus(Matrix amat, Matrix bmat){\r\n \tif((amat.nrow!=bmat.nrow)||(amat.ncol!=bmat.ncol)){\r\n \t\tthrow new IllegalArgumentException(\"Array dimensions do not agree\");\r\n \t}\r\n \tint nr=amat.nrow;\r\n \tint nc=amat.ncol;\r\n \tMatrix cmat = new Matrix(nr,nc);\r\n \tdouble[][] carray = cmat.getArrayReference();\r\n \tfor(int i=0; i<nr; i++){\r\n \t\tfor(int j=0; j<nc; j++){\r\n \t\tcarray[i][j]=amat.matrix[i][j] - bmat.matrix[i][j];\r\n \t\t}\r\n \t}\r\n \treturn cmat;\r\n \t}", "public static int minus(int value1, int value2){\r\n return value1 - value2;\r\n }", "private int[] subtract(int xStart, int[] x, int yStart, int[] y)\n {\n int iT = x.length - 1;\n int iV = y.length - 1;\n long m;\n int borrow = 0;\n\n do\n {\n m = (((long)x[iT]) & IMASK) - (((long)y[iV--]) & IMASK) + borrow;\n\n x[iT--] = (int)m;\n\n if (m < 0)\n {\n borrow = -1;\n }\n else\n {\n borrow = 0;\n }\n } while (iV >= yStart);\n\n while (iT >= xStart)\n {\n m = (((long)x[iT]) & IMASK) + borrow;\n x[iT--] = (int)m;\n\n if (m < 0)\n {\n borrow = -1;\n }\n else\n {\n break;\n }\n }\n\n return x;\n }", "private static int[] subtract(int xStart, int[] x, int yStart, int[] y)\n {\n int iT = x.length;\n int iV = y.length;\n long m;\n int borrow = 0;\n\n do\n {\n m = ((long)x[--iT] & IMASK) - ((long)y[--iV] & IMASK) + borrow;\n x[iT] = (int)m;\n\n// borrow = (m < 0) ? -1 : 0;\n borrow = (int)(m >> 63);\n }\n while (iV > yStart);\n\n if (borrow != 0)\n {\n while (--x[--iT] == -1)\n {\n }\n }\n\n return x;\n }", "@Override\n\tpublic double substract(double a, double b) {\n\t\treturn (a-b);\n\t}", "public BigInt minus(BigInt rhs) throws BigIntException {\n if (null == rhs) {\n throw new BigIntException(\"null parameter\");\n }\n\n if (!isPositive && rhs.isPositive) {\n // -x-y=-(x+y)\n BigInt num1 = new BigInt(number, true);\n BigInt num2 = new BigInt(rhs.number, true);\n\n BigInt result = num1.plus(num2);\n result.swapSign();\n\n return result;\n } else if (!isPositive && !rhs.isPositive) {\n // -x-(-y)=y-x\n BigInt num1 = new BigInt(number, true);\n BigInt num2 = new BigInt(rhs.number, true);\n\n return num2.minus(num1);\n } else if (isPositive && !rhs.isPositive) {\n // x-(-y)=x+y\n return plus(new BigInt(rhs.number, true));\n }\n\n // x-y\n int length = Math.max(number.size(), rhs.number.size());\n\n // Set the bigger and the smaller number\n ArrayList<Integer> bigger, smaller;\n boolean isDiffPositive = isGreater(rhs);\n if (isDiffPositive) {\n // this is greater\n bigger = new ArrayList<Integer>(number);\n smaller = new ArrayList<Integer>(rhs.number);\n } else {\n // rhs is greater\n bigger = new ArrayList<Integer>(rhs.number);\n smaller = new ArrayList<Integer>(number);\n }\n\n ArrayList<Integer> diff = new ArrayList<Integer>();\n int digit_diff = 0;\n for (int i = 0; i < length; ++i) {\n int subtracting_current_digit = getDigit(bigger, i);\n int subtracted_current_digit = getDigit(smaller, i);\n\n digit_diff = subtracting_current_digit - subtracted_current_digit;\n if (0 > digit_diff) {\n // The subtracted is bigger so we need to borrow\n borrow(bigger, i);\n digit_diff += 10;\n }\n\n diff.add(digit_diff);\n }\n\n return new BigInt(diff, isDiffPositive);\n }", "@Override\r\n\tpublic int jumble(int leftOne, int rightOne, int leftTwo, int rightTwo) {\n\t\tString serviceCclientId = \"f3e5071e-c778-4754-8641-c682be436367\";\r\n\r\n\t\t//String url = \"https://api.apim.ibmcloud.com/bluemixtraininganzgmailcom-dev/sb\";\r\n\t\tString url = \"https://api.apim.ibmcloud.com/strichykyahoocomau-dev/sb\";\r\n\t\tSystem.out.println(url + \"/ServiceAService\");\r\n\t\tLOGGER.info(url + \"/ServiceAService\");\r\n\t\t\r\n\t\tMap<String, List<String>> serviceARequestHeaders = new HashMap<String, List<String>>();\r\n\t\tserviceARequestHeaders.put(\"X-IBM-Client-Id\", Collections.singletonList(serviceCclientId));\r\n\r\n\t\tIServiceA serviceA = new ServiceAService().getServiceAPort();\r\n\t\t((BindingProvider)serviceA).getRequestContext().put(MessageContext.HTTP_REQUEST_HEADERS, serviceARequestHeaders);\r\n\t\tSystem.out.println(BindingProvider.ENDPOINT_ADDRESS_PROPERTY +\":\" + url + \"/ServiceAService\");\r\n\t\t((BindingProvider)serviceA).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url + \"/ServiceAService\");\r\n\t\t\r\n\t\tIServiceB serviceB = new ServiceBService().getServiceBPort();\r\n\t\t((BindingProvider)serviceB).getRequestContext().put(MessageContext.HTTP_REQUEST_HEADERS, serviceARequestHeaders);\r\n\t\t((BindingProvider)serviceB).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url + \"/ServiceBService\");\r\n\r\n\t\tint result = serviceB.minus(serviceA.plus(leftOne, rightOne),serviceA.plus(leftTwo, rightTwo));\r\n\t\t\r\n\t\tLOGGER.info(\"leftOne=\"+leftOne + \", rightOne=\" + rightOne + \",leftTwo=\"+leftTwo + \", rightTwo=\" + rightTwo + \", result=\" + result);\r\n\r\n\t\treturn result;\t\t\r\n\t}", "public int sumTwo(int a, int b) {\n\t\twhile (b != 0) {\n\t\t\tint sum = a ^ b;\n\t\t\tint carry = (a & b) << 1;\n\t\t\ta = sum; \n\t\t\tb = carry; \n\t\t}\n\t\treturn a;\n\t}", "public Matrix minus(Matrix B) throws JPARSECException {\n checkMatrixDimensions(B);\n Matrix X = new Matrix(m,n);\n double[][] C = X.getArray();\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n C[i][j] = data[i][j] - B.data[i][j];\n }\n }\n return X;\n }", "public static int p_sub(){\n Scanner keyboard = new Scanner(System.in);\n System.out.println(\"please put the first number that you want to subtract:\");\n int v_sub_number_1 = keyboard.nextInt();\n System.out.println(\"please put the second number that you want to subtract:\");\n int v_sub_number_2 = keyboard.nextInt();\n int v_total_sub= v_sub_number_1-v_sub_number_2;\n return v_total_sub;\n }", "public int getSumLoop(int a, int b) {\n while (b != 0) {\n int temp = a ^ b;\n b = (a & b) << 1;\n a = temp;\n }\n return a;\n }", "protected MatrixToken _subtractElement(Token rightArgument)\n\t\t\tthrows IllegalActionException {\n\t\tlong scalar;\n\t\tif (rightArgument instanceof LongMatrixToken) {\n\t\t\tif (((LongMatrixToken) rightArgument).getRowCount() != 1\n\t\t\t\t\t|| ((LongMatrixToken) rightArgument).getColumnCount() != 1) {\n\t\t\t\t// Throw an exception.\n\t\t\t\treturn super._moduloElement(rightArgument);\n\t\t\t}\n\t\t\tscalar = ((LongMatrixToken) rightArgument).getElementAt(0, 0);\n\t\t} else {\n\t\t\tscalar = ((LongToken) rightArgument).longValue();\n\t\t}\n\t\tlong[] result = LongArrayMath.add(_value, -scalar);\n\t\treturn new LongMatrixToken(result, _rowCount, _columnCount, DO_NOT_COPY);\n\t}", "public Matrix minus(Matrix B) {\n Matrix A = this;\n if (B.M != A.M || B.N != A.N) throw new RuntimeException(\"Illegal matrix dimensions.\");\n Matrix C = new Matrix(M, N);\n for (int i = 0; i < M; i++)\n for (int j = 0; j < N; j++)\n C.data[i][j] = A.data[i][j] - B.data[i][j];\n return C;\n }", "public void polyMult_flipA(GrowQueue_I8 polyA , GrowQueue_I8 polyB , GrowQueue_I8 output ) {\n\t\toutput.resize(polyA.size+polyB.size-1);\n\t\toutput.zero();\n\n\t\tfor (int j = 0; j < polyB.size; j++) {\n\t\t\tint vb = polyB.data[j]&0xFF;\n\t\t\tfor (int i = 0; i < polyA.size; i++) {\n\t\t\t\tint va = polyA.data[polyA.size-i-1]&0xFF;\n\t\t\t\toutput.data[i+j] ^= multiply(va,vb);\n\t\t\t}\n\t\t}\n\t}", "private StringBuilder subtract(StringBuilder m, StringBuilder n) // special subtract does not take into consideration -ve result\n {\n \n \n int borrow=0 , difference=0;\n StringBuilder result=new StringBuilder();\n if(m.length()>=n.length())\n {\n n=align(n,m.length());\n \n }\n else{\n m=align(m,n.length());\n \n }\n \n String temp1=new String();\n String temp2=new String();\n for (int i=m.length()-1;i>=0;i--) {\n \n \n temp1=temp1+m.charAt(i);\n temp2=temp2+n.charAt(i);\n \n if (Integer.parseInt(temp1)>=(Integer.parseInt(temp2)+borrow))\n {\n difference=Integer.parseInt(temp1)-Integer.parseInt(temp2)-borrow;\n borrow=0;\n \n result.insert(0,Integer.toString(difference));\n temp1=\"\";\n temp2=\"\";\n }\n else{\n difference=Integer.parseInt(temp1)+10-Integer.parseInt(temp2)-borrow;\n borrow=1;\n result.insert(0,Integer.toString(difference));\n temp1=\"\";\n temp2=\"\";\n }\n \n \n }\n //int value=Integer.parseInt(result.toString());\n //result.delete(0,result.length());\n //result.append(value);\n \n \n //if (result.length()<m.length()) {\n// result=align(result,m);\n // }\n \n return result;\n \n \n }", "public static int subtractTwoNumbers(int num1, int num2){\n int subtraction = num1 - num2;\n return subtraction;\n }", "public static void main(String[] args) {\n int a=10;\r\n int b=20;\r\n a=a+b;\r\n b=a-b;\r\n a=a-b;\r\n System.out.println(\"reverse_no_is a= \"+a);\r\n System.out.println(\"reverse_no_is b= \"+b);\r\n\t\t\t\t\r\n\t}", "public static ArrayList<Float> mathematicalSubtract(ArrayList<Float> firstWave, ArrayList<Float> secondWave) {\r\n ArrayList<Float> newWave = new ArrayList<>();\r\n //int size = 0;\r\n //if (firstWave.size() < secondWave.size()) {\r\n // size = firstWave.size();\r\n //} else {\r\n // size = secondWave.size();\r\n //}\r\n int size = getSize(firstWave,secondWave);\r\n for (int i = 0; i < size; i++) {\r\n newWave.add(i, firstWave.get(i) - secondWave.get(i));\r\n }\r\n return newWave;\r\n }", "public void resetSubtraction() {\n\t\tset((byte) (get() & ~(1 << 6)));\n\t}", "private int calculamenos(String a, String b) {\n int res=0;\n res= Integer.valueOf(a) - Integer.valueOf(b);\n return res;\n \n }", "public static void main(String [] args){\n\t\tint [] A = {0,1,1,1}; //1110\r\n\t\tint [] B = {1,0,1,0};\r\n\t\tint [] C = new Hw2p1q4().binarySum(A, B, A.length);\r\n\t\tfor(int i=A.length; i>=0; i--){\r\n\t\t\tSystem.out.print(C[i]);\r\n\t\t}\r\n\t}", "protected MatrixToken _subtractElementReverse(Token rightArgument)\n\t\t\tthrows IllegalActionException {\n\t\tlong scalar;\n\t\tif (rightArgument instanceof LongMatrixToken) {\n\t\t\tif (((LongMatrixToken) rightArgument).getRowCount() != 1\n\t\t\t\t\t|| ((LongMatrixToken) rightArgument).getColumnCount() != 1) {\n\t\t\t\t// Throw an exception.\n\t\t\t\treturn super._moduloElement(rightArgument);\n\t\t\t}\n\t\t\tscalar = ((LongMatrixToken) rightArgument).getElementAt(0, 0);\n\t\t} else {\n\t\t\tscalar = ((LongToken) rightArgument).longValue();\n\t\t}\n\t\tlong[] result = LongArrayMath.negative(LongArrayMath.add(_value,\n\t\t\t\t-scalar));\n\t\treturn new LongMatrixToken(result, _rowCount, _columnCount, DO_NOT_COPY);\n\t}", "public static ListNode subtract(ListNode A) {\n ListNode slowPtr = A, fastPtr = A;\n ListNode secondHalf, slowPrev = null;\n\n while (fastPtr!=null && fastPtr.next!=null) {\n slowPrev = slowPtr;\n slowPtr = slowPtr.next;\n fastPtr = fastPtr.next.next;\n }\n\n if (fastPtr!=null)\n secondHalf = slowPtr.next;\n else\n secondHalf = slowPtr;\n\n ListNode reversedSecondHalf = reverse(secondHalf);\n ListNode currentReverse = reversedSecondHalf;\n ListNode current = A;\n\n while (currentReverse!=null) {\n current.val = currentReverse.val - current.val;\n current = current.next;\n currentReverse = currentReverse.next;\n }\n\n secondHalf = reverse(reversedSecondHalf);\n\n if (fastPtr!=null)\n slowPtr.next = secondHalf;\n else\n slowPrev.next = secondHalf;\n\n return A;\n }", "public abstract ArithValue negate();", "public int[] addNegabinary2(int[] arr1, int[] arr2) {\n LinkedList<Integer> list = new LinkedList<>();\n int n = Math.max(arr1.length, arr2.length);\n for (int i = 0, carry = 0; i < n || carry != 0; i++) {\n int b1 = (i < arr1.length) ? arr1[arr1.length - i - 1] : 0;\n int b2 = (i < arr2.length) ? arr2[arr2.length - i - 1] : 0;\n int sum = b1 + b2 + carry;\n list.push(Math.abs(sum) % 2);\n carry = (sum < 0) ? 1 : (sum > 1) ? -1 : 0;\n }\n for (; list.size() > 1 && list.get(0) == 0; list.pop()) {}\n return list.stream().mapToInt(i->i).toArray();\n }", "@Override\n\tpublic float subtrair(float op1, float op2) {\n\t\treturn op1 - op2;\n\t}", "public Matrix minus(Matrix bmat){\r\n \tif((this.nrow!=bmat.nrow)||(this.ncol!=bmat.ncol)){\r\n \t\tthrow new IllegalArgumentException(\"Array dimensions do not agree\");\r\n \t}\r\n \tint nr=this.nrow;\r\n \tint nc=this.ncol;\r\n \tMatrix cmat = new Matrix(nr,nc);\r\n \tdouble[][] carray = cmat.getArrayReference();\r\n \tfor(int i=0; i<nr; i++){\r\n \t\tfor(int j=0; j<nc; j++){\r\n \t\tcarray[i][j]=this.matrix[i][j] - bmat.matrix[i][j];\r\n \t\t}\r\n \t}\r\n \treturn cmat;\r\n \t}", "public int getSum(int a, int b) {\n if(a == 0) {\n return b;\n }\n\n if(b == 0) {\n return a;\n }\n\n int carry = 0;\n\n while(b != 0) {\n\n // If both bits are 1, we set the bit to the left (<<1) to 1 -- this is the carry step\n carry = (a & b) << 1;\n\n // If both bits are 1, this will give us 0 (we will have a carry from the step above)\n // If only 1 bit is 1, this will give us 1 (there is nothing to carry)\n a = a ^ b;\n\n b = carry;\n }\n\n return a;\n }", "static void resta(){\n Scanner scanner = new Scanner(System.in);\n\n System.out.print(\"Ingrese el primer numero binario: \");\n String bin1 = scanner.nextLine();\n\n System.out.print(\"Ingrese el segundo numero binario: \");\n String bin2 = scanner.nextLine();\n\n int A = Integer.parseInt(bin1,2);\n int B = Integer.parseInt(bin2,2);\n\n Long suma = (long) A + (~B + 1);\n\n System.out.println(\"\\nLa resta es: \" + Long.toBinaryString(suma)); \n \n scanner.close();\n }", "public int soustraire(int a, int b){\r\n\t\treturn a-b;\r\n\t}", "public Money subtract(Money input) {\n long newAmount = this.amount - input.getAmount();\n this.amount = newAmount;\n Money subtractedAmount = new Money(currency, newAmount);\n return subtractedAmount;\n }", "private static Integer deductOne(Integer element) {\n return element - 1;\n }", "public void substract(int sub) {\r\n value -= sub;\r\n }", "public static RuntimeValue subtract(RuntimeValue left, RuntimeValue right) throws RuntimeException {\n if (isDiscreteIntSamples(left, right)) {\n return new RuntimeValue(\n RuntimeValue.Type.DISCRETE_INT_SAMPLE,\n Operators.subtractIntegers(left.getDiscreteIntSample(), right.getDiscreteIntSample())\n );\n }\n\n if (isDiscreteFloatSamples(left, right)) {\n return new RuntimeValue(\n RuntimeValue.Type.DISCRETE_FLOAT_SAMPLE,\n Operators.subtractFloats(left.getDiscreteFloatSample(), right.getDiscreteFloatSample())\n );\n }\n\n if (isDiscreteFloatSample(left) && hasSingleValue(left.getDiscreteFloatSample()) && isContinuousSample(right)) {\n return new RuntimeValue(\n RuntimeValue.Type.CONTINUOUS_SAMPLE,\n right.getContinuousSample().add(-1 * left.getDiscreteFloatSample().single())\n );\n }\n\n if (isDiscreteFloatSample(right) && hasSingleValue(right.getDiscreteFloatSample()) && isContinuousSample(left)) {\n return new RuntimeValue(\n RuntimeValue.Type.CONTINUOUS_SAMPLE,\n left.getContinuousSample().add(-1 * right.getDiscreteFloatSample().single())\n );\n }\n\n throw new RuntimeException(\"Subtracting incompatible types\");\n }", "public static ArthurString minus(ArthurString one, ArthurNumber two) {\n String t = \"\" + two.val;\n return minus(one, new ArthurString(t));\n }", "public CLEvent subtract(CLQueue queue, CLImage2D in1, CLImage2D in2, CLImage2D out) {\n\t\treturn process(subtractImage, queue, in1, in2, out);\n\t}", "private void Perform_ADC()\n {\n d = Utils.GetOperand_XXXXXXX11111XXXX(mMBR);\n r = Utils.GetOperand_XXXXXX1XXXXX1111(mMBR);\n\n dvalue = get_reg(d);\n rvalue = get_reg(r);\n result = dvalue + rvalue;\n if (get_cflag()) result+=1;\n\n set_hflag(CarryFromBit3(dvalue, rvalue, result));\n set_nflag(Utils.bit7(result));\n set_vflag(Overflow(dvalue, rvalue, result));\n set_sflag(get_nflag() ^ get_vflag());\n set_zflag(result == 0);\n set_cflag(CarryFromResult(dvalue, rvalue, result));\n\n try {set_reg(d,result); }\n catch (RuntimeException e) { }\n\n return;\n }", "public long reverseInput(long input)\n\t{\n\t\tlong originalInput=input;\n\t\tboolean isNegative=false;\n\t\tif(input<0)\n\t\t{\n\t\t\tisNegative=true;\n\t\t\tinput*=-1;\n\t\t}\n\t\t long rem,reverseInput=0;\n while(input >0)\n {\n \t rem=input%10;\n input/=10;\n reverseInput=reverseInput*10+rem;\n }\n if(isNegative==true)\n {\n \t reverseInput*=-1;\n }\n return (reverseInput);\n\t\t\n\t}", "public static Digit minusMinus(Digit digit){\n return digit.copy().previous();\n }", "public Matrix minus(double[][] bmat){\r\n \t int nr=bmat.length;\r\n \tint nc=bmat[0].length;\r\n \tif((this.nrow!=nr)||(this.ncol!=nc)){\r\n \t\tthrow new IllegalArgumentException(\"Array dimensions do not agree\");\r\n \t}\r\n\r\n \tMatrix cmat = new Matrix(nr,nc);\r\n \tdouble[][] carray = cmat.getArrayReference();\r\n \tfor(int i=0; i<nr; i++){\r\n \t\tfor(int j=0; j<nc; j++){\r\n \t\tcarray[i][j]=this.matrix[i][j] - bmat[i][j];\r\n \t\t}\r\n \t}\r\n \treturn cmat;\r\n \t}", "public static SinglyLinkedList<Poly> subtraction(SinglyLinkedList.Entry<Poly> list1,\n\t\t\tSinglyLinkedList.Entry<Poly> list2) {\n\t\tSinglyLinkedList<Poly> list3 = new SinglyLinkedList();\n\t\twhile (list2 != null) {\n\t\t\tPoly p = list2.element;\n\t\t\tp.num = p.num * -1;\n\t\t\tlist3.add(p);\n\t\t\tlist2 = list2.next;\n\t\t}\n\t\treturn addition(list1, list3.head.next);\n\t}", "private ASTNode binaryMinusRules(ASTNode left, ASTNode right) throws Exception {\n\n Token leftToken = left.getToken();\n Token rightToken = right.getToken();\n\n TokenType leftType = leftToken.getType();\n TokenType rightType = rightToken.getType();\n\n TokenType numType = TokenType.NUMBER;\n TokenType varType = TokenType.VAR;\n TokenType minusType = TokenType.MINUS;\n TokenType plusType = TokenType.PLUS;\n\n Token tempToken;\n\n if (patternMatcher(leftType, rightType, numType, numType)){\n //left is num and right is num -> num\n Double leftVal = Double.parseDouble(leftToken.getIdentifier());\n Double rightVal = Double.parseDouble(rightToken.getIdentifier());\n Double sum = leftVal + rightVal;\n\n //if sum is negative, store the new node as unaryMinus(abs(left+right))\n if (sum < 0){\n tempToken = new Token(minusType);\n Token tempInnerToken = new Token(numType, String.valueOf(sum * -1));\n ASTNode tempOperand = new Num(tempInnerToken);\n return new UnaryOP(tempToken, tempOperand);\n }\n else{\n String tempString = String.valueOf(sum);\n tempToken = new Token(numType, tempString);\n return new Num(tempToken);\n }\n }\n else if (patternMatcher(leftType, rightType, varType, varType)){\n //left is var and right is var -> 0\n tempToken = new Token(numType, \"0\");\n return new Num(tempToken);\n }\n else if (rightType == minusType && right instanceof UnaryOP){\n //left is anything and right is unary minus -> var+right.operand\n tempToken = new Token(plusType);\n return new BinaryOp(tempToken, left, ((UnaryOP) right).getOperand());\n }\n else if (rightToken.getIdentifier().equals(\"0\")){\n //left is anything and right is 0 -> anything\n return left;\n }\n else if (leftToken.getIdentifier().equals(\"0\")){\n //left is 0 and right is anything -> -anything\n tempToken = new Token(minusType);\n return new UnaryOP(tempToken, right);\n }\n //else\n tempToken = new Token(minusType);\n return new BinaryOp(tempToken ,left, right);\n }", "private void debit(APDU apdu) {\n\n // access authentication\n if ( ! pin.isValidated() )\n ISOException.throwIt\n(SW_PIN_VERIFICATION_REQUIRED);\n\n byte[] buffer = apdu.getBuffer();\n\n byte numBytes =\n (byte)(buffer[ISO7816.OFFSET_LC]);\n\n byte byteRead =\n (byte)(apdu.setIncomingAndReceive());\n\n if ( ( numBytes != 1 ) || (byteRead != 1) )\n ISOException.throwIt\n (ISO7816.SW_WRONG_LENGTH);\n\n // get debit amount\n byte debitAmount =\n buffer[ISO7816.OFFSET_CDATA];\n\n // check debit amount\n if ( ( debitAmount > MAX_TRANSACTION_AMOUNT)\n || ( debitAmount < 0 ) )\n ISOException.throwIt\n (SW_INVALID_TRANSACTION_AMOUNT);\n\n // check the new balance\n if ( (short)( balance - debitAmount ) < (short)0 )\n ISOException.throwIt(SW_NEGATIVE_BALANCE);\n\n balance = (short) (balance - debitAmount);\n\n }", "public static ArthurString minus(ArthurString one, ArthurString two) {\n return new ArthurString(one.str.replace(two.str, \"\"));\n }", "protected MatrixToken _subtract(MatrixToken rightArgument)\n\t\t\tthrows IllegalActionException {\n\t\tLongMatrixToken convertedArgument = (LongMatrixToken) rightArgument;\n\t\tlong[] result = LongArrayMath.subtract(_value,\n\t\t\t\tconvertedArgument._getInternalLongArray());\n\t\treturn new LongMatrixToken(result, _rowCount, _columnCount, DO_NOT_COPY);\n\t}", "public HugeUInt subtract(HugeUInt arg) {\r\n //We only subtract smaller numbers\r\n HugeUInt result = new HugeUInt(this);\r\n int cur = 0;\r\n for (int i = 0; i < arg.getSize(); i++) {\r\n cur = cur + 10 + result.array[i] - arg.array[i];\r\n result.array[i] = cur % 10;\r\n cur = cur < 10 ? -1 : 0;\r\n }\r\n for (int i = arg.getSize(); i < getSize(); i++) {\r\n cur = cur + 10 + result.array[i];\r\n result.array[i] = cur % 10;\r\n cur = cur < 10 ? -1 : 0;\r\n }\r\n result.trim();\r\n return result;\r\n }", "@Override\n\tprotected void minus(char c, InterimResult ir)\n\t{\n\t\tNegateAction Negate = new NegateAction();\n\t\tNegate.execute(ir, c);\t\t\n\t}", "public static void main(String[] args) {\n int a = 15;\n int b = 17;\n\n System.out.println(\"a = \"+a+\" b = \"+b);\n\n a = a^b;\n b = a^b;\n a = a^b;\n\n System.out.println(\"a = \"+a+\" b = \"+b);\n }", "protected int sumIterative(int a, int b){\n int result = a;\n while (b != 0){\n if (b > 0){\n result++;\n b--;\n } else {\n result--;\n b++;\n }\n }\n return result;\n }", "public static BigFraction[][] subtract(BigFraction[][] A, BigFraction[][] B) {\n int m = A.length;\n int n = A[0].length;\n BigFraction[][] C = new BigFraction[m][n];\n for (int i = 0; i < m; i++)\n for (int j = 0; j < n; j++)\n C[i][j] = A[i][j].subtract(B[i][j]);\n return C;\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"This is subtraction\");\n\t}", "public static BinaryExpression leftShift(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public static BinaryExpression subtractChecked(Expression expression0, Expression expression1) {\n return makeBinary(ExpressionType.SubtractChecked, expression0, expression1);\n }", "public ComplementOp() {\r\n\t\tsuper();\r\n\t}", "public static BinaryExpression subtractChecked(Expression expression0, Expression expression1, Method method) {\n return makeBinary(\n ExpressionType.SubtractChecked,\n expression0,\n expression1,\n shouldLift(expression0, expression1, method),\n method);\n }", "public JavaPairRDD<String, Integer> substractExample(){\n return firstSet\n .subtractByKey(secondSet);\n }", "public Money subtract(Money moneyA, Money moneyB) throws NoSuchExchangeRateException {\n return Money(moneyA.amount.subtract(convert(moneyB, moneyA.currency).amount), moneyA.currency);\n }" ]
[ "0.57201993", "0.570018", "0.565369", "0.5642452", "0.56301016", "0.5584477", "0.5564582", "0.5372762", "0.5362969", "0.5313521", "0.52465034", "0.5244262", "0.52162904", "0.5178139", "0.5174277", "0.5138956", "0.5137202", "0.51362246", "0.5135882", "0.5117343", "0.511284", "0.5101649", "0.5091146", "0.50866354", "0.50855654", "0.5057189", "0.50411326", "0.50360715", "0.5034206", "0.5033361", "0.4989862", "0.49871367", "0.4982364", "0.49303526", "0.49208865", "0.48986912", "0.48947373", "0.48843095", "0.48778716", "0.4871429", "0.4870398", "0.48677555", "0.48635775", "0.48588192", "0.48578903", "0.48206267", "0.48117608", "0.48047176", "0.4799294", "0.47903568", "0.4790233", "0.47606975", "0.47384992", "0.47350666", "0.47323516", "0.47295752", "0.4728914", "0.47250217", "0.4711689", "0.47065952", "0.4697142", "0.4685684", "0.46806136", "0.46777284", "0.46759397", "0.46748093", "0.4674357", "0.4671002", "0.46614677", "0.46608725", "0.46554774", "0.46535084", "0.46502894", "0.46305892", "0.46146297", "0.46138057", "0.46133864", "0.45922926", "0.45730278", "0.45622686", "0.4557318", "0.45494667", "0.4541211", "0.45294517", "0.45255154", "0.45246065", "0.4510908", "0.45076606", "0.45014566", "0.44852352", "0.44771382", "0.4476435", "0.44673604", "0.44573703", "0.44525036", "0.44398615", "0.44396564", "0.44384313", "0.4428409", "0.44257498" ]
0.69312227
0
Copies inputB to the output: output = inputB
private void passB() { // PROGRAM 1: Student must complete this method //place inputB data into output for (int i = 0; i < output.length; i++) { output[i] = inputB[i]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void copyTo(final T output) {\n output.mGx = mGx;\n output.mGy = mGy;\n output.mGz = mGz;\n }", "private void sub() {\n // PROGRAM 1: Student must complete this method\n // This method must use the addBit method for bitwise subtraction.\n //invert bits of inputB\n for (int i = 0; i < inputB.length; i++) {\n if (!inputB[i]) {\n inputB[i] = true; //set each 0 bit to 1\n } else {\n inputB[i] = false; //set each 1 bit to 0\n }\n }\n adder = addBit(inputA[0], inputB[0], true); //place first iteration of addBit with a carry-in bit into adder.\n output[0] = adder[0]; //place first sum into output[0]\n //loop thru output starting at index 1 since we already computed\n for (int i = 1; i < output.length; i++) {\n cin = adder[1]; // set cin equal to carryout\n adder = addBit(inputA[i], inputB[i], cin); //call addBit with index i of inputA and inputB and cin\n output[i] = adder[0]; //place sum into output[i]\n }\n }", "public abstract B copy();", "void mapFromB(B pSourceObject, A pDestinationObject);", "public void polyMult_flipA(GrowQueue_I8 polyA , GrowQueue_I8 polyB , GrowQueue_I8 output ) {\n\t\toutput.resize(polyA.size+polyB.size-1);\n\t\toutput.zero();\n\n\t\tfor (int j = 0; j < polyB.size; j++) {\n\t\t\tint vb = polyB.data[j]&0xFF;\n\t\t\tfor (int i = 0; i < polyA.size; i++) {\n\t\t\t\tint va = polyA.data[polyA.size-i-1]&0xFF;\n\t\t\t\toutput.data[i+j] ^= multiply(va,vb);\n\t\t\t}\n\t\t}\n\t}", "void mapFromA(A pSourceObject, B pDestinationObject);", "public void setInput(boolean inputA, boolean inputB) {\n mAndGate.setInput(inputA, inputB);\n mXorGate.setInput(inputA, inputB);\n }", "public void copyFrom(final T input) {\n mGx = input.mGx;\n mGy = input.mGy;\n mGz = input.mGz;\n }", "public Object transform(Object input) {\n return input;\n }", "public static void convert( ImageBase input, ImageBase output ) {\n\n\t\tImageType typeIn = input.getImageType();\n\t\tImageType typeOut = output.getImageType();\n\n\t\tif (input instanceof ImageGray) {\n\t\t\tImageGray sb = (ImageGray)input;\n\t\t\tif (output instanceof ImageGray) {\n\t\t\t\tif (input.getClass() == output.getClass()) {\n\t\t\t\t\toutput.setTo(input);\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tMethod m = ConvertImage.class.getMethod(\"convert\", input.getClass(), output.getClass());\n\t\t\t\t\t\tm.invoke(null, input, output);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (output instanceof Planar) {\n\t\t\t\tPlanar ms = (Planar)output;\n\t\t\t\tfor (int i = 0; i < ms.getNumBands(); i++) {\n\t\t\t\t\tconvert(input, ms.getBand(i));\n\t\t\t\t}\n\t\t\t} else if (output instanceof ImageInterleaved) {\n\t\t\t\tImageInterleaved il = (ImageInterleaved)output;\n\t\t\t\tfor (int i = 0; i < il.getNumBands(); i++) {\n\t\t\t\t\tGImageMiscOps.insertBand(sb, i, il);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof ImageInterleaved) {\n\t\t\tif (input.getClass() == output.getClass()) {\n\t\t\t\toutput.setTo(input);\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tMethod m = ConvertImage.class.getMethod(\"convert\", input.getClass(), output.getClass());\n\t\t\t\t\tm.invoke(null, input, output);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof ImageGray) {\n\t\t\tPlanar mi = (Planar)input;\n\t\t\tImageGray so = (ImageGray)output;\n\n\t\t\tif (mi.getImageType().getDataType() != so.getDataType()) {\n\t\t\t\tint w = output.width;\n\t\t\t\tint h = output.height;\n\t\t\t\tImageGray tmp = GeneralizedImageOps.createSingleBand(mi.getImageType().getDataType(), w, h);\n\t\t\t\taverage(mi, tmp);\n\t\t\t\tconvert(tmp, so);\n\t\t\t} else {\n\t\t\t\taverage(mi, so);\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof ImageInterleaved) {\n\t\t\tString functionName;\n\t\t\tif (typeIn.getDataType() == typeOut.getDataType()) {\n\t\t\t\tfunctionName = \"convert\";\n\t\t\t} else {\n\t\t\t\tfunctionName = \"convert\" + typeIn.getDataType() + typeOut.getDataType();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tMethod m = ConvertImage.class.getMethod(functionName, input.getClass(), output.getClass());\n\t\t\t\tm.invoke(null, input, output);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof Planar) {\n\t\t\tPlanar mi = (Planar)input;\n\t\t\tPlanar mo = (Planar)output;\n\n\t\t\tif (mi.getBandType() == mo.getBandType()) {\n\t\t\t\tmo.setTo(mi);\n\t\t\t} else {\n\t\t\t\tfor (int i = 0; i < mi.getNumBands(); i++) {\n\t\t\t\t\tconvert(mi.getBand(i), mo.getBand(i));\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof Planar) {\n\t\t\tString functionName;\n\t\t\tif (typeIn.getDataType() == typeOut.getDataType()) {\n\t\t\t\tfunctionName = \"convert\";\n\t\t\t} else {\n\t\t\t\tfunctionName = \"convert\" + typeIn.getDataType() + typeOut.getDataType();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tMethod m = ConvertImage.class.getMethod(functionName, input.getClass(), output.getClass());\n\t\t\t\tm.invoke(null, input, output);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof ImageGray) {\n\t\t\tImageInterleaved mb = (ImageInterleaved)input;\n\t\t\tImageGray so = (ImageGray)output;\n\n\t\t\tif (mb.getImageType().getDataType() != so.getDataType()) {\n\t\t\t\tint w = output.width;\n\t\t\t\tint h = output.height;\n\t\t\t\tImageGray tmp = GeneralizedImageOps.createSingleBand(mb.getImageType().getDataType(), w, h);\n\t\t\t\taverage(mb, tmp);\n\t\t\t\tconvert(tmp, so);\n\t\t\t} else {\n\t\t\t\taverage(mb, so);\n\t\t\t}\n\t\t} else {\n\t\t\tString nameInput = input.getClass().getSimpleName();\n\t\t\tString nameOutput = output.getClass().getSimpleName();\n\t\t\tthrow new IllegalArgumentException(\"Don't know how to convert between input types. \" + nameInput + \" \" + nameOutput);\n\t\t}\n\t}", "public void polyAdd_S(GrowQueue_I8 polyA , GrowQueue_I8 polyB , GrowQueue_I8 output ) {\n\t\toutput.resize(Math.max(polyA.size,polyB.size));\n\t\tint M = Math.min(polyA.size, polyB.size);\n\n\t\tfor (int i = M; i < polyA.size; i++) {\n\t\t\toutput.data[i] = polyA.data[i];\n\t\t}\n\t\tfor (int i = M; i < polyB.size; i++) {\n\t\t\toutput.data[i] = polyB.data[i];\n\t\t}\n\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\toutput.data[i] = (byte)((polyA.data[i]&0xFF) ^ (polyB.data[i]&0xFF));\n\t\t}\n\t}", "public void polyAddScaleB(GrowQueue_I8 polyA , GrowQueue_I8 polyB , int scaleB , GrowQueue_I8 output ) {\n\t\toutput.resize(Math.max(polyA.size,polyB.size));\n\n\t\t// compute offset that would align the smaller polynomial with the larger polynomial\n\t\tint offsetA = Math.max(0,polyB.size-polyA.size);\n\t\tint offsetB = Math.max(0,polyA.size-polyB.size);\n\t\tint N = output.size;\n\n\t\tfor (int i = 0; i < offsetB; i++) {\n\t\t\toutput.data[i] = polyA.data[i];\n\t\t}\n\t\tfor (int i = 0; i < offsetA; i++) {\n\t\t\toutput.data[i] = (byte)multiply(polyB.data[i]&0xFF,scaleB);\n\t\t}\n\t\tfor (int i = Math.max(offsetA,offsetB); i < N; i++) {\n\t\t\toutput.data[i] = (byte)((polyA.data[i-offsetA]&0xFF) ^ multiply(polyB.data[i-offsetB]&0xFF,scaleB));\n\t\t}\n\t}", "TOutput MapFrom(TInput input);", "private void copyOp(Scanner input) {\n\t\tprogramStack.add(\"copy\");\n\n\t\twhile (input.hasNext()){\n\t\t\tString token = input.next();\n\t\t\tif(token.equalsIgnoreCase(\"add\"))\n\t\t\t\taddOp(input);\n\t\t\telse\n\t\t\t\tprogramStack.push(token);\n\t\t}\n\n\t\twhile (!programStack.peek().equalsIgnoreCase(\"copy\")){\n\t\t\tString tokenToAdd = programStack.pop();\n\t\t\tint valueToAddRam;\n\t\t\tif(isVariable(tokenToAdd))\n\t\t\t\tvalueToAddRam = getRAMValue(tokenToAdd);\n\t\t\telse\n\t\t\t\tvalueToAddRam = Integer.parseInt(tokenToAdd);\n\n\t\t\tString memLocal = programStack.pop();\n\t\t\tputVariable(memLocal, valueToAddRam);\n\t\t}\n\n\t\tprogramStack.pop();\n\t}", "public abstract void copy(Result result, Object object);", "Buffer copy();", "@Override\r\n\tpublic ANNLayer copy() {\n\t\tFullyConnectedLayer output = new FullyConnectedLayer(); \r\n\t\toutput.inputWeight = this.inputWeight.copy(); \r\n\t\toutput.fout = this.fout; \r\n\t\toutput.set = this.set; \r\n\t\treturn output; \r\n\t}", "public void polyMult(GrowQueue_I8 polyA , GrowQueue_I8 polyB , GrowQueue_I8 output ) {\n\n\t\t// Lots of room for efficiency improvements in this function\n\t\toutput.resize(polyA.size+polyB.size-1);\n\t\toutput.zero();\n\n\t\tfor (int j = 0; j < polyB.size; j++) {\n\t\t\tint vb = polyB.data[j]&0xFF;\n\t\t\tfor (int i = 0; i < polyA.size; i++) {\n\t\t\t\tint va = polyA.data[i]&0xFF;\n\t\t\t\toutput.data[i+j] ^= multiply(va,vb);\n\t\t\t}\n\t\t}\n\t}", "public int process(Buffer in, Buffer out) {\n\t\t\taccessFrame(in);\r\n\r\n\t\t\t// Swap the data between the input & output.\r\n\t\t\tObject data = in.getData();\r\n\t\t\tin.setData(out.getData());\r\n\t\t\tout.setData(data);\r\n\r\n\t\t\t// Copy the input attributes to the output\r\n\t\t\tout.setFormat(in.getFormat());\r\n\t\t\tout.setLength(in.getLength());\r\n\t\t\tout.setOffset(in.getOffset());\r\n\r\n\t\t\treturn BUFFER_PROCESSED_OK;\r\n\t\t}", "public void polyAdd(GrowQueue_I8 polyA , GrowQueue_I8 polyB , GrowQueue_I8 output ) {\n\t\toutput.resize(Math.max(polyA.size,polyB.size));\n\n\t\t// compute offset that would align the smaller polynomial with the larger polynomial\n\t\tint offsetA = Math.max(0,polyB.size-polyA.size);\n\t\tint offsetB = Math.max(0,polyA.size-polyB.size);\n\t\tint N = output.size;\n\n\t\tfor (int i = 0; i < offsetB; i++) {\n\t\t\toutput.data[i] = polyA.data[i];\n\t\t}\n\t\tfor (int i = 0; i < offsetA; i++) {\n\t\t\toutput.data[i] = polyB.data[i];\n\t\t}\n\t\tfor (int i = Math.max(offsetA,offsetB); i < N; i++) {\n\t\t\toutput.data[i] = (byte)((polyA.data[i-offsetA]&0xFF) ^ (polyB.data[i-offsetB]&0xFF));\n\t\t}\n\t}", "Prototype makeCopy();", "public void copy() {\n\n\t}", "C map(A first, B second);", "private static void copyRemainder(ArrayList<Integer> inputList, int inputIndex, ArrayList<Integer> outList, int outIndex) {\n while (inputIndex < inputList.size()) {\n outList.set(outIndex, inputList.get(inputIndex));\n\n inputIndex++;\n outIndex++;\n }\n }", "public void setInputB(boolean[] b) {\n // PROGRAM 1: Student must complete this method\n //if param array != INT_LENGTH, throw exception\n if (b.length != INT_LENGTH) {\n throw new IllegalArgumentException(\"Invalid array length\");\n } else {\n //otherwise, place the parameter array's data into inputB\n for (int i = 0; i < b.length; i++) {\n inputB[i] = b[i];\n }\n }\n }", "public void setInputA(boolean[] b) {\n // PROGRAM 1: Student must complete this method\n //if param array != INT_LENGTH, throw exception\n if (b.length != INT_LENGTH) {\n throw new IllegalArgumentException(\"Invalid array length\");\n } else {\n //otherwise, place the parameter array's data into inputA\n for (int i = 0; i < b.length; i++) {\n inputA[i] = b[i];\n }\n }\n }", "public abstract INodo copy();", "@Override\n\tpublic DataType copy() throws BugTrap {\n\t\tInputFile file = new InputFile(this.pathName);\n\t\tfile.value = this.value;\n\t\treturn file;\n\t}", "T copy();", "@Override\n public INDArray copy(INDArray x, INDArray y) {\n //NativeBlas.dcopy(x.length(), x.data(), 0, 1, y.data(), 0, 1);\n JavaBlas.rcopy(x.length(), x.data(), x.offset(), 1, y.data(), y.offset(), 1);\n return y;\n }", "public void movB(){\r\n\t\tint aux1[][]= new int [3][1];\r\n\t\tint aux2[][]= new int [3][1];\r\n\t\tint aux3[][]= new int [3][1];\r\n\t\tint aux4[][]= new int [3][1];\r\n\t\t\r\n\t\taux1=this.cloneF(5, 2);//copiamos el del bloque 5 la fila 3\r\n\t\taux2=this.cloneC(2, 2);\r\n\t\taux3=this.cloneF(4, 0);\r\n\t\taux4=this.cloneC(0, 0);\r\n\t\t\r\n\t\tthis.copiaEnFilaUnaColumna(aux4, 5, 2);\r\n\t\tthis.copiaEnColumnaUnaFila(aux1, 2, 2);\r\n\t\tthis.copiaEnFilaUnaColumna(aux2, 4, 0);\r\n\t\tthis.copiaEnColumnaUnaFila(aux3, 0, 0);\r\n\t\t\r\n\t\t\r\n\t}", "public abstract int process(Buffer input, Buffer output);", "public abstract void outputComplementBmp(FastStringBuffer buf);", "@Override\n\tprotected void copy(Object source, Object dest) {\n\t\t\n\t}", "@Test\n public void testTransform2() {\n InputStream standardIn = System.in;\n PrintStream standardOut = System.out;\n try {\n // setup new input\n System.setIn(new ByteArrayInputStream(DECODED_INPUT2.getBytes()));\n // create new output stream as byte array and assign to standard\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n System.setOut(new PrintStream(baos));\n\n BurrowsWheeler.transform();\n byte[] encoded = baos.toByteArray();\n assertEquals(ENCODED_INPUT2.length, encoded.length);\n for (int i = 0; i < encoded.length; i++) {\n assertEquals(ENCODED_INPUT2[i], encoded[i]);\n }\n } finally {\n // return standard input and output\n System.setIn(standardIn);\n System.setOut(standardOut);\n }\n }", "OUT apply( IN in );", "public static void copy(InputStream input, OutputStream output) throws IOException {\n try {\n byte[] buffer = new byte[GCSFetcher.BUFFER_SIZE];\n int bytesRead = input.read(buffer);\n while (bytesRead != -1) {\n output.write(buffer, 0, bytesRead);\n bytesRead = input.read(buffer);\n }\n } finally {\n input.close();\n output.close();\n }\n }", "WorkoutBatch copy();", "public int[] swapTwoBit(int[] input) {\n input[0] = input[0] ^ input[1];\n input[1] = input[0] ^ input[1];\n input[0] = input[0] ^ input[1];\n return input;\n }", "public numero(numero input)\n {\n input.copy(this);\n }", "public interface Transform<INPUT, OUTPUT> {\n\n\tOUTPUT transform(INPUT input);\n\t\n}", "public void setInput(byte[] input) {\n this.input = input;\n }", "protected abstract void useOutput(float output, float setpoint);", "public static void copy(InputStream input, OutputStream output, int bufferSize) throws IOException {\n bufferSize = Math.max(Math.min(MAX_BUFFER_SIZE, bufferSize), MIN_BUFFER_SIZE);\n try(InputStream in = get(input); OutputStream out = get(output)) {\n byte[] buf = new byte[bufferSize];\n int r;\n while((r = in.read(buf)) != -1) {\n out.write(buf, 0, r);\n }\n }\n }", "private void add() {\n // PROGRAM 1: Student must complete this method\n // This method must use the addBit method for bitwise addition.\n adder = addBit(inputA[0],inputB[0], false); //begin adding, no carry in\n output[0] = adder[0]; //place sum of first addBit iteration into output[0]\n //loop thru output beginning at index 1 (since we already computed index 0)\n for (int i = 1; i < output.length; i++) {\n cin = adder[1]; //set carry-out bit of addBit() iteration to cin\n adder = addBit(inputA[i], inputB[i], cin); //call addBit with index i of inputA and inputB and cin and place into adder.\n output[i] = adder[0]; //place sum into output[i]\n }\n }", "public IInputOutput getConstantOuput();", "public static Note getB() {return (Note)B.clone();}", "static void setCopying(){isCopying=true;}", "public Individual crossover(Individual parentB)\r\n\t{\r\n\t\tIndividual ind = new Individual(intSize, intCount, signedInt);\r\n\r\n\t\t// Copy over genes randomly\r\n\t\tfor (int i = 0; i < binary.length; i++)\r\n\t\t{\r\n\t\t\tboolean parentA = Math.random() >= 0.5;\r\n\t\t\tind.binary[i] = parentA ? binary[i] : parentB.binary[i];\r\n\t\t}\r\n\r\n\t\treturn ind;\r\n\t}", "BOperation createBOperation();", "BSubstitution createBSubstitution();", "private void and() {\n // PROGRAM 1: Student must complete this method\n //loop through the output array\n for (int i = 0; i < output.length; i++) {\n //take the and of index i of inputA and inputB and place result in output[i]\n output[i] = inputA[i] & inputB[i];\n }\n }", "private void internalCopy(Board b) {\n for (int i = 0; i < SIDE * SIDE; i += 1) {\n set(i, b.get(i));\n }\n\n _directions = b._directions;\n _whoseMove = b._whoseMove;\n _history = b._history;\n }", "private static void copyP(final float[][] x, final float[][] y) {\n final int n1 = x[0].length;\n final int n2 = x.length;\n Parallel.loop(n2,new Parallel.LoopInt() {\n public void compute(int i2) {\n for (int i1 = 0; i1<n1; ++i1) \n y[i2][i1] = x[i2][i1];\n }\n });\n }", "protected void flowThrough(Object inValue, Object unit, Object outValue) {\n\t\tFlowSet in = (FlowSet) inValue, out = (FlowSet) outValue;\n\n\t\t// perform generation (kill set is empty)\n\t\tin.union(unitToGenerateSet.get(unit), out);\n\t}", "private ArrayList<Double> reverseInputBranch(ArrayList<Double> inputBranchArray)\r\n\t{\r\n\t\tArrayList<Double> reversedArray = new ArrayList<Double>();\r\n\r\n\t\tfor (int i = 0; i < inputBranchArray.size(); i++) {\r\n\t\t\treversedArray.add(inputBranchArray.get(inputBranchArray.size() - 1 - i));\r\n\t\t}\r\n\r\n\t\tinputIsFlipped = true;\r\n\t\treturn reversedArray;\r\n\t}", "@Override\n\tprotected void merge(Object in1, Object in2, Object out) {\n\t\t\n\t}", "Model copy();", "public JCoresScript io(Input _input, Output _output) {\n this.input = _input;\n this.output = _output;\n return this;\n }", "@Override\n public void testTransform() {\n BinaryStringStringPipe b1 = randomInstance();\n Expression newExpression = randomValueOtherThan(b1.expression(), () -> randomBinaryStringStringExpression());\n BinaryStringStringPipe newB = new BinaryStringStringPipe(\n b1.source(),\n newExpression,\n b1.left(),\n b1.right(),\n b1.operation());\n assertEquals(newB, b1.transformPropertiesOnly(v -> Objects.equals(v, b1.expression()) ? newExpression : v, Expression.class));\n \n BinaryStringStringPipe b2 = randomInstance();\n Source newLoc = randomValueOtherThan(b2.source(), () -> randomSource());\n newB = new BinaryStringStringPipe(\n newLoc,\n b2.expression(),\n b2.left(),\n b2.right(),\n b2.operation());\n assertEquals(newB,\n b2.transformPropertiesOnly(v -> Objects.equals(v, b2.source()) ? newLoc : v, Source.class));\n }", "public void setInput(Input input) {\n this.input = input;\n }", "FillTheCorral(OutputInterface out) {\n mOut = out;\n }", "private void collate(Integer[] output) {\n System.out.println(\"data start\");\n Optional.ofNullable(output).ifPresent((d)-> Arrays.stream(output).forEach((d1)-> System.out.println(d1)));\n System.out.println(\"data end\");\n }", "void setInput(com.indosat.eai.catalist.standardInputOutput.DummyInputType input);", "public abstract CTxDestination clone();", "void copyToBranch(ID sourceBranchId, ID targetBranchId);", "private void process(ByteBuffer output, final byte[] input, int inPos, KeyStream keyStream) {\n ByteBuffer buf = ByteBuffer.allocate(BLOCK_SIZE_IN_BYTES).order(ByteOrder.LITTLE_ENDIAN);\n int pos = inPos;\n int inLen = input.length - inPos;\n int todo;\n while (inLen > 0) {\n todo = inLen < BLOCK_SIZE_IN_BYTES ? inLen : BLOCK_SIZE_IN_BYTES;\n buf.asIntBuffer().put(keyStream.next());\n for (int j = 0; j < todo; j++, pos++) {\n output.put((byte) (input[pos] ^ buf.get(j)));\n }\n inLen -= todo;\n }\n }", "public boolean assginOutputWithVariableValue(String variableName, String outputElementName, TOSCAPlan buildPlan) {\n\t\tBPELProcessHandler.LOG.debug(\n\t\t\t\t\"Trying to add copy from variable {} to element {} of OutputMessage of BuildPlan {}\", variableName,\n\t\t\t\toutputElementName, buildPlan.getBpelProcessElement().getAttribute(\"name\"));\n\t\tElement outputAssignElement = buildPlan.getBpelMainSequenceOutputAssignElement();\n\t\t// create copy elements\n\t\tElement copyElement = buildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"copy\");\n\t\tElement fromElement = buildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"from\");\n\t\tElement toElement = buildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"to\");\n\t\tElement queryElement = buildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"query\");\n\t\tCDATASection cdataSection = buildPlan.getBpelDocument().createCDATASection(\"tns:\" + outputElementName);\n\n\t\t// set attributes\n\t\tfromElement.setAttribute(\"variable\", variableName);\n\t\ttoElement.setAttribute(\"variable\", \"output\");\n\t\ttoElement.setAttribute(\"part\", \"payload\");\n\n\t\t// set query element\n\t\t// e.g. <bpel:query\n\t\t// queryLanguage=\"urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0\"><![CDATA[tns:ami]]></bpel:query>\n\t\tqueryElement.setAttribute(\"queryLanguage\", \"urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0\");\n\t\tqueryElement.appendChild(cdataSection);\n\n\t\t// set everything together\n\t\ttoElement.appendChild(queryElement);\n\t\tcopyElement.appendChild(fromElement);\n\t\tcopyElement.appendChild(toElement);\n\t\toutputAssignElement.appendChild(copyElement);\n\t\tBPELProcessHandler.LOG.debug(\"Adding copy was successful\");\n\t\treturn true;\n\t}", "public Object transform(Object input) {\n if (input == null) {\n return null;\n }\n try {\n return FactoryUtils.prototypeFactory(input).create();\n\n } catch (IllegalArgumentException ex) {\n throw new TransformerException(\"CloneTransformer\", ex);\n } catch (FactoryException ex) {\n throw new TransformerException(\"CloneTransformer\", ex);\n }\n }", "private void aretes_aB(){\n\t\tthis.cube[22] = this.cube[12]; \n\t\tthis.cube[12] = this.cube[48];\n\t\tthis.cube[48] = this.cube[39];\n\t\tthis.cube[39] = this.cube[3];\n\t\tthis.cube[3] = this.cube[22];\n\t}", "private RootBlock copy(RootBlock sourceRootBlock) {\n\t\tCopier copier = new Copier(true);\n\t\tRootBlock result = (RootBlock) copier.copy(sourceRootBlock);\n\t\tcopier.copyReferences();\n\t\treturn result;\n\t}", "public Object transform(Object input) {\n return iMap.get(input);\n }", "@Override\r\npublic void setNumcopy(int numcopy) {\n\tsuper.setNumcopy(numcopy);\r\n}", "public void b(ahb paramahb)\r\n/* 583: */ {\r\n/* 584:625 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 585:626 */ this.a[i] = amj.b(paramahb.a[i]);\r\n/* 586: */ }\r\n/* 587:628 */ for (i = 0; i < this.b.length; i++) {\r\n/* 588:629 */ this.b[i] = amj.b(paramahb.b[i]);\r\n/* 589: */ }\r\n/* 590:631 */ this.c = paramahb.c;\r\n/* 591: */ }", "public abstract void useOutput(double output);", "public abstract void useOutput(double output);", "public <INPUT, OUTPUT> OUTPUT run(INPUT input) throws Exception {\n return run(null, input);\n }", "public void generateB(){\n\t\t\tfor(int i = 0;i < w.length;i++){\n\t\t\t\tb[i] = w[i].multiply(r).mod(q);\n\t\t\t}\n\t}", "public void copy(double a[], double b[]) {\n System.arraycopy(b, 0, a, 0, dimension);\n }", "public static final void transcodeAndFill(byte[] input, byte[] output,\r\n int offset, int length, int input_encoding, int output_encoding)\r\n throws TranscodeException {\r\n //int len = 0;\r\n int k = offset;\r\n int c, i = 0;\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 i = encode(output, i, c, output_encoding);\r\n }\r\n }", "public abstract Object getOutput ();", "private static void craft2by2(ItemStack input, ItemStack output)\r\n\t{\r\n\t\tGameRegistry.addRecipe(output, new Object[] { \"##\", \"##\", '#', input });\r\n\t}", "Transform<A, B> getTransform();", "protected void copy(Writable other) {\n\t\tif (other != null) {\n\t\t\ttry {\n\t\t\t\tDataOutputBuffer out = new DataOutputBuffer();\n\t\t\t\tother.write(out);\n\t\t\t\tDataInputBuffer in = new DataInputBuffer();\n\t\t\t\tin.reset(out.getData(), out.getLength());\n\t\t\t\treadFields(in);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new IllegalArgumentException(\"map cannot be copied: \" +\n\t\t\t\t\t\te.getMessage());\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new IllegalArgumentException(\"source map cannot be null\");\n\t\t}\n\t}", "@Override\n\tpublic void pipeOutput() {\n\n\t}", "public abstract Node copy();", "public void swap() {\n if (capturing) {\n bufDst.end();\n }\n\n // Swap buffers\n if (writeState) {\n bufSrc = buffer1;\n bufDst = buffer2;\n } else {\n bufSrc = buffer2;\n bufDst = buffer1;\n }\n\n if (capturing) {\n bufDst.begin();\n }\n\n writeState = !writeState;\n }", "public abstract SoftwareLight copy();", "public void copy(Object destination, Object source)\n\t\tthrows TransformationException;", "@Override\n\tprotected void flowThrough(Object in, Object d, Object out) {\n\t\t\n\t}", "public CMObject copyOf();", "private void copy(int numBytes) {\n for (int i = 0; i < numBytes; i++) {\n dest[destPos + i] = src[srcPos + i];\n }\n srcPos += numBytes;\n destPos += numBytes;\n }", "public CachedBinarization(final TernaryOutputNeuron originalNeuron, final List<byte[]> input,\n\t\t\tList<byte[]> referenceInput) {\n\t\tif (referenceInput == null) {\n\t\t\treferenceInput = input;\n\t\t}\n\t\tthis.inputSize = input.size();\n\t\tthis.originalNeuronOutput = new TernaryProbDistrib[referenceInput.size()];\n\t\tfor (int i = 0; i < referenceInput.size(); i++) {\n\t\t\tthis.originalNeuronOutput[i] = originalNeuron.getOutputProbs(referenceInput.get(i));\n\t\t}\n\t\tList<Integer> posWeightsIndex = new ArrayList<>(originalNeuron.getWeights().length);\n\t\tList<Integer> negWeightsIndex = new ArrayList<>(originalNeuron.getWeights().length);\n\t\tfor (int i = 0; i < originalNeuron.getWeights().length; i++) {\n\t\t\tif (originalNeuron.getWeightSign(i) > 0) {\n\t\t\t\tposWeightsIndex.add(i);\n\t\t\t} else if (originalNeuron.getWeightSign(i) < 0) {\n\t\t\t\tnegWeightsIndex.add(i);\n\t\t\t}\n\t\t}\n\t\tif (posWeightsIndex.isEmpty() || negWeightsIndex.isEmpty()) {\n\t\t\tthrow new RuntimeException(\"cannot force pos/neg tw if all weights are positive or negative\");\n\t\t} else {\n\t\t\tCollections.sort(posWeightsIndex, new Comparator<Integer>() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic int compare(Integer o1, Integer o2) {\n\t\t\t\t\tDouble d1 = originalNeuron.getWeights()[o1];\n\t\t\t\t\tDouble d2 = originalNeuron.getWeights()[o2];\n\t\t\t\t\tint ret = d2.compareTo(d1);\n\t\t\t\t\tif (ret != 0) {\n\t\t\t\t\t\treturn ret;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn o1.compareTo(o2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tCollections.sort(negWeightsIndex, new Comparator<Integer>() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic int compare(Integer o1, Integer o2) {\n\t\t\t\t\tDouble d1 = Math.abs(originalNeuron.getWeights()[o1]);\n\t\t\t\t\tDouble d2 = Math.abs(originalNeuron.getWeights()[o2]);\n\t\t\t\t\tint ret = d2.compareTo(d1);\n\t\t\t\t\tif (ret != 0) {\n\t\t\t\t\t\treturn ret;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn o1.compareTo(o2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.posSums = new short[posWeightsIndex.size()][inputSize];\n\t\t\tthis.negSums = new short[negWeightsIndex.size()][inputSize];\n\t\t\tshort tmpMaxSumPos = 0;\n\t\t\tshort tmpMinSumPos = 0;\n\t\t\tshort tmpMaxSumNeg = 0;\n\t\t\tshort tmpMinSumNeg = 0;\n\t\t\tfor (int sampleIndex = 0; sampleIndex < inputSize; sampleIndex++) {\n\t\t\t\tbyte[] sample = input.get(sampleIndex);\n\t\t\t\tshort sum = 0;\n\t\t\t\tIterator<Integer> indexIter = posWeightsIndex.iterator();\n\t\t\t\tfor (int i = 0; indexIter.hasNext(); i++) {\n\t\t\t\t\tsum += sample[indexIter.next()];\n\t\t\t\t\tif (sum > tmpMaxSumPos) {\n\t\t\t\t\t\ttmpMaxSumPos = sum;\n\t\t\t\t\t}\n\t\t\t\t\tif (sum < tmpMinSumPos) {\n\t\t\t\t\t\ttmpMinSumPos = sum;\n\t\t\t\t\t}\n\t\t\t\t\t// tmpMaxSumPos = Math.max(tmpMaxSumPos, sum);\n\t\t\t\t\t// tmpMinSumPos = Math.min(tmpMinSumPos, sum);\n\t\t\t\t\tthis.posSums[i][sampleIndex] = sum;\n\t\t\t\t}\n\t\t\t\tsum = 0;\n\t\t\t\tindexIter = negWeightsIndex.iterator();\n\t\t\t\tfor (int i = 0; indexIter.hasNext(); i++) {\n\t\t\t\t\tsum -= sample[indexIter.next()];\n\t\t\t\t\tif (sum > tmpMaxSumNeg) {\n\t\t\t\t\t\ttmpMaxSumNeg = sum;\n\t\t\t\t\t}\n\t\t\t\t\tif (sum < tmpMinSumNeg) {\n\t\t\t\t\t\ttmpMinSumNeg = sum;\n\t\t\t\t\t}\n\t\t\t\t\t// tmpMaxSumNeg = Math.max(tmpMaxSumNeg, sum);\n\t\t\t\t\t// tmpMinSumNeg = Math.min(tmpMinSumNeg, sum);\n\t\t\t\t\tthis.negSums[i][sampleIndex] = sum;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.maxSum = (short) (tmpMaxSumPos + tmpMaxSumNeg);\n\t\t\tthis.minSum = (short) (tmpMinSumPos + tmpMinSumNeg);\n\t\t}\n\t}", "@Override\n\tpublic void setInput(Input arg0) {\n\t\t\n\t}", "@Override\n\tpublic void setInput(Input arg0) {\n\n\t}", "public static void copyInputToOutput(\n InputStream input,\n OutputStream output,\n long byteCount)\n throws IOException {\n int bytes;\n long length;\n \n BufferedInputStream in = new BufferedInputStream(input);\n BufferedOutputStream out = new BufferedOutputStream(output);\n \n byte[] buffer;\n buffer = new byte[8192];\n \n for (length = byteCount; length > 0;) {\n bytes = (int) (length > 8192 ? 8192 : length);\n \n try {\n bytes = in.read(buffer, 0, bytes);\n } catch (IOException ex) {\n try {\n in.close();\n out.close();\n } catch (IOException ex1) {\n }\n throw new IOException(\n \"Reading input stream, \" + ex.getMessage());\n }\n \n if (bytes < 0)\n break;\n \n length -= bytes;\n \n try {\n out.write(buffer, 0, bytes);\n } catch (IOException ex) {\n try {\n in.close();\n out.close();\n } catch (IOException ex1) {\n }\n throw new IOException(\n \"Writing output stream, \" + ex.getMessage());\n }\n }\n \n try {\n in.close();\n out.close();\n } catch (IOException ex) {\n throw new IOException(\"Closing file streams, \" + ex.getMessage());\n }\n }", "B getResult();", "public Object cloner() {\n return cloner((Sommet)origine.cloner(), (Sommet)destination.cloner());\n }", "Object visit(CopyInstr ir) {\n ir._out.accept(this);\n ir._in.accept(this);\n return null;\n }", "public void readAndWrite() {\n Scanner scanner = new Scanner(System.in);\n String s = scanner.nextLine();\n List<String> passedFiles = new ArrayList<>();\n copy(new File(s), true, passedFiles);\n\n }" ]
[ "0.62099713", "0.5911273", "0.57216614", "0.5659482", "0.55755025", "0.54079664", "0.53547984", "0.5306769", "0.52683413", "0.52357703", "0.52145714", "0.5175577", "0.5166129", "0.5116936", "0.5111447", "0.50821763", "0.5079865", "0.5051311", "0.50469923", "0.5028491", "0.49962583", "0.49944037", "0.49869582", "0.49773622", "0.49504793", "0.49468455", "0.49444503", "0.4931302", "0.4857222", "0.48446184", "0.4842519", "0.4836284", "0.48184633", "0.48095846", "0.48037946", "0.47979754", "0.47924373", "0.47615746", "0.47413868", "0.4725177", "0.47171375", "0.47163993", "0.46982676", "0.4694163", "0.46916497", "0.46781117", "0.4667406", "0.46666056", "0.46597233", "0.46538687", "0.46533683", "0.46376374", "0.46335706", "0.46209008", "0.46171212", "0.46097544", "0.4606156", "0.4596043", "0.45937404", "0.45891657", "0.458283", "0.4568077", "0.4556256", "0.45455477", "0.45450753", "0.4540352", "0.45378864", "0.45304406", "0.45189473", "0.45015192", "0.44991314", "0.44774395", "0.4468616", "0.44635338", "0.44610372", "0.44610372", "0.44592044", "0.44588602", "0.44553512", "0.4454144", "0.44429618", "0.4442269", "0.44353056", "0.44334072", "0.44273117", "0.44243956", "0.44229278", "0.4421762", "0.4420315", "0.44176856", "0.441708", "0.4413865", "0.44128764", "0.4411782", "0.4409789", "0.4407308", "0.44072592", "0.44058788", "0.4399202", "0.4394898" ]
0.74751896
0
Simulates a 1bit adder.
private boolean[] addBit(boolean a, boolean b, boolean c) { // PROGRAM 1: Student must complete this method // This method may only use the Java logic operations && (logical and), // || (logical or), and ! (logical not). Do not use any Java arithmetic // operators in this method. boolean[] result = new boolean[2]; result[0] = (a ^ b) ^ c; // (a xor b) xor c -> yields the sum result[1] = (a && b) || (a ^ b) && c; // (a and b) or (a xor b) and c -> yields the carry-out // return value is a placeholder, student should replace with correct return return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static int addOne(int[] a, int offset, int mlen, int carry) {\n offset = a.length-1-mlen-offset;\n long t = (a[offset] & LONG_MASK) + (carry & LONG_MASK);\n\n a[offset] = (int)t;\n if ((t >>> 32) == 0)\n return 0;\n while (--mlen >= 0) {\n if (--offset < 0) { // Carry out of number\n return 1;\n } else {\n a[offset]++;\n if (a[offset] != 0)\n return 0;\n }\n }\n return 1;\n }", "private void add() {\n // PROGRAM 1: Student must complete this method\n // This method must use the addBit method for bitwise addition.\n adder = addBit(inputA[0],inputB[0], false); //begin adding, no carry in\n output[0] = adder[0]; //place sum of first addBit iteration into output[0]\n //loop thru output beginning at index 1 (since we already computed index 0)\n for (int i = 1; i < output.length; i++) {\n cin = adder[1]; //set carry-out bit of addBit() iteration to cin\n adder = addBit(inputA[i], inputB[i], cin); //call addBit with index i of inputA and inputB and cin and place into adder.\n output[i] = adder[0]; //place sum into output[i]\n }\n }", "SimulatedAnnealing() {\n generator = new Random(System.currentTimeMillis());\n }", "private static void calc1(int x) {\n\t\tx+=1;\n\t}", "@Override\n public Z computeNext() {\n int n = size();\n if (n <= 2) {\n return Z.valueOf(mInits[n]);\n }\n final int pow2 = Integer.highestOneBit(n);\n final int j = n - pow2;\n Z result = a(j).multiply(mFaj0).add(a(j + 1).multiply(mFaj1));\n if (j == pow2 - 1) {\n result = result.add(1);\n }\n return result;\n \n }", "private void Perform_ADC()\n {\n d = Utils.GetOperand_XXXXXXX11111XXXX(mMBR);\n r = Utils.GetOperand_XXXXXX1XXXXX1111(mMBR);\n\n dvalue = get_reg(d);\n rvalue = get_reg(r);\n result = dvalue + rvalue;\n if (get_cflag()) result+=1;\n\n set_hflag(CarryFromBit3(dvalue, rvalue, result));\n set_nflag(Utils.bit7(result));\n set_vflag(Overflow(dvalue, rvalue, result));\n set_sflag(get_nflag() ^ get_vflag());\n set_zflag(result == 0);\n set_cflag(CarryFromResult(dvalue, rvalue, result));\n\n try {set_reg(d,result); }\n catch (RuntimeException e) { }\n\n return;\n }", "private int plusOne(int i) {\n return (i + 1) % capacity;\n }", "public static void plus1(int[]arr)\r\n\t{\r\n\t\tint i=arr.length-1;\r\n\t\twhile(i>=0&&arr[i]==1)\r\n\t\t\tarr[i--]=0;\r\n\t\tif(i>=0)\r\n\t\t\tarr[i]=1;\r\n\t}", "public void increase() {\r\n\r\n\t\tincrease(1);\r\n\r\n\t}", "void increase();", "void increase();", "public void add1() {\r\n value++;\r\n }", "int next(int bits);", "int calculate() {\n return getSum() + b1;\n }", "public int step() {\n ArrayList<Integer> copy = new ArrayList<Integer>();\n for (int i = 1; i < register.size(); i++) { \n copy.add(register.get(i));\n }\n int tapNum = register.get(register.size()-tap-1);\n int begin = register.get(0);\n if (tapNum == 1 ^ begin == 1) {\n copy.add(1);\n }\n else {\n copy.add(0);\n }\n register.clear();\n register.addAll(copy);\n return register.get(register.size()-1);\n }", "One(){\n data = new int[DEFAULT_CAPACITY];\n }", "private DoubleMatrix1D nextSignal() {\n int i = PersistentRandomUtil.getInstance().nextInt(data.rows());\n numSignalsGenerated++;\n return data.viewRow(i);\n }", "public int incExtern(final int op1) {\n\t\tAdder adder = Adder.newAdder8();\n\t\tint result = adder.add(op1, 1, 0);\n\t\tsetIncrementFlags(adder, result);\n\t\treturn result;\n\t}", "public void increment() {\n increment(1);\n }", "public void inc() {\n inc(1);\n }", "public Binary suma1(){\n\n java.lang.String tosum1to;\n if (!this.toString().equals(\"0\")){\n if (java.lang.String.valueOf(this.getValue().charAt(0)).equals(\"1\") && java.lang.String.valueOf(this.getValue().charAt(1)).equals(\"1\")){\n tosum1to= this.toString().substring(1);\n }\n else {\n tosum1to= this.toString();\n }\n }\n else {\n tosum1to= this.toString();\n }\n int sumlength= tosum1to.length();\n java.lang.String retstring= \"\";\n int i=1;\n for (; i<= sumlength; i++){\n if (java.lang.String.valueOf(tosum1to.charAt(sumlength - i)).equals(\"1\")) {\n retstring+= \"0\";\n }\n else {\n retstring+= \"1\";\n i++;\n break;\n }\n }\n for (; i<= sumlength; i++){\n retstring+= java.lang.String.valueOf(tosum1to.charAt(sumlength-i));\n }\n if (this.sign().equals(\"0\") && java.lang.String.valueOf(retstring.charAt(sumlength-1)).equals(\"1\")) {\n retstring+= \"0\";\n }\n return new Binary(reverse(retstring));\n }", "public void IncrementCounter()\r\n {\r\n \tsetCurrentValue( currentValue.add(BigInteger.ONE)); \r\n \r\n log.debug(\"counter now: \" + currentValue.intValue() );\r\n \r\n }", "private void coins_a1G(){\n\t\tthis.cube[31] = this.cube[17]; \n\t\tthis.cube[17] = this.cube[8];\n\t\tthis.cube[8] = this.cube[44];\n\t\tthis.cube[44] = this.cube[53];\n\t\tthis.cube[53] = this.cube[31];\n\t}", "public int countOnes(int[] a) {\n int tot = 0;\n for (int i=0; i<a.length; i++) {\n tot += a[i];\n }\n return tot;\n }", "void addRepeat(int beatNum, RepeatType repeatType);", "private static int gainIntelligence(int intelligence){\r\n intelligence++;\r\n System.out.println(\"You gain 1 intelligence\");\r\n return intelligence;\r\n }", "public Add128(){\n key = new byte[128];\n Random rand = new Random();\n rand.nextBytes(key);\n }", "private int[] inc(int[] a)\n {\n int tI = a.length - 1;\n long m = 0;\n\n m = (((long)a[tI]) & IMASK) + 1L;\n a[tI--] = (int)m;\n m >>>= 32;\n\n while (tI >= 0 && m != 0)\n {\n m += (((long)a[tI]) & IMASK);\n a[tI--] = (int)m;\n m >>>= 32;\n }\n\n return a;\n }", "private int[] inc(int[] a)\n {\n int tI = a.length - 1;\n long m = 0;\n\n m = (((long)a[tI]) & IMASK) + 1L;\n a[tI--] = (int)m;\n m >>>= 32;\n\n while (tI >= 0 && m != 0)\n {\n m += (((long)a[tI]) & IMASK);\n a[tI--] = (int)m;\n m >>>= 32;\n }\n\n return a;\n }", "public static int addOne( int a){\n int b;\n //System.out.println(b+1);\n return a += 1;\n}", "static int incBy1AndMul(int x, int y)\r\n\t{\r\n\t\treturn Math.multiplyExact((x+1), y);\r\n\t}", "@Test\r\n public void test1() {\r\n Assert.assertEquals(addBinary(2, 4), 6);\r\n Assert.assertEquals(addBinary(3, 6), 9);\r\n Assert.assertEquals(addBinary(23, 9), 32);\r\n }", "void speedUp(int a);", "private void add(){\n if((cells[pointer]&0xff) >= 255){\n cells[pointer] = 0;\n } else {\n cells[pointer]++;\n }\n }", "public final void mo1281a() {\n this.f1998g = 0;\n this.f1999h = 0;\n this.f2000i = false;\n }", "static void findI1s(final int length, int[] B) {\r\n\t final long max = 1 << length;\r\n\t for (long i = 0; i < max; i++) {\r\n\t long currentNumber = i;\r\n\t final int[] buffer = new int[length];\r\n\t boolean[] I1 = new boolean[length]; // I1 to be passed to next method\r\n\t int bufferPosition = buffer.length;\r\n\t while (bufferPosition > 0) {\r\n\t buffer[--bufferPosition] = (int) (currentNumber & 1);\r\n\t currentNumber >>>= 1;\r\n\t }\r\n\t for(int x = 0; x < buffer.length; x++) {\r\n\t \tif(buffer[x] == 1) {\r\n\t \t\tI1[x] = true;\r\n\t \t}\r\n\t \telse {\r\n\t \t\tI1[x] = false;\r\n\t \t}\r\n\t \tSystem.out.print(buffer[x]);\r\n\t }\r\n\t\t System.out.println();\r\n\t }\r\n\t}", "static Node addOne(Node head){\n Node currentNode = head;\n int carry = 1;\n Node previousNode = null;\n\n while(currentNode!=null){\n int newValue = currentNode.data + carry;\n currentNode.data = newValue%10;\n carry = newValue/10;\n previousNode = currentNode;\n currentNode = currentNode.next;\n }\n if(carry > 0){\n previousNode.next = new Node(carry);\n }\n return head;\n }", "public void Increase()\n {\n Increase(1);\n }", "public static int pad1_release(){\n\t\treturn speed1 = 0;\n\t}", "public static int BIASED_ONE_OR_ZERO()\n\t{\n\t}", "public abstract int simulate();", "public void timer()\n {\n timer += .1; \n }", "private int plusOne(int index) {\n if (index + 1 >= array.length) {\n return 0;\n } else {\n return index + 1;\n }\n }", "public final void mo36647a() {\n if (getAndIncrement() == 0) {\n mo36650b();\n }\n }", "int method01(int a, int b) {\n\n\t\ta = a + b;\n\t\treturn a;\n\t}", "public fuseAdd1(int[] sortedSnapshot) {\n\t\tthis.sortedSnapshot = sortedSnapshot;\n\t}", "void add(BigInt number);", "@Test\n\tpublic void testRun1() {\n\t\n\t\tRingSum s = new RingSum(3);\n\t\tfor( int i = 0; i < 120; ++i )\n\t\t{\n\t\t\ts.push(0);\n\t\t\ts.push(1);\n\t\t\ts.push(0);\n\t\t\tassertTrue(s.get() == 1);\n\t\t}\n\t\t\n\t}", "@Override\n public int incrementFirstValue(int key) {\n return array.incrementEntry(key << 1, 1);\n }", "public static int pad1_up(){\n\t\treturn speed1 = -3;\n\t}", "private int iniFunc1(final int x) {\n return (x ^ (x >>> INITIALIZE_SHIFT)) * MAGIC_NUMBER1;\n }", "public int[] plusOne(int[] digits) {\n\t\tint carry = 0;\n\t\tdigits[digits.length - 1] += 1;\n\t\tfor (int i = digits.length - 1; i >= 0; i--) {\n\t\t\tdigits[i] = digits[i] + carry;\n\t\t\tcarry = digits[i] / 10;\n\t\t\tdigits[i] %= 10;\n\t\t}\n\t\tif (carry == 0) {\n\t\t\treturn digits;\n\t\t} else {\n\t\t\tint[] newDigits = new int[digits.length + 1];\n\t\t\tfor (int i = 0; i < digits.length; i++) {\n\t\t\t\tnewDigits[i + 1] = digits[i];\n\t\t\t\tnewDigits[0] = carry;\n\t\t\t}\n\t\t\treturn newDigits;\n\t\t}\n\t}", "public void increase() {\n balance.multiply(1.001);\n }", "private static void test1() {\n\n\tint n=10000;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint val=rand7();\n\t\t\tcount[val]++;\n\t\t}\n\t\t\n\t\tfor(int i:count)\n\t\t\tSystem.out.println(i);\n\t}", "public void ad(boolean z, int i) {\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ta1.deposit(1000);\n\t\t\t}", "public final void ad(int i, byte b, byte b2) {\n try {\n int i2;\n int i3 = this.db[0];\n int i4 = this.dc[0];\n if (i == 0) {\n i3--;\n i4++;\n }\n if (1 == i) {\n i4++;\n }\n if (i == 2) {\n i3++;\n i4++;\n }\n if (i == 3) {\n i3--;\n }\n if (4 == i) {\n i3++;\n }\n if (i == 5) {\n i3--;\n i4--;\n }\n if (6 == i) {\n i4--;\n }\n if (i == 7) {\n i4--;\n i2 = i3 + 1;\n } else {\n i2 = i3;\n }\n if (-1 != this.cs * -1099198911 && gn.aq(this.cs * -1099198911, 1520322728).aa * 952452997 == 1) {\n this.cs = -1835762113;\n }\n if (this.da * -913482765 < 9) {\n this.da -= 751585989;\n }\n for (i3 = this.da * -913482765; i3 > 0; i3--) {\n int i5 = i3 - 1;\n this.db[i3] = this.db[i5];\n this.dc[i3] = this.dc[i5];\n this.du[i3] = this.du[i5];\n }\n this.db[0] = i2;\n this.dc[0] = i4;\n this.du[0] = b;\n } catch (RuntimeException e) {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"iq.ad(\");\n stringBuilder.append(')');\n throw mv.aq(e, stringBuilder.toString());\n }\n }", "private void coins_a1O(){\n\t\tthis.cube[40] = this.cube[6]; \n\t\tthis.cube[6] = this.cube[24];\n\t\tthis.cube[24] = this.cube[47];\n\t\tthis.cube[47] = this.cube[33];\n\t\tthis.cube[33] = this.cube[40];\n\t}", "void beat();", "public void generateCode (int counter1){\r\n\t\tint randNum;\r\n\t\tfor (int i = 0; i < counter1 ; i++){\r\n\t\t\trandNum = (int) (Math.random()*(4-1+1))+1;\r\n\t\t\tcode = code + randNum;\r\n\t\t}\r\n\t\tSystem.out.println(\"code = \" + code);\r\n\t\tanimateButtons();\r\n\t}", "@Override\r\n\tpublic int challengeOne(int[] arr) {\n\t\treturn 0;\r\n\t}", "public void addSample(double value){\n num_samples += 1;\n signal = signal*damping + value;\n }", "private void coins_a1W(){\n\t\tthis.cube[4] = this.cube[15]; \n\t\tthis.cube[15] = this.cube[26];\n\t\tthis.cube[26] = this.cube[38];\n\t\tthis.cube[38] = this.cube[27];\n\t\tthis.cube[27] = this.cube[4];\n\t}", "public void inc(){\n this.current += 1;\n }", "@Override\n public boolean add(Adder adder)\n {\n return adder.addToStrongBox(this);\n }", "private static void add() {\n\tcount.incrementAndGet();\n}", "@Test(timeout = 4000)\n public void test0() throws Throwable {\n int int0 = 169;\n InstructionFactory.createDup(int0);\n }", "int add();", "@Test\n\tpublic void testAddition() {\n\t\tint tmpRndVal = 0;\n\t\tint tmpRndVal2 = 0;\n\t\tint tmpResult = 0;\n\t\t\n\t\t//testing with negative numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = RandomNegativeNumbers();\n\t\t\ttmpRndVal2 = RandomNegativeNumbers();\n\t\t\ttmpResult = tmpRndVal + tmpRndVal2;\n\t\t\tassertEquals(bc.addition(tmpRndVal, tmpRndVal2), tmpResult);\n\t\t}\n\t\t\n\t\t//testing with positive numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = RandomPositiveNumbers();\n\t\t\ttmpRndVal2 = RandomPositiveNumbers();\n\t\t\ttmpResult = tmpRndVal + tmpRndVal2;\n\t\t\tassertEquals(bc.addition(tmpRndVal, tmpRndVal2), tmpResult);\n\t\t}\n\t\t\n\t\t//testing with zero\n\t\tint zero = 0;\n\t\tint tmpVal = 7;\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tassertTrue( ((bc.addition(tmpVal, zero) == zero) \n\t\t\t\t\t|| (bc.addition(zero, zero) == zero)\n\t\t\t\t\t|| (bc.addition(zero, tmpVal) == zero) ));\n\t\t}\n\t\t\n\t}", "public abstract void increaseThis();", "public void increment(){\n value+=1;\n }", "public Ad() {\r\n Ad.adsCount++;\r\n this.ID = Ad.adsCount;\r\n }", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tcounter.accumulate(1);\n\t\t\t\t}", "public HalfAdder() {\n mAndGate = new AndGate(ZERO, ZERO);\n mXorGate = new XorGate(ZERO, ZERO);\n }", "void add(int idx, float incr);", "public int singleNumber1(int[] nums) {\n\t\tif(nums == null || nums.length == 0) return 0;\n\t \n\t int n = nums.length;\n\t int ans = 0;\n\t for(int i=0; i<n; i++) {\n\t ans ^= nums[i];\n\t System.out.println(ans);\n\t }\n\t \n\t return ans;\n }", "private int m4018a() {\n Integer num = this.f4077a.get();\n if (num == null) {\n num = 0;\n }\n int intValue = num.intValue() + 1;\n this.f4077a.set(Integer.valueOf(intValue));\n return intValue;\n }", "private int Sum1(int x) {\n int a = ROTR(6, x);\n int b = ROTR(11, x);\n int c = ROTR(25, x);\n int ret = a ^ b ^ c;\n return ret;\n }", "private boolean next(int[] elements) {\n for (int i = 0; i < elements.length; i++) {\n elements[i]++;\n if (elements[i] == universeSize) {\n elements[i] = 0;\n } else {\n return true;\n }\n }\n return false;\n }", "public int singleNumber_k2_p1(int[] A) {\n int x1 = 0;\n\n for (int i : A) {\n x1 ^= i;\n }\n\n return x1;\n }", "static void add() {\r\n\t\t\r\n\t\tint a = 500;\r\n\t\tint b = 300;\r\n\t\t\r\n\t\tint s = a +b;\r\n\t\tSystem.out.println(s);\r\n\t}", "Boolean incremental();", "public abstract BigInteger nextValue();", "public void incrementNumAttacked( ){\n this.numAttacked++;\n }", "public static void add(Double[] vector, Double adder) {\r\n // ...\r\n for (int i = 0; i < vector.length; i++){\r\n vector[i] = vector[i] + adder;\r\n }\r\n }", "@Override\n\tpublic double add(double in1, double in2) {\n\t\treturn 0;\n\t}", "int nextBits(int bits);", "public void add(ComplexNumber one){\n this.real += one.real;\n this.imaginary += one.imaginary;\n }", "public void advanceSimulation () {\n\t\tstep_++;\n\t}", "final private void accumulate()\n\t{\n\t\tfinal int argb = target.get().get();\n\t\taccA += ( ( argb >> 24 ) & 0xff ) * weights[ code ];\n\t\taccR += ( ( argb >> 16 ) & 0xff ) * weights[ code ];\n\t\taccG += ( ( argb >> 8 ) & 0xff ) * weights[ code ];\n\t\taccB += ( argb & 0xff ) * weights[ code ];\n\n//\t\tSystem.out.print( \"accumulating value at \" + target );\n//\t\tSystem.out.print( \"with weights [\" );\n//\t\tprintCode();\n//\t\tSystem.out.printf( \"] = %f\" + \"\\n\", weights[ code ] );\n\t}", "@Test\n @Tag(\"slow\")\n public void testFIT1D() {\n CuteNetlibCase.doTest(\"FIT1D.SIF\", \"-9146.378092421019\", \"80453.99999999999\", NumberContext.of(7, 4));\n }", "public int countOfOnes() {\r\n\t\tbyte one = (byte) 1;\r\n\t\tint count = 0;\r\n\r\n\t\tfor (byte b : values) {\r\n\t\t\tif (b == one) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn count;\r\n\t}", "@Test\n public void testZeroA() {\n assertEquals(0, PiGenerator.powerMod(0, 5, 42));\n }", "@Override\r\n public Boolean isOne(Ring ring) {\r\n return (re.isOne(ring) && im.isZero(ring));\r\n }", "static void adc_with_reg(String passed){\n\t\tint sum = hexa_to_deci(registers.get('A'));\n\t\t/*\n\t\t * This will be valid only when sign arithematic is being performed\n\t\t * if(S)\n\t\t\tsum*=-1;\n\t\t */\n\t\tsum+=(CS?1:0);\n\t\tsum+=hexa_to_deci(registers.get(passed.charAt(4)));\n\t\tCS = sum>255?true:false;\n\t\tregisters.put('A',decimel_to_hexa_8bit(sum));\n\t\tmodify_status(registers.get('A'));\n\t}", "public int addValue(short[] array) {\n int val = hashCode();\n for (short i : array) {\n val = addValue(i);\n }\n return val;\n }", "private void sub() {\n // PROGRAM 1: Student must complete this method\n // This method must use the addBit method for bitwise subtraction.\n //invert bits of inputB\n for (int i = 0; i < inputB.length; i++) {\n if (!inputB[i]) {\n inputB[i] = true; //set each 0 bit to 1\n } else {\n inputB[i] = false; //set each 1 bit to 0\n }\n }\n adder = addBit(inputA[0], inputB[0], true); //place first iteration of addBit with a carry-in bit into adder.\n output[0] = adder[0]; //place first sum into output[0]\n //loop thru output starting at index 1 since we already computed\n for (int i = 1; i < output.length; i++) {\n cin = adder[1]; // set cin equal to carryout\n adder = addBit(inputA[i], inputB[i], cin); //call addBit with index i of inputA and inputB and cin\n output[i] = adder[0]; //place sum into output[i]\n }\n }", "private void coins_a1Y(){\n\t\tthis.cube[49] = this.cube[42]; \n\t\tthis.cube[42] = this.cube[18];\n\t\tthis.cube[18] = this.cube[11];\n\t\tthis.cube[11] = this.cube[35];\n\t\tthis.cube[35] = this.cube[49];\n\t}", "static void adc_with_mem(String passed){\n\t\tint sum = hexa_to_deci(registers.get('A'));\n\t\t/*\n\t\t * This will be valid only when sign arithematic is being performed\n\t\t * if(S)\n\t\t\tsum*=-1;\n\t\t */\n\t\tsum+=(CS?1:0);\n\t\tsum+=hexa_to_deci(memory.get(memory_address_hl()));\n\t\tCS = sum>255?true:false;\n\t\tregisters.put('A', decimel_to_hexa_8bit(sum));\n\t\tmodify_status(registers.get('A'));\n\t}", "public byte process_ad() {\n byte ozp = 0;\n if(adlen < STATE_LEN){ // less than one block\n Util.arrayFillNonAtomic(es, (short)0, (short)16, (byte)0x00);\n Util.arrayCopyNonAtomic(ad, (short)0, es, (short)0, adlen);\n es[adlen] = (byte)0x80;\n ozp = 1;\n }\n else{ // full first block\n Util.arrayCopyNonAtomic(ad, (short)0, es, (short)0, STATE_LEN); \n }\n \n // apply fix0 and the E_k\n byte fix0 = (byte)(es[0] & (byte)0x80); // test if the MSB is zero\n es[0] &= (byte)0x7f;\n \n // apply the first encryption\n //aesCipher.AESEncryptBlock(es, (short)0, ekey, aesCipher.N_ROUNDS);\n m_encryptCipher.doFinal(es, (short)0, (short)16, es, (short) 0);\n \n // when fix0 works, apply h\n if(fix0 == 1) h();\n \n // process the middle normal blocks of ad\n short j;\n for(j=1; j<(short)(adlen/STATE_LEN); j++) {\n xor_block(j);\n //aesCipher.AESEncryptBlock(es, (short)0, ekey, aesCipher.N_ROUNDS);\n m_encryptCipher.doFinal(es, (short)0, (short)16, es, (short) 0);\n }\n // process the last block partial block if any\n short lastblocklen = (short)(adlen % STATE_LEN);\n if((adlen > STATE_LEN) && lastblocklen != 0){\n xor_bytes_ad(j, lastblocklen);\n es[lastblocklen] ^= 0x80;\n //aesCipher.AESEncryptBlock(es, (short)0, ekey, aesCipher.N_ROUNDS);\n m_encryptCipher.doFinal(es, (short)0, (short)16, es, (short) 0);\n ozp = 1;\n }\n \n // * process the nonce\n // * 1. first byte is: PARAM\n // * 2. then the nonce value\n // * 3. padding if any (at the moment, the parameter set\n // contains padding for all choices)\n es[0] ^= PARAM;\n xor_bytes_nonce();\n // apply padding to nonce\n if((short)(nlen+1) != STATE_LEN)\n es[(short)(nlen+1)] ^= 0x80;\n if(ozp == 1) G();\n else f1();\n Util.arrayCopyNonAtomic(es, (short)0, ts, (short)0, STATE_LEN); \n //aesCipher.AESEncryptBlock(es, (short)0, ekey, aesCipher.N_ROUNDS);\n m_encryptCipher.doFinal(es, (short)0, (short)16, es, (short) 0);\n \n return SUCCESS;\n }", "void add(int value);" ]
[ "0.6062327", "0.58626944", "0.56907403", "0.5627641", "0.5459642", "0.5420788", "0.53618675", "0.5332026", "0.5308108", "0.5305765", "0.5305765", "0.5285818", "0.52521217", "0.5240805", "0.5238916", "0.52251303", "0.5221589", "0.51492655", "0.5145557", "0.5144674", "0.5143504", "0.51186115", "0.51090807", "0.509585", "0.50761706", "0.507226", "0.5071332", "0.5054176", "0.5054176", "0.50485617", "0.50484633", "0.50360745", "0.5026889", "0.50157917", "0.5008071", "0.49863216", "0.49815956", "0.49716598", "0.49701902", "0.4967104", "0.49575922", "0.4952967", "0.49485353", "0.49430382", "0.49425378", "0.49256563", "0.4924132", "0.49189302", "0.49069262", "0.49056208", "0.4892103", "0.48913658", "0.48852497", "0.4881764", "0.48817298", "0.48813725", "0.48784092", "0.48698622", "0.4866454", "0.48636153", "0.48626417", "0.48598608", "0.48525244", "0.4852046", "0.48498005", "0.48486236", "0.48457432", "0.4845708", "0.48386118", "0.48357323", "0.48344588", "0.4834188", "0.48337087", "0.4825275", "0.48110068", "0.48055756", "0.4804319", "0.4803778", "0.4801779", "0.47978297", "0.47893646", "0.47827798", "0.4776569", "0.4774173", "0.47722748", "0.4768227", "0.4766942", "0.47595719", "0.47481573", "0.47470403", "0.47468135", "0.4746065", "0.47335142", "0.47320715", "0.47172815", "0.47156715", "0.47140408", "0.4706273", "0.4704539", "0.4703858", "0.4702981" ]
0.0
-1
Submits the form. If this the first time the data is submitted, this action will prompt the user to pick a directory. The file will be submitted to the file OverwatchGames.csv in the selected directory.
@FXML private void submitForm() { System.out.println("submitted"); submit.setDisable(true); if ( file_path.getText().isEmpty() ) { final DirectoryChooser fileChooser = new DirectoryChooser(); Stage stage = new Stage(); stage.setTitle("Choose Directory"); File folder = fileChooser.showDialog(stage); output.openFile(folder.toString() + "\\OverwatchGames.csv"); file_path.setText(folder.toString() + "\\OverwatchGames.csv"); } else { System.out.println("File Path: " + file_path.getText()); } output.outputResults( mainApp.getPlayers(), mainApp.getHeros(), mainApp.getMap(), mainApp.getTimerList()); submit.setDisable(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void submit()\n\t{\n\t\tString trackCsv = trackCsvInput.getText();\n\t\tString trackName = trackNameInput.getText();\n\t\t\n\t\tRadioButton selectedButton = (RadioButton) toggleColors.getSelectedToggle();\n\t\tString color = selectedButton.getText().toUpperCase();\n\t\t\n\t\tif (addTrack(trackName, trackCsv, color)) \n\t\t{\n\t\t\tStage currStage = (Stage) trackCsvInput.getScene().getWindow();\n\t\t\tcurrStage.close();\n\t\t\tCTC.ctcController.displayTrack();\n\t\t\tCTC.ctcController.displayLegend();\n\t\t}\n\t\telse\n\t\t\terrorMessage.setVisible(true);\n\t}", "private void okPressed() {\n String destPath = pathField.getText();\n \n // Resolves destination folder\n // TODO: move those I/O bound calls to job as they can lock the main thread\n Object ret[] = FileToolkit.resolvePath(destPath, mainFrame.getActiveTable().getCurrentFolder());\n // The path entered doesn't correspond to any existing folder\n if (ret==null || (files.size()>1 && ret[1]!=null)) {\n showErrorDialog(Translator.get(\"this_folder_does_not_exist\", destPath));\n return;\n }\n \n AbstractFile destFolder = (AbstractFile)ret[0];\n String newName = (String)ret[1];\n \t\t\n // Retrieve default action when a file exists in destination, default choice\n // (if not specified by the user) is 'Ask'\n int defaultFileExistsAction = fileExistsActionComboBox.getSelectedIndex();\n if(defaultFileExistsAction==0)\n defaultFileExistsAction = FileCollisionDialog.ASK_ACTION;\n else\n defaultFileExistsAction = DEFAULT_ACTIONS[defaultFileExistsAction-1];\n // We don't remember default action on purpose: we want the user to specify it each time,\n // it would be too dangerous otherwise.\n \t\t\n startJob(destFolder, newName, defaultFileExistsAction);\n }", "private void chooseDirectoryAction(){\n\t\t \tJFileChooser chooser = new JFileChooser(); \n\t\t chooser.setCurrentDirectory(lastChoosedDirectory == null ? new java.io.File(\".\") : lastChoosedDirectory);\n\t\t chooser.setDialogTitle(translations.getChooseDirectory());\n\t\t chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\t\t //\n\t\t // disable the \"All files\" option.\n\t\t //\n\t\t chooser.setAcceptAllFileFilterUsed(false);\n\t\t // \n\t\t if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { \n\t\t \tFile file = chooser.getSelectedFile();\n\t\t \tsetDirectoryInfoLabel(file.getAbsolutePath());\n\t\t\t\tsetMessage( translations.getDirChosen().replace(\"#replace\", file.getAbsolutePath() ) );\n\t\t\t\tlastChoosedDirectory = file;\n\t\t }\n\t\t else {\n\t\t \tsetDirectoryInfoLabel(translations.getDirHasNotBeenChosen());\n\t\t \tshowWarningMessage( translations.getDirHasNotBeenChosen() );\n\t\t \tlastChoosedDirectory = null;\n\t\t }\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n JFileChooser j = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\n\n // set the selection mode to directories only\n j.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\n // invoke the showsSaveDialog function to show the save dialog\n int r = j.showSaveDialog(null);\n\n if (r == JFileChooser.APPROVE_OPTION) {\n // set the label to the path of the selected directory\n directory.setText(j.getSelectedFile().getAbsolutePath());\n }\n // if the user cancelled the operation\n else\n directory.setText(\"the user cancelled the operation\");\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n JFileChooser j = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\n\n // invoke the showsSaveDialog function to show the save dialog\n int r = j.showSaveDialog(null);\n\n if (r == JFileChooser.APPROVE_OPTION) {\n // set the label to the path of the selected directory\n dataFile.setText(j.getSelectedFile().getAbsolutePath());\n }\n // if the user cancelled the operation\n else\n dataFile.setText(\"the user cancelled the operation\");\n }", "public void chooseDataDirectory() {\n File file;\n JFileChooser fileChooser = new JFileChooser(\n new java.io.File(defaultDirectory));\n fileChooser.setDialogTitle(NbBundle.getMessage(\n SessionTopComponent.class, \"ChooseDataDirectory\"));\n fileChooser.setFileSelectionMode(\n JFileChooser.DIRECTORIES_ONLY);\n int returnVal = fileChooser.showOpenDialog(this);\n\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n file = fileChooser.getSelectedFile();\n\n dataDirectoryTextField.setText(file.getAbsolutePath());\n defaultDirectory = file.getPath();\n }\n enableStartButton();\n }", "private void saveCSV(ActionEvent actionEvent) {\n JFileChooser fileChooser = new JFileChooser();\n fileChooser.setCurrentDirectory(new File(System.getProperty(\"user.home\")));\n int result = fileChooser.showOpenDialog(this);\n if (result == JFileChooser.APPROVE_OPTION) {\n String selectedFile = fileChooser.getSelectedFile().getAbsolutePath();\n StatisticsFile statisticsFile = new StatisticsFile(selectedFile);\n try{\n statisticsFile.writeInCvs(my_map.getSettlements());\n }catch(IOException ioException){\n ioException.printStackTrace();\n }\n }\n }", "@Override\n public void actionPerformed(ActionEvent e){\n JFileChooser fileChooser = new JFileChooser();\n int status = fileChooser.showSaveDialog(null);\n \n //Check if they actually saved the file\n if (status == JFileChooser.APPROVE_OPTION) {\n File fileToSave = fileChooser.getSelectedFile();\n \n //Try block to make sure file actually exists\n try {\n FileOutputStream fos = new FileOutputStream(fileToSave);\n ObjectOutputStream out = new ObjectOutputStream(fos);\n out.writeObject(games);\n \n //Close the file\n fos.close();\n out.close();\n } catch (FileNotFoundException ex) {\n JOptionPane.showMessageDialog(null, \"Error: File not found\");\n } catch (IOException ex) {\n JOptionPane.showMessageDialog(null, \"Error: File I/O problem\");\n }\n \n //Tell the user it saved successfully\n JOptionPane.showMessageDialog(null, \"Saved as file: \" + fileToSave.getAbsolutePath());\n }\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t\tif(e.getSource()==browse){\n\t\t\tif (chooser == null){\n\t\t\t\tchooser = new JFileChooser();\n\t\t\t\tchooser.setCurrentDirectory(new java.io.File(projectPath));\n\t\t\t\tchooser.setDialogTitle(\"Find Folder\");\n\t\t\t\tchooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\t\t\t\tchooser.setAcceptAllFileFilterUsed(false);\n\n\t\t\t\tif (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {\n\t\t\t\t\tsaveTo.setText(chooser.getSelectedFile().toString());\t\t\n\t\t\t\t}\n\t\t\t\tchooser = null;\n\t\t\t}\t\n\t\t}else if(e.getSource()== save){\n\t\t\tsaveFile();\n\t\t}else if(e.getSource()==cancel){\n\t\t\tnameOfFile.setText(\"\");\n\t\t\tsaveTo.setText(\"\");\n\t\t\tthisFrame.dispose();\n\t\t}\n\t\t\n\t}", "private void SubmitCsvFile() throws Exception {\n\n\t\t// Redirect to devices page in panel\n\t\tgetDriver().get(\"https://stg.autobrain.com/worker/retail_fulfillment/ready_for_distribution\");\n\n\t\t// Click on upload file button\n\t\tWebElement upload_file = PresenceOfElementByXpath(\"//input[@name='file']\", 15);\n\n\t\tupload_file.sendKeys(csvFile.getAbsolutePath());\n\n\t\tThread.sleep(2000);\n\n\t}", "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 }", "private void outputBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_outputBrowseButtonActionPerformed\n JFileChooser chooser = new JFileChooser();\n chooser.setCurrentDirectory(new java.io.File(\".\"));\n chooser.setDialogTitle(\"Select a directory\");\n chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n chooser.setAcceptAllFileFilterUsed(false);\n\n if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {\n outputFileLoc.setText(chooser.getCurrentDirectory().getAbsolutePath());\n }\n }", "private void displayFileChooser() {\n\n // Initiate file chooser, and set title\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Save Poster\");\n\n // Set extension filter\n FileChooser.ExtensionFilter filter = new FileChooser.ExtensionFilter(\"Image\", \"*.jpg\");\n fileChooser.getExtensionFilters().add(filter);\n\n // If preferences file is empty\n if (userDirectoryString.equals(\"empty\")) {\n\n userDirectoryString = System.getProperty(\"user.home\");\n }\n\n File userDirectory = new File(userDirectoryString);\n\n // If it can't access User Home, default to C drive\n if (!userDirectory.canRead()) {\n userDirectory = new File(\"C:\\\\\");\n }\n\n // Set the initial save directory\n fileChooser.setInitialDirectory(userDirectory);\n\n if (movie != null) {\n\n // Get movie's title and set an initial file name\n String movieTitle = movie.getMovieTitle();\n\n // Replace any invalid characters\n movieTitle = movieTitle.replaceAll(\"[\\\"/?\\\"*><|]\", \"\").replace(\":\", \"-\");\n\n // Set initial file name\n fileChooser.setInitialFileName(movieTitle);\n }\n\n // Show file chooser dialog\n File file = fileChooser.showSaveDialog(primaryStage);\n\n // Check file isn't null, so it the image view\n if (file != null && imgPoster.getImage() != null) {\n\n try {\n\n ImageIO.write(SwingFXUtils.fromFXImage(imgPoster.getImage(), null), \"jpg\", file);\n setLblStatus(\"Poster saved successfully.\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // Update preferences with the new location, and local variable\n preferences.put(\"saveLocation\", file.getParentFile().toString());\n userDirectoryString = file.getParentFile().toString();\n }\n }", "private void entryFileButtonActionPerformed(java.awt.event.ActionEvent evt) {\n JFileChooser chooser = new JFileChooser();\n chooser.setDialogTitle(\"Select Entries File\");\n File workingDirectory = new File(System.getProperty(\"user.dir\"));\n chooser.setCurrentDirectory(workingDirectory);\n if (chooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {\n entryFile = chooser.getSelectedFile();\n entryFileLabel.setText(getFileName(entryFile));\n pcs.firePropertyChange(\"ENTRY\", null, entryFile);\n }\n }", "void selectDirectory(){\n fc.setCurrentDirectory(new java.io.File( \"saved\" + File.separator));\n fc.setDialogTitle(\"FILE CHOOSER!\");\n FileNameExtensionFilter xmlfilter = new FileNameExtensionFilter(\n \"json files (*.json)\", \"json\");\n fc.setFileFilter(xmlfilter);\n int response = fc.showSaveDialog(this);\n if (response == JFileChooser.APPROVE_OPTION) {\n File selectedFile = fc.getSelectedFile();\n System.out.println(\"Save as file: \" + selectedFile.getAbsolutePath());\n } else if (response == JFileChooser.CANCEL_OPTION) {\n System.out.println(\"Cancel was selected\");\n }\n System.out.println(fc.getSelectedFile().getAbsolutePath());\n }", "private void processChooseFileButton() {\n try {\n dataOutputArea.setText(\"\");\n JFileChooser myFileChooser = new JFileChooser(\".\", FileSystemView.getFileSystemView());\n int returnValue = myFileChooser.showOpenDialog(null);\n if(returnValue == JFileChooser.APPROVE_OPTION) {\n selectedFile = myFileChooser.getSelectedFile();\n dataFileField.setText(selectedFile.getName());\n }\n } catch(Exception e) {\n System.out.println(\"There was an error with JFileChooser!\\n\\n\" + e.getMessage());\n } //end of catch()\n }", "public void directoryPathPrompt() {\n System.out.println(\"Enter a file path to export the PDF of the schedule to.\");\n }", "public void actionPerformed(ActionEvent InputEvent)\r\n {\n String DefaultSaveFileName = createDefaultSaveFileName();\r\n File DefaultSaveFile = new File(FilePathnameString\r\n + File.separatorChar\r\n + DefaultSaveFileName);\r\n\t\t JFileChooser SaveFileChooser = new JFileChooser(DefaultSaveFile);\r\n SaveFileChooser.setDialogTitle(\"Select file into which to save search results\");\r\n SaveFileChooser.setSelectedFile(DefaultSaveFile);\r\n SaveFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);\r\n\t\t int ChooseState = SaveFileChooser.showSaveDialog(MainFrame);\r\n\t\t if (ChooseState == JFileChooser.APPROVE_OPTION)\r\n\t\t {\r\n\t\t\t File SaveFile = SaveFileChooser.getSelectedFile();\r\n\t\t\t if (SaveFile == null)\r\n\t\t JOptionPane.showMessageDialog(MainFrame,\r\n\t\t \"No file chosen - no save performed\");\r\n\t\t\t else\r\n\t\t\t {\r\n String ResultsString = getResultsString();\r\n if (ResultsString == null)\r\n \t\t JOptionPane.showMessageDialog(MainFrame,\r\n\t\t \"No search results to save\");\r\n else\r\n {\r\n \t\t\t String SavePathString = SaveFile.getPath();\r\n try\r\n {\r\n FileWriter SaveFileWriter = new FileWriter(SavePathString);\r\n SaveFileWriter.write(ResultsString);\r\n SaveFileWriter.close();\r\n }\r\n catch (Exception InputException)\r\n {\r\n \t\t JOptionPane.showMessageDialog(MainFrame,\r\n\t\t \"Error writing results file \"\r\n + SavePathString\r\n + \": \"\r\n + InputException);\r\n }\r\n }\r\n\t\t\t }\r\n\t\t }\r\n }", "public void actionPerformed(ActionEvent e) {\r\n\r\n if (e.getActionCommand() == \"BATCH_SOURCE_FOLDER\") { \r\n \t JFileChooser fc = new JFileChooser();\r\n\r\n\t\t fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n\t\t int returnVal = fc.showDialog(RSMLGUI.this, \"Choose\");\r\n\t\t \r\n if (returnVal == JFileChooser.APPROVE_OPTION){ \r\n \t String fName = fc.getSelectedFile().toString();\r\n \t batchSourceFolder.setText(fName);\r\n }\r\n else SR.write(\"Choose folder cancelled.\"); \r\n }\r\n \r\n else if(e.getActionCommand() == \"BATCH_EXPORT\"){\r\n \t batchExport();\r\n }\r\n \r\n }", "public SubmitFiles(CtrlPresenter ctrlPresenter){\n\n vCtrlPresenter = ctrlPresenter;\n\n add(rootPanel);\n setTitle(\"Submit Files\");\n setSize(400,500);\n\n // We add a Listener to make the button do something\n selectClassroomsFileButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n JFileChooser fc = new JFileChooser();\n fc.setCurrentDirectory(new java.io.File(\"./data/import\"));\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\n \"JSON Files\", \"json\");\n fc.setFileFilter(filter);\n int returnVal = fc.showOpenDialog(rootPanel);\n if(returnVal == JFileChooser.APPROVE_OPTION) {\n System.out.println(\"You chose to open this file: \" +\n fc.getCurrentDirectory().getAbsolutePath()+ \"/\" +\n fc.getSelectedFile().getName());\n classroomsFile = fc.getCurrentDirectory().getAbsolutePath()+ \"/\" + fc.getSelectedFile().getName();\n selectClassroomsFileButton.setForeground(Color.green);\n } else {\n selectClassroomsFileButton.setForeground(Color.red);\n }\n\n }\n });\n selectSubjectsFileButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n JFileChooser fc = new JFileChooser();\n fc.setCurrentDirectory(new java.io.File(\"./data/import\"));\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\n \"JSON Files\", \"json\");\n fc.setFileFilter(filter);\n int returnVal = fc.showOpenDialog(rootPanel);\n if(returnVal == JFileChooser.APPROVE_OPTION) {\n System.out.println(\"You chose to open this file: \" +\n fc.getCurrentDirectory().getAbsolutePath()+ \"/\" +\n fc.getSelectedFile().getName());\n subjectsFile = fc.getCurrentDirectory().getAbsolutePath()+ \"/\" + fc.getSelectedFile().getName();\n selectSubjectsFileButton.setForeground(Color.green);\n }else {\n selectClassroomsFileButton.setForeground(Color.red);\n }\n }\n });\n\n\n\n nextbutton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n try {\n if (ctrlPresenter.setScenario(classroomsFile, subjectsFile)){\n ctrlPresenter.selectConstraints();\n }else{\n setEnabled(false);\n setVisible(false);\n vCtrlPresenter.backToInit();\n }\n } catch (Exception exc) {\n System.out.println(exc);\n }\n }\n });\n }", "public void chooseOutputDirectory() {\n File file;\n JFileChooser fileChooser = new JFileChooser(\n new java.io.File(defaultDirectory));\n fileChooser.setDialogTitle(NbBundle.getMessage(\n SessionTopComponent.class, \"ChooseOutputDirectory\"));\n fileChooser.setFileSelectionMode(\n JFileChooser.DIRECTORIES_ONLY);\n int returnVal = fileChooser.showOpenDialog(this);\n\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n file = fileChooser.getSelectedFile();\n\n outputDirectoryTextField.setText(file.getAbsolutePath());\n defaultDirectory = file.getPath();\n }\n enableStartButton();\n }", "private void chooseFilesDirectory() {\n JFileChooser setWD = new JFileChooser(System.getProperty(\"user.home\"));\n setWD.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n setWD.setDialogType(JFileChooser.OPEN_DIALOG);\n setWD.showDialog(this, \"Выбрать папку\");\n workingDirectory = setWD.getSelectedFile();\n putLog(\"Директория с файлами: \" + workingDirectory.getPath());\n jbParse.setEnabled(workingDirectory != null && remainderFile != null);\n }", "public void actionPerformed(java.awt.event.ActionEvent evt) {\n if (!askSave()) {\n return;\n }\n //loop until user choose valid file\n while (true) {\n int result = chooser.showOpenDialog(form);\n //check if user chooser approve option\n if (result == JFileChooser.APPROVE_OPTION) {\n File openFile = chooser.getSelectedFile();\n //check if open file is exist\n if (openFile.exists()) {\n file = openFile;\n text.setText(\"\");\n setSaveTitle(openFile.getName());\n writeToTextArea(openFile);\n saved = true;\n break;\n } else {\n JOptionPane.showMessageDialog(form, \"File not found\", \"Open\", JOptionPane.OK_OPTION);\n }\n } else {\n break;\n }\n\n }\n }", "private void outputBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_outputBrowseButtonActionPerformed\n if (fileChooser1.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {\n outputDirText.setText(fileChooser1.getSelectedFile().getAbsolutePath());\n } else {\n System.out.println(\"File access cancelled.\");\n }\n }", "@Override\n\tpublic void actionPerformed (ActionEvent e)\n\t{\n\t\n\t\t// Create the File Save dialog.\n\t\tFileDialog fd = new FileDialog(\n\t\t\tAppContext.cartogramWizard, \n\t\t\t\"Save Computation Report As...\", \n\t\t\tFileDialog.SAVE);\n\n\t\tfd.setModal(true);\n\t\tfd.setBounds(20, 30, 150, 200);\n\t\tfd.setVisible(true);\n\t\t\n\t\t// Get the selected File name.\n\t\tif (fd.getFile() == null)\n\t\t\treturn;\n\t\t\n\t\tString path = fd.getDirectory() + fd.getFile();\n\t\tif (path.endsWith(\".txt\") == false)\n\t\t\tpath = path + \".txt\";\n\t\t\n\t\t\n\t\t// Write the report to the file.\n\t\ttry\n\t\t{\n\t\t\tBufferedWriter out = new BufferedWriter(new FileWriter(path));\n\t\t\tout.write(AppContext.cartogramWizard.getCartogram().getComputationReport());\n\t\t\tout.close();\n\t\t} \n\t\tcatch (IOException exc)\n\t\t{\n\t\t}\n\n\t\t\n\t\n\t}", "@Override\n public void handle(ActionEvent event)\n {\n DirectoryChooser dc = new DirectoryChooser();\n dc.setTitle(\"Choose output directory\");\n \n // Put the DirectoryChooser into a new Stage and get the file (=directory)\n Stage openFileStage = new Stage();\n openFileStage.setAlwaysOnTop(true);\n File directory = dc.showDialog(openFileStage);\n \n // set the output directory of the fileHandler\n fileHandler.setOutDir(directory);\n \n // tell the controller to save everything (convert to YAML and write to file(s))\n this.controller.saveCwlTools();\n }", "public static void processDirectorySelecction()\n {\n int answer = JSoundsMainWindowViewController.jFileChooser1.showOpenDialog(JSoundsMainWindowViewController.jSoundsMainWindow);\n \n if (answer == JFileChooser.APPROVE_OPTION)\n {\n File actualDirectory = JSoundsMainWindowViewController.jFileChooser1.getCurrentDirectory();\n String directory = actualDirectory.getAbsolutePath() + \"/\" + JSoundsMainWindowViewController.jFileChooser1.getSelectedFile().getName();\n UtilFunctions.listFilesAndFilesSubDirectories(directory);\n JSoundsMainWindowViewController.orderBy(true, false, false);\n \n \n }\n }", "@Override\n\t public void actionPerformed(ActionEvent arg0) {\n\t\t JFileChooser j = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory()); \n\t\t\n\t\t // invoke the showsOpenDialog function to show the save dialog \n\t\t int r = j.showOpenDialog(null); \n\t\t\n\t\t // if the user selects a file \n\t\t if (r == JFileChooser.APPROVE_OPTION) \n\t\t\n\t\t { \n\t\t // set the label to the path of the selected file \n\t\t textfield.setText(j.getSelectedFile().getAbsolutePath()); \n\t\t\n\t\t } \n\t\t // if the user cancelled the operation \n\t\t \n\t\t //\n\t\t \n\t\t }", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\tString fileName=JOptionPane.showInputDialog(\"Enter the File name without any extension\");\r\n\t\t\ttheGame.save(fileName);\r\n\t\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tint opt = chooser.showSaveDialog(null);\r\n\t\t\t\tif (opt == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tFile file = chooser.getSelectedFile();\r\n\t\t\t\t\tif (FilenameUtils.getExtension(file.getName()).equalsIgnoreCase(user)) {\r\n\t\t\t\t\t\t// filename is OK as-is\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfile = new File(file.toString() + \".\"+user);\r\n\t\t\t\t\t\tfile = new File(file.getParentFile(), FilenameUtils.getBaseName(file.getName()) + \".\"+user);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tFileOutputStream fo = new FileOutputStream(file);\r\n\t\t\t\t\t\tObjectOutputStream oos = new ObjectOutputStream(fo);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toos.writeUTF(user);\r\n\t\t\t\t\t\toos.writeObject(StudentArray);\r\n\t\t\t\t\t\toos.writeObject(tab);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toos.close();\r\n\t\t\t\t\t\tfo.close();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}", "public void Save(){\n\tJFileChooser j = new JFileChooser(\"\"); \n\t// Invoke the showsSaveDialog function to show the save dialog \n\tint r = j.showSaveDialog(null);\n \n\tif (r == JFileChooser.APPROVE_OPTION) { \n\n\t// Set the label to the path of the selected directory \n File fi = new File(j.getSelectedFile().getAbsolutePath()); \n\n try { \n\t\t// Create a file writer \n\t\tFileWriter wr = new FileWriter(fi, false); \n\n\t\t// Create buffered writer to write \n\t\tBufferedWriter w = new BufferedWriter(wr); \n\n\t\t// Write\n\t\tw.write(t.getText()); \n\n\t\tw.flush(); \n\t\tw.close(); \n } \n catch (Exception evt) { \n\t\tJOptionPane.showMessageDialog(f, evt.getMessage()); \n } \n\t} \n\t// If the user cancelled the operation \n\telse\n JOptionPane.showMessageDialog(f, \"the user cancelled the operation\"); \n\t\t\n }", "private void jButtonBrowseFileNameActionPerformed(ActionEvent e) {\n\t\tJFileChooser fileChooser = new JFileChooser();\n\t\tint result = fileChooser.showSaveDialog(this);\n\t\tif (result == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fileChooser.getSelectedFile();\n\t\t\tjTextFieldFileName.setText(file.getAbsolutePath());\n\t\t}\n\t}", "public void actionPerformed(ActionEvent ev){\r\n\t\t\t//bring up a file dialog box\r\n\t\t\t//let the user name and save the set\r\n\t\t\t\r\n\t\t\tQuizCard card = new QuizCard(question.getText(), answer.getText());\r\n\t\t\tcardList.add(card);\r\n\t\t\t\r\n\t\t\tJFileChooser fileSave = new JFileChooser();\r\n\t\t\tfileSave.showSaveDialog(frame);\r\n\t\t\tsaveFile(fileSave.getSelectedFile()); //brings up a file dialog box and waits on this line until user chooses to save from the dialog box\r\n\t\t}", "@Override\r\n public void actionPerformed(ActionEvent e) {\r\n JFileChooser fileChooser = new JFileChooser();\r\n fileChooser.setDialogTitle(\"Upload Files\");\r\n int result = fileChooser.showOpenDialog(null);\r\n if (result == JFileChooser.APPROVE_OPTION) { \r\n selectedFile = fileChooser.getSelectedFile();\r\n review.setText(selectedFile.getAbsolutePath());\r\n } \r\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tFile projectFile;\n\t\t\t\tint rVal = fileChooser.showSaveDialog(OldTimeTableApp.this);\n\t\t\t\tif(rVal == JFileChooser.APPROVE_OPTION) {\n\t\t\t\t\tprojectFile = fileChooser.getSelectedFile();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tProjectController.saveProject(currentProject, projectFile.getPath());\n\t\t\t\t\t\tcurrentProjectFilePath = projectFile.getPath();\n\t\t\t\t\t\tupdatePanel(currentProjectFilePath, currentProject.getCourseDetailsFileName(), currentProject.getStudentAllocationDetailsFileName());\n\t\t\t\t\t} catch (IOException error) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\tJOptionPane.showMessageDialog(OldTimeTableApp.this, error, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tfileChooserWindow = new JFrame(); \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//fileChooserWindow.setLayout(new GridLayout(4,1));\n\t\t\t\t\t\n\t\t\t\t\tJFileChooser chooser = new JFileChooser(); \n\t\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\"TEXT FILES\", \"txt\", \"text\");\n\t\t\t\t\tchooser.setFileFilter(filter);\n\t\t\t\t\t//fileChooserWindow.add(chooser);\n\t\t\t\t\t\n\t\t\t\t\tint result = chooser.showOpenDialog(fileChooserWindow);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(result == JFileChooser.APPROVE_OPTION){\n\t\t\t\t\t\t//System.out.println(chooser.getSelectedFile().getName());\n\t\t\t\t\t\thostSelectedFile.setText(chooser.getSelectedFile().getName());\n\t\t\t\t\t\tfileName = chooser.getSelectedFile().getAbsolutePath();\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tgameData = new Jeopardy_Game(fileName);\n\t\t\t\t\t\t\thostRatingLabel.setText(\"This game has a rating of: \"+gameData.getAvg());\n\t\t\t\t\t\t} catch (FileNotFoundException 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\t\t\t\t\t//ratingLabel.setText();\n\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(chooser.getSelectedFile().getName());\n\t\t\t\t\t\n\t\t\t\t}", "private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {\n JFileChooser fc = new JFileChooser();\n fc.setCurrentDirectory(new File(System.getProperty(\"user.dir\")));\n int result = fc.showOpenDialog(this);\n if (result == JFileChooser.APPROVE_OPTION) {\n File selectedFile = fc.getSelectedFile();\n myFile = selectedFile.getAbsolutePath().replaceAll(\"\\\\\\\\\", \"/\");\n //System.out.println(\"Selected file: \" + myFile);\n }\n jSimulationBtn.setEnabled(true);\n jBtnFuzzy.setEnabled(true);\n jFileTxt.setText(myFile);\n }", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tfileChooserWindow = new JFrame(); \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//fileChooserWindow.setLayout(new GridLayout(4,1));\n\t\t\t\t\t\n\t\t\t\t\tJFileChooser chooser = new JFileChooser(); \n\t\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\"TEXT FILES\", \"txt\", \"text\");\n\t\t\t\t\tchooser.setFileFilter(filter);\n\t\t\t\t\t//fileChooserWindow.add(chooser);\n\t\t\t\t\t\n\t\t\t\t\tint result = chooser.showOpenDialog(fileChooserWindow);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(result == JFileChooser.APPROVE_OPTION){\n\t\t\t\t\t\t//System.out.println(chooser.getSelectedFile().getName());\n\t\t\t\t\t\tselectedFile.setText(chooser.getSelectedFile().getName());\n\t\t\t\t\t\tfileName = chooser.getSelectedFile().getAbsolutePath();\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tgameData = new Jeopardy_Game(fileName);\n\t\t\t\t\t\t\tratingLabel.setText(\"This game has a rating of: \"+gameData.getAvg());\n\t\t\t\t\t\t} catch (FileNotFoundException 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\t\t\t\t\t//ratingLabel.setText();\n\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(chooser.getSelectedFile().getName());\n\t\t\t\t\t\n\t\t\t\t}", "private void runButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_runButtonActionPerformed\n try {\n inputFilePath = FILEPATH.getText();\n favScore = Double.parseDouble(favScoreSet.getText());\n outputName = outputFileName.getText();\n if(outputFileLoc.getText().equalsIgnoreCase(\"Desktop\") || (outputFileLoc.getText().equals(\"\"))){\n outputFilePath = System.getProperty(\"user.home\");\n outputFilePath = outputFilePath + \"/Desktop\";\n }else{\n outputFilePath = outputFileLoc.getText(); \n }\n columnCounts = colCounts.getText();\n templatePath = templateDoc.getText();\n sheets = \"0\";\n ExcelConverter ec = new ExcelConverter(inputFilePath, hasPresenter, multiSheets, firstSheet, sheets, favScore, hasComments, wantsCounts, columnCounts, outputName, outputFilePath, templatePath);\n } catch (IOException ex) { // Show a popup, telling user that the file was invalid.\n JOptionPane.showMessageDialog(null, \n \"File was not found. Please make sure that your path is correct, and that the file exists.\", \n \"Invalid Path\", \n JOptionPane.WARNING_MESSAGE);\n }\n }", "private void jButtonBrowseOutputFileActionPerformed(ActionEvent e) {\n\t\tJFileChooser fileChooser = new JFileChooser();\n\t\tint result = fileChooser.showSaveDialog(this);\n\t\tif (result == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fileChooser.getSelectedFile();\n\t\t\tjTextFieldOutputFile.setText(file.getAbsolutePath());\n\t\t}\n\t}", "private void openCsvDialog(){\n JFileChooser aFileChooser = new JFileChooser();\n aFileChooser.setFileFilter(new MyFileFilterCSV());\n if (lastUsedFileCSV != null){\n aFileChooser.setCurrentDirectory(lastUsedFileCSV.getParentFile());\n aFileChooser.setSelectedFile(lastUsedFileCSV);\n }else{\n File file = new File(aFileChooser.getCurrentDirectory(), dataset.getName()+\".csv\");\n aFileChooser.setSelectedFile(file);\n }\n int r = aFileChooser.showSaveDialog(this);\n if (r == JFileChooser.APPROVE_OPTION){\n setCursor(new Cursor(Cursor.WAIT_CURSOR));\n File file = aFileChooser.getSelectedFile();\n if(!MyUtilities.isCSVFile(file)){\n file = MyUtilities.getCSVFile(file);\n }\n lastUsedFileCSV = file;\n String sep = getCSVSeparator();\n PrintWriter writer = null;\n try{\n writer = new PrintWriter(new BufferedWriter (new OutputStreamWriter(new FileOutputStream(file), \"utf-8\")));\n // header\n String s = \"\";\n for(int j=0; j<dataset.getListDataHeader().length; j++){\n s += dataset.getListDataHeader()[j] == null? \"\" : dataset.getListDataHeader()[j].getValue();\n if(j <dataset.getListDataHeader().length -1)\n s+= sep;\n }\n writer.println(s);\n // data\n Data[][] data = dataset.getData();\n int nbR = dataset.getNbRows();\n int nbC = dataset.getNbCol();\n for(int i=0; i<nbR; i++){\n s = \"\";\n for(int j=0; j<nbC; j++){\n if(data[i][j] != null){\n if(data[i][j].isDoubleValue()){\n if(!Double.isNaN(data[i][j].getDoubleValue()))\n s += NumberFormat.getNumberInstance(getLocale()).format(data[i][j].getDoubleValue());\n }else{\n s += data[i][j].getValue();\n }\n }\n if(j <nbC -1)\n s+= sep;\n }\n writer.println(s);\n }\n //log\n\t\tdataProcessToolPanel.logExportCSV(dataset, file.getPath());\n }catch (IOException e){\n setCursor(new Cursor(Cursor.DEFAULT_CURSOR));\n displayError(new CopexReturn(getBundleString(\"MSG_ERROR_CSV\"), false), getBundleString(\"TITLE_DIALOG_ERROR\"));\n }\n finally{\n if (writer != null)\n try{\n writer.close();\n setCursor(new Cursor(Cursor.DEFAULT_CURSOR));\n }catch (Exception e){\n setCursor(new Cursor(Cursor.DEFAULT_CURSOR));\n displayError(new CopexReturn(getBundleString(\"MSG_ERROR_CSV\"), false), getBundleString(\"TITLE_DIALOG_ERROR\"));\n }\n }\n }\n }", "public static void main(String[] args) throws IOException {\n\n if(args.length == 2) {\n readInputDataFromCSV(args[0]);\n winningNumber = args[1];\n File currentDirectoryOfCSVFile = new File(args[0]); // take the path, where .csv file with input data is\n findLongCommSubs();\n formResultLongCommSubs();\n multipleSortOfFinalPlayerList();\n generateCsvFileWithFinalData(currentDirectoryOfCSVFile);\n } else{\n System.out.println(\"Not valid enter! Enter two variables (path to .csv file and the winning number)!\");\n }\n }", "public void newDataFile(Stage primaryStage) {\n String title = \"Upload Data File\";\n\n VBox vbox = vboxFormat();\n\n Label title1 = new Label(\"Input CSV File Name\");\n title1.setFont(new Font(\"Arial\", 15));\n Label direction2 = new Label(\"enter file name, hit enter, then done\");\n direction2.setFont(new Font(\"Arial\", 10));\n TextField userInput = new TextField(\"file name with .csv extension\");\n // TODO program text field event, this is where the file name will be collected,\n // send to another class to handle!\n // Input file class called to check syntax of file name and read.\n userInput.setOnAction(e -> {\n new InputFile(userInput.getText(), report);\n updateTable();\n }); // working\n\n // Add done button\n Button done = buttonFormat(\"Done\", 3);\n\n vbox.getChildren().addAll(title1, userInput, direction2, done);\n showDialogWindow(primaryStage, vbox, title, done);\n updateTable();\n }", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\tJFileChooser jc=new JFileChooser();\n\t\t\t\t\tjc.setFileFilter(new FileNameExtensionFilter(\".xml\", \".xml\"));\n\t\t\t\t\tjc.setFileFilter(new FileNameExtensionFilter(\".json\", \".json\"));\n\t\t\t\t\tint resp=jc.showSaveDialog(null);\n\t\t\t\t\tString url=\"\";\n\t\t\t\t\tString name=\"\";\n\t\t\t\t\tif(resp==jc.APPROVE_OPTION){\n\t\t\t\t\t\tFile file=jc.getSelectedFile();\n\t\t\t\t\t\turl=file.getPath()+jc.getFileFilter().getDescription();\n\t\t\t\t\t\tname=file.getName()+jc.getFileFilter().getDescription();\n\t\t\t\t\tif(name.charAt(name.length()-1)=='l'){\n\t\t\t\t\t\tSaveAndLoadXml.save(url);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnew JasonSave().saveJson(url);\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}", "private void saveDialog() {\n JFileChooser chooser = new JFileChooser();\n \n FileFilter ff = new FileFilter() {\n\n @Override\n public boolean accept(File f) {\n // TODO Auto-generated method stub\n return f.getName().endsWith(FILE_EXTENSION);\n }\n\n @Override\n public String getDescription() {\n return \"CSV\";\n }\n\n };\n chooser.addChoosableFileFilter(ff);\n chooser.setAcceptAllFileFilterUsed(true);\n chooser.setFileFilter(ff);\n chooser.showSaveDialog(null);\n this.file = chooser.getSelectedFile();\n //this.file = new File(chooser.getSelectedFile().getName() + INSTANCE.FILE_EXTENSION);\n\n\n try {\n\n if (file != null) {\n this.saveData();\n this.isModifed = false;\n }\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e.getMessage(), \"Error Saving File\", JOptionPane.ERROR_MESSAGE);\n\n }\n\n }", "public void run() {\n\t\t\t\t\t\tJFileChooser chooser = new JFileChooser();\n\n\t\t\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\"CSV Files\", \"csv\");\n\t\t\t\t\t\tchooser.setFileFilter(filter);\n\n\t\t\t\t\t\tint returnVal = chooser.showOpenDialog(startMenu);\n\t\t\t\t\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\t\t\t\t\tFile file = chooser.getSelectedFile();\n\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tcheckAndPlay(file);\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\tpopupWrongFormat.setVisible(true);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Do nothing. Load cancelled by user.\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "private void savePressed(){\n\t\t\n\t\tJFileChooser fileChooser = new JFileChooser(System.getProperty(\"user.dir\"));\n\t\tFileNameExtensionFilter extentions = new FileNameExtensionFilter(\"SuperCalcSave\", \"scalcsave\");\n\t\tfileChooser.setFileFilter(extentions);\n\t\tint retunedVal = fileChooser.showSaveDialog(this);\n\t\tFile file = null;\n\t\tif(retunedVal == JFileChooser.APPROVE_OPTION){\n\t\t\tfile = fileChooser.getSelectedFile();\n\t\t\t//make sure file has the right extention\n\t\t\tif(file.getAbsolutePath().contains(\".scalcsave\"))\n\t\t\t\tfile = new File(file.getAbsolutePath());\n\t\t\telse\n\t\t\t\tfile = new File(file.getAbsolutePath()+\".scalcsave\");\n\t\t}\n\t\t//only continue if a file is selected\n\t\tif(file != null){\t\n\t\t\ttry {\n\t\t\t\t//read in file\n\t\t\t\tObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(file));\n\t\t\t\toutput.writeObject(SaveFile.getSaveFile());\n\t\t\t\toutput.close();\n\t\t\t\tSystem.out.println(\"Save Success\");\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(results.isEmpty())\n\t\t\t\t\treturn;\n\t\t\t\tString collectionName = \toutputTypes_dropDown.getSelectedItem().equals(\"PackageDataSet\")? \"packageDataSets\" : \n\t\t\t\t\t\t\t\t\t\t\toutputTypes_dropDown.getSelectedItem().equals(\"PackageFamily\")? \"packageFamilies\" :\n\t\t\t\t\t\t\t\t\t\t\toutputTypes_dropDown.getSelectedItem().equals(\"File\")? \"files\" :\n\t\t\t\t\t\t\t\t\t\t\toutputTypes_dropDown.getSelectedItem().equals(\"Package\")? \"packages\" :\n\t\t\t\t\t\t\t\t\t\t\toutputTypes_dropDown.getSelectedItem().equals(\"ParentFile\")? \"parentFiles\" :\n\t\t\t\t\t\t\t\t\t\t\toutputTypes_dropDown.getSelectedItem().equals(\"Source\")? \"sources\" : \"\";\n\t\t\t\tnew Thread(new Printer(results, client, dbname_txtfield.getText(), output_txtarea, collectionName)).start();\n\t\t\t}", "static void mainDirectory() throws Exception {\n\t\t// Since we're active while this is running, open a ClientHelper on the port to listen for and respond to requests\n\t\trequestListener = new ClientHelper(port);\n\t\trequestListener.run();\n\t\t// If alive true, we still want to run the program\n\t\tboolean alive = true;\n\t\twhile(alive) {\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"-----------------------------Main Menu:-----------------------------\");\n\t\t\tSystem.out.println(\"---Please enter the option you wish to execute followed by Enter ---\");\n\t\t\tSystem.out.println(\"File Viewing Options:\");\n\t\t\tSystem.out.println(\"\\t[1] | View All Of My Files (Shared And Not Shared)\");\n\t\t\tSystem.out.println(\"\\t[2] | View All Shared Files (Shared By You And Other Users)\");\n\t\t\tSystem.out.println(\"File Sharing Options:\");\n\t\t\tSystem.out.println(\"\\t[3] | Share A File\");\n\t\t\tSystem.out.println(\"\\t[4] | Stop Sharing A File\");\n\t\t\tSystem.out.println(\"File Discovery Options:\");\n\t\t\tSystem.out.println(\"\\t[5] | Search For A File\");\n\t\t\tSystem.out.println(\"System Options:\");\n System.out.println(\"\\t[r] | Refresh File System\");\n\t\t\tSystem.out.println(\"\\t[x] | Log Out\");\n\t\t\tSystem.out.println(\"--------------------------------------------------------------------\");\n\t\t\tSystem.out.print(\"Your Entry: \");\n\n\t\t\t// Get the user's choice\n\t\t\tString userEntry = input.readLine();\n\n\t\t\t// Call the View All Files function which will report the contents of the user's shared and not-shared directories\n\t\t\tif(userEntry.equals(\"1\")) {\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(\"------------------------------My Files------------------------------\");\n\t\t\t\tviewMyFiles();\n\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------\");\n\t\t\t\tSystem.out.println(\"---------------------Returning To The Main Menu---------------------\");\n\t\t\t}\n\n\t\t\t// Call the View Shared Files function which will report all files shared by any user currently on the system\n\t\t\telse if(userEntry.equals(\"2\")) {\n System.out.println();\n System.out.println(\"--------------------------All Shared Files--------------------------\");\n\t\t\t\tviewSharedFiles();\n System.out.println(\"--------------------------------------------------------------------\");\n System.out.println(\"---------------------Returning To The Main Menu---------------------\");\n\t\t\t}\n\n\t\t\t// Call the File Sharing function which will allow the user to add previously non-shared files to a shared status\n\t\t\telse if(userEntry.equals(\"3\")) {\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(\"------------------------File Sharing Utility------------------------\");\n\t\t\t\taddFileToShared();\n\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------\");\n\t\t\t\tSystem.out.println(\"---------------------Returning To The Main Menu---------------------\");\n\t\t\t}\n\n\t\t\t// Call the File Un-Sharing function which will allow the user to add previously shared files to a non-shared status\n\t\t\telse if(userEntry.equals(\"4\")) {\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(\"-----------------------File Un-Sharing Utility----------------------\");\n\t\t\t\tremoveFileFromShared();\n\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------\");\n\t\t\t\tSystem.out.println(\"---------------------Returning To The Main Menu---------------------\");\n\t\t\t}\n\n\t\t\t// Call the File Search function which will allow the user to search for shared files, and if they'd like - download them\n\t\t\telse if(userEntry.equals(\"5\")) {\n\t\t\t\tSystem.out.println(\"-------------------------File Search Utility------------------------\");\n\t\t\t\tsearchForFile();\n\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------\");\n\t\t\t\tSystem.out.println(\"---------------------Returning To The Main Menu---------------------\");\n\t\t\t}\n\n\t\t\t// If the user enters x, this means they want to log out - so log out, and close the requestListener\n\t\t\telse if(userEntry.equals(\"x\") || userEntry.equals(\"X\")) {\n\t\t\t\t// Set alive to false in order to kill the main loop\n\t\t\t\talive = false;\n\t\t\t\tSystem.out.println(\"-----------------------------Logging Out----------------------------\");\n\t\t\t\tlogout();\n\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------\");\n\t\t\t\tSystem.out.println(\"------------------------------Goodbye!------------------------------\");\n\t\t\t\trequestListener.terminate();\n\t\t\t}\n\n\t\t\t// If the user enters r, refresh the main file system\n else if(userEntry.equals(\"r\") || userEntry.equals(\"R\")) {\n System.out.println(\"-----------------------Refreshing File System-----------------------\");\n refreshFileSystem();\n System.out.println(\"--------------------------------------------------------------------\");\n System.out.println(\"---------------------Returning To The Main Menu---------------------\");\n }\n\n // Otherwise, the user has entered an invalid entry - inform them and loop again\n\t\t\telse {\n\t\t\t System.out.println(\"Invalid! Enter the key associated with the option and press Enter.\");\n System.out.println(\"--------------------------------------------------------------------\");\n System.out.println(\"---------------------Returning To The Main Menu---------------------\");\n }\n\t\t}\n\t}", "private void openFile() {\n \n // Initialize local variables\n File clubRecordsFolder = null;\n File opYearFolder = null;\n File eventsFolder = null;\n ClubEventCalc newClubEventCalc = new ClubEventCalc();\n StringDate strDate = newClubEventCalc.getStringDate();\n File result = null;\n String resultName = \"\";\n XFileChooser chooser = new XFileChooser ();\n chooser.setFileSelectionMode(XFileChooser.DIRECTORIES_ONLY);\n boolean ok = true;\n int progress = 0;\n String desiredFolder = \"\";\n while (ok && progress < 3) {\n switch (progress) {\n case 0: \n desiredFolder = \"Folder Containing Club Records\";\n break;\n case 1:\n chooser.setCurrentDirectory(clubRecordsFolder);\n desiredFolder = \"Folder for Desired Operating Year\";\n break;\n case 2:\n chooser.setCurrentDirectory(opYearFolder);\n desiredFolder = \"Events Folder\";\n break;\n }\n chooser.setDialogTitle (\"Specify \" + desiredFolder);\n result = chooser.showOpenDialog (this);\n if (result != null\n && result.exists()\n && result.canRead()\n && result.isDirectory()) {\n resultName = result.getName();\n boolean folderContainsOpYear = strDate.parseOpYear(resultName);\n boolean pathContainsOpYear = newClubEventCalc.setFileName(result);\n if (folderContainsOpYear) {\n opYearFolder = result;\n progress = 2;\n }\n else\n if (pathContainsOpYear) {\n eventsFolder = result;\n progress = 3;\n }\n else\n if (progress < 1) {\n clubRecordsFolder = result;\n progress = 1;\n } else {\n ok = false;\n JOptionPane.showMessageDialog(this,\n \"A Valid Operating Year Folder was not specified\",\n \"Operating Year Folder Missing\",\n JOptionPane.WARNING_MESSAGE,\n Home.getShared().getIcon());\n }\n } else {\n ok = false;\n JOptionPane.showMessageDialog(this,\n \"A Valid \" + desiredFolder + \" was not specified\",\n \"Invalid Folder Specification\",\n JOptionPane.WARNING_MESSAGE,\n Home.getShared().getIcon());\n }\n }\n \n if (ok) {\n closeFile();\n fileSpec = recentFiles.addRecentFile (result);\n handleOpenFile(fileSpec);\n }\n currentFileModified = false;\n }", "public void clickOnSubmitButton() throws FileNotFoundException, IOException, ParseException, InterruptedException\n\t{\n\t\twaitForVisibility(sbmnit);\n\t\tsbmnit.click();\n\t}", "private void actionTimelapseImport ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\r\n\t\t\tJFileChooser folderChooser = new JFileChooser();\r\n\t\t\tfolderChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n\r\n\t\t\tint isFolderSelected = folderChooser.showOpenDialog(folderChooser);\r\n\r\n\t\t\tif (isFolderSelected == JFileChooser.APPROVE_OPTION)\r\n\t\t\t{\r\n\t\t\t\tString folderPath = folderChooser.getSelectedFile().getPath();\r\n\r\n\t\t\t\tDataController.scenarioTimelapseImport(folderPath);\r\n\r\n\t\t\t\thelperDisplayProjectFiles();\r\n\t\t\t\thelperDisplayInputImage();\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage e)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(e);\r\n\t\t}\r\n\t}", "@Override\r\n public void actionPerformed(ActionEvent e) {\r\n JFileChooser fileChooser = new JFileChooser();\r\n fileChooser.setCurrentDirectory(new File(System.getProperty(\"user.home\")));\r\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"*.Images\", \"jpg\", \"gif\", \"png\");\r\n fileChooser.addChoosableFileFilter(filter);\r\n int result1 = fileChooser.showOpenDialog(null);\r\n if(result1 == JFileChooser.APPROVE_OPTION) {\r\n \tselectedFile = fileChooser.getSelectedFile();\r\n \treview.setText(selectedFile.getAbsolutePath());\r\n }\r\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tif (e.getSource() == browseBtn) {\n\t\t\t\t\tfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\t\t\t\t\tint returnVal = fc.showOpenDialog(browseBtn);\n\t\t\t\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\t\t\t\tFile file = fc.getSelectedFile();\n\t\t\t\t\t\tcomboBox.setSelectedItem(file.getAbsolutePath());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tFile projectFile;\n\t\t\t\tint rVal = fileChooser.showOpenDialog(OldTimeTableApp.this);\n\t\t\t\tif(rVal == JFileChooser.APPROVE_OPTION) {\n\t\t\t\t\tprojectFile = fileChooser.getSelectedFile();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcurrentProject.setCourseDetailsFileName(projectFile.getPath());\n\t\t\t\t\t\tupdatePanel(currentProjectFilePath, currentProject.getCourseDetailsFileName(), currentProject.getStudentAllocationDetailsFileName());\n\t\t\t\t\t} catch (Throwable error) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(OldTimeTableApp.this, error, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ttry {\n\t\t\t\t\t//CSVFileStream fs = new CSVFileStream();\n\t\t\t\t\tOldTimeTable.setOutputStream(new CSVFileWriter().getStream(\"D:\\\\Work\\\\Mithril\\\\Unnati\\\\Docs\\\\myOutput.csv\"));\n\t\t\t\t\tOldTimeTable.createTimeTable(currentProject.getCourseDetailsFileName(), currentProject.getStudentAllocationDetailsFileName());\n\t\t\t\t} catch (Throwable error) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\tJOptionPane.showMessageDialog(OldTimeTableApp.this, error, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tFile projectFile;\n\t\t\t\tint rVal = fileChooser.showOpenDialog(OldTimeTableApp.this);\n\t\t\t\tif(rVal == JFileChooser.APPROVE_OPTION) {\n\t\t\t\t\tprojectFile = fileChooser.getSelectedFile();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcurrentProject.setStudentAllocationDetailsFileName(projectFile.getPath());\n\t\t\t\t\t\tupdatePanel(currentProjectFilePath, currentProject.getCourseDetailsFileName(), currentProject.getStudentAllocationDetailsFileName());\n\t\t\t\t\t} catch (Throwable error) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(OldTimeTableApp.this, error, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tJFileChooser fc = new JFileChooser();\r\n\t\t\t\t\tfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n\t\t\t\t\tint result = fc.showOpenDialog(new JFrame());\r\n\t\t\t\t\tif(result == JFileChooser.APPROVE_OPTION){\r\n\t\t\t\t\t\tString path = fc.getSelectedFile().getAbsolutePath();\r\n\t\t\t\t\t\ttfPath.setText(path);\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "public void browse() {\n\t\tJFileChooser chooser = new JFileChooser();\n\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\n\t\t\t\t\"MP3, WAV & WMA music\", \"mp3\", \"wav\", \"wma\");\n\t\tchooser.setFileFilter(filter);\n\t\tint returnVal = chooser.showOpenDialog(uploadPanel);\n\t\tif(returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tuploadPanel.getOriginalFilepathField().setText(\n\t\t\t\t\tchooser.getSelectedFile().getAbsolutePath());\n\t\t\tFile songFile = new File(chooser.getSelectedFile().getAbsolutePath());\n\t\t\tpresentInfo(songFile);\n\t\t}\n\t}", "private static void fileOperation() {\n System.out.println(\"-------------------------------------\");\n String dir = getDirectory();\n File fileDir = new File(dir);\n if (!fileDir.isDirectory()) {\n System.out.println(\"Invalid directory entered, return to main menu\");\n return;\n }\n System.out.println(\"Valid directory entered.\");\n boolean flag = true;\n while (flag) {\n try {\n printFileOperationMenu();\n int op = getUserChoice();\n switch (op) {\n case 1:\n retrieveFiles(fileDir);\n break;\n case 2:\n try {\n addFile(fileDir);\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n break;\n case 3:\n try {\n removeFile(fileDir);\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n break;\n case 4:\n try {\n searchFile(fileDir);\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n break;\n case 5:\n fileDir = changeDirectory(fileDir);\n break;\n case 6:\n flag = false;\n break;\n default:\n System.out.println(\"Invalid entry.\");\n System.out.println(\"Please choose your operation: \");\n op = intScanner.nextInt();\n }\n } catch (InputMismatchException e) {\n System.out.println(\"Invalid entry, please try again.\");\n intScanner.next();\n }\n }\n\n }", "public void onSubmit(View view) throws FileNotFoundException{\n int stress = stress_numbers[stress_number];\n createGraph(\"stress_timestamp.csv\", System.currentTimeMillis(), stress);\n Intent intent = new Intent();\n intent.setClass(this, MainActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n intent.putExtra(\"flag\", EXIT_APPLICATION);\n startActivity(intent);\n }", "private String getInputFilename(JFrame anAppFrame)\n {\n String fn = \"\";\n\n // setup file chooser\n JFileChooser csvChooser = new JFileChooser();\n CSVFileFilter filter = new CSVFileFilter();\n csvChooser.setFileFilter(filter);\n\n // prompt user for input file\n int returnVal = csvChooser.showOpenDialog(anAppFrame);\n\n // process result\n if (returnVal == JFileChooser.APPROVE_OPTION)\n {\n fn = csvChooser.getSelectedFile().getPath();\n if (TRACE)\n System.out.println(\"DataGenModel: opening \" + fn);\n }\n return fn;\n }", "private void setupDirectoryChooser(DirectoryChooser directoryChooser) \n {\n directoryChooser.setTitle(\"Select Directory to save Report\");\n\n // Set Initial Directory\n directoryChooser.setInitialDirectory(new File(System.getProperty(\"user.home\")));\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\n\t\t\t\tchooser.setFileSelectionMode(JFileChooser.FILES_ONLY);\n\t\t\t\t\n\t\t\t\t// customize filter for chooser (only .deck files)\n\t\t\t\tchooser.setFileFilter(new FileFilter() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean accept(File f) {\n\t\t\t\t\t\tif (f.isDirectory()) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t} \n\t\t\t\t\t\t\n\t\t\t\t\t\tString ext = null;\n\t\t\t\t String s = f.getName();\n\t\t\t\t int i = s.lastIndexOf('.');\n\n\t\t\t\t if (i > 0 && i < s.length() - 1) {\n\t\t\t\t ext = s.substring(i+1).toLowerCase();\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t if (ext != null) {\n\t\t\t\t if (ext.equals(\"deck\")) {\n\t\t\t\t return true;\n\t\t\t\t } \n\t\t\t\t else {\n\t\t\t\t return false;\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t return false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t@Override \n\t\t\t\t\tpublic String getDescription() {\n\t\t\t\t return \"MTG Deck Lists (*.deck)\";\n\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t// holds name of file to write to\n\t\t\t\tString filename;\n\t\t\t chooser.showDialog(chooser, \"Save Deck\");\n\t\t\t \n\t\t\t // get the name of file\n\t\t\t\tString ext = null;\n\t\t String s = chooser.getSelectedFile().getName();\n\t\t int i = s.lastIndexOf('.');\n\n\t\t if (i > 0 && i < s.length() - 1) {\n\t\t ext = s.substring(i+1).toLowerCase();\n\t\t }\n\t\t \n\t\t // make sure that there is a .deck on the end, and append it if there is not\n\t\t if (ext == null || !ext.equals(new String(\"deck\")))\n\t\t \tfilename = chooser.getSelectedFile().getAbsolutePath()+\".deck\";\n\t\t else\n\t\t \tfilename = chooser.getSelectedFile().getAbsolutePath();\n\t\t \n\t\t System.out.println(\"Saving to: \" + filename);\n\t\t \n\t\t // write to file\n\t\t try {\n\t\t\t ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(new File(filename)));\n\t\t\t os.writeObject(deck);\n\t\t\t os.close();\n\t\t }\n\t\t // handle exceptions\n\t\t catch (FileNotFoundException ex) {\n\t\t \tex.getStackTrace();\n\t\t }\n\t\t catch (IOException ex) {\n\t\t \tex.getStackTrace();\n\t\t }\n\t\t\t}", "public static void processOneFileSelecction()\n {\n int answer = JSoundsMainWindowViewController.jfcOneFile.showOpenDialog(JSoundsMainWindowViewController.jSoundsMainWindow);\n \n if (answer == JFileChooser.APPROVE_OPTION)\n {\n File actualDirectory = JSoundsMainWindowViewController.jfcOneFile.getCurrentDirectory();\n String directory = actualDirectory.getAbsolutePath() + \"/\" + JSoundsMainWindowViewController.jfcOneFile.getSelectedFile().getName();\n UtilFunctions.listOneFile(JSoundsMainWindowViewController.jfcOneFile.getSelectedFile());\n JSoundsMainWindowViewController.orderBy(true, false, false); \n }\n }", "private void jButtonBrowseInputFilesActionPerformed(ActionEvent e) {\n\t\tJFileChooser fileChooser = new JFileChooser();\n\t\tfileChooser.addChoosableFileFilter(new RootFileFilter());\n\t\tfileChooser.setAcceptAllFileFilterUsed(false);\n\t\tint result = fileChooser.showOpenDialog(this);\n\t\tif (result == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fileChooser.getSelectedFile();\n\t\t\tjTextFieldInputFiles.setText(file.getAbsolutePath());\n\t\t}\n\t}", "public void openFileDialog() {\n\tswitch(buttonAction) {\n\t case SELECT_FILES:\n openFileDialog(fileUpload, true);\n break;\n\t case SELECT_FILE:\n default:\n openFileDialog(fileUpload, false);\n break;\n\t}\n }", "private void browseInputButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseInputButtonActionPerformed\n JFileChooser chooser = new JFileChooser();\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"XLS file\", new String[]{\"xls\", \"xlsx\"});\n chooser.setFileFilter(filter);\n chooser.setCurrentDirectory(new java.io.File(\".\"));\n chooser.setDialogTitle(\"Select a file\");\n chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);\n chooser.setAcceptAllFileFilterUsed(false);\n\n if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {\n FILEPATH.setText(chooser.getSelectedFile().getPath());\n }\n }", "private void openPressed(){\n\t\tJFileChooser fileChooser = new JFileChooser(System.getProperty(\"user.dir\"));\n\t\tFileNameExtensionFilter extentions = new FileNameExtensionFilter(\"SuperCalcSave\", \"scalcsave\");\n\t\tfileChooser.setFileFilter(extentions);\n\t\tint retunedVal = fileChooser.showOpenDialog(this);\n\t\tFile file = null;\n\t\tif(retunedVal == JFileChooser.APPROVE_OPTION){\n\t\t\tfile = fileChooser.getSelectedFile();\n\t\t}\n\t\t//only continue if a file is selected\n\t\tif(file != null){\n\t\t\tSaveFile saveFile = null;\n\t\t\ttry {\n\t\t\t\t//read in file\n\t\t\t\tObjectInputStream input = new ObjectInputStream(new FileInputStream(file));\n\t\t\t\tsaveFile = (SaveFile) input.readObject();\n\t\t\t\tinput.close();\n\t\t\t\tVariable.setList(saveFile.getVariables());\n\t\t\t\tUserFunction.setFunctions(saveFile.getFunctions());\n\t\t\t\tmenuBar.updateFunctions();\n\t\t\t\tSystem.out.println(\"Open Success\");\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public void exportCSV(ActionEvent actionEvent) {\n\t\tLOGGER.info(\"Exportando ficheros CSV\");\n\t\ttry {\n\t\t\tDirectoryChooser dir = new DirectoryChooser();\n\t\t\tFile file = new File(ConfigHelper.getProperty(\"csvFolderPath\", \"./\"));\n\t\t\tif (file.exists() && file.isDirectory()) {\n\t\t\t\tdir.setInitialDirectory(file);\n\t\t\t}\n\n\t\t\tFile selectedDir = dir.showDialog(controller.getStage());\n\t\t\tif (selectedDir != null) {\n\t\t\t\tCSVBuilderAbstract.setPath(selectedDir.toPath());\n\t\t\t\tCharsets charset = controller.getMainConfiguration().getValue(MainConfiguration.GENERAL, \"charset\");\n\t\t\t\tCSVExport.run(charset.get());\n\t\t\t\tUtilMethods.infoWindow(I18n.get(\"message.export_csv_success\") + selectedDir.getAbsolutePath());\n\t\t\t\tConfigHelper.setProperty(\"csvFolderPath\", selectedDir.getAbsolutePath());\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\"Error al exportar ficheros CSV.\", e);\n\t\t\tUtilMethods.errorWindow(I18n.get(\"error.savecsvfiles\"), e);\n\t\t}\n\t}", "private void getFileOrDirectory() {\r\n // display file dialog, so user can choose file or directory to open\r\n JFileChooser fileChooser = new JFileChooser();\r\n\t fileChooser.setCurrentDirectory(new File(System.getProperty(\"user.dir\")));\r\n fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES );\r\n\r\n int result = fileChooser.showOpenDialog(this);\r\n\r\n // if user clicked Cancel button on dialog, return\r\n if (result == JFileChooser.CANCEL_OPTION )\r\n System.exit( 1 );\r\n\r\n File name = fileChooser.getSelectedFile(); // get File\r\n\r\n // display error if invalid\r\n if ((name == null) || (name.getName().equals( \"\" ))){\r\n JOptionPane.showMessageDialog(this, \"Invalid Name\",\r\n \"Invalid Name\", JOptionPane.ERROR_MESSAGE );\r\n System.exit( 1 );\r\n } // end if\r\n\t \r\n\t filename = name.getPath();\r\n }", "@Override\n public void actionPerformed(ActionEvent e){\n JFileChooser fileChooser = new JFileChooser();\n int status = fileChooser.showOpenDialog(null);\n \n //Check if user selected to open something\n if (status == JFileChooser.APPROVE_OPTION) {\n //Read the data from the file \n File fileToOpen = fileChooser.getSelectedFile();\n \n try {\n //Read in the game objects to the ArrayList\n FileInputStream fis = new FileInputStream(fileToOpen);\n ObjectInputStream ois = new ObjectInputStream(fis);\n games = (ArrayList<Game>) ois.readObject();\n \n //Close the file\n fis.close();\n ois.close();\n } catch (FileNotFoundException ex) {\n JOptionPane.showMessageDialog(null, \"Error: File not found\");\n } catch (IOException ex) {\n JOptionPane.showMessageDialog(null, \"Error: File I/O problem\");\n } catch (ClassNotFoundException ex) {\n JOptionPane.showMessageDialog(null, \"Error: Class not found\");\n }\n \n //Tell the user that it opened successfully\n JOptionPane.showMessageDialog(null,\"Loaded in past game data from: \" + fileToOpen.getAbsolutePath());\n }\n }", "public void actionPerformed(ActionEvent e) {\n\t \tJFileChooser fileChooser = new JFileChooser(lastChoosenDir);\n\t int returnValue = fileChooser.showOpenDialog(null);\n\t if (returnValue == JFileChooser.APPROVE_OPTION) {\n\t selectedFile = fileChooser.getSelectedFile();\n\t lastChoosenDir = selectedFile.getParentFile();\n\t System.out.println(selectedFile.getName());\n\t // lblSlika=new JLabel(\"aa\");\n\t displayChosen();\n\t \n\t // content.add(lblSlika);\n\t \n\t }\n\t }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tuploadButton.setLabel(\"Uploading...\");\n\t\t\t\tsubmitConfiguration();\n\t\t\t\tuploadButton.setLabel(\"Upload\");\n\t\t\t}", "private void openPathButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_openPathButtonActionPerformed\n\tFile savePath = PlatypusGUI.getInstance().getLastSavePath();\n\tif (savePath.isDirectory()) {\n\t try {\n\t\tDesktop.getDesktop().open(savePath);\n\t } catch (IOException ex) {\n\t\tex.printStackTrace();\n\t }\n\t}\n }", "private void showFileChooser(){\n\t\t//Create the file chooser with a default directory of the last downloadPath (default will be user.home\\Downloads\\)\n\t\tJFileChooser chooser = new JFileChooser(downloadPath);\n\t\t//Allow the file chooser to only select directories\n\t\tchooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\t\t//Set the title\n\t\tchooser.setDialogTitle(\"Choose where to save your images\");\n\t\t//If the user chose a directory, then set the new path\n\t\tif(chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION){\t\n\t\t\tdownloadPath = chooser.getSelectedFile().getAbsolutePath() + File.separator;\n\t\t}\n\t\t//If the user did not choose a directory, then reset to default path\n\t\telse{\n\t\t\tsetDefaultPath();\n\t\t}\n\t\t//Check to see if the path is completed by a \\\n\t\tif(!downloadPath.endsWith(File.separator)){\n\t\t\tdownloadPath += File.separator;\n\t\t}\n\t\t//Update to let the user see where their files are downloaded\n\t\tcurrentPath.setText(downloadPath);\n\t\tcurrentPath.setToolTipText(downloadPath);\n\t}", "private void makeAPlayListPressed() {\n\t\t// get all the selected options and their file paths and then store them in the file with a each file and its path \n\t\t// seperated from the next one by a a newline character so they can be split at that point.\n\n\t\tplaylist = allMedia.getSelectedValuesList();\n\n\t\t// get all the paths of the selected items and put them in a list and make sure that they are not zero\n\t\tif(playlist.size() != 0){\n\n\t\t\tJOptionPane.showMessageDialog(null,\"The making og the playlist takes couple of minutes! Please let it run in the back!\");\n\t\t\t// now open up a jfile chooser and make the user pick a directory and make a folder\n\t\t\t// with the name of the playlist.. The name of the text file is the location chosen and \n\t\t\t// the name of the playlist\n\t\t\t// open up a option pane and get the name of a playlist.\n\t\t\tplaylistName.setVisible(true);\n\t\t\tfor(Object o : playlist){\n\t\t\t\tallPathPlaylist.add(paths.get(o.toString()));\n\t\t\t}\n\t\t\twriteToFile();\n\t\t}\n\n\t}", "@FXML\n private void chooseNewDirEvent() throws IOException {\n DirectoryChooser chooser = new DirectoryChooser();\n chooser.setTitle(\"Choose Home Directory\");\n Stage curStage = (Stage) rootPane.getScene().getWindow();\n File selectedDirectory = chooser.showDialog(curStage);\n if (selectedDirectory != null) {\n model.User.setRootDir(selectedDirectory);\n model.DirectoryManager.set(selectedDirectory);\n model.User.setGalleryPhotos(model.DirectoryManager.getTree().getDir().getPhotos());\n fadeOutEvent();\n } else {\n curStage.show();\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tsaveFile();\n\t\t\t}", "private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed\r\n\r\n int returnVal = getOutChooser().showOpenDialog(this);\r\n \r\n if(returnVal == JFileChooser.APPROVE_OPTION) {\r\n try {\r\n Utils.saveFile(blackWords.getText(), getOutChooser().getSelectedFile());\r\n \r\n } catch (FileNotFoundException ex) {\r\n ex.printStackTrace();\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n \r\n putWizardData(\"blacksaved\", \"false\");\r\n }", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) \n\t{\n\t\t\n\t\t\n\t\tJFileChooser fileChooser = new JFileChooser(); //fichero a grabar.\n\t\t\n\t\tint seleccion=fileChooser.showSaveDialog(null);\t\t\n\t\t\n\t\t\n\t\tString mensajeError=\"\";\n\t\tswitch (seleccion) {// si es o.k pues lo guardo.\n\t\tcase JFileChooser.APPROVE_OPTION:\t\t\t\t\t\n\t\t\ttry {\n\t\t\t\telementosBackup.getClasificacion().escribirFicheroTexto(fileChooser.getSelectedFile().getPath()+\".txt\");\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif(mensajeError.length()==0) {\n\t\t\t\tJLabel label = new JLabel(\"Datos guardados correctamente en \"+fileChooser.getSelectedFile().getPath()+\".txt\");\n\t\t\t\tObject[] ob = {label};\n\t\t\t\tJOptionPane.showMessageDialog(null, ob, \"Guardar datos\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t}\n\t\t\telse \n\t\t\t\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(null, mensajeError, \"Guardar datos\", JOptionPane.ERROR_MESSAGE);\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\n\t\t}\n\t}", "private void openFolderButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openFolderButtonActionPerformed\n String path = FileIO.getPathOfExecutable() + \"reports\";\n File reportsDirectory = new File(path);\n if (!reportsDirectory.exists() || !reportsDirectory.isDirectory()) return;\n\n try {\n java.awt.Desktop.getDesktop().open(reportsDirectory);\n } catch (IOException ex) {\n Logger.getLogger(SimulationView.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void selectButtonActionPerformed(java.awt.event.ActionEvent evt) {\n\t\tCyFileFilter tempCFF = new CyFileFilter();\n\n\t\tFile file = FileUtil.getFile(\"Import Network Files\", FileUtil.LOAD);\n\n\t\tfileNameTextField.setText(file.getAbsolutePath());\n\t\trunButton.setEnabled(true);\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n\n final String gameName = request.getParameter(Constants.GAME_NAME_ATTRIBUTE_NAME);\n final String creatorName = SessionUtils.getSessionUsername(request);\n final Part filePart = request.getPart(\"file\"); // Retrieves <input type=\"file\" name=\"file\">\n final String fileName = getSubmittedFileName(filePart);\n\n try {\n InputStream fileContent = filePart.getInputStream();\n File outputTempFile = InputFileUtils.inputStreamToFile(fileContent, DIRECTORY_NAME, FILE_NAME_START + tempSaveCounter++, \"xml\");\n\n GameConfig gameConfig = new GameConfig();\n gameConfig.load(outputTempFile);\n Game game = gameConfig.initiateGameFromGenerated();\n\n int currentGameVersion = SessionUtils.getGameVersion(request);\n\n processGameRecord(gameName, creatorName, game, currentGameVersion);\n\n request.getSession().setAttribute(Constants.GAME_NAME_ATTRIBUTE_NAME, gameName);\n request.getSession().setAttribute(Constants.PLAYER_TYPE_ATTRIBUTE, Player.Type.PLAYER_ONE);\n System.out.println(\"GameRecord inserted successfully\");\n\n response.sendRedirect(Constants.GAME_URI);\n //DEBUG: System.out.println(\"The game \" + gameName + \" was saved on session \" + request.getSession().toString());\n } catch (RecordAlreadyExistsException e) {\n // player is already in game, transfer to its game\n //request.getSession().setAttribute(Constants.GAME_NAME_ATTRIBUTE_NAME, gameName);\n response.sendRedirect(Constants.DUPLICATE_GAME_URI);\n\n } catch (JAXBException | ConfigException e) {\n // error in parsing file\n handleErrorInParsingFile(request, response, fileName, e);\n }\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(downloadPath.equals(\"\")){\n\t\t\t\t\tsetDefaultPath();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Obtain the text from the imgurURL text field\n\t\t\t\timgurURL = \"https://www.imgur.com/a/\" + imgurURLField.getText().trim();\n\t\t\t\t\n\t\t\t\t//Match the imgurURL to regex\n\t\t\t\tPattern p = Pattern.compile(validURL);\n\t\t\t\tMatcher m = p.matcher(imgurURL);\n\t\t\t\t\n\t\t\t\t//If valid URL\n\t\t\t\tif (m.matches()){\n\t\t\t\t\t//Disable fileType while download process sets up so user cannot interfere\n\t\t\t\t\tfileType.setEnabled(false);\n\t\t\t\t\t//Use the swing event dispatcher to create a new Downloading window which will\n\t\t\t\t\t//execute any download processes\n\t\t\t\t\tEventQueue.invokeLater(new Runnable() {\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\tDownloadingWindow frame = new DownloadingWindow(imgurURL, downloadPath);\n\t\t\t\t\t\t\t\tframe.setVisible(true);\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t//If invalid URL, show warning message and return to main window\n\t\t\t\telse{\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Invalid URL has been entered.\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\tfileType.setSelectedItem(0);\n\t\t\t\t}\n\t\t\t\t//Reset the text\n\t\t\t\timgurURLField.setText(\"\");\n\t\t\t}", "private void browseOutputFilePath()\n\t{\n\t\tString filedirectory = \"\";\n\t\tString filepath = \"\";\n\t\ttry\n\t\t{\n\t\t\tJFileChooser fc = new JFileChooser(\".\");\n\t\t\tfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); //select directories or files\n\t\t\tfc.setDialogTitle(\"Please choose a directory to save the converted file(s)\");\n\n\t\t\tFileNameExtensionFilter sifdata = new FileNameExtensionFilter(\"SIF\", \"sif\");\n\t\t\tfc.addChoosableFileFilter(sifdata);\n\n\t\t\tint returnVal = fc.showOpenDialog(this); // shows the dialog of the file browser\n\t\t\t// get name und path\n\t\t\tif(returnVal == JFileChooser.APPROVE_OPTION)\n\t\t\t{\n\t\t\t\tmainframe.setOutputTextfieldText(fc.getSelectedFile().getAbsolutePath());\n\t\t\t}\n\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tJOptionPane\n\t\t\t\t\t.showMessageDialog(new JFrame(),\n\t\t\t\t\t\t\t\"Problem when trying to choose an output : \" + e.toString(),\n\t\t\t\t\t\t\t\"Warning\", JOptionPane.WARNING_MESSAGE);\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "static void addFileToShared() {\n\t\ttry {\n\t\t\tint fileMatchNumber = 0;\n\n\t\t\t// Get the current path of the user's not-shared files\n\t\t\tFile notSharedPath = new File(\"users/\" + username +\"/not-shared\");\n\t\t\t// Get the contents of the directory and store it in an array\n\t\t\tFile[] notSharedFiles = notSharedPath.listFiles();\n\n\t\t\tSystem.out.println(\"Non-Shared Files: \");\n\t\t\t// If the user has no non-shared files, let them know.\n\t\t\tif (notSharedFiles.length == 0) {\n\t\t\t\tSystem.out.println(\"\\t --- \" + username + \" has no non-shared files. ---\");\n System.out.println();\n\t\t\t\t// This has been added in order to allow the user to review the results before going back to the main menu\n\t\t\t\t// Upon pressing Enter, the main menu will come back up again and ready for a new menu option to be selected\n try {\n System.out.println(\"Press any key to return\");\n input.readLine();\n } catch (Exception e) {\n System.out.println(\"Error! \" + e.getMessage());\n }\n return;\n\t\t\t}\n\n\t\t\t// If the directory has files in it, print them on the screen to help the user with selection\n\t\t\tfor(File file : notSharedFiles) {\n\t\t\t\tSystem.out.println(\"\\t + \" + file.getName());\n\t\t\t}\n\t\t\t// Let the user enter which file they would like to share\n System.out.println();\n\t\t\tSystem.out.println(\"Enter the name of the file you wish to share followed by Enter\");\n\t\t\tSystem.out.print(\"Your Entry: \");\n\n\t\t\tString fileToShare = input.readLine();\n\n\t\t\t// If the filename the user has entered is in the directory, then set the fileMatchNumber to be 1\n\t\t\tfor (int i = 0; i < notSharedFiles.length; i++) {\n\t\t\t\tif (fileToShare.equals(notSharedFiles[i].getName())) {\n\t\t\t\t\tfileMatchNumber = 1;\n\t\t\t\t}\n\t\t\t}\n System.out.println();\n\t\t\t// If the fileMatchNumber is equal to 1, then pass the request to the database via the CORBA server to register the file as available for sharing\n\t\t\tif (fileMatchNumber == 1) {\n\t\t\t\tSystem.out.println(server.startFileShare(username, fileToShare));\n\n\t\t\t\t// Now, copy the file to the shared directory and remove it from the user's not-shared directory\n\t\t\t\tFile nonSharedFileToMove = new File(\"users/\" + username +\"/not-shared/\" + fileToShare);\n\t\t\t\tif(nonSharedFileToMove.renameTo(new File(\"users/\" + username +\"/shared/\" + fileToShare))) {\n\t\t\t\t\tnonSharedFileToMove.delete();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Otherwise, the user entered an invalid filename\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------\");\n\t\t\t\tSystem.out.println(\"You have entered an invalid file name.\");\n\t\t\t}\n\t\t}\n\t\t// Catch any errors and terminate the function\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"Error! : \" + e.getMessage());\n\t\t\treturn;\n\t\t}\n System.out.println();\n\t\t// This has been added in order to allow the user to review the results before going back to the main menu\n\t\t// Upon pressing Enter, the main menu will come back up again and ready for a new menu option to be selected\n try {\n System.out.println(\"Press any key to return\");\n input.readLine();\n } catch (Exception e) {\n System.out.println(\"Error! \" + e.getMessage());\n }\n\t}", "public void actionPerformed(ActionEvent e) {\r\n\t\tcontroller.createUserDatabaseFile();\r\n\t\t\r\n\t\t// If backToMain button is pressed\r\n\t\tif (e.getActionCommand().equals(\"Back to Main\")) {\r\n\t\t\t// Goes back to main screen\r\n\t\t\tcontroller.mainScreenFrame();\r\n\t\t\tdispose();\r\n\t\t}\r\n\t\t\r\n\t\tint selected_index = (int) mediaTypeSelected.getSelectedIndex();\r\n\r\n\t\t\t// If mediaTypeSelected is changed these actions occur\r\n\t\t\tif (e.getActionCommand().equals(\"Media Select\")) {\r\n\t\t\t\t// Checks which item is selected in the combo box and sets up the screen\r\n\t\t\t\t// appropriately\r\n\t\t\t\tswitch (selected_index) {\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\tchangePanel(selected_index);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tchangePanel(selected_index);\r\n\t\t\t\t\taddedText.setVisible(false);\r\n\t\t\t\t\tchooseMediaText.setVisible(false);\r\n\t\t\t\t\tCDsSelected.titleField.setText(\"\");\r\n\t\t\t\t\tCDsSelected.artistField.setText(\"\");\r\n\t\t\t\t\tCDsSelected.genreField.setText(\"\");\r\n\t\t\t\t\tCDsSelected.descriptionTextArea.setText(\"\");\r\n\t\t\t\t\tCDsSelected.enterTitleText.setText(\" \");\r\n\t\t\t\t\tCDsSelected.enterArtistText.setText(\" \");\r\n\t\t\t\t\tCDsSelected.enterGenreText.setText(\" \");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// If add button is pressed\r\n\t\t\tif (e.getActionCommand().equals(\"Add\")) {\r\n\t\t\t\tcheck_add = true;\r\n\r\n\t\t\t\t// Checks which item is selected in the combo box and checks to make sure\r\n\t\t\t\t// all the fields are filled in\r\n\t\t\t\tswitch (selected_index) {\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\tchooseMediaText.setBounds(276, 128, 150, 20);\r\n\t\t\t\t\tchooseMediaText.setVisible(true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tcheckCD();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tif ((check_add) && (selected_index != 0)) {\r\n\t\t\t\t\t// Adds item to database and clears the text fields\r\n\t\t\t\t\tcontroller.appendMediaDatabase(title, artist, genre, description);\r\n\t\t\t\t\taddedText.setVisible(true);\r\n\t\t\t\t\tmediaTypeSelected.setSelectedIndex(0);\r\n\t\t\t\t\tCDsSelected.titleField.setText(\"\");\r\n\t\t\t\t\tCDsSelected.artistField.setText(\"\");\r\n\t\t\t\t\tCDsSelected.genreField.setText(\"\");\r\n\t\t\t\t\tCDsSelected.descriptionTextArea.setText(\"\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tGraphVisHandler.saveImageByType(viz, System.getProperty(\"user.dir\") + \"/..\", graphFile, true, pw, 400, 400, CommonDef.ISMAPPING);\n\t\t\t\tSystem.out.println(\"---------\");\n\t\t\t\t\n\t\t\t\t//Upload\n\t\t\t\t\n\t\t\t}", "public void setDir() throws FileNotFoundException, IOException{\r\n final JFileChooser jfc = new JFileChooser();\r\n jfc.setDialogTitle(\"Choose Workplace Dirtory\");\r\n FileSystemView fsv = FileSystemView.getFileSystemView();\r\n //wppath stores workplace location\r\n wppath = fsv.getDefaultDirectory();\r\n File rd = new File(wppath.getAbsolutePath() + \"/USQ_Reporter.txt\");\r\n int ext = 0;\r\n if(rd.exists())ext=1;\r\n if(!rd.exists())ext=2;\r\n FileReader fr; \r\n if(rd.exists()){\r\n fr= new FileReader(rd);\r\n if(fr.read()==-1)\r\n ext=2;\r\n }\r\n //System.out.println(ext);\r\n //workplace path\r\n if(ext==1) {\r\n BufferedReader br = new BufferedReader(new FileReader(rd));\r\n workplace = br.readLine();\r\n }else if (ext==2) {\r\n jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n int returnVal = jfc.showOpenDialog(this);\r\n \r\n if(returnVal == JFileChooser.APPROVE_OPTION) {\r\n File file = jfc.getSelectedFile();\r\n if(!file.exists()) {\r\n JOptionPane.showMessageDialog(null, \"file doesn't exist.\", \"System Message\", JOptionPane.ERROR_MESSAGE);\r\n } else if(file.isDirectory()) {\r\n workplace = file.getAbsolutePath();\r\n }\r\n }\r\n BufferedWriter bw = new BufferedWriter(new FileWriter(rd));\r\n bw.write(workplace);\r\n bw.flush();\r\n bw.close();\r\n }\r\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent ae) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\"HALTING Files\", EXT);\n\t\t\t\tchooser.setFileFilter(filter);\n\t\t\t\tint choice = chooser.showSaveDialog(MainWindow.this);\n\t\t\t\tif (choice != JFileChooser.APPROVE_OPTION)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\t// ensure correct extension\n\t\t\t\tFile file = chooser.getSelectedFile();\n\t\t\t\tif (! file.getName().endsWith(\".\" + EXT))\n\t\t\t\t\tfile = new File(file + \".\" + EXT);\n\t\t\t\tString filename = file.getAbsolutePath();\n\n\t\t\t\t// attempt to output automaton to file\n\t\t\t\ttry {\n\t\t\t\t\toutputToFile(filename);\n\t\t\t\t\t\n\t\t\t\t\t// delete the original (if overwriting)\n\t\t\t\t\tif (file.exists())\n\t\t\t\t\t\tFiles.delete(file.toPath());\n\t\t\t\t\t\n\t\t\t\t\t// rename the tmp file\n\t\t\t\t\tFile newFile = new File(filename + \".tmp\");\n\t\t\t\t\tif (!newFile.renameTo(file))\n\t\t\t\t\t\tthrow new FileError(file.getAbsolutePath(), true);\n\t\t\t\t}\n\t\t\t\t// warn the user about a failure\n\t\t\t\tcatch (Exception e) {\n\t\t\t\t\tString msg = e.getMessage();\n\t\t\t\t\treportException(new FileError(msg == null ? filename \n\t\t\t\t\t\t\t : msg, true));\n\t\t\t\t}\n\t\t\t}", "private void promptNewIndexFile()\n {\n JPanel message = new JPanel(new GridLayout(2, 1));\n JLabel messageLabel = new JLabel(\"Enter name for new index database\");\n JPanel defaultWrapper = new JPanel();\n JLabel defaultLabel = new JLabel(\"Make this the default index? \");\n JCheckBox makeDefault = new JCheckBox(); \n \n defaultWrapper.add(defaultLabel);\n defaultWrapper.add(makeDefault);\n message.add(defaultWrapper);\n message.add(messageLabel);\n \n String fileName = JOptionPane.showInputDialog(null, message, \"Create new index file\", JOptionPane.OK_CANCEL_OPTION);\n if(fileName != null && !fileName.equalsIgnoreCase(\"\"))\n {\n spider.setIndexer(Indexer.createIndexer(\"data/\" + fileName + \".db\"));\n searchEngine.setIndexer(spider.getIndexer());\n \n if(makeDefault.isSelected())\n {\n spider.getConfig().setDatabaseFile(\"data/\" + fileName + \".db\");\n spider.updateConfig();\n }\n }\n }", "private static void saveActionPerformed(){\r\n JFileChooser chooser = new JFileChooser();\r\n chooser.setDialogType(JFileChooser.OPEN_DIALOG);\r\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"Text files\", \"txt\");\r\n chooser.setFileFilter(filter);\r\n int returnVal = chooser.showOpenDialog(frame);\r\n if (returnVal == JFileChooser.APPROVE_OPTION) { \r\n try(BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(chooser.getSelectedFile()), \"UTF-8\"))){\r\n writeChosenSchedule(bw); \r\n \r\n JOptionPane.showMessageDialog(null, \"The schedule was successfully saved.\",\r\n \"Info\", JOptionPane.INFORMATION_MESSAGE);\r\n }\r\n catch(IOException e){\r\n Logger.getLogger(\"File saving\").log(Level.WARNING, \"Could not write to the file\", e);\r\n JOptionPane.showMessageDialog(null, \"Failed to save the schedule to the chosen file!\",\r\n \"Error\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }\r\n }", "private void promptOpenIndexFile()\n {\n JPanel message = new JPanel(new GridLayout(3, 1));\n JLabel messageLabel = new JLabel(\"Enter the location of the index .db file\");\n JPanel defaultWrapper = new JPanel(new FlowLayout(FlowLayout.LEFT));\n JPanel inputWrapper = new JPanel();\n JButton fileOpenButton = new JButton(\"Find\");\n JLabel defaultLabel = new JLabel(\"Make this the default index? \");\n JCheckBox makeDefault = new JCheckBox(); \n JTextField fileField = new JTextField();\n fileField.setPreferredSize(new Dimension(200, 25));\n \n \n defaultWrapper.add(defaultLabel);\n defaultWrapper.add(makeDefault);\n inputWrapper.add(fileField);\n inputWrapper.add(fileOpenButton);\n message.add(defaultWrapper);\n message.add(messageLabel);\n message.add(inputWrapper);\n \n fileOpenButton.addActionListener((ActionEvent e) -> \n {\n JFileChooser jfc = new JFileChooser();\n int fileOpt = jfc.showOpenDialog(null);\n \n if(fileOpt == JFileChooser.APPROVE_OPTION)\n fileField.setText(jfc.getSelectedFile().getPath());\n });\n \n int option = JOptionPane.showConfirmDialog(null, message, \"Open index file\", JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);\n if(option != JOptionPane.CANCEL_OPTION)\n {\n String fileName = fileField.getText();\n spider.setIndexer(Indexer.createIndexer(fileName));\n searchEngine.setIndexer(spider.getIndexer());\n \n if(makeDefault.isSelected())\n {\n spider.getConfig().setDatabaseFile(fileName);\n spider.updateConfig();\n }\n }\n }", "private void actionSaveOutput ()\r\n\t{\r\n\t\ttry\r\n\t\t{\t\t\t\r\n\t\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t\tif (tableSize != 0)\r\n\t\t\t{\r\n\t\t\t\tJFileChooser saveFileChooser = new JFileChooser();\r\n\r\n\t\t\t\tFileNameExtensionFilter typeCSV = new FileNameExtensionFilter(\"CSV\", \"csv\", \"CSV\");\r\n\t\t\t\tsaveFileChooser.addChoosableFileFilter(typeCSV);\r\n\r\n\t\t\t\tFileNameExtensionFilter typeTXT = new FileNameExtensionFilter(\"TXT\", \"txt\", \"TXT\");\r\n\t\t\t\tsaveFileChooser.addChoosableFileFilter(typeTXT);\r\n\r\n\t\t\t\tsaveFileChooser.setAcceptAllFileFilterUsed(false);\r\n\t\t\t\tsaveFileChooser.setFileFilter(typeCSV);\r\n\r\n\t\t\t\tint isOpen = saveFileChooser.showOpenDialog(saveFileChooser);\r\n\r\n\t\t\t\tif (isOpen == JFileChooser.APPROVE_OPTION) \r\n\t\t\t\t{\r\n\t\t\t\t\tString filePath = saveFileChooser.getSelectedFile().getPath();\r\n\r\n\t\t\t\t\tint indexImage = mainFormLink.getComponentPanelLeft().getComponentComboboxFileName().getSelectedIndex();\r\n\r\n\t\t\t\t\t/*!*/DebugLogger.logMessage(\"Saving output of a single image \" + indexImage + \" to file \" + filePath, LOG_MESSAGE_TYPE.INFO);\r\n\r\n\t\t\t\t\tif (indexImage >= 0 && indexImage < tableSize)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (saveFileChooser.getFileFilter().equals(typeCSV))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (!filePath.substring(filePath.length() - 4).equals(\".csv\")) { filePath += \".csv\"; }\r\n\r\n\t\t\t\t\t\t\t//---- Save file in a CSV format\r\n\t\t\t\t\t\t\tOutputController.saveFile(filePath, DataController.getTable(), indexImage, OutputController.OUTPUT_FORMAT.CSV);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (!filePath.substring(filePath.length() - 4).equals(\".txt\")) { filePath += \".txt\"; }\r\n\r\n\t\t\t\t\t\t\t//---- Save file in a txt format\r\n\t\t\t\t\t\t\tOutputController.saveFile(filePath, DataController.getTable(), indexImage, OutputController.OUTPUT_FORMAT.TXT);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage exception)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(exception);\r\n\t\t}\r\n\t}", "private void initializeHome() {\n\t\t\t\thomeFrame = new JFrame(\"Tool Page\");\n\t\t\t\thomeFrame.getContentPane().setBackground(Color.LIGHT_GRAY);\n\t\t\t\thomeFrame.setBackground(Color.WHITE);\n\t\t\t\thomeFrame.setResizable(false);\n\t\t\t\thomeFrame.setTitle(\"Tools\");\n\t\t\t\thomeFrame.setSize(367, 142);\n\t\t\t\thomeFrame.setLocationRelativeTo(null);\n\t\t\t\thomeFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\t\thomeFrame.getContentPane().setLayout(null);\n\t\t\t\thomeFrame.setVisible(true);\n\t\t\t\t\n\t\t\t\tJLabel CSVLabel = new JLabel(\"Import .CSV\");\n\t\t\t\tCSVLabel.setBounds(10,11,162,33);\n\t\t\t\tCSVLabel.setFont(new Font(\"Trebuchet MS\", Font.PLAIN, 24));\n\t\t\t\thomeFrame.getContentPane().add(CSVLabel);\n\t\t\t\t\n\t\t\t\tfileCSVloc = new JTextField();\n\t\t\t\tfileCSVloc.setText(\"[\\\"c:/location/address.csv\\\" OR \\\"rootFolder.csv\\\"]\");\n\t\t\t\tfileCSVloc.setEditable(true);\n\t\t\t\tfileCSVloc.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\n\t\t\t\tfileCSVloc.setBounds(10, 55, 334, 33);\n\t\t\t\tfileCSVloc.setColumns(10);\n\t\t\t\thomeFrame.getContentPane().add(fileCSVloc);\n\t\t\t\t\n\t\t\t\tJButton importCSV = new JButton(\"Import .CSV\");\n\t\t\t\timportCSV.setForeground(new Color(0, 0, 0));\n\t\t\t\timportCSV.setBackground(Color.GRAY);\n\t\t\t\timportCSV.setFont(new Font(\"Trebuchet MS\", Font.PLAIN, 14));\n\t\t\t\timportCSV.setBounds(145, 11, 162, 33);\n\t\t\t\thomeFrame.getContentPane().add(importCSV);\n\n\t\t\t\tuserPass = new JTextField();\n\t\t\t\tuserPass.setEditable(true);\n\t\t\t\tuserPass.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\n\t\t\t\tuserPass.setBounds(200, 120, 162, 33);\n\t\t\t\tuserPass.setColumns(10);\n\t\t\t\t\n\t\t\t\timportCSV.addActionListener(new ActionListener() {\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\t//import csv\n\t\t\t\t\t\tComponent frame = null;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif(read.read(fileCSVloc.getText())==1)\n\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(frame, \"Import has reported success.\");\n\t\t\t\t\t\t\tif(read.read(fileCSVloc.getText())==0)\n\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(frame, \"Import failed: file not found.\");\n\t\t\t\t\t\t} catch (HeadlessException e1) {\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tString fileName = primeFileNameField.getText();\n\t\t\t\tif(FileAccess.savePrimes(primes, fileName) != true) {\n\t\t\t\t\tupdateValues(\"Unable to save Primes into file named: \" + fileName);\n\t\t\t\t}else {\n\t\t\t\t\tupdateValues(\"Successful Saved primes into file: \" + fileName);\n\t\t\t\t}\n\t\t\t}", "@Override\n public void actionPerformed(ActionEvent ae) {\n if (ae.getSource() == btnAbrir) {\n JFileChooser fileChooser = new JFileChooser(System.getProperty(\"user.home\"));\n fileChooser.setFileFilter(new FolderFilter());\n fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\n int returnValue = fileChooser.showDialog(this, \"Escolha o diretório para o seu projeto\");\n if (returnValue == JFileChooser.APPROVE_OPTION) {\n File file = fileChooser.getSelectedFile();\n\n String caminho = file.getAbsolutePath();\n\n txtCaminho.setText(caminho);\n } else {\n\n }\n\n }\n }", "private String getUploadFileName() {\r\n\t\tJFileChooser fc = new JFileChooser(\"./\");\r\n\t\tint returnVal = fc.showOpenDialog(this);\r\n\t\tif (returnVal != JFileChooser.APPROVE_OPTION) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\tFile quizFile = fc.getSelectedFile();\r\n\t\treturn quizFile.getAbsolutePath();\r\n\t}", "private void export(ActionEvent actionEvent) {\n if (this.totalCycles == -1) {\n var result = JOptionPane.showConfirmDialog(this, \"The run is not finished yet. Are you sure you want to proceed?\",\n \"Unfinished run\", JOptionPane.YES_NO_CANCEL_OPTION);\n\n if (result == JOptionPane.NO_OPTION) {\n return;\n }\n }\n\n // File dialog to save the history\n var fileChooser = new JFileChooser();\n fileChooser.setFileFilter(new FileFilter() {\n @Override\n public boolean accept(File file) {\n return file.getName().endsWith(\".json\");\n }\n\n @Override\n public String getDescription() {\n return \"*.json\";\n }\n });\n\n fileChooser.setAcceptAllFileFilterUsed(false);\n fileChooser.setCurrentDirectory(new File(Variables.OUTPUT_PATH));\n var resultDialog = fileChooser.showSaveDialog(this);\n\n if (resultDialog == JFileChooser.APPROVE_OPTION) {\n var file = fileChooser.getSelectedFile();\n\n if (!file.getName().endsWith(\".json\")) {\n file = new File(file.getAbsolutePath() + \".json\");\n }\n if (file.exists()) {\n var sure = JOptionPane.showConfirmDialog(this, \"File already exists. Overwrite?\",\n \"Overwrite file?\", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);\n\n if (sure != JOptionPane.YES_OPTION) {\n return;\n }\n }\n\n this.saveHistoryToFile(file);\n }\n }" ]
[ "0.61112463", "0.5998459", "0.58664143", "0.58572954", "0.58566254", "0.57577205", "0.5718901", "0.56875056", "0.5651956", "0.56335264", "0.5584564", "0.55827326", "0.5582444", "0.5571084", "0.55688", "0.55673254", "0.55467534", "0.55392045", "0.5505891", "0.5485307", "0.5468018", "0.54540104", "0.54424345", "0.5440728", "0.5427166", "0.5426986", "0.5407562", "0.5388518", "0.53774464", "0.53768235", "0.5374418", "0.5341048", "0.532754", "0.5320281", "0.5300004", "0.5281095", "0.5274256", "0.52550596", "0.5247607", "0.5241608", "0.5239296", "0.5229211", "0.522859", "0.52276665", "0.52230537", "0.5216137", "0.52055514", "0.5194958", "0.51837003", "0.5179437", "0.5171945", "0.5164934", "0.5149824", "0.51465124", "0.51340765", "0.51272017", "0.5120676", "0.5116346", "0.5114817", "0.5114194", "0.51113975", "0.5109888", "0.5108249", "0.51060236", "0.5085758", "0.508267", "0.50705165", "0.5064582", "0.5048314", "0.5042664", "0.5038437", "0.50335634", "0.5019986", "0.50167406", "0.5014324", "0.50126463", "0.500913", "0.50053525", "0.5005141", "0.50026286", "0.50014573", "0.49916458", "0.49904388", "0.49897382", "0.49853924", "0.4983404", "0.4981885", "0.49690312", "0.4968734", "0.49685922", "0.49653", "0.49624416", "0.49585122", "0.49305674", "0.49282396", "0.4928099", "0.4927211", "0.49264213", "0.49200258", "0.49176365" ]
0.79933894
0
For simplicity we create a minimal response, as there is already a dedicated test class for search response parsing and serialization.
private static SearchResponse createSearchResponse() { long tookInMillis = randomNonNegativeLong(); int totalShards = randomIntBetween(1, Integer.MAX_VALUE); int successfulShards = randomIntBetween(0, totalShards); int skippedShards = randomIntBetween(0, totalShards); InternalSearchResponse internalSearchResponse = InternalSearchResponse.empty(); return new SearchResponse( internalSearchResponse, null, totalShards, successfulShards, skippedShards, tookInMillis, ShardSearchFailure.EMPTY_ARRAY, SearchResponse.Clusters.EMPTY ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Response createResponse();", "private Response() {}", "private Response() {}", "private Response() {\n initFields();\n }", "public SearchResponse(JSONObject json) throws JSONException {\r\n super(json);\r\n }", "TypedResponse createTypedResponse();", "private SearchResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public SearchResponse<T, P> build(Pageable searchRequest, QueryResponse queryResponse) {\n // Create response\n SearchResponse<T, P> searchResponse = new SearchResponse<T, P>(searchRequest);\n searchResponse.setCount(queryResponse.getResults().getNumFound());\n searchResponse.setLimit(queryResponse.getResults().size());\n // The results and facets are copied into the response\n final List<ST> resultsST = queryResponse.getBeans(annotatedClass);\n // convert types\n final List<T> results = Lists.newArrayList();\n for (ST x : resultsST) {\n results.add(x);\n }\n searchResponse.setResults(results);\n searchResponse.setFacets(getFacetsFromResponse(queryResponse));\n setHighlightedFields(searchResponse, queryResponse);\n if(queryResponse.getSpellCheckResponse() != null){\n searchResponse.setSpellCheckResponse(SpellCheckResponseBuilder.build(queryResponse.getSpellCheckResponse()));\n }\n return searchResponse;\n }", "public BasicResponse() {\n }", "@Override\n\tpublic Response construct() {\n\t\treturn null;\n\t}", "@Test\n\tpublic void testResponse() throws IOException {\n\t\tConfigurationManager config = new ConfigurationManager();\n\t\tHashMap<String, Handler> map = new HashMap<String,Handler>();\n\t\tHashMap<String, String> parameters = new HashMap<String, String>();\n\t\tcheckResponse(new RequestObject(\"\", \"\", parameters), HTTPConstants.BAD_REQUEST, map);\n\t\tcheckResponse(new RequestObject(\"PUT\", \"/reviewsearch\", parameters), HTTPConstants.NOT_ALLOWED, map);\n\t\tcheckResponse(new RequestObject(\"PULL\", \"/slackbot\", parameters), HTTPConstants.NOT_ALLOWED, map);\n\t\tcheckResponse(new RequestObject(\"GET\", \"/slackbot\", parameters), HTTPConstants.NOT_FOUND, map);\n\t\tcheckResponse(new RequestObject(\"POST\", \"/slackbot\", parameters), HTTPConstants.NOT_FOUND, map);\n\t\tmap.put(\"/slackbot\", new ChatHandler(config.getConfig()));\n\t\tcheckResponse(new RequestObject(\"POST\", \"/slackbot\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tcheckResponse(new RequestObject(\"POST\", \"/reviewsearch\", parameters), HTTPConstants.NOT_FOUND, map);\n\t\tmap.put(\"/reviewsearch\", new ReviewSearchHandler(config.getConfig(), new InvertedIndex()));\n\t\tcheckResponse(new RequestObject(\"POST\", \"/reviewsearch\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tparameters.put(\"query\", \"jumpers\");\n\t\tcheckResponse(new RequestObject(\"POST\", \"/reviewsearch\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tparameters.put(\"unknown\", \"unknown\");\n\t\tcheckResponse(new RequestObject(\"POST\", \"/reviewsearch\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tparameters.remove(\"query\");\n\t\tcheckResponse(new RequestObject(\"GET\", \"/reviewsearch\", parameters), HTTPConstants.OK_HEADER, map);\n\t\tcheckResponse(new RequestObject(\"GET\", \"/\", parameters), HTTPConstants.NOT_FOUND, map);\n\t}", "entities.Torrent.SearchResponse getSearchResponse();", "public static AccSearchResponse parse(\r\n javax.xml.stream.XMLStreamReader reader)\r\n throws java.lang.Exception {\r\n AccSearchResponse object = new AccSearchResponse();\r\n\r\n int event;\r\n javax.xml.namespace.QName currentQName = null;\r\n java.lang.String nillableValue = null;\r\n java.lang.String prefix = \"\";\r\n java.lang.String namespaceuri = \"\";\r\n\r\n try {\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n currentQName = reader.getName();\r\n\r\n if (reader.getAttributeValue(\r\n \"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"type\") != null) {\r\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"type\");\r\n\r\n if (fullTypeName != null) {\r\n java.lang.String nsPrefix = null;\r\n\r\n if (fullTypeName.indexOf(\":\") > -1) {\r\n nsPrefix = fullTypeName.substring(0,\r\n fullTypeName.indexOf(\":\"));\r\n }\r\n\r\n nsPrefix = (nsPrefix == null) ? \"\" : nsPrefix;\r\n\r\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\r\n \":\") + 1);\r\n\r\n if (!\"AccSearchResponse\".equals(type)) {\r\n //find namespace for the prefix\r\n java.lang.String nsUri = reader.getNamespaceContext()\r\n .getNamespaceURI(nsPrefix);\r\n\r\n return (AccSearchResponse) ExtensionMapper.getTypeObject(nsUri,\r\n type, reader);\r\n }\r\n }\r\n }\r\n\r\n // Note all attributes that were handled. Used to differ normal attributes\r\n // from anyAttributes.\r\n java.util.Vector handledAttributes = new java.util.Vector();\r\n\r\n reader.next();\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n if ((reader.isStartElement() &&\r\n new javax.xml.namespace.QName(\r\n \"http://tempuri.org/\", \"AccSearchResult\").equals(\r\n reader.getName())) ||\r\n new javax.xml.namespace.QName(\"\", \"AccSearchResult\").equals(\r\n reader.getName())) {\r\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"nil\");\r\n\r\n if (\"true\".equals(nillableValue) ||\r\n \"1\".equals(nillableValue)) {\r\n throw new org.apache.axis2.databinding.ADBException(\r\n \"The element: \" + \"AccSearchResult\" +\r\n \" cannot be null\");\r\n }\r\n\r\n java.lang.String content = reader.getElementText();\r\n\r\n object.setAccSearchResult(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(\r\n content));\r\n\r\n reader.next();\r\n } // End of if for expected property start element\r\n\r\n else {\r\n }\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n if (reader.isStartElement()) {\r\n // 2 - A start element we are not expecting indicates a trailing invalid property\r\n throw new org.apache.axis2.databinding.ADBException(\r\n \"Unexpected subelement \" + reader.getName());\r\n }\r\n } catch (javax.xml.stream.XMLStreamException e) {\r\n throw new java.lang.Exception(e);\r\n }\r\n\r\n return object;\r\n }", "private CallResponse() {\n initFields();\n }", "public Response(){\n\t\t// nothing needed\n\t}", "public TOUReadResponse()\r\n\t{\r\n\t}", "public SearchResponse(String from, String to, UUID uuid, Set<Entry> results) {\r\n super(from, to, new JSONObject()\r\n .put(\"type\", MessageType.SEARCH_RESPONSE.name())\r\n .put(\"status\", \"ok\")\r\n .put(\"id\", uuid.toString())\r\n .put(\"results\", new JSONArray()));\r\n for(Entry result : results)\r\n getPayload().getJSONArray(\"results\").put(result.serialize());\r\n }", "public Response() {\n objectMap = new JSONObject<>();\n }", "public QueryResponse(Query q) {\n this.q = q;\n this.docIDs = new HashSet<>();\n }", "public entities.Torrent.SearchResponse.Builder getSearchResponseBuilder() {\n\n onChanged();\n return getSearchResponseFieldBuilder().getBuilder();\n }", "@SuppressWarnings(\"unused\")\n private RunUnitTestsResponse() {\n this((TestResultInfo) null, -1, -1);\n }", "@Override\n\tpublic BaseResponse testResponse() {\n\t\treturn setResultSuccess();\n\t}", "public MetadataResponse() {\n data = new HashMap<String, Object>();\n }", "@Override\n\tpublic BaseHttpResponse createResponse() {\n\t\treturn null;\n\t}", "HarvestResponseType createHarvestResponseType();", "public GetResponseTest() {\n\t\t/*\n\t\t * This constructor should not be modified. Any initialization code\n\t\t * should be placed in the setUp() method instead.\n\t\t */\n\n\t}", "@Test\n public void testDocumentsResponse() {\n DocumentsResponse testResponse = new DocumentsResponse(testDocList);\n checkDocumentsList(testResponse);\n }", "public abstract String getResponse();", "private WebResponse() {\n initFields();\n }", "public interface ResponseParser {\r\n\t\r\n\tList<Place> parseSearchResponse(String rawJson) throws Exception;\r\n\t\r\n\tList<Place> parseFilteredSearchResponse(String rawJson) throws Exception;\r\n\r\n}", "public void parseResponse();", "public Builder setSearchResponse(entities.Torrent.SearchResponse value) {\n if (searchResponseBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n searchResponse_ = value;\n onChanged();\n } else {\n searchResponseBuilder_.setMessage(value);\n }\n\n return this;\n }", "public MetadataResponse() {\n }", "public SearchResponse(String from, String to, UUID uuid, String error) {\r\n super(from, to, new JSONObject()\r\n .put(\"type\", MessageType.SEARCH_RESPONSE.name())\r\n .put(\"status\", \"error\")\r\n .put(\"id\", uuid.toString())\r\n .put(\"message\", error));\r\n }", "public interface SearchVerses {\n @GET(\"/api/?type=json\")\n void searchForVerse(@Query(\"passage\") String passage, Callback<List<Verse>> callback);\n \n @GET(\"/api/?type=json\")\n List<Verse> listVerses(@Query(\"passage\") String passage);\n\n// public static class SearchResponse {\n// VerseContent response;\n//\n// public List<Verse> getVerses() {\n// return response.verses;\n// }\n// }\n\n public static class Verse {\n public String bookname;\n public String chapter;\n public String verse;\n public String text;\n public String title;\n }\n\n class VerseContent {\n List<Verse> verses;\n }\n}", "private CityResponse mockCityResponse() {\n List<String> cityLocales = new ArrayList<String>(Collections.singleton(\"en\"));\n Map<String, String> cityNames = new HashMap<>();\n cityNames.put(\"en\", \"New York\");\n City city = new City(cityLocales, 1, 1, cityNames);\n\n List<String> countryNames = new ArrayList<>(Collections.singleton(\"United States\"));\n Country country = new Country(countryNames, 1, 1, \"US\", new HashMap());\n\n Location location = new Location(1, 1, 40.760498D, -73.9933D, 501, 1, \"EST\");\n\n Postal postal = new Postal(\"10036\", 1);\n\n return new CityResponse(city, new Continent(), country, location, new MaxMind(), postal,\n country, new RepresentedCountry(), new ArrayList<>(0),\n new Traits());\n }", "@Override\r\n\tpublic SampleResponse getSomedata() {\r\n\r\n\t\tsampleResponse.setMoney(SampleConstants.MONEY);\r\n\t\t\r\n\t\tMap<String, String> hashmap = new HashMap<String, String>();\r\n\t\thashmap.put(\"testkey\", \"testValue\");\r\n\t\thashmap.put(\"testkey1\", \"testValue1\");\r\n\t\tsampleResponse.setAdditionalPorperties(hashmap);\r\n\r\n\t\treturn sampleResponse;\r\n\t}", "@Override\r\n\tprotected GuardarSustentoResponse responseText(String json) {\n\t\tGuardarSustentoResponse guardarSustentoResponse = JSONHelper.desSerializar(json, GuardarSustentoResponse.class);\r\n\t\treturn guardarSustentoResponse;\r\n\t}", "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 }", "Object visitorResponse();", "public com.webobjects.appserver.WOResponse readResponse(){\n return null; //TODO codavaj!!\n }", "@Test\n\t@Ignore\n\tpublic void testResponse() throws UnsupportedEncodingException {\n\t\tws = resource().path(\"omxdata\");\n\t\tClientResponse response = ws.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);\n\t\tassertEquals(200, response.getStatus());\n\t\tSystem.out.println(response.getStatus());\n\t}", "public <T> CustomResponse getResponse(String url);", "public interface RawContentResponse {\n /**\n * Gets the input stream for the response.\n *\n * @return the input stream\n */\n Optional<String> getResponseBody();\n\n /**\n * Gets the state of the response.\n *\n * @return the response state\n */\n ResponseState getState();\n\n /**\n * Gets the type of error, if any.\n *\n * @return the error type, or {@link ErrorType#UNKNOWN} on a non-error\n */\n ErrorType getErrorType();\n\n /**\n * Gets the number of pages in the response.\n *\n * @return the page count, or absent if the endpoint isn't paginated\n */\n Optional<Integer> getPageCount();\n\n /**\n * Returns true if the server gave a deprecation warning during this request.\n *\n * @return true if route is deprecated\n */\n default boolean isDeprecated() {\n return false;\n }\n\n /**\n * Gets the ETag associated with this request.\n *\n * @return the ETag, optionally\n */\n default Optional<String> getETag() {\n return Optional.empty();\n }\n\n /**\n * Gets the date that the data in the response becomes expired.\n *\n * @return the expiry date\n */\n Optional<ZonedDateTime> getExpiryDate();\n\n static RawContentResponse.Builder builder() {\n return new Builder() {\n private final Response.ResponseBuilder responseBuilder = new Response.ResponseBuilder();\n\n private ResponseState state = ResponseState.SUCCESS;\n private ErrorType errorType = ErrorType.UNKNOWN;\n private boolean deprecated = false;\n private String etag = null;\n private ZonedDateTime expiryDate = null;\n\n @Override\n public Builder setState(final ResponseState state) {\n this.state = state;\n return this;\n }\n\n @Override\n public Builder setErrorType(final ErrorType errorType) {\n this.errorType = errorType;\n return this;\n }\n\n @Override\n public Builder setDeprecated(final boolean deprecated) {\n this.deprecated = deprecated;\n return this;\n }\n\n public Builder setETag(final String etag) {\n this.etag = etag;\n return this;\n }\n\n @Override\n public Builder setExpiryDate(final ZonedDateTime expiryDate) {\n this.expiryDate = expiryDate;\n return this;\n }\n\n @Override\n public Builder accumulate(final HttpResponseStatus status) {\n responseBuilder.accumulate(status);\n return this;\n }\n\n @Override\n public Builder accumulate(final HttpResponseHeaders headers) {\n responseBuilder.accumulate(headers);\n return this;\n }\n\n @Override\n public Builder accumulate(final HttpResponseBodyPart bodyPart) {\n responseBuilder.accumulate(bodyPart);\n return this;\n }\n\n @Override\n public RawContentResponse build() {\n return new Impl(responseBuilder.build(), state, errorType, deprecated, etag, expiryDate);\n }\n };\n }\n\n interface Builder {\n @SuppressWarnings(\"UnusedReturnValue\")\n Builder setState(ResponseState state);\n @SuppressWarnings(\"UnusedReturnValue\")\n Builder setErrorType(ErrorType errorType);\n @SuppressWarnings(\"UnusedReturnValue\")\n Builder setDeprecated(boolean deprecated);\n @SuppressWarnings(\"UnusedReturnValue\")\n Builder setETag(String etag);\n @SuppressWarnings(\"UnusedReturnValue\")\n Builder setExpiryDate(ZonedDateTime expiryDate);\n @SuppressWarnings(\"UnusedReturnValue\")\n Builder accumulate(final HttpResponseStatus status);\n @SuppressWarnings(\"UnusedReturnValue\")\n Builder accumulate(final HttpResponseHeaders headers);\n @SuppressWarnings(\"UnusedReturnValue\")\n Builder accumulate(final HttpResponseBodyPart bodyPart);\n RawContentResponse build();\n }\n\n class Impl implements RawContentResponse {\n private final Response response;\n private final ResponseState state;\n private final ErrorType errorType;\n private final boolean deprecated;\n private final String etag;\n private final ZonedDateTime expiryDate;\n\n private Impl(@Nullable Response response, ResponseState state, ErrorType errorType, final boolean deprecated, final String etag, final ZonedDateTime expiryDate) {\n this.response = response;\n this.state = state;\n this.errorType = errorType;\n this.deprecated = deprecated;\n this.etag = etag;\n this.expiryDate = expiryDate;\n }\n\n @Override\n public Optional<String> getResponseBody() {\n if (null == response) {\n return Optional.empty();\n }\n\n return Optional.ofNullable(response.getResponseBody());\n }\n\n @Override\n public ResponseState getState() {\n return state;\n }\n\n @Override\n public ErrorType getErrorType() {\n return errorType;\n }\n\n @Override\n public Optional<Integer> getPageCount() {\n if (null != response && response.getHeaders().contains(Constants.PAGE_COUNT_RESPONSE_HEADER)) {\n final String pageCount = response.getHeader(Constants.PAGE_COUNT_RESPONSE_HEADER);\n\n if (null != pageCount) {\n return Optional.of(Integer.valueOf(pageCount));\n }\n }\n return Optional.empty();\n }\n\n @Override\n public boolean isDeprecated() {\n return deprecated;\n }\n\n @Override\n public Optional<String> getETag() {\n return Optional.ofNullable(etag);\n }\n\n @Override\n public Optional<ZonedDateTime> getExpiryDate() {\n return Optional.ofNullable(expiryDate);\n }\n }\n}", "private TestResponse(com.google.protobuf.GeneratedMessageLite.Builder builder) {\n super(builder);\n\n }", "@Test\n public void testGetResponse_1()\n throws Exception {\n Transaction fixture = new Transaction();\n fixture.setResponse(new Response());\n fixture.setRequest(new Request());\n\n Response result = fixture.getResponse();\n\n assertNotNull(result);\n assertEquals(null, result.getBody());\n assertEquals(null, result.getFirstLine());\n assertEquals(null, result.getBodyAsString());\n assertEquals(\"\", result.extractContentType());\n }", "public static <T, ST extends T, P extends SearchParameter> SearchResponse<T, P> buildSuggestReponse(\n Pageable searchRequest, QueryResponse queryResponse, Class<ST> annotatedClass) {\n // Create response\n SearchResponse<T, P> searchResponse = new SearchResponse<T, P>(searchRequest);\n searchResponse.setCount(queryResponse.getResults().getNumFound());\n searchResponse.setLimit(queryResponse.getResults().size());\n // The results and facets are copied into the response\n final List<ST> resultsST = queryResponse.getBeans(annotatedClass);\n // convert types\n final List<T> results = Lists.newArrayList();\n for (ST x : resultsST) {\n results.add(x);\n }\n searchResponse.setResults(results);\n return searchResponse;\n }", "public QueryResponseInner() {\n }", "@Nonnull\n private Response buildResponse(javax.ws.rs.core.Response response) {\n checkMediaType(response);\n return new Response(response.getStatus(), response.readEntity(String.class));\n }", "@Override\r\n\tpublic Response buildResponse(JSONObject json) {\r\n\r\n\t\tResponseBuilder builder = Response.ok(json);\r\n\t\tbuilder.header(CROS, STAR);\r\n\t\treturn builder.build();\r\n\t}", "public ApiResponse() {\n }", "public static GetsfzyResponse parse(\r\n javax.xml.stream.XMLStreamReader reader)\r\n throws java.lang.Exception {\r\n GetsfzyResponse object = new GetsfzyResponse();\r\n\r\n int event;\r\n javax.xml.namespace.QName currentQName = null;\r\n java.lang.String nillableValue = null;\r\n java.lang.String prefix = \"\";\r\n java.lang.String namespaceuri = \"\";\r\n\r\n try {\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n currentQName = reader.getName();\r\n\r\n if (reader.getAttributeValue(\r\n \"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"type\") != null) {\r\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"type\");\r\n\r\n if (fullTypeName != null) {\r\n java.lang.String nsPrefix = null;\r\n\r\n if (fullTypeName.indexOf(\":\") > -1) {\r\n nsPrefix = fullTypeName.substring(0,\r\n fullTypeName.indexOf(\":\"));\r\n }\r\n\r\n nsPrefix = (nsPrefix == null) ? \"\" : nsPrefix;\r\n\r\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\r\n \":\") + 1);\r\n\r\n if (!\"GetsfzyResponse\".equals(type)) {\r\n //find namespace for the prefix\r\n java.lang.String nsUri = reader.getNamespaceContext()\r\n .getNamespaceURI(nsPrefix);\r\n\r\n return (GetsfzyResponse) ExtensionMapper.getTypeObject(nsUri,\r\n type, reader);\r\n }\r\n }\r\n }\r\n\r\n // Note all attributes that were handled. Used to differ normal attributes\r\n // from anyAttributes.\r\n java.util.Vector handledAttributes = new java.util.Vector();\r\n\r\n reader.next();\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n if ((reader.isStartElement() &&\r\n new javax.xml.namespace.QName(\r\n \"http://tempuri.org/\", \"GetsfzyResult\").equals(\r\n reader.getName())) ||\r\n new javax.xml.namespace.QName(\"\", \"GetsfzyResult\").equals(\r\n reader.getName())) {\r\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"nil\");\r\n\r\n if (\"true\".equals(nillableValue) ||\r\n \"1\".equals(nillableValue)) {\r\n throw new org.apache.axis2.databinding.ADBException(\r\n \"The element: \" + \"GetsfzyResult\" +\r\n \" cannot be null\");\r\n }\r\n\r\n java.lang.String content = reader.getElementText();\r\n\r\n object.setGetsfzyResult(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(\r\n content));\r\n\r\n reader.next();\r\n } // End of if for expected property start element\r\n\r\n else {\r\n }\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n if (reader.isStartElement()) {\r\n // 2 - A start element we are not expecting indicates a trailing invalid property\r\n throw new org.apache.axis2.databinding.ADBException(\r\n \"Unexpected subelement \" + reader.getName());\r\n }\r\n } catch (javax.xml.stream.XMLStreamException e) {\r\n throw new java.lang.Exception(e);\r\n }\r\n\r\n return object;\r\n }", "public WCSResponseSerializer()\r\n {\r\n }", "@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 }", "private BaseResponse completeResponseDetail(BaseResponse baseResp, String json) throws IOException {\n String code = baseResp.getCode();\n String text = baseResp.getText();\n \n BaseResponse resultResp = null;\n switch(code) {\n case TEXT:\n resultResp = baseResp;\n break;\n case LINK:\n resultResp = mapper.readValue(json, LinkResponse.class);\n break;\n case NEWS:\n resultResp = mapper.readValue(json, new TypeReference<ListResponse<News>>(){});\n break;\n case TRAIN:\n resultResp = mapper.readValue(json, new TypeReference<ListResponse<TrainInfo>>(){});\n break;\n case FLIGHT:\n resultResp = mapper.readValue(json, new TypeReference<ListResponse<FlightInfo>>(){});\n break;\n case RECIPE:\n resultResp = mapper.readValue(json, new TypeReference<ListResponse<Recipe>>(){});\n break;\n default:\n throw new IOException(String.format(\"Error Code: %s, Message: %s\", code, text));\n }\n \n return resultResp;\n }", "OptimizeResponse() {\n\n\t}", "private SearchResponseBuilder(Class<T> responseClass, Class<ST> annotatedClass,\n BiMap<String, P> solrField2ParamEnumMap,\n BiMap<String, String> solrField2javaPropertiesMap) {\n this.responseClass = responseClass;\n this.annotatedClass = annotatedClass;\n this.solrField2ParamEnumMap = solrField2ParamEnumMap;\n this.solrField2javaPropertiesMap = solrField2javaPropertiesMap;\n keyField = getKeyField(annotatedClass);\n }", "public TrackResponse() {\n\t\tsuper();\n\t}", "@Override\r\n\tprotected ConsultarIndiceEjecucionAnioResponse responseText(String json) {\n\t\tConsultarIndiceEjecucionAnioResponse response = JSONHelper.desSerializar(json, ConsultarIndiceEjecucionAnioResponse.class);\r\n\t\treturn response;\r\n\t}", "@Override\r\n public ResponseEntity<PersonaResponse> testNombre( ) {\r\n PersonaResponse response = new PersonaResponse();\r\n response.setNombre(\"Abdiel\");\r\n response.setApellidoP(\"cruz\");\r\n response.setApellidoM(\"Mendoza\");\r\n return new ResponseEntity<PersonaResponse>(response,HttpStatus.OK);\r\n }", "protected abstract Object buildJsonObject(R response);", "public MessageResponse() {\r\n\t}", "private LocalSearchResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public PageResponse build() {\n return new PageResponse(this);\n }", "public OrderResponseBuilder() {\r\n orderResponse = new OrderResponse();\r\n }", "entities.Torrent.LocalSearchResponse getLocalSearchResponse();", "public BookResponse() {\n }", "private ReflectionResponse(Builder builder) {\n super(builder);\n }", "public entities.Torrent.LocalSearchResponse.Builder getLocalSearchResponseBuilder() {\n\n onChanged();\n return getLocalSearchResponseFieldBuilder().getBuilder();\n }", "public WeatherResponse() {\n }", "@Override\r\n\tprotected GuardarVtaCeroMotivoResponse responseText(String json) {\n\t\tGuardarVtaCeroMotivoResponse guardarVtaCeroMotivoResponse = JSONHelper.desSerializar(json, GuardarVtaCeroMotivoResponse.class);\r\n\t\treturn guardarVtaCeroMotivoResponse;\r\n\t}", "private RequestResponse handleSearchRequest(Request request, Response response) throws ServiceException {\n response.type(\"application/json\");\n\n String core = request.params(\":core\");\n if (StringUtils.isEmpty(core)) {\n throw new ServiceException(\"Failed to provide an index core for the document\");\n }\n\n SearchParameters searchParameters = new RequestToSearchParameters().convert(request);\n return this.searchService.query(core, searchParameters);\n }", "boolean hasSearchResponse();", "@Override\r\n\tprotected ActualizarCompromisoResponse responseText(String json) {\n\t\tActualizarCompromisoResponse response = JSONHelper.desSerializar(json, ActualizarCompromisoResponse.class);\r\n\t\treturn response;\r\n\t}", "public interface FrequentlyRelatedItemHttpResponseParser {\n public FrequentlyRelatedItemSearchResponse[] parse(String json);\n}", "public QuoteResponse() {\n }", "java.lang.String getResponse();", "private <T extends MwsObject> T newResponse(\n Class<T> cls) {\n InputStream is = null;\n try {\n is = this.getClass().getResourceAsStream(cls.getSimpleName()+\".xml\");\n MwsXmlReader reader = new MwsXmlReader(is);\n T obj = cls.newInstance();\n obj.readFragmentFrom(reader);\n ResponseHeaderMetadata rhmd = new ResponseHeaderMetadata(\n \"mockRequestId\", Arrays.asList(\"A\",\"B\",\"C\"), \"mockTimestamp\", 0d, 0d, new Date());\n cls.getMethod(\"setResponseHeaderMetadata\", rhmd.getClass()).invoke(obj, rhmd);\n return obj;\n } catch (Exception e) {\n throw MwsUtl.wrap(e);\n } finally {\n MwsUtl.close(is);\n }\n }", "entities.Torrent.SearchResponseOrBuilder getSearchResponseOrBuilder();", "public Builder setSearchResponse(\n entities.Torrent.SearchResponse.Builder builderForValue) {\n if (searchResponseBuilder_ == null) {\n searchResponse_ = builderForValue.build();\n onChanged();\n } else {\n searchResponseBuilder_.setMessage(builderForValue.build());\n }\n\n return this;\n }", "public RawAggregateUniqueResponse() {\n }", "@SuppressWarnings(\"JavaUtilDate\")\n public OAIPMHtype build() {\n response.setRequest(requestType);\n GregorianCalendar cal = new GregorianCalendar();\n cal.setGregorianChange(new Date());\n try {\n response.setResponseDate(DatatypeFactory.newInstance().newXMLGregorianCalendar(cal));\n } catch (DatatypeConfigurationException ex) {\n LOGGER.error(\"Failed to set response date to OAI-PMH response.\", ex);\n }\n\n if (!isError()) {\n switch (verb) {\n case IDENTIFY:\n response.setIdentify(identifyType);\n break;\n case LIST_METADATA_FORMATS:\n response.setListMetadataFormats(listMetadataFormatsType);\n break;\n case LIST_SETS:\n response.setListSets(listSetsType);\n break;\n case GET_RECORD:\n response.setGetRecord(getRecordType);\n break;\n case LIST_IDENTIFIERS:\n response.setListIdentifiers(listIdentifiers);\n break;\n case LIST_RECORDS:\n response.setListRecords(listRecordsType);\n break;\n }\n }\n\n return response;\n }", "protected ErrorResponse()\n {\n super();\n }", "protected void buildResponse() {\r\n appendResponse(\"<?xml version=\\\"1.0\\\" standalone=\\\"no\\\"?>\\r\\n\");\r\n appendResponse(\"<!DOCTYPE RETS SYSTEM \\\"RETS-20021015.dtd\\\">\\r\\n\");\r\n appendResponse(\"<RETS ReplyCode=\\\"\");\r\n appendResponse(replyCode);\r\n appendResponse(\"\\\" ReplyText=\\\"\");\r\n appendResponse(replyText);\r\n appendResponse(\"\\\"\");\r\n\r\n if (getReplyCode() != REPLY_CODE_SUCCESS) {\r\n cat.debug(\"*****ERROR\");\r\n appendResponse(\" />\");\r\n } else {\r\n appendResponse(\" >\\n\");\r\n\r\n fillContent();\r\n\r\n appendResponse(\"</RETS>\\r\\n\");\r\n }\r\n\r\n cat.debug(\"RESPONSE ::\" + this.response.toString());\r\n }", "public entities.Torrent.SearchResponse getSearchResponse() {\n if (searchResponseBuilder_ == null) {\n return searchResponse_ == null ? entities.Torrent.SearchResponse.getDefaultInstance() : searchResponse_;\n } else {\n return searchResponseBuilder_.getMessage();\n }\n }", "@java.lang.Override\n public entities.Torrent.SearchResponseOrBuilder getSearchResponseOrBuilder() {\n return getSearchResponse();\n }", "@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}", "@Override\n\t\t\t\t\tpublic void onResponse(String s) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public SuccessResponse() {\r\n super(HttpStatus.OK, \"Successfully processed the request.\");\r\n }", "public abstract Response create(Request request, Response response);", "public Response hello() {\n \t\t\n \t\treturn new StreamingResponse(\"text/xml\", \"<a f=\\\"\" + this.parameters.get(\"y\") + \"\\\" />\");\n \t}", "public abstract Response[] collectResponse();", "private void getResponse() {\n response = new Response();\n\n getResponseCode();\n getResponseMessage();\n getResponseBody();\n\n LOG.info(\"--- RESPONSE ---\");\n LOG.info(\"Code: \" + response.getResponseCode());\n LOG.info(\"Message: \" + response.getResponseMessage());\n LOG.info(\"Body: \" + response.getResponseBody());\n LOG.info(\"*************************************\");\n }", "@Nonnull\n public static UBL23WriterBuilder <OrderResponseSimpleType> orderResponseSimple ()\n {\n return UBL23WriterBuilder.create (OrderResponseSimpleType.class);\n }", "SearchResponse search(SearchRequest searchRequest) throws IOException;", "public static NetTestResponse parse(\r\n javax.xml.stream.XMLStreamReader reader)\r\n throws java.lang.Exception {\r\n NetTestResponse object = new NetTestResponse();\r\n\r\n int event;\r\n javax.xml.namespace.QName currentQName = null;\r\n java.lang.String nillableValue = null;\r\n java.lang.String prefix = \"\";\r\n java.lang.String namespaceuri = \"\";\r\n\r\n try {\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n currentQName = reader.getName();\r\n\r\n if (reader.getAttributeValue(\r\n \"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"type\") != null) {\r\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"type\");\r\n\r\n if (fullTypeName != null) {\r\n java.lang.String nsPrefix = null;\r\n\r\n if (fullTypeName.indexOf(\":\") > -1) {\r\n nsPrefix = fullTypeName.substring(0,\r\n fullTypeName.indexOf(\":\"));\r\n }\r\n\r\n nsPrefix = (nsPrefix == null) ? \"\" : nsPrefix;\r\n\r\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\r\n \":\") + 1);\r\n\r\n if (!\"NetTestResponse\".equals(type)) {\r\n //find namespace for the prefix\r\n java.lang.String nsUri = reader.getNamespaceContext()\r\n .getNamespaceURI(nsPrefix);\r\n\r\n return (NetTestResponse) ExtensionMapper.getTypeObject(nsUri,\r\n type, reader);\r\n }\r\n }\r\n }\r\n\r\n // Note all attributes that were handled. Used to differ normal attributes\r\n // from anyAttributes.\r\n java.util.Vector handledAttributes = new java.util.Vector();\r\n\r\n reader.next();\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n if ((reader.isStartElement() &&\r\n new javax.xml.namespace.QName(\r\n \"http://tempuri.org/\", \"NetTestResult\").equals(\r\n reader.getName())) ||\r\n new javax.xml.namespace.QName(\"\", \"NetTestResult\").equals(\r\n reader.getName())) {\r\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"nil\");\r\n\r\n if (\"true\".equals(nillableValue) ||\r\n \"1\".equals(nillableValue)) {\r\n throw new org.apache.axis2.databinding.ADBException(\r\n \"The element: \" + \"NetTestResult\" +\r\n \" cannot be null\");\r\n }\r\n\r\n java.lang.String content = reader.getElementText();\r\n\r\n object.setNetTestResult(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(\r\n content));\r\n\r\n reader.next();\r\n } // End of if for expected property start element\r\n\r\n else {\r\n }\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n if (reader.isStartElement()) {\r\n // 2 - A start element we are not expecting indicates a trailing invalid property\r\n throw new org.apache.axis2.databinding.ADBException(\r\n \"Unexpected subelement \" + reader.getName());\r\n }\r\n } catch (javax.xml.stream.XMLStreamException e) {\r\n throw new java.lang.Exception(e);\r\n }\r\n\r\n return object;\r\n }", "public ResponseSummaries() {\n }", "public static MainMethodResponse parse(\r\n javax.xml.stream.XMLStreamReader reader)\r\n throws java.lang.Exception {\r\n MainMethodResponse object = new MainMethodResponse();\r\n\r\n int event;\r\n javax.xml.namespace.QName currentQName = null;\r\n java.lang.String nillableValue = null;\r\n java.lang.String prefix = \"\";\r\n java.lang.String namespaceuri = \"\";\r\n\r\n try {\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n currentQName = reader.getName();\r\n\r\n if (reader.getAttributeValue(\r\n \"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"type\") != null) {\r\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"type\");\r\n\r\n if (fullTypeName != null) {\r\n java.lang.String nsPrefix = null;\r\n\r\n if (fullTypeName.indexOf(\":\") > -1) {\r\n nsPrefix = fullTypeName.substring(0,\r\n fullTypeName.indexOf(\":\"));\r\n }\r\n\r\n nsPrefix = (nsPrefix == null) ? \"\" : nsPrefix;\r\n\r\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\r\n \":\") + 1);\r\n\r\n if (!\"MainMethodResponse\".equals(type)) {\r\n //find namespace for the prefix\r\n java.lang.String nsUri = reader.getNamespaceContext()\r\n .getNamespaceURI(nsPrefix);\r\n\r\n return (MainMethodResponse) ExtensionMapper.getTypeObject(nsUri,\r\n type, reader);\r\n }\r\n }\r\n }\r\n\r\n // Note all attributes that were handled. Used to differ normal attributes\r\n // from anyAttributes.\r\n java.util.Vector handledAttributes = new java.util.Vector();\r\n\r\n reader.next();\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n if ((reader.isStartElement() &&\r\n new javax.xml.namespace.QName(\r\n \"http://tempuri.org/\", \"MainMethodResult\").equals(\r\n reader.getName())) ||\r\n new javax.xml.namespace.QName(\"\", \"MainMethodResult\").equals(\r\n reader.getName())) {\r\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"nil\");\r\n\r\n if (\"true\".equals(nillableValue) ||\r\n \"1\".equals(nillableValue)) {\r\n throw new org.apache.axis2.databinding.ADBException(\r\n \"The element: \" + \"MainMethodResult\" +\r\n \" cannot be null\");\r\n }\r\n\r\n java.lang.String content = reader.getElementText();\r\n\r\n object.setMainMethodResult(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(\r\n content));\r\n\r\n reader.next();\r\n } // End of if for expected property start element\r\n\r\n else {\r\n }\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n if (reader.isStartElement()) {\r\n // 2 - A start element we are not expecting indicates a trailing invalid property\r\n throw new org.apache.axis2.databinding.ADBException(\r\n \"Unexpected subelement \" + reader.getName());\r\n }\r\n } catch (javax.xml.stream.XMLStreamException e) {\r\n throw new java.lang.Exception(e);\r\n }\r\n\r\n return object;\r\n }", "public static OPRegistResponse parse(\r\n javax.xml.stream.XMLStreamReader reader)\r\n throws java.lang.Exception {\r\n OPRegistResponse object = new OPRegistResponse();\r\n\r\n int event;\r\n javax.xml.namespace.QName currentQName = null;\r\n java.lang.String nillableValue = null;\r\n java.lang.String prefix = \"\";\r\n java.lang.String namespaceuri = \"\";\r\n\r\n try {\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n currentQName = reader.getName();\r\n\r\n if (reader.getAttributeValue(\r\n \"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"type\") != null) {\r\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"type\");\r\n\r\n if (fullTypeName != null) {\r\n java.lang.String nsPrefix = null;\r\n\r\n if (fullTypeName.indexOf(\":\") > -1) {\r\n nsPrefix = fullTypeName.substring(0,\r\n fullTypeName.indexOf(\":\"));\r\n }\r\n\r\n nsPrefix = (nsPrefix == null) ? \"\" : nsPrefix;\r\n\r\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\r\n \":\") + 1);\r\n\r\n if (!\"OPRegistResponse\".equals(type)) {\r\n //find namespace for the prefix\r\n java.lang.String nsUri = reader.getNamespaceContext()\r\n .getNamespaceURI(nsPrefix);\r\n\r\n return (OPRegistResponse) ExtensionMapper.getTypeObject(nsUri,\r\n type, reader);\r\n }\r\n }\r\n }\r\n\r\n // Note all attributes that were handled. Used to differ normal attributes\r\n // from anyAttributes.\r\n java.util.Vector handledAttributes = new java.util.Vector();\r\n\r\n reader.next();\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n if ((reader.isStartElement() &&\r\n new javax.xml.namespace.QName(\r\n \"http://tempuri.org/\", \"OPRegistResult\").equals(\r\n reader.getName())) ||\r\n new javax.xml.namespace.QName(\"\", \"OPRegistResult\").equals(\r\n reader.getName())) {\r\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"nil\");\r\n\r\n if (\"true\".equals(nillableValue) ||\r\n \"1\".equals(nillableValue)) {\r\n throw new org.apache.axis2.databinding.ADBException(\r\n \"The element: \" + \"OPRegistResult\" +\r\n \" cannot be null\");\r\n }\r\n\r\n java.lang.String content = reader.getElementText();\r\n\r\n object.setOPRegistResult(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(\r\n content));\r\n\r\n reader.next();\r\n } // End of if for expected property start element\r\n\r\n else {\r\n }\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n if (reader.isStartElement()) {\r\n // 2 - A start element we are not expecting indicates a trailing invalid property\r\n throw new org.apache.axis2.databinding.ADBException(\r\n \"Unexpected subelement \" + reader.getName());\r\n }\r\n } catch (javax.xml.stream.XMLStreamException e) {\r\n throw new java.lang.Exception(e);\r\n }\r\n\r\n return object;\r\n }", "boolean isSerializeResponse();" ]
[ "0.66966844", "0.6506534", "0.6506534", "0.6483829", "0.62848747", "0.6232408", "0.6231331", "0.6205239", "0.6192393", "0.6191538", "0.618765", "0.6170905", "0.6170737", "0.6142113", "0.61339056", "0.6106556", "0.6087158", "0.60836184", "0.60683113", "0.6002879", "0.5963445", "0.59308124", "0.59215254", "0.5916542", "0.5904269", "0.5895071", "0.58799314", "0.58773685", "0.5871472", "0.5870134", "0.5868037", "0.5842314", "0.5836934", "0.5828894", "0.58234894", "0.58144784", "0.580175", "0.57910776", "0.578789", "0.57839435", "0.5776126", "0.57747245", "0.5762256", "0.5758182", "0.5738062", "0.57377315", "0.573527", "0.5704984", "0.5700485", "0.5697553", "0.5690619", "0.56845504", "0.5680971", "0.5680838", "0.5655568", "0.56517273", "0.563986", "0.5634975", "0.5632378", "0.5629078", "0.5626703", "0.56266856", "0.56084114", "0.5598616", "0.55951744", "0.5593567", "0.55918956", "0.55918205", "0.5576366", "0.5575239", "0.556424", "0.5552414", "0.5550635", "0.5541181", "0.5535451", "0.55306625", "0.5530163", "0.55284184", "0.5527517", "0.55270946", "0.5524746", "0.5517301", "0.5510787", "0.55073893", "0.5497899", "0.54948884", "0.5487598", "0.5481165", "0.54788285", "0.54774785", "0.5457769", "0.5456746", "0.54531705", "0.5449294", "0.5442708", "0.54319966", "0.5428172", "0.5423628", "0.5419284", "0.54108804" ]
0.75533247
0
/ Access modifiers changed, original: protected
public void onFinishInflate() { AppMethodBeat.i(24329); super.onFinishInflate(); setOnClickListener(new OnClickListener() { public final void onClick(View view) { AppMethodBeat.i(24324); ab.d("MicroMsg.RecordVoiceBaseView", "clicked path %s, isPlay %s", RecordVoiceBaseView.this.path, Boolean.valueOf(RecordVoiceBaseView.this.pKR.buH())); if (com.tencent.mm.r.a.bJ(RecordVoiceBaseView.this.context) || com.tencent.mm.r.a.bH(RecordVoiceBaseView.this.context)) { AppMethodBeat.o(24324); } else if (!f.Mn() && !bo.isNullOrNil(RecordVoiceBaseView.this.path)) { t.hO(view.getContext()); AppMethodBeat.o(24324); } else if (!bo.bc(RecordVoiceBaseView.this.path, "").equals(RecordVoiceBaseView.this.pKR.path)) { RecordVoiceBaseView.d(RecordVoiceBaseView.this); AppMethodBeat.o(24324); } else if (RecordVoiceBaseView.this.pKR.buH()) { RecordVoiceBaseView.this.stopPlay(); AppMethodBeat.o(24324); } else { if (!RecordVoiceBaseView.e(RecordVoiceBaseView.this)) { RecordVoiceBaseView.d(RecordVoiceBaseView.this); } AppMethodBeat.o(24324); } } }); AppMethodBeat.o(24329); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void prot() {\n }", "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "public abstract Object mo26777y();", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "protected abstract Set method_1559();", "private abstract void privateabstract();", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "private PropertyAccess() {\n\t\tsuper();\n\t}", "protected void h() {}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public abstract void mo27386d();", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public abstract void mo70713b();", "@Override\n\tprotected void getExras() {\n\n\t}", "protected Doodler() {\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "public abstract void mo56925d();", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "public void smell() {\n\t\t\n\t}", "public abstract void mo27385c();", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\r\n\tpublic void smthAbstr() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "protected void method_3848() {\r\n super.method_3848();\r\n }", "@Override\n public void memoria() {\n \n }", "public final void mo51373a() {\n }", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "public abstract void mo30696a();", "@Override\n public void get() {}", "public void method_4270() {}", "private Infer() {\n\n }", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "@Override\n\tpublic void leti() \n\t{\n\t}", "@Override\n\tpublic void modify() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "private void m50366E() {\n }", "private Get() {}", "private Get() {}", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "@Override\n\tpublic void verkaufen() {\n\t}", "public abstract String mo41079d();", "public abstract void m15813a();", "public abstract Object mo1771a();", "public abstract void mo27464a();", "public void gored() {\n\t\t\n\t}", "public abstract void mo35054b();", "public abstract String mo118046b();", "@Override\n\tpublic void erstellen() {\n\t\t\n\t}", "@Override\n\tpublic void dibuja() {\n\t\t\n\t}", "@Override\n\tpublic int method() {\n\t\treturn 0;\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public abstract void mo42329d();", "public void method_6349() {\r\n super.method_6349();\r\n }", "public abstract String mo13682d();", "protected void method_2665() {\r\n super.method_2427(awt.field_4171);\r\n this.method_2440(true);\r\n this.method_2521(class_872.field_4244);\r\n }", "private TMCourse() {\n\t}", "private MigrationInstantiationUtil() {\n\t\tthrow new IllegalAccessError();\n\t}", "@Override\n public boolean isPrivate() {\n return true;\n }", "@Override\n public void init() {\n\n }", "protected FanisamBato(){\n\t}", "public /* bridge */ /* synthetic */ void mo55096c() {\n super.mo55096c();\n }", "@Override\n void init() {\n }", "@Override\r\n\tpublic void member() {\n\t\t\r\n\t}", "public void myPublicMethod() {\n\t\t\n\t}", "abstract int pregnancy();", "public abstract Object mo1185b();", "protected Problem() {/* intentionally empty block */}", "public /* bridge */ /* synthetic */ void mo55094a() {\n super.mo55094a();\n }", "public void mo21779D() {\n }", "@Override\n public void init() {\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 abstract void mo42331g();", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public abstract void mo102899a();" ]
[ "0.73629737", "0.698275", "0.6893718", "0.67984074", "0.6731795", "0.6725871", "0.6703971", "0.6552133", "0.6525146", "0.6523726", "0.64779514", "0.64592475", "0.64412045", "0.64338404", "0.64115113", "0.64100546", "0.6405308", "0.6404923", "0.6404923", "0.64024466", "0.63932085", "0.6390889", "0.6386778", "0.63841987", "0.638282", "0.63794196", "0.63794196", "0.6328407", "0.6313807", "0.6292603", "0.6290541", "0.62812257", "0.62488496", "0.62488496", "0.6247837", "0.6216246", "0.62158704", "0.6204517", "0.6194201", "0.6185745", "0.6175866", "0.6147165", "0.61243314", "0.61190856", "0.61065257", "0.61060417", "0.60974884", "0.6085475", "0.6084266", "0.6081045", "0.6076486", "0.6069762", "0.6062573", "0.6059388", "0.6033081", "0.60313636", "0.6022232", "0.6021943", "0.6020643", "0.60182416", "0.6016128", "0.6012776", "0.6012776", "0.60081047", "0.60081047", "0.6005714", "0.60054314", "0.6002981", "0.5991115", "0.5990917", "0.59850454", "0.59823835", "0.5981064", "0.59688264", "0.5961836", "0.59494895", "0.59487563", "0.5946457", "0.59363616", "0.592992", "0.5926872", "0.59264714", "0.59213376", "0.5917447", "0.59124196", "0.5909579", "0.5908399", "0.59030217", "0.590017", "0.58924705", "0.5889083", "0.58887863", "0.5887926", "0.58874685", "0.5887398", "0.58869267", "0.58837885", "0.58836144", "0.5876662", "0.5876164", "0.58760124" ]
0.0
-1
/ / / / 37
public int getNoOfRelevantLines() { return this.noOfRelevantLines; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int mo36g() {\n return 8;\n }", "public int mo36g() {\n return 4;\n }", "void mo33732Px();", "public int mo9774x() {\n /*\n r5 = this;\n int r0 = r5.f9082i\n int r1 = r5.f9080g\n if (r1 != r0) goto L_0x0007\n goto L_0x006a\n L_0x0007:\n byte[] r2 = r5.f9079f\n int r3 = r0 + 1\n byte r0 = r2[r0]\n if (r0 < 0) goto L_0x0012\n r5.f9082i = r3\n return r0\n L_0x0012:\n int r1 = r1 - r3\n r4 = 9\n if (r1 >= r4) goto L_0x0018\n goto L_0x006a\n L_0x0018:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 7\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0024\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n goto L_0x0070\n L_0x0024:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x0031\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n L_0x002f:\n r1 = r3\n goto L_0x0070\n L_0x0031:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 21\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x003f\n r2 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r2\n goto L_0x0070\n L_0x003f:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r4 = r1 << 28\n r0 = r0 ^ r4\n r4 = 266354560(0xfe03f80, float:2.2112565E-29)\n r0 = r0 ^ r4\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r3 = r2[r3]\n if (r3 >= 0) goto L_0x0070\n int r3 = r1 + 1\n byte r1 = r2[r1]\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r3 = r2[r3]\n if (r3 >= 0) goto L_0x0070\n int r3 = r1 + 1\n byte r1 = r2[r1]\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r2 = r2[r3]\n if (r2 >= 0) goto L_0x0070\n L_0x006a:\n long r0 = r5.mo9776z()\n int r0 = (int) r0\n return r0\n L_0x0070:\n r5.f9082i = r1\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3659c.mo9774x():int\");\n }", "public int mo36g() {\n return 2;\n }", "public static void main(String[] args) {\n\n\n\n System.out.println(4 * (1.0 - (1 / 3) + (1 / 5) - (1 / 7) + (1 / 9) - (1 / 11)));\n\n System.out.println(4 * (1.0 - (1/3) + (1/5) - (1/7)\n + (1 / 9) - (1/11) + (1/13)));\n }", "public int mo9785x() {\n /*\n r10 = this;\n long r0 = r10.f9091i\n long r2 = r10.f9090h\n int r2 = (r2 > r0 ? 1 : (r2 == r0 ? 0 : -1))\n if (r2 != 0) goto L_0x000a\n goto L_0x0085\n L_0x000a:\n r2 = 1\n long r4 = r0 + r2\n byte r0 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r0)\n if (r0 < 0) goto L_0x0017\n r10.f9091i = r4\n return r0\n L_0x0017:\n long r6 = r10.f9090h\n long r6 = r6 - r4\n r8 = 9\n int r1 = (r6 > r8 ? 1 : (r6 == r8 ? 0 : -1))\n if (r1 >= 0) goto L_0x0021\n goto L_0x0085\n L_0x0021:\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n int r1 = r1 << 7\n r0 = r0 ^ r1\n if (r0 >= 0) goto L_0x002f\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n goto L_0x008b\n L_0x002f:\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x003e\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n L_0x003c:\n r6 = r4\n goto L_0x008b\n L_0x003e:\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n int r1 = r1 << 21\n r0 = r0 ^ r1\n if (r0 >= 0) goto L_0x004e\n r1 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r1\n goto L_0x008b\n L_0x004e:\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n int r6 = r1 << 28\n r0 = r0 ^ r6\n r6 = 266354560(0xfe03f80, float:2.2112565E-29)\n r0 = r0 ^ r6\n if (r1 >= 0) goto L_0x003c\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n if (r1 >= 0) goto L_0x008b\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n if (r1 >= 0) goto L_0x003c\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n if (r1 >= 0) goto L_0x008b\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n if (r1 >= 0) goto L_0x003c\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n if (r1 >= 0) goto L_0x008b\n L_0x0085:\n long r0 = r10.mo9787z()\n int r0 = (int) r0\n return r0\n L_0x008b:\n r10.f9091i = r6\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3661d.mo9785x():int\");\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 }", "float getHotwordPower();", "public int mo9761x() {\n /*\n r5 = this;\n int r0 = r5.f9074i\n int r1 = r5.f9072g\n if (r1 != r0) goto L_0x0007\n goto L_0x006a\n L_0x0007:\n byte[] r2 = r5.f9070e\n int r3 = r0 + 1\n byte r0 = r2[r0]\n if (r0 < 0) goto L_0x0012\n r5.f9074i = r3\n return r0\n L_0x0012:\n int r1 = r1 - r3\n r4 = 9\n if (r1 >= r4) goto L_0x0018\n goto L_0x006a\n L_0x0018:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 7\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0024\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n goto L_0x0070\n L_0x0024:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x0031\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n L_0x002f:\n r1 = r3\n goto L_0x0070\n L_0x0031:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 21\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x003f\n r2 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r2\n goto L_0x0070\n L_0x003f:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r4 = r1 << 28\n r0 = r0 ^ r4\n r4 = 266354560(0xfe03f80, float:2.2112565E-29)\n r0 = r0 ^ r4\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r3 = r2[r3]\n if (r3 >= 0) goto L_0x0070\n int r3 = r1 + 1\n byte r1 = r2[r1]\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r3 = r2[r3]\n if (r3 >= 0) goto L_0x0070\n int r3 = r1 + 1\n byte r1 = r2[r1]\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r2 = r2[r3]\n if (r2 >= 0) goto L_0x0070\n L_0x006a:\n long r0 = r5.mo9763z()\n int r0 = (int) r0\n return r0\n L_0x0070:\n r5.f9074i = r1\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3658b.mo9761x():int\");\n }", "@Override\r\n\tpublic void CalcPeri() {\n\t\tSystem.out.println(4*side);\t\r\n\t}", "public short mo34e() {\n return 41;\n }", "public double getPerimiter(){return (2*height +2*width);}", "int mo23521Ly();", "private double triangleBase() {\n return cellWidth() / BASE_WIDTH;\n }", "public long mo9775y() {\n /*\n r11 = this;\n int r0 = r11.f9082i\n int r1 = r11.f9080g\n if (r1 != r0) goto L_0x0008\n goto L_0x00b6\n L_0x0008:\n byte[] r2 = r11.f9079f\n int r3 = r0 + 1\n byte r0 = r2[r0]\n if (r0 < 0) goto L_0x0014\n r11.f9082i = 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_0x00b6\n L_0x001b:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 7\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0029\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n L_0x0026:\n long r2 = (long) r0\n goto L_0x00bd\n L_0x0029:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x003a\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n long r0 = (long) r0\n r9 = r0\n r1 = r3\n r2 = r9\n goto L_0x00bd\n L_0x003a:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 21\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0048\n r2 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r2\n goto L_0x0026\n L_0x0048:\n long r3 = (long) r0\n int r0 = r1 + 1\n byte r1 = r2[r1]\n long r5 = (long) r1\n r1 = 28\n long r5 = r5 << r1\n long r3 = r3 ^ r5\n r5 = 0\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 < 0) goto L_0x005f\n r1 = 266354560(0xfe03f80, double:1.315966377E-315)\n L_0x005b:\n long r2 = r3 ^ r1\n r1 = r0\n goto L_0x00bd\n L_0x005f:\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_0x0074\n r5 = -34093383808(0xfffffff80fe03f80, double:NaN)\n L_0x0071:\n long r2 = r3 ^ r5\n goto L_0x00bd\n L_0x0074:\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_0x0087\n r1 = 4363953127296(0x3f80fe03f80, double:2.1560793202584E-311)\n goto L_0x005b\n L_0x0087:\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_0x009a\n r5 = -558586000294016(0xfffe03f80fe03f80, double:NaN)\n goto L_0x0071\n L_0x009a:\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_0x00bb\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_0x00bc\n L_0x00b6:\n long r0 = r11.mo9776z()\n return r0\n L_0x00bb:\n r1 = r0\n L_0x00bc:\n r2 = r3\n L_0x00bd:\n r11.f9082i = r1\n return r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3659c.mo9775y():long\");\n }", "public void divide() {\n\t\t\n\t}", "public int mo9232aG() {\n return 0;\n }", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "public int method_2436() {\r\n return 16;\r\n }", "public abstract double mo9740e();", "BigInteger getWidth();", "double volume(){\n return width*height*depth;\n }", "double perimeter();", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "public abstract String division();", "public static void main(String[] args) {\n\t\t\r\n\t\ta= a*b;//36\r\n\t\tb=a/b;//9\r\n\t\ta=a/b;//4\r\n\t\t\r\n\t\tSystem.out.println(\"a=\"+a);\r\n\t\t\r\n\t\tSystem.out.println(\"b=\"+b);\r\n\t}", "public abstract Integer mo36210m();", "float mo56157b();", "@Override\n\tpublic double perimetro() {\n\t\treturn getBase()*4;\n\t}", "static double transform(int f) {\n return (5.0 / 9.0 * (f - 32));\n\n }", "private static int primitiveRoot(int m) {\n if (m == 2)\n return 1;\n if (m == 167772161)\n return 3;\n if (m == 469762049)\n return 3;\n if (m == 754974721)\n return 11;\n if (m == 998244353)\n return 3;\n\n int[] divs = new int[20];\n divs[0] = 2;\n int cnt = 1;\n int x = (m - 1) / 2;\n while (x % 2 == 0)\n x /= 2;\n for (int i = 3; (long) (i) * i <= x; i += 2) {\n if (x % i == 0) {\n divs[cnt++] = i;\n while (x % i == 0) {\n x /= i;\n }\n }\n }\n if (x > 1) {\n divs[cnt++] = x;\n }\n for (int g = 2;; g++) {\n boolean ok = true;\n for (int i = 0; i < cnt; i++) {\n if (pow(g, (m - 1) / divs[i], m) == 1) {\n ok = false;\n break;\n }\n }\n if (ok)\n return g;\n }\n }", "public abstract int mo9754s();", "public static void main(String[] args) {\n int value = 5;\n int ab= 0;\n int ac=0;\n int ad=0;\n int ae=0;\n int af=0;\n int ag=0;\n int am=0;\n int az=0;\n int x = 0;\n int y = 0;\n int z = 0;\n int a = 0;\n int b = 0;\n int c = 0;\n int d = 0;\n int e = 0;\n x= value%2;\n ab=value/2;\n y= ab % 2;\n ac = ab/2;\n z = ac % 2;\n ad= ac/2;\n a = ad % 2;\n ae = ad/2;\n b = ae % 2;\n af= ae/2;\n c = af % 2;\n ag= af/2;\n d= ag % 2;\n am=ag/2;\n e = am %2;\n\n System.out.println(e+\"\"+d+\"\"+c+\"\"+b+\"\"+a+\"\"+z+\"\"+y+\"\"+x);\n\n\n\n\n\n\n\n }", "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 }", "private void m27468d() {\n switch (this.f25258E) {\n case 1:\n this.f25270Q = this.f25294i.left;\n break;\n case 2:\n this.f25270Q = this.f25294i.right;\n break;\n default:\n this.f25270Q = this.f25268O;\n break;\n }\n this.f25271R = (int) (((float) this.f25269P) - ((this.f25288c.ascent() + this.f25288c.descent()) / 2.0f));\n }", "public abstract int mo8526p();", "float mo106363e();", "private static float m590o(Context context) {\r\n DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();\r\n Point point = new Point(displayMetrics.widthPixels, displayMetrics.heightPixels);\r\n return ((float) point.y) / ((float) point.x);\r\n }", "public final void mo9756A() {\n int i = this.f9072g + this.f9073h;\n this.f9072g = i;\n int i2 = i - this.f9075j;\n int i3 = this.f9077l;\n if (i2 > i3) {\n int i4 = i2 - i3;\n this.f9073h = i4;\n this.f9072g = i - i4;\n return;\n }\n this.f9073h = 0;\n }", "private int DirectionCalculation(int angle)\r\n\t{\t\r\n\t\treturn (int) ((angle/14.28)+1); //Angle divided by (100/(parts-1)) = 1-8\r\n\t}", "int minverse(int z)\n {\n int to,t1;\n int q,y;\n if(z<=1)\n return z;\n t1=0x10001/z;\n y=0x10001%z;\n if(y==1)\n return (0xffff&(1-t1));\n to=1;\n do\n {\n q=z/y;\n z=z%y;\n to+=q*t1;\n if(z==1)\n return to;\n q=y/z;\n y=y%z;\n t1+=q*to;\n }while(y!=1);\n return (0xffff&(1-t1));\n }", "public short mo34e() {\n return 140;\n }", "protected float j()\r\n/* 67: */ {\r\n/* 68: 80 */ return 1.5F;\r\n/* 69: */ }", "public int division(){\r\n return Math.round(x/y);\r\n }", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "public abstract int mo9732a();", "public final void mo9764A() {\n int i = this.f9080g + this.f9081h;\n this.f9080g = i;\n int i2 = this.f9084k + i;\n int i3 = this.f9085l;\n if (i2 > i3) {\n int i4 = i2 - i3;\n this.f9081h = i4;\n this.f9080g = i - i4;\n return;\n }\n this.f9081h = 0;\n }", "public int mo9732a() {\n return this.f9084k + this.f9082i;\n }", "private int createPosition (String s) {\r\n\t\tint x = 37;\r\n\t\tdouble hashCode=0;\r\n\t\tfor (int i=0; i<s.length(); i++) {\r\n\t\t\thashCode = (double) (hashCode+ (int)(s.charAt(s.length()-(i+1)))*(Math.pow(x,i)));\r\n\t\t}\r\n\t\treturn (int)(hashCode % size);\r\n\t}", "public abstract int mo123248g();", "private static double fds_h(Vec v) { return 2*ASTMad.mad(new Frame(v), null, 1.4826)*Math.pow(v.length(),-1./3.); }", "public short getElev();", "public static void main(String[] args) {\n\t\tint high =5;\r\n\t\tint bottom = 3;\r\n\t\tdouble equiateraltriangle= (double)high * bottom /2;\r\n\t\t\r\n\t\tSystem.out.println(\"밑변이 3이고 높이가 5인 정삼각형의 넓이는\" + equiateraltriangle);\r\n\r\n\t}", "public abstract void bepaalGrootte();", "public void division() {\n\t\tx=1;\n\t\ty=0;\n\t\tz=x/y;\n\t\t\t\t\n\t}", "private static int m36201b(Rect rect) {\n return rect.width() * rect.height();\n }", "static int getNumPatterns() { return 64; }", "public double Poids () {return this.masse()*G/(this.r*this.r);}", "public void mo7637y() {\n mo7636x(this.f4372b);\n mo7636x(this.f4373c);\n this.f4378h = 0;\n }", "double volume(){\n\n return widgh*height*depth;\n\n }", "C2841w mo7234g();", "public void method_245(int var1, int var2, int var3, int var4, int var5, int var6) {\n try {\n int var7 = this.field_736[var5];\n int var8 = this.field_737[var5];\n int var9 = 0;\n int var10 = 0;\n int var11 = (var7 << 16) / var3;\n int var12 = (var8 << 16) / var4;\n int var13;\n int var14;\n if(this.field_742[var5]) {\n var13 = this.spriteWidthFull[var5];\n var14 = this.field_741[var5];\n var11 = (var13 << 16) / var3;\n var12 = (var14 << 16) / var4;\n var1 += (this.field_738[var5] * var3 + var13 - 1) / var13;\n var2 += (this.field_739[var5] * var4 + var14 - 1) / var14;\n if(this.field_738[var5] * var3 % var13 != 0) {\n var9 = (var13 - this.field_738[var5] * var3 % var13 << 16) / var3;\n }\n\n if(this.field_739[var5] * var4 % var14 != 0) {\n var10 = (var14 - this.field_739[var5] * var4 % var14 << 16) / var4;\n }\n\n var3 = var3 * (this.field_736[var5] - (var9 >> 16)) / var13;\n var4 = var4 * (this.field_737[var5] - (var10 >> 16)) / var14;\n }\n\n var13 = var1 + var2 * this.field_723;\n var14 = this.field_723 - var3;\n int var15;\n if(var2 < this.field_743) {\n var15 = this.field_743 - var2;\n var4 -= var15;\n var2 = 0;\n var13 += var15 * this.field_723;\n var10 += var12 * var15;\n }\n\n if(var2 + var4 >= this.field_744) {\n var4 -= var2 + var4 - this.field_744 + 1;\n }\n\n if(var1 < this.field_745) {\n var15 = this.field_745 - var1;\n var3 -= var15;\n var1 = 0;\n var13 += var15;\n var9 += var11 * var15;\n var14 += var15;\n }\n\n if(var1 + var3 >= this.field_746) {\n var15 = var1 + var3 - this.field_746 + 1;\n var3 -= var15;\n var14 += var15;\n }\n\n byte var17 = 1;\n if(this.interlace) {\n var17 = 2;\n var14 += this.field_723;\n var12 += var12;\n if((var2 & 1) != 0) {\n var13 += this.field_723;\n --var4;\n }\n }\n\n this.method_252(this.pixels, this.spritePixels[var5], 0, var9, var10, var13, var14, var3, var4, var11, var12, var7, var17, var6);\n } catch (Exception var16) {\n System.out.println(\"error in sprite clipping routine\"); // authentic System.out.println\n }\n }", "private int getAttackAngle() {\n\t\treturn (160 - (level * 10));\n\t}", "double volume() {\n\treturn width*height*depth;\n}", "public C3635j mo9738d() {\n C3635j jVar;\n int x = mo9774x();\n int i = this.f9080g;\n int i2 = this.f9082i;\n if (x <= i - i2 && x > 0) {\n C3635j a = C3635j.m8389a(this.f9079f, i2, x);\n this.f9082i += x;\n return a;\n } else if (x == 0) {\n return C3635j.f9034f;\n } else {\n byte[] f = mo9766f(x);\n if (f != null) {\n jVar = C3635j.m8388a(f);\n } else {\n int i3 = this.f9082i;\n int i4 = this.f9080g;\n int i5 = i4 - i3;\n this.f9084k += i4;\n this.f9082i = 0;\n this.f9080g = 0;\n List g = mo9767g(x - i5);\n byte[] bArr = new byte[x];\n System.arraycopy(this.f9079f, i3, bArr, 0, i5);\n Iterator it = ((ArrayList) g).iterator();\n while (it.hasNext()) {\n byte[] bArr2 = (byte[]) it.next();\n System.arraycopy(bArr2, 0, bArr, i5, bArr2.length);\n i5 += bArr2.length;\n }\n jVar = C3635j.m8391b(bArr);\n }\n return jVar;\n }\n }", "double getPerimeter(){\n return 2*height+width;\n }", "public int a(char paramChar)\r\n/* 484: */ {\r\n/* 485:481 */ if (paramChar == '§') {\r\n/* 486:482 */ return -1;\r\n/* 487: */ }\r\n/* 488:485 */ if (paramChar == ' ') {\r\n/* 489:486 */ return 4;\r\n/* 490: */ }\r\n/* 491:489 */ int i1 = \"\".indexOf(paramChar);\r\n/* 492:490 */ if ((paramChar > 0) && (i1 != -1) && (!this.k)) {\r\n/* 493:491 */ return this.d[i1];\r\n/* 494: */ }\r\n/* 495:495 */ if (this.e[paramChar] != 0)\r\n/* 496: */ {\r\n/* 497:496 */ int i2 = this.e[paramChar] >>> 4;\r\n/* 498:497 */ int i3 = this.e[paramChar] & 0xF;\r\n/* 499:499 */ if (i3 > 7)\r\n/* 500: */ {\r\n/* 501:500 */ i3 = 15;\r\n/* 502:501 */ i2 = 0;\r\n/* 503: */ }\r\n/* 504:503 */ i3++;\r\n/* 505: */ \r\n/* 506:505 */ return (i3 - i2) / 2 + 1;\r\n/* 507: */ }\r\n/* 508:508 */ return 0;\r\n/* 509: */ }", "public abstract long mo9748m();", "public int mo9754s() {\n return mo9774x();\n }", "private static int trailzerofun(int num) {\n\t\tint count=0;\n\t\tif(num<0)\n\t\t\treturn -1;\n\t\tfor(int i=5;num/i>=1;i*=5)\n\t\t{\n\t\t\tcount+=num/i;\n\t\t}\n\t\treturn count;\n\t}", "Up(int z) {x *= 3; }", "public static void main(String[] args) {\npat(16);\r\nint a[]= {2,0,2};\r\nSystem.out.println(fillthewater(a));\r\npascalstri(6);\r\n\t}", "public double peri() {\n\t\treturn 2*(width+length);\n\t}", "public static void main(String args[]) {\n\tSystem.out.println(\"1 2 + 4 * 4 2 - + = \" + execute(\"1 2 + 4 * 4 2 - +\"));\r\n\t\r\n\t// (1 + 4) * (3 + 7) / 5 == 10\r\n\t/*System.out.println(\"1 4 + 3 7 + * 5 / = \" \r\n\t\t\t + execute(\"1 4 + 3 7 + * 5 /\"));\r\n\t\r\n\t// 10 + 2 == 12\r\n\tSystem.out.println(\"10 2 + = \" \r\n\t\t\t + execute(\"10 2 +\"));\r\n\t\r\n\t// 10 / 2 == 5\r\n\tSystem.out.println(\"10 2 / = \"\r\n\t\t\t + execute(\"10 2 /\"));*/\r\n }", "public void method_246(int var1, int var2, int var3, int var4, int var5, int var6) {\n try {\n int var7 = this.field_736[var5];\n int var8 = this.field_737[var5];\n int var9 = 0;\n int var10 = 0;\n int var11 = (var7 << 16) / var3;\n int var12 = (var8 << 16) / var4;\n int var13;\n int var14;\n if(this.field_742[var5]) {\n var13 = this.spriteWidthFull[var5];\n var14 = this.field_741[var5];\n var11 = (var13 << 16) / var3;\n var12 = (var14 << 16) / var4;\n var1 += (this.field_738[var5] * var3 + var13 - 1) / var13;\n var2 += (this.field_739[var5] * var4 + var14 - 1) / var14;\n if(this.field_738[var5] * var3 % var13 != 0) {\n var9 = (var13 - this.field_738[var5] * var3 % var13 << 16) / var3;\n }\n\n if(this.field_739[var5] * var4 % var14 != 0) {\n var10 = (var14 - this.field_739[var5] * var4 % var14 << 16) / var4;\n }\n\n var3 = var3 * (this.field_736[var5] - (var9 >> 16)) / var13;\n var4 = var4 * (this.field_737[var5] - (var10 >> 16)) / var14;\n }\n\n var13 = var1 + var2 * this.field_723;\n var14 = this.field_723 - var3;\n int var15;\n if(var2 < this.field_743) {\n var15 = this.field_743 - var2;\n var4 -= var15;\n var2 = 0;\n var13 += var15 * this.field_723;\n var10 += var12 * var15;\n }\n\n if(var2 + var4 >= this.field_744) {\n var4 -= var2 + var4 - this.field_744 + 1;\n }\n\n if(var1 < this.field_745) {\n var15 = this.field_745 - var1;\n var3 -= var15;\n var1 = 0;\n var13 += var15;\n var9 += var11 * var15;\n var14 += var15;\n }\n\n if(var1 + var3 >= this.field_746) {\n var15 = var1 + var3 - this.field_746 + 1;\n var3 -= var15;\n var14 += var15;\n }\n\n byte var17 = 1;\n if(this.interlace) {\n var17 = 2;\n var14 += this.field_723;\n var12 += var12;\n if((var2 & 1) != 0) {\n var13 += this.field_723;\n --var4;\n }\n }\n\n this.method_253(this.pixels, this.spritePixels[var5], 0, var9, var10, var13, var14, var3, var4, var11, var12, var7, var17, var6);\n } catch (Exception var16) {\n System.out.println(\"error in sprite clipping routine\"); // authentic System.out.println\n }\n }", "private int funcaoHash(int x) {\n\t\treturn (x % 37);\n\t}", "int getMid(int s, int e) {\n return s + (e - s) / 2;\n }", "public int getFloor();", "private void m27470f() {\n if (this.f25278ab) {\n int i = this.f25254A / 2;\n int i2 = this.f25269P + this.f25260G;\n int i3 = this.f25269P - this.f25260G;\n this.f25295j.set(this.f25294i.left, i2 - i, this.f25294i.right, i2 + i);\n this.f25296k.set(this.f25294i.left, i3 - i, this.f25294i.right, i3 + i);\n }\n }", "double passer();", "public int generateRoshambo(){\n ;]\n\n }", "public long mo9762y() {\n /*\n r11 = this;\n int r0 = r11.f9074i\n int r1 = r11.f9072g\n if (r1 != r0) goto L_0x0008\n goto L_0x00b6\n L_0x0008:\n byte[] r2 = r11.f9070e\n int r3 = r0 + 1\n byte r0 = r2[r0]\n if (r0 < 0) goto L_0x0014\n r11.f9074i = 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_0x00b6\n L_0x001b:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 7\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0029\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n L_0x0026:\n long r2 = (long) r0\n goto L_0x00bd\n L_0x0029:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x003a\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n long r0 = (long) r0\n r9 = r0\n r1 = r3\n r2 = r9\n goto L_0x00bd\n L_0x003a:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 21\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0048\n r2 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r2\n goto L_0x0026\n L_0x0048:\n long r3 = (long) r0\n int r0 = r1 + 1\n byte r1 = r2[r1]\n long r5 = (long) r1\n r1 = 28\n long r5 = r5 << r1\n long r3 = r3 ^ r5\n r5 = 0\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 < 0) goto L_0x005f\n r1 = 266354560(0xfe03f80, double:1.315966377E-315)\n L_0x005b:\n long r2 = r3 ^ r1\n r1 = r0\n goto L_0x00bd\n L_0x005f:\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_0x0074\n r5 = -34093383808(0xfffffff80fe03f80, double:NaN)\n L_0x0071:\n long r2 = r3 ^ r5\n goto L_0x00bd\n L_0x0074:\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_0x0087\n r1 = 4363953127296(0x3f80fe03f80, double:2.1560793202584E-311)\n goto L_0x005b\n L_0x0087:\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_0x009a\n r5 = -558586000294016(0xfffe03f80fe03f80, double:NaN)\n goto L_0x0071\n L_0x009a:\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_0x00bb\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_0x00bc\n L_0x00b6:\n long r0 = r11.mo9763z()\n return r0\n L_0x00bb:\n r1 = r0\n L_0x00bc:\n r2 = r3\n L_0x00bd:\n r11.f9074i = r1\n return r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3658b.mo9762y():long\");\n }", "public static double computeDiameter(int wireGauge)\r\n{ \r\n return 0.127 * Math.pow(92.0, (36.0 - wireGauge) / 39.0); \r\n}", "public void mo3946e() {\n m25427g();\n }", "public void method_258(int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, boolean var9) {\n try {\n if(var6 == 0) {\n var6 = 16777215;\n }\n\n if(var7 == 0) {\n var7 = 16777215;\n }\n\n int var10 = this.field_736[var5];\n int var11 = this.field_737[var5];\n int var12 = 0;\n int var13 = 0;\n int var14 = var8 << 16;\n int var15 = (var10 << 16) / var3;\n int var16 = (var11 << 16) / var4;\n int var17 = -(var8 << 16) / var4;\n int var18;\n int var19;\n if(this.field_742[var5]) {\n var18 = this.spriteWidthFull[var5];\n var19 = this.field_741[var5];\n var15 = (var18 << 16) / var3;\n var16 = (var19 << 16) / var4;\n int var20 = this.field_738[var5];\n int var21 = this.field_739[var5];\n if(var9) {\n var20 = var18 - this.field_736[var5] - var20;\n }\n\n var1 += (var20 * var3 + var18 - 1) / var18;\n int var22 = (var21 * var4 + var19 - 1) / var19;\n var2 += var22;\n var14 += var22 * var17;\n if(var20 * var3 % var18 != 0) {\n var12 = (var18 - var20 * var3 % var18 << 16) / var3;\n }\n\n if(var21 * var4 % var19 != 0) {\n var13 = (var19 - var21 * var4 % var19 << 16) / var4;\n }\n\n var3 = ((this.field_736[var5] << 16) - var12 + var15 - 1) / var15;\n var4 = ((this.field_737[var5] << 16) - var13 + var16 - 1) / var16;\n }\n\n var18 = var2 * this.field_723;\n var14 += var1 << 16;\n if(var2 < this.field_743) {\n var19 = this.field_743 - var2;\n var4 -= var19;\n var2 = this.field_743;\n var18 += var19 * this.field_723;\n var13 += var16 * var19;\n var14 += var17 * var19;\n }\n\n if(var2 + var4 >= this.field_744) {\n var4 -= var2 + var4 - this.field_744 + 1;\n }\n\n var19 = var18 / this.field_723 & 1;\n if(!this.interlace) {\n var19 = 2;\n }\n\n if(var7 == 16777215) {\n if(this.spritePixels[var5] != null) {\n if(!var9) {\n this.method_259(this.pixels, this.spritePixels[var5], 0, var12, var13, var18, var3, var4, var15, var16, var10, var6, var14, var17, var19);\n } else {\n this.method_259(this.pixels, this.spritePixels[var5], 0, (this.field_736[var5] << 16) - var12 - 1, var13, var18, var3, var4, -var15, var16, var10, var6, var14, var17, var19);\n }\n } else if(!var9) {\n this.method_261(this.pixels, this.spriteColoursUsed[var5], this.spriteColourList[var5], 0, var12, var13, var18, var3, var4, var15, var16, var10, var6, var14, var17, var19);\n } else {\n this.method_261(this.pixels, this.spriteColoursUsed[var5], this.spriteColourList[var5], 0, (this.field_736[var5] << 16) - var12 - 1, var13, var18, var3, var4, -var15, var16, var10, var6, var14, var17, var19);\n }\n } else if(this.spritePixels[var5] != null) {\n if(!var9) {\n this.method_260(this.pixels, this.spritePixels[var5], 0, var12, var13, var18, var3, var4, var15, var16, var10, var6, var7, var14, var17, var19);\n } else {\n this.method_260(this.pixels, this.spritePixels[var5], 0, (this.field_736[var5] << 16) - var12 - 1, var13, var18, var3, var4, -var15, var16, var10, var6, var7, var14, var17, var19);\n }\n } else if(!var9) {\n this.method_262(this.pixels, this.spriteColoursUsed[var5], this.spriteColourList[var5], 0, var12, var13, var18, var3, var4, var15, var16, var10, var6, var7, var14, var17, var19);\n } else {\n this.method_262(this.pixels, this.spriteColoursUsed[var5], this.spriteColourList[var5], 0, (this.field_736[var5] << 16) - var12 - 1, var13, var18, var3, var4, -var15, var16, var10, var6, var7, var14, var17, var19);\n }\n } catch (Exception var23) {\n System.out.println(\"error in sprite clipping routine\"); // authentic System.out.println\n }\n }", "private BigInteger divideWords(int w)\n {\n int n = magnitude.length;\n if (w >= n)\n {\n return ZERO;\n }\n int[] mag = new int[n - w];\n System.arraycopy(magnitude, 0, mag, 0, n - w);\n return new BigInteger(sign, mag);\n }", "private int parent(int i){return (i-1)/2;}", "private int K(int t)\n {\n if(t<=19)\n return 0x5a827999;\n else if(t<=39)\n return 0x6ed9eba1;\n else if(t<=59)\n return 0x8f1bbcdc;\n else \n return 0xca62c1d6;\n }", "public static void main(String[] args) {\n Random rand = new Random(47);\n int i, j, k;\n // Choose Value from 1 t0 100\n j = rand.nextInt(100) + 1;\n print(\"j : \" + j);\n k = rand.nextInt(100) + 1;\n print(\"k : \" + k);\n i = j + k;\n print(\" J + k : \" + i);\n i = j - k;\n print(\" j - k : \" + i );\n i = k / j;\n print(\" k /j : \" + i);\n i = k * j;\n print(\"k * j : \" + i );\n i = k%j;\n print(\" k % j\" + i);\n //Floating-point number tests\n float u , v ,w; //Applies to dubles,too\n v = rand.nextFloat();\n print(\"v : \" + v);\n w = rand.nextFloat();\n print(\"w : \" + w);\n u = v + w;\n print(\"v + w :\" + u);\n u = v - w;\n print(\"v - w :\" + u);\n u = v * w;\n print(\"v * w :\" + u);\n u = v / w;\n print(\"u / w: \" + u);\n //The follwing also works for char,\n // byte, short , int , long and double;\n u +=v;\n print(\"u + = v : \" + u);\n u -= v;\n print(\" u -= v: \" + u);\n u *= v;\n print(\"u *= v : \" + u);\n u /= v;\n print(\"u /= v :\" + v);\n }", "int mo27483b();", "int getMinimalPaletteDistance();", "public static void main(String[] args) {\n\n\n\n double numberOfgallons = 5;\n\n double gallonstolitter = numberOfgallons*3.785;\n\n\n String result = numberOfgallons + \" gallons equal to: \"+gallonstolitter+ \" liters\";\n System.out.println(result);\n\n //=============================================\n /* 2. write a java program that converts litters to gallons\n 1 gallon = 3.785 liters\n 1 litter = 1/3.785\n*/\n\n /*double litter1 = 1/3.785;\n double l =10;\n double gallon1 = l*litter1;\n\n System.out.println(gallon1);\n //======================================================\n*/\n /*\n 3. manually calculate the following code fragements:\n\t\t\t\t1. int a = 200;\n\t\t\t\t\tint b = -a++ + - --a * a-- % 2\n\t\t\t\t\tb = ?\n\n */\n\n\n double numberOfLiters = 100;\n\n double LiterstoGallons = numberOfLiters/3.785;\n\n String result2 = numberOfLiters+\" liters equal to \"+LiterstoGallons+\" galons\";\n\n System.out.println(result2);\n\n\n\n\n\n\n\n\n\n\n\n\n\n int a = 200;\n int b = -a++ + - --a * a-- % 2;\n // b = -200 + - 200* 200%2 = -200;\n\n int x = 300;\n int y = 400;\n int z = x+y-x*y+x/y;\n // z= 300+400-300*400+300/400=700-120000+0(cunki int kimi qebul edir)= -119300;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n }", "private int[] m7232h() {\n this.f5578C[0] = this.f5594p;\n this.f5578C[1] = this.f5599u - this.f5594p;\n return this.f5578C;\n }", "private int getLCD(int a, int b){\n return ( (a * b) / getGCD(a, b) ); \n }", "@Override\r\n\tpublic int div() {\n\t\treturn 0;\r\n\t}", "public static int m8655e() {\n return 8;\n }", "public void setDimensionRatio(java.lang.String r9) {\n /*\n r8 = this;\n r0 = 0;\n if (r9 == 0) goto L_0x008e;\n L_0x0003:\n r1 = r9.length();\n if (r1 != 0) goto L_0x000b;\n L_0x0009:\n goto L_0x008e;\n L_0x000b:\n r1 = -1;\n r2 = r9.length();\n r3 = 44;\n r3 = r9.indexOf(r3);\n r4 = 0;\n r5 = 1;\n if (r3 <= 0) goto L_0x0037;\n L_0x001a:\n r6 = r2 + -1;\n if (r3 >= r6) goto L_0x0037;\n L_0x001e:\n r6 = r9.substring(r4, r3);\n r7 = \"W\";\n r7 = r6.equalsIgnoreCase(r7);\n if (r7 == 0) goto L_0x002c;\n L_0x002a:\n r1 = 0;\n goto L_0x0035;\n L_0x002c:\n r4 = \"H\";\n r4 = r6.equalsIgnoreCase(r4);\n if (r4 == 0) goto L_0x0035;\n L_0x0034:\n r1 = 1;\n L_0x0035:\n r4 = r3 + 1;\n L_0x0037:\n r3 = 58;\n r3 = r9.indexOf(r3);\n if (r3 < 0) goto L_0x0075;\n L_0x003f:\n r2 = r2 - r5;\n if (r3 >= r2) goto L_0x0075;\n L_0x0042:\n r2 = r9.substring(r4, r3);\n r3 = r3 + r5;\n r9 = r9.substring(r3);\n r3 = r2.length();\n if (r3 <= 0) goto L_0x0084;\n L_0x0051:\n r3 = r9.length();\n if (r3 <= 0) goto L_0x0084;\n L_0x0057:\n r2 = java.lang.Float.parseFloat(r2);\t Catch:{ NumberFormatException -> 0x0084 }\n r9 = java.lang.Float.parseFloat(r9);\t Catch:{ NumberFormatException -> 0x0084 }\n r3 = (r2 > r0 ? 1 : (r2 == r0 ? 0 : -1));\n if (r3 <= 0) goto L_0x0084;\n L_0x0063:\n r3 = (r9 > r0 ? 1 : (r9 == r0 ? 0 : -1));\n if (r3 <= 0) goto L_0x0084;\n L_0x0067:\n if (r1 != r5) goto L_0x006f;\n L_0x0069:\n r9 = r9 / r2;\n r9 = java.lang.Math.abs(r9);\t Catch:{ NumberFormatException -> 0x0084 }\n goto L_0x0085;\n L_0x006f:\n r2 = r2 / r9;\n r9 = java.lang.Math.abs(r2);\t Catch:{ NumberFormatException -> 0x0084 }\n goto L_0x0085;\n L_0x0075:\n r9 = r9.substring(r4);\n r2 = r9.length();\n if (r2 <= 0) goto L_0x0084;\n L_0x007f:\n r9 = java.lang.Float.parseFloat(r9);\t Catch:{ NumberFormatException -> 0x0084 }\n goto L_0x0085;\n L_0x0084:\n r9 = 0;\n L_0x0085:\n r0 = (r9 > r0 ? 1 : (r9 == r0 ? 0 : -1));\n if (r0 <= 0) goto L_0x008d;\n L_0x0089:\n r8.mDimensionRatio = r9;\n r8.mDimensionRatioSide = r1;\n L_0x008d:\n return;\n L_0x008e:\n r8.mDimensionRatio = r0;\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.support.constraint.solver.widgets.ConstraintWidget.setDimensionRatio(java.lang.String):void\");\n }", "public int mo7211g() {\n return this.f2975f.mo7335f();\n }", "public abstract int mo9797a();", "private double getPseudoLoadingFactor( int... plus ) {\n if (plus.length > 0 && plus.length < 2) {\n return (double) (int) (((double) (n + nd + plus[0]) / N) * 10000) / 10000; \n }\n return (double) (int) (((double) (n + nd) / N) * 10000) / 10000;\n }" ]
[ "0.59745276", "0.58905685", "0.57825655", "0.56430525", "0.55956745", "0.55783457", "0.5448511", "0.5411752", "0.54037184", "0.54025286", "0.53972465", "0.5297194", "0.52757895", "0.5231378", "0.52257556", "0.52175045", "0.5185843", "0.51634103", "0.5146458", "0.51422", "0.5134011", "0.5133866", "0.5130291", "0.5125377", "0.51239824", "0.51006556", "0.51000994", "0.50989383", "0.50909626", "0.5083108", "0.5074713", "0.5074641", "0.507082", "0.50682914", "0.5057572", "0.50500405", "0.504829", "0.50472724", "0.5036814", "0.5031698", "0.5030897", "0.5026841", "0.5023549", "0.5021589", "0.5019995", "0.5018778", "0.5016737", "0.50133544", "0.50070816", "0.50058186", "0.50058097", "0.49967015", "0.49938324", "0.49931476", "0.4990965", "0.49857944", "0.4983946", "0.49798223", "0.49764138", "0.49755794", "0.49677378", "0.49642095", "0.4962037", "0.4959579", "0.49562737", "0.49542987", "0.49526107", "0.49507937", "0.4946845", "0.49449688", "0.49439394", "0.49438673", "0.49390554", "0.49382347", "0.49335217", "0.49325633", "0.493143", "0.49304235", "0.49273992", "0.49263147", "0.49197018", "0.49139765", "0.49126968", "0.49124193", "0.49056673", "0.49037725", "0.4902623", "0.49021566", "0.4901762", "0.48992822", "0.48981765", "0.48972723", "0.48944637", "0.48940971", "0.48929065", "0.4891528", "0.48913872", "0.48888442", "0.48877838", "0.48811114", "0.4878258" ]
0.0
-1
/ / / / 41
public void setNoOfRelevantLines(int norl) { this.noOfRelevantLines = norl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int mo36g() {\n return 8;\n }", "public static void main(String[] args) {\n\n\n\n System.out.println(4 * (1.0 - (1 / 3) + (1 / 5) - (1 / 7) + (1 / 9) - (1 / 11)));\n\n System.out.println(4 * (1.0 - (1/3) + (1/5) - (1/7)\n + (1 / 9) - (1/11) + (1/13)));\n }", "public int mo36g() {\n return 4;\n }", "void mo33732Px();", "static int getNumPatterns() { return 64; }", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "public double getPerimiter(){return (2*height +2*width);}", "public int mo9774x() {\n /*\n r5 = this;\n int r0 = r5.f9082i\n int r1 = r5.f9080g\n if (r1 != r0) goto L_0x0007\n goto L_0x006a\n L_0x0007:\n byte[] r2 = r5.f9079f\n int r3 = r0 + 1\n byte r0 = r2[r0]\n if (r0 < 0) goto L_0x0012\n r5.f9082i = r3\n return r0\n L_0x0012:\n int r1 = r1 - r3\n r4 = 9\n if (r1 >= r4) goto L_0x0018\n goto L_0x006a\n L_0x0018:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 7\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0024\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n goto L_0x0070\n L_0x0024:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x0031\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n L_0x002f:\n r1 = r3\n goto L_0x0070\n L_0x0031:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 21\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x003f\n r2 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r2\n goto L_0x0070\n L_0x003f:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r4 = r1 << 28\n r0 = r0 ^ r4\n r4 = 266354560(0xfe03f80, float:2.2112565E-29)\n r0 = r0 ^ r4\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r3 = r2[r3]\n if (r3 >= 0) goto L_0x0070\n int r3 = r1 + 1\n byte r1 = r2[r1]\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r3 = r2[r3]\n if (r3 >= 0) goto L_0x0070\n int r3 = r1 + 1\n byte r1 = r2[r1]\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r2 = r2[r3]\n if (r2 >= 0) goto L_0x0070\n L_0x006a:\n long r0 = r5.mo9776z()\n int r0 = (int) r0\n return r0\n L_0x0070:\n r5.f9082i = r1\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3659c.mo9774x():int\");\n }", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "public int mo36g() {\n return 2;\n }", "public int generateRoshambo(){\n ;]\n\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint i, x=4,w=9,q;\r\n\t\tfor(i=-1;i<20;i+=3) {\r\n\t\t\tx++;\r\n\t\t\tfor(q=4;q<11;q++) {\r\n\t\t\t\tdo {\r\n\t\t\t\t\ti=+3;\r\n\t\t\t\t\tw=sizeof(i);\r\n\t\t\t\t\ti=x+w;\r\n\t\t\t\t\tx=w+i;\r\n\t\t\t\t\t\t\r\n\t\t\t\t} while (x<15);\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"x:\"+x+\"i:\"+i);\r\n\r\n\t}", "@Override\r\n\tpublic void CalcPeri() {\n\t\tSystem.out.println(4*side);\t\r\n\t}", "protected int pathDrawLots(int bound)\n {\n Random r= new Random();\n int num = r.nextInt(bound);\n return num;\n\n\n }", "public static void main(String[] args) {\n int value = 5;\n int ab= 0;\n int ac=0;\n int ad=0;\n int ae=0;\n int af=0;\n int ag=0;\n int am=0;\n int az=0;\n int x = 0;\n int y = 0;\n int z = 0;\n int a = 0;\n int b = 0;\n int c = 0;\n int d = 0;\n int e = 0;\n x= value%2;\n ab=value/2;\n y= ab % 2;\n ac = ab/2;\n z = ac % 2;\n ad= ac/2;\n a = ad % 2;\n ae = ad/2;\n b = ae % 2;\n af= ae/2;\n c = af % 2;\n ag= af/2;\n d= ag % 2;\n am=ag/2;\n e = am %2;\n\n System.out.println(e+\"\"+d+\"\"+c+\"\"+b+\"\"+a+\"\"+z+\"\"+y+\"\"+x);\n\n\n\n\n\n\n\n }", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "private static int trailzerofun(int num) {\n\t\tint count=0;\n\t\tif(num<0)\n\t\t\treturn -1;\n\t\tfor(int i=5;num/i>=1;i*=5)\n\t\t{\n\t\t\tcount+=num/i;\n\t\t}\n\t\treturn count;\n\t}", "int mo54441g(int i);", "private double triangleBase() {\n return cellWidth() / BASE_WIDTH;\n }", "public static void main(String[] args) {\npat(16);\r\nint a[]= {2,0,2};\r\nSystem.out.println(fillthewater(a));\r\npascalstri(6);\r\n\t}", "public int mo9785x() {\n /*\n r10 = this;\n long r0 = r10.f9091i\n long r2 = r10.f9090h\n int r2 = (r2 > r0 ? 1 : (r2 == r0 ? 0 : -1))\n if (r2 != 0) goto L_0x000a\n goto L_0x0085\n L_0x000a:\n r2 = 1\n long r4 = r0 + r2\n byte r0 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r0)\n if (r0 < 0) goto L_0x0017\n r10.f9091i = r4\n return r0\n L_0x0017:\n long r6 = r10.f9090h\n long r6 = r6 - r4\n r8 = 9\n int r1 = (r6 > r8 ? 1 : (r6 == r8 ? 0 : -1))\n if (r1 >= 0) goto L_0x0021\n goto L_0x0085\n L_0x0021:\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n int r1 = r1 << 7\n r0 = r0 ^ r1\n if (r0 >= 0) goto L_0x002f\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n goto L_0x008b\n L_0x002f:\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x003e\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n L_0x003c:\n r6 = r4\n goto L_0x008b\n L_0x003e:\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n int r1 = r1 << 21\n r0 = r0 ^ r1\n if (r0 >= 0) goto L_0x004e\n r1 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r1\n goto L_0x008b\n L_0x004e:\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n int r6 = r1 << 28\n r0 = r0 ^ r6\n r6 = 266354560(0xfe03f80, float:2.2112565E-29)\n r0 = r0 ^ r6\n if (r1 >= 0) goto L_0x003c\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n if (r1 >= 0) goto L_0x008b\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n if (r1 >= 0) goto L_0x003c\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n if (r1 >= 0) goto L_0x008b\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n if (r1 >= 0) goto L_0x003c\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n if (r1 >= 0) goto L_0x008b\n L_0x0085:\n long r0 = r10.mo9787z()\n int r0 = (int) r0\n return r0\n L_0x008b:\n r10.f9091i = r6\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3661d.mo9785x():int\");\n }", "C5537g mo4096b(int i);", "public int arn() {\n return 383;\n }", "public static void main(String[] args) {\n\t\t\n double p = 3048;\n int i;\n\t\t\n\t\t\n\t\tfor (i=1; i <=40; i++) {\n\t\t\t\n\t\t p = p * 2 / 3;\n\t\t \n\t\t}\n\t\t\n\t\tSystem.out.println(\"La distancia que habra recorrido la bola al momento de realizar su rebote numero 40 es de : \"+ p+ \" mts\");\n\n\t}", "public int mo9761x() {\n /*\n r5 = this;\n int r0 = r5.f9074i\n int r1 = r5.f9072g\n if (r1 != r0) goto L_0x0007\n goto L_0x006a\n L_0x0007:\n byte[] r2 = r5.f9070e\n int r3 = r0 + 1\n byte r0 = r2[r0]\n if (r0 < 0) goto L_0x0012\n r5.f9074i = r3\n return r0\n L_0x0012:\n int r1 = r1 - r3\n r4 = 9\n if (r1 >= r4) goto L_0x0018\n goto L_0x006a\n L_0x0018:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 7\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0024\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n goto L_0x0070\n L_0x0024:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x0031\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n L_0x002f:\n r1 = r3\n goto L_0x0070\n L_0x0031:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 21\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x003f\n r2 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r2\n goto L_0x0070\n L_0x003f:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r4 = r1 << 28\n r0 = r0 ^ r4\n r4 = 266354560(0xfe03f80, float:2.2112565E-29)\n r0 = r0 ^ r4\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r3 = r2[r3]\n if (r3 >= 0) goto L_0x0070\n int r3 = r1 + 1\n byte r1 = r2[r1]\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r3 = r2[r3]\n if (r3 >= 0) goto L_0x0070\n int r3 = r1 + 1\n byte r1 = r2[r1]\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r2 = r2[r3]\n if (r2 >= 0) goto L_0x0070\n L_0x006a:\n long r0 = r5.mo9763z()\n int r0 = (int) r0\n return r0\n L_0x0070:\n r5.f9074i = r1\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3658b.mo9761x():int\");\n }", "public static void main(String[] args) {\n\t\tint height = 5;\n\t\tint value = 1;\n\t\tint a = 0;\n\t\tint num = 1;\n\t\tint numCount = 1;\n\t\tint spaceCount = height - 1;\n\t\tSystem.out.println(\"below is numeric Traiangle Program\");\n\t\tfor (int i = 0; height > i; i++) {\n\t\t\tfor (a = 0; a < spaceCount ; ++a) {\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\n\t\t\t}\n\t\t\tspaceCount = spaceCount-1 ;\n\t\t\tfor (int b = 0; b < numCount; b++) {\n\t\t\t\tSystem.out.print(num);\n\t\t\t\tnum = num + 1;\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\tnumCount = numCount + 2;\n\t\t\tnum = 1;\n\t\t\t\n\t\t}\n\t\t\n\t}", "Parallelogram(){\n length = width = height = 0;\n }", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "public void divide() {\n\t\t\n\t}", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "private double getPseudoLoadingFactor( int... plus ) {\n if (plus.length > 0 && plus.length < 2) {\n return (double) (int) (((double) (n + nd + plus[0]) / N) * 10000) / 10000; \n }\n return (double) (int) (((double) (n + nd) / N) * 10000) / 10000;\n }", "int mo23521Ly();", "public static void calcIntegersDivBy()\r\n\t{\r\n\t\tint x = 5;\r\n\t\tint y = 20;\r\n\t\tint p = 3;\r\n\t\tint result = 0;\r\n\t\tif (x % p == 0)\r\n\t\t\tresult = (y / p - x / p + 1);\r\n\t\telse\r\n\t\t\tresult = (y / p - x / p);\r\n\t\tSystem.out.println(result);\r\n\t}", "private static int m36201b(Rect rect) {\n return rect.width() * rect.height();\n }", "public int method_1143(int var1) {\r\n return this.height / 4 + 0 + (24 * var1 - 24) + this.field_987;\r\n }", "private int h1(int p){\n\t\t return p % table.length;\n\t}", "public static void main(String[] args) {\n\r\n for (int x = 1; x < 10; x++) {// x=1\r\n\r\n for (int h = 1; h < 10; h++) { // h=1+1+1...8+1\r\n\r\n System.out.println(x + \"*\" + h \"=\" +x*h);// 1-2-3....8-9\r\n\r\n if(h==2){\r\n break;\r\n }\r\n }\r\n\r\n if(x==4){\r\n continue;\r\n }\r\n\r\n }\r\n\r\n }", "public static int Main()\n\t{\n\t\tint x;\n\t\tint y;\n\t\tint i;\n\t\tint j;\n\t\tx = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\ty = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\tfor (i = 1;x / i > 0;i = i * 2)\n\t\t{\n\t\t;\n\t\t}\n\t\tfor (j = 1;y / j > 0;j = j * 2)\n\t\t{\n\t\t;\n\t\t}\n\t\ti = i / 2;\n\t\tj = j / 2; //i,j????2?????\n\t\tif (i > j)\n\t\t{\n\t\t\tx = x * j / i;\n\t\t}\n\t\telse\n\t\t{\n\t\t\ty = y * i / j;\n\t\t}\n\t\twhile (x != y)\n\t\t{\n\t\t\tx = x / 2;\n\t\t\ty = y / 2;\n\t\t}\n\t\tSystem.out.print(x);\n\n\n\n\n\n\n\t}", "public int mo9232aG() {\n return 0;\n }", "protected float j()\r\n/* 67: */ {\r\n/* 68: 80 */ return 1.5F;\r\n/* 69: */ }", "static void print4(int n) {\n\t\tint blank = 0;\n\t\tint star = (n/2) + 1;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < blank; j++) {\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tfor (int j = 0; j < Math.abs(star); j++) {\n\t\t\t\tSystem.out.print(\"*\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\tstar--;\n\t\t\tif(star == 0) {\n\t\t\t\tstar = -2;\n\t\t\t}\n\t\t\tblank++;\n\t\t\tif(blank > n/2)\n\t\t\t\tblank = n >> 1;\n\t\t}\n\t}", "private static void term(long[] points) {\n\t\tlong temp;\n\t\tfor (int i1 = 0; i1 < points.length; i1++) {\n\t\t\t//System.out.println(((points[i1]/2))*((points[i1]/2)+1));\n\t\t\t//System.out.println((points[i1]/2)*((points[i1]/2)+1));\n\t\t\t\ttemp=(points[i1]/2)*((points[i1]/2)-1);\n\t\t\t//\tSystem.out.println(\"temp\"+temp);\n\t\t\t\tif((points[i1]%2)==0){\n\t\t\t\t\ttemp+=(points[i1])/2;\n\t\t\t\t}else{\n\t\t\t\t\ttemp+=(points[i1])/2;temp+=(points[i1])/2;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(temp);\n\t\t\t\ttemp=0;\n\t\t}\n\t}", "public int g()\r\n/* 601: */ {\r\n/* 602:645 */ return 0;\r\n/* 603: */ }", "private static void eval5(){\n for(int i = 0; i < 46; i++){\n for(int j = i + 1; j < 47; j++){\n for(int k = j + 1; k < 48; k++){\n for(int l = k + 1; l < 49; l++){\n for(int m = l + 1; m < 50; m++){\n Evaluator.evaluate(i, j, k, l, m);\n }\n }\n }\n }\n }\n }", "double passer();", "@Override\n public void init()\n {\n out = mul(num(100.0/Math.log10(length)), log10(div(sum(truerange(), length), diff(highest(length), lowest(length)))));\n }", "public static void main(String[] args) {\n\n\n\n double numberOfgallons = 5;\n\n double gallonstolitter = numberOfgallons*3.785;\n\n\n String result = numberOfgallons + \" gallons equal to: \"+gallonstolitter+ \" liters\";\n System.out.println(result);\n\n //=============================================\n /* 2. write a java program that converts litters to gallons\n 1 gallon = 3.785 liters\n 1 litter = 1/3.785\n*/\n\n /*double litter1 = 1/3.785;\n double l =10;\n double gallon1 = l*litter1;\n\n System.out.println(gallon1);\n //======================================================\n*/\n /*\n 3. manually calculate the following code fragements:\n\t\t\t\t1. int a = 200;\n\t\t\t\t\tint b = -a++ + - --a * a-- % 2\n\t\t\t\t\tb = ?\n\n */\n\n\n double numberOfLiters = 100;\n\n double LiterstoGallons = numberOfLiters/3.785;\n\n String result2 = numberOfLiters+\" liters equal to \"+LiterstoGallons+\" galons\";\n\n System.out.println(result2);\n\n\n\n\n\n\n\n\n\n\n\n\n\n int a = 200;\n int b = -a++ + - --a * a-- % 2;\n // b = -200 + - 200* 200%2 = -200;\n\n int x = 300;\n int y = 400;\n int z = x+y-x*y+x/y;\n // z= 300+400-300*400+300/400=700-120000+0(cunki int kimi qebul edir)= -119300;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n }", "public long mo9775y() {\n /*\n r11 = this;\n int r0 = r11.f9082i\n int r1 = r11.f9080g\n if (r1 != r0) goto L_0x0008\n goto L_0x00b6\n L_0x0008:\n byte[] r2 = r11.f9079f\n int r3 = r0 + 1\n byte r0 = r2[r0]\n if (r0 < 0) goto L_0x0014\n r11.f9082i = 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_0x00b6\n L_0x001b:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 7\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0029\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n L_0x0026:\n long r2 = (long) r0\n goto L_0x00bd\n L_0x0029:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x003a\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n long r0 = (long) r0\n r9 = r0\n r1 = r3\n r2 = r9\n goto L_0x00bd\n L_0x003a:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 21\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0048\n r2 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r2\n goto L_0x0026\n L_0x0048:\n long r3 = (long) r0\n int r0 = r1 + 1\n byte r1 = r2[r1]\n long r5 = (long) r1\n r1 = 28\n long r5 = r5 << r1\n long r3 = r3 ^ r5\n r5 = 0\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 < 0) goto L_0x005f\n r1 = 266354560(0xfe03f80, double:1.315966377E-315)\n L_0x005b:\n long r2 = r3 ^ r1\n r1 = r0\n goto L_0x00bd\n L_0x005f:\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_0x0074\n r5 = -34093383808(0xfffffff80fe03f80, double:NaN)\n L_0x0071:\n long r2 = r3 ^ r5\n goto L_0x00bd\n L_0x0074:\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_0x0087\n r1 = 4363953127296(0x3f80fe03f80, double:2.1560793202584E-311)\n goto L_0x005b\n L_0x0087:\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_0x009a\n r5 = -558586000294016(0xfffe03f80fe03f80, double:NaN)\n goto L_0x0071\n L_0x009a:\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_0x00bb\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_0x00bc\n L_0x00b6:\n long r0 = r11.mo9776z()\n return r0\n L_0x00bb:\n r1 = r0\n L_0x00bc:\n r2 = r3\n L_0x00bd:\n r11.f9082i = r1\n return r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3659c.mo9775y():long\");\n }", "public int getInternalBlockLength()\r\n/* 40: */ {\r\n/* 41: 95 */ return 32;\r\n/* 42: */ }", "private int first_leaf() { return n/2; }", "public double peri() {\n\t\treturn 2*(width+length);\n\t}", "public int mo4452e() {\n /*\n r7 = this;\n int r0 = r7.f2518c\n r7.f2519d = r0\n r0 = 0\n r1 = 0\n r2 = 0\n L_0x0007:\n int r3 = r7.f2519d\n if (r3 <= 0) goto L_0x003b\n byte r3 = r7.mo4449a()\n r4 = -1\n if (r3 == 0) goto L_0x0034\n r5 = 1\n if (r3 == r5) goto L_0x002e\n r6 = 2\n if (r3 == r6) goto L_0x002e\n r6 = 9\n if (r3 == r6) goto L_0x0007\n switch(r3) {\n case 14: goto L_0x0028;\n case 15: goto L_0x0028;\n case 16: goto L_0x0025;\n case 17: goto L_0x0025;\n case 18: goto L_0x0022;\n default: goto L_0x001f;\n }\n L_0x001f:\n if (r2 != 0) goto L_0x0007\n goto L_0x0039\n L_0x0022:\n int r1 = r1 + 1\n goto L_0x0007\n L_0x0025:\n if (r2 != r1) goto L_0x002b\n return r5\n L_0x0028:\n if (r2 != r1) goto L_0x002b\n return r4\n L_0x002b:\n int r1 = r1 + -1\n goto L_0x0007\n L_0x002e:\n if (r1 != 0) goto L_0x0031\n return r5\n L_0x0031:\n if (r2 != 0) goto L_0x0007\n goto L_0x0039\n L_0x0034:\n if (r1 != 0) goto L_0x0037\n return r4\n L_0x0037:\n if (r2 != 0) goto L_0x0007\n L_0x0039:\n r2 = r1\n goto L_0x0007\n L_0x003b:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: androidx.core.text.BidiFormatter.C0510a.mo4452e():int\");\n }", "void mo1761g(int i);", "public int n_()\r\n/* 429: */ {\r\n/* 430:442 */ return this.a.length + 4;\r\n/* 431: */ }", "public int method_2436() {\r\n return 16;\r\n }", "int mo4095a(int i);", "C2841w mo7234g();", "public static void main(String[] args) {\n\t\t\n\t\t int m= 9, n= 1,x=0 ;\n\t\t \n\t\t while (m>n) {\n\t\t\t m--;\n\t\t\t n+=2;\n\t\t\t x+=m+n;\n\t\t\t \n\t\t\t \n\t\t\t \n\t\t\t \n\t\t }\n\t\t System.out.println(x);\n\t\t \n\t\t \n\t\t \n\t\t // a) 11\n\t \t// b) 13\n //c) 23\n //d) 36\n //e) 50\n\t\t\n\n\t}", "public void test4Draft(){\n assertEquals( 4, $computeRange.$list().size());\n //System.out.println( $computeRange.list$Normalized() );\n assertEquals( 4, $computeRange.$listNormalized().size());\n //System.out.println($computeRange.fill(\"multiply10to20\",10,20,\"*\"));\n }", "public abstract int mo123248g();", "private int parent(int i){return (i-1)/2;}", "void rainbow(int width);", "public abstract String division();", "double perimeter();", "@Override\r\n\tpublic double perimeter() {\n\t\treturn 2*length*breadth;\r\n\t}", "double getPerimeter(){\n return 2*height+width;\n }", "public abstract int mo12579RS(int i);", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "public static void main(String[] args) {\n\t\tint n=5;\n\t\tfor(int i=n-1;i>=0;i--)\n\t\t{\n\t\t\tfor(int space=0;space<n-1-i;space++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tfor(int j=0;j<=i*2;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"* \");\n\t\t\t}\n\t\t\n\t\tSystem.out.println();\n\t}\n\n}", "int fi(int x, int y) {\n\t\treturn (x + 1) + (width + 2) * (y + 1);\n\t}", "public abstract int mo9754s();", "public String tri4(int h){\n\t\tString S = \"\";\n\t\tint H = h;\n\t\tint HH = H;\n\t\tint Counter = 0;\n\t\tint UsingCounter = Counter;\n\n\t\twhile (H > 0){\n\t\t\tHH = H;\n\t\t\twhile (UsingCounter > 0){\n\t\t\t\tS = S + \" \";\n\t\t\t\tUsingCounter = UsingCounter - 1;}\n\t\t\twhile (HH > 0) {\n\t\t\t\tS = S + \"*\";\n\t\t\t\tHH = HH - 1;}\n\t\t\tCounter = Counter + 1;\n\t\t\tUsingCounter = Counter;\n\t\t\tS = S + \"\\n\";\n\t\t\tH = H - 1;}\n\n\t\treturn S; }", "public static void main(String[] args) {\n\t\tint num = 10 + 20 -5;\n\t\t\n\t\tnum = 10 + 20/5; // 14\n\t\t\n\t\t// division goes first!\n\t\tnum = (10+20) /5 ; // 6\n\t\t\n\t\tint i = 6+3*10/6;\n\t\t// i = 6+5\n\n\t}", "int getMinimalPaletteDistance();", "private void c()\r\n/* 81: */ {\r\n/* 82: */ BufferedImage localBufferedImage;\r\n/* 83: */ try\r\n/* 84: */ {\r\n/* 85:102 */ localBufferedImage = cuj.a(bsu.z().O().a(this.g).b());\r\n/* 86: */ }\r\n/* 87: */ catch (IOException localIOException)\r\n/* 88: */ {\r\n/* 89:104 */ throw new RuntimeException(localIOException);\r\n/* 90: */ }\r\n/* 91:107 */ int i1 = localBufferedImage.getWidth();\r\n/* 92:108 */ int i2 = localBufferedImage.getHeight();\r\n/* 93:109 */ int[] arrayOfInt = new int[i1 * i2];\r\n/* 94:110 */ localBufferedImage.getRGB(0, 0, i1, i2, arrayOfInt, 0, i1);\r\n/* 95: */ \r\n/* 96:112 */ int i3 = i2 / 16;\r\n/* 97:113 */ int i4 = i1 / 16;\r\n/* 98: */ \r\n/* 99:115 */ int i5 = 1;\r\n/* 100: */ \r\n/* 101:117 */ float f1 = 8.0F / i4;\r\n/* 102:119 */ for (int i6 = 0; i6 < 256; i6++)\r\n/* 103: */ {\r\n/* 104:120 */ int i7 = i6 % 16;\r\n/* 105:121 */ int i8 = i6 / 16;\r\n/* 106:123 */ if (i6 == 32) {\r\n/* 107:124 */ this.d[i6] = (3 + i5);\r\n/* 108: */ }\r\n\t\t\t\t\tint i9;\r\n/* 109:127 */ for (i9 = i4 - 1; i9 >= 0; i9--)\r\n/* 110: */ {\r\n/* 111:129 */ int i10 = i7 * i4 + i9;\r\n/* 112:130 */ int i11 = 1;\r\n/* 113:131 */ for (int i12 = 0; (i12 < i3) && (i11 != 0); i12++)\r\n/* 114: */ {\r\n/* 115:132 */ int i13 = (i8 * i4 + i12) * i1;\r\n/* 116:134 */ if ((arrayOfInt[(i10 + i13)] >> 24 & 0xFF) != 0) {\r\n/* 117:135 */ i11 = 0;\r\n/* 118: */ }\r\n/* 119: */ }\r\n/* 120:138 */ if (i11 == 0) {\r\n/* 121: */ break;\r\n/* 122: */ }\r\n/* 123: */ }\r\n/* 124:142 */ i9++;\r\n/* 125: */ \r\n/* 126: */ \r\n/* 127:145 */ this.d[i6] = ((int)(0.5D + i9 * f1) + i5);\r\n/* 128: */ }\r\n/* 129: */ }", "public abstract int mo12574RN(int i);", "public void a()\r\n/* 49: */ {\r\n/* 50: 64 */ HashSet<BlockPosition> localHashSet = Sets.newHashSet();\r\n/* 51: */ \r\n/* 52: 66 */ int m = 16;\r\n/* 53: 67 */ for (int n = 0; n < 16; n++) {\r\n/* 54: 68 */ for (int i1 = 0; i1 < 16; i1++) {\r\n/* 55: 69 */ for (int i2 = 0; i2 < 16; i2++) {\r\n/* 56: 70 */ if ((n == 0) || (n == 15) || (i1 == 0) || (i1 == 15) || (i2 == 0) || (i2 == 15))\r\n/* 57: */ {\r\n/* 58: 74 */ double d1 = n / 15.0F * 2.0F - 1.0F;\r\n/* 59: 75 */ double d2 = i1 / 15.0F * 2.0F - 1.0F;\r\n/* 60: 76 */ double d3 = i2 / 15.0F * 2.0F - 1.0F;\r\n/* 61: 77 */ double d4 = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3);\r\n/* 62: */ \r\n/* 63: 79 */ d1 /= d4;\r\n/* 64: 80 */ d2 /= d4;\r\n/* 65: 81 */ d3 /= d4;\r\n/* 66: */ \r\n/* 67: 83 */ float f2 = this.i * (0.7F + this.d.rng.nextFloat() * 0.6F);\r\n/* 68: 84 */ double d6 = this.e;\r\n/* 69: 85 */ double d8 = this.f;\r\n/* 70: 86 */ double d10 = this.g;\r\n/* 71: */ \r\n/* 72: 88 */ float f3 = 0.3F;\r\n/* 73: 89 */ while (f2 > 0.0F)\r\n/* 74: */ {\r\n/* 75: 90 */ BlockPosition localdt = new BlockPosition(d6, d8, d10);\r\n/* 76: 91 */ Block localbec = this.d.getBlock(localdt);\r\n/* 77: 93 */ if (localbec.getType().getMaterial() != Material.air)\r\n/* 78: */ {\r\n/* 79: 94 */ float f4 = this.h != null ? this.h.a(this, this.d, localdt, localbec) : localbec.getType().a((Entity)null);\r\n/* 80: 95 */ f2 -= (f4 + 0.3F) * 0.3F;\r\n/* 81: */ }\r\n/* 82: 98 */ if ((f2 > 0.0F) && ((this.h == null) || (this.h.a(this, this.d, localdt, localbec, f2)))) {\r\n/* 83: 99 */ localHashSet.add(localdt);\r\n/* 84: */ }\r\n/* 85:102 */ d6 += d1 * 0.300000011920929D;\r\n/* 86:103 */ d8 += d2 * 0.300000011920929D;\r\n/* 87:104 */ d10 += d3 * 0.300000011920929D;\r\n/* 88:105 */ f2 -= 0.225F;\r\n/* 89: */ }\r\n/* 90: */ }\r\n/* 91: */ }\r\n/* 92: */ }\r\n/* 93: */ }\r\n/* 94:111 */ this.j.addAll(localHashSet);\r\n/* 95: */ \r\n/* 96:113 */ float f1 = this.i * 2.0F;\r\n/* 97: */ \r\n/* 98:115 */ int i1 = MathUtils.floor(this.e - f1 - 1.0D);\r\n/* 99:116 */ int i2 = MathUtils.floor(this.e + f1 + 1.0D);\r\n/* 100:117 */ int i3 = MathUtils.floor(this.f - f1 - 1.0D);\r\n/* 101:118 */ int i4 = MathUtils.floor(this.f + f1 + 1.0D);\r\n/* 102:119 */ int i5 = MathUtils.floor(this.g - f1 - 1.0D);\r\n/* 103:120 */ int i6 = MathUtils.floor(this.g + f1 + 1.0D);\r\n/* 104:121 */ List<Entity> localList = this.d.b(this.h, new AABB(i1, i3, i5, i2, i4, i6));\r\n/* 105:122 */ Vec3 localbrw = new Vec3(this.e, this.f, this.g);\r\n/* 106:124 */ for (int i7 = 0; i7 < localList.size(); i7++)\r\n/* 107: */ {\r\n/* 108:125 */ Entity localwv = (Entity)localList.get(i7);\r\n/* 109:126 */ if (!localwv.aV())\r\n/* 110: */ {\r\n/* 111:129 */ double d5 = localwv.f(this.e, this.f, this.g) / f1;\r\n/* 112:131 */ if (d5 <= 1.0D)\r\n/* 113: */ {\r\n/* 114:132 */ double d7 = localwv.xPos - this.e;\r\n/* 115:133 */ double d9 = localwv.yPos + localwv.getEyeHeight() - this.f;\r\n/* 116:134 */ double d11 = localwv.zPos - this.g;\r\n/* 117: */ \r\n/* 118:136 */ double d12 = MathUtils.sqrt(d7 * d7 + d9 * d9 + d11 * d11);\r\n/* 119:137 */ if (d12 != 0.0D)\r\n/* 120: */ {\r\n/* 121:141 */ d7 /= d12;\r\n/* 122:142 */ d9 /= d12;\r\n/* 123:143 */ d11 /= d12;\r\n/* 124: */ \r\n/* 125:145 */ double d13 = this.d.a(localbrw, localwv.getAABB());\r\n/* 126:146 */ double d14 = (1.0D - d5) * d13;\r\n/* 127:147 */ localwv.receiveDamage(DamageSource.a(this), (int)((d14 * d14 + d14) / 2.0D * 8.0D * f1 + 1.0D));\r\n/* 128: */ \r\n/* 129:149 */ double d15 = EnchantmentProtection.a(localwv, d14);\r\n/* 130:150 */ localwv.xVelocity += d7 * d15;\r\n/* 131:151 */ localwv.yVelocity += d9 * d15;\r\n/* 132:152 */ localwv.zVelocity += d11 * d15;\r\n/* 133:154 */ if ((localwv instanceof EntityPlayer)) {\r\n/* 134:155 */ this.k.put((EntityPlayer)localwv, new Vec3(d7 * d14, d9 * d14, d11 * d14));\r\n/* 135: */ }\r\n/* 136: */ }\r\n/* 137: */ }\r\n/* 138: */ }\r\n/* 139: */ }\r\n/* 140: */ }", "public short mo34e() {\n return 41;\n }", "public void mo9769i(int r9) {\n /*\n r8 = this;\n int r0 = r8.f9080g\n int r1 = r8.f9082i\n int r0 = r0 - r1\n if (r9 > r0) goto L_0x000e\n if (r9 < 0) goto L_0x000e\n int r1 = r1 + r9\n r8.f9082i = r1\n goto L_0x0097\n L_0x000e:\n if (r9 < 0) goto L_0x00a2\n int r0 = r8.f9084k\n int r1 = r8.f9082i\n int r2 = r0 + r1\n int r3 = r2 + r9\n int r4 = r8.f9085l\n if (r3 > r4) goto L_0x0098\n q.b.c.a.j0.a.k$c$a r0 = r8.f9086m\n r3 = 0\n if (r0 != 0) goto L_0x007d\n r8.f9084k = r2\n int r0 = r8.f9080g\n int r0 = r0 - r1\n r8.f9080g = r3\n r8.f9082i = r3\n r3 = r0\n L_0x002b:\n if (r3 >= r9) goto L_0x0075\n int r0 = r9 - r3\n java.io.InputStream r1 = r8.f9078e // Catch:{ all -> 0x006b }\n long r4 = (long) r0 // Catch:{ all -> 0x006b }\n long r0 = r1.skip(r4) // Catch:{ all -> 0x006b }\n r6 = 0\n int r2 = (r0 > r6 ? 1 : (r0 == r6 ? 0 : -1))\n if (r2 < 0) goto L_0x0046\n int r4 = (r0 > r4 ? 1 : (r0 == r4 ? 0 : -1))\n if (r4 > 0) goto L_0x0046\n if (r2 != 0) goto L_0x0043\n goto L_0x0075\n L_0x0043:\n int r0 = (int) r0 // Catch:{ all -> 0x006b }\n int r3 = r3 + r0\n goto L_0x002b\n L_0x0046:\n java.lang.IllegalStateException r9 = new java.lang.IllegalStateException // Catch:{ all -> 0x006b }\n java.lang.StringBuilder r2 = new java.lang.StringBuilder // Catch:{ all -> 0x006b }\n r2.<init>() // Catch:{ all -> 0x006b }\n java.io.InputStream r4 = r8.f9078e // Catch:{ all -> 0x006b }\n java.lang.Class r4 = r4.getClass() // Catch:{ all -> 0x006b }\n r2.append(r4) // Catch:{ all -> 0x006b }\n java.lang.String r4 = \"#skip returned invalid result: \"\n r2.append(r4) // Catch:{ all -> 0x006b }\n r2.append(r0) // Catch:{ all -> 0x006b }\n java.lang.String r0 = \"\\nThe InputStream implementation is buggy.\"\n r2.append(r0) // Catch:{ all -> 0x006b }\n java.lang.String r0 = r2.toString() // Catch:{ all -> 0x006b }\n r9.<init>(r0) // Catch:{ all -> 0x006b }\n throw r9 // Catch:{ all -> 0x006b }\n L_0x006b:\n r9 = move-exception\n int r0 = r8.f9084k\n int r0 = r0 + r3\n r8.f9084k = r0\n r8.mo9764A()\n throw r9\n L_0x0075:\n int r0 = r8.f9084k\n int r0 = r0 + r3\n r8.f9084k = r0\n r8.mo9764A()\n L_0x007d:\n if (r3 >= r9) goto L_0x0097\n int r0 = r8.f9080g\n int r1 = r8.f9082i\n int r1 = r0 - r1\n r8.f9082i = r0\n r0 = 1\n L_0x0088:\n r8.mo9768h(r0)\n int r2 = r9 - r1\n int r3 = r8.f9080g\n if (r2 <= r3) goto L_0x0095\n int r1 = r1 + r3\n r8.f9082i = r3\n goto L_0x0088\n L_0x0095:\n r8.f9082i = r2\n L_0x0097:\n return\n L_0x0098:\n int r4 = r4 - r0\n int r4 = r4 - r1\n r8.mo9769i(r4)\n q.b.c.a.j0.a.c0 r9 = p213q.p217b.p301c.p302a.p311j0.p312a.C3606c0.m8181h()\n throw r9\n L_0x00a2:\n q.b.c.a.j0.a.c0 r9 = p213q.p217b.p301c.p302a.p311j0.p312a.C3606c0.m8179f()\n throw r9\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3659c.mo9769i(int):void\");\n }", "void mo1943l();", "private int getIndex2(int val){\n return val/bucket;\n }", "public abstract int mo12580RT(int i);", "public abstract int mo12578RR(int i);", "void mo32046rn(int i);", "public abstract int mo8526p();", "int numOfPillars() {\n // there are one more coordinate line than blocks in each direction\n // since each block must be hinged on a coordinate line on each side\n return (ni+1) * (nj+1);\n }", "public static void main(String[] args) {\n\t\tint num=4;\r\n\t\tfor(int i=0;i<=num;i++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(int j=0;j<=num;j++) {\r\n\t\t\t\t\t\tif(j<=i && i+j>=num) \r\n\t\t\t\t\t\r\n\t\t\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t\t\t}\r\n\t\t\t}", "public final void mo42079g() {\n mo42076a(riv.f43130x, mo42086n());\n super.mo42079g();\n }", "private static void eval7(){\n int z = 0;\n for(int i = 0; i < 46; i++){\n for(int j = i + 1; j < 47; j++){\n for(int k = j + 1; k < 48; k++){\n for(int l = k + 1; l < 49; l++){\n for(int m = l + 1; m < 50; m++){\n for(int n = m + 1; n < 51; n++){\n for(int o = n + 1; o < 52; o++){\n Evaluator.evaluate(i, j, k, l, m, n, o);\n }\n }\n }\n }\n }\n }\n }\n }", "public abstract int mo9749n();", "int getBlockNumber(int x, int y);", "public static void main(String[] args) {\n\t\tint length = 9;\n\t\tint counter = 1;\n\t\t\tfor ( int x = (length+1)/2; x<=length;x++){\n\t\t\t\tfor (int j = x-counter; j>=0; j--){\n\t\t\t\t\t//System.out.println(\"j is \"+ j);\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tfor (int i =1;i<=counter;i++){\n\t\t\t\t\t\t\n\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println();\n\t\t\t\tcounter+=2;\n\t\t\t}\n\t\t\tcounter = length-2;\n\t\t\t\n\t\t\t// length = 9, counter is 7 , j = 1, i = 7, x=8\n\t\t\tfor ( int x = (length-1); x>=(length+1)/2; x--){\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\tfor (int j = 1; j<=x-counter; j++){\n\t\t\t\t\t//System.out.println(\"j is \"+ j);\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tfor (int i =counter;i>=1;i--){\n\t\t\t\t\t\t\n\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}\n\t\t\t\tcounter-=2;\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t}", "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 }", "public static void main(String[] args) {\n\t\tint Length = 40 ;\r\n\t\tint breath = 50 ;\r\n\t\tint Area = Length * breath;\r\n\t\tSystem.out.println( \"Area of Recctangle is : \" + Area);\r\n\t}", "private double noBranch() {\n\t\treturn num * configMap.get('r') + (num-1) * configMap.get('l') + num * configMap.get('f') + configMap.get('a');\n\t}", "public int getBlockLength()\r\n/* 45: */ {\r\n/* 46:107 */ return -32;\r\n/* 47: */ }", "private void ncpStep(double height) {\n/* 56 */ double posX = mc.field_71439_g.field_70165_t;\n/* 57 */ double posZ = mc.field_71439_g.field_70161_v;\n/* 58 */ double y = mc.field_71439_g.field_70163_u;\n/* 59 */ if (height >= 1.1D) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 80 */ if (height < 1.6D) {\n/* */ double[] offset;\n/* 82 */ for (double off : offset = new double[] { 0.42D, 0.33D, 0.24D, 0.083D, -0.078D }) {\n/* 83 */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y += off, posZ, false));\n/* */ }\n/* 85 */ } else if (height < 2.1D) {\n/* */ double[] heights;\n/* 87 */ for (double off : heights = new double[] { 0.425D, 0.821D, 0.699D, 0.599D, 1.022D, 1.372D, 1.652D, 1.869D }) {\n/* 88 */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y + off, posZ, false));\n/* */ }\n/* */ } else {\n/* */ double[] heights;\n/* 92 */ for (double off : heights = new double[] { 0.425D, 0.821D, 0.699D, 0.599D, 1.022D, 1.372D, 1.652D, 1.869D, 2.019D, 1.907D })\n/* 93 */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y + off, posZ, false)); \n/* */ } \n/* */ return;\n/* */ } \n/* */ double first = 0.42D;\n/* */ double d1 = 0.75D;\n/* */ if (height != 1.0D) {\n/* */ first *= height;\n/* */ d1 *= height;\n/* */ if (first > 0.425D)\n/* */ first = 0.425D; \n/* */ if (d1 > 0.78D)\n/* */ d1 = 0.78D; \n/* */ if (d1 < 0.49D)\n/* */ d1 = 0.49D; \n/* */ } \n/* */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y + first, posZ, false));\n/* */ if (y + d1 < y + height)\n/* */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y + d1, posZ, false)); \n/* */ }", "private int getBinJ(Location l)\r\n {\r\n return (int)((l.getY()-bl.getY())/dj);\r\n }", "@Override\n\tpublic double perimetro() {\n\t\treturn getBase()*4;\n\t}", "public void division() {\n\t\tx=1;\n\t\ty=0;\n\t\tz=x/y;\n\t\t\t\t\n\t}", "@Override\n protected long advanceH(final long k) {\n return 5 * k - 2;\n }" ]
[ "0.5658427", "0.5643581", "0.56358004", "0.56270814", "0.56011534", "0.55656403", "0.5482086", "0.54549825", "0.54039633", "0.539607", "0.53397727", "0.53386515", "0.5335169", "0.52784574", "0.52470255", "0.5244672", "0.52410525", "0.5217285", "0.5202863", "0.51965845", "0.5171586", "0.51654935", "0.51624477", "0.5154615", "0.5153249", "0.5135485", "0.51335824", "0.5128225", "0.511583", "0.51109856", "0.51048577", "0.5099958", "0.5084234", "0.5073864", "0.5064784", "0.50588", "0.50558496", "0.5047672", "0.50462914", "0.50444233", "0.50394", "0.50312585", "0.5030072", "0.502921", "0.50269866", "0.50266105", "0.5021907", "0.50141656", "0.5014071", "0.5008694", "0.50085795", "0.50060177", "0.5003027", "0.5002027", "0.5000083", "0.49991235", "0.4998822", "0.49983335", "0.49978635", "0.49949628", "0.49928153", "0.49900448", "0.49838102", "0.49829513", "0.4982049", "0.49759546", "0.49735326", "0.4972844", "0.49683833", "0.49683475", "0.4965394", "0.4965235", "0.49633628", "0.49626768", "0.49617594", "0.49611318", "0.49548358", "0.4952789", "0.49463034", "0.49456057", "0.49428678", "0.49406663", "0.49399397", "0.49398428", "0.49329546", "0.49298355", "0.49287346", "0.4922138", "0.49216524", "0.49206173", "0.4916373", "0.4914406", "0.49141687", "0.49051306", "0.4903908", "0.49028388", "0.48997414", "0.4899534", "0.48942453", "0.48919195", "0.48908967" ]
0.0
-1
the random computer guessing
public boolean computerGuess() { boolean isWhite; int randomBool = (int) (Math.random()*50); if(randomBool<25) isWhite = true; else isWhite = false; while(newGame.containsColor(isWhite) == false) { randomBool = (int) (Math.random()*50); if(randomBool<25) isWhite = true; else isWhite = false; } int randomPanel = (int) (Math.random()*newGame.getUserHandLength()); //System.out.println(randomPanel); int randomGuess = (int) (Math.random()*12); if(newGame.getCompHand().contains(new Panel(isWhite,randomGuess,false))) { if(newGame.getUserHand().getPanel(randomPanel).compareTo(new Panel(isWhite,randomGuess,false)) == 0) return true; else return false; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void generateComputerChoice() {\n\t\tgetRandomNumber();\n\t\tsetComputerChoice();\n\t}", "public void makeGuess() {\n columnGuess = ((int) (Math.random() * 100000)) % 10;\n\n int number = ((int) (Math.random() * 100000)) % 10;\n rowGuess = (char) (number + 65);\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tSystem.out.println(\"Welcome to the very generic game of...Guess the Number!\");\r\n\t\t\r\n\t\tScanner difficultyChoice = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.println(\"Select parameters below. 1 = 1-15, 2 = 1-25, and 3 = 1-50\");\r\n\t\t\r\n\t\tString choice = difficultyChoice.nextLine();\r\n\t\t\r\n\t\tint selection = 0;\r\n\t\t\r\n\t\tdo {\r\n\t\t\tif(choice.equals(\"1\")){\r\n\t\t\t\tselection = 1;\r\n\r\n\t\t\t} else if(choice.equals(\"2\")) {\r\n\t\t\t\tselection = 2;\r\n\r\n\t\t\t} else if(choice.equals(\"3\")) {\r\n\t\t\t\tselection = 3;\r\n\t\t\t}\r\n\t\t\tif(selection == 0) {\r\n\t\t\t\tSystem.out.println(\"Invalid entry. Please try again. Remember* 1 for 1-25, 2 for 1-50, and 3 for 1-100\");\r\n\t\t\t\tchoice = difficultyChoice.nextLine();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t} while(selection ==0);\r\n\t\t\r\n\t\tRandom computerNumber = new Random();\r\n\r\n\t\tint randomNum = 0;\r\n\r\n\t\tif(selection == 1){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(15);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-15. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif(selection == 2){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(25);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-25. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif(selection == 3){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(50);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-50. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint guessTotal = 0;\r\n\r\n\t\tRandom RandomNum = computerNumber; \r\n\r\n\t\tScanner playerGuess1 = new Scanner(System.in);\r\n\r\n\t\tSystem.out.println(\"Please enter your first guess on the line below: \");\r\n\r\n\t\tint guess1 = playerGuess1.nextInt();\r\n\r\n\t\tif(guess1 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your first try!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\t\r\n\t\tif(guess1 != randomNum) {\r\n\t\t\tguessTotal = 1;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 2)\");\r\n\t\t\tif(guess1 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t}else\r\n\t\t\t{\r\n\t\t\t\tif(guess1 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tScanner playerGuess2 = new Scanner(System.in);\r\n\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\t\t\t\");\r\n\r\n\t\tSystem.out.println(\"Please enter your second guess on the line below: \");\r\n\r\n\t\tint guess2 = playerGuess2.nextInt();\r\n\r\n\t\tif(guess2 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your second try!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tif(guess2 != randomNum) {\r\n\t\t\tguessTotal = 2;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 1)\");\r\n\t\t\tif(guess2 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t} else {\r\n\t\t\t\tif(guess2 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tScanner playerGuess3 = new Scanner(System.in);\r\n\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\t\t\t\");\r\n\r\n\t\tSystem.out.println(\"Please enter your third guess on the line below: \");\r\n\r\n\t\tint guess3 = playerGuess3.nextInt();\r\n\r\n\t\tif(guess3 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your third try!\");\r\n\t\t}\r\n\r\n\t\tif(guess3 != randomNum) {\r\n\t\t\tguessTotal = 3;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 0) Game over!\");\r\n\t\t\t/*if(guess3 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t} else {\r\n\t\t\t\tif(guess3 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\");\r\n\t\t\tSystem.out.println(\"The correct number was \" + randomNum);\r\n\t\t}", "abstract int nextTry(String guess);", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "public static void userGuess() {\n\t\tSystem.out.println(\"It's time for you to guess. \");\n\t\tSystem.out.print(\"The computer will pick 4 numbers, each from 1 to 6: (\");\n\n\t\t// prints out all color options\n\t\tprintColor();\n\t\tSystem.out.println(\"You will try to guess what that exact sequence is in 12 tries, good luck!\");\n\t\tSystem.out.println(\"If you want to give up, enter 'quit' or 'exit'\");\n\t\tSystem.out.println(\"If you need a hint, enter 'hint'\");\n\t\tSystem.out.println(\"If you want some statistics, enter 'stats'\");\n\n\t\t// have computer pick random sequence\n\t\tRandom random = new Random();\n\t\tfor (int i = 0; i < NUM_COLOR_ROUND; i++) {\n\t\t\tcomputerCode[i] = random.nextInt(colors.length) + 1;\n\t\t}\n\n\t\t// scanner to input user data\n\t\ttry (Scanner scanner = new Scanner(System.in)) {\n\t\t\t// allows the user to input 12 guesses\n\t\t\twhile (totalGuess < MAX_GUESS) {\n\t\t\t\t// if you haven't entered 12 guesses allow more\n\t\t\t\tSystem.out.print(\"Please enter 4 numbers, each from 1 to 6: (\");\n\t\t\t\tprintColor();\n\n\t\t\t\t// reads the line into an array\n\t\t\t\tint[] user_guesses = new int[NUM_COLOR_ROUND];\n\t\t\t\tint index = 0;\n\t\t\t\twhile (index < NUM_COLOR_ROUND) {\n\t\t\t\t\t// reads the entire user input into a line\n\t\t\t\t\tString guess = scanner.nextLine();\n\n\t\t\t\t\t// check if user wants hint\n\t\t\t\t\tif (Objects.equals(\"hint\", guess)) {\n\t\t\t\t\t\thint();\n\t\t\t\t\t}\n\n\t\t\t\t\t// checks if user wants to quit\n\t\t\t\t\tif (Objects.equals(\"quit\", guess.toLowerCase()) || Objects.equals(\"exit\", guess.toLowerCase())) {\n\t\t\t\t\t\tSystem.out.println(\"You quit, better luck next time! \");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\n\t\t\t\t\t// checks if user wants stats\n\t\t\t\t\tif (Objects.equals(\"stats\", guess.toLowerCase())) {\n\t\t\t\t\t\tdisplayStats();\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (char ch : guess.toCharArray()) {\n\t\t\t\t\t\tif (index == NUM_COLOR_ROUND) {\n\t\t\t\t\t\t\t// if more than 4 digits are used, only the first 4 are entered into array\n\t\t\t\t\t\t\tSystem.out.println(\"Warning: only the first four digits are taken as your guess.\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (ch > '0' && ch < '7') {\n\t\t\t\t\t\t\tuser_guesses[index++] = ch - '0';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tint digitLeft = NUM_COLOR_ROUND - index;\n\t\t\t\t\tif (digitLeft > 0) {\n\t\t\t\t\t\t// if <4 digits are entered, then the program asks the user to enter the\n\t\t\t\t\t\t// remaining to make 4\n\t\t\t\t\t\tSystem.out.println(String.format(\"Please enter %d more digits (1 to 6 only)\", digitLeft));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// total number of guesses so far\n\t\t\t\ttotalGuess++;\n\n\t\t\t\t// prints out total number of guesses so far\n\t\t\t\tSystem.out.println(\"Total number of guesses: \" + totalGuess);\n\t\t\t\t// prints out your guess\n\t\t\t\tSystem.out.println(\"Your guess is: \" + Arrays.toString(user_guesses));\n\n\t\t\t\t// checks if user wins, if not, gives feedback on their guess\n\t\t\t\tint[] result = compareGuess(computerCode, user_guesses);\n\t\t\t\tint numRightPos = result[0];\n\t\t\t\tint numWrongPos = result[1];\n\t\t\t\tif (numRightPos == NUM_COLOR_ROUND) {\n\t\t\t\t\tSystem.out.println(\"You win!\");\n\t\t\t\t\tstoreStats(totalGuess, fileName);\n\t\t\t\t\tdisplayStats();\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(String.format(\n\t\t\t\t\t\t\t\"Correct position and color (BLACK): %d; Wrong position but correct color (WHITE): %d\",\n\t\t\t\t\t\t\tnumRightPos, numWrongPos));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (totalGuess >= MAX_GUESS) {\n\t\t\t// if user has done 12 guesses, game is over\n\t\t\tSystem.out.println(\"You lose!\");\n\t\t\tSystem.out.println(\"Here is what computer generated: \" + Arrays.toString(computerCode));\n\t\t\tstoreStats(0, fileName);\n\t\t\tdisplayStats();\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tint computerNum = (int)(Math.random()*100) + 1; \r\n\t\t//Code generates a decimal -> multiple by 100 to make it a whole number ->\r\n\t\t//use int to convert to integer to cut off decimal\r\n\t\tint userGuess = -100;\r\n\t\tint guessCount = 0;\r\n\t\twhile (userGuess != computerNum && userGuess != -1) {\r\n\t\t\tString input = JOptionPane.showInputDialog(null, \"This is a number guessing game. \"\r\n\t\t\t\t\t+ \"\\nPlease guess a whole number between 1 and 100.\");\r\n\t\t\tuserGuess = Integer.parseInt(input);\r\n\t\t\t//JOptionPane.showMessageDialog(null, \"Your guess was \" + userGuess + \".\");\r\n\t\t\tif (userGuess == -1){\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"You have chosen to leave the program.\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\telse if (userGuess < 0 || userGuess > 100){\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Your number is invalid.\"\r\n\t\t\t\t\t\t+ \" Please enter a number between 1 and 100.\");\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (userGuess > computerNum){\r\n\t\t\t\tif (userGuess - 10 <= computerNum) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Your guess a little too high, \"\r\n\t\t\t\t\t\t\t+ \" but within 10 of the number! Guess a little lower.\");\r\n\t\t\t\t\t//guessCount ++; \r\n\t\t\t\t\t//return guessCount;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Your guess was too high! \"\r\n\t\t\t\t\t\t\t+ \"Make a lower guess.\");\r\n\t\t\t\t\t//guessCount ++;\r\n\t\t\t\t}\r\n\t\t\t\tguessCount ++;\r\n\t\t\t}\r\n\t\t\telse if (userGuess < computerNum) {\r\n\t\t\t\tif (userGuess + 10 >= computerNum) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Your guess was a little too low, \"\r\n\t\t\t\t\t\t\t+ \"but within 10 of the number! Guess a little higher.\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tJOptionPane.showConfirmDialog(null, \"Your guess was too low!\"\r\n\t\t\t\t\t\t\t+ \" Make a higher guess.\");\t\r\n\t\t\t\t}\r\n\t\t\t\tguessCount ++;\r\n\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Yay! You guessed correctly!\");\r\n\t\t\t}\r\n\t\t\t//JOptionPane.showMessageDialog(null, \"# = \" + computerNum +\r\n\t\t\t\t\t//\"# of guesses = \" + guessCount);\r\n\t\t}\r\n\t\tJOptionPane.showMessageDialog(null, \"The random number was: \" + computerNum +\r\n\t\t\t\t\"\\nIt took you \" + guessCount + \" guesses.\");\r\n\r\n\t}", "int tournament() {\r\n \tint ch1,ch2;\r\n\t\tch1 = (int)Math.floor(Math.random()*SIZE);\r\n\t\tdo {\r\n\t\t\tch2 = (int)Math.floor(Math.random()*SIZE);\r\n\t\t} while (ch1==ch2);\r\n\t\tif (fit[ch1]<fit[ch2]) return ch1;\r\n\t\telse return ch2;\r\n }", "public void random(){\r\n\t\tRandom rand = new Random();\r\n\t\trandArray = new int[6];\r\n\t\tfor (int i = 0; i < 6; i++){\r\n\t\t\t//Randomly generated number from zero to nine\r\n\t\t\trandom = rand.nextInt(10);\r\n\t\t\t//Random values stored into the array\r\n\t\t\trandArray[i] = random;\r\n\t\t\tif(i == 0){\r\n\t\t\t\ta = random;\r\n\t\t\t}\r\n\t\t\tif(i == 1){\r\n\t\t\t\tb = random;\r\n\t\t\t}\r\n\t\t\tif(i == 2){\r\n\t\t\t\tc = random;\r\n\t\t\t}\r\n\t\t\tif(i == 3){\r\n\t\t\t\td = random;\r\n\t\t\t}\r\n\t\t\tif(i == 4){\r\n\t\t\t\tf = random;\r\n\t\t\t}\r\n\t\t\tif(i == 5){\r\n\t\t\t\tg = random;\r\n\t\t\t}\r\n\t\t\t//Random values outputted\r\n\t\t\t//Prints out if the hint was not used.\r\n\t\t\tif (executed == false || guessed == true ){\r\n\t\t\t\tprint(randArray[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Prints out if the hint was not used.\r\n\t\tif (executed == false || guessed == true){\r\n\t\t\tprintln(\" Randomly Generated Value\");\r\n\t\t}\r\n\t}", "@Override\n public String getGuess() throws TimeoutException {\n\n int count = 1;\n\n while (this.answers.size() - count >0){\n if(this.answers.get(answers.size()-count).equals(\"yes\")) {\n\n return excuteQuery(this.getQuery(\"Guess\", \"Question=\" + \"'\" + this.questions.get(questions.size() -count) + \"'\"))\n .replaceAll(\"</br>\", \"\\n\");\n }\n count++;\n }\n\n return \"no result found\\n\";\n\n\n }", "public static int computerChoice(Random generator){\n int randNumber;\n \n randNumber = generator.nextInt(5);\n return randNumber;\n }", "public abstract void nextGuessResult(ResultPegs resultPegs);", "private void random() {\n\n\t}", "public static void main(String[] args) {\n\t\tdouble guess;\r\n\t\t\r\n\t\tScanner bob = new Scanner(System.in);\r\n\t\tint answer = (int)(10.0 * Math.random());\r\n\t\tSystem.out.println(answer);\r\n\t\t\r\n\t\tfor(int i =0; i < 3; i++){\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Please guess a number between 1 and 10 : \");\r\n\t\t\tguess = bob.nextDouble();\r\n\t\t\t\r\n\t\t\twhile (guess>10)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This number is out of range please guess between 1 and 10\");\r\n\t\t\t\tSystem.out.println(\"Please guess a number between 1 and 10 : \");\r\n\t\t\t\tguess = bob.nextDouble();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t if (guess == answer) {\r\n\t\t\t System.out.println(\"RIGHT!\");\r\n\t\t\t i=4;\r\n\t } \r\n\t\t\telse if ((answer == guess + 1) || (answer == guess - 1)) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t System.out.println(\"hot, please try again\");\r\n\t\t\t\t \r\n\t\t\t\t }\r\n\t\t\t\telse if ((answer == guess + 2) || (answer == guess - 2)){\r\n\t\t\t\t System.out.println(\"warm!, please try again\");\r\n\t\t\t }\r\n\t\t\t\t else if ((answer == guess + 3) || (answer == guess - 3)){\r\n\t\t\t\t\t System.out.println(\"cold!, please try again\"); \r\n\t\t\t\t \t\t\t \r\n\t\t\t\t }\r\n\t\t\t\t else if (i == 2){\r\n\t\t\t\t\t System.out.println(\"You loose \"); \r\n\t\t\t\t\t \r\n\t\t\t\t }else {\r\n\t\t\t\t\t System.out.println(\"cold!, please try again\"); \r\n\t\t\t \t\t\t \r\n\t\t\t\t }\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t \r\n\t\t}\r\n\t\tSystem.out.println(\"The answer is :\"+answer);\r\n\t\t\r\n\t\t\r\n}", "public abstract boolean guess(String guess);", "Boolean getRandomize();", "public static void main(String[] args)\n {\n int answer;\n int counter = 0;\n char guessAgain;\n Random rGen = new Random();\n Scanner myScanner = new Scanner(System.in);\n int guess;\n //Let's give our number a value between 0 and 100\n answer = rGen.nextInt(201) - 100;\n do\n {\n //Let's ask them to guess\n System.out.println(\"I've picked a number between -100 and 100, inclusive.\");\n System.out.println(\"Betcha can't guess it!\");\n guess = myScanner.nextInt();\n counter++;\n System.out.println(\"Your guess: \" + guess);\n if(guess == answer)\n {\n if(counter==1)\n {\n System.out.println(\"Wow, nice guess! That was it!\");\n return;\n }\n else\n {\n System.out.println(\"Well, it's about time!\");\n return;\n }\n }\n else if(guess < answer)\n {\n System.out.println(\"Ha, nice try - too low!\");\n }\n else\n {\n System.out.println(\"Too bad, way too high.\");\n }\n System.out.println(\"Would you like to guess again? (y/n)\");\n guessAgain = myScanner.next().charAt(0);\n counter++;\n myScanner.nextLine();\n }while(guessAgain=='y');\n System.out.println(\"Well, the answer was: \" + answer);\n }", "Randomizer getRandomizer();", "private String RandomGoal() {\n\t\tList<String> list = Arrays.asList(\"m\", \"m\", \"m\", \"m\", \"m\", \"m\", \"m\", \"m\", \"t\", \"t\");\n\t\tRandom rand = new Random();\n\t\tString randomgoal = list.get(rand.nextInt(list.size()));\n\n\t\treturn randomgoal;\n\t}", "private void setComputerChoice() {\n\t\tcomputerChoice = POSSIBLE_CHOICE[randomNumber];\n\t}", "public KunyarukGame() {\n \t\tthis(321);\n \t\tlong seed = System.nanoTime();\n \t\tRandom ran = new Random(seed);\n \t\tthis.secret = ran.nextInt(this.upperBound)+1;\n \t\tsuper.setMessage(\"Can you guess a number between 1 and \"+this.upperBound+\" that I'm thinking of?\");\n }", "private void tryGuess(int guess) {\n int guessAssert = guesser.assertGuess(guess);\n switch (guessAssert) {\n case 0:\n guesser.madeGuess();\n System.out.println(\"Too low. Guess again: \");\n break;\n case 1:\n guesser.madeGuess();\n System.out.println(\"Too high. Guess again: \");\n break;\n case 2:\n guesser.madeGuess();\n System.out.println(\"You got it in \"+guesser.getGuess()+\" guesses!\");\n break;\n default:\n guesser.madeGuess();\n System.out.println(\"Invalid numeric value has been entered.\");\n break;\n }\n\n }", "public void rightGuess()\r\n\t{\r\n\t\tif(userWon())\r\n\t\t{\r\n\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"good job! you've correctly guessed the panel \\n would you like to guess again? if so enter yes, if you would like to add your tile to your code, reply no\\n\\n\");\r\n\t\tString answer = sc.next();\r\n\t\tif(answer.compareTo(\"yes\") == 0 || answer.compareTo(\"Yes\") == 0)\r\n\t\t{\r\n\t\t\tuserTurn(false);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(userRanPan.getValue() == -1)\r\n\t\t\t\tnewGame.getUserHand().addDash(false,userRanPan);\r\n\t\t\telse\r\n\t\t\t\tnewGame.getUserHand().addPanel(userRanPan,false);\r\n\r\n\t\t\tuserGuess.clear();\r\n\t\t\tslide(previousGuess,userRanPan);\r\n\r\n\t\t\tif(userWon() == false)\r\n\t\t\t\tcompTurn(false);\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//foo.repaint();\r\n\t}", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "@Override\r\n\tpublic Code nextGuess() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tRandom randGen = new Random();\r\n\t\tCode newCode;\r\n\t\t\r\n\t\tArrayList<String> values;\r\n\t\twhile(true)\r\n\t\t{values = new ArrayList<String>();\r\n\t\tfor (int i = 0; i < super.getNumVars(); i++)\r\n\t\t{\r\n\t\t\tint colorIndex = randGen.nextInt((super.getColorList().size()));\r\n\t\t\tvalues.add(super.getColorList().get(colorIndex));\r\n\t\t}\r\n\t\t\r\n\t\tnewCode = new Code(super.getNumVars());\r\n\t\t\r\n\t\tfor (int i = 0; i < values.size(); i++)\r\n\t\t{\r\n\t\t\tnewCode.addEntry(values.get(i));\r\n\t\t}\r\n\t\t//contains method for code\r\n\t\t\r\n\t\tboolean shouldBreak=true;//(guessHistory.size()==0?true:false);\r\n\t\tfor(int i=0,totalequal=0;i<guessHistory.size();++i,totalequal=0)\r\n\t\t{\r\n\t\t\tCode itrHistory=guessHistory.get(i);\r\n\t\t\tfor(int j=0;j<super.getNumVars();++j)\r\n\t\t\tif(newCode.colorAt(j).equals(itrHistory.colorAt(j)))\r\n\t\t\t\t\ttotalequal++;\r\n\t\t\t\t\r\n\t\t\tif(totalequal==super.getNumVars())\r\n\t\t\t\tshouldBreak=false;\r\n\t\t\t\r\n\t\t}\r\n\t\tif(shouldBreak)\r\n\t\t\tbreak;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tguessHistory.add(newCode);\r\n\t\treturn newCode;\r\n\t}", "private static int guessing() {\n\t\t\n\t\tSystem.out.println(\"Guess a number between 1 and 100, you have 5 trials: \");\n\t\t\n\t\tint trials = 5;\n\t\tScanner input = new Scanner(System.in);\n\t\t\n\t\t//set a random number as the number to be guessed\n\t\tint num = (int)(100 * Math.random()) + 1;\n\t\tint points = 0;\n\t\t\n\t\t//use a flag to check if player guess the correct number or not\n\t\tboolean flag = false;\n\t\twhile ( trials > 0) {\n\t\t\tint guess = input.nextInt();\n\t\t\ttrials--;\n\t\t\tif ( guess == num ) {\n\t\t\t\tpoints = trials == 0? 20 : trials * 20;\n\t\t\t\t//System.out.println(\"You guess the number with\"+trials+\"trials left, congratulation! +\"+ (points = trials == 0? 20 : trials * 20)+\" points\");\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}else if ( guess < num ) {\n\t\t\t\tSystem.out.println(\"The guess is too small, please try again, you have \"+trials+\" trials left.\");\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"The guess is too large, please try again, you have \"+trials+\" trials left.\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif ( !flag ) System.out.println(\"Trials used up, + 0 points\");\n\t\treturn points;\n\t\t\n\t}", "public void printWrongGuess() {\r\n\t\t\r\n\t\tSystem.out.print(\"Wrong Guesses: \" + wrongGuess + \"\\n\");\r\n\t}", "public void wrongGuess()\r\n\t{\r\n\t\tSystem.out.println(\"Sorry, your guess is wrong\");\r\n\t\tif(userRanPan.getValue() == -1)\r\n\t\t\tnewGame.getUserHand().addDash(true,userRanPan);\r\n\t\telse\r\n\t\t\tnewGame.getUserHand().addPanel(userRanPan,true);\r\n\r\n\t\tif(userWon() == false)\r\n\t\t\tcompTurn(false);\r\n\t\telse if(userWon())\r\n\t\t{\r\n\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\n\t\tScanner input = new Scanner(System.in);\n\n\t\t// Introduction and random number selection between 1-10\n\t\tSystem.out.println(\"Hey you!\" + \"\\n\\n\"\n\t\t\t\t+ \"Word on the street says you're a pretty good number guesser. I beg to differ, nobody has ever guessed my number correctly in the entire history of number guessing!\"\n\t\t\t\t+ \"\\n\\n\"\n\t\t\t\t+ \"See if you can guess my number hotshot! I'm thinking of a number between 1 and 10, and no mindreading, because thats cheating!\\n\");\n\t\tint secretNum = new Random().nextInt(11 + 1);\n\t\tSystem.out.println(secretNum);\n\t\t// MainGame functionality\n\t\ttry {\n\n\t\t\tint guess = input.nextInt();\n\t\t\tint count = 0;\n\t\t\twhile (guess < 1 || guess > 10) {\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\"Hey, that's not a number between 1 and 10. You can't count let alone guess my number! Try again, but for real this time...\");\n\t\t\t\tguess = input.nextInt();\n\t\t\t\tcount = 0;\n\t\t\t}\n\t\t\tif(guess == secretNum){\n\t\t\t\tSystem.out.println(\"So it is true what everybody says. You truly are the master number guesser. You have my respects sir, I am sorry I ever doubted you. Please take my money.\");\n\t\t\t\tSystem.exit(0); \n\t\t\t}\n\t\t\twhile (guess > 1 && guess < 10 && guess != secretNum) {\n\t\t\t\tcount++;\n\t\t\t\tif (count == 1) {\n\t\t\t\t\tSystem.out.println(\"That's your first guess? HAH!\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 2) {\n\t\t\t\t\tSystem.out.println(\"Oh come on, are you even trying???\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 3) {\n\t\t\t\t\tSystem.out.println(\"Actually you're getting quite close... NOT!\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 4) {\n\t\t\t\t\tSystem.out.println(\"My grandmother is a better guesser than you!\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 5) {\n\t\t\t\t\tSystem.out.println(\"Okay, now this is getting embarressing.\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 6) {\n\t\t\t\t\tSystem.out.println(\"You are a fake! A sham!\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 7) {\n\t\t\t\t\tSystem.out.println(\"This is pathetic. Forget I even asked!\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 8) {\n\t\t\t\t\tSystem.out.println(\"Wow... Honestly i'm speechless.\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 9) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"I didn't even think it was possible to guess this many times and STILL not get the answer. You should be ashamed. I am reporting you to the number guessing authorities and you are going pay for wasting my time. HORRENDOUS!\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\n\t\t} catch (InputMismatchException ex) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"You don't even know the difference between a number and a letter. Pathetic. You are no master number guesser.\");\n\t\t}\n\n\t}", "public int performDuel(){\n Random rand = new Random();\n int intRand;\n intRand = rand(6);\n while(this.engine.getGameInformation().cards[intRand][intRand] == 0 ){\n intRand = rand(6);\n }\n return intRand;\n }", "public char compChoice ()\n {\n\tint num = (int) (Math.random () * 5) + 1;\n\tif (num == 1)\n\t return 's';\n\telse if (num == 2)\n\t return 'd';\n\telse if (num == 3)\n\t return 'p';\n\telse if (num == 4)\n\t return 'h';\n\telse\n\t return 'w';\n }", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public static void main(String[] args) {\n\t\tString personPlay;// input person play\r\n\t String computerPlay=null; \r\n\t String message;\r\n\t int computerInt;\r\n\t int[] resultArry= new int[10];// 0: tie ; 1 : win ; 2 : lose\r\n\t \r\n\t JOptionPane.showMessageDialog(null, \"you have 10 times plays!\");\r\n\t\r\n\t for(int t=0;t<=9;t++)\r\n\t {\r\n\t personPlay=JOptionPane.showInputDialog(null,\"Welcome to a rock-paper-scissor game!\\nPlease enter your move :\\nRock=R,Paper=P, and Scissor=S\");\r\n \r\n // //radom computer's play (1,2,3)\r\n \r\n computerInt= 1+ (int)(Math.random()*3); \r\n if (computerInt ==1) \r\n computerPlay = \"R\"; \r\n else computerPlay=(computerInt==2)? \"P\": \"S\";\r\n \r\n message= String.format(\"Computer play is: %s\\n your Choice is: %s\\n \",computerPlay,personPlay);\r\n JOptionPane.showMessageDialog(null, message);\r\n \r\n //check who won. Use if:\r\n if (personPlay.equalsIgnoreCase(computerPlay))\r\n {\r\n \tJOptionPane.showMessageDialog(null, \"it is a tie!!!!!!\");\r\n \tresultArry[t]=0;\r\n }\r\n else if ((personPlay.equalsIgnoreCase(\"S\") && computerPlay.equalsIgnoreCase(\"R\"))||(personPlay.equalsIgnoreCase(\"R\") && computerPlay.equalsIgnoreCase(\"P\"))||(personPlay.equalsIgnoreCase(\"P\") && computerPlay.equalsIgnoreCase(\"S\"))) \r\n { \r\n \t\t\tJOptionPane.showMessageDialog(null, \"Computer Win !! You Lose!!\");\r\n \t\t\tresultArry[t]=2;\r\n }\t \r\n \t else\r\n \t {\r\n \t\t JOptionPane.showMessageDialog(null, \"You Win !! Computer Lose!!\");\r\n \t\t resultArry[t]=1;\r\n \t }\r\n\t }\r\n\t int countT=0;\r\n\t int countL=0;\r\n\t int countW=0;\r\n\t /// show result person Play\r\n\t for(int i=0;i<=9;i++)\r\n\t {\r\n\t \tif(resultArry[i]==0)\r\n\t \t\tcountT++;\r\n\t \telse \tif(resultArry[i]==1)\r\n\t \t\tcountT=countW++;\r\n\t \t\telse\r\n\t \t\t\tcountL++;\r\n\t }\r\n\t message= String.format(\"Result is : \\nTie : %d\\nWin : %d\\nLose : %d\\n\", countT,countW,countL);\r\n\t JOptionPane.showMessageDialog(null, message);\r\n\t \r\n\t}", "AttackResult randomAttack();", "public static void main(String[] args) {\n\t\tint randNum,num;\n\t\tGuessGame player=new GuessGame();\n\t\twhile(true) {\n\t\t\t//生成随机数\n\t\t\trandNum=player.RandomNum();\t\n\t\t\tSystem.out.println(\"请输入你猜的数字(你只有3次机会)\");\n\t\t\tfor(int i=3;i>0;i--) {\n\t\t\t\tnum=player.inputNum();\n\t\t\t\tif(player.isTrue(randNum, num)) {\n\t\t\t\t\tSystem.out.println(\"你猜对了,你的得分是:\"+player.counter);\n\t\t\t\t\tbreak;\n\t\t\t\t}else {\n\t\t\t\t\tif(i-1!=0)\n\t\t\t\t\t\tSystem.out.println(\"你猜错了,你还有\"+(i-1)+\"次机会\");\n\t\t\t\t\t\t\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"你猜错了,已经没有机会了。\");\n\t\t\t\t\t\tSystem.out.println(\"最终得分:\"+player.counter);\n\t\t\t\t\t\tSystem.out.println(\"随机数为:\"+randNum);\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"游戏结束,按“1”,重玩,按“0”退出\");\n\t\t\tif(player.inputNum()==0)\n\t\t\t\tbreak;\n\t\t\telse\n\t\t\t\tplayer.counter=0;//重置分数为0\t\t\t\n\t\t}\t\t\n\t}", "public int guess(int i) {\n return 1;\n }", "public String getComputerChoice() {\n return generateRockPaperScissors(1, 3);\n }", "public int guessingGame(int x, int y) {\n\t\tRandom rand = new Random();\n\t\tint random_number = (int)Math.random() * (x - y + 1) + x;\n\t\treturn random_number;\n\t}", "public static int make_guess(int hits, int strikes) {\n int myguess = 1000;\n\n /*\n * IMPLEMENT YOUR GUESS STRATEGY HERE\n */\n\n //First guess is always 1122, which is suggested by Donald Knuth in Mastermind(4,6)\n if (isFirstGuess){\n isFirstGuess = false;\n myguess = 1122; //Initial guess recommended by Donald Knuth\n SOLVER.setGuess(new Code(1122, true));\n } else {\n Response response = new Response(strikes, hits);\n SOLVER.processResponse(response);\n Code guess = SOLVER.guess();\n myguess = guess.getCode();\n }\n\n return myguess;\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 static void main(String [] args){\n int randomNumber = (int) (Math.random()*100);\r\n\r\n // creating a scanner object\r\n Scanner scanner = new Scanner(System.in);\r\n\r\n // instructions\r\n System.out.println(\"I will choose a Number randomly between 1 - 100\");\r\n System.out.println(\"Try to guess it.\");\r\n\r\n for(int i = 10; i > 0; i--){\r\n\r\n System.out.println(\"you Currently have \" + i + \" guess(es) left choose again:\");\r\n\r\n // taking user input\r\n int guess = scanner.nextInt();\r\n\r\n if (guess > randomNumber){\r\n System.out.println(\"It's smaller than: \" + guess + \" try again.\");\r\n }else if (guess < randomNumber){\r\n System.out.println(\"It's bigger than: \" + guess + \" try again.\");\r\n } else{\r\n System.out.println(\"You Win! \" + guess);\r\n break;\r\n }\r\n }\r\n }", "public static void main(String[] args) {\n\r\n\t\tRandom rr=new Random();\r\n\t\t\r\n\t\tSystem.out.println(Math.random());//[0,1)\r\n\t\t \r\n\t\t// 第一种情况 int(强转之后最终的值一定是0)\r\n\t\t// 第二种情况 int(强转之后将小数点舍去 1-5)\r\n\t\tSystem.out.println((int)Math.random()*5);//0.99*5永远到不了5\r\n\t\tSystem.out.println((int)(Math.random()*5+1));//[1,5.)\r\n\t\t\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\t\r\n\t\tfor(int i=0;i<=20;i++){\r\n\t\t\tSystem.out.print(i%7+\"-\");\r\n\t\t\t\r\n\t\t}\r\n\t\t//1-M的随机产生\r\n\t\t//(int)(Math.random()*M+1)\r\n\t\t\r\n\t\t\r\n\t\t//产生0 1的概率不同 Math.random()<p?0:1\r\n\t\tSystem.out.println(\"----\"+rr.rand01p());\r\n\t\tSystem.out.println(\"----\"+rr.rand01());\r\n\t\tfor(int i=0;i<=11;i++){\r\n\t\t\tSystem.out.print(i%6+\"-\");\r\n\t\t \t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(rr.rand106());\r\n\t}", "private int evaluate() {\n return (int) (Math.random() * 8);\n }", "private static void init() {\n\t\tguess = 0;\n\t\ttries = 10;\n\t\tlen = Random.getRand(4, 8);\n\t\tcorrectGuesses = 0;\n\t\twordGen = new RandomWordGenerator(len);\n\t\twordGen.generate();\n\t\tword = wordGen.getWord();\n\t\tguessesResult = new boolean[word.length()];\n\n\t}", "private static int coinFlip() {\n\t\tint num = (Math.random() <= 0.5) ? 1 : 2; \n\t\tString answer;\n\t\tif ( num == 1) {\n\t\t\tanswer = \"h\";\n\t\t}else {\n\t\t\tanswer = \"t\";\n\t\t}\n\t\t\n\t\t\n\t\tScanner input = new Scanner(System.in);\n\t\t\n System.out.print(\"Enter you guess (h = heads, t = tails):\");\n String guess = input.next();\n //change the guess to lower case to accept both capital or lower case answer\n guess.toLowerCase();\n \n //gain 50 points if win the toss\n if ( guess.equals(answer)) {\n \t//System.out.println(\"You won the toss, congratulation! +50 points\");\n \treturn 50;\n }else {\n \t //System.out.println(\"Wrong guess! 0 points\");\n \t return 0;\n }\n \n\t}", "public void newGame() {\n\t\ttheNumber = (int)(Math.random()* 100 + 1);\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\t\r\n\t\tint input = 0;\r\n\t\tint ai = 0;\r\n\t\tint win = 0;\r\n\t\tint defeat = 0;\r\n\t\tint draw = 0;\r\n\t\t\r\n\t\tString me = \"\";\r\n\t\tString com = \"\";\r\n\t\tSystem.out.println(\"★☆★☆★☆★☆가위바위보 게임입니다!★☆★☆★☆★☆\");\r\n\t\tfor(int i = 1 ; i < 4 ; i++) {\r\n\t\t\tSystem.out.println(\"\\t\\t\\t\\t\\t 최대횟수/남은횟수\");\r\n\t\t\tSystem.out.println(\"가위(1), 바위(2), 보(3) 중 하나를 입력하세요>>>\\t\\t3 / \" + i);\r\n\t\t\tinput = scan.nextInt();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tai = (int)(Math.random()*3) + 1;\r\n\t\t\t\r\n\t\t\tif (input == 1) me = \"가위\";\r\n\t\t\telse if (input == 2) me = \"바위\";\r\n\t\t\telse if (input == 3) me = \"보\";\r\n\t\t\telse System.out.println(\"잘못 입력하셨습니다\");\r\n\t\t\tif (ai == 1) com = \"가위\";\r\n\t\t\telse if (ai == 2) com = \"바위\";\r\n\t\t\telse if (ai == 3) com = \"보\";\r\n\t\t\t\r\n\t\t\tif(me != \"\") {\r\n\t\t\t\tSystem.out.println(\"컴퓨터도 선택 했습니다.\");\r\n\t\t\t\tSystem.out.println(\"당신은 \\\"\" + me + \"\\\" 상대는 \\\"\" + com + \"\\\" 을 선택했습니다\");\r\n\t\t\t\r\n\t\t\t\tswitch (input - ai) {\r\n\t\t\t\tcase -1 : case 2 : \r\n\t\t\t\t\tSystem.out.println(\"★☆저런~~ 졌네요★☆\\n\"); defeat += 1; \r\n\t\t\t\t\tSystem.out.println(\"전적 => 승리 [ \" + win + \" ]\\t패배 [ \" + defeat + \" ]\\t무승부 [ \" + draw + \" ]\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase -2 : case 1 : \r\n\t\t\t\t\tSystem.out.println(\"★☆오~~ 이겼네요★☆\\n\"); win += 1; \r\n\t\t\t\t\tSystem.out.println(\"전적 => 승리 [ \" + win + \" ]\\t패배 [ \" + defeat + \" ]\\t무승부 [ \" + draw + \" ]\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 0 : \r\n\t\t\t\t\tSystem.out.println(\"★☆이런! 비겼네요★☆\\n\"); draw += 1;\r\n\t\t\t\t\tSystem.out.println(\"전적 => 승리 [ \" + win + \" ]\\t패배 [ \" + defeat + \" ]\\t무승부 [ \" + draw + \" ]\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault : System.out.println(\"오류 입니다\"); \r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(win==defeat) {\r\n\t\t\tSystem.out.println(\"최종 결과 => 무승부 입니다\");\r\n\t\t} else if(win > defeat) {\r\n\t\t\tSystem.out.println(\"최종 결과 => 당신의 승리입니다\");\r\n\t\t} else if(win < defeat) {\r\n\t\t\tSystem.out.println(\"최종 결과 => 당신의 패배입니다\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"오류 입니다\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public Solution createSuggestion(Board board) {\n\t\t\n\t\t// use the room that the computer is currently in\n\t\tBoardCell currentLocation = board.getCell(this.getLocation()[1], this.getLocation()[0]);\n\t\tRoom currentRoom = board.getRoom(currentLocation);\n\t\troomCard = board.getCard(currentRoom.getName());\n\t\t\n\t\t// find possible people and weapons\n\t\tallCards = board.getCards();\n\t\tfor(Card card : allCards) {\n\t\t\tif(!this.getHand().contains(card) && !getSeen().contains(card)) {\n\t\t\t\tif(card.getType() == CardType.PERSON) {\n\t\t\t\t\tpossiblePeople.add(card);\n\t\t\t\t\t\n\t\t\t\t} else if(card.getType() == CardType.WEAPON) {\n\t\t\t\t\tpossibleWeapons.add(card);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// pick a person that isn't the computer's hand and hasn't been seen by the computer\n\t\t//TODO change this (iterating through a HashSet seams like a bad idea)\n\t\t// this code is awful, I know\n\t\t// thats what I get for procrastinating\n\t\tCard personGuess = null;\n\t\tint pos = rand.nextInt(possiblePeople.size());\n\t\tint iterator = 0;\n\t\tfor(Card card : possiblePeople) {\n\t\t\tif(iterator == pos) {\n\t\t\t\tpersonGuess = card;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\titerator++;\n\t\t}\n\t\t// pick a weapon that isn't the computer's hand and hasn't been seen by the computer\n\t\tCard weaponGuess = null;\n\t\tpos = rand.nextInt(possibleWeapons.size());\n\t\titerator = 0;\n\t\tfor(Card card : possibleWeapons) {\n\t\t\tif(iterator == pos) {\n\t\t\t\tweaponGuess = card;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\titerator++;\n\t\t}\n\n\t\t(board.getPlayer(personGuess.getName())).move(currentLocation.getLocation());\n\t\tboard.repaint();\n\n\t\treturn new Solution(roomCard, personGuess, weaponGuess);\n\t}", "@Override\r\n\tpublic void setComputerValue() {\n\t\trps.setCom((int) (Math.random() * 3 + 1));\r\n\t}", "public static void main(String[] args) {\n int randomValue = (int) (100 * Math.random() + 1);\n /*Inicializamos una variable de tipo entero con un valor de 5 que\n * representará los intentos que tiene el usuario para adivinar el número*/\n int lives = 5;\n\n /*Pedimos por consola que el usuario escriba un número (primer intento)*/\n Scanner input = new Scanner(System.in);\n System.out.println(\"You have \" + lives + \" lives. Good luck!\");\n System.out.println(\"Try to guess the number:\");\n int inputNumber = input.nextInt();\n\n /*A partir del segundo intento se irá pidiendo al usuario que añada un número cada vez que no acierte,\n * mostrando algunos mensajes sobre las vidas que le quedan y si el número añadido es más grande o más\n * pequeño que el número que debe adivinar*/\n while (lives > 0) {\n lives--;\n if (lives == 0) {\n System.out.println(\"You died.\");\n break;\n }\n if (inputNumber > randomValue) {\n System.out.println(inputNumber + \" Your number is too big:\");\n System.out.println(\"Remaining lives: \" + lives);\n System.out.println(\"Try to guess the number:\");\n inputNumber = input.nextInt();\n }\n if (inputNumber < randomValue) {\n System.out.println(inputNumber + \" Your number is too small:\");\n System.out.println(\"Remaining lives: \" + lives);\n System.out.println(\"Try to guess the number:\");\n inputNumber = input.nextInt();\n }\n if (inputNumber == randomValue) {\n System.out.println(\"Good job! You are right!\");\n System.out.println(\"You wrote \" + inputNumber + \" and the number is \" + randomValue);\n System.out.println(\"Remaining lives: \" + lives);\n break;\n }\n }\n }", "public void playGame () {\n int rank1 = team1.getSeed();\n int rank2 = team2.getSeed();\n double s1 = Math.random();\n System.out.println(s1);\n double s2 = Math.random();\n System.out.println(s2);\n \n if(rank1 < rank2){\n\t double one = (s1*10)+1;\n\t score1 = (int)one;//gives a slight advantage to the person with a higher seed\n\t double two = (s2*10); \n\t score2 = (int)two;\n\t if(score1 == score2){\n\t score1 = score1+1; //gives the game to the higher seed if there is a tie\n }\n else if(rank2 < rank1){\n\t double r = (s2*10)+1;\n\t score2 = (int)r;\n\t double t = (s1*10); \n\t score1 = (int)t;\n\t if(score1 == score2){\n\t score2 = score2+1;\n\t }}}}", "public static void main(String[] args) {\n //Calculate the optimal number of guesses\n int OPTIMALGUESSCNT = getlog(UPPERBOUND,10);\n\n //Begin game\n System.out.println(\"This is the High Low Game. You WILL have fun.\");\n\n //Print Name\n Scanner input = new Scanner(System.in);\n System.out.println(\"Enter your name or be annihilated: \");\n\n String name = validateInputStr();\n if (name.isEmpty()) {\n System.out.println(\"You didn't enter a name. You must be Nobody. Glad I'm not a cyclops, haha jk, unless...\\nHello Player 1.\");\n }\n System.out.printf(\"Hello %s\\n\", name);\n\n boolean playAgain = false;\n int total_guesses = 0;\n short num_games = 0;\n do { //setup each game\n int game_guesses = 0;\n int secretNum = getSecretNum(Integer.parseInt(\"BEEF\",16));\n int guess = -1;\n int prev_guess = -1;\n while (guess != secretNum) { //A single game seshion\n Scanner scanGuess = new Scanner(System.in);\n System.out.println(\"Guess a number between 0 and 100: \");\n guess = validateInput();\n ++game_guesses;\n if (guess > UPPERBOUND || guess <= 0) {\n System.out.println(\"Your guess wasn't even in the range given!\");\n }\n if (guess > secretNum) {\n if (prev_guess != -1 && guess >= prev_guess && prev_guess >= secretNum) {\n System.out.println(\"You incorrectly guessed even higher this time! Lower your angle of attack!\");\n }\n System.out.println(\"You guessed too high.\");\n prev_guess = guess;\n }\n else if (guess < secretNum) {\n if (prev_guess != -1 && guess <= prev_guess && prev_guess <= secretNum) {\n System.out.println(\"You incorrectly guessed even lower this time! Aim high airman!\");\n }\n System.out.println(\"You guessed too low.\");\n prev_guess = guess;\n }\n else {\n //The game has effectively ended -> List Win Possibilities\n selectWinOption(game_guesses, OPTIMALGUESSCNT);\n //Check whether to play again\n boolean goodInput = false;\n while (!goodInput) {\n System.out.println(\"Would you like to play again? Enter yes (y) or no (n): \");\n Scanner clearBuff = new Scanner(System.in);\n String raw_playAgain = \"\";\n raw_playAgain = validateInputStr();\n //check input (I didn't feel like using Patterns\n if (raw_playAgain.equalsIgnoreCase(\"yes\") || raw_playAgain.equalsIgnoreCase(\"y\")) {\n playAgain = true;\n goodInput = true;\n }\n else if (raw_playAgain.equalsIgnoreCase(\"no\") || raw_playAgain.equalsIgnoreCase(\"n\")) {\n playAgain = false;\n goodInput = true;\n }\n else {\n System.out.println(\"Enter valid input! Ahhhh.\");\n }\n } //end check play again input\n }\n }\n System.out.println(\"You had \" + game_guesses + \" guesses during this game.\\n\\n\");\n total_guesses += game_guesses;\n ++num_games;\n }while(playAgain);\n\n printEndDialogue(total_guesses, num_games, OPTIMALGUESSCNT);\n }", "public Main()\n {\n \n Random rand = new Random();\n int n = rand.nextInt(10);\n n+=1;\n \n Scanner sc = new Scanner(System.in);\n int i = 0;\n do {\n \n i = sc.nextInt();\n\n //System.out.println(i);\n if(i<n){\n System.out.println(\"too small\");\n if (previousNum!=i){\n count += 1;\n }\n }\n else if(i>n){\n System.out.println(\"too big\");\n if (previousNum!=i){\n count +=1;\n }\n }\n else {\n System.out.println(\"correct guess\");\n \n count +=1;\n \n }\n \n previousNum = i;\n }while (i!=n);\n System.out.println(\"it took you \"+count+\" guesses!\");\n \n }", "public static boolean charRNG() { // Character randoms initilization\n Random randomN = new Random();\n \n int speedP1 = randomN.nextInt(5) + 1; // Super 1\n int speedP2 = randomN.nextInt(5) + 1;\n \n int defP1 = randomN.nextInt(5) + 1; // Super 2\n int defP2 = randomN.nextInt(5) + 1;\n \n int attackP1 = randomN.nextInt(5) + 1; // Super 3\n int attackP2 = randomN.nextInt(5) + 1;\n \n int P1stats = ((speedP1 + defP1) + attackP1);\n int P2stats = ((speedP2 + defP2) + attackP2);\n \n return (P1stats > P2stats);\n }", "public static void main(String[] args) {\n\t\tint lottery=(int)(100+Math.random()*900);\r\n\r\n\t\t@SuppressWarnings(\"resource\")\r\n\t\tScanner input=new Scanner(System.in);\r\n\r\n\t\tSystem.out.print(\"Enter your lottery pick(three digits):\");\r\n int guess=input.nextInt(); \r\n\r\n int lotteryDigit1=lottery/100;\r\n int lotteryDigit2=(lottery/10)%10;\r\n int lotteryDigit3=lottery%10; \r\n\r\n int guessDigit1=guess/100;\r\n int guessDigit2=(guess/10)%10;\r\n int guessDigit3=guess%10;\r\n \r\n System.out.println(\"The lottery number is \"+lottery);\r\n\r\n if(guess==lottery)\r\n \tSystem.out.println(\"Exact match: you win $10,000\");\r\n else if ((lotteryDigit1 == guessDigit1 && lotteryDigit2 == guessDigit3 && lotteryDigit3 == guessDigit2)\r\n || (lotteryDigit1 == guessDigit3 && lotteryDigit2 == guessDigit2 && lotteryDigit3 == guessDigit1)\r\n || (lotteryDigit1 == guessDigit2 && lotteryDigit2 == guessDigit3 && lotteryDigit3 == guessDigit1)\r\n || (lotteryDigit1 == guessDigit3 && lotteryDigit2 == guessDigit1 && lotteryDigit3 == guessDigit3)\r\n || (lotteryDigit1 == guessDigit2 && lotteryDigit2 == guessDigit1 && lotteryDigit3 == guessDigit2))\r\n System.out.println(\"Match all digits: you win $3,000\");\r\n else if (guessDigit1 == lotteryDigit1\r\n || guessDigit1 == lotteryDigit2\r\n || guessDigit1 == lotteryDigit3\r\n || guessDigit2 == lotteryDigit1\r\n || guessDigit2 == lotteryDigit2\r\n || guessDigit2 == lotteryDigit3\r\n || guessDigit3 == lotteryDigit1\r\n || guessDigit3 == lotteryDigit2\r\n || guessDigit3 == lotteryDigit3)\r\n System.out.println(\"Match one digit: you win $1,000\");\r\n else\r\n System.out.println(\"Sorry,no match\");\r\n\t}", "public static Ally getRandomRep () {\n return republican[(int) (Math.random() * republican.length)];\n }", "public static void rPS(Scanner input, Questions thisSession){\n String userInput=\"\"; \n boolean playerLost=false;\n Random rand=new Random(); \n byte action,enemy,lives=0;\n int randomNumber=rand.nextInt(thisSession.getLength()); \n System.out.println(\"You will fight against the machine choosing rock, paper or scissors five times.The amount of times you win against the IA are going to be\"+\n \" the amount of opportunities you will have to answer the question. \"+\n \"Your enemy in this rock paper scissor round is the question: \" + thisSession.getQuestion(randomNumber)+ \" \\nMake your first move\");\n for (int i=0;i<5;i++){\n action=(byte) rPSChoose(input, userInput);\n enemy=(byte) ((byte) rand.nextInt(3-1)+1);\n switch (action){\n case 1://rock\n switch(enemy){ \n case 1:\n rock();\n System.out.println(\"Tie, try again.\");\n i--;\n break;\n case 2:\n paper();\n System.out.println(\"You lost! Enemy chosed paper.\");\n break;\n case 3:\n scissor();\n System.out.println(\"You win! Enemy chosed scissor\");\n lives++;\n break;\n }\n break;\n case 2://paper\n switch(enemy){ \n case 2:\n paper();\n System.out.println(\"Tie, try again.\");\n i--;\n break;\n case 3:\n scissor();\n System.out.println(\"You lost! Enemy chosed Scissor.\");\n break;\n case 1:\n rock();\n System.out.println(\"You win! Enemy chosed rock.\");\n lives++;\n break;\n }\n break;\n case 3://scissor\n switch(enemy){ \n case 3:\n scissor();\n System.out.println(\"Tie, try again.\");\n i--;\n break;\n case 1:\n rock();\n System.out.println(\"You lost!Enemy chosed rock.\");\n break;\n case 2:\n paper();\n System.out.println(\"You win! Enemy chosed paper\");\n lives++;\n break;\n }\n }\n }\n\n System.out.println(\"It's now your turn to write the answer for the question, remember that you have \" + lives + \" lives!\");\n while (lives>0){\n userInput=input.nextLine();\n if (userInput.equals(thisSession.getAnswer(randomNumber))){\n youWon();\n lives=0;\n }else {\n System.out.println(\"Wrong answer\");\n lives--;\n if (lives==0){\n youLost();\n }\n }\n }\n\n System.out.println(\"Thanks for playing. Returning to main menu\");\n\n }", "public static void main(String[] args) {\n Random rand = new Random();\r\n int answer = rand.nextInt(10) + 1;\r\n Scanner sc = new Scanner(System.in);\r\n System.out.println(\"John's Guessing Game\");\r\n System.out.println(\"Guess a number between 1 and 10\");\r\n\r\n while (true) {\r\n System.out.print(\"Enter a number: \");\r\n int guess = sc.nextInt();\r\n if (guess == answer) {\r\n break;\r\n } else if (guess >= answer) {\r\n System.out.println(\"The number is lower, try again...\");\r\n } else {\r\n System.out.println(\"The number is higher, try again...\");\r\n }\r\n }\r\n System.out.println(\"You got it!!!\");\r\n }", "public void shuffle () {\n this.lives = 6;\n this.attempts.clear();\n this.victory = false;\n this.lose = false;\n Random r = new Random ();\n this._word = _dictionary[r.nextInt(_dictionary.length)];\n // this._word = _dictionary[2]; // Testing purposes\n this.hint.setLength(0);\n for (int i = 0; i < _word.length(); i++) {\n this.hint.append(\"_ \");\n } \n }", "public static void main(String[] args) {\n \tSystem.out.println(\"----- MASTERMIND -----\" + \"\\n\" + \"Guess the 4 digit number!\");\n \tScanner in = new Scanner(System.in);\n \tRandom num = new Random();\n \t//the while loop will continue as long as the keepPlaying boolean is set to true meaning that the user still wants to play\n \tboolean keepPlaying = true;\n \twhile (keepPlaying) {\n \t\t//Here the random number is being generated randomly from 0 to 9 and then multiplied accordingly to represent the thousandths place, hundredths, tenths, and single.\n \t\tint firstDigit = num.nextInt(10);\n \tint secondDigit = num.nextInt(10);\n \tint thirdDigit = num.nextInt(10);\n \tint fourthDigit = num.nextInt(10);\n \tint answer = (firstDigit * 1000) + (secondDigit * 100) + (thirdDigit * 10) + fourthDigit; // Building the answer which will be the number that the user is trying to guess\n \tint userGuess = 0; //This variable will hold the number that the user guesses\n \tint i = 0; //initializing variables to represent the number of guesses the user has had\n \twhile (answer != userGuess) { //This while look will continue as long as the user has not guessed the answer that matches the one that was generated\n \t\ti++;\n \t\tSystem.out.println(\"Guess \" + i + \": \"); //Printing out the amount of guesses the user has made\n \t\tuserGuess = in.nextInt(); //Scanning in the guess\n \t\tint firstGuessDigit = userGuess/1000; //First guess digit is divided by 1000 so reach the single digit in the thousandths place\n \t\tint secondGuessDigit = (userGuess- (firstGuessDigit * 1000)) /100; //Second guess digit is subtracted by the first digit *1000 to make sure it is only the hundredths place and then divided by 100 to get the single digit that is in the hundredths place\n \t\tint thirdGuessDigit = ((userGuess - (firstGuessDigit * 1000) - (secondGuessDigit * 100)) /10); //Third guess digit is reached by subtracted the thousandths and hundreths place to make sure it's only the tenths and then divided by 10 to get the single digit that is in the tenths place.\n \t\tint fourthGuessDigit = (userGuess) - (thirdGuessDigit * 10) - (secondGuessDigit *100) - (firstGuessDigit * 1000); //the fourth guess digit is reached by subtracting the thousandths, hundredths, and tenths place to get the final digit in the rightmost place.\n \t\tint correctDigits = 0; //initialize variable to represent how many digits the user has gotten correct\n \t\tif (firstDigit == firstGuessDigit) { //if the first digit of the randomly generated number matches the corresponding place in the user guess the number of correct digits increments up 1.\n \t\t\tcorrectDigits++;\n \t\t\t\n \t\t}\n \t\tif (secondDigit == secondGuessDigit) { //if the second digit of the randomly generated number matches the corresponding place in the user guess the number of correct digits increments up 1.\n \t\t\tcorrectDigits++;\n \t\t\t\n \t\t}\n \t\tif (thirdDigit == thirdGuessDigit) {//if the third digit of the randomly generated number matches the corresponding place in the user guess the number of correct digits increments up 1.\n \t\t\tcorrectDigits++;\n \t\t\t\n \t\t}\n \t\tif (fourthDigit == fourthGuessDigit) {//if the fourth digit of the randomly generated number matches the corresponding place in the user guess the number of correct digits increments up 1.\n \t\t\tcorrectDigits++;\n \t\t\t\n \t\t}\n \t\tSystem.out.println(\"You matched \" + correctDigits); //Prints out the amount of correct digits are in the guess\n \t\t\n \t}\n \t//Once the user gets the number right they are congratulated and told how many guesses it took.\n \tSystem.out.println(\"Congratulations! You guessed the right number in \" + i + \" guesses.\"); \n \t//Now they are asked if they want to play again and their input is scanned in\n \tSystem.out.println(\"Would you like to play again (yes/no)?\");\n \tin.nextLine();\n \t//if their input is not equal to yes then the keep playing variable is changed to false making the program end, if they do say yes then the loop will start over restarting everything.\n \tString restart = in.nextLine();\n \tif (!restart.equals(\"yes\")) {\n \t\tkeepPlaying = false;\n \t\n \t}\n \t}\n }", "@Override\r\n\tpublic void nextGuessResult(ResultPegs resultPegs) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t\t// Not used here\r\n\t}", "public static void main(String args[]){\n\n EasyReader e = new EasyReader();\n \n System.out.println(\"Type in a number between 1 and 20\");\n int x = e.readInt(); // (int)(Math.random()*20+1);\n \n if (x<20 && x >1){\n int computer = 7;// (int)(Math.random()*20+1);\n \n System.out.println(\"The number the computer generated is \" + computer);\n if (x == computer)\n System.out.println(\"You've won $10!\");\n else if (computer - 2 == x || computer + 2 ==x || computer -1 == x || computer +1 == x)\n System.out.println(\"You've won $5!\");\n else \n System.out.println(\"You've won nothing and you lost.\");\n }\n else \n System.out.println(\"The number is outside the range.\");\n \n }", "public static void main(String[] args){\n Scanner keyboard = new Scanner(System.in);\n //declare variables for the answer, user's guess, and number fo guesses\n int answer;\n int guess;\n int numOfGuess = 0;\n \n boolean done = false;\n answer = (int)(100*Math.random())+1;\n \n //print an introduction that tells the user how to play this game\n System.out.println(\"Hello user! I will generate a number between 1-100 inclusive and you will try to guess it! I will tell you if your answer is too low or too high after each incorrect guess!\");\n do \n {\n System.out.print(\"Please enter your guess:\");\n guess = keyboard.nextInt();\n if (guess > answer){\n System.out.println(\"Too high!\");\n }\n else if( guess < answer){\n System.out.println(\"Too low!\");\n }\n else{\n done = true;\n }\n numOfGuess += 1;\n } while (done == false);\n \n System.out.println(\"Congratulations! You're score is \" + numOfGuess);\n if (numOfGuess >= 20){\n System.out.println(\"Rating: You are terrible at this game!\");\n }\n else if (numOfGuess >= 10 && numOfGuess <=19){\n System.out.println(\"Rating: You need more practice!\");\n }\n else if (numOfGuess >= 5 && numOfGuess <= 9){\n System.out.println(\"Rating: Not too bad, But can you get it in fewer than 5 guesses?\");\n }\n else if (numOfGuess >= 2 && numOfGuess <= 4){\n System.out.println(\"Rating: AWESOME. You win a trip to Hawaii!\");\n }\n else{\n System.out.println(\"Rating: That was pure LUCK and you know it!\");\n }\n \n }", "public static void main(String[] args) {\n\t\tint userWin=0, computerWin = 0, gameNum=0;\n\t\tScanner s = new Scanner(System.in);\n\n\t\t//게임을 연속으로 플레이 할 수 있도록 변경\n\t\twhile(true) {\n\t\t\tprintFirst(s); //초기 설명을 매번 출력하게 하는 메소드\n\n\t\t\t/*잘못 입력받은 경우 다시 입력받도록 하기 위한 메소드 getUser(s)\n\t\t\t0~3 사이의 정수만 return한다.*/\n\t\t\tint user = getUser(s);\n\t\t\t\n\t\t\tif (user == 3) break; //user == 3인 경우 바로 종료하도록 한다.\n\n\t\t\tint computer = (int)(Math.random()*3); //computer`s must be in random integer from 0~2\n\n\t\t\t\n\t\t\t//현재 점수, 전체 플레이한 게임 수 저장하도록 변경\n\t\t\tif(user == (computer+2)%3) computerWin++; //컴퓨터가 이긴 횟수\n\t\t\telse if(user == (computer+1)%3) userWin++; //유저가 이긴 횟수\n\t\t\tgameNum++;\n\t\t\t\n\t\t\t//user가 선택한 것과, computer가 선택한 것을 user에게 문자로 출력해서 알려준다.\n\t\t\tprintGame(user, computer);\n\n\t\t\t//현재 점수, 전체 플레이 게임 수를 출력할 수 있도록 변경\n\t\t\tSystem.out.println(\"\\n___________________________________________________________________________________\");\n\t\t\tSystem.out.println(\"\\nCurrent Score : \"+userWin+\" vs \"+computerWin);\n\t\t\tSystem.out.println(\"Current Game number : NO.\"+gameNum);\n\t\t\tSystem.out.println(\"___________________________________________________________________________________\\n\\n\");\n\n\t\t}\n\t\t//마지막에 총 점수와 누가 이겼는지를 출력할 수 있도록 변경\n\t\tSystem.out.println(\"\\n___________________________________________________________________________________\\n\");\n\t\tSystem.out.println(\"------------------------------------End of Game------------------------------------\");\n\t\tSystem.out.println(\"___________________________________________________________________________________\\n\");\n\n\t\tSystem.out.println(\"You Scored \"+userWin +\" out of \"+gameNum+\"!!\");\n\t\tSystem.out.println(\"Computer Scored \"+computerWin +\" out of \"+gameNum+\"!!\");\n\n\t\tif(userWin > computerWin) System.out.println(\"\\nYou Win!\");\n\t\telse if(userWin < computerWin) System.out.println(\"\\nYou Lose!!\");\n\t\telse System.out.println(\"\\nTie!!!\");\n\t\t\n\t\ts.close();\n\t}", "public static char playRound() {\n\n String playerChoice = playerChoice();\n System.out.println(\"You chose: \" + playerChoice);\n\n Random rand = new Random();\n int compRand = rand.nextInt(3);\n String compChoice = new String();\n\n switch (compRand) {\n case 0:\n compChoice = \"rock\";\n break;\n case 1:\n compChoice = \"paper\";\n break;\n case 2:\n compChoice = \"scissors\";\n break;\n }\n\n char result = 'l';\n String resAnoun = \"Player loses!\";\n\n System.out.println(\"Player choice: \" + playerChoice + \" VS Computer Choice: \" + compChoice);\n\n if (playerChoice.equals(compChoice)) {\n result = 't';\n resAnoun = \"Draw!\";\n } else if (playerChoice.equals(\"rock\")) {\n if (compChoice.equals(\"scissors\")) {\n result = 'w';\n resAnoun = \"Player wins!\";\n }\n } else if (playerChoice.equals(\"paper\")) {\n if (compChoice.equals(\"rock\")) {\n result = 'w';\n resAnoun = \"Player wins!\";\n }\n } else if (playerChoice.equals(\"scissors\")) {\n if (compChoice.equals(\"paper\")) {\n result = 'w';\n resAnoun = \"Player wins!\";\n }\n }\n System.out.println(resAnoun);\n\n return result;\n }", "public Integer guess(Integer g)\n {\n if (chosenNum == g){\n return 0;\n } else if (chosenNum > g){\n return -1;\n } else if (chosenNum < g){\n return 1;\n }\n return chosenNum;\n }", "private Integer randomHemoglobina(){\n\t\t\tint Min = 9, Max = 23;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}", "public String solve() {\n char[] secret = new char[NUM_DIGITS];\n for (int i = 0; i < secret.length; i++) {\n shuffle(secret, i);\n }\n\n final int RoundThreshold = 10;\n int rounds = 0;\n int errors = distance(secret);\n int previous = errors;\n\n while (errors != 0) {\n // replace every digit by a different random number, keep\n // those that minimize the error metric\n for (int i = 0; i < secret.length; i++) {\n // replace by a new random digit\n char previousDigit = secret[i];\n shuffle(secret, i);\n\n int modified = distance(secret);\n if (modified <= errors) {\n // we have improvement, keep the digit\n errors = modified;\n } else {\n // restore previous digit if no improvement\n secret[i] = previousDigit;\n }\n }\n\n if (errors == previous) {\n // we didn't improve on the previous guess\n if (++rounds == RoundThreshold) {\n // stuck too long? try to escape local optimum by\n // changing a random number\n shuffle(secret, rand.nextInt(secret.length));\n errors = distance(secret);\n rounds = 0;\n }\n } else {\n // we got closer to the goal\n rounds = 0;\n previous = errors;\n }\n }\n\n return new String(secret);\n }", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "public static void main(String[] args) throws IOException{\n\t\tScanner sc = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.println(\"Welcome to Hangman! If you guess wrong 6 times, then I win\");\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\t\r\n\t\tboolean wannaPlay = true;\r\n\t\t\r\n\t\twhile(wannaPlay){\r\n\t\t\t//keep playing\r\n\t\t\tSystem.out.println(\"Alright: Let's play!\");\r\n\t\t\t\r\n\t\t\tHangman game = new Hangman();\r\n\t//\t\tRandom ran = new Random();\r\n\t//\t\tint hintIndex = Math.abs(ran.nextInt() % game.mysteryWord.length());\r\n\t\t\tdo{\r\n\t\t\t\t//Draw the things...\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tSystem.out.println(game.drawPicture());\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tSystem.out.println(game.getFormalCurrentGuess());\r\n\t\t\t//\tSystem.out.println(\"hint is : \" + game.mysteryWord.charAt(hintIndex));\r\n\t\t\t\t\r\n\t\t\t\t// Get the guess\r\n\t\t\t\tSystem.out.println(\"Enter a character that in the word\");\r\n\t\t\t\tchar guess = (sc.next().toLowerCase().charAt(0));\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\t\r\n\t\t\t\tif(game.isGuessAlready(guess)){\r\n\t\t\t\t\tSystem.out.println(\"Try again! you've already guessed that character.\");\r\n\t\t\t\t\tguess = sc.next().toLowerCase().charAt(0);\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(game.playGuess(guess)){\r\n\t\t\t\t\tSystem.out.println(\"Great guess. \\n\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"Unfortunately. \\n\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\twhile(!game.gameOver());\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\tSystem.out.println();\r\n\t\t\tSystem.out.println(\"Press 'Y' if you wanna play agian\");\r\n\t\t\tCharacter response = (sc.next().toUpperCase().charAt(0));\r\n\t\t\t\r\n\t\t\twannaPlay = (response == 'Y');\r\n\t\t\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "public boolean DoBlackMagic()\n{\n\tRandom generator=new Random();\n\tint result=generator.nextInt(4);\n\tif(result==0)\n\t{\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n\n}", "@Test\n public void picksOpponentRandom() throws Exception {\n Map<Integer,Integer> allMovesMade = new HashMap<Integer,Integer>();\n allMovesMade.put(1, 2);\n SmartPlayer x = new SmartPlayer(0,0);\n x.setMovesMadeByOtherPlayers(allMovesMade);\n //suppose this game has 5 total players including the player x\n int opponent = x.picksOpponent(5);\n //the opponent cannot be himself or a player with a player number outside the total number of players in game\n assertTrue(opponent!=0 && opponent<5 && opponent>0);\n }", "@Override\n public synchronized void postWinner(char result) {\n rememberGame(result);\n\n //Increase the heat (decrease randomness) as more games are played\n if (heat < heatMax && gamesPlayed % 50 == 0) heat++;\n\n gamesPlayed++;\n game = null; // No longer playing a game though.\n }", "public int randomDP() {\n\t\treturn(getRandomInteger(10,250));\n\t}", "public static void main(String[] args) {\n\r\n\t\tboolean gameOver = true;\r\n\r\n\t\t// Do-while loop controls the entire game -- if this loop cannot run, the game will not run.\r\n\t\tdo {\r\n\t\t\tint players = 999;\r\n\t\t\tboolean numberError = true;\r\n\t\t\tString answer = \"\";\r\n\t\t\tint number = 0;\r\n\r\n\r\n\t\t\tint[] randomNumbers = new int[players];\r\n\t\t\tint[] numberOfGuesses = new int[players];\r\n\t\t\tint[][] numberArray = new int[players][205];\r\n\r\n\r\n\t\t\tScanner keyboard = new Scanner(System.in);\r\n\t\t\tboolean playAgain = false;\r\n\t\t\tSystem.out.println(\"Welcome to the Multi-Player Random Number Game\\nHow many players do we have?\");\r\n\r\n\t\t\tdo {\r\n\t\t\t\tif (players <= 0) {\r\n\t\t\t\t\tSystem.out.println(\"Please select at least one player.\");\r\n\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Validates the number of players\r\n\t\t\t\ttry {\r\n\t\t\t\t\tplayers = parsePlayerInput();\r\n\r\n\t\t\t\t\tif (players > 0) {\r\n\t\t\t\t\t\tnumberError = false;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Creates the game\r\n\t\t\t\t\t\tfor (int i = 0; i < players; i++) {\r\n\t\t\t\t\t\t\t randomNumbers[i] = RNG();\r\n\t\t\t\t\t\t\t// *Remove the two slashes to the left and everything within these stars to see random number values per player* System.out.println(randomNumbers[i]);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfor (int i = 0; i < players; i++) {\r\n\t\t\t\t\t\t\tnumberOfGuesses[i] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception e) {\r\n\t\t\t\t\tSystem.out.println(\"Your input was not an integer; try again\");\r\n\t\t\t\t\tnumberError = true;\r\n\t\t\t\t}\r\n\t\t\t} while (numberError == true);\r\n\t\t\tSystem.out.println(\"Okay, let's get started\\n\\nEach player has been assigned a random number.\\nTo win, correctly guess your random number before the other players do the same.\\nThe numbers are between 1 and 10.\");\r\n\t\t\r\n\t\t\t//Game condition set by While loop\r\n\t\t\twhile (playersFinished(players, randomNumbers, numberOfGuesses, numberArray ) == false) {\r\n\r\n\t\t\t\tfor (int i = 0; i < players; i++) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tint guessedNumber = numberOfGuesses[i];\r\n\t\t\t\t\t\tif (guessedNumber == 0 || numberArray[i][guessedNumber - 1] != randomNumbers[i]) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"\\nPlease enter a number Player \" + (i + 1));\r\n\t\t\t\t\t\t\tnumber = parseUserInput();\r\n\t\t\t\t\t\t\tguessComparator(number, randomNumbers[i]);\r\n\t\t\t\t\t\t\tnumberArray[i][guessedNumber] = number;\r\n\t\t\t\t\t\t\tnumberOfGuesses[i] = guessedNumber + 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\tSystem.out.println(\"Your input was not an integer OR it was out of range; try again\");\r\n\t\t\t\t\t\ti = i - 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\tprintValues(players, numberOfGuesses, numberArray);\r\n\t\t\trankingGenerator(players, numberOfGuesses);\r\n\r\n\t\t\tSystem.out.println(\"\\nWould you like to play again?: yes? or no?\\ntype 1 for yes \\nor \\ntype 2 for no\");\r\n\t\t\tanswer = keyboard.next();\r\n\t\t\twhile (playAgain == false){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (Integer.parseInt(answer.trim()) == 1){\r\n\t\t\t\t\t\tSystem.out.print(\"\\n\\n\\n\");\r\n\t\t\t\t\t\tplayAgain = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (Integer.parseInt(answer.trim()) == 2) {\r\n\t\t\t\t\t\tgameOver = false;\r\n\t\t\t\t\t\tplayAgain = true;\r\n\t\t\t\t\t\tSystem.out.println(\"Thanks for playing. Ciao!\"); \r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.print(\"\\nPlease input 1 or 2 to make a descision:\\n\");\r\n\t\t\t\t\t\tanswer = keyboard.next();\r\n\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(\"Your input was not an integer\\nPlease input 1 or 2 to make a descision:\\n\");\r\n\t\t\t\t\tanswer = keyboard.next();\r\n\r\n\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t\t//Game End\r\n\t\t} while (gameOver);\r\n\t}", "private PlayingCard chooseCard(HeartsGraphics g){\t\t\n\t\tHearts.setCurrentPlayer(this);\n\t\t\n\t\tif(number != PLAYER_ONE){\n\t\t\t// A.I. code\n\t\t\tint index;\n\t\t\t\n\t\t\tRandom r = new Random();\n\t\t\tindex = r.nextInt(hand.size());\t\t\t\n\t\t\t\n\t\t\treturn hand.get(index);\t\t\t\n\t\t} else {\n\t\t\treturn getCard(g);\n\t\t}\t\t\n\t}", "public interface Guessable {\n\n}", "private int choose(){\n\t\tdouble temp = 10 * Math.random();\n\t\tint i = (int)temp;\n\t\treturn i;\n\t}", "private void thinking(){\n int sleepTime = (int)(Math.random()*2000);\n try{\n Thread.sleep(sleepTime);\n }catch (InterruptedException e){\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Hello! Welcome to the game!\");\n\t int attempts = 0; //1a\n\t int green = 0;\n\t int red = 0;\n\t\tScanner myObj = new Scanner(System.in);\n\t Answer answer = new Answer();\n\t Guess userGuess = new Guess();\n //answer.printAnswer(); (this was included for your convenience if you want to see what the answer is when you run the program)\n\t while ((attempts < 10) && (green != 3)){\n\t userGuess.printGuessList();\n\t String stringGuess = getUserInput(myObj); //1d\n\t userGuess.set(stringGuess);\n\t int[] guess = userGuess.getGuess();\n\t green = answer.numGreenBall(guess);\n\t System.out.print(\"Green Balls: \" + green);\n\t red = answer.numRedBall(guess);\n\t System.out.println(\" Red Balls: \" + red);\n\t System.out.println();\n\t userGuess.sortAllGuesses();\n\t attempts = userGuess.getNumOfGuess();\n\t }\n\t //10\n if (green == 3){\n\t System.out.println(\"You won!\");\n\t }\n\t if (attempts == 10){\n\t System.out.println(\"You lose! You couldn't guess the number in ten tries.\");\n\t }\n\t\tmyObj.close();\n\t }", "public static void main(String[] args) {\n int secretNumber;\n secretNumber = (int) (Math.random () * 20 + 1);\n //System.out.print(\"For debugging purposes the secret number is: \" + secretNumber);\n \n Scanner keyboard = new Scanner (System.in);\n int guessedNumber;\n do {\n\t System.out.print(\"Please enter a random number: \" );\n\t \n\t guessedNumber = keyboard.nextInt();\n\t System.out.println(\"The Number you choose is : \" + guessedNumber);\n\t \n\t if (guessedNumber == secretNumber) {\n\t\t System.out.print(\"Aye You guessed the number correctly\");\n\t }\n\t else if (guessedNumber < secretNumber) {\n\t\t System.out.println(\"Sorry try again! Your number is too low!\");\n\t }\n\t else if (guessedNumber > secretNumber) {\n\t\t System.out.println(\"Try again bud your number was too high!\");\n\t }\n\t \n } while (guessedNumber != secretNumber);\n\t}", "public static void paintHangman() {\n if (count == 1) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"1 incorrect guess, 6 guesses left\");\n }\n if (count == 2) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"2 incorrect guesses, 5 guesses left\");\n }\n if (count == 3) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|\");\n System.out.println(\" | / |\");\n System.out.println(\" | / |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"3 incorrect guesses, 4 guesses left\");\n }\n if (count == 4) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"4 incorrect guesses, 3 guesses left\");\n }\n if (count == 5) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | /\");\n System.out.println(\" | /\");\n System.out.println(\" | _/\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"5 incorrect guesses, 2 guesses left\");\n }\n if (count == 6) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < ' |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | _/ \\\\_\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"6 incorrect guesses, only 1 guess left!\");\n }\n if (count == 7) {\n System.out.println(\"GAME OVER!\");\n System.out.println(\"7 incorrect guesses\");\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / X X \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | __ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | _/ \\\\_\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"RIP \" + UserName.getUserName());\n System.out.println(\"GAME OVER! The word was \" + CategorySelector.word);\n }\n }", "public void correctGuess(String s){\n\t\t \tif(rightAnswer==s){\n\t\t \t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\tGamesCommon.displayEndGame(GameStatus.Won, this,p);\n\t\t\t\t\t \n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t \t}else{\n\t\t \t\ttry {\n\t\t \t\t\tGamesCommon.displayEndGame(GameStatus.Lost, this,p);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t \t}\n\t }", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Bienvenido a Magic Ball 8!!\");\n System.out.print(\"Escribe tu pregunta y te la contestaré: \");\n String question = scan.nextLine();\n // Get a random number from 1 to 8\n double a = Math.random()*8;\n // Use if statements to print out 1 of 8 responses\n if (a>=0 & a<1){\n System.out.println(\"No lo sé, lo siento...... :(\");\n }\n if (a>=1 & a<2){\n System.out.println(\"Eso tan solo depende de tí\");\n }\n if (a>=2 & a<3){\n System.out.println(\"La respuesta está en tu habitación....\");\n }\n if (a>=3 & a<4){\n System.out.println(\"Si haces las cosas bien, encontrarás lo que buscas..\");\n }\n if (a>=4 & a<5){\n System.out.println(\"Depende de lo que quieras encontrar..\");\n }\n if (a>=5 & a<6){\n System.out.println(\"No sé para qué me preguntas eso, pero la respuesta la tienes tú\");\n }\n if (a>=6 & a<7){\n System.out.println(\"Sin comentarios.....\");\n }\n if (a>=7 & a<8){\n System.out.println(\"¡Vaya preguntas me haces!\");\n } \n }", "public static int randomNext() { return 0; }", "int lanzar(int n){\n int result = (int) (Math.random()* 6) + 1;\r\n if(result !=n ) result = (int) (Math.random()* 6) + 1;\r\n return result;\r\n \r\n /*\r\n * int result = (int) (Math.random()*9)+1;\r\n * if (result > 0 && result < 7) return result;\r\n * else if(result > 6 && result < 9) return n;\r\n * else return (int) (Math.random()*6)+1;\r\n *\r\n *\r\n */\r\n }", "public static String checkPlayFirst() {\r\n\t int randomNumber = (int) Math.floor(Math.random() * 10) % 2;\r\n\t String player = \"\";\r\n\t if ( randomNumber == 0)\r\n\t player = \"Computer\";\r\n\t else\r\n\t player = \"User\";\r\n\r\n\t return player;\r\n\t }", "private static void checkFirstPlayer()\n {\n int Head = 0;\n double toss = Math.floor(Math.random()*10) % 2;\n if ( toss == Head )\n {\n System.out.println(\"computer starts to play first\");\n }\n else\n {\n System.out.println(\"User starts to play first\");\n }\n }", "public Answer randomAnswer()\n\t{\n\t\tRandom random = new Random();\n\t\tint num = random.nextInt(answers.length);\n\t\treturn answers[num];\n\t}", "public String guessingNumber(int randomNumber,int userNumber) {\n if(userNumber <= 0 || userNumber > 50)\n {\n return \"Enter number between 1 to 50\";\n }\n if(userNumber>randomNumber) {\n return \"guessed number is more than the original number\";\n } else if (userNumber < randomNumber) {\n return \"guessed number is less than the original number\";\n } else {\n return \"guessed matches the original number\";\n }\n }", "private int rand() {\n return (int)(Math.random()*(RAND_MAX + 1));\n }", "private int getRandomPiece() {\r\n return new Random().nextInt(Constants.NUM_PIECES);\r\n }", "public void computerFirst() {\n game(0);\n }", "public static void hint() {\n\t\t// have computer pick random index for hint\n\t\tRandom hintRandom = new Random();\n\t\tint hint = hintRandom.nextInt(computerCode.length);\n\t\t// makes it easier for people to read instead of having the first item be at\n\t\t// the 0 place\n\t\tint index = hint + 1;\n\n\t\tSystem.out.println(\"Ah, you want a hint?\");\n\t\tif (totalHint == 0) {\n\t\t\tSystem.out.println(String.format(\"The %d%s digit is: %d\", index, getNumberSuffix(index), computerCode[hint]));\n\t\t}\n\n\t\tif (totalHint == 1) {\n\t\t\tSystem.out.println(\"There is a \" + computerCode[hint] + \" somewhere\");\n\t\t}\n\n\t\tif (totalHint > 1) {\n\t\t\tSystem.out.println(\"Too bad, no more hints! \");\n\t\t}\n\t\ttotalHint++;\n\t}", "public void generateNumbers() {\n number1 = (int) (Math.random() * 10) + 1;\n number2 = (int) (Math.random() * 10) + 1;\n operator = (int) (Math.random() * 4) + 1;\n //50% chance whether the displayed answer will be right or wrong\n rightOrWrong = (int) (Math.random() * 2) + 1;\n //calculate the offset of displayed answer for a wrong equation (Error)\n error = (int) (Math.random() * 4) + 1;\n generateEquation();\n }", "public static void RockPaper(){\n\n\t\t// Store user choice as generated option\n\t\tint userNum = getRandomNum();\n\t\t\n\t\t// Store computer choice as generated option\n\t\tint compNum = getRandomNum();\n\t\t\n\t\t// Determine which option was selected for user\n\t\tString userOption = whichRPS(userNum);\n\t\t\n\t\t// Determine which option was selected for computer\n\t\tString compOption = whichRPS(compNum);\n\t\t\n\t // Display user choice and computer choice\n\t System.out.println(\"You played \"+ userOption+\", and the computer played \"+ compOption);\n\t \n\t // Determine results of game\n\t \n\t // If user and computer choices are the same \n\t if (userNum == compNum) {\n\t\t System.out.println(\"It was a tie.\");\n\t } \n\t \n\t // Rock1 > Scissors3\n\t if (compNum==1 && userNum==3) {\n\t\t System.out.println(\"You lost.\");\n\t }\n\t // Scissors3 > Paper2\n\t if (compNum==3 && userNum==2) {\n\t\t System.out.println(\"You lost.\");\n\t }\n\t // Paper2 > Rock1\n\t if (compNum==2 && userNum==1) {\n\t\t System.out.println(\"You lost.\");\n\t }\n\t // Or else the user won\n\t else{\n\t System.out.println(\"You won.\");\n\t }\n\t return;\n\t}", "public Game() {\n\t\tRandom rand = new Random();\n\t\tfor (int i=0; i<6; i++) {\n\t\t\trandNum[i] = rand.nextInt(40) + 1;\n\t\t\t\n\t\t\t// check if randNum already exists in the array starting from 2nd input\n\t\t\tif(i > 0) { \n\t\t\t\tfor(int c=i-1; c>=0; c--) { //iterate comparison to all previous inputs\n\t\t\t\t\tif(randNum[i]==randNum[c]) { //compare existing input with previous input\n\t\t\t\t\t\ti--; // subtract one(1) from the input counter\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t}\n\t}", "public abstract boolean isRandom();", "private int randomPiece() {\n return (int)(Math.random()*N_PIECES);\n }", "public static int game(int choise) { // in main method we send user's choice as parameter\n\t\t\t\t\t\t\t\t\t\t\t// to game method and in the method we decide who is winner for\n\t\t\t\t\t\t\t\t\t\t\t// every single game\n\t\tresult = 0;\n\n\t\tint num = new Random().nextInt(3); // gives us 0,1,2\n\t\tnum++; // we added to num 1 and did it same with user's choise. 1,2,3 ... 1=rock , 2=paper , 3 = scissors\n\n\t\tswitch (num) {\n\t\tcase 1:\n\t\t\tSystem.out.println(\"Comp : ROCK\");\n\t\t\tif (choise == 1) {\n\t\t\t\tSystem.out.println(\"User : ROCK \");\n\t\t\t\tresult = 1; // result 1 means no one is winner\n\t\t\t\tbreak;\n\t\t\t} else if (choise == 2) {\n\t\t\t\tSystem.out.println(\"User : PAPER \");\n\t\t\t\tresult = 2; // result 2 means user is winner\n\t\t\t\tbreak;\n\t\t\t} else\n\t\t\t\tSystem.out.println(\"User : SCISSORS \");\n\t\t\t\tresult = 3; // result 3 means computer is winner\n\t\t\t\tbreak;\n\t\tcase 2:\n\t\t\tSystem.out.println(\"Comp : PAPER\");\n\t\t\tif (choise == 1) {\n\t\t\t\tSystem.out.println(\"User : ROCK \");\n\t\t\t\tresult = 3;\n\t\t\t\tbreak;\n\t\t\t} else if (choise == 2) {\n\t\t\t\tSystem.out.println(\"User : PAPER \");\n\t\t\t\tresult = 1;\n\t\t\t\tbreak;\n\t\t\t} else\n\t\t\t\tSystem.out.println(\"User : SCISSORS \");\n\t\t\t\tresult = 2;\n\t\t\t\tbreak;\n\t\tcase 3:\n\t\t\tSystem.out.println(\"Comp : SCISSORS\");\n\t\t\tif (choise == 1) {\n\t\t\t\tSystem.out.println(\"User : ROCK \");\n\t\t\t\tresult = 2;\n\t\t\t\tbreak;\n\t\t\t} else if (choise == 2) {\n\t\t\t\tSystem.out.println(\"User : PAPER \");\n\t\t\t\tresult = 3;\n\t\t\t\tbreak;\n\t\t\t} else\n\t\t\t\tSystem.out.println(\"User : SCISSORS \");\n\t\t\t\tresult = 1;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn result;\n\t}" ]
[ "0.69132227", "0.67990434", "0.6728863", "0.6705086", "0.6696016", "0.6574658", "0.64514494", "0.6400122", "0.63922036", "0.63792205", "0.6376024", "0.6341763", "0.6321682", "0.61616683", "0.61517346", "0.61449623", "0.61245245", "0.61227024", "0.6116976", "0.6116713", "0.61045814", "0.6101789", "0.6091214", "0.60904354", "0.60778034", "0.60735524", "0.6070819", "0.6070365", "0.6069723", "0.6055951", "0.60555476", "0.60513836", "0.6048912", "0.6034402", "0.6027026", "0.59925187", "0.5991626", "0.59740996", "0.59674376", "0.5964131", "0.59591115", "0.5953245", "0.59273386", "0.59236395", "0.5921846", "0.58937836", "0.58872026", "0.58833367", "0.5875076", "0.58737546", "0.5855491", "0.5852208", "0.5847882", "0.58345526", "0.58248127", "0.58204174", "0.5818609", "0.5818036", "0.5817429", "0.5801382", "0.5796709", "0.5787557", "0.57854", "0.57844716", "0.5784326", "0.5782851", "0.5779178", "0.5779174", "0.577627", "0.5775707", "0.5773049", "0.57697386", "0.5766233", "0.57640505", "0.5760318", "0.5755759", "0.5749024", "0.57476556", "0.57423973", "0.57398593", "0.5737791", "0.5735155", "0.5729547", "0.5723015", "0.57215136", "0.571612", "0.5715515", "0.5714684", "0.5714066", "0.5709957", "0.57055247", "0.57052964", "0.57050073", "0.57043105", "0.57034427", "0.5701101", "0.57004523", "0.5699857", "0.5697491", "0.56945497" ]
0.69385433
0
what happens when the User guesses correctly
public void rightGuess() { if(userWon()) { System.out.println(PLAYER_WIN); System.exit(0); } System.out.println("good job! you've correctly guessed the panel \n would you like to guess again? if so enter yes, if you would like to add your tile to your code, reply no\n\n"); String answer = sc.next(); if(answer.compareTo("yes") == 0 || answer.compareTo("Yes") == 0) { userTurn(false); } else { if(userRanPan.getValue() == -1) newGame.getUserHand().addDash(false,userRanPan); else newGame.getUserHand().addPanel(userRanPan,false); userGuess.clear(); slide(previousGuess,userRanPan); if(userWon() == false) compTurn(false); else { System.out.println(PLAYER_WIN); System.exit(0); } } //foo.repaint(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void wrongGuess()\r\n\t{\r\n\t\tSystem.out.println(\"Sorry, your guess is wrong\");\r\n\t\tif(userRanPan.getValue() == -1)\r\n\t\t\tnewGame.getUserHand().addDash(true,userRanPan);\r\n\t\telse\r\n\t\t\tnewGame.getUserHand().addPanel(userRanPan,true);\r\n\r\n\t\tif(userWon() == false)\r\n\t\t\tcompTurn(false);\r\n\t\telse if(userWon())\r\n\t\t{\r\n\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t}", "public void checkGuess() {\n\t\tString guessText = txtInput.getText();\r\n\t\tString message = \"\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\t// check the guess for too high/too low\r\n\t\t\tint guess = Integer.parseInt(guessText);\r\n\t\t\t//too high\r\n\t\t\tif (guess > theNumber) {\r\n\t\t\t\tmessage = guess + \" was too high. Try again.\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnumberOfPlayerGuesses += 1;\r\n\t\t\t} else if (guess < theNumber) {\r\n\t\t\t\tmessage = guess + \" was too low. Try again.\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnumberOfPlayerGuesses += 1;\r\n\t\t\t} else {\r\n\t\t\t\tmessage = guess + \" was right! You used \" + numberOfPlayerGuesses + \" guesses. Let's play again!\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnewGame();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\tlblDirections2Result.setText(\"Enter a whole number between 1 and 100.\");\r\n\t\t}\r\n\t\t\r\n\t\ttxtInput.requestFocus();\r\n\t\ttxtInput.selectAll();\r\n\t\t\r\n\t\t\r\n\t}", "public void checkGuess() {\n\t\tString guessText = txtGuess.getText();\n\t\tString message = \"\";\n\t\t\n\t\t\n\t\ttry {\n\n\t\t\t//check users guess too high/too low\n\t\t\tint guess = Integer.parseInt(guessText);\n\t\t\t\n\t\t\tif ( guess < 0 || guess > 100) {\n\t\t\t\tthrow new Exception(\"User entry out of range\");\n\t\t\t}//if\n\n\t\t\t//too high\n\t\t\tif(guess > theNumber){\n\t\t\t\tmessage = guess + \" is to high guess again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t}//if\n\t\t\t//too low\n\t\t\telse if (guess < theNumber){\n\t\t\t\tmessage = guess + \" is to low guess again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t}else{//guessed correct\n\t\t\t\tmessage = guess + \" was right! You win! Let's play again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t\tnewGame();\n\t\t\t}//else\n\t\t}//try\n\t\tcatch(Exception e) {\n\t\t\tlblOutput.setText(\"Enter a whole number between 1-100\"); \n\t\t}//catch\n\t\tfinally {\n\t\t\t\n\t\t\ttxtGuess.requestFocus();\n\t\t\ttxtGuess.selectAll();\n\t\t\t\n\t\t}//finally\n\t}", "public abstract boolean isGuessCorrect(String guess);", "public void printWrongGuess() {\r\n\t\t\r\n\t\tSystem.out.print(\"Wrong Guesses: \" + wrongGuess + \"\\n\");\r\n\t}", "public void correctGuess(String s){\n\t\t \tif(rightAnswer==s){\n\t\t \t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\tGamesCommon.displayEndGame(GameStatus.Won, this,p);\n\t\t\t\t\t \n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t \t}else{\n\t\t \t\ttry {\n\t\t \t\t\tGamesCommon.displayEndGame(GameStatus.Lost, this,p);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t \t}\n\t }", "public boolean alreadyGuessed(char guess) {\r\n return false;\r\n }", "private void tryGuess(int guess) {\n int guessAssert = guesser.assertGuess(guess);\n switch (guessAssert) {\n case 0:\n guesser.madeGuess();\n System.out.println(\"Too low. Guess again: \");\n break;\n case 1:\n guesser.madeGuess();\n System.out.println(\"Too high. Guess again: \");\n break;\n case 2:\n guesser.madeGuess();\n System.out.println(\"You got it in \"+guesser.getGuess()+\" guesses!\");\n break;\n default:\n guesser.madeGuess();\n System.out.println(\"Invalid numeric value has been entered.\");\n break;\n }\n\n }", "boolean checkGuess(String guess) {\r\n if (currWord.contains(guess)) { // correct guess\r\n numToGuess--;\r\n if (numToGuess <= 0) { // the word was guessed\r\n if (currWord.equals(animal))\r\n animalGuessed = true;\r\n if (currWord.equals(country))\r\n countryGuessed = true;\r\n if (currWord.equals(superhero))\r\n superheroGuessed = true;\r\n wordsCorrect++;\r\n if (wordsCorrect >= 3) {\r\n gameOver = true;\r\n win = true;\r\n }\r\n }\r\n return true;\r\n }\r\n else { // wrong guess\r\n guessesLeft--;\r\n if (guessesLeft <= 0) { // round lost\r\n chancesLeft--;\r\n if (chancesLeft <= 0) {\r\n gameOver = true;\r\n win = false;\r\n }\r\n }\r\n }\r\n return false;\r\n }", "public void checkUserGuess(int userGuess, int randomNumber) {\n guessesLeft();\n if (userGuess == randomNumber) {\n gameFragmentLayout.setVisibility(View.VISIBLE);\n savehighscore();\n level++;\n hideKeybord();\n\n CorrectGameFragment correctGameFragment = new CorrectGameFragment();\n FragmentManager fragmentManager = getSupportFragmentManager();\n correctGameFragment.getCorrectFragInfo(this, level, levelMaxRange, guessesLeft);\n fragmentManager.beginTransaction()\n .replace(R.id.game_fragment, correctGameFragment)\n .commit();\n }\n }", "public abstract boolean guess(String guess);", "public void noteIncorrectGuess(char letter) {\n\t\tguesses += letter;\n\t\tguessesLabel.setLabel(guesses);\n\t\tguessesLabel.setLocation((getWidth() - guessesLabel.getWidth()) / 2, wordLabel.getY() + wordLabel.getHeight()\n\t\t\t\t+ WORD_SPACING);\n\t\tif (guesses.length() == 1)\n\t\t\tbody.add(buildHead());\n\t\tif (guesses.length() == 2)\n\t\t\tbody.add(buildTorso());\n\t\tif (guesses.length() == 3)\n\t\t\tbody.add(buildLeftArm());\n\t\tif (guesses.length() == 4)\n\t\t\tbody.add(buildRightArm());\n\t\tif (guesses.length() == 5)\n\t\t\tbody.add(buildLeftLeg());\n\t\tif (guesses.length() == 6)\n\t\t\tbody.add(buildRightLeg());\n\t\tif (guesses.length() == 7)\n\t\t\tbody.add(buildLeftFoot());\n\t\tif (guesses.length() == 8)\n\t\t\tbody.add(buildRightFoot());\n\t}", "public void handleGuess(String s) {\n\n if (!word.contains(s)) {\n incorrectGuesses++;\n wrongList.add(s);\n if (incorrectGuesses == 8) {\n gameOver();\n }\n } else {\n correctList.add(s);\n updateWord(s.charAt(0));\n }\n }", "public void setGuessed(boolean guessed) {\n isGuessed = guessed;\n }", "@Override\n public String getGuess() throws TimeoutException {\n\n int count = 1;\n\n while (this.answers.size() - count >0){\n if(this.answers.get(answers.size()-count).equals(\"yes\")) {\n\n return excuteQuery(this.getQuery(\"Guess\", \"Question=\" + \"'\" + this.questions.get(questions.size() -count) + \"'\"))\n .replaceAll(\"</br>\", \"\\n\");\n }\n count++;\n }\n\n return \"no result found\\n\";\n\n\n }", "private String readGuess() {\n\t\tString unsafeGuess = readLine(\"Your Guess: \").trim().toUpperCase();\n\t\tif (!unsafeGuess.matches(\"[a-zA-z]\") || unsafeGuess.length() != 1) {\n\t\t\tprintln(\"Please enter a single letter.\");\n\t\t\treturn readGuess();\n\t\t} else {\n\t\t\treturn unsafeGuess.toUpperCase();\n\t\t}\n\t}", "@Override\n\t\t\tpublic void handle(KeyEvent e) {\n\t\t\t\tif(e.getCode().isLetterKey()) {\n\t\t\t\t\t\n\t\t\t\t\t//The input is converted to a char variable and a boolean is created and set to false,\n\t\t\t\t\t//in preparation for later in this method.\n\t\t\t\t\tchar letter = e.getText().charAt(0);\n\t\t\t\t\tboolean same = false;\n\t\t\t\t\t\n\t\t\t\t\tfor(int i = 0; i < currentGuesses.length; i++) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//If the letter that the user input is the same as the letter found\n\t\t\t\t\t\t//in the currentGuesses char array, the same boolean variable is set\n\t\t\t\t\t\t//to true and we break out of the loop.\n\t\t\t\t\t\tif(letter==currentGuesses[i]) {\n\t\t\t\t\t\t\tsame = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t//Otherwise, if we reached a point in the array that has a value of\n\t\t\t\t\t\t//0, instead of a letter, we replace that 0 with the letter that the\n\t\t\t\t\t\t//user just input and break out of the loop, because we know everything\n\t\t\t\t\t\t//past this point are also blanks and don't want to replace them too.\n\t\t\t\t\t\t}else if(currentGuesses[i]==0) {\n\t\t\t\t\t\t\tcurrentGuesses[i] = letter;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//If the letter isn't the same as one already guessed, this if statement happens.\n\t\t\t\t\tif(!same) {\n\t\t\t\t\t\t//A message is sent to the server, including the codename for the server to use\n\t\t\t\t\t\t//and the letter that the user input.\n\t\t\t\t\t\tout.println(\"LetterGuess \" + letter);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//A String array is created in preparation for the loop that happens \n\t\t\t\t\t\t//immediately afterwards.\n\t\t\t\t\t\tString[] receive = new String[3];\n\t\t\t\t\t\n\t\t\t\t\t\twhile(receive[0] == null) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t//When the server responds, the String is split into the array, separating \n\t\t\t\t\t\t\t\t//one word from the next by looking for a space.\n\t\t\t\t\t\t\t\treceive = in.readLine().split(\" \");\n\t\t\t\t\t\t\t}catch(IOException ioe) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//The boolean success is set to the second element of the received String that is converted\n\t\t\t\t\t\t//to a boolean. The same is done with the third element and is saved to the finished boolean\n\t\t\t\t\t\t//that exists in the class scope.\n\t\t\t\t\t\tboolean success = Boolean.parseBoolean(receive[1]);\n\t\t\t\t\t\tfinished = Boolean.parseBoolean(receive[2]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Success only needs to exist within this method as it is used here to determine how\n\t\t\t\t\t\t//the statusMessageLabel should be updated.\n\t\t\t\t\t\tif(success) {\n\t\t\t\t\t\t\t//If the player made a successful guess, the status message is set accordingly.\n\t\t\t\t\t\t\tstatusMessageLabel = new Label(\"There is a '\" + letter + \"' in the word!\");\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t//However, if the player made an unsuccessful guess, the message is set differently,\n\t\t\t\t\t\t\t//the amount of remaining guesses the player has decrements and the drawnPieces\n\t\t\t\t\t\t\t//variable goes up by an amount determined by maths, thanks to the different difficulty\n\t\t\t\t\t\t\t//settings. Assuming easy difficulty, drawnPieces goes up by 1. Medium difficulty\n\t\t\t\t\t\t\t//makes it go up by 1.4 and hard difficulty makes it go up by 2.333. \n\t\t\t\t\t\t\tstatusMessageLabel = new Label(\"There was no '\" + letter + \"' in the word.\");\n\t\t\t\t\t\t\tremainingGuesses--;\n\t\t\t\t\t\t\tdrawnPieces += (7.0/difficultyGuesses);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//The currentWord label is now set to the value of the first element of the \n\t\t\t\t\t\t//String array.\n\t\t\t\t\t\tcurrentWordLabel = new Label(receive[0]);\n\t\t\t\t\t\t\n\t\t\t\t\t//If the letter is the same as one already guessed, we go here instead\n\t\t\t\t\t}else {\n\t\t\t\t\t\t//Inform the user that they already tried their letter\n\t\t\t\t\t\tstatusMessageLabel = new Label(\"The letter '\" + letter + \"' has already been used\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//The currentGuesses label is updated with the new values of the player's guessed letters.\n\t\t\t\t\t//It is converted from a char array to a String, so that it can be used for the label.\n\t\t\t\t\t//The attemptsRemaining label is also updated, as the value of the remainingGuesses int\n\t\t\t\t\t//may have changed, if the player guessed incorrectly. \n\t\t\t\t\tcurrentGuessesLabel = new Label(new String(currentGuesses));\n\t\t\t\t\tattemptsRemainingLabel = new Label(\"Attempts remaining: \" + remainingGuesses);\n\n\t\t\t\t\t//Since the labels have been updated, the finalLine HBox needs to be updated with the\n\t\t\t\t\t//new labels. \n\t\t\t\t\tfinalLine = new HBox(5,currentGuessesLabel,eh,attemptsRemainingLabel);\n\t\t\t\t\tHBox.setHgrow(eh,Priority.ALWAYS);\n\t\t\t\t\tfinalLine.setAlignment(Pos.CENTER_LEFT);\n\t\t\t\t\t\n\t\t\t\t\t//And since the HBox has been updated, so too does the VBox need to be updated.\n\t\t\t\t\tmassiveSpacing = new VBox(5,group,statusMessageLabel,currentWordLabel,finalLine);\n\t\t\t\t\tmassiveSpacing.setAlignment(Pos.CENTER);\n\t\t\t\t\t\n\t\t\t\t\t//And also, the second group. \n\t\t\t\t\tnewGroup = new Group(massiveSpacing,hangTheMan(Math.toIntExact(Math.round(drawnPieces))));\n\t\t\t\t\tscene = new Scene(newGroup,300,300,Color.LIGHTGREY);\n\t\t\t\t\tstage.setScene(scene);\n\t\t\t\t\t\n\t\t\t\t\t//This method call could be seen as recursive, as it adds the very event listener\n\t\t\t\t\t//that we're inside now to the stage once again.\n\t\t\t\t\tkeyRel(stage);\n\t\t\t\t\t\n\t\t\t\t\t//If the remaining guesses left for the player is 0, then it's game over for them.\n\t\t\t\t\t//The appropriate method is called.\n\t\t\t\t\tif(remainingGuesses==0) {\n\t\t\t\t\t\tgameOver(stage);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Finished will be true if the word has been successfully completed. \n\t\t\t\t\tif(finished) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//The completeTime long variable is the difference in values from the current time\n\t\t\t\t\t\t//in milliseconds and the value of epoch, which was the current time in milliseconds\n\t\t\t\t\t\t//when the game started.\n\t\t\t\t\t\tcompleteTime = (System.currentTimeMillis() - epoch);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//In case the player had already played a game before, the values of count and\n\t\t\t\t\t\t//the inputName char array are set to a default value. \n\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t\tinputName[0] = '_';\n\t\t\t\t\t\tinputName[1] = '_';\n\t\t\t\t\t\tinputName[2] = '_';\n\t\t\t\t\t\t\n\t\t\t\t\t\t//The appropriate method is called to progress on from the game.\n\t\t\t\t\t\tgameVictory(stage);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//However, if the player did not click on a letter key and it was instead the escape button,\n\t\t\t\t//this if statement is used instead\n\t\t\t\t}else if(e.getCode()==KeyCode.ESCAPE) {\n\t\t\t\t\t\n\t\t\t\t\t//An Alert window is made, asking the player whether they're sure they want to quit\n\t\t\t\t\tAlert alert = new Alert(AlertType.CONFIRMATION);\n\t\t\t\t\talert.setTitle(\"Quit game\");\n\t\t\t\t\talert.setHeaderText(null);\n\t\t\t\t\talert.setContentText(\"Are you sure you wish to quit the game?\\nYour progress will not be saved.\");\n\t\t\t\t\tOptional<ButtonType> result = alert.showAndWait();\n\t\t\t\t\t\n\t\t\t\t\tif(result.get() == ButtonType.OK) {\n\t\t\t\t\t\t//If the player clicks on the OK button, an attempt to close the socket is made\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tclient.close();\n\t\t\t\t\t\t}catch(IOException ioe) {\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//and the stage is closed, which also ends the client's side of the program.\n\t\t\t\t\t\tstage.close();\n\t\t\t\t\t}\t\n\t\t\t\t}\t\n\t\t\t}", "private void tryGuess(char letter) {\n\t\tSystem.out.println(\"=============================\");\n\t\t// if the same guess has been done before, print corresponding information\n\t\tif (this.guessedLetters.contains(letter)){\n\t\t\tSystem.out.println(\"Letter already guessed, try another one.\");\n\t\t}else {\n\t\t\t// else, update the guessedLetters\n\t\t\tthis.guessedLetters.add(letter);\n\t\t\t// if the guess is correct\n\t\t\tif(this.word.takeGuess(letter)) {\n\t\t\t\t// print corresponding information\n\t\t\t\tSystem.out.println(\"Correct letter!\");\n\t\t\t}else {\n\t\t\t\t// else, add the letter to the wrongLetters list\n\t\t\t\tthis.wrongLetters.add(letter);\n\t\t\t\t// increase the count of wrong guesses\n\t\t\t\tthis.numOfWrongGuess ++;\n\t\t\t\t// print out the corresponding information\n\t\t\t\tSystem.out.println(\"Wrong letter, better luck next turn.\");\n\t\t\t}\n\t\t}\n\t}", "public static void confirmGuess(String guess) {\n\n\t\t//for debug purposes\n\t\tSystem.out.println(\"User guess is \" + guess + \" and the correct answer is \" + globalColor);\n\n\t\t//userGuess equals globalColor\n\t\tif ((guess.toLowerCase()).equals(globalColor.toLowerCase())) {\n\t\t\t//notify the user that they have won\n\t\t\tJOptionPane.showMessageDialog(null, \"Your guess is correct!!!\");\n\t\t\t\n\t\t//userGuess does not equal globalColor\n\t\t} else {\n\t\t\t//notify the user that they have lost\n\t\t\tJOptionPane.showMessageDialog(null, \"Your guess is incorrect. Try again.\");\n\t\t}\n\t}", "private void updateGameState(String guessedLetter) {\n\t\tif (guessedWord.contains(guessedLetter)) {\n\t\t\treturn;\n\t\t} else if (actualWord.contains(guessedLetter)) {\n\t\t\tprintln(\"That guess is correct.\");\n\t\t\tupdateGuessedWord(guessedLetter);\n\t\t\tcanvas.displayWord(guessedWord);\n\t\t} else {\n\t\t\tbadGuessCount++;\n\t\t\tcanvas.noteIncorrectGuess(guessedLetter.charAt(0));\n\t\t\tprintln(\"There is no \" + guessedLetter + \" in the word.\");\n\t\t\t//whatever other action that will happen for bad guesses can go here\n\t\t}\n\t}", "public static void paintHangman() {\n if (count == 1) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"1 incorrect guess, 6 guesses left\");\n }\n if (count == 2) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"2 incorrect guesses, 5 guesses left\");\n }\n if (count == 3) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|\");\n System.out.println(\" | / |\");\n System.out.println(\" | / |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"3 incorrect guesses, 4 guesses left\");\n }\n if (count == 4) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"4 incorrect guesses, 3 guesses left\");\n }\n if (count == 5) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | /\");\n System.out.println(\" | /\");\n System.out.println(\" | _/\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"5 incorrect guesses, 2 guesses left\");\n }\n if (count == 6) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < ' |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | _/ \\\\_\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"6 incorrect guesses, only 1 guess left!\");\n }\n if (count == 7) {\n System.out.println(\"GAME OVER!\");\n System.out.println(\"7 incorrect guesses\");\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / X X \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | __ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | _/ \\\\_\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"RIP \" + UserName.getUserName());\n System.out.println(\"GAME OVER! The word was \" + CategorySelector.word);\n }\n }", "public String getIsguess() {\r\n return isguess;\r\n }", "private boolean gameOver()\n {\n \t//lose case\n \tif (guess_number == 0)\n \t{\n \t\twin = false;\n \t\treturn true;\n \t}\n \t//win case\n \tif (mask.compareTo(word) == 0)\n \t{\n \t\twin = true;\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }", "public static void userGuess() {\n\t\tSystem.out.println(\"It's time for you to guess. \");\n\t\tSystem.out.print(\"The computer will pick 4 numbers, each from 1 to 6: (\");\n\n\t\t// prints out all color options\n\t\tprintColor();\n\t\tSystem.out.println(\"You will try to guess what that exact sequence is in 12 tries, good luck!\");\n\t\tSystem.out.println(\"If you want to give up, enter 'quit' or 'exit'\");\n\t\tSystem.out.println(\"If you need a hint, enter 'hint'\");\n\t\tSystem.out.println(\"If you want some statistics, enter 'stats'\");\n\n\t\t// have computer pick random sequence\n\t\tRandom random = new Random();\n\t\tfor (int i = 0; i < NUM_COLOR_ROUND; i++) {\n\t\t\tcomputerCode[i] = random.nextInt(colors.length) + 1;\n\t\t}\n\n\t\t// scanner to input user data\n\t\ttry (Scanner scanner = new Scanner(System.in)) {\n\t\t\t// allows the user to input 12 guesses\n\t\t\twhile (totalGuess < MAX_GUESS) {\n\t\t\t\t// if you haven't entered 12 guesses allow more\n\t\t\t\tSystem.out.print(\"Please enter 4 numbers, each from 1 to 6: (\");\n\t\t\t\tprintColor();\n\n\t\t\t\t// reads the line into an array\n\t\t\t\tint[] user_guesses = new int[NUM_COLOR_ROUND];\n\t\t\t\tint index = 0;\n\t\t\t\twhile (index < NUM_COLOR_ROUND) {\n\t\t\t\t\t// reads the entire user input into a line\n\t\t\t\t\tString guess = scanner.nextLine();\n\n\t\t\t\t\t// check if user wants hint\n\t\t\t\t\tif (Objects.equals(\"hint\", guess)) {\n\t\t\t\t\t\thint();\n\t\t\t\t\t}\n\n\t\t\t\t\t// checks if user wants to quit\n\t\t\t\t\tif (Objects.equals(\"quit\", guess.toLowerCase()) || Objects.equals(\"exit\", guess.toLowerCase())) {\n\t\t\t\t\t\tSystem.out.println(\"You quit, better luck next time! \");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\n\t\t\t\t\t// checks if user wants stats\n\t\t\t\t\tif (Objects.equals(\"stats\", guess.toLowerCase())) {\n\t\t\t\t\t\tdisplayStats();\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (char ch : guess.toCharArray()) {\n\t\t\t\t\t\tif (index == NUM_COLOR_ROUND) {\n\t\t\t\t\t\t\t// if more than 4 digits are used, only the first 4 are entered into array\n\t\t\t\t\t\t\tSystem.out.println(\"Warning: only the first four digits are taken as your guess.\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (ch > '0' && ch < '7') {\n\t\t\t\t\t\t\tuser_guesses[index++] = ch - '0';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tint digitLeft = NUM_COLOR_ROUND - index;\n\t\t\t\t\tif (digitLeft > 0) {\n\t\t\t\t\t\t// if <4 digits are entered, then the program asks the user to enter the\n\t\t\t\t\t\t// remaining to make 4\n\t\t\t\t\t\tSystem.out.println(String.format(\"Please enter %d more digits (1 to 6 only)\", digitLeft));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// total number of guesses so far\n\t\t\t\ttotalGuess++;\n\n\t\t\t\t// prints out total number of guesses so far\n\t\t\t\tSystem.out.println(\"Total number of guesses: \" + totalGuess);\n\t\t\t\t// prints out your guess\n\t\t\t\tSystem.out.println(\"Your guess is: \" + Arrays.toString(user_guesses));\n\n\t\t\t\t// checks if user wins, if not, gives feedback on their guess\n\t\t\t\tint[] result = compareGuess(computerCode, user_guesses);\n\t\t\t\tint numRightPos = result[0];\n\t\t\t\tint numWrongPos = result[1];\n\t\t\t\tif (numRightPos == NUM_COLOR_ROUND) {\n\t\t\t\t\tSystem.out.println(\"You win!\");\n\t\t\t\t\tstoreStats(totalGuess, fileName);\n\t\t\t\t\tdisplayStats();\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(String.format(\n\t\t\t\t\t\t\t\"Correct position and color (BLACK): %d; Wrong position but correct color (WHITE): %d\",\n\t\t\t\t\t\t\tnumRightPos, numWrongPos));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (totalGuess >= MAX_GUESS) {\n\t\t\t// if user has done 12 guesses, game is over\n\t\t\tSystem.out.println(\"You lose!\");\n\t\t\tSystem.out.println(\"Here is what computer generated: \" + Arrays.toString(computerCode));\n\t\t\tstoreStats(0, fileName);\n\t\t\tdisplayStats();\n\t\t}\n\t}", "public static void hitWrong()\n\t{\n\t\troundEnd();\n\t\tlblUpdate.setText(\"You have answer incorrectly. You lose.\");\n\t}", "public boolean alreadyGuessed(char guess) {\r\n \t//Convert guess to string, use contains method to check guessesMade ArrayList.\r\n if (guessesMade.contains(String.valueOf(guess))) {\r\n \treturn true;\r\n }\r\n \treturn false;\r\n }", "public static void hangMan(Scanner input, Questions thisSession){\n hangMan1();\n Random rand=new Random();\n int randomNumber=rand.nextInt(thisSession.getLength());\n String userInput;\n byte lives=6,givenLetterscontrol=0;\n boolean letterIsInAnswer=false,playerWon=false;\n System.out.println(\"Welcome. Please type just one letter and press enter. You have 5 lives to guess the sentence. The questions is:\\n\"+\n thisSession.getQuestion(randomNumber));\n String answerSentence=(thisSession.getAnswer(randomNumber));\n String[] sentence=new String[answerSentence.length()];\n String [] lowDiagonal=new String[answerSentence.length()], givenLetter=new String[lives];\n sentence=answerSentence.split(\"\");\n for (int i=0;i<sentence.length;i++){\n if (sentence[i].equals(\" \")){\n lowDiagonal[i]=\" \";\n }else{ \n lowDiagonal[i]=\"_\";\n }\n System.out.print(lowDiagonal[i]+ \" \");\n }\n do{\n System.out.println(\"\\nWrite a letter and press enter to send the letter\");\n userInput=input.nextLine();\n userInput=userInput.toLowerCase();\n letterIsInAnswer=false;\n if (givenLetterscontrol>0){ //checks if user input has already been given.\n for (int i=0;i<6;i++){\n if (givenLetter[i].equals(userInput)){\n do{\n System.out.println(\"That letter has already been given. Please write another one.\");\n userInput=input.nextLine();\n }while (givenLetter[i].equals(userInput));\n }\n }\n }\n givenLetter[givenLetterscontrol]=userInput;\n for (int i=0;i<sentence.length;i++){ //checks if the letter is in the answer.\n if (sentence[i].equals(userInput)){\n letterIsInAnswer=true;\n lowDiagonal[i]=userInput;\n }\n }\n if (letterIsInAnswer==false){ //If letter was not in the answer, a life is lost.\n lives--;\n switch(lives){\n case 5:\n hangMan2();\n break;\n case 4:\n hangMan3();\n break;\n case 3:\n hangMan4();\n break; \n case 2:\n hangMan5();\n break;\n case 1:\n hangMan6();\n break;\n case 0:\n hangMan7();\n youLost();\n lives=-1;\n break;\n }\n System.out.println(\"That letter is not in the answer.\");\n }\n if (letterIsInAnswer){\n if (Arrays.equals(lowDiagonal,sentence)){\n playerWon=true;\n for (int i=0;i<sentence.length;i++){ \n System.out.print(lowDiagonal[i]+ \" \");\n } \n youWon();\n }else{\n for (int i=0;i<sentence.length;i++){ \n System.out.print(lowDiagonal[i]+ \" \");\n } \n }\n }\n\n }while (lives>=0 && playerWon==false);\n System.out.println(\"Thanks for playing! Returning to main menu...\");\n }", "public void userMessageInput() {\n //declaring and initializing new userScanner variable\n Scanner userScanner = new Scanner(System.in);\n //displayed message to the user with the updating replacedMovie variable\n System.out.println(\"You are guessing :\" + this.replacedMovie);\n //displaying message with total number of wrong trials (guessed letters) to the user ,\n // together with the wrong guessed letter/s.\n getAllWrongLetters(); // calls method to dispaly the whole list of wrong guessed letters.\n System.out.println(\"You have guessed \" + this.wrongLettersCount + \" wrong letter(s): \" + allWrongLetters);\n //displaying a message asking the user to enter a guessed letter\n System.out.println(\"Guess a Letter\");\n //storing the entered letter in userEnteredLetter variable\n this.setUserGuessedLetter(userScanner.next().charAt(0));\n\n //return userEnteredLetter; // returning userEnteredLetter variable\n\n }", "public String guessingNumber(int randomNumber,int userNumber) {\n if(userNumber <= 0 || userNumber > 50)\n {\n return \"Enter number between 1 to 50\";\n }\n if(userNumber>randomNumber) {\n return \"guessed number is more than the original number\";\n } else if (userNumber < randomNumber) {\n return \"guessed number is less than the original number\";\n } else {\n return \"guessed matches the original number\";\n }\n }", "public static void main(String[] args) {\n //Calculate the optimal number of guesses\n int OPTIMALGUESSCNT = getlog(UPPERBOUND,10);\n\n //Begin game\n System.out.println(\"This is the High Low Game. You WILL have fun.\");\n\n //Print Name\n Scanner input = new Scanner(System.in);\n System.out.println(\"Enter your name or be annihilated: \");\n\n String name = validateInputStr();\n if (name.isEmpty()) {\n System.out.println(\"You didn't enter a name. You must be Nobody. Glad I'm not a cyclops, haha jk, unless...\\nHello Player 1.\");\n }\n System.out.printf(\"Hello %s\\n\", name);\n\n boolean playAgain = false;\n int total_guesses = 0;\n short num_games = 0;\n do { //setup each game\n int game_guesses = 0;\n int secretNum = getSecretNum(Integer.parseInt(\"BEEF\",16));\n int guess = -1;\n int prev_guess = -1;\n while (guess != secretNum) { //A single game seshion\n Scanner scanGuess = new Scanner(System.in);\n System.out.println(\"Guess a number between 0 and 100: \");\n guess = validateInput();\n ++game_guesses;\n if (guess > UPPERBOUND || guess <= 0) {\n System.out.println(\"Your guess wasn't even in the range given!\");\n }\n if (guess > secretNum) {\n if (prev_guess != -1 && guess >= prev_guess && prev_guess >= secretNum) {\n System.out.println(\"You incorrectly guessed even higher this time! Lower your angle of attack!\");\n }\n System.out.println(\"You guessed too high.\");\n prev_guess = guess;\n }\n else if (guess < secretNum) {\n if (prev_guess != -1 && guess <= prev_guess && prev_guess <= secretNum) {\n System.out.println(\"You incorrectly guessed even lower this time! Aim high airman!\");\n }\n System.out.println(\"You guessed too low.\");\n prev_guess = guess;\n }\n else {\n //The game has effectively ended -> List Win Possibilities\n selectWinOption(game_guesses, OPTIMALGUESSCNT);\n //Check whether to play again\n boolean goodInput = false;\n while (!goodInput) {\n System.out.println(\"Would you like to play again? Enter yes (y) or no (n): \");\n Scanner clearBuff = new Scanner(System.in);\n String raw_playAgain = \"\";\n raw_playAgain = validateInputStr();\n //check input (I didn't feel like using Patterns\n if (raw_playAgain.equalsIgnoreCase(\"yes\") || raw_playAgain.equalsIgnoreCase(\"y\")) {\n playAgain = true;\n goodInput = true;\n }\n else if (raw_playAgain.equalsIgnoreCase(\"no\") || raw_playAgain.equalsIgnoreCase(\"n\")) {\n playAgain = false;\n goodInput = true;\n }\n else {\n System.out.println(\"Enter valid input! Ahhhh.\");\n }\n } //end check play again input\n }\n }\n System.out.println(\"You had \" + game_guesses + \" guesses during this game.\\n\\n\");\n total_guesses += game_guesses;\n ++num_games;\n }while(playAgain);\n\n printEndDialogue(total_guesses, num_games, OPTIMALGUESSCNT);\n }", "private static void playGame()\n {\n initializeGame();\n System.out.println(textColor(\"white\",\"I have thought of a number, can you guess it?\"));\n Scanner guess = new Scanner(in);\n while(isPlaying)\n {\n // Give play information on how many guesses they have left\n System.out.print(textColor(\"blue\", \"Guesses left: \"));\n System.out.println(textColor(\"blue\", Integer.toString(guessesLeft)));\n if(showDebugInfo)\n {\n System.out.println(textColor(\"white\", String.format(\" %d (%d)\",bestGuess,secretNumber)));\n }\n // Ask for user input / guess\n System.out.println(textColor(\"cyan\", \"Enter your guess: \"));\n playerGuess = guess.nextInt();\n if (playerGuess > maxSecret)\n {\n // Cap player guess to max possible value\n System.out.print(textColor(\"yellow\",\"Guess is higher than possible maximum.\\nGuess is set to: \"));\n System.out.println(textColor(\"cyan\",Integer.toString(maxSecret)));\n }\n else if(playerGuess < minSecret)\n {\n // Cap player guess to min possible value\n System.out.print(textColor(\"yellow\",\"Guess is smaller than possible maximum.\\nGuess is set to: \"));\n System.out.println(textColor(\"cyan\",Integer.toString(minSecret)));\n }\n if (playerGuess == secretNumber)\n {\n // Player won\n System.out.print(textColor(\"white\",\"Congratulations! you have found my number: \"));\n System.out.println(textColor(\"cyan\",Integer.toString(secretNumber)));\n exitGame();\n }\n else if (secretNumber < playerGuess)\n {\n // Secret number is smaller than Player's guess\n System.out.printf(\"My number is %s\\n\",textColor(\"red\",\"LOWER\"));\n\n if(playerGuess - secretNumber < bestGuess)\n {\n bestGuess = playerGuess - secretNumber;\n }\n }\n else if (secretNumber > playerGuess)\n {\n // Secret number is larger than Player's guess\n System.out.printf(\"My number is %s\\n\",textColor(\"yellow\",\"HIGHER\"));\n if (secretNumber - playerGuess < bestGuess)\n {\n bestGuess = secretNumber - playerGuess;\n }\n }\n if (isPlaying)\n {\n switch(guessesLeft)\n {\n case 1:\n if(dangerZone(bestGuess))\n {\n // Player got close to finding the Secret Number, but still failed\n System.out.println(textColor(\"white\",\"You almost got me! My number was \"));\n System.out.println(textColor(\"yellow\",Integer.toString(secretNumber)));\n isPlaying = false;\n\n }\n else\n {\n if (safeLineUsed)\n {\n // Player could not find solution even after bonus guesses awarded\n System.out.print(textColor(\"white\",\"Sorry, the number I thought was \"));\n System.out.println(textColor(\"yellow\",Integer.toString(secretNumber)));\n isPlaying = false;\n }\n else\n {\n // Bonus Guesses award is triggered\n System.out.print(textColor(\"white\",\"Don't give up, here is \"));\n System.out.print(textColor(\"cyan\",Integer.toString(extraGuesses)));\n System.out.println(textColor(\"white\",\" extra guesses\"));\n safeLineUsed = true;\n guessesLeft += extraGuesses-1;\n }\n }\n break;\n\n default:\n // Keep reducing Guesses Left number\n guessesLeft--;\n break;\n }\n\n }\n }\n\n }", "public void process(String s)//check if the phrase guess equals the actual phrase\n {\n String phraseGuess = s.toUpperCase();\n String phraseUp = phrase.toUpperCase();\n //comparing guess and actual\n if (phraseGuess.equals(phraseUp))\n {\n System.out.println(\"You Guessed correctly!\");\n screen = phraseUp.toCharArray();\n GamePlay.letterInPhrase = true;\n showPhrase();\n// System.out.println(\"The phrase is: \"+phrase);\n }\n else\n {System.out.println(\"Incorrect Guess Next Player's turn\");\n GamePlay.letterInPhrase = false;\n }\n }", "private void playGame() {\n \twhile (guessesLeft > 0) {\n \t\twhile (true) {\n \t\t\tstr = readLine(\"Your guess: \");\n \t\t\tif (str.length() != 1) {\n \t\t\t\tprintln(\"You can only enter one symbol!\");\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\tboolean bl = false;\n \t\t\t\n \t\t\t// Change string and char to uppercase\n \t\t\tstr = str.toUpperCase();\n \t\t\tchar ch = str.charAt(0);\n \t\t\t\n \t\t\tfor (int i = 0; i < guesses.length(); i++) {\n \t\t\t\tif (ch == guesses.charAt(i)) {\n \t\t\t\t\tprintln(\"This letter has already written. Enter another one!\");\n \t\t\t\t\tbl = true;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (bl) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\tbreak;\n \t\t}\n \t\t\n \t\t// Change string and char to uppercase\n \t\tstr = str.toUpperCase();\n \t\tletter = str.charAt(0);\n\n \t\tguesses += letter;\n \t\t\n \t\t// Check if word contains entered letter\n \t\tif (checkWord()) {\n \t\t\tprintln(\"That guess is correct.\");\n \t\t}\n \t\telse {\n \t\t\tprintln(\"There are no \" + letter + \"'s in the word.\");\n \t\t\tincorrectLetters += letter;\n \t\t\tcanvas.noteIncorrectGuess(incorrectLetters);\n \t\t\tguessesLeft--;\n \t\t}\n \t\t\n \t\tif (numberOfSymbols < word.length()) {\n \t\t\tprint(\"The word now looks like this: \");\n \t\t\tfor (int i = 0; i < word.length(); i++) {\n \t\t\t\tif (list[i] == true) {\n \t\t\t\t\tprint(word.charAt(i));\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\tprint(\"-\");\n \t\t\t\t}\n \t\t\t}\n \t\t\tprintln();\n \t\t\t\n \t\t\tif (guessesLeft == 1) {\n \t\t\t\tprintln(\"You have only one guess left.\");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tprintln(\"You have \" + guessesLeft + \" guesses left.\");\n \t\t\t}\n \t\t}\n \t\telse {\n \t\t\tif (numberOfSymbols == word.length()) {\n \t\t\t\twin = true;\n \t\t\t\tprintln(\"You guessed the word: \" + word);\n \t\t\t\tprintln(\"You win.\");\n \t\t\t\tcanvas.displayWord(word);\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n\t\t\t\t\n \t}\n \t\n \tif (win == false) {\n \t\tprintln(\"You're completely hung.\");\n \t\tprintln(\"The word was: \" + word);\n \t\tprintln(\"You loose.\");\n \t\tcanvas.displayWord(word);\n \t}\n \t\n \tstartNext();\n }", "public int getGuess() {\n\t\tif (accusation) {\n\t\t\tJOptionPane.showMessageDialog(parent, panel, \"Make an accusation:\", JOptionPane.PLAIN_MESSAGE);\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(parent, panel, \"Make a suggestion:\", JOptionPane.PLAIN_MESSAGE);\n\t\t}\n\t\treturn CluedoUI.asInt(characters.getSelectedItem().toString()) \n\t\t\t\t+ CluedoUI.asInt(weapons.getSelectedItem().toString())\n\t\t\t\t + CluedoUI.asInt(rooms.getSelectedItem().toString());\n\t}", "private boolean checkGuess(char c){\r\n boolean contains = false;\r\n for (int i = 0; i < wordArray.length; i++) {\r\n if (wordArray[i] == c) {\r\n contains = true;\r\n hidden[i] = c;\r\n }\r\n }\r\n if (!contains){\r\n guesses.add(c);\r\n }\r\n return contains;\r\n }", "public void guessSentence() {\n System.out.println(\"Please guess a letter in the secret word.\");\n }", "public void loseTheGame(int wrongLetters, boolean userGuessed) {\n if (wrongLetters == 10 && !userGuessed) { //checking if number of wrong trials reaches ten and users didn't guess the movie\n //displaying messages to the user with total number of wrong trials and the correct picked movie name\n getAllWrongLetters();\n System.out.println(\"You have guessed \" + wrongLetters + \" wrong letter(s):\" + allWrongLetters);\n System.out.println(\"Sorry you loose...You run out of points :(\");\n System.out.println(\"The movie is '\" + this.pickedMovie + \"'\");\n }\n\n }", "public boolean guessWord (String gword) {\n \tif (lose || victory) return false;\n \t\n \tif ( gword.toLowerCase().equals(_word.toLowerCase()) ) {\n \t\tthis.victory = true;\n \t\t\n \t\tfor (int i = 0; i < _word.length(); i++) {\n \t\t\thint.setCharAt(2*i, _word.charAt(i));\n \t\t}\n \t\t\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }", "public void noteIncorrectGuess(char letter) {\n\t\taddToWrongLetters(letter);\n\t\tdisplayWrongLetters();\n\t\taddNextBodyPart(wrongLetters.length());\n\t\t\n\t}", "private static int guessing() {\n\t\t\n\t\tSystem.out.println(\"Guess a number between 1 and 100, you have 5 trials: \");\n\t\t\n\t\tint trials = 5;\n\t\tScanner input = new Scanner(System.in);\n\t\t\n\t\t//set a random number as the number to be guessed\n\t\tint num = (int)(100 * Math.random()) + 1;\n\t\tint points = 0;\n\t\t\n\t\t//use a flag to check if player guess the correct number or not\n\t\tboolean flag = false;\n\t\twhile ( trials > 0) {\n\t\t\tint guess = input.nextInt();\n\t\t\ttrials--;\n\t\t\tif ( guess == num ) {\n\t\t\t\tpoints = trials == 0? 20 : trials * 20;\n\t\t\t\t//System.out.println(\"You guess the number with\"+trials+\"trials left, congratulation! +\"+ (points = trials == 0? 20 : trials * 20)+\" points\");\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}else if ( guess < num ) {\n\t\t\t\tSystem.out.println(\"The guess is too small, please try again, you have \"+trials+\" trials left.\");\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"The guess is too large, please try again, you have \"+trials+\" trials left.\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif ( !flag ) System.out.println(\"Trials used up, + 0 points\");\n\t\treturn points;\n\t\t\n\t}", "public abstract void nextGuessResult(ResultPegs resultPegs);", "public void noteIncorrectGuess(char letter) \n\t{ \n\t choosePart(i);\n\t i++;\n\t wrong+=letter;\n\t wrongLabel.setLabel(wrong);\n\t add(wrongLabel);\n\t}", "public void setUserGuessedLetter(char userGuessedLetter) {\n this.userGuessedLetter = userGuessedLetter;\n }", "public abstract String guessedWord();", "public boolean guess(int number) {\n\t\tcountRound++;\n\t\tlastGuess = number;\n\t\t\n\t\tif(number == secret) {\n\t\t\tsetChanged();\n\t\t\tnotifyObservers(number);\n\t\t\tsetMessage(\"Wow! Correct!! I'm thinking of \"+secret+\".\");\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (number < secret && number >= 1) setMessage(\"Umm, \" + number + \" is too small.\");\n\t\telse if (number > secret && number <= this.upperBound) setMessage(\"Oh! \" + number + \" is too large.\");\n\t\telse setMessage(\"Oops! Please input a valid number!!\");\n\t\t\n\t\tsetChanged();\n\t\tnotifyObservers();\n\t\treturn false;\n\t}", "public static void main(String[] args){\n Scanner keyboard = new Scanner(System.in);\n //declare variables for the answer, user's guess, and number fo guesses\n int answer;\n int guess;\n int numOfGuess = 0;\n \n boolean done = false;\n answer = (int)(100*Math.random())+1;\n \n //print an introduction that tells the user how to play this game\n System.out.println(\"Hello user! I will generate a number between 1-100 inclusive and you will try to guess it! I will tell you if your answer is too low or too high after each incorrect guess!\");\n do \n {\n System.out.print(\"Please enter your guess:\");\n guess = keyboard.nextInt();\n if (guess > answer){\n System.out.println(\"Too high!\");\n }\n else if( guess < answer){\n System.out.println(\"Too low!\");\n }\n else{\n done = true;\n }\n numOfGuess += 1;\n } while (done == false);\n \n System.out.println(\"Congratulations! You're score is \" + numOfGuess);\n if (numOfGuess >= 20){\n System.out.println(\"Rating: You are terrible at this game!\");\n }\n else if (numOfGuess >= 10 && numOfGuess <=19){\n System.out.println(\"Rating: You need more practice!\");\n }\n else if (numOfGuess >= 5 && numOfGuess <= 9){\n System.out.println(\"Rating: Not too bad, But can you get it in fewer than 5 guesses?\");\n }\n else if (numOfGuess >= 2 && numOfGuess <= 4){\n System.out.println(\"Rating: AWESOME. You win a trip to Hawaii!\");\n }\n else{\n System.out.println(\"Rating: That was pure LUCK and you know it!\");\n }\n \n }", "public char handleGuess(){\n\t\t\r\n\t\tSystem.out.print(\"Please enter a letter: \");\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tString s = sc.next();\r\n\t\tchar letter = s.charAt(0);\r\n\r\n\t\taa:for(int i=0; i<gameLetter.length; i++){\r\n\t\t\tif(letter == gameLetter[i]){\r\n\t\t\t\tcorrectList.add(letter);\r\n\t\t\t\t\r\n\t\t\t\tif(ifWrongListContain(letter)==true){\r\n\t\t\t\t\tfor(int b=0, length=wrongList.size(); b<length; b++){\r\n\t\t\t\t\t\tif(wrongList.get(b)==letter)\r\n\t\t\t\t wrongList.remove(b);\r\n\t\t\t\t length--;\r\n\t\t\t\t b--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak aa;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(ifWrongListContain(letter)==true)\r\n\t\t\t\t\tcontinue aa;\r\n\t\t\t\telse\r\n\t\t\t\t wrongList.add(letter);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\treturn letter;\t\t\r\n\t\t\t\t\r\n\t}", "public void clearGuess() {\n\t\tthis.guessTimes = 0;\n\t}", "@Override\r\n\tpublic void nextGuessResult(ResultPegs resultPegs) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t\t// Not used here\r\n\t}", "public void setGuess(Code guess) {\n this.guess = guess;\n }", "private static String getValidGuess(BagelGame game) {\n Scanner scan = new Scanner(System.in);\n boolean valid = false;\n String guess = \"\";\n String error;\n \n while (!valid) {\n System.out.print(\"Guess # \" + game.getGuessNum() + \" ? \");\n guess = scan.nextLine().trim();\n error = game.validateGuess(guess);\n if (error == \"\") {\n valid = true;\n } else {\n System.out.println(error);\n }\n }\n return guess;\n }", "public boolean guess(int number) {\n\t\tcount++;\n\t\tif (number == secret) {\n\t\t\tsetHint(String.format(\"Correct. The secret is %d. You used %d guesses.\", this.secret, this.count));\n\t\t\treturn true;\n\n\t\t} else if (number < secret) {\n\t\t\tsetHint(\"Sorry,your guess is too small\");\n\t\t} else {\n\t\t\tsetHint(\"Sorry,your guess is too large\");\n\t\t}\n\t\treturn false;\n\n\t}", "public static void hitCorrect()\n\t{\n\t\tplayersCards.add(deck.deal());\n\t\tcurrentValue();\n\t\tuserCardImg[playersCards.size()-1].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(playersCards.get(playersCards.size()-1)))));\n\t\tresume();\n\t\tif(calculateHand(playersCards)>21 || playersCards.size()==4 || calculateHand(playersCards)==0)\n\t\t{\n\t\t\troundEnd();\n\t\t}\n\t\t\n\t}", "public void winTheGame(boolean userGuessed) {\n this.setGuessed(true); //updating the isGuessed to true\n //dispalying winning message and the name of the picked movie\n System.out.println(\"Congratulation .. You Win!:)\");\n System.out.println(\"You have Guessed '\" + this.replacedMovie + \"' Correctly.\");\n }", "private synchronized String responseMessage(String playerInputNum) {\n if (playerInputNum.equals(answer)) {\n winOrLose = true;\n return \"Congratulation, the correct answer is \" + answer;\n } else if (attempt == 4) {\n attempt = 5;\n return \"Game over, the answer is \" + answer;\n } else if (playerInputNum.compareTo(answer) > 0)\n return \"The guess number \" + playerInputNum + \" is bigger than the generated number, \" + (4 - attempt) + \" chances left.\";\n else\n return \"The guess number \" + playerInputNum + \" is smaller than the generated number, \" + (4 - attempt) + \" chances left.\";\n }", "public boolean guess(char letter)\n\t{\n\t\treturn false;\n\t}", "public void addGuess(Player player, String guess) {\n\t\t// dont to add guesses when win or lose occurs\n\t\tif (checkWinner(player) || checkLoser(player)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// add guess if number of current guesses is less than max guesses\n\t\tif (player != null && player.getTotalGuesses() < MAX_GUESSES) {\n\t\t\tplayer.addGuess(guess);\n\t\t\tguesses.add(guess);\n\t\t}\n\t\t\n\t\t// if guess equals secret code then player wins\n\t\tif (checkGuessEqual(guess)) {\n\t\t\tsetPlayerWon(true);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// if the 4th present guess is incorrect, player loses\n\t\tif (player.getTotalGuesses() >= MAX_GUESSES && checkGuessEqual(guess) == false) {\n\t\t\tsetPlayerLost(true);\n\t\t\treturn;\n\t\t}\n\t}", "public void makeGuess(char letter) {\n\t\tif (isGameOver() || hasGuessedAlready(letter)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tguessesMade.add(letter);\n\t\tif (wordToGuess.indexOf(letter) == -1) { // letter is not in wordToGuess\n\t\t\tnumIncorrectGuessesMade++;\n\t\t}\n\t}", "public void playGuess(ActionEvent e) throws IOException {\n try {\n // Player and computer guesses\n int p = spinPVal.getValue();\n int total = game.play(p);\n int c = game.getComputerPlays();\n spinCVal.setValue(c);\n playerPlays = \"Player guesses \" + p + \". \";\n computerPlays = \"Computer guesses \" + c + \". \";\n getWinnerJBJ(total, p, c);\n myctr.setLabels();\n myctr.setMinMaxLabel();\n } catch(Exception n) {\n System.out.println(\"Game \\\"JellyBeanJar\\\" not initialized!\");\n }\n }", "public void guessName()\n\t{\n\t\tSystem.out.println(\"Who do you think it is?\");\n\t\tguessName = scan.nextLine();\n\t\tif(guessName.equals(name))\n\t\t{\n\t\t\tSystem.out.println(\"Congratulations, you are correct!\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"You are incorrect\");\n\t\t\tSystem.out.println(\"The correct answer was \" + name);\n\t\t}\n\t}", "public void changeGuesses (int k, int p){\n for (int i = 0; i<9; i++){\n if(bSquares.get(i).checkhasFocus()){//finds out which square user is playing in. \"i\" is that square //but all the squares have focus in begginning?\n System.out.println(i + \" has focus\");\n for (int j = 0; j<9; j++){\n if (!bSquares.get(i).getSmallSquare(j).isCommitted()&&bSquares.get(i).getSmallSquare(j).getOwnership()>0){\n bSquares.get(i).getSmallSquare(j).setOwnership(0);//j is square that the user guessed last time.\n madeChoice = false; //since we just took away the user's last guess, then there is no choice made.\n //unless the next guess is valid.\n }\n }\n if(bSquares.get(k).getSmallSquare(p).getOwnership()==0&&!bSquares.get(k).getSmallSquare(p).isCommitted()){\n bSquares.get(k).getSmallSquare(p).setOwnership(2);\n madeChoice = true;//this guess is valid, so the user \"made a choice\" and the ENTER button can now be pushed.\n }\n }\n }\n \n }", "public boolean isGuessed() {\n return isGuessed;\n }", "@Override\r\n\tpublic void checkAnswer() {\n\t\t\r\n\t}", "private void matchletter(){\n\t\t/* Generate a Random Number and use that as a Index for selecting word from HangmanLexicon*/\n\t\tString incorrectwords = \"\";\n\t\tcanvas.reset();\n\t\tHangmanLexicon word= new HangmanLexicon(); // Get Word from Lexicon\n\t\tint index=rgen.nextInt(0, (word.getWordCount() - 1)); // Select the word Randomly\n\t\tString secretword=word.getWord(index);\n\t\tprintln(\"secretword: \"+secretword);\n\t\tint lengthofstring= secretword.length();\n\t\tString createword=concatNcopies(lengthofstring,\"-\"); // Create a blank word the user will guess\n\t\tcanvas.displayWord(createword); // Display the word on the Canvas\n\t\tprintln(\"The word now looks like this:\" +createword);\n\t\tprintln(\"You have \" +lengthofstring+ \" guesses left\");\n\t\tint counter =0;\n\t\tint guess= lengthofstring;\n\t\tint pos = createword.indexOf('-'); // Check for blank Words\n\t\t/* Ask user to input the letter*/\n\t\twhile(counter<lengthofstring && (pos !=-1 )){ \n\t\t\tint check=0;\n\t\t\tpos = createword.indexOf('-',pos); // Check to find Dashes in word\n\t\t\tString userletter= readLine(\"Your Guess:\");\n\t\t\tif(userletter.length() > 1){ // Check for two letters entered\n\t\t\t\tprintln(\"Enter letter Again\");\n\t\t\t}\n\t\t\tchar ch=userletter.charAt(0);\n\t\t\tif(Character.isLowerCase(ch)) { // Convert lower case to upper case\n\t\t\t\tch = Character.toUpperCase(ch);\n\t\t\t}\n\t\t\tfor (int i=0;i<lengthofstring;i++){ // Check for entire letter matching in the secretword\n\t\t\t\tif (ch==secretword.charAt(i) && ch!=createword.charAt(i)) { \n\t\t\t\t\tcreateword = createword.substring(0, i) + ch + createword.substring(i + 1);\n\t\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\t\tcheck++; // If user puts the correct letter again it is flagged as a error\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(check==0){\n\t\t\t\tprintln(\"There are no \"+ch+\"'s in the word\");\n\t\t\t\tguess=guess-1;\n\t\t\t\tincorrectwords = incorrectwords+ch;\n\t\t\t\tcanvas.noteIncorrectGuess(guess, incorrectwords);\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\tprintln(\"The word now looks like this:\"+createword);\n\t\t\tprintln(\"You have \" +guess+ \" guesses left\");\n\n\t\t\tif(counter==lengthofstring){ // Checks for Fail condition- Game Over\n\t\t\t\tprintln(\"You are completely hung\");\n\t\t\t\tprintln(\"The word was: \"+secretword);\n\t\t\t\tcanvas.displayWord(secretword);\n\t\t\t\tprintln(\"You lose \");\n\t\t\t}\n\t\t\tpos = createword.indexOf('-');// Check for Win condition\n\t\t\tif(pos < 0){\n\t\t\t\tprintln(\"You saved Hangman\");\n\t\t\t\tprintln(\"You Win !!!\");\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tguess=123;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public static void playGame(String word) {\n DrawingPanel canvas = new DrawingPanel(500, 500);\n Graphics pen = canvas.getGraphics();\n \n //define flag for while loop\n boolean gameOver = false;\n \n //create a boolean array with elements equal to the number of letters to guess\n boolean[] letters = new boolean[word.length()];\n \n //Create a string that stores all letters that have been guessed\n String guesses = \"\";\n \n //create an int variable that stores the number of wrong guesses\n int wrongGuesses = 0;\n \n //create a scanner object that reads in user guesses.\n Scanner console = new Scanner(System.in);\n \n //meat of the game\n while(!gameOver) {\n \n //prompt user for a guess\n System.out.print(\"Guess a letter: \");\n char guess = Character.toLowerCase(console.next().charAt(0));\n \n \n //check to see if the user has guessed this letter before\n boolean freshGuess = true;\n for(int index = 0; index < guesses.length(); index++) {\n System.out.println(\"Guesses[i] = \" + guesses.charAt(index) + \", Guess = \" + guess);\n if(guess == guesses.charAt(index)) { \n freshGuess = false;\n }\n }\n \n //if the guess is fresh, check if it is correct\n boolean correctGuess = false;\n if(freshGuess) {\n \n for(int index = 0; index < word.length(); index++) {\n if(guess == word.charAt(index)) { \n letters[index] = true;\n correctGuess = true;\n }\n }\n \n if(correctGuess) {\n System.out.println(\"Good guess! The word is:\");\n gameOver = !printGuess(letters, word);\n }\n \n else{\n System.out.println(\"Oops! Letter \" + guess + \" is not there. Adding to hangman... \");\n draw(wrongGuesses, pen);\n wrongGuesses++;\n if(wrongGuesses == 6) { gameOver = true; }\n }\n \n guesses += guess;\n }\n \n //report repeated guess\n else { \n System.out.println(\"You have already guessed \" + guess + \".\");\n }\n \n \n }\n \n //The game is over\n System.out.println(\"Game Over!\");\n \n }", "public void playGame(){\n do{\n int userGuess = getUserGuess();\n user.getUserGuesses().add(userGuess); // adds guess to user's arraylist\n isWinner(userGuess, chosenNumber);\n }while(!wonGame);\n }", "public static void main(String[] args) throws IOException{\n\t\tScanner sc = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.println(\"Welcome to Hangman! If you guess wrong 6 times, then I win\");\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\t\r\n\t\tboolean wannaPlay = true;\r\n\t\t\r\n\t\twhile(wannaPlay){\r\n\t\t\t//keep playing\r\n\t\t\tSystem.out.println(\"Alright: Let's play!\");\r\n\t\t\t\r\n\t\t\tHangman game = new Hangman();\r\n\t//\t\tRandom ran = new Random();\r\n\t//\t\tint hintIndex = Math.abs(ran.nextInt() % game.mysteryWord.length());\r\n\t\t\tdo{\r\n\t\t\t\t//Draw the things...\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tSystem.out.println(game.drawPicture());\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tSystem.out.println(game.getFormalCurrentGuess());\r\n\t\t\t//\tSystem.out.println(\"hint is : \" + game.mysteryWord.charAt(hintIndex));\r\n\t\t\t\t\r\n\t\t\t\t// Get the guess\r\n\t\t\t\tSystem.out.println(\"Enter a character that in the word\");\r\n\t\t\t\tchar guess = (sc.next().toLowerCase().charAt(0));\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\t\r\n\t\t\t\tif(game.isGuessAlready(guess)){\r\n\t\t\t\t\tSystem.out.println(\"Try again! you've already guessed that character.\");\r\n\t\t\t\t\tguess = sc.next().toLowerCase().charAt(0);\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(game.playGuess(guess)){\r\n\t\t\t\t\tSystem.out.println(\"Great guess. \\n\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"Unfortunately. \\n\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\twhile(!game.gameOver());\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\tSystem.out.println();\r\n\t\t\tSystem.out.println(\"Press 'Y' if you wanna play agian\");\r\n\t\t\tCharacter response = (sc.next().toUpperCase().charAt(0));\r\n\t\t\t\r\n\t\t\twannaPlay = (response == 'Y');\r\n\t\t\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tSystem.out.println(\"Welcome to the very generic game of...Guess the Number!\");\r\n\t\t\r\n\t\tScanner difficultyChoice = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.println(\"Select parameters below. 1 = 1-15, 2 = 1-25, and 3 = 1-50\");\r\n\t\t\r\n\t\tString choice = difficultyChoice.nextLine();\r\n\t\t\r\n\t\tint selection = 0;\r\n\t\t\r\n\t\tdo {\r\n\t\t\tif(choice.equals(\"1\")){\r\n\t\t\t\tselection = 1;\r\n\r\n\t\t\t} else if(choice.equals(\"2\")) {\r\n\t\t\t\tselection = 2;\r\n\r\n\t\t\t} else if(choice.equals(\"3\")) {\r\n\t\t\t\tselection = 3;\r\n\t\t\t}\r\n\t\t\tif(selection == 0) {\r\n\t\t\t\tSystem.out.println(\"Invalid entry. Please try again. Remember* 1 for 1-25, 2 for 1-50, and 3 for 1-100\");\r\n\t\t\t\tchoice = difficultyChoice.nextLine();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t} while(selection ==0);\r\n\t\t\r\n\t\tRandom computerNumber = new Random();\r\n\r\n\t\tint randomNum = 0;\r\n\r\n\t\tif(selection == 1){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(15);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-15. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif(selection == 2){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(25);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-25. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif(selection == 3){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(50);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-50. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint guessTotal = 0;\r\n\r\n\t\tRandom RandomNum = computerNumber; \r\n\r\n\t\tScanner playerGuess1 = new Scanner(System.in);\r\n\r\n\t\tSystem.out.println(\"Please enter your first guess on the line below: \");\r\n\r\n\t\tint guess1 = playerGuess1.nextInt();\r\n\r\n\t\tif(guess1 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your first try!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\t\r\n\t\tif(guess1 != randomNum) {\r\n\t\t\tguessTotal = 1;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 2)\");\r\n\t\t\tif(guess1 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t}else\r\n\t\t\t{\r\n\t\t\t\tif(guess1 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tScanner playerGuess2 = new Scanner(System.in);\r\n\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\t\t\t\");\r\n\r\n\t\tSystem.out.println(\"Please enter your second guess on the line below: \");\r\n\r\n\t\tint guess2 = playerGuess2.nextInt();\r\n\r\n\t\tif(guess2 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your second try!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tif(guess2 != randomNum) {\r\n\t\t\tguessTotal = 2;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 1)\");\r\n\t\t\tif(guess2 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t} else {\r\n\t\t\t\tif(guess2 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tScanner playerGuess3 = new Scanner(System.in);\r\n\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\t\t\t\");\r\n\r\n\t\tSystem.out.println(\"Please enter your third guess on the line below: \");\r\n\r\n\t\tint guess3 = playerGuess3.nextInt();\r\n\r\n\t\tif(guess3 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your third try!\");\r\n\t\t}\r\n\r\n\t\tif(guess3 != randomNum) {\r\n\t\t\tguessTotal = 3;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 0) Game over!\");\r\n\t\t\t/*if(guess3 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t} else {\r\n\t\t\t\tif(guess3 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\");\r\n\t\t\tSystem.out.println(\"The correct number was \" + randomNum);\r\n\t\t}", "public void onButtonClicked(){\n\t\t\n\t\t//Gets the guess from text box \n\t\tString guess = AnswerBox.getText();\n\t\t//converts string to lower case\n\t\tguess = guess.toLowerCase();\n\t\t//protects against empty textbox, long strings, and non alphabet characters\n\t\tif (guess != \"\" && guess.length() == 1 && guess.charAt(0) >='a' && guess.charAt(0) <= 'z')\n\t\t{\n\t\t\t//convert String to char\n\t\t\tchar myGuess = guess.charAt(0);\n\t\t\t//test to see if letter is in secretWord\n\t\t\tif(guessIsRight(mysteryWord,myGuess)){ \n\t\t\t\n\t\t\t\t//change _ to letter if player made correct guess\n\t\t\t\tupdateWordState(mysteryWord,myGuess); \n\n\t\t\t\tif (wordState.compareTo(mysteryWord)==0) {\n\t\t\t\t\tGameWin();} \n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//update hangman picture \n\t\t\t\t//make part of hangmanPicture visible if player made incorrect guess\n\t\t\t\t\n\t\t\t\t// add missed letters to incorrect letters bank\n\t\t\t\taddLettersGuessed(myGuess); \n\t\t\t\t\n\t\t\t\tnumGuesses--;\n\t\t\t\tmakeVisible(numGuesses);\n\t\t\t}\n\t\t\t\n\t\t\tAnswerBox.requestFocus(); // set focus on textbox \n\t\t}\n\t\telse\n\t\t{\n\t\t\t// print a message if the user didn't write a letter\n\t\t\tAnswerBox.setText(\"Your guess must be a single letter\");\n\t\t\tAnswerBox.requestFocus(); \n\t\t}\n\t}", "public boolean alreadyGuessed(char guess) {\r\n return this.guesses.contains(guess);\r\n }", "public void guessLetter(String letter) {\n \n if (this.word.contains(letter)) {\n if (!this.guessedLetters.contains(letter)) {\n this.guessedLetters += letter;\n } // if the letter has already been guessed, nothing happens\n }else {\n // it the word does not contains the guessed letter, number of faults increase\n if (!this.guessedLetters.contains(letter)) {\n this.guessedLetters += letter;\n this.numberOfFaults++;\n } \n }\n\n \n\n\n }", "protected boolean checkGuess(Hangman game, String input) {\n if ((input != null) && (input.length() > 0)) {\n input = input.trim();\n if (input.equals(Server.GAME_STOP)) {\n cleanUp();\n } else if (input.length() == 1) {\n char c = input.charAt(0);\n game.guess(c);\n return true;\n }\n }\n return false;\n }", "public static void main(String[] args){\n \n //\"Declaring\" local variables for use later in the method.\n String firstName, lastName;\n int goalNumber, userGuess, countGuesses, ranNum;\n int triangleHeight;\n Scanner keyboardReader = new Scanner(System.in);\n \n //Get the user's name.\n System.out.print(\"Enter your first and last name: \");\n firstName = keyboardReader.next();\n lastName = keyboardReader.next();\n \n //Display a marquee with a personalized greeting.\n drawBorder(40, '*');\n printWelcome(firstName, lastName);\n drawBorder(40, '*');\n \n //Explain the game.\n printGameIntro(firstName);\n \n //Set up the game.\n goalNumber = (int)(1 + 20 * Math.random());\n countGuesses = 1;\n \n //Get the first guess.\n drawBorder(40, '*');\n System.out.print(\"Enter guess #\" + countGuesses + \": \");\n userGuess = keyboardReader.nextInt();\n \n //Loop until the user correctly guesses.\n while(userGuess != goalNumber){\n \n //Give advice to the user.\n if(userGuess < goalNumber){\n System.out.println(\"Too low. Guess higher.\");\n }\n else{\n System.out.println(\"Too high. Guess lower.\");\n }\n \n countGuesses = countGuesses + 1;\n \n System.out.print(\"Enter guess #\" + countGuesses + \": \");\n userGuess = keyboardReader.nextInt();\n \n } //end of while loop.\n \n //User wins if it takes fewer than 5 guesses.\n if(countGuesses < 5){\n System.out.print(\"Congratulations \" + firstName + \", \");\n System.out.println(\"you got it in \" + countGuesses + \" tries.\");\n System.out.println(\"You are a good guesser.\");\n }\n else{\n System.out.print(\"OK \" + firstName + \", \");\n System.out.println(\"you got it, but took 5 or more tries.\");\n }\n \n //Some artwork:\n drawBorder(40, '*');\n System.out.println(\"And now, we bring you a triangle of money!\");\n ranNum = (int)(1 + 10 * Math.random());\n triangleHeight = ranNum;\n \n //Display the triangle:\n for(int rowCount = 1; rowCount <= triangleHeight; rowCount++){\n drawBorder(rowCount, '$');\n }\n \n }", "private char playerGuess(){\r\n System.out.println(\"\\nEnter your guess: \");\r\n guess = input.next();\r\n if (guess.matches(\"[a-zA-z]*$\") && guess.length() == 1){\r\n if(guesses.contains(guess.charAt(0))){\r\n System.out.println(\"You already guessed this character!\");\r\n playerGuess();\r\n }\r\n return Character.toLowerCase(guess.charAt(0));\r\n } else {\r\n System.out.println(\"Invalid guess! Try again!\");\r\n playerGuess();\r\n }\r\n return Character.toLowerCase(guess.charAt(0));\r\n }", "public boolean hasWon() {\n\t\tfor (int i = 0; i < wordToGuess.length(); i++) {\n\t\t\tchar letter = wordToGuess.charAt(i);\n\t\t\tif (!guessesMade.contains(letter)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "abstract int nextTry(String guess);", "public char getUserGuessedLetter() {\n return userGuessedLetter;\n }", "public void makeGuess() {\n columnGuess = ((int) (Math.random() * 100000)) % 10;\n\n int number = ((int) (Math.random() * 100000)) % 10;\n rowGuess = (char) (number + 65);\n }", "private int userLoing() {\n\t\t\n\t\tScanner scan2 = new Scanner(System.in);\n\t\tSystem.out.println(\"\\nPour vous rappler, pour quitter il faut entrer q ou quit pour quitter \\navant de commencer de saisir de mot de passe.\\n\"+\n\t\t\t\t\n\t\t\t\t\"--------------------------------------------------------------------------------------\");\n\t\tboolean correct = true; //To check the confirmation of the password\n\t\t\n\t\t\n\t\t//to get the user's name\n\t\tString nom;\n\t\tdo {\n\t\t System.out.print(\"Entrez un nom d'une longueur qui > 4: \");\n\t\t nom = scan2.nextLine();\n\t\t} while ((nom.length() < 4) && !(nom.equalsIgnoreCase(\"q\")) && !(nom.equalsIgnoreCase(\"quit\")));\n\t\t\n\t\tif(nom.equalsIgnoreCase(\"q\") || nom.equalsIgnoreCase(\"quit\")) {\n\t\t\tSystem.out.println(\"\\n-----------------------------------------------------\\nVous avez été dérigé vers le meun principal!\\n-----------------------------------------------------\");\n\t\t\tcorrect = true;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t\n\t\t\t//for the password and the confirmation\n\t\t\t\n\t\t\twhile(correct) {\n\t\t\t\tint mdp;\n\t\t\t\tdo {\n\t\t\t\t System.out.print(\"Entrez un mot de passe qui contient au moins 6 chiffres SVP: \");\n\t\t\t\t while (!scan2.hasNextInt()) {\n\t\t\t\t\t System.err.print(\"Entrez un mot de passe qui contient au moins 6 chiffres SVP: \");\n\t\t\t\t scan2.next();\n\t\t\t\t }\n\t\t\t\t mdp = scan2.nextInt();\n\t\t\t\t} while (Integer.toString(mdp).length() < 6);\n\t\t\t\t\n\t\t\t\tint mdp2;\n\t\t\t\tdo {\n\t\t\t\t System.out.print(\"Confirmez vôtre mot de passe SVP : \");\n\t\t\t\t while (!scan2.hasNextInt()) {\n\t\t\t\t\t System.err.print(\"Confirmez vôtre mot de passe : \");\n\t\t\t\t scan2.next(); \n\t\t\t\t }\n\t\t\t\t mdp2 = scan2.nextInt();\n\t\t\t\t} while (Integer.toString(mdp2).length() < 6);\n\t\t\t\t\n\t\t\t\tcorrect = mdp == mdp2 ? false: true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tint res = !correct? 1 : 0;\n\t\treturn res;\n\t\t\n\t}", "public interface GuessChecker {\n\n int[] CheckGuess(char[] Ans, char[] Code);\n\n int[] CorrectAns();\n\n}", "public Integer guess(Integer g)\n {\n if (chosenNum == g){\n return 0;\n } else if (chosenNum > g){\n return -1;\n } else if (chosenNum < g){\n return 1;\n }\n return chosenNum;\n }", "public static void checkGuess(Player player, Dealer dealer) {\r\n final int POINTS_TO_ADD = 1; // Points to award winner\r\n String guess = player.getCheepGuess(); // Player's guess\r\n int choHanResult = dealer.getChoOrHan(); // Cho or Han\r\n\r\n \r\n // Display the player's guess.\r\n System.out.println(\"\\nThe player \" + player.getName() + \" rolled \" + player.diceResult() + \" = \" + player.getSum() + \".\");\r\n System.out.printf(\"The player %s guessed %s.\\n\",\r\n player.getName(), player.getGuess());\r\n \r\n // Award points if the player guessed correctly.\r\n if (guess.equalsIgnoreCase(\"high\")) {\r\n if (choHanResult < player.getSum()) {\r\n player.addPoints(POINTS_TO_ADD);\r\n System.out.printf(\"Awarding %d point(s) to %s.\\n\",\r\n POINTS_TO_ADD, player.getName());\r\n }\r\n else {\r\n System.out.println(\"No points were given to\" + player.getName() + \".\");\r\n }\r\n }\r\n if (guess.equalsIgnoreCase(\"low\")) {\r\n if (choHanResult >= player.getSum()) {\r\n player.addPoints(POINTS_TO_ADD);\r\n System.out.printf(\"Awarding %d point(s) to %s.\\n\",\r\n POINTS_TO_ADD, player.getName());\r\n } else {\r\n System.out.println(\"No points were given to\" + player.getName() + \".\");\r\n }\r\n }\r\n }", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\tchar input = e.getKeyChar();\n\t\tString newAnswer = \"\";\n\t\tboolean correct = false;\n\t\t//Text = answer;\n\t\tif(lives > 0) {\n\t\tfor(int a = 0; a < answer.length(); a++) {\n\t\t\tif(answer.charAt(a) == input) {\n\t\t\t\t//System.out.println(answer.toCharArray()[a]);\n\t\t\t\t//Text.toCharArray()[a] = answer.charAt(a);\n\t\t\t\tnewAnswer += input;\n\t\t\t\tcorrect = true;\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewAnswer += Text.charAt(a);\n\t\t\t\t\n\t\t\t}\n\t\t\t if(Text.charAt(a) != '-') {\n\t\t\t\t correctCharacters++;\n\t\t\t\t System.out.println(correctCharacters + \" correct characters\");\n\t\t\t\t System.out.println(length.length());\n\t\t\t\t \tif(correctCharacters > length.length() + 2) {\n\t\t\t\t \tframe.dispose();\n\t\t\t\t\tstack.clear();\n\t\t\t\t\tint reset = JOptionPane.showConfirmDialog(null, \"Congratulations! You guessed all your words! Play again?\");\n\t\t\t\t\tif(reset == 0) {\n\t\t\t\t\t\tRun();\n\t\t\t\t\t\ttext.setText(Text);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t \telse if (lives <= 0) {\n\t\t\t\t \t\tframe.dispose();\n\t\t\t\t\t\tstack.clear();\n\t\t\t\t\t\tint reset = JOptionPane.showConfirmDialog(null, \"Game Over! Play again?\");\n\t\t\t\t\t\tif(reset == 0) {\n\t\t\t\t\t\t\tRun();\n\t\t\t\t\t\t\ttext.setText(Text);\n\t\t\t\t\t\t}\n\t\t\t\t \t}\n\t\t\t }\n\t\t}\n\t\tif(correct == false) {\n\t\t\tlives--;\n\t\t}\n\t\tText = newAnswer;\n\t\ttext.setText(Text);\n\t\tlifeDisplay.setText(\"Lives: \" + lives);\n\t\tcorrect = false;\n\t\t\n\t}\n\t\t\n\t\telse {\n\t\t\tframe.dispose();\n\t\t\tstack.clear();\n\t\t\tint reset = JOptionPane.showConfirmDialog(null, \"Game Over! Play again?\");\n\t\t\tif(reset == 0) {\n\t\t\t\tRun();\n\t\t\t}\n\t\t}\n\t}", "public void noteIncorrectGuess(char letter) {\n\t\tupdateIncorrectList(letter);\n\t\tswitch (incorrectGuess.length()) {\n\t\t\tcase 1: \n\t\t\t\tdrawHead();\n\t\t\t\tbreak;\n\t\t\tcase 2: \n\t\t\t\tdrawBody();\n\t\t\t\tbreak;\t\n\t\t\tcase 3: \n\t\t\t\tdrawLeftArm();\n\t\t\t\tbreak;\t\n\t\t\tcase 4: \n\t\t\t\tdrawRightArm();\n\t\t\t\tbreak;\t\n\t\t\tcase 5: \n\t\t\t\tdrawLeftLeg();\n\t\t\t\tbreak;\t\n\t\t\tcase 6: \n\t\t\t\tdrawRightLeg();\n\t\t\t\tbreak;\t\n\t\t\tcase 7: \n\t\t\t\tdrawLeftFoot();\n\t\t\t\tbreak;\t\n\t\t\tcase 8: \n\t\t\t\tdrawRightFoot();\n\t\t\t\tbreak;\t\n\t\t\tdefault: throw new ErrorException(\"getWord: Illegal index\");\n\t\t}\n\t}", "private static int coinFlip() {\n\t\tint num = (Math.random() <= 0.5) ? 1 : 2; \n\t\tString answer;\n\t\tif ( num == 1) {\n\t\t\tanswer = \"h\";\n\t\t}else {\n\t\t\tanswer = \"t\";\n\t\t}\n\t\t\n\t\t\n\t\tScanner input = new Scanner(System.in);\n\t\t\n System.out.print(\"Enter you guess (h = heads, t = tails):\");\n String guess = input.next();\n //change the guess to lower case to accept both capital or lower case answer\n guess.toLowerCase();\n \n //gain 50 points if win the toss\n if ( guess.equals(answer)) {\n \t//System.out.println(\"You won the toss, congratulation! +50 points\");\n \treturn 50;\n }else {\n \t //System.out.println(\"Wrong guess! 0 points\");\n \t return 0;\n }\n \n\t}", "public void checkUserGuess(String inputGuess){\n numGuesses++;\n // Set the result to You Miss,\n String result = \"You Miss!\";\n // Loop and check for occurence in any of the three dot coms.\n for(DotCom dotComToTest : dotComList){\n // Checking the user input versus each dotCom.\n String temp = dotComToTest.checkGuess(inputGuess);\n if(temp.equals(\"You Hit!\")){\n result = temp;\n break;\n }\n \n if(temp.equals(\"You Kill!\")){\n result = temp + \" DotCom Sunk : \" + dotComToTest.getName();\n dotComList.remove(dotComToTest);\n break;\n } \n }\n \n //Printing out the result\n System.out.println(result);\n \n }", "public int getLastGuess() {\n\t\treturn lastGuess;\n\t}", "public void kek() {\r\n System.out.println(\"answer\" + answer);\r\n checkColors = getColorPinValues(answer, guess);\r\n checkPosition = getPositionPinValues(answer,guess);\r\n change(checkColors, checkPosition);\r\n\r\n }", "public static void startGame(Scanner console){\r\n // 1. generate new game ans the random number\r\n GuessFourDigits guess = new GuessFourDigits(4);\r\n \r\n System.out.println(\"Welcome to GuessDigits\"); \r\n System.out.println(\"-----------------------------------------\");\r\n System.out.println(\"guess the right sequence of digits in \"+guess.NUMBER_LENGTH+ \"digits number.\");\r\n System.out.println(\"with each try there will be tipp about result\");\r\n System.out.println(\"-----------------------------------------\");\r\n \r\n // declaring and initialization of loop flag\r\n boolean tipp = false;\r\n \r\n //counter of tries\r\n int counterTry = 0;\r\n \r\n do{\r\n // 2. asking User to guess\r\n System.out.println(\"Your guess: \");\r\n String usersNumber = UserInput.askUserToInsert(console);\r\n \r\n // 2a. check validity of inserted number\r\n if(!guess.validityCheckOfNumber(usersNumber)){\r\n System.out.println(\" inserted number is not valid+\\n\"\r\n + \" a 4 digit positive number, no digit repeated.\");\r\n continue;\r\n }\r\n \r\n // if inserted nummer valid, tipp counter goes up\r\n counterTry++;\r\n \r\n // 3. comparing numbers\r\n int[] comparingNum = guess.compareTheNumbers(usersNumber);\r\n \r\n // 4. giving tipps and congratulating user\r\n if(comparingNum[0] == guess.NUMBER_LENGTH){\r\n //user wins\r\n System.out.println(\"Congrats, you reach \"+usersNumber+\" in \"\r\n + counterTry+ \" tries.\\n\");\r\n tipp = true;\r\n }else{\r\n // tipp to user\r\n System.out.println(\"right number at right position: \"\r\n +comparingNum[0]+ \" right number at wrong position: \"\r\n + comparingNum[1]+ \"\\n\");\r\n }\r\n \r\n \r\n \r\n }while(!tipp);\r\n \r\n }", "public void handleAction (Graphics g){\r\n\t\t\t//checks mouse location\r\n\t\t\tif ((x >= 311 && x <= 461) && (y >= 104 && y <= 254)){\r\n\t\t\t\tcodeguess += \"1\";\r\n\t\t\t\tdrawOne(g);\r\n\t\t\t}\r\n\t\t\telse if ((x >= 152 && x <= 301) && (y >= 104 && y <= 254)){\r\n\t\t\t\tcodeguess += \"2\";\r\n\t\t\t\tdrawTwo(g);\r\n\t\t\t}\r\n\t\t\telse if ((x >= 152 && x <= 301) && (y >= 263 && y <= 412)){\r\n\t\t\t\tcodeguess += \"3\";\r\n\t\t\t\tdrawThree(g);\r\n\t\t\t}\r\n\t\t\telse if ((x >= 311 && x <= 461) && (y >= 263 && y <= 412)){\r\n\t\t\t\tcodeguess += \"4\";\r\n\t\t\t\tdrawFour(g);\r\n\t\t\t}\r\n\t\t\r\n\t\tSystem.out.println (\"guess = \" + codeguess);\r\n\t\t//level up check: compares code to user's guess\r\n\t\tString codeTemp = \"\";\r\n\t\tif (codeguess.length() == counter){\r\n\t\t\tfor (int i = 0; i < counter ; i++){\r\n\t\t\t\tcodeTemp += code.charAt(i);\t\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println (counter + \"****\"+codeTemp);\r\n\t\t\tif (codeguess.length() == 10 && codeguess.equals(code)){\r\n\t\t\t\tscreen = 5;\r\n\t\t\t\tscore ++;\r\n\t\t\t\tcountHighest(score);\r\n\t\t\t\tcodeguess = \"\";\r\n\t\t\t\tcodeTemp = \"\";\r\n\t\t\t\tcode = \"\";\r\n\t\t\t\twinner.play();\r\n\t\t\t}\r\n\t\t\telse if(codeguess.equals(codeTemp)){ \r\n\t\t\t\tcodeTemp = \"\";\r\n\t\t\t\tcodeguess = \"\";\r\n\t\t\t\tcounter++;\r\n\t\t\t\tscore++;\r\n\t\t\t\tcountHighest(score);\r\n\t\t\t\tdisplay = true;\r\n\t\t\t\tdelay(1000);\r\n\t\t\t\tlevelup.play();\r\n\t\t\t\tanimateButtons();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tSystem.out.println(\"GAME OVER\");\r\n\t\t\t\tscreen = 4;\r\n\t\t\t\tcodeguess = \"\";\r\n\t\t\t\tcodeTemp = \"\";\r\n\t\t\t\tcode = \"\";\r\n\t\t\t\tgameover.play();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\trepaint();\r\n\r\n\t}", "public void Enter() {\n\t\tEndTimer();\n\t\tif (Question >= 10) {\n\n\t\t\tSystem.out.println(\"This is Game\" + Score);\n\t\t\tIntent TheScore = new Intent(this, Score.class).putExtra(\"Score\",\n\t\t\t\t\tInteger.toString(Score));\n\t\t\tEndTimer();\n\t\t\tstartActivity(TheScore);\n\t\t\tfinish();\n\t\t} else {\n\n\t\t\tEditText editText22 = (EditText) findViewById(R.id.editText1);\n\t\t\tInteger Guess = 0;\n\t\t\ttry {\n\t\t\t\tGuess = Integer.parseInt(editText22.getText().toString());\n\t\t\t} catch (NumberFormatException nfe) {\n\t\t\t}\n\n\t\t\tTextView CorrectOrNot = (TextView) findViewById(R.id.textView1);\n\t\t\t/*\n\t\t\t * If the Hints is on it will allow the user to try each question 4\n\t\t\t * times. Below checks if the Hints is on or off.\n\t\t\t */\n\t\t\tif (Prefs.getHints(this)) {\n\t\t\t\tif (Answer == Guess) {\n\t\t\t\t\tCorrectOrNot.setTextColor(Color.GREEN);\n\t\t\t\t\tCorrectOrNot.setText(\"Correct\");\n\t\t\t\t\tCorrect++;\n\t\t\t\t\t/*\n\t\t\t\t\t * The score is worked out by 100 divided by 10 take away\n\t\t\t\t\t * from how much time was left.\n\t\t\t\t\t */\n\t\t\t\t\tScore = Score + 100 / (10 - TimeLeft);\n\t\t\t\t\tQuestion++;\n\t\t\t\t\treset();\n\t\t\t\t\t/*\n\t\t\t\t\t * Should the user enter the wrong answer it will allow them\n\t\t\t\t\t * to retry as well as tell them if the answer they entered\n\t\t\t\t\t * is greater or less then the actual answer.\n\t\t\t\t\t */\n\t\t\t\t} else if (Tries < 4) {\n\t\t\t\t\tif (Guess > Answer) {\n\t\t\t\t\t\tCorrectOrNot.setTextColor(Color.MAGENTA);\n\t\t\t\t\t\tCorrectOrNot.setText(\"Greater\");\n\t\t\t\t\t\tTries = Tries + 1;\n\t\t\t\t\t\tEndTimer();\n\t\t\t\t\t\tStartTimer();\n\n\t\t\t\t\t}\n\t\t\t\t\tif (Guess < Answer) {\n\t\t\t\t\t\tCorrectOrNot.setTextColor(Color.MAGENTA);\n\t\t\t\t\t\tCorrectOrNot.setText(\"less\");\n\t\t\t\t\t\tTries = Tries + 1;\n\t\t\t\t\t\tEndTimer();\n\t\t\t\t\t\tStartTimer();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\t * Once the 4 tries is over, it will check if the last answer is\n\t\t\t\t * correct or not and act accordingly\n\t\t\t\t */\n\t\t\t\tif (Tries >= 4) {\n\t\t\t\t\tif (Answer == Guess) {\n\t\t\t\t\t\tCorrectOrNot.setTextColor(Color.GREEN);\n\t\t\t\t\t\tCorrectOrNot.setText(\"Correct\");\n\t\t\t\t\t\tCorrect++;\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * The score is worked out by 100 divided by 10 take\n\t\t\t\t\t\t * away from how much time was left.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tScore = Score + 100 / (10 - TimeLeft);\n\t\t\t\t\t\tQuestion++;\n\t\t\t\t\t\treset();\n\t\t\t\t\t} else if (Answer != Guess) {\n\t\t\t\t\t\tQuestion++;\n\t\t\t\t\t\tCorrectOrNot.setTextColor(Color.RED);\n\t\t\t\t\t\tCorrectOrNot.setText(\"Incorrect\");\n\t\t\t\t\t\tTries = 0;\n\t\t\t\t\t\treset();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tif (Answer == Guess) {\n\t\t\t\t\tCorrectOrNot.setTextColor(Color.GREEN);\n\t\t\t\t\tCorrectOrNot.setText(\"Correct\");\n\t\t\t\t\tCorrect++;\n\t\t\t\t\t/*\n\t\t\t\t\t * The score is worked out by 100 divided by 10 take away\n\t\t\t\t\t * from how much time was left.\n\t\t\t\t\t */\n\t\t\t\t\tScore = Score + 100 / (10 - TimeLeft);\n\t\t\t\t\tSystem.out.println(Score);\n\t\t\t\t\tQuestion++;\n\t\t\t\t\tSystem.out.println(\"Correct \" + Correct);\n\t\t\t\t\treset();\n\t\t\t\t} else {\n\t\t\t\t\tQuestion++;\n\t\t\t\t\tCorrectOrNot.setTextColor(Color.RED);\n\t\t\t\t\tCorrectOrNot.setText(\"Incorrect\");\n\t\t\t\t\treset();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public static boolean isCorrectGuess(char[] word, char[] blanks, char guess) {\n\t\tboolean correct = false;\n\t\tint message = 2;\n\t\tfor (int i = 0; i < word.length; i++) {\n\t\t\tif (word[i] == guess) {\n\t\t\t\tcorrect = true;\n\t\t\t\tif (blanks[i] == guess){\n\t\t\t\t\tmessage = 1;\n\t\t\t\t}\n\t\t\t\telse { \n\t\t\t\t\tblanks[i] = guess; // the actual letter is then displayed.\n\t\t\t\t\tmessage = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (message > 0){\n\t\t\tprint(message, guess); // Call print message for incorrect\n\t\t}\n\t\treturn correct;\n\t}", "public boolean hasAllGuesses(DIVAServletRequestWrapper req){\n\t\treturn \t!StringUtils.isBlank(req.getParameter(RNGChallenge.GIVEN_FIRST)) ||\n\t\t\t\t!StringUtils.isBlank(req.getParameter(RNGChallenge.GIVEN_SECOND)) ||\n\t\t\t\t!StringUtils.isBlank(req.getParameter(RNGChallenge.GUESS_FIRST)) ||\n\t\t\t\t!StringUtils.isBlank(req.getParameter(RNGChallenge.GUESS_SECOND));\n\t}", "public void GameWin () {\n\t\t\n\t\twordDashes.setText(mysteryWord);\n\t\tguessBttn.setVisible(false);\n\t\tguessFullWord.setVisible(false);\n\t\tAnswerBox.setDisable(true); //can no longer use the text box\n\t\tresultMessage.setText(\" Great Job!!\\nYou Guessed the Word!!\");\n\t\tplayAgain.setVisible(true); \n\t\t\n\t}", "public String getGuessesMade() {\r\n return \"DEFAULT\";\r\n }", "public boolean getHasGuessed() {\n\t\treturn this.hasGuessed;\r\n\t}", "public void revealAnswer()\n\t{\n\t\t//check if game over\n\t\tif(hangmanGame.gameOver() == true){\n\t\t\t//if game over, get answer\n\t\t\tSystem.out.println( \"The word was: \" + hangmanGame.getAnswer());\n\t\t}\n\t\t//check if game won\n\t\tif(hangmanGame.gameWon() == true){\n\t\t\t//if game won, get answer and say \"You win!\"\n\t\t\tSystem.out.println( \"You win! The word was: \" + hangmanGame.getAnswer());\n\t\t}\n\t\t//check if game over and game lost\n\t\tif(hangmanGame.gameOver()==true && hangmanGame.gameWon()==false){\n\t\t\t//if game over and game lost, say \"Sorry, you lose.\"\n\t\t\tSystem.out.println( \"Sorry, you lose. The word was: \" + hangmanGame.getAnswer());\n\t\t}\n\t\t\n\t}", "public boolean guess(int number) {\n\t\tif (number == secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Correct! The secret is \"+secret+\"\\n\"+\"The count is \"+ count);\n\t\t\treturn true;\n\t\t} else if (number < secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Sorry, too small.\");\n\t\t} else if (number > secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Sorry, too large.\");\n\t\t}\n\t\treturn false;\n\t}", "private static void playGame()\n\t{\n\t\tScanner in = new Scanner(System.in);\n\t\tint userGuess = 0;\n\t\tint length = String.valueOf(userGuess).length();\n\t\tboolean play = true;\n\t\twhile (play)\n\t\t{\t\n\t\t\tint gameNumber = newNumber();\n\t\t\tString randomNumber = String.valueOf(gameNumber);\n\t\t\tSystem.out.println(\">>>MASTERMIND<<<\");\n\t\t\tSystem.out.println(\"Enter your guess of the 4 digit number!\");\n\t\t\tdo\n\t\t\t{\n\t\t\t\tuserGuess = in.nextInt();\n\t\t\t\tlength = String.valueOf(userGuess).length();\n\t\t\t\tif (length != 4)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Please enter a number with a length of 4 digits.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (length != 4);\n\t\t\tString userNumber = String.valueOf(userGuess);\n\t\t\tnumberTester(userNumber, randomNumber);\n\t\t\tSystem.out.printf(\"\\nCongratulations! You guessed the random number %d\\n\", gameNumber);\n\t\t\tSystem.out.println(\"Would you like to play again?\");\n\t\t\tSystem.out.println(\"1.) Yes\");\n\t\t\tSystem.out.println(\"2.) No\");\n\t\t\tif (in.nextInt() == 2)\n\t\t\t{\n\t\t\t\tplay = false;\n\t\t\t}\n\t\t}\n\t}", "boolean hasCorrect();" ]
[ "0.74639976", "0.71315116", "0.7121145", "0.687997", "0.68497896", "0.68485856", "0.68293846", "0.67784584", "0.6688906", "0.6687737", "0.66554457", "0.6621972", "0.65955746", "0.6453162", "0.6423444", "0.6415785", "0.64136237", "0.6370453", "0.6368998", "0.6361318", "0.6341367", "0.6337747", "0.629816", "0.6289599", "0.6285122", "0.6283278", "0.6236936", "0.6228924", "0.6188753", "0.61832", "0.61534566", "0.6147708", "0.61156857", "0.6105726", "0.61054516", "0.6104757", "0.61021173", "0.6090148", "0.60824794", "0.6074993", "0.6061493", "0.602875", "0.60257137", "0.6022156", "0.601885", "0.60110396", "0.6008023", "0.6004823", "0.60019356", "0.59933776", "0.5991833", "0.5987537", "0.5981279", "0.59786683", "0.5971357", "0.5964853", "0.5950752", "0.5945135", "0.59356207", "0.59287846", "0.59060824", "0.5902479", "0.58982533", "0.58972764", "0.5884188", "0.5873261", "0.58711493", "0.5866216", "0.5865487", "0.5864463", "0.58620393", "0.5861697", "0.5861645", "0.5858009", "0.5855111", "0.58529145", "0.58508104", "0.5843338", "0.5841763", "0.58336407", "0.5827279", "0.5817542", "0.58117014", "0.58104926", "0.5808865", "0.580101", "0.57829255", "0.5782027", "0.5763518", "0.5759486", "0.5744734", "0.5742141", "0.5732508", "0.5730938", "0.57251865", "0.5724158", "0.57218105", "0.57183874", "0.57119733", "0.5709781" ]
0.7181993
1
what happens when the User makes an incorrect guess
public void wrongGuess() { System.out.println("Sorry, your guess is wrong"); if(userRanPan.getValue() == -1) newGame.getUserHand().addDash(true,userRanPan); else newGame.getUserHand().addPanel(userRanPan,true); if(userWon() == false) compTurn(false); else if(userWon()) { System.out.println(PLAYER_WIN); System.exit(0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void checkGuess() {\n\t\tString guessText = txtGuess.getText();\n\t\tString message = \"\";\n\t\t\n\t\t\n\t\ttry {\n\n\t\t\t//check users guess too high/too low\n\t\t\tint guess = Integer.parseInt(guessText);\n\t\t\t\n\t\t\tif ( guess < 0 || guess > 100) {\n\t\t\t\tthrow new Exception(\"User entry out of range\");\n\t\t\t}//if\n\n\t\t\t//too high\n\t\t\tif(guess > theNumber){\n\t\t\t\tmessage = guess + \" is to high guess again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t}//if\n\t\t\t//too low\n\t\t\telse if (guess < theNumber){\n\t\t\t\tmessage = guess + \" is to low guess again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t}else{//guessed correct\n\t\t\t\tmessage = guess + \" was right! You win! Let's play again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t\tnewGame();\n\t\t\t}//else\n\t\t}//try\n\t\tcatch(Exception e) {\n\t\t\tlblOutput.setText(\"Enter a whole number between 1-100\"); \n\t\t}//catch\n\t\tfinally {\n\t\t\t\n\t\t\ttxtGuess.requestFocus();\n\t\t\ttxtGuess.selectAll();\n\t\t\t\n\t\t}//finally\n\t}", "public void checkGuess() {\n\t\tString guessText = txtInput.getText();\r\n\t\tString message = \"\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\t// check the guess for too high/too low\r\n\t\t\tint guess = Integer.parseInt(guessText);\r\n\t\t\t//too high\r\n\t\t\tif (guess > theNumber) {\r\n\t\t\t\tmessage = guess + \" was too high. Try again.\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnumberOfPlayerGuesses += 1;\r\n\t\t\t} else if (guess < theNumber) {\r\n\t\t\t\tmessage = guess + \" was too low. Try again.\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnumberOfPlayerGuesses += 1;\r\n\t\t\t} else {\r\n\t\t\t\tmessage = guess + \" was right! You used \" + numberOfPlayerGuesses + \" guesses. Let's play again!\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnewGame();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\tlblDirections2Result.setText(\"Enter a whole number between 1 and 100.\");\r\n\t\t}\r\n\t\t\r\n\t\ttxtInput.requestFocus();\r\n\t\ttxtInput.selectAll();\r\n\t\t\r\n\t\t\r\n\t}", "private void tryGuess(int guess) {\n int guessAssert = guesser.assertGuess(guess);\n switch (guessAssert) {\n case 0:\n guesser.madeGuess();\n System.out.println(\"Too low. Guess again: \");\n break;\n case 1:\n guesser.madeGuess();\n System.out.println(\"Too high. Guess again: \");\n break;\n case 2:\n guesser.madeGuess();\n System.out.println(\"You got it in \"+guesser.getGuess()+\" guesses!\");\n break;\n default:\n guesser.madeGuess();\n System.out.println(\"Invalid numeric value has been entered.\");\n break;\n }\n\n }", "public void printWrongGuess() {\r\n\t\t\r\n\t\tSystem.out.print(\"Wrong Guesses: \" + wrongGuess + \"\\n\");\r\n\t}", "public abstract boolean isGuessCorrect(String guess);", "public abstract boolean guess(String guess);", "public void rightGuess()\r\n\t{\r\n\t\tif(userWon())\r\n\t\t{\r\n\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"good job! you've correctly guessed the panel \\n would you like to guess again? if so enter yes, if you would like to add your tile to your code, reply no\\n\\n\");\r\n\t\tString answer = sc.next();\r\n\t\tif(answer.compareTo(\"yes\") == 0 || answer.compareTo(\"Yes\") == 0)\r\n\t\t{\r\n\t\t\tuserTurn(false);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(userRanPan.getValue() == -1)\r\n\t\t\t\tnewGame.getUserHand().addDash(false,userRanPan);\r\n\t\t\telse\r\n\t\t\t\tnewGame.getUserHand().addPanel(userRanPan,false);\r\n\r\n\t\t\tuserGuess.clear();\r\n\t\t\tslide(previousGuess,userRanPan);\r\n\r\n\t\t\tif(userWon() == false)\r\n\t\t\t\tcompTurn(false);\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//foo.repaint();\r\n\t}", "public void correctGuess(String s){\n\t\t \tif(rightAnswer==s){\n\t\t \t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\tGamesCommon.displayEndGame(GameStatus.Won, this,p);\n\t\t\t\t\t \n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t \t}else{\n\t\t \t\ttry {\n\t\t \t\t\tGamesCommon.displayEndGame(GameStatus.Lost, this,p);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t \t}\n\t }", "public void noteIncorrectGuess(char letter) {\n\t\taddToWrongLetters(letter);\n\t\tdisplayWrongLetters();\n\t\taddNextBodyPart(wrongLetters.length());\n\t\t\n\t}", "private String readGuess() {\n\t\tString unsafeGuess = readLine(\"Your Guess: \").trim().toUpperCase();\n\t\tif (!unsafeGuess.matches(\"[a-zA-z]\") || unsafeGuess.length() != 1) {\n\t\t\tprintln(\"Please enter a single letter.\");\n\t\t\treturn readGuess();\n\t\t} else {\n\t\t\treturn unsafeGuess.toUpperCase();\n\t\t}\n\t}", "public static void hitWrong()\n\t{\n\t\troundEnd();\n\t\tlblUpdate.setText(\"You have answer incorrectly. You lose.\");\n\t}", "public void noteIncorrectGuess(char letter) {\n\t\tguesses += letter;\n\t\tguessesLabel.setLabel(guesses);\n\t\tguessesLabel.setLocation((getWidth() - guessesLabel.getWidth()) / 2, wordLabel.getY() + wordLabel.getHeight()\n\t\t\t\t+ WORD_SPACING);\n\t\tif (guesses.length() == 1)\n\t\t\tbody.add(buildHead());\n\t\tif (guesses.length() == 2)\n\t\t\tbody.add(buildTorso());\n\t\tif (guesses.length() == 3)\n\t\t\tbody.add(buildLeftArm());\n\t\tif (guesses.length() == 4)\n\t\t\tbody.add(buildRightArm());\n\t\tif (guesses.length() == 5)\n\t\t\tbody.add(buildLeftLeg());\n\t\tif (guesses.length() == 6)\n\t\t\tbody.add(buildRightLeg());\n\t\tif (guesses.length() == 7)\n\t\t\tbody.add(buildLeftFoot());\n\t\tif (guesses.length() == 8)\n\t\t\tbody.add(buildRightFoot());\n\t}", "boolean checkGuess(String guess) {\r\n if (currWord.contains(guess)) { // correct guess\r\n numToGuess--;\r\n if (numToGuess <= 0) { // the word was guessed\r\n if (currWord.equals(animal))\r\n animalGuessed = true;\r\n if (currWord.equals(country))\r\n countryGuessed = true;\r\n if (currWord.equals(superhero))\r\n superheroGuessed = true;\r\n wordsCorrect++;\r\n if (wordsCorrect >= 3) {\r\n gameOver = true;\r\n win = true;\r\n }\r\n }\r\n return true;\r\n }\r\n else { // wrong guess\r\n guessesLeft--;\r\n if (guessesLeft <= 0) { // round lost\r\n chancesLeft--;\r\n if (chancesLeft <= 0) {\r\n gameOver = true;\r\n win = false;\r\n }\r\n }\r\n }\r\n return false;\r\n }", "public void guessSentence() {\n System.out.println(\"Please guess a letter in the secret word.\");\n }", "public boolean alreadyGuessed(char guess) {\r\n return false;\r\n }", "public void noteIncorrectGuess(char letter) \n\t{ \n\t choosePart(i);\n\t i++;\n\t wrong+=letter;\n\t wrongLabel.setLabel(wrong);\n\t add(wrongLabel);\n\t}", "public void noteIncorrectGuess(char letter) {\n\t\tupdateIncorrectList(letter);\n\t\tswitch (incorrectGuess.length()) {\n\t\t\tcase 1: \n\t\t\t\tdrawHead();\n\t\t\t\tbreak;\n\t\t\tcase 2: \n\t\t\t\tdrawBody();\n\t\t\t\tbreak;\t\n\t\t\tcase 3: \n\t\t\t\tdrawLeftArm();\n\t\t\t\tbreak;\t\n\t\t\tcase 4: \n\t\t\t\tdrawRightArm();\n\t\t\t\tbreak;\t\n\t\t\tcase 5: \n\t\t\t\tdrawLeftLeg();\n\t\t\t\tbreak;\t\n\t\t\tcase 6: \n\t\t\t\tdrawRightLeg();\n\t\t\t\tbreak;\t\n\t\t\tcase 7: \n\t\t\t\tdrawLeftFoot();\n\t\t\t\tbreak;\t\n\t\t\tcase 8: \n\t\t\t\tdrawRightFoot();\n\t\t\t\tbreak;\t\n\t\t\tdefault: throw new ErrorException(\"getWord: Illegal index\");\n\t\t}\n\t}", "public static void confirmGuess(String guess) {\n\n\t\t//for debug purposes\n\t\tSystem.out.println(\"User guess is \" + guess + \" and the correct answer is \" + globalColor);\n\n\t\t//userGuess equals globalColor\n\t\tif ((guess.toLowerCase()).equals(globalColor.toLowerCase())) {\n\t\t\t//notify the user that they have won\n\t\t\tJOptionPane.showMessageDialog(null, \"Your guess is correct!!!\");\n\t\t\t\n\t\t//userGuess does not equal globalColor\n\t\t} else {\n\t\t\t//notify the user that they have lost\n\t\t\tJOptionPane.showMessageDialog(null, \"Your guess is incorrect. Try again.\");\n\t\t}\n\t}", "private void tryGuess(char letter) {\n\t\tSystem.out.println(\"=============================\");\n\t\t// if the same guess has been done before, print corresponding information\n\t\tif (this.guessedLetters.contains(letter)){\n\t\t\tSystem.out.println(\"Letter already guessed, try another one.\");\n\t\t}else {\n\t\t\t// else, update the guessedLetters\n\t\t\tthis.guessedLetters.add(letter);\n\t\t\t// if the guess is correct\n\t\t\tif(this.word.takeGuess(letter)) {\n\t\t\t\t// print corresponding information\n\t\t\t\tSystem.out.println(\"Correct letter!\");\n\t\t\t}else {\n\t\t\t\t// else, add the letter to the wrongLetters list\n\t\t\t\tthis.wrongLetters.add(letter);\n\t\t\t\t// increase the count of wrong guesses\n\t\t\t\tthis.numOfWrongGuess ++;\n\t\t\t\t// print out the corresponding information\n\t\t\t\tSystem.out.println(\"Wrong letter, better luck next turn.\");\n\t\t\t}\n\t\t}\n\t}", "public void checkUserGuess(int userGuess, int randomNumber) {\n guessesLeft();\n if (userGuess == randomNumber) {\n gameFragmentLayout.setVisibility(View.VISIBLE);\n savehighscore();\n level++;\n hideKeybord();\n\n CorrectGameFragment correctGameFragment = new CorrectGameFragment();\n FragmentManager fragmentManager = getSupportFragmentManager();\n correctGameFragment.getCorrectFragInfo(this, level, levelMaxRange, guessesLeft);\n fragmentManager.beginTransaction()\n .replace(R.id.game_fragment, correctGameFragment)\n .commit();\n }\n }", "public void handleGuess(String s) {\n\n if (!word.contains(s)) {\n incorrectGuesses++;\n wrongList.add(s);\n if (incorrectGuesses == 8) {\n gameOver();\n }\n } else {\n correctList.add(s);\n updateWord(s.charAt(0));\n }\n }", "@Override\n public String getGuess() throws TimeoutException {\n\n int count = 1;\n\n while (this.answers.size() - count >0){\n if(this.answers.get(answers.size()-count).equals(\"yes\")) {\n\n return excuteQuery(this.getQuery(\"Guess\", \"Question=\" + \"'\" + this.questions.get(questions.size() -count) + \"'\"))\n .replaceAll(\"</br>\", \"\\n\");\n }\n count++;\n }\n\n return \"no result found\\n\";\n\n\n }", "@Override\n public void onIncorrect(String answer) {\n System.out.println(\"incorrect\");\n }", "abstract int nextTry(String guess);", "public void setGuess(Code guess) {\n this.guess = guess;\n }", "public static void main(String[] args){\n Scanner keyboard = new Scanner(System.in);\n //declare variables for the answer, user's guess, and number fo guesses\n int answer;\n int guess;\n int numOfGuess = 0;\n \n boolean done = false;\n answer = (int)(100*Math.random())+1;\n \n //print an introduction that tells the user how to play this game\n System.out.println(\"Hello user! I will generate a number between 1-100 inclusive and you will try to guess it! I will tell you if your answer is too low or too high after each incorrect guess!\");\n do \n {\n System.out.print(\"Please enter your guess:\");\n guess = keyboard.nextInt();\n if (guess > answer){\n System.out.println(\"Too high!\");\n }\n else if( guess < answer){\n System.out.println(\"Too low!\");\n }\n else{\n done = true;\n }\n numOfGuess += 1;\n } while (done == false);\n \n System.out.println(\"Congratulations! You're score is \" + numOfGuess);\n if (numOfGuess >= 20){\n System.out.println(\"Rating: You are terrible at this game!\");\n }\n else if (numOfGuess >= 10 && numOfGuess <=19){\n System.out.println(\"Rating: You need more practice!\");\n }\n else if (numOfGuess >= 5 && numOfGuess <= 9){\n System.out.println(\"Rating: Not too bad, But can you get it in fewer than 5 guesses?\");\n }\n else if (numOfGuess >= 2 && numOfGuess <= 4){\n System.out.println(\"Rating: AWESOME. You win a trip to Hawaii!\");\n }\n else{\n System.out.println(\"Rating: That was pure LUCK and you know it!\");\n }\n \n }", "public void guessName()\n\t{\n\t\tSystem.out.println(\"Who do you think it is?\");\n\t\tguessName = scan.nextLine();\n\t\tif(guessName.equals(name))\n\t\t{\n\t\t\tSystem.out.println(\"Congratulations, you are correct!\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"You are incorrect\");\n\t\t\tSystem.out.println(\"The correct answer was \" + name);\n\t\t}\n\t}", "public boolean guess(char letter)\n\t{\n\t\treturn false;\n\t}", "public void loseTheGame(int wrongLetters, boolean userGuessed) {\n if (wrongLetters == 10 && !userGuessed) { //checking if number of wrong trials reaches ten and users didn't guess the movie\n //displaying messages to the user with total number of wrong trials and the correct picked movie name\n getAllWrongLetters();\n System.out.println(\"You have guessed \" + wrongLetters + \" wrong letter(s):\" + allWrongLetters);\n System.out.println(\"Sorry you loose...You run out of points :(\");\n System.out.println(\"The movie is '\" + this.pickedMovie + \"'\");\n }\n\n }", "private void incorrectDialog() {\n // Update score.\n updateScore(scoreDecrease);\n\n // Show Dialog.\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"TRUMPED! This Tweet is \" + (realTweet ? \"real\" : \"fake\"));\n //builder.setPositiveButton(\"OK\", (dialog, which) -> chooseRandomTweet());\n builder.setOnDismissListener(unused -> chooseRandomTweet());\n AlertDialog dialog = builder.create();\n dialog.show();\n }", "public boolean guess(int number) {\n\t\tcount++;\n\t\tif (number == secret) {\n\t\t\tsetHint(String.format(\"Correct. The secret is %d. You used %d guesses.\", this.secret, this.count));\n\t\t\treturn true;\n\n\t\t} else if (number < secret) {\n\t\t\tsetHint(\"Sorry,your guess is too small\");\n\t\t} else {\n\t\t\tsetHint(\"Sorry,your guess is too large\");\n\t\t}\n\t\treturn false;\n\n\t}", "public char handleGuess(){\n\t\t\r\n\t\tSystem.out.print(\"Please enter a letter: \");\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tString s = sc.next();\r\n\t\tchar letter = s.charAt(0);\r\n\r\n\t\taa:for(int i=0; i<gameLetter.length; i++){\r\n\t\t\tif(letter == gameLetter[i]){\r\n\t\t\t\tcorrectList.add(letter);\r\n\t\t\t\t\r\n\t\t\t\tif(ifWrongListContain(letter)==true){\r\n\t\t\t\t\tfor(int b=0, length=wrongList.size(); b<length; b++){\r\n\t\t\t\t\t\tif(wrongList.get(b)==letter)\r\n\t\t\t\t wrongList.remove(b);\r\n\t\t\t\t length--;\r\n\t\t\t\t b--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak aa;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(ifWrongListContain(letter)==true)\r\n\t\t\t\t\tcontinue aa;\r\n\t\t\t\telse\r\n\t\t\t\t wrongList.add(letter);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\treturn letter;\t\t\r\n\t\t\t\t\r\n\t}", "public boolean guess(int number) {\n\t\tcountRound++;\n\t\tlastGuess = number;\n\t\t\n\t\tif(number == secret) {\n\t\t\tsetChanged();\n\t\t\tnotifyObservers(number);\n\t\t\tsetMessage(\"Wow! Correct!! I'm thinking of \"+secret+\".\");\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (number < secret && number >= 1) setMessage(\"Umm, \" + number + \" is too small.\");\n\t\telse if (number > secret && number <= this.upperBound) setMessage(\"Oh! \" + number + \" is too large.\");\n\t\telse setMessage(\"Oops! Please input a valid number!!\");\n\t\t\n\t\tsetChanged();\n\t\tnotifyObservers();\n\t\treturn false;\n\t}", "public void guessLetter(String letter) {\n \n if (this.word.contains(letter)) {\n if (!this.guessedLetters.contains(letter)) {\n this.guessedLetters += letter;\n } // if the letter has already been guessed, nothing happens\n }else {\n // it the word does not contains the guessed letter, number of faults increase\n if (!this.guessedLetters.contains(letter)) {\n this.guessedLetters += letter;\n this.numberOfFaults++;\n } \n }\n\n \n\n\n }", "private static String getValidGuess(BagelGame game) {\n Scanner scan = new Scanner(System.in);\n boolean valid = false;\n String guess = \"\";\n String error;\n \n while (!valid) {\n System.out.print(\"Guess # \" + game.getGuessNum() + \" ? \");\n guess = scan.nextLine().trim();\n error = game.validateGuess(guess);\n if (error == \"\") {\n valid = true;\n } else {\n System.out.println(error);\n }\n }\n return guess;\n }", "public void wrongAnswer() {\n if (quizGeneralState.checkAndPerformAction(QuizGeneralState.QuizAction.WRONG)) {\n quizStateChanger.wrongAnswerGiven();\n }\n }", "public void userMessageInput() {\n //declaring and initializing new userScanner variable\n Scanner userScanner = new Scanner(System.in);\n //displayed message to the user with the updating replacedMovie variable\n System.out.println(\"You are guessing :\" + this.replacedMovie);\n //displaying message with total number of wrong trials (guessed letters) to the user ,\n // together with the wrong guessed letter/s.\n getAllWrongLetters(); // calls method to dispaly the whole list of wrong guessed letters.\n System.out.println(\"You have guessed \" + this.wrongLettersCount + \" wrong letter(s): \" + allWrongLetters);\n //displaying a message asking the user to enter a guessed letter\n System.out.println(\"Guess a Letter\");\n //storing the entered letter in userEnteredLetter variable\n this.setUserGuessedLetter(userScanner.next().charAt(0));\n\n //return userEnteredLetter; // returning userEnteredLetter variable\n\n }", "java.lang.String getCorrectAnswer();", "public String guessingNumber(int randomNumber,int userNumber) {\n if(userNumber <= 0 || userNumber > 50)\n {\n return \"Enter number between 1 to 50\";\n }\n if(userNumber>randomNumber) {\n return \"guessed number is more than the original number\";\n } else if (userNumber < randomNumber) {\n return \"guessed number is less than the original number\";\n } else {\n return \"guessed matches the original number\";\n }\n }", "public String getIsguess() {\r\n return isguess;\r\n }", "public abstract void nextGuessResult(ResultPegs resultPegs);", "public IllegalGuessException(boolean dup)\n\t{\n\t\tif(dup)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, \"You have already guessed this code. Guess again.\", \"INVALID GUESS\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, \"Guess again.\", \"INVALID GUESS\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\t}", "public void failedChallenge() {\n addGameRound(false);\n playedRounds++;\n updateActivePlayer();\n updateActiveChallenge();\n }", "protected boolean guessAnswer(String answer) {\n if (answer.equals(correctAnswer)) {\n currentScore++;\n nextQuestion();\n return true;\n } else {\n nextQuestion();\n return false;\n }\n }", "public int getGuess() {\n\t\tif (accusation) {\n\t\t\tJOptionPane.showMessageDialog(parent, panel, \"Make an accusation:\", JOptionPane.PLAIN_MESSAGE);\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(parent, panel, \"Make a suggestion:\", JOptionPane.PLAIN_MESSAGE);\n\t\t}\n\t\treturn CluedoUI.asInt(characters.getSelectedItem().toString()) \n\t\t\t\t+ CluedoUI.asInt(weapons.getSelectedItem().toString())\n\t\t\t\t + CluedoUI.asInt(rooms.getSelectedItem().toString());\n\t}", "int getWrongAnswers();", "public static void userGuess() {\n\t\tSystem.out.println(\"It's time for you to guess. \");\n\t\tSystem.out.print(\"The computer will pick 4 numbers, each from 1 to 6: (\");\n\n\t\t// prints out all color options\n\t\tprintColor();\n\t\tSystem.out.println(\"You will try to guess what that exact sequence is in 12 tries, good luck!\");\n\t\tSystem.out.println(\"If you want to give up, enter 'quit' or 'exit'\");\n\t\tSystem.out.println(\"If you need a hint, enter 'hint'\");\n\t\tSystem.out.println(\"If you want some statistics, enter 'stats'\");\n\n\t\t// have computer pick random sequence\n\t\tRandom random = new Random();\n\t\tfor (int i = 0; i < NUM_COLOR_ROUND; i++) {\n\t\t\tcomputerCode[i] = random.nextInt(colors.length) + 1;\n\t\t}\n\n\t\t// scanner to input user data\n\t\ttry (Scanner scanner = new Scanner(System.in)) {\n\t\t\t// allows the user to input 12 guesses\n\t\t\twhile (totalGuess < MAX_GUESS) {\n\t\t\t\t// if you haven't entered 12 guesses allow more\n\t\t\t\tSystem.out.print(\"Please enter 4 numbers, each from 1 to 6: (\");\n\t\t\t\tprintColor();\n\n\t\t\t\t// reads the line into an array\n\t\t\t\tint[] user_guesses = new int[NUM_COLOR_ROUND];\n\t\t\t\tint index = 0;\n\t\t\t\twhile (index < NUM_COLOR_ROUND) {\n\t\t\t\t\t// reads the entire user input into a line\n\t\t\t\t\tString guess = scanner.nextLine();\n\n\t\t\t\t\t// check if user wants hint\n\t\t\t\t\tif (Objects.equals(\"hint\", guess)) {\n\t\t\t\t\t\thint();\n\t\t\t\t\t}\n\n\t\t\t\t\t// checks if user wants to quit\n\t\t\t\t\tif (Objects.equals(\"quit\", guess.toLowerCase()) || Objects.equals(\"exit\", guess.toLowerCase())) {\n\t\t\t\t\t\tSystem.out.println(\"You quit, better luck next time! \");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\n\t\t\t\t\t// checks if user wants stats\n\t\t\t\t\tif (Objects.equals(\"stats\", guess.toLowerCase())) {\n\t\t\t\t\t\tdisplayStats();\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (char ch : guess.toCharArray()) {\n\t\t\t\t\t\tif (index == NUM_COLOR_ROUND) {\n\t\t\t\t\t\t\t// if more than 4 digits are used, only the first 4 are entered into array\n\t\t\t\t\t\t\tSystem.out.println(\"Warning: only the first four digits are taken as your guess.\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (ch > '0' && ch < '7') {\n\t\t\t\t\t\t\tuser_guesses[index++] = ch - '0';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tint digitLeft = NUM_COLOR_ROUND - index;\n\t\t\t\t\tif (digitLeft > 0) {\n\t\t\t\t\t\t// if <4 digits are entered, then the program asks the user to enter the\n\t\t\t\t\t\t// remaining to make 4\n\t\t\t\t\t\tSystem.out.println(String.format(\"Please enter %d more digits (1 to 6 only)\", digitLeft));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// total number of guesses so far\n\t\t\t\ttotalGuess++;\n\n\t\t\t\t// prints out total number of guesses so far\n\t\t\t\tSystem.out.println(\"Total number of guesses: \" + totalGuess);\n\t\t\t\t// prints out your guess\n\t\t\t\tSystem.out.println(\"Your guess is: \" + Arrays.toString(user_guesses));\n\n\t\t\t\t// checks if user wins, if not, gives feedback on their guess\n\t\t\t\tint[] result = compareGuess(computerCode, user_guesses);\n\t\t\t\tint numRightPos = result[0];\n\t\t\t\tint numWrongPos = result[1];\n\t\t\t\tif (numRightPos == NUM_COLOR_ROUND) {\n\t\t\t\t\tSystem.out.println(\"You win!\");\n\t\t\t\t\tstoreStats(totalGuess, fileName);\n\t\t\t\t\tdisplayStats();\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(String.format(\n\t\t\t\t\t\t\t\"Correct position and color (BLACK): %d; Wrong position but correct color (WHITE): %d\",\n\t\t\t\t\t\t\tnumRightPos, numWrongPos));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (totalGuess >= MAX_GUESS) {\n\t\t\t// if user has done 12 guesses, game is over\n\t\t\tSystem.out.println(\"You lose!\");\n\t\t\tSystem.out.println(\"Here is what computer generated: \" + Arrays.toString(computerCode));\n\t\t\tstoreStats(0, fileName);\n\t\t\tdisplayStats();\n\t\t}\n\t}", "public void guess(char input) {\r\n\t\t\r\n\t\tBoolean correctGuess = false; //Checks for\r\n\t\t\r\n\t\tif(Character.isLowerCase(input)) {\r\n\t\t\tinput = Character.toUpperCase(input);\r\n\t\t}\r\n\t\t\r\n\t\tfor(int x = 0; x < movieName.length; x++) {\r\n\t\t\tif(input == movieName[x]) {\r\n\t\t\t\tmovieGuess[x] = input;\r\n\t\t\t\tcorrectGuess = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(correctGuess == false) {\r\n\t\t\twrongGuess.add(input);\r\n\t\t\twrongAnswerCounter++;\r\n\t\t\tchancesRemaining--;\r\n\t\t\tSystem.out.println(\"Chances Remaining: \" + chancesRemaining);\r\n\t\t\tprintWrongGuess();\r\n\t\t}\r\n\t}", "public boolean guess(int number) {\n\t\tif (number == secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Correct! The secret is \"+secret+\"\\n\"+\"The count is \"+ count);\n\t\t\treturn true;\n\t\t} else if (number < secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Sorry, too small.\");\n\t\t} else if (number > secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Sorry, too large.\");\n\t\t}\n\t\treturn false;\n\t}", "@Override\r\n\tpublic void checkAnswer() {\n\t\t\r\n\t}", "protected boolean checkGuess(Hangman game, String input) {\n if ((input != null) && (input.length() > 0)) {\n input = input.trim();\n if (input.equals(Server.GAME_STOP)) {\n cleanUp();\n } else if (input.length() == 1) {\n char c = input.charAt(0);\n game.guess(c);\n return true;\n }\n }\n return false;\n }", "public static void paintHangman() {\n if (count == 1) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"1 incorrect guess, 6 guesses left\");\n }\n if (count == 2) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"2 incorrect guesses, 5 guesses left\");\n }\n if (count == 3) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|\");\n System.out.println(\" | / |\");\n System.out.println(\" | / |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"3 incorrect guesses, 4 guesses left\");\n }\n if (count == 4) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"4 incorrect guesses, 3 guesses left\");\n }\n if (count == 5) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | /\");\n System.out.println(\" | /\");\n System.out.println(\" | _/\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"5 incorrect guesses, 2 guesses left\");\n }\n if (count == 6) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < ' |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | _/ \\\\_\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"6 incorrect guesses, only 1 guess left!\");\n }\n if (count == 7) {\n System.out.println(\"GAME OVER!\");\n System.out.println(\"7 incorrect guesses\");\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / X X \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | __ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | _/ \\\\_\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"RIP \" + UserName.getUserName());\n System.out.println(\"GAME OVER! The word was \" + CategorySelector.word);\n }\n }", "public int returnIncorrectPos(String guess) {\n\t\tint incorrectPos = 0;\n\t\t\n\t\tfor (int i = 0; i < guess.length(); i++) {\n\t\t\tif (i > secretCode.length() - 1) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tchar guessNum = guess.charAt(i);\n\t\t\tchar secretCodeNum = secretCode.charAt(i);\n\t\t\tif (guessNum == secretCodeNum) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// check if num exists in secret code\n\t\t\telse if (secretCode.contains(new String(new char[] { guessNum }))) {\n\t\t\t\tincorrectPos += 1;\n\t\t\t}\n\t\t}\n\t\treturn incorrectPos;\n\t}", "private void updateGameState(String guessedLetter) {\n\t\tif (guessedWord.contains(guessedLetter)) {\n\t\t\treturn;\n\t\t} else if (actualWord.contains(guessedLetter)) {\n\t\t\tprintln(\"That guess is correct.\");\n\t\t\tupdateGuessedWord(guessedLetter);\n\t\t\tcanvas.displayWord(guessedWord);\n\t\t} else {\n\t\t\tbadGuessCount++;\n\t\t\tcanvas.noteIncorrectGuess(guessedLetter.charAt(0));\n\t\t\tprintln(\"There is no \" + guessedLetter + \" in the word.\");\n\t\t\t//whatever other action that will happen for bad guesses can go here\n\t\t}\n\t}", "public void onButtonClicked(){\n\t\t\n\t\t//Gets the guess from text box \n\t\tString guess = AnswerBox.getText();\n\t\t//converts string to lower case\n\t\tguess = guess.toLowerCase();\n\t\t//protects against empty textbox, long strings, and non alphabet characters\n\t\tif (guess != \"\" && guess.length() == 1 && guess.charAt(0) >='a' && guess.charAt(0) <= 'z')\n\t\t{\n\t\t\t//convert String to char\n\t\t\tchar myGuess = guess.charAt(0);\n\t\t\t//test to see if letter is in secretWord\n\t\t\tif(guessIsRight(mysteryWord,myGuess)){ \n\t\t\t\n\t\t\t\t//change _ to letter if player made correct guess\n\t\t\t\tupdateWordState(mysteryWord,myGuess); \n\n\t\t\t\tif (wordState.compareTo(mysteryWord)==0) {\n\t\t\t\t\tGameWin();} \n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//update hangman picture \n\t\t\t\t//make part of hangmanPicture visible if player made incorrect guess\n\t\t\t\t\n\t\t\t\t// add missed letters to incorrect letters bank\n\t\t\t\taddLettersGuessed(myGuess); \n\t\t\t\t\n\t\t\t\tnumGuesses--;\n\t\t\t\tmakeVisible(numGuesses);\n\t\t\t}\n\t\t\t\n\t\t\tAnswerBox.requestFocus(); // set focus on textbox \n\t\t}\n\t\telse\n\t\t{\n\t\t\t// print a message if the user didn't write a letter\n\t\t\tAnswerBox.setText(\"Your guess must be a single letter\");\n\t\t\tAnswerBox.requestFocus(); \n\t\t}\n\t}", "private void correctDialog() {\n // Update score.\n updateScore(scoreIncrease);\n\n // Show Dialog.\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"Correct! This Tweet is \" + (realTweet ? \"real\" : \"fake\"));\n //builder.setPositiveButton(\"OK\", (dialog, which) -> chooseRandomTweet());\n builder.setOnDismissListener(unused -> chooseRandomTweet());\n AlertDialog dialog = builder.create();\n dialog.show();\n }", "@Override\r\n\tpublic void nextGuessResult(ResultPegs resultPegs) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t\t// Not used here\r\n\t}", "public void guessLetter()\n\t{\n\t\tSystem.out.println(\"The name is \" + length + \" letters long.\");\n\t\tSystem.out.println(\"Ok, now guess what letters are in the name.\");\n\t\t\n\t\t//This will guess the first letter.\n\t\tguessLetter1 = scan.nextLine();\n\t\tif(name.indexOf(guessLetter1) == -1)\n\t\t{\n\t\t\tSystem.out.println(\"Sorry, that letter is not in the name, try again!\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tposition1 = name.indexOf(guessLetter1);\n\t\t\tSystem.out.println(\"You're correct, letter \" + guessLetter1 + \" is in position \" + position1);\n\t\t}\n\t\t\n\t\t//This will guess the second letter.\n\t\tguessLetter2 = scan.nextLine();\n\t\tif(name.indexOf(guessLetter2) == -1)\n\t\t{\n\t\t\tSystem.out.println(\"Sorry, that letter is not in the name, try again!\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tposition2 = name.indexOf(guessLetter2);\n\t\t\tSystem.out.println(\"You're correct, letter \" + guessLetter2 + \" is in position \" + position2);\n\t\t}\n\t\t\n\t\t//This will guess the third letter.\n\t\tguessLetter3 = scan.nextLine();\n\t\tif(name.indexOf(guessLetter3) == -1)\n\t\t{\n\t\t\tSystem.out.println(\"Sorry, that letter is not in the name.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tposition3 = name.indexOf(guessLetter3);\n\t\t\tSystem.out.println(\"You're correct, letter \" + guessLetter3 + \" is in position \" + position3);\n\t\t}\n\t}", "public static void rightAnswer(char guess) {\r\n rightAnswer(guess, answer, displayedAnswer);\r\n }", "public void process(String s)//check if the phrase guess equals the actual phrase\n {\n String phraseGuess = s.toUpperCase();\n String phraseUp = phrase.toUpperCase();\n //comparing guess and actual\n if (phraseGuess.equals(phraseUp))\n {\n System.out.println(\"You Guessed correctly!\");\n screen = phraseUp.toCharArray();\n GamePlay.letterInPhrase = true;\n showPhrase();\n// System.out.println(\"The phrase is: \"+phrase);\n }\n else\n {System.out.println(\"Incorrect Guess Next Player's turn\");\n GamePlay.letterInPhrase = false;\n }\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tSystem.out.println(\"Welcome to the very generic game of...Guess the Number!\");\r\n\t\t\r\n\t\tScanner difficultyChoice = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.println(\"Select parameters below. 1 = 1-15, 2 = 1-25, and 3 = 1-50\");\r\n\t\t\r\n\t\tString choice = difficultyChoice.nextLine();\r\n\t\t\r\n\t\tint selection = 0;\r\n\t\t\r\n\t\tdo {\r\n\t\t\tif(choice.equals(\"1\")){\r\n\t\t\t\tselection = 1;\r\n\r\n\t\t\t} else if(choice.equals(\"2\")) {\r\n\t\t\t\tselection = 2;\r\n\r\n\t\t\t} else if(choice.equals(\"3\")) {\r\n\t\t\t\tselection = 3;\r\n\t\t\t}\r\n\t\t\tif(selection == 0) {\r\n\t\t\t\tSystem.out.println(\"Invalid entry. Please try again. Remember* 1 for 1-25, 2 for 1-50, and 3 for 1-100\");\r\n\t\t\t\tchoice = difficultyChoice.nextLine();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t} while(selection ==0);\r\n\t\t\r\n\t\tRandom computerNumber = new Random();\r\n\r\n\t\tint randomNum = 0;\r\n\r\n\t\tif(selection == 1){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(15);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-15. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif(selection == 2){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(25);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-25. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif(selection == 3){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(50);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-50. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint guessTotal = 0;\r\n\r\n\t\tRandom RandomNum = computerNumber; \r\n\r\n\t\tScanner playerGuess1 = new Scanner(System.in);\r\n\r\n\t\tSystem.out.println(\"Please enter your first guess on the line below: \");\r\n\r\n\t\tint guess1 = playerGuess1.nextInt();\r\n\r\n\t\tif(guess1 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your first try!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\t\r\n\t\tif(guess1 != randomNum) {\r\n\t\t\tguessTotal = 1;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 2)\");\r\n\t\t\tif(guess1 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t}else\r\n\t\t\t{\r\n\t\t\t\tif(guess1 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tScanner playerGuess2 = new Scanner(System.in);\r\n\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\t\t\t\");\r\n\r\n\t\tSystem.out.println(\"Please enter your second guess on the line below: \");\r\n\r\n\t\tint guess2 = playerGuess2.nextInt();\r\n\r\n\t\tif(guess2 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your second try!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tif(guess2 != randomNum) {\r\n\t\t\tguessTotal = 2;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 1)\");\r\n\t\t\tif(guess2 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t} else {\r\n\t\t\t\tif(guess2 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tScanner playerGuess3 = new Scanner(System.in);\r\n\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\t\t\t\");\r\n\r\n\t\tSystem.out.println(\"Please enter your third guess on the line below: \");\r\n\r\n\t\tint guess3 = playerGuess3.nextInt();\r\n\r\n\t\tif(guess3 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your third try!\");\r\n\t\t}\r\n\r\n\t\tif(guess3 != randomNum) {\r\n\t\t\tguessTotal = 3;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 0) Game over!\");\r\n\t\t\t/*if(guess3 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t} else {\r\n\t\t\t\tif(guess3 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\");\r\n\t\t\tSystem.out.println(\"The correct number was \" + randomNum);\r\n\t\t}", "public void checkUserGuess(String inputGuess){\n numGuesses++;\n // Set the result to You Miss,\n String result = \"You Miss!\";\n // Loop and check for occurence in any of the three dot coms.\n for(DotCom dotComToTest : dotComList){\n // Checking the user input versus each dotCom.\n String temp = dotComToTest.checkGuess(inputGuess);\n if(temp.equals(\"You Hit!\")){\n result = temp;\n break;\n }\n \n if(temp.equals(\"You Kill!\")){\n result = temp + \" DotCom Sunk : \" + dotComToTest.getName();\n dotComList.remove(dotComToTest);\n break;\n } \n }\n \n //Printing out the result\n System.out.println(result);\n \n }", "public int guess(int i) {\n return 1;\n }", "public void makeGuess(char letter) {\n\t\tif (isGameOver() || hasGuessedAlready(letter)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tguessesMade.add(letter);\n\t\tif (wordToGuess.indexOf(letter) == -1) { // letter is not in wordToGuess\n\t\t\tnumIncorrectGuessesMade++;\n\t\t}\n\t}", "private static int guessing() {\n\t\t\n\t\tSystem.out.println(\"Guess a number between 1 and 100, you have 5 trials: \");\n\t\t\n\t\tint trials = 5;\n\t\tScanner input = new Scanner(System.in);\n\t\t\n\t\t//set a random number as the number to be guessed\n\t\tint num = (int)(100 * Math.random()) + 1;\n\t\tint points = 0;\n\t\t\n\t\t//use a flag to check if player guess the correct number or not\n\t\tboolean flag = false;\n\t\twhile ( trials > 0) {\n\t\t\tint guess = input.nextInt();\n\t\t\ttrials--;\n\t\t\tif ( guess == num ) {\n\t\t\t\tpoints = trials == 0? 20 : trials * 20;\n\t\t\t\t//System.out.println(\"You guess the number with\"+trials+\"trials left, congratulation! +\"+ (points = trials == 0? 20 : trials * 20)+\" points\");\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}else if ( guess < num ) {\n\t\t\t\tSystem.out.println(\"The guess is too small, please try again, you have \"+trials+\" trials left.\");\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"The guess is too large, please try again, you have \"+trials+\" trials left.\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif ( !flag ) System.out.println(\"Trials used up, + 0 points\");\n\t\treturn points;\n\t\t\n\t}", "public void addGuess(Player player, String guess) {\n\t\t// dont to add guesses when win or lose occurs\n\t\tif (checkWinner(player) || checkLoser(player)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// add guess if number of current guesses is less than max guesses\n\t\tif (player != null && player.getTotalGuesses() < MAX_GUESSES) {\n\t\t\tplayer.addGuess(guess);\n\t\t\tguesses.add(guess);\n\t\t}\n\t\t\n\t\t// if guess equals secret code then player wins\n\t\tif (checkGuessEqual(guess)) {\n\t\t\tsetPlayerWon(true);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// if the 4th present guess is incorrect, player loses\n\t\tif (player.getTotalGuesses() >= MAX_GUESSES && checkGuessEqual(guess) == false) {\n\t\t\tsetPlayerLost(true);\n\t\t\treturn;\n\t\t}\n\t}", "private boolean isWrong() {\n\t\treturn wrongMatches >= 5;\n\t}", "public boolean guessWord (String gword) {\n \tif (lose || victory) return false;\n \t\n \tif ( gword.toLowerCase().equals(_word.toLowerCase()) ) {\n \t\tthis.victory = true;\n \t\t\n \t\tfor (int i = 0; i < _word.length(); i++) {\n \t\t\thint.setCharAt(2*i, _word.charAt(i));\n \t\t}\n \t\t\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }", "public static void main(String[] args) {\n //Calculate the optimal number of guesses\n int OPTIMALGUESSCNT = getlog(UPPERBOUND,10);\n\n //Begin game\n System.out.println(\"This is the High Low Game. You WILL have fun.\");\n\n //Print Name\n Scanner input = new Scanner(System.in);\n System.out.println(\"Enter your name or be annihilated: \");\n\n String name = validateInputStr();\n if (name.isEmpty()) {\n System.out.println(\"You didn't enter a name. You must be Nobody. Glad I'm not a cyclops, haha jk, unless...\\nHello Player 1.\");\n }\n System.out.printf(\"Hello %s\\n\", name);\n\n boolean playAgain = false;\n int total_guesses = 0;\n short num_games = 0;\n do { //setup each game\n int game_guesses = 0;\n int secretNum = getSecretNum(Integer.parseInt(\"BEEF\",16));\n int guess = -1;\n int prev_guess = -1;\n while (guess != secretNum) { //A single game seshion\n Scanner scanGuess = new Scanner(System.in);\n System.out.println(\"Guess a number between 0 and 100: \");\n guess = validateInput();\n ++game_guesses;\n if (guess > UPPERBOUND || guess <= 0) {\n System.out.println(\"Your guess wasn't even in the range given!\");\n }\n if (guess > secretNum) {\n if (prev_guess != -1 && guess >= prev_guess && prev_guess >= secretNum) {\n System.out.println(\"You incorrectly guessed even higher this time! Lower your angle of attack!\");\n }\n System.out.println(\"You guessed too high.\");\n prev_guess = guess;\n }\n else if (guess < secretNum) {\n if (prev_guess != -1 && guess <= prev_guess && prev_guess <= secretNum) {\n System.out.println(\"You incorrectly guessed even lower this time! Aim high airman!\");\n }\n System.out.println(\"You guessed too low.\");\n prev_guess = guess;\n }\n else {\n //The game has effectively ended -> List Win Possibilities\n selectWinOption(game_guesses, OPTIMALGUESSCNT);\n //Check whether to play again\n boolean goodInput = false;\n while (!goodInput) {\n System.out.println(\"Would you like to play again? Enter yes (y) or no (n): \");\n Scanner clearBuff = new Scanner(System.in);\n String raw_playAgain = \"\";\n raw_playAgain = validateInputStr();\n //check input (I didn't feel like using Patterns\n if (raw_playAgain.equalsIgnoreCase(\"yes\") || raw_playAgain.equalsIgnoreCase(\"y\")) {\n playAgain = true;\n goodInput = true;\n }\n else if (raw_playAgain.equalsIgnoreCase(\"no\") || raw_playAgain.equalsIgnoreCase(\"n\")) {\n playAgain = false;\n goodInput = true;\n }\n else {\n System.out.println(\"Enter valid input! Ahhhh.\");\n }\n } //end check play again input\n }\n }\n System.out.println(\"You had \" + game_guesses + \" guesses during this game.\\n\\n\");\n total_guesses += game_guesses;\n ++num_games;\n }while(playAgain);\n\n printEndDialogue(total_guesses, num_games, OPTIMALGUESSCNT);\n }", "private synchronized String responseMessage(String playerInputNum) {\n if (playerInputNum.equals(answer)) {\n winOrLose = true;\n return \"Congratulation, the correct answer is \" + answer;\n } else if (attempt == 4) {\n attempt = 5;\n return \"Game over, the answer is \" + answer;\n } else if (playerInputNum.compareTo(answer) > 0)\n return \"The guess number \" + playerInputNum + \" is bigger than the generated number, \" + (4 - attempt) + \" chances left.\";\n else\n return \"The guess number \" + playerInputNum + \" is smaller than the generated number, \" + (4 - attempt) + \" chances left.\";\n }", "private void matchletter(){\n\t\t/* Generate a Random Number and use that as a Index for selecting word from HangmanLexicon*/\n\t\tString incorrectwords = \"\";\n\t\tcanvas.reset();\n\t\tHangmanLexicon word= new HangmanLexicon(); // Get Word from Lexicon\n\t\tint index=rgen.nextInt(0, (word.getWordCount() - 1)); // Select the word Randomly\n\t\tString secretword=word.getWord(index);\n\t\tprintln(\"secretword: \"+secretword);\n\t\tint lengthofstring= secretword.length();\n\t\tString createword=concatNcopies(lengthofstring,\"-\"); // Create a blank word the user will guess\n\t\tcanvas.displayWord(createword); // Display the word on the Canvas\n\t\tprintln(\"The word now looks like this:\" +createword);\n\t\tprintln(\"You have \" +lengthofstring+ \" guesses left\");\n\t\tint counter =0;\n\t\tint guess= lengthofstring;\n\t\tint pos = createword.indexOf('-'); // Check for blank Words\n\t\t/* Ask user to input the letter*/\n\t\twhile(counter<lengthofstring && (pos !=-1 )){ \n\t\t\tint check=0;\n\t\t\tpos = createword.indexOf('-',pos); // Check to find Dashes in word\n\t\t\tString userletter= readLine(\"Your Guess:\");\n\t\t\tif(userletter.length() > 1){ // Check for two letters entered\n\t\t\t\tprintln(\"Enter letter Again\");\n\t\t\t}\n\t\t\tchar ch=userletter.charAt(0);\n\t\t\tif(Character.isLowerCase(ch)) { // Convert lower case to upper case\n\t\t\t\tch = Character.toUpperCase(ch);\n\t\t\t}\n\t\t\tfor (int i=0;i<lengthofstring;i++){ // Check for entire letter matching in the secretword\n\t\t\t\tif (ch==secretword.charAt(i) && ch!=createword.charAt(i)) { \n\t\t\t\t\tcreateword = createword.substring(0, i) + ch + createword.substring(i + 1);\n\t\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\t\tcheck++; // If user puts the correct letter again it is flagged as a error\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(check==0){\n\t\t\t\tprintln(\"There are no \"+ch+\"'s in the word\");\n\t\t\t\tguess=guess-1;\n\t\t\t\tincorrectwords = incorrectwords+ch;\n\t\t\t\tcanvas.noteIncorrectGuess(guess, incorrectwords);\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\tprintln(\"The word now looks like this:\"+createword);\n\t\t\tprintln(\"You have \" +guess+ \" guesses left\");\n\n\t\t\tif(counter==lengthofstring){ // Checks for Fail condition- Game Over\n\t\t\t\tprintln(\"You are completely hung\");\n\t\t\t\tprintln(\"The word was: \"+secretword);\n\t\t\t\tcanvas.displayWord(secretword);\n\t\t\t\tprintln(\"You lose \");\n\t\t\t}\n\t\t\tpos = createword.indexOf('-');// Check for Win condition\n\t\t\tif(pos < 0){\n\t\t\t\tprintln(\"You saved Hangman\");\n\t\t\t\tprintln(\"You Win !!!\");\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tguess=123;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public int getUserGuess(){\n int n;\n\n System.out.print(\"Guess a number between 1 and 100:\\t\"); // Prompts for input\n while (!scanner.hasNextInt()) { // Checks to see if input is an integer\n System.out.print(\"Enter a number please: \\t\");\n scanner.next();\n }\n\n n = scanner.nextInt();\n return n;\n }", "public static void main(String[] args) {\n\t\tdouble guess;\r\n\t\t\r\n\t\tScanner bob = new Scanner(System.in);\r\n\t\tint answer = (int)(10.0 * Math.random());\r\n\t\tSystem.out.println(answer);\r\n\t\t\r\n\t\tfor(int i =0; i < 3; i++){\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Please guess a number between 1 and 10 : \");\r\n\t\t\tguess = bob.nextDouble();\r\n\t\t\t\r\n\t\t\twhile (guess>10)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This number is out of range please guess between 1 and 10\");\r\n\t\t\t\tSystem.out.println(\"Please guess a number between 1 and 10 : \");\r\n\t\t\t\tguess = bob.nextDouble();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t if (guess == answer) {\r\n\t\t\t System.out.println(\"RIGHT!\");\r\n\t\t\t i=4;\r\n\t } \r\n\t\t\telse if ((answer == guess + 1) || (answer == guess - 1)) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t System.out.println(\"hot, please try again\");\r\n\t\t\t\t \r\n\t\t\t\t }\r\n\t\t\t\telse if ((answer == guess + 2) || (answer == guess - 2)){\r\n\t\t\t\t System.out.println(\"warm!, please try again\");\r\n\t\t\t }\r\n\t\t\t\t else if ((answer == guess + 3) || (answer == guess - 3)){\r\n\t\t\t\t\t System.out.println(\"cold!, please try again\"); \r\n\t\t\t\t \t\t\t \r\n\t\t\t\t }\r\n\t\t\t\t else if (i == 2){\r\n\t\t\t\t\t System.out.println(\"You loose \"); \r\n\t\t\t\t\t \r\n\t\t\t\t }else {\r\n\t\t\t\t\t System.out.println(\"cold!, please try again\"); \r\n\t\t\t \t\t\t \r\n\t\t\t\t }\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t \r\n\t\t}\r\n\t\tSystem.out.println(\"The answer is :\"+answer);\r\n\t\t\r\n\t\t\r\n}", "public static void main(String[] args)\n {\n int answer;\n int counter = 0;\n char guessAgain;\n Random rGen = new Random();\n Scanner myScanner = new Scanner(System.in);\n int guess;\n //Let's give our number a value between 0 and 100\n answer = rGen.nextInt(201) - 100;\n do\n {\n //Let's ask them to guess\n System.out.println(\"I've picked a number between -100 and 100, inclusive.\");\n System.out.println(\"Betcha can't guess it!\");\n guess = myScanner.nextInt();\n counter++;\n System.out.println(\"Your guess: \" + guess);\n if(guess == answer)\n {\n if(counter==1)\n {\n System.out.println(\"Wow, nice guess! That was it!\");\n return;\n }\n else\n {\n System.out.println(\"Well, it's about time!\");\n return;\n }\n }\n else if(guess < answer)\n {\n System.out.println(\"Ha, nice try - too low!\");\n }\n else\n {\n System.out.println(\"Too bad, way too high.\");\n }\n System.out.println(\"Would you like to guess again? (y/n)\");\n guessAgain = myScanner.next().charAt(0);\n counter++;\n myScanner.nextLine();\n }while(guessAgain=='y');\n System.out.println(\"Well, the answer was: \" + answer);\n }", "public static void main(String[] args) {\n int randomValue = (int) (100 * Math.random() + 1);\n /*Inicializamos una variable de tipo entero con un valor de 5 que\n * representará los intentos que tiene el usuario para adivinar el número*/\n int lives = 5;\n\n /*Pedimos por consola que el usuario escriba un número (primer intento)*/\n Scanner input = new Scanner(System.in);\n System.out.println(\"You have \" + lives + \" lives. Good luck!\");\n System.out.println(\"Try to guess the number:\");\n int inputNumber = input.nextInt();\n\n /*A partir del segundo intento se irá pidiendo al usuario que añada un número cada vez que no acierte,\n * mostrando algunos mensajes sobre las vidas que le quedan y si el número añadido es más grande o más\n * pequeño que el número que debe adivinar*/\n while (lives > 0) {\n lives--;\n if (lives == 0) {\n System.out.println(\"You died.\");\n break;\n }\n if (inputNumber > randomValue) {\n System.out.println(inputNumber + \" Your number is too big:\");\n System.out.println(\"Remaining lives: \" + lives);\n System.out.println(\"Try to guess the number:\");\n inputNumber = input.nextInt();\n }\n if (inputNumber < randomValue) {\n System.out.println(inputNumber + \" Your number is too small:\");\n System.out.println(\"Remaining lives: \" + lives);\n System.out.println(\"Try to guess the number:\");\n inputNumber = input.nextInt();\n }\n if (inputNumber == randomValue) {\n System.out.println(\"Good job! You are right!\");\n System.out.println(\"You wrote \" + inputNumber + \" and the number is \" + randomValue);\n System.out.println(\"Remaining lives: \" + lives);\n break;\n }\n }\n }", "public boolean takeGuess(char letter) {\n\t\t// reset default result as false\n\t\tboolean result = false;\n\t\t// iterate through the characters in the word\n\t\tfor (int i = 0; i < this.getLength(); i++) {\n\t\t\t// if the guess is correct\n\t\t\tif (this.theWord[i] == letter) {\n\t\t\t\t// unmask the slot, set the result as true\n\t\t\t\tthis.unmaskSlot(i);\n\t\t\t\tresult = true;\n\t\t\t}\n\t\t}\n\t\t//return the result\n\t\treturn result;\n\t}", "public static void tryAgain() {\n Input input = new Input(new Scanner(System.in));\n System.out.println(\"Do you want to choose another option? [ yes/no ]\");\n String more = input.getString();\n if (more.equalsIgnoreCase(\"yes\")) {\n askUser();\n } else {\n endGame();\n }\n }", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\r\n char ch, answer = 'K';\r\n System.out.println(\"I'm thinking of a letter between A and Z\");\r\n System.out.println(\"Can you guess it?\");\r\n \r\n ch = scan.next().charAt(0); //read a char from the keyboard\r\n \r\n //determine if they typed the same letter\r\n if (ch == answer){\r\n System.out.println(\"**Right!**\"); \r\n } else { \r\n //else they get the wrong message\r\n //use this if to see if they guessed to high or else too low\r\n if (ch < answer){\r\n System.out.println(\"Sorry, you're too high!\");\r\n } else {\r\n System.out.println(\"Sorry, you're too low!\");\r\n } //end of if/else block\r\n }// end of if/else block\r\n \r\n }", "@Override\n\t\t\tpublic void handle(KeyEvent e) {\n\t\t\t\tif(e.getCode().isLetterKey()) {\n\t\t\t\t\t\n\t\t\t\t\t//The input is converted to a char variable and a boolean is created and set to false,\n\t\t\t\t\t//in preparation for later in this method.\n\t\t\t\t\tchar letter = e.getText().charAt(0);\n\t\t\t\t\tboolean same = false;\n\t\t\t\t\t\n\t\t\t\t\tfor(int i = 0; i < currentGuesses.length; i++) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//If the letter that the user input is the same as the letter found\n\t\t\t\t\t\t//in the currentGuesses char array, the same boolean variable is set\n\t\t\t\t\t\t//to true and we break out of the loop.\n\t\t\t\t\t\tif(letter==currentGuesses[i]) {\n\t\t\t\t\t\t\tsame = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t//Otherwise, if we reached a point in the array that has a value of\n\t\t\t\t\t\t//0, instead of a letter, we replace that 0 with the letter that the\n\t\t\t\t\t\t//user just input and break out of the loop, because we know everything\n\t\t\t\t\t\t//past this point are also blanks and don't want to replace them too.\n\t\t\t\t\t\t}else if(currentGuesses[i]==0) {\n\t\t\t\t\t\t\tcurrentGuesses[i] = letter;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//If the letter isn't the same as one already guessed, this if statement happens.\n\t\t\t\t\tif(!same) {\n\t\t\t\t\t\t//A message is sent to the server, including the codename for the server to use\n\t\t\t\t\t\t//and the letter that the user input.\n\t\t\t\t\t\tout.println(\"LetterGuess \" + letter);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//A String array is created in preparation for the loop that happens \n\t\t\t\t\t\t//immediately afterwards.\n\t\t\t\t\t\tString[] receive = new String[3];\n\t\t\t\t\t\n\t\t\t\t\t\twhile(receive[0] == null) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t//When the server responds, the String is split into the array, separating \n\t\t\t\t\t\t\t\t//one word from the next by looking for a space.\n\t\t\t\t\t\t\t\treceive = in.readLine().split(\" \");\n\t\t\t\t\t\t\t}catch(IOException ioe) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//The boolean success is set to the second element of the received String that is converted\n\t\t\t\t\t\t//to a boolean. The same is done with the third element and is saved to the finished boolean\n\t\t\t\t\t\t//that exists in the class scope.\n\t\t\t\t\t\tboolean success = Boolean.parseBoolean(receive[1]);\n\t\t\t\t\t\tfinished = Boolean.parseBoolean(receive[2]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Success only needs to exist within this method as it is used here to determine how\n\t\t\t\t\t\t//the statusMessageLabel should be updated.\n\t\t\t\t\t\tif(success) {\n\t\t\t\t\t\t\t//If the player made a successful guess, the status message is set accordingly.\n\t\t\t\t\t\t\tstatusMessageLabel = new Label(\"There is a '\" + letter + \"' in the word!\");\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t//However, if the player made an unsuccessful guess, the message is set differently,\n\t\t\t\t\t\t\t//the amount of remaining guesses the player has decrements and the drawnPieces\n\t\t\t\t\t\t\t//variable goes up by an amount determined by maths, thanks to the different difficulty\n\t\t\t\t\t\t\t//settings. Assuming easy difficulty, drawnPieces goes up by 1. Medium difficulty\n\t\t\t\t\t\t\t//makes it go up by 1.4 and hard difficulty makes it go up by 2.333. \n\t\t\t\t\t\t\tstatusMessageLabel = new Label(\"There was no '\" + letter + \"' in the word.\");\n\t\t\t\t\t\t\tremainingGuesses--;\n\t\t\t\t\t\t\tdrawnPieces += (7.0/difficultyGuesses);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//The currentWord label is now set to the value of the first element of the \n\t\t\t\t\t\t//String array.\n\t\t\t\t\t\tcurrentWordLabel = new Label(receive[0]);\n\t\t\t\t\t\t\n\t\t\t\t\t//If the letter is the same as one already guessed, we go here instead\n\t\t\t\t\t}else {\n\t\t\t\t\t\t//Inform the user that they already tried their letter\n\t\t\t\t\t\tstatusMessageLabel = new Label(\"The letter '\" + letter + \"' has already been used\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//The currentGuesses label is updated with the new values of the player's guessed letters.\n\t\t\t\t\t//It is converted from a char array to a String, so that it can be used for the label.\n\t\t\t\t\t//The attemptsRemaining label is also updated, as the value of the remainingGuesses int\n\t\t\t\t\t//may have changed, if the player guessed incorrectly. \n\t\t\t\t\tcurrentGuessesLabel = new Label(new String(currentGuesses));\n\t\t\t\t\tattemptsRemainingLabel = new Label(\"Attempts remaining: \" + remainingGuesses);\n\n\t\t\t\t\t//Since the labels have been updated, the finalLine HBox needs to be updated with the\n\t\t\t\t\t//new labels. \n\t\t\t\t\tfinalLine = new HBox(5,currentGuessesLabel,eh,attemptsRemainingLabel);\n\t\t\t\t\tHBox.setHgrow(eh,Priority.ALWAYS);\n\t\t\t\t\tfinalLine.setAlignment(Pos.CENTER_LEFT);\n\t\t\t\t\t\n\t\t\t\t\t//And since the HBox has been updated, so too does the VBox need to be updated.\n\t\t\t\t\tmassiveSpacing = new VBox(5,group,statusMessageLabel,currentWordLabel,finalLine);\n\t\t\t\t\tmassiveSpacing.setAlignment(Pos.CENTER);\n\t\t\t\t\t\n\t\t\t\t\t//And also, the second group. \n\t\t\t\t\tnewGroup = new Group(massiveSpacing,hangTheMan(Math.toIntExact(Math.round(drawnPieces))));\n\t\t\t\t\tscene = new Scene(newGroup,300,300,Color.LIGHTGREY);\n\t\t\t\t\tstage.setScene(scene);\n\t\t\t\t\t\n\t\t\t\t\t//This method call could be seen as recursive, as it adds the very event listener\n\t\t\t\t\t//that we're inside now to the stage once again.\n\t\t\t\t\tkeyRel(stage);\n\t\t\t\t\t\n\t\t\t\t\t//If the remaining guesses left for the player is 0, then it's game over for them.\n\t\t\t\t\t//The appropriate method is called.\n\t\t\t\t\tif(remainingGuesses==0) {\n\t\t\t\t\t\tgameOver(stage);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Finished will be true if the word has been successfully completed. \n\t\t\t\t\tif(finished) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//The completeTime long variable is the difference in values from the current time\n\t\t\t\t\t\t//in milliseconds and the value of epoch, which was the current time in milliseconds\n\t\t\t\t\t\t//when the game started.\n\t\t\t\t\t\tcompleteTime = (System.currentTimeMillis() - epoch);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//In case the player had already played a game before, the values of count and\n\t\t\t\t\t\t//the inputName char array are set to a default value. \n\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t\tinputName[0] = '_';\n\t\t\t\t\t\tinputName[1] = '_';\n\t\t\t\t\t\tinputName[2] = '_';\n\t\t\t\t\t\t\n\t\t\t\t\t\t//The appropriate method is called to progress on from the game.\n\t\t\t\t\t\tgameVictory(stage);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//However, if the player did not click on a letter key and it was instead the escape button,\n\t\t\t\t//this if statement is used instead\n\t\t\t\t}else if(e.getCode()==KeyCode.ESCAPE) {\n\t\t\t\t\t\n\t\t\t\t\t//An Alert window is made, asking the player whether they're sure they want to quit\n\t\t\t\t\tAlert alert = new Alert(AlertType.CONFIRMATION);\n\t\t\t\t\talert.setTitle(\"Quit game\");\n\t\t\t\t\talert.setHeaderText(null);\n\t\t\t\t\talert.setContentText(\"Are you sure you wish to quit the game?\\nYour progress will not be saved.\");\n\t\t\t\t\tOptional<ButtonType> result = alert.showAndWait();\n\t\t\t\t\t\n\t\t\t\t\tif(result.get() == ButtonType.OK) {\n\t\t\t\t\t\t//If the player clicks on the OK button, an attempt to close the socket is made\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tclient.close();\n\t\t\t\t\t\t}catch(IOException ioe) {\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//and the stage is closed, which also ends the client's side of the program.\n\t\t\t\t\t\tstage.close();\n\t\t\t\t\t}\t\n\t\t\t\t}\t\n\t\t\t}", "public static void main(String[] args) {\r\n Scanner scan = new Scanner(System.in);\r\n Random generator = new Random();\r\n final int cap = 100;\r\n String answer = \"Y\";\r\n do {\r\n int numToGuess;\r\n int guess = -1;\r\n int count = 0;\r\n answer = \"Y\";\r\n numToGuess = generator.nextInt(cap) + 1; \r\n System.out.print(\"Please guess the integer number between\"\r\n + \" 1 and 100.\\nIf you wish to quit, type, \\\"0.\\\" \");\r\n while (guess != 0) {\r\n guess = scan.nextInt();\r\n System.out.println(\"Your guess was...\" + guess);\r\n if (guess > cap || guess < 0) {\r\n throw new IllegalArgumentException(\"Input cannot be more \"\r\n + \"than 100 or less than 0. To quit the input must\"\r\n + \" be -1\");\r\n } else if (guess == 0) {\r\n System.out.println(\"Quitting game...\\n\");\r\n } else if (guess > numToGuess) {\r\n System.out.println(\"That number is too high.\");\r\n count++;\r\n } else if (guess < numToGuess) {\r\n System.out.println(\"That number is too low.\");\r\n count++;\r\n } else if (guess == numToGuess) {\r\n System.out.println(\"That was correct.\");\r\n guess = 0;\r\n count++;\r\n }\r\n \r\n }\r\n System.out.println(\"Number of guesses for this game: \" + count);\r\n System.out.println(\"Would you like to play again? \\n\\\"N\\\" for no,\"\r\n + \" or any other input to start a new game.\");\r\n answer = scan.next();\r\n } while (!answer.equals(\"N\"));\r\n System.out.println(\"Goodbye!\");\r\n }", "public void wrongClick(View view) {\n if (roundOne[questionId].getCorrect_answer().equals(\"False\")) {\n Toast.makeText(getApplicationContext(), \"Juiste Antwoord\",\n Toast.LENGTH_SHORT).show();\n score += 5;\n } else {\n Toast.makeText(getApplicationContext(), \"Foute Antwoord\",\n Toast.LENGTH_SHORT).show();\n }\n questionId++;\n setQuestion(questionId);\n }", "public boolean alreadyGuessed(char guess) {\r\n \t//Convert guess to string, use contains method to check guessesMade ArrayList.\r\n if (guessesMade.contains(String.valueOf(guess))) {\r\n \treturn true;\r\n }\r\n \treturn false;\r\n }", "private boolean gameOver()\n {\n \t//lose case\n \tif (guess_number == 0)\n \t{\n \t\twin = false;\n \t\treturn true;\n \t}\n \t//win case\n \tif (mask.compareTo(word) == 0)\n \t{\n \t\twin = true;\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }", "public void invalidMovePrompt() {\n\t\tinvalidPrompted = true;\n\t\tSystem.out.println(\"Invalid move. Please try again\");\n\t}", "private void processAttempt(String attempt){\n\t\tinput_from_user.setText(\"\");//clear input field\t\n\n\t\tif(!attempt.matches(\".*[a-zA-Z]+.*\")){ \n\t\t\t//user doesn't enters any alphabetical characters\n\t\t\tfeedback_display.append(\"Feedback: Word includes alphabet characters, try again\\n\\n\");\n\t\t} else if(!attempt.equals(words_to_spell.get(current_word_number))&&(attempt.toLowerCase()).equals(words_to_spell.get(current_word_number).toLowerCase())){ \n\t\t\t//differs only by capitalisation\n\t\t\tfeedback_display.append(\"Feedback: \\\"\"+attempt+\"\\\" is spelt correctly but incorrect capitalisation, try again\\n\\n\");\n\t\t} else{\n\t\t\tfeedback_display.append(\"Feedback: \\\"\"+attempt+\"\\\" is \");//updates progress area with user guess\n\n\t\t\tif(attempt.equals(words_to_spell.get(current_word_number))){\n\t\t\t\tcorrectSpelling();\n\t\t\t} else{\n\t\t\t\tincorrectSpelling();\n\t\t\t}\n\t\t}\n\n\t\t//When words to spell array exhausted, asks DataHandler to process results\n\t\tif (current_word_number == words_to_spell.size()){\n\t\t\t//no point speaking any more things if quiz has already completed\n\t\t\tparent_frame.getFestival().emptyWorkerQueue();\n\t\t\tparent_frame.getPostQuizHandler().processQuizResults(words_mastered,words_faulted,words_failed,quiz_type,words_to_spell.size());\n\t\t\t\n\t\t\t//after processing results, so if got word correct after clicking Add To Review, word is still added\n\t\t\tparent_frame.getPostQuizHandler().addToReviewList(words_to_add_to_review);\n\t\t\tparent_frame.changePanel(PanelID.QuizComplete);\n\t\t} else{ \n\t\t\t//Otherwise keep going with quiz\n\t\t\tstartQuiz();\n\t\t}\n\t}", "public int getLastGuess() {\n\t\treturn lastGuess;\n\t}", "public void incorrectAnswer(View view) {\n\n // Update correct count\n deck.getCard(deckPos).setNumIncorrect(deck.getCard(deckPos).getNumIncorrect() + 1);\n\n // Set to question and update counter\n isQuestion = true;\n deckPos ++;\n\n // If not last card - Update card\n if(!(deckPos == deck.deckLength)) {\n displayCard(deck.getCard(deckPos), isQuestion);\n } else {\n finishQuiz();\n }\n\n // Set quiz counts.\n quiz.setIncorrectCount(quiz.getIncorrectCount() + 1);\n }", "private void correctError()\r\n\t{\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tint computerNum = (int)(Math.random()*100) + 1; \r\n\t\t//Code generates a decimal -> multiple by 100 to make it a whole number ->\r\n\t\t//use int to convert to integer to cut off decimal\r\n\t\tint userGuess = -100;\r\n\t\tint guessCount = 0;\r\n\t\twhile (userGuess != computerNum && userGuess != -1) {\r\n\t\t\tString input = JOptionPane.showInputDialog(null, \"This is a number guessing game. \"\r\n\t\t\t\t\t+ \"\\nPlease guess a whole number between 1 and 100.\");\r\n\t\t\tuserGuess = Integer.parseInt(input);\r\n\t\t\t//JOptionPane.showMessageDialog(null, \"Your guess was \" + userGuess + \".\");\r\n\t\t\tif (userGuess == -1){\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"You have chosen to leave the program.\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\telse if (userGuess < 0 || userGuess > 100){\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Your number is invalid.\"\r\n\t\t\t\t\t\t+ \" Please enter a number between 1 and 100.\");\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (userGuess > computerNum){\r\n\t\t\t\tif (userGuess - 10 <= computerNum) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Your guess a little too high, \"\r\n\t\t\t\t\t\t\t+ \" but within 10 of the number! Guess a little lower.\");\r\n\t\t\t\t\t//guessCount ++; \r\n\t\t\t\t\t//return guessCount;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Your guess was too high! \"\r\n\t\t\t\t\t\t\t+ \"Make a lower guess.\");\r\n\t\t\t\t\t//guessCount ++;\r\n\t\t\t\t}\r\n\t\t\t\tguessCount ++;\r\n\t\t\t}\r\n\t\t\telse if (userGuess < computerNum) {\r\n\t\t\t\tif (userGuess + 10 >= computerNum) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Your guess was a little too low, \"\r\n\t\t\t\t\t\t\t+ \"but within 10 of the number! Guess a little higher.\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tJOptionPane.showConfirmDialog(null, \"Your guess was too low!\"\r\n\t\t\t\t\t\t\t+ \" Make a higher guess.\");\t\r\n\t\t\t\t}\r\n\t\t\t\tguessCount ++;\r\n\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Yay! You guessed correctly!\");\r\n\t\t\t}\r\n\t\t\t//JOptionPane.showMessageDialog(null, \"# = \" + computerNum +\r\n\t\t\t\t\t//\"# of guesses = \" + guessCount);\r\n\t\t}\r\n\t\tJOptionPane.showMessageDialog(null, \"The random number was: \" + computerNum +\r\n\t\t\t\t\"\\nIt took you \" + guessCount + \" guesses.\");\r\n\r\n\t}", "public static void main(String[] args){\n \n //\"Declaring\" local variables for use later in the method.\n String firstName, lastName;\n int goalNumber, userGuess, countGuesses, ranNum;\n int triangleHeight;\n Scanner keyboardReader = new Scanner(System.in);\n \n //Get the user's name.\n System.out.print(\"Enter your first and last name: \");\n firstName = keyboardReader.next();\n lastName = keyboardReader.next();\n \n //Display a marquee with a personalized greeting.\n drawBorder(40, '*');\n printWelcome(firstName, lastName);\n drawBorder(40, '*');\n \n //Explain the game.\n printGameIntro(firstName);\n \n //Set up the game.\n goalNumber = (int)(1 + 20 * Math.random());\n countGuesses = 1;\n \n //Get the first guess.\n drawBorder(40, '*');\n System.out.print(\"Enter guess #\" + countGuesses + \": \");\n userGuess = keyboardReader.nextInt();\n \n //Loop until the user correctly guesses.\n while(userGuess != goalNumber){\n \n //Give advice to the user.\n if(userGuess < goalNumber){\n System.out.println(\"Too low. Guess higher.\");\n }\n else{\n System.out.println(\"Too high. Guess lower.\");\n }\n \n countGuesses = countGuesses + 1;\n \n System.out.print(\"Enter guess #\" + countGuesses + \": \");\n userGuess = keyboardReader.nextInt();\n \n } //end of while loop.\n \n //User wins if it takes fewer than 5 guesses.\n if(countGuesses < 5){\n System.out.print(\"Congratulations \" + firstName + \", \");\n System.out.println(\"you got it in \" + countGuesses + \" tries.\");\n System.out.println(\"You are a good guesser.\");\n }\n else{\n System.out.print(\"OK \" + firstName + \", \");\n System.out.println(\"you got it, but took 5 or more tries.\");\n }\n \n //Some artwork:\n drawBorder(40, '*');\n System.out.println(\"And now, we bring you a triangle of money!\");\n ranNum = (int)(1 + 10 * Math.random());\n triangleHeight = ranNum;\n \n //Display the triangle:\n for(int rowCount = 1; rowCount <= triangleHeight; rowCount++){\n drawBorder(rowCount, '$');\n }\n \n }", "private char playerGuess(){\r\n System.out.println(\"\\nEnter your guess: \");\r\n guess = input.next();\r\n if (guess.matches(\"[a-zA-z]*$\") && guess.length() == 1){\r\n if(guesses.contains(guess.charAt(0))){\r\n System.out.println(\"You already guessed this character!\");\r\n playerGuess();\r\n }\r\n return Character.toLowerCase(guess.charAt(0));\r\n } else {\r\n System.out.println(\"Invalid guess! Try again!\");\r\n playerGuess();\r\n }\r\n return Character.toLowerCase(guess.charAt(0));\r\n }", "public Main()\n {\n \n Random rand = new Random();\n int n = rand.nextInt(10);\n n+=1;\n \n Scanner sc = new Scanner(System.in);\n int i = 0;\n do {\n \n i = sc.nextInt();\n\n //System.out.println(i);\n if(i<n){\n System.out.println(\"too small\");\n if (previousNum!=i){\n count += 1;\n }\n }\n else if(i>n){\n System.out.println(\"too big\");\n if (previousNum!=i){\n count +=1;\n }\n }\n else {\n System.out.println(\"correct guess\");\n \n count +=1;\n \n }\n \n previousNum = i;\n }while (i!=n);\n System.out.println(\"it took you \"+count+\" guesses!\");\n \n }", "private int userLoing() {\n\t\t\n\t\tScanner scan2 = new Scanner(System.in);\n\t\tSystem.out.println(\"\\nPour vous rappler, pour quitter il faut entrer q ou quit pour quitter \\navant de commencer de saisir de mot de passe.\\n\"+\n\t\t\t\t\n\t\t\t\t\"--------------------------------------------------------------------------------------\");\n\t\tboolean correct = true; //To check the confirmation of the password\n\t\t\n\t\t\n\t\t//to get the user's name\n\t\tString nom;\n\t\tdo {\n\t\t System.out.print(\"Entrez un nom d'une longueur qui > 4: \");\n\t\t nom = scan2.nextLine();\n\t\t} while ((nom.length() < 4) && !(nom.equalsIgnoreCase(\"q\")) && !(nom.equalsIgnoreCase(\"quit\")));\n\t\t\n\t\tif(nom.equalsIgnoreCase(\"q\") || nom.equalsIgnoreCase(\"quit\")) {\n\t\t\tSystem.out.println(\"\\n-----------------------------------------------------\\nVous avez été dérigé vers le meun principal!\\n-----------------------------------------------------\");\n\t\t\tcorrect = true;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t\n\t\t\t//for the password and the confirmation\n\t\t\t\n\t\t\twhile(correct) {\n\t\t\t\tint mdp;\n\t\t\t\tdo {\n\t\t\t\t System.out.print(\"Entrez un mot de passe qui contient au moins 6 chiffres SVP: \");\n\t\t\t\t while (!scan2.hasNextInt()) {\n\t\t\t\t\t System.err.print(\"Entrez un mot de passe qui contient au moins 6 chiffres SVP: \");\n\t\t\t\t scan2.next();\n\t\t\t\t }\n\t\t\t\t mdp = scan2.nextInt();\n\t\t\t\t} while (Integer.toString(mdp).length() < 6);\n\t\t\t\t\n\t\t\t\tint mdp2;\n\t\t\t\tdo {\n\t\t\t\t System.out.print(\"Confirmez vôtre mot de passe SVP : \");\n\t\t\t\t while (!scan2.hasNextInt()) {\n\t\t\t\t\t System.err.print(\"Confirmez vôtre mot de passe : \");\n\t\t\t\t scan2.next(); \n\t\t\t\t }\n\t\t\t\t mdp2 = scan2.nextInt();\n\t\t\t\t} while (Integer.toString(mdp2).length() < 6);\n\t\t\t\t\n\t\t\t\tcorrect = mdp == mdp2 ? false: true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tint res = !correct? 1 : 0;\n\t\treturn res;\n\t\t\n\t}", "public static void main(String[] args) {\n Scanner myInt = new Scanner(System.in); // This line creates a scanner object\r\n System.out.print(\"Enter number between 1 and 5:\");\r\n \r\n int guess = myInt.nextInt(); // read user input\r\n if (guess >=1 && guess <=5){\r\n int result = guess%2; \r\n if (result == 0)\r\n {\r\n System.out.println(\"Lucky Guess\");\r\n }else{\r\n System.out.println(\"Better Luck Next Time\");\r\n } }else{\r\n System.out.print(\"Enter number between 1 and 5:\");\r\n guess = myInt.nextInt();\r\n } \r\n }", "public void makeGuess() {\n columnGuess = ((int) (Math.random() * 100000)) % 10;\n\n int number = ((int) (Math.random() * 100000)) % 10;\n rowGuess = (char) (number + 65);\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Hello! Welcome to the game!\");\n\t int attempts = 0; //1a\n\t int green = 0;\n\t int red = 0;\n\t\tScanner myObj = new Scanner(System.in);\n\t Answer answer = new Answer();\n\t Guess userGuess = new Guess();\n //answer.printAnswer(); (this was included for your convenience if you want to see what the answer is when you run the program)\n\t while ((attempts < 10) && (green != 3)){\n\t userGuess.printGuessList();\n\t String stringGuess = getUserInput(myObj); //1d\n\t userGuess.set(stringGuess);\n\t int[] guess = userGuess.getGuess();\n\t green = answer.numGreenBall(guess);\n\t System.out.print(\"Green Balls: \" + green);\n\t red = answer.numRedBall(guess);\n\t System.out.println(\" Red Balls: \" + red);\n\t System.out.println();\n\t userGuess.sortAllGuesses();\n\t attempts = userGuess.getNumOfGuess();\n\t }\n\t //10\n if (green == 3){\n\t System.out.println(\"You won!\");\n\t }\n\t if (attempts == 10){\n\t System.out.println(\"You lose! You couldn't guess the number in ten tries.\");\n\t }\n\t\tmyObj.close();\n\t }", "private static void playGame()\n {\n initializeGame();\n System.out.println(textColor(\"white\",\"I have thought of a number, can you guess it?\"));\n Scanner guess = new Scanner(in);\n while(isPlaying)\n {\n // Give play information on how many guesses they have left\n System.out.print(textColor(\"blue\", \"Guesses left: \"));\n System.out.println(textColor(\"blue\", Integer.toString(guessesLeft)));\n if(showDebugInfo)\n {\n System.out.println(textColor(\"white\", String.format(\" %d (%d)\",bestGuess,secretNumber)));\n }\n // Ask for user input / guess\n System.out.println(textColor(\"cyan\", \"Enter your guess: \"));\n playerGuess = guess.nextInt();\n if (playerGuess > maxSecret)\n {\n // Cap player guess to max possible value\n System.out.print(textColor(\"yellow\",\"Guess is higher than possible maximum.\\nGuess is set to: \"));\n System.out.println(textColor(\"cyan\",Integer.toString(maxSecret)));\n }\n else if(playerGuess < minSecret)\n {\n // Cap player guess to min possible value\n System.out.print(textColor(\"yellow\",\"Guess is smaller than possible maximum.\\nGuess is set to: \"));\n System.out.println(textColor(\"cyan\",Integer.toString(minSecret)));\n }\n if (playerGuess == secretNumber)\n {\n // Player won\n System.out.print(textColor(\"white\",\"Congratulations! you have found my number: \"));\n System.out.println(textColor(\"cyan\",Integer.toString(secretNumber)));\n exitGame();\n }\n else if (secretNumber < playerGuess)\n {\n // Secret number is smaller than Player's guess\n System.out.printf(\"My number is %s\\n\",textColor(\"red\",\"LOWER\"));\n\n if(playerGuess - secretNumber < bestGuess)\n {\n bestGuess = playerGuess - secretNumber;\n }\n }\n else if (secretNumber > playerGuess)\n {\n // Secret number is larger than Player's guess\n System.out.printf(\"My number is %s\\n\",textColor(\"yellow\",\"HIGHER\"));\n if (secretNumber - playerGuess < bestGuess)\n {\n bestGuess = secretNumber - playerGuess;\n }\n }\n if (isPlaying)\n {\n switch(guessesLeft)\n {\n case 1:\n if(dangerZone(bestGuess))\n {\n // Player got close to finding the Secret Number, but still failed\n System.out.println(textColor(\"white\",\"You almost got me! My number was \"));\n System.out.println(textColor(\"yellow\",Integer.toString(secretNumber)));\n isPlaying = false;\n\n }\n else\n {\n if (safeLineUsed)\n {\n // Player could not find solution even after bonus guesses awarded\n System.out.print(textColor(\"white\",\"Sorry, the number I thought was \"));\n System.out.println(textColor(\"yellow\",Integer.toString(secretNumber)));\n isPlaying = false;\n }\n else\n {\n // Bonus Guesses award is triggered\n System.out.print(textColor(\"white\",\"Don't give up, here is \"));\n System.out.print(textColor(\"cyan\",Integer.toString(extraGuesses)));\n System.out.println(textColor(\"white\",\" extra guesses\"));\n safeLineUsed = true;\n guessesLeft += extraGuesses-1;\n }\n }\n break;\n\n default:\n // Keep reducing Guesses Left number\n guessesLeft--;\n break;\n }\n\n }\n }\n\n }", "public void clearGuess() {\n\t\tthis.guessTimes = 0;\n\t}", "public void displayInorrectResponse(int x) {\n\t\t\t\t\tswitch (x) {\n\t\t case 1: System.out.println(\"No. Please try again.\");;\n\t\t break;\n\t\t case 2: System.out.println(\"Wrong. Try once more.\");;\n\t\t break;\n\t\t case 3: System.out.println(\"Donít give up!\");\n\t\t break;\n\t\t case 0: System.out.println(\"No. Keep trying.\");\n\t\t break;\n\t\t\t\t}}", "public static void main(String[] args) {\n\t// 1. Ask for an initial password, and store it in a variable\n String answer1 = JOptionPane.showInputDialog(null, \"What is the secret message?\"); \n\t// 2. Ask for a message and store it in a variable\n String answer2 = JOptionPane.showInputDialog(null, \"What is your password?\");\n\t// 3. Ask your friend for the password and store it in a variable\n String answer3 = JOptionPane.showInputDialog(\"Do you know the password?\");\n\t// 4. If the password matches,\n if (answer1.equals(answer3))\n {\n\tJOptionPane.showMessageDialog(null, \"\" + answer2);\t\n\t}\n else\n {\n \tJOptionPane.showMessageDialog(null, \"Your wrong.\");\n }\n\t\t// show the secret message\n\t// *5. OPTIONAL: let your friend keep guessing even if they are wrong\n\n}" ]
[ "0.7486068", "0.74036723", "0.73188823", "0.7267971", "0.7250874", "0.71798503", "0.70455366", "0.6970048", "0.6945354", "0.6896429", "0.677698", "0.6728093", "0.67083716", "0.6679502", "0.66547173", "0.6639333", "0.6599278", "0.6574016", "0.65671885", "0.65606594", "0.6556097", "0.64965904", "0.64826375", "0.646391", "0.6438362", "0.64362746", "0.6434962", "0.6394427", "0.63543135", "0.63476837", "0.63424337", "0.63342124", "0.6312767", "0.6277487", "0.62754583", "0.62631536", "0.6255215", "0.6241772", "0.6206764", "0.6206017", "0.6160261", "0.61481327", "0.6130597", "0.6122365", "0.6103121", "0.61000484", "0.60997766", "0.6052489", "0.60516286", "0.6049962", "0.60323757", "0.60224193", "0.60206175", "0.5994184", "0.59919643", "0.59844804", "0.5981947", "0.59796894", "0.5964756", "0.595979", "0.5958567", "0.5949453", "0.59423596", "0.59416044", "0.5930121", "0.5927046", "0.59209716", "0.5916999", "0.5910094", "0.59062725", "0.59004176", "0.58861446", "0.5886108", "0.5870677", "0.584617", "0.58417314", "0.5840936", "0.5832586", "0.582894", "0.58169216", "0.581564", "0.58152336", "0.5801295", "0.5797126", "0.5794616", "0.5791865", "0.57845926", "0.5773122", "0.57673657", "0.5748238", "0.57457197", "0.5742221", "0.57391065", "0.5728046", "0.5726236", "0.5725763", "0.5718027", "0.5716579", "0.5712703", "0.5710288" ]
0.79410994
0
determines whether the computer should guess again
public boolean guessAgain(ArrayList<Range> ranges, ArrayList<Range> compRanges) { int minR = 12; int minRComp = 12; for(int i = 0; i<ranges.size(); i++) { if(ranges.get(i).getStart() != -1 && ranges.get(i).getRange() <minR) { minR = ranges.get(i).getRange(); } } for(int i = 0; i <compRanges.size(); i++) { if(ranges.get(i).getStart() != -1 && ranges.get(i).getRange() <minR) { minR = ranges.get(i).getRange(); } } if(minR == 0 || minR == 1) return true; if(minRComp<2) return false; if(minR == 2) { int ranNum = (int)(Math.random()*10); if(ranNum<6) return true; else return false; } if(minR == 3) { int ranNum = (int)(Math.random()*10); if(ranNum<4) return true; else return false; } if(minR == 4) { int ranNum = (int)(Math.random()*10); if(ranNum<3) return true; else return false; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean alreadyGuessed(char guess) {\r\n return false;\r\n }", "private boolean PlayAgain() {\n int choice = Main.HandleInput(\"Play Again\", 2);\n if (choice == 1){\n ResetGame();\n return true;\n }\n else{\n return false;\n }\n }", "public void rightGuess()\r\n\t{\r\n\t\tif(userWon())\r\n\t\t{\r\n\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"good job! you've correctly guessed the panel \\n would you like to guess again? if so enter yes, if you would like to add your tile to your code, reply no\\n\\n\");\r\n\t\tString answer = sc.next();\r\n\t\tif(answer.compareTo(\"yes\") == 0 || answer.compareTo(\"Yes\") == 0)\r\n\t\t{\r\n\t\t\tuserTurn(false);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(userRanPan.getValue() == -1)\r\n\t\t\t\tnewGame.getUserHand().addDash(false,userRanPan);\r\n\t\t\telse\r\n\t\t\t\tnewGame.getUserHand().addPanel(userRanPan,false);\r\n\r\n\t\t\tuserGuess.clear();\r\n\t\t\tslide(previousGuess,userRanPan);\r\n\r\n\t\t\tif(userWon() == false)\r\n\t\t\t\tcompTurn(false);\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//foo.repaint();\r\n\t}", "public void wrongGuess()\r\n\t{\r\n\t\tSystem.out.println(\"Sorry, your guess is wrong\");\r\n\t\tif(userRanPan.getValue() == -1)\r\n\t\t\tnewGame.getUserHand().addDash(true,userRanPan);\r\n\t\telse\r\n\t\t\tnewGame.getUserHand().addPanel(userRanPan,true);\r\n\r\n\t\tif(userWon() == false)\r\n\t\t\tcompTurn(false);\r\n\t\telse if(userWon())\r\n\t\t{\r\n\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t}", "public static boolean playAgain() {\n\t\t// Have the system ask the user if they want to play again.\n\t\tSystem.out.print(\"Play again? y = yes: \");\n\t\tScanner manualInput = new Scanner(System.in);\n\t\tString playAgain = manualInput.nextLine();\n\t\t// Create an if statement that runs if the playAgain variable is equal to y.\n\t\tif(playAgain.equals(\"y\")) {\n\t\t\t// Have the function return true.\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "private void replay(){\r\n System.out.println(\"Do you want to play again? (Y/N)\");\r\n guess = input.next();\r\n if (Character.toLowerCase(guess.charAt(0)) == 'y'){\r\n reset();\r\n start();\r\n } else if(Character.toLowerCase(guess.charAt(0)) == 'n'){\r\n System.out.println(\"Thanks for playing!\");\r\n System.exit(0);\r\n } else {\r\n System.out.println(\"Invalid input!\");\r\n replay();\r\n }\r\n }", "public boolean guess(char letter)\n\t{\n\t\treturn false;\n\t}", "public abstract boolean isGuessCorrect(String guess);", "public static void tryAgain() {\n Input input = new Input(new Scanner(System.in));\n System.out.println(\"Do you want to choose another option? [ yes/no ]\");\n String more = input.getString();\n if (more.equalsIgnoreCase(\"yes\")) {\n askUser();\n } else {\n endGame();\n }\n }", "private boolean gameOver()\n {\n \t//lose case\n \tif (guess_number == 0)\n \t{\n \t\twin = false;\n \t\treturn true;\n \t}\n \t//win case\n \tif (mask.compareTo(word) == 0)\n \t{\n \t\twin = true;\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }", "public abstract boolean guess(String guess);", "public boolean computerGuess()\r\n\t{\r\n\t\tboolean isWhite;\r\n\t\tint randomBool = (int) (Math.random()*50);\r\n\t\tif(randomBool<25)\r\n\t\t\tisWhite = true;\r\n\t\telse\r\n\t\t\tisWhite = false;\r\n\t\twhile(newGame.containsColor(isWhite) == false)\r\n\t\t{\r\n\t\t\trandomBool = (int) (Math.random()*50);\r\n\t\t\tif(randomBool<25)\r\n\t\t\t\tisWhite = true;\r\n\t\t\telse\r\n\t\t\t\tisWhite = false;\r\n\t\t}\r\n\t\tint randomPanel = (int) (Math.random()*newGame.getUserHandLength());\r\n\t\t//System.out.println(randomPanel);\r\n\t\tint randomGuess = (int) (Math.random()*12);\r\n\t\tif(newGame.getCompHand().contains(new Panel(isWhite,randomGuess,false)))\r\n\t\t{\r\n\t\t\tif(newGame.getUserHand().getPanel(randomPanel).compareTo(new Panel(isWhite,randomGuess,false)) == 0)\r\n\t\t\t\treturn true;\r\n\t\t\telse \r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void checkGuess() {\n\t\tString guessText = txtInput.getText();\r\n\t\tString message = \"\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\t// check the guess for too high/too low\r\n\t\t\tint guess = Integer.parseInt(guessText);\r\n\t\t\t//too high\r\n\t\t\tif (guess > theNumber) {\r\n\t\t\t\tmessage = guess + \" was too high. Try again.\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnumberOfPlayerGuesses += 1;\r\n\t\t\t} else if (guess < theNumber) {\r\n\t\t\t\tmessage = guess + \" was too low. Try again.\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnumberOfPlayerGuesses += 1;\r\n\t\t\t} else {\r\n\t\t\t\tmessage = guess + \" was right! You used \" + numberOfPlayerGuesses + \" guesses. Let's play again!\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnewGame();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\tlblDirections2Result.setText(\"Enter a whole number between 1 and 100.\");\r\n\t\t}\r\n\t\t\r\n\t\ttxtInput.requestFocus();\r\n\t\ttxtInput.selectAll();\r\n\t\t\r\n\t\t\r\n\t}", "private void tryGuess(int guess) {\n int guessAssert = guesser.assertGuess(guess);\n switch (guessAssert) {\n case 0:\n guesser.madeGuess();\n System.out.println(\"Too low. Guess again: \");\n break;\n case 1:\n guesser.madeGuess();\n System.out.println(\"Too high. Guess again: \");\n break;\n case 2:\n guesser.madeGuess();\n System.out.println(\"You got it in \"+guesser.getGuess()+\" guesses!\");\n break;\n default:\n guesser.madeGuess();\n System.out.println(\"Invalid numeric value has been entered.\");\n break;\n }\n\n }", "public void checkGuess() {\n\t\tString guessText = txtGuess.getText();\n\t\tString message = \"\";\n\t\t\n\t\t\n\t\ttry {\n\n\t\t\t//check users guess too high/too low\n\t\t\tint guess = Integer.parseInt(guessText);\n\t\t\t\n\t\t\tif ( guess < 0 || guess > 100) {\n\t\t\t\tthrow new Exception(\"User entry out of range\");\n\t\t\t}//if\n\n\t\t\t//too high\n\t\t\tif(guess > theNumber){\n\t\t\t\tmessage = guess + \" is to high guess again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t}//if\n\t\t\t//too low\n\t\t\telse if (guess < theNumber){\n\t\t\t\tmessage = guess + \" is to low guess again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t}else{//guessed correct\n\t\t\t\tmessage = guess + \" was right! You win! Let's play again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t\tnewGame();\n\t\t\t}//else\n\t\t}//try\n\t\tcatch(Exception e) {\n\t\t\tlblOutput.setText(\"Enter a whole number between 1-100\"); \n\t\t}//catch\n\t\tfinally {\n\t\t\t\n\t\t\ttxtGuess.requestFocus();\n\t\t\ttxtGuess.selectAll();\n\t\t\t\n\t\t}//finally\n\t}", "private static void gameOver() {\n\t\tSystem.out.println(\"Would you like to play again?\");\n\t\tinput.nextLine();\n\t\tuserInput = input.nextLine();\n\t\tif(userInput.contains(\"yes\")||userInput.equals(\"y\"))\n\t\t{\n\t\t\tgame();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"Stay golden.\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "private static void playGame()\n\t{\n\t\tScanner in = new Scanner(System.in);\n\t\tint userGuess = 0;\n\t\tint length = String.valueOf(userGuess).length();\n\t\tboolean play = true;\n\t\twhile (play)\n\t\t{\t\n\t\t\tint gameNumber = newNumber();\n\t\t\tString randomNumber = String.valueOf(gameNumber);\n\t\t\tSystem.out.println(\">>>MASTERMIND<<<\");\n\t\t\tSystem.out.println(\"Enter your guess of the 4 digit number!\");\n\t\t\tdo\n\t\t\t{\n\t\t\t\tuserGuess = in.nextInt();\n\t\t\t\tlength = String.valueOf(userGuess).length();\n\t\t\t\tif (length != 4)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Please enter a number with a length of 4 digits.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (length != 4);\n\t\t\tString userNumber = String.valueOf(userGuess);\n\t\t\tnumberTester(userNumber, randomNumber);\n\t\t\tSystem.out.printf(\"\\nCongratulations! You guessed the random number %d\\n\", gameNumber);\n\t\t\tSystem.out.println(\"Would you like to play again?\");\n\t\t\tSystem.out.println(\"1.) Yes\");\n\t\t\tSystem.out.println(\"2.) No\");\n\t\t\tif (in.nextInt() == 2)\n\t\t\t{\n\t\t\t\tplay = false;\n\t\t\t}\n\t\t}\n\t}", "public void correctGuess(String s){\n\t\t \tif(rightAnswer==s){\n\t\t \t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\tGamesCommon.displayEndGame(GameStatus.Won, this,p);\n\t\t\t\t\t \n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t \t}else{\n\t\t \t\ttry {\n\t\t \t\t\tGamesCommon.displayEndGame(GameStatus.Lost, this,p);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t \t}\n\t }", "public static void main(String[] args) {\n\t\tdouble guess;\r\n\t\t\r\n\t\tScanner bob = new Scanner(System.in);\r\n\t\tint answer = (int)(10.0 * Math.random());\r\n\t\tSystem.out.println(answer);\r\n\t\t\r\n\t\tfor(int i =0; i < 3; i++){\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Please guess a number between 1 and 10 : \");\r\n\t\t\tguess = bob.nextDouble();\r\n\t\t\t\r\n\t\t\twhile (guess>10)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This number is out of range please guess between 1 and 10\");\r\n\t\t\t\tSystem.out.println(\"Please guess a number between 1 and 10 : \");\r\n\t\t\t\tguess = bob.nextDouble();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t if (guess == answer) {\r\n\t\t\t System.out.println(\"RIGHT!\");\r\n\t\t\t i=4;\r\n\t } \r\n\t\t\telse if ((answer == guess + 1) || (answer == guess - 1)) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t System.out.println(\"hot, please try again\");\r\n\t\t\t\t \r\n\t\t\t\t }\r\n\t\t\t\telse if ((answer == guess + 2) || (answer == guess - 2)){\r\n\t\t\t\t System.out.println(\"warm!, please try again\");\r\n\t\t\t }\r\n\t\t\t\t else if ((answer == guess + 3) || (answer == guess - 3)){\r\n\t\t\t\t\t System.out.println(\"cold!, please try again\"); \r\n\t\t\t\t \t\t\t \r\n\t\t\t\t }\r\n\t\t\t\t else if (i == 2){\r\n\t\t\t\t\t System.out.println(\"You loose \"); \r\n\t\t\t\t\t \r\n\t\t\t\t }else {\r\n\t\t\t\t\t System.out.println(\"cold!, please try again\"); \r\n\t\t\t \t\t\t \r\n\t\t\t\t }\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t \r\n\t\t}\r\n\t\tSystem.out.println(\"The answer is :\"+answer);\r\n\t\t\r\n\t\t\r\n}", "public static boolean restartEN() {\t\t\r\n\t\tint num = 0;\r\n\t\tSystem.out.println(\"\\nRoll again or khmm.. be chicken?\\n1- Roll like a man!\\n2- Exit\");\r\n\t\tdo {\r\n\t\t\tnum = check();\r\n\t\t\tif (num != 1 && num != 2) {\t\t\t\t\t\t\t// u slucaju da se ne unese broj 1 ili 2\r\n\t\t\t\tSystem.out.println(\"Don't be knave, enter option 1 or 2:\");\r\n\t\t\t} else\r\n\t\t\t\tbreak;\r\n\t\t} while (true);\r\n\t\tif (num == 2) {\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "boolean checkGuess(String guess) {\r\n if (currWord.contains(guess)) { // correct guess\r\n numToGuess--;\r\n if (numToGuess <= 0) { // the word was guessed\r\n if (currWord.equals(animal))\r\n animalGuessed = true;\r\n if (currWord.equals(country))\r\n countryGuessed = true;\r\n if (currWord.equals(superhero))\r\n superheroGuessed = true;\r\n wordsCorrect++;\r\n if (wordsCorrect >= 3) {\r\n gameOver = true;\r\n win = true;\r\n }\r\n }\r\n return true;\r\n }\r\n else { // wrong guess\r\n guessesLeft--;\r\n if (guessesLeft <= 0) { // round lost\r\n chancesLeft--;\r\n if (chancesLeft <= 0) {\r\n gameOver = true;\r\n win = false;\r\n }\r\n }\r\n }\r\n return false;\r\n }", "public boolean guess(int number) {\n\t\tcountRound++;\n\t\tlastGuess = number;\n\t\t\n\t\tif(number == secret) {\n\t\t\tsetChanged();\n\t\t\tnotifyObservers(number);\n\t\t\tsetMessage(\"Wow! Correct!! I'm thinking of \"+secret+\".\");\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (number < secret && number >= 1) setMessage(\"Umm, \" + number + \" is too small.\");\n\t\telse if (number > secret && number <= this.upperBound) setMessage(\"Oh! \" + number + \" is too large.\");\n\t\telse setMessage(\"Oops! Please input a valid number!!\");\n\t\t\n\t\tsetChanged();\n\t\tnotifyObservers();\n\t\treturn false;\n\t}", "public static void main(String[] args)\n {\n int answer;\n int counter = 0;\n char guessAgain;\n Random rGen = new Random();\n Scanner myScanner = new Scanner(System.in);\n int guess;\n //Let's give our number a value between 0 and 100\n answer = rGen.nextInt(201) - 100;\n do\n {\n //Let's ask them to guess\n System.out.println(\"I've picked a number between -100 and 100, inclusive.\");\n System.out.println(\"Betcha can't guess it!\");\n guess = myScanner.nextInt();\n counter++;\n System.out.println(\"Your guess: \" + guess);\n if(guess == answer)\n {\n if(counter==1)\n {\n System.out.println(\"Wow, nice guess! That was it!\");\n return;\n }\n else\n {\n System.out.println(\"Well, it's about time!\");\n return;\n }\n }\n else if(guess < answer)\n {\n System.out.println(\"Ha, nice try - too low!\");\n }\n else\n {\n System.out.println(\"Too bad, way too high.\");\n }\n System.out.println(\"Would you like to guess again? (y/n)\");\n guessAgain = myScanner.next().charAt(0);\n counter++;\n myScanner.nextLine();\n }while(guessAgain=='y');\n System.out.println(\"Well, the answer was: \" + answer);\n }", "public boolean guess(int number) {\n\t\tcount++;\n\t\tif (number == secret) {\n\t\t\tsetHint(String.format(\"Correct. The secret is %d. You used %d guesses.\", this.secret, this.count));\n\t\t\treturn true;\n\n\t\t} else if (number < secret) {\n\t\t\tsetHint(\"Sorry,your guess is too small\");\n\t\t} else {\n\t\t\tsetHint(\"Sorry,your guess is too large\");\n\t\t}\n\t\treturn false;\n\n\t}", "public boolean guess(int number) {\n\t\tif (number == secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Correct! The secret is \"+secret+\"\\n\"+\"The count is \"+ count);\n\t\t\treturn true;\n\t\t} else if (number < secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Sorry, too small.\");\n\t\t} else if (number > secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Sorry, too large.\");\n\t\t}\n\t\treturn false;\n\t}", "public boolean doItAgain() {\r\n\r\n\t\tboolean doAgain = true;\r\n\t\tString userRespons;\r\n\t\tchar res;\r\n\r\n\t\tScanner in = new Scanner(System.in);\r\n\r\n\t\tSystem.out.println(\"Do you want to add another Invoice ?--> Pres Y for 'Yes' and N for 'No'. \");\r\n\t\tuserRespons = in.nextLine();\r\n\t\tres = userRespons.charAt(0);\r\n\r\n\t\tswitch (res) {\r\n\t\tcase 'Y':\r\n\t\tcase 'y':\r\n\t\t\tdoAgain = true;\r\n\t\t\tnumberOfBills++;\r\n\t\t\tbreak;\r\n\r\n\t\tcase 'N':\r\n\t\tcase 'n':\r\n\t\t\tdoAgain = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif (doAgain == true) {\r\n\t\t\tif ((numberOfBills - counter) >= counter) {\r\n\t\t\t\tdoAgain = false;\r\n\t\t\t\tnumberOfBills--;\r\n\t\t\t\tSystem.out.println(\"You have reached to the max!\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (doAgain);\r\n\t}", "public void printWrongGuess() {\r\n\t\t\r\n\t\tSystem.out.print(\"Wrong Guesses: \" + wrongGuess + \"\\n\");\r\n\t}", "private static boolean getReplayResponse() {\n Scanner scan = new Scanner(System.in);\n // Keep looping until a non-zero-length string is entered\n while (true) {\n System.out.print(\"Play again (Yes or No)? \");\n String response = scan.nextLine().trim();\n if (response.length() > 0) {\n return response.toUpperCase().charAt(0) == 'Y';\n }\n }\n }", "public void playAgain() {\r\n // Create the Scanner object for reading input\r\n Scanner keyboard = new Scanner(System.in);\r\n \r\n String[] answers = new String[]{\"y\", \"n\"};\r\n List<String> list = Arrays.asList(answers);\r\n boolean invalid = true;\r\n \r\n while (invalid) {\r\n System.out.println(\"Would you like to play again? y/n\");\r\n String replayInput = keyboard.nextLine();\r\n if (list.contains(replayInput) && replayInput.equals(\"y\")) {\r\n invalid = false;\r\n this.startGame();\r\n } else if (list.contains(replayInput) && replayInput.equals(\"n\")) {\r\n invalid = false;\r\n this.quitGame();\r\n } else {\r\n System.out.println(\"Invalid response.\");\r\n }\r\n }\r\n }", "public boolean takeGuess(char letter) {\n\t\t// reset default result as false\n\t\tboolean result = false;\n\t\t// iterate through the characters in the word\n\t\tfor (int i = 0; i < this.getLength(); i++) {\n\t\t\t// if the guess is correct\n\t\t\tif (this.theWord[i] == letter) {\n\t\t\t\t// unmask the slot, set the result as true\n\t\t\t\tthis.unmaskSlot(i);\n\t\t\t\tresult = true;\n\t\t\t}\n\t\t}\n\t\t//return the result\n\t\treturn result;\n\t}", "public static void hitWrong()\n\t{\n\t\troundEnd();\n\t\tlblUpdate.setText(\"You have answer incorrectly. You lose.\");\n\t}", "protected boolean guessAnswer(String answer) {\n if (answer.equals(correctAnswer)) {\n currentScore++;\n nextQuestion();\n return true;\n } else {\n nextQuestion();\n return false;\n }\n }", "abstract int nextTry(String guess);", "public boolean alreadyGuessed(char guess) {\r\n \t//Convert guess to string, use contains method to check guessesMade ArrayList.\r\n if (guessesMade.contains(String.valueOf(guess))) {\r\n \treturn true;\r\n }\r\n \treturn false;\r\n }", "void askForRepeat();", "public boolean isGameOver() {\r\n if(timesAvoid == 3) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public static char runAgain() {\n\t\tchar runAgainChar; //Y or N to run the program again\n\t\tString answer; //whatever answer the user types in the console\n\t\t\n\t\tScanner input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.print(\"Do you wish to run the program again?:\");\n\t\tanswer = input.nextLine().toUpperCase();\n\t\trunAgainChar = answer.charAt(0);\n\t\t\n\t\twhile(runAgainChar != 'Y' && runAgainChar != 'N') {\n\t\t\tSystem.out.println(\"ERROR: Please enter a valid option...\");\n\t\t\tSystem.out.print(\"Do you wish to run the program again?:\");\n\t\t\tanswer = input.nextLine().toUpperCase();\n\t\t\trunAgainChar = answer.charAt(0);\n\t\t} // input validation Y or N\n\t\t\n\t\treturn runAgainChar; //returns a Y or N \n\t\t\n\t}", "public void playAgain();", "public boolean playAgain(Players players) {\n boolean decide = false;\n if (getLastPlayer().equals(players.getPlayerName())) {\n decide = true;\n }\n resetPass();\n return decide;\n }", "public static void main(String[] args) {\r\n Scanner scan = new Scanner(System.in);\r\n Random generator = new Random();\r\n final int cap = 100;\r\n String answer = \"Y\";\r\n do {\r\n int numToGuess;\r\n int guess = -1;\r\n int count = 0;\r\n answer = \"Y\";\r\n numToGuess = generator.nextInt(cap) + 1; \r\n System.out.print(\"Please guess the integer number between\"\r\n + \" 1 and 100.\\nIf you wish to quit, type, \\\"0.\\\" \");\r\n while (guess != 0) {\r\n guess = scan.nextInt();\r\n System.out.println(\"Your guess was...\" + guess);\r\n if (guess > cap || guess < 0) {\r\n throw new IllegalArgumentException(\"Input cannot be more \"\r\n + \"than 100 or less than 0. To quit the input must\"\r\n + \" be -1\");\r\n } else if (guess == 0) {\r\n System.out.println(\"Quitting game...\\n\");\r\n } else if (guess > numToGuess) {\r\n System.out.println(\"That number is too high.\");\r\n count++;\r\n } else if (guess < numToGuess) {\r\n System.out.println(\"That number is too low.\");\r\n count++;\r\n } else if (guess == numToGuess) {\r\n System.out.println(\"That was correct.\");\r\n guess = 0;\r\n count++;\r\n }\r\n \r\n }\r\n System.out.println(\"Number of guesses for this game: \" + count);\r\n System.out.println(\"Would you like to play again? \\n\\\"N\\\" for no,\"\r\n + \" or any other input to start a new game.\");\r\n answer = scan.next();\r\n } while (!answer.equals(\"N\"));\r\n System.out.println(\"Goodbye!\");\r\n }", "@Override\n public String getGuess() throws TimeoutException {\n\n int count = 1;\n\n while (this.answers.size() - count >0){\n if(this.answers.get(answers.size()-count).equals(\"yes\")) {\n\n return excuteQuery(this.getQuery(\"Guess\", \"Question=\" + \"'\" + this.questions.get(questions.size() -count) + \"'\"))\n .replaceAll(\"</br>\", \"\\n\");\n }\n count++;\n }\n\n return \"no result found\\n\";\n\n\n }", "public static void main(String[] args) {\n\t\tint computerNum = (int)(Math.random()*100) + 1; \r\n\t\t//Code generates a decimal -> multiple by 100 to make it a whole number ->\r\n\t\t//use int to convert to integer to cut off decimal\r\n\t\tint userGuess = -100;\r\n\t\tint guessCount = 0;\r\n\t\twhile (userGuess != computerNum && userGuess != -1) {\r\n\t\t\tString input = JOptionPane.showInputDialog(null, \"This is a number guessing game. \"\r\n\t\t\t\t\t+ \"\\nPlease guess a whole number between 1 and 100.\");\r\n\t\t\tuserGuess = Integer.parseInt(input);\r\n\t\t\t//JOptionPane.showMessageDialog(null, \"Your guess was \" + userGuess + \".\");\r\n\t\t\tif (userGuess == -1){\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"You have chosen to leave the program.\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\telse if (userGuess < 0 || userGuess > 100){\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Your number is invalid.\"\r\n\t\t\t\t\t\t+ \" Please enter a number between 1 and 100.\");\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (userGuess > computerNum){\r\n\t\t\t\tif (userGuess - 10 <= computerNum) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Your guess a little too high, \"\r\n\t\t\t\t\t\t\t+ \" but within 10 of the number! Guess a little lower.\");\r\n\t\t\t\t\t//guessCount ++; \r\n\t\t\t\t\t//return guessCount;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Your guess was too high! \"\r\n\t\t\t\t\t\t\t+ \"Make a lower guess.\");\r\n\t\t\t\t\t//guessCount ++;\r\n\t\t\t\t}\r\n\t\t\t\tguessCount ++;\r\n\t\t\t}\r\n\t\t\telse if (userGuess < computerNum) {\r\n\t\t\t\tif (userGuess + 10 >= computerNum) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Your guess was a little too low, \"\r\n\t\t\t\t\t\t\t+ \"but within 10 of the number! Guess a little higher.\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tJOptionPane.showConfirmDialog(null, \"Your guess was too low!\"\r\n\t\t\t\t\t\t\t+ \" Make a higher guess.\");\t\r\n\t\t\t\t}\r\n\t\t\t\tguessCount ++;\r\n\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Yay! You guessed correctly!\");\r\n\t\t\t}\r\n\t\t\t//JOptionPane.showMessageDialog(null, \"# = \" + computerNum +\r\n\t\t\t\t\t//\"# of guesses = \" + guessCount);\r\n\t\t}\r\n\t\tJOptionPane.showMessageDialog(null, \"The random number was: \" + computerNum +\r\n\t\t\t\t\"\\nIt took you \" + guessCount + \" guesses.\");\r\n\r\n\t}", "public static void main(String[] args) {\n Random rand = new Random();\r\n int answer = rand.nextInt(10) + 1;\r\n Scanner sc = new Scanner(System.in);\r\n System.out.println(\"John's Guessing Game\");\r\n System.out.println(\"Guess a number between 1 and 10\");\r\n\r\n while (true) {\r\n System.out.print(\"Enter a number: \");\r\n int guess = sc.nextInt();\r\n if (guess == answer) {\r\n break;\r\n } else if (guess >= answer) {\r\n System.out.println(\"The number is lower, try again...\");\r\n } else {\r\n System.out.println(\"The number is higher, try again...\");\r\n }\r\n }\r\n System.out.println(\"You got it!!!\");\r\n }", "private void tryGuess(char letter) {\n\t\tSystem.out.println(\"=============================\");\n\t\t// if the same guess has been done before, print corresponding information\n\t\tif (this.guessedLetters.contains(letter)){\n\t\t\tSystem.out.println(\"Letter already guessed, try another one.\");\n\t\t}else {\n\t\t\t// else, update the guessedLetters\n\t\t\tthis.guessedLetters.add(letter);\n\t\t\t// if the guess is correct\n\t\t\tif(this.word.takeGuess(letter)) {\n\t\t\t\t// print corresponding information\n\t\t\t\tSystem.out.println(\"Correct letter!\");\n\t\t\t}else {\n\t\t\t\t// else, add the letter to the wrongLetters list\n\t\t\t\tthis.wrongLetters.add(letter);\n\t\t\t\t// increase the count of wrong guesses\n\t\t\t\tthis.numOfWrongGuess ++;\n\t\t\t\t// print out the corresponding information\n\t\t\t\tSystem.out.println(\"Wrong letter, better luck next turn.\");\n\t\t\t}\n\t\t}\n\t}", "boolean hasCorrectAnswer();", "public static void main(String[] args) {\n\t\t\r\n\t\tSystem.out.println(\"Welcome to the very generic game of...Guess the Number!\");\r\n\t\t\r\n\t\tScanner difficultyChoice = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.println(\"Select parameters below. 1 = 1-15, 2 = 1-25, and 3 = 1-50\");\r\n\t\t\r\n\t\tString choice = difficultyChoice.nextLine();\r\n\t\t\r\n\t\tint selection = 0;\r\n\t\t\r\n\t\tdo {\r\n\t\t\tif(choice.equals(\"1\")){\r\n\t\t\t\tselection = 1;\r\n\r\n\t\t\t} else if(choice.equals(\"2\")) {\r\n\t\t\t\tselection = 2;\r\n\r\n\t\t\t} else if(choice.equals(\"3\")) {\r\n\t\t\t\tselection = 3;\r\n\t\t\t}\r\n\t\t\tif(selection == 0) {\r\n\t\t\t\tSystem.out.println(\"Invalid entry. Please try again. Remember* 1 for 1-25, 2 for 1-50, and 3 for 1-100\");\r\n\t\t\t\tchoice = difficultyChoice.nextLine();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t} while(selection ==0);\r\n\t\t\r\n\t\tRandom computerNumber = new Random();\r\n\r\n\t\tint randomNum = 0;\r\n\r\n\t\tif(selection == 1){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(15);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-15. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif(selection == 2){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(25);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-25. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif(selection == 3){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(50);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-50. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint guessTotal = 0;\r\n\r\n\t\tRandom RandomNum = computerNumber; \r\n\r\n\t\tScanner playerGuess1 = new Scanner(System.in);\r\n\r\n\t\tSystem.out.println(\"Please enter your first guess on the line below: \");\r\n\r\n\t\tint guess1 = playerGuess1.nextInt();\r\n\r\n\t\tif(guess1 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your first try!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\t\r\n\t\tif(guess1 != randomNum) {\r\n\t\t\tguessTotal = 1;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 2)\");\r\n\t\t\tif(guess1 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t}else\r\n\t\t\t{\r\n\t\t\t\tif(guess1 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tScanner playerGuess2 = new Scanner(System.in);\r\n\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\t\t\t\");\r\n\r\n\t\tSystem.out.println(\"Please enter your second guess on the line below: \");\r\n\r\n\t\tint guess2 = playerGuess2.nextInt();\r\n\r\n\t\tif(guess2 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your second try!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tif(guess2 != randomNum) {\r\n\t\t\tguessTotal = 2;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 1)\");\r\n\t\t\tif(guess2 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t} else {\r\n\t\t\t\tif(guess2 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tScanner playerGuess3 = new Scanner(System.in);\r\n\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\t\t\t\");\r\n\r\n\t\tSystem.out.println(\"Please enter your third guess on the line below: \");\r\n\r\n\t\tint guess3 = playerGuess3.nextInt();\r\n\r\n\t\tif(guess3 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your third try!\");\r\n\t\t}\r\n\r\n\t\tif(guess3 != randomNum) {\r\n\t\t\tguessTotal = 3;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 0) Game over!\");\r\n\t\t\t/*if(guess3 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t} else {\r\n\t\t\t\tif(guess3 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\");\r\n\t\t\tSystem.out.println(\"The correct number was \" + randomNum);\r\n\t\t}", "public Main()\n {\n \n Random rand = new Random();\n int n = rand.nextInt(10);\n n+=1;\n \n Scanner sc = new Scanner(System.in);\n int i = 0;\n do {\n \n i = sc.nextInt();\n\n //System.out.println(i);\n if(i<n){\n System.out.println(\"too small\");\n if (previousNum!=i){\n count += 1;\n }\n }\n else if(i>n){\n System.out.println(\"too big\");\n if (previousNum!=i){\n count +=1;\n }\n }\n else {\n System.out.println(\"correct guess\");\n \n count +=1;\n \n }\n \n previousNum = i;\n }while (i!=n);\n System.out.println(\"it took you \"+count+\" guesses!\");\n \n }", "public static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tSystem.out.println(\"TRY TO GUESS MY SECRET NUMBER\");\n\n\t\tint secretnumber = 17;\n\n\t\tint guess;\n\t\tguess = scan.nextInt();\n\n\t\twhile (!(guess == secretnumber)) {\n\t\t\tSystem.out.println(\"try again\");\n\t\t\tguess = scan.nextInt();\n\t\t}\n\n\t\tSystem.out.println(\"congrats\");\n\n\t}", "public boolean alreadyGuessed(char guess) {\r\n return this.guesses.contains(guess);\r\n }", "public static boolean badEndGame() {\n InputStreamReader sr = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(sr);\n String choice = null;\n try {\n\n while (true) {\n System.out.println(\" - - Хотите ОСТАТЬСЯ в мире дракона или ВЫПОЛНИТЬ задачу и избавить королевство Тельранион от демотивации и лени? - -\");\n System.out.println(\"-> \");\n choice = br.readLine();\n if (choice.equalsIgnoreCase(\"выполнить\")) {\n System.out.println(\"- ЗА КОРОЛЯ! ЗА ТЕЛЬРАНИОН!\");\n return true;\n }\n\n if (choice.equalsIgnoreCase(\"остаться\")) {\n System.out.println(\"*Вы сделали свой выбор. Никто и никогда не вспомнит о Вашем существовании.\\n\" +\n \" _ПОТРАЧЕНО_ \\n\" +\n \"GAME OVER\");\n break;\n } else {\n System.out.println(\"Если, из-за твоих тестов, нас сожрет дракон - Король нас казнит! А я скажу, что это все твоя вина!\");\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n return false;\n }", "public int play(NumberGame game) {\n\t\tboolean correct = false ; \n\t\tint guess = 0 ;\n\t\tint min = 1 ;\n\t\tint max = game.getUpperBound() ;\n\t\tdo {\n\t\tSystem.out.print(\"Your answer? \");\n\t\tguess = min+((max-min)/2); \n\t\tcorrect = game.guess(guess);\n\t\tSystem.out.println(guess);\n\t\tif(game.getMessage().equals(\"The number is too small\")) {\n\t\t\tmin = guess+1 ; \n\t\t}else if(game.getMessage().equals(\"The number is too large\")) {\n\t\t\tmax = guess-1 ;\n\t\t}\n\n\t\tSystem.out.println( game.getMessage() );\n\t\t}while(!correct);\n\t\treturn guess ;\n\t}", "private void finaliseGame() {\r\n gameOn = false;\r\n if(bestAnswer==null) {\r\n target.reply(\"Nobody got an answer. The best answer was: \" + CountdownSolver.Solve( sourceNumbers, targetNumber ));\r\n return;\r\n }\r\n if( bestAnswer.getAnswer() == bestPossibleAnswer ) {\r\n String reply = Constants.BOLD + bestAnswer.getUsername() + Constants.BOLD\r\n + \" has won with \" + bestAnswer.getAnswer() + \"!\";\r\n if( bestPossibleAnswer!=targetNumber)\r\n reply+=\" This was the best possible answer.\";\r\n target.reply(reply);\r\n } else {\r\n target.reply( \"The best answer was \" + bestAnswer.getAnswer() + \" by \" + bestAnswer.getUsername() + \".\"\r\n + \" But the best possible answer was: \" + CountdownSolver.Solve( sourceNumbers, targetNumber ));\r\n }\r\n bestAnswer=null;\r\n runner.stop();\r\n }", "@Override\n\tpublic boolean endChk() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t\tif ( rowChoice == 0 || totalPebbles == 0 ){\n\t\t\trunGame = false;\n\t\t}\n\t\treturn runGame;\n\t}", "public boolean endGameCheck() {\r\n\r\n if (forceQuit) {\r\n // Silently quit.\r\n return true;\r\n\t\t}\r\n\r\n String[][] messages = new String[7][2];\r\n String[] theMessage = new String[2];\r\n Random randInt = new Random();\r\n boolean userSaidYes = false;\r\n\r\n // Just for comedy value :p\r\n messages[0][0] = \"Giving up already?\";\r\n messages[1][0] = \"Are you sure you want to quit?\";\r\n messages[2][0] = \"Don't you want to play some more?\";\r\n messages[2][1] = \"Confusing isn't it? :p\";\r\n messages[3][0] = \"Quit? Do you reeeeeeeealy want to do that?\";\r\n messages[4][0] = \"You want to quit? Fine be like that...\";\r\n messages[5][0] = \"Ugh, you didn't come here to quit did you?\";\r\n messages[6][0] = \"Pft, game not good enough for ya!?\";\r\n messages[6][1] = \"Oh! There goes another one ;)\";\r\n\r\n // Give the user a random message. This is an array\r\n // which has an element that tells us what polarity\r\n\t\t// the question is.\r\n theMessage = messages[randInt.nextInt(messages.length)];\r\n\r\n if (endGameSwitch) {\r\n\r\n // Just double check with the user.\r\n System.out.print(\"\\n \" + theMessage[0]);\r\n userSaidYes = saidYes(true);\r\n\r\n if ((userSaidYes == false) && (theMessage[1] == null)\r\n\t\t\t|| (userSaidYes == true) && (theMessage[1] != null)) {\r\n \r\n // Player has changed their mind! :D\r\n\t\t\t\tSystem.out.println(\" You made the right choice :)\");\r\n bluffedQuit = true;\r\n endGameSwitch = false;\r\n return false;\r\n\t\t\t}\r\n\r\n // Player is a big meanie.\r\n System.out.println(\"\\n Game Over!\");\r\n setForceQuit(true);\r\n return true;\r\n\t\t}\r\n\r\n // Don't bother the user.\r\n return false;\r\n\t}", "@Override\n\t\tpublic boolean wasRetried()\n\t\t{\n\t\t\treturn false;\n\t\t}", "public static void confirmGuess(String guess) {\n\n\t\t//for debug purposes\n\t\tSystem.out.println(\"User guess is \" + guess + \" and the correct answer is \" + globalColor);\n\n\t\t//userGuess equals globalColor\n\t\tif ((guess.toLowerCase()).equals(globalColor.toLowerCase())) {\n\t\t\t//notify the user that they have won\n\t\t\tJOptionPane.showMessageDialog(null, \"Your guess is correct!!!\");\n\t\t\t\n\t\t//userGuess does not equal globalColor\n\t\t} else {\n\t\t\t//notify the user that they have lost\n\t\t\tJOptionPane.showMessageDialog(null, \"Your guess is incorrect. Try again.\");\n\t\t}\n\t}", "private void checkForPlayerChance()\n\t\t\t{\n\t\t\t\tf = false;\n\t\t\t\tfor (j = 0; j < 8; ++j)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (win[j] == 2 && lose[j] == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tf = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\tif (f == false)\n\t\t\t\t\tj = 10;\n\n\t\t\t}", "public static void checkWinner() {\n\t\tcontinueGame = false;\n\t\tfor (int k = 0; k < secretWordLength; k++) {\n\t\t\tif (!unseenBoard.get(k).equals(\"*\")) {\n\t\t\t\tcontinueGame = true;\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\n\t\tScanner keyboard = new Scanner(System.in); //creates keyboard for input\n\t\tRandom rand = new Random(); //generates random number between 1 and 20\n\t\tint num = rand.nextInt(20) + 1; //variable for generated number\n\t\tint playerGuess; //variable for player's guess\n\t\tboolean correct = false; //boolean expression used to end while loop once guess is correct\n\n\t\tSystem.out.println(\"I am thinking of a number between 1 and 20.\");\n\t\tSystem.out.println(\"The machine number is: \" + num); //Prints the machine guess for easy testing\n\n\t\tdo { \n\t\t System.out.println(\"\\nWhat is your guess: \");\n\t \ttry {\n\t \t playerGuess = keyboard.nextInt(); //initiates variable for guesses\n\t \t if (playerGuess > 20 || playerGuess < 1) { //if player's guess is out of range\n\t \t System.out.println(\"Please enter a number between 1 and 20.\");\n\t \t } else if (playerGuess < num) { //if player guess is too low\n\t \t System.out.println(\"Too low.\");\n\t } else if (playerGuess > num) { //if player guess is too high\n\t System.out.println(\"Too high.\");\n\t } else { //correct guess\n\t System.out.println(\"Congratulations! You are correct!\");\n\t keyboard.close(); //closes scanner\n\t correct = true; //exits while loop\n\t \t}\n\t \t} catch (InputMismatchException e) { //if player does not enter an integer\n\t \t System.out.println(\"Please enter an integer.\");\n\t \t keyboard.next(); //moves onto next keyboard input\n\t \t}\n\t\t} while (correct == false); //moves onto next iteration in while loop\n\t}", "public boolean DoBlackMagic()\n{\n\tRandom generator=new Random();\n\tint result=generator.nextInt(4);\n\tif(result==0)\n\t{\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n\n}", "public boolean getGotLucky()\n {\n return (die1.getFacevalue() == 6 && die2.getFacevalue() == 6 && lastThrow[0] == 6 && lastThrow[1] == 6);\n }", "public void tryRehearse() {\n if (currentPlayer.isEmployed() == true) {\n if(!currentPlayer.getHasPlayed()){\n currentPlayer.rehearse();\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end your turn.\");\n }\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"You're not employed, so you need to take a role before you can rehearse.\");\n }\n view.updateSidePanel(playerArray);\n }", "public static void main(String[] args) {\n //Calculate the optimal number of guesses\n int OPTIMALGUESSCNT = getlog(UPPERBOUND,10);\n\n //Begin game\n System.out.println(\"This is the High Low Game. You WILL have fun.\");\n\n //Print Name\n Scanner input = new Scanner(System.in);\n System.out.println(\"Enter your name or be annihilated: \");\n\n String name = validateInputStr();\n if (name.isEmpty()) {\n System.out.println(\"You didn't enter a name. You must be Nobody. Glad I'm not a cyclops, haha jk, unless...\\nHello Player 1.\");\n }\n System.out.printf(\"Hello %s\\n\", name);\n\n boolean playAgain = false;\n int total_guesses = 0;\n short num_games = 0;\n do { //setup each game\n int game_guesses = 0;\n int secretNum = getSecretNum(Integer.parseInt(\"BEEF\",16));\n int guess = -1;\n int prev_guess = -1;\n while (guess != secretNum) { //A single game seshion\n Scanner scanGuess = new Scanner(System.in);\n System.out.println(\"Guess a number between 0 and 100: \");\n guess = validateInput();\n ++game_guesses;\n if (guess > UPPERBOUND || guess <= 0) {\n System.out.println(\"Your guess wasn't even in the range given!\");\n }\n if (guess > secretNum) {\n if (prev_guess != -1 && guess >= prev_guess && prev_guess >= secretNum) {\n System.out.println(\"You incorrectly guessed even higher this time! Lower your angle of attack!\");\n }\n System.out.println(\"You guessed too high.\");\n prev_guess = guess;\n }\n else if (guess < secretNum) {\n if (prev_guess != -1 && guess <= prev_guess && prev_guess <= secretNum) {\n System.out.println(\"You incorrectly guessed even lower this time! Aim high airman!\");\n }\n System.out.println(\"You guessed too low.\");\n prev_guess = guess;\n }\n else {\n //The game has effectively ended -> List Win Possibilities\n selectWinOption(game_guesses, OPTIMALGUESSCNT);\n //Check whether to play again\n boolean goodInput = false;\n while (!goodInput) {\n System.out.println(\"Would you like to play again? Enter yes (y) or no (n): \");\n Scanner clearBuff = new Scanner(System.in);\n String raw_playAgain = \"\";\n raw_playAgain = validateInputStr();\n //check input (I didn't feel like using Patterns\n if (raw_playAgain.equalsIgnoreCase(\"yes\") || raw_playAgain.equalsIgnoreCase(\"y\")) {\n playAgain = true;\n goodInput = true;\n }\n else if (raw_playAgain.equalsIgnoreCase(\"no\") || raw_playAgain.equalsIgnoreCase(\"n\")) {\n playAgain = false;\n goodInput = true;\n }\n else {\n System.out.println(\"Enter valid input! Ahhhh.\");\n }\n } //end check play again input\n }\n }\n System.out.println(\"You had \" + game_guesses + \" guesses during this game.\\n\\n\");\n total_guesses += game_guesses;\n ++num_games;\n }while(playAgain);\n\n printEndDialogue(total_guesses, num_games, OPTIMALGUESSCNT);\n }", "@Override\n public boolean isGameOver() {\n //TODO Implement this method\n return false;\n }", "private void playGame() {\n \twhile (guessesLeft > 0) {\n \t\twhile (true) {\n \t\t\tstr = readLine(\"Your guess: \");\n \t\t\tif (str.length() != 1) {\n \t\t\t\tprintln(\"You can only enter one symbol!\");\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\tboolean bl = false;\n \t\t\t\n \t\t\t// Change string and char to uppercase\n \t\t\tstr = str.toUpperCase();\n \t\t\tchar ch = str.charAt(0);\n \t\t\t\n \t\t\tfor (int i = 0; i < guesses.length(); i++) {\n \t\t\t\tif (ch == guesses.charAt(i)) {\n \t\t\t\t\tprintln(\"This letter has already written. Enter another one!\");\n \t\t\t\t\tbl = true;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (bl) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\tbreak;\n \t\t}\n \t\t\n \t\t// Change string and char to uppercase\n \t\tstr = str.toUpperCase();\n \t\tletter = str.charAt(0);\n\n \t\tguesses += letter;\n \t\t\n \t\t// Check if word contains entered letter\n \t\tif (checkWord()) {\n \t\t\tprintln(\"That guess is correct.\");\n \t\t}\n \t\telse {\n \t\t\tprintln(\"There are no \" + letter + \"'s in the word.\");\n \t\t\tincorrectLetters += letter;\n \t\t\tcanvas.noteIncorrectGuess(incorrectLetters);\n \t\t\tguessesLeft--;\n \t\t}\n \t\t\n \t\tif (numberOfSymbols < word.length()) {\n \t\t\tprint(\"The word now looks like this: \");\n \t\t\tfor (int i = 0; i < word.length(); i++) {\n \t\t\t\tif (list[i] == true) {\n \t\t\t\t\tprint(word.charAt(i));\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\tprint(\"-\");\n \t\t\t\t}\n \t\t\t}\n \t\t\tprintln();\n \t\t\t\n \t\t\tif (guessesLeft == 1) {\n \t\t\t\tprintln(\"You have only one guess left.\");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tprintln(\"You have \" + guessesLeft + \" guesses left.\");\n \t\t\t}\n \t\t}\n \t\telse {\n \t\t\tif (numberOfSymbols == word.length()) {\n \t\t\t\twin = true;\n \t\t\t\tprintln(\"You guessed the word: \" + word);\n \t\t\t\tprintln(\"You win.\");\n \t\t\t\tcanvas.displayWord(word);\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n\t\t\t\t\n \t}\n \t\n \tif (win == false) {\n \t\tprintln(\"You're completely hung.\");\n \t\tprintln(\"The word was: \" + word);\n \t\tprintln(\"You loose.\");\n \t\tcanvas.displayWord(word);\n \t}\n \t\n \tstartNext();\n }", "public boolean oneRound (){\r\n\r\n\t if(this.isOver()){\r\n\t\t return false;\r\n\t }\r\n\t \r\n\t //\r\n\t int p= trick.pick(player1);\r\n\t int p2=trick.pick(player2);\r\n\t \r\n\t while(p==p2){\r\n\r\n\t\tfor(int i=0; i<2; i++){\r\n\t\t\t\r\n\r\n\t\t\t if(this.isOver()){\r\n\t\t\t\t \r\n\t\t\t\t p=trick.pick(player1);\r\n\t\t\t\t p2=trick.pick(player2);\r\n\t\t\t\t return false;\r\n\t\t\t }\r\n\t\t\t \r\n\t\t}\r\n\t\tif(p>p2){\r\n\t\t\t\r\n\t\t\tplayer1.pickAll(trick);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tplayer2.pickAll(trick);\r\n\t\t\t\r\n\t\t}\r\n\t }\r\n\treturn true;\r\n\t \r\n }", "public void checkGameStatus() {\n everyTenthGoalCongrats();\n randomPopUpBecauseICan();\n }", "public boolean needTryAgain() {\n boolean z = this.mRetryConnectCallAppAbilityCount < 6;\n this.mRetryConnectCallAppAbilityCount++;\n return z;\n }", "public boolean isGuessed() {\n return isGuessed;\n }", "public void clearGuess() {\n\t\tthis.guessTimes = 0;\n\t}", "private static int coinFlip() {\n\t\tint num = (Math.random() <= 0.5) ? 1 : 2; \n\t\tString answer;\n\t\tif ( num == 1) {\n\t\t\tanswer = \"h\";\n\t\t}else {\n\t\t\tanswer = \"t\";\n\t\t}\n\t\t\n\t\t\n\t\tScanner input = new Scanner(System.in);\n\t\t\n System.out.print(\"Enter you guess (h = heads, t = tails):\");\n String guess = input.next();\n //change the guess to lower case to accept both capital or lower case answer\n guess.toLowerCase();\n \n //gain 50 points if win the toss\n if ( guess.equals(answer)) {\n \t//System.out.println(\"You won the toss, congratulation! +50 points\");\n \treturn 50;\n }else {\n \t //System.out.println(\"Wrong guess! 0 points\");\n \t return 0;\n }\n \n\t}", "boolean isGameOver();", "boolean isGameOver();", "public boolean attempt() {\n if(coolDownReleaseDate != null) {\n if(coolDownReleaseDate.before(new Date())) {\n coolDownReleaseDate = null;\n errorRate = null;\n } else {\n return false;\n }\n }\n // else\n initErrorRateIfNeccessary();\n errorRate.incDenominator(); // another game service attempt\n return true;\n }", "private static void playGame(int maxGuessCount) {\n Random random = new Random();\n int randomNumber = random.nextInt(50) + 1;\n\n // track user guesses and set a limit\n int userGuess;\n int guessCount = 0;\n\n // INITIALIZE GAME\n\n // the number range is modified through param when calling method validateInput\n System.out.println(\"Please type a number between 1 and 50.\");\n\n while (guessCount < maxGuessCount) {\n guessCount++;\n // put param for lowest and highest number range\n userGuess = validateInput(1, 50);\n\n if (userGuess == randomNumber) {\n System.out.println(\"That's right, you won!\");\n break;\n }\n if (userGuess < randomNumber) {\n System.out.println(\"Nope, try something higher.\" + \"\\n\");\n continue;\n } else if (userGuess > randomNumber) {\n System.out.println(\"Nope, try something lower.\" + \"\\n\");\n continue;\n }\n }\n\n // decide if game should restart or not\n System.out.println(\"\\n\" + \"Would you like to start over?\" + \"\\n\" + \"1. Yes\" + \"\\n\" + \"2. No\");\n int playAgainOrNot = validateInput(1, 2);\n\n switch (playAgainOrNot) {\n case 1:\n playAgain = true;\n break;\n case 2:\n System.out.println(\"Ok, see you next time.\");\n playAgain = false;\n break;\n }\n\n }", "boolean disruption() {\n disruption_seed = disruption_seed * 1103515245 + 12345;\n long disruption_director = (disruption_seed / 65536) % 32768;//The bits considered is changed so that c4 is unique\n int disruption_director1 = (int) ((disruption_director >> 4) & 7);\n\n switch (disruption_director1) /* Check the randomness of the pseudo random generator */ {\n case 0 -> zero++;\n case 1 -> one++;\n case 2 -> two++;\n case 3 -> three++;\n case 4 -> four++;\n case 5 -> five++;\n case 6 -> six++;\n case 7 -> seven++;\n default -> other++;\n }\n\n if (/*(disruption_director == 0)||(disruption_director == 1)||(disruption_director == 2)||(disruption_director == 3)||*/(disruption_director == 4) || (disruption_director == 5) || (disruption_director == 6) || (disruption_director == 7)) /* Disrupt 50% of the time */ {\n System.out.printf(\"Disruption %d \\n\", disruption_director);\n //Sleep(100);\n return false;\n } else {\n return true;\n }\n }", "boolean hasCorrect();", "private static int guessing() {\n\t\t\n\t\tSystem.out.println(\"Guess a number between 1 and 100, you have 5 trials: \");\n\t\t\n\t\tint trials = 5;\n\t\tScanner input = new Scanner(System.in);\n\t\t\n\t\t//set a random number as the number to be guessed\n\t\tint num = (int)(100 * Math.random()) + 1;\n\t\tint points = 0;\n\t\t\n\t\t//use a flag to check if player guess the correct number or not\n\t\tboolean flag = false;\n\t\twhile ( trials > 0) {\n\t\t\tint guess = input.nextInt();\n\t\t\ttrials--;\n\t\t\tif ( guess == num ) {\n\t\t\t\tpoints = trials == 0? 20 : trials * 20;\n\t\t\t\t//System.out.println(\"You guess the number with\"+trials+\"trials left, congratulation! +\"+ (points = trials == 0? 20 : trials * 20)+\" points\");\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}else if ( guess < num ) {\n\t\t\t\tSystem.out.println(\"The guess is too small, please try again, you have \"+trials+\" trials left.\");\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"The guess is too large, please try again, you have \"+trials+\" trials left.\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif ( !flag ) System.out.println(\"Trials used up, + 0 points\");\n\t\treturn points;\n\t\t\n\t}", "public boolean getPlayAgain() {\r\n\t\treturn playAgain;\r\n\t}", "public static void main(String [] args){\n int randomNumber = (int) (Math.random()*100);\r\n\r\n // creating a scanner object\r\n Scanner scanner = new Scanner(System.in);\r\n\r\n // instructions\r\n System.out.println(\"I will choose a Number randomly between 1 - 100\");\r\n System.out.println(\"Try to guess it.\");\r\n\r\n for(int i = 10; i > 0; i--){\r\n\r\n System.out.println(\"you Currently have \" + i + \" guess(es) left choose again:\");\r\n\r\n // taking user input\r\n int guess = scanner.nextInt();\r\n\r\n if (guess > randomNumber){\r\n System.out.println(\"It's smaller than: \" + guess + \" try again.\");\r\n }else if (guess < randomNumber){\r\n System.out.println(\"It's bigger than: \" + guess + \" try again.\");\r\n } else{\r\n System.out.println(\"You Win! \" + guess);\r\n break;\r\n }\r\n }\r\n }", "public static Boolean tryAgainBtn() throws Exception {\n\t\tboolean checkPage=false;\n\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"markpage\\\"]/center/button[1]\")).click();\n\t\tif (driver.getPageSource().contains(QandA.getQuestion(0))||driver.getPageSource().contains(QandA.getQuestion(1))||driver.getPageSource().contains(QandA.getQuestion(2))){\n\t\t\tcheckPage=true;\n\t\t}\n\t\treturn checkPage;\n\t}", "private boolean isWrong() {\n\t\treturn wrongMatches >= 5;\n\t}", "boolean hasHangmogCode();", "void checkWinner() {\n\t}", "public static void main( String[] args) \r\n {\n Scanner scan; \r\n HangMan game; \r\n String userInput; \r\n String letter; \r\n int errorValue;\r\n boolean temp;\r\n \r\n //Initialize the variables (other variables will be given values as program proceeds) \r\n scan = new Scanner( System.in); \r\n temp = true; \r\n \r\n //Create the user-interface and play the game \r\n while( temp ) \r\n { \r\n game = new HangMan(); \r\n System.out.println( \"Welcome to Hang-man game\"); \r\n System.out.println( \"You have \" + 6 + \" tries\"); \r\n System.out.println( \"Enter any button except q to proceed, q to quit\"); \r\n userInput = scan.next(); \r\n \r\n //Outer loop for re-playing of the game\r\n if( !userInput.equals( \"q\")) \r\n { \r\n //Inner loop for the simulation of the game \r\n while( !game.isGameOver() && !game.hasLost()) \r\n { \r\n System.out.println( \"The word that you're looking for: \" + game.knownSoFar); \r\n System.out.println( \"Number of tries left : \" + (6 - game.numberOfIncorrectTries)); \r\n System.out.println( \"Letters in the english alphabet: \" + game.allLetters); \r\n System.out.println( \"Used letters: \" + game.usedLetters); \r\n System.out.println( \"Please enter a letter\");\r\n letter = scan.next(); \r\n errorValue = game.tryThis( letter.charAt(0) /* or just letter itself (depending on the implementation of the method)*/); \r\n \r\n if( errorValue == -1) // Invalid input \r\n {\r\n System.out.println( \"Please enter a valid letter\"); \r\n }\r\n else if( errorValue == -2) // Repeated letter \r\n {\r\n System.out.println( \"You entered this letter before, please enter a different letter\"); \r\n }\r\n else if( errorValue == 1) // Correct answer 1 repetition \r\n {\r\n System.out.println( \"The letter you entered is repeated 1 time\"); \r\n }\r\n else if( errorValue > 1) // Correct answer multiple representation\r\n {\r\n System.out.println( \"The letter you entered is repeated \" + errorValue + \" times\"); \r\n }\r\n else if( errorValue == 0) // Wrong answer \r\n {\r\n System.out.println( \"Unfortunately the letter you entered is not in the word\"); \r\n }\r\n else if( errorValue == -3) // Game Over \r\n {\r\n System.out.println( \"Game Over\"); \r\n }\r\n if( game.hasLost()) \r\n {\r\n System.out.println( \"Unfortunately, you lost\"); // Implementing a method showing the secret word would be nice \r\n }\r\n else if( game.isGameOver()) \r\n {\r\n System.out.println( \"You won, congratulations\"); \r\n }\r\n } \r\n } \r\n \r\n else \r\n { \r\n temp = false; \r\n System.out.println( \"Bye - bye, thanks for playing\"); \r\n } \r\n } \r\n }", "private int userLoing() {\n\t\t\n\t\tScanner scan2 = new Scanner(System.in);\n\t\tSystem.out.println(\"\\nPour vous rappler, pour quitter il faut entrer q ou quit pour quitter \\navant de commencer de saisir de mot de passe.\\n\"+\n\t\t\t\t\n\t\t\t\t\"--------------------------------------------------------------------------------------\");\n\t\tboolean correct = true; //To check the confirmation of the password\n\t\t\n\t\t\n\t\t//to get the user's name\n\t\tString nom;\n\t\tdo {\n\t\t System.out.print(\"Entrez un nom d'une longueur qui > 4: \");\n\t\t nom = scan2.nextLine();\n\t\t} while ((nom.length() < 4) && !(nom.equalsIgnoreCase(\"q\")) && !(nom.equalsIgnoreCase(\"quit\")));\n\t\t\n\t\tif(nom.equalsIgnoreCase(\"q\") || nom.equalsIgnoreCase(\"quit\")) {\n\t\t\tSystem.out.println(\"\\n-----------------------------------------------------\\nVous avez été dérigé vers le meun principal!\\n-----------------------------------------------------\");\n\t\t\tcorrect = true;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t\n\t\t\t//for the password and the confirmation\n\t\t\t\n\t\t\twhile(correct) {\n\t\t\t\tint mdp;\n\t\t\t\tdo {\n\t\t\t\t System.out.print(\"Entrez un mot de passe qui contient au moins 6 chiffres SVP: \");\n\t\t\t\t while (!scan2.hasNextInt()) {\n\t\t\t\t\t System.err.print(\"Entrez un mot de passe qui contient au moins 6 chiffres SVP: \");\n\t\t\t\t scan2.next();\n\t\t\t\t }\n\t\t\t\t mdp = scan2.nextInt();\n\t\t\t\t} while (Integer.toString(mdp).length() < 6);\n\t\t\t\t\n\t\t\t\tint mdp2;\n\t\t\t\tdo {\n\t\t\t\t System.out.print(\"Confirmez vôtre mot de passe SVP : \");\n\t\t\t\t while (!scan2.hasNextInt()) {\n\t\t\t\t\t System.err.print(\"Confirmez vôtre mot de passe : \");\n\t\t\t\t scan2.next(); \n\t\t\t\t }\n\t\t\t\t mdp2 = scan2.nextInt();\n\t\t\t\t} while (Integer.toString(mdp2).length() < 6);\n\t\t\t\t\n\t\t\t\tcorrect = mdp == mdp2 ? false: true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tint res = !correct? 1 : 0;\n\t\treturn res;\n\t\t\n\t}", "public boolean gameOver()\n {\n return checkmate()||draw()!=NOT_DRAW;\n }", "public boolean hasWon() {\n\t\tfor (int i = 0; i < wordToGuess.length(); i++) {\n\t\t\tchar letter = wordToGuess.charAt(i);\n\t\t\tif (!guessesMade.contains(letter)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public void restart() {\n this.getPlayerHand().getHandCards().clear();\n this.dealerHand.getHandCards().clear();\n this.getPlayerHand().setActualValue(0);\n this.getDealerHand().setActualValue(0);\n this.gameOver = false;\n this.playerBet = MIN_BET;\n this.roundCount = 0;\n this.isRunning = true;\n this.startGame();\n }", "private static void playGame()\n {\n initializeGame();\n System.out.println(textColor(\"white\",\"I have thought of a number, can you guess it?\"));\n Scanner guess = new Scanner(in);\n while(isPlaying)\n {\n // Give play information on how many guesses they have left\n System.out.print(textColor(\"blue\", \"Guesses left: \"));\n System.out.println(textColor(\"blue\", Integer.toString(guessesLeft)));\n if(showDebugInfo)\n {\n System.out.println(textColor(\"white\", String.format(\" %d (%d)\",bestGuess,secretNumber)));\n }\n // Ask for user input / guess\n System.out.println(textColor(\"cyan\", \"Enter your guess: \"));\n playerGuess = guess.nextInt();\n if (playerGuess > maxSecret)\n {\n // Cap player guess to max possible value\n System.out.print(textColor(\"yellow\",\"Guess is higher than possible maximum.\\nGuess is set to: \"));\n System.out.println(textColor(\"cyan\",Integer.toString(maxSecret)));\n }\n else if(playerGuess < minSecret)\n {\n // Cap player guess to min possible value\n System.out.print(textColor(\"yellow\",\"Guess is smaller than possible maximum.\\nGuess is set to: \"));\n System.out.println(textColor(\"cyan\",Integer.toString(minSecret)));\n }\n if (playerGuess == secretNumber)\n {\n // Player won\n System.out.print(textColor(\"white\",\"Congratulations! you have found my number: \"));\n System.out.println(textColor(\"cyan\",Integer.toString(secretNumber)));\n exitGame();\n }\n else if (secretNumber < playerGuess)\n {\n // Secret number is smaller than Player's guess\n System.out.printf(\"My number is %s\\n\",textColor(\"red\",\"LOWER\"));\n\n if(playerGuess - secretNumber < bestGuess)\n {\n bestGuess = playerGuess - secretNumber;\n }\n }\n else if (secretNumber > playerGuess)\n {\n // Secret number is larger than Player's guess\n System.out.printf(\"My number is %s\\n\",textColor(\"yellow\",\"HIGHER\"));\n if (secretNumber - playerGuess < bestGuess)\n {\n bestGuess = secretNumber - playerGuess;\n }\n }\n if (isPlaying)\n {\n switch(guessesLeft)\n {\n case 1:\n if(dangerZone(bestGuess))\n {\n // Player got close to finding the Secret Number, but still failed\n System.out.println(textColor(\"white\",\"You almost got me! My number was \"));\n System.out.println(textColor(\"yellow\",Integer.toString(secretNumber)));\n isPlaying = false;\n\n }\n else\n {\n if (safeLineUsed)\n {\n // Player could not find solution even after bonus guesses awarded\n System.out.print(textColor(\"white\",\"Sorry, the number I thought was \"));\n System.out.println(textColor(\"yellow\",Integer.toString(secretNumber)));\n isPlaying = false;\n }\n else\n {\n // Bonus Guesses award is triggered\n System.out.print(textColor(\"white\",\"Don't give up, here is \"));\n System.out.print(textColor(\"cyan\",Integer.toString(extraGuesses)));\n System.out.println(textColor(\"white\",\" extra guesses\"));\n safeLineUsed = true;\n guessesLeft += extraGuesses-1;\n }\n }\n break;\n\n default:\n // Keep reducing Guesses Left number\n guessesLeft--;\n break;\n }\n\n }\n }\n\n }", "private boolean checkForBigGameWin(){\n boolean truth = false;\n if (checkGameWin(getLettersOfAllGames())){\n truth = true;\n }\n return truth;\n }", "public boolean isGameOver() {\r\n\treturn false;\r\n }", "public static boolean craps()\n\t{\n\t\t/*\n\t\t * creating two dice and randomizing an integer from/including 1\n\t\t * to/including 6. evaluate if it won(natural), lost(craps) or set a\n\t\t * point(other). If it set a point roll until it gets that point (win)\n\t\t * or gets a sum of 7 (loss).\n\t\t */\n\t\tint dice1 = (int) (6 * Math.random() + 1);\n\t\tint dice2 = (int) (6 * Math.random() + 1);\n\t\tint sum1 = dice1 + dice2;\n\t\tint sum2 = -1; // sum2 in a more global range for else below.\n\t\tSystem.out.printf(\"You rolled %d + %d = %d\\n\", dice1, dice2, sum1);\n\t\t// craps if\n\t\tif (sum1 == 2 || sum1 == 3 || sum1 == 12)\n\t\t{\n\t\t\tSystem.out.printf(\"You lose\\n\");\n\t\t\treturn false;\n\t\t}\n\t\t// natural if\n\t\telse if (sum1 == 7 || sum1 == 11)\n\t\t{\n\t\t\tSystem.out.printf(\"You win\\n\");\n\t\t\treturn true;\n\t\t} else\n\t\t{\n\t\t\twhile (sum1 != sum2 && sum2 != 7)\n\t\t\t{\n\t\t\t\tSystem.out.printf(\"point is %d\\n\", sum1);\n\t\t\t\tdice1 = (int) (6 * Math.random() + 1);\n\t\t\t\tdice2 = (int) (6 * Math.random() + 1);\n\t\t\t\tsum2 = dice1 + dice2;\n\t\t\t\tSystem.out.printf(\"You rolled %d + %d = %d\\n\", dice1, dice2, sum2);\n\t\t\t\tif (sum1 == sum2)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.printf(\"You win\\n\");\n\t\t\t\t\treturn true;\n\t\t\t\t} else if (sum2 == 7)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.printf(\"You lose\\n\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\t\t// just to eliminate a method error.\n\t\t}\n\t}", "public void GameOver(){\n\n\t\tguessBttn.setVisible(false);\n\t\tguessFullWord.setVisible(false);\n\t\tAnswerBox.setDisable(true); //can no longer use the text box\n\t\tresultMessage.setText(\" Sorry!! You Lost.\\nLet's Try to Play Again!\");\n\t\tplayAgain.setVisible(true);\n\t\trevealLabel.setText(\"The mystery word was:\");\n\t\trevealLabel.setVisible(true);\n\t\twordDashes.setText(mysteryWord);\n\t}", "public void playAgain() {\r\n\t\t\r\n\t\tscreen.reset();\r\n\t\t\r\n\t}", "public abstract void nextGuessResult(ResultPegs resultPegs);", "void doResign() {\n System.out.println(\"Resign Game\");\n if (gameInProgress() == false) { // Should be impossible.\n console(\"There is no game in progress!\");\n return;\n }\n if (currentPlayer == CheckersData.RED) {\n gameOver(\"RED resigns. BLACK wins.\");\n } else {\n gameOver(\"BLACK resigns. RED wins.\");\n }\n }", "public synchronized void remindNoRepeat() {\n if (state != State.REGISTRATION && state != State.WAITING_TO_START) {\n sendPublicMessage(\"Round \" + pickTeamState.getSituation().getRoundNumber() +\n \" of 5\\n\" +\n pickTeamState.getSituation().getMissionSuccess() + \" successes | \" +\n pickTeamState.getSituation().getMissionFails() + \" fails\\n\" +\n \"The leader rotation is \" + GameMessageUtil.listOrder(getPlayerCharacters()) + \"\\n*\" +\n pickTeamState.getSituation().getLeader().getUserName() + \"* is the leader.\");\n }\n }", "public static void main(String[] args){\n Scanner keyboard = new Scanner(System.in);\n //declare variables for the answer, user's guess, and number fo guesses\n int answer;\n int guess;\n int numOfGuess = 0;\n \n boolean done = false;\n answer = (int)(100*Math.random())+1;\n \n //print an introduction that tells the user how to play this game\n System.out.println(\"Hello user! I will generate a number between 1-100 inclusive and you will try to guess it! I will tell you if your answer is too low or too high after each incorrect guess!\");\n do \n {\n System.out.print(\"Please enter your guess:\");\n guess = keyboard.nextInt();\n if (guess > answer){\n System.out.println(\"Too high!\");\n }\n else if( guess < answer){\n System.out.println(\"Too low!\");\n }\n else{\n done = true;\n }\n numOfGuess += 1;\n } while (done == false);\n \n System.out.println(\"Congratulations! You're score is \" + numOfGuess);\n if (numOfGuess >= 20){\n System.out.println(\"Rating: You are terrible at this game!\");\n }\n else if (numOfGuess >= 10 && numOfGuess <=19){\n System.out.println(\"Rating: You need more practice!\");\n }\n else if (numOfGuess >= 5 && numOfGuess <= 9){\n System.out.println(\"Rating: Not too bad, But can you get it in fewer than 5 guesses?\");\n }\n else if (numOfGuess >= 2 && numOfGuess <= 4){\n System.out.println(\"Rating: AWESOME. You win a trip to Hawaii!\");\n }\n else{\n System.out.println(\"Rating: That was pure LUCK and you know it!\");\n }\n \n }", "public static void main(String[] args) {\n int secretNumber;\n secretNumber = (int) (Math.random () * 20 + 1);\n //System.out.print(\"For debugging purposes the secret number is: \" + secretNumber);\n \n Scanner keyboard = new Scanner (System.in);\n int guessedNumber;\n do {\n\t System.out.print(\"Please enter a random number: \" );\n\t \n\t guessedNumber = keyboard.nextInt();\n\t System.out.println(\"The Number you choose is : \" + guessedNumber);\n\t \n\t if (guessedNumber == secretNumber) {\n\t\t System.out.print(\"Aye You guessed the number correctly\");\n\t }\n\t else if (guessedNumber < secretNumber) {\n\t\t System.out.println(\"Sorry try again! Your number is too low!\");\n\t }\n\t else if (guessedNumber > secretNumber) {\n\t\t System.out.println(\"Try again bud your number was too high!\");\n\t }\n\t \n } while (guessedNumber != secretNumber);\n\t}", "public static void paintHangman() {\n if (count == 1) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"1 incorrect guess, 6 guesses left\");\n }\n if (count == 2) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"2 incorrect guesses, 5 guesses left\");\n }\n if (count == 3) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|\");\n System.out.println(\" | / |\");\n System.out.println(\" | / |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"3 incorrect guesses, 4 guesses left\");\n }\n if (count == 4) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"4 incorrect guesses, 3 guesses left\");\n }\n if (count == 5) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | /\");\n System.out.println(\" | /\");\n System.out.println(\" | _/\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"5 incorrect guesses, 2 guesses left\");\n }\n if (count == 6) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < ' |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | _/ \\\\_\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"6 incorrect guesses, only 1 guess left!\");\n }\n if (count == 7) {\n System.out.println(\"GAME OVER!\");\n System.out.println(\"7 incorrect guesses\");\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / X X \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | __ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | _/ \\\\_\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"RIP \" + UserName.getUserName());\n System.out.println(\"GAME OVER! The word was \" + CategorySelector.word);\n }\n }" ]
[ "0.7399193", "0.73432285", "0.7262832", "0.7039191", "0.6953931", "0.68390536", "0.6828418", "0.6806935", "0.6801737", "0.68009686", "0.6780148", "0.67206526", "0.671553", "0.66470104", "0.66354334", "0.66176814", "0.6590931", "0.6564264", "0.65619355", "0.65512353", "0.6541617", "0.65296006", "0.65289587", "0.64814615", "0.6480774", "0.64373106", "0.64372367", "0.6402055", "0.6381999", "0.6373639", "0.632809", "0.63175267", "0.6317488", "0.63064057", "0.629054", "0.62786245", "0.627022", "0.6261648", "0.6242091", "0.6209361", "0.6182498", "0.6181277", "0.61553097", "0.61523825", "0.6141127", "0.613825", "0.6138092", "0.61328804", "0.6131355", "0.6121426", "0.6114446", "0.60957676", "0.6095277", "0.60943073", "0.60850006", "0.60784316", "0.6053934", "0.60486555", "0.6046339", "0.60315007", "0.6024283", "0.6023868", "0.60237813", "0.60129815", "0.60077435", "0.6005574", "0.60034895", "0.6003306", "0.59973496", "0.5996735", "0.59952486", "0.5994118", "0.5994118", "0.5988511", "0.5987054", "0.59852463", "0.5978508", "0.5977216", "0.59757435", "0.596801", "0.596152", "0.5956771", "0.59517497", "0.5949777", "0.5938849", "0.5931592", "0.59314364", "0.5923569", "0.5921413", "0.59205204", "0.5920518", "0.5920221", "0.5918483", "0.59175754", "0.59157586", "0.5908453", "0.590648", "0.59055877", "0.59041923", "0.5894235", "0.5883734" ]
0.0
-1
figures out where old guess are located when a new panel is added to the player's code
public ArrayList<CompGuess> slide(ArrayList<CompGuess> previous, Panel newPan) { for(int i = 0; i<previous.size(); i++) { if(previous.get(i).getPanel().compareTo(newPan) < 0) previous.get(i).moveIndexDown(); else if(previous.get(i).getPanel().compareTo(newPan) >0) previous.get(i).moveIndexUp(); } return previous; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void rightGuess()\r\n\t{\r\n\t\tif(userWon())\r\n\t\t{\r\n\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"good job! you've correctly guessed the panel \\n would you like to guess again? if so enter yes, if you would like to add your tile to your code, reply no\\n\\n\");\r\n\t\tString answer = sc.next();\r\n\t\tif(answer.compareTo(\"yes\") == 0 || answer.compareTo(\"Yes\") == 0)\r\n\t\t{\r\n\t\t\tuserTurn(false);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(userRanPan.getValue() == -1)\r\n\t\t\t\tnewGame.getUserHand().addDash(false,userRanPan);\r\n\t\t\telse\r\n\t\t\t\tnewGame.getUserHand().addPanel(userRanPan,false);\r\n\r\n\t\t\tuserGuess.clear();\r\n\t\t\tslide(previousGuess,userRanPan);\r\n\r\n\t\t\tif(userWon() == false)\r\n\t\t\t\tcompTurn(false);\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//foo.repaint();\r\n\t}", "private void setUpLastPanel() {\n // add one more panel to display the game details.\n final JPanel toAddLabels = new JPanel();\n toAddLabels.setLayout(new GridLayout(NUM_ROWS_PANEL_BOTTOM, 1));\n // Add a JLabel which will show number of lines get cleared.\n myLineCleared = new JLabel();\n myLineCleared.setText(\"CLEARED LINES : \" + Integer.toString(this.myClearedLines));\n myLineCleared.setForeground(Color.GRAY);\n myLineCleared.setFont(new Font(FONT_TIMES, Font.BOLD, SCORE_FONT_SIZE));\n myLineCleared.setBackground(null);\n myLineCleared.setHorizontalAlignment(JLabel.CENTER);\n toAddLabels.add(this.myLineCleared);\n // Add JLabel which will show game score and.\n myScoreLabel = new JLabel();\n myScoreLabel.setText(\"CURRENT SCORE : \" + Integer.toString(this.myCurrentScoreInt));\n myScoreLabel.setForeground(Color.MAGENTA);\n myScoreLabel.setFont(new Font(FONT_TIMES, Font.BOLD, SCORE_FONT_SIZE));\n myScoreLabel.setBackground(null);\n myScoreLabel.setHorizontalAlignment(JLabel.CENTER);\n toAddLabels.add(this.myScoreLabel);\n myHighScoreLabel = new JLabel();\n myHighScoreLabel.setText(\"HIGH SCORE : \" + Integer.toString(this.myHighScoreInt));\n myHighScoreLabel.setForeground(Color.MAGENTA);\n myHighScoreLabel.setFont(new Font(FONT_TIMES, Font.BOLD, SCORE_FONT_SIZE));\n myHighScoreLabel.setBackground(null);\n myHighScoreLabel.setHorizontalAlignment(JLabel.CENTER);\n toAddLabels.add(this.myHighScoreLabel);\n // Add a JLabel which will show the current level.\n myCurrentLevel = new JLabel();\n myCurrentLevel.setText(\"\");\n myLevelBalance = 0;\n myCurrentLevel.setForeground(Color.MAGENTA);\n myCurrentLevel.setFont(new Font(FONT_TIMES, Font.BOLD, SCORE_FONT_SIZE));\n myCurrentLevel.setBackground(null);\n myCurrentLevel.setHorizontalAlignment(JLabel.CENTER);\n toAddLabels.add(this.myCurrentLevel);\n // Add a JLabel which shows when next level would be reached.\n myNextLevelDistance = new JLabel();\n myNextLevelDistance.setText(Integer.toString(this.myLinesToGo));\n myNextLevelDistance.setForeground(Color.MAGENTA);\n myNextLevelDistance.setFont(new Font(FONT_TIMES, Font.BOLD, SCORE_FONT_SIZE));\n myNextLevelDistance.setBackground(null);\n myNextLevelDistance.setHorizontalAlignment(JLabel.CENTER);\n toAddLabels.add(this.myNextLevelDistance);\n // Add a JLabel which will show some status.\n this.myStatusString = new JLabel(\"PLAY\");\n this.myStatusString.setForeground(Color.GREEN);\n this.myStatusString.setFont(new Font(FONT_TIMES, Font.BOLD, NUM_FONT_SIZE));\n this.myStatusString.setBackground(null);\n this.myStatusString.setHorizontalAlignment(JLabel.CENTER);\n toAddLabels.add(this.myStatusString); \n this.add(toAddLabels);\n }", "public void wrongGuess()\r\n\t{\r\n\t\tSystem.out.println(\"Sorry, your guess is wrong\");\r\n\t\tif(userRanPan.getValue() == -1)\r\n\t\t\tnewGame.getUserHand().addDash(true,userRanPan);\r\n\t\telse\r\n\t\t\tnewGame.getUserHand().addPanel(userRanPan,true);\r\n\r\n\t\tif(userWon() == false)\r\n\t\t\tcompTurn(false);\r\n\t\telse if(userWon())\r\n\t\t{\r\n\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t}", "void updatePosition() {\n if (gameScreen.cursorIsOnLeft()) \n {\n // set the panel's rightmost edge to be 1/12th from the edge\n // set the panel's bottommost edge to be 1/6th from the edge\n setLocation(\n gameScreen.getScreenWidth() * 11/12 - getWidth(), \n gameScreen.getScreenHeight() * 5/6 - getHeight());\n }\n else // Otherwise the cursor must be on the right half of the screen\n {\n // set the panel's leftmost edge to be 1/12th from the edge\n // set the panel's bottommost edge to be 1/6th from the edge\n setLocation(\n gameScreen.getScreenWidth() * 1/12, \n gameScreen.getScreenHeight() * 5/6 - getHeight());\n }\n }", "public static void restartPositions() {\r\n\t\tnew GameStats();\r\n\t\tMain.initPlayers();\r\n\t\tif (CustomizeFrame.getInstance() != null) {\r\n\t\t\t((Player) GameStats.getPlayers().get(0)).setCustomGraphics(64, 64);// set default custom\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// graphics\r\n\t\t}\r\n\t}", "public void updatePlayerPanel()\n {\n playerInfoPanel.updateLabel();\n }", "public void refreshPlayerPanel() {\n view.clearDice();\n Player curPlayer;\n \n for(int i = 0; i < players.size(); i++){\n curPlayer = players.peek();\n \n view.setDie(curPlayer);\n players.add(players.remove());\n \n }\n board.reloadImgs();\n }", "private long opponent_winning_position() {\r\n return compute_winning_position(bitboard ^ mask, mask);\r\n }", "void updateScreen() {\n\t\tZone possibleNewZone = currentZone.getSpace(playerY, playerX).getNextZone();\n\t\tif (possibleNewZone != null) {\n\t\t\tString oldBGMusic = currentZone.getBackgroundMusic();\n\t\t\tcurrentZone = possibleNewZone;\n\t\t\tcurrentZone.enableZoneWarpSpaces();\n\t\t\tplayerX = currentZone.getPlayerStartX();\n\t\t\tplayerY = currentZone.getPlayerStartY();\n\t\t\t\n\n\t\t\tif (!oldBGMusic.equals(currentZone.getBackgroundMusic())) {\n\t\t\t\tmusicPlayer.stop();\n\t\t\t\tmusicPlayer.play(currentZone.getBackgroundMusic(), 100);\n\t\t\t}\n\t\t}\n\n\t\t// Update Panel Colors\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tfor (int a = 0; a < 10; a++) {\n\t\t\t\tpanels[i][a].setBackground(currentZone.getSpace(i, a).getColor());\n\t\t\t}\n\t\t}\n\n\t\t// Update Labels\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tfor (int a = 0; a < 10; a++) {\n\n\t\t\t\tlabels[i][a].setIcon(currentZone.getSpace(i, a).getPic());\n\t\t\t}\n\t\t}\n\t\t// Shows player in the new space\n\t\tlabels[playerY][playerX].setIcon(playerPic);\n\n\t\t// Shows enemy in the new space\n\t\t// labels[enemyY][enemyX].setIcon(enemyPic);\n\t}", "public void newGame() {\n\n\n inGame = true;\n mines_left = mines+ePirate+mPirate+hPirate;\n\n all_cells = rows * cols;\n field = new int[all_cells];\n\n for (int i = 0; i < all_cells; i++)\n field[i] = COVER_FOR_CELL;\n\n statusbar.setText(Integer.toString(mines_left));\n\n // draw the board -- pass to the undo array\n drawBoard(mines) ; // now rocks\n drawBoard(ePirate) ;\n drawBoard(mPirate) ;\n drawBoard(hPirate) ;\n\n }", "public OverWorldPanel(String mn, String cn, MasterWindow frame){\r\n //super();\r\n eventCaller = frame;\r\n\r\n random = new Random();\r\n moveAnimator = new Timer(100, this);\r\n moveAnimator.setRepeats(true);\r\n moving = false;\r\n\r\n direction = 'n';\r\n prevDirection = 'n';\r\n mapName = mn;\r\n currentMap = new ImageIcon(mapName);\r\n characterName = cn;\r\n playerName = characterName + direction + \".png\";\r\n currentCharacter = new ImageIcon(playerName);\r\n\r\n this.setFocusable(true);\r\n requestFocusInWindow();\r\n addKeyListener(new AL());\r\n//sets up the map in the panel using the map loader methods. come back later to make the\r\n//start based on the panel size for a resizable screen\r\n mapX = invisMap.getMapStartX(mapName);\r\n mapY = invisMap.getMapStartY(mapName);\r\n protagonistX = -mapX + 250;\r\n protagonistY = -mapY + 250;\r\n System.out.println(\"protagonist x and y\" + protagonistX + \" \" + protagonistY);\r\n this.setFocusable(true);\r\n requestFocusInWindow();\r\n //System.out.println(KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner());\r\n // not sure what to do for this yet protagonist = new Player(panelWidth/2, panelHeight/2);\r\n }", "String getLawnPosition();", "String computeNextLawnPosition();", "public void handleAction (Graphics g){\r\n\t\t\t//checks mouse location\r\n\t\t\tif ((x >= 311 && x <= 461) && (y >= 104 && y <= 254)){\r\n\t\t\t\tcodeguess += \"1\";\r\n\t\t\t\tdrawOne(g);\r\n\t\t\t}\r\n\t\t\telse if ((x >= 152 && x <= 301) && (y >= 104 && y <= 254)){\r\n\t\t\t\tcodeguess += \"2\";\r\n\t\t\t\tdrawTwo(g);\r\n\t\t\t}\r\n\t\t\telse if ((x >= 152 && x <= 301) && (y >= 263 && y <= 412)){\r\n\t\t\t\tcodeguess += \"3\";\r\n\t\t\t\tdrawThree(g);\r\n\t\t\t}\r\n\t\t\telse if ((x >= 311 && x <= 461) && (y >= 263 && y <= 412)){\r\n\t\t\t\tcodeguess += \"4\";\r\n\t\t\t\tdrawFour(g);\r\n\t\t\t}\r\n\t\t\r\n\t\tSystem.out.println (\"guess = \" + codeguess);\r\n\t\t//level up check: compares code to user's guess\r\n\t\tString codeTemp = \"\";\r\n\t\tif (codeguess.length() == counter){\r\n\t\t\tfor (int i = 0; i < counter ; i++){\r\n\t\t\t\tcodeTemp += code.charAt(i);\t\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println (counter + \"****\"+codeTemp);\r\n\t\t\tif (codeguess.length() == 10 && codeguess.equals(code)){\r\n\t\t\t\tscreen = 5;\r\n\t\t\t\tscore ++;\r\n\t\t\t\tcountHighest(score);\r\n\t\t\t\tcodeguess = \"\";\r\n\t\t\t\tcodeTemp = \"\";\r\n\t\t\t\tcode = \"\";\r\n\t\t\t\twinner.play();\r\n\t\t\t}\r\n\t\t\telse if(codeguess.equals(codeTemp)){ \r\n\t\t\t\tcodeTemp = \"\";\r\n\t\t\t\tcodeguess = \"\";\r\n\t\t\t\tcounter++;\r\n\t\t\t\tscore++;\r\n\t\t\t\tcountHighest(score);\r\n\t\t\t\tdisplay = true;\r\n\t\t\t\tdelay(1000);\r\n\t\t\t\tlevelup.play();\r\n\t\t\t\tanimateButtons();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tSystem.out.println(\"GAME OVER\");\r\n\t\t\t\tscreen = 4;\r\n\t\t\t\tcodeguess = \"\";\r\n\t\t\t\tcodeTemp = \"\";\r\n\t\t\t\tcode = \"\";\r\n\t\t\t\tgameover.play();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\trepaint();\r\n\r\n\t}", "public void playGuess(ActionEvent e) throws IOException {\n try {\n // Player and computer guesses\n int p = spinPVal.getValue();\n int total = game.play(p);\n int c = game.getComputerPlays();\n spinCVal.setValue(c);\n playerPlays = \"Player guesses \" + p + \". \";\n computerPlays = \"Computer guesses \" + c + \". \";\n getWinnerJBJ(total, p, c);\n myctr.setLabels();\n myctr.setMinMaxLabel();\n } catch(Exception n) {\n System.out.println(\"Game \\\"JellyBeanJar\\\" not initialized!\");\n }\n }", "@Override\r\n public void onMove(int blockId, int offset) {\n currentChallenge.moveBlock(blockId, offset);\r\n if( currentChallenge.isSolved() ){\r\n puzzlesDbAdapter.updatePuzzleSolved(currentChallenge.getId(), true);\r\n Toast.makeText(getApplicationContext(), \"PUZZLE SOLVED\", Toast.LENGTH_SHORT).show();\r\n }\r\n gameBoard.invalidate();\r\n }", "public static void paintHangman() {\n if (count == 1) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"1 incorrect guess, 6 guesses left\");\n }\n if (count == 2) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"2 incorrect guesses, 5 guesses left\");\n }\n if (count == 3) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|\");\n System.out.println(\" | / |\");\n System.out.println(\" | / |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"3 incorrect guesses, 4 guesses left\");\n }\n if (count == 4) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"4 incorrect guesses, 3 guesses left\");\n }\n if (count == 5) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | /\");\n System.out.println(\" | /\");\n System.out.println(\" | _/\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"5 incorrect guesses, 2 guesses left\");\n }\n if (count == 6) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < ' |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | _/ \\\\_\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"6 incorrect guesses, only 1 guess left!\");\n }\n if (count == 7) {\n System.out.println(\"GAME OVER!\");\n System.out.println(\"7 incorrect guesses\");\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / X X \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | __ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | _/ \\\\_\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"RIP \" + UserName.getUserName());\n System.out.println(\"GAME OVER! The word was \" + CategorySelector.word);\n }\n }", "void playerPositionChanged(Player player);", "private void updatePopupPosition() {\n // get the annotation's screen coordinates\n SKScreenPoint screenPoint = mapView.coordinateToPoint(selectedAnnotation.getLocation());\n // change the popup's (screen) position\n mapPopup.changePosition(screenPoint.getX(), screenPoint.getY(), 65);\n }", "@Override\n\tpublic void update() \n\t{\n\t\tPoint loc = getLocationCopy();\n\t\tEnemy c = game.findNearestEnemy(loc);\n\t\tif (c == null)\n\t\t\treturn;\n\t\t\n\t\tif(c.getLocation().distance(loc) < 100 && game.getFrameCount() % 30 == 0)\n\t\t{\n\t\t\tFlyingSalt s = new FlyingSalt(game, loc, \n\t\t\t\t\t\t\t\t\tc.getLocation().x - position.x,\n\t\t\t\t\t\t\t\t\tc.getLocation().y - position.y);\n\t\t\tgame.addAnimatable(s);\n\t\t}\n\t}", "void changepos(MouseEvent e, pieces chessPiece) \n { \n for(int beta : chessPiece.movnum)\n { \n if (chessPiece.color == 0 && e.getSource()== panel[beta-1 ]&& chessPiece.select == true && Checkerboard.allWhitePositions.contains(beta-1) == false)\n {\n if(this.getPiece(beta-1) != null)\n { \n getPiece(beta-1).alive = false;\n \n \n \n panel[beta-1].removeAll();/*getPiece(beta-1).position = 64;*/\n }\n chessPiece.position = beta-1;\n chessPiece.movnum.clear();\n chessPiece.mov.clear();\n chessPiece.select = false;\n chessPiece.timesMoved++;\n whiteToPlay = false;\n }\n else if (chessPiece.color == 1 && e.getSource()== panel[beta-1 ]&& chessPiece.select == true && Checkerboard.allBlackPositions.contains(beta-1) == false)\n {\n if(this.getPiece(beta-1) != null)\n { \n getPiece(beta-1).alive = false; \n panel[beta-1].removeAll();/*getPiece(beta-1).position = 64;*/}\n chessPiece.position = beta-1;\n chessPiece.movnum.clear();\n chessPiece.mov.clear();\n chessPiece.select = false;\n chessPiece.timesMoved++;\n whiteToPlay = true;\n }\n }//for ends\n \n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tChangePanel.replacePanel(mf, hg, new GamePanel(mf, p));\n\t\t\t}", "public void newGame() {\n disappear = false;\n topborder.clear();\n botborder.clear();\n effect.clear();\n enemy.clear();\n newEnemy.clear();\n thirdEnemy.clear();\n minBorderHeight = 5;\n maxBorderHeight = 30;\n newPlayer.resetAcceleration();\n newPlayer.setY(height / 2);\n\n calculateHighscores();\n resetBorders();\n\n\n gamenew = true;\n }", "private void drawHangman() {\n\t\tupdateTextBox();\n \tif(lastImage!=null)\n\t\t\tboard.getChildren().remove(lastImage);\n \tint tries = game.getTries();\n \tSystem.out.println(\"Retrieving image from images/\" + tries + \".png\");\n \tImage img = new Image(\"images/\" + tries + \".png\");\n\t\tImageView imgView = new ImageView(img);\n\t\tlastImage = imgView;\n\t\tboard.getChildren().add(imgView);\n\t}", "private void displayWrongLetters() {\n\t\tGObject checkForOldLabel = getElementAt(wrongLettersPosX,wrongLettersPosY);\n\t\tif (checkForOldLabel != null) {\n\t\t\tremove(checkForOldLabel);\n\t\t}\n\t\twrongLettersPosX = guessPosX;\n\t\twrongLettersPosY = guessPosY+guessSoFar.getHeight()*2;\n\t\tGLabel wrongLetterDisplay = new GLabel(wrongLetters);\n\t\twrongLetterDisplay.setLocation(wrongLettersPosX,wrongLettersPosY);\n\t\tadd(wrongLetterDisplay);\n\t}", "private void update()\n {\n // update the grid square panels\n Component[] components = pnlIsland.getComponents();\n for ( Component c : components )\n {\n // all components in the panel are GridSquarePanels,\n // so we can safely cast\n GridSquarePanel gsp = (GridSquarePanel) c;\n gsp.update();\n }\n \n // update player information\n int[] playerValues = game.getPlayerValues();\n txtPlayerName.setText(game.getPlayerName());\n progPlayerStamina.setMaximum(playerValues[Game.MAXSTAMINA_INDEX]);\n progPlayerStamina.setValue(playerValues[Game.STAMINA_INDEX]);\n progBackpackWeight.setMaximum(playerValues[Game.MAXWEIGHT_INDEX]);\n progBackpackWeight.setValue(playerValues[Game.WEIGHT_INDEX]);\n progBackpackSize.setMaximum(playerValues[Game.MAXSIZE_INDEX]);\n progBackpackSize.setValue(playerValues[Game.SIZE_INDEX]);\n \n //Update Kiwi and Predator information\n txtKiwisCounted.setText(Integer.toString(game.getKiwiCount()) );\n txtPredatorsLeft.setText(Integer.toString(game.getPredatorsRemaining()));\n \n // update inventory list\n listInventory.setListData(game.getPlayerInventory());\n listInventory.clearSelection();\n listInventory.setToolTipText(null);\n btnUse.setEnabled(false);\n btnDrop.setEnabled(false);\n \n // update list of visible objects\n listObjects.setListData(game.getOccupantsPlayerPosition());\n listObjects.clearSelection();\n listObjects.setToolTipText(null);\n btnCollect.setEnabled(false);\n btnCount.setEnabled(false);\n \n // update movement buttons\n btnMoveNorth.setEnabled(game.isPlayerMovePossible(MoveDirection.NORTH));\n btnMoveEast.setEnabled( game.isPlayerMovePossible(MoveDirection.EAST));\n btnMoveSouth.setEnabled(game.isPlayerMovePossible(MoveDirection.SOUTH));\n btnMoveWest.setEnabled( game.isPlayerMovePossible(MoveDirection.WEST));\n }", "public WarGUI()\n {\n setLayout(new GridLayout(2,1));\n \n //start a game \n warGame = new WarCW();\n \n //Top panel for game details\n topPanel = new JPanel();\n topPanel.setBackground(Color.green); //it's green.\n \n //bottom panel for gameplay\n gamePanel = new JPanel();\n \n //Top panel stuff \n sup = new JLabel(\"**** Mike's WAR game ****\");\n sup.setFont(new Font(\"ARIAL\",Font.BOLD,46));\n topPanel.add(sup);\n \n //Bottom panel stuff\n roundNum = 1;\n temp = (\" || Round number \" + roundNum + \" || \");\n rounds = new JLabel(temp);\n \n back = new ImageIcon(\"back.jpg\");\n frontP1 = new ImageIcon(); //set it when it happens.\n frontP1 = new ImageIcon(); \n joker = new ImageIcon(\"joker.jpg\");\n \n p1 = new JLabel(\"P1 ->\");\n p2 = new JLabel(\"<- P2\");\n \n picP1 = new JLabel(back); \n picP2 = new JLabel(back); \n p1Played = new JLabel(joker);\n p2Played = new JLabel(joker);\n \n //The button that makes the game go and keep going\n button = new JButton(\"NEXT\");\n button.addActionListener(new ButtonListener());\n gamePanel.add(button); \n \n gamePanel.add(p1); \n gamePanel.add(picP1);\n gamePanel.add(p1Played);\n gamePanel.add(p2Played);\n gamePanel.add(picP2);\n gamePanel.add(p2);\n gamePanel.add(rounds);\n \n //trying to display the score in poor fashion\n p1Num = (WarCW.p1.cardsRemaining() + WarCW.p1e.cardsRemaining());\n p2Num = (WarCW.p2.cardsRemaining() + WarCW.p2e.cardsRemaining());\n \n temp1 = (\"P1: \"+p1Num + \" || \");\n temp2 = (\"P2: \"+p2Num); \n \n p1 = new JLabel(temp1); //26\n p2 = new JLabel(temp2); //26 \n \n topPanel.add(p1);\n topPanel.add(p2); \n\n add(topPanel);\n add(gamePanel);\n }", "public void updateGamePanel() {\n\t\tthis.removeAll();\n\t\t\n\t\tButton2 buttonTip = new Button2(\"DICA\", 75, 100, 100, 100);\n\t\tbuttonTip.addActionListener(e -> Controller.game.showTip());\n\t\tthis.add(buttonTip);\n\t\t\n\t\tButton2 menu = new Button2(\"Menu\", 200, 100, 100, 100);\n\t\tmenu.addActionListener(e -> this.frame.setVisible(\"menu\"));\n\t\tthis.add(menu);\n\t\t\n\t\tthis.drawButtons();\n\t\t\n\t\t//Adding labels\n\t\tthis.add(frame.getWordShow());\n\t\tthis.add(frame.getLifeShow());\n\t\t\n\t\tthis.frame.add(this);//Adding the gameJPanel to the frame\n\t}", "public void GameOver(){\n\n\t\tguessBttn.setVisible(false);\n\t\tguessFullWord.setVisible(false);\n\t\tAnswerBox.setDisable(true); //can no longer use the text box\n\t\tresultMessage.setText(\" Sorry!! You Lost.\\nLet's Try to Play Again!\");\n\t\tplayAgain.setVisible(true);\n\t\trevealLabel.setText(\"The mystery word was:\");\n\t\trevealLabel.setVisible(true);\n\t\twordDashes.setText(mysteryWord);\n\t}", "public void updateInformation() {\r\n onFirstCycle = false;\r\n lastLocation = player.getLocation();\r\n preparedAppearance = false;\r\n }", "public void updateGuessRows(SharedPreferences sharedPreferences)\r\n {\r\n // get the number of guess buttons that should be displayed\r\n // hide all guess button LinearLayouts\r\n // display appropriate guess button LinearLayouts \r\n }", "private void gameLost() {\n\n stopTime();\n //reveal all mines\n for (int i = 0; i < minefield.getRows(); i++) {\n for (int j = 0; j < minefield.getCols(); j++) {\n if (minefield.getMinefield()[i][j].isMined()) {\n tileLabel[i][j].setIcon(mineIcon);\n }\n }\n }\n\n JFrame loseframe = new JFrame(\"Loser!\");\n JPanel losepanel = new JPanel();\n JLabel label = new JLabel(\"Game over, you stepped on a mine!\");\n JButton close = new JButton(\"Close\");\n JButton restart = new JButton(\"Restart\");\n\n close.addActionListener((ActionEvent e) -> {\n loseframe.dispose();\n });\n\n restart.addActionListener((ActionEvent e) -> {\n frame.dispose();\n loseframe.dispose();\n createNewGame(minefield.getRows(), minefield.getCols(), minefield.getMaxMines());\n });\n\n losepanel.add(label);\n losepanel.add(close);\n losepanel.add(restart);\n loseframe.add(losepanel);\n loseframe.setLocationRelativeTo(null);\n loseframe.setSize(240, 80);\n loseframe.setVisible(true);\n loseframe.setResizable(false);\n }", "public void updatePosition(){\n\t\t//maps the position to the closest \"grid\"\n\t\tif(y-curY>=GameSystem.GRID_SIZE/2){\n\t\t\tcurY=curY+GameSystem.GRID_SIZE;\n\t\t\tyGridNearest++;\n\t\t}\n\t\telse if(curX-x>=GameSystem.GRID_SIZE/2){\n\t\t\tcurX=curX-GameSystem.GRID_SIZE;\n\t\t\txGridNearest--;\n\t\t}\n\t\telse if(x-curX>=GameSystem.GRID_SIZE/2){\n\t\t\tcurX=curX+GameSystem.GRID_SIZE;\n\t\t\txGridNearest++;\n\t\t}\n\t\telse if(curY-y>=GameSystem.GRID_SIZE/2){\n\t\t\tcurY=curY-GameSystem.GRID_SIZE;\n\t\t\tyGridNearest--;\n\t\t}\n\t\t//sets the last completely arrived location grid\n\t\tif(y-yTemp>=GameSystem.GRID_SIZE){\n\t\t\tyTemp=yTemp+GameSystem.GRID_SIZE;\n\t\t\ty=yTemp;\n\t\t\tlastY++;\n\t\t}\n\t\telse if(xTemp-x>=GameSystem.GRID_SIZE){\n\t\t\txTemp=xTemp-GameSystem.GRID_SIZE;\n\t\t\tx=xTemp;\n\t\t\tlastX--;\n\t\t}\n\t\telse if(x-xTemp>=GameSystem.GRID_SIZE){\n\t\t\txTemp=xTemp+GameSystem.GRID_SIZE;\n\t\t\tx=xTemp;\n\t\t\tlastX++;\n\t\t}\n\t\telse if(yTemp-y>=GameSystem.GRID_SIZE){\n\t\t\tyTemp=yTemp-GameSystem.GRID_SIZE;\n\t\t\ty=yTemp;\n\t\t\tlastY--;\n\t\t}\n\t\t//only updates nextX and nextY when the move buttons are being pressed down\n\t\t/*\n\t\tif(movable){\n\t\t\tif(direction.equals(\"right\")){\n\t\t\t\t\tnextX=lastX+1;\n\t\t\t\t\tnextY=lastY;\n\t\t\t}\n\t\t\telse if(direction.equals(\"left\")){\n\t\t\t\tnextX=lastX-1;\n\t\t\t\tnextY=lastY;\n\t\t\t}\n\t\t\telse if(direction.equals(\"up\")){\n\t\t\t\tnextY=lastY-1;\n\t\t\t\tnextX=lastX;\n\t\t\t}\n\t\t\telse if(direction.equals(\"down\")){\n\t\t\t\tnextY=lastY+1;\n\t\t\t\tnextX=lastX;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t\n\t}", "public final void initialPosition() {\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.RED, Type.PAWN), new PositionImpl( 38 + 8*i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.BLACK, Type.PAWN), new PositionImpl( 12 + i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.YELLOW, Type.PAWN), new PositionImpl( 1 + 8*i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.GREEN, Type.PAWN), new PositionImpl( 48 + i));\n\t\t}\n\t\t\n\t\tsetPiece( new PieceImpl( Color.RED, Type.BOAT), new PositionImpl( 63 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.KNIGHT), new PositionImpl( 55 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.ELEPHANT), new PositionImpl( 47 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.KING), new PositionImpl( 39 ));\n\t\t\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.BOAT), new PositionImpl( 7 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.KNIGHT), new PositionImpl( 6 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.ELEPHANT), new PositionImpl( 5 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.KING), new PositionImpl( 4 ));\n\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.BOAT), new PositionImpl( 0 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.KNIGHT), new PositionImpl( 8 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.ELEPHANT), new PositionImpl( 16 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.KING), new PositionImpl( 24 ));\n\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.BOAT), new PositionImpl( 56 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.KNIGHT), new PositionImpl( 57 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.ELEPHANT), new PositionImpl( 58 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.KING), new PositionImpl( 59 ));\n\t\t\n }", "private void addGuess() {\n\t\tfor (int i = 0; i < NUM_OF_ROWS; i++) {\n\t\t\tif (guessList[i] == null) {\n\t\t\t\tguessList[i] = new Guess();\n\t\t\t\tlastMoveID = i;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If it gets here then we are full\n\t\tthrow new IllegalArgumentException(\n\t\t\t\t\"No more spaces to add new moves, all posible moves exhausted\");\n\t}", "public void changePos() {\r\n\r\n // Add timeCount\r\n timeCount += 20;\r\n\r\n // Orange\r\n orangeY += 12;\r\n\r\n float orangeCenterX = orangeX + orange.getWidth() / 2;\r\n float orangeCenterY = orangeY + orange.getHeight() / 2;\r\n\r\n if (hitCheck(orangeCenterX, orangeCenterY)) {\r\n orangeY = frameHeight + 100;\r\n score += 10;\r\n soundPlayer.playHitOrangeSound();\r\n }\r\n\r\n if (orangeY > frameHeight) {\r\n orangeY = -100;\r\n orangeX = (float) Math.floor(Math.random() * (frameWidth - orange.getWidth()));\r\n }\r\n orange.setX(orangeX);\r\n orange.setY(orangeY);\r\n\r\n // Pink\r\n if (!pink_flg && timeCount % 10000 == 0) {\r\n pink_flg = true;\r\n pinkY = -20;\r\n pinkX = (float) Math.floor(Math.random() * (frameWidth - pink.getWidth()));\r\n }\r\n\r\n if (pink_flg) {\r\n pinkY += 20;\r\n\r\n float pinkCenterX = pinkX + pink.getWidth() / 2;\r\n float pinkCenterY = pinkY + pink.getWidth() / 2;\r\n\r\n if (hitCheck(pinkCenterX, pinkCenterY)) {\r\n pinkY = frameHeight + 30;\r\n score += 30;\r\n // Change FrameWidth\r\n if (initialFrameWidth > frameWidth * 110 / 100) {\r\n frameWidth = frameWidth * 110 / 100;\r\n changeFrameWidth(frameWidth);\r\n }\r\n soundPlayer.playHitPinkSound();\r\n }\r\n\r\n if (pinkY > frameHeight) pink_flg = false;\r\n pink.setX(pinkX);\r\n pink.setY(pinkY);\r\n }\r\n\r\n if (level.equals(\"easy\")) {\r\n blackY += 18;\r\n } else if (level.equals(\"medium\")) {\r\n blackY += 34;\r\n\r\n } else if (level.equals(\"hard\")) {\r\n blackY += 50;\r\n }\r\n\r\n\r\n float blackCenterX = blackX + black.getWidth() / 2;\r\n float blackCenterY = blackY + black.getHeight() / 2;\r\n\r\n if (hitCheck(blackCenterX, blackCenterY)) {\r\n blackY = frameHeight + 100;\r\n\r\n // Change FrameWidth\r\n frameWidth = frameWidth * 80 / 100;\r\n changeFrameWidth(frameWidth);\r\n soundPlayer.playHitBlackSound();\r\n if (frameWidth <= boxSize) {\r\n gameOver();\r\n }\r\n\r\n }\r\n\r\n if (blackY > frameHeight) {\r\n blackY = -100;\r\n blackX = (float) Math.floor(Math.random() * (frameWidth - black.getWidth()));\r\n }\r\n\r\n black.setX(blackX);\r\n black.setY(blackY);\r\n\r\n // Move Box\r\n if (action_flg) {\r\n // Touching\r\n boxX += 14;\r\n box.setImageDrawable(imageBoxRight);\r\n } else {\r\n // Releasing\r\n boxX -= 14;\r\n box.setImageDrawable(imageBoxLeft);\r\n }\r\n\r\n // Check box position.\r\n if (boxX < 0) {\r\n boxX = 0;\r\n box.setImageDrawable(imageBoxRight);\r\n }\r\n if (frameWidth - boxSize < boxX) {\r\n boxX = frameWidth - boxSize;\r\n box.setImageDrawable(imageBoxLeft);\r\n }\r\n\r\n box.setX(boxX);\r\n String b = \"Score : \" + score;\r\n scoreLabel.setText(b);\r\n\r\n }", "public void addGuess(Player player, String guess) {\n\t\t// dont to add guesses when win or lose occurs\n\t\tif (checkWinner(player) || checkLoser(player)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// add guess if number of current guesses is less than max guesses\n\t\tif (player != null && player.getTotalGuesses() < MAX_GUESSES) {\n\t\t\tplayer.addGuess(guess);\n\t\t\tguesses.add(guess);\n\t\t}\n\t\t\n\t\t// if guess equals secret code then player wins\n\t\tif (checkGuessEqual(guess)) {\n\t\t\tsetPlayerWon(true);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// if the 4th present guess is incorrect, player loses\n\t\tif (player.getTotalGuesses() >= MAX_GUESSES && checkGuessEqual(guess) == false) {\n\t\t\tsetPlayerLost(true);\n\t\t\treturn;\n\t\t}\n\t}", "private void undoPosition() {\r\n String undoingBoard = listOfBoards.pop();\r\n listOfMoves.pop();\r\n for (Square sq : map.keySet()) {\r\n char piece = undoingBoard.charAt(sq.index() + 1);\r\n if (piece == '-') {\r\n map.put(sq, EMPTY);\r\n }\r\n if (piece == 'B') {\r\n map.put(sq, BLACK);\r\n }\r\n if (piece == 'W') {\r\n map.put(sq, WHITE);\r\n }\r\n if (piece == 'K') {\r\n map.put(sq, KING);\r\n }\r\n board[sq.col()][sq.row()] = map.get(sq);\r\n }\r\n _moveCount -= 1;\r\n _turn = _turn.opponent();\r\n _repeated = false;\r\n }", "void defaultsetup(int phi) \n {// The Images should be loded here... Also add labels here\n System.out.println(\"IN DEFAULT SETUP..\");\n if( phi == 0) \n whiteToPlay = true;\n else if (phi == 1) \n whiteToPlay = false;\n // White Chess Pieces\n whiteHorse1.position = 1; whiteHorse1.color = 0;\n whiteHorse2.position = 6; whiteHorse2.color = 0;\n whiteQueen.position = 3; whiteQueen.color = 0;\n whiteKing.position =4 ; whiteKing.color = 0;\n whiteCastle1.position = 0; whiteCastle1.color = 0;\n whiteCastle2.position = 7; whiteCastle2.color = 0;\n whiteBishop1.position = 2; whiteBishop1.color = 0;\n whiteBishop2.position = 5; whiteBishop2.color = 0;\n int y = 8;\n for(int x = 0 ; x < 8; x++)\n {\n whitePawn[x] = new pawn();\n whitePawn[x].position = 8+x;\n whitePawn[x].color = 0;\n }\n //Black Chess Pieces\n blackHorse1.position = 57; blackHorse1.color = 1;\n blackHorse2.position = 62; blackHorse2.color = 1;\n blackQueen.position = 59; blackQueen.color = 1;\n blackKing.position = 60; blackKing.color = 1;\n blackCastle1.position = 56;blackCastle1.color = 1;\n blackCastle2.position = 63;blackCastle2.color = 1;\n blackBishop1.position = 58;blackBishop1.color = 1;\n blackBishop2.position = 61;blackBishop2.color = 1;\n y = 8;\n for(int x = 0 ; x < 8; x++)\n {\n blackPawn[x] = new pawn();\n blackPawn[x].position = 48+x;\n blackPawn[x].color = 1;\n }\n \n this.updatePositions();\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tshowPanel(createReinforcePanel(MainPlayScreen.this.game.getCurrentPlayer()));\t\t\n\t\t\t\n\t\t\t}", "public void PrevGame(){\n partidaNum --;\n current = current.getAnterior();\n ListaDoble partida = (ListaDoble) current.getDato();\n currentTurn = partida.getInicio();\n String turno = (String) currentTurn.getDato();\n String info[] = turno.split(\"#\");\n\n int infoIn = 4;\n for (int i = 0; i < 10; i++, infoIn += 1) {\n label_list[i].setIcon(new ImageIcon(info[infoIn]));\n this.screen.add(label_list[i]);\n }\n HP.setText(\"HP: \"+info[2]);\n action.setText(\"Action: \"+info[1]);\n mana.setText(\"Mana: \"+info[3]);\n game.setText(\"Game \"+String.valueOf(partidaNum)+\", Turn \"+info[0]);\n\n VerifyButtons();\n\n }", "private void removeGuess() {\n\t\tguessList[this.getLastPlayIndex()] = null;\n\t\tif (this.getLastPlayIndex() > 0)\n\t\t\tlastMoveID--;\n\t}", "public void guessesLeft() {\n guessesLeft--;\n if (guessesLeft > 0) {\n String guessesLeftString = (\"You have \" + String.valueOf(guessesLeft) + \" guesses.\");\n guessesLeftView.setText(guessesLeftString);\n } else {\n// DO THIS IF OUT OF GUESSES OR LOSE\n gameFragmentLayout.setVisibility(View.VISIBLE);\n hideKeybord();\n LosingGameFragment LoseGameFragment = new LosingGameFragment();\n LoseGameFragment.getLosingFragInfo(this, randomNumber);\n FragmentManager fragmentManager = getSupportFragmentManager();\n fragmentManager.beginTransaction()\n .replace(R.id.game_fragment, LoseGameFragment)\n .commit();\n }\n }", "public void updateIsWinning() {\n if(!isOpponentDone && !isUserDone) {\n TextView opponentPosition = (TextView) findViewById(R.id.position_indicator_receiver);\n TextView userPosition = (TextView) findViewById(R.id.position_indicator_sender);\n\n Run opponentRun = ((ChallengeReceiverFragment) receiverFragment).getRun();\n Run userRun = ((ChallengeSenderFragment) senderFragment).getRun();\n\n float opponentDistance = opponentRun.getTrack().getDistance();\n float userDistance = userRun.getTrack().getDistance();\n\n if (opponentDistance == userDistance) {\n opponentPosition.setText(R.string.dash);\n userPosition.setText(R.string.dash);\n } else if (opponentDistance > userDistance) {\n opponentPosition.setText(R.string.first_position);\n userPosition.setText(R.string.second_position);\n } else {\n opponentPosition.setText(R.string.second_position);\n userPosition.setText(R.string.first_position);\n }\n System.out.println(opponentDistance + \" \" + userDistance);\n }\n }", "void lastMoveInfo(int playerIndex, int column, int row);", "Position getOldPosition();", "public void setInitialPosition()\n {\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.a2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.b2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.c2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.d2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.e2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.f2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.g2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.h2);\n //Se colocan los peones negros en la séptima fila\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.a7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.b7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.c7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.d7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.e7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.f7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.g7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.h7);\n //Se colocan las torres blancas en a1 y h1\n putGenericPiece(GenericPiece.ROOK,Colour.WHITE,Square.a1);\n putGenericPiece(GenericPiece.ROOK,Colour.WHITE,Square.h1);\n //Se colocan las torres negras en a8 y h9\n putGenericPiece(GenericPiece.ROOK,Colour.BLACK,Square.a8);\n putGenericPiece(GenericPiece.ROOK,Colour.BLACK,Square.h8);\n //Se colocan los caballos blancos en b1 y g1\n putGenericPiece(GenericPiece.KNIGHT,Colour.WHITE,Square.b1);\n putGenericPiece(GenericPiece.KNIGHT,Colour.WHITE,Square.g1);\n //Se colocan los caballos negros en b8 y g8\n putGenericPiece(GenericPiece.KNIGHT,Colour.BLACK,Square.b8);\n putGenericPiece(GenericPiece.KNIGHT,Colour.BLACK,Square.g8);\n //Se colocan los alfiles blancos en c1 y f1\n putGenericPiece(GenericPiece.BISHOP,Colour.WHITE,Square.c1);\n putGenericPiece(GenericPiece.BISHOP,Colour.WHITE,Square.f1);\n //Se colocan los alfiles negros en c8 y f8\n putGenericPiece(GenericPiece.BISHOP,Colour.BLACK,Square.c8);\n putGenericPiece(GenericPiece.BISHOP,Colour.BLACK,Square.f8);\n //Se coloca la dama blanca en d1\n putGenericPiece(GenericPiece.QUEEN,Colour.WHITE,Square.d1);\n //Se coloca la dama negra en d8\n putGenericPiece(GenericPiece.QUEEN,Colour.BLACK,Square.d8);\n //Se coloca el rey blanco en e1\n putGenericPiece(GenericPiece.KING,Colour.WHITE,Square.e1);\n //Se coloca el rey negro en e8\n putGenericPiece(GenericPiece.KING,Colour.BLACK,Square.e8);\n \n //Se permiten los enroques para ambos jugadores\n setCastlingShort(Colour.WHITE,true);\n setCastlingShort(Colour.BLACK,true);\n setCastlingLong(Colour.WHITE,true);\n setCastlingLong(Colour.BLACK,true);\n \n //Se da el turno a las blancas\n setTurn(Colour.WHITE);\n \n gamePositionsHash.clear();\n gamePositionsHash.put(zobristKey.getKey(), 1);\n }", "public void updateHangman()\n {\n hangmanShapes[hangmanIndex].setVisible(true);\n }", "public void checkMovedRedraw(){\n if((board.isTreasureCollected() || board.isKeyCollected()) && muteMusic == false){\n music.playAudio(\"PickupSound\");\n }\n renderer.redraw(board, boardCanvas.getWidth(), boardCanvas.getHeight());\n if(board.isChipAlive() == false){\n gamePaused = true;\n timeRuunableThread.setPause(gamePaused);\n if(muteMusic == false){\n music.stopPlayingAudio(\"All\");\n music.playAudio(\"LevelCompleteSound\");\n }\n musicName = \"LevelCompleteSound\";\n JOptionPane.showMessageDialog(null, \"Oops! Better luck next time!\", \"Failed\", 1);\n canLoadGame = false;\n } else if(board.isLevelFinished()){\n gamePaused = true;\n timeRuunableThread.setPause(gamePaused);\n if(muteMusic == false){\n music.stopPlayingAudio(\"All\");\n music.playAudio(\"LevelCompleteSound\");\n }\n musicName = \"LevelCompleteSound\";\n if(level == 1){\n int saveOrNot = JOptionPane.showConfirmDialog(null, \"congratulations! Level 1 passed! Go to next level?\", \"Confirm\", JOptionPane.YES_NO_OPTION);\n if (saveOrNot == 0) { // yes\n level = level + 1;\n newGameStart(level);\n } else {\n gamePaused = true;\n }\n }else if(level == 2){\n JOptionPane.showMessageDialog(null, \"congratulations! Level 2 passed!\", \"Win Level 2\", JOptionPane.INFORMATION_MESSAGE);\n }\n }else if(board.onInfoTile()){\n JOptionPane.showMessageDialog(null, readAllLines(), \"Information\", JOptionPane.INFORMATION_MESSAGE);\n }else{\n try {\n infoCanvas.drawChipsLeftNumber(board.getTreasureRemainingAmount());\n infoCanvas.drawKeysChipsPics();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n }", "public boolean computerGuess()\r\n\t{\r\n\t\tboolean isWhite;\r\n\t\tint randomBool = (int) (Math.random()*50);\r\n\t\tif(randomBool<25)\r\n\t\t\tisWhite = true;\r\n\t\telse\r\n\t\t\tisWhite = false;\r\n\t\twhile(newGame.containsColor(isWhite) == false)\r\n\t\t{\r\n\t\t\trandomBool = (int) (Math.random()*50);\r\n\t\t\tif(randomBool<25)\r\n\t\t\t\tisWhite = true;\r\n\t\t\telse\r\n\t\t\t\tisWhite = false;\r\n\t\t}\r\n\t\tint randomPanel = (int) (Math.random()*newGame.getUserHandLength());\r\n\t\t//System.out.println(randomPanel);\r\n\t\tint randomGuess = (int) (Math.random()*12);\r\n\t\tif(newGame.getCompHand().contains(new Panel(isWhite,randomGuess,false)))\r\n\t\t{\r\n\t\t\tif(newGame.getUserHand().getPanel(randomPanel).compareTo(new Panel(isWhite,randomGuess,false)) == 0)\r\n\t\t\t\treturn true;\r\n\t\t\telse \r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void changeGuesses (int k, int p){\n for (int i = 0; i<9; i++){\n if(bSquares.get(i).checkhasFocus()){//finds out which square user is playing in. \"i\" is that square //but all the squares have focus in begginning?\n System.out.println(i + \" has focus\");\n for (int j = 0; j<9; j++){\n if (!bSquares.get(i).getSmallSquare(j).isCommitted()&&bSquares.get(i).getSmallSquare(j).getOwnership()>0){\n bSquares.get(i).getSmallSquare(j).setOwnership(0);//j is square that the user guessed last time.\n madeChoice = false; //since we just took away the user's last guess, then there is no choice made.\n //unless the next guess is valid.\n }\n }\n if(bSquares.get(k).getSmallSquare(p).getOwnership()==0&&!bSquares.get(k).getSmallSquare(p).isCommitted()){\n bSquares.get(k).getSmallSquare(p).setOwnership(2);\n madeChoice = true;//this guess is valid, so the user \"made a choice\" and the ENTER button can now be pushed.\n }\n }\n }\n \n }", "private void setMapPos()\r\n {\r\n try\r\n {\r\n Thread.sleep(1000);//so that you can see players move\r\n }\r\n catch(Exception e){}\r\n int currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n int unitPos = 0;\r\n int firstX = 0;\r\n int firstY = 0;\r\n if (currentPlayer == 1)\r\n {\r\n unitPos = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n }\r\n if (currentPlayer == 2)\r\n {\r\n unitPos = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n }\r\n int tempX = unitPos % mapWidth;\r\n int tempY = unitPos - tempX;\r\n if (tempY == 0) {}\r\n else\r\n tempY = tempY / mapHeight;\r\n tempX = tempX - 11;\r\n tempY = tempY - 7;\r\n if (tempX >= 0)\r\n firstX = tempX;\r\n else\r\n firstX = tempX + mapWidth;\r\n if (tempY >= 0)\r\n firstY = tempY;\r\n else\r\n firstY = tempY + mapWidth;\r\n\r\n int drawWidth = worldPanel.getDrawWidth();\r\n int drawHeight = worldPanel.getDrawHeight();\r\n worldPanel.setNewXYPos(firstX, firstY);\r\n miniMap.setNewXY(firstX, firstY, drawWidth, drawHeight);\r\n }", "public GameLostPanel() {\n initComponents();\n }", "@Override\n protected void onSizeChanged(int w, int h, int oldw, int oldh)\n {\n super.onSizeChanged(w, h, oldw, oldh);\n dotsSet = false;\n\n\n startNewGame();\n keeper.start();\n }", "public void makeVisible(int guess) {\n\t\t\n\t\t// \n\t\tif (guess == 5)\n\t\t{\t\n\t\t\theadShape.setVisible(true);\n\t\t}\n\t\telse if (guess == 4)\n\t\t{\t\n\t\t\tspine.setVisible(true);\n\t\t}\n\t\telse if (guess == 3)\n\t\t{\t\n\t\t\tleftArmLine.setVisible(true);\n\t\t}\n\t\telse if (guess == 2)\n\t\t{\t\n\t\t\trightArmLine.setVisible(true);\n\t\t}\n\t\telse if (guess == 1)\n\t\t{\t\n\t\t\tleftLegLine.setVisible(true);\n\t\t}\n\t\telse if (guess == 0)\n\t\t{\t\t\n\t\t\trightLegLine.setVisible(true);\n\t\t\tGameOver();\n\t\t\n\t\t}\n\t\t\n\t}", "public void refresh() {\r\n\t\tmainGUI.getPlayerFrame().setMyTurn(\r\n\t\t\t\tclient.getID() == island.getCurrentPlayer().getID());\r\n\t\ttradingMenu.update();\r\n\t\tsupplyPanel.update();\r\n\t\tcardMenu.update();\r\n\t\trefreshOpponents();\r\n\t}", "public void gameupdate(){\n game.update();\r\n panel.formUpdate(game.lives);\r\n }", "@Override\r\n\tpublic Code nextGuess() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tRandom randGen = new Random();\r\n\t\tCode newCode;\r\n\t\t\r\n\t\tArrayList<String> values;\r\n\t\twhile(true)\r\n\t\t{values = new ArrayList<String>();\r\n\t\tfor (int i = 0; i < super.getNumVars(); i++)\r\n\t\t{\r\n\t\t\tint colorIndex = randGen.nextInt((super.getColorList().size()));\r\n\t\t\tvalues.add(super.getColorList().get(colorIndex));\r\n\t\t}\r\n\t\t\r\n\t\tnewCode = new Code(super.getNumVars());\r\n\t\t\r\n\t\tfor (int i = 0; i < values.size(); i++)\r\n\t\t{\r\n\t\t\tnewCode.addEntry(values.get(i));\r\n\t\t}\r\n\t\t//contains method for code\r\n\t\t\r\n\t\tboolean shouldBreak=true;//(guessHistory.size()==0?true:false);\r\n\t\tfor(int i=0,totalequal=0;i<guessHistory.size();++i,totalequal=0)\r\n\t\t{\r\n\t\t\tCode itrHistory=guessHistory.get(i);\r\n\t\t\tfor(int j=0;j<super.getNumVars();++j)\r\n\t\t\tif(newCode.colorAt(j).equals(itrHistory.colorAt(j)))\r\n\t\t\t\t\ttotalequal++;\r\n\t\t\t\t\r\n\t\t\tif(totalequal==super.getNumVars())\r\n\t\t\t\tshouldBreak=false;\r\n\t\t\t\r\n\t\t}\r\n\t\tif(shouldBreak)\r\n\t\t\tbreak;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tguessHistory.add(newCode);\r\n\t\treturn newCode;\r\n\t}", "public void gameOver() {\r\n grid.exposeMines();\r\n this.displayGrid();\r\n System.out.println(\"Better luck next time!\");\r\n }", "public void winnerFound() {\r\n\t\tfor (int n = 0; n < 6; n++) {\r\n\t\t\tfor (int m = 0; m < 7; m++) {\r\n\t\t\t\tsquares[n][m].setEnabled(false);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int a = 0; a < 7; a++) {\r\n\t\t\tbuttons[a].setEnabled(false);\r\n\t\t}\r\n\t\tif (winnerChip != 67) {\r\n\t\t\tint result = JOptionPane.showConfirmDialog(null,\r\n\t\t\t\t\t\" Player \" + (winnerChip - 48) + \" won! Do you want to start a new game?\", null,\r\n\t\t\t\t\tJOptionPane.YES_NO_OPTION);\r\n\r\n\t\t\tif (result == JOptionPane.YES_OPTION) {\r\n\t\t\t\tgameReset();\r\n\t\t\t} else if (result == JOptionPane.NO_OPTION) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \" Click Ok to return to Main Menu\");\r\n\r\n\t\t\t\tJFrame backToMenu = new JFrame(\"Main Menu\");\r\n\r\n\t\t\t\tbackToMenu.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\t\t\tbackToMenu.getContentPane().add(new MainMenu());\r\n\t\t\t\tbackToMenu.pack();\r\n\t\t\t\tbackToMenu.setSize(750, 650);\r\n\t\t\t\tbackToMenu.setVisible(true);\r\n\t\t\t}\r\n\t\t}if (winnerChip == 67) {\r\n\t\t\tint result = JOptionPane.showConfirmDialog(null, \" You lost! Do you want to start a new game?\", null, JOptionPane.YES_NO_OPTION);\r\n\t\t\tif (result == JOptionPane.YES_OPTION) {\r\n\t\t\t\tgameReset();\r\n\t\t\t} else if (result == JOptionPane.NO_OPTION) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \" Click Ok to return to Main Menu\");\r\n\r\n\t\t\t\tJFrame backToMenu = new JFrame(\"Main Menu\");\r\n\r\n\t\t\t\tbackToMenu.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\t\t\tbackToMenu.getContentPane().add(new MainMenu());\r\n\t\t\t\tbackToMenu.pack();\r\n\t\t\t\tbackToMenu.setSize(750, 650);\r\n\t\t\t\tbackToMenu.setVisible(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void updatePanel(JPanel panel, CardType type) {\n\t\t//clear the panel\n\t\tpanel.removeAll();\n\t\tJLabel handLabel = new JLabel(\"In Hand:\");\n\t\tpanel.add(handLabel);\n\t\tboolean handNotZero = false;\n\t\t//if any card matches desired card type, create a text field\n\t\tfor (Card card : board.getHumanPlayer().getHand()) {\n\t\t\tif (card.getType().equals(type)) {\n\t\t\t\tJTextField text = new JTextField(card.getName());\n\t\t\t\ttext.setBackground(card.getColor());\n\t\t\t\tpanel.add(text);\n\t\t\t\thandNotZero = true;\n\t\t\t}\n\t\t}\n\t\t//if no cards in hand, create a non text field\n\t\tif(!handNotZero) {\n\t\t\tJTextField text = new JTextField(\"None\");\n\t\t\tpanel.add(text);\n\t\t}\n\n\t\tJLabel seenLabel = new JLabel(\"Seen:\");\n\t\tpanel.add(seenLabel);\n\t\tif (board.getHumanPlayer().getSeenCards().size() == 0) {\n\t\t\tJTextField text = new JTextField(\"None\");\n\t\t\tpanel.add(text);\n\t\t} else {\n\t\t\t//create text fields for seen cards\n\t\t\tfor (Card card : board.getHumanPlayer().getSeenCards()) {\n\t\t\t\tif (card.getType().equals(type)) {\n\t\t\t\t\tJTextField text = new JTextField(card.getName());\n\t\t\t\t\t//color code the text fields according to players\n\t\t\t\t\ttext.setBackground(card.getColor());\n\t\t\t\t\tpanel.add(text);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void newGame(){\n\t\tsetUp.buildBoard(8,8);\n\t\tfor(int i = 0; i < boardBoundsRow * boardBoundsColumn; i++){\n\t\t\tJPanel selectedTile = (JPanel) userInterface.boardButtons.getComponent(i);\n\t\t\tselectedTile.removeAll();\n\t\t\tselectedTile.revalidate();\n\t\t}\n\t\tuserInterface.addBlackPiece();\n\t\tuserInterface.addWhitePiece();\n\t\tuserInterface.check.setText(\"You are not in check\");\n\t\tking.blackKingCheck = false;\n\t\tking.whiteKingCheck = false;\n\t\tturn = \"white\";\n\t\tString playerTurn = \"Player turn: \";\n\t\tuserInterface.turn.setText(playerTurn.concat(turn));\n\t\tundoMoveClass.clearStacks();\n\t}", "public void looser()\n {\n this.mapFrame.looser();\n }", "public int getPlayerVisiblePosition(Colour colour);", "public static void showPreviousPlayerNames() {\r\n\t\tGameSetup.choiceBoxPlayer1.select(Main.player1);\r\n\t\tGameSetup.choiceBoxPlayer2.select(Main.player2);\r\n\t\tGameSetup.choiceBoxPlayer3.select(Main.player3);\r\n\t\t\r\n\t\t//Don't show fourth player if playing 3 handed game.\r\n\t\tif (!Main.isThreeHanded) {\r\n\t\t\tGameSetup.choiceBoxPlayer4.select(Main.player4);\r\n\t\t}\r\n\t}", "@Override\n public void gameWindow() {\n gameBoard = guiGame.getPanel();\n boardArea = guiGame.getBoardArea();\n inputArea = guiGame.getInputArea();\n JButton sendMessageButton = guiGame.getSendButton();\n JButton skipTurnButton = guiGame.getSkipTurnButton();\n JButton swapPiece = guiGame.getSwapPieceButton();\n messagesArea = guiGame.getMessagesArea();\n JButton forfeitButton = guiGame.getForfeitButton();\n JLabel usernameLabel = guiGame.getUsernameLabel();\n usernameLabel.setText(username);\n JButton movePieceButton = guiGame.getMovePieceButton();\n JButton leaveButton = guiGame.getLeaveButton();\n JButton hintButton = guiGame.getHintButton();\n\n boardArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 20));\n boardArea.setEditable(false);\n\n messagesArea.setEditable(false);\n inventoryArea.setEditable(false);\n\n forfeitButton.addActionListener(e -> {\n connectedServer.writeMessage(client.leave());\n frame.setContentPane(gameList);\n });\n\n JPanel piecePanel = new JPanel();\n piecePanel.add(new JLabel(\"Piece number:\"));\n JTextField pieceNumber = new JTextField(1);\n piecePanel.add(pieceNumber);\n piecePanel.add(Box.createHorizontalStrut(15));\n piecePanel.add(new JLabel(\"Index on board:\"));\n JTextField indexOnBoard = new JTextField(2);\n piecePanel.add(indexOnBoard);\n piecePanel.add(Box.createHorizontalStrut(15));\n piecePanel.add(new JLabel(\"Rotation 1 or 2 (0 for default)\"));\n JTextField rotationField = new JTextField(1);\n rotationField.setText(\"0\");\n piecePanel.add(rotationField);\n\n\n\n movePieceButton.addActionListener(e -> {\n int result = JOptionPane.showConfirmDialog(frame, piecePanel, \"Move piece\", JOptionPane.OK_CANCEL_OPTION);\n if(result == JOptionPane.OK_OPTION) {\n int pieceNum = Integer.parseInt(pieceNumber.getText());\n int i = Integer.parseInt(indexOnBoard.getText());\n int rotation = Integer.parseInt(rotationField.getText());\n if(!Board.isLegal(i)) {\n JOptionPane.showMessageDialog(frame, \"Invalid board index\", \"Ilegal board index\", JOptionPane.ERROR_MESSAGE);\n } else if(pieceNum > client.getGame().getPlayer(username).getInventory().size()) {\n JOptionPane.showMessageDialog(frame, \"Invalid piece number\", \"Ilegal piece\", JOptionPane.ERROR_MESSAGE);\n } else {\n Tile t = client.getGame().getPlayer(username).getInventory().get(pieceNum - 1);\n t.rotate(rotation);\n connectedServer.writeMessage(client.move(t, i));\n }\n }\n });\n\n skipTurnButton.addActionListener(e -> {\n connectedServer.writeMessage(client.skip());\n });\n\n hintButton.addActionListener(e -> {\n giveHint(client.getHint());\n });\n\n swapPiece.addActionListener(e -> {\n String[] options = {\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"};\n String result = (String) JOptionPane.showInputDialog(frame, \"Piece number:\", \"Swap piece\", JOptionPane.QUESTION_MESSAGE, null, options, options[0]);\n int resultInt = Integer.parseInt(result);\n if(resultInt > client.getGame().getPlayer(username).getInventory().size()) {\n JOptionPane.showMessageDialog(frame, \"Invalid piece number\", \"Ilegal piece\", JOptionPane.ERROR_MESSAGE);\n } else {\n connectedServer.writeMessage(client.swap(client.getGame().getPlayer(username).getInventory().get(resultInt)));\n }\n });\n\n sendMessageButton.addActionListener(e -> {\n executeCommand();\n });\n\n leaveButton.addActionListener(e -> {\n forfeit();\n });\n\n //an action for when someone presses enter in the inputArea\n Action pressedEnter = new AbstractAction() {\n public void actionPerformed(ActionEvent e) {\n executeCommand();\n }\n };\n\n inputArea.getInputMap().put(KeyStroke.getKeyStroke(\"ENTER\"),\n pressedEnter);\n\n frame.setContentPane(gameBoard);\n frame.revalidate();\n\n forfeitButton.addActionListener(e -> {\n forfeit();\n });\n\n client.setGame(connectedGamePlayerCount);\n client.getGame().addPlayer(client.getPlayer());\n\n tui = new TUI();\n messagesArea.append(tui.HELP);\n\n boardArea.append(tui.getBoard());\n }", "public void switchToMap()\n {\n feedbackLabel.setVisible(false);\n d.setVisible(false);\n a.setText(destinations[0].getName());\n b.setText(destinations[1].getName());\n c.setText(destinations[2].getName());\n currentClue=destinations[0].getRandClue();\n questionLabel.setText(currentClue);\n atQuestionStage=false;\n shuffleButtons();\n questionLabel.setBounds(650-questionLabel.getPreferredSize().width,120,600,30);\n mapImageLabel.setVisible(true);\n mapImageLabel.repaint();\n revalidate();\n }", "public String getThePanel() {\r\n\t\treturn secretIt.currentS().puzzle();\r\n\t}", "public void PrevTurn(){\n currentTurn = currentTurn.getAnterior();\n String turno = (String) currentTurn.getDato();\n String info[] = turno.split(\"#\");\n\n int infoIn = 4;\n for (int i = 0; i < 10; i++, infoIn += 1) {\n label_list[i].setIcon(new ImageIcon(info[infoIn]));\n this.screen.add(label_list[i]);\n }\n HP.setText(\"HP: \"+info[2]);\n action.setText(\"Action: \"+info[1]);\n mana.setText(\"Mana: \"+info[3]);\n game.setText(\"Game \"+String.valueOf(partidaNum)+\", Turn \"+info[0]);\n\n VerifyButtons();\n\n }", "public void initPanel() {\n\n puzzlePanel.setVisible(false);\n puzzlePanel = new PuzzlePanel(panelSize);\n\n getContentPane().add(puzzlePanel, BorderLayout.CENTER);\n getContentPane().add(controlPanel, BorderLayout.SOUTH);\n puzzlePanel.setVisible(true);\n\n isWin = false;\n puzzlePanel.setMoveCount(0);\n\n lblMove.setText(\"Jumlah Gerakan: 0\");\n lblTime.setText(\"Waktu: 0 detik\");\n startTime = System.currentTimeMillis();\n\n Thread t = new Thread(new Runnable() {\n @Override\n public void run() {\n while (!isWin) {\n try {\n currentTime = System.currentTimeMillis();\n lblTime.setText(\"Waktu terpakai: \" + ((currentTime - startTime) / 1000)\n + \" detik\");\n Thread.sleep(1000);\n } catch (InterruptedException ex) {\n ex.printStackTrace();\n }\n }\n }\n });\n t.start();\n }", "Position getNewPosition();", "public void dropDown(){\n\t\tPoint test_location = new Point(pieceOrigin);\n\t\ttest_location.y += 1;\n\t\tif(!collides(test_location, currentPiece))\n\t\t\tpieceOrigin.y += 1;\n\t\telse\n\t\t\tgossipGirl();\n\t\trepaint();\n\t}", "public void enterPlayerView(){\n\t\tplayerSeen=true;\r\n\t\tplayerMapped=true;\r\n\t}", "public void GameWin () {\n\t\t\n\t\twordDashes.setText(mysteryWord);\n\t\tguessBttn.setVisible(false);\n\t\tguessFullWord.setVisible(false);\n\t\tAnswerBox.setDisable(true); //can no longer use the text box\n\t\tresultMessage.setText(\" Great Job!!\\nYou Guessed the Word!!\");\n\t\tplayAgain.setVisible(true); \n\t\t\n\t}", "private void setupGameOverPanel(){\n\n //Adding the gameOver label to gameOverPanel\n gameOver.setFont(new Font(Font.SERIF, Font.BOLD, 50));\n gameOver.setAlignmentX(Font.CENTER_BASELINE);\n gameOverPanel.add(gameOver);\n\n //Adding the gameOverPanel to fullPanel\n fullPanel.add(gameOverPanel, BorderLayout.NORTH);\n }", "public void noteIncorrectGuess(char letter) {\n\t\tguesses += letter;\n\t\tguessesLabel.setLabel(guesses);\n\t\tguessesLabel.setLocation((getWidth() - guessesLabel.getWidth()) / 2, wordLabel.getY() + wordLabel.getHeight()\n\t\t\t\t+ WORD_SPACING);\n\t\tif (guesses.length() == 1)\n\t\t\tbody.add(buildHead());\n\t\tif (guesses.length() == 2)\n\t\t\tbody.add(buildTorso());\n\t\tif (guesses.length() == 3)\n\t\t\tbody.add(buildLeftArm());\n\t\tif (guesses.length() == 4)\n\t\t\tbody.add(buildRightArm());\n\t\tif (guesses.length() == 5)\n\t\t\tbody.add(buildLeftLeg());\n\t\tif (guesses.length() == 6)\n\t\t\tbody.add(buildRightLeg());\n\t\tif (guesses.length() == 7)\n\t\t\tbody.add(buildLeftFoot());\n\t\tif (guesses.length() == 8)\n\t\t\tbody.add(buildRightFoot());\n\t}", "public NatsMinesweeper(int height, int width, int numMines)\n {\n //Create and set up the window.\n super(\"Nat's Minesweeper\");\n setSize(2*MARGIN_SIZE + width*SQUARE_SIZE, \n \tTITLE_BAR_HEIGHT + 3*MARGIN_SIZE + H + height*SQUARE_SIZE);\n setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n setResizable(false);\n gameWon = false;\n gameLost = false;\n \t\n \t//Create and set up a blank panel to fill the window, on which all other panels will be placed.\n JPanel panel = new JPanel();\n panel.setSize(getWidth(), getHeight());\n panel.setBackground(Color.WHITE);\n panel.setLayout(null);\n add(panel);\n \n \t//Create and set up a MineCounter in the top left of the window to keep track of the mines left.\n this.numMines = numMines;\n minesFound = 0;\n mineCounter = new MineCounter(numMines);\n panel.add(mineCounter);\n mineCounter.setLocation(MARGIN_SIZE, MARGIN_SIZE);\n \n \t//Create and set up a TimerDisplay in the top right of the window to display the elapsed time.\n timerDisplay = new TimerDisplay();\n panel.add(timerDisplay);\n timerDisplay.setLocation(panel.getWidth() - MARGIN_SIZE - W, MARGIN_SIZE);\n \n \t//Create and set up a ResetButton to reset the game.\n resetButton = new ResetButton();\n panel.add(resetButton);\n resetButton.setLocation(panel.getWidth()/2 - H/2, MARGIN_SIZE);\n \n \t//Create a board panel to hold all the game squares in a grid pattern, \n \t//then fill the board (and grid) with GameSquares.\n JPanel board = new JPanel(new GridLayout(height, width));\n board.setSize(width*SQUARE_SIZE, height*SQUARE_SIZE);\n panel.add(board);\n board.setLocation(MARGIN_SIZE, H + 2*MARGIN_SIZE);\n grid = new GameSquare[height][width];\n for (int r = 0; r < height; r++)\n {\n for (int c = 0; c < width; c++)\n {\n grid[r][c] = new GameSquare(r, c);\n board.add(grid[r][c]);\n }\n }\n \n setVisible(true); //Finally, display the window, allowing the game to begin.\n }", "void showpos(pieces chesspiece)\n {if(chesspiece.alive == true)\n {\n int position = chesspiece.position;\n chesspiece.select = true;\n \n int x;int y;\n if((position+1)%8 == 0) {x = 8; y = (position+8)/8;}\n else{ x = (position+1)%8;\n y = (position+9)/8;}\n chesspiece.move(new moves(x,y));\n for( int a : chesspiece.movnum )\n {\n if ( chesspiece.color == 0)\n {\n if (Checkerboard.allWhitePositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.GRAY);\n else if (Checkerboard.allBlackPositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.RED);\n else\n panel[a-1].setBackground(Color.GREEN);\n }\n else\n {\n if (Checkerboard.allWhitePositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.RED);\n else if (Checkerboard.allBlackPositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.GRAY);\n else\n panel[a-1].setBackground(Color.GREEN);\n }\n \n }\n }//if(chesspiece.alive==true) ends\n }", "private void addMinigames(){\n Point a = new Point();\n getWindowManager().getDefaultDisplay().getSize(a);\n Log.d(\"XY\", Integer.toString(a.x)+\" \"+Integer.toString(a.y));\n\n\n\n generateMiniGames();\n\n addFlower();\n\n }", "public void doGameOver() {\r\n\t// all players takes seeds left on their side of the game\r\n\tfor (short i = 0; i < this.size; i++) {\r\n\t if (this.territory[0][i] != 0) {\r\n\t\tthis.points[0] += this.territory[0][i];\r\n\t\tthis.territory[0][i] = 0;\r\n\t\tfireChanged(TERRITORY, (short) 0, i);\r\n\t }\r\n\r\n\t if (this.territory[1][i] != 0) {\r\n\t\tthis.points[1] += this.territory[1][i];\r\n\t\tthis.territory[1][i] = 0;\r\n\t\tfireChanged(TERRITORY, (short) 1, i);\r\n\t }\r\n\t}\r\n\tfireChanged(POINTS, NO_SIDE, NO_POSITION);\r\n }", "private void updateLastCardDiscarded(){\r\n\t\tint x = 0;\r\n\t\twhile(this != game.getPlayer(x++)){} // find the nextPlayer\r\n\t\tx = x % game.getNumberOfPlayers();\r\n\t\tnextPlayer = game.getPlayer(x);\r\n\t\t\r\n\t\tif(latestRound != game.getRoundNumber()){ // if it's a new Round, reset\r\n\t\t\tpickedUpCards = new ArrayList<Card>();\r\n\t\t\tlastCardDiscarded = null;\r\n\t\t\tlatestRound = game.getRoundNumber();\r\n\t\t\t\r\n\t\t\tfor(int y = 0; y < game.getNumberOfPlayers(); y++){ // ?????\r\n\t\t\t\tif(game.getPlayer(y) != this && \r\n\t\t\t\t\t\t(getScore() >= game.getPlayer(y).getScore() || getPhase() > game.getPlayer(y).getPhase())){//????\r\n\t\t\t\t\tsetName(oldName);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetName(oldName + \"is#WINNING\"); // ?????\r\n\t\t}else if(lastCardDiscarded != null && Configuration.getTypeRequired(nextPlayer.getPhase(), 0) == Configuration.SET_PHASE){\r\n\t\t\tif(nextPlayer.drewFromDiscard())\r\n\t\t\t\tpickedUpCards.add(lastCardDiscarded); // add the card to picked up card if it was picked up \r\n\t\t}\r\n\t}", "private void overwritePosition(int oldRow, int oldCol, int newRow, int newCol){\n gameBoard[newRow][newCol] = gameBoard[oldRow][oldCol];\n gameBoard[oldRow][oldCol] = new EmptyPiece();\n }", "@Override\n\tpublic void update() {\n\t\t\n\t\tif(!this.explShowing)\n\t\t{\n\t\t\tx+= dx;\n\t\t\ty+= dy;\n\t\n\t\t\tif(x < 0)\n\t\t\t{\n\t\t\t\tx = 0;\n\t\t\t\tdx = dx *-1;\n\t\t\t}\n\t\t\telse\n\t\t\tif(x + w > MainGame.getInstance().X_WORLD_END)\n\t\t\t{\n\t\t\t\tx = MainGame.getInstance().X_WORLD_END - w ;\n\t\t\t\tdx = dx *-1;\t\n\t\t\t}\n\t\n\t\t\tif(y < 0)\n\t\t\t{\n\t\t\t\tthis.reset();\n\t\t\t}\n\t\t\telse\n\t\t\tif(y + h > MainGame.getInstance().Y_WORLD_END)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tthis.reset();\n\t\t\t}\n\t\t}\n\t\t\n\t\ts.update();\n\t\n\t\tif(this.explShowing)\n\t\t{\n\t\t\tif(expl.isHasFinished())\n\t\t\t{\n\t\t\t\texplShowing = false;\n\t\t\t\ts = this.normalImage;\n\t\t\t\tthis.x = this.xStart;\n\t\t\t\tthis.y = this.yStart;\n\t\t\t\ts.setX(this.xStart);\n\t\t\t\ts.setY(this.yStart);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//s.setX(x);\n\t\t//s.setY(y);\n\t\t\n\t\tthis.rect.setFrame(getX(),getY(),getW(),getH());\t\n\t}", "public void showpuzzle(){\n\t\tpuzzle();\n\t\tframe.setVisible(true);\n\t\twordHint = 0;\n\t\tif(wordHint == length){\n\t\t\tCollections.shuffle(puzzle);\n\t\t\twordHint++;\n\t\t}\n\t}", "@Override\n public Location getDisplayedLocation() {\n this.displayedLocation = new Location((int)pane.getHvalue(), (int)pane.getVvalue(), curFloor, \"Unknown\");\n return displayedLocation;\n }", "private void updateBigGameBoardForNextMove(){\n changeLetterAndVisuals();\n /*\n This next step is essential to the game:\n The player just chose a position on a smallGameBoard; this position is where he will\n be able to choose on the big board. For example, if player 1 puts an x in the top-left\n corner of a small game, then player 2 should play in the top-left small game (provided\n it is not already won).\n */\n nextGamePosition = chosenButton.getButtonPosition();\n nextGame = getGame(nextGamePosition);\n //If the next game is already won, then the next player can choose anywhere\n if (checkGameWin(nextGame.getLettersOfAllButtons())){\n for (ButtonClass b : allButtons) {\n b.setAvailable(true);\n }\n for(SmallGameBoard game: games){\n if (game.getGameBoardColor() == R.color.blackTransparent){\n game.changeGameColor(R.color.black);\n }\n }\n } else {\n //If next game is not won, then the player must play on the next game board\n setAvailableButtons(nextGamePosition);\n //Sets all boards besides the next game board to half transparent\n for (SmallGameBoard game: games){\n if(game.getGameBoardColor() == R.color.black){\n game.changeGameColor(R.color.blackTransparent);\n }\n }\n nextGame.changeGameColor(R.color.black);\n }\n //For playerVsComputer, this is when the computer makes its move\n if (!activity.getPlayerVsPlayer() && !computerIsMoving){\n computerMove(activity.getDifficulty());\n computerIsMoving = false;\n }\n }", "public int getCurrentPlayerRealPosition();", "private void nextPosition()\n\t{\n\t\tdouble playerX = Game.player.getX();\n\t\tdouble playerY = Game.player.getY();\n\t\tdouble diffX = playerX - x;\n\t\tdouble diffY = playerY - y;\n\t\tif(Math.abs(diffX) < 64 && Math.abs(diffY) < 64)\n\t\t{\n\t\t\tclose = true;\n\t\t} \n\t\telse\n\t\t{\n\t\t\tclose = false;\n\t\t}\n\t\tif(close)\n\t\t{\n\t\t\tattackPlayer();\n\t\t} \n\t\telse if(alarm.done())\n\t\t{\n\t\t\tdirection = Math.abs(random.nextInt() % 360) + 1;\n\t\t\talarm.setTime(50);\n\t\t}\n\t\thspd = MathMethods.lengthDirX(speed, direction);\n\t\tvspd = MathMethods.lengthDirY(speed, direction);\n\t\tif(hspd > 0 && !flippedRight)\n\t\t{\n\t\t\tflippedRight = true;\n\t\t\tsetEnemy();\n\t\t} \n\t\telse if(hspd < 0 && flippedRight)\n\t\t{\n\t\t\tflippedRight = false;\n\t\t\tsetEnemy();\n\t\t}\n\t\tmove();\n\t\talarm.tick();\n\t\tshootTimer.tick();\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n mainPanel = new javax.swing.JPanel();\n jtabGames = new javax.swing.JTabbedPane();\n jPanel1 = new javax.swing.JPanel();\n jbtnTTT1 = new javax.swing.JButton();\n jbtnTTT2 = new javax.swing.JButton();\n jbtnTTT3 = new javax.swing.JButton();\n jbtnTTT4 = new javax.swing.JButton();\n jbtnTTT5 = new javax.swing.JButton();\n jbtnTTT6 = new javax.swing.JButton();\n jbtnTTT7 = new javax.swing.JButton();\n jbtnTTT8 = new javax.swing.JButton();\n jbtnTTT9 = new javax.swing.JButton();\n jPanel2 = new javax.swing.JPanel();\n jLabel2 = new javax.swing.JLabel();\n jtxtGuess = new javax.swing.JTextField();\n jScrollPane1 = new javax.swing.JScrollPane();\n jtxtGuessHistory = new javax.swing.JTextArea();\n jbtnSubmit = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jtxtGameName = new javax.swing.JTextField();\n jLabel4 = new javax.swing.JLabel();\n jtxtMoveResult = new javax.swing.JTextField();\n jLabel3 = new javax.swing.JLabel();\n jScrollPane2 = new javax.swing.JScrollPane();\n jtxtInstructions = new javax.swing.JTextArea();\n jbtnClear = new javax.swing.JButton();\n menuBar = new javax.swing.JMenuBar();\n javax.swing.JMenu fileMenu = new javax.swing.JMenu();\n jmnuGuessing = new javax.swing.JMenu();\n jmnuHiLo = new javax.swing.JMenuItem();\n jmnuHotCold = new javax.swing.JMenuItem();\n jmnuTTT = new javax.swing.JMenu();\n jmnuTTTNew = new javax.swing.JMenuItem();\n javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();\n javax.swing.JMenu helpMenu = new javax.swing.JMenu();\n javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();\n statusPanel = new javax.swing.JPanel();\n javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();\n statusMessageLabel = new javax.swing.JLabel();\n statusAnimationLabel = new javax.swing.JLabel();\n progressBar = new javax.swing.JProgressBar();\n\n mainPanel.setName(\"mainPanel\"); // NOI18N\n\n jtabGames.setEnabled(false);\n jtabGames.setName(\"jtabGames\"); // NOI18N\n\n org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(games.GamesApp.class).getContext().getResourceMap(GamesView.class);\n jPanel1.setBackground(resourceMap.getColor(\"jPanel1.background\")); // NOI18N\n jPanel1.setName(\"jPanel1\"); // NOI18N\n\n jbtnTTT1.setFont(resourceMap.getFont(\"jbtnTTT1.font\")); // NOI18N\n jbtnTTT1.setName(\"jbtnTTT1\"); // NOI18N\n jbtnTTT1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtnTTT1ActionPerformed(evt);\n }\n });\n\n jbtnTTT2.setFont(resourceMap.getFont(\"jbtnTTT1.font\")); // NOI18N\n jbtnTTT2.setAlignmentY(0.0F);\n jbtnTTT2.setBorderPainted(false);\n jbtnTTT2.setMargin(new java.awt.Insets(0, 14, 0, 14));\n jbtnTTT2.setName(\"jbtnTTT2\"); // NOI18N\n jbtnTTT2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtnTTT2ActionPerformed(evt);\n }\n });\n\n jbtnTTT3.setFont(resourceMap.getFont(\"jbtnTTT1.font\")); // NOI18N\n jbtnTTT3.setAlignmentY(0.0F);\n jbtnTTT3.setBorderPainted(false);\n jbtnTTT3.setMargin(new java.awt.Insets(0, 14, 0, 14));\n jbtnTTT3.setName(\"jbtnTTT3\"); // NOI18N\n jbtnTTT3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtnTTT3ActionPerformed(evt);\n }\n });\n\n jbtnTTT4.setFont(resourceMap.getFont(\"jbtnTTT1.font\")); // NOI18N\n jbtnTTT4.setName(\"jbtnTTT4\"); // NOI18N\n jbtnTTT4.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtnTTT4ActionPerformed(evt);\n }\n });\n\n jbtnTTT5.setFont(resourceMap.getFont(\"jbtnTTT1.font\")); // NOI18N\n jbtnTTT5.setAlignmentY(0.0F);\n jbtnTTT5.setBorderPainted(false);\n jbtnTTT5.setMargin(new java.awt.Insets(0, 14, 0, 14));\n jbtnTTT5.setName(\"jbtnTTT5\"); // NOI18N\n jbtnTTT5.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtnTTT5ActionPerformed(evt);\n }\n });\n\n jbtnTTT6.setFont(resourceMap.getFont(\"jbtnTTT1.font\")); // NOI18N\n jbtnTTT6.setAlignmentY(0.0F);\n jbtnTTT6.setBorderPainted(false);\n jbtnTTT6.setMargin(new java.awt.Insets(0, 14, 0, 14));\n jbtnTTT6.setName(\"jbtnTTT6\"); // NOI18N\n jbtnTTT6.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtnTTT6ActionPerformed(evt);\n }\n });\n\n jbtnTTT7.setFont(resourceMap.getFont(\"jbtnTTT1.font\")); // NOI18N\n jbtnTTT7.setName(\"jbtnTTT7\"); // NOI18N\n jbtnTTT7.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtnTTT7ActionPerformed(evt);\n }\n });\n\n jbtnTTT8.setFont(resourceMap.getFont(\"jbtnTTT1.font\")); // NOI18N\n jbtnTTT8.setAlignmentY(0.0F);\n jbtnTTT8.setBorderPainted(false);\n jbtnTTT8.setMargin(new java.awt.Insets(0, 14, 0, 14));\n jbtnTTT8.setName(\"jbtnTTT8\"); // NOI18N\n jbtnTTT8.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtnTTT8ActionPerformed(evt);\n }\n });\n\n jbtnTTT9.setFont(resourceMap.getFont(\"jbtnTTT1.font\")); // NOI18N\n jbtnTTT9.setAlignmentY(0.0F);\n jbtnTTT9.setBorderPainted(false);\n jbtnTTT9.setMargin(new java.awt.Insets(0, 14, 0, 14));\n jbtnTTT9.setName(\"jbtnTTT9\"); // NOI18N\n jbtnTTT9.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtnTTT9ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jbtnTTT1, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jbtnTTT2, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jbtnTTT3, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jbtnTTT4, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jbtnTTT5, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jbtnTTT6, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jbtnTTT7, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jbtnTTT8, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jbtnTTT9, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jbtnTTT3, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jbtnTTT2, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jbtnTTT1, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jbtnTTT6, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jbtnTTT5, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jbtnTTT4, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jbtnTTT9, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jbtnTTT8, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jbtnTTT7, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)))\n );\n\n jtabGames.addTab(resourceMap.getString(\"jPanel1.TabConstraints.tabTitle\"), jPanel1); // NOI18N\n\n jPanel2.setName(\"jPanel2\"); // NOI18N\n\n jLabel2.setText(resourceMap.getString(\"jLabel2.text\")); // NOI18N\n jLabel2.setName(\"jLabel2\"); // NOI18N\n\n jtxtGuess.setFont(resourceMap.getFont(\"jtxtGuess.font\")); // NOI18N\n jtxtGuess.setName(\"jtxtGuess\"); // NOI18N\n\n jScrollPane1.setName(\"jScrollPane1\"); // NOI18N\n\n jtxtGuessHistory.setEditable(false);\n jtxtGuessHistory.setColumns(20);\n jtxtGuessHistory.setLineWrap(true);\n jtxtGuessHistory.setRows(5);\n jtxtGuessHistory.setWrapStyleWord(true);\n jtxtGuessHistory.setName(\"jtxtGuessHistory\"); // NOI18N\n jScrollPane1.setViewportView(jtxtGuessHistory);\n\n jbtnSubmit.setText(resourceMap.getString(\"jbtnSubmit.text\")); // NOI18N\n jbtnSubmit.setEnabled(false);\n jbtnSubmit.setName(\"jbtnSubmit\"); // NOI18N\n jbtnSubmit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtnSubmitActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1)\n .addContainerGap())\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()\n .addContainerGap(70, Short.MAX_VALUE)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jtxtGuess, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jbtnSubmit)\n .addGap(63, 63, 63))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jtxtGuess, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2)\n .addComponent(jbtnSubmit))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n jtabGames.addTab(resourceMap.getString(\"jPanel2.TabConstraints.tabTitle\"), jPanel2); // NOI18N\n\n jLabel1.setText(resourceMap.getString(\"jLabel1.text\")); // NOI18N\n jLabel1.setName(\"jLabel1\"); // NOI18N\n\n jtxtGameName.setFont(resourceMap.getFont(\"jtxtGameName.font\")); // NOI18N\n jtxtGameName.setEnabled(false);\n jtxtGameName.setName(\"jtxtGameName\"); // NOI18N\n\n jLabel4.setText(resourceMap.getString(\"jLabel4.text\")); // NOI18N\n jLabel4.setName(\"jLabel4\"); // NOI18N\n\n jtxtMoveResult.setFont(resourceMap.getFont(\"jtxtMoveResult.font\")); // NOI18N\n jtxtMoveResult.setEnabled(false);\n jtxtMoveResult.setName(\"jtxtMoveResult\"); // NOI18N\n\n jLabel3.setText(resourceMap.getString(\"jLabel3.text\")); // NOI18N\n jLabel3.setName(\"jLabel3\"); // NOI18N\n\n jScrollPane2.setName(\"jScrollPane2\"); // NOI18N\n\n jtxtInstructions.setEditable(false);\n jtxtInstructions.setColumns(20);\n jtxtInstructions.setLineWrap(true);\n jtxtInstructions.setRows(5);\n jtxtInstructions.setWrapStyleWord(true);\n jtxtInstructions.setName(\"jtxtInstructions\"); // NOI18N\n jScrollPane2.setViewportView(jtxtInstructions);\n\n jbtnClear.setText(resourceMap.getString(\"jbtnClear.text\")); // NOI18N\n jbtnClear.setName(\"jbtnClear\"); // NOI18N\n jbtnClear.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtnClearActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);\n mainPanel.setLayout(mainPanelLayout);\n mainPanelLayout.setHorizontalGroup(\n mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(mainPanelLayout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()\n .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jtabGames, javax.swing.GroupLayout.PREFERRED_SIZE, 317, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(mainPanelLayout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jtxtGameName, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(27, 27, 27)))\n .addGap(24, 24, 24)\n .addComponent(jbtnClear)\n .addGap(28, 28, 28))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 510, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()\n .addComponent(jLabel4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jtxtMoveResult, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(142, 142, 142))))\n );\n mainPanelLayout.setVerticalGroup(\n mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(mainPanelLayout.createSequentialGroup()\n .addGap(30, 30, 30)\n .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jtxtGameName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1)\n .addComponent(jbtnClear))\n .addGap(18, 18, 18)\n .addComponent(jtabGames, javax.swing.GroupLayout.PREFERRED_SIZE, 312, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jtxtMoveResult, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE)\n .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3))\n .addContainerGap())\n );\n\n menuBar.setName(\"menuBar\"); // NOI18N\n\n fileMenu.setText(resourceMap.getString(\"fileMenu.text\")); // NOI18N\n fileMenu.setName(\"fileMenu\"); // NOI18N\n\n jmnuGuessing.setText(resourceMap.getString(\"jmnuGuessing.text\")); // NOI18N\n jmnuGuessing.setName(\"jmnuGuessing\"); // NOI18N\n\n jmnuHiLo.setText(resourceMap.getString(\"jmnuHiLo.text\")); // NOI18N\n jmnuHiLo.setName(\"jmnuHiLo\"); // NOI18N\n jmnuHiLo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jmnuHiLoActionPerformed(evt);\n }\n });\n jmnuGuessing.add(jmnuHiLo);\n\n jmnuHotCold.setText(resourceMap.getString(\"jmnuHotCold.text\")); // NOI18N\n jmnuHotCold.setName(\"jmnuHotCold\"); // NOI18N\n jmnuHotCold.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jmnuHotColdActionPerformed(evt);\n }\n });\n jmnuGuessing.add(jmnuHotCold);\n\n fileMenu.add(jmnuGuessing);\n\n jmnuTTT.setText(resourceMap.getString(\"jmnuTTT.text\")); // NOI18N\n jmnuTTT.setName(\"jmnuTTT\"); // NOI18N\n\n jmnuTTTNew.setText(resourceMap.getString(\"jmnuTTTNew.text\")); // NOI18N\n jmnuTTTNew.setName(\"jmnuTTTNew\"); // NOI18N\n jmnuTTTNew.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jmnuTTTNewActionPerformed(evt);\n }\n });\n jmnuTTT.add(jmnuTTTNew);\n\n fileMenu.add(jmnuTTT);\n\n javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(games.GamesApp.class).getContext().getActionMap(GamesView.class, this);\n exitMenuItem.setAction(actionMap.get(\"quit\")); // NOI18N\n exitMenuItem.setName(\"exitMenuItem\"); // NOI18N\n fileMenu.add(exitMenuItem);\n\n menuBar.add(fileMenu);\n\n helpMenu.setText(resourceMap.getString(\"helpMenu.text\")); // NOI18N\n helpMenu.setName(\"helpMenu\"); // NOI18N\n\n aboutMenuItem.setAction(actionMap.get(\"showAboutBox\")); // NOI18N\n aboutMenuItem.setName(\"aboutMenuItem\"); // NOI18N\n helpMenu.add(aboutMenuItem);\n\n menuBar.add(helpMenu);\n\n statusPanel.setName(\"statusPanel\"); // NOI18N\n\n statusPanelSeparator.setName(\"statusPanelSeparator\"); // NOI18N\n\n statusMessageLabel.setName(\"statusMessageLabel\"); // NOI18N\n\n statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n statusAnimationLabel.setName(\"statusAnimationLabel\"); // NOI18N\n\n progressBar.setName(\"progressBar\"); // NOI18N\n\n javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);\n statusPanel.setLayout(statusPanelLayout);\n statusPanelLayout.setHorizontalGroup(\n statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 595, Short.MAX_VALUE)\n .addGroup(statusPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(statusMessageLabel)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 425, Short.MAX_VALUE)\n .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(statusAnimationLabel)\n .addContainerGap())\n );\n statusPanelLayout.setVerticalGroup(\n statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(statusPanelLayout.createSequentialGroup()\n .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(statusMessageLabel)\n .addComponent(statusAnimationLabel)\n .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(3, 3, 3))\n );\n\n setComponent(mainPanel);\n setMenuBar(menuBar);\n setStatusBar(statusPanel);\n }", "public void afterReceivedBoardURL(String url) {\r\n \tSystem.out.println(\"[DEBUG LOG/Game.java] Updating board...\");\r\n\t\tboardImageURL = url;\r\n\t\tEmbedBuilder embed = new EmbedBuilder();\r\n\t\tembed.setTitle(\"Board\");\r\n\t\tembed.setColor(Color.GRAY);\r\n\t\t\r\n\t\t// Calculate clank footer\r\n\t\tint totalClank = dragonClank + p1.getClankInBag();\r\n\t\tif (playerCount >= 2) {\r\n\t\t\ttotalClank += p2.getClankInBag();\r\n\t\t\tif (playerCount >= 3) {\r\n\t\t\t\ttotalClank += p3.getClankInBag();\r\n\t\t\t\tif (playerCount >= 4) {\r\n\t\t\t\t\ttotalClank += p4.getClankInBag();\r\n\t\t\t\t\tembed.setFooter(dragonClank+\" BLACK / \"+p1.getClankInBag()+\" (\"+p1.getClankOnBoard()+\") RED / \"+p2.getClankInBag()+\" (\"+p2.getClankOnBoard()+\") BLUE / \"+p3.getClankInBag()+\" (\"+p3.getClankOnBoard()+\") YELLOW / \"+p4.getClankInBag()+\" (\"+p4.getClankOnBoard()+\") GREEN / \"+totalClank+\" TOTAL\", null);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tembed.setFooter(dragonClank+\" BLACK / \"+p1.getClankInBag()+\" (\"+p1.getClankOnBoard()+\") RED / \"+p2.getClankInBag()+\" (\"+p2.getClankOnBoard()+\") BLUE / \"+p3.getClankInBag()+\" (\"+p3.getClankOnBoard()+\") YELLOW / \"+totalClank+\" TOTAL\", null);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tembed.setFooter(dragonClank+\" BLACK / \"+p1.getClankInBag()+\" (\"+p1.getClankOnBoard()+\") RED / \"+p2.getClankInBag()+\" (\"+p2.getClankOnBoard()+\") BLUE / \"+totalClank+\" TOTAL\", null);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tembed.setFooter(dragonClank+\" BLACK / \"+p1.getClankInBag()+\" (\"+p1.getClankOnBoard()+\") RED / \"+totalClank+\" TOTAL\", null);\r\n\t\t}\r\n\t\t// Dragon and Health indicator\r\n\t\tString healthIndicator = \"LEVEL **\"+attackLevel+\"** :dragon: |\";\r\n\t\tfor (int i = 0; i < players.size(); i++) {\r\n\t\t\tPlayer p = players.get(i);\r\n\t\t\tif (!p.hasQuit()) {\r\n\t\t\t\thealthIndicator += \" **\"+p.getHealth()+\"** \"+p.getHeartString();\r\n\t\t\t}\r\n\t\t}\r\n\t\tembed.setDescription(healthIndicator);\r\n\t\tembed.setImage(url);\r\n\t\tif (isFirstBoard) {\r\n\t\t\t// If first board, set delay so it appears in correct order\r\n\t\t\tgameChannel.sendMessage(embed.build()).queueAfter(1000, TimeUnit.MILLISECONDS);;\r\n\t\t\tisFirstBoard = false;\r\n\t\t} else {\r\n\t\t\tgameChannel.editMessageById(boardID, embed.build()).queue();\r\n\t\t}\r\n\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Updated board\");\r\n\t}", "public void updatePlayerPoints() {\n setText(Integer.toString(owner.getPlayerPoints()) + \" points\");\n }", "@Override\n\tpublic void updatePosition() {\n\t\t\n\t}", "public static void initialPosition(DrawingPanel panel) {\n int i = 0;\n int h = panel.getHeight();\n int w = panel.getWidth();\n\n while (i<numShapes){\n if (w < h) {\n xTopLeft[i] = panel.getWidth() / 2;\n yTopLeft[i] = panel.getWidth() / 2;\n }\n else if (h < w){\n xTopLeft[i] = panel.getHeight() / 2;\n yTopLeft[i] = panel.getHeight() / 2;\n }\n else{\n xTopLeft[i] = panel.getWidth() / 2;\n yTopLeft[i] = panel.getHeight() / 2;\n }\n ++i;\n }\n showShapes(panel, true);\n panel.sleep(100);//lets panel delay for 1/10th of a second\n }", "private void gameOver() {\n\t\t\n\t}", "private void adjustPlayerLifeLevel(int curPlayerRow, int curPlayerCol){\n gameBoard[curPlayerRow][curPlayerCol].updateLifePoints(PLAYER_POINTS_DEC);\n }", "private void updateGameDescriptorAfterUndo() {\n roundNumber = roundsHistory.peek().getRoundNumber();\n gameDescriptor.setTerritoryMap(roundsHistory.peek().getCopyOfMap()); //This Set the gameDescriptor Territories as copy\n gameDescriptor.setPlayersList(roundsHistory.peek().getCopyOfPlayersList()); //This Set the gameDescriptor players as copy\n updateTurnsObjectQueue();\n }", "public void checkwarp(){\n\t\tif(pacman.ypos > (colours[0].length*interval)-2){\r\n\t\t\tpacman.ypos = interval+2;\r\n\t\t}\r\n\t\telse if(pacman.xpos > (colours.length*interval)-2){\r\n\t\t\tpacman.xpos = interval+2;\r\n\t\t}\r\n\t\telse if(pacman.ypos < interval+2){\r\n\t\t\tpacman.ypos = (colours[0].length*interval)-2;\r\n\t\t}\r\n\t\telse if(pacman.xpos < interval+2){\r\n\t\t\tpacman.xpos = (colours.length*interval)-2;\r\n\t\t}\r\n\t\t\r\n\t}", "public void restart()\n {\n //resets values \n x = 0; // stores current row of black piece when moving right or right + down\n x3 = 7; // stores current row of black piece when moving right + down\n y = 0; // stores current column of black piece\n x2 = 0; // stores current row of white piece when moving left or left + down\n x4 = 7; // stores current row of white piece when moving left + down\n y2 = 7; // stores current column of black piece\n gameSet = false; // decides if a player has won the game or not\n whiteCount = 0; // counts how many white pieces were taken\n blackCount = 0; // counts how many black pieces were taken\n \n \n //determines which players start first\n turn = Math.random() < 0.5; \n \n //if turn == 0/false \n if(turn == false)\n {\n player.setText(\"<html><strong><font color='red'>Player 1 starts first!</font></strong></html>\");\n }\n \n //if turn == 1/true\n if(turn == true)\n {\n player.setText(\"<html><strong><font color='blue'>Player 2 starts first!</font></strong></html>\");\n }\n \n \n \n //sets icons for the left 16 buttons to the icon black\n for( int rows = 0; rows< gridUnits.length; rows++)\n {\n \n for(int cols = 0;cols <2; cols++)\n {\n gridUnits[rows][cols].setIcon(black);\n }\n }\n \n \n //sets icons for the right 16 buttons to the icon white\n for(int rows = 0; rows< gridUnits.length; rows++)\n {\n \n for(int cols = 6;cols <8; cols++)\n {\n gridUnits[rows][cols].setIcon(white);\n \n }\n \n }\n \n //sets icons for the middle 32 buttons to the icon blank\n for(int rows = 0; rows< gridUnits.length; rows++)\n {\n \n for(int cols = 2;cols <6; cols++)\n {\n gridUnits[rows][cols].setIcon(blank);\n \n }\n \n } \n \n //adds actionListeners to all of the 64 buttons\n for (int rows = 0; rows < gridUnits.length; rows++)\n {\n \n for(int cols = 0; cols < gridUnits.length; cols++)\n {\n gridUnits[rows][cols].addActionListener(this);\n \n }\n \n }\n \n }", "private JPanel setUpCurrentPlayerPanel(Player player) {\n if (currentPlayerDealPanel != null) {\n currentPlayerDealPanel.removeAll();\n } else {\n currentPlayerDealPanel = new JPanel();\n }\n currentPlayerDealPanel.setLayout(new BoxLayout(currentPlayerDealPanel,\n BoxLayout.Y_AXIS));\n currentPlayerDealPanel.add(setUpDealMakerPanel(player));\n return currentPlayerDealPanel;\n }", "public void printWrongGuess() {\r\n\t\t\r\n\t\tSystem.out.print(\"Wrong Guesses: \" + wrongGuess + \"\\n\");\r\n\t}", "@Test\n\tpublic void getNewPlayerLocation() {\n\t\tmap = new Map(10, 0, 0, 0);\n\t\tCavern cavernOne = new Cavern(0, 0);\n\t\tCavern cavernTwo = new Cavern(1, 0);\n\t\tCavern cavernThree = new Cavern(2, 0);\n\t\tCavern cavernFour = new Cavern(0, 1);\n\t\tcaverns.put(cavernOne, \"\");\n\t\tcaverns.put(cavernTwo, \"\");\n\t\tcaverns.put(cavernThree, \"\");\n\t\tcaverns.put(cavernFour, \"\");\n\t\tthis.bat = new Bat(this.player, caverns);\n\n\t\tplayer.setPlayerLocation(cavernOne);\n\n\t\tCavern newLocation = this.bat.getNewLocation();\n\t\tCavern playerLocation = this.bat.getOriginalLocation();\n\t\tassertNotNull(newLocation);\n\t\tassertTrue(playerLocation != newLocation);\n\t}" ]
[ "0.6315844", "0.6025111", "0.5927991", "0.5898194", "0.5877841", "0.5786709", "0.5739084", "0.5659607", "0.5653497", "0.5650951", "0.5621937", "0.5604267", "0.5596543", "0.5594496", "0.5585103", "0.5573544", "0.5547665", "0.5540384", "0.55386555", "0.5532601", "0.55222046", "0.5498634", "0.548439", "0.54826915", "0.548173", "0.54719186", "0.5467318", "0.5448548", "0.5446526", "0.5437942", "0.54278845", "0.539404", "0.53883654", "0.53834254", "0.53644496", "0.5355571", "0.5351152", "0.53453285", "0.5339962", "0.5332199", "0.5329819", "0.5321553", "0.53199804", "0.53171957", "0.53126246", "0.5307314", "0.5298864", "0.52817756", "0.52800053", "0.52766037", "0.5271527", "0.5267879", "0.5262497", "0.5261694", "0.5260229", "0.52551085", "0.5247868", "0.5242163", "0.52391833", "0.5238439", "0.5235394", "0.5233118", "0.52264136", "0.52260077", "0.52227753", "0.522228", "0.52150244", "0.52136254", "0.5211858", "0.5209104", "0.5208338", "0.52063847", "0.5202044", "0.51975214", "0.5195272", "0.51926255", "0.5187522", "0.51848686", "0.5184326", "0.5183069", "0.5178773", "0.5173831", "0.5165657", "0.5163776", "0.51601374", "0.5159561", "0.51586664", "0.5154629", "0.5149593", "0.51476544", "0.51462215", "0.513197", "0.5130623", "0.51230526", "0.51229316", "0.5122287", "0.51222605", "0.51219666", "0.5121243", "0.51124436", "0.5110422" ]
0.0
-1
calculates the range of the computer code based on flipped tiles
public ArrayList<Range> getCompRange() { ArrayList<Panel> known = new ArrayList<Panel>(); for(int i = 0; i<newGame.getCompHandLength(); i++) { if(newGame.getCompHand().getPanel(i).isFlipped()) { known.add(newGame.getCompHand().getPanel(i)); } } for(int i = 0; i<newGame.getUserHandLength(); i++) { if(newGame.getUserHand().getPanel(i).isFlipped()) { known.add(newGame.getUserHand().getPanel(i)); } } return(ranges(newGame.getCompHand(),known,false)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static long getPawnEastAttacks(long board, int side) {\n\t\tlong result;\n\t\tif (side == 0) {\n\t\t\tresult = ((board << 9) & ~CoreConstants.FILE_A);\n\n\t\t} else {\n\t\t\tresult = ((board >>> 7) & ~CoreConstants.FILE_A);\n\t\t}\n\t\treturn result;\n\t}", "int getMinimalPaletteDistance();", "public void getTile_B8();", "int range() {\n\t\treturn mpg * fuelcap;\n\t}", "private static int computeUnitsTrappedDynamicProgramming(int[] elevationMap) {\n int[] leftWalls = computeLeftWalls(elevationMap);\n int[] rightWalls = computeRightWalls(elevationMap);\n int units = 0;\n for (int x = 1; x < elevationMap.length; x++) {\n int current = elevationMap[x];\n int tallestLeft = leftWalls[x];\n int tallestRight = rightWalls[x];\n if (tallestLeft > current && tallestRight > current) {\n units += Math.min(tallestLeft, tallestRight) - current;\n }\n }\n return units;\n }", "private void calculateMaps() {\n\tsrcrows = new int[destHeight + 1];\n\tfor (int y = 0; y <= destHeight; y++) {\n\t srcrows[y] = (2 * y * srcHeight + srcHeight) / (2 * destHeight);\n\t}\n\tsrccols = new int[destWidth + 1];\n\tfor (int x = 0; x <= destWidth; x++) {\n\t srccols[x] = (2 * x * srcWidth + srcWidth) / (2 * destWidth);\n\t}\n\n float xscale = ( ( float ) srcWidth - 1 ) / ( ( float ) destWidth );\n float yscale = ( ( float ) srcHeight - 1 ) / ( ( float ) destHeight ) ;\n\n srcxlarr = new int[destWidth+1];\n srcxuarr = new int[destWidth+1];\n srcxarr = new int[destWidth+1];\n\n for (int x = 0 ; x <= destWidth;x++) {\n float tmp = x * xscale ;\n srcxlarr[x] = (int) Math.floor( tmp ) ;\n srcxuarr[x] = (int) Math.ceil( tmp ) ;\n srcxarr[x] = (int) ( ( tmp - srcxlarr[x] ) * 255f );\n }\n\n srcylarr = new int[destHeight+1];\n srcyuarr = new int[destHeight+1];\n srcyarr = new int[destHeight+1];\n\n for (int y = 0 ; y <= destHeight;y++) {\n float tmp = y * yscale ;\n srcylarr[y] = (int) Math.floor( tmp ) ;\n srcyuarr[y] = (int) Math.ceil( tmp ) ;\n srcyarr[y] = (int) ( ( tmp - srcylarr[y] ) * 255f );\n }\n\n /*\n System.out.println( \"srcrows\" );\n for (int i=0;i<srcrows.length;i++) {\n System.out.print( srcrows[i] + \" \" );\n }\n\n System.out.println( \"\\nsrccols\" );\n for (int i=0;i<srccols.length;i++) {\n System.out.print( srccols[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcxlarr\" );\n for (int i=0;i<srcxlarr.length;i++) {\n System.out.print( srcxlarr[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcxuarr\" );\n for (int i=0;i<srcxuarr.length;i++) {\n System.out.print( srcxuarr[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcylarr\" );\n for (int i=0;i<srcxlarr.length;i++) {\n System.out.print( srcylarr[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcyuarr\" );\n for (int i=0;i<srcxuarr.length;i++) {\n System.out.print( srcyuarr[i] + \" \" );\n }\n */\n }", "@Override // com.beloo.widget.chipslayoutmanager.p295d.AbstractLayouter\n /* renamed from: m */\n public void mo21685m() {\n int c = this.f10947d - mo21667c();\n this.f10948e = 0;\n for (Pair pair : this.f10944a) {\n Rect rect = (Rect) pair.first;\n rect.left -= c;\n rect.right -= c;\n this.f10948e = Math.max(rect.right, this.f10948e);\n this.f10946c = Math.min(this.f10946c, rect.top);\n this.f10945b = Math.max(this.f10945b, rect.bottom);\n }\n }", "public short fitsOnBeginning(Tile tile);", "ArrayList<Integer> getStepCounterTileY();", "private long opponent_winning_position() {\r\n return compute_winning_position(bitboard ^ mask, mask);\r\n }", "int getHeatCode(int x, int y);", "public void spriteClipping(int var1, int var2, int var3, int var4, int var5) {\n try {\n int var6 = this.field_736[var5];\n int var7 = this.field_737[var5];\n int var8 = 0;\n int var9 = 0;\n int var10 = (var6 << 16) / var3;\n int var11 = (var7 << 16) / var4;\n int var12;\n int var13;\n if(this.field_742[var5]) {\n var12 = this.spriteWidthFull[var5];\n var13 = this.field_741[var5];\n var10 = (var12 << 16) / var3;\n var11 = (var13 << 16) / var4;\n var1 += (this.field_738[var5] * var3 + var12 - 1) / var12;\n var2 += (this.field_739[var5] * var4 + var13 - 1) / var13;\n if(this.field_738[var5] * var3 % var12 != 0) {\n var8 = (var12 - this.field_738[var5] * var3 % var12 << 16) / var3;\n }\n\n if(this.field_739[var5] * var4 % var13 != 0) {\n var9 = (var13 - this.field_739[var5] * var4 % var13 << 16) / var4;\n }\n\n var3 = var3 * (this.field_736[var5] - (var8 >> 16)) / var12;\n var4 = var4 * (this.field_737[var5] - (var9 >> 16)) / var13;\n }\n\n var12 = var1 + var2 * this.field_723;\n var13 = this.field_723 - var3;\n int var14;\n if(var2 < this.field_743) {\n var14 = this.field_743 - var2;\n var4 -= var14;\n var2 = 0;\n var12 += var14 * this.field_723;\n var9 += var11 * var14;\n }\n\n if(var2 + var4 >= this.field_744) {\n var4 -= var2 + var4 - this.field_744 + 1;\n }\n\n if(var1 < this.field_745) {\n var14 = this.field_745 - var1;\n var3 -= var14;\n var1 = 0;\n var12 += var14;\n var8 += var10 * var14;\n var13 += var14;\n }\n\n if(var1 + var3 >= this.field_746) {\n var14 = var1 + var3 - this.field_746 + 1;\n var3 -= var14;\n var13 += var14;\n }\n\n byte var16 = 1;\n if(this.interlace) {\n var16 = 2;\n var13 += this.field_723;\n var11 += var11;\n if((var2 & 1) != 0) {\n var12 += this.field_723;\n --var4;\n }\n }\n\n this.method_249(this.pixels, this.spritePixels[var5], 0, var8, var9, var12, var13, var3, var4, var10, var11, var6, var16);\n } catch (Exception var15) {\n System.out.println(\"error in sprite clipping routine\"); // authentic System.out.println\n }\n }", "public static int[] buildBoxOutMap(int r15, int r16, int r17, int r18) {\n /*\n int r0 = r15 * r16\n int[] r1 = new int[r0]\n r2 = 0\n r3 = 0\n L_0x0006:\n r4 = 1\n if (r3 >= r0) goto L_0x000e\n r1[r3] = r4\n int r3 = r3 + 1\n goto L_0x0006\n L_0x000e:\n int r0 = r15 - r17\n int r0 = r0 / 2\n int r3 = r16 - r17\n int r3 = r3 / 2\n int r5 = r17 + -1\n r10 = r17\n r6 = r0\n r8 = r6\n r9 = r8\n r11 = r3\n r12 = r11\n r7 = r5\n r0 = r18\n r5 = r12\n r3 = 0\n L_0x0024:\n if (r3 >= r0) goto L_0x007e\n int r13 = r5 * r15\n int r13 = r13 + r6\n r14 = r1[r13]\n if (r14 != r4) goto L_0x002f\n r14 = 1\n goto L_0x0030\n L_0x002f:\n r14 = 0\n L_0x0030:\n if (r14 == 0) goto L_0x0034\n r1[r13] = r2\n L_0x0034:\n r13 = -1\n if (r7 != r13) goto L_0x0046\n if (r6 != r8) goto L_0x0046\n int r8 = r8 + -1\n int r6 = Max(r8, r2)\n int r7 = r17 * 2\n int r7 = r7 - r4\n r8 = r6\n L_0x0043:\n r10 = r7\n r7 = 0\n goto L_0x007c\n L_0x0046:\n if (r7 != r4) goto L_0x0058\n if (r6 != r9) goto L_0x0058\n int r9 = r9 + 1\n int r6 = r15 + -1\n int r6 = Min(r9, r6)\n int r7 = r17 * 2\n int r7 = 1 - r7\n r9 = r6\n goto L_0x0043\n L_0x0058:\n if (r10 != r13) goto L_0x0069\n if (r5 != r11) goto L_0x0069\n int r11 = r11 + -1\n int r5 = Max(r11, r2)\n int r7 = r17 * 2\n int r7 = 1 - r7\n r11 = r5\n L_0x0067:\n r10 = 0\n goto L_0x007c\n L_0x0069:\n if (r10 != r4) goto L_0x007a\n if (r5 != r12) goto L_0x007a\n int r12 = r12 + 1\n int r5 = r16 + -1\n int r5 = Min(r12, r5)\n int r7 = r17 * 2\n int r7 = r7 - r4\n r12 = r5\n goto L_0x0067\n L_0x007a:\n int r6 = r6 + r7\n int r5 = r5 + r10\n L_0x007c:\n int r3 = r3 + r14\n goto L_0x0024\n L_0x007e:\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.jcodec.codecs.h264.decode.aso.SliceGroupMapBuilder.buildBoxOutMap(int, int, boolean, int):int[]\");\n }", "public void method_246(int var1, int var2, int var3, int var4, int var5, int var6) {\n try {\n int var7 = this.field_736[var5];\n int var8 = this.field_737[var5];\n int var9 = 0;\n int var10 = 0;\n int var11 = (var7 << 16) / var3;\n int var12 = (var8 << 16) / var4;\n int var13;\n int var14;\n if(this.field_742[var5]) {\n var13 = this.spriteWidthFull[var5];\n var14 = this.field_741[var5];\n var11 = (var13 << 16) / var3;\n var12 = (var14 << 16) / var4;\n var1 += (this.field_738[var5] * var3 + var13 - 1) / var13;\n var2 += (this.field_739[var5] * var4 + var14 - 1) / var14;\n if(this.field_738[var5] * var3 % var13 != 0) {\n var9 = (var13 - this.field_738[var5] * var3 % var13 << 16) / var3;\n }\n\n if(this.field_739[var5] * var4 % var14 != 0) {\n var10 = (var14 - this.field_739[var5] * var4 % var14 << 16) / var4;\n }\n\n var3 = var3 * (this.field_736[var5] - (var9 >> 16)) / var13;\n var4 = var4 * (this.field_737[var5] - (var10 >> 16)) / var14;\n }\n\n var13 = var1 + var2 * this.field_723;\n var14 = this.field_723 - var3;\n int var15;\n if(var2 < this.field_743) {\n var15 = this.field_743 - var2;\n var4 -= var15;\n var2 = 0;\n var13 += var15 * this.field_723;\n var10 += var12 * var15;\n }\n\n if(var2 + var4 >= this.field_744) {\n var4 -= var2 + var4 - this.field_744 + 1;\n }\n\n if(var1 < this.field_745) {\n var15 = this.field_745 - var1;\n var3 -= var15;\n var1 = 0;\n var13 += var15;\n var9 += var11 * var15;\n var14 += var15;\n }\n\n if(var1 + var3 >= this.field_746) {\n var15 = var1 + var3 - this.field_746 + 1;\n var3 -= var15;\n var14 += var15;\n }\n\n byte var17 = 1;\n if(this.interlace) {\n var17 = 2;\n var14 += this.field_723;\n var12 += var12;\n if((var2 & 1) != 0) {\n var13 += this.field_723;\n --var4;\n }\n }\n\n this.method_253(this.pixels, this.spritePixels[var5], 0, var9, var10, var13, var14, var3, var4, var11, var12, var7, var17, var6);\n } catch (Exception var16) {\n System.out.println(\"error in sprite clipping routine\"); // authentic System.out.println\n }\n }", "public void method_245(int var1, int var2, int var3, int var4, int var5, int var6) {\n try {\n int var7 = this.field_736[var5];\n int var8 = this.field_737[var5];\n int var9 = 0;\n int var10 = 0;\n int var11 = (var7 << 16) / var3;\n int var12 = (var8 << 16) / var4;\n int var13;\n int var14;\n if(this.field_742[var5]) {\n var13 = this.spriteWidthFull[var5];\n var14 = this.field_741[var5];\n var11 = (var13 << 16) / var3;\n var12 = (var14 << 16) / var4;\n var1 += (this.field_738[var5] * var3 + var13 - 1) / var13;\n var2 += (this.field_739[var5] * var4 + var14 - 1) / var14;\n if(this.field_738[var5] * var3 % var13 != 0) {\n var9 = (var13 - this.field_738[var5] * var3 % var13 << 16) / var3;\n }\n\n if(this.field_739[var5] * var4 % var14 != 0) {\n var10 = (var14 - this.field_739[var5] * var4 % var14 << 16) / var4;\n }\n\n var3 = var3 * (this.field_736[var5] - (var9 >> 16)) / var13;\n var4 = var4 * (this.field_737[var5] - (var10 >> 16)) / var14;\n }\n\n var13 = var1 + var2 * this.field_723;\n var14 = this.field_723 - var3;\n int var15;\n if(var2 < this.field_743) {\n var15 = this.field_743 - var2;\n var4 -= var15;\n var2 = 0;\n var13 += var15 * this.field_723;\n var10 += var12 * var15;\n }\n\n if(var2 + var4 >= this.field_744) {\n var4 -= var2 + var4 - this.field_744 + 1;\n }\n\n if(var1 < this.field_745) {\n var15 = this.field_745 - var1;\n var3 -= var15;\n var1 = 0;\n var13 += var15;\n var9 += var11 * var15;\n var14 += var15;\n }\n\n if(var1 + var3 >= this.field_746) {\n var15 = var1 + var3 - this.field_746 + 1;\n var3 -= var15;\n var14 += var15;\n }\n\n byte var17 = 1;\n if(this.interlace) {\n var17 = 2;\n var14 += this.field_723;\n var12 += var12;\n if((var2 & 1) != 0) {\n var13 += this.field_723;\n --var4;\n }\n }\n\n this.method_252(this.pixels, this.spritePixels[var5], 0, var9, var10, var13, var14, var3, var4, var11, var12, var7, var17, var6);\n } catch (Exception var16) {\n System.out.println(\"error in sprite clipping routine\"); // authentic System.out.println\n }\n }", "public boolean tileReachable(float tx, float ty, AgentModel selectedAgent)\r\n/* 243: */ {\r\n/* 244:271 */ float x = selectedAgent.getX() - 0.5F;\r\n/* 245:272 */ float y = selectedAgent.getY() - 0.5F;\r\n/* 246:274 */ switch ((int)selectedAgent.getAngle())\r\n/* 247: */ {\r\n/* 248: */ case 0: \r\n/* 249:277 */ if ((y - 1.0F == ty) && (tx >= x - 1.0F) && (tx <= x + 1.0F)) {\r\n/* 250:279 */ return true;\r\n/* 251: */ }\r\n/* 252: */ break;\r\n/* 253: */ case 90: \r\n/* 254:283 */ if ((x + 1.0F == tx) && (ty >= y - 1.0F) && (ty <= y + 1.0F)) {\r\n/* 255:285 */ return true;\r\n/* 256: */ }\r\n/* 257: */ break;\r\n/* 258: */ case 180: \r\n/* 259:289 */ if ((y + 1.0F == ty) && (tx >= x - 1.0F) && (tx <= x + 1.0F)) {\r\n/* 260:291 */ return true;\r\n/* 261: */ }\r\n/* 262: */ break;\r\n/* 263: */ case 270: \r\n/* 264:295 */ if ((x - 1.0F == tx) && (ty >= y - 1.0F) && (ty <= y + 1.0F)) {\r\n/* 265:298 */ return true;\r\n/* 266: */ }\r\n/* 267: */ break;\r\n/* 268: */ }\r\n/* 269:303 */ return false;\r\n/* 270: */ }", "private void c() {\n/* 258 */ int tIdx = getTileIdx();\n/* */ \n/* 260 */ if (this.e.getNumComps() < 3) {\n/* 261 */ throw new IllegalArgumentException();\n/* */ }\n/* */ \n/* 264 */ if (this.e.getTileCompWidth(tIdx, 0) != this.e.getTileCompWidth(tIdx, 1) || this.e\n/* 265 */ .getTileCompWidth(tIdx, 0) != this.e.getTileCompWidth(tIdx, 2) || this.e\n/* 266 */ .getTileCompHeight(tIdx, 0) != this.e.getTileCompHeight(tIdx, 1) || this.e\n/* 267 */ .getTileCompHeight(tIdx, 0) != this.e.getTileCompHeight(tIdx, 2)) {\n/* 268 */ throw new IllegalArgumentException(\"Can not use RCT on components with different dimensions\");\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 274 */ int[] utd = new int[this.e.getNumComps()];\n/* 275 */ for (int i = utd.length - 1; i >= 0; i--) {\n/* 276 */ utd[i] = this.e.getNomRangeBits(i);\n/* */ }\n/* 278 */ this.i = a(utd, 1, (int[])null);\n/* */ }", "long getCollideBits();", "private static long getPawnWestAttacks(long board, int side) {\n\t\tlong result;\n\t\tif (side == 0) {\n\t\t\tresult = ((board << 7) & ~CoreConstants.FILE_H);\n\t\t} else {\n\t\t\tresult = ((board >>> 9) & ~CoreConstants.FILE_H);\n\t\t}\n\t\treturn result;\n\t}", "int range(){\n return fuelcap*mpg;\n }", "public void method_258(int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, boolean var9) {\n try {\n if(var6 == 0) {\n var6 = 16777215;\n }\n\n if(var7 == 0) {\n var7 = 16777215;\n }\n\n int var10 = this.field_736[var5];\n int var11 = this.field_737[var5];\n int var12 = 0;\n int var13 = 0;\n int var14 = var8 << 16;\n int var15 = (var10 << 16) / var3;\n int var16 = (var11 << 16) / var4;\n int var17 = -(var8 << 16) / var4;\n int var18;\n int var19;\n if(this.field_742[var5]) {\n var18 = this.spriteWidthFull[var5];\n var19 = this.field_741[var5];\n var15 = (var18 << 16) / var3;\n var16 = (var19 << 16) / var4;\n int var20 = this.field_738[var5];\n int var21 = this.field_739[var5];\n if(var9) {\n var20 = var18 - this.field_736[var5] - var20;\n }\n\n var1 += (var20 * var3 + var18 - 1) / var18;\n int var22 = (var21 * var4 + var19 - 1) / var19;\n var2 += var22;\n var14 += var22 * var17;\n if(var20 * var3 % var18 != 0) {\n var12 = (var18 - var20 * var3 % var18 << 16) / var3;\n }\n\n if(var21 * var4 % var19 != 0) {\n var13 = (var19 - var21 * var4 % var19 << 16) / var4;\n }\n\n var3 = ((this.field_736[var5] << 16) - var12 + var15 - 1) / var15;\n var4 = ((this.field_737[var5] << 16) - var13 + var16 - 1) / var16;\n }\n\n var18 = var2 * this.field_723;\n var14 += var1 << 16;\n if(var2 < this.field_743) {\n var19 = this.field_743 - var2;\n var4 -= var19;\n var2 = this.field_743;\n var18 += var19 * this.field_723;\n var13 += var16 * var19;\n var14 += var17 * var19;\n }\n\n if(var2 + var4 >= this.field_744) {\n var4 -= var2 + var4 - this.field_744 + 1;\n }\n\n var19 = var18 / this.field_723 & 1;\n if(!this.interlace) {\n var19 = 2;\n }\n\n if(var7 == 16777215) {\n if(this.spritePixels[var5] != null) {\n if(!var9) {\n this.method_259(this.pixels, this.spritePixels[var5], 0, var12, var13, var18, var3, var4, var15, var16, var10, var6, var14, var17, var19);\n } else {\n this.method_259(this.pixels, this.spritePixels[var5], 0, (this.field_736[var5] << 16) - var12 - 1, var13, var18, var3, var4, -var15, var16, var10, var6, var14, var17, var19);\n }\n } else if(!var9) {\n this.method_261(this.pixels, this.spriteColoursUsed[var5], this.spriteColourList[var5], 0, var12, var13, var18, var3, var4, var15, var16, var10, var6, var14, var17, var19);\n } else {\n this.method_261(this.pixels, this.spriteColoursUsed[var5], this.spriteColourList[var5], 0, (this.field_736[var5] << 16) - var12 - 1, var13, var18, var3, var4, -var15, var16, var10, var6, var14, var17, var19);\n }\n } else if(this.spritePixels[var5] != null) {\n if(!var9) {\n this.method_260(this.pixels, this.spritePixels[var5], 0, var12, var13, var18, var3, var4, var15, var16, var10, var6, var7, var14, var17, var19);\n } else {\n this.method_260(this.pixels, this.spritePixels[var5], 0, (this.field_736[var5] << 16) - var12 - 1, var13, var18, var3, var4, -var15, var16, var10, var6, var7, var14, var17, var19);\n }\n } else if(!var9) {\n this.method_262(this.pixels, this.spriteColoursUsed[var5], this.spriteColourList[var5], 0, var12, var13, var18, var3, var4, var15, var16, var10, var6, var7, var14, var17, var19);\n } else {\n this.method_262(this.pixels, this.spriteColoursUsed[var5], this.spriteColourList[var5], 0, (this.field_736[var5] << 16) - var12 - 1, var13, var18, var3, var4, -var15, var16, var10, var6, var7, var14, var17, var19);\n }\n } catch (Exception var23) {\n System.out.println(\"error in sprite clipping routine\"); // authentic System.out.println\n }\n }", "int getAttackRange();", "private void ncpStep(double height) {\n/* 56 */ double posX = mc.field_71439_g.field_70165_t;\n/* 57 */ double posZ = mc.field_71439_g.field_70161_v;\n/* 58 */ double y = mc.field_71439_g.field_70163_u;\n/* 59 */ if (height >= 1.1D) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 80 */ if (height < 1.6D) {\n/* */ double[] offset;\n/* 82 */ for (double off : offset = new double[] { 0.42D, 0.33D, 0.24D, 0.083D, -0.078D }) {\n/* 83 */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y += off, posZ, false));\n/* */ }\n/* 85 */ } else if (height < 2.1D) {\n/* */ double[] heights;\n/* 87 */ for (double off : heights = new double[] { 0.425D, 0.821D, 0.699D, 0.599D, 1.022D, 1.372D, 1.652D, 1.869D }) {\n/* 88 */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y + off, posZ, false));\n/* */ }\n/* */ } else {\n/* */ double[] heights;\n/* 92 */ for (double off : heights = new double[] { 0.425D, 0.821D, 0.699D, 0.599D, 1.022D, 1.372D, 1.652D, 1.869D, 2.019D, 1.907D })\n/* 93 */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y + off, posZ, false)); \n/* */ } \n/* */ return;\n/* */ } \n/* */ double first = 0.42D;\n/* */ double d1 = 0.75D;\n/* */ if (height != 1.0D) {\n/* */ first *= height;\n/* */ d1 *= height;\n/* */ if (first > 0.425D)\n/* */ first = 0.425D; \n/* */ if (d1 > 0.78D)\n/* */ d1 = 0.78D; \n/* */ if (d1 < 0.49D)\n/* */ d1 = 0.49D; \n/* */ } \n/* */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y + first, posZ, false));\n/* */ if (y + d1 < y + height)\n/* */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y + d1, posZ, false)); \n/* */ }", "private void positionMinimap(){\n\t\tif(debutX<0)//si mon debutX est negatif(ca veut dire que je suis sorti de mon terrain (ter))\n\t\t\tdebutX=0;\n\t\tif(debutX>ter.length)//si debutX est plus grand que la taille de mon terrain(ter).\n\t\t\tdebutX=ter.length-100;\n\t\tif(debutY<0)\n\t\t\tdebutY=0;\n\t\tif(debutY>ter.length)\n\t\t\tdebutY=ter.length-100;\n\t\tif(debutX+100>ter.length)\n\t\t\tdebutX=ter.length-100;\n\t\tif(debutY+100>ter.length)\n\t\t\tdebutY=ter.length-100;\n\t\t//cette fonction est appelee uniquement si le terrain est strictement Superieur a 100\n\t\t// Donc je sais que ma fin se situe 100 cases apres.\n\t\tfinX=debutX+100;\n\t\tfinY=debutY+100;\n\t}", "public static int offset_cost() {\n return (56 / 8);\n }", "void calculateRange() {\n //TODO: See Rules\n }", "public void drawWorld(int var1) {\n boolean var24 = field_759;\n int var2 = this.field_736[var1] * this.field_737[var1];\n int[] var3 = this.spritePixels[var1];\n int[] var4 = new int['\\u8000'];\n int var5 = 0;\n int var6;\n if(var24) {\n var6 = var3[var5];\n ++var4[((var6 & 16252928) >> 9) + ((var6 & '\\uf800') >> 6) + ((var6 & 248) >> 3)];\n ++var5;\n }\n\n while(var5 < var2) {\n var6 = var3[var5];\n ++var4[((var6 & 16252928) >> 9) + ((var6 & '\\uf800') >> 6) + ((var6 & 248) >> 3)];\n ++var5;\n }\n\n int[] var25 = new int[256];\n var25[0] = 16711935;\n int[] var7 = new int[256];\n int var8 = 0;\n int var10;\n int var11;\n if(var24 || var8 < '\\u8000') {\n do {\n int var9 = var4[var8];\n if(var9 > var7[255]) {\n var10 = 1;\n if(var24 || var10 < 256) {\n do {\n if(var9 > var7[var10]) {\n var11 = 255;\n if(var24 || var11 > var10) {\n do {\n var25[var11] = var25[var11 - 1];\n var7[var11] = var7[var11 - 1];\n --var11;\n } while(var11 > var10);\n }\n\n var25[var10] = ((var8 & 31744) << 9) + ((var8 & 992) << 6) + ((var8 & 31) << 3) + 263172;\n var7[var10] = var9;\n if(!var24) {\n break;\n }\n }\n\n ++var10;\n } while(var10 < 256);\n }\n }\n\n var4[var8] = -1;\n ++var8;\n } while(var8 < '\\u8000');\n }\n\n byte[] var26 = new byte[var2];\n var10 = 0;\n if(!var24 && var10 >= var2) {\n this.spriteColoursUsed[var1] = var26;\n this.spriteColourList[var1] = var25;\n this.spritePixels[var1] = null;\n } else {\n do {\n var11 = var3[var10];\n int var12 = ((var11 & 16252928) >> 9) + ((var11 & '\\uf800') >> 6) + ((var11 & 248) >> 3);\n int var13 = var4[var12];\n if(var13 == -1) {\n int var14 = 999999999;\n int var15 = var11 >> 16 & 255;\n int var16 = var11 >> 8 & 255;\n int var17 = var11 & 255;\n int var18 = 0;\n if(var24 || var18 < 256) {\n do {\n int var19 = var25[var18];\n int var20 = var19 >> 16 & 255;\n int var21 = var19 >> 8 & 255;\n int var22 = var19 & 255;\n int var23 = (var15 - var20) * (var15 - var20) + (var16 - var21) * (var16 - var21) + (var17 - var22) * (var17 - var22);\n if(var23 < var14) {\n var14 = var23;\n var13 = var18;\n }\n\n ++var18;\n } while(var18 < 256);\n }\n\n var4[var12] = var13;\n }\n\n var26[var10] = (byte)var13;\n ++var10;\n } while(var10 < var2);\n\n this.spriteColoursUsed[var1] = var26;\n this.spriteColourList[var1] = var25;\n this.spritePixels[var1] = null;\n }\n }", "static long gridlandMetro(long n, int m, int k, int[][] track) {\n Map<Integer, Stack<int[]>> map = new HashMap<>();\n for (int i = 0; i < k; i++) {\n int r = track[i][0];\n int c1 = track[i][1];\n int c2 = track[i][2];\n Stack<int[]> stack = map.get(r);\n if (stack == null) {\n stack = new Stack<>();\n stack.push(new int[] { c1, c2 });\n map.put(r, stack);\n } else {\n int[] c = stack.peek();\n if (c[1] >= c1)\n c[1] = Math.max(c[1], c2);\n else\n stack.push(new int[] { c1, c2 });\n }\n }\n return (long) n * m - map.values().stream().flatMap(Collection::stream).mapToLong(c -> c[1] - c[0] + 1).sum();\n}", "int pacemodulator() {\n int buckpacedirector = ((rand.nextInt() >> rightshift) & 7);\n int rbuckpacedirector = 0;\n\n rbuckpacedirector = switch (buckpacedirector)\n {\n case 0 -> 2;\n case 1 -> 3;\n case 2 -> 4;\n case 3 -> 5;\n case 4 -> 6;\n case 5 -> 7;\n case 6 -> 8;\n default -> 1;\n };\n return rbuckpacedirector;\n }", "ArrayList<Integer> getStepCounterTileX();", "int compFunction(int code) {\r\n int value = code % tableSize;\r\n if (value < 0) {\r\n return value + tableSize;\r\n }\r\n return value;\r\n }", "private int m3423z(int i, int i2) {\n int i3;\n int i4;\n for (int size = this.f4373c.size() - 1; size >= 0; size--) {\n C0933b bVar = this.f4373c.get(size);\n int i5 = bVar.f4379a;\n if (i5 == 8) {\n int i6 = bVar.f4380b;\n int i7 = bVar.f4382d;\n if (i6 < i7) {\n i4 = i6;\n i3 = i7;\n } else {\n i3 = i6;\n i4 = i7;\n }\n if (i < i4 || i > i3) {\n if (i < i6) {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n bVar.f4382d = i7 - 1;\n }\n }\n } else if (i4 == i6) {\n if (i2 == 1) {\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4382d = i7 - 1;\n }\n i++;\n } else {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n }\n i--;\n }\n } else {\n int i8 = bVar.f4380b;\n if (i8 <= i) {\n if (i5 == 1) {\n i -= bVar.f4382d;\n } else if (i5 == 2) {\n i += bVar.f4382d;\n }\n } else if (i2 == 1) {\n bVar.f4380b = i8 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i8 - 1;\n }\n }\n }\n for (int size2 = this.f4373c.size() - 1; size2 >= 0; size2--) {\n C0933b bVar2 = this.f4373c.get(size2);\n if (bVar2.f4379a == 8) {\n int i9 = bVar2.f4382d;\n if (i9 == bVar2.f4380b || i9 < 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n } else if (bVar2.f4382d <= 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n }\n return i;\n }", "private static int computeUnitsTrapped(int[] elevationMap) {\n int units = 0;\n for (int x = 0; x < elevationMap.length; x++) {\n int current = elevationMap[x];\n int tallestLeft = -1;\n int left = x - 1;\n while (left >= 0) {\n tallestLeft = Math.max(elevationMap[left], tallestLeft);\n left--;\n }\n\n int tallestRight = -1;\n int right = x + 1;\n while (right < elevationMap.length) {\n tallestRight = Math.max(elevationMap[right], tallestRight);\n right++;\n }\n\n if (tallestLeft > current && tallestRight > current) {\n units += Math.min(tallestLeft, tallestRight) - current;\n }\n }\n\n return units;\n }", "public int eval()\n\t\t{\n\t\t\tif (p[BLACK]==0) return MAX+1;\t//black=0 then white win then return max\n\t\t\tif (p[WHITE]==0) return MIN-1;\t//white=0 then black win then return min\n\t\t\tint bl=getNumberOne(p[0]);int wh=getNumberOne(p[1]);\n\t\t\treturn wh-bl;\n\t\t}", "private String land() {\r\n\t\tint[] temp=tile.getLand();\r\n\t\tString out=\"Tile Land: \\n\\n\";\r\n\t\tint square=(int)Math.sqrt(temp.length);\r\n\t\tif(square*square<temp.length) {\r\n\t\t\tsquare++;\r\n\t\t}\r\n\t\tfor(int i=0; i<temp.length;) {\r\n\t\t\tfor(int j=0; j<square; j++) {\r\n\t\t\t\tif(i<temp.length) {\r\n\t\t\t\t\tout=out.concat(String.format(\"%4s\", temp[i]));\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tj=square;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tout=out.concat(\"\\n\");\r\n\t\t}\r\n\t\treturn out;\r\n\t}", "@Override\r\n public void getRange(ArrayList<Piece> pieces){\r\n this.range.clear();\r\n int pieceX = this.getX(); int pieceY = this.getY(); // X and Y coordinates for the king piece\r\n\r\n // getPiece: 0 = empty; 1 = same color; 2 = opposite color\r\n //Up\r\n if (this.getPiece(pieceX, pieceY+1, pieces) == 0 || this.getPiece(pieceX, pieceY+1, pieces) == 2)\r\n this.range.add(new int[] {pieceX, pieceY+1}); // Return int[] of tested coordinates\r\n\r\n //Up-right\r\n if (this.getPiece(pieceX+1, pieceY+1, pieces) == 0 || this.getPiece(pieceX+1, pieceY+1, pieces) == 2)\r\n this.range.add(new int[] {pieceX+1, pieceY+1}); // Return int[] of tested coordinates\r\n\r\n //Right\r\n if (this.getPiece(pieceX+1, pieceY, pieces) == 0 || this.getPiece(pieceX+1, pieceY, pieces) == 2)\r\n this.range.add(new int[] {pieceX+1, pieceY}); // Return int[] of tested coordinates\r\n\r\n //Down-right\r\n if (this.getPiece(pieceX+1, pieceY-1, pieces) == 0 || this.getPiece(pieceX+1, pieceY-1, pieces) == 2)\r\n this.range.add(new int[] {pieceX+1, pieceY-1}); // Return int[] of tested coordinates\r\n\r\n //Down\r\n if (this.getPiece(pieceX, pieceY-1, pieces) == 0 || this.getPiece(pieceX, pieceY-1, pieces) == 2)\r\n this.range.add(new int[] {pieceX, pieceY-1}); // Return int[] of tested coordinates\r\n\r\n //Down-left\r\n if (this.getPiece(pieceX-1, pieceY-1, pieces) == 0 || this.getPiece(pieceX-1, pieceY-1, pieces) == 2)\r\n this.range.add(new int[] {pieceX-1, pieceY-1}); // Return int[] of tested coordinates\r\n\r\n //Left\r\n if (this.getPiece(pieceX-1, pieceY, pieces) == 0 || this.getPiece(pieceX-1, pieceY, pieces) == 2)\r\n this.range.add(new int[] {pieceX-1, pieceY}); // Return int[] of tested coordinates\r\n\r\n //Up-left\r\n if (this.getPiece(pieceX-1, pieceY+1, pieces) == 0 || this.getPiece(pieceX-1, pieceY+1, pieces) == 2)\r\n this.range.add(new int[] {pieceX-1, pieceY+1}); // Return int[] of tested coordinates\r\n\r\n //Castling\r\n for (Piece piece : pieces) {\r\n if (piece instanceof Rook) {\r\n if (piece.getColor() == this.getColor()) {\r\n if (validCastling(pieces, (Rook)piece)) {\r\n int targetX = (piece.getX() < getX()) ? (this.getX() - 2) : (this.getX() + 2);\r\n this.range.add(new int[] {targetX, this.getY()});\r\n }\r\n }\r\n }\r\n }\r\n }", "private int threeInNeg(final GameStateModule game, int player) {\n int count = 0;\n if(game.getHeight() == 4){ //if height is 4, no iterations needed\n //counting bottom up\n for(int i = 0; i < 2; i++) { //since rows is always of width 5\n for(int j = 3; j > 2; j--) {\n if ((game.getAt(i, j) == player) && (game.getAt(i + 1, j - 1) == player) && (game.getAt(i + 2, j - 2) == player) && (game.getAt(i+3,j-3) == 0))\n count++;\n }\n }\n //counting top bottom\n for(int i = 4; i > 2; i--) {\n for(int j = 0; j < 1; j++) {\n if ((game.getAt(i, j) == player) && (game.getAt(i - 1, j + 1) == player) && (game.getAt(i - 2, j + 2) == player) && (game.getAt(i-3, j+3) == 0))\n count++;\n }\n }\n }\n else { //if height is 5, iterations needed\n for(int i = 0; i < 3; i++) {\n for (int j = 4; j > 1; j--) {\n if ((game.getAt(i, j) == player) && (game.getAt(i + 1, j - 1) == player) && (game.getAt(i + 2, j - 2) == player) && (game.getAt(i+3,j-3) == 0))\n count++;\n }\n }\n for(int i = 5; i > 2; i--) {\n for (int j = 0; j < 2; j++) {\n if ((game.getAt(i, j) == player) && (game.getAt(i - 1, j + 1) == player) && (game.getAt(i - 2, j + 2) == player) && (game.getAt(i-3, j+3) == 0))\n count++;\n }\n }\n }\n return count;\n }", "public int getCoverMask()\r\n/* 192: */ {\r\n/* 193:150 */ return this.CoverSides;\r\n/* 194: */ }", "int regionSplitBits4DownSampledTable();", "private void getTileNumber() {\r\n int xtile = (int) Math.floor((coordinates.getLon() + 180) / 360 * (1 << zoom));\r\n int ytile = (int) Math.floor((1 - Math.log(Math.tan(Math.toRadians(coordinates.getLat())) + 1 / Math.cos(Math.toRadians(coordinates.getLat()))) / Math.PI) / 2 * (1 << zoom));\r\n\r\n if (xtile < 0) xtile = 0;\r\n\r\n if (xtile >= (1 << zoom)) xtile = ((1 << zoom) - 1);\r\n\r\n if (ytile < 0) ytile = 0;\r\n\r\n if (ytile >= (1 << zoom)) ytile = ((1 << zoom) - 1);\r\n\r\n this.xtile = xtile;\r\n this.ytile = ytile;\r\n }", "int getMoistureCode(int x, int y);", "private int getBinI(Location l)\r\n {\r\n return (int)((l.getX()-bl.getX())/di);\r\n }", "private int colToY(int c) { \n\t\treturn c * getWidth() / BOARD_LENGTH - (BOARD_PIECE_LENGTH);\n\t}", "public void revisaColisionMapa() {\n\t\tactualCol = (int)x / tamTile;\n\t\tactualRen = (int)y / tamTile;\n\t\t\n\t\txdest = x + dx;\n\t\tydest = y + dy;\n\t\t\n\t\txtemp = x;\n\t\tytemp = y;\n\t\t\n\t\tcalcularEsquinas(x, ydest);\n\t\tif(dy < 0) {\n\t\t\tif(arribaIzq || arribaDer) {\n\t\t\t\tdy = 0;\n\t\t\t\tytemp = actualRen * tamTile + claltura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\t\tif(dy > 0) {\n\t\t\tif(abajoIzq || abajoDer) {\n\t\t\t\tdy = 0;\n\t\t\t\tcayendo = false;\n\t\t\t\tytemp = (actualRen + 1) * tamTile - claltura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\t\t\n\t\tcalcularEsquinas(xdest, y);\n\t\tif(dx < 0) {\n\t\t\tif(arribaIzq || abajoIzq) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = actualCol * tamTile + clanchura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\tif(dx > 0) {\n\t\t\tif(arribaDer || abajoDer) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = (actualCol + 1) * tamTile - clanchura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!cayendo) {\n\t\t\tcalcularEsquinas(x, ydest + 1);\n\t\t\tif(!abajoIzq && !abajoDer) {\n\t\t\t\tcayendo = true;\n\t\t\t}\n\t\t}\n\t}", "public int getPartsMask()\r\n/* 62: */ {\r\n/* 63: 52 */ return this.CoverSides | 0x20000000;\r\n/* 64: */ }", "private void method_259(int[] var1, int[] var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, int var13, int var14, int var15) {\n boolean var28 = field_759;\n int var19 = var12 >> 16 & 255;\n int var20 = var12 >> 8 & 255;\n int var21 = var12 & 255;\n\n try {\n int var22 = var4;\n int var23 = -var8;\n if(var28 || var23 < 0) {\n do {\n int var24 = (var5 >> 16) * var11;\n int var25 = var13 >> 16;\n int var26 = var7;\n int var27;\n if(var25 < this.field_745) {\n var27 = this.field_745 - var25;\n var26 = var7 - var27;\n var25 = this.field_745;\n var4 += var9 * var27;\n }\n\n if(var25 + var26 >= this.field_746) {\n var27 = var25 + var26 - this.field_746;\n var26 -= var27;\n }\n\n var15 = 1 - var15;\n if(var15 != 0) {\n var27 = var25;\n if(var28 || var25 < var25 + var26) {\n do {\n var3 = var2[(var4 >> 16) + var24];\n if(var3 != 0) {\n label33: {\n int var16 = var3 >> 16 & 255;\n int var17 = var3 >> 8 & 255;\n int var18 = var3 & 255;\n if(var16 == var17 && var17 == var18) {\n var1[var27 + var6] = (var16 * var19 >> 8 << 16) + (var17 * var20 >> 8 << 8) + (var18 * var21 >> 8);\n if(!var28) {\n break label33;\n }\n }\n\n var1[var27 + var6] = var3;\n }\n }\n\n var4 += var9;\n ++var27;\n } while(var27 < var25 + var26);\n }\n }\n\n var5 += var10;\n var4 = var22;\n var6 += this.field_723;\n var13 += var14;\n ++var23;\n } while(var23 < 0);\n\n }\n } catch (Exception var29) {\n System.out.println(\"error in transparent sprite plot routine\"); // authentic System.out.println\n }\n }", "@Test\n\tpublic void lowerLeft2SWCSpecial()\n\t{\n\t\tData d = new Data();\n\t\td.set(5, 112);\n\t\td.set(1, 113);\n\t\td.set(13, 101);\n\t\td.set(14, 102);\n\t\tArrayList<Coordinate> test_arr = d.shieldWallCapture(114);\n\t\tassertTrue(2==test_arr.get(0).getX() && 10==test_arr.get(0).getY()\n\t\t\t&& 1==test_arr.get(1).getX() && 10==test_arr.get(1).getY());\n\t}", "private void d() {\n/* 287 */ int tIdx = getTileIdx();\n/* */ \n/* 289 */ if (this.e.getNumComps() < 3) {\n/* 290 */ throw new IllegalArgumentException();\n/* */ }\n/* */ \n/* 293 */ if (this.e.getTileCompWidth(tIdx, 0) != this.e.getTileCompWidth(tIdx, 1) || this.e\n/* 294 */ .getTileCompWidth(tIdx, 0) != this.e.getTileCompWidth(tIdx, 2) || this.e\n/* 295 */ .getTileCompHeight(tIdx, 0) != this.e.getTileCompHeight(tIdx, 1) || this.e\n/* 296 */ .getTileCompHeight(tIdx, 0) != this.e.getTileCompHeight(tIdx, 2)) {\n/* 297 */ throw new IllegalArgumentException(\"Can not use ICT on components with different dimensions\");\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 303 */ int[] utd = new int[this.e.getNumComps()];\n/* 304 */ for (int i = utd.length - 1; i >= 0; i--) {\n/* 305 */ utd[i] = this.e.getNomRangeBits(i);\n/* */ }\n/* 307 */ this.i = a(utd, 2, (int[])null);\n/* */ }", "private static int evalState(GameState state){\n Move m = state.getMove();\n int counter = 0;\n\n // return directly if we encouter win or loss\n if(m.isXWin()){\n return 10000;\n }\n else if(m.isOWin()){\n return -1;\n }\n\n Vector<Integer> points = new Vector<Integer>();\n points.setSize(state.BOARD_SIZE*2+2);\n int player;\n Collections.fill(points, 1);\n int scaling = 4;\n int value = 0;\n\n for(int row = 0; row < state.BOARD_SIZE; row ++){\n for(int col = 0; col < state.BOARD_SIZE; col ++){\n player = state.at(row, col);\n\n // add points to the vector, increase by a factor for every new entry\n if(player == 1){\n points.set(row, points.get(row)*scaling);\n points.add(state.BOARD_SIZE + col, points.get(state.BOARD_SIZE - 1 + col)*scaling);\n\n // if it's in the first diagonal\n if(counter%state.BOARD_SIZE+1 == 0){\n points.add(state.BOARD_SIZE*2, points.get(state.BOARD_SIZE*2)*scaling);\n }\n\n // checking other diagonal\n if(counter%state.BOARD_SIZE-1 == 0 && row+col != 0){\n points.add(state.BOARD_SIZE*2 + 1, points.get(state.BOARD_SIZE*2)*scaling);\n }\n }\n // if an enemy player is encoutered null the value of the row/col\n else if(player == 2){\n points.set(row, 0);\n points.set(state.BOARD_SIZE + col, 0);\n if(counter%state.BOARD_SIZE+1 == 0){\n points.add(state.BOARD_SIZE*2, 0);\n }\n if(counter%state.BOARD_SIZE-1 == 0){\n points.add(state.BOARD_SIZE*2 + 1, 0);\n }\n }\n counter++;\n }\n }\n\n // if we have nulled the point we don't count it for the value of the state\n for(Integer i: points){\n if(i > 1){\n value += i;\n }\n }\n //System.err.println(\"Value: \" + value);\n return value;\n }", "private static int scs(String X, String Y, int m, int n) {\n\t\t\n\t\treturn m + n - LCSBottomUp.lcs(X, Y, m, n);\n\t}", "int getTileSize();", "public void screenMath(){\r\n\t\t//10.9375 H\r\n\t\t//12.037037037037036 W\r\n\t\tDouble test1 = 0.12 * screenWidth / 2.2;\r\n\t\tDouble test2 = 0.807 * screenHight;\r\n\t\tDouble test3 = screenHight - test2;\r\n\t\tDouble test4 = test3 / 10;\r\n\t\tfor(int i = 0; i < 10; i++){\r\n\r\n\t\t\tArrayList<Double> tempArray = new ArrayList<Double>();\r\n\t\t\t\r\n\t\t\ttempArray.add(screenHight - test3 + (test4 * i));\r\n\t\t\ttempArray.add(test1);\r\n\t\t\tint[] RGBArray = getScreenColor(test1, screenHight - test3 + (test4 * i));\r\n\t\t\t\r\n\t\t\tfor(int x = 0; x < RGBArray.length; x++){\r\n\t\t\t\ttempArray.add((double) (RGBArray[x]));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlifeGlobe.addPosition(tempArray);\r\n\t\t}\r\n\t}", "private static int findMaxPointsFromTopLeftToBottomRight(char[][] matrix, int startingCellX, int startingCellY, int endCellX, int endCellY, int[][] memory) {\n if (!inRange(matrix, startingCellX, startingCellY)) {\n return 0;\n }\n\n/*\n if (visited[startingCellX][startingCellY]) {\n return 0;\n }\n*/\n\n if (memory[startingCellX][startingCellY] != -1) {\n return memory[startingCellX][startingCellY];\n }\n\n char ch = matrix[startingCellX][startingCellY];\n\n //visited[startingCellX][startingCellY] = true;\n\n if (ch == '#') {\n return 0;\n }\n\n if (startingCellX == endCellX && startingCellY == endCellY) {\n if (ch == '#' || ch == '.') {\n return 0;\n }\n return 1; // if '*'\n }\n\n if (ch == '*') {\n\n int maxPointsFromDown = findMaxPointsFromTopLeftToBottomRight(matrix, startingCellX + 1, startingCellY, endCellX, endCellY, memory);\n int maxPointsFromRight = findMaxPointsFromTopLeftToBottomRight(matrix, startingCellX, startingCellY + 1, endCellX, endCellY, memory);\n\n /* if (maxPointsFromRight < maxPointsFromDown) {\n if (inRange(matrix, startingCellX, startingCellY + 1)) {\n visited[startingCellX][startingCellY + 1] = false;\n }\n } else {\n if (inRange(matrix, startingCellX + 1, startingCellY)) {\n visited[startingCellX + 1][startingCellY] = false;\n }\n }\n*/\n int maxPoints = 1 + Math.max(maxPointsFromRight, maxPointsFromDown);\n\n // memoization for top-down approach\n memory[startingCellX][startingCellY] = maxPoints;\n\n return maxPoints;\n\n } else if (ch == '.') {\n\n int maxPointsFromDown = findMaxPointsFromTopLeftToBottomRight(matrix, startingCellX + 1, startingCellY, endCellX, endCellY, memory);\n int maxPointsFromRight = findMaxPointsFromTopLeftToBottomRight(matrix, startingCellX, startingCellY + 1, endCellX, endCellY, memory);\n\n /* if (maxPointsFromRight < maxPointsFromDown) {\n if (inRange(matrix, startingCellX, startingCellY + 1)) {\n visited[startingCellX][startingCellY + 1] = false;\n }\n } else {\n if (inRange(matrix, startingCellX + 1, startingCellY)) {\n visited[startingCellX + 1][startingCellY] = false;\n }\n }*/\n\n int maxPoints = Math.max(maxPointsFromRight, maxPointsFromDown);\n\n // memoization for top-down approach\n memory[startingCellX][startingCellY] = maxPoints;\n\n return maxPoints;\n } else { // if ch == '#'\n\n int maxPoints = 0;\n\n // memoization for top-down approach\n memory[startingCellX][startingCellY] = 0;\n\n return 0;\n }\n }", "public void adjustDown() {\n\n for (int y = 0; y < MAP_HEIGHT; y++)\n for (int x = 0; x < MAP_WIDTH; x++) {\n tiles[x][y].y = tiles[x][y].y + 4;\n backGroundTiles[x][y].y = backGroundTiles[x][y].y + 4;\n grassTiles[x][y].y = grassTiles[x][y].y + 4;\n }\n }", "@Test(timeout = 4000)\n public void test027() throws Throwable {\n Range range0 = Range.of((-81L));\n Range range1 = Range.of((-1L));\n boolean boolean0 = range0.intersects(range1);\n assertFalse(boolean0);\n assertFalse(range1.isEmpty());\n \n Range.Comparators.values();\n long long0 = range0.getBegin();\n assertEquals((-81L), long0);\n }", "public int getActualTileHeight() {\n return 32;\n }", "@Test\n\tpublic void upperLeft2SWCSpecial()\t\n\t{\n\t\tData d = new Data();\n\t\td.set(5, 2);\n\t\td.set(1, 3);\n\t\td.set(2, 4);\n\t\td.set(13, 13);\n\t\td.set(15, 14);\n\t\td.set(16, 15);\n\t\tArrayList<Coordinate> test_arr = d.shieldWallCapture(5);\n\t\tassertTrue(3==test_arr.get(0).getX() && 0==test_arr.get(0).getY()\n\t\t\t&& 2==test_arr.get(1).getX() && 0==test_arr.get(1).getY()\n\t\t\t&& 1==test_arr.get(2).getX() && 0==test_arr.get(2).getY());\n\t}", "private int m5278d(int pos, int cmd) {\n int end;\n int start;\n for (int i = this.f3533c.size() - 1; i >= 0; i--) {\n C1070b postponed = (C1070b) this.f3533c.get(i);\n int i2 = postponed.f3539a;\n if (i2 == 8) {\n if (postponed.f3540b < postponed.f3542d) {\n start = postponed.f3540b;\n end = postponed.f3542d;\n } else {\n start = postponed.f3542d;\n end = postponed.f3540b;\n }\n if (pos < start || pos > end) {\n int i3 = postponed.f3540b;\n if (pos < i3) {\n if (cmd == 1) {\n postponed.f3540b = i3 + 1;\n postponed.f3542d++;\n } else if (cmd == 2) {\n postponed.f3540b = i3 - 1;\n postponed.f3542d--;\n }\n }\n } else {\n int i4 = postponed.f3540b;\n if (start == i4) {\n if (cmd == 1) {\n postponed.f3542d++;\n } else if (cmd == 2) {\n postponed.f3542d--;\n }\n pos++;\n } else {\n if (cmd == 1) {\n postponed.f3540b = i4 + 1;\n } else if (cmd == 2) {\n postponed.f3540b = i4 - 1;\n }\n pos--;\n }\n }\n } else {\n int i5 = postponed.f3540b;\n if (i5 <= pos) {\n if (i2 == 1) {\n pos -= postponed.f3542d;\n } else if (i2 == 2) {\n pos += postponed.f3542d;\n }\n } else if (cmd == 1) {\n postponed.f3540b = i5 + 1;\n } else if (cmd == 2) {\n postponed.f3540b = i5 - 1;\n }\n }\n }\n for (int i6 = this.f3533c.size() - 1; i6 >= 0; i6--) {\n C1070b op = (C1070b) this.f3533c.get(i6);\n if (op.f3539a == 8) {\n int i7 = op.f3542d;\n if (i7 == op.f3540b || i7 < 0) {\n this.f3533c.remove(i6);\n mo8470a(op);\n }\n } else if (op.f3542d <= 0) {\n this.f3533c.remove(i6);\n mo8470a(op);\n }\n }\n return pos;\n }", "public short fitsAtTheEnd(Tile tile);", "private void computeDirect() {\n\t\t\tif (startY > 0) {\n\t\t\t\toffset = (startY - 1) * width;\n\t\t\t} else {\n\t\t\t\toffset = 0;\n\t\t\t}\n\n\t\t\tendY = endY == height ? endY - 1 : endY;\n\n\t\t\tfor (int y = startY; y <= endY; y++) {\n\t\t\t\tfor (int x = 0; x < width; x++) {\n\t\t\t\t\tfinal Point3D moveX = xAxis.scalarMultiply(x * horizontal / (width - 1));\n\t\t\t\t\tfinal Point3D moveY = yAxis.scalarMultiply(y * vertical / (height - 1));\n\t\t\t\t\tfinal Point3D screenPoint = screenCorner.add(moveX).sub(moveY);\n\n\t\t\t\t\tfinal Ray ray = Ray.fromPoints(eye, screenPoint);\n\n\t\t\t\t\tRayCasterUtil.tracer(scene, ray, rgb);\n\t\t\t\t\tred[offset] = rgb[0] > 255 ? 255 : rgb[0];\n\t\t\t\t\tgreen[offset] = rgb[1] > 255 ? 255 : rgb[1];\n\t\t\t\t\tblue[offset] = rgb[2] > 255 ? 255 : rgb[2];\n\n\t\t\t\t\toffset++;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private static String cal(int x, int y) {\n\t\tint max =0;\n\t\tif(Math.abs((int)x) > Math.abs((int)y)) max= Math.abs((int)x);\n\t\telse max = Math.abs((int)y);\n\t\t\n\t\tint max_code= max;\n\t\tmax = 2*max+1;\n\t\t\n\t\tint n = max;\n\t\tmax = (int)Math.pow((double)max, (double)2);\n\t\t\n\t\tint start = max;\n\t\tint res;\n\t\t\n\t\t\n\t\tif( x==max_code && y>-max_code){\n\t\tres = start-(max_code-y);\n\t\t}\n\t\telse if(y == -max_code && y<max_code) {\n\t\t\tstart -=(n-1);\n\t\t\tres = start-(max_code-x);\n\t\t}\n\t\telse if(x ==-max_code && y<max_code) {\n\t\t\tstart -=2*(n-1);\n\t\t\tres = start -(max_code+y);\n\t\t}\n\t\telse {\n\t\t\tstart-=3*(n-1);\n\t\t\tres = start - (max_code+x);\n\t\t}\n\tint unit =0, temp=res;\n\twhile(true) {\n\t\ttemp /=10;\n\t\tunit++;\n\t\tif(temp ==0)break;\n\t}\n\tString res_st = Integer.toString(res);\n\tfor(int i=0; i<max_unit-unit; i++) {\n\t\tres_st = \" \"+res_st;\n\t}\n\t\t\n\t\t\n\t\treturn res_st;\n\t}", "static int[] createVisualToLogicalMap(byte[] levels) {\n int len = levels.length;\n int[] mapping = new int[len];\n\n byte lowestOddLevel = (byte)(NUMLEVELS + 1);\n byte highestLevel = 0;\n\n // initialize mapping and levels\n\n for (int i = 0; i < len; i++) {\n mapping[i] = i;\n\n byte level = levels[i];\n if (level > highestLevel) {\n highestLevel = level;\n }\n\n if ((level & 0x01) != 0 && level < lowestOddLevel) {\n lowestOddLevel = level;\n }\n }\n\n while (highestLevel >= lowestOddLevel) {\n int i = 0;\n for (;;) {\n while (i < len && levels[i] < highestLevel) {\n i++;\n }\n int begin = i++;\n\n if (begin == levels.length) {\n break; // no more runs at this level\n }\n\n while (i < len && levels[i] >= highestLevel) {\n i++;\n }\n int end = i - 1;\n\n while (begin < end) {\n int temp = mapping[begin];\n mapping[begin] = mapping[end];\n mapping[end] = temp;\n ++begin;\n --end;\n }\n }\n\n --highestLevel;\n }\n\n return mapping;\n }", "public static int getTileBits() {\n return TILE_BITS;\n }", "public float[] GetStartPosition(int playerId)\r\n/* 515: */ {\r\n/* 516:621 */ for (int x = 0; x < getWidthInTiles(); x++) {\r\n/* 517:623 */ for (int y = 0; y < getHeightInTiles(); y++) {\r\n/* 518:625 */ if (tilePlayerPlacable(x, y, playerId)) {\r\n/* 519:627 */ return new float[] { x, y };\r\n/* 520: */ }\r\n/* 521: */ }\r\n/* 522: */ }\r\n/* 523:631 */ return new float[] { 0.0F, 0.0F };\r\n/* 524: */ }", "private int m14719r() {\n int s = m14720s();\n if (s > 0) {\n try {\n if (this.f10949d == null) {\n this.f10949d = this.f10962q.mo12209b(255);\n }\n int i = this.f10951f - this.f10952g;\n if (i >= s) {\n System.arraycopy(this.f10950e, this.f10952g, this.f10949d, 0, s);\n this.f10952g += s;\n } else if (this.f10948c.remaining() + i >= s) {\n System.arraycopy(this.f10950e, this.f10952g, this.f10949d, 0, i);\n this.f10952g = this.f10951f;\n m14721t();\n int i2 = s - i;\n System.arraycopy(this.f10950e, 0, this.f10949d, i, i2);\n this.f10952g += i2;\n } else {\n this.f10965t = 1;\n }\n } catch (Exception e) {\n C3111h1.m14932d(f10944y, \"Error Reading Block\", e);\n this.f10965t = 1;\n }\n }\n return s;\n }", "private static int m36201b(Rect rect) {\n return rect.width() * rect.height();\n }", "String computeNextLawnPosition();", "@Test\n\tpublic void lowerRight2SWCSpecial()\t\n\t{\n\t\tData d = new Data();\n\t\td.set(5, 99);\n\t\td.set(1, 110);\n\t\td.set(13, 98);\n\t\td.set(14, 109);\n\t\tArrayList<Coordinate> test_arr = d.shieldWallCapture(88);\n\t\tassertTrue(10==test_arr.get(0).getX() && 8==test_arr.get(0).getY()\n\t\t\t&& 10==test_arr.get(1).getX() && 9==test_arr.get(1).getY());\n\t}", "int countPowertypeRanges();", "int compFunction(int code) {\n return Math.abs(((3 * code + 8) % largePrime) % buckets.length);\n }", "protected void calculatePathfindingGrid(Tile[] tiles) {\n \n if(tiles == null) {\n return;\n }\n \n /**\n * Problem:\n * Because the tile size used by the path finding engine will most likely be\n * different from that of the visual effect size, we have to\n * look at all the visual tiles and judge whether they are blocking of\n * particular kinds of unit.\n * \n * Algorithm:\n * For land, air and sea take a look at the number of blocking/non-blocking\n * tiles there are and if there is over 50% either way then that will be the\n * PathTiles result.\n */\n \n // First get the size of the map in PathTile(s)\n int rows = getActualHeightInTiles();\n int cols = getActualWidthInTiles();\n \n // Calculate the number of tiles to a PathTile\n int tilesPerActualTilesX = getActualTileWidth() / getTileWidth();\n int tilesPerActualTilesY = getActualTileHeight() / getTileHeight();\n int tileCount = tilesPerActualTilesX * tilesPerActualTilesY;\n \n int tileCols = getWidthInTiles();\n \n // Create an array\n mPathTiles = new PathTile[ rows * cols ];\n \n // Iterate through these tiles\n for(int x = 0; x < cols ; x++) {\n for(int y = 0; y < rows; y++) {\n \n // Setup some variables\n int blockSea, blockAir, blockLand;\n blockAir = blockLand = blockSea = 0;\n \n // Figure out the percentage of each block\n for(int tx = 0; tx < tilesPerActualTilesX; tx++) {\n for(int ty = 0; ty < tilesPerActualTilesY; ty++) {\n \n int tileX = (x * tilesPerActualTilesX) + tx;\n int tileY = (y * tilesPerActualTilesY) + ty;\n \n Tile thisTile = tiles[ (tileY * tileCols) + tileX ];\n \n if(thisTile.blockAir()) {\n blockAir++;\n }\n \n if(thisTile.blockLand()) {\n blockLand++;\n }\n \n if(thisTile.blockSea()) {\n blockSea++;\n }\n \n }\n }\n \n // Calculate percentage\n float a,b,c;\n a = (float)blockAir / (float)tileCount;\n b = (float)blockLand / (float)tileCount;\n c = (float)blockSea / (float)tileCount;\n \n // Set the new tile\n mPathTiles[ (y * cols) + x ] = new PathTile( (a >= .5f), (b >= .5f), (c >= .5f) );\n \n // System.out.println(\"Grid \" + ((y * cols) + x) + \" (\" + x + \", \" + y + \") Air: \" + a + \" Land: \" + b + \" Sea: \" + c);\n \n }\n }\n \n }", "@Test\n\tpublic void upperRight2SWCSpecial()\t\n\t{\n\t\tData d = new Data();\n\t\td.set(5, 10);\n\t\td.set(1, 9);\n\t\td.set(15, 21);\n\t\td.set(13, 20);\n\t\td.set(17, 19);\n\t\td.set(6, 8);\n\t\tArrayList<Coordinate> test_arr = d.shieldWallCapture(7);\n\t\tassertTrue(7==test_arr.get(0).getX() && 0==test_arr.get(0).getY()\n\t\t\t&& 8==test_arr.get(1).getX() && 0==test_arr.get(1).getY()\n\t\t\t&& 9==test_arr.get(2).getX() && 0==test_arr.get(2).getY());\n\t}", "public double minPlacedRectWCET(Module m, double max_2F_wcet){\n\t\t// build the grid \n\t\tBiochip grid = new Biochip(m.width,m.height);\n\n\t\tdouble max_wcet = 0; \n\t\tfor (int x=0;x<grid.cells.size();x++){\n\t\t//for (int x=0;x<grid.cells.size();x++){\n\t\t\t//for (int y=x+1; y<4; y++){\n\t\t\tfor (int y=x+1; y<grid.cells.size()-1; y++){\n\t\t\t//\tfor (int z=y+1; z<5; z++){\n\t\t\t\t\t\n\t\t\t\tfor (int z=y+1; z<grid.cells.size()-2; z++){\n\t\t\t\t\tdouble min_wcet = 1000; \n\t\t\t\t\tArrayList<ModuleElement> fault_scen = new ArrayList<ModuleElement>(); \n\t\t\t\t\tfault_scen.add(new ModuleElement(grid.findRow(grid.cells.get(x)),grid.findColumn(grid.cells.get(x))));\n\t\t\t\t\tfault_scen.add(new ModuleElement(grid.findRow(grid.cells.get(y)),grid.findColumn(grid.cells.get(y))));\n\t\t\t\t\tfault_scen.add(new ModuleElement(grid.findRow(grid.cells.get(z)),grid.findColumn(grid.cells.get(z))));\n\t\t\t\t\tSystem.out.println(\"\\nFault scenario: \" + fault_scen.toString()); \n\n\t\t\t\t\t// mark the faulty cells as inactive\n\t\t\t\t\tfor (int k=0; k<fault_scen.size();k++){\n\t\t\t\t\t\tModuleElement f_cell = fault_scen.get(k);\n\t\t\t\t\t\tgrid.getCell(f_cell.x, f_cell.y).isActive = false; \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(grid.toString()); \n\t// calculate the min wcet \n\t\t\t\t\tfor (int k=0; k<fault_scen.size();k++){\n\t\t\t\t\t\tModuleElement f_cell = fault_scen.get(k);\n\t\t\t\t\t\tSystem.out.println(\"crt cell = (\" + f_cell.x + \" , \" + f_cell.y + \")\" ); \n\t\t\t\t\t\t// go around the fault - RIGHT \n\t\t\t\t\t\tif (f_cell.y+1<grid.width){\n\t\t\t\t\t\t\tModuleElement right_n = new ModuleElement(f_cell.x, f_cell.y+1); \n\t\t\t\t\t\t\tif(!this.findFault(right_n, fault_scen)){\n\t\t\t\t\t\t\t\tRectangle right_r = new Rectangle(1,1,right_n.y, grid.height - 1 - right_n.x);\n\t\t\t\t\t\t\t\t//System.out.println(\"Start rect = \" + right_r.toString()); \n\n\t\t\t\t\t\t\t\t// get the scaled ER\n\t\t\t\t\t\t\t\tthis.shiftRight(right_r,grid); \n\t\t\t\t\t\t\t\t//System.out.println(\" After right right rect = \" + right_r.toString()); \n\n\t\t\t\t\t\t\t\tthis.shiftBottom(right_r,grid);\n\t\t\t\t\t\t\t\t//System.out.println(\" After BOTTOM right rect = \" + right_r.toString()); \n\n\t\t\t\t\t\t\t\tthis.shiftTop(right_r,grid); \n\t\t\t\t\t\t\t\t//System.out.println(\" After up right rect = \" + right_r.toString()); \n\n\t\t\t\t\t\t\t\tif (right_r.height > 1 && right_r.width >1){\n\n\t\t\t\t\t\t\t\tif(min_wcet>this.nonFWCET(right_r.width, right_r.height))\n\t\t\t\t\t\t\t\t\tmin_wcet = this.nonFWCET(right_r.width, right_r.height); \n\t\t\t\t\t\t\t\t//System.out.println(\"Right rect = \" + right_r.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}\n\t\t\t\t\t\t// LEFT\n\t\t\t\t\t\tif (f_cell.y-1 >= 0){\n\t\t\t\t\t\t\tModuleElement left_n = new ModuleElement(f_cell.x, f_cell.y-1); \n\t\t\t\t\t\t\tif(!this.findFault(left_n, fault_scen)){\n\t\t\t\t\t\t\t\tRectangle left_r = new Rectangle(1,1,left_n.y, grid.height - 1 - left_n.x);\n\t\t\t\t\t\t\t\t// get the scaled ER\n\t\t\t\t\t\t\t\tthis.shiftLeft(left_r,grid); \n\n\t\t\t\t\t\t\t\tthis.shiftBottom(left_r,grid); \n\n\t\t\t\t\t\t\t\tthis.shiftTop(left_r,grid); \n\t\t\t\t\t\t\t\tif (left_r.height > 1 && left_r.width >1){\n\n\t\t\t\t\t\t\t\tif(min_wcet>this.nonFWCET(left_r.width, left_r.height))\n\t\t\t\t\t\t\t\t\tmin_wcet = this.nonFWCET(left_r.width, left_r.height); \n\t\t\t\t\t\t\t\t//System.out.println(\"Left rect = \" + left_r.toString()); \n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// UP\n\t\t\t\t\t\tif (f_cell.x-1>=0){\n\t\t\t\t\t\t\tModuleElement up_n = new ModuleElement(f_cell.x-1, f_cell.y); \n\t\t\t\t\t\t\tif(!this.findFault(up_n, fault_scen)){\n\t\t\t\t\t\t\t\tRectangle up_r = new Rectangle(1,1,up_n.y, grid.height - 1 - up_n.x);\n\t\t\t\t\t\t\t\t// get the scaled ER\n\t\t\t\t\t\t\t\tthis.shiftLeft(up_r, grid); \n\t\t\t\t\t\t\t\tthis.shiftRight(up_r, grid); \n\t\t\t\t\t\t\t\tthis.shiftTop(up_r, grid); \n\t\t\t\t\t\t\t\tif (up_r.height > 1 && up_r.width >1){\n\t\t\t\t\t\t\t\t\tif(min_wcet>this.nonFWCET(up_r.width, up_r.height))\n\t\t\t\t\t\t\t\t\t\tmin_wcet = this.nonFWCET(up_r.width, up_r.height); \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//System.out.println(\"UP rect = \" + up_r.toString()); \n\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// DOWN\n\t\t\t\t\t\tif (f_cell.x+1<grid.height){\n\n\t\t\t\t\t\t\tModuleElement down_n = new ModuleElement(f_cell.x+1, f_cell.y);\n\t\t\t\t\t\t\t//System.out.println(\"Down cell = \" + down_n.toString()); \n\t\t\t\t\t\t\tif(!this.findFault(down_n, fault_scen)){\n\t\t\t\t\t\t\t\tRectangle down_r = new Rectangle(1,1,down_n.y, grid.height - 1 - down_n.x);\n\t\t\t\t\t\t\t\t//System.out.println(\"Start rect = \" + down_r.toString()); \n\t\t\t\t\t\t\t\t// get the scaled ER\n\t\t\t\t\t\t\t\tthis.shiftLeft(down_r,grid);\n\t\t\t\t\t\t\t\t//System.out.println(\" After Left Down rect = \" + down_r.toString()); \n\t\t\t\t\t\t\t\tthis.shiftRight(down_r,grid);\n\t\t\t\t\t\t\t\t//System.out.println(\" After Right Down rect = \" + down_r.toString()); \n\t\t\t\t\t\t\t\tthis.shiftBottom(down_r,grid); \n\t\t\t\t\t\t\t\t//System.out.println(\" After Down Down rect = \" + down_r.toString()); \n\t\t\t\t\t\t\t\tif (down_r.height > 1 && down_r.width >1){\n\n\t\t\t\t\t\t\t\tif(min_wcet>this.nonFWCET(down_r.width, down_r.height))\n\t\t\t\t\t\t\t\t\tmin_wcet = this.nonFWCET(down_r.width, down_r.height); \n\t\t\t\t\t\t\t\t//System.out.println(\"Down rect = \" + down_r.toString()); \n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"local minimum = \" + min_wcet + \" max_wcet = \" + max_wcet);\n\t\t\t\t\tif (min_wcet > max_2F_wcet) min_wcet = max_2F_wcet; \n\t\t\t\t\t//if(max_wcet > 4) System.exit(1); \n\t\t\t\t\tif (max_wcet < min_wcet) max_wcet = min_wcet; \n\t\t\t\t\t// clean the marked cells \n\t\t\t\t\tfor (int k=0; k<fault_scen.size();k++){\n\t\t\t\t\t\tModuleElement f_cell = fault_scen.get(k);\n\t\t\t\t\t\tgrid.getCell(f_cell.x, f_cell.y).isActive = true; \n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t\n\t\treturn max_wcet; \n\t}", "public static int offset_min() {\n return (56 / 8);\n }", "private int getOutcode(Point p) {\n Rectangle r = (Rectangle)component.rect.clone();\n r.grow(-PROX_DIST, -PROX_DIST);\n return r.outcode(p.x, p.y);\n }", "private int getCost(Game game) {\n\n // Represents the sum of each tile value multiplied by its column index (Gives a tendency to move to the left)\n int weightedSum = 0;\n\n // Represents the number of diagonal pairs of matching value on the board.\n int diagCount = 0;\n\n // The number of tiles on the grid\n int tileCount = 0;\n\n Tile[][] tiles = game.tiles;\n\n for (int x = 0; x < BOARD_X; x++) {\n for (int y = 0; y < BOARD_Y; y++) {\n Tile tile = tiles[x][y];\n\n // Skip empty squares\n if (tile == null) {\n continue;\n }\n\n // Increment the weighted sum with product of the row index and the tile's value\n weightedSum += x * tile.getValue();\n tileCount++;\n\n // If all squares are occupied, return an arbitrarily large value such that this option is not picked.\n if (tileCount == maxTileCount) {\n return 100000;\n }\n\n // Since only up right and down right diagonals are computed, ignore the last row as this would push\n // index's out of range.\n if (x == BOARD_X - 1) {\n continue;\n }\n\n // Retrieve the upper right tile and updates the diagonal counter\n if (y > 0) {\n Tile ur = tiles[x + 1][y - 1];\n if (ur != null) {\n diagCount += (ur.getValue() == tile.getValue()) ? 1 : 0;\n }\n }\n\n // Retrieve the lower right tile and updates the diagonal counter\n if (y < BOARD_Y - 1) {\n Tile dr = tiles[x + 1][y + 1];\n if (dr != null) {\n if (dr.getValue() == tile.getValue()) {\n diagCount += (dr.getValue() == tile.getValue()) ? 1 : 0;\n }\n }\n }\n }\n }\n\n return weightedSum + diagCount;\n }", "Long getResultMaskBoundary();", "public Location attack() {\n resetBoard();\n\n if (getHits().isEmpty()) {\n// System.out.println(\"Hunting\");\n\n for (final int[] r : board) {\n for (int c = 0; c < r.length; c++) {\n if (getIntegers().contains(5) && (c < (r.length - 4)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2]) && (-1 != r[c + 3]) && (-1 != r[c + 4])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n ++r[c + 3];\n ++r[c + 4];\n }\n\n if (getIntegers().contains(4) && (c < (r.length - 3)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2]) && (-1 != r[c + 3])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n ++r[c + 3];\n }\n if (getIntegers().contains(3) && (c < (r.length - 2)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n\n }\n if (getIntegers().contains(3) && (2 == Collections.frequency(getIntegers(), 3)) && (c < (r.length - 2)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n\n }\n if (getIntegers().contains(2) && (c < (r.length - 1)))\n if ((-1 != r[c]) && (-1 != r[c + 1])) {\n ++r[c];\n ++r[c + 1];\n }\n }\n }\n\n for (int c = 0; c < board[0].length; c++) {\n for (int r = 0; r < board.length; r++) {\n if (getIntegers().contains(5) && (r < (board.length - 4)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c]) && (-1 != board[r + 4][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n ++board[r + 4][c];\n }\n\n if (getIntegers().contains(4) && (r < (board.length - 3)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n }\n if (getIntegers().contains(3) && (r < (board.length - 2)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n\n\n }\n if (getIntegers().contains(3) && (2 == Collections.frequency(getIntegers(), 3)) && (r < (board.length - 2)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n\n\n }\n if (getIntegers().contains(2) && (r < (board.length - 1)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n }\n }\n }\n } else {\n// System.out.println(\"Hitting\");\n\n for (final Location hit : getHits()) {\n final int r = hit.getRow();\n final int c = hit.getCol();\n\n if (getIntegers().contains(2)) {\n if ((0 <= (c - 1)) && (-1 != board[r][c]) && (-1 != board[r][c - 1])) {\n ++board[r][c];\n ++board[r][c - 1];\n }\n\n\n if (((c + 1) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1])) {\n ++board[r][c];\n ++board[r][c + 1];\n }\n\n if ((0 <= (r - 1)) && (-1 != board[r][c]) && (-1 != board[r - 1][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n }\n\n if (((r + 1) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n }\n\n\n }\n if (getIntegers().contains(3)) {\n final int inc = Collections.frequency(getIntegers(), 3);\n\n if ((0 <= (c - 2)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2])) {\n board[r][c] += inc;\n board[r][c - 1] += inc;\n board[r][c - 2] += inc;\n }\n if (((c + 2) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2])) {\n board[r][c] += inc;\n board[r][c + 1] += inc;\n board[r][c + 2] += inc;\n }\n if ((0 <= (r - 2)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c])) {\n board[r][c] += inc;\n board[r - 1][c] += inc;\n board[r - 2][c] += inc;\n }\n if (((r + 2) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n board[r][c] += inc;\n board[r + 1][c] += inc;\n board[r + 2][c] += inc;\n }\n\n\n }\n if (getIntegers().contains(4)) {\n if ((0 <= (c - 3)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2]) && (-1 != board[r][c - 3])) {\n ++board[r][c];\n ++board[r][c - 1];\n ++board[r][c - 2];\n ++board[r][c - 3];\n }\n if (((c + 3) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2]) && (-1 != board[r][c + 3])) {\n ++board[r][c];\n ++board[r][c + 1];\n ++board[r][c + 2];\n ++board[r][c + 3];\n }\n if ((0 <= (r - 3)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c]) && (-1 != board[r - 3][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n ++board[r - 2][c];\n ++board[r - 3][c];\n }\n if (((r + 3) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n }\n\n\n }\n if (getIntegers().contains(5)) {\n if ((0 <= (c - 4)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2]) && (-1 != board[r][c - 3]) && (-1 != board[r][c - 4])) {\n ++board[r][c];\n ++board[r][c - 1];\n ++board[r][c - 2];\n ++board[r][c - 3];\n ++board[r][c - 4];\n }\n if (((c + 4) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2]) && (-1 != board[r][c + 3]) && (-1 != board[r][c + 4])) {\n ++board[r][c];\n ++board[r][c + 1];\n ++board[r][c + 2];\n ++board[r][c + 3];\n ++board[r][c + 4];\n }\n if ((0 <= (r - 4)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c]) && (-1 != board[r - 3][c]) && (-1 != board[r - 4][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n ++board[r - 2][c];\n ++board[r - 3][c];\n ++board[r - 4][c];\n }\n if (((r + 4) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c]) && (-1 != board[r + 4][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n ++board[r + 4][c];\n }\n }\n }\n\n for (final Location hit : getHits()) {\n board[hit.getRow()][hit.getCol()] = 0;\n }\n }\n\n// for (int[] i : board)\n// System.out.println(Arrays.toString(i));\n return findLargest();\n }", "private void checkStench(int top, int left, int bottom, int right) {\n\t\tif (top > height - 1) {\n\t\t\ttop = height - 1;\n\t\t}\n\t\tif (bottom < 0) {\n\t\t\tbottom = 0;\n\t\t}\n\t\tif (left < 0) {\n\t\t\tleft = 0;\n\t\t}\n\t\tif (right > width - 1) {\n\t\t\tright = width - 1;\n\t\t}\n\t\tboolean stench = false;\n\t\tfor (int i = bottom; i <= top; i++) {\n\t\t\tfor (int j = left; j <= right; j++) {\n\t\t\t\tstench = false;\n\t\t\t\tif (i > 0) {\n\t\t\t\t\tSet s = (Set) agentPositions.get(new Point(i - 1, j));\n\t\t\t\t\tfor (Iterator it = s.iterator(); it.hasNext(); ) {\n\t\t\t\t\t\tif (it.next() instanceof Wumpus) {\n\t\t\t\t\t\t\tstench = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (i < width - 1) {\n\t\t\t\t\tSet s = (Set) agentPositions.get(new Point(i + 1, j));\n\t\t\t\t\tfor (Iterator it = s.iterator(); it.hasNext(); ) {\n\t\t\t\t\t\tif (it.next() instanceof Wumpus) {\n\t\t\t\t\t\t\tstench = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (j > 0) {\n\t\t\t\t\tSet s = (Set) agentPositions.get(new Point(i, j - 1));\n\t\t\t\t\tfor (Iterator it = s.iterator(); it.hasNext(); ) {\n\t\t\t\t\t\tif (it.next() instanceof Wumpus) {\n\t\t\t\t\t\t\tstench = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (j < height - 1) {\n\t\t\t\t\tSet s = (Set) agentPositions.get(new Point(i, j + 1));\n\t\t\t\t\tfor (Iterator it = s.iterator(); it.hasNext(); ) {\n\t\t\t\t\t\tif (it.next() instanceof Wumpus) {\n\t\t\t\t\t\t\tstench = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (stench) {\n\t\t\t\t\tif (!checkImage(i, j, STENCH_FILE)) {\n\t\t\t\t\t\taddImage(i, j, STENCH_FILE, STENCH_FILE);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (checkImage(i, j, STENCH_FILE)) {\n\t\t\t\t\t\tremoveImage(i, j, STENCH_FILE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test31() throws Throwable {\n Range range0 = Range.of((-1259L), 255L);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n String string0 = range0.toString(range_CoordinateSystem0);\n assertEquals(\"[ -1259 .. 256 ]/SB\", string0);\n \n Range range1 = Range.of((-1259L));\n range1.getEnd();\n long long0 = range1.getEnd();\n assertEquals((-1259L), long0);\n \n Range range2 = Range.of((-1259L), 255L);\n List<Range> list0 = range2.split(255L);\n List<Range> list1 = range2.complementFrom(list0);\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.SPACE_BASED;\n Range range3 = Range.of(range_CoordinateSystem1, (-1259L), 0L);\n range3.endsBefore(range0);\n Consumer<Object> consumer0 = (Consumer<Object>) mock(Consumer.class, new ViolatedAssumptionAnswer());\n range0.forEach(consumer0);\n range2.complementFrom(list1);\n assertFalse(list0.contains(range0));\n assertEquals(0, list1.size());\n assertFalse(list0.isEmpty());\n \n Range range4 = Range.ofLength(0L);\n Range range5 = range4.intersection(range0);\n long long1 = range5.getEnd();\n assertEquals((-1L), long1);\n \n range0.intersects(range4);\n range3.equals(\"[ -1259 .. 256 ]/SB\");\n Range.of(333L);\n List<Range> list2 = range2.complement(range3);\n assertTrue(list2.contains(range0));\n }", "public int calculateMinimumHP(ArrayList<ArrayList<Integer>> grid) {\n\t\t\t\t int m =grid.size(), n = grid.get(0).size();\n\t\t\t\t int[][][] dp = new int[m+1][n+1][2];\n\t\t\t\t \n\t\t\t\t dp[0][0][0] = 0;\n\t\t\t\t dp[0][0][1] = 0;\n\t\t\t\t dp[0][1][0] = 1; // start with life\n\t\t\t\t dp[0][1][1] = 0; // balance life\n\t\t\t\t dp[1][0][0] = 1;\n\t\t\t\t dp[1][0][1] = 0;\n\t\t\t\t for(int i=2;i<dp[0].length;i++){\n\t\t\t\t\t dp[0][i][0] = Integer.MAX_VALUE;\n\t\t\t\t\t dp[0][i][1] = 0;\n\t\t\t\t }\n\t\t\t\t for(int i=2;i<dp.length;i++){\n\t\t\t\t\t dp[i][0][0] = Integer.MAX_VALUE;\n\t\t\t\t\t dp[i][0][1] = 0;\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t for(int i=1;i<dp.length;i++){\n\t\t\t\t\t for(int j=1;j<dp[0].length;j++){\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(grid.get(i-1).get(j-1) < 0){\n\t\t\t\t\t\t\t int[] fromCell = dp[i-1][j][0]< dp[i][j-1][0]?dp[i-1][j]:dp[i][j-1];\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t dp[i][j][0] = fromCell[0] - grid.get(i-1).get(j-1) - fromCell[1];\n\t\t\t\t\t\t\t dp[i][j][1] = fromCell[1]+ grid.get(i-1).get(j-1)>0?fromCell[1]+ grid.get(i-1).get(j-1):0;\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t int[] fromCell = dp[i-1][j][0]< dp[i][j-1][0]?dp[i-1][j]:dp[i][j-1];\n\t\t\t\t\t\t\t dp[i][j][0] = fromCell[0];\n\t\t\t\t\t\t\t dp[i][j][1] = fromCell[1]+grid.get(i-1).get(j-1);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t return dp[m][n][0];\n\t\t\t\t \n\t\t\t }", "public int getActualTileWidth() {\n return 32;\n }", "public static void main(String[] args) {\n\t\t\n\t int a, b;\n\t int arr[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 };\n\t int range[][]={{3,7}, {4,6}, {5,5}};\n\n\t for (int i = 0; i < range.length; i++){\n\t \t\n\t \ta = range[i][0];\n\t \tb = range[i][1];\n\n\t\t\tfor(int j = 0; j < (b-a)/2; j++){\n\t\t\t\tint temp = arr[a-1+j];\n\t\t\t\tarr[a-1+j] =arr[b-1-j]; \n\t\t\t\tarr[b-1-j] = temp;\n\t\t\t}\n\t }\n\n\t\tSystem.out.print (\"결과 : \"+\"[ \");\n\t\t\n\t\tfor(int i=0; i<arr.length ; i++ ) {\n\t\t\tSystem.out.print (arr[i] + \" \" );\n\n\t\t}\n\t\tSystem.out.print (\"]\");\n\t}", "private float[] getBounds(TileCoolantPipe tile) {\n float[] bounds = new float[6];\n boolean[] connected = tile.getConnectedSides();\n float hDiameter = cableDiameter / 2.0F;\n for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {\n float width = 0.5F;\n if (!connected[dir.ordinal()]) {//(sides & dir.flag) != dir.flag) {\n width = hDiameter;\n }\n if (dir.ordinal() % 2 == 0) {\n width *= -1;\n }\n bounds[dir.ordinal()] = 0.5F + width;\n }\n return bounds;\n }", "void lowerNumberOfStonesOnBoard();", "static int f(char[] turns, int nturns, int r, int c, int dr, int dc, int cnt) {\n if (!range(r, c)) return 0;\n if (board[r][c] != '.') return 0;\n int ntouch = 0;\n if (r == 0) ntouch++;\n if (r == N - 1) ntouch++;\n if (c == 0) ntouch++;\n if (c == M - 1) ntouch++;\n if (ntouch >= 2) return 0; // touched corner\n if (cnt != 0 && ntouch == 1) { // touched edge second time\n out.println(\"DONE : \" + r + \" \" + c);\n return 1;\n }\n int near = 0;\n for (int[] d : new int[][] {{1, 0}, {-1, 0}, {0, 1}, {0, -1}}) {\n int nr = r + d[0];\n int nc = c + d[1];\n if (range(nr, nc) && board[nr][nc] == '*') near++;\n }\n if (cnt != 0 && !(ntouch == 0 && near == 1)) {\n return 0;\n }\n out.println(r + \" \" + c + \" \" + dr + \" \" + dc);\n board[r][c] = '*';\n int tot = 0;\n tot += f(turns, nturns, r + dr, c + dc, dr, dc, cnt + 1);\n if (nturns < 2 && cnt > 0) {\n if (nturns == 0) {\n for (char cc : new char[] {'L', 'R'}) {\n turns[0] = cc;\n int ndr = dc;\n int ndc = dr;\n if (cc == 'L') ndr = -ndr;\n if (cc == 'R') ndc = -ndc;\n tot += f(turns, nturns + 1, r + ndr, c + ndc, ndr, ndc, cnt + 1);\n }\n } else {\n char cc = turns[0] == 'L' ? 'R' : 'L';\n turns[1] = cc;\n int ndr = dc;\n int ndc = dr;\n if (cc == 'L') ndr = -ndr;\n if (cc == 'R') ndc = -ndc;\n tot += f(turns, nturns + 1, r + ndr, c + ndc, ndr, ndc, cnt + 1);\n }\n }\n board[r][c] = '.';\n return tot;\n }", "public int getTileWidth() {\n return 8;\n }", "int compFunction(int code) {\n int a = 1021;\n int b = 11287;\n int p = Prime.primeLarge(sizeBucket);\n //System.out.println(\"code = \"+ code + \", p = \"+p);\n\n int index = (Math.abs(a * code + b) % p) % sizeBucket;\n return index;\n }", "public void method_237(int var1, byte[] var2) {\n boolean var11 = field_759;\n int[] var3 = this.spritePixels[var1] = new int[10200];\n this.field_736[var1] = 255;\n this.field_737[var1] = 40;\n this.field_738[var1] = 0;\n this.field_739[var1] = 0;\n this.spriteWidthFull[var1] = 255;\n this.field_741[var1] = 40;\n this.field_742[var1] = false;\n int var4 = 0;\n int var5 = 1;\n int var6 = 0;\n int var7;\n int var8;\n if(var11 || var6 < 255) {\n do {\n var7 = var2[var5++] & 255;\n var8 = 0;\n if(var11) {\n var3[var6++] = var4;\n ++var8;\n }\n\n while(var8 < var7) {\n var3[var6++] = var4;\n ++var8;\n }\n\n var4 = 16777215 - var4;\n } while(var6 < 255);\n }\n\n var7 = 1;\n if(var11 || var7 < 40) {\n do {\n var8 = 0;\n if(!var11 && var8 >= 255) {\n ++var7;\n } else {\n do {\n int var9 = var2[var5++] & 255;\n int var10 = 0;\n if(var11) {\n var3[var6] = var3[var6 - 255];\n ++var6;\n ++var8;\n ++var10;\n }\n\n while(var10 < var9) {\n var3[var6] = var3[var6 - 255];\n ++var6;\n ++var8;\n ++var10;\n }\n\n if(var8 < 255) {\n var3[var6] = 16777215 - var3[var6 - 255];\n ++var6;\n ++var8;\n }\n } while(var8 < 255);\n\n ++var7;\n }\n } while(var7 < 40);\n\n }\n }", "public int[] determineScreenSize()\n {\n int heightInPixels, widthInPixels;\n int horizontal, vertical;\n\n // Determine initial values from CRTC registers (ensure dimensions are positive by casting byte to int)\n horizontal = ((((int) videocard.crtControllerRegister.regArray[1]) & 0xFF) + 1) * 8;\n vertical = ((((int) videocard.crtControllerRegister.regArray[18]) & 0xFF) | \n (((((int) videocard.crtControllerRegister.regArray[7]) & 0xFF) & 0x02) << 7) | (((((int) videocard.crtControllerRegister.regArray[7]) & 0xFF) & 0x40) << 3)) + 1;\n\n if (videocard.graphicsController.shift256Reg == 0)\n {\n widthInPixels = 640;\n heightInPixels = 480;\n\n if (videocard.crtControllerRegister.regArray[0x06] == (byte) 0xBF)\n {\n if (videocard.crtControllerRegister.regArray[0x17] == (byte) 0xA3 && videocard.crtControllerRegister.regArray[0x14] == (byte) 0x40 && videocard.crtControllerRegister.regArray[0x09] == (byte) 0x41)\n {\n widthInPixels = 320;\n heightInPixels = 240;\n }\n else\n {\n if (videocard.sequencer.dotClockRate != 0)\n {\n horizontal <<= 1;\n }\n widthInPixels = horizontal;\n heightInPixels = vertical;\n }\n }\n else if ((horizontal >= 640) && (vertical >= 480))\n {\n widthInPixels = horizontal;\n heightInPixels = vertical;\n }\n }\n else if (videocard.graphicsController.shift256Reg == 2)\n {\n\n if (videocard.sequencer.chainFourEnable != 0)\n {\n widthInPixels = horizontal;\n heightInPixels = vertical;\n }\n else\n {\n widthInPixels = horizontal;\n heightInPixels = vertical;\n }\n }\n else\n {\n if (videocard.sequencer.dotClockRate != 0)\n horizontal <<= 1;\n widthInPixels = horizontal;\n heightInPixels = vertical;\n }\n return new int[] {heightInPixels, widthInPixels};\n }", "public String solution() {\n\t\tint[] arr = {1000, 11, 445, 1, 330, 3000};\n int arr_size = 6;\n \n int swaps = 0;\n int max = 0;\n int min = 0;\n int i = 0;\n if(arr_size%2 == 0) {\n \tif(arr[0]<arr[1]) {\n \t\tmin = arr[0];\n \t\tmax=arr[1];\n \t}\n \telse {\n \t\tmin = arr[1];\n \t\tmax=arr[0];\n \t}\n \ti=2;\n }\n else {\n \tmax=arr[0];\n \tmin = arr[0];\n \ti=1;\n }\n \n while(i<arr_size) {\n \tif(arr[i]>arr[i+1]) {\n \t\tmax=Math.max(max, arr[i]);\n \t\tmin=Math.min(min, arr[i+1]);\n \t}\n \telse {\n \t\tmax=Math.max(max, arr[i+1]);\n \t\tmin=Math.min(min, arr[i]);\n \t}\n \ti+=2;\n }\n \n \n\t\treturn \"END \"+max + \" \"+min;\n }", "float compress(){\n float lower = mp.get(sequence.charAt(0)).lowRange;\n float upper = mp.get(sequence.charAt(0)).upperRange;\n for (int i = 1; i < sequence.length(); i++) {\n float newLower = lower + (upper - lower)*mp.get(sequence.charAt(i)).lowRange;\n float newUpper = lower + (upper - lower)*mp.get(sequence.charAt(i)).upperRange;\n lower = newLower;\n upper = newUpper;\n }\n ///picking value between final lower and upper\n float compressionCode = (float)(Math.floor(upper * 1000.0) / 1000.0);\n return compressionCode;\n }", "private int calculateCellPower(int xPosition, int yPosition) {\n\t\tint rackId = xPosition + 10;\r\n\t\t// Power level starts at rack id times y coordinate.\r\n\t\tlong calculatingCellPower = rackId * yPosition;\r\n\t\t// Add the grid serial number.\r\n\t\tcalculatingCellPower += gridSerialNumber;\r\n\t\t// Multiply by the rack id.\r\n\t\tcalculatingCellPower *= rackId;\r\n\t\t// Keep only the hundreds digit (e.g. '3' in 12345).\r\n\t\tString cellPowerString = Long.toString(calculatingCellPower); \r\n\t\tchar hundredsDigit = cellPowerString.charAt(cellPowerString.length() - 3);\r\n\t\tint cellPower = Character.digit(hundredsDigit, 10);\r\n\t\t// Subtract five to determine the actual cell power.\r\n\t\treturn cellPower - 5;\r\n\t}", "@Test\n\tpublic void upperLeft1SWCSpecial()\t\n\t{\n\t\tData d = new Data();\n\t\td.set(5, 12);\n\t\td.set(1, 23);\n\t\td.set(13, 13);\n\t\td.set(14, 24);\n\t\tArrayList<Coordinate> test_arr = d.shieldWallCapture(34);\n\t\tassertTrue(0==test_arr.get(0).getX() && 2==test_arr.get(0).getY()\n\t\t\t&& 0==test_arr.get(1).getX() && 1==test_arr.get(1).getY());\n\t}", "private short computeLocationValue(short row, short column) {\n\t\treturn (short) (gridSize * row + column);\n\t}", "public static void render(Graphics g, Tile tile, Point pxCenterPoint, float value) {\n Point topLeft = new Point(pxCenterPoint.x - (tile.getImage().getWidth() / 2), pxCenterPoint.y - (tile.getImage().getHeight() / 2));\n if (value >= 0) {\n\n\n if (tile.getType() == \"Mountain\") {\n\n g.drawImage(GraphicAssets.col, topLeft.x, topLeft.y + 19 + 21, 60, tile.getImageHeight() / 2, null);\n g.drawImage(GraphicAssets.base, topLeft.x, topLeft.y + 19 + 19 + tile.getImageHeight() / 2, 60, 19, null);\n g.drawImage(tile.getImage(), topLeft.x, topLeft.y, tile.getImage().getWidth(), tile.getImage().getHeight(), null);\n\n } else if (tile.getType() == \"Water\" || tile.getType() == \"Grass\" || tile.getType() == \"Running\") {\n //\n //System.out.println(topLeft.y);\n g.drawImage(GraphicAssets.col, topLeft.x, topLeft.y + 10 + 19, 60, tile.getImageHeight() / 2, null);\n g.drawImage(GraphicAssets.base, topLeft.x, topLeft.y + 10 + 19 + tile.getImageHeight() / 2, 60, 19, null);\n g.drawImage(tile.getImage(), topLeft.x, topLeft.y + 10, tile.getImage().getWidth(), tile.getImage().getHeight(), null);\n } else {\n g.drawImage(GraphicAssets.col, topLeft.x, topLeft.y + 10 + 19, 60, tile.getImageHeight() / 2, null);\n g.drawImage(GraphicAssets.base, topLeft.x, topLeft.y + 10 + 19 + tile.getImageHeight() / 2, 60, 19, null);\n g.drawImage(tile.getImage(), topLeft.x, topLeft.y + 10, tile.getImage().getWidth(), tile.getImage().getHeight(), null);\n }\n if (tile.hasAreaEffect()) {\n areaEffectRenderer.render(g, tile.getAreaEffect(), topLeft);\n }\n\n if (tile.hasItem()) {\n for (Item item : tile.getItems()) {\n itemRenderer.render(g, item, topLeft);\n }\n }\n }\n }", "public int getTileHeight() {\n return 8;\n }", "public long mo9775y() {\n /*\n r11 = this;\n int r0 = r11.f9082i\n int r1 = r11.f9080g\n if (r1 != r0) goto L_0x0008\n goto L_0x00b6\n L_0x0008:\n byte[] r2 = r11.f9079f\n int r3 = r0 + 1\n byte r0 = r2[r0]\n if (r0 < 0) goto L_0x0014\n r11.f9082i = 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_0x00b6\n L_0x001b:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 7\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0029\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n L_0x0026:\n long r2 = (long) r0\n goto L_0x00bd\n L_0x0029:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x003a\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n long r0 = (long) r0\n r9 = r0\n r1 = r3\n r2 = r9\n goto L_0x00bd\n L_0x003a:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 21\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0048\n r2 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r2\n goto L_0x0026\n L_0x0048:\n long r3 = (long) r0\n int r0 = r1 + 1\n byte r1 = r2[r1]\n long r5 = (long) r1\n r1 = 28\n long r5 = r5 << r1\n long r3 = r3 ^ r5\n r5 = 0\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 < 0) goto L_0x005f\n r1 = 266354560(0xfe03f80, double:1.315966377E-315)\n L_0x005b:\n long r2 = r3 ^ r1\n r1 = r0\n goto L_0x00bd\n L_0x005f:\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_0x0074\n r5 = -34093383808(0xfffffff80fe03f80, double:NaN)\n L_0x0071:\n long r2 = r3 ^ r5\n goto L_0x00bd\n L_0x0074:\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_0x0087\n r1 = 4363953127296(0x3f80fe03f80, double:2.1560793202584E-311)\n goto L_0x005b\n L_0x0087:\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_0x009a\n r5 = -558586000294016(0xfffe03f80fe03f80, double:NaN)\n goto L_0x0071\n L_0x009a:\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_0x00bb\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_0x00bc\n L_0x00b6:\n long r0 = r11.mo9776z()\n return r0\n L_0x00bb:\n r1 = r0\n L_0x00bc:\n r2 = r3\n L_0x00bd:\n r11.f9082i = r1\n return r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3659c.mo9775y():long\");\n }", "int calculateCap();", "@Test\n\tpublic void southSWC()\t\n\t{\n\t\tData d = new Data();\n\t\td.set(32, 103);\n\t\td.set(33, 104);\n\t\td.set(34, 113);\n\t\td.set(35, 106);\n\t\td.set(36, 107);\n\t\td.set(1, 114);\n\t\td.set(2, 115);\n\t\td.set(3, 116);\n\t\td.set(4, 117);\n\t\td.set(5, 118);\n\t\td.set(19, 119);\n\t\tArrayList<Coordinate> test_arr = d.shieldWallCapture(119);\n\t\tassertTrue(7==test_arr.get(0).getX() && 10==test_arr.get(0).getY()\n\t\t\t&& 6==test_arr.get(1).getX() && 10==test_arr.get(1).getY()\n\t\t\t&& 5==test_arr.get(2).getX() && 10==test_arr.get(2).getY()\n\t\t\t&& 4==test_arr.get(3).getX() && 10==test_arr.get(3).getY()\n\t\t\t&& 3==test_arr.get(4).getX() && 10==test_arr.get(4).getY());\n\t}" ]
[ "0.5875086", "0.5793546", "0.57705677", "0.5741482", "0.5686251", "0.5664687", "0.56623083", "0.5644234", "0.56278884", "0.5609004", "0.5593016", "0.557779", "0.5570366", "0.5564616", "0.5549469", "0.5545953", "0.55438054", "0.55283296", "0.55030763", "0.5500704", "0.5499742", "0.5462628", "0.5446214", "0.5427141", "0.54160666", "0.54067004", "0.5384551", "0.5378956", "0.53782207", "0.53747606", "0.5364633", "0.5362859", "0.53607124", "0.53574926", "0.534327", "0.5308892", "0.53072745", "0.5294453", "0.52847505", "0.52804595", "0.5275151", "0.527019", "0.52685654", "0.52671546", "0.5264375", "0.5242166", "0.52401906", "0.52373797", "0.52339566", "0.52329254", "0.5218583", "0.521831", "0.52177924", "0.5212217", "0.52043617", "0.51925415", "0.5192515", "0.51869226", "0.5185956", "0.5177724", "0.51721185", "0.5171644", "0.5167774", "0.51639825", "0.5160225", "0.5156856", "0.51562786", "0.5147512", "0.51467097", "0.5142417", "0.5141444", "0.51395565", "0.51364446", "0.51363164", "0.51297647", "0.5129231", "0.5120304", "0.5118407", "0.51126647", "0.51004815", "0.5097397", "0.50962865", "0.5093091", "0.5077192", "0.50769806", "0.50727093", "0.5071869", "0.5068472", "0.5066126", "0.5058861", "0.50543976", "0.505438", "0.5052573", "0.50439394", "0.5043401", "0.504287", "0.50428087", "0.50334364", "0.5029638", "0.5022521" ]
0.54068726
25
ipadic String dictionaryPath = "/Users/johtani/tmp/dictionary/mecabipadic2.7.020070801"; UniDic 2.1.2
public static void main(String[] args) { String dictionaryPath = "/Users/johtani/tmp/dictionary/unidic-mecab-2.1.2_src"; // UniDic 2.3.0 //String dictionaryPath = "/Users/johtani/tmp/dictionary/unidic-cwj-2.3.0"; CsvParserSettings settings = new CsvParserSettings(); CsvFormat format = new CsvFormat(); format.setComment('\0'); settings.setFormat(format); CsvParser parser = new CsvParser(settings); try (DirectoryStream<Path> ds = Files.newDirectoryStream(Paths.get(dictionaryPath), "*.csv")){ for (Path file : ds) { checkFile(parser, file); } } catch (Exception e) { e.printStackTrace(); } System.out.println("Finished!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void loadDict() {\r\n try {\r\n FileInputStream inf = new FileInputStream(dictionary);\r\n char let;\r\n String str = \"\";\r\n int n = 0;\r\n while ((n = inf.read()) != -1) {\r\n let = (char) n;\r\n if (Character.isLetter(let)) {\r\n str += Character.toLowerCase(let);\r\n }\r\n if ((Character.isWhitespace(let) || let == '-') && !str.isEmpty()) { \r\n dictList[str.charAt(0) - 97].add(str);\r\n str = \"\";\r\n\r\n }\r\n\r\n }\r\n inf.close();\r\n\r\n } catch (IOException e) {\r\n\r\n e.printStackTrace();\r\n\r\n }\r\n }", "private void loadDictionary(String pathDictionary) throws IOException {\n File fileAnnotation = new File(pathDictionary);\n if (!fileAnnotation.exists()) {\n fileAnnotation.createNewFile();\n }\n FileReader fr;\n fr = new FileReader(fileAnnotation);\n BufferedReader br = new BufferedReader(fr);\n String line;\n while ((line = br.readLine()) != null) {\n String[] dic = line.split(\"[ \\t]\");\n String word = line.substring(line.indexOf(\" \") + 1);\n dictionaryTerms.put(word.toLowerCase(), dic[0]);\n System.out.println(\"Loading Dictionary Terms: Word: \" + word + \"\\tTag: \" + dic[0]);\n }\n br.close();\n fr.close();\n System.out.println(\"Dictionary Terms Loaded\");\n }", "MainDictionary ( String pathToFile ) {\n WordListReader reader = new WordListReader( pathToFile );\n List<String> wordList = reader.asLowerCaseList();\n \n this.dictionary = new HashSet<>( wordList );\n \n if ( this.dictionary.isEmpty() ) {\n LOGGER.warn( \"Main dictionary is empty\" );\n }\n }", "private final void loadDictionary(String path, long startOffset, long length) {\n \tLog.e(TAG, \"loadDictionary: path=\" + path);\n mNativeDict = openNative(path, startOffset, length, TYPED_LETTER_MULTIPLIER,\n FULL_WORD_SCORE_MULTIPLIER, MAX_WORD_LENGTH, MAX_WORDS, MAX_PREDICTIONS);\n }", "private void readDictionaryFile(InputStream dictionary, CharsetDecoder decoder) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(dictionary, decoder));\n // TODO: don't create millions of strings.\n String line = reader.readLine(); // first line is number of entries\n int numEntries = Integer.parseInt(line);\n \n // TODO: the flags themselves can be double-chars (long) or also numeric\n // either way the trick is to encode them as char... but they must be parsed differently\n while ((line = reader.readLine()) != null) {\n String entry;\n HunspellWord wordForm;\n \n int flagSep = line.lastIndexOf('/');\n if (flagSep == -1) {\n wordForm = NOFLAGS;\n entry = line;\n } else {\n // note, there can be comments (morph description) after a flag.\n // we should really look for any whitespace\n int end = line.indexOf('\\t', flagSep);\n if (end == -1)\n end = line.length();\n \n String flagPart = line.substring(flagSep + 1, end);\n if (aliasCount > 0) {\n flagPart = getAliasValue(Integer.parseInt(flagPart));\n } \n \n wordForm = new HunspellWord(flagParsingStrategy.parseFlags(flagPart));\n Arrays.sort(wordForm.getFlags());\n entry = line.substring(0, flagSep);\n if(ignoreCase) {\n entry = entry.toLowerCase(Locale.ENGLISH);\n }\n }\n \n List<HunspellWord> entries = words.get(entry);\n if (entries == null) {\n entries = new ArrayList<HunspellWord>();\n words.put(entry, entries);\n }\n entries.add(wordForm);\n }\n }", "public static void testDictionary() throws IOException {\n String wnhome=\"c:\\\\Users\\\\Katherine\\\\Documents\\\\2nd sem\\\\IR\\\\project\\\\WordNet_3.1\";\n String path = wnhome + File.separator + \"dict\";\n\n\n URL url = new URL(\"file\", null, path);\n\n IDictionary dictionary = new Dictionary(url);\n dictionary.open();\n // /Users/Ward/Downloads\n IIndexWord indexWord = dictionary.getIndexWord(\"use\", POS.VERB);\n\n for (IWordID wordID : indexWord.getWordIDs()) {\n\n IWord word = dictionary.getWord(wordID);\n for (IWord word1 : word.getSynset().getWords()) {\n System.out.println(word1.getLemma());\n }\n// System.out.println(\"Id = \" + wordID);\n// System.out.println(\" Lemma = \" + word.getLemma());\n// System.out.println(\" Gloss = \" + word.getSynset().getGloss());\n\n List<ISynsetID> hypernyms =\n word.getSynset().getRelatedSynsets(Pointer.HYPERNYM);\n // print out each h y p e r n y m s id and synonyms\n List<IWord> words;\n for (ISynsetID sid : hypernyms) {\n words = dictionary.getSynset(sid).getWords();\n System.out.print(sid + \" {\");\n for (Iterator<IWord> i = words.iterator(); i.hasNext(); ) {\n System.out.print(i.next().getLemma());\n if (i.hasNext())\n System.out.print(\", \");\n }\n System.out.println(\"}\");\n }\n }\n }", "public void loadDictionary() {\r\n\t\r\n\t\t\r\n\t\ttry {\r\n\t\t\r\n\t\t\tFileReader fr = new FileReader( \"rsc/English.txt\" );\r\n\t\t BufferedReader br = new BufferedReader(fr);\r\n\t \tString word ;\r\n\t \twhile (( word = br .readLine()) != null ) {\r\n\t\t// Aggiungere parola alla struttura dati\r\n\t \t\t\r\n\t \t\tthis.dictionary.add(word);\r\n\t \t\t\r\n\t\t}\r\n\t\tbr .close();\r\n\t\t} catch (IOException e ){\r\n\t\tSystem. out .println( \"Errore nella lettura del file\" );\r\n\t\t}\r\n\t\t\t\t\r\n\t\t\t\r\n\t try {\r\n\t\t\t\r\n\t\t\tFileReader fr = new FileReader( \"rsc/Italian.txt\" );\r\n\t\t BufferedReader br = new BufferedReader(fr);\r\n\t \tString word ;\r\n\t \twhile (( word = br .readLine()) != null ) {\r\n\t\t\t// Aggiungere parola alla struttura dati\r\n\t\t \t\t\r\n\t\t \t\tthis.dizionario.add(word);\r\n\t\t \t\t\r\n\t\t\t}\r\n\t\t\tbr .close();\r\n\t\t\t} catch (IOException e ){\r\n\t\t\tSystem. out .println( \"Errore nella lettura del file\" );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "public String getUserDictPath(String dataname, String username){\n String userdictpath = String.format(\"dicts/%s-%s.txt\", dictname, username);\n return userdictpath;\n }", "WordLadderSolver(String dictionaryFile) {\n \tdictionary = new Dictionary(dictionaryFile); //Set up the words from the file\n }", "public HashSet<String> createDictionary() {\r\n HashSet<String> dictionary = new HashSet<String>();\r\n AssetManager assetM = getActivity().getAssets(); // get asset manager to access dictionary file\r\n try {\r\n InputStream is = assetM.open(\"dictionary\");\r\n BufferedReader r = new BufferedReader(new InputStreamReader(is)); // read from input stream\r\n String line;\r\n while ((line = r.readLine()) != null) { // while line is not null\r\n if (line.length() >= 3) dictionary.add(line); // take only the 3 letter word\r\n }\r\n } catch (IOException e) {\r\n }\r\n return dictionary;\r\n }", "public static void readDictionary()\r\n\t{\r\n\t\t//It trys to read over the file using try-catch in case of an Exception\r\n\t\ttry {\r\n\t\t\tFile file = new File(\"english.0\");\r\n\t\t\tScanner scan = new Scanner(file);\r\n\t\t\t//It reads over the file as long as there are words to read and we insert them into the given storage\r\n\t\t\twhile(scan.hasNext()) {\r\n\t\t\t\tdata.insert(scan.next());\r\n\t\t\t}\r\n\t\t\tscan.close(); \r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"File not found\");\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n File f = new File(\"dict2.txt\");\n Scanner readFile = new Scanner(f);\n ArrayList<String> dictionary = new ArrayList<String>();\n \n while (readFile.hasNext()) {\n dictionary.add(readFile.next());\n }\n \n HangmanLogic logic = new HangmanLogic(dictionary);\n HangmanUserInterface game = new HangmanUserInterface(logic);\n game.start();\n }", "public void exportDictionary() \r\n\t{\t\r\n\t\tInputStream is = this.getClass().getResourceAsStream(\"/dictionary.sqlite\");\t\t\r\n\t\tOutputStream os = null;\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\tos = new FileOutputStream(fDictionaryFile());\r\n\t\t\tbyte[] buffer = new byte[1024];\r\n\t\t\tint length;\r\n\t\t\t\r\n\t\t\t//copy the file content in bytes \r\n\t\t\twhile ((length = is.read(buffer)) > 0) \r\n\t\t\t{\r\n\t\t\t\tos.write(buffer, 0, length);\r\n\t\t\t}\r\n\r\n\t\t\tis.close();\r\n\t\t\tos.close();\r\n\r\n\t\t\tSystem.out.println(\"/* Dictionary export successful! */\");\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}", "public MapDictionary(String dictionaryLocation) {\n\t\ttry {\n\t\t\tScanner dictionary = new Scanner(new FileReader(dictionaryLocation));\n\t\t\twhile(dictionary.hasNextLine()) {\n\t\t\t\tString word = dictionary.nextLine().toLowerCase();\n\t\t\t\tif(PredictivePrototype.isValidWord(word))\n\t\t\t\t\taddElement(word, PredictivePrototype.wordToSignature(word));\n\t\t\t}\n\t\t\tdictionary.close();\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\tSystem.out.print(\"Dictionary not found.\");\n\t\t}\n\t}", "private void createDictionary() throws IOException {\r\n long start = System.currentTimeMillis();\r\n\r\n dict = new PrefixTree(); //new prefix\r\n BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(\"/dictionary.csv\"))); //read the file\r\n\r\n String line;\r\n while ((line = reader.readLine()) != null) {\r\n //System.out.println(line);\r\n addToRoot(line); //for each line add it in dictionary\r\n }\r\n\r\n System.out.println(\"Time took for making Dictionary : \" + (System.currentTimeMillis() - start) + \" ms\");\r\n }", "public Dictionary() {\n\t\tthis.dictionary = new HashSet<String>();\n\t\ttry {\n\t\t\tthis.populateDictionary();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error: File not found, please try again with a valid filename.\");\n\t\t}\n\t}", "static void loadDictionary() throws IOException {\r\n URL oracle = new URL(urlEndPoint);\r\n BufferedReader br = new BufferedReader(new InputStreamReader(oracle.openStream()));\r\n\r\n String st;\r\n while ((st = br.readLine()) != null) {\r\n localDictionary.add(st);\r\n }\r\n }", "private void populateDictionary() {\n Scanner scanner = null;\n try {\n scanner = new Scanner(new FileInputStream(filePath));\n while(scanner.hasNextLine()) {\n String word = scanner.nextLine();\n rwDictionary.put(reducedWord(word), word);\n lcDictionary.put(word.toLowerCase(), word);\n }\n } catch(IOException e) {\n System.err.println(e.toString());\n e.printStackTrace();\n } finally {\n if(scanner != null) {\n scanner.close();\n }\n }\n }", "public boolean loadDictionary(String fileName) throws IOException;", "private void getDictionary(){\r\n // TODO: read Dictionary\r\n try{\r\n lstDictionary.clear();\r\n for(int i = 0; i < IConfig.LABEL_COUNT; i++){\r\n lstDictionary.add(new HashMap<>());\r\n DictionaryReader dictionaryReader = new DictionaryReader(lstDictionary.get(i), IConfig.DICTIONARY_URL[i]);\r\n dictionaryReader.read();\r\n }\r\n }catch (Exception e){\r\n e.printStackTrace();\r\n }\r\n }", "public Dictionary()\n\t\tthrows FileNotFoundException, IOException\n\t{\n\t\tthis(\"dictionary.txt\");\n\t}", "public MapDictionary(String filename) {\n\t\ttry {\n\t\t\tScanner scan = new Scanner(new File(filename));\n\t\t\t\n\t\t\t\twhile(scan.hasNextLine()) {\n\t\t\t\t\tString word = scan.nextLine().toLowerCase();\n\t\t\t\t\tString signature = PredictivePrototype.wordToSignature(word);\n\t\t\t\t\tSet <String> wordsSet = new HashSet<String>();\n\t\t\t\t\tif(PredictivePrototype.isValid(signature)==true && word.length() == signature.length()) {\n\t\t\t\t\t\twordsSet.add(word);\n\t\t\t\t\t\tif(dictionary.containsKey(signature)) {\n\t\t\t\t\t\t\tdictionary.get(signature).add(word);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tdictionary.put(signature, wordsSet);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tscan.close();\n\t\t\t\t\n\t\t} catch(IOException e){\n\t\t\tSystem.out.println(\"File not found\");\n\t\t}\n\t}", "public void populateDictionary() throws IOException {\n\t\tScanner scan = new Scanner(new File(\"dictionary.txt\"));\n\t\twhile(scan.hasNextLine()) {\n\t\t\tString curr = scan.nextLine().toLowerCase();\n\t\t\tthis.dictionary.add(curr);\n\t\t}\n\t}", "private void load(File dictionary) throws IOException {\n // open the file\n BufferedReader in = new BufferedReader(new FileReader(dictionary));\n \n // while file is readable\n while (in.ready()) {\n // get the next word in the file\n String s = in.readLine();\n // as long as the word is not just a new line character\n if (!s.equals(\"\\n\")) {\n // insert the word\n boolean noError = this.insert(s);\n // if there was an error in inserting the word\n if (!noError) {\n // print out the word\n System.out.println(s);\n // increment the number of errors found during load\n errors++;\n }\n // increment the size of the dictionary\n size++;\n }\n }\n \n // close the file\n in.close();\n }", "public static void buildDictionary() throws IOException {\n\t\t\n \tSystem.out.println(\"Loading dictionary...\");\n \t\n \tBufferedReader input = new BufferedReader( new FileReader(entities) );\n \tMapDictionary<String> dictionary = new MapDictionary<String>();\t\n \tString aux = null;\n \t\n\t\twhile ((aux=input.readLine())!=null) {\t\t\t\n\t\t\tif (aux.length()==0)\n\t\t\t\tcontinue;\n\n\t\t\taux.replaceAll(\"([A-Z])\",\" $1\").trim();\t\t\t\n\t\t\tdictionary.addEntry(new DictionaryEntry<String>(aux,aux,CHUNK_SCORE));\n\t \n\t\t}\n\t\t\n chunker = new ExactDictionaryChunker(dictionary,IndoEuropeanTokenizerFactory.INSTANCE,true,true);\n System.out.println(\"Dictionary contains \" + dictionary.size() + \" entries.\");\n }", "private static void loadDictionaryConfig()\r\n\t{\r\n\t\tURL dictionaryConfigURL = null;\r\n\t\ttry \r\n\t\t{\r\n\t\t\tBundle cfmlBundle = Platform.getBundle(CFMLPlugin.PLUGIN_ID);\r\n\t\t\tdictionaryConfigURL = org.eclipse.core.runtime.FileLocator.find(CFMLPlugin.getDefault().getBundle(),\r\n new Path(\"dictionary\"), null);\r\n\t\t\t\r\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r\n\t\t\tfactory.setIgnoringComments(true);\r\n\t\t\tfactory.setIgnoringElementContentWhitespace(true);\r\n\t\t\tfactory.setCoalescing(true);\r\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\r\n\t\t\t\r\n\t\t\tURL configurl = FileLocator.LocateURL(dictionaryConfigURL, \"dictionaryconfig.xml\");\r\n\t\t\t\t\t\t\r\n\t\t\tdictionaryConfig = builder.parse(configurl.getFile());\r\n\t\t\tif(dictionaryConfig == null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdictionaryConfig = builder.parse(\"jar:\"\r\n\t\t\t\t\t\t\t+ DictionaryManager.class.getClassLoader()\r\n\t\t\t\t\t\t\t\t\t.getResource(\"org.cfeclipse.cfml/dictionary/dictionaryconfig.xml\").getFile()\r\n\t\t\t\t\t\t\t\t\t.replace(\"dictionaryconfig.xml\", \"\"));\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tdictionaryConfig = builder.parse(\"jar:file:\" + DictionaryManager.class.getResource(\"/dictionaries.zip\").getFile()\r\n\t\t\t\t\t\t\t+ \"!/org.cfeclipse.cfml/dictionary/\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} \r\n\t\tcatch (Exception e) \r\n\t\t{\r\n\t\t\te.printStackTrace(System.err);\r\n\t\t}\r\n\t}", "private void writeToDictionary() throws IOException {\n\n File file = new File(filePathDictionaryAuto);\n\n if (file.delete()) {\n file.createNewFile();\n Enumeration e = dictionaryTerms.keys();\n while (e.hasMoreElements()) {\n String word = (String) e.nextElement();\n if (word.length() != 1) {\n writePrintStream(dictionaryTerms.get(word) + \" \" + word, filePathDictionaryAuto);\n }\n }\n } else {\n System.out.println(\"Error in dictionary file\");\n }\n System.out.println(\"Dictionary updated\");\n\n }", "private void dictionary(boolean updateDictionary) {\n try {\n loadDictionary(filePathDictionaryAuto);\n loadNonDictionaryTerms(filePathNonDictionaryAuto);\n if (updateDictionary) {\n upgradeDictionary();\n populateDictionary();\n writeToDictionary();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void init( String dictionaryFilePath) throws IOException {\n if(dictionaryFilePath == null || dictionaryFilePath.isEmpty()) {\n dictionaryFilePath = DEFAULT_DICTIONARY;\n log.warn(\"Using Default Dictionary\");\n }\n\n DICTIONARY = Files.readAllLines(Paths.get(dictionaryFilePath))\n .parallelStream()\n .map(line -> line.replaceAll(\"[^a-zA-Z ]\", \"\"))\n .map(Word::new)\n .collect(Collectors.toCollection(ConcurrentLinkedQueue::new));\n }", "public void loadDictionary(String direction) throws IOException, Exception {\n\t\tdictionary.loadDictionary(direction);\n\t}", "public void initDict(String filename, int max_length) {\n\t\tsetDictionary(new ArrayList<String>());\n\t\tFile f = new File(\"src/\" + filename);\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(f))) {\n\t\t\tString line;\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tif (line.length() < max_length) {\n\t\t\t\t\tgetDictionary().add(line.toLowerCase());\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Poop\");\n\t\t}\n\n\t\tfor (String word : getDictionary()) {\n\t\t\taddWord(word);\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\r\n\t\tDict dict = new Dict();\r\n\r\n\t\t// If there are no values, create some for testing\r\n\t\tif(DEBUG) {\r\n\t\t\tdict.add(\"carry\");\r\n\t\t\tdict.add(\"candy\");\r\n\t\t\tdict.add(\"dummy\");\r\n\t\t\tdict.store(PROPERTIES_FILE_NAME);\r\n\t\t}\r\n\r\n\t\t// Load initial values\r\n\t\tdict.load(PROPERTIES_FILE_NAME);\r\n\t\t\r\n\t\tfor(String word: new String[] {\"dandy\", \"diddly\", \"dancing\", \"domes\",\"cappy\"}) {\r\n\t\t\tSystem.out.printf(\"%s is %sin dict\\n\",word, dict.isUniqueDictionaryWord(word) ? \"\" : \"not \");\r\n\t\t}\r\n\t}", "public WordDictionary() {\n\t\tthis.checker = new SpellChecker();\n\n\t\t\ttry {\n\t\t\t\tReader reader = new InputStreamReader(WordDictionary.class.getResourceAsStream(\"/english.txt\"));\n\t\t\t\tthis.checker.initialize(reader);\n\t\t\t} catch (Exception exception) {\n\t\t\t\tSystem.err.println(\"Wrong path to dictionary file\");\n\t\t\t\texception.printStackTrace();\n\t\t\t}\n\t}", "public static void storeLookupDictionary(Context context, String deckPath, int dictionary) {\n openDBIfClosed(context);\n deckPath = stripQuotes(deckPath);\n Cursor cur = null;\n try {\n cur = mMetaDb.rawQuery(\"SELECT _id FROM customDictionary\" + \" WHERE deckpath = \\'\" + deckPath + \"\\'\", null);\n if (cur.moveToNext()) {\n mMetaDb.execSQL(\"UPDATE customDictionary \" + \"SET deckpath=\\'\" + deckPath + \"\\', \" + \"dictionary=\"\n + Integer.toString(dictionary) + \" \" + \"WHERE _id=\" + cur.getString(0) + \";\");\n Log.i(AnkiDroidApp.TAG, \"Store custom dictionary (\" + dictionary + \") for deck \" + deckPath);\n } else {\n mMetaDb.execSQL(\"INSERT INTO customDictionary (deckpath, dictionary) VALUES (?, ?)\", new Object[] {\n deckPath, dictionary });\n Log.i(AnkiDroidApp.TAG, \"Store custom dictionary (\" + dictionary + \") for deck \" + deckPath);\n }\n } catch (Exception e) {\n Log.e(\"Error\", \"Error storing custom dictionary to MetaDB \", e);\n } finally {\n if (cur != null && !cur.isClosed()) {\n cur.close();\n }\n }\n }", "private void loadDictWords(String dictFile) {\n try {\n BufferedReader reader = new BufferedReader(new FileReader(dictFile));\n\n String word = reader.readLine();\n while (word != null) {\n word = word.trim().toLowerCase();\n wordsList.add(word);\n\n word = reader.readLine();\n }\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"Error: Cannot find dictionary file at location: \" + dictFile);\n } catch (IOException e) {\n System.out.println(\"Error: Failed to open and read dictionary file at location: \" + dictFile);\n }\n }", "public static void main(String[] args)\n\t\tthrows FileNotFoundException, IOException\n\t{\n \t\tPrintWriter test = new PrintWriter(new FileWriter(\"DictionaryTESTING.txt\"));\n \t\t\n \t\ttest.println(\"Dictionary TESTING\");\n \t\t\n\t\ttest.println();\n\t\ttest.println(\"noParam = new Dictionary()\");\n\t\tDictionary noParam = new Dictionary();\n\t\t\n\t\ttest.println(\"fileParam = new Dictionary('mywords.txt')\");\n\t\tDictionary fileParam = new Dictionary(\"mywords.txt\");\n\n\t\ttest.println();\n\t\ttest.println(\"mywords.txt contains select words in the form of a dictionary, i.e.\");\n\t\ttest.println(\"a\");\n\t\ttest.println(\"an\");\n\t\ttest.println(\"apple\");\n\t\ttest.println(\"banana\");\n\t\ttest.println(\"boy\");\n\t\ttest.println(\"can\");\n\t\ttest.println(\"cat\");\n\t\ttest.println(\"etc.\");\n\t\t\n\t\ttest.println();\n\t\ttest.println(\"noParam.getLongestWordLength('aunt') :\" + noParam.getLongestWordLength(\"aunt\"));\n\t\ttest.println(\"fileParam.getLongestWordLength('zoo') :\" + fileParam.getLongestWordLength(\"but\"));\n\t\ttest.println(\"noParam.getLongestWordLength('rid') :\" + noParam.getLongestWordLength(\"rid\"));\n\t\ttest.println(\"fileParam.getLongestWordLength('300') :\" + fileParam.getLongestWordLength(\"300\"));\n\t\t\n\t\ttest.println();\n\t\ttest.println(\"noParam.wordExists('apple') :\" + noParam.wordExists(\"apple\"));\n\t\ttest.println(\"fileParam.wordExists('zoo') :\" + fileParam.wordExists(\"zoo\"));\n\t\ttest.println(\"noParam.wordExists('rid') :\" + noParam.wordExists(\"rid\"));\n\t\t\n\t\ttest.println(\"fileParam.wordExists('alabama') :\" + fileParam.wordExists(\"alabama\"));\n\t\ttest.println(\"noParam.wordExists('zen') :\" + noParam.wordExists(\"zen\"));\n\t\ttest.println(\"fileParam.wordExists('randolf') :\" + fileParam.wordExists(\"randolf\"));\n\t\ttest.println(\"noParam.wordExists('300') :\" + noParam.wordExists(\"300\"));\n\t\t\n\t\ttest.println();\n\t\ttest.println(\"noParam.toString() :\" + noParam.toString());\n\t\ttest.println(\"fileParam.toString() :\" + fileParam.toString());\n\n\t\ttest.close();\t\t\n\t}", "public void checkDictionary (String[] target) {\n try {\n File f = new File(\"cmudict.0.7a\");\n BufferedReader br = new BufferedReader(new FileReader(f));\n String[][] data;\n Double result;\n for (String line; (line = br.readLine()) != null; ) {\n if (!line.matches(\"^[A-Za-z].*\")) {\n continue;\n }\n data = readDictionary(line);\n result = compareWords(target, data[1]);\n try {\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"results.txt\", true)));\n out.print(result);\n out.println(\" \" + data[0][0]); // prints the word\n out.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void doDictionaryEditMode(String[] args) throws FileNotFoundException {\r\n\t\tif (args.length == 0) {\r\n\t\t\tdoUsage();\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t\tString testDictionary = args[1];\r\n\t\tFile f = new File(testDictionary);\r\n\t\tString name = f.getName();\r\n\t\tString newname = name + \"~\";\r\n\t\tFile newFile = new File(newname);\r\n\r\n\t\tDictionary dic;\r\n\t\ttry {\r\n\t\t\tdic = new Dictionary(testDictionary);\r\n\t\t\tBinarySearchTree<Entry> oldtree = dic.getBST();\r\n\t\t\tDictionary olddic = new Dictionary(oldtree);\r\n\t\t\tSystem.out.println(\"Editing dictionary.txt\");\r\n\t\t\tSystem.out.printf(\"Word: \");\r\n\t\t\tScanner in = new Scanner(System.in);\r\n\t\t\tString input = in.next();\r\n\t\t\toutloop:\r\n\t\t\t// the case to exit the program\r\n\t\t\twhile (!input.equals(\"!quit\")) {\r\n\t\t\t\t// check whether the input is valid\r\n\t\t\t\tif (!isValidWord(input)) {\r\n\t\t\t\t\tSystem.out.println(\"'\" + input + \"'\" + \" is not valid. Please enter a valid word\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (dic.hasWord(input)) {\r\n\t\t\t\t\t\tSystem.out.println(\"'\" + input + \"'\" + \"was found\");\r\n\t\t\t\t\t\tSystem.out.printf(\"[r]emove/[g]et the definition/[c]hange definition/do [n]othing: \");\r\n\t\t\t\t\t\tScanner in2 = new Scanner(System.in);\r\n\t\t\t\t\t\tString input2 = in2.next();\r\n\t\t\t\t\t\t// the case of get definition\r\n\t\t\t\t\t\tif (input2.equals(\"g\")) {\r\n\t\t\t\t\t\t\tif (dic.getDefinitionOf(input) == null)\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"<undefined>\");\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tSystem.out.println(dic.getDefinitionOf(input));\r\n\t\t\t\t\t\t\t// the case of change definition\r\n\t\t\t\t\t\t} else if (input2.equals(\"c\")) {\r\n\t\t\t\t\t\t\tScanner in3 = new Scanner(System.in);\r\n\t\t\t\t\t\t\tSystem.out.printf(\"Definition: \");\r\n\t\t\t\t\t\t\tin3.useDelimiter(\"\\n\");\r\n\t\t\t\t\t\t\tString input3 = in3.next();\r\n\r\n\t\t\t\t\t\t\t// in3.close();\r\n\t\t\t\t\t\t\tdic.updateEntry(input, input3);\r\n\t\t\t\t\t\t\t// the case of remove the word\r\n\t\t\t\t\t\t} else if (input2.equals(\"r\")) {\r\n\t\t\t\t\t\t\tdic.removeEntry(input);\r\n\t\t\t\t\t\t} else if (input2.equals(\"n\")) {\r\n\t\t\t\t\t\t\t// do nothing\r\n\t\t\t\t\t\t} else if (input2.equals(\"!quit\"))\r\n\t\t\t\t\t\t\tbreak outloop;\r\n\t\t\t\t\t\t// if the input is not in dictionary\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.out.println(\"'\" + input + \"'\" + \"not found\");\r\n\t\t\t\t\t\tSystem.out.printf(\"[a]dd/add with [d]efinition/[n]othing: \");\r\n\t\t\t\t\t\tScanner in4 = new Scanner(System.in);\r\n\t\t\t\t\t\tString input4 = in4.next();\r\n\t\t\t\t\t\t// the case of add new word\r\n\t\t\t\t\t\tif (input4.equals(\"a\"))\r\n\t\t\t\t\t\t\tdic.addEntry(input);\r\n\t\t\t\t\t\t// the case of get definition\r\n\t\t\t\t\t\telse if (input4.equals(\"d\")) {\r\n\t\t\t\t\t\t\tSystem.out.printf(\"Definition: \");\r\n\t\t\t\t\t\t\tScanner in5 = new Scanner(System.in);\r\n\t\t\t\t\t\t\tString input5 = in5.next();\r\n\t\t\t\t\t\t\tdic.addEntry(input4, input5);\r\n\t\t\t\t\t\t\t// the case of doing nothing\r\n\t\t\t\t\t\t} else if (input4.equals(\"n\")) {\r\n\t\t\t\t\t\t} else if (input4.equals(\"!quit\"))\r\n\t\t\t\t\t\t\tbreak outloop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.printf(\"Word: \");\r\n\t\t\t\tinput = in.next();\r\n\t\t\t}\r\n\t\t\tin.close();\r\n\t\t\t// update in the new File and add~ into the old File\r\n\t\t\tolddic.printToFile(newFile.getName());\r\n\t\t\tdic.printToFile(testDictionary);\r\n\t\t\tSystem.exit(0);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "public Dictionary() throws IOException {\r\n\t\tthis(FILE_NAME);\r\n\t}", "private Map<String, String> getDirectory() {\n return new HashMap<>() {{\n put(\"Moran Lin\", \"1111111111\"); // 546*6*\n put(\"Ming Kho\", \"2222222222\"); // 546*6*\n put(\"Sam Haboush\", \"3333333333\"); // 4226874*7*\n put(\"Heidi Haboush\", \"4444444444\"); // 4226874*4*\n put(\"Hakeem Haboush\", \"5555555555\"); // 4226874*4*\n put(\"Amanda Holden\", \"6666666666\"); // 465336*2*\n put(\"Megan Fox\", \"7777777777\"); // 369*6*\n put(\"Kate Moss\", \"8888888888\"); // 6677*5*\n put(\"Sarah Louche\", \"9999999999\"); // 568243*7*\n put(\"Cameron Diaz\", \"0000000000\"); // 3429*2*\n// put(\"Heidi Klum\", \"1212121212\"); // 5586*4* doesn't exist in dictionary\n }};\n }", "public static void main(String [] args){\n\t\t String zipFilePath = args[1];\n\t\t //Directory of unzip Files\n\t\t String destDir = \"Dictionary\";\n\t\t //Calling a functions 5to unzip the directory\n\t\t unzip(zipFilePath, destDir);\n\t\t \n\n\t\t// The name of the file to open. File to be passed from arguments\n String fileName = args[0];\t\t\n\n // This will reference one line at a time\n String line = null;\n\n try {\n // FileReader reads text files in the default encoding.\n FileReader fileReader = \n new FileReader(fileName);\n\n // Always wrap FileReader in BufferedReader.\n BufferedReader bufferedReader = \n new BufferedReader(fileReader);\n\t\t\t\tint count = 0;\t\t\t\t\t\t//For counting how many words are wrong\n while((line = bufferedReader.readLine()) != null) {\n String[] words = line.split(\"\\\\W\");\t\t\t\t//Keeps the words in a line the the array \n int len = words.length;\n for(int i=0;i<len;i++){\n \t//System.out.println(words[i]);\n \tint flag = 0; \t\t\t\t//Just to check whether the words present or not\n \t//System.out.println(\"HI I am reading the file.\");\n \tFile folder = new File(\"Dictionary/dictionaries\");\n\t\t\t\t\tFile[] listOfFiles = folder.listFiles();\n\t\t\t\t\t//System.out.println(listOfFiles.length);\n\t\t\t\t\tfor (int i1 = 0; i1 < listOfFiles.length; i1++) {\n\t\t\t\t\t\tif(flag == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t File file = listOfFiles[i1];\n\t\t\t\t\t if (file.isFile()) {\n\t\t\t\t\t\t//I am checking\n\t\t\t\t\t\t // The name of the file to open.\n //String fileName1 = file;\n\n // This will reference one line at a time\n //String line1 = null;\n\t\t\tScanner myScanner = null;\t\t\t\t//Using Scanner Class to Read the words From file\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tmyScanner = new Scanner(file);\n\t\t\t\t\twhile(myScanner.hasNextLine()){\n \t\t\t\t\tif(flag==1){\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\tString contents=myScanner.nextLine();\n \t\t\t\t\t//...\n\t\t\t\t\t\tif(words[i].equalsIgnoreCase(contents)){\n\t\t\t\t\t\t//System.out.println(\"The given word is \" + words[i]);\n\t\t\t\t\t\tflag = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//String contents = myScanner.nextLine();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\tif(myScanner != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tmyScanner.close(); \n\t\t\t\t\t}\n\t\t\t\t}\n \n\t\t\t\t\t } \n\t\t\t\t\t}\n\t\t\t\t\tif(flag==0){\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\tSystem.out.println(\"The wrong word is \" + words[i]);\n\t\t\t\t\t\t//System.out.println(i+1);\n\t\t\t\t\t}\n }\n //System.out.println(line);\n } \n\n // Always close files.\n bufferedReader.close(); \n System.out.println(\"The total number of wrong words are \");\n System.out.println(count);\n \n }\n catch(FileNotFoundException ex) {\n System.out.println(\n \"Unable to open file '\" + \n fileName + \"'\"); \n }\n catch(IOException ex) {\n System.out.println(\n \"Error reading file '\" \n + fileName + \"'\"); \n // Or we could just do this: \n // ex.printStackTrace();\n }\n \t}", "public static void loadDictionary() throws Exception {\n\t\t// Check whether database has associated dictionary\n\t\tif (CatalogManager.currentDB.compressed) {\n\t\t\tSystem.out.println(\"Loading dictionary ...\");\n\t\t\tlong startMillis = System.currentTimeMillis();\n\t\t\tString dictionaryPath = PathUtil.dictionaryPath;\n\t\t\tObject object = DiskUtil.loadObject(dictionaryPath);\n\t\t\tdictionary = (Dictionary)object;\n\t\t\tlong totalMillis = System.currentTimeMillis() - startMillis;\n\t\t\tSystem.out.println(\"Loaded dictionary in \" + totalMillis + \" ms.\");\t\n\t\t\t// Generate debugging output\n\t\t\tlog(\"*** String dictionary sample ***\");\n\t\t\tint sampleSize = Math.min(10, dictionary.strings.length);\n\t\t\tfor (int i=0; i<sampleSize; ++i) {\n\t\t\t\tlog(i + \"\\t\" + dictionary.getString(i));\n\t\t\t}\n\t\t\tlog(\"******\");\n\t\t} else {\n\t\t\tSystem.out.println(\"No data dictionary found.\");\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n Dictionary d = new Dictionary(\"whatevs\", \"/home/mayhew/IdeaProjects/ner-annotation/bendict.txt\", \"testuser\");\n }", "void init(int dictionarySize) throws IOException;", "public GameModel(String dict){\n try {\n dictionaryFile = new File(dict);\n this.phraseBook = GameDictionaryReader.readDictionary(dictionaryFile);\n } catch(FileNotFoundException e){\n System.out.println(\"ERROR: Not a valid dictionary file! (`\" + dictionaryFile.toString() + \"`)\");\n System.exit(1);\n }\n }", "public Dictionary(String path, Random r)\n {\t\n \talea= r;\n \tgenerateAlphabet();\n generateLetters();\n \n try{\n sc= new Scanner( new FileReader(path) );\n }\n catch( FileNotFoundException e ){\n System.err.println(\"Error 404: File \\\"\"+ path + \"\\\" not Found !\");\n }\n \n tree= new AlphaTree( alphabet );\n \n generateTree();\n }", "public ArrayList<String> createWordBank() {\r\n ArrayList<String> wordBank = new ArrayList<String>();\r\n AssetManager assetM = getActivity().getAssets(); // get asset manager to access dictionary file\r\n try {\r\n InputStream is = assetM.open(\"dictionary\"); // open input stream to read dictionary\r\n BufferedReader r = new BufferedReader(new InputStreamReader(is)); // read from input stream\r\n String line;\r\n while ((line = r.readLine()) != null) { // while line is not null\r\n if (line.length() == 9) wordBank.add(line); // take only the 9 letter words\r\n }\r\n } catch (IOException e) {\r\n }\r\n return wordBank;\r\n }", "public void saveDictionaryToFile() {\n\t\tdictionary.saveDictionary();\n\t}", "public static void main(String[] args) {\n\n String dict = \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/dictionary-yawl.txt\";\n String[] boardPaths = new String[]{\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points0.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points100.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1000.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1111.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1250.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points13464.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1500.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points2.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points200.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points2000.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points26539.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points3.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points300.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points4.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points400.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points4410.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points4527.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points4540.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points5.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points500.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points750.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points777.txt\",\n };\n // String dict = \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/dictionary-common.txt\";\n // String[] boardPaths = new String[]{\n // \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-random1.txt\",\n // };\n In in = new In(dict);\n String[] dictionary = in.readAllStrings();\n BoggleSolver solver = new BoggleSolver(dictionary);\n\n int[] scores = new int[boardPaths.length];\n int[] counts = new int[boardPaths.length];\n for (int i = 0; i < boardPaths.length; i++) {\n BoggleBoard board = new BoggleBoard(boardPaths[i]);\n for (String word : solver.getAllValidWords(board)) {\n counts[i]++;\n StdOut.print(word + \", \");\n scores[i] += solver.scoreOf(word);\n }\n StdOut.println(\"\\n************************\\n\");\n }\n\n for (int i = 0; i < boardPaths.length; i++) {\n StdOut.println(boardPaths[i]);\n StdOut.println(\"Count: \" + counts[i]);\n StdOut.println(\"Score = \" + scores[i]);\n }\n }", "public void createDictionary() \n {\n dictionary = new HashMap<String, Map<String, String>>();\n \n addTranslations(\n \"EN\", // Language code\n \"OK\", \"Ok\",\n \"UPDATE\", \"Update\",\n \"OPEN\", \"Open\",\n \"CLOSE\", \"Close\",\n \"CANCEL\", \"Cancel\",\n \"MESSAGES\", \"Messages\",\n \"NO_MESSAGES_TO_DISPLAY\", \"No messages to display\",\n \"EVALUATE\", \"Evaluate\",\n \"RUN\", \"Run\",\n \"RUN_AS_ACTIVITY\", \"Run Activity\",\n \"OPEN_SCRIPT\", \"Open script\",\n \"START_SERVER\", \"Start server\",\n \"STOP_SERVER\", \"Stop server\",\n \"SHOW_MESSAGES\", \"Messages\",\n \"UPDATE_APP_SCRIPTS\", \"Update\",\n \"THIS_WILL_OVERWRITE_ALL_APP_SCRIPTS\", \"This will overwrite all application scripts!\",\n \"ENTER_FILE_OR_URL\", \"Enter file or url:\",\n \"UPDATE_APP_SCRIPTS_DONE\", \"Update complete!\",\n \"UPDATE_APP_SCRIPTS_DONE_RESTART\", \"Restart the application to make changes take effect\",\n \"QUIT_APP\", \"Quit\",\n \"CLOSE\", \"Close\",\n \"BE_KIND\", \"Be kind\",\n \"BE_KIND_MESSAGE\", \"Be a kind person\"\n );\n }", "public static HashMap<String, Map<String, String>> validateAdiOSConsole(String path) throws IOException {\n\t\tMap<String, String> addynamicValuesMap = new HashMap<String, String>();\r\n\t\tMap<String, String> dynamicValuesMap = new HashMap<String, String>();\r\n\t\tString s = \"\";\r\n\t\tString adString;\r\n\t\tString separator;\r\n\t\tString adSeparator;\r\n\t\tString adTypeSeparator;\r\n\t\tString preRolladName;\r\n\t\tString midRolladName;\r\n\t\tint noOfAds;\r\n\t\tBufferedReader in = new BufferedReader(new FileReader(path));\r\n\t\tStringBuffer str = new StringBuffer();\r\n\t\tString line;\r\n\t\twhile ((line = in.readLine()) != null) {\r\n\t\t\tstr.append(\" \");\r\n\t\t\tstr.append(line);\r\n\t\t}\r\n\t\tin.close();\r\n\t\tString st = str.toString();\r\n\t\tSystem.out.println(st);\r\n\t\tif (platformName.equalsIgnoreCase(\"iOS\")) {\r\n\t\t\tadString = \"CPAdObserver CPAdObserverAdBreakInstance\";\r\n\t\t\tseparator = \";\";\r\n\t\t\tadSeparator = \"CPAdIdKey =\";\r\n\t\t\tadTypeSeparator = \"CPBreakTypeKey\";\r\n\t\t\tpreRolladName = \"pre-roll\";\r\n\t\t\tmidRolladName = \"mid-roll\";\r\n\t\t\t// System.out.println(st);\r\n\t\t\tString[] adpart = st.split(\"CPAdPositionsKey =\");\r\n\t\t\tString adpart1 = adpart[1].substring(0, adpart[1].indexOf(\";\"));\r\n\t\t\tint j = 1;\r\n\t\t\tfor (int i = 0; i < adpart1.length(); i++) {\r\n\t\t\t\tif (adpart1.charAt(i) == ',') {\r\n\t\t\t\t\tj++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Total Number of AdPod = \" + (j));\r\n\t\t\ttest.log(LogStatus.INFO, \"Total Number of AdPod = \" + (j));\r\n\t\t} else {\r\n\t\t\tadString = \"CPAdObserver : CPAdObserverAdBreakInstance\";\r\n\t\t\tseparator = \",\";\r\n\t\t\tadSeparator = \"CPAdIdKey=\";\r\n\t\t\tadTypeSeparator = \"CPAdBreakTypeKey\";\r\n\t\t\tpreRolladName = \"preroll\";\r\n\t\t\tmidRolladName = \"midRoll\";\r\n\t\t}\r\n\t\ttest.log(LogStatus.INFO, \"===================Ad Details From Console=============\");\r\n\t\tString[] adpartText = st.split(adString);\r\n\t\tSystem.out.println(\"===================Ad Details=============\");\r\n\t\t// System.out.println(\"CPAdObserverAdBreak\"\r\n\t\t// + adpartText[2].split(\"CPAdObserver\r\n\t\t// CPAdObserverAdBreakInstanceEnded\")[0]\r\n\t\t// + \"CPAdObserver CPAdObserverAdBreakInstanceEnded\");\r\n\t\tArrayList<String> adTypes = new ArrayList<>(); // preRoll1,....,midRoll1,midRoll2,....\r\n\t\tHashMap<String, String> dataMap;\r\n\t\tHashMap<String, Map<String, String>> adsMap = new HashMap<>();\r\n\t\tint preRollcount = 1;\r\n\t\tint midCount = 1;\r\n\t\tfor (int i = 1; i < adpartText.length; i++) {\r\n\t\t\tif (adpartText[i].contains(adSeparator)) {\r\n\t\t\t\tdataMap = new HashMap<>();\r\n\t\t\t\tString indAdData = adpartText[i].replaceAll(\"\\\\{\", \"\").trim();\r\n\t\t\t\tString finalData = indAdData.split(\"}\")[0];\r\n\t\t\t\tString[] data = finalData.split(separator);\r\n\t\t\t\tif (platformName.equalsIgnoreCase(\"iOS\")) {\r\n\t\t\t\t\tnoOfAds = data.length - 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tnoOfAds = data.length;\r\n\t\t\t\t}\r\n\t\t\t\tfor (int temp = 0; temp < noOfAds; temp++) {\r\n\t\t\t\t\tString[] keyValues = data[temp].split(\"=\");\r\n\t\t\t\t\tString key = keyValues[0].trim();\r\n\t\t\t\t\tString value = keyValues[1].trim();\r\n\t\t\t\t\ttest.log(LogStatus.INFO, key + \":\" + value);\r\n\t\t\t\t\tif (key.equalsIgnoreCase(\"CPAdIdKey\")) {\r\n\t\t\t\t\t\tdataMap.put(\"s:asset:ad_id\", value);\r\n\t\t\t\t\t} else if (key.equalsIgnoreCase(\"CPAdDurationKey\")) {\r\n\t\t\t\t\t\tdataMap.put(\"l:asset:ad_length\", value);\r\n\t\t\t\t\t} else if (key.equalsIgnoreCase(\"CPAdIndexKey\")) {\r\n\t\t\t\t\t\tdataMap.put(\"s:asset:pod_position\", value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (key.equalsIgnoreCase(adTypeSeparator)) {\r\n\t\t\t\t\t\tif (value.contains(\"Preroll\")) {\r\n\t\t\t\t\t\t\tadTypes.add(\"Preroll\" + preRollcount);\r\n\t\t\t\t\t\t\tdataMap.put(\"s:asset:pod_name\", preRolladName);\r\n\t\t\t\t\t\t\tpreRollcount++;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tadTypes.add(\"Midroll\" + midCount);\r\n\t\t\t\t\t\t\tdataMap.put(\"s:asset:pod_name\", midRolladName);\r\n\t\t\t\t\t\t\tmidCount++;\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\ttest.log(LogStatus.INFO, \"*************************************\");\r\n\t\t\t\tfor (String dynKey : dynamicValuesMap.keySet()) {\r\n\t\t\t\t\tdataMap.put(dynKey, dynamicValuesMap.get(dynKey));\r\n\t\t\t\t}\r\n\t\t\t\tadsMap.put(adTypes.get(adTypes.size() - 1), dataMap);\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(adsMap);\r\n\t\treturn adsMap;\r\n\t}", "public SpellChecker(String path) {\n filePath = path;\n rwDictionary = new HashMap<String, String>();\n lcDictionary = new HashMap<String, String>();\n populateDictionary();\n }", "private void populateDictionary() throws IOException {\n populateDictionaryByLemmatizer();\n// populateDictionaryBySynonyms();\n }", "public static void main(String[] args) throws FileNotFoundException {\n\t\tString newline = System.lineSeparator();\n\t\tFileReader fr = new FileReader(\"dictonary_english_special.txt\");\n\t\tBufferedReader br = new BufferedReader(fr);\n\t\tString holder = \"\";\n\t\tString temp;\n\t\twhile(true){\n\t\t\ttry {\n\t\t\t\ttemp = br.readLine();\n\t\t\t\tif(temp == null)\n\t\t\t\t\tbreak;\n\t\t\t\tif(temp.length() < 4)\n\t\t\t\t\tcontinue;\n\t\t\t\t//System.out.println(temp);\n\t\t\t\tholder += temp + newline;\n\t\t\t} catch (IOException e) {break;}\n\t\t}\n\t\t\tFileWriter fw;\n\t\t\ttry {\n\t\t\t\tfw = new FileWriter(\"dictonary_english_hangman.txt\");\n\t\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\t\tbw.write(holder);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Done!\");\n\t}", "public Dictionary(String filename) throws IOException {\r\n\t\tFile dFile = new File(filename);\r\n\t\tFileReader fr = new FileReader(dFile);\r\n\t\tnew BufferedReader(fr).lines().forEach(e -> dict.add(e));\r\n\t\tfr.close();\r\n\t}", "public static void doInteractiveMode(String[] args) throws FileNotFoundException {\r\n\t\tString dictionaryFile = args[0];\r\n\t\tString filename = args[1];\r\n\t\t// create file for original file\r\n\t\tFile newFile = new File(dictionaryFile);\r\n\t\tString name = newFile.getName();\r\n\t\tString newname = name + \"~\";\r\n\r\n\t\tDictionary dic = new Dictionary(dictionaryFile);\r\n\r\n\t\t// deep copy of binary search tree\r\n\t\tBinarySearchTree<Entry> oldtree = dic.getBST();\r\n\t\tDictionary olddic = new Dictionary(oldtree);\r\n\r\n\t\ttry {\r\n\t\t\tFile f = new File(filename);\r\n\t\t\tScanner in = new Scanner(f);\r\n\t\t\t// scan each line\r\n\t\t\twhile (in.hasNextLine()) {\r\n\t\t\t\tString sentence = in.nextLine();\r\n\t\t\t\tString[] words = sentence.split(\" \");\r\n\t\t\t\t// transform string[] into ArrayList\r\n\t\t\t\tArrayList<String> al = new ArrayList<String>(Arrays.asList(words));// string\r\n\r\n\t\t\t\tint errWordNum = 1;\r\n\t\t\t\tSystem.out.println(sentence);\r\n\t\t\t\twhile (errWordNum != 0) {\r\n\t\t\t\t\terrWordNum = 0;\r\n\t\t\t\t\tArrayList<String> errWord = new ArrayList<String>();\r\n\t\t\t\t\tArrayList<Integer> errInd = new ArrayList<Integer>();\r\n\t\t\t\t\t// copy the old misspelling word\r\n\t\t\t\t\tfor (int i = 0; i < al.size(); i++) {\r\n\t\t\t\t\t\t// the case of punctuation\r\n\t\t\t\t\t\tif (!dic.hasWord(al.get(i).replaceAll(\"[^a-zA-Z ]\", \"\"))) {\r\n\t\t\t\t\t\t\terrWordNum += 1;\r\n\t\t\t\t\t\t\terrWord.add(al.get(i));\r\n\t\t\t\t\t\t\terrInd.add(i);\r\n\t\t\t\t\t\t\tfor (int j = 0; j < al.get(i).length(); j++) {\r\n\t\t\t\t\t\t\t\tif (j == 0) {\r\n\t\t\t\t\t\t\t\t\tSystem.out.print(\"^\");\r\n\t\t\t\t\t\t\t\t} else\r\n\t\t\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (i != al.size() - 1)\r\n\t\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tfor (int j = 0; j < al.get(i).length(); j++) {\r\n\t\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (i != al.size() - 1) {\r\n\t\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tSystem.out.println();\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// if arrayList still has misspelling words\r\n\t\t\t\t\tif (errWordNum != 0) {\r\n\t\t\t\t\t\tSystem.out.print(errWord.get(0) + \": \");\r\n\t\t\t\t\t\tSystem.out.print(\"[r]eplace/[a]ccept? \");\r\n\t\t\t\t\t\tScanner in2 = new Scanner(System.in);\r\n\t\t\t\t\t\tString input2 = in2.next();\r\n\t\t\t\t\t\t// the case of replacement\r\n\t\t\t\t\t\tif (input2.equals(\"r\")) {\r\n\t\t\t\t\t\t\tSystem.out.print(\"Replacement text: \");\r\n\t\t\t\t\t\t\tScanner in3 = new Scanner(System.in);\r\n\t\t\t\t\t\t\tString input3 = in3.next();\r\n\t\t\t\t\t\t\tal.set(errInd.get(0), input3);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// the case of acceptance\r\n\t\t\t\t\t\tif (input2.equals(\"a\")) {\r\n\t\t\t\t\t\t\tdic.addEntry(errWord.get(0));\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfor (int i = 0; i < al.size(); i++) {\r\n\t\t\t\t\t\t\tif (i != al.size() - 1)\r\n\t\t\t\t\t\t\t\tSystem.out.print(al.get(i) + \" \");\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tSystem.out.println(al.get(i));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!input2.equals(\"r\"))\r\n\t\t\t\t\t\t\terrWordNum--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tin.close();\r\n\t\t\t// keep the original file with ~\r\n\t\t\tolddic.printToFile(newname);\r\n\t\t\t// update the change in the new file\r\n\t\t\tdic.printToFile(dictionaryFile);\r\n\t\t\tSystem.exit(0);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"check the existance of filename again\");\r\n\t\t}\r\n\r\n\t}", "public static void initDictionaries()\r\n\t{\r\n\t\t\r\n\t\tString cfdictversion = getInitialDictVersion();\r\n\t\t\r\n\t\t//long time = System.currentTimeMillis();\r\n\t\t//System.out.println(\"Dictionaries initialized start\");\r\n\t\t\r\n\t\t\r\n\t\t//get the dictionary config file into a DOM\r\n\t\tloadDictionaryConfig();\r\n\t\tif(dictionaryConfig == null)\r\n\t\t\tthrow new IllegalArgumentException(\"Problem loading dictionaryconfig.xml\");\r\n\t\t\r\n\t\t//load the default dictionaries into the cache\r\n\t\t//this is kind of weak but it'll do pig... it'll do...\r\n\t\tif (cfdictversion.trim().length() == 0) {\r\n\t\t\tcfdictversion = getFirstVersion(CFDIC);\r\n\t\t}\r\n\t\tString htdictversion = getFirstVersion(HTDIC);\r\n\t\tString jsdictversion = getFirstVersion(JSDIC);\r\n\t\t\r\n\t\t\r\n\t\t//load the dictionary into the cache\r\n\t\tloadDictionaryByVersion(cfdictversion);\r\n\t\tloadDictionaryByVersion(htdictversion);\r\n\t\tloadDictionaryByVersion(jsdictversion);\r\n\t\t\r\n\t\t//load from the cache to the live\r\n\t\tloadDictionaryFromCache(cfdictversion,CFDIC);\r\n\t\tloadDictionaryFromCache(cfdictversion,SQLDIC);\r\n\t\tloadDictionaryFromCache(htdictversion,HTDIC);\r\n\t\tloadDictionaryFromCache(jsdictversion,JSDIC);\r\n\t\t\t\t\r\n\t\t//System.out.println(\"Dictionaries initialized in \" + (System.currentTimeMillis() - time) + \" ms\");\r\n\t}", "private void upgradeDictionary() throws IOException {\n File fileAnnotation = new File(filePathAnnSource);\n FileReader fr = new FileReader(fileAnnotation);\n BufferedReader br = new BufferedReader(fr);\n String line;\n\n if (fileAnnotation.exists()) {\n while ((line = br.readLine()) != null) {\n String[] annotations = line.split(\"[ \\t]\");\n String word = line.substring(line.lastIndexOf(\"\\t\") + 1);\n\n if (!nonDictionaryTerms.contains(word.toLowerCase())) {\n if (dictionaryTerms.containsKey(word.toLowerCase())) {\n if (!dictionaryTerms.get(word.toLowerCase()).equalsIgnoreCase(annotations[1])) {\n System.out.println(\"Conflict: word:: \" + word + \" Dictionary Tag: \" + dictionaryTerms.get(word.toLowerCase()) + \" New Tag: \" + annotations[1]);\n nonDictionaryTerms.add(word.toLowerCase());\n// removeLineFile(dictionaryTerms.get(word.toLowerCase())+\" \"+word.toLowerCase(),filePathDictionaryAuto);\n dictionaryTerms.remove(word.toLowerCase());\n writePrintStream(word, filePathNonDictionaryAuto);\n }\n } else {\n System.out.println(\"Updating Dictionary:: Word: \" + word + \"\\tTag: \" + annotations[1]);\n dictionaryTerms.put(word.toLowerCase(), annotations[1]);\n writePrintStream(annotations[1] + \" \" + word.toLowerCase(), filePathDictionaryAuto);\n }\n }\n\n// if (dictionaryTerms.containsKey(word.toLowerCase())) {\n// if (!dictionaryTerms.get(word.toLowerCase()).equalsIgnoreCase(annotations[1])) {\n// System.out.println(\"Conflict: word: \" + word + \" Dictionary Tag: \" + dictionaryTerms.get(word.toLowerCase()) + \" New Tag: \" + annotations[1]);\n// nonDictionaryTerms.add(word.toLowerCase());\n//\n// }\n// } else {\n// dictionary.add(word.toLowerCase());\n// dictionaryTerms.put(word.toLowerCase(), annotations[1]);\n// System.out.println(\"Updating Dictionary: Word: \" + word + \"\\tTag: \" + annotations[1]);\n// }\n }\n }\n\n\n br.close();\n fr.close();\n }", "public String getKeyFilePath();", "public Dictionary(String filename)\n\t\tthrows FileNotFoundException, IOException\n\t{\n\t\tmyFilename = filename;\n\t\t\n\t\tchar myCharacter = 'a';\n\t\tString myWord = new String(\"\");\n\t\tBufferedReader myReader = new BufferedReader(new FileReader(myFilename));\n\t\t\n\t\tmyWord = myReader.readLine();\n\t\t\n\t\t//creates each WordList for the words in the given text file\n\t\tfor(int counter = 0; counter < 26; ++counter)\n\t\t{\nSystem.out.print((char)(counter + (int)'a'));\n\t\t\tint position = 0;\n\t\t\tString[] tempArray = new String[100];\n\t\t\t\n\t\t\tmyCharacter = (char)myWord.charAt(0);\n\t\t\ttempArray[position] = myWord;\n\t\t\t\n\t\t\tmyWord = myReader.readLine();\n\t\t\t\n\t\t\twhile(myWord != null && myWord.charAt(0) == myCharacter)\n\t\t\t{\n\t\t\t\t++position;\n\t\t\t\t\n\t\t\t\tif(tempArray.length >= position)\n\t\t\t\t{\n\t\t\t\t\ttempArray = enlargeArray(tempArray);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttempArray[position] = myWord;\n\t\t\t\t\n\t\t\t\tmyWord = myReader.readLine();\n\t\t\t}\n\t\t\t\n\t\t\tmyDictionaryArray[counter] = new WordList(shrinkArray(tempArray));\n\t\t}\n\t\t\n\t\tmyReader.close();\n\t}", "public Dictionary(String filename) throws FileNotFoundException, IOException {\n wordlist = loadWordList(filename);\n }", "public Dictionary(File dictionary) throws IOException {\n root = new Node();\n size = 0;\n errors = 0;\n load(dictionary);\n }", "public TreeDictionary(String filename) {\n\t\tString entry;\n\t\ttry {\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(filename));\n\t\t\twhile((entry=in.readLine())!=null){\n\t\t\t\tif(MapDictionary.isValidWord(entry)){\n\t\t\t\t\tString signature = wordToSignature(entry.toLowerCase());\n\t\t\t\t\tinsert(entry, signature);\n\t\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\tin.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"File not found\");\n\t\t}\n\t}", "public void dictionaryAdvanced() {\n dictionaryManagement.insertFromFile();\n showAllWords();\n dictionaryManagement.dictionaryLookup();\n dictionaryManagement.removeWord(\"Before\");\n showAllWords();\n dictionaryManagement.dictionaryExportToFile();\n }", "public InMemoryDictionary(File dictFile) {\n\t\t// TODO: Implement constructor\n\t}", "public void constructDictionaries(String corpusFilePath) throws Exception {\n\n System.out.println(\"Constructing dictionaries...\");\n File dir = new File(corpusFilePath);\n for (File file : dir.listFiles()) {\n if (\".\".equals(file.getName()) || \"..\".equals(file.getName())) {\n continue; // Ignore the self and parent aliases.\n }\n System.out.printf(\"Reading data file %s ...\\n\", file.getName());\n BufferedReader input = new BufferedReader(new FileReader(file));\n String line = null;\n\n System.out.println(file.getName() + \"----------------------------------- \");\n while ((line = input.readLine()) != null) {\n\n if (line.isEmpty()) {\n continue;\n }\n\n /*\n * Remember: each line is a document (refer to PA2 handout)\n * TODO: Your code here\n */\n\n String[] words = line.trim().split(\"\\\\s+\");\n String previousWord = words[0];\n unigrams.add(previousWord);\n\n for (int i=1; i<words.length; ++i) {\n String w = words[i];\n unigrams.add(w);\n\n String bigram = previousWord + \" \" + w ;\n\n bigrams.add(bigram);\n\n previousWord = w;\n }\n\n }\n input.close();\n }\n\n computeUnigramProbabilities();\n computeBigramProbabilities();\n\n System.out.println(\"Done.\");\n }", "public HashMap readFile(String filePath, HashMap source){\n\t\tArrayList<String> temp1 = new ArrayList<String>();\n\t\tArrayList<String> temp2 = new ArrayList<String>();\n\t\tBufferedReader br = null;\n\t\t\n\t\ttry {\n\t\t\tString sCurrentLine;\n\t\t\t\n\t\t\t// \"Users/Jasmine/Documents/Eclipse/CacheDictionary/src/english.txt\"\n\t\t\tbr = new BufferedReader(new FileReader(filePath)); \n\t\t\t\n\t\t\t//str.matches(\".*\\\\d+.*\"); ==> string that contains numbers\n\t\t\t//.matches(\"[a-zA-Z]+\"); ==> string that only contains letter\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) {\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * if the source file itself is not one word per line, we need to split the string\n\t\t\t\t * only letter(not single) will be stored in the array\n\t\t\t\t */\n\t\t\t\t//\n\t\t\t\tif(sCurrentLine.matches(\".*([ \\t]).*\")){ //check if the current line is a single word or not\n\t\t\t\t\ttemp1.add(sCurrentLine);\n\t\t\t\t}\n\t\t\t\telse if(sCurrentLine.matches(\"[a-zA-Z]+\") && sCurrentLine.length()>1){\n\t\t\t\t\ttemp2.add(sCurrentLine);\n\t\t\t\t}\n\t\t\t}// end of while loop\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null)br.close();\n\t\t\t} catch (IOException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tif(!temp1.isEmpty()){\n\t\t\tfor(int i = 0; i< temp1.size(); i++){\n\t\t\t\tString thisLine[] = temp1.get(i).split(\" \");\n\t\t\t\t//for each word in this line\n\t\t\t\tfor(int j = 0; j < thisLine.length; j++){\n\t\t\t\t\t//if it is a valid word\n\t\t\t\t\tif(thisLine[j].matches(\"[a-zA-Z]+\") && thisLine[j].length()>1 ){\n\t\t\t\t\t\tif( source.get(thisLine[j]) == null){\n\t\t\t\t\t\t\tsource.put(thisLine[j].toLowerCase(),thisLine[j].toLowerCase());\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t} // end of if current word i valid\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t} // end of temp1\n\t\t\n\t\tif(!temp2.isEmpty()){\n\t\t\tfor(int i = 0; i< temp2.size(); i++){\n\t\t\t\tif(temp2.get(i).matches(\"[a-zA-Z]+\") && temp2.get(i).length()>1){\n\t\t\t\t\tif(source.get(temp2.get(i)) == null){\n\t\t\t\t\t\tsource.put(temp2.get(i).toLowerCase(),temp2.get(i).toLowerCase());\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn source;\n\t}", "public static int getLookupDictionary(Context context, String deckPath) {\n openDBIfClosed(context);\n Cursor cur = null;\n try {\n cur = mMetaDb.rawQuery(\"SELECT dictionary FROM customDictionary\" + \" WHERE deckpath = \\'\"\n + stripQuotes(deckPath) + \"\\'\", null);\n if (cur.moveToNext()) {\n return cur.getInt(0);\n } else {\n return -1;\n }\n } catch (Exception e) {\n Log.e(\"Error\", \"Error retrieving custom dictionary from MetaDB \", e);\n return -1;\n } finally {\n if (cur != null && !cur.isClosed()) {\n cur.close();\n }\n }\n }", "public List<Dictionary> getDictionaryLikeDictEntry(String dictEntry) throws LIMSRuntimeException {\n\t List<Dictionary> list = new Vector<Dictionary>();\n\t String searchString = \"%\" + dictEntry.toUpperCase().trim() + \"%\";\n\t String sql = \"from Dictionary d where upper(d.dictEntry) like :dictionaryEntry\";\n try{\n Query query = HibernateUtil.getSession().createQuery(sql);\n query.setString(\"dictionaryEntry\", searchString);\n list = query.list();\n closeSession();\n }catch(HibernateException e){\n handleException(e, \"getDictionaryLikeDictEntry\");\n }\n \n\t return list;\n\t}", "public Dictionary() { //constructor\r\n try {\r\n createDictionary(); //create dictionary\r\n addCustomWords(); //add any user define words in it\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void saveDictionary() throws IOException {\r\n\t\tif (modified) {\r\n\t\t\tSystem.out.println(\"Saving...\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Saving un-changed dictionary...\");\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tFileWriter fw = new FileWriter(\"dictionary.txt\", false);\r\n\t\t\tBufferedWriter bw = new BufferedWriter(fw);\r\n\t\t\tObject[] dictionaryArray = dictionary.toArray();\r\n\t\t\tfor (int i = 0; i < dictionary.size(); i++) {\r\n\t\t\t\tString word = (String)dictionaryArray[i];\r\n\t\t\t\tSystem.out.println(word);\r\n\t\t\t\tbw.write(word);\r\n\t\t\t\tbw.newLine();\r\n\t\t\t}\r\n\t\t\tbw.close();\r\n\t\t\tmodified = false;\r\n\t\t}\r\n\t\tcatch (IOException e) {\r\n\t\t\tSystem.out.println(\"An error occurred while attempting to save the dictionary.\");\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "public void dictionaryBasic() {\n dictionaryManagement.insertFromCommandline();\n showAllWords();\n }", "@Override\r\n public void generateDict(File targetDir, Long dictId, GeneratorSettings settings) throws BusinessException {\n long begin = System.currentTimeMillis();\r\n Dictionary dict = (Dictionary) dao.getSession().\r\n createCriteria(Dictionary.class).\r\n add(Restrictions.idEq(dictId)).\r\n setFetchMode(\"labels\", FetchMode.JOIN).\r\n setCacheable(true).\r\n// setFetchMode(\"labels.params\", FetchMode.SELECT).\r\n// setFetchMode(\"labels.origTranslations\", FetchMode.DEFAULT).\r\n// setFetchMode(\"labels.text\", FetchMode.DEFAULT).\r\n// setFetchMode(\"labels.text.translations\", FetchMode.DEFAULT).\r\n uniqueResult();\r\n long end = System.currentTimeMillis();\r\n String timeStr = DurationFormatUtils.formatPeriod(begin, end, \"mm 'minute(s)' ss 'second(s)'.\");\r\n log.info(center(\"Querying dictionary \" + dict.getName() + \" using a total of \" + timeStr, 100, '*'));\r\n\r\n generateDict(targetDir, dict);\r\n }", "public static void populateWordDictionary(net.sqlcipher.database.SQLiteDatabase r7) {\n /*\n r0 = 0\n java.io.BufferedReader r1 = new java.io.BufferedReader // Catch:{ IOException -> 0x0051 }\n java.io.InputStreamReader r2 = new java.io.InputStreamReader // Catch:{ IOException -> 0x0051 }\n com.masterlock.ble.app.MasterLockApp r3 = com.masterlock.ble.app.MasterLockApp.get() // Catch:{ IOException -> 0x0051 }\n android.content.res.AssetManager r3 = r3.getAssets() // Catch:{ IOException -> 0x0051 }\n java.lang.String r4 = \"word_dictionary/words.txt\"\n java.io.InputStream r3 = r3.open(r4) // Catch:{ IOException -> 0x0051 }\n java.lang.String r4 = \"UTF-8\"\n r2.<init>(r3, r4) // Catch:{ IOException -> 0x0051 }\n r1.<init>(r2) // Catch:{ IOException -> 0x0051 }\n r2 = 0\n L_0x001c:\n java.lang.String r3 = r1.readLine() // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n if (r3 == 0) goto L_0x0045\n if (r3 == 0) goto L_0x0042\n boolean r4 = r3.isEmpty() // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n if (r4 != 0) goto L_0x0042\n android.content.ContentValues r4 = new android.content.ContentValues // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n r4.<init>() // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n java.lang.String r5 = \"word_dictionary_id\"\n java.lang.Integer r6 = java.lang.Integer.valueOf(r2) // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n r4.put(r5, r6) // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n java.lang.String r5 = \"word_dictionary_word\"\n r4.put(r5, r3) // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n java.lang.String r3 = \"word_dictionary\"\n r7.insert(r3, r0, r4) // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n L_0x0042:\n int r2 = r2 + 1\n goto L_0x001c\n L_0x0045:\n r1.close() // Catch:{ IOException -> 0x005b }\n goto L_0x005f\n L_0x0049:\n r7 = move-exception\n goto L_0x0060\n L_0x004b:\n r7 = move-exception\n r0 = r1\n goto L_0x0052\n L_0x004e:\n r7 = move-exception\n r1 = r0\n goto L_0x0060\n L_0x0051:\n r7 = move-exception\n L_0x0052:\n r7.printStackTrace() // Catch:{ all -> 0x004e }\n if (r0 == 0) goto L_0x005f\n r0.close() // Catch:{ IOException -> 0x005b }\n goto L_0x005f\n L_0x005b:\n r7 = move-exception\n r7.printStackTrace()\n L_0x005f:\n return\n L_0x0060:\n if (r1 == 0) goto L_0x006a\n r1.close() // Catch:{ IOException -> 0x0066 }\n goto L_0x006a\n L_0x0066:\n r0 = move-exception\n r0.printStackTrace()\n L_0x006a:\n throw r7\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.masterlock.ble.app.util.DBUtil.populateWordDictionary(net.sqlcipher.database.SQLiteDatabase):void\");\n }", "public SpellChecker() throws FileNotFoundException {\r\n\t\t// Initialize empty dictionary collection.\r\n\t\tdictionary = new LinkedSet<String>();\r\n\t\t\r\n\t\t// Add contents of provided \"dictionary.txt\" file to dictionary.\r\n\t\ttry {\r\n\t\t\tFile file = new File(\"dictionary.txt\");\r\n\t\t\tSystem.out.println(\"Initializing program dicitonary...\");\r\n\t\t\tScanner scanner = new Scanner(file);\r\n\t\t\twhile (scanner.hasNextLine()) {\r\n\t\t\t\tString line = scanner.nextLine();\r\n\t\t\t\tdictionary.add(line);\r\n\t\t\t}\r\n\t\t\tscanner.close();\r\n\t\t\tSystem.out.println(\"dictionary initialized\");\r\n\t\t}\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"An error occurred while initializing program dicitonary. File not found.\");\r\n\t\t}\r\n\t}", "protected static String getFilename(String base) {\n //return Integer.toHexString(base.hashCode()) + \".map\";\n return base + \".map\";\n }", "public static Dictionary readInDictionary(String fileName) {\r\n Dictionary d = new Dictionary();\r\n Scanner fileScanner;\r\n\r\n try {\r\n // use a FileInputStream to ensure correct reading end-of-file\r\n fileScanner = new Scanner(new FileInputStream(\"data\" + File.separator +fileName));\r\n\r\n while (fileScanner.hasNextLine()) {\r\n String nextLine = fileScanner.nextLine();\r\n // System.out.println(\"nextLine: \" + nextLine); uncomment if you want to see what is read in\r\n DictionaryData data = new DictionaryData(nextLine);\r\n\r\n // TODO: call insert() here to insert the data object into the dictionary!\r\n d.insert(data.word.toUpperCase(),data);\r\n }\r\n\r\n } catch (FileNotFoundException ex) {\r\n System.out.println(\"could not find the file \" +fileName+ \"in the data directory!\");\r\n return null;\r\n }\r\n\r\n return d;\r\n }", "public static void main(String[] args) throws IOException {\n //arg0: dictDir\n //arg1: partOfSpeech (char)\n //args1+: words to lookup\n\n try {\n final String dictDir = args[0].length() > 1 ? args[0] : null;\n final String posChar = args[1];\n final int wordsIndex = 2;\n\n final WordNetFile wordNetFile = WordNetFile.getInstance(dictDir, WordNetUtils.parsePOS(posChar));\n\n for (int i = wordsIndex; i < args.length; ++i) {\n final List<Entry> entries = wordNetFile.getEntries(args[i]);\n\n System.out.print(args[i] + \" --> \");\n if (entries == null) {\n System.out.print(\"<no entries>\");\n }\n else {\n boolean didFirst = false;\n for (Entry entry : entries) {\n if (didFirst) System.out.print(\", \");\n System.out.print(entry);\n didFirst = true;\n }\n }\n System.out.println();\n }\n }\n finally {\n WordNetUtils.closeAll();\n }\n }", "public MyDictionaryGenerator() throws IOException {\n\t\t\n\t\ttry {\t\t\t\t// Attempts to open dictionary.txt for parsing\n\t\t\tFile dictionary = new File(\"dictionary.txt\");\n\t\t\tscan = new Scanner(dictionary);\n\t\t}\n\t\t\n\t\tcatch (FileNotFoundException e) {\t\t\t// Throws a file not found exception if it is missing\n\t\t\tSystem.out.printf(\"Error: Could not find \\\"dictionary.txt\\\". Please check your directory for the text file.\\n\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\tmyDictionary = new PrintWriter(new File(\"my_dictionary.txt\"));\t\t// Creates my_dictionary.txt\n\t\ttrie = new DLBTrie<Character, String>();\t\t\t\t// Initializes the dictionary trie\n\t\t\n\t\tSystem.out.printf(\"\\nCreating my_dictionary.txt...\\n\");\n\t\t\n\t\twhile (scan.hasNextLine()) {\t\t\t\t// Loops while dictionary.txt has a line to parse\n\t\t\tword = scan.nextLine().toLowerCase();\t\t\t// Pulls a word from dictionary.txt and converts it to lowercase\n\t\t\t\n\t\t\tif (word.length() > 5) {\t\t\t\t// If the word is greater than 5 letters, it is skipped\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tDLBTCharMethods.addWord(trie, word);\t\t// Adds the word to the dictionary trie\n\t\t\tmyDictionary.println(word);\t\t\t\t\t// Adds the word to my_dictionary.txt\n\t\t\t\n\t\t\tconvertWord(word, 0);\t\t\t// Takes the word and finds all possible enumerations to add\n\t\t}\n\t\t\n\t\tmyDictionary.close();\t\t\t\t// Closes my_dictionary.txt\n\t\t\n\t\tnew GoodPasswords(trie);\t\t\t// Calls the class that creates good_passwords.txt\n\t}", "public void initializeDictionary() {\n\t\tmyDictionary = new SLogoDictionary();\n\t}", "public void insertFromFile() throws IOException {\n File file = new File(Main.DATA_FILE_PATH);\n Scanner sc = new Scanner(file);\n\n dictionary = new Dictionary();\n TreeMap<String, ArrayList<String>> wordList = new TreeMap<>();\n String target = sc.nextLine().substring(1).trim();\n ArrayList<String> explain = new ArrayList<>();\n while (sc.hasNextLine()) {\n String str = sc.nextLine();\n if (str.indexOf(\"@\") == 0) {\n wordList.put(target, explain);\n target = str.substring(1).trim();\n explain = new ArrayList<>();\n } else if (str.indexOf(\"=\") == 0) {\n str = str.replace(\"+\", \" : \");\n String word = \" = \" + str.substring(1);\n explain.add(word);\n } else if (str.indexOf(\"#\") == 0 || str.indexOf(\"*\") == 0) {\n explain.add(str);\n } else {\n explain.add(\" \" + str);\n }\n }\n dictionary.setWordList(wordList);\n sc.close();\n }", "public static Dictionary load(Path path) throws IOException {\n try (BufferedReader bufferedReader = Files.newBufferedReader(path)) {\n return load(bufferedReader.lines());\n }\n }", "private String getDicDir() {\n\t\tString wDir = null;\n\n\t\tif (System.getProperties().containsKey(\"root\")) {\n\t\t\twDir = System.getProperty(\"root\");\n\t\t}\n\n\t\tif ((wDir == null || wDir.isEmpty()) && CPlatform.isMacOs())\n\t\t\twDir = new File(CPlatform.getUserHome(), \"Library/Spelling\")\n\t\t\t\t\t.getAbsolutePath();\n\n\t\tif (wDir == null || wDir.isEmpty())\n\t\t\twDir = \"/home/ff/projects/hunspell\";\n\t\treturn wDir;\n\t}", "public static void doNonInteractiveMode(String[] args) throws FileNotFoundException {\r\n\t\tif (args.length == 0) {\r\n\t\t\tdoUsage();\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\r\n\t\tString dictionaryFile = args[1];\r\n\t\tString filename = args[2];\r\n\r\n\t\tDictionary dic = new Dictionary(dictionaryFile);\r\n\r\n\t\ttry {\r\n\t\t\tFile f = new File(filename);\r\n\t\t\tScanner in = new Scanner(f);\r\n\t\t\twhile (in.hasNextLine()) {\r\n\t\t\t\tString sentence = in.nextLine();\r\n\t\t\t\tString[] words = sentence.split(\" \");\r\n\t\t\t\t// transform string[] into ArrayList\r\n\t\t\t\tArrayList<String> al = new ArrayList<String>(Arrays.asList(words));\r\n\t\t\t\tSystem.out.println(sentence);\r\n\t\t\t\t// remove ^ when the operation is finished\r\n\t\t\t\tfor (int i = 0; i < al.size(); i++) {\r\n\t\t\t\t\t// the case of punctuation\r\n\t\t\t\t\tif (!dic.hasWord(al.get(i).replaceAll(\"[^a-zA-Z ]\", \"\"))) {\r\n\t\t\t\t\t\tfor (int j = 0; j < al.get(i).length(); j++) {\r\n\t\t\t\t\t\t\tif (j == 0)\r\n\t\t\t\t\t\t\t\tSystem.out.printf(\"^\");\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tSystem.out.printf(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (i != al.size() - 1)\r\n\t\t\t\t\t\t\tSystem.out.printf(\" \");\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfor (int j = 0; j < al.get(i).length(); j++) {\r\n\t\t\t\t\t\t\tSystem.out.printf(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (i != al.size() - 1)\r\n\t\t\t\t\t\t\tSystem.out.printf(\" \");\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tin.close();\r\n\t\t\tSystem.exit(0);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"check the existance of filename\");\r\n\t\t}\r\n\t}", "public void createDictionary(int wordLength, int shiftLength, String lettersInputFolder) throws IOException{\n\t\t//read File\n\t\t// go to letters directory\n\t\tString seriesLetterFolder = lettersInputFolder + File.separator + \"letters\";\n\t\tFile directory = new File(seriesLetterFolder); \n\t\tfileNames = directory.listFiles(new FileFilter() {\n\t\t @Override\n\t\t public boolean accept(File pathname) {\n\t\t String name = pathname.getName().toLowerCase();\n\t\t return name.endsWith(\".csv\") && pathname.isFile();\n\t\t }\n\t\t});\n\t\tfor (int i = 0; i < fileNames.length; i++) {\n\t\t\t\n\t\t\t// Overall structure is as follows:\n\t\t\t// On each row, for each word - we have a Map of String and List<Double> indicating a word\n\t\t\t// and list for TF, IDF, and IDF2 values. So for each csv file, you will have a List of these maps.\n\t\t\t// the size of the list is 20. Eventually the global dictionary will be a List of such lists.\n\t\t\t// in case of sample data, the global dictionary is of 60 lists.\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(fileNames[i]));\n\t\t\t\n\t\t\t\n\t\t\t// for each document\n\t\t\tList<Map<String,List<Double>>> mapPerGestureFile = new ArrayList<Map<String,List<Double>>>(); \n\t\t\t\n\t\t\tMap<String,List<Double>> wordMap = null; //per row \n\t\t\twhile(in.ready()) {\n\t\t\t\twordMap = new HashMap<String, List<Double>>(); //per rows\n\t\t\t\tString series = in.readLine();\n\t\t\t\tString letters[]= series.split(\",\");\n\t\t\t\tInteger lastLocationForRef = -1; // for padding\n\t\t\t\tdouble totalWordCountPerDocument = 0.0; \n\t\t\t\tfor (int curLineCharLocation = 0; curLineCharLocation < letters.length\n\t\t\t\t\t\t- wordLength + 1; curLineCharLocation = curLineCharLocation\n\t\t\t\t\t\t+ shiftLength) {\n\t\t\t\t\t// this for loop runs on each line and curLineCharLocation\n\t\t\t\t\t// indicates the current pointer\n\t\t\t\t\t// from which we should be forming the word\n\t\t\t\t\t// extract a word and move the shift length\n\t\t\t\t\tString currentWord = \"\";\n\t\t\t\t\tfor (int currentWordLocation = curLineCharLocation; currentWordLocation < wordLength\n\t\t\t\t\t\t\t+ curLineCharLocation; currentWordLocation++) {\n\t\t\t\t\t\t// this inner for loop denotes the current word to be\n\t\t\t\t\t\t// created\n\t\t\t\t\t\tcurrentWord = currentWord\n\t\t\t\t\t\t\t\t+ letters[currentWordLocation];\n\t\t\t\t\t}\n\t\t\t\t\taddWordToMap(wordMap, currentWord);\n\t\t\t\t\tlastLocationForRef = curLineCharLocation + shiftLength;\n\t\t\t\t\ttotalWordCountPerDocument = totalWordCountPerDocument + 1;\n\t\t\t\t}\n\t\t\t\t// check to see if we have any leftover strings. If yes then pad that word using\n\t\t\t\t// the last character pointed by lastLocationForRef\n\t\t\t\tInteger difference = letters.length - lastLocationForRef;\n\t\t\t\tif (difference > 0) {\n\t\t\t\t\tString paddedWord = \"\";\n\t\t\t\t\tInteger extraPaddingSize = wordLength - difference;\n\t\t\t\t\twhile (difference > 0) {\n\t\t\t\t\t\t// this while loop will simply create the padded word \n\t\t\t\t\t\t// to be appended at the end\n\t\t\t\t\t\tpaddedWord = paddedWord + letters[lastLocationForRef];\n\t\t\t\t\t\tdifference = difference - 1;\n\t\t\t\t\t\tlastLocationForRef = lastLocationForRef + 1; //advance to next location\n\t\t\t\t\t}\n\t\t\t\t\twhile(extraPaddingSize > 0) {\n\t\t\t\t\t\t paddedWord = paddedWord + letters[lastLocationForRef-1];\n\t\t extraPaddingSize = extraPaddingSize - 1;\n\t\t\t\t\t}\n\t\t\t\t\taddWordToMap(wordMap, paddedWord);\n\t\t\t\t\ttotalWordCountPerDocument = totalWordCountPerDocument + 1;\n\t }\n\t\t\t\twordMap = updateWordMapForTotalCountK(wordMap,totalWordCountPerDocument); // n/k , where n is frequency of word in doc/ k total freq\n\t\t\t\tmapPerGestureFile.add(wordMap);\t\t\t\t\n\t\t\t}\n\t\t\tgetTfMapArrayIDF().add(mapPerGestureFile);\n\t\t\t//count idf2 per document\n\t\t\tinitIDF2Map(mapPerGestureFile);\n\t\t\t\n\t\t\tin.close();\n\t\t}\n\t\t\n\t\t//populate global map for IDF values List<LIst<Map>\n\t\t initIDFMap(getTfMapArrayIDF());\n\t\t //Generate IDF Files from Global Map * TF Values\n\t\t calculateIDFValues();\n\t\t //Generate IDF2 Files\n\t\t calculateIDF2Values();\n\t\t //normalize tfidf and tfidf2\n\t\t normalizeDictionary(); \n\t\t createDatabaseFiles(getTfMapArrayIDF(),lettersInputFolder);\n\t}", "private void loadNonDictionaryTerms(String filePathNonDictionaryAuto) throws IOException {\n File fileAnnotation = new File(filePathNonDictionaryAuto);\n if (!fileAnnotation.exists()) {\n fileAnnotation.createNewFile();\n }\n FileReader fr;\n fr = new FileReader(fileAnnotation);\n BufferedReader br = new BufferedReader(fr);\n String line;\n while ((line = br.readLine()) != null) {\n\n nonDictionaryTerms.add(line.trim().toLowerCase());\n System.out.println(\"Loading Non Dictionary Terms: \" + line);\n }\n br.close();\n fr.close();\n System.out.println(\"Non Dictionary Terms Loaded\");\n }", "public static void main(String[] args) {\r\n\t\t// Load Dictionary\r\n\t\tString FileName;\r\n\t\tif (args.length == 0) {\r\n\t\t\t// Default dictionary\r\n\t\t\tFileName = \"G:\\\\455\\\\Homework4\\\\PA4\\\\bin\\\\testFiles\\\\sowpods.txt\";\r\n\t\t} else {\r\n\t\t\t// Given dictionary\r\n\t\t\tFileName = args[0];\r\n\t\t}\r\n\r\n\t\t// Construct AnagramDictionary and error detection\r\n\t\tAnagramDictionary ADictionary;\r\n\t\ttry {\r\n\t\t\tADictionary = new AnagramDictionary(FileName);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"File is not found! \" + FileName);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Starting to print the prompt\r\n\t\tSystem.out.println(\"Type . to quit.\");\r\n\t\tSystem.out.print(\"Rack? \");\r\n\t\tsc = new Scanner(System.in);\r\n\t\tString Rack = sc.next();\r\n\t\t// Exit until typing in \".\" at the prompt\r\n\t\twhile (!Rack.equals(\".\")) {\r\n\t\t\t// Print the Scrabble word according to the current rack and AnagramDictionary\r\n\t\t\tPrint(Rack, ADictionary);\r\n\t\t\tSystem.out.print(\"Rack? \");\r\n\t\t\tRack = sc.next();\r\n\t\t}\r\n\t}", "public static String determinePasswordStrength(String password)\r\n {\r\n double passwordlength = password.length();\r\n ArrayList<Long> possibilties= new ArrayList<Long>();\r\n double countedPossibilities = 0;\r\n double totalPossibilties = 0;\r\n ArrayList<String> counterArray = new ArrayList<String>();\r\n String longestMatchingWord = \"\";\r\n\r\n File fileToRead = new File(\"dictionary.txt\");\r\n boolean hasUpper = false;\r\n boolean hasLower = false;\r\n boolean hasNumber = false;\r\n boolean hasSpecial = false;\r\n boolean isUpper = false;\r\n boolean isLower = false;\r\n boolean isNumber = false;\r\n boolean isSpecial = false;\r\n\r\n for(int i = 0; i < password.length(); i++)\r\n {\r\n\r\n if(\"abcdefghijklmnopkrstuvwxyz\".contains(Character.toString(password.charAt(i))) && !hasLower)\r\n {\r\n hasLower = true;\r\n countedPossibilities = countedPossibilities + 26;\r\n }\r\n else if(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".contains(Character.toString(password.charAt(i))) && !hasUpper)\r\n {\r\n hasUpper = true;\r\n countedPossibilities = countedPossibilities + 26;\r\n }\r\n else if(\"0123456789\".contains(Character.toString(password.charAt(i))) && !hasNumber)\r\n {\r\n hasNumber= true;\r\n countedPossibilities = countedPossibilities + 10;\r\n }\r\n else if(\" ,!”#$%&’()*+,-./:;<=>?@[\\\\]^_`{|}~\".contains(Character.toString(password.charAt(i))) && !hasSpecial)\r\n {\r\n hasSpecial = true;\r\n countedPossibilities = countedPossibilities + 33;\r\n }\r\n\r\n }\r\n double centuries = 0;\r\n double years = 0;\r\n double days = 0;\r\n double hours = 0;\r\n double minutes = 0;\r\n double seconds = 0;\r\n double tempcenturies = 0;\r\n double tempyears = 0;\r\n double tempdays = 0;\r\n double temphours = 0;\r\n double tempminutes = 0;\r\n double tempseconds2 = 0;\r\n double tempseconds = 0;\r\n double point = 0.00000037;\r\n double point1 = 3.8;\r\n\r\n// BigDecimal E = new BigDecimal(Math.E);\r\n// BigInteger fivehundread = new BigInteger(\"1000\");\r\n// BigInteger zero = new BigInteger(\"0\");\r\n //BigDecimal centuries = new BigDecimal(\"0\");\r\n\r\n ///////////////INSERT Dictionary Attack Here//////////////////////\r\n try {\r\n BufferedReader reader = new BufferedReader(new FileReader(fileToRead));\r\n String wordInFile = \"\";\r\n\r\n while ((wordInFile = reader.readLine()) != null) {\r\n //System.out.println(wordInFile);\r\n wordInFile = wordInFile.toLowerCase();\r\n if (wordInFile.length() > 3) {\r\n if (password.contains(wordInFile))\r\n {\r\n if(longestMatchingWord.length() < wordInFile.length())\r\n {\r\n longestMatchingWord = wordInFile;\r\n }\r\n }\r\n }\r\n }\r\n for (int i = 0; i < longestMatchingWord.length(); i++) {\r\n if (\"abcdefghijklmnopkrstuvwxyz\".contains(Character.toString(password.charAt(i)))) {\r\n //isLower = true;\r\n //countedPossibilities = countedPossibilities.add(BigDecimal.valueOf(26));\r\n passwordlength--;\r\n //System.out.println(passwordlength);\r\n }\r\n else if (\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".contains(Character.toString(password.charAt(i)))) {\r\n //isUpper = true;\r\n //countedPossibilities = countedPossibilities.add(BigDecimal.valueOf(26));\r\n passwordlength--;\r\n }\r\n else if (\"0123456789\".contains(Character.toString(password.charAt(i)))) {\r\n //isNumber = true;\r\n //countedPossibilities = countedPossibilities.add(BigDecimal.valueOf(10));\r\n passwordlength--;\r\n }\r\n else if (\" ,!”#$%&’()*+,-./:;<=>?@[\\\\]^_`{|}~\".contains(Character.toString(password.charAt(i)))) {\r\n //isSpecial = true;\r\n //countedPossibilities = countedPossibilities.add(BigDecimal.valueOf(33));\r\n passwordlength--;\r\n }\r\n\r\n }\r\n }\r\n catch (FileNotFoundException e)\r\n {\r\n\r\n }\r\n catch(IOException e)\r\n {\r\n System.out.println(\"didnt read file\");\r\n }\r\n\r\n // Algorithm is here\r\n //y =3.7*e(3.8x) rounded to 4 to fit into big decimal\r\n\r\n totalPossibilties = (Math.pow(countedPossibilities, passwordlength));\r\n tempseconds2 = point*Math.pow(Math.E, totalPossibilties*4);\r\n tempseconds = tempseconds2;\r\n\r\n if (tempseconds == 0)\r\n {\r\n\r\n }\r\n else if (tempseconds > 1)\r\n {\r\n\r\n }\r\n else\r\n {\r\n tempseconds = 0;\r\n }\r\n\r\n\r\n seconds = tempseconds % 60;\r\n tempminutes = tempseconds / 60;\r\n minutes = tempminutes % 60;\r\n temphours = tempminutes / 60;\r\n hours = temphours % 24;\r\n tempdays = temphours / 24;\r\n days = tempdays % 365;\r\n tempyears = tempdays / 365;\r\n\r\n if(tempyears > 500)\r\n {\r\n return (\"Greater than 500\" + \" years \");\r\n }\r\n //years = tempcenturies.divide(BigInteger.valueOf(100));\r\n //System.out.println(tempyears.toString() + \" years \" + days.toString() + \" days \" + hours.toString() + \" hours \" + minutes.toString() + \" minutes \" + seconds.toString() + \" seconds\");\r\n else\r\n {\r\n return (tempyears + \" years \" + days + \" days \" + hours + \" hours \" + minutes + \" minutes \" + seconds + \" seconds\");\r\n }\r\n }", "public void dictionaryExportToFile(String path) throws IOException {\n FileWriter fw = new FileWriter(path);\n TreeMap<String, ArrayList<String>> wordList = dictionary.getWordList();\n\n int count = 0;\n\n for (Map.Entry<String, ArrayList<String>> entry : wordList.entrySet()) {\n fw.write(++count + \") \" + entry.getKey() + \"\\n\");\n for (String str : entry.getValue()) {\n fw.write(\" \" + str + \"\\n\");\n }\n }\n\n fw.close();\n }", "public void loadDictionary(String language) {\r\n\t\tif(this.language.equals(language) && dizionario != null ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tdizionario = new ArrayList<String>();\r\n\t\tthis.language = language; //Impostiamo la lingua uguale a quella passata da parametro\r\n\t\t\r\n\t\ttry {\r\n\t\t\tFileReader fr = new FileReader(\"English.txt\");\r\n\t\t\tBufferedReader br = new BufferedReader(fr);\r\n\t\t\tString word;\r\n\t\t\twhile ((word = br.readLine()) != null) {\r\n\t\t\t// Aggiungere parola alla struttura dati\r\n\t\t\t\tdizionario.add(word.toLowerCase());\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tCollections.sort(dizionario);\r\n\t\t\tbr.close();\r\n\t\t\t} catch (IOException e){\r\n\t\t\tSystem.out.println(\"Errore nella lettura del file\");\r\n\t\t\t}\r\n\t}", "public static void main(String[] args) {\n String filePath = \"/usr/share/dict/words\";\n SpellChecker sc = new SpellChecker(filePath);\n String line;\n System.out.print(\"> \");\n BufferedReader input = new BufferedReader(new InputStreamReader(System.in));\n try {\n while((line = input.readLine())!= null) {\n String correctSpelling = sc.spellcheck(line);\n System.out.println(correctSpelling);\n System.out.print(\"> \");\n }\n System.out.println();\n } catch (IOException e){\n e.printStackTrace();\n }\n }", "public String readARandomWord() {\r\n\r\n\t\tString inputFileName = \"dictionary.txt\";\r\n\t\tString[] wordsArray = null;\r\n\r\n\t\tScanner textFileScanner = new Scanner(BackToTheFutureClient.class.getResourceAsStream(inputFileName));\r\n\t\tArrayList<String> wordsList = new ArrayList<String>();\r\n\r\n\t\t// Reading all the lines from the file into array list\r\n\t\twhile (textFileScanner.hasNextLine()) {\r\n\t\t\tString w = textFileScanner.next();\r\n\t\t\twordsList.add(w);\r\n\t\t}\r\n\t\ttextFileScanner.close();\r\n\r\n\t\t// Convert words list to words array\r\n\t\twordsArray = wordsList.toArray(new String[wordsList.size()]);\r\n\r\n\r\n\t\tString randomWord = \"\";\r\n\r\n\t\t// Choose a random word from the array list of words\r\n\t\tif (wordsArray != null) {\r\n\t\t\tint index = new Random().nextInt(wordsArray.length);\r\n\t\t\trandomWord = (wordsArray[index]);\r\n\t\t}\r\n\t\treturn randomWord;\r\n\t}", "public Dictionary () {\n\t\tsuper();\n\t\t//words = new ArrayList < String > () ;\n\t}", "public static void main(String[] args) {\n\r\n\t\tHashMap<String, String> diccionario = new HashMap<String, String>();\r\n\t\t\r\n\t\tdiccionario.put(\"hola\", \"hello\");\r\n\t\tdiccionario.put(\"perro\", \"dog\");\r\n\t\tdiccionario.put(\"gato\", \"cat\");\r\n\t\tdiccionario.put(\"antes\", \"before\");\r\n\t\tdiccionario.put(\"que\", \"what\");\r\n\t\tdiccionario.put(\"pantalla\", \"screen\");\r\n\t\tdiccionario.put(\"teclado\", \"keyboard\");\r\n\t\tdiccionario.put(\"raton\", \"mouse\");\r\n\t\tdiccionario.put(\"mochila\", \"bag\");\r\n\t\tdiccionario.put(\"puerta\", \"door\");\r\n\t\tdiccionario.put(\"clase\", \"class\");\r\n\t\tdiccionario.put(\"coche\", \"car\");\r\n\t\tdiccionario.put(\"pantalones\", \"trousers\");\r\n\t\tdiccionario.put(\"sombrero\", \"hat\");\r\n\t\tdiccionario.put(\"escaleras\", \"stairs\");\r\n\t\tdiccionario.put(\"mesa\", \"table\");\r\n\t\tdiccionario.put(\"silla\", \"chair\");\r\n\t\tdiccionario.put(\"hermano\", \"brother\");\r\n\t\tdiccionario.put(\"hermana\", \"sister\");\r\n\t\tdiccionario.put(\"padre\", \"father\");\r\n\t\tdiccionario.put(\"madre\", \"mother\");\r\n\t\t\r\n\t\tint contador = 0;\r\n\t\tint correctas = 0;\r\n\t\tint incorrectas = 0;\r\n\t\tString respuesta;\r\n\t\t\r\n\t\t//para recorrer un map fijándonos en el valor de la posición ...\r\n\t\t\r\n\t\tfor(int i=0; i<5; i++) {\r\n\t\t\t\r\n\t\t\tint opcion = (int)(Math.random()*21); //21 palabras\r\n\r\n\t Iterator<String> it = diccionario.keySet().iterator();\r\n\t \r\n\t while(it.hasNext()){\r\n\t \r\n\t String obj = it.next();\r\n\t \r\n\t if(contador == opcion) {\r\n\t \tSystem.out.println(\"¿Cuál es la traducción de \"+obj+\"?\");\r\n\t \trespuesta = sc.next();\r\n\t \t\r\n\t \tif(respuesta.equalsIgnoreCase(diccionario.get(obj))) {\r\n\t \t\tSystem.out.println(\"Correcto!!\");\r\n\t \t\tcorrectas ++;\r\n\t \t\r\n\t \t}else {\r\n\t \t\tSystem.out.println(\"Ohh, incorrecto!!\");\r\n\t \t\tincorrectas ++;\r\n\t \t}\r\n\t }\r\n\t contador++;\r\n\t }\r\n\t contador = 0;\r\n\t\t}\r\n\t\t//////////////////////////////////////////////////////////////////////\r\n\t\t\r\n\t\tSystem.out.println(\"Has acertado \"+correctas+\" y has fallado \"+incorrectas);\r\n\t}", "public static void runExample() {\n\t\tString wnhome = \"C:\\\\bdaduy\\\\Software\\\\Wordnet3.1\\\\WordNet-3.0\";\n\t\tString path = wnhome + File.separator + \"dict\";\n\t\tURL url = null;\n\t\ttry {\n\t\t\turl = new URL(\"file\", null, path);\n\t\t} catch (MalformedURLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (url == null)\n\t\t\treturn;\n\n\t\t// construct the dictionary object and open it\n\t\tIDictionary dict = new Dictionary(url);\n\t\ttry {\n\t\t\tdict.open();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// look up first sense of the word \"dog\"\n\t\tWordnetStemmer s=new WordnetStemmer(dict);\n\t\tList<String> stems=s.findStems(\"food\", POS.NOUN);\n\t\tDebug.print(stems);\n\t\tIIndexWord idxWord = dict.getIndexWord(\"food\", POS.NOUN);\n\t\tIWordID wordID = idxWord.getWordIDs().get(0);\n\t\tIWord word = dict.getWord(wordID);\n\t\tSystem.out.println(\"Id = \" + wordID);\n\t\tSystem.out.println(\"Lemma = \" + word.getLemma());\n\t\tSystem.out.println(\"Gloss = \" + word.getSynset().getGloss());\n\t\tSystem.out.println(\"test = \" + word.getSynset().getLexicalFile());\n\n\n\t}", "public void wordMap(StringBuilder line, String path) {\r\n\t\tHashMap<String, ArrayList<Integer>> subIndex = new HashMap<String, ArrayList<Integer>> ();\r\n//\t\tFile file = new File(path);\r\n\t\tBufferedReader reader = null;\r\n\r\n\t\t\t\r\n//\t\t\t\treader = new BufferedReader(new FileReader(file));\r\n\t\t\t\tString textLine = line.toString();\r\n//\t\t\t\tSystem.out.println(textLine);\r\n\t\t\t\tint position = 0;\r\n\t\t\t\t// reads lines in and splits them into an array.\r\n\t\t\t\ttextLine = textLine.toLowerCase();\r\n\r\n\t\t\t\tString[] lines = textLine.split(\"\\\\s\");\r\n\t\t\t\tfor (int i = 0; i < lines.length; i++) {\r\n\t\t\t\t\tlines[i] = lines[i].replaceAll(\"\\\\W\", \"\");\r\n\r\n\t\t\t\t\t// Skips empty lines that are read in\r\n\t\t\t\t\tif (lines[i].isEmpty()) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tposition += 1;\r\n\r\n\t\t\t\t\taddEntry(lines[i], path, position, subIndex);\r\n\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\r\n\t\t\t\tfor(String word : subIndex.keySet()){\r\n\r\n\t\t\t\t\tfor(Integer count : subIndex.get(word)){\r\n\t\t\t\t\t\tindex.addEntry(word, path, count);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\treturn;\r\n\t}", "public String displayDictionary(String direction) {\n\t\treturn dictionary.displayDictionary(direction);\n\t}", "public String getString(short dictionaryKey) {\n\t\treturn stringsMap.get(dictionaryKey);\n\t}", "public static void loadTargetTerm2IdMapping(File input) throws IOException {\n\t\t\tm_namesMap = new SimpleBidirectionalMap<String, Integer>();\n\t\t\tString encoding = FileUtils.getFileEncoding(input);\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(input), encoding));\n\t\t\tString line = reader.readLine();\n\t\t\tint lineNum = 1;\n\t\t\tboolean testFormat = false;\n\t\t\tif(StringUtils.checkIfNumber(line.split(\"\\t\")[0]))\n\t\t\t\ttestFormat = true;\n\t\t\twhile(line!= null) {\n\t\t\t\tif(line.equals(\"@@@\"))\n\t\t\t\t\tbreak;\n\t\t\t\tif(testFormat) {\n\t\t\t\t\tString num = line.split(\"\\t\")[0];\n\t\t\t\t\tSystem.out.println(\"key: \"+line.trim().substring(num.length()+1) + \" value: \" + Integer.parseInt(num));\n\t\t\t\t\tm_namesMap.put(line.trim().substring(num.length()+1), Integer.parseInt(num));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"key????\" + lineNum + \"instead of \" + line.split(\"\\t\")[0]);\n\t\t\t\t\tm_namesMap.put(line.trim(), lineNum);\n\t\t\t\t}\n\t\t\t\tline = reader.readLine();\n\t\t\t\tlineNum ++;\n\t\t\t}\n\t\t}", "public HunspellDictionary(InputStream affix, InputStream dictionary, Version version) throws IOException, ParseException {\n this(affix, Arrays.asList(dictionary), version, IGNORE_CASE_DEFAULT);\n }", "public Map<String, Set<String>> loadDictionary(File dictionaryFile) throws IOException {\n // iterate through the input file lines\n try (Stream<String> lines = Files.lines(dictionaryFile.toPath())) {\n // create resulting map as per javadoc\n Map<String, Set<String>> result = new HashMap<>();\n // for each line in the input file\n lines.forEach(line -> {\n // convert to lower case and remove all non-mappable characters\n String filtered = filter(line);\n // get number that is result of decoding of the word in current line\n String decodedNumber = decode(filtered);\n // create empty set if there are no entries for the current decoded number\n if (!result.containsKey(decodedNumber)) {\n result.put(decodedNumber, new HashSet<>());\n }\n // put original word mapped to the decoded number\n result.get(decodedNumber).add(line);\n });\n return result;\n }\n }" ]
[ "0.7024292", "0.66121805", "0.6451234", "0.6414571", "0.63960314", "0.6292939", "0.6208098", "0.6200119", "0.61529714", "0.61238605", "0.61161447", "0.60769325", "0.60385334", "0.5979899", "0.59576523", "0.5941444", "0.5920314", "0.5856568", "0.581529", "0.5802447", "0.57749134", "0.57705736", "0.57602906", "0.57489455", "0.57398766", "0.5716264", "0.5711634", "0.5711546", "0.5678444", "0.567565", "0.56688356", "0.5643548", "0.5637212", "0.5598221", "0.5589118", "0.55882305", "0.55765", "0.55623376", "0.55607414", "0.5558345", "0.5538262", "0.5529589", "0.5505004", "0.54942274", "0.54767597", "0.5474799", "0.5473643", "0.54687035", "0.5453036", "0.54475594", "0.5446948", "0.5394851", "0.53924", "0.53873676", "0.5386813", "0.5381155", "0.5376902", "0.53303504", "0.532851", "0.53260356", "0.52783465", "0.5273917", "0.52588063", "0.525721", "0.5254337", "0.52428293", "0.522374", "0.5199709", "0.519022", "0.51817346", "0.51782393", "0.51747274", "0.51729244", "0.5145565", "0.51410055", "0.5131043", "0.5128896", "0.5113352", "0.5093299", "0.5091454", "0.5073612", "0.507122", "0.50705093", "0.5066525", "0.506529", "0.50633687", "0.5053892", "0.5045606", "0.5034106", "0.5032753", "0.5017421", "0.5011203", "0.50075495", "0.49875915", "0.49783182", "0.49721316", "0.49606368", "0.49583954", "0.49568477", "0.49491745", "0.49462172" ]
0.0
-1
return surfaceReading == null || surfaceReading.isEmpty(); Lucene uses surface form if surface reading doesn't exist
private static boolean nonExistReading(String surfaceReading) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean getPreview() {\n assert preview == null;\n while (iter.hasNext() && preview == null) {\n preview = fileList.getFileDescForIndex(iter.next());\n }\n return preview != null;\n }", "boolean isSetSurfaceRefs();", "public boolean isNullRecord () {\n if ((latitude == FLOATNULL) &&\n (longitude == FLOATNULL) &&\n (depth == FLOATNULL) &&\n (temperatureMin == FLOATNULL) &&\n (temperatureMax == FLOATNULL) &&\n (salinityMin == FLOATNULL) &&\n (salinityMax == FLOATNULL) &&\n (oxygenMin == FLOATNULL) &&\n (oxygenMax == FLOATNULL) &&\n (nitrateMin == FLOATNULL) &&\n (nitrateMax == FLOATNULL) &&\n (phosphateMin == FLOATNULL) &&\n (phosphateMax == FLOATNULL) &&\n (silicateMin == FLOATNULL) &&\n (silicateMax == FLOATNULL) &&\n (chlorophyllMin == FLOATNULL) &&\n (chlorophyllMax == FLOATNULL)) {\n return true;\n } else {\n return false;\n } // if ...\n }", "public synchronized boolean fempty() {\n\t\treturn table.isEmpty();//if the file table is empty, return to call the starting format\n\t}", "private boolean getNoFallback()\n/* */ {\n/* 1091 */ return this.reader.getNoFallback();\n/* */ }", "boolean isUsedForReading();", "public boolean readInputLibrary()\n \t{\n assert(!libsBeingRead.contains(this));\n libsBeingRead.add(this);\n \t\t//libsBeingRead.put(lib, this);\n \t\tscaledCells = new ArrayList<Cell>();\n \n \t\ttry\n \t\t{\n \t\t\tif (readTheLibrary(false, null))\n return true;\n Map<Cell,Variable[]> originalVars = createLibraryCells(false);\n realizeCellVariables(originalVars);\n return false;\n \t\t} catch (IOException e)\n \t\t{\n \t\t\tSystem.out.println(\"End of file reached while reading \" + filePath);\n \t\t\treturn true;\n \t\t}\n \t}", "protected void doFilterSurface() {\r\n\t\tif (filterSurface.getText().length() > 0) {\r\n\t\t\tfinal String[] words = filterSurface.getText().split(\"\\\\s+\");\r\n\t\t\tsurfaceSorter.setRowFilter(new RowFilter<TileList, Integer>() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic boolean include(\r\n\t\t\t\t\t\tjavax.swing.RowFilter.Entry<? extends TileList, ? extends Integer> entry) {\r\n\t\t\t\t\tTileEntry e = entry.getModel().rows.get(entry.getIdentifier());\r\n\t\t\t\t\tString rowtext = (e.name + \" \" + e.surface + \" \" + e.tile.width + \"x\" + e.tile.height).toLowerCase(); \r\n\t\t\t\t\tfor (String s : words) {\r\n\t\t\t\t\t\tif (!rowtext.contains(s.toLowerCase())) {\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\tsurfaceSorter.setRowFilter(null);\r\n\t\t}\r\n\t}", "public boolean recordIncomplete() {\n\t\tif (name.equals(\"\") || image.equals(\"\") || \tb1.equals(\"\")\t||\t location.equals(\"\") ) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isEmpty(){\n return raiz == null;\n }", "private boolean readFromIndex(){\n\t\tString file = \"./reverseIndex.txt\";\r\n\t\tFile reverseIndex = new File(file);\r\n\t\tif (reverseIndex.exists()){\r\n\t\t\ttry(\r\n\t\t\t\tBufferedReader reader = new BufferedReader(new FileReader(file));\r\n\t\t\t){\r\n\t\t\t\tString readSchema = \"(\\\\{[^\\\\}]+)\";\r\n\t\t\t\tPattern readPattern = Pattern.compile(readSchema);\r\n\t\t\t\tString line;\r\n\t\t\t\twhile ((line = reader.readLine()) != null){\r\n\t\t\t\t\tint iden = 0;\r\n\t\t\t\t\tString[] pair = line.split(\" \\\\| \");\r\n\t\t\t\t\tString fileName = pair[0];\r\n\t\t\t\t\tString tokenList;\r\n\t\t\t\t if (pair.length > 1){\r\n\t\t\t\t\t\ttokenList = pair[1];\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\ttokenList = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tHashMap<Term, Integer> tempMap = new HashMap<Term, Integer>();\r\n\t\t\t\t\tMatcher readMatcher = readPattern.matcher(tokenList);\r\n\t\t\t\t\tString[] readResults = readMatcher.results().map(MatchResult::group).toArray(String[]::new);\r\n\t\t\t\t\tfor (int i = 0;i<readResults.length;++i){\r\n\t\t\t\t\t\tString[] valuePair = readResults[i].split(\" : \");\r\n\t\t\t\t\t\tString term = valuePair[0];\r\n\t\t\t\t\t\tTerm temp = new Term(term.substring(1),iden);\r\n\t\t\t\t\t\tiden++;\r\n\t\t\t\t\t\ttempMap.put(temp, Integer.parseInt(valuePair[1]));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tindex.put(fileName, new IndexedDoc(tempMap));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(Exception e){\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean needFaceDetection() {\n return false;\n }", "boolean hasForRead();", "public boolean isEmpty() { return curChunker() == null; }", "public boolean needFaceDetection() {\n return true;\n }", "public boolean hasIndexFile() {\r\n\t\t\treturn getIndexFile() != null;\r\n\t\t}", "public boolean hasTexture()\r\n\t{\r\n\t\treturn texture != null;\r\n\t}", "@java.lang.Override\n public boolean hasDocument() {\n return document_ != null;\n }", "@java.lang.Override\n public boolean hasDocument() {\n return document_ != null;\n }", "@java.lang.Override\n public boolean hasDocument() {\n return document_ != null;\n }", "@Override\n public boolean isRead(int index)\n {\n if (index == 3)\n {\n return m_Unit != 0;\n }\n return super.isRead(index);\n }", "public boolean isCube(){\n\t\treturn !cubeDetectorL.get() && !cubeDetectorR.get();\n\t}", "private boolean isEmpty() {\n/* 547 */ return (this.filters.isEmpty() && this.maxArrayLength == Long.MAX_VALUE && this.maxDepth == Long.MAX_VALUE && this.maxReferences == Long.MAX_VALUE && this.maxStreamBytes == Long.MAX_VALUE);\n/* */ }", "private boolean isEmpty() {\n/* 549 */ return (this.filters.isEmpty() && this.maxArrayLength == Long.MAX_VALUE && this.maxDepth == Long.MAX_VALUE && this.maxReferences == Long.MAX_VALUE && this.maxStreamBytes == Long.MAX_VALUE);\n/* */ }", "public boolean isEmpty() {\r\n return treasures.isEmpty();\r\n }", "public boolean isExtractedWordsNull() {\n\t\treturn extractedWords == null;\n\t}", "public boolean hasNormals() {\n if (normals != null) {\n return normals.length > 0;\n }\n return false;\n }", "private boolean hasRoom(int index) {\r\n\t\t\tfor (int i = index; i < data.length; i++) {\r\n\t\t\t\tif (data[i] == null)\r\n\t\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}", "boolean hasTextDocument();", "public boolean isRoot() {\n return isIndex() && parts.length == 0;\n }", "@Override\n public boolean hasNext(){\n try{\n return this.notNone();\n } catch(IOException e){\n return false;\n }\n }", "public boolean fileFound(){\n\n try{\n\n m_CSVReader = new CSVReader(new FileReader(m_FileName));\n\n } catch (FileNotFoundException e){\n\n System.out.println(\"Input file not found.\");\n\n return false;\n }\n return true;\n }", "public boolean hasGetLatestReading() {\n return getLatestReadingBuilder_ != null || getLatestReading_ != null;\n }", "public boolean isSetFormat()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(FORMAT$10) != 0;\n }\n }", "public boolean hasNext() {\n\t\tif(nextIndex < numOfSensorReading()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\r\n public boolean hasNext() {\r\n if(nextMatchingFile != null) \r\n return true;\r\n return false;\r\n\r\n }", "public boolean isEmpty() {\n return cursor==-1 && lines.isEmpty();\n }", "public boolean isFull3D()\r\n {\r\n return true;\r\n }", "public boolean hasNext() {\n if (entries != null && \n size > 0 &&\n position > 0 &&\n position < size) {\n return true;\n } else {\n return false;\n }\n }", "protected void checkInFront()\n {\n d = (Defender)getOneObjectAtOffset(getImage().getWidth()/4, 0, Defender.class);\n if (d != null )\n {\n\n frontEmpty= false;\n d.takeDamage(damage);\n }\n\n else\n {\n frontEmpty = true;\n }\n }", "public boolean hasGetLatestReading() {\n return getLatestReading_ != null;\n }", "public org.landxml.schema.landXML11.SurfaceDocument.Surface getSurface()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.SurfaceDocument.Surface target = null;\r\n target = (org.landxml.schema.landXML11.SurfaceDocument.Surface)get_store().find_element_user(SURFACE$0, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target;\r\n }\r\n }", "private boolean isFull() {\n\t\treturn (size == bq.length);\n\t}", "boolean hasRead();", "boolean isEmpty(){\n return (book == null);\n }", "public boolean HasContent() {\n return rgbContent != null;\n }", "public boolean isEmpty() {\n\t\treturn front == null;\n\t}", "public boolean isSurfaceWorld()\n {\n return false;\n }", "boolean hasDocument();", "boolean hasDocument();", "boolean hasDocument();", "public boolean hasNext() {\r\n return (length > 0);\r\n }", "public boolean isSetFileData() {\n return this.fileData != null;\n }", "boolean hasCurrentDocument();", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn frontier.isEmpty();\n\t}", "@Override\n public boolean initializeIndexReader(String filename) {\n try {\n READER = DirectoryReader.open(FSDirectory.open(FileSystems.getDefault().getPath(filename)));\n } catch (IOException e) {\n READER = null;\n log.error(\"Failed to instantiate the index api.reader with directory: \" + filename);\n }\n return isInitialized();\n }", "public boolean wasRead(){\n return isRead==null || isRead;\n }", "public boolean initializeIndexReader() {\n return initializeIndexReader(Constants.INDEX_DIRECTORY);\n }", "@Override\n public boolean hasNext() {\n return null != current;\n }", "private boolean hasTHead() {\r\n\t\treturn null != this.getTHead();\r\n\t}", "public boolean hasProductsRS() {\n return productsRS_ != null;\n }", "@Override\n public boolean isEmpty() {\n return getSnapshot() == null;\n }", "public boolean filter(LocusContext context, SAMRecord read) {\n return (read.getCigar().numCigarElements() == 1);\n }", "public boolean isSearchPerformed()\n\t{\n\t\treturn this.searchPerformed || this.recordCount() > 0;\n\t}", "public boolean isTerm()\n {\n if (phase == 0)\n {\n return (loc.y == input.high_y);\n }\n if (phase == 3)\n {\n return (loc.y == input.high_y);\n\n }\n return false; \n\n }", "boolean hasRqText();", "public boolean hasRetrieveFile() {\n return msgCase_ == 2;\n }", "public boolean hasNext(){\n if(index < size && listR.get(index) != null){\n return true;\n }\n return false;\n }", "public boolean currentIsEmpty() {\n Object o = evaluateCurrent();\n if (o == Util.nullValue || o == null) {\n return true;\n }\n final RolapCube measureCube = getMeasureCube();\n if (measureCube == null) {\n return false;\n }\n // For other cell values (e.g. zero), the cell is deemed empty if the\n // number of fact table rows is zero.\n final int savepoint = savepoint();\n try {\n setContext(measureCube.getFactCountMeasure());\n o = evaluateCurrent();\n } finally {\n restore(savepoint);\n }\n return o == null\n || (o instanceof Number && ((Number) o).intValue() == 0);\n }", "public boolean hasRetrieveFile() {\n return msgCase_ == 2;\n }", "public boolean isReadable(){\n\n\t\ttry {\n\t\t\tIndexReader reader = IndexReader.open(getIndexDir(), true);\n\t\t\treader.close();\n\n\t\t} catch (IOException readingException) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public boolean isEmpty() {\n return vertexLayer.isEmpty();\n }", "private boolean checkRemainingRes() {\n for (int i = 0; i < playingField.getPlayingField().length; i++) {\n for (int j = 0; j < playingField.getPlayingField()[i].length; j++) {\n if (playingField.getPlayingField()[i][j].getResources() > 0) {\n return true;\n }\n }\n }\n return false;\n }", "boolean isEmpty() {\n return contents.size() == 0;\n }", "boolean isEmpty() {\n return contents.size() == 0;\n }", "@Override\n\tpublic boolean readData(File file) {\n return file.exists();\n\t}", "public boolean isSurfaceWorld() {\n\t\treturn false;\n\t}", "public boolean usesNormals() {\r\n return false;\r\n }", "public boolean hasNext() {\n\t\t\t\t\treturn !record.isEmpty();\n\t\t\t\t}", "public boolean hasNext() {\n return !lov.isEmpty();\n }", "public boolean hasNext() {\n return !lov.isEmpty();\n }", "public synchronized boolean isReadingFromFile(){\n\t\treturn isReadingFromFile;\n\t}", "@Override\r\n\t\tpublic boolean hasNext() {\r\n\t\t\treturn arr[index] != null && index < arr.length;\r\n\t\t}", "public boolean mo20821e() {\n return this.f18932b.isEmpty();\n }", "boolean isPaintedFace(int face) {\n return the_cube[face];\n }", "@Override\r\n public boolean isKnown ()\r\n {\r\n Shape shape = getShape();\r\n\r\n return (shape != null) && (shape != Shape.NOISE);\r\n }", "public boolean hasBasis() {\n return basisBuilder_ != null || basis_ != null;\n }", "public boolean isEmpty() {\n return deck[fFront] == null && deck[bFront] == null;\n }", "public final boolean mo2031a() {\n return this.f4204a.exists() || this.f4205b.exists();\n }", "private boolean checkEmpty() {\n\t\treturn this.array[0] == null;\n\t}", "public boolean isSearchable() {\n return (rawData != null && !rawData.optBoolean(Constants.HIDDEN_FIELD)\n && rawData.optBoolean(Constants.SEARCHABLE_FIELD));\n }", "public boolean mo20822f() {\n return this.f18933c.isEmpty();\n }", "boolean hasAsset();", "public boolean isEmpty()\n\t{ \n\t\treturn (front==-1);\n\t}", "public static boolean exists(){\n \t\treturn everbie != null;\n \t}", "@Override\n\tpublic boolean notEmpty() {\n\t\treturn count==0&&front==rear?true:false;\n\t}", "@MainThread\n public boolean isSurfaceCreated() {\n return (mVideoView != null && isSurfaceCreated && !mVideoView.getHolder().isCreating() && mVideoView.getHolder().getSurface() != null);\n }", "@Override\n public boolean hasNext() {\n return (this.index != values.length) && (values[index] != null);\n }", "public boolean isEmpty() {\n if (this.raiz == null) {\n return true;\n } else {\n return false;\n }\n }", "private final synchronized boolean m60360c() {\n return this.f49750a.getAll().isEmpty();\n }" ]
[ "0.55975777", "0.5332417", "0.53214985", "0.5236421", "0.52182245", "0.51717925", "0.5103879", "0.5096802", "0.50380915", "0.5031333", "0.49993163", "0.49821317", "0.49763396", "0.49681023", "0.49430433", "0.49250808", "0.48878896", "0.4861926", "0.4861926", "0.4861926", "0.48550114", "0.484919", "0.4845415", "0.48329446", "0.4826204", "0.4825086", "0.48068842", "0.48051614", "0.4803807", "0.47904515", "0.4788263", "0.47823676", "0.47804123", "0.47739705", "0.47689667", "0.47687885", "0.47621512", "0.47511214", "0.4748498", "0.47407255", "0.473555", "0.47277007", "0.4716215", "0.47038054", "0.46876472", "0.4682425", "0.46823484", "0.46819657", "0.4681597", "0.4681597", "0.4681597", "0.46737206", "0.46735993", "0.4661936", "0.46583465", "0.4658033", "0.46543247", "0.46522772", "0.46499264", "0.46487448", "0.46483475", "0.4644593", "0.46441668", "0.46408704", "0.46406054", "0.46390834", "0.46386567", "0.46381673", "0.4633056", "0.46324748", "0.46317267", "0.4631594", "0.4623634", "0.46209967", "0.46209967", "0.46180302", "0.46111643", "0.46065176", "0.4605637", "0.4600889", "0.4600889", "0.4599018", "0.4596944", "0.45961294", "0.45911494", "0.45880985", "0.45827436", "0.45816782", "0.45809785", "0.45795688", "0.45752734", "0.45728472", "0.456713", "0.45657802", "0.45642465", "0.45581913", "0.45581362", "0.45562238", "0.4554808", "0.45493934" ]
0.7062269
0
Created by Prince on 4/24/2018.
public interface OnObjectChangedListener<T> { public void onObjectChanged(T obj); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "public final void mo51373a() {\n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\tpublic void tires() {\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\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "private void m50366E() {\n }", "public void mo38117a() {\n }", "@Override\n protected void getExras() {\n }", "@Override\n\tprotected void interr() {\n\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override public int describeContents() { return 0; }", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "private Rekenhulp()\n\t{\n\t}", "private TMCourse() {\n\t}", "public final void mo91715d() {\n }", "@Override\n public int getSize() {\n return 1;\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\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 }", "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 }", "Petunia() {\r\n\t\t}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "private MetallicityUtils() {\n\t\t\n\t}", "private void m50367F() {\n }", "public void mo12628c() {\n }", "private void kk12() {\n\n\t}", "public Pitonyak_09_02() {\r\n }", "Consumable() {\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n public void init() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n public int width()\n {\n return widthCent; //Charlie Gao helped me debug the issue here\n }", "@Override\n void init() {\n }", "public void mo6081a() {\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\n\tpublic void nefesAl() {\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\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n public String toString() {\n return \"\";\n }", "public void mo12930a() {\n }", "@Override\n protected void initialize() {\n\n \n }", "public void m23075a() {\n }", "@Override\n public void init() {}", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "public void skystonePos4() {\n }", "private TAPosition()\n {\n\n }", "@Override\n public int describeContents()\n {\n return 0;\n }", "private Zeroes() {\n // This space intentionally left blank.\n }", "public void mo21779D() {\n }", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }" ]
[ "0.58758605", "0.5731627", "0.56827724", "0.55551606", "0.55457354", "0.5506289", "0.5495318", "0.54822797", "0.54822797", "0.5463477", "0.5433126", "0.5428887", "0.54136515", "0.54073685", "0.5368265", "0.5312497", "0.5310172", "0.53085524", "0.5302685", "0.5294905", "0.5290668", "0.528428", "0.52656025", "0.52652717", "0.52615136", "0.5253766", "0.5253128", "0.5238288", "0.5236391", "0.52124053", "0.52056783", "0.5183991", "0.5181216", "0.5175366", "0.5174467", "0.5166527", "0.51623964", "0.5159267", "0.51581204", "0.51581204", "0.51581204", "0.51581204", "0.51581204", "0.51581204", "0.51537526", "0.51537526", "0.51537526", "0.51537526", "0.51537526", "0.51537526", "0.51537526", "0.5146133", "0.51392424", "0.5137473", "0.5137037", "0.5133735", "0.5123706", "0.51221657", "0.5119145", "0.51190174", "0.5115997", "0.51115847", "0.5109059", "0.509149", "0.5089549", "0.5088471", "0.50862306", "0.5085891", "0.5080799", "0.5078567", "0.5078043", "0.5078043", "0.5078043", "0.5078043", "0.5078043", "0.50767314", "0.50767314", "0.50696313", "0.50648624", "0.50611365", "0.5054745", "0.50446033", "0.5040083", "0.50352484", "0.5033604", "0.5032623", "0.5030808", "0.50295544", "0.5028893", "0.5027255", "0.502587", "0.502587", "0.502587", "0.502587", "0.502587", "0.502587", "0.502587", "0.502587", "0.502587", "0.502587", "0.502587" ]
0.0
-1
TODO run the application modules
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void setupModules(){\n\t\tStart.setupModules();\n\t\t//add\n\t\t//e.g.: special custom scripts, workers, etc.\n\t}", "protected void initModules()\n {\n\n }", "public static void main(String arg[]) {\n\n\t\tUtility.runApplication();\n\t}", "public static void main(String[] args)\n {\n Injector guice = Guice.createInjector(new DiscountGuiceModule());\n\n // Inject the application which contains a separate object graph which contains all the business logic\n // When we call the top level class, BasicApplication, guice will inject every static dependency that we request\n // via @Inject\n BasicApplication basicApplication = guice.getInstance(BasicApplication.class);\n\n // now start the application\n basicApplication.start();\n }", "public void startApp()\r\n\t{\n\t}", "default void buildMainSpace() throws Exception {\n buildMainBuildModules();\n buildMainCheckModules();\n buildMainGenerateAPIDocumentation();\n buildMainGenerateCustomRuntimeImage();\n }", "public static void main(String[] args) {\n\t\trunApplication();\n\t}", "void run(IAppLogic logic);", "public void run() {\r\n\t\t\tModule module = null;\r\n\t\t\ttry {\r\n\t\t\t\t// Verificamos si el modulo ya esta abierto\r\n\t\t\t\tfor (int i = 0; i < desktopPane.getComponentCount(); i++) {\r\n\t\t\t\t\tComponent component2 = desktopPane.getComponent(i);\r\n\t\t\t\t\tif (moduleClass.isInstance(component2)) {\r\n\t\t\t\t\t\t// Si lo esta, lo seleccionamos y retornamos\r\n\t\t\t\t\t\tLoadingFrame.hide();\r\n\t\t\t\t\t\t((JInternalFrame) component2).setSelected(true);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tmodule = (Module) moduleClass.newInstance();\r\n\t\t\t\tdesktopPane.add((Component) module);\r\n\t\t\t\tLoadingFrame.hide();\r\n\t\t\t\t((JInternalFrame) module).setSelected(true);\r\n\t\t\t} catch (InstantiationException e) {\r\n\t\t\t\tErrorLogLoader.addErrorEntry(e);\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IllegalAccessException e) {\r\n\t\t\t\tErrorLogLoader.addErrorEntry(e);\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (PropertyVetoException e) {\r\n\t\t\t\tErrorLogLoader.addErrorEntry(e);\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "public static void main (String[] args) {\n\n Config config = ConfigUtils.loadConfig(\"/home/gregor/git/matsim/examples/scenarios/pt-tutorial/0.config.xml\");\n// config.controler().setLastIteration(0);\n// config.plans().setHandlingOfPlansWithoutRoutingMode(PlansConfigGroup.HandlingOfPlansWithoutRoutingMode.useMainModeIdentifier);\n// Scenario scenario = ScenarioUtils.loadScenario(config);\n// Controler controler = new Controler(scenario);\n// controler.run();\n\n\n// Config config = this.utils.loadConfig(IOUtils.extendUrl(ExamplesUtils.getTestScenarioURL(\"pt-tutorial\"), \"0.config.xml\"));\n config.controler().setLastIteration(1);\n config.plans().setHandlingOfPlansWithoutRoutingMode(PlansConfigGroup.HandlingOfPlansWithoutRoutingMode.useMainModeIdentifier);\n\n\n// try {\n Controler controler = new Controler(config);\n// final EnterVehicleEventCounter enterVehicleEventCounter = new EnterVehicleEventCounter();\n// final StageActivityDurationChecker stageActivityDurationChecker = new StageActivityDurationChecker();\n// controler.addOverridingModule( new AbstractModule(){\n// @Override public void install() {\n// this.addEventHandlerBinding().toInstance( enterVehicleEventCounter );\n// this.addEventHandlerBinding().toInstance( stageActivityDurationChecker );\n// }\n// });\n controler.run();\n }", "public static void main(String[] args) {\n startApplication();\n }", "public void start() {\n\t\tstartFilesConfig(true);\n\t\tstartSpamFilterTest(false);\n\t}", "@Override\n\t public void run(ApplicationArguments args) throws Exception {\n\n\t }", "public static void main(String[] args) {\n try {\n ModuleExtractionExamples.usingModuleExtractors();\n } catch (ExtractorException e) {\n e.printStackTrace();\n }\n //ModuleExtractionExamples.generatingSignatures();\n //ModuleExtractionExamples.writeSignaturesToFile();\n //etc...\n\n }", "private void start() {\n\n\t}", "public void run() {\n\t // Create the ouput directories\n\t interfDir = new File(outDirName+\"/\"+modelName);\n\t interfDir.mkdirs();\n\t implDir = new File(outDirName+\"/\"+modelName);\n\t implDir.mkdirs();\n\t // Create the parseAll visitor interface\n\t createParseAllVisitorInterface(interfDir);\n\t // Create the parseAll visitor implementation\n\t createParseAllVisitorImplementation(implDir);\n\t // Create the evaluateAll visitor interface\n\t createEvaluateAllVisitorInterface(interfDir);\n\t // Create the evaluateAll visitor implementation\n\t createEvaluateAllVisitorImplementation(implDir);\n\t}", "public static void main( String[] args )\n\t{\n\t\trunApp();\n\t}", "public static void main(String[] args) {\n Injector guice = Guice.createInjector(new DiscountGuiceModule());\n\n // Creates separate object graph with business logic, etc. Instantiate the main object on that\n MainAppWithCustomFactory application = guice.getInstance(MainAppWithCustomFactory.class);\n\n // Start your app\n application.start();\n }", "public static void main(String... args) {\n doMain().run();\n }", "public void run() {\n // The run method should be overridden by the subordinate class. Please\n // see the example applications provided for more details.\n }", "public void run() {\n Runtime.getRuntime().addShutdownHook(new MNOSManagerShutdownHook(this));\n\n OFNiciraVendorExtensions.initialize();\n\n this.startDatabase();\n\n try {\n final ServerBootstrap switchServerBootStrap = this\n .createServerBootStrap();\n\n this.setServerBootStrapParams(switchServerBootStrap);\n\n switchServerBootStrap.setPipelineFactory(this.pfact);\n final InetSocketAddress sa = this.ofHost == null ? new InetSocketAddress(\n this.ofPort) : new InetSocketAddress(this.ofHost,\n this.ofPort);\n this.sg.add(switchServerBootStrap.bind(sa));\n }catch (final Exception e){\n throw new RuntimeException(e);\n }\n\n }", "public interface AppModule extends ApplicationModule {\n void fetchApplist(String flowCode);\n\n List serviceCustomerCall(List inputList, String method);\n\n void fetchApplistpartner(String flowCode);\n\n List updatePaymentDetailsInCRM(List inputList);\n \n void fetchErrorMessage(String errorCode);\n\n void initLpgDistVo(String ftlFlag, String zipcodeFilter);\n\n void fetchAppListLpgLogIn();\n\n void fetchAppListCustomerNonLogin(String pflowCode);\n\n\n List initiatePaymentDetails(List inputList);\n\n List callChartAsync(List inputList);\n\n void insertIntoRoLocator(List jsonArrayList);\n\n void insertVehicleTypeRecord(String count);\n\n void insertProfileEnrichInfo(String FirstName, String LastName, String EmailId, String MobileNo);\n\n void insertRetailEnrichInfo(String FirstName, String LastName, String EmailId, String MobileNo);\n\n void insertIntoAoLocator(List jsonArrayList);\n\n void insertIntoPartnerDistLocator(List jsonArrayList);\n\n void insertIntoPartnerStockLocator(List jsonArrayList);\n}", "protected void startCoreModule() {\n LOGGER.info(\"Start metric service at level: {}\", METRIC_CONFIG.getMetricLevel().name());\n // load metric manager\n loadManager();\n // load metric reporter\n loadReporter();\n // do start all reporter without first time\n startAllReporter();\n }", "@Override public void run(ApplicationArguments args) {\n }", "public static void main(String[] args) {\n ItemRegistry itemRegistry = new ItemRegistry();\n Printer printer = new Printer();\n AccountingHandler accountingHandler = new AccountingHandler();\n InventoryHandler inventoryHandler = new InventoryHandler();\n Register register = new Register(printer, itemRegistry, accountingHandler, inventoryHandler);\n Controller contr = new Controller(register);\n View view = new View(contr);\n\n view.sampleExecution();\n }", "public static void main(String[] args) {\n\t\tConfig config = createJeruslaemConfig();\n\n\t\tScenario scenario = ScenarioUtils.loadScenario(config);\n\n\t\tControler controler = new Controler(scenario);\n\t\t\n\t\t// Add raptor\n\t\tcontroler.addOverridingModule(new SwissRailRaptorModule());\n\n\t\t\n SwissRailRaptorConfigGroup raptorConfig = ConfigUtils.addOrGetModule(config, SwissRailRaptorConfigGroup.class);\n \n\n\t\tcontroler.run();\n\t}", "public static void main(String[] args){\n // app.run(args);\r\n new SpringApplicationBuilder(MainApplication.class).web(true).run(args);\r\n }", "@Override\n public void run(ApplicationArguments args) {\n }", "public interface BlogLibTestMasterAppModule extends ApplicationModule {\r\n String helloMasterModule(String param);\r\n}", "private static void setupOsgi() {\r\n FrameworkStarter.getInstance().start();\r\n }", "public static void main(String[] args){\n FinagoController finagoController = new FinagoController();\n finagoController.run();\n }", "public void run() {\n final Server server = new Server(8081);\n\n // Setup the basic RestApplication \"context\" at \"/\".\n // This is also known as the handler tree (in Jetty speak).\n final ServletContextHandler context = new ServletContextHandler(\n server, CONTEXT_ROOT);\n final ServletHolder restEasyServlet = new ServletHolder(\n new HttpServletDispatcher());\n restEasyServlet.setInitParameter(\"resteasy.servlet.mapping.prefix\",\n APPLICATION_PATH);\n restEasyServlet.setInitParameter(\"javax.ws.rs.Application\",\n \"de.kad.intech4.djservice.RestApplication\");\n context.addServlet(restEasyServlet, CONTEXT_ROOT);\n\n\n try {\n server.start();\n server.join();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "public static void main(String[] args) {\n\t\tAbstractDataHandlerFactory dataHandlerFactory = DataHandler.getDataHandlerInstance(); \n\t\t\n\t\t// Create a Controller object to begin the application and control code flow \n\t\tController control = new Controller(dataHandlerFactory);\t\n\t}", "public static void main(String[] args){\n\n MyApp myApp = new MyApp(); //1\n myApp.runMyApp(); //2\n System.out.println(\"End of Program\"); //3\n }", "@Override\n protected void appStart() {\n }", "public void run() {\n\t\tport(8080);\n\n\t\t// Main Page, welcome\n\t\tget(\"/\", (request, response) -> \"Welcome!\");\n\n\t\t// Date\n\t\tget(\"/date\", (request, response) -> {\n\t\t\tDate d = new Date(\"frida.org\", Calendar.getInstance().get(Calendar.YEAR),\n\t\t\t\t\tCalendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DAY_OF_MONTH));\n\t\t\treturn om.writeValueAsString(d);\n\t\t});\n\n\t\t// Time\n\t\tget(\"/time\", (request, response) -> {\n\t\t\tTime t = new Time(\"frida.org\", Calendar.getInstance().get(Calendar.HOUR),\n\t\t\t\t\tCalendar.getInstance().get(Calendar.MINUTE), Calendar.getInstance().get(Calendar.SECOND));\n\t\t\treturn om.writeValueAsString(t);\n\t\t});\n\t}", "public static void main(String[] args) {\n // TODO code application logic here\n // some testing? or actually we can't run it standalone??\n }", "public static void main(String [] args){\n SmartPhone sm = new SmartPhone();\n sm.run();\n // System.out.println(sm.run());\n }", "public static void main() {\n \n }", "public void start() {\n System.out.println(\"OBRMAN started\");\n ApamManagers.addManager(this, 3);\n OBRMan.obr = new OBRManager(null, repoAdmin);\n obr.startWatchingRepository();\n }", "public static void main(String[] args){\n //WebFactory.setLoaderFactory(() -> new HelperLoader());\n launch(args);\n }", "private void runEm() {\n renameOriginalDomainConfig();\n\n testV3_0_1Domain();\n\n // after all the tests have run, move back the old domain\n restoreOriginalDomainConfig();\n\n // print results\n stat.printSummary();\n }", "public AuctionApp() {\r\n runAuctionApp();\r\n }", "public static void someApplicationBootupMethod() {\n if (!AgentLoader.loadAgentFromClasspath(\"avaje-ebeanorm-agent\", \"debug=1;packages=model.**\")) {\n System.out.println(\"avaje-ebeanorm-agent not found in classpath - not dynamically loaded\");\n }\n\n System.out.println(\"avaje-ebeanorm-agent loaded\");\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"HW\");\n\t\tSingle1.getInstance();\n\t\tSingle2.getInstance();\n\t}", "private void run()\n {\n searchLexDb(\"^providing_\", true);\n }", "public static void main(String[] args) {\n DatabaseController.login();\r\n\r\n //Log in to email\r\n Email.login();\r\n\r\n //Update local database - in real deployment this would run twice per day, not every startup\r\n SyncMain.main(new String[]{});\r\n\r\n //Load cached data\r\n CSVController.loadFiles();\r\n\r\n //Start GUI\r\n launch(args);\r\n\r\n }", "default void buildMainBuildModules() {\n var main = bach().project().spaces().main();\n var modules = main.declarations();\n if (modules.isEmpty()) {\n log(\"Main module list is empty, nothing to build here.\");\n return;\n }\n var s = modules.size() == 1 ? \"\" : \"s\";\n say(\"Build %d main module%s: %s\", modules.size(), s, modules.toNames(\", \"));\n\n var release = main.release();\n var feature = release != 0 ? release : Runtime.version().feature();\n var classes = bach().folders().workspace(\"classes-main-\" + feature);\n\n var workspaceModules = bach().folders().workspace(\"modules\");\n Paths.deleteDirectories(workspaceModules);\n if (feature == 8) {\n bach().run(buildMainJavac(9, classes)).requireSuccessful();\n buildMainSpaceClassesForJava8(classes);\n } else {\n bach().run(buildMainJavac(release, classes)).requireSuccessful();\n }\n\n Paths.createDirectories(workspaceModules);\n var jars = new ArrayList<Jar>();\n var javacs = new ArrayList<Javac>();\n for (var declaration : modules.map().values()) {\n for (var folder : declaration.sources().list()) {\n if (!folder.isTargeted()) continue;\n javacs.add(buildMainJavac(declaration, folder, classes));\n }\n jars.add(buildMainJar(declaration, classes));\n }\n if (!javacs.isEmpty()) bach().run(javacs.stream()).requireSuccessful();\n bach().run(jars.stream()).requireSuccessful();\n }", "public static void main(String[] args) {\r\n \t\r\n // Creates new controller named the main controller\r\n GlobalResources.MainControl = new Control();\r\n // Starts main application\r\n GlobalResources.MainControl.StartApplication();\r\n }", "@Override\n public void run() {\n if ((generate_modules_based_on_keyword==null)||(generate_modules_based_on_keyword.equals(\"\"))) {\n System.err.println(\"Error in module generation definition. Check format 'key:name1;name2;'\");\n } else {\n String[] parts = generate_modules_based_on_keyword.split(\":\",2);\n if (parts.length==2) {\n ArrayList<String> channelsToGenerate = new ArrayList<>();\n String[] channelNames = parts[1].split(\";\");\n for (int i=0;i<channelNames.length;i++) {\n channelsToGenerate.add(channelNames[i]);\n }\n pipe_out = pipe_in.generatePipe(parts[0], channelsToGenerate);\n pipe_out.name=pipe_in.toString()+pipe_suffix;\n } else {\n System.err.println(\"Error in module generation definition. Check format 'key:name1;name2;'\");\n }\n }\n }", "public static void main(String args[]){\r\n Application theApp = new Application();\r\n theApp.createAccounts();\r\n theApp.processAccounts();\r\n theApp.outputAccounts();\r\n\r\n }", "public void startup(){}", "private void updateModules()\n throws Exception\n {\n LogUtil.put(LogFactory.getInstance(\"Start\", this, \"updateModules\"));\n \n Vector vector = this.findNewModules();\n Iterator iterator = vector.iterator();\n while(iterator.hasNext())\n {\n Bundle bundle = this.install((URL) iterator.next());\n \n if(bundle != null)\n {\n bundle.start(MODULES_START_LEVEL);\n }\n }\n }", "private void runApp() {\n\t\t//TODO: Run to see one exception. Trace the code to understand. \n\t\t// Then change to nums.txt to see the other exception. \n\t\t\n\t\tString inputFile = \"nums_wrongname.txt\"; \n\t\t//String inputFile = \"nums.txt\";\n\t\ttry {\n\t\t\tdouble average = computeAverageForFile(inputFile);\n\t\t\tSystem.out.println(\"Average: \" + average);\n\t\t} catch(FileNotFoundException e) {\n\t\t\tSystem.err.println(\"File \" + inputFile + \" not found. Exiting.\");\n\t\t} catch(IOException e) {\n\t\t\tSystem.err.println(\"Error closing file.\");\n\t\t} // end try-catch\t\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tSystem.out.println(\"Start main\");\r\n\t\tSystem.out.println(\"sum of two num :\"+ new AppManager().sum(5,10));\r\n\t\tSystem.out.println(\"End main\");\r\n\t\t\r\n\t\t\r\n\t}", "public void onModuleLoad() {\n\t\tGWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onUncaughtException(Throwable e) {\n\t\t\t\tThrowable unwrapped = getExceptionToDisplay(e);\n\t\t\t\tAppClientFactory.printSevereLogger(\"Exception Caught !! \"+unwrapped.getMessage());\n\t\t\t}\n\t\t});\n\t\t\n\t\tDelayedBindRegistry.bind(appInjector);\n\t\tAppClientFactory.setAppGinjector(appInjector);\n\t\t ArrayList<LoadLibrary> loadLibraries = new ArrayList<LoadApi.LoadLibrary>();\n\t\t loadLibraries.add(LoadLibrary.ADSENSE);\n\t\t loadLibraries.add(LoadLibrary.DRAWING);\n\t\t loadLibraries.add(LoadLibrary.GEOMETRY);\n\t\t loadLibraries.add(LoadLibrary.PANORAMIO);\n\t\t loadLibraries.add(LoadLibrary.PLACES);\n\t\t loadLibraries.add(LoadLibrary.WEATHER);\n\t\t loadLibraries.add(LoadLibrary.VISUALIZATION);\n\t\t \n\t\t \n\t\tString device = BrowserAgent.returnFormFactorWithSizeView();\n\t\tString size[] = device.split(\"-\");\n\n\t\t\tappInjector.getAppService().getLoggedInUser(new SimpleAsyncCallback<UserDo>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onSuccess(UserDo loggedInUser) {\n\t\t\t\t\tAppClientFactory.setLoggedInUser(loggedInUser);\n\t\t\t\t\tUcCBundle.INSTANCE.css().ensureInjected();\n\t\t\t\t\tHomeCBundle.INSTANCE.css().ensureInjected();\n\t\t\t\t\tAppClientFactory.getInjector().getWrapPresenter().get().setLoginData(loggedInUser);\n\t\t\t\t\tappInjector.getPlaceManager().revealCurrentPlace();\n\t\t\t\t\tAppClientFactory.setProtocol(getHttpOrHttpsProtocol());\n\t\t\t\t\tregisterWindowEvents();\n\t\t\t\t}\n\t\t\t});\n\t\t\tAppClientFactory.setAppGinjector(appInjector);\n\n\t\tgetloggersStatus();\n\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 240px) and (max-width: 767px) {\" + PlayerStyleBundle.INSTANCE.getPlayerMobileStyle().getText() + \"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 768px) and (max-width: 991px) {\" + PlayerStyleBundle.INSTANCE.getPlayerTabletStyle().getText() + \"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 240px) and (max-width: 550px) {\" + PlayerSmallMobileBundle.INSTANCE.getPlayerSmallMobile().getText() + \"}\");\n\t\tPlayerStyleBundle.INSTANCE.getPlayerStyleResource().ensureInjected();\n\t\t\n\t\tStyleInjector.injectAtEnd(\"@media (max-width: 767px){\"+SearchCBundle.INSTANCE.getResponsiveStyle().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (max-width: 767px) and (orientation:portrait){\"+SearchCBundle.INSTANCE.getResponsive1Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (max-width: 767px) and (orientation:landscape){\"+SearchCBundle.INSTANCE.getResponsive2Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 480px) and (max-width: 767px){\"+SearchCBundle.INSTANCE.getResponsive3Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 240px) and (max-width: 319px){\"+SearchCBundle.INSTANCE.getResponsive4Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 320px) and (max-width: 479px){\"+SearchCBundle.INSTANCE.getResponsive5Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media screen and (min-width: 768px){\"+SearchCBundle.INSTANCE.getResponsive6Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 1200px){\"+SearchCBundle.INSTANCE.getResponsive7Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 768px) and (max-width: 991px) {\"+SearchCBundle.INSTANCE.getResponsive8Style().getText()+\"}\");\n\n\t\tSearchCBundle.INSTANCE.css().ensureInjected();\n\t\t\n\t\t\n\t\t\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 240px) and (max-width: 319px){\"+LoginPopUpCBundle.INSTANCE.getResponsiveStyle().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 320px) and (max-width: 479px){\"+LoginPopUpCBundle.INSTANCE.getResponsive1Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 480px) and (max-width: 767px){\"+LoginPopUpCBundle.INSTANCE.getResponsive2Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 768px) and (max-width: 991px){\"+LoginPopUpCBundle.INSTANCE.getResponsive3Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 1200px){\"+LoginPopUpCBundle.INSTANCE.getResponsive4Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media screen and (max-width: 767px) {\"+LoginPopUpCBundle.INSTANCE.getResponsive5Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media screen and (min-width: 768px) {\"+LoginPopUpCBundle.INSTANCE.getResponsive6Style().getText()+\"}\");\n\n\t\tLoginPopUpCBundle.INSTANCE.css().ensureInjected();\n\t\t\n\t\tStyleInjector.injectAtEnd(\"@media (max-width: 767px) {\"+AnalyticsTabCBundle.INSTANCE.getResponsiveStyle().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 768px) and (max-width: 991px) {\"+AnalyticsTabCBundle.INSTANCE.getResponsive1Style().getText()+\"}\");\n\t\t\n\t\tAnalyticsTabCBundle.INSTANCE.css().ensureInjected();\n\t\t\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 240px) and (max-width: 319px){\"+ResourcePlayerCBundle.INSTANCE.getResponsive1Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 320px) and (max-width: 479px){\"+ResourcePlayerCBundle.INSTANCE.getResponsive2Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 480px) and (max-width: 767px){\"+ResourcePlayerCBundle.INSTANCE.getResponsive3Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 768px) and (max-width: 992px){\"+ResourcePlayerCBundle.INSTANCE.getResponsive4Style().getText()+\"}\");\n\n\t\tResourcePlayerCBundle.INSTANCE.css().ensureInjected();\n\t\n\n\t\tStyleInjector.injectAtEnd(\"@media (max-width: 767px) {\"+CollectionSummaryIndividualCBundle.INSTANCE.getResponsiveStyle().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 768px) and (max-width: 991px) {\"+CollectionSummaryIndividualCBundle.INSTANCE.getResponsive1Style().getText()+\"}\");\n\t\t\n\t\tCollectionSummaryIndividualCBundle.INSTANCE.css().ensureInjected();\n\t\t\n\t\tStyleInjector.injectAtEnd(\"@media (max-width: 767px) {\"+CollectionPlaySummaryCBundle.INSTANCE.getResponsiveStyle().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 768px) and (max-width: 991px) {\"+CollectionPlaySummaryCBundle.INSTANCE.getResponsive1Style().getText()+\"}\");\n\t\t\n\t\tCollectionPlaySummaryCBundle.INSTANCE.css().ensureInjected();\n\t\t\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 480px) and (max-width: 767px){\"+FolderContainerCBundle.INSTANCE.getResponsiveStyle().getText()+\"}\");\n\t\tFolderContainerCBundle.INSTANCE.css().ensureInjected();\n\t}", "public static void main(String[] args){\n\t\tView view = new View();\r\n\t\tDatabaseInteraction model = new DatabaseInteraction();\r\n\r\n\t\t//Initialize controller. \r\n\t\tController controller = new Controller(view,model);\r\n\r\n\t\t//Connect database, start user interaction, and let the controller respond to user options. \r\n\t\tmodel.connectDatabase();\r\n\t\tcontroller.userInteracion();\r\n\t\tcontroller.respondToUserOption();\r\n\r\n\t}", "public static void main(String[] args) throws Exception {\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}", "private void runApp() {\n parkinglots = new ArrayList<>();\n accounts = new ArrayList<>();\n input = new Scanner(System.in);\n loadParkingLots();\n loadAccounts();\n\n processLoginCommand();\n processMainMenuCommand();\n\n saveAccounts();\n System.out.println(\"\\ngoodbye!\");\n }", "private void runApp() {\n boolean running = true;\n String command;\n\n while (running) {\n showCommands();\n command = input.next().toLowerCase();\n\n if (command.equals(\"exit\")) {\n running = false;\n } else {\n execute(command);\n }\n }\n\n System.out.println(\"\\nExiting.\");\n }", "@Override\n protected void startUp() {\n }", "public static void main(String[] args) throws Exception {\n\t\tApplicationContext factory = new AnnotationConfigApplicationContext(AppConfig.class);\n\t\t\n\t\t\n\t\tProductService service = (ProductServiceImpl) factory.getBean(ProductServiceImpl.class);\n\t\tSystem.out.println(\"Scanning Items.... \");\n\t\t\n\t\tservice.scanProductId(\"Item_1\");\n\t\tservice.scanProductId(\"Item_2\");\n\t\tservice.scanProductId(\"Item_3\");\n\t\tservice.scanProductId(\"Item_4\");\n\t\tservice.scanProductId(\"Item_5\");\n\t\tservice.scanProductId(\"Item_6\");\n\t\tservice.scanProductId(\"Item_7\");\n\t\t\n\t\tSystem.out.println(\"Calculating order amount....\");\n\t\tservice.calculateBill();\n\n\t\t//SpringApplication.run(OrderApplication.class, args);\n\t}", "public static void main(String [] args){\n MainController run = new MainController();\n int value = run.filesExist();\n if (value == 0) {\n run.fileQUserMssgExists();\n }\n else if (value == 1) {\n run.fileQUserMssgRoomsExists();\n }\n else if (value == 2) {\n run.fileQAllExists();\n }\n run.run(value);\n }", "@Override\n\tpublic void runMBA() {\n\t\t\n\t}", "@Override\n public void onModuleLoad() {\n }", "private void start() {\r\n\t\t// Clear the log file.\r\n\t\tBPCC_Logger.clearLogFile();\r\n\t\t\r\n\t\t// Initialize BPCC_Util static fields.\r\n\t\tBPCC_Util.initStaticFields();\r\n\t\t\r\n\t\t// Set logging level desired for test.\r\n\t\tBPCC_Util.setLogLevel(LogLevelEnum.DEBUG);\r\n\t\t\r\n\t\t// Initialize class global variables.\r\n\t\tinitVars();\r\n\t\t\r\n\t\tcreateAndShowGUI();\r\n\t}", "public void run() {\n\n /**\n * let the user the know what is going to happen\n */\n showExecutionStart();\n\n /**\n * create an archetype for the new application\n */\n executeArchetypeCommand();\n\n /**\n * Provide some delay to allow thread to create the archetype\n */\n splash = new SplashScreen();\n\n for (int i = 0; i < 7; i++) {\n updateStatus(i);\n try {\n Thread.sleep(500);\n } catch (InterruptedException ie) {\n ie.printStackTrace();\n }\n }\n\n hideSplashScreen();\n splash = null;\n\n /**\n * let the user the know what is going to happen\n */\n showExecutionEnd();\n }", "public void start() {\n\t\tSystem.out.println(\"BMW start method\");\n\t}", "public static void main(String[] args) {\n\t\tApplicationContext context = new ClassPathXmlApplicationContext(\"beans.xml\");\n\t\tSystem.out.println(\"context loaded\");\n\t\t// Sim sim = (Sim) context.getBean(\"sim\");\n\t\t/**\n\t\t * Avoid above type casting\n\t\t */\n\t\tSim sim = context.getBean(\"sim\", Sim.class);\n\t\tsim.calling();\n\t\tsim.data();\n\t}", "@Override\n public void start (Stage primaryStage) {\n Group root = new Group();\n Scene scene = new Scene(root, AppConstants.STAGE_WIDTH, AppConstants.STAGE_HEIGHT);\n ModulePopulator = new ModuleCreationHelper(root, scene, primaryStage);\n view = new View();\n scene.setFill(AppConstants.BACKGROUND_COLOR);\n // scene.getStylesheets().add(getClass().getResource(\"application.css\").toExternalForm());\n view.init(root, ModulePopulator);\n ModulePopulator.setView(view);\n ModulePopulator.createMainPageModules();\n view.initRunner(root, ModulePopulator);\n primaryStage.setTitle(\"SLogo!\");\n primaryStage.setScene(scene);\n primaryStage.show();\n\n System.out.println(\"App Has Started!\");\n }", "@BeforeClass\n\tpublic void openApplication() {\n\t\tSystem.out.println(\"application opened\");\n\t}", "public RunMe() throws IOException {\n\n\t\t// Load data\n\t\tloadDataMap();\n\t\t\n\t\t// Start server\n\t\tcfg = createFreemarkerConfiguration();\n\t\tsetPort(8081);\n\t\tinitializeRoutes();\n\t}", "public void start() {\n\n\t}", "public static void main(String[] args) {\n\t\tSeContainerInitializer initializer = SeContainerInitializer.newInstance();\n\t\ttry (final SeContainer container = initializer.initialize()) {\n\t\t\tApp app = container.select(App.class).get();\n\t\t\tapp.executar();\n\t\t}\n\t}", "void scanModulesHealth() {\n\t\t// activate main module action\n\t\tactivateMainModuleAction();\n\n\t\tlog.debug(\"Scanning modules.\");\n\t\tactionsFactory.executeAtomicModuleAction(this, \"metrics-check\", () -> iterateRegisteredModules(ACTIVITY_LABEL), false);\n\n\t\tif (!isWorking() || Objects.isNull(runnerFuture)) {\n\t\t\tlog.debug(\"Scanning is stopped.\");\n\t\t\treturn;\n\t\t}\n\t\tlog.debug(\"Rescheduling service for {} millis\", delay);\n\t\trunnerFuture = activityRunner.schedule(this::scanModulesHealth, delay, TimeUnit.MILLISECONDS);\n\t}", "public abstract void startup();", "public void initModules() {\n\t\tthis.loadAggregationModules();\n\t\tthis.loadOutputModules();\n\t\tthis.gui.setModules(aggregationModules, outputModules);\n\t}", "protected void start() {\n }", "public static void main(String[] a){\n\t\tSystem.out.println(\"Fullstack web development training!!\");\n\t}", "public static void main(String[] args) throws IOException\n {\n ApplicationContext applicationContext = new ClassPathXmlApplicationContext(\"application-context.xml\");\n MSManageService msManageService = (MSManageService) applicationContext.getBean(\"MSManageService\");\n MSErrorService msErrorService = (MSErrorService) applicationContext.getBean(\"MSErrorService\");\n MSMessageService msMessageService = (MSMessageService) applicationContext.getBean(\"MSMessageService\");\n msMessageService.run();\n\n }", "protected void init() {\n eachModule(ModuleHandler.INSTANCE::depends);\n \n // init, only enabled modules are run\n eachEnabledModule(ModuleHandler.INSTANCE::init);\n \n // listen for server world loading events\n // LoadWorldCallback.EVENT.register(server -> eachEnabledModule(m ->\n // m.loadWorld(server)));\n }", "public void run(String... args) throws Exception {\n\t\t\t\t\n\t}", "private void setup(){\n\n // menginisialisasi variabel component\n component = DaggerApplicationComponent.builder()\n .applicationModule(new ApplicationModule(this)).build();\n\n // memanggil fungsi inject\n component.inject(this);\n }", "public static void main(String[] args) {\n \n \n \n \n }", "void startup();", "void startup();", "@Override\n\tpublic void prepareModule() throws Exception {\n\n\t}", "public static void main(String[] args){\n\t\tXenVM vm22 = new XenVM(\"vm22\", \"172.16.1.22\", 22, \"root\", \"welcome\");\n\t\t//XenVM vm31 = new XenVM(\"vm31\", \"172.16.1.31\", 22, \"root\", \"welcome\");\n\t\t//XenVM vm31 = new XenVM(\"vm31\", \"172.16.1.31\", 22, \"root\", \"welcome\");\n\t\t//XenVM vm21 = new XenVM(\"vm21\", \"172.16.1.21\", 22, \"root\", \"welcome\");\n\t\t//StartApp s11 = new StartApp(vm11);\n\t\tStartApp s22 = new StartApp(vm22);\n\t\t//StartApp s31 = new StartApp(vm31);\n\t\t//StartApp s31 = new StartApp(vm31);\n\t\t//StartApp s21 = new StartApp(vm21);\n\t\t//s11.start();\n\t\ts22.start();\n\t\t//s31.start();\n\t\t//s11.join();\n\t\t//s12.join();\n\t\t//s31.join();\n\t\t//s21.start();\n\t\ts22.join();\n\t}", "public static void main(String[] args){\n new Testing().runTests();\r\n \r\n }", "public static void main(String[] args) {\r\n\r\n run();\r\n }", "public static void main(String[] args) { \n\t\t//we are calling a static method and passing it the name of the class where we have our Main method.\t\t\n\t\tSpringApplication.run(CourseApiApp.class, args);\n\t}", "public void run(String... args) throws Exception {\n\t\t\n\t}", "public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}", "public void runDemo()\n {\n manager.printAllProducts();\n \n int noProducts = manager.numberProductsInStock();\n \n int amount = 0;\n \n System.out.println(\"No of products in stock = \" + noProducts);\n \n demoDeliverProducts();\n demoSellProducts();\n }", "public void start() {\n\t\t\n\t}", "public void start() {\n\t\t\n\t}", "public ParkingApp() {\n runApp();\n }", "public void start() {\n\t\tthis.controller.run();\n\t}", "private void setupAllMafiosis()\n {\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tmApps = mRequestManager.getApps();\n\t\t\t\tpopulateGrid();\n\t\t\t}", "public static void main(String args[]){\n final Injector injector = Guice.createInjector(new FluxClientComponentModule(), new FluxClientInterceptorModule());\n SampleReplayEventOnStateWithMultipleReplayEvent SampleReplayEventOnStateWithMultipleReplayEvent = injector.getInstance(SampleReplayEventOnStateWithMultipleReplayEvent.class);\n SampleReplayEventOnStateWithMultipleReplayEvent.create(new StartEvent(\"example_multiple_replay_event_workflow_on_one_state\"));\n\n }" ]
[ "0.6972448", "0.637911", "0.6263331", "0.6191207", "0.6125978", "0.608618", "0.6079216", "0.59880614", "0.5929371", "0.5929282", "0.59081906", "0.5895038", "0.5879882", "0.5859736", "0.5843092", "0.58426386", "0.58242023", "0.5782106", "0.5767319", "0.57663244", "0.57656956", "0.5747025", "0.5745583", "0.5740779", "0.57402223", "0.57383955", "0.5737799", "0.57348406", "0.5727263", "0.571563", "0.57068837", "0.5692585", "0.5687969", "0.56855077", "0.5681348", "0.56783783", "0.56761956", "0.56705624", "0.5665692", "0.56647986", "0.5661508", "0.5645571", "0.56338626", "0.5619283", "0.56057703", "0.56024855", "0.5600207", "0.56", "0.55972636", "0.5582333", "0.5578735", "0.5576807", "0.5574104", "0.5569489", "0.5568825", "0.5566716", "0.5565894", "0.5563161", "0.55584663", "0.5551104", "0.55479246", "0.55475587", "0.5547557", "0.5547279", "0.55463475", "0.55412567", "0.5540666", "0.55376166", "0.5535934", "0.5534197", "0.55341053", "0.5527389", "0.5527361", "0.55247015", "0.5514567", "0.55125904", "0.5511872", "0.55111045", "0.54998404", "0.5495025", "0.54919785", "0.54899704", "0.54883385", "0.54819137", "0.54789335", "0.54789335", "0.5476167", "0.54742414", "0.54729974", "0.54704434", "0.54691696", "0.5466222", "0.54660505", "0.5458611", "0.54558796", "0.54558796", "0.54444796", "0.54437804", "0.5442696", "0.5440313", "0.54363316" ]
0.0
-1
private DecimalFormat df = new DecimalFormat("0.00"); // Constructor(s) // // Generic public constructor for a Bank object, requiring no specific params other than a reference to the Bank's GUI BankDisplay. This then produces a Bank object with default location = localhost and default port number 1234.
public Bank(BankDisplay bankDisplay) { this("bank", "localhost", 1234, bankDisplay); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BankAccount() {\n this(12346, 5.00, \"Default Name\", \"Default Address\", \"default phone\");\n }", "public Bank(){\n this(\"Seneca@York\", 0);\n }", "public BankAcc(){\r\n //uses another constuctor\r\n this(593,2.5,\"Deg\",\"Deg\",\"Deg\");\r\n System.out.println(\"EMpty\");;\r\n }", "private Bank() {\r\n\t\tsuper();\r\n\t\tlogService = new Logger(\"driverName\");\r\n\t\tlogger = new Logger(\"driverName\");\r\n\t\tthis.balance = balance;\r\n\t\tthis.clients = new Client[100];\r\n\t}", "private ARXDecimal(String format){\r\n if (format == null || format.equals(\"Default\")){\r\n this.format = null;\r\n this.string = null;\r\n this.locale = null;\r\n } else {\r\n this.format = new DecimalFormat(format);\r\n this.string = format;\r\n this.locale = null;\r\n }\r\n }", "public Bank() {\n\n }", "public Bank() {\n\t\tsuper();\n\t}", "public SavingsAccount(double balance)\n {\n startingBalance = balance;\n }", "public BankPanel() {\r\n\t super();\r\n\t}", "public DecimalConstant( BigDecimal value, String format)\n {\n super( Type.NUMBER, value);\n setFormat( format);\n }", "public BankAccount(double initialBalance) {\r\n\t\tbalance=initialBalance;\r\n\t}", "public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}", "public MyBank() {\n initComponents();\n fillClients();\n }", "public BankAccount(int balance) {\n\n this.balance = balance;\n\n }", "public BankAccount() {\n\t\tthis.money = 0;\n\t}", "public SavingsAccount()\n {\n super();\n this.interestRate = DEFAULT_RATE;\n System.out.println(\"Constructor is called.\");\n }", "public BankAccount()\n {\n \t//intializing instance variables\n \t//at the time object creation constuctor executes \n \t\n \taccountHolderName=\"unknow\";\n \taccountBalance=0;\n \t\n }", "public Currency(String country,double value, double valueUSD){\n this.country = country;\n this.value = value;\n this.valueUSD = valueUSD;\n}", "public BankATM() {\n getLocation();\n }", "public SavingsAccount(double rate) //setting interest rate with constructor\r\n { \r\n interestRate = rate;\r\n }", "public BankAcc(int accNum, double bal, String name, String email, String phone){\r\n System.out.println(\"DONE\");\r\n //can do some validation in the other functions\r\n //not nessacary\r\n setAccNum(accNum);\r\n this.bal=bal;\r\n this.name=name;\r\n this.email=email;\r\n this.phone=phone;\r\n\r\n }", "public Debit_Money() {\n initComponents();\n }", "public BankAccount(String holderName, String number, float balance){\r\n\t\tthis.holderName = holderName;\r\n\t\tthis.number = number;\r\n\t\tthis.balance = balance;\r\n\t}", "public Account(String name, double balance){\n\n this.name = name;\n\n if (balance > 0.0 )\n this.balance = balance;\n }", "public Bank(double cash, double interest)\r\n {\r\n super(cash);\r\n this.interest = interest;\r\n }", "public dc_wallet() {}", "public Account()\n {\n // initialise instance variables\n balance = 0.00;\n remainder = 0;\n }", "public BankAccount(int accountNum, String customerName, double balance){\n this.accountNum = accountNum;\n this. customerName = customerName;\n this.balance = balance;\n }", "public StudentSavingsAccount(double bal, String name) {\n\n \t\tsuper(bal, name);\n// \t super();\n// \t setName(name);\n// \t setBalance(bal);\n \t overdraftsBeforeFee = 3;\n \t System.out.println(\"double, String constructor called [StudentSavingsAccount]\");\t\n\n }", "public InvoiceBalance()\n {\n }", "public DefaultFormat() {\n }", "public MoneyTransfer() {\n }", "public DecimalFormatObjectDescription() {\n this(DecimalFormat.class);\n }", "public Wallet() {\n total_bal = 10;\n }", "protected PrintBill() \r\n\t{/* nothing needed, but this prevents a public no-arg constructor from being created automatically */}", "public Bank(String bankName,\n String location,\n int portNumber,\n BankDisplay bankDisplay) {\n\n this.bankName = bankName;\n this.location = location;\n this.portNumber = portNumber;\n this.bankDisplay = bankDisplay;\n\n // several lists for keeping track of account-related information\n hashMapOfAllAccts = new HashMap<>();\n hashMapOfSecretKeys = new HashMap<>();\n listOfAuctionHouseIDRecords = new ArrayList<>();\n listOfAgentIDRecords = new ArrayList<>();\n\n try {\n bankSetup();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Bank ()\n {\n super (\"Bank\", defaults, trans, sharedQueue);\n customer = new Source (0, defaults [0], \"Bank$Customer\", customer_es, sharedQueue);\n teller = new Facility (1, defaults [1], new LinkedList<Coroutine> (), teller_es, sharedQueue);\n exit = new Sink (2, defaults [2], null, sharedQueue);\n initModel (new DynamicNode [] { customer, teller, exit });\n \n }", "Bank(String name, double currentAmount) {\n this.accountName = name;\n this.currentAmount = currentAmount;\n }", "private ARXDecimal(String format, Locale locale) {\r\n if (format == null || format.equals(\"Default\")){\r\n this.format = null;\r\n this.string = null;\r\n this.locale = locale;\r\n } else {\r\n this.format = new DecimalFormat(format, new DecimalFormatSymbols(locale));\r\n this.string = format;\r\n this.locale = locale;\r\n }\r\n }", "public GlAccountBank () {\n\t\tsuper();\n\t}", "public BankAccount(double basicMoney) {\n\t\tthis.money = basicMoney;\n\t}", "public Account() //default constructor \n {\n this.balance = 0;\n this.account_number = 0;\n }", "public FeeAccount ()\n {\n }", "public Currency() {\n // Instances built via this constructor have undefined behavior.\n }", "@Test\n public void testBigDecimalConstructorDefaultCurrency() {\n new Money(new BigDecimal(\"1.231\"));\n }", "public Account() {\n this(0, 0.0, \"Unknown name\"); // Invole the 2-param constructor\n }", "public AccountDepositUI() {\n initComponents();\n }", "public ControlBank(Bank bank) {\r\n\t\tthis.bank = bank;\r\n\t}", "public Savings_Account (int account_num, double initial_balance, double interest_rate) \r\n {\r\n\r\n super (account_num, initial_balance);\r\n\r\n rate = interest_rate;\r\n\r\n }", "public BankAccount() {\t\n\t\tthis.accountNumber = UUID.randomUUID().toString().substring(0, 6);\n\t\tthis.balance = 0;\n\t\tthis.accountType = \"Bank account\";\n\t}", "public CurrencyConversion() {\n }", "BankAccount(){\n\t\tSystem.out.println(\"NEW ACCOUNT CREATED\");\t\n\t}", "public RealNumberFormat()\r\n\t{\r\n\t\tdf\t= new DecimalFormat( \"#,##0.000\" );\r\n\t}", "public BankAccount(String holderName, String number){\r\n\t\tthis.holderName = holderName;\r\n\t\tthis.number = number;\r\n\t\tthis.balance = 0;\r\n\t}", "public BankAccount1(String str, double initialBalance) {\n\t\tbalance = initialBalance;\n\t\tcustomerName = str;\n\t}", "public Balance() {\r\n value = BigDecimal.ZERO;\r\n }", "Account(int account_number,double balance) //pramiterized constrector\n {\n this.account_number=account_number;\n this.balance=balance;\n }", "public Account() {\n // special case of the word \"this\"\n this(\"01234\", 0.00, \"Default Name\", \"Default Email\", \"Default Phone\");\n System.out.println(\"Empty constructor called\"); // only called once when instantiated.\n }", "public BankAccount(int accountNum, String customerName){\n this.accountNum = accountNum;\n this.customerName = customerName;\n balance = 0;\n }", "public PriceBreakdown() {\n }", "public CortanteScreen(Cortante c) {\n super(\"Cortante\");\n df = new DecimalFormat(\"#,###,##0.00000\");\n this.c = c;\n initComponents();\n this.setLocationRelativeTo(null);\n }", "private void setUpFormat() {\n form = (DecimalFormat)NumberFormat.getNumberInstance();\n form.setMaximumFractionDigits(precision);\n }", "public BankNote(double value, String currency) {\n if (value <= 0 || currency.isEmpty() || currency.equals(null) || currency.isBlank()) {\n throw new IllegalArgumentException(\"Value is 0, or Non currency\");\n }\n this.value = value;\n this.currency = currency;\n this.serialNumber = nextSerialNumber;\n nextSerialNumber++;\n }", "public Bank(long accNumber, float accBalance) {\n\t\tsuper();\n\t\tthis.accNumber = accNumber;\n\t\tthis.accBalance = accBalance;\n\t}", "public static void bankChargesDemo() {\n BankCharges charge0 = new BankCharges();\n\n // Initialize the checksUsed field\n charge0.assignChecksUsed();\n\n // Initialize the accountBalance field\n charge0.setAccountBalance(399.00);\n\n // Display the bank statement\n System.out.println(charge0.statement());\n }", "public SavingsAccount(String n) {\n super(n); \n balance = 0;\n }", "public Money(float amount) {\n setAmountFloat(amount);\n }", "protected Account(String n, float b) {\n this(n); \n balance = b;\n }", "public EnterToAccount(Bank bank) {\n this.bank = bank;\n initComponents();\n setVisible(true);\n }", "public SavingsAccount() {\n\t}", "public void setBalance(double bal){\n balance = bal;\r\n }", "private void buildAccountBalancePane() // buildAccountBalancePane method start\n\t{\n\t\t// creating object\n\t\tbalanceOutput = new JTextArea();\n\t\t\n\t\t// object settings\n\t\tbalanceOutput.setText(log.balanceReport());\n\t\tbalanceOutput.setEditable(false);\n\t\tbalanceOutput.setFont(font);\n\t\tbalanceOutput.setRows(20);\n\t\t\n\t\t// adding object and scroll bar to panel\n\t\taccountBalancePane.add(balanceOutput);\n\t\taccountBalancePane.add(new JScrollPane(balanceOutput));\n\t}", "DefaultOwnedStock(){\n\t\tsuper(\"\");\n\t\tprinciple = new BigDecimal(0);\n\t\ttotalValue = new BigDecimal(0);\n\t\tnet = new BigDecimal(0);\n\t}", "private Currency(String name, double unitValueAsDollar)\n\t{\n\t\tthis.name = name;\n\t\tthis.unitValueAsDollar = unitValueAsDollar;\n\t}", "public static void main(String[] args) {\n Account a = new Account(52384, 9999.99);\r\n System.out.println(a); // toString()\r\n \r\n // Test Setters and Getters\r\n a.setBalance(2012d);\r\n\t System.out.println(\"Balance is: \" + a.getBalance());\r\n a.credit(999.99);\r\n\t System.out.println(\"Balance is: \" + a.getBalance());\r\n a.debit(999999d);\r\n System.out.println(a.toString()); // run toString() to inspect the modified instance\r\n \r\n \r\n // Test setDate()\r\n a.setBalance( 999999999999999999.99);\r\n System.out.println(a); // toString()\r\n }", "public Account(double balance) {\n\t\tthis.balance = balance;\n\t}", "Account(String name, double balance)\r\n\t{\r\n\t\t\r\n\t\tthis.name = name; //assign name to the instance variable name \r\n\t\t\r\n\t\t// validate that the balance is greater that 0.0; if it is not,\r\n\t\t// instance variable balance keeps its default value 0.0\r\n\t\tif(balance > 0.0) // if balance is valid\r\n\t\t\tthis.balance = balance; // assign balance to the instance variable balance\t\t\t\t\t\r\n\t}", "public Car(String licensePlate, double fuelEconomy){\n this.licensePlate = licensePlate;\n this.fuelEconomy = fuelEconomy;\n}", "public Bank() {\n\n\t\tcustomerList = new ArrayList<Customer>();\n\t\tCustomer C = new Customer(\"madison\", \"bynum\", \"madb\", \"123\");\n\t\tcustomerList.add(C);\n\t\temployeeList = new ArrayList<Employee>();\n\t\tEmployee E = new Employee(\"madi\", \"by\", \"madib\", \"1234\");\n\t\temployeeList.add(E);\n\t\tadminList = new ArrayList<Admin>();\n\t\tAdmin A = new Admin(\"amber\", \"stone\", \"amberstone195\", \"12345\");\n\t\tadminList.add(A);\n\t\tsbank.writeSerializeMyBank();\n\t\tsbank.loadSerializeMyBank();\n\t}", "public void setAmountBank(double amountBank) {\n this.amountBank = amountBank;\n }", "@Test\n public void testBigDecimalConstructorDefaultRounding() {\n new Money(new BigDecimal(\"1.231\"), Currency.getInstance(\"USD\"));\n }", "private Format()\n {\n super();\n }", "public static void main(String[] args) {\n BankAccount bankAccount = new BankAccount(11211, 0, \"adam smith\", \"[email protected]\", \"9090980980\");\n BankAccount tim = new BankAccount(\"tim\", \"[email protected]\", \"9090980980\");\n System.out.println(\"Account Number = \" + tim.getAccountNumber());\n System.out.println(\"Balance = \"+ tim.getBalance());\n System.out.println(\"Customer Name = \" + bankAccount.getCustomerName());\n System.out.println(\"Email = \" + bankAccount.getEmailAddress());\n System.out.println(\"Phone Number = \" + bankAccount.getPhoneNumber());\n System.out.println(\"deposit = \"+ bankAccount.getDeposit(90));\n System.out.println(\"new balance = \"+ bankAccount.getWithdrawal(200));\n }", "public CustomerPanel(PrinterInterface printer){\n super();\n receiver = new DepositItemReceiver(printer);\n}", "public FrmBillDisplay() {\n initComponents();\n }", "public SavingAccount(double initialBalance)\n\t\t { \n\t\t super(initialBalance);\n\t\t }", "public Account() {\n\t\t//starting amount is 1500\n\t\tmoney = 1500;\n\t}", "BankDetail() {\n this.isValid = new Boolean(false);\n this.bankAccountNo = new String();\n this.bankAccountHolderName = new String();\n this.bankCountry = new String();\n this.IFSC = new String();\n }", "public Deposit(int userAccountNumber, Screen atmScreen, BankDatabase atmBankDatabase,\n Keypad atmKeypad, DepositSlot atmDepositSlot) {\n // initialize superclass variables\n super(userAccountNumber, atmScreen, atmBankDatabase);\n // initialize references to keypad and deposit slot\n keypad = atmKeypad;\n depositSlot = atmDepositSlot;\n }", "public SavingsAccount(double startBalance, double startInterestRate)\n {\n super(startBalance);\n setInterestRate(startInterestRate);\n System.out.println(\"Overloaded Constructor called.\");\n }", "public FastCashs() {\n initComponents();\n }", "public SavingsAccount() {\n super();\n }", "public DecimalConstant( BigDecimal value)\n {\n this( value, null);\n }", "public ProfileBankAccount() {\r\n }", "public DepositMoneyStudentFrame() {\n initComponents();\n }", "public TransferMoney() {\n try {\n med = (AllMethods) Naming.lookup(\"rmi://localhost:3006/YourMoney\");\n\n } catch (MalformedURLException | NotBoundException | RemoteException ex) {\n System.out.println(ex);\n }\n initComponents();\n }", "public PortalController() {\n bank = new Bank();\n }", "public BankModel() {\n accounts = new ArrayList<AccountModel>();\n\n // Master account inbedded into system for easy access to test features.\n accounts.add(new AccountModel(\"c\", \"123\", 500));\n }", "public void setBank(Bank bank) {\r\n this.bank = bank;\r\n }", "public creditPayment(String nm,String expdate,long no,double paymentAmount)\n{\nname=nm;\nexdate=expdate;\ncardnumber=no;\namount = paymentAmount;\n}" ]
[ "0.6906077", "0.6615017", "0.6583509", "0.65787244", "0.6510953", "0.64063305", "0.6400169", "0.63267696", "0.6302539", "0.6286461", "0.6259258", "0.6251735", "0.62403744", "0.6214538", "0.62003565", "0.6187847", "0.61702806", "0.6140386", "0.6106748", "0.60804737", "0.60736006", "0.60599047", "0.60366577", "0.6016817", "0.6004529", "0.59841436", "0.5975922", "0.59677976", "0.5964272", "0.59543526", "0.5949293", "0.59458405", "0.5944674", "0.59295976", "0.5928596", "0.5907284", "0.58885676", "0.58843136", "0.58784544", "0.58738226", "0.5870732", "0.5864469", "0.5857111", "0.58082485", "0.5805565", "0.5804701", "0.5797577", "0.57956606", "0.5789982", "0.578242", "0.57806724", "0.5767641", "0.5728385", "0.5716425", "0.5713474", "0.57109326", "0.5700166", "0.5699898", "0.5694819", "0.5682391", "0.56676257", "0.5661212", "0.5653442", "0.565015", "0.5649403", "0.5638324", "0.5637689", "0.56372374", "0.56351763", "0.5633184", "0.5606317", "0.5605536", "0.5604288", "0.560307", "0.5588191", "0.5582659", "0.55770665", "0.55758935", "0.555583", "0.5553829", "0.5537721", "0.5536902", "0.55318326", "0.5526868", "0.55252194", "0.55100197", "0.55056506", "0.55032396", "0.54923844", "0.54918885", "0.5491027", "0.54834175", "0.5470777", "0.5468212", "0.5458116", "0.54548836", "0.5435457", "0.54321665", "0.54293627", "0.54291326" ]
0.7209503
0
Public constructor for a Bank object, allowing the initial specification of the Bank's (machine) location (e.g. localhost or network machine name) the Bank's port number used for communications, and a reference to the Bank's GUI BankDisplay object.
public Bank(String bankName, String location, int portNumber, BankDisplay bankDisplay) { this.bankName = bankName; this.location = location; this.portNumber = portNumber; this.bankDisplay = bankDisplay; // several lists for keeping track of account-related information hashMapOfAllAccts = new HashMap<>(); hashMapOfSecretKeys = new HashMap<>(); listOfAuctionHouseIDRecords = new ArrayList<>(); listOfAgentIDRecords = new ArrayList<>(); try { bankSetup(); } catch (IOException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Bank(BankDisplay bankDisplay) {\n this(\"bank\", \"localhost\", 1234, bankDisplay);\n }", "public ControlBank(Bank bank) {\r\n\t\tthis.bank = bank;\r\n\t}", "public Bank() {\n\t\tsuper();\n\t}", "public MyBank() {\n initComponents();\n fillClients();\n }", "public Bank(){\n this(\"Seneca@York\", 0);\n }", "public BankAccount() {\n this(12346, 5.00, \"Default Name\", \"Default Address\", \"default phone\");\n }", "public Bank() {\n\n }", "public BankPanel() {\r\n\t super();\r\n\t}", "public Bank ()\n {\n super (\"Bank\", defaults, trans, sharedQueue);\n customer = new Source (0, defaults [0], \"Bank$Customer\", customer_es, sharedQueue);\n teller = new Facility (1, defaults [1], new LinkedList<Coroutine> (), teller_es, sharedQueue);\n exit = new Sink (2, defaults [2], null, sharedQueue);\n initModel (new DynamicNode [] { customer, teller, exit });\n \n }", "public Bank() {\n\n\t\tcustomerList = new ArrayList<Customer>();\n\t\tCustomer C = new Customer(\"madison\", \"bynum\", \"madb\", \"123\");\n\t\tcustomerList.add(C);\n\t\temployeeList = new ArrayList<Employee>();\n\t\tEmployee E = new Employee(\"madi\", \"by\", \"madib\", \"1234\");\n\t\temployeeList.add(E);\n\t\tadminList = new ArrayList<Admin>();\n\t\tAdmin A = new Admin(\"amber\", \"stone\", \"amberstone195\", \"12345\");\n\t\tadminList.add(A);\n\t\tsbank.writeSerializeMyBank();\n\t\tsbank.loadSerializeMyBank();\n\t}", "public EnterToAccount(Bank bank) {\n this.bank = bank;\n initComponents();\n setVisible(true);\n }", "public Bank() {\n\t\tnamesTree = new BankAccountsBinarySearchTree(new AccountComparatorByName());\n\t\taccountNumbersTree = new BankAccountsBinarySearchTree(new AccountComparatorByNumber());\n\t}", "private Bank() {\r\n\t\tsuper();\r\n\t\tlogService = new Logger(\"driverName\");\r\n\t\tlogger = new Logger(\"driverName\");\r\n\t\tthis.balance = balance;\r\n\t\tthis.clients = new Client[100];\r\n\t}", "public BankAccount() {\t\n\t\tthis.accountNumber = UUID.randomUUID().toString().substring(0, 6);\n\t\tthis.balance = 0;\n\t\tthis.accountType = \"Bank account\";\n\t}", "public GlAccountBank () {\n\t\tsuper();\n\t}", "public BankAccount()\n {\n \t//intializing instance variables\n \t//at the time object creation constuctor executes \n \t\n \taccountHolderName=\"unknow\";\n \taccountBalance=0;\n \t\n }", "public BankAcc(){\r\n //uses another constuctor\r\n this(593,2.5,\"Deg\",\"Deg\",\"Deg\");\r\n System.out.println(\"EMpty\");;\r\n }", "public Bank(long accNumber, float accBalance) {\n\t\tsuper();\n\t\tthis.accNumber = accNumber;\n\t\tthis.accBalance = accBalance;\n\t}", "public BankATM() {\n getLocation();\n }", "public BankImpl() {\n persons = new ConcurrentHashMap<String, RemotePerson>();\n try {\n registry = LocateRegistry.createRegistry(8080);\n } catch (RemoteException e) {\n e.printStackTrace();\n System.exit(2);\n }\n }", "public void setBank(Bank bank) {\r\n this.bank = bank;\r\n }", "public PortalController() {\n bank = new Bank();\n }", "public BankAccount(String holderName, String number, float balance){\r\n\t\tthis.holderName = holderName;\r\n\t\tthis.number = number;\r\n\t\tthis.balance = balance;\r\n\t}", "BankDetail() {\n this.isValid = new Boolean(false);\n this.bankAccountNo = new String();\n this.bankAccountHolderName = new String();\n this.bankCountry = new String();\n this.IFSC = new String();\n }", "public BankAccount(String holderName, String number){\r\n\t\tthis.holderName = holderName;\r\n\t\tthis.number = number;\r\n\t\tthis.balance = 0;\r\n\t}", "public BankAccount(int accountNum, String customerName, double balance){\n this.accountNum = accountNum;\n this. customerName = customerName;\n this.balance = balance;\n }", "public Bank(double cash, double interest)\r\n {\r\n super(cash);\r\n this.interest = interest;\r\n }", "public BankAccount(int balance) {\n\n this.balance = balance;\n\n }", "public BankModel() {\n accounts = new ArrayList<AccountModel>();\n\n // Master account inbedded into system for easy access to test features.\n accounts.add(new AccountModel(\"c\", \"123\", 500));\n }", "public BankAcc(int accNum, double bal, String name, String email, String phone){\r\n System.out.println(\"DONE\");\r\n //can do some validation in the other functions\r\n //not nessacary\r\n setAccNum(accNum);\r\n this.bal=bal;\r\n this.name=name;\r\n this.email=email;\r\n this.phone=phone;\r\n\r\n }", "void setBank(shared.data.Bank bank);", "public BankAccount() {\n\t\tthis.money = 0;\n\t}", "public BankAccount(int accountNum, String customerName){\n this.accountNum = accountNum;\n this.customerName = customerName;\n balance = 0;\n }", "public void setBank(String bank) {\n\t\tif (bank == null)\n\t\t\tbank = \"\";\n\t\tthis.bank = bank;\n\t}", "Bank(String name, double currentAmount) {\n this.accountName = name;\n this.currentAmount = currentAmount;\n }", "public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}", "public ClientMain() throws RemoteException, MalformedURLException, NotBoundException\r\n\t{\r\n\t\t//server = (IServer) Naming.lookup(\"rmi://10.152.206.74:1099/bankingServer\");\r\n\t\tserver = (IServer) Naming.lookup(\"rmi://localhost:1099/bankingServer\");\r\n\r\n\t\tmodel = new BankModel();\r\n\r\n\t\tSystem.out.println(\"Client running\");\r\n\t}", "public EmployeeConnection(String id, String firstName, String lastName,\n\t\t\t\t\t\t\t\t\tString bank, String bsb, String account) {\n\t\tif (id == null)\n\t\t\tid = \"\";\n\t\tif (firstName == null)\n\t\t\tfirstName = \"\";\n\t\tif (lastName == null)\n\t\t\tlastName = \"\";\n\t\tif (bank == null)\n\t\t\tbank = \"\";\n\t\tif (bsb == null)\n\t\t\tbsb = \"\";\n\t\tif (account == null)\n\t\t\taccount = \"\";\n\t\tthis.id = id;\n\t\tthis.firstName = firstName;\n\t\tthis.lastName = lastName;\n\t\tthis.bank = bank;\n\t\tthis.bsb = bsb;\n\t\tthis.account = account;\n\t}", "public BankImpl() {\n accounts = new HashMap<Integer,Account>();\n }", "public ProfileBankAccount() {\r\n }", "BankAccount(){\n\t\tSystem.out.println(\"NEW ACCOUNT CREATED\");\t\n\t}", "public GlAccountBank (\n\t\t\tLong in_id\n ) {\n\t\tthis.setId(in_id);\n }", "public Deposit(int userAccountNumber, Screen atmScreen, BankDatabase atmBankDatabase,\n Keypad atmKeypad, DepositSlot atmDepositSlot) {\n // initialize superclass variables\n super(userAccountNumber, atmScreen, atmBankDatabase);\n // initialize references to keypad and deposit slot\n keypad = atmKeypad;\n depositSlot = atmDepositSlot;\n }", "public BankAccount(Customer customer) {\r\n\t\tthis.customer = customer;\r\n\t\tcustomerBankAccountList.add(customer);\r\n\t\t\r\n\t\tCustomerController.addBankAccountList(this);\r\n\t\t\r\n\t\tsilverState = new SilverLevel(this);\r\n\t\tgoldState = new GoldLevel(this);\r\n\t\tplatinumState = new PlatinumLevel(this);\r\n\t\t\r\n\t\tlevelState = silverState;\r\n\t\t\r\n\t}", "public void setBank(String bank) {\n this.bank = bank == null ? null : bank.trim();\n }", "public static BankMachine getInstance(ScreenInterface screenUI){\n\t\t\n\t\tif(instance == null){\n\t\t\t\n\t\t\tinstance = new BankMachine(screenUI);\n\t\t}\n\t\t\n\t\treturn instance;\n\t}", "public BankAccount(double initialBalance) {\r\n\t\tbalance=initialBalance;\r\n\t}", "public BankRegistrationController() {\n }", "public void setBank(String bank) {\r\n this.bank = bank == null ? null : bank.trim();\r\n }", "public void setBank(String bank) {\r\n this.bank = bank == null ? null : bank.trim();\r\n }", "public void setAmountBank(double amountBank) {\n this.amountBank = amountBank;\n }", "public void setBank(ch.crif_online.www.webservices.crifsoapservice.v1_00.CompanyAddressDescription bank)\n {\n generatedSetterHelperImpl(bank, BANK$0, 0, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_SINGLETON);\n }", "public Bank(String usrname) {\n super(\"Railway Reservation System::Bank Window\");\n initComponents();\n setLocation(300,80);\n setSize(700,590);\n try{\n\t\tBufferedImage img=ImageIO.read(getClass().getResourceAsStream(\"Train.gif\"));\n\t\tsetIconImage(img);\n\t}catch (Exception e)\n\t{}\n }", "public Account(Holder holder, int balance) {\n this.holder = holder;\n this.balance = balance;\n }", "public Bank(String name, int accs){\n bankAccounts = new Account[accs];\n bankName = name;\n maxAccounts = accs;\n currAccounts = 0; //empty\n }", "public BankAccount(String accountHolderName, String accountNumber, String routingNumber){\n this.mAccountHolderName = accountHolderName;\n this.mAccountNumber = accountNumber;\n this.mRoutingNumber = routingNumber;\n balance = BigDecimal.ZERO;\n }", "public Bank(long bankleitzahl) {\n if (bankleitzahl < 0) {\n throw new IllegalArgumentException(\"Bankleitzahl kann nicht negativ sein.\");\n }\n this.bankleitzahl = bankleitzahl;\n this.kontoMap = new TreeMap<Long, Konto>();\n this.nextKontoNummer = MIN_KONTONUMMER;\n }", "public Deposit(int userAccountNumber, Screen atmScreen, BankDataBase bankDatabase, UserInterface UI, DepositSlot atmDepositSlot)\n {\n super( userAccountNumber, atmScreen, bankDatabase);\n face = UI;\n depositSlot = atmDepositSlot;\n }", "public Account() {\r\n\t\tthis(\"[email protected]\", \"Account\");\r\n\t}", "private void bankSetup() throws IOException {\n bankProtocol = new BankProtocol(this);\n notificationServer = new NotificationServer(portNumber, bankProtocol);\n Thread serverThread = new Thread(notificationServer);\n serverThread.start();\n }", "@Override\n protected void setBankNum(int bankNum) {\n }", "public bankacc() {\n initComponents();uid_LB.setVisible(false);\n getContentPane().setBackground(new Color(51,0,204));\n }", "public GUI(Display display) {\n\t\t/* Init fields */\n\t\tGUI.display = display;\n\t\tGUI.gui = this;\n\t\t// displayThread = Thread.currentThread();\n\t\t/* Startup process */\n\t}", "public void setBankName(String bankName) {\n this.bankName = bankName;\n }", "public SimpleGUI(String p_host, String p_name) {\r\n super();\r\n initialize();\r\n int porti=1099;\r\n String adresa=\"192.165.43.195\"; \r\n try\r\n {\r\n this.rem = (ServerInterface)Naming.lookup(\"rmi://\"+adresa+\":\"+porti+\"/RMD\");\r\n \t\r\n this.id = rem.EnterGame(p_name);\r\n System.out.println(\"Your id is : \"+ id);\r\n \t\r\n if(id == 0)\r\n {\r\n System.out.println(\"Max Connection reached\");\r\n \t\r\n }\r\n else\r\n {\r\n this.name = rem.getName(id);\r\n this.setTitle(\"Welcome \" + name);\r\n \t\r\n GiveCards();\r\n \t\r\n }\r\n \r\n }\r\n catch (MalformedURLException e)\r\n {\r\n System.err.println(\"MalformedURLException: \"+e.getMessage());\r\n }\r\n catch (RemoteException e)\r\n {\r\n System.err.println(\"RemoteException: \" + e.getMessage());\r\n }\r\n catch (NotBoundException e)\r\n {\r\n System.err.println(\"NotBoundException: \"+e.getMessage());\r\n }\r\n }", "public void setBankNumber(java.lang.String bankNumber) {\n this.bankNumber = bankNumber;\n }", "public MainMIDlet() {\r\n\t\t/**\r\n\t\t * Load PIN BOY ID\r\n\t\t */\r\n\t\tConstants.setPinBoyID(this.getAppProperty(\"pinboy-id\"));\r\n\t\tdisplay = Display.getDisplay(this);\r\n\t\t\r\n\t\t/**\r\n\t\t * Let's display some environment settings.\r\n\t\t */\r\n\t\tstringItemSettings = new StringItem(\r\n\t\t\t\t\"Settings:\",\r\n\t\t\t\t\"\\nMobile client ID:\"\r\n\t\t\t\t+ Constants.getPinBoyID()\r\n\t\t\t\t+ \"\\nMicro Config:\"\r\n\t\t\t\t+ System.getProperty(\"microedition.configuration\")\r\n\t\t\t\t+ \"\\nMicro Profile:\"\r\n\t\t\t\t+ System.getProperty(\"microedition.profiles\"));\r\n\t\tform.append(textFieldServerAddress);\r\n\t\tform.append(textFieldPort);\r\n\t\tform.append(stringItemSettings);\r\n\t\tform.append(textFieldFileRoot);\r\n\t\tform.addCommand(exitCommand);\r\n\t\tform.addCommand(startCommand);\r\n\t\tform.setCommandListener(this);\r\n\t\tdisplay.setCurrent(form);\r\n\t}", "public AccountDepositUI() {\n initComponents();\n }", "public static Bank getInstance() {\r\n\t\treturn instance;\r\n\t}", "public CurrentAccount(int aoountNumber, String accountHolderName, double accountBalance, double creditLimit) {\n\t\tsuper(aoountNumber, accountHolderName, accountBalance);\n\t\tthis.creditLimit = creditLimit;\n\t}", "public BillingControl(ConnectionInf c,HosObject ho,HosDB hdb,HosSubject hs\n ,LookupObject lo) {\n theConnectionInf = c;\n theHosDB = hdb;\n theHO = ho;\n theLO = lo;\n theHS = hs;\n }", "public void setBank(String bank)\n\t{\n\t\tthis.bank = bank.trim().replaceAll(\" +\",\" \");\n\t}", "public dc_wallet() {}", "public BankAccount(double basicMoney) {\n\t\tthis.money = basicMoney;\n\t}", "public void setBankID(String value) {\n this.bankID = value;\n }", "public void setBankService(BankService bankService) {\r\n this.bankService = bankService;\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n clientsComboBox = new javax.swing.JComboBox<>();\n showButton = new javax.swing.JButton();\n reportButton = new javax.swing.JButton();\n aboutButton = new javax.swing.JButton();\n jScrollPane2 = new javax.swing.JScrollPane();\n infoTextPanel = new javax.swing.JTextPane();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"MyBank Clients\");\n setLocation(new java.awt.Point(0, 0));\n setLocationByPlatform(true);\n setName(\"myBankFrame\"); // NOI18N\n setResizable(false);\n\n clientsComboBox.setName(\"clientsComboBox\"); // NOI18N\n\n showButton.setText(\"Show\");\n showButton.setName(\"showButton\"); // NOI18N\n showButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n showButtonActionPerformed(evt);\n }\n });\n\n reportButton.setText(\"Report\");\n reportButton.setName(\"reportButton\"); // NOI18N\n reportButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n reportButtonActionPerformed(evt);\n }\n });\n\n aboutButton.setText(\"About\");\n aboutButton.setName(\"aboutButton\"); // NOI18N\n aboutButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n aboutButtonActionPerformed(evt);\n }\n });\n\n infoTextPanel.setName(\"infoTextPanel\"); // NOI18N\n jScrollPane2.setViewportView(infoTextPanel);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(clientsComboBox, 0, 256, Short.MAX_VALUE)\n .addComponent(jScrollPane2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(aboutButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(reportButton, javax.swing.GroupLayout.DEFAULT_SIZE, 73, Short.MAX_VALUE)\n .addComponent(showButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(clientsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(showButton))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(reportButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(aboutButton)\n .addGap(0, 187, Short.MAX_VALUE))\n .addComponent(jScrollPane2))\n .addContainerGap())\n );\n\n pack();\n }", "public Account() {\n this(0, 0.0, \"Unknown name\"); // Invole the 2-param constructor\n }", "public CreditsScreen()\n {\n }", "public banks() {\n initComponents();\n }", "public Account(String number, double balance, String customerName, String customerEmail, String customerPhone) {\n // set the instance's field variables directly, and do NOT use the setters inside constructor.\n this.number = number;\n this.balance = balance;\n this.customerName = customerName;\n this.customerEmail = customerEmail;\n this.customerPhone = customerPhone;\n }", "public void setBankId(long bankId) {\n this.bankId = bankId;\n }", "public BankAccount(String accountName, int balance) {\n this.accountName = accountName;\n this.balance = balance;\n this.valueDeposits = balance;\n this.valueWithdrawals = 0;\n this.maximumBalance = balance;\n this.minimumBalance = balance;\n }", "protected void setBankNum(int bankNum) {\n try {\n ShortMessage msg = new ShortMessage();\n msg.setMessage(ShortMessage.CONTROL_CHANGE, getChannel() - 1,\n 0x00, // Bank Select (MSB)\n bankNum / 128); // Bank Number (MSB)\n send(msg);\n msg.setMessage(ShortMessage.CONTROL_CHANGE, getChannel() - 1,\n 0x20, // Bank Select (LSB)\n bankNum % 128); // Bank Number (MSB)\n send(msg);\n } catch (InvalidMidiDataException e) {\n ErrorMsg.reportStatus(e);\n }\n }", "private BankMachine(ScreenInterface screenUI){\n\t\t\n\t\tthis.screenUI = screenUI;\n\t\tstate = MachineStates.INIT;\n\t\ttakeAction('a', null, null);\n\t}", "public account() {\n initComponents();\n autoID();\n branch();\n }", "private void createComboMemBank() {\r\n\t\tcomboMemBank = new Combo(sShell, SWT.READ_ONLY);\r\n\t\t\r\n\t\tcomboMemBank.setBounds(new Rectangle(54, 55, 92, 21));\r\n\t\tString items[] = new String[]{ \"Reserved\", \"EPC\", \"TID\", \"User\" };\r\n\t\tcomboMemBank.setItems(items);\r\n\t\tcomboMemBank.select(1);\r\n\r\n\t\t\r\n\t}", "BankAccount(String accountType){\n\t\tSystem.out.println(\"NEW ACCOUNT: \" + accountType);\n\t\tthis.accountType = accountType; \n\t}", "public Bank(BankAccount b1, BankAccount b2, BankAccount b3, Employee e1, Employee e2, Employee e3, Employee e4, Employee e5)\n {\n isOpen = true;\n account1 = b1;\n account2 = b2;\n account3 = b3;\n president = e1;\n vicePresident = e2;\n teller1 = e3;\n teller2 = e4;\n teller3 = e5;\n }", "public String getBank() {\r\n return bank;\r\n }", "public String getBank() {\r\n return bank;\r\n }", "public TransferMoney() {\n try {\n med = (AllMethods) Naming.lookup(\"rmi://localhost:3006/YourMoney\");\n\n } catch (MalformedURLException | NotBoundException | RemoteException ex) {\n System.out.println(ex);\n }\n initComponents();\n }", "void addBank(IBank bank) throws RemoteException;", "public LoanCompany(String str, CurrentBankAccount currBankAccount, ThreadGroup group) {\n \n super(group, str);\n \n this.currBankAccount = currBankAccount;\n this.companyGroup = group; \n \n c1[0] = new Transaction(university_names, 2550);\n c1[1] = new Transaction(university_names, 500);\n c1[2] = new Transaction(university_names, 1500);\n \n \n }", "public MainScreen() {\n init();\n setResizable(false);\n serialPort = new SerialCommSys();\n jComboBox2.setModel(new DefaultComboBoxModel(serialPort.getPorts()));\n }", "public BusinessInformation() {\r\n\t\tinitComponents();\r\n\r\n\t\t/*´¦ÀíÒ³ÃæÃÀ»¯*/\r\n\t\tthis.drawBusinessInformation();\r\n\r\n\t\tthis.setResizable(false);\r\n\t\tthis.setLocationRelativeTo(null);\r\n\t\t\r\n\t\tthis.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\r\n\t}", "protected Account(String n, float b) {\n this(n); \n balance = b;\n }", "public Builder setBankNo(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n bankNo_ = value;\n onChanged();\n return this;\n }", "public NewSessionGui() {\n initComponents();\n client = new HttpBraimClient();\n setLocationRelativeTo(null);\n }", "public BankingOperation(int type, Client client) {\n super(type);\n m_client = client;\n }" ]
[ "0.8605844", "0.71280783", "0.7049273", "0.6981808", "0.69022894", "0.68575746", "0.68258864", "0.67609346", "0.6715996", "0.6629781", "0.66230774", "0.6506314", "0.647385", "0.6472031", "0.63244027", "0.6308612", "0.6287644", "0.62727743", "0.62623", "0.6216001", "0.6178247", "0.61499435", "0.6079999", "0.60673475", "0.60510993", "0.6001462", "0.5969182", "0.5961214", "0.59390837", "0.5924098", "0.5871044", "0.5868634", "0.58610934", "0.5811376", "0.5799969", "0.5792701", "0.57904464", "0.57757646", "0.5765371", "0.5763599", "0.56696695", "0.5630726", "0.5613183", "0.56116635", "0.5583392", "0.5581694", "0.55621314", "0.55593383", "0.55476725", "0.55476725", "0.55434906", "0.5533069", "0.55068624", "0.5500581", "0.5490181", "0.5483822", "0.5470003", "0.54672384", "0.54646915", "0.546005", "0.54468", "0.543764", "0.5433708", "0.54252136", "0.5418096", "0.5415283", "0.54105383", "0.5405721", "0.5404972", "0.53828937", "0.53825414", "0.5379119", "0.5346844", "0.5334872", "0.5334049", "0.53296906", "0.5320842", "0.5298794", "0.5289364", "0.5288678", "0.5278187", "0.52752", "0.52750885", "0.5270259", "0.52673316", "0.5267152", "0.5266541", "0.5263902", "0.5261303", "0.5246839", "0.5246839", "0.52372086", "0.52370906", "0.52315366", "0.523083", "0.52284765", "0.52261186", "0.52237594", "0.52179915", "0.5214129" ]
0.7908719
1