query
stringlengths 7
33.1k
| document
stringlengths 7
335k
| metadata
dict | negatives
listlengths 3
101
| negative_scores
listlengths 3
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
TODO Autogenerated method stub | public static void main(String[] args) throws MalformedURLException, InterruptedException {
DesiredCapabilities capabilities= new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,"Rajesh Iphone");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,"ios");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION,"9.3.5");
capabilities.setCapability("udid","499ae5ae6d066971991c5d27e8fbff07899a489d");
capabilities.setCapability("bundleId","TAmobiletest.safarlauncher");
AppiumDriver driver= new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
Set<String> contextHandles = driver.getContextHandles();
System.out.println(contextHandles.size());
for(String contextname:contextHandles)
{
System.out.println(contextname);
if(contextname.contains("WEBVIEW"))
{
driver.context(contextname);
}
}
driver.get("http://www.google.com");
Thread.sleep(5000);
driver.findElementById("lst-ib").sendKeys("Sachin");
driver.findElementById("tsbb").click();
Thread.sleep(9000);
String Actual_Result = driver.findElementByXPath("//span[contains(text(),'Cricketer')]").getText();
System.out.println("Actual Result is "+Actual_Result);
} | {
"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}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"private stendhal() {\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\r\n\tpublic void dispase() {\n\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@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.66708666",
"0.65675074",
"0.65229905",
"0.6481001",
"0.64770633",
"0.64584893",
"0.6413091",
"0.63764185",
"0.6275735",
"0.62541914",
"0.6236919",
"0.6223816",
"0.62017626",
"0.61944294",
"0.61944294",
"0.61920846",
"0.61867654",
"0.6173323",
"0.61328775",
"0.61276996",
"0.6080555",
"0.6076938",
"0.6041293",
"0.6024541",
"0.6019185",
"0.5998426",
"0.5967487",
"0.5967487",
"0.5964935",
"0.59489644",
"0.59404725",
"0.5922823",
"0.5908894",
"0.5903041",
"0.5893847",
"0.5885641",
"0.5883141",
"0.586924",
"0.5856793",
"0.58503157",
"0.58464456",
"0.5823378",
"0.5809384",
"0.58089525",
"0.58065355",
"0.58065355",
"0.5800514",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57896614",
"0.5789486",
"0.5786597",
"0.5783299",
"0.5783299",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5760369",
"0.5758614",
"0.5758614",
"0.574912",
"0.574912",
"0.574912",
"0.57482654",
"0.5732775",
"0.5732775",
"0.5732775",
"0.57207066",
"0.57149917",
"0.5714821",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57115865",
"0.57045746",
"0.5699",
"0.5696016",
"0.5687285",
"0.5677473",
"0.5673346",
"0.56716853",
"0.56688815",
"0.5661065",
"0.5657898",
"0.5654782",
"0.5654782",
"0.5654782",
"0.5654563",
"0.56536144",
"0.5652585",
"0.5649566"
] | 0.0 | -1 |
Create an image file name | private static File createImageFile() throws IOException {
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String imageFileName = "JPEG_" + timeStamp + "_";
File storageDir = MyApplication.getContext().getExternalFilesDir(Environment.DIRECTORY_PICTURES);
File image = File.createTempFile(
imageFileName, /* prefix */
".jpg", /* suffix */
storageDir /* directory */
);
return image;
} | {
"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 }",
"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(String imgDir) throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = imgDir + File.separator + 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 }",
"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.6706409",
"0.6694521",
"0.6692518",
"0.66892946",
"0.6665624",
"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.67068315 | 18 |
The initial method to be executed when the class is invoked. The request parameter is extracted to a variable | @Override
public void doInit() {
action = (String) getRequestAttributes().get("action");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected String onInit(HttpServletRequest req, HttpServletResponse resp, FunctionItem fi,\n\t\t\tHashtable<String, String> params, String action, L l, S s) throws Exception {\n\t\treturn null;\n\t}",
"public void request() {\n }",
"private Request() {\n initFields();\n }",
"public RequestUrlHandler() {\n // requestService = SpringContextHolder.getBean(ScfRequestService.class);\n }",
"@Override\n\tpublic void initRequest() {\n\n\t}",
"@Override\n\tprotected void initial(HttpServletRequest req) throws SiDCException, Exception {\n\t\tLogAction.getInstance().initial(logger, this.getClass().getCanonicalName());\n\t}",
"public void doInitialAction(){}",
"public void init() {\n FacesContext context = FacesContext.getCurrentInstance();\n Map<String, String> paramMap = context.getExternalContext().getRequestParameterMap();//gets the info from the URL\n this.setFormId(paramMap.get(\"id\"));//gets the form ID from the URL and sets it to the variable\n\n\n this.startDateQuestionSet();//executes the method\n this.startMultQuestionSet();//executes the method\n this.startSingleQuestionSet();//executes the method\n this.startTextQuestionSet();//executes the method\n }",
"private RequestExecution() {}",
"Call mo35727a(Request request);",
"@Override\n\tpublic String init_request() {\n\t\treturn null;\n\t}",
"@Override\r\n\tpublic void execute(HttpServletRequest request) {\n\r\n\t}",
"void startPage(RequestContextHolder request);",
"public void init()\n {\n context = getServletContext();\n parameters = (Siu_ContainerLabel)context.getAttribute(\"parameters\");\n }",
"private WebRequest() {\n initFields();\n }",
"private Request() {}",
"private Request() {}",
"@Override\n public Object run() throws ZuulException {\n HttpServletRequest req = RequestContext.getCurrentContext().getRequest();\n logger.info(\">>> Request uri : {} \" , req.getRequestURL());\n return null;\n }",
"@Override\n\tprotected void init() throws Exception {\n\t\toid = getParameter(\"oid\");\n\t\tif (AppUtil.isEmpty(oid)) {\n\t\t\toid = getArgument(\"oid\");\n\t\t}\n\t\tif (AppUtil.isEmpty(oid)) {\n\t\t\tsetupNewPage();\n\t\t} else {\n\t\t\tsetupEditPage();\n\t\t}\n\t}",
"@Override\n\tpublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object object) throws Exception {\n\t\tlogger.info(request.getRequestURI());\n\t //method\n\t\tlogger.info(request.getMethod());\n\t //ip\n\t\tlogger.info(request.getRemoteAddr());\n\t\tEnumeration enu=request.getParameterNames(); \n\t\twhile(enu.hasMoreElements()){ \n\t\t\tString paraName=(String)enu.nextElement(); \n\t\t\tlogger.info(paraName+\": \"+request.getParameter(paraName));\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"private void callHandler(String method, HttpServletRequest request, HttpServletResponse response) throws IOException {\n JsonElement payload = getPayload(request, response);\n RequestContext context = new RequestContext(\n request, response, urlVariables, request.getParameterMap(), payload);\n PathNode apiStructure = getApiStructure(method);\n\n if (request.getPathInfo() == null) {\n logger.warn(\"Received \" + method + \" request with empty path.\");\n return;\n }\n\n PathNode.PathNodeResult result = apiStructure.getBindingForSubPath(request.getPathInfo());\n if (result != null) {\n urlVariables.putAll(result.getArgValues());\n result.getApiSpec().apiInterface.call(context);\n }\n }",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic CommandInput( HttpServletRequest req ){\r\n\t\t\t\t\r\n\t\tlogger.debug( \"CommandInput() start\" );\r\n\r\n\t\t//Parameter automatisch in die Map laden\r\n\t\tthis.params = new HashMap<String, Object>( (HashMap<String, Object>)req.getParameterMap() );\r\n\t\t\r\n\t\t//Session speichern\r\n\t\tthis.session = req.getSession();\r\n\t\t\r\n\t\tthis.locale = req.getLocale();\r\n\r\n\t\tlogger.debug( \"CommandInput() end\" );\r\n\r\n\t}",
"@Override\n public void init() {\n String[] args = this.getParameters().getRaw().toArray(new String[0]);\n // We run Spring context initialization at the time of JavaFX initialization:\n springContext = SpringApplication.run(MainApp.class, args);\n }",
"@Override\n\tpublic void OnRequest() {\n\t\t\n\t}",
"@Override\n protected void doInit() {\n super.doInit();\n this.startTime = (String) this.getRequest().getAttributes().get(\"startTime\");\n this.endTime = (String) this.getRequest().getAttributes().get(\"endTime\");\n this.interval = (String) this.getRequest().getAttributes().get(\"samplingInterval\");\n }",
"private void preRequest() {\n\t\tSystem.out.println(\"pre request, i am playing job\");\n\t}",
"@Override\n\tpublic void onRequestStart(String reqId) {\n\t\t\n\t}",
"public void initRequest() {\n repo.getData();\n }",
"public void handleInitRequest(ScenarioController scenarioController);",
"@Override\r\npublic void requestInitialized(ServletRequestEvent arg0) {\n\t\r\n}",
"@Override\n\tpublic void beforeAction(String method, HttpServletRequest request, HttpServletResponse response) {\n\t\t// Default behavior : nothing to do \n\t}",
"public abstract ModelAndView handleInit(HttpServletRequest req, HttpServletResponse res, Object inputCommand, BindException be) throws Throwable;",
"public void initIstance(HttpServletRequest request) {\n \tname = request.getParameter(\"name\");\n priceMin = request.getParameter(\"priceMin\");\n priceMax = request.getParameter(\"priceMax\");\n code = request.getParameter(\"code\");\n description = request.getParameter(\"description\");\n String hiddenStr = request.getParameter(\"hidden\");\n hidden = hiddenStr != null;\n typeIdes = request.getParameterValues(\"type\");\n }",
"@Override\n\tpublic void setRequest(Map<String, Object> arg0) {\n\t\tthis.request = arg0;\n\t}",
"@Override\n\t\t\t\t\tpublic void onReqStart() {\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onStart(int what, Object[] params) {\n\n\t\t\t\t\t}",
"HttpServletRequest getCurrentRequest();",
"public void init(HttpServletRequest request) throws ServletException {\n\t}",
"private void changeRequest(InstanceRequest request) {\r\n\t\t\r\n\t}",
"Object handle(Object request);",
"protected void onBeginRequest()\n\t{\n\t}",
"private PredictRequest() {\n\t}",
"@Override\n\tpublic void setRequest(Map<String, Object> arg0) {\n\n\t}",
"@Override\n\tprotected void init(VaadinRequest request) {\n\t\tUI.getCurrent().setLocale(Locale.ENGLISH);\n\t\t\n\t\t// Set the page title (window or tab caption)\n\t\tPage.getCurrent().setTitle(\"My Page\");\n\t\t// Set a session attribute\n\t\tVaadinSession.getCurrent().setAttribute(\"myattrib\", \"hello\");\n\t\t\n\t\t// Access the HTTP service parameters\n\t\tVaadinService.getCurrent().getBaseDirectory();\n\t\t\n\t\tnew CheckBoxFeatures(this).test();\n\t\t\n\t}",
"protected abstract String invoke(HttpServletRequest request) throws DriverException, WorkflowException;",
"@Override\n public void setServletRequest(HttpServletRequest arg0) {\n\n }",
"@Override\n public void init(final FilterConfig filterConfig) {\n Misc.log(\"Request\", \"initialized\");\n }",
"public void init(HttpServletRequest request) {\n\n\t\ttry {\n\t\t\tsuper.init(request);\n\t\t\tthis.dataComposer = (IDataComposer) super.getBeanFactory().getBean(HDIVUtil.getDataComposerName());\n\t\t\trequest.setAttribute(\"dataComposer\", this.dataComposer);\n\n\t\t} catch (Exception e) {\n\t\t\tString errorMessage = HDIVUtil.getMessage(\"helper.init\");\n\t\t\tthrow new HDIVException(errorMessage, e);\n\t\t}\n\t}",
"@Override\n public Object run() throws ZuulException {\n HttpServletRequest request = RequestContext.getCurrentContext().getRequest();\n logger.info(\"request-> {} request uri -> {}\", request, request.getRequestURI());\n\n return null;\n }",
"public CreateIndividualPreAction() {\n }",
"@RequestMapping(value = \"/testRequestMethod\", method = { RequestMethod.GET, RequestMethod.POST })\n @ResponseBody\n public String testF(final HttpServletRequest request) {\n System.out.println(\"testReqeustMethod\");\n final String key = request.getParameterNames().nextElement();\n final String value = request.getParameter(key);\n System.out.println(key + \"(\" + value + \")\");\n\n return \"/module_index<br>\" + \"Parameter name: \" + key + \"<br>Parameter value: \" + value;\n }",
"String execute(HttpServletRequest request);",
"@Override\r\n\t\t\tpublic void onRequest() {\n\t\t\t\t\r\n\t\t\t}",
"public FrameworkCommand(String input, ObjectType init) \n {\n commandString = input.toUpperCase();\n initiator = init;\n\n // todo: verb as first word?\n \n /* This is a crummy timestamp.. We'll hope to do better in subclasses \n using scheduler instances. */\n lTimestamp = System.currentTimeMillis() * 1000;\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html\");\n PrintWriter out = response.getWriter();\n\n ServletContext context = getServletContext();\n Enumeration<String> e = context.getInitParameterNames();\n\n String str = \"\";\n while (e.hasMoreElements()) {\n str = e.nextElement();\n out.print(\"<br> \" + context.getInitParameter(str));\n }\n\n processRequest(request, response);\n }",
"Object executeMethodCall(String actionName, String inMainParamValue) throws APIException;",
"public GrizzletRequest getRequest();",
"private static void setRequest(Object request) {\n\t\tif (null != request) {\n\t\t\tMDC.put(ApplicationConstants.REQUEST, request.toString());\n\t\t}\n\t}",
"public void doMyStartupStuff() {\n System.out.println(\"init method\");\n }",
"public void init() {\n ServletContext context = getServletContext();\r\n host = context.getInitParameter(\"host\");\r\n port = context.getInitParameter(\"port\");\r\n user = context.getInitParameter(\"user\");\r\n pass = context.getInitParameter(\"pass\");\r\n }",
"public void initiateAction() {\r\n\t\t// TODO Auto-generated method stub\t\r\n\t}",
"void request(RequestParams params);",
"public void init() {\n ServletContext context = getServletContext();\n host = context.getInitParameter(\"host\");\n port = context.getInitParameter(\"port\");\n user = context.getInitParameter(\"user\");\n pass = context.getInitParameter(\"pass\");\n }",
"private DemoProcessStartEmailForWebservice() {\n\n }",
"public Http()\n {\n numberOfParameters = -1;\n }",
"@Override\n public void doInit(Page page, Map<String, Object> args) throws Exception {\n Selectors.wireVariables(page, this, Selectors.newVariableResolvers(getClass(), null));\n\n UserCredential cre = authService.getUserCredential();\n if (cre == null || cre.isAnonymous()) {\n Executions.sendRedirect(\"/login/\");\n }\n }",
"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 void invoke(HttpRequest request, HttpResponse response) throws IOException, ServletException {\n Processor servletProcessor = new ServletProcessor();\n Processor staticProcessor = new StaticResourceProcessor();\n Processor defaultProcessor = new DefaultProcessor();\n staticProcessor.setProcessor(defaultProcessor);\n servletProcessor.setProcessor(staticProcessor);\n servletProcessor.process(request, response);\n }",
"public void initMethod(){\n\t}",
"@Override\r\n\tpublic Result<?> preHandle(RequestParam<?> param) {\n\t\treturn null;\r\n\t}",
"public ServantObject servant_preinvoke(org.omg.CORBA.Object self,\n String operation,\n Class expectedType);",
"@Override\n protected void init(PageDto page, HttpServletRequest request, HttpServletResponse response, Model model) {\n\n }",
"public FunctionRequestAjax() {\r\n\t\tsuper();\r\n\t}",
"private void onPreRequestData(int tag) {\n }",
"static HttpRequestInitializer getRequestInitializer() {\n return new HttpRequestInitializer() {\n @Override\n public void initialize(final HttpRequest arg0) {\n }\n };\n }",
"@RequestMapping(value = \"/addInit\")\n public String addInit() {\n return genericService.addInit();\n }",
"com.uzak.inter.bean.test.TestRequest.TestBeanRequest getRequest();",
"@RequestMapping(\"/start\")\n public void initialTurn() {\n playerService.initialTurn();\n }",
"@Override\n\tpublic void setServletRequest(HttpServletRequest arg0) {\n\t\t\n\t}",
"protected void initialize() { \n param1 = SmartDashboard.getNumber(\"param1\");\n param2 = SmartDashboard.getNumber(\"param2\");\n param3 = SmartDashboard.getNumber(\"param3\");\n param4 = SmartDashboard.getNumber(\"param4\");\n command = new C_DriveBasedOnEncoderWithTwist(param1, param2, param3);\n }",
"ServletRequestInjector getRequestInjector();",
"public void init() {\n\t\tServletContext context = getServletContext();\n\t\thost = context.getInitParameter(\"host\");\n\t\tport = context.getInitParameter(\"port\");\n\t\tuser = context.getInitParameter(\"user\");\n\t\tpass = context.getInitParameter(\"pass\");\n\t}",
"private void runBaseInit(HttpServletRequest request, HttpServletResponse response) throws Exception {\n SimApi.initBaseSim();\n }",
"public void init() {\n\t\tServletContext context = getServletContext();\n\t\thost = context.getInitParameter(\"host\");\n\t\tport = context.getInitParameter(\"port\");\n\t\tuser = context.getInitParameter(\"user\");\n\t\tpass = context.getInitParameter(\"pass\");\n\t}",
"public void setInitialParameters() {\n /** DO NOTHING */\n }",
"public void doRequest( HttpServletRequest rqs, HttpServletResponse rsp ) throws ServletException, IOException {\n\n StopWatch sw = new StopWatch();\n sw.reset();\n\n sw.start( rqs.getRequestURI() );\n\n Core core = (Core) getServletContext().getAttribute( \"core\" );\n\n logger.debug( \"Query : {}\", rqs.getQueryString() );\n logger.debug( \"URI : {}\", rqs.getRequestURI() );\n logger.debug( \"METHOD : {}\", rqs.getMethod() );\n logger.debug( \"CORE : {}\", core );\n\n /* Instantiating request and response */\n Request request = new Request( rqs, core.getDefaultTemplate() );\n request.setLocaleFromCookie( \"language\" );\n\n Response response = new Response( rsp );\n response.setCharacterEncoding( \"UTF-8\" );\n\n request.setStopWatch( sw );\n\n logger.debug( \"[Parameters] {}\", rqs.getParameterMap() );\n\n /* Instantiating context */\n VelocityContext vc = new VelocityContext();\n vc.put( \"title\", \"\" );\n\n request.setContext( vc );\n request.getContext().put( \"request\", request );\n request.setRequestParts( rqs.getRequestURI().split( \"/\" ) );\n logger.debug( \"------ {} -----\", Arrays.asList( request.getRequestParts() ) );\n\n vc.put( \"currentUrl\", rqs.getRequestURI() );\n\n request.setUser( core.getAnonymousUser() );\n request.setTheme( core.getDefaultTheme() );\n\n request.getStopWatch().stop( rqs.getRequestURI() );\n\n WebResponse r = null;\n if(request.getRequestParts().length > 0 && request.getRequestParts()[0].equalsIgnoreCase(\"static\")) {\n \ttry {\n\t\t\t\tr = ((Autonomous)core.getRoot().getChild(\"static\")).autonomize(request);\n\t\t\t} catch (Throwable e) {\n\t\t\t\tthrow new ServletException(e);\n\t\t\t}\n } else {\n request.getStopWatch().start( \"Authentication\" );\n\n logger.debug( \"THE USER: {}\", request.getUser() );\n\n logger.debug( \"AUTHENTICATING\" );\n try {\n\t core.getAuthentication().authenticate( request, response );\n\t\t\t\n\t\t\t logger.debug( \"THE USER: {}\", request.getUser() );\n\t\t\t request.getStopWatch().stop( \"Getting user\", true );\n\t\t\t\n\t\t\t request.getStopWatch().stop( \"Authentication\" );\n\t\t\t request.getStopWatch().start( \"Render page\" );\n\t\t\n\t\t // Render the page\n\t\t Runner runner = core.render( request );\n\t\t runner.injectContext(request);\n\t\t r = runner.run();\n\t\t request.getUser().setSeen();\n\t\t } catch( CoreException e ) {\n\t\t e.printStackTrace();\n\t\t /*\n\t\t if( response.isRenderingMain() ) {\n\t\t response.renderError( request, e );\n\t\t } else {\n\t\t response.sendError( e.getCode(), e.getMessage() );\n\t\t }\n\t\t */\n\t\t r = new ErrorResponse(e).badRequest();\n\t\t } catch( Throwable e ) {\n\t\t logger.error( \"CAUGHT ERROR\" );\n\t\t e.printStackTrace();\n\t\t generateException( request, rsp.getWriter(), e, e.getMessage() );\n\t\t }\n }\n \n r.respond(request, response);\n\n sw.stop();\n logger.info( \"Request response: {}\", response.getResponse() );\n\n // Render the bottom\n /*\n if( response.isRenderingMain() ) {\n try {\n vc.put( \"seconds\", sw.getSeconds() );\n response.getWriter().print( core.getTemplateManager().getRenderer( request ).render( \"org/seventyeight/web/bottomPage.vm\" ) );\n } catch( TemplateException e ) {\n e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n }\n */\n\n //logger.info( sw.print( 1000 ) );\n System.out.println( sw.print( 10000 ) );\n }",
"public MyCallSite() {\n// mh = findTarget();\n super(findTarget());\n }",
"@Override\n public void onInitialDPRequest(InitialDPRequest arg0) {\n\n }",
"public void handleRequest(Request req) {\n\n }",
"@Override\n public void action() {\n System.out.println(\"Matchmaker Behaviour\");\n addBehaviour(new RequestToMatchMakerBehaviour());\n\n }",
"@RequestMapping(value = { \"/simple\"})\r\n\tpublic ModelAndView init(HttpServletRequest request) {\r\n\t\treturn new ModelAndView(\"simple\");\r\n\t}",
"protected void onPrepareRequest(HttpUriRequest request) throws IOException {\n\t\t// Nothing.\n\t}",
"public void begin(WebRequest theRequest) {\r\n theRequest.addParameter(\"auction\", \"239\");\r\n theRequest.addParameter(\"amount\", \"392\");\r\n theRequest.addParameter(\"bid\", \"923\");\r\n\r\n // add the user parameters to login\r\n theRequest.addParameter(\"firstName\", \"James\");\r\n theRequest.addParameter(\"lastName\", \"Bond\");\r\n theRequest.addParameter(\"e-mail\", \"[email protected]\");\r\n }",
"@Test\n\tpublic void testGetRequestParameter() {\n\t}",
"public interface Command {\n /**\n * @param request from browser\n * @return String page\n */\n String execute(HttpServletRequest request);\n}",
"public interface BeforeHandler {\n void execute(Map<String, Object> body,HttpServletRequest request) throws Exception;\n}",
"@RequestMapping(\"/loginPage\")\n\tpublic String init(HttpServletRequest request) {\n\t\treturn \"login\";\n\t}",
"public void setRequest(GhRequest param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }",
"public void setRequest(GhRequest param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }",
"public Call_simple() {\n }"
] | [
"0.62182343",
"0.615576",
"0.6108483",
"0.6084121",
"0.6074229",
"0.60479885",
"0.5998022",
"0.5987606",
"0.5855498",
"0.58328307",
"0.57890075",
"0.5746675",
"0.5719743",
"0.56515366",
"0.56476825",
"0.5632698",
"0.5632698",
"0.5592429",
"0.55634934",
"0.55509806",
"0.5535654",
"0.55197376",
"0.5506294",
"0.5503744",
"0.5498861",
"0.5494897",
"0.54899645",
"0.545706",
"0.545484",
"0.54324853",
"0.54283",
"0.54068893",
"0.5404373",
"0.53910404",
"0.5384118",
"0.53792393",
"0.537653",
"0.5362258",
"0.535779",
"0.535438",
"0.53454244",
"0.53419834",
"0.5326773",
"0.5325774",
"0.5323298",
"0.5314494",
"0.53129244",
"0.5309289",
"0.53004587",
"0.528717",
"0.52820355",
"0.5280596",
"0.52727205",
"0.5272278",
"0.5271322",
"0.52669495",
"0.526644",
"0.5265078",
"0.5246742",
"0.5246091",
"0.5245251",
"0.5228683",
"0.5228542",
"0.5218571",
"0.5208614",
"0.5207577",
"0.52026594",
"0.5200287",
"0.5193232",
"0.51854247",
"0.5184651",
"0.51712096",
"0.51668155",
"0.5166241",
"0.51593316",
"0.5155392",
"0.5150762",
"0.5149575",
"0.5136236",
"0.5136081",
"0.51341325",
"0.512745",
"0.5121745",
"0.51177895",
"0.510788",
"0.5104505",
"0.51032037",
"0.5102956",
"0.5102288",
"0.50997144",
"0.509468",
"0.5093398",
"0.5080986",
"0.50801724",
"0.5075026",
"0.5059448",
"0.50561774",
"0.50554156",
"0.50554156",
"0.50545573"
] | 0.6617874 | 0 |
Checks for the request attribute and invoke the corresponding method for business logic | @Get
public String serviceRequest() {
counter.increment(endpoint);
boolean rateResult = false;
boolean cdrResult = false;
boolean tcdrResult = false;
// Get the list of enabled resources
enabledResourceList = getEnabledResources();
// Service the request
try {
if (action.equalsIgnoreCase("rate")) {
logger.debug("Attempting to generate a Rate");
rateResult = generateRate();
} else if (action.equalsIgnoreCase("cdr")) {
logger.debug("Attempting to generate a CDR");
cdrResult = generateCdr();
} else if (action.equalsIgnoreCase("t-cdr")) {
logger.debug("Attempting to generate a CDR for T-nova");
tcdrResult = generateTNovaCdr();
}
// Construct the response
if (rateResult) {
return "The rate generation was successful";
} else if (cdrResult) {
return "The cdr generation was successful";
} else if (tcdrResult) {
return "The T-Nova cdr generation was successful";
} else {
return "Operation Failed";
}
}catch (Exception e){
logger.error("Error while generating it: "+e.getMessage());
return "Operation Failed";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void checkRequest(String theRequest, HttpServletRequest request, HttpServletResponse response) {\n try {\n\n Method requestMethod = this.getClass().getDeclaredMethod(theRequest, HttpServletRequest.class, HttpServletResponse.class);\n requestMethod.invoke(this, request, response);\n\n } catch (IllegalAccessException ex) {\n System.err.println(\"IllegalAccessException Error: \" + ex.getCause());\n } catch (IllegalArgumentException ex) {\n System.err.println(\"IllegalArgumentException Error: \" + ex.getCause());\n } catch (NoSuchMethodException ex) {\n System.err.println(\"NoSuchMethodException Error: \" + ex.getCause());\n } catch (SecurityException ex) {\n System.err.println(\"SecurityException Error: \" + ex.getCause());\n } catch (InvocationTargetException ex) {\n System.err.println(\"InvocationTargetException Error: \" + ex.getCause());\n }\n }",
"protected abstract String invoke(HttpServletRequest request) throws DriverException, WorkflowException;",
"public abstract boolean isAppropriateRequest(Request request);",
"@Override\r\n\tprotected void validateData(ActionMapping arg0, HttpServletRequest arg1) {\n\t\t\r\n\t}",
"@Override\n\tpublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object object) throws Exception {\n\t\t\n\t\tString hospitalCode = request.getParameter(\"hospitalCode\");\n\t\tif (StringUtils.isBlank(hospitalCode)) {\n\t\t\tlogger.error(\"hospitalCode is null\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tString tradeMode = request.getParameter(\"tradeMode\");\n\t\tif (StringUtils.isBlank(tradeMode)) {\n\t\t\tlogger.error(\"tradeMode is null\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tString totalFee = request.getParameter(\"totalFee\");\n\t\tif (StringUtils.isBlank(totalFee)) {\n\t\t\tlogger.error(\"totalFee is null\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t}",
"protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)\r\n/* 27: */ throws Exception\r\n/* 28: */ {\r\n/* 29:84 */ Object command = getCommand(request);\r\n/* 30:85 */ ServletRequestDataBinder binder = bindAndValidate(request, command);\r\n/* 31:86 */ BindException errors = new BindException(binder.getBindingResult());\r\n/* 32:87 */ return handle(request, response, command, errors);\r\n/* 33: */ }",
"Object handle(Object request);",
"@Override\r\n\tpublic void execute(HttpServletRequest request) {\n\r\n\t}",
"@Override\n\tpublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object object) throws Exception {\n\t\tlogger.info(request.getRequestURI());\n\t //method\n\t\tlogger.info(request.getMethod());\n\t //ip\n\t\tlogger.info(request.getRemoteAddr());\n\t\tEnumeration enu=request.getParameterNames(); \n\t\twhile(enu.hasMoreElements()){ \n\t\t\tString paraName=(String)enu.nextElement(); \n\t\t\tlogger.info(paraName+\": \"+request.getParameter(paraName));\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"private void callHandler(String method, HttpServletRequest request, HttpServletResponse response) throws IOException {\n JsonElement payload = getPayload(request, response);\n RequestContext context = new RequestContext(\n request, response, urlVariables, request.getParameterMap(), payload);\n PathNode apiStructure = getApiStructure(method);\n\n if (request.getPathInfo() == null) {\n logger.warn(\"Received \" + method + \" request with empty path.\");\n return;\n }\n\n PathNode.PathNodeResult result = apiStructure.getBindingForSubPath(request.getPathInfo());\n if (result != null) {\n urlVariables.putAll(result.getArgValues());\n result.getApiSpec().apiInterface.call(context);\n }\n }",
"private void processRequest(HttpServletRequest request, HttpServletResponse response) {\n }",
"@Override\n\tpublic void validateRequest(BaseRequest request) {\n\t\t\n\t}",
"public void request() {\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(ValidationScenarioHandlerServlet.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"@Override\n public void doInit() {\n action = (String) getRequestAttributes().get(\"action\");\n }",
"public void handleRequest(Request req) {\n\n }",
"private void caseForfeit(Request request) {\n }",
"private void processRequest(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response) {\n\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(ValidationScenarioHandlerServlet.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"void onBoardUser(@Valid String x,HttpServletRequest request)throws Exception;",
"@Override\n protected boolean validate(HttpServletRequest request) {\n\t\tlog.debug(\"ContectCtl validate method start\");\n boolean pass = true;\n\n if (DataValidator.isNull(request.getParameter(\"name\"))) {\n request.setAttribute(\"name\",\n PropertyReader.getValue(\"error.require\", \"Name\"));\n pass = false;\n }else if (!DataValidator.isName(request.getParameter(\"name\"))) {\n\t\t\trequest.setAttribute(\"name\",\n\t\t\t\t\tPropertyReader.getValue(\"error.name\", \"Name\"));\n\t\t\tpass = false;\n\t\t}\n \n if (DataValidator.isNull(request.getParameter(\"email\"))) {\n\t\t\trequest.setAttribute(\"email\",\n\t\t\t\t\tPropertyReader.getValue(\"error.require\", \"Email Address\"));\n\t\t\tpass = false;\n\t\t} else if (!DataValidator.isEmail(request.getParameter(\"email\"))) {\n\t\t\trequest.setAttribute(\"email\",\n\t\t\t\t\tPropertyReader.getValue(\"error.email\", \"Email Address\"));\n\t\t\tpass = false;\n\t\t}\n\n if (DataValidator.isNull(request.getParameter(\"message\"))) {\n request.setAttribute(\"message\",\n PropertyReader.getValue(\"error.require\", \"Message\"));\n pass = false;\n }\n\n log.debug(\"ContectCtl validate method end\");\n return pass;\n }",
"protected void service(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletException, IOException {\n\tif (aRequest.getAttribute(\"EXTRANET_METHOD\") == null) {\n\t\tsuper.service(aRequest, aResponse);\n\t} else {\n\t\t// If comming from a forward, determine if GET method should be invoked\n\t\tString lMethod = (String) aRequest.getAttribute(\"EXTRANET_METHOD\");\n\t\tif (lMethod != null && lMethod.equals(\"GET\")) {\n\t\t\tdoGet(aRequest, aResponse);\n\t\t} else {\n\t\t\tsuper.service(aRequest, aResponse);\n\t\t}\n\t}\n}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n if (request.getParameter(\"btnGuardar\") != null) {\n btnGuardar(request, response);\n \n } else if (request.getParameter(\"btnModificar\") != null) {\n btnModificar(request, response);\n } else if (request.getParameter(\"btnCancelar\") != null) {\n \n } else if (request.getParameter(\"codigoSeleccionado\") != null) {\n if (request.getParameter(\"stOpcion\").equals(\"M\")) {\n \n cargarModificar(request, response);\n \n } else if (request.getParameter(\"stOpcion\").equals(\"E\")) {\n btnEliminar(request, response);\n }\n \n }\n }",
"public DataHolder processRequest(DataHolder indataholder) throws java.rmi.RemoteException;",
"void processRequest(RequestInfo<T, O> requestInfo, Class<T> TClass, Class<O> OClass, boolean invalidateCache);",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n WebAppConfig config = new WebAppConfig(getInitParameter(WebAppConfig.APP_CONTEXT_PATH),\r\n getInitParameter(WebAppConfig.ACTIVITY_PATH),\r\n getInitParameter(WebAppConfig.ACTIVITY_PREFIX),\r\n getInitParameter(WebAppConfig.ACTIVITY_SUFFIX));\r\n\r\n ActivityManager manager = new ActivityManager(config);\r\n\r\n manager.performActivity(request, response);\r\n }",
"void handleRequest();",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String acao = request.getParameter(\"acao\");\n if (acao.equals(\"logar\")) {\n logar(request, response);\n } else if(acao.equals(\"logout\")) {\n logout(request, response);\n }\n }",
"public abstract boolean validate(Request request, Response response);",
"@Override\r\n public boolean isRequest() {\n return false;\r\n }",
"public Object handleRequest(P request) throws Exception;",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n if(request.getParameter(\"action\")!=null){\n String action=request.getParameter(\"action\");\n switch(action){\n case \"Traducir\":\n validateNucleotid(request,response);\n break;\n }\n }else{\n response.sendRedirect(\"index.jsp\");\n }\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n \n }",
"protected boolean validate(HttpServletRequest request) {\r\n/* 54 */ log.debug(\"RoomCtl Method validate Started\");\r\n/* */ \r\n/* 56 */ boolean pass = true;\r\n/* */ \r\n/* */ \r\n/* */ \r\n/* */ \r\n/* 61 */ if (DataValidator.isNull(request.getParameter(\"room\"))) {\r\n/* 62 */ request.setAttribute(\"room\", \r\n/* 63 */ PropertyReader.getValue(\"error.require\", \" RoomNo\"));\r\n/* 64 */ pass = false;\r\n/* */ } \r\n/* */ \r\n/* */ \r\n/* */ \r\n/* */ \r\n/* 70 */ if (DataValidator.isNull(request.getParameter(\"description\"))) {\r\n/* 71 */ request.setAttribute(\"description\", \r\n/* 72 */ PropertyReader.getValue(\"error.require\", \"Description\"));\r\n/* 73 */ pass = false;\r\n/* */ } \r\n/* */ \r\n/* */ \r\n/* */ \r\n/* 78 */ if (\"-----Select-----\".equalsIgnoreCase(request.getParameter(\"hostelId\"))) {\r\n/* 79 */ request.setAttribute(\"hostelId\", \r\n/* 80 */ PropertyReader.getValue(\"error.require\", \"Hostel Name\"));\r\n/* 81 */ pass = false;\r\n/* */ } \r\n/* */ \r\n/* */ \r\n/* */ \r\n/* 86 */ log.debug(\"RoomCtl Method validate Ended\");\r\n/* */ \r\n/* 88 */ return pass;\r\n/* */ }",
"@Override\n\t\t\tpublic boolean preHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2) throws Exception {\n\t\t\t\tSystem.out.println(\"自定义拦截器preHandle\");\n\t\t\t\treturn true;\n\t\t\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String acao = request.getParameter(\"acao\");\n if (acao.equals(\"preparar\")) {\n preparar(request, response);\n } else {\n if (acao.equals(\"confirmar\")) {\n confirmar(request, response);\n }\n }\n }",
"@Override\n protected final void parseRequest(final HttpServletRequest request, HttpServletResponse response) {\n\n parsePath(request);\n\n LOGGER.warning(\"[REST]: \" + request.getMethod() + \"|\" + apiName + \"/\" + resourceName + \"|\" + request.getHeader(\"Current-Page\"));\n\n // Fixes BS-400. This is ugly.\n I18n.getInstance();\n\n api = APIs.get(apiName, resourceName);\n api.setCaller(this);\n\n super.parseRequest(request, response);\n\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"protected abstract void processRequest( HttpServletRequest request, HttpServletResponse response )\n throws ServletException, IOException;",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (ParseException ex) {\n Logger.getLogger(OwnerController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"boolean hasRequest();",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (ParseException ex) {\n Logger.getLogger(OwnerController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n String contextPath = req.getContextPath();\n// String path = uri.replaceAll(contextPath, \"\");\n Method method = urlMethodMap.get(contextPath);\n if (method != null) {\n String packageName = methodPackageMap.get(method);\n String controllerName = nameMap.get(packageName);\n UserController userController = (UserController) instanceMap.get(controllerName);\n try {\n method.setAccessible(true);\n method.invoke(userController);\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n }\n }\n }",
"@Override\n\tpublic void beforeAction(String method, HttpServletRequest request, HttpServletResponse response) {\n\t\t// Default behavior : nothing to do \n\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\n\tpublic String requestedProcess(HttpServletRequest request, HttpServletResponse response) throws Throwable {\n\t\trequest.setCharacterEncoding(\"utf-8\");\n\t\tresponse.setCharacterEncoding(\"utf-8\");\n\t\t\n\t\tString email = request.getParameter(\"email\");\n\t\tSystem.out.println(\"idCheckAction>>> email : \"+email);\n\t\t\n\t\tuserDAO dataMgr = new userDAO();\n\t\tboolean emailChecker = dataMgr.proc_emailChecker(email);\n\t\trequest.setAttribute(\"emailChecker\", emailChecker);\n\t\t\n\t\treturn \"/mgr_account/idCheck.jsp\";\n\t}",
"@ModelAttribute //该注解用于在执行请求调用方法前执行\n public void setReqAndRes(HttpServletRequest request, HttpServletResponse response){\n Logger logger = LoggerFactory.getLogger(UserController.class);\n logger.error(\"请求执行--\"+request.getRequestURL()+\", remote--\"+request.getRemoteAddr()+\", local--\"+request.getLocalAddr());\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"public abstract void handle(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ApiException, IOException;",
"protected void service(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tString actionType=req.getParameter(\"actionType\");\n\t\tif(actionType.equals(\"query\"))\n\t\t{\n\t\t\tquery(req,resp);\n\t\t}\n\t\tif(actionType.equals(\"kanweizhang\"))\n\t\t{\n\t\t\tkanweizhang(req,resp);\n\t\t}\n\t\tif(actionType.equals(\"tuiweizhang\"))\n\t\t{\n\t\t\ttuiweizhang(req,resp);\n\t\t}\n\t\t\n\t\tif(actionType.equals(\"querywenlei\"))\n\t\t{\n\t\t\tquerywenlei(req,resp);\n\t\t}\n\t}",
"public boolean isRequest(){\n return false;\n }",
"@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"private Object processHttpRequestIfNecessary(Object argument) {\n\t\tif (argument instanceof HttpServletRequestWrapper) { // ShiroHttpServletRequest?\n\t\t\tHttpServletRequestWrapper wrap = (HttpServletRequestWrapper) argument;\n\t\t\t/*\n\t\t\t * Wrapping request with resolved XSS security.\n\t\t\t */\n\t\t\twrap.setRequest(resolver.newXssHttpRequestWrapper((HttpServletRequest) wrap.getRequest()));\n\t\t} else if (argument instanceof HttpServletRequest) {\n\t\t\targument = resolver.newXssHttpRequestWrapper((HttpServletRequest) argument);\n\t\t}\n\n\t\treturn argument;\n\t}",
"public boolean handle(ExchangeHelper exchangeHelper) throws IOException {\n if (method == null || method == exchangeHelper.getMethod()) {\n System.out.println(String.format(\"%s request received on path '%s', using handler: %s\", exchangeHelper.getMethod(), exchangeHelper.getUriPath(), handler.getClass().getSimpleName()));\n\n //Run pre filters\n for (RouteFilter filter : preFilters) {\n if (!filter.doFilter(exchangeHelper)) {\n //We don't continue, but the request was handled\n return true;\n }\n }\n\n //OK, we are a route for that method\n handler.handle(exchangeHelper);\n\n //Run post filters\n for (RouteFilter filter : postFilters) {\n if (!filter.doFilter(exchangeHelper)) {\n //We don't continue, but the request was handled\n return true;\n }\n }\n\n //We handled that request\n return true;\n }\n\n //We did NOT handle that request\n return false;\n }",
"boolean isValid()\n {\n return isRequest() && isResponse();\n }",
"abstract protected void doService(HttpServletRequest request,\r\n\t\t\t\t\t\t\t\t\t HttpServletResponse response) throws ServletException, IOException,ApplicationException;",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException \n {\n final String THIS_METHOD_NAME = \"processRequest() - \";\n \n logger.enter(THIS_METHOD_NAME);\n \n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n \n /* Global initializations for the rest of the modules */\n doGlobaInit(request,response);\n \n log(THIS_METHOD_NAME + \"Global initializations are done..\");\n \n try {\n \n String controlAction = request.getParameter(\"controlAction\");\n \n log(THIS_METHOD_NAME + \"requestParam controlAction : \"+controlAction);\n \n /* \n * Used for the determining whether or not to display the fields \n * at the first time \n */\n request.setAttribute(\"controlAction\", controlAction);\n \n if(controlAction==null || controlAction.trim().length()<=0)\n {\n //putInSession(request, \"selectedModule\", null);\n actOnNullAction(request, response);\n }\n else if(controlAction.equalsIgnoreCase(\"getFields\"))\n {\n actOnGetFields(request, response);\n }\n else if (controlAction.equalsIgnoreCase(\"getConstraints\"))\n {\n actOnGetConstraints(request, response);\n }\n else if (controlAction.equalsIgnoreCase(\"getConstraintInfo\"))\n {\n actOnGetConstraintInfo(request, response);\n }\n else if(controlAction.equalsIgnoreCase(\"addModule\"))\n {\n //putInSession(request, \"selectedModule\", null);\n actOnAddModule(request, response); \n }\n else if(controlAction.equalsIgnoreCase(\"addField\"))\n {\n actOnAddField(request, response);\n } \n else if(controlAction.equalsIgnoreCase(\"addConstraint\"))\n {\n actOnAddConstraint(request,response);\n }\n else if (controlAction.equalsIgnoreCase(\"export\"))\n {\n actOnExport(request,response);\n }\n \n getServletContext().getRequestDispatcher(\"/admin.jsp\").forward(request, response); \n \n } finally { \n out.close();\n } \n \n logger.exit(THIS_METHOD_NAME);\n }",
"public abstract ModelAndView handleInit(HttpServletRequest req, HttpServletResponse res, Object inputCommand, BindException be) throws Throwable;",
"@Override\n public String performGet(HttpServletRequest request) {\n return performPost(request);\n }",
"public abstract void handle(Request request, Response response) throws Exception;",
"void handleManualFilterRequest();",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (SQLException ex) {\n Logger.getLogger(indicatoractivities1.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"abstract public LoanApplicationResponse handleLoanRequest(LoanApplicationRequest loanRequest);",
"Call mo35727a(Request request);",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"public void processRequest(HttpServletRequest request)\n {\n // do nothing if not initialized or session has expired.\n if(mv==null || request.getSession().isNew())\n {\n errorMsg = \"Session has expired (or is new). Please fill in the form and \"+\n \"click on the Submit button.\"; \n return;\n }\n \n success = false;\n errorMsg = null;\n if(action!=null) // user clicked an action button\n {\n if(\"Submit\".equalsIgnoreCase(action))\n doSubmit();\n else if(\"Zm In\".equalsIgnoreCase(action))\n doZoomIn();\n else if(\"Zm Out\".equalsIgnoreCase(action))\n doZoomOut(); \n else if(\"Pan W.\".equalsIgnoreCase(action))\n doPanHalf('W');\n else if(\"Pan E.\".equalsIgnoreCase(action))\n doPanHalf('E');\n else if(\"Pan S.\".equalsIgnoreCase(action))\n doPanHalf('S');\n else if(\"Pan N.\".equalsIgnoreCase(action))\n doPanHalf('N');\n }\n else if(request.getParameter(\"mouseClick.x\")!=null)\n {\n // user clicked on the map itself: recenter\n doRecenter(request);\n }\n \n if(success)\n {\n //reset action\n action = null;\n //update map size for display purpose\n size = mv.getRequestSize();\n //update center x,y for display purpose\n Point2D p = mv.getRequestCenter();\n if(p !=null)\n {\n centerX = p.getX();\n centerY = p.getY();\n }\n }\n }",
"private void doBeforeApplyRequest(final PhaseEvent arg0) {\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n \r\n }",
"public interface BeforeHandler {\n void execute(Map<String, Object> body,HttpServletRequest request) throws Exception;\n}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n\r\n List resultsList = new ArrayList();\r\n\r\n // Receive request from adminPage\r\n String c = request.getParameter(\"action\");\r\n String mem_id = request.getParameter(\"mem_id\");\r\n String id = request.getParameter(\"id\");\r\n\r\n AdminModel am = new AdminModel();\r\n\r\n // Send to model & invoke one of three methods\r\n switch (c) {\r\n case \"Check Approvals\":\r\n resultsList = am.getApprovals();\r\n break;\r\n case \"List Member Payments\":\r\n resultsList = am.listPayments(mem_id);\r\n break;\r\n case \"Approve Outstanding Member\":\r\n am.approvalResult(mem_id);\r\n break;\r\n case \"List Claims\":\r\n resultsList = am.listClaims(id);\r\n break;\r\n case \"Approve Claim\":\r\n am.approveClaim(id);\r\n break;\r\n case \"Reject Claim\":\r\n am.rejectClaim(id);\r\n break;\r\n case \"End of Year Charge\":\r\n am.endOfYearCharge();\r\n break;\r\n }\r\n\r\n // Send back to view (adminPage.jsp)\r\n request.setAttribute(\"output\", resultsList);\r\n RequestDispatcher view = request.getRequestDispatcher(\"/docs/adminPage\");\r\n view.forward(request, response);\r\n }",
"@Override\n\tpublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)\n\t\t\tthrows Exception {\n\t\tif (handler instanceof HandlerMethod) {\n\t\t\tHandlerMethod handlerMethod = (HandlerMethod) handler;\n\t\t\tMethod method = handlerMethod.getMethod();\n\t\t\tTokenCheck annotation = method.getAnnotation(TokenCheck.class);\n\t\t\tHttpSession session = request.getSession();\n\t\t\tif (annotation != null) {\n\n\t\t\t\tboolean tokenCheck = annotation.check();\n\t\t\t\tif (tokenCheck) {\n\t\t\t\t\tif (isRepeatSubmit(request)) {\n\t\t\t\t\t\tString rootPath = session.getServletContext().getContextPath();\n\t\t\t\t\t\tresponse.sendRedirect(rootPath + \"/user/tokenError\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t//session.removeAttribute(CommonConstants.SSM_TOKEN);\n\t\t\t\t}\n\t\t\t\tboolean generateToken = annotation.generateToken();\n\t\t\t\tif (generateToken) {\n\t\t\t\t\tsession.setAttribute(CommonConstants.SSM_TOKEN, UUID.randomUUID().toString());\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn super.preHandle(request, response, handler);\n\t\t}\n\t}",
"private void filterAndHandleRequest () {\n\t// Filter the request based on the header.\n\t// A response means that the request is blocked.\n\t// For ad blocking, bad header configuration (http/1.1 correctness) ... \n\tHttpHeaderFilterer filterer = proxy.getHttpHeaderFilterer ();\n\tHttpHeader badresponse = filterer.filterHttpIn (this, channel, request);\n\tif (badresponse != null) {\n\t statusCode = badresponse.getStatusCode ();\n\t sendAndClose (badresponse);\n\t} else {\n\t status = \"Handling request\";\n\t if (getMeta ())\n\t\thandleMeta ();\n\t else\n\t\thandleRequest ();\n\t}\n }",
"public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception\r\n {\r\n // Add the player from the session\r\n Turn currentTurn = getGameState().getCurrentTurn();\r\n Player player = getLoginManager().getPlayer(request);\r\n request.setAttribute(RequestAttributes.PLAYER, player);\r\n\r\n // Add the game state\r\n GameState gameState = getGameState();\r\n request.setAttribute(RequestAttributes.GAME_STATE, gameState);\r\n\r\n // Send the version\r\n request.setAttribute(RequestAttributes.VERSION, getMetaFactory().getGameStateFactory().getVersion());\r\n\r\n // Add the Current date/time\r\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n String date = dateFormat.format(new Date());\r\n request.setAttribute(RequestAttributes.CURRENT_DATE, date);\r\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"HH:mm z\");\r\n String time = timeFormat.format(new Date());\r\n request.setAttribute(RequestAttributes.CURRENT_TIME, time);\r\n\r\n // Get the module links\r\n List<Link> linkList = this.moduleHandler.getLinks(currentTurn, player);\r\n Collections.sort(linkList, new Link.LinkTextComparator(SortType.ASCENDING));\r\n if (!linkList.isEmpty())\r\n {\r\n request.setAttribute(RequestAttributes.LINK_LIST, linkList);\r\n }\r\n\r\n // Get the effective rules\r\n BookFactory bookFactory = getMetaFactory().getBookFactory();\r\n List<Book> rulebookList = bookFactory.findByBookStatus(BookStatus.EFFECTIVE);\r\n Collections.sort(rulebookList, new Book.DesignationComparator());\r\n request.setAttribute(RequestAttributes.RULE_BOOK_LIST, rulebookList);\r\n\r\n // Get the effective books\r\n List<Book> bookList = bookFactory.findByBookStatus(BookStatus.BOOK);\r\n Collections.sort(bookList, new Book.DesignationComparator());\r\n request.setAttribute(RequestAttributes.CURRENT_BOOK_LIST, bookList);\r\n\r\n // Url properties\r\n request.setAttribute(RequestAttributes.URL_PROPERTIES, this.urlProperties.getUrlProperties());\r\n request.setAttribute(RequestAttributes.PUBLIC_FORUM_URL, this.publicForumUrl);\r\n\r\n // Calendar id\r\n request.setAttribute(RequestAttributes.CALENDAR_ID, this.calendarId);\r\n\r\n // History links\r\n request.setAttribute(RequestAttributes.HISTORY_LINKS, this.historyLinks);\r\n\r\n return true;\r\n }",
"boolean isConditionFullfilled(DataObject object, HttpServletRequest req) throws ASGRuntimeException;",
"@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (SQLException ex) {\n Logger.getLogger(doctorAvailability.class.getName()).log(Level.SEVERE, null, ex);\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(doctorAvailability.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n request.setCharacterEncoding(\"utf-8\");\n String method = (String) request.getAttribute(\"do\");\n if (method.equals(\"index\")) {\n index(request, response);\n }\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n\t\t\tpublic void onRequest() {\n\t\t\t\t\r\n\t\t\t}",
"private void onPreRequestData(int tag) {\n }",
"@Override\n\t\t\tpublic void handle(Request req, Response res) throws Exception {\n\t\t\t\tfinal String op = req.params(\":op\");\n\t\t\t\tfinal String username = req.queryParams(\"user\");\n\t\t\t\tfinal String path = req.queryParams(\"path\");\n\t\t\t\t\n\t\t\t\t//--- framework access ---//\n\t\t\t\tif (!Results.hasFrameworkAccess(op, path)) halt(404);\n\t\t\t\t//--- path exists? ---//\n\t\t\t\tif (!Directories.isExist(path)) halt(404);\n\t\t\t\t//--- section and path access ---//\n\t\t\t\tif (!AccessManager.hasAccess(username, path)) halt(401);\n\n\t\t\t}",
"@Override\r\n\tpublic void execute(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\t\r\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }"
] | [
"0.6379705",
"0.60921293",
"0.5943786",
"0.5926253",
"0.59167856",
"0.5886525",
"0.57771474",
"0.5753215",
"0.57345784",
"0.57163584",
"0.57056355",
"0.56977916",
"0.5622041",
"0.55940866",
"0.5587153",
"0.5586485",
"0.55613434",
"0.5558678",
"0.5556514",
"0.554948",
"0.55356354",
"0.5535132",
"0.55243367",
"0.55018073",
"0.5498768",
"0.5495454",
"0.5492473",
"0.5491768",
"0.54908013",
"0.54842937",
"0.5479531",
"0.54582155",
"0.5447096",
"0.5442891",
"0.5435415",
"0.54296005",
"0.54267246",
"0.54166746",
"0.54053485",
"0.5397617",
"0.5391225",
"0.5391225",
"0.5391225",
"0.5391225",
"0.5391225",
"0.5391225",
"0.5391225",
"0.5391225",
"0.5391225",
"0.5391225",
"0.53813136",
"0.53735447",
"0.5367044",
"0.53600097",
"0.533997",
"0.5314525",
"0.5309911",
"0.5305748",
"0.53019905",
"0.53019905",
"0.5294315",
"0.52905273",
"0.5290396",
"0.5282104",
"0.5280787",
"0.52724123",
"0.5271019",
"0.52705675",
"0.52615774",
"0.5255651",
"0.5253567",
"0.5253441",
"0.52498347",
"0.52472",
"0.5242863",
"0.52342844",
"0.5233837",
"0.5225648",
"0.5225514",
"0.5219234",
"0.52180046",
"0.52145475",
"0.5214342",
"0.5212839",
"0.52050996",
"0.52014744",
"0.520025",
"0.51989347",
"0.5197918",
"0.51954436",
"0.51946485",
"0.51892054",
"0.5185541",
"0.5178676",
"0.5176122",
"0.5176122",
"0.51719904",
"0.5168517",
"0.5166867",
"0.5164856",
"0.51535434"
] | 0.0 | -1 |
Get a list of meters which are selected Pseudo Code 1. Connect to the UDR service to get a list of meters 2. Store the meters which are selected | private ArrayList getEnabledResources() {
ArrayList enabledResourceList = new ArrayList();
String meterData;
JsonRepresentation responseJson;
int meterNameIndex = 0;
int meterStatusIndex = 0;
JSONArray columnArr, tagArr, pointsArr;
// Get the active meters from the meter API from UDR Service
try {
logger.debug("Attempting to get the Enabled Resources");
meterData = udrServiceClient.getActiveResources();
responseJson = new JsonRepresentation(meterData);
JSONObject jsonObj = responseJson.getJsonObject();
columnArr = jsonObj.getJSONArray("columns");
//tagArr = jsonObj.getJSONArray("tags");
for (int i = 0; i < columnArr.length(); i++) {
if ("metername".equals(columnArr.get(i))) {
meterNameIndex = i;
}
if ("status".equals(columnArr.get(i))) {
meterStatusIndex = i;
}
}
pointsArr = jsonObj.getJSONArray("points");
HashMap<String, String> enabledResourceMap = new HashMap<String, String>();
for (int j = 0; j < pointsArr.length(); j++) {
JSONArray arr = (JSONArray) pointsArr.get(j);
if (Integer.parseInt(arr.get(meterStatusIndex).toString()) == 1) {
if (!enabledResourceList.contains(arr.get(meterNameIndex)))
enabledResourceList.add(arr.get(meterNameIndex));
}
}
} catch (Exception e) {
logger.error("Error while getting the Enabled Resources: "+e.getMessage());
e.printStackTrace();
}
return enabledResourceList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"InternalResultsResponse<GasMeter> fetchAllGasMeters(InquiryDeviceRequest inquiryDeviceRequest);",
"List<DeviceLocation> getDeviceLocations(List<DeviceIdentifier> deviceIdentifiers) throws DeviceDetailsMgtException;",
"public DCU() {\r\n meters = new ArrayList<Meter>();\r\n id = \"unknown\";\r\n }",
"private void readMeasurementData() {\n if (choice == 1){\n readImperialData();\n } \n if (choice == 2){\n readMetricData();\n }\n }",
"private void getDevices(){\n progress.setVisibility(View.VISIBLE);\n\n emptyMessage.setVisibility(View.GONE);\n getListView().setVisibility(View.GONE);\n\n // request device list from the server\n Model.PerformRESTCallTask gd = Model.asynchRequest(this,\n getString(R.string.rest_url) + \"?\"\n + \"authentification_key=\" + MainActivity.authentificationKey + \"&operation=\" + \"getdevices\",\n //Model.GET,\n \"getDevices\");\n tasks.put(\"getDevices\", gd);\n }",
"public void GetParams(int id){\n\t JSONObject device;\n\t List<String> params = new ArrayList<String>();\n\t\t\n\t try {\n\t\tHttpResponse<JsonNode> response = Unirest.get(\"https://painel.dcc.ufmg.br/midea/detail/\" + Integer.toString(id))\n\t\t .header(\"accept\", \"application/json, text/plain, */*\")\n\t\t .header(\"x-devtools-emulate-network-conditions-client-id\", \"dfc781d4-4de5-4a54-a230-12b081f0187d\")\n\t\t .header(\"user-agent\", \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36\")\n\t\t .header(\"referer\", \"https://painel.dcc.ufmg.br/midea/\")\n\t\t .header(\"accept-encoding\", \"gzip, deflate, br\")\n\t\t .header(\"accept-language\", \"pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7\")\n\t\t .header(\"cookie\", \"session=.eJwlzs1ugzAQBOBXqfacQzHhgpSbSQXSLiIysdaXKCFEscE98KMER3n30vY6I30zLzjdhna8QzoNc7uBk71C-oKPC6SA4epZ3S3r6mlcLUhzxK6wqDHhcOgo5LGRhTWSY1Tdwp4fpTz2pHEhmT9ZUP-bG5fH5DGw3_eoq3h1_nvXJOQLt9qfFJoteVr3ssDh2KPMEqPwUaomIrl6X7UoVZ2U2lh0nUCx74zKIhL1QiLbwXsD89gOf_9hmQf7be00zv4M7x8c6EyD.DPiMAA.mPVHlsFOK9PP0VA8LGsaki5qRZg\")\n\t\t .header(\"cache-control\", \"no-cache\")\n\t\t .asJson();\n\t\t\n\t\tdevice = (JSONObject) response.getBody().getObject().get(\"device\");\n\t\tget_Estado = (String) device.get(\"estado\");\n\t\tget_Temp = device.get(\"set_temp\").toString();\n\t\tget_Swing = (String) device.get(\"swing\").toString();\n\t\tget_Fan = (String) device.get(\"fan\");\n\t }catch(UnirestException e) {\n\t\tSystem.out.println(\"AIR CONTROL: Failed to get params.\");\n\t }\n\t}",
"InternalResultsResponse<Device> fetchGasMeterById(DeviceRequest deviceRequest);",
"public static void getLightStatus()\n\t{\n\t\ttry\n\t\t{\n\t\t\tArrayList<NameValuePair> nameValuePairs1 = new ArrayList<NameValuePair>();\n\t\t\tnameValuePairs1.add(new BasicNameValuePair(\"userID\",String.valueOf(Thermo_main.userID)));\n\t\t\tString httpPoststring = \"http://\"+Thermo_main.ip_addr_server+\"/getLightStatus_java.php\";\n\t\t\t\n\t\t\t//String httpPostSetString = \"http://\"+Thermo_main.ip_addr_server+\"/setEnergy.php\";\n\t\t\t//Thermo_main.help.setResult(nameValuePairs1, httpPostSetString);\n\t\t\t\n\t\t\tString result = Thermo_main.help.getResult(nameValuePairs1,httpPoststring);\n\t\t\tJSONArray array = new JSONArray(result);\n\n\t\t\tfor(int n =0; n< array.length(); n++)\n\t\t\t{\n\t\t\t\tJSONObject objLight = array.getJSONObject(n);\n\t\t\t\troom_new.add(objLight.getInt(\"room\")); \n\t\t\t\tlight_status_new.add(objLight.getString(\"light_status\"));\n\t\t\t\tdimmer_status_new.add(objLight.getString(\"dimmer_status\"));\n\t\t\t}\n\t\t}catch(Exception e) {}\n\t}",
"private void getMatches(){\r\n\t\tString cLong = commandList.get(2);//holds client's longitude in string form\r\n\t\tString cLat = commandList.get(3);//holds the client's latitude in String form\r\n\r\n\t\tArrayList<String> matchList = new ArrayList<>();//holds user names of found matches\r\n\t\t\r\n\t\tString[] clientPSliders = getPSliders(commandList.get(1));\r\n\r\n\t\t//load in SQL command to find matches using given client's min and max values\r\n\t\tcommand =\"SELECT location.userName FROM (location INNER JOIN users \"\r\n\t\t\t\t+ \"ON location.userName = users.userName) INNER JOIN personalSlider \"\r\n\t\t\t\t+ \"ON users.userName = personalSlider.userName WHERE (((location.longitude) <= \";\r\n\t\tcommand += roundLongUp(cLong) + \" And (location.longitude) >= \";\r\n\t\tcommand += roundLongDown(cLong) + \") AND ((location.latitude) <= \";\r\n\t\tcommand += roundLatUp(cLat) + \" And (location.latitude) >= \";\r\n\t\tcommand += roundLatDown(cLat) + \") AND ((personalSlider.pGender) >= \";\r\n\t\tcommand += commandList.get(4) + \" And (personalSlider.pGender) <= \" + commandList.get(5);\r\n\t\tcommand += \" AND ((personalSlider.pExpression) >= \" + commandList.get(6) +\r\n\t\t\t\t\" And (personalSlider.pExpression) <= \" + commandList.get(7) + \")\";\r\n\t\tcommand += \" AND ((personalSlider.pOrientation) >= \" + commandList.get(8) +\r\n\t\t\t\t\" And (personalSlider.pOrientation) <= \" + commandList.get(9) + \")));\";\r\n\r\n\t\t\r\n\t\ttry {//try block for sending SQL command\r\n\t\t\trs = stmt.executeQuery(command);//send command\r\n\r\n\t\t\twhile(rs.next()){//while there are matches\r\n\t\t\t\tmatchList.add(rs.getString(\"userName\"));//load userName\r\n\t\t\t}\r\n\r\n\t\t\t//each String[] is a match, 0 = userName, 1 = pGenderMin, .....6=pOrientationMax, 7=distance (used later)\r\n\t\t\tArrayList<String[]> fullMatches = getSeekingSlider(matchList);\r\n\r\n\t\t\t//remove the non-overlapping matches, pass clients ratings and the list of matches\r\n\t\t\tcrossMatch(strArrToIntArr(clientPSliders), fullMatches);\r\n\t\t\t\r\n\t\t\t//remove matches over 25 miles away\r\n\t\t\tlimitDistance(Double.valueOf(cLat), Double.valueOf(cLong), fullMatches);\r\n\t\t\t\r\n\t\t\trs = null;//null the result set\r\n\t\t\t\r\n\t\t\tString[] tempStrArr;//holds the personal slider for the current match\r\n\t\t\tfor(String[] currArr: fullMatches){//for all the remaining matches\r\n\t\t\t\ttempStrArr = getPSliders(currArr[0]);//get personal slider for current matches\r\n\t\t\t\tout.println(tempStrArr[0] + \", \" + tempStrArr[1] + \", \"//loads userName, pGen, pExpr, pOrient\r\n\t\t\t\t\t\t\t+ tempStrArr[2] + \", \" + tempStrArr[3] + \", \" + currArr[7]);//line 2\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\tout.println(e.getMessage());\r\n\t\t}\r\n\t}",
"List<DeviceDetails> getDevices();",
"private ServiceResponse getControlledLamps() {\r\n\t// We assume that the Service-Call always succeeds because we only\r\n\t// simulate the lights\r\n\tServiceResponse sr = new ServiceResponse(CallStatus.succeeded);\r\n\t// create a list including the available lights\r\n\tint[] lamps = theServer.getLampIDs();\r\n\tArrayList al = new ArrayList(lamps.length);\r\n\tfor (int i = 0; i < lamps.length; i++) {\r\n\t LightSource ls = new LightSource(\r\n\t\t constructLampURIfromLocalID(lamps[i]));\r\n\t ls.setLightType(ElectricLight.lightBulb);\r\n\t al.add(ls);\r\n\t}\r\n\t// create and add a ProcessOutput-Event that binds the output URI to the\r\n\t// created list of lamps\r\n\tsr.addOutput(new ProcessOutput(\r\n\t\tLightingService1.OUTPUT_CONTROLLED_LAMPS, al));\r\n\treturn sr;\r\n }",
"private ServiceResponse getLampInfo(String lampURI) {\r\n\ttry {\r\n\t // collect the needed data\r\n\t int lampID = extractLocalIDfromLampURI(lampURI);\r\n\t String loc = theServer.getLampLocation(lampID);\r\n\t int state = theServer.isOn(lampID) ? 100 : 0;\r\n\t // We assume that the Service-Call always succeeds because we only\r\n\t // simulate the lights\r\n\t ServiceResponse sr = new ServiceResponse(CallStatus.succeeded);\r\n\t // create and add a ProcessOutput-Event that binds the output URI to\r\n\t // the state of the lamp\r\n\t sr.addOutput(new ProcessOutput(\r\n\t\t LightingService1.OUTPUT_LAMP_BRIGHTNESS,\r\n\t\t new Integer(state)));\r\n\t // create and add a ProcessOutput-Event that binds the output URI to\r\n\t // the location of the lamp\r\n\t sr.addOutput(new ProcessOutput(\r\n\t\t LightingService1.OUTPUT_LAMP_LOCATION, new Room(\r\n\t\t\t constructLocationURIfromLocalID(loc))));\r\n\t return sr;\r\n\t} catch (Exception e) {\r\n\t return invalidInput;\r\n\t}\r\n }",
"public ArrayList getDeviceInfo();",
"public void get()\n {\n Session session = new Session(\"udp:\"+\"\"+\"/161\", writer);\n\n // creating PDU\n session.getBulk(\"1.3.6.1.2.1.1.1\");\n session.getBulk(\"1.3.6.1.2.1.1.2\");\n\n List<String> oList = new ArrayList<String>();\n oList.add(\"1.3.6.1.2.1.25.3.2.1.3.768\");\n oList.add(\"1.3.6.1.2.1.25.3.2.1.3.770\");\n\n session.get(oList);\n\n\n // creating PDU\n session.walk(\"1.3.6.1.2.1.25.3.2.1.3\");\n\n // wait for all sessions to complete\n while (!session.isComplete())\n {\n session.printStats();\n try {\n Thread.currentThread();\n Thread.sleep(100);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }//sleep for 100 ms\n\n }\n session.printStats();\n writer.close();\n }",
"public String[] obtainStops() {\n\n String[] stopsNone = { \"No stops found\" };\n String[] stopsArbutus = { \"Commons Dr. & Park Rd.\", \"Park Rd. & Poplar Ave.\", \"Hilltop Cir. & Commons Dr.\", \"Administration Dr. Bus Shelter\", \"Hilltop Cir. & Hilltop Rd.\", \"Hilltop Cir. & Walker Ave.\", \"Hilltop Cir. & Center Rd.\", \"Poplar Ave. & Stadium Lot\", \"TRC @ Linden Ave\", \"Westland Blvd. & Circle Dr.\", \"Westland Blvd. & Courtney Rd.\", \"Maiden Choice La. & Westland Blvd\", \"Maiden Choice La. & Warren Tree\", \"Maiden Choice La. & Wilkens Ave\", \"Maiden Choice La. & Grouse Ct\", \"Maiden Choice La. & Symmington Aven.\"};\n String[] stopsArundel = { \"Commons Dr. & Park Rd.\", \"Park Rd. & Poplar Ave.\", \"Hilltop Cir. & Commons Dr.\", \"BWI Marc Station\", \"Arundel Mills Mall Visitor Entrace #5\", \"BWI Marc Station\", \"Administration Dr. Bus Shelter\", \"Hilltop Circle & Hilltop Rd.\" };\n String[] stopsCatonsville = { \"Commons Dr. & Park Rd.\", \"Park Rd. & Poplar Ave.\", \"Hilltop Cir. & Commons Dr.\", \"Administration Dr. Bus Shelter\", \"Rolling Rd @YMCA\", \"Rolling Rd @Valley Rd (CCBC)\", \"Catonsville High @Bloomsbury Ave\", \"Mellor Ave & Bloomsbury Ave\" };\n String[] stopsDowntownA = { \"Commons Dr. & Park Rd\", \"Park Rd. & Poplar Ave.\", \"Hilltop Cir. & Commons Dr.\", \"Greyhound Station @ Haines\",\"MLK Blvd & Pratt St (UMB)\", \"Green St & Fayette St\", \"Green St & Lombard St (UMB)\" };\n\n if ( this.longName.toLowerCase().contains(\"Arbutus\".toLowerCase()) ) {\n return stopsArbutus;\n }\n if ( this.longName.contains(\"Arundel\") ) {\n return stopsArundel;\n }\n if ( this.longName.contains(\"Catonsville\") ) {\n return stopsCatonsville;\n }\n if ( this.longName.contains(\"Downtown\") ) {\n return stopsDowntownA;\n }\n\n return stopsNone;\n\n }",
"private void selectAvailableDevices() {\n\n ArrayList deviceStrs = new ArrayList();\n final ArrayList<String> devices = new ArrayList();\n\n BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();\n // checking and enabling bluetooth\n if (!btAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n } else {\n btAdapter = BluetoothAdapter.getDefaultAdapter();\n Set<BluetoothDevice> pairedDevices = btAdapter.getBondedDevices();\n if (pairedDevices.size() > 0) {\n for (BluetoothDevice device : pairedDevices) {\n deviceStrs.add(device.getName() + \"\\n\" + device.getAddress());\n devices.add(device.getAddress());\n }\n }\n\n // show a list of paired devices to connect with\n final AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);\n ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.select_dialog_singlechoice,\n deviceStrs.toArray(new String[deviceStrs.size()]));\n alertDialog.setSingleChoiceItems(adapter, -1, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n int position = ((AlertDialog) dialog).getListView().getCheckedItemPosition();\n String deviceAddress = devices.get(position);\n setDeviceAddress(deviceAddress);\n chosen = true;\n //notify user for ongoing connection\n launchRingDialog();\n\n }\n });\n\n alertDialog.setTitle(R.string.blueChose);\n alertDialog.show();\n }\n }",
"@Override\n protected Void doInBackground(Void... params) {\n manufatures = new ArrayList<Manufatures>();\n // Create an array to populate the spinner\n manufatureslist = new ArrayList<String>();\n // JSON file URL address\n jsonobject = JSONfunctions\n .getJSONfromURL(Config.URL_GET_MANUFACTURE_LIST);\n\n try {\n // Locate the NodeList name\n jsonarray = jsonobject.getJSONArray(\"manufacture\");\n for (int i = 0; i < jsonarray.length(); i++) {\n jsonobject = jsonarray.getJSONObject(i);\n\n Manufatures manufaturesOpt = new Manufatures();\n\n manufaturesOpt.setId(jsonobject.optInt(\"id\"));\n manufaturesOpt.setName(jsonobject.optString(\"name\"));\n\n manufatures.add(manufaturesOpt);\n\n // Populate spinner with country names\n manufatureslist.add(jsonobject.optString(\"name\"));\n\n }\n } catch (Exception e) {\n Log.e(\"Error\", e.getMessage());\n e.printStackTrace();\n }\n return null;\n }",
"List<DeviceInfo> getDevicesInfo(List<DeviceIdentifier> deviceIdentifiers) throws DeviceDetailsMgtException;",
"private void getMasechtotListFromServer() {\n\n\n RequestManager.getMasechtotList().subscribe(new Observer<Result<MasechetList>>() {\n @Override\n public void onSubscribe(Disposable d) {\n\n }\n\n @Override\n public void onNext(Result<MasechetList> masechetListResult) {\n\n saveMasechtotList(masechetListResult.getData());\n mMasechtotList = masechetListResult.getData();\n\n }\n\n @Override\n public void onError(Throwable e) {\n\n }\n\n @Override\n public void onComplete() {\n\n }\n });\n\n\n }",
"public String searchMeterReaderMRDMapping() {\n\t\tAppLog.begin();\n\t\ttry {\n\t\t\tStringBuffer resonseSB = new StringBuffer(512);\n\t\t\tMeterReaderDetails meterReaderDetails = new MeterReaderDetails();\n\t\t\tmeterReaderDetails.setMeterReaderZone(selectedZone);\n\t\t\t/* Start: Commented by Matiur Rahman on 30-09-2015 */\n\t\t\t// List<MRDTaggingDetails> mrdTaggingDetailsList = MRDTaggingDAO\n\t\t\t// .getAllCurrentTaggingList(selectedZone);\n\t\t\t/* End: Commented by Matiur Rahman on 30-09-2015 */\n\t\t\t/* Start: Added by Matiur Rahman on 30-09-2015 */\n\t\t\tList<MRDTaggingDetails> mrdTaggingDetailsList = MRDTaggingDAO\n\t\t\t\t\t.getAllCurrentTaggingList(selectedZone, selectedZROCode,\n\t\t\t\t\t\t\tselectedMRKeys,mrEmpId,mrHhdId);\n\t\t\tAppLog.debug(\"\" + selectedZone + \">>\" + selectedZROCode + \">>>\"\n\t\t\t\t\t+ selectedMRKeys);\n\t\t\t/* End: Added by Matiur Rahman on 30-09-2015 */\n\t\t\tMRDTaggingDetails mrdTaggingDetails = null;\n\t\t\tif (null != mrdTaggingDetailsList\n\t\t\t\t\t&& mrdTaggingDetailsList.size() > 0) {\n\t\t\t\tresonseSB.append(\"<table class=\\\"table-grid\\\">\");\n\t\t\t\tresonseSB.append(\"<tr>\");\n\t\t\t\tresonseSB\n\t\t\t\t\t\t.append(\"<th align=\\\"center\\\" colspan=\\\"15\\\">Current MRD Tagging Status</th>\");\n\t\t\t\tresonseSB.append(\"</tr>\");\n\t\t\t\tresonseSB.append(\"<tr>\");\n\t\t\t\tresonseSB.append(\"<th width=\\\"5%\\\" rowspan=\\\"2\\\">SL</th>\");\n\t\t\t\t/* Start: Added by Matiur Rahman on 30-09-2015 */\n\t\t\t\tresonseSB.append(\"<th width=\\\"5%\\\" rowspan=\\\"2\\\" >ZONE</th>\");\n\t\t\t\tresonseSB.append(\"<th width=\\\"5%\\\" rowspan=\\\"2\\\" >MR</th>\");\n\t\t\t\tresonseSB.append(\"<th width=\\\"5%\\\" rowspan=\\\"2\\\" >Area</th>\");\n\t\t\t\tresonseSB\n\t\t\t\t\t\t.append(\"<th width=\\\"5%\\\" rowspan=\\\"2\\\" >MRD Type</th>\");\n\t\t\t\t/* End: Added by Matiur Rahman on 30-09-2015 */\n\t\t\t\tresonseSB\n\t\t\t\t\t\t.append(\"<th width=\\\"5%\\\" rowspan=\\\"2\\\" colspan=\\\"2\\\">MRD CODE</th>\");\n\t\t\t\tresonseSB\n\t\t\t\t\t\t.append(\"<th width=\\\"50%\\\" rowspan=\\\"1\\\" colspan=\\\"3\\\">METER READER</th>\");\n\t\t\t\tresonseSB\n\t\t\t\t\t\t.append(\"<th width=\\\"15%\\\" rowspan=\\\"1\\\" colspan=\\\"2\\\">TAGGED</th>\");\n\t\t\t\tresonseSB\n\t\t\t\t\t\t.append(\"<th width=\\\"20%\\\" rowspan=\\\"1\\\" colspan=\\\"2\\\">EFFECTIVE</th>\");\n\t\t\t\tresonseSB.append(\"</tr>\");\n\t\t\t\tresonseSB.append(\"<tr>\");\n\t\t\t\tresonseSB.append(\"<th width=\\\"5%\\\" rowspan=\\\"1\\\">ID</th>\");\n\t\t\t\tresonseSB.append(\"<th width=\\\"15%\\\" rowspan=\\\"1\\\">NAME</th>\");\n\t\t\t\tresonseSB\n\t\t\t\t\t\t.append(\"<th width=\\\"5%\\\" rowspan=\\\"1\\\">EMPLOYEE ID</th>\");\n\t\t\t\tresonseSB.append(\"<th width=\\\"5%\\\" rowspan=\\\"1\\\">BY</th>\");\n\t\t\t\tresonseSB.append(\"<th width=\\\"10%\\\" rowspan=\\\"1\\\">ON</th>\");\n\t\t\t\tresonseSB.append(\"<th width=\\\"10%\\\" rowspan=\\\"1\\\">FROM</th>\");\n\t\t\t\tresonseSB.append(\"<th width=\\\"10%\\\" rowspan=\\\"1\\\">TO</th>\");\n\t\t\t\tresonseSB.append(\"</tr>\");\n\t\t\t\tfor (int i = 0; i < mrdTaggingDetailsList.size(); i++) {\n\t\t\t\t\tmrdTaggingDetails = mrdTaggingDetailsList.get(i);\n\t\t\t\t\tmeterReaderDetails = mrdTaggingDetails\n\t\t\t\t\t\t\t.getMeterReaderDetails();\n\t\t\t\t\tresonseSB\n\t\t\t\t\t\t\t.append(\"<tr bgcolor=\\\"white\\\"\tonMouseOver=\\\"javascript:this.bgColor= 'yellow'\\\" onMouseOut=\\\"javascript:this.bgColor='white'\\\">\");\n\t\t\t\t\tresonseSB.append(\"<td align=\\\"center\\\">\" + (i + 1)\n\t\t\t\t\t\t\t+ \"</td>\");\n\t\t\t\t\t/* Start: Added by Matiur Rahman on 30-09-2015 */\n\t\t\t\t\tresonseSB.append(\"<td align=\\\"center\\\">\"\n\t\t\t\t\t\t\t+ mrdTaggingDetails.getZone() + \"</td>\");\n\t\t\t\t\tresonseSB.append(\"<td align=\\\"center\\\">\"\n\t\t\t\t\t\t\t+ mrdTaggingDetails.getMr() + \"</td>\");\n\t\t\t\t\tresonseSB.append(\"<td align=\\\"left\\\" nowrap>\"\n\t\t\t\t\t\t\t+ mrdTaggingDetails.getArea() + \"</td>\");\n\t\t\t\t\tresonseSB.append(\"<td align=\\\"center\\\">\"\n\t\t\t\t\t\t\t+ mrdTaggingDetails.getType() + \"</td>\");\n\t\t\t\t\t/* End: Added by Matiur Rahman on 30-09-2015 */\n\t\t\t\t\tresonseSB.append(\"<td align=\\\"center\\\">\"\n\t\t\t\t\t\t\t+ mrdTaggingDetails.getMrkey() + \"</td>\");\n\t\t\t\t\tresonseSB\n\t\t\t\t\t\t\t.append(\"<td align=\\\"center\\\" width=\\\"2%\\\"><input type=\\\"checkbox\\\" id=\\\"\"\n\t\t\t\t\t\t\t\t\t+ mrdTaggingDetails.getMrkey()\n\t\t\t\t\t\t\t\t\t+ \"\\\" class=\\\"case\\\" name=\\\"case\\\"></td>\");\n\t\t\t\t\tresonseSB.append(\"<td align=\\\"center\\\">\"\n\t\t\t\t\t\t\t+ meterReaderDetails.getMeterReaderID() + \"</td>\");\n\t\t\t\t\tresonseSB\n\t\t\t\t\t\t\t.append(\"<td align=\\\"left\\\">\"\n\t\t\t\t\t\t\t\t\t+ meterReaderDetails.getMeterReaderName()\n\t\t\t\t\t\t\t\t\t+ \"</td>\");\n\t\t\t\t\tresonseSB.append(\"<td align=\\\"center\\\">\"\n\t\t\t\t\t\t\t+ meterReaderDetails.getMeterReaderEmployeeID()\n\t\t\t\t\t\t\t+ \"</td>\");\n\t\t\t\t\tresonseSB.append(\"<td align=\\\"center\\\">\"\n\t\t\t\t\t\t\t+ mrdTaggingDetails.getCreatedBy() + \"</td>\");\n\t\t\t\t\tresonseSB.append(\"<td align=\\\"center\\\" nowrap>\"\n\t\t\t\t\t\t\t+ mrdTaggingDetails.getCreatedOn() + \"</td>\");\n\t\t\t\t\tresonseSB.append(\"<td align=\\\"center\\\" nowrap>\"\n\t\t\t\t\t\t\t+ mrdTaggingDetails.getEffectiveFrom() + \"</td>\");\n\t\t\t\t\tresonseSB.append(\"<td align=\\\"center\\\" nowrap>\"\n\t\t\t\t\t\t\t+ mrdTaggingDetails.getEffectiveTo() + \"</td>\");\n\t\t\t\t\tresonseSB.append(\"</tr>\");\n\t\t\t\t}\n\t\t\t\tresonseSB.append(\"</table><br/>\");\n\t\t\t\tresonseSB.append(\"<table>\");\n\t\t\t\tresonseSB.append(\"<tr>\");\n\t\t\t\tresonseSB\n\t\t\t\t\t\t.append(\"<td width=\\\"15%\\\" align=\\\"right\\\"><b>Meter Reader</b></td>\");\n\t\t\t\t/* Start: Commented by Matiur Rahman on 30-09-2015 */\n\t\t\t\t// List<MeterReaderDetails> meterReaderList =\n\t\t\t\t// (ArrayList<MeterReaderDetails>) HHDMaintenanceDAO\n\t\t\t\t// .getMeterReaderList(selectedZone);\n\t\t\t\t/* End: Commented by Matiur Rahman on 30-09-2015 */\n\t\t\t\t/* Start: Added by Matiur Rahman on 30-09-2015 */\n\t\t\t\tList<MeterReaderDetails> meterReaderList = (ArrayList<MeterReaderDetails>) MRDTaggingDAO\n\t\t\t\t\t\t.getMeterReaderList(new MeterReaderDetails(\n\t\t\t\t\t\t\t\tselectedZROCode));\n\t\t\t\t/* End: Added by Matiur Rahman on 30-09-2015 */\n\t\t\t\tStringBuffer meterReaderDropdown = new StringBuffer();\n\t\t\t\tmeterReaderDropdown\n\t\t\t\t\t\t.append(\"<select name=\\\"meterReaderID\\\" id=\\\"meterReaderID\\\" class=\\\"selectbox-long\\\">\");\n\t\t\t\tmeterReaderDropdown\n\t\t\t\t\t\t.append(\"<option value=''>Please Select</option>\");\n\t\t\t\tif (null != meterReaderList && meterReaderList.size() > 0) {\n\t\t\t\t\tfor (int i = 0; i < meterReaderList.size(); i++) {\n\t\t\t\t\t\tmeterReaderDetails = (MeterReaderDetails) meterReaderList\n\t\t\t\t\t\t\t\t.get(i);\n\t\t\t\t\t\tmeterReaderDropdown.append(optionTagBeginPart1);\n\t\t\t\t\t\tmeterReaderDropdown.append(meterReaderDetails\n\t\t\t\t\t\t\t\t.getMeterReaderID());\n\t\t\t\t\t\tmeterReaderDropdown.append(optionTagBeginPart2);\n\t\t\t\t\t\tmeterReaderDropdown.append(meterReaderDetails\n\t\t\t\t\t\t\t\t.getMeterReaderName());\n\t\t\t\t\t\tmeterReaderDropdown.append(optionTagEnd);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmeterReaderDropdown.append(selectTagEnd);\n\t\t\t\tresonseSB.append(\"<td width=\\\"10%\\\" id='mtrRdrTD'>\"\n\t\t\t\t\t\t+ meterReaderDropdown.toString() + \"</td>\");\n\t\t\t\tresonseSB\n\t\t\t\t\t\t.append(\"<td width=\\\"2%\\\"><img src=\\\"/DataEntryApp/images/load.gif\\\" width=\\\"25\\\" border=\\\"0\\\" title=\\\"Processing\\\" style=\\\"display: none;\\\" id=\\\"imgMtrRdrSrc\\\" /></td>\");\n\t\t\t\tresonseSB\n\t\t\t\t\t\t.append(\"<td width=\\\"20%\\\" ><input type=\\\"text\\\" name=\\\"mtrRdsSrc\\\" id=\\\"mtrRdsSrc\\\" size='10' class=\\\"textbox\\\" title='Enter Employee Id of the Meter Reader'/><input type=\\\"button\\\" name=\\\"btnGetMtrRdr\\\" id=\\\"btnGetMtrRdr\\\" value=\\\"GO\\\" class=\\\"smallbutton\\\" onclick=\\\"fnGetMtrRdr();\\\" /></td>\");\n\t\t\t\tresonseSB\n\t\t\t\t\t\t.append(\"<td align=\\\"left\\\" ><input type=\\\"button\\\" name=\\\"btnTag\\\"\tid=\\\"btnTag\\\" value=\\\" Tag Selected MRD(s) \\\" class=\\\"groovybutton\\\" onclick=\\\"fnTagMRD();\\\" /></td>\");\n\t\t\t\tresonseSB\n\t\t\t\t\t\t.append(\"<td align=\\\"left\\\" ><input type=\\\"button\\\" name=\\\"btnUnTag\\\"\tid=\\\"btnUnTag\\\" value=\\\" UnTag Selected MRD(s) \\\" class=\\\"groovybutton\\\" onclick=\\\"fnUnTagMRD();\\\" /></td>\");\n\t\t\t\tresonseSB.append(\"</table><br/>\");\n\t\t\t} else {\n\t\t\t\tresonseSB\n\t\t\t\t\t\t.append(\"<font color='red'><b>No records Found to Display!</b></font><br/>\");\n\t\t\t}\n\t\t\tinputStream = new StringBufferInputStream(resonseSB.toString());\n\n\t\t} catch (Exception e) {\n\t\t\tinputStream = new StringBufferInputStream(\n\t\t\t\t\t\"<font color='red' size='2'><li><span><b>ERROR:Sorry, There was problem while Processing Last Operation.</b></font>\");\n\t\t\tAppLog.error(e);\n\n\t\t}\n\t\tAppLog.end();\n\t\treturn SUCCESS;\n\t}",
"java.util.List<com.mwr.jdiesel.api.Protobuf.Message.Device> \n getDevicesList();",
"public void getDevices(final Subscriber<List<Device>> devicesSubscriber) {\n if (smartThingsService==null) {\n devicesSubscriber.onError(new Throwable(\"Please login to SmartThings before trying to get devices\"));\n return;\n }\n Observable.combineLatest(smartThingsService.getSwitchesObservable(), smartThingsService.getLocksObservable(), new Func2<List<Device>, List<Device>, List<Device>>() {\n @Override\n public List<Device> call(List<Device> switches, List<Device> locks) {\n List<Device> devices = new ArrayList<>();\n devices.addAll(switches);\n devices.addAll(locks);\n return devices;\n }\n }).doOnError(new Action1<Throwable>() {\n @Override\n public void call(Throwable throwable) {\n devicesSubscriber.onError(throwable);\n }\n }).doOnCompleted(new Action0() {\n @Override\n public void call() {\n //\n }\n }).subscribe(new Action1<List<Device>>() {\n @Override\n public void call(List<Device> devices) {\n devicesSubscriber.onNext(devices);\n }\n });\n }",
"private synchronized void getpickuplist() {\n\n if (Utility.isConnectingToInternet(getActivity())) {\n if (mGpsTracker.canGetLocation()) {\n if (Utility.ischeckvalidLocation(mGpsTracker)) {\n try {\n disableEmptyView();\n setUpDummyPickUpAdapter();\n Map<String, String> param = new HashMap<>();\n if (!AppConstants.isGestLogin(getActivity())) {\n param.put(\"iduser\", SharedPref.getInstance().getStringVlue(getActivity(), userId));\n param.put(\"latitude\", \"\" + mGpsTracker.getLatitude());\n param.put(\"longitude\", \"\" + mGpsTracker.getLongitude());\n } else {\n param.put(\"iduser\", \"0\");\n param.put(\"latitude\", \"\" + mGpsTracker.getLatitude());\n param.put(\"longitude\", \"\" + mGpsTracker.getLongitude());\n if (AppConstants.getGender(getActivity()) != null && AppConstants.getGender(getActivity()) != \"\") {\n param.put(\"gender_pref\", AppConstants.getGender(getActivity()));\n } else {\n param.put(\"gender_pref\", \"Both\");\n }\n\n if (AppConstants.getRadius(getActivity()) != null && AppConstants.getRadius(getActivity()) != \"\") {\n param.put(\"radius_limit\", AppConstants.getRadius(getActivity()));\n } else {\n param.put(\"radius_limit\", \"100\");\n }\n }\n\n\n // param.put(\"iduser\", \"\" + SharedPref.getInstance().getIntVlue(getActivity(), USER_TYPE));\n if (!isRefresh) {\n progressWheel.setVisibility(View.VISIBLE);\n progressWheel.startAnimation();\n }\n btn_buddyup.setEnabled(false);\n btn_pickup.setEnabled(false);\n if (!AppConstants.isGestLogin(getActivity())) {\n RequestHandler.getInstance().stringRequestVolley(getActivity(), AppConstants.getBaseUrl(SharedPref.getInstance().getBooleanValue(getActivity(), isStaging)) + pickuplist, param, this, 1);\n } else {\n RequestHandler.getInstance().stringRequestVolley(getActivity(), AppConstants.getBaseUrl(SharedPref.getInstance().getBooleanValue(getActivity(), isStaging)) + \"pickuplist_guest\", param, this, 1);\n\n }\n\n\n } catch (Exception e) {\n e.printStackTrace();\n Log.e(\"Error on PickUp List\", \"\" + e.toString());\n }\n } else {\n mGpsTracker.showInvalidLocationAlert();\n }\n } else {\n showSettingsAlert(PICKUPUPREQUESTCODE);\n }\n } else {\n showNoInternetEmptyView();\n Utility.showInternetError(getActivity());\n }\n }",
"public void getDistance() {\n if (curLocation == null) {\n Toast.makeText(getApplicationContext(), \"Retrieving location - Try Again\", Toast.LENGTH_LONG).show();\n return;\n }\n String url = \"https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial\" +\n \"&origins=\" + curLocation.latitude + \",\" + curLocation.longitude +\n \"&destinations=\" + dest.latitude + \",\" + dest.longitude +\n \"&mode=walking\" +\n \"&key=\" + getString(R.string.google_maps_key);\n StringRequest request = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {\n\n //callback for when get distance returns data\n @Override\n public void onResponse(String response) {\n try {\n JSONObject data = new JSONObject(response);\n distance = data.getJSONArray(\"rows\").getJSONObject(0).getJSONArray(\"elements\")\n .getJSONObject(0).getJSONObject(\"distance\").getString(\"text\");\n duration = data.getJSONArray(\"rows\").getJSONObject(0).getJSONArray(\"elements\")\n .getJSONObject(0).getJSONObject(\"duration\").getString(\"text\");\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Toast.makeText(getApplicationContext(), \"Error retrieving directions\", Toast.LENGTH_LONG).show();\n }\n });\n requestQueue.add(request);\n }",
"void getDevicesCurrentlyOnline(String deviceType, AsyncCallback<List<String>> callback);",
"public ArrayList<String> Distance(String from, float amount, String[] units) {\n\t\tfrom = findFrom(from);\n\t\tif (from.equals(\"meter\")) {\n\t\t\tArrayList<String> kaduvil = new ArrayList<String>();\n\t\t\tkaduvil.add(\"\" + amount + \" \" + units[0] );\n\t\t\tkaduvil.add(\"\" + amount / 1000 + \" \" + units[1] );\n\t\t\tkaduvil.add(\"\" + amount * 39.37007874 + \" \" + units[2] );\n\t\t\treturn kaduvil;\n\t\t} else {\n\t\t\tif (from.equals(\"inches\")) {\n\t\t\t\treturn Distance(\"meter\", amount / 39.37007874f, units);\n\t\t\t} else {\n\t\t\t\treturn Distance(\"meter\", amount * 1000, units);\n\t\t\t}\n\t\t}\n\t}",
"@GetMapping(\"/recommend/{smartMeterId}\")\n public Set<Map.Entry<String, Double>> getRecommendation(@PathVariable(\"smartMeterId\") String smartMeterId ){\n return smartMeterService.getPlanComparison(PlanComparisonRequest.from(smartMeterId)).getPricePlanComparisons().entrySet();\n }",
"public List<NoteToken> getElts(){\r\n List<NoteToken> returnList = new ArrayList<NoteToken>();\r\n for (Iterator<Meters> i = MetersList.iterator(); i.hasNext();){\r\n returnList.addAll(i.next().getElts());\r\n }\r\n return returnList;\r\n }",
"public String getRouters(){\n wifi.startScan();\n results = wifi.getScanResults();\n size = results.size();\n String jsonRouter = new Gson().toJson(results);\n return jsonRouter;\n }",
"public List<SectorModel> getAllSectorsAndIUS();",
"public void getDirections(String startLocation, String endLocation) {\n\n // build the url\n String requestUrl = BASE_URL + DIRECTIONS_MODE + \"?api_key=\" + API_KEY + \"&start=\" + startLocation + \"&end=\" + endLocation;\n\n // start a new thread to do the request, because we don't want to be networking on our main thread\n Thread t = new Thread(() -> {\n\n // build a request from the url\n Request request = new Request.Builder().url(requestUrl).build();\n\n // try to get the response\n try (Response response = client.newCall(request).execute()) {\n if (response.body() != null) {\n String responseString = Objects.requireNonNull(response.body()).string();\n Log.d(TAG, \"getDirections: got response: \" + responseString);\n\n // convert the response into a result object\n DirectionsResult result = new DirectionsResult();\n result.parse(responseString);\n Log.d(TAG, \"getDirections: \" + result.getSteps().size());\n\n // notify the listeners\n for (DirectionsListener listener : listeners) {\n listener.onDirectionsAvailable(result);\n }\n }\n\n } catch (IOException e) {\n Log.d(TAG, \"getDirections: caught exception: \" + e.getLocalizedMessage());\n }\n });\n\n t.start();\n\n// try {\n// t.join();\n// } catch (InterruptedException e) {\n// e.printStackTrace();\n// }\n\n }",
"public static void getDevicesList()\n {\n MidiDevice.Info[]\taInfos = MidiSystem.getMidiDeviceInfo();\n\t\tfor (int i = 0; i < aInfos.length; i++)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tMidiDevice\tdevice = MidiSystem.getMidiDevice(aInfos[i]);\n\t\t\t\tboolean\t\tbAllowsInput = (device.getMaxTransmitters() != 0);\n\t\t\t\tboolean\t\tbAllowsOutput = (device.getMaxReceivers() != 0);\n\t\t\t\tif (bAllowsInput || bAllowsOutput)\n\t\t\t\t{\n\n\t\t\t\t\tSystem.out.println(i + \"\" + \" \"\n\t\t\t\t\t\t+ (bAllowsInput?\"IN \":\" \")\n\t\t\t\t\t\t+ (bAllowsOutput?\"OUT \":\" \")\n\t\t\t\t\t\t+ aInfos[i].getName() + \", \"\n\t\t\t\t\t\t+ aInfos[i].getVendor() + \", \"\n\t\t\t\t\t\t+ aInfos[i].getVersion() + \", \"\n\t\t\t\t\t\t+ aInfos[i].getDescription());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\" + i + \" \" + aInfos[i].getName());\n\t\t\t\t\t}\n\n\t\t\t}\n\t\t\tcatch (MidiUnavailableException e)\n\t\t\t{\n\t\t\t\t// device is obviously not available...\n\t\t\t\t// out(e);\n\t\t\t}\n\t\t}\n\t\tif (aInfos.length == 0)\n\t\t{\n\t\t\tSystem.out.println(\"[No devices available]\");\n\t\t}\n\t\t//System.exit(0);\n }",
"public void queryAccelerometerData()\n\t{\n\t\ttry\n\t\t{\n\t\t\tif(serverRequestStatus==true)\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcheckApi();\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static List<OptionItem> consultarRutasByLocation(LatLng point){\n RutaDTO ruta = null;\n OptionItem optItem = null;\n List<OptionItem> options = new ArrayList<OptionItem>();\n HttpClient httpClient = new DefaultHttpClient();\n HttpGet del = new HttpGet(HOST_BACKEND+\"mycityviewBE/rest/ruta/consultar?latitud=\"+point.latitude+\"&longitud=\"+point.longitude);\n del.setHeader(\"content-type\", CONTENT_TYPE);\n del.setHeader(\"Authorization\", getAuthorization().trim());\n try {\n HttpResponse resp = httpClient.execute(del);\n if(resp.getStatusLine().getStatusCode() == HttpStatus.SC_OK){\n String respStr = EntityUtils.toString(resp.getEntity());\n JSONArray jsonArray = new JSONArray(respStr);\n if(jsonArray.length() != 0){\n for (int i=0; i<jsonArray.length(); i++){\n Gson gson = new GsonBuilder().create();\n ruta = gson.fromJson(jsonArray.getJSONObject(i).toString(), RutaDTO.class);\n optItem = new OptionItem(ruta.getNombreRuta(), ruta.getIdRuta());\n optItem.setRutaDTO(ruta);\n options.add(optItem);\n }\n }\n }\n } catch (Exception ex) {\n Log.e(\"ServicioRest\", \"Error!\", ex);\n }\n return options;\n }",
"public static void getRoomsAPI()\n\t{\n\t\ttry\n\t\t{\n\t\t\tWebClient checkIP = new WebClient(\"http://api.conceptnet.io/c/en/room/n?offset=0&limit=1000\");\n\t\t\tcheckIP.post(\"\");\n\t\t\tlong startIP = System.currentTimeMillis();\n\t\t\t\n\t\t\tArrayList<ArrayList<String> > checkq = new ArrayList<ArrayList<String> >();\n\t\t\twhile(true)\n\t\t\t{\n\t\t\t\tcheckIP.getQueue(checkq);\n\t\t\t\tboolean processedsomething = false;\n\t\t\t\tfor (int i = 0; i < checkq.size(); i++) \n\t\t\t\t{\n\t\t\t\t\tArrayList<String> resultlines = checkq.remove(i);\n\t\t\t\t\t\n\t\t\t\t\tString x = null;\n\t\t\t\t\tString relation = null;\n\t\t\t\t\tString relationweight = null;\n\t\t\t\t\tString y = null;\n\n\t\t\t\t\tfor(int li=0;li<resultlines.size();li++)\n\t\t\t\t\t{\t\t\n\t\t\t\t\t\tprocessedsomething = true;\n\t\t\t\t\t\t\n\t\t\t\t\t\tString line = resultlines.get(li);\n\t\t\t\t\t\tline = line.trim();\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(line.startsWith(\"\\\"@id\\\": \\\"/a/[\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tline = line.substring(\"\\\"@id\\\": \\\"/a/[\".length());\n\t\t\t\t\t\t\tint ind = line.indexOf(\",\");\n\t\t\t\t\t\t\trelation = line.substring(0,ind);\n\t\t\t\t\t\t\tline = line.substring(ind+1);\n\t\t\t\t\t\t\tind = line.indexOf(\",\");\n\t\t\t\t\t\t\tx = line.substring(0,ind);\n\t\t\t\t\t\t\tline = line.substring(ind+1);\n\t\t\t\t\t\t\tind = line.indexOf(\"]\");\n\t\t\t\t\t\t\ty = line.substring(0,ind);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(line.startsWith(\"\\\"weight\\\": \"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trelationweight = line.substring(\"\\\"weight\\\": \".length());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//can now process the edge information\n\t\t\t\t\t\t\t//we only want the things that are a room not things a room is\n\t\t\t\t\t\t\tif(y.equalsIgnoreCase(\"c/en/room/n\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSystem.out.println(x+\" \"+relation+\" \"+y);\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}\n\t\t\t\tif(processedsomething)\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tThread.sleep(16);\n\t\t\t\t\n\t\t\t\tlong time = System.currentTimeMillis();\n//\t\t\t\tif((time-startIP)>1000)\n//\t\t\t\t{\n//\t\t\t\t\t//timeout\n//\t\t\t\t\tbreak;\n//\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\t\n\t\t}\n\t}",
"public static void getOneNearbyRestaurant(final int period, String latitude, String longitude, final RouteMakerFragment.MyHandler handler) {\n Parameters parameters = new Parameters();\n parameters.add(\"lng\", longitude);\n parameters.add(\"lat\", latitude);\n parameters.add(\"radius\", 1000);\n Log.e(\"lng\",longitude);\n Log.e(\"lat\",latitude);\n JuheData.executeWithAPI(APIConstants.DIET_INFO_ID, APIConstants.DIET_INFO_IP, JuheData.GET, parameters, new DataCallBack() {\n @Override\n public void resultLoaded(int err, String reason, String result) {\n\n if (err == 0) {\n try {\n JSONObject object = new JSONObject(result);\n Log.e(\"reason2\",object.getString(\"reason\"));\n JSONArray list = object.getJSONArray(\"result\");\n JSONObject restaurant = list.getJSONObject(new Random().nextInt(list.length()));\n RouteData.dietTempInfo[period] = new RouteData.DietTemp(period,\n restaurant.getString(\"name\"),\n restaurant.getString(\"latitude\"),\n restaurant.getString(\"longitude\"),\n restaurant.getString(\"address\"),\n restaurant.getString(\"phone\"),\n restaurant.getString(\"photos\"),\n Integer.parseInt(restaurant.getString(\"very_good_remarks\").equals(\"\")?\"0\":restaurant.getString(\"very_good_remarks\")) + Integer.parseInt(restaurant.getString(\"good_remarks\").equals(\"\")?\"0\":restaurant.getString(\"good_remarks\")),\n Integer.parseInt(restaurant.getString(\"common_remarks\").equals(\"\")?\"0\":restaurant.getString(\"common_remarks\")),\n Integer.parseInt(restaurant.getString(\"bad_remarks\").equals(\"\")?\"0\":restaurant.getString(\"bad_remarks\")) + Integer.parseInt(restaurant.getString(\"very_bad_remarks\").equals(\"\")?\"0\":restaurant.getString(\"very_bad_remarks\")),\n new StringBuilder(restaurant.getString(\"recommended_dishes\")).append(restaurant.getString(\"recommended_products\").equals(\"\") || restaurant.getString(\"recommended_dishes\").equals(\"\") ? \"\" : \",\").append((restaurant.getString(\"recommended_products\"))).toString());\n Message m = new Message();\n Bundle b = new Bundle();\n b.putBoolean(\"minus\", true);\n b.putString(\"source\", \"spot\");\n m.setData(b);\n handler.handleMessage(m);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }\n });\n }",
"@Override\r\n\tpublic List<Customer_judge_driver> selectByDrivertelphone(Map<String, Object> map, String hzm) {\n\t\tList<Customer_judge_driver> list=null;\r\n\t\tCustomer_judge_driver c= new Customer_judge_driver();\r\n try{\r\n\t\t\t\r\n\t\t\tlist=getSqlMapClientTemplate().queryForList(c.getClass().getName()+\".\"+hzm,map);\r\n\t\t\t\t\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"数据连接失败,请检查数据服务是否开启\");\r\n\t\t\tthrow new RuntimeException(e.getMessage());\r\n\t\t}\r\n\t\treturn list;\r\n\t}",
"protected void fetchMySmartDevices() {\n setIsLoading(true);\n getCompositeDisposable().add(getDataManager()\n .getAllSmartDevices()\n .subscribeOn(getSchedulerProvider().io())\n .observeOn(getSchedulerProvider().ui())\n .subscribe(mySmartDevices -> {\n mySmartDevicesListLiveData.setValue(mySmartDevices);\n\n setIsLoading(false);\n }, throwable -> {\n setIsLoading(false);\n }));\n }",
"private void getVehicleList() {\n mApiCall.getVehicleList();\n }",
"public int readDistance() {\r\n\t\tint newDistance=0;\r\n\t\tint filterCount = 0;\r\n\t\twhile(filterCount<US_FILTER) {\r\n\t\t\tus.fetchSample(usData, 0); // acquire data\r\n\t\t\tnewDistance=(int) (usData[0] * 100.0);// extract from buffer, cast to int and add to total\r\n\t\t\t\r\n\t\t\tif(newDistance<=distance+US_ERROR && newDistance>=distance-US_ERROR) {\r\n\t\t\t\tfilterCount++;\r\n\t\t\t}else {\r\n\t\t\t\tfilterCount=0;\r\n\t\t\t}\r\n\t\t\tdistance=newDistance;\r\n\t\t}\r\n\t\treturn distance; \r\n\t}",
"private void QueryDirections() {\n\t\tshowProgress(true, \"正在搜索导航路线...\");\n\t\t// Spawn the request off in a new thread to keep UI responsive\n\t\tfor (final FloorInfo floorInfo : floorList) {\n\t\t\tif (floorInfo.getPoints() != null\n\t\t\t\t\t&& floorInfo.getPoints().length >= 2) {\n\n\t\t\t\tThread t = new Thread() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Start building up routing parameters\n\t\t\t\t\t\t\tRouteTask routeTask = RouteTask\n\t\t\t\t\t\t\t\t\t.createOnlineRouteTask(\n\t\t\t\t\t\t\t\t\t\t\tfloorInfo.getRouteServerPath(),\n\t\t\t\t\t\t\t\t\t\t\tnull);\n\n\t\t\t\t\t\t\tRouteParameters rp = routeTask\n\t\t\t\t\t\t\t\t\t.retrieveDefaultRouteTaskParameters();\n\t\t\t\t\t\t\tNAFeaturesAsFeature rfaf = new NAFeaturesAsFeature();\n\t\t\t\t\t\t\t// Convert point to EGS (decimal degrees)\n\t\t\t\t\t\t\t// Create the stop points (start at our location, go\n\t\t\t\t\t\t\t// to pressed location)\n\t\t\t\t\t\t\t// StopGraphic point1 = new StopGraphic(mLocation);\n\t\t\t\t\t\t\t// StopGraphic point2 = new StopGraphic(p);\n\t\t\t\t\t\t\trfaf.setFeatures(floorInfo.getPoints());\n\t\t\t\t\t\t\trfaf.setCompressedRequest(true);\n\t\t\t\t\t\t\trp.setStops(rfaf);\n\n\t\t\t\t\t\t\t// Set the routing service output SR to our map\n\t\t\t\t\t\t\t// service's SR\n\t\t\t\t\t\t\trp.setOutSpatialReference(wm);\n\t\t\t\t\t\t\trp.setFindBestSequence(true);\n\t\t\t\t\t\t\trp.setPreserveFirstStop(true);\n\t\t\t\t\t\t\tif (floorInfo.getEndPoint() != null) {\n\t\t\t\t\t\t\t\trp.setPreserveLastStop(true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Solve the route and use the results to update UI\n\t\t\t\t\t\t\t// when received\n\t\t\t\t\t\t\tfloorInfo.setRouteResult(routeTask.solve(rp));\n\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tmException = e;\n\t\t\t\t\t\t\t// mHandler.post(mUpdateResults);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trouteIndex++;\n\t\t\t\t\t\tif (routeIndex >= routeCount) {\n\t\t\t\t\t\t\tmHandler.post(mSetCheckMap);\n\t\t\t\t\t\t\tmHandler.post(mUpdateResults);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\t// Start the operation\n\t\t\t\tt.start();\n\t\t\t}\n\t\t}\n\n\t}",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == RESULT_CODE_SEARCH) {\n if (resultCode == Activity.RESULT_OK) {\n String street_name;\n String street_number;\n String meter_number;\n try {\n street_name = data.getStringExtra(\"street_name\");\n street_number = data.getStringExtra(\"street_number\");\n meter_number = data.getStringExtra(\"meter_number\");\n } catch (Exception e) {\n e.printStackTrace();\n return;\n }\n\n ArrayList<model_pro_mr_route_rows> rows = new ArrayList<>();\n for (MeterReaderController.Keys rid : MeterReaderController.route_row_keys) {\n rows.add(\n DBHelper.pro_mr_route_rows.getRouteRow(rid.getInstNode_id(),\n rid.getMobnode_id(),\n rid.getCycle(),\n rid.getRoute_number(),\n rid.getMeter_id(),\n rid.getWalk_sequence()));\n }\n\n //We have a meter number, only on record will have the entry\n if (!meter_number.isEmpty()) {\n for (model_pro_mr_route_rows r : rows) {\n if ((r.getMeter_number().compareToIgnoreCase(meter_number) == 0)) {\n setCurrentFragmentView(\n new MeterReaderController.Keys(r.getCycle(),\n r.getInstNode_id(),\n r.getMeter_id(),\n r.getMobnode_id(),\n r.getRoute_number(),\n r.getWalk_sequence()));\n return;\n }\n }\n }\n\n //We have a complete address\n if (!street_name.isEmpty() & !street_number.isEmpty()) {\n for (model_pro_mr_route_rows r : rows) {\n if ((r.getAddress_name().compareToIgnoreCase(street_name) == 0) &\n (r.getStreet_number().compareToIgnoreCase(street_number) == 0)) {\n setCurrentFragmentView(\n new MeterReaderController.Keys(r.getCycle(),\n r.getInstNode_id(),\n r.getMeter_id(),\n r.getMobnode_id(),\n r.getRoute_number(),\n r.getWalk_sequence()));\n return;\n }\n }\n }\n\n //We have a street name but no number\n if (!street_name.isEmpty()) {\n for (model_pro_mr_route_rows r : rows) {\n if (r.getAddress_name().compareToIgnoreCase(street_name) == 0) {\n setCurrentFragmentView(\n new MeterReaderController.Keys(r.getCycle(),\n r.getInstNode_id(),\n r.getMeter_id(),\n r.getMobnode_id(),\n r.getRoute_number(),\n r.getWalk_sequence()));\n return;\n }\n }\n }\n\n //We have a street number but no nname\n if (!street_number.isEmpty()) {\n for (model_pro_mr_route_rows r : rows) {\n if (r.getStreet_number().compareToIgnoreCase(street_number) == 0) {\n setCurrentFragmentView(\n new MeterReaderController.Keys(r.getCycle(),\n r.getInstNode_id(),\n r.getMeter_id(),\n r.getMobnode_id(),\n r.getRoute_number(),\n r.getWalk_sequence()));\n }\n }\n }\n }\n }\n }",
"@Test\n\tpublic void listLocations(){\n\t\tList<Location> lists = locationService.queryLoctionsByLat(29.8679775, 121.5450105);\n\t\t//System.out.println(lists.size()) ;\n\t\tfor(Location loc : lists){\n\t\t\tSystem.out.println(loc.getAddress_cn());\n\t\t}\n\t}",
"public List<String> query1(){\n List<String> list = this.stats.bus_non_available(this.mR.clone(), this.mB.clone());\n return list;\n }",
"public interface GateDevicesSet {\n\n public boolean isReady();\n\n public void setReady(boolean ready);\n\n public void setFailed(boolean failed);\n\n public long getHomeId();\n\n public void setHomeId(long homeId);\n\n public void setControllerState(DeviceStateEnum state, boolean clearRequest);\n\n public DeviceStateEnum getControllerState();\n\n public List<DeviceDTO> getDeviceDTOList();\n\n public void setDeviceDTO(DeviceDTO dto);\n\n public void addGateDevice(int index);\n\n public void removeGateDevice(int index);\n\n public void addDeviceGroup(int indexDevice, int indexGroup);\n\n public void addGateDeviceParameter(int indexDevice, ZWaveDeviceParametersNames paramName, Object paramValue);\n\n public void removeGateDeviceParameter(int indexDevice, ZWaveDeviceParametersNames paramName);\n\n public void requestMode(DeviceStateEnum mode);\n\n public DeviceStateEnum getRequestedMode();\n\n public ServerTransport getTransport();\n\n}",
"List<Device> selectByExample(DeviceExample example);",
"private void consultPluviometer() {\r\n\t\tResourceBundle bundle = ControladorContexto.getBundle(\"mensaje\");\r\n\t\tResourceBundle bundleLifeCycle = ControladorContexto\r\n\t\t\t\t.getBundle(\"messageLifeCycle\");\r\n\t\tValidacionesAction validate = ControladorContexto\r\n\t\t\t\t.getContextBean(ValidacionesAction.class);\r\n\t\tpluviometerPojoSubList = new ArrayList<PluviometerPojo>();\r\n\t\tList<SelectItem> parameters = new ArrayList<SelectItem>();\r\n\t\tStringBuilder consult = new StringBuilder();\r\n\t\tStringBuilder unionSearchMessages = new StringBuilder();\r\n\t\tString searchMessages = \"\";\r\n\t\ttry {\r\n\t\t\tadvancedSearch(consult, parameters, bundle, unionSearchMessages);\r\n\t\t\tList<Pluviometer> pluviometerList = pluviometerDao\r\n\t\t\t\t\t.consultPluviometer(consult, parameters);\r\n\t\t\tpluviometerPojoList = new ArrayList<PluviometerPojo>();\r\n\t\t\tif (pluviometerList != null) {\r\n\t\t\t\tfor (Pluviometer pluviometer : pluviometerList) {\r\n\t\t\t\t\tDate date = pluviometer.getDateRecord();\r\n\t\t\t\t\tif (pluviometerPojo == null\r\n\t\t\t\t\t\t\t|| !((date.after(pluviometerPojo.getStartWeek()) && date\r\n\t\t\t\t\t\t\t\t\t.before(pluviometerPojo.getEndWeek())))) {\r\n\t\t\t\t\t\tpluviometerPojo = new PluviometerPojo();\r\n\t\t\t\t\t\tpluviometerPojo.setWeek(ControladorFechas\r\n\t\t\t\t\t\t\t\t.getNumberWeek(pluviometer.getDateRecord()));\r\n\t\t\t\t\t\tpluviometerPojo.setStartWeek(ControladorFechas\r\n\t\t\t\t\t\t\t\t.diaInicialSemana(pluviometer.getDateRecord()));\r\n\t\t\t\t\t\tpluviometerPojo.setEndWeek(ControladorFechas\r\n\t\t\t\t\t\t\t\t.diaFinalSemana(pluviometer.getDateRecord()));\r\n\t\t\t\t\t\tpluviometerPojo.setTotal(0);\r\n\t\t\t\t\t\tpluviometerPojo.setVector(new int[7]);\r\n\t\t\t\t\t\tpluviometerPojoList.add(pluviometerPojo);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tint numberDay = ControladorFechas.getNumberDay(date);\r\n\t\t\t\t\tif (numberDay != 1) {\r\n\t\t\t\t\t\tnumberDay = numberDay - 1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tnumberDay = 7;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpluviometerPojo.setVectorPos(numberDay - 1,\r\n\t\t\t\t\t\t\tpluviometer.getReading());\r\n\t\t\t\t\tpluviometerPojo.setTotal(pluviometerPojo.getTotal()\r\n\t\t\t\t\t\t\t+ pluviometer.getReading());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlong amount = (long) pluviometerPojoList.size();\r\n\t\t\tpagination.paginar(amount);\r\n\t\t\tint totalReg = pagination.getRango();\r\n\t\t\tint start = pagination.getInicio();\r\n\t\t\tint rank = start + totalReg;\r\n\t\t\tif (pluviometerPojoList.size() < rank) {\r\n\t\t\t\trank = pluviometerPojoList.size();\r\n\t\t\t}\r\n\t\t\tthis.pluviometerPojoSubList = pluviometerPojoList.subList(start,\r\n\t\t\t\t\trank);\r\n\t\t\tif ((pluviometerPojoList == null || pluviometerPojoList.size() <= 0)\r\n\t\t\t\t\t&& !\"\".equals(unionSearchMessages.toString())) {\r\n\t\t\t\tsearchMessages = MessageFormat\r\n\t\t\t\t\t\t.format(bundle\r\n\t\t\t\t\t\t\t\t.getString(\"message_no_existen_registros_criterio_busqueda\"),\r\n\t\t\t\t\t\t\t\tunionSearchMessages);\r\n\t\t\t} else if (pluviometerPojoList == null\r\n\t\t\t\t\t|| pluviometerPojoList.size() <= 0) {\r\n\t\t\t\tControladorContexto.mensajeInformacion(null,\r\n\t\t\t\t\t\tbundle.getString(\"message_no_existen_registros\"));\r\n\t\t\t} else if (!\"\".equals(unionSearchMessages.toString())) {\r\n\t\t\t\tsearchMessages = MessageFormat\r\n\t\t\t\t\t\t.format(bundle\r\n\t\t\t\t\t\t\t\t.getString(\"message_existen_registros_criterio_busqueda\"),\r\n\t\t\t\t\t\t\t\tbundleLifeCycle.getString(\"rain_gauge_label_s\"),\r\n\t\t\t\t\t\t\t\tunionSearchMessages);\r\n\t\t\t}\r\n\t\t\tvalidate.setMensajeBusqueda(searchMessages);\r\n\t\t} catch (Exception e) {\r\n\t\t\tControladorContexto.mensajeError(e);\r\n\t\t}\r\n\t}",
"public PassengerList getPassengerList(int mCode)\r\n\t {\r\n\t\t return MRs[mCode].getPassengerList();\r\n\t }",
"public Multimap<String, OOCSIDevice> devicesByLocation() {\n\t\tpurgeStaleClients();\n\n\t\tMultimap<String, OOCSIDevice> locationsMappedDevices = MultimapBuilder.hashKeys().linkedListValues().build();\n\t\tclients.values().stream().forEach(\n\t\t od -> od.locations.entrySet().stream().forEach(loc -> locationsMappedDevices.put(loc.getKey(), od)));\n\t\treturn locationsMappedDevices;\n\t}",
"public DeviceLocator getDeviceLocator();",
"private void getTemperature() {\r\n \t\r\n \t//Get the date from the DateService class\r\n \tDate theDate = theDateService.getDate(); \r\n \t\r\n \t//Increment the number of readings\r\n \tlngNumberOfReadings ++;\r\n \tdouble temp = 0.0;\r\n \tString rep = \"\";\r\n \t\r\n \t//Assume that the TMP36 is connected to AIN4\r\n \trep = this.theTemperatureService.readTemperature(\"4\");\r\n \tpl(rep);\r\n \ttemp = this.theTemperatureService.getTheTemperature();\r\n \t\r\n \t//All details necessary to send this reading are present so create a new TemperatureReading object\r\n \tTemperatureReading theReading = new TemperatureReading(temp, theDate, lngNumberOfReadings);\r\n \tthis.send(theReading);\r\n \t\r\n }",
"private void requestServerToGetInformation() {\n Net net = Net.getInstance();\n Log.i(TAG, \"requestServerToGetInformation: Start connect server\");\n net.get(AppConstant.SERVER_COMBO_URL, new Callback() {\n @Override\n public void onFailure(Call call, IOException e) {\n Log.i(TAG, \"onFailure: connect error; \" + e.getMessage());\n }\n @Override\n public void onResponse(Call call, Response response) throws IOException {\n // get the JSON from responses.\n String jsonStr = response.body().string();\n Log.i(TAG, \"onResponse: --------------------------------\" + jsonStr);\n parseJsonAndUpdateView(jsonStr.trim());\n }\n });\n }",
"@Override\n public void onLocationChanged(Location location) {\n String myUrl = \"https://a.mapillary.com/v3/map_features?layers=trafficsigns\" +\n \"&radius=600\" +\n \"&client_id=YUNMM3lQRXRUR1Y0MDBwcEVLaFJsUTo2ZWFjY2Y0YWJhM2JmYmM5\" +\n \"&per_page=\" + numberOfResults +\n \"&closeto=\" + location.getLongitude() + \",\" + location.getLatitude();\n //String to place our result in\n String result = null;\n //Instantiate new instance of our class\n HttpGetRequest getRequest = new HttpGetRequest();\n //Perform the doInBackground method, passing in our url\n try {\n result = getRequest.execute(myUrl).get();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n try {\n JSONObject jObject = new JSONObject(result);\n JSONArray features = jObject.getJSONArray(\"features\");\n for (int i=0; i < numberOfResults; i++){\n try {\n JSONObject featuresObject = features.getJSONObject(i);\n // Pulling items from the array\n JSONObject properties = featuresObject.getJSONObject(\"properties\");\n nearbyRoadSigns[i] = properties.getString(\"value\");\n\n System.out.println(nearbyRoadSigns[i]);\n\n } catch (JSONException e) {\n // Oops\n }\n }\n locationManager.removeUpdates(this);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }",
"private void settingbusroutes() {\n String[] busroutenumbers =\n busdb.Areasroutes.keySet().toArray(new String[busdb.Areasroutes.size()]);\n ArrayAdapter <String> adapter =\n new ArrayAdapter <>(this, android.R.layout.simple_list_item_1, busroutenumbers);\n et_busroute.setThreshold(1);\n et_busroute.setAdapter(adapter);\n/* *************************************/\n\n\n/* *************************************/\n\n final List <String> areas = new ArrayList <>();\n for (String s : busdb.Areasroutes.values()) {\n if (s != null)\n areas.add(s);\n\n }\n et_area.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n new MaterialDialog.Builder(UserRegister.this)\n .title(R.string.chooseArea)\n .items(areas)\n .itemsCallback(new MaterialDialog.ListCallback() {\n @Override\n public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {\n et_area.setText(text);\n }\n })\n .show();\n }\n });\n/* *************************************/\n\n\n //pick up points\n\n final ArrayList <String> pickuppoints = new ArrayList <>();\n\n for (String key : busdb.busroute.keySet()) {\n Vector <Pair <String, String>> pairsV = busdb.busroute.get(key);\n\n for (int i = 0; i < pairsV.size(); i++) {\n\n if (pairsV.get(i).first != null)\n pickuppoints.add(pairsV.get(i).first);\n\n }\n }\n\n et_pickuppoint.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n new MaterialDialog.Builder(UserRegister.this)\n .title(R.string.choosepickup)\n .items(pickuppoints)\n .itemsCallback(new MaterialDialog.ListCallback() {\n @Override\n public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {\n et_pickuppoint.setText(text);\n }\n })\n .show();\n\n }\n });\n/* *************************************/\n\n\n }",
"public void getInfo () {\n int[] info = elevator.getInfo ();\n currFloor = info[0];\n maxCap = info[2];\n numFloors = info[3];\n currCap = info[5];\n state = info[6];\n }",
"public void searchMotors() {\n\t\t\t\n\t\t// try to limit searching \n\t\tif(ports.contains(lights)) ports.remove(lights);\n\t\t\n\t\tUtil.debug(\"discovery for motors starting on \" + ports.size()+\" ports\", this); \n\t\n\t\t//for (int i = ports.size() - 1; i >= 0; i--) {\n\t\tfor (int i=0; i<ports.size(); i++) {\n\t\t\tif (state.get(State.values.serialport)!=null) { break; } // stop if find it\n\t\t\t//if (connect(ports.get(i), BAUD_RATES[1])) {\n\t\t\tif (connect(ports.get(i), 115200)) {\n\t\t\t\tUtil.delay(TIMEOUT*2);\n\t\t\t\tif (serialPort != null) { close(); }\n\t\t\t}\n\t\t}\n\t}",
"public RetExchDevcEntitlsModel getMobileDeviceDetails(String handsetId, String phoneNumber) throws ServiceException;",
"public interface GetPokeStops {\n\n @GET(\"nearPokestop\")\n Call<List<PokeStop>> getNearBy(@Query(\"uid\") String uid, @Query(\"latitude\") double latitude, @Query(\"longitude\") double longitude);\n\n}",
"public void getDeviceByModelNumber()\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Enter Model number \");\r\n\t\t\tString searchModelNumber = sc.nextLine();\r\n\t\t\t\r\n\t\t\tDevice d = record.getDeviceByModelNumber(searchModelNumber);\r\n\t\t\tprintDeviceDetails(d);\r\n\t\t}",
"public static List<Object> getMidLocationBetweenTwoLocation(final String sourceAddress, final String destinationAddress, final String API_KEY) {\n\n\n final List<String> list = new ArrayList<>();\n final List<Object> midPointList = new ArrayList<>();\n\n Thread thread = new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n\n URL url = new URL(\"https://maps.googleapis.com/maps/api/directions/json?\" + \"origin=\" + sourceAddress + \"&destination=\" + destinationAddress + \"&key=\" + API_KEY);\n HttpHandler handler = new HttpHandler();\n String jsonStr = handler.makeServiceCall(String.valueOf(url));\n\n if (jsonStr != null) {\n\n JSONObject jsonObject = new JSONObject(jsonStr);\n JSONArray jsonArray = jsonObject.getJSONArray(\"routes\");\n\n System.out.println(\"response:\" + jsonArray);\n\n if (jsonArray != null && jsonArray.length() > 0) {\n JSONArray legsObject = jsonArray.getJSONObject(2).getJSONArray(\"legs\");\n if (legsObject != null) {\n JSONArray stepsArray = legsObject.getJSONObject(6).getJSONArray(\"steps\");\n if (stepsArray != null && stepsArray.length() > 0) {\n for (int i = 0; i < stepsArray.length(); i++) {\n JSONObject object = stepsArray.getJSONObject(i);\n\n if (object.has(\"end_location\")) {\n JSONObject end_locationObject = object.getJSONObject(\"end_location\");\n double lat = end_locationObject.getDouble(\"lat\");\n double lng = end_locationObject.getDouble(\"lng\");\n\n URL lat_lng_url = new URL(\"https://maps.googleapis.com/maps/api/geocode/json?\" + \"latlng=\" + lat + \",\" + lng + \"&key=\" + API_KEY);\n\n JSONObject latlngObject = new JSONObject(String.valueOf(lat_lng_url));\n\n JSONArray latlngArray = latlngObject.getJSONArray(\"results\");\n\n if (latlngArray != null && latlngArray.length() > 0) {\n JSONObject addressObj = latlngArray.getJSONObject(1);\n String formatted_address = addressObj.getString(\"formatted_address\");\n list.add(formatted_address);\n }\n }\n }\n midPointList.addAll(list);\n }\n }\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n });\n thread.start();\n try {\n thread.join();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n return midPointList;\n }",
"@Test\n public void distanceTest() {\n //Query Matrix API\n Response response = given()\n .param(\"locations\", getParameter(\"manyLocations\"))\n .param(\"sources\", \"all\")\n .param(\"destinations\",\"all\")\n .param(\"metrics\", \"distance\")\n .param(\"profile\", \"driving-car\")\n .param(\"resolve_locations\", \"true\")\n .when()\n .get(getEndPointName());\n\n String[] locations = (String[]) getParameter(\"manyLocationsArray\");\n\n Assert.assertEquals(response.getStatusCode(), 200);\n JSONObject jResponse = new JSONObject(response.body().asString());\n JSONArray jDistances = jResponse.getJSONArray(\"distances\");\n //Query Routing API 12x12 times\n for(int i = 0; i < 12; i++) {\n for (int j = 0; j < 12; j++) {\n Response response2 = given()\n .param(\"coordinates\", locations[i] + \"|\" + locations[j])\n .param(\"instructions\", \"false\")\n .param(\"preference\", getParameter(\"preference\"))\n .param(\"profile\", getParameter(\"carProfile\"))\n .when()\n .get(\"routes\");\n\n JSONObject jResponseRouting = new JSONObject(response2.body().asString());\n JSONObject jRoute = (jResponseRouting.getJSONArray(\"routes\")).getJSONObject(0);\n double routeDistance = jRoute.getJSONObject(\"summary\").getDouble(\"distance\");\n double matrixDistance = jDistances.getJSONArray(i).getDouble(j);\n Assert.assertTrue( matrixDistance - .1 < routeDistance);\n Assert.assertTrue( matrixDistance + .1 > routeDistance);\n\n }\n }\n }",
"private HashMap<String, ElectricalMeasurement> currentMeasurementSelection(HashMap<String, ElectricalMeasurement> currentMeasurement, DistrictModel districtAgentModel) {\r\n\t\tHashMap<String, ElectricalMeasurement> selectedMeasurement = new HashMap<>();\r\n\t\tVector<NetworkComponent> sensors = this.findSensors(districtAgentModel.getvNetworkComponents());\r\n\t\t\r\n\t\tfor(int i=0; i<sensors.size();i++) {\r\n\t\t\tString sensorKey = sensors.get(i).getId();\r\n\t\t\tElectricalMeasurement electricalMeasurement = currentMeasurement.get(sensorKey);\r\n\t\t\tselectedMeasurement.put(sensorKey, electricalMeasurement);\r\n\t\t}\r\n\t\t\r\n\t\treturn selectedMeasurement;\r\n\t}",
"List<CmstTransfdevice> selectByExample(CmstTransfdeviceExample example);",
"public HashMap<String, String> getCalculation(){\n return directionsList;\n }",
"private void distanceMatrixNetworkCall() {\n //Get all addresses\n List<String> addresses = new ArrayList<>();\n\n //Get the address to find distances from first\n addresses.add(selectedLat + \",\" + selectedLong);\n\n //Get doctors\n List<Doctor> doctors = new DoctorDao(getApplicationContext()).findAll();\n\n //add all doctors office addresses from database\n for (int i = 0; i < doctors.size(); i++) {\n addresses.add(doctors.get(i).getOfficeAddress());\n }\n\n //add the options for the request\n Map<String, Boolean> options = new HashMap<>();\n options.put(\"allToAll\", false);\n\n //create an object\n DistanceMatrixRequest requestObj = new DistanceMatrixRequest(addresses, options);\n\n Gson gson = new Gson();\n\n RequestQueue queue = Volley.newRequestQueue(getApplicationContext());\n\n GsonDistanceMatrixRequest gsonRequest = new GsonDistanceMatrixRequest(requestObj\n , new Response.Listener<DistanceMatrixResponse>() {\n @Override\n public void onResponse(DistanceMatrixResponse response) {\n\n //add doctors name address and distance to hashmap list for the nearby doctors list adapter\n for (int i = 0; i < doctors.size(); i++) {\n // create a hashmap\n HashMap<String, String> hashMap = new HashMap<>();\n\n // convert image int to a string and place it into the hashmap with an images key\n hashMap.put(\"id\", String.valueOf(doctors.get(i).getID()));\n hashMap.put(\"name\", \"Dr. \" + doctors.get(i).getFirstName() + \" \" + doctors.get(i).getLastName());\n hashMap.put(\"address\", doctors.get(i).getOfficeAddress());\n hashMap.put(\"distance\", String.valueOf(response.getDistance().get(i + 1)));\n\n DistanceMatrixResponse.Location location = response.getLocations().get(i + 1);\n hashMap.put(\"lat\", String.valueOf(location.getLatLng().getLat()));\n hashMap.put(\"lng\", String.valueOf(location.getLatLng().getLng()));\n\n // add this hashmap to the list\n nearbyDoctorsData.add(hashMap);\n }\n\n displayNearbyDoctors(mListViewDoctors);\n\n\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Toast.makeText(LocateDoctorActivity.this, \"Unable to Retrieve Nearby Doctors\", Toast.LENGTH_SHORT).show();\n }\n });\n\n queue.add(gsonRequest);\n\n }",
"Request<List<UserInfoDetailsProxy>> getPassengerList(List<Long> passengers);",
"@Override\n\tpublic Object doService() throws Exception {\n\t\t\n\t\tString sql;\n\t\n\t\tList<Map<String,Object>> list=new ArrayList<Map<String,Object>>();\n\t\t\n\t\t\n\t\t\n\t\t//全路网\n\t\t\t String [] selType=JsonTagContext.getRequest().getParameterValues(\"selType[]\");\n\t\t\tString tp_sql=\"0\";\n\t\t\tif(selType!=null){\n\t\t\t\tfor(String tp:selType){\n\t\t\t\t\tif(\"1\".equals(tp)){\n\t\t\t\t\t\ttp_sql+=\"+enter_times\";\n\t\t\t\t\t}else if(\"2\".equals(tp)){\n\t\t\t\t\t\ttp_sql+=\"+exit_times\";\n\t\t\t\t\t}else if(\"3\".equals(tp)){\n\t\t\t\t\t\ttp_sql+=\"+change_times\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tsql =\"SELECT T.*, ROWNUM RN FROM (\"\n\t\t\t\t\t+\"select b.district_code,sum(in_pass_num) in_pass_num from\"\n\t\t\t\t\t +\"(select station_id,round(sum(\"+tp_sql+\")/1000000,2) in_pass_num from TBL_METRO_FLUXNEW_\" +date+\" GROUP BY station_id) a,\"\n\t\t\t\t\t+\"(select * from tbl_metro_station_info_area WHERE STATION_VER in (select max(STATION_VER) from tbl_metro_station_info_area)) b\"\n\t\t\t\t\t +\" where a.STATION_ID=b.station_id\"\n\t\t\t\t\t +\" GROUP BY b.district_code order by in_pass_num desc\"\n\t\t\t\t+ \") T where ROWNUM <= ?\" ;\n\t\t\t//jsonTagJdbcDao.getJdbcTemplate().setMaxRows(this.getSize());\n\t\t\tlist = jsonTagJdbcDao.getJdbcTemplate().queryForList(sql,this.getSize());\n\t\t\t\n\t\t\n\t\t\t\n\t\t \n\t\t \n\t\treturn list;\n\t\t\n\t}",
"public ArrayList<Node> getLuasNodes(ArrayList<Node> initialList, LatLng startLocation, LatLng EndLocation){\n ArrayList<Node> luasStopList = nodeMinimisation.findMatchingLuasStops(initialList,startLocation,EndLocation);\n for(Node bus : luasStopList){\n System.out.println(\"stop is: \"+bus.getStopId());\n }\n return luasStopList;\n }",
"@Test\n public void getMeasurementUsingGETTest() throws ApiException {\n String date = null;\n String time = null;\n String place = null;\n String pollutant = null;\n MeasurementsDTO response = api.getMeasurementUsingGET(date, time, place, pollutant);\n\n // TODO: test validations\n }",
"private void getStateRelay(){\n Retrofit retrofit = new Retrofit.Builder()\n .baseUrl(URL)\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n\n ServiceAPI serviceAPI = retrofit.create(ServiceAPI.class);\n final Call<RelayModel> relayModel = serviceAPI.getStateRelay();\n relayModel.enqueue(new Callback<RelayModel>() {\n @Override\n public void onResponse(Call<RelayModel> call, Response<RelayModel> response) {\n switchButtonLamp.setChecked(response.body().getLamp());\n switchButtonFan.setChecked(response.body().getFan());\n //switchButtonSpray.setChecked(response.body().getSpray());\n switchButtonExhaustFan.setChecked(response.body().getExhaust());\n\n }\n\n @Override\n public void onFailure(Call<RelayModel> call, Throwable t) {\n\n }\n });\n }",
"public void searchLights() {\n\t\n\t\t// try to limit searching\n\t\tif(ports.contains(motors)) ports.remove(motors);\n\t\tif(state.get(State.values.serialport) != null) \n\t\t\tports.remove(state.get(State.values.serialport));\n\t\t\t\n\t\tUtil.debug(\"discovery for lights starting on ports: \" + ports.size(), this);\n\t\t\n\t\tfor (int i = ports.size() - 1; i >= 0; i--) {\n\t\t\tif (state.get(State.values.lightport)!=null) { break; } // stop if find it\n\t\t\t//if (connect(ports.get(i), BAUD_RATES[0])) {\t\n\t\t\tif (connect(ports.get(i), 57600)) {\n\t\t\t\tUtil.delay(TIMEOUT*2);\n\t\t\t\tif (serialPort != null) { close(); }\n\t\t\t}\n\t\t}\n\t}",
"public interface RWDeviceMapper {\n /**\n * 批量获取设备\n * 0\n *\n * @param longs\n * @return\n */\n public List<DeviceRoleDeviceRea> RWbatchCWsByDeviceId(List<String> longs);\n\n /**\n * 1\n *\n * @param longs\n * @return\n */\n public List<DeviceRoleDeviceRea> MHbatchCWsByDeviceId(List<String> longs);\n\n /**\n * 2\n *\n * @param longs\n * @return\n */\n public List<DeviceRoleDeviceRea> CWbatchCWsByDeviceId(List<String> longs);\n\n /**\n * 3\n *\n * @param longs\n * @return\n */\n public List<DeviceRoleDeviceRea> ECbatchCWsByDeviceId(List<String> longs);\n\n /**\n * 根据区域 查询 地表水设备\n *\n * @return\n */\n public List<XwEquipmentRwDO> getRWAllBySelect_v1(AreaToDeviceVO_v1 areaToDeviceVO_v1);\n /**\n * 根据区域 查询 地表水设备\n *\n * @return\n */\n public List<XwEquipmentRwDO> getRWAllBySelect_v1_admin(AreaToDeviceVO_v1 areaToDeviceVO_v1);\n\n /**\n * 根据区域 查询 井盖 设备\n *\n * @return\n */\n public List<XwEquipmentMhDO> getMHAllBySelect_v1(AreaToDeviceVO_v1 areaToDeviceVO_v1);\n /**\n * 根据区域 查询 井盖 设备\n *\n * @return\n */\n public List<XwEquipmentMhDO> getMHAllBySelect_v1_admin(AreaToDeviceVO_v1 areaToDeviceVO_v1);\n\n /**\n * 根据区域 查询 生活用水 设备\n *\n * @return\n */\n public List<XwEquipmentCwDO> getCWAllBySelect_v1(AreaToDeviceVO_v1 areaToDeviceVO_v1);\n /**\n * 根据区域 查询 生活用水 设备\n *\n * @return\n */\n public List<XwEquipmentCwDO> getCWAllBySelect_v1_admin(AreaToDeviceVO_v1 areaToDeviceVO_v1);\n\n /**\n * 根据区域 查询 电梯 设备\n *\n * @return\n */\n public List<XwEquipmentEcDO> getECAllBySelect_v1(AreaToDeviceVO_v1 areaToDeviceVO_v1);\n /**\n * 根据区域 查询 电梯 设备\n *\n * @return\n */\n public List<XwEquipmentEcDO> getECAllBySelect_v1_admin(AreaToDeviceVO_v1 areaToDeviceVO_v1);\n}",
"@Override\n public void onConnected(Bundle dataBundle) {\n mLocation = mLocationClient.getLastLocation();\n\n double lat = mLocation.getLatitude();\n double lon = mLocation.getLongitude();\n\n if(lat < -90)\n {\n if(lon > 45 && lon < 75)\n mRegion.setSelection(7);\n }\n else if(lat < -60)\n {\n if(lon < 45 && lon > 30)\n mRegion.setSelection(6);\n }\n else if(lat < -30)\n {\n if(lon > 30 && lon < 75)\n mRegion.setSelection(2);\n }\n else if(lat < 30)\n {\n if(lon < 60 && lon > 30)\n mRegion.setSelection(1);\n }\n else if(lat < 60)\n {\n if(lon > -30 && lon < 0)\n mRegion.setSelection(5);\n if(lon < 15 && lon > -20)\n mRegion.setSelection(8);\n if(lon < -20 && lon > -60)\n mRegion.setSelection(9);\n }\n else if(lat < 90)\n {\n if(lon < 15 && lon > -20)\n mRegion.setSelection(8);\n if(lon < -20 && lon > -60)\n mRegion.setSelection(9);\n if(lon < 75 && lon > 30)\n mRegion.setSelection(0);\n }\n else if(lat < 120)\n {\n if(lon < 75 && lon > 30)\n mRegion.setSelection(0);\n }\n else\n {\n mRegion.setSelection(4);\n }\n }",
"private void locationRequests(){\n mFusedClient = LocationServices.getFusedLocationProviderClient(this);\n mLocationCallback = new LocationCallback(){\n @Override\n public void onLocationResult(LocationResult locationResult){\n List<Location> locationList = locationResult.getLocations();\n if(locationList.size() > 0){\n Location location = locationList.get(locationList.size() - 1);\n Log.i(TAG, \"Location: \" + location.getLatitude() + \" \" + location.getLongitude());\n mLatitude = String.valueOf(location.getLatitude());\n mLongitude = String.valueOf(location.getLongitude());\n }\n }\n };\n mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(UPDATE_INTERVAL_IN_MILLISECONDS);\n mLocationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL_IN_MILLISECONDS);\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){\n if(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mFusedClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n } else {\n getLocation();\n }\n } else {\n mFusedClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }\n }",
"private void getDistance() {\n\n float dist = 0;\n Location location = \n locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n while (location==null) { //If we don't know where we are right now\n Toast.makeText(this, \"No last known location. Aborting...\", \n Toast.LENGTH_LONG).show();\n location = \n locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }\n\n createPositions();\n\n dist = location.distanceTo(mPositions.get(0).toLocation());\n distanceList.add(dist);\n\n dist = mPositions.get(0).toLocation().distanceTo(mPositions.get(1).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(1).toLocation().distanceTo(mPositions.get(2).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(2).toLocation().distanceTo(mPositions.get(3).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(3).toLocation().distanceTo(mPositions.get(4).toLocation());\n distanceList.add(dist);\n \n }",
"Set<Ride> queryRidesFromSupplier(Trip trip, Supplier supplier){\n Map<String, String> parameters = journeyRequestLocationsToParameters(trip);\n String parsedParameters = new HttpUrlParameterParser().parseParameters(parameters);\n String urlAddress = REQUEST_ROOT_URL + supplier.toString() + \"?\" + parsedParameters;\n IConnection<HttpURLConnection, String> httpConnectionHandler = new HttpConnectionHandler();\n HttpURLConnection connection = httpConnectionHandler.connect(urlAddress);\n\n if(connection == null){\n return new HashSet<>();\n }\n\n String response = httpConnectionHandler.getResponse(connection);\n return extractRidesFromResponse(response, trip.getNumPassengers(), supplier);\n }",
"public static String findTemp(String lat, String lon) {\n //final String methodPath = \"/entities.electricityusage/\";\n //initialize\n URL url = null;\n String appid = \"appid=f93bd59bea3ab44fb8dba0d95596adfc\";\n HttpURLConnection conn = null;\n String textResult = \"\";\n //making http request\n try {\n url = new URL(WEATHER_URI + \"lat=\" + lat + \"&\" + \"lon=\" + lon + \"&\" +appid);\n // open the connection\n conn = (HttpURLConnection) url.openConnection();\n // set the time out\n conn.setReadTimeout(10000);\n conn.setConnectTimeout(15000);\n // set the connection method to GET\n conn.setRequestMethod(\"GET\");\n //add http headers to set your response type to json\n conn.setRequestProperty(\"Content-Type\", \"application/json\");\n conn.setRequestProperty(\"Accept\", \"application/json\");\n //Read the response\n Scanner inStream = new Scanner(conn.getInputStream());\n //read the input stream and store it as string\n while (inStream.hasNextLine()) {\n textResult += inStream.nextLine();\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n conn.disconnect();\n }\n return textResult;\n }",
"@Override public String toString(){\r\n \tint counter =1;\r\n StringBuilder output = new StringBuilder();\r\n for (Iterator<Meters> i = MetersList.iterator(); i.hasNext();){\r\n \toutput.append(\"Meter #:\"+counter+\" \");\r\n output.append(i.next().toString());\r\n output.append(\"\\n\");\r\n counter ++;\r\n }\r\n return output.toString();\r\n }",
"private String populateMtrRdr() {\n\t\tAppLog.begin();\n\t\ttry {\n\t\t\tMeterReaderDetails meterReaderDetails = new MeterReaderDetails();\n\t\t\tmeterReaderDetails.setMeterReaderEmployeeID(meterReaderID);\n\t\t\tList<MeterReaderDetails> meterReaderList = (ArrayList<MeterReaderDetails>) MRDTaggingDAO\n\t\t\t\t\t.getMeterReaderList(meterReaderDetails);\n\t\t\tStringBuffer meterReaderDropdown = new StringBuffer();\n\t\t\tmeterReaderDropdown\n\t\t\t\t\t.append(\"<select name=\\\"meterReaderID\\\" id=\\\"meterReaderID\\\" class=\\\"selectbox-long\\\">\");\n\t\t\tmeterReaderDropdown.append(\"\");\n\t\t\tmeterReaderDetails = null;\n\t\t\tif (null != meterReaderList && meterReaderList.size() > 0) {\n\t\t\t\tfor (int i = 0; i < meterReaderList.size(); i++) {\n\t\t\t\t\tmeterReaderDetails = (MeterReaderDetails) meterReaderList\n\t\t\t\t\t\t\t.get(i);\n\t\t\t\t\tmeterReaderDropdown.append(optionTagBeginPart1);\n\t\t\t\t\tmeterReaderDropdown.append(meterReaderDetails\n\t\t\t\t\t\t\t.getMeterReaderID());\n\t\t\t\t\tmeterReaderDropdown.append(optionTagBeginPart2);\n\t\t\t\t\tmeterReaderDropdown.append(meterReaderDetails\n\t\t\t\t\t\t\t.getMeterReaderName());\n\t\t\t\t\tmeterReaderDropdown.append(optionTagEnd);\n\t\t\t\t}\n\t\t\t}\n\t\t\tmeterReaderDropdown.append(selectTagEnd);\n\t\t\tinputStream = new StringBufferInputStream(meterReaderDropdown\n\t\t\t\t\t.toString());\n\t\t} catch (Exception e) {\n\t\t\tinputStream = new StringBufferInputStream(\n\t\t\t\t\t\"<font color='red' size='2'><li><span><b>ERROR:Sorry, There was problem while Processing Last Operation.</b></font>\");\n\t\t\tAppLog.error(e);\n\t\t}\n\t\tAppLog.end();\n\t\treturn SUCCESS;\n\t}",
"public void populateVitals() {\n try {\n Statement stmt = con.createStatement();\n\n ResultSet rs = stmt.executeQuery(\"select * from device\");\n while (rs.next()) {\n\n String guid = rs.getString(\"DeviceGUID\");\n int deviceId = rs.getInt(\"DeviceID\");\n int deviceTypeId = rs.getInt(\"DeviceTypeID\");\n int locationId = rs.getInt(\"LocationID\");\n float deviceProblem = rs.getFloat(\"ProblemPercentage\");\n\n String dateService = rs.getString(\"DateOfInitialService\");\n\n Device device = new Device();\n device.setDateOfInitialService(dateService);\n device.setDeviceGUID(guid);\n device.setDeviceID(deviceId);\n device.setDeviceTypeID(deviceTypeId);\n device.setLocationID(locationId);\n device.setProblemPercentage(deviceProblem);\n\n deviceList.add(device);\n\n }\n } catch (SQLException e) {\n log.error(\"Error populating devices\", e);\n }\n\n }",
"private void getWalkinList(){\n sendPacket(CustomerTableAccess.getConnection().getWalkinList());\n \n }",
"public abstract List<NADevice> getDevices(Context context);",
"@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"buslabel\", sShareBusLable);\n params.put(\"direction\", sShareDirection);\n params.put(\"ss\", sSharestopSerial);\n params = CGlobals_lib_ss.getInstance().getBasicMobileParamsShort(params,\n Constants_bus.SHARE_BUS_LOCATION_URL, mActivity);\n String delim = \"\";\n StringBuilder getParams = new StringBuilder();\n for (Map.Entry<String, String> entry : params.entrySet()) {\n getParams.append(delim + entry.getKey() + \"=\"\n + entry.getValue());\n delim = \"&\";\n }\n String url1 = Constants_bus.SHARE_BUS_LOCATION_URL;\n try {\n String url = url1 + \"?\" + getParams.toString()\n + \"&verbose=Y\";\n System.out.println(\"url \" + url);\n\n } catch (Exception e) {\n SSLog_SS.e(TAG + \" callBusTrip\", e.getMessage());\n }\n return CGlobals_BA.getInstance().checkParams(params);\n }",
"@JsonIgnore public Collection<Distance> getFlightDistanceDistances() {\n final Object current = myData.get(\"flightDistance\");\n if (current == null) return Collections.emptyList();\n if (current instanceof Collection) {\n return (Collection<Distance>) current;\n }\n return Arrays.asList((Distance) current);\n }",
"private ArrayList<String> getEquipment() throws IOException {\n\t// System.out.println(\"ROVER_02 method getEquipment()\");\n\tGson gson = new GsonBuilder().setPrettyPrinting().create();\n\tout.println(\"EQUIPMENT\");\n\n\tString jsonEqListIn = in.readLine(); // grabs the string that was\n\t\t\t\t\t\t\t\t\t\t\t// returned first\n\tif (jsonEqListIn == null) {\n\t\tjsonEqListIn = \"\";\n\t}\n\tStringBuilder jsonEqList = new StringBuilder();\n\t// System.out.println(\"ROVER_02 incomming EQUIPMENT result - first\n\t// readline: \" + jsonEqListIn);\n\n\tif (jsonEqListIn.startsWith(\"EQUIPMENT\")) {\n\t\twhile (!(jsonEqListIn = in.readLine()).equals(\"EQUIPMENT_END\")) {\n\t\t\tif (jsonEqListIn == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// System.out.println(\"ROVER_02 incomming EQUIPMENT result: \" +\n\t\t\t// jsonEqListIn);\n\t\t\tjsonEqList.append(jsonEqListIn);\n\t\t\tjsonEqList.append(\"\\n\");\n\t\t\t// System.out.println(\"ROVER_02 doScan() bottom of while\");\n\t\t}\n\t} else {\n\t\t// in case the server call gives unexpected results\n\t\tclearReadLineBuffer();\n\t\treturn null; // server response did not start with \"EQUIPMENT\"\n\t}\n\n\tString jsonEqListString = jsonEqList.toString();\n\tArrayList<String> returnList;\n\treturnList = gson.fromJson(jsonEqListString, new TypeToken<ArrayList<String>>() {\n\t}.getType());\n\t// System.out.println(\"ROVER_02 returnList \" + returnList);\n\n\treturn returnList;\n}",
"public List<Device> getListDevice() {\n\n\t\tList<Device> listDevice = new ArrayList<Device>();\n\n\t\tDevice device = new Device();\n\n\t\tdevice.setName(\"DeviceNorgren\");\n\t\tdevice.setManufacturer(\"Norgren\");\n\t\tdevice.setVersion(\"5.7.3\");\n\t\tdevice.setDescriptionSemantic(\"http://www.loa-cnr.it/ontologies/DUL.owl#isDescribedBy\");\n\n\t\tSensor sensorTemperature = new Sensor();\n\t\tsensorTemperature.setName(\"SensorSiemens\");\n\t\tsensorTemperature.setManufacturer(\"Siemens\");\n\t\tsensorTemperature.setVersion(\"1.2.2\");\n\t\tsensorTemperature.setDescriptionSemantic(\"http://www.loa-cnr.it/ontologies/DUL.owl#isDescribedBy\");\n\t\tsensorTemperature.setMonitor(\"Temperature\");\n\n\t\tSensor sensorPressure = new Sensor();\n\t\tsensorPressure.setName(\"SensorOmron\");\n\t\tsensorPressure.setManufacturer(\"Omron\");\n\t\tsensorPressure.setVersion(\"0.5.2\");\n\t\tsensorPressure.setDescriptionSemantic(\"http://www.loa-cnr.it/ontologies/DUL.owl#isDescribedBy\");\n\t\tsensorPressure.setMonitor(\"Pressure\");\n\n\t\tdevice.getListSensor().add(sensorTemperature);\n\t\tdevice.getListSensor().add(sensorPressure);\n\n\t\tActuator actuadorKey = new Actuator();\n\n\t\tactuadorKey.setName(\"SensorAutonics\");\n\t\tactuadorKey.setManufacturer(\"Autonics\");\n\t\tactuadorKey.setVersion(\"3.1\");\n\t\tactuadorKey.setDescriptionSemantic(\"http://www.loa-cnr.it/ontologies/DUL.owl#isDescribedBy\");\n\t\tactuadorKey.setAction(\"On-Off\");\n\n\t\tdevice.getListActuator().add(actuadorKey);\n\n\t\tlistDevice.add(device);\n\n\t\treturn listDevice;\n\n\t}",
"private void fetchRatesData() {\r\n RequesterBean requesterBean = new RequesterBean();\r\n requesterBean.setFunctionType(GET_RATE_DATA);\r\n requesterBean.setDataObject(instituteRatesBean);\r\n \r\n AppletServletCommunicator appletServletCommunicator = new \r\n AppletServletCommunicator(CONNECTION_STRING, requesterBean);\r\n appletServletCommunicator.setRequest(requesterBean);\r\n appletServletCommunicator.send();\r\n ResponderBean responderBean = appletServletCommunicator.getResponse();\r\n \r\n if(responderBean == null) {\r\n //Could not contact server.\r\n CoeusOptionPane.showErrorDialog(COULD_NOT_CONTACT_SERVER);\r\n return;\r\n }\r\n \r\n if(responderBean.isSuccessfulResponse()) {\r\n Hashtable ratesData = (Hashtable)responderBean.getDataObject();\r\n hasMaintainCodeTablesRt = ((Boolean)ratesData.get(\"HAS_OSP_RIGHT\")).booleanValue();\r\n if( hasMaintainCodeTablesRt ){\r\n setFunctionType(TypeConstants.MODIFY_MODE);\r\n }else {\r\n setFunctionType(TypeConstants.DISPLAY_MODE);\r\n }\r\n //queryKey = RATES + ratesData.get(\"PARENT_UNIT_NUMBER\").toString();\r\n\r\n //Set title\r\n dlgRates.setTitle(RATES + \" for Unit \" + instituteRatesBean.getUnitNumber());\r\n queryEngine.addDataCollection(queryKey, ratesData);\r\n\r\n }else {\r\n //Server Error\r\n CoeusOptionPane.showErrorDialog(responderBean.getMessage());\r\n return;\r\n }\r\n }",
"public float getDistanceData() {\n\t\tultrasonicSample.fetchSample(distanceData, 0);\n\t\tfloat distance = distanceData[0]*100; //change the unit from m to cm\n\t\tfloat distanceToReturn;\n\t\tif (distance >= WALL_DIS + WIDTH && filterControl < FILTER_OUT) {\n\t\t\t// bad value, do not set the distance var, however do increment the\n\t\t\t// filter value\n\t\t\tfilterControl++;\n\t\t\tdistanceToReturn = lastDistance;\n\t\t} else if (distance >= WALL_DIS + WIDTH) {\n\t\t\t// We have repeated large values, so there must actually be nothing\n\t\t\t// there: leave the distance alone\n\t\t\tdistanceToReturn = distance;\n\t\t\tlastDistance = distance;\n\t\t}else {\n\t\t\t// distance too low: reset filter and leave\n\t\t\t// distance alone.\n\t\t\tfilterControl = 0;\n\t\t\tdistanceToReturn = distance;\n\t\t\tlastDistance = distance;\n\t\t}\n\t LCD.drawString(\"D: \" +distanceToReturn, 0, 3);\n\t\treturn distanceToReturn;\n\t}",
"private void onAllTemperatures(RequestAllTemperatures r){\n\t\tgetContext().actorOf(DeviceGroupQuery.props(\n\t\t\t\tactorsIds, r.requestId, getSender(), new FiniteDuration(3, TimeUnit.SECONDS)));\n\t}",
"public ArrayList getUnits();",
"public double[] getLocation()\n {\n \t\t\t\t\n\t\t\ttry{\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tLocation place = null;\n\t\t\t\tdouble[] resultLocation = new double[2];\n\t\t\t\t\n\t\t\t\t\tswitch (option)\n\t\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\tcase GPS:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tplace = locationManager\n\t\t\t \t\t.getLastKnownLocation(LocationManager.GPS_PROVIDER);\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase NETWORK:\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\tplace = locationManager\n\t\t\t\t\t\t\t\t\t.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\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\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\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tresultLocation[0] = place.getLongitude();\n\t\t\t\t\tresultLocation[1] = place.getLatitude();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\treturn resultLocation;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t}catch(Exception error){\n\t\t\t\t\n\t\t\t\tLog.d(\"ERROR CLASS GEO LOCATION - GET LOCATION\", error.getMessage());\n\t\t\t\t\n\t\t\t}\n\t\t\t \n \treturn null;\n\t\t\t\n }",
"public static List<Quake> getQuakeData(String caller, String urlPath, String magnitude, String duration, String distance, Context context) {\n List<Quake> quakeList = new ArrayList<Quake>();\n HttpURLConnection urlConnection = null;\n BufferedReader reader = null;\n try {\n URL url = new URL(urlPath);\n urlConnection = (HttpURLConnection) url.openConnection();\n urlConnection.setRequestMethod(\"GET\");\n Log.d(MainActivity.APP_TAG, \"Utility: Connecting \" + url);\n urlConnection.setConnectTimeout(5000);\n urlConnection.setReadTimeout(5000);\n urlConnection.connect();\n Log.d(MainActivity.APP_TAG, \"Utility: Received data from \" + url);\n\n // Read the input stream into a String\n InputStream inputStream = urlConnection.getInputStream();\n StringBuilder stringBuilder = new StringBuilder();\n reader = new BufferedReader(new InputStreamReader(inputStream));\n\n String line;\n while ((line = reader.readLine()) != null) {\n stringBuilder.append(line);\n }\n\n Log.d(MainActivity.APP_TAG, \"Utility: JSON String: \" + stringBuilder.toString());\n if (stringBuilder.length() > 0) {\n JSONObject jsonObject = new JSONObject(stringBuilder.toString());\n JSONArray featuresArray = jsonObject.getJSONArray(\"features\");\n\n if (featuresArray != null && featuresArray.length() > 0) {\n Log.d(MainActivity.APP_TAG, caller + \" : \" + stringBuilder.toString());\n for (int i = 0; i < featuresArray.length(); i++) {\n JSONObject propertiesObject = featuresArray.getJSONObject(i).getJSONObject(\"properties\");\n if (propertiesObject != null) {\n float mag = (propertiesObject.getString(\"mag\") != null && !propertiesObject.getString(\"mag\").equals(\"null\")) ? Float.valueOf(propertiesObject.getString(\"mag\").toString()) : 0;\n if (mag < Float.valueOf(magnitude)) {\n continue;\n }\n long timeStamp = (propertiesObject.getString(\"time\") != null) ? Long.valueOf(propertiesObject.getString(\"time\").toString()) : 0;\n if (timeStamp > 0 && duration != null && duration.equals(\"today\") && url.toString().equals(Utility.urlType.get(\"today\"))) {\n if (!inRange(timeStamp)) {\n continue;\n }\n }\n String place = propertiesObject.getString(\"place\").toString();\n String urlLink = propertiesObject.getString(\"url\").toString();\n String significance = propertiesObject.getString(\"sig\").toString();\n String status = propertiesObject.getString(\"status\").toString();\n String title = propertiesObject.getString(\"title\").toString();\n\n JSONObject geometryObject = featuresArray.getJSONObject(i).getJSONObject(\"geometry\");\n String eventId = featuresArray.getJSONObject(i).getString(\"id\").toString();\n if (geometryObject != null) {\n double longitude = (geometryObject.getJSONArray(\"coordinates\") != null && geometryObject.getJSONArray(\"coordinates\").length() > 0) ? Double.parseDouble(geometryObject.getJSONArray(\"coordinates\").get(0).toString()) : 0;\n double latitude = (geometryObject.getJSONArray(\"coordinates\") != null && geometryObject.getJSONArray(\"coordinates\").length() > 1) ? Double.parseDouble(geometryObject.getJSONArray(\"coordinates\").get(1).toString()) : 0;\n double depth = (geometryObject.getJSONArray(\"coordinates\") != null && geometryObject.getJSONArray(\"coordinates\").length() > 2) ? Double.parseDouble(geometryObject.getJSONArray(\"coordinates\").get(2).toString()) : 0;\n if (longitude != 0 && longitude != 0 && depth != 0) {\n quakeList.add(new Quake(String.valueOf(mag), longitude, latitude, place, depth, String.valueOf(timeStamp), urlLink, status, title, significance, eventId));\n }\n }\n }\n }\n }\n }\n } catch (Exception exception) {\n quakeList = null;\n Log.e(MainActivity.APP_TAG, \"Utility: getQuakeData Exception: \" + exception.toString());\n addErrorEntry(context, exception);\n exception.printStackTrace();\n } finally {\n urlConnection.disconnect();\n }\n Log.d(MainActivity.APP_TAG, caller + \" : Quake Count=\" + ((quakeList != null) ? quakeList.size() : null));\n return quakeList;\n }",
"List<PCDevice> getAllPC();",
"public static void logMeters(final Collection<? extends Meter> meters) {\n if (!log.isDebugEnabled()) {\n return;\n }\n // The original collection is usually unmodifiable\n final List<Meter> sortedMeters = new ArrayList<>(meters);\n Collections.sort(sortedMeters, METER_COMPARATOR);\n\n log.debug(\"Found meters:\");\n for (final Meter meter : sortedMeters) {\n final Id id = meter.getId();\n final String type = id.getType().name();\n final String name = id.getName();\n final Map<String, String> tagMap = new LinkedHashMap<>(); // Tags are already sorted\n for (final Tag tag : id.getTags()) {\n tagMap.put(tag.getKey(), tag.getValue());\n }\n log.debug(\"- {} {} {}\", type, name, tagMap);\n }\n }",
"SelectBluetoothDeviceParameters getSelectBluetoothDeviceParameters();",
"void getMotionInfo(){\n double degreeDistance = Math.sqrt(Math.pow((startLat - endLat),2) + Math.pow((startLong - endLong),2));\n double R = 6378.137; // Radius of earth in KM\n double dLat = startLat * Math.PI / 180 - endLat* Math.PI / 180;\n dLat = Math.abs(dLat);\n double dLon = startLong * Math.PI / 180 - endLong* Math.PI / 180;\n dLon = Math.abs(dLon);\n double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(endLat * Math.PI / 180) * Math.cos(startLat* Math.PI / 180) *\n Math.sin(dLon / 2) * Math.sin(dLon / 2);\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n double distance;\n distance = R * c;\n distance = distance * 1000f;\n pathDistance = distance;\n degToMRatio = degreeDistance/distance;\n double angle = Math.atan(dLat/dLon);\n xCompMotion = Math.cos(angle);\n yCompMotion = Math.sin(angle);\n totalNumSteps = pathDistance/STEP_LENGTH;\n //Rounds number of steps to nearest whole number\n totalNumSteps = Math.round(totalNumSteps);\n }",
"private void fetchStopPoints() {\n\t\tif (mode == Mode.ADD_MODE && routeComboBox.getValue() != null) {\n\t\t\tstopPoints = SQLExecutor.fetchStopPointsByRoute(routeComboBox.getValue());\n\t\t} else if (mode == Mode.UPDATE_MODE && tripComboBox.getValue() != null){\n\t\t\tstopPoints = SQLExecutor.fetchStopPointsByTrip(tripComboBox.getValue());\n\t\t}\n\t}",
"public static ArrayList<XYLocation> findPath2(String CHAR1, String CHAR2,CampusRouteFindingModel campusModel) {\n\t\t ArrayList<XYLocation> retrn = new ArrayList<XYLocation>();\n\t\t graph<String, Float> g = campusModel.getGraph();\n\t\t Map<String, String> idFirst = campusModel.getName();\n\t\t Map<String,String> nameFirst = campusModel.getID();\n\t\t Map<String, XYLocation> locations = campusModel.getLocations();\n\t\t if(!(nameFirst.containsKey(CHAR1))&&(!(idFirst.containsKey(CHAR1)))) { \n\t\t\t if(!(nameFirst.containsKey(CHAR2))&&(!(idFirst.containsKey(CHAR2)))) {\n\t\t\t\t if (CHAR1.equals(CHAR2)) {\n\t\t\t\t\t retrn.add(locations.get(CHAR1));\n\t\t\t\t\t return retrn;\n\t\t\t\t }\n\t\t\t\t retrn.add(locations.get(CHAR1));\n\t\t\t\t retrn.add(locations.get(CHAR2));\n\t\t\t\t return retrn;\n\t\t\t }\n\t\t\t retrn.add(locations.get(CHAR1));\n\t\t\t return retrn;\n\t\t\t}\n\t\t\tif(!(nameFirst.containsKey(CHAR2))&&(!(idFirst.containsKey(CHAR2)))) {\n\t\t\t\tretrn.add(locations.get(CHAR2));\n\t\t\t\treturn retrn;\n\t\t\t}\n\t\tif (nameFirst.containsKey(CHAR1)) {\n\t\t\tCHAR1 = nameFirst.get(CHAR1);\n\t\t}\n\t\tif (nameFirst.containsKey(CHAR2)) {\n\t\t\tCHAR2 = nameFirst.get(CHAR2);\n\t\t}\n\t\tretrn.add(locations.get(CHAR1));\n\t\tif (!(CHAR1.equals(CHAR2))) {\n\t\t\tArrayList<edges<String, Double>> tmp = Dijkstra(CHAR1,CHAR2,g);\n\t\t\tif (tmp==null) {\n\t\t\t\tretrn.add(locations.get(CHAR1));\n\t\t\t\tretrn.add(locations.get(CHAR1));\n\t\t\t\treturn retrn;\n\t\t\t}\n\t\t\tIterator<edges<String, Double>> print = tmp.iterator();\n\t\t\tprint.next();\n\t\t\twhile (print.hasNext()) {\n\t\t\t\tedges<String, Double> temp = print.next();\n\t\t\t\tretrn.add(locations.get(temp.getDest()));\n\t\t\t}\n\t\t}\n\t\treturn retrn;\n\t}",
"private void getDeviceSpinner() {\n\n StringRequest stringRequest = new StringRequest(\"https://cardtest10.000webhostapp.com/Sync_Spinner_D.php\", new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n\n try{\n\n JSONObject jsonResponse = new JSONObject(response);\n JSONArray jsonArraytask = jsonResponse.getJSONArray(\"device\");\n\n for(int i=0; i < jsonArraytask.length(); i++)\n {\n JSONObject jsonObjecttask = jsonArraytask.getJSONObject(i);\n String task = jsonObjecttask.optString(\"Device_Type\");\n arrayDeviceType.add(task);\n }\n\n }catch (JSONException e){\n e.printStackTrace();\n }\n\n // Applying the adapter to our spinner\n spDeviceModel.setAdapter(new ArrayAdapter <>(UserAreaActivity.this, android.R.layout.simple_spinner_dropdown_item, arrayDeviceType));\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Toast.makeText(UserAreaActivity.this, error + \"\", Toast.LENGTH_SHORT).show();\n }\n });\n\n RequestQueue requestQueue = Volley.newRequestQueue(this);\n requestQueue.add(stringRequest);\n\n }",
"private void choice_fuel(Field response) {\n ListRecords lrN = new ListRecords();\n Record recN;\n// for (Record rec : lr) {\n Record rec = (Record) response.value;\n recN = new Record();\n recN.add(new Field(\"type\", Field.TYPE_INTEGER, 1));\n recN.add(new Field(\"name\", Field.TYPE_STRING, rec.getString(\"name\")));\n lrN.add(recN);\n long idL = (Long)rec.getValue(\"id\");\n Integer id = (int)idL;\n\n recN.add(new Field(\"idNetwork\", Field.TYPE_LONG, idL));\n ListRecords listR = (ListRecords) rec.getValue(\"fuels\");\n if (listR != null) {\n for (Record recFuel : listR) {\n recN = new Record();\n recN.add(new Field(\"type\", Field.TYPE_INTEGER, 0));\n recN.add(new Field(\"idNetwork\", Field.TYPE_INTEGER, id));\n recN.add(new Field(\"price\", Field.TYPE_DOUBLE, recFuel.getDouble(\"price\")));\n recN.add(new Field(\"fuel_icon\", Field.TYPE_STRING, recFuel.getString(\"icon\")));\n lrN.add(recN);\n }\n }\n// }\n response.value = lrN;\n }",
"public Result call()\n {\n // create peptide\n Peptide peptide = Rotamer.reconstitute(startingPeptide, rotamersToReconstitute);\n\n // analyze interactions\n List<Interaction> interactions = OPLScalculator.getInteractions(peptide);\n\n // initialize maps that will contain the answers\n Map<Rotamer,Double> rotamerMap = new LinkedHashMap<>();\n\n // analyze all interactions in this peptide\n Double[][] energyMatrix = Interaction.getRotamerEnergyMatrix(peptide, interactions, true);\n\n // get rotamer energies\n for (Rotamer rotamer : rotamers)\n {\n Double singleEnergy = Interaction.getRotamerEnergy(rotamer, energyMatrix); \n //if ( rotamerMap.containsKey(rotamer) && Math.abs(rotamerMap.get(rotamer) - singleEnergy) > 0.01 )\n // System.out.println(\"mismatch\");\n rotamerMap.put(rotamer,singleEnergy);\n }\n\n // get backbone energy\n double thisBackboneEnergy = Interaction.getBackboneEnergy(energyMatrix); \n\n // concurrently update results\n map.putAll(rotamerMap);\n backboneEnergy.compareAndSet(0.0, thisBackboneEnergy);\n\n // return result\n //return new RotamerEnergyResult(rotamerMap, rotamerPairMap, thisBackboneEnergy); \n return null;\n }"
] | [
"0.5772522",
"0.53011703",
"0.51661444",
"0.51394516",
"0.5134196",
"0.51296514",
"0.5085443",
"0.50267863",
"0.5003873",
"0.4991577",
"0.49823475",
"0.49642554",
"0.4936203",
"0.49242854",
"0.4923782",
"0.4891943",
"0.4869166",
"0.48516998",
"0.48486373",
"0.4813557",
"0.48020872",
"0.47833386",
"0.47812977",
"0.477909",
"0.47686282",
"0.47596776",
"0.47420892",
"0.4740122",
"0.4729113",
"0.47285086",
"0.47175297",
"0.47056893",
"0.4695752",
"0.4674591",
"0.46731806",
"0.4671067",
"0.4657891",
"0.46564457",
"0.46541986",
"0.46455294",
"0.46420377",
"0.46360937",
"0.4635696",
"0.46316",
"0.4630132",
"0.46280363",
"0.46097144",
"0.4598869",
"0.45865947",
"0.45861226",
"0.4579417",
"0.45762777",
"0.45680568",
"0.4561877",
"0.45603055",
"0.4549812",
"0.45493275",
"0.45483986",
"0.4547119",
"0.45461914",
"0.45251203",
"0.45091242",
"0.45041555",
"0.45036626",
"0.45030028",
"0.45001376",
"0.44986954",
"0.44974682",
"0.4497035",
"0.44953224",
"0.44887984",
"0.4488342",
"0.44875973",
"0.44818175",
"0.44785145",
"0.4476971",
"0.44683233",
"0.44658",
"0.4463778",
"0.4461876",
"0.445986",
"0.4454807",
"0.4454725",
"0.44486716",
"0.4446203",
"0.4446108",
"0.44430766",
"0.44374564",
"0.4436263",
"0.44350046",
"0.4430872",
"0.44305182",
"0.44284976",
"0.44251344",
"0.44199094",
"0.44178364",
"0.44167158",
"0.44129276",
"0.4412396",
"0.44031632",
"0.44025242"
] | 0.0 | -1 |
Initiated the generation of rate depending on the existing rating policy Pseudo Code 1. Check for the rating policy 2. Invoke the method to initiate the rate generation | private boolean generateRate() {
TSDBData rateObj;
boolean result = false;
if (Flag.getMeteringType().equalsIgnoreCase("static")) {
rateObj = generateStaticRate();
} else {
rateObj = generateDynamicRate();
}
if (rateObj.getPoints().size() > 0)
result = saveRate(rateObj);
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setRate(int rate) { this.rate = rate; }",
"private TSDBData generateDynamicRate() {\n //TODO: replace with single method generateRate and parameter (static, dynamic)\n double rate;\n Random rateGenerator = new Random();\n TSDBData rateData = new TSDBData();\n ArrayList<String> strArr = null;\n ArrayList<Object> objArrNode;\n ArrayList<ArrayList<Object>> objArr = new ArrayList<ArrayList<Object>>();\n\n // Iterate through the list and generate the rate for each enabled meters\n for (int k = 0; k < enabledResourceList.size(); k++) {\n //rate = getDynamicRate(enabledResourceList.get(k).toString());\n rate = rateGenerator.nextInt((3 - 1) + 1) + 1;\n strArr = StringUtil.strArr(\"resource\", \"rate\", \"rate_policy\");\n //strArr.add(\"resource\");\n //strArr.add(\"rate\");\n //strArr.add(\"rate_policy\");\n objArrNode = new ArrayList<Object>();\n objArrNode.add(enabledResourceList.get(k));\n objArrNode.add(rate);\n objArrNode.add(Flag.getMeteringType());\n objArr.add(objArrNode);\n }\n\n rateData.setName(\"rate\");\n rateData.setColumns(strArr);\n rateData.setPoints(objArr);\n return rateData;\n }",
"public abstract void setRate();",
"private TSDBData generateStaticRate() {\n //TODO: check if there is generic method to to return rateData\n ArrayList<String> strArr = StringUtil.strArr(\"resource\", \"rate\", \"rate_policy\");\n TSDBData rateData = createPOJOObject(\"rate\", strArr, load.getStaticRate());\n return rateData;\n }",
"public DepreciatingPolicy(float amount, float rate){\r\n super(amount);\r\n this.rate = rate*100;\r\n }",
"public void handleRating() {\r\n Users rater = ui.getUser();\r\n newRating = ratingEJB.findByUserAndRecipe(rater, recipe);\r\n boolean edit = false; // determine whether we need to edit\r\n\r\n // No rating for this user exists\r\n if (newRating == null && rating > 0 && rating <= 5) {\r\n newRating = new RecipeRating();\r\n newRating.setRater(rater);\r\n newRating.setRecipe(recipe);\r\n newRating.setRatingDate(new Date().getTime());\r\n } // A rating exists\r\n else {\r\n edit = true;\r\n }\r\n\r\n switch (rating) {\r\n case 1:\r\n this.newRating.setRatingValue(RatingValue.ONE_STAR);\r\n break;\r\n case 2:\r\n this.newRating.setRatingValue(RatingValue.TWO_STARS);\r\n break;\r\n case 3:\r\n this.newRating.setRatingValue(RatingValue.THREE_STARS);\r\n break;\r\n case 4:\r\n this.newRating.setRatingValue(RatingValue.FOUR_STARS);\r\n break;\r\n case 5:\r\n this.newRating.setRatingValue(RatingValue.FIVE_STARS);\r\n break;\r\n }// end switch\r\n\r\n if (edit) {\r\n this.newRating = ratingEJB.editRecipeRating(newRating);\r\n } else {\r\n this.newRating = ratingEJB.createRecipeRating(newRating);\r\n }\r\n }",
"public void setRate();",
"public PolicyBinderPage rateFunctionality(String policyNo) {\r\n\r\n RateApolicyPage rateapolicypage = new RateApolicyPage(driver);\r\n rateapolicypage.rateFunctionality(policyNo);\r\n return new PolicyBinderPage(driver);\r\n }",
"public abstract double calcAvRating();",
"public void setRate(Integer rate) {\r\n this.rate = rate;\r\n }",
"public void specialize(){\n\tdefense *= .6;\n\tattRating *= 1.4;\n\tif ( attRating > 2.0){\n\t attRating = 2.0;\n\t}\n }",
"public void setRating(Rating rating) {\n double boundedRating = this.boundedRating(rating);\n this.normalisedRating = this.normaliseRating(boundedRating);\n this.ratingCount++;\n }",
"double getRate();",
"Rate initRate(Rate iRate)\n {\n iRate.updateElementValue(\"Rate\");\n return iRate;\n }",
"private void calculateRating() {\n\t\tVisitor[] visitors = getVisitors();\n\t\tint max = 0;\n\t\tint act = 0;\n\t\tfor (Visitor visitor : visitors) {\n\t\t\tif(validRating(visitor)) {\n\t\t\t\tmax += 5;\n\t\t\t\tact += visitor.getRating();\n\t\t\t}\n\t\t}\n\t\tif(max != 0) {\n\t\t\trating = (1f*act)/(1f*max);\n\t\t}\n\t}",
"Policy _get_policy(int policy_type);",
"public Rate rate() {\n _initialize();\n return rate;\n }",
"double getRating();",
"private void evaluateProbabilities()\n\t{\n\t}",
"public void setRating(int rating) {\r\n this.rating = rating;\r\n }",
"public void setRating(double rating){\n\t\tthis.rating = rating;\n\t}",
"protected InterestRate() {\n\t}",
"public void setRating(int rating)\n {\n this.rating = rating;\n }",
"@Then(\"rate gets updated with new rating\")\n\tpublic void rate_gets_updated_with_new_rating() {\n\t throw new io.cucumber.java.PendingException();\n\t}",
"public void setRating(int rating);",
"@Override\n\tpublic void makeDecision() {\n\t\tint powerMax = (int)(initPower) / 100;\n\t\tint powerMin = (int)(initPower * 0.3) / 100;\n\n\t\t// The value is calculated randomly from 0 to 10% of the initial power\n\t\tRandom rand = new Random();\n\t\tint actualPower = rand.nextInt((powerMax - powerMin) + 1) + powerMin;\n\t\tanswer.setConsumption(actualPower);\n\t}",
"public void setRating(int rating) {\n this.rating = rating;\n }",
"abstract double calculateCurrentDiscountRate();",
"public abstract double getDiscountRate();",
"public static void rate(Long propID, String userID, Integer newRatingValue)\r\n\t\t\tthrows ServiceException {\r\n\t\tRating rating = ofy.find(Rating.class, buildID(userID, propID));\r\n\r\n\t\t/*\r\n\t\t * if there was no previous rating and the new value indicates a rating\r\n\t\t * deletion, or if the previous rating and the new rating are the same,\r\n\t\t * then there is nothing to do. So, notify the client that it sent a\r\n\t\t * pointless update.\r\n\t\t */\r\n\t\tif ((rating == null && newRatingValue == null)\r\n\t\t\t\t|| ((rating != null && newRatingValue != null) && rating.eval == newRatingValue\r\n\t\t\t\t\t\t.intValue())) {\r\n\t\t\tthrow new ServiceException(\"cannot update rating: old rating (\"\r\n\t\t\t\t\t+ rating.eval + \") is the same as new rating (\"\r\n\t\t\t\t\t+ newRatingValue + \")\");\r\n\t\t}\r\n\r\n\t\tLock lock = Lock.getNodeLock(propID);\r\n\t\ttry {\r\n\t\t\tlock.lock();\r\n\r\n\t\t\tProposition prop = ofy.get(Proposition.class, propID);\r\n\r\n\t\t\t/* if the user has previously rated back out previous rating */\r\n\t\t\tif (rating != null) {\r\n\t\t\t\tprop.ratingSum -= rating.eval;\r\n\t\t\t\tprop.ratingCount--;\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * otherwise create a new rating object to hold new rating (note\r\n\t\t\t * that in the case where rating == null we always need a new rating\r\n\t\t\t * object here because we have ruled out the case where both rating\r\n\t\t\t * == null and newRatingValue == null by throwing the exception\r\n\t\t\t * above)\r\n\t\t\t */\r\n\t\t\telse {\r\n\t\t\t\trating = new Rating();\r\n\t\t\t\trating.setID(userID, propID);\r\n\t\t\t}\r\n\r\n\t\t\tif (newRatingValue != null) {\r\n\t\t\t\t/* update the proposition with the new evaluation */\r\n\t\t\t\tprop.ratingSum += newRatingValue;\r\n\t\t\t\tprop.ratingCount++;\r\n\r\n\t\t\t\t/* save the new evaluation */\r\n\t\t\t\trating.eval = newRatingValue;\r\n\t\t\t\tofy.put(rating);\r\n\t\t\t} else {\r\n\t\t\t\t/*\r\n\t\t\t\t * if newRatingValue == null we need to delete the rating object\r\n\t\t\t\t * (note this will only happen when there was already a rating\r\n\t\t\t\t * object in the database because we ruled out the possibility\r\n\t\t\t\t * of (rating == null && newRating == null) by throwing\r\n\t\t\t\t * exception above)\r\n\t\t\t\t */\r\n\t\t\t\tofy.delete(rating);\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * notice that I do not call the ArgMapServiceImpl.updateNode()\r\n\t\t\t * function here because I do not want to have the updated time\r\n\t\t\t * change. The updated time is used by the live refresh system to\r\n\t\t\t * determine when a client refresh is needed, and I don't want to\r\n\t\t\t * trigger a client refresh because, at the moment I'm not even\r\n\t\t\t * sending the ratingSum to the client (and don't plan to) (it's\r\n\t\t\t * marked 'transient', so it doesn't get sent.)\r\n\t\t\t */\r\n\t\t\tofy.put(prop);\r\n\r\n\t\t\t/*\r\n\t\t\t * TODO need to queue a task to recalculate the scores for all the\r\n\t\t\t * nodes that depend on this node's score or average rating.\r\n\t\t\t */\r\n\t\t} finally {\r\n\t\t\tlock.unlock();\r\n\t\t}\r\n\t}",
"protected abstract boolean canGenerateScore();",
"public void setRating(double rating) {\n\t\tthis.rating = rating;\n\t}",
"public void fixTeacherRating()\n {\n // put your code here\n if(profQuality < 5)\n profQuality++;\n }",
"public interface IRating {\n\t\n\t/**\n\t * Enums for various types of likes\n\t * @author terratenff\n\t *\n\t */\n\tpublic static enum LikeType {\n\t\tFUNNY(0), INFORMATIVE(1), DETAILED(2), IRONIC(3), INSPIRATIONAL(4),\n\t\tEASY(5), CHALLENGING(6), ABSURD(7), POETIC(8), SIMPLE(9),\n\t\tNONE(-1);\n\t\t\n\t\t/**\n\t\t * Container for various types of likes.\n\t\t */\n\t\tprivate static LikeType[] values = null;\n\t\t\n\t\t/**\n\t\t * Identifying value for a like type.\n\t\t */\n\t\tprivate int id;\n\t\t\n\t\t/**\n\t\t * LikeType constructor.\n\t\t * @param id Assigned ID.\n\t\t */\n\t\tLikeType(int id) {\n\t\t\tthis.id = id;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Getter for the like type's ID.\n\t\t * @return ID value that corresponds the like type.\n\t\t */\n\t\tpublic int getId() {\n\t\t\treturn this.id;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Getter for a like type based on provided ID.\n\t\t * @param id ID of desired like type.\n\t\t * @return Like type corresponding to provided ID, or like type\n\t\t * NONE if a match could not be found.\n\t\t */\n\t\tpublic static LikeType getLikeType(int id) {\n\t\t\tif (values == null) values = LikeType.values();\n\t\t\t\n\t\t\tfor (LikeType like : values) {\n\t\t\t\tif (id == like.getId()) return like;\n\t\t\t}\n\t\t\t\n\t\t\treturn LikeType.NONE;\n\t\t}\n\t};\n\n\t/**\n\t * Getter for rating ID.\n\t * @return ID.\n\t */\n\tpublic int getId();\n\t\n\t/**\n\t * Gives the rating instance an ID number. This function is meant to be called only once,\n\t * immediately after being added to the database.\n\t * @param id Assigned ID.\n\t */\n\tpublic void assignId(int id);\n\t\n\t/**\n\t * Getter for the ID of the user who created the story that the rating\n\t * is aimed at.\n\t * @return ID of the creator of the story.\n\t */\n\tpublic int getMakerId();\n\t\n\t/**\n\t * Getter for the ID of the user who created the rating.\n\t * @return ID of the rater.\n\t */\n\tpublic int getRaterId();\n\t\n\t/**\n\t * Getter for the ID of the story that the rating is focused on.\n\t * @return ID of the story.\n\t */\n\tpublic int getStoryId();\n\t\n\t/**\n\t * Getter for the time at which the rating was created.\n\t * @return Time of creation, as a LocalDate instance.\n\t */\n\tpublic LocalDate getViewDate();\n\t\n\t/**\n\t * Getter for the numerical rating given by the rater.\n\t * @return Numerical representation of the rating.\n\t */\n\tpublic int getGrade();\n\t\n\t/**\n\t * Getter for whether the user personally liked the story.\n\t * @return true, if the user liked it. false otherwise.\n\t */\n\tpublic boolean isLiked();\n\t\n\t/**\n\t * Getter for the like type assigned by the rater.\n\t * @return LikeType-enum given by the rater. NONE is returned if\n\t * the rater did not specifically like it.\n\t */\n\tpublic LikeType getLikeType();\n\t\n\t/**\n\t * Getter for the flag possibly raised by the rater. The flag indicates\n\t * that the rater thinks that the story violates story rules/guidelines.\n\t * @return true, if the rater has flagged it. false otherwise.\n\t */\n\tpublic boolean isFlagged();\n\t\n\t/**\n\t * Getter for a comment left behind by the rater.\n\t * @return Comment string. An empty string is returned if no comment was made.\n\t */\n\tpublic String getComment();\n}",
"public void setRating(int rating) {\n this.rating = rating;\n if (this.rating < 0) {\n this.rating = 0;\n }\n }",
"public int getSessionCreateRate();",
"private void processStartBeforeCase(RatedPeriod rate, RateWrapper rateWrapper) {\n\n }",
"protected abstract Double getRate(T object);",
"void sendRequestCode(String rating, float rate, String review, String imageRating);",
"public void setRating(int rating) {\n\t\tthis.rating = rating;\n\t}",
"private void processStartInsideCase(RatedPeriod rate, RateWrapper rateWrapper) {\n\n }",
"public void rateMovie()\n {\n movieRate = UI.askString(\"Movie Title: \");\n movieRate = movieRate.toLowerCase();\n // Loop to check if the entered movie exists\n while (again) \n {\n // Checks if the movie exists\n if (r.movieExists(movieRate) == false)\n {\n UI.println(\"That movie does not exist\");\n movieRate = UI.askString(\"Movie Title: \");\n } \n else \n {\n again = false;\n }\n }\n again = true;\n // Loop to check if the rating is 0-10\n while (again) \n {\n double rating = UI.askDouble(\"Rating: \");\n try\n {\n if (rating < 0 || rating > 10) \n {\n throw new ArithmeticException();\n } \n else \n {\n r.rateMovie(movieRate, rating);\n again = false;\n }\n }\n \n catch (ArithmeticException ae) \n {\n UI.println(\"Please enter a number 0-10\");\n }\n \n catch (Exception e) \n {\n UI.println(\"Please enter a number 0-10\");\n }\n }\n again = true;\n }",
"public void setRating(Integer rating) {\r\n this.rating = rating;\r\n }",
"public int presetTriageNumber() {\r\n\t\tint triageRating = 0;\r\n\t\tint triageGenerator = random.nextInt(4);\r\n\t\tswitch (triageGenerator) {\r\n\t\tcase 0:\r\n\t\t\ttriageRating = 1;\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t\ttriageRating = 2;\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\ttriageRating = 3;\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\ttriageRating = 4;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn triageRating;\r\n\t}",
"public interface IRate {\n\t\n\t//writing the class outline\n\tpublic void setRate();\n\tpublic void increaseRate();\n}",
"public void setHotOrNotRating(int rating) {\r\n this.rating += rating;\r\n ratingCount++;\r\n }",
"@Override\n\tpublic double calculateRate(int distance, double weight) {\n\t\tdouble rate = 0;\n\t\tif (weight >= 0 && weight <= 2) {\n\t\t\trate = 0.0020;\n\t\t\trate = rate * distance;\n\n\t\t} else if (weight >= 3 && weight <= 8) {\n\t\t\trate = 0.0022;\n\t\t\trate = rate * distance;\n\t\t} else if (weight >= 9 && weight <= 15) {\n\t\t\trate = 0.0024;\n\t\t\treturn rate * distance;\n\t\t}\n\t\tif (weight >= 1*16 && weight <= 3*16) {\n\t\t\trate = 0.0150 * distance;\n\t\t} else if (weight >= 4*16 && weight <= 8*16) {\n\t\t\trate = 0.0160 * distance;\n\t\t} else if (weight >= 9 * 16) {\n\t\t\trate = 0.0170 * distance;\n\t\t}\n\n\t\treturn rate;\n\t}",
"public abstract void setDiscountRate(double discountRate);",
"private void calculateRates() {\n if (rateOutput == null || !outputs.containsKey(rateOutput)) throw new RuntimeException(\"Insufficient data to calculate recipe rates\");\n recipesPerMinute = productionRate / outputs.get(rateOutput);\n\n for (String resource : inputs.keySet()) {\n ratesPerMinute.put(resource,-1.0 * recipesPerMinute * inputs.get(resource));\n }\n for (String resource: outputs.keySet()) {\n ratesPerMinute.put(resource, recipesPerMinute * outputs.get(resource));\n }\n }",
"public void setRate(double newRate) {\n this.rate = newRate;\n }",
"@Override\r\n\tpublic void updateDriverRate(int score, String driverID) {\n\t\t\r\n\t}",
"protected void updateGeneratedExpressions() throws cbit.vcell.parser.ExpressionException, PropertyVetoException {\r\n\t\tKineticsParameter rateParm = getKineticsParameterFromRole(ROLE_ReactionRate);\r\n\t\tKineticsParameter currentParm = getKineticsParameterFromRole(ROLE_CurrentDensity);\r\n\t\tKineticsParameter bindingRadiusParam = getKineticsParameterFromRole(ROLE_Binding_Radius);\r\n\t\tKineticsParameter kOnParam = getKineticsParameterFromRole(ROLE_KOn);\r\n\t\tKineticsParameter diff_react1Param = getKineticsParameterFromRole(ROLE_Diffusion_Reactant1);\r\n\t\tKineticsParameter diff_react2Param = getKineticsParameterFromRole(ROLE_Diffusion_Reactant2);\r\n\t\tKineticsParameter conc_react1Param = getKineticsParameterFromRole(ROLE_Concentration_Reactant1);\r\n\t\tKineticsParameter conc_react2Param = getKineticsParameterFromRole(ROLE_Concentration_Reactant2);\r\n\t\t\r\n\t\tif (currentParm==null && rateParm==null){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// rate prameter expr.\r\n\t\tReactionParticipant rp_Array[] = getReactionStep().getReactionParticipants();\r\n\t\tExpression kOn_exp = getSymbolExpression(kOnParam);\r\n\t\tExpression newRateExp = null;\r\n\t\tint reactantCount = 0;\r\n\t\tfor (int i = 0; i < rp_Array.length; i++) {\r\n\t\t\tExpression term = null;\r\n\t\t\tExpression speciesContext = getSymbolExpression(rp_Array[i].getSpeciesContext());\r\n\t\t\tint stoichiometry = rp_Array[i].getStoichiometry();\r\n\t\t\tif (rp_Array[i] instanceof Reactant){\r\n\t\t\t\treactantCount++;\r\n\t\t\t\tif (stoichiometry < 1){\r\n\t\t\t\t\tthrow new ExpressionException(\"reactant must have stoichiometry of at least 1\");\r\n\t\t\t\t}else if (stoichiometry == 1){\r\n\t\t\t\t\tterm = speciesContext;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tterm = Expression.power(speciesContext,new Expression(stoichiometry));\r\n\t\t\t\t}\t\r\n\t\t\t\tkOn_exp = Expression.mult(kOn_exp,term);\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (reactantCount > 0){\r\n\t\t\tnewRateExp = kOn_exp;\r\n\t\t}else{\r\n\t\t\tnewRateExp = new Expression(0.0);\r\n\t\t}\r\n\t\trateParm.setExpression(newRateExp);\r\n\t\t\r\n\t\t// current Parameter. set to 0??\r\n\t\tcurrentParm.setExpression(new Expression(0.0));\r\n\t\t\r\n\t\t// binding radius, computed by Kon = 2*PI*D/Ln(b/R), b = 1/sqrt(Pa*PI)\r\n\t\tReservedSymbol pi_ReservedSymbol = getReactionStep().getModel().getPI_CONSTANT();\r\n\t\tExpression Pa = Expression.max(getSymbolExpression(conc_react1Param), getSymbolExpression(conc_react2Param));\r\n\t\tExpression sqrt_Pa_PI = Expression.sqrt(Expression.mult(Pa, getSymbolExpression(pi_ReservedSymbol))); //sqrt(Pa*PI)\r\n\t\tExpression b = Expression.div(new Expression(1), sqrt_Pa_PI); // 1/sqrt(Pa*PI)\r\n\t\tExpression sumD = Expression.add(getSymbolExpression(diff_react1Param), getSymbolExpression(diff_react2Param));\r\n\t\tExpression exp2_PI_D = Expression.mult(new Expression(2.0), getSymbolExpression(pi_ReservedSymbol), sumD); //2*PI*D\r\n\t\tExpression exponentNumExp = Expression.div(exp2_PI_D, getSymbolExpression(kOnParam)); // 2*PI*D/kon\r\n\t\tExpression exponentExp = Expression.exp(Expression.negate(exponentNumExp)); // exp(-2*PI*D/Kon)\r\n\t\tExpression radius = Expression.mult(b,exponentExp); // b*exp(-2*PI*D/Kon)\r\n\t\t\r\n\t\tif (bindingRadiusParam != null && radius != null) {\r\n\t\t\tbindingRadiusParam.setExpression(radius);\r\n\t\t} \r\n\t\t\t\r\n\t\t// SECONDARY CURRENT DENSITY\r\n\t\t// update from reaction rate\r\n\t\tupdateInwardCurrentDensityFromReactionRate();\r\n\t}",
"@Override\n public void createPolicyFromQuote(Policy policy, Quote quote) {\n checkCommonData(quote.getCommonData());\n ProductUtils.validateMainInsured(quote);\n\n // There is only one insured at this point\n Insured insured = quote.getInsureds().get(0);\n\n // check main insured stuff\n ProductUtils.checkInsuredAgeInRange(insured, MIN_AGE, MAX_AGE);\n ProductUtils.checkMainInsured(insured);\n checkMainInsured10ECSpecific(insured);\n\n // Recalculate the quote\n //TODO this method do nothing!!!\n calculateQuote(quote, null);\n\n // check for calculated data\n ProductUtils.validateNumberOfCoverages(quote.getCoverages());\n\n // There is only one coverage at this point\n Coverage coverage = quote.getCoverages().get(0);\n\n ProductUtils.checkBeneficiaries(insured, coverage.getBeneficiaries());\n check10ECPremiumsData(quote.getPremiumsData(), insured.getStartDate());\n\n // Copy from quote to Policy\n policy.setQuoteId(quote.getQuoteId());\n policy.setCommonData(SerializationUtils.clone(quote.getCommonData()));\n policy.setPremiumsData(SerializationUtils.clone(quote.getPremiumsData()));\n policy.addCoverage(SerializationUtils.clone(coverage));\n policy.addInsured(SerializationUtils.clone(insured));\n\n // Add payment schedule\n addPayments(policy, DURATION_PAYMENT_IN_YEAR);\n }",
"void compute() {\n\n if (random.nextBoolean()) {\n value = value + random.nextInt(variation);\n ask = value + random.nextInt(variation / 2);\n bid = value + random.nextInt(variation / 2);\n } else {\n value = value - random.nextInt(variation);\n ask = value - random.nextInt(variation / 2);\n bid = value - random.nextInt(variation / 2);\n }\n\n if (value <= 0) {\n value = 1.0;\n }\n if (ask <= 0) {\n ask = 1.0;\n }\n if (bid <= 0) {\n bid = 1.0;\n }\n\n if (random.nextBoolean()) {\n // Adjust share\n int shareVariation = random.nextInt(100);\n if (shareVariation > 0 && share + shareVariation < stocks) {\n share += shareVariation;\n } else if (shareVariation < 0 && share + shareVariation > 0) {\n share += shareVariation;\n }\n }\n }",
"void addRatingCallback(RatingCallback callback);",
"public void updateRate(double r){\r\n rate *= r;\r\n }",
"public void setRating(Integer value)\n\t{\n\t}",
"public void setMyRating(double myRating) {\n this.myRating = myRating;\n }",
"private void determinationImpostRate(Vehicle vehicle) {\n serviceForDeterminationImpostRate.determinationImpostRateByOwner(vehicle);\n }",
"private void Rating(int minAge)\r\n {\r\n this.minAge = minAge;\r\n }",
"public int getRating();",
"PolicyDecision getDecision();",
"public int getRate() {\n return rate_;\n }",
"public void submitRating() {\n if (validate() == true) {\n //delete every previous rating for this user\n ctrl.deleteRating(currentUser.getUsername());\n //add individual ratings for this submit\n for (PostDTO p : postList) {\n if (p.getTmpRating() != null) {\n ctrl.addRating(p, new RatingDTO(p.getTmpRating(), currentUser, p), currentUser);\n }\n }\n }\n // fetching the data state from db resets all the previous tmpRatings to 0\n refreshState();\n }",
"public static double getRandomRating() {\n return (double) (RandomNumberGenerator.getRandomInt(0, 10) / 2d);\n }",
"public Map<Integer, AnswerRecord> prepareRating(int worker, int experiment, int amount) {\n Map<Integer, AnswerRecord> answers = create.transactionResult(config -> {\n Map<Integer, AnswerRecord> reservedRatings = DSL.using(config).select(ANSWER.fields())\n .select(RATING_RESERVATION.ID_RESERVERD_RATING)\n .from(ANSWER)\n .innerJoin(RATING_RESERVATION).on(RATING_RESERVATION.WORKER.eq(worker)\n .and(RATING_RESERVATION.EXPERIMENT.eq(experiment))\n .and(RATING_RESERVATION.ANSWER.eq(ANSWER.ID_ANSWER))\n .and(RATING_RESERVATION.USED.eq(false))\n )\n .fetchMap(RATING_RESERVATION.ID_RESERVERD_RATING, record -> record.into(Tables.ANSWER));\n logger.trace(\"Worker {} has reserved open ratings {}.\", worker, reservedRatings);\n\n Timestamp now = Timestamp.valueOf(LocalDateTime.now());\n\n DSL.using(config).update(RATING_RESERVATION)\n .set(RATING_RESERVATION.TIMESTAMP, now)\n .where(RATING_RESERVATION.ID_RESERVERD_RATING.in(reservedRatings.keySet()))\n .execute();\n\n int reserveNew = Math.max(amount - reservedRatings.size(), 0);\n logger.trace(\"Reserving {} new Ratings for worker {}.\", reserveNew, worker);\n\n LocalDateTime limit = LocalDateTime.now().minus(2, ChronoUnit.HOURS);\n Timestamp timestamp = Timestamp.valueOf(limit);\n Field<Integer> count = DSL.count(RATING_RESERVATION.ID_RESERVERD_RATING).as(\"count\");\n Map<Integer, AnswerRecord> toRate = DSL.using(config).select()\n .select(ANSWER.fields())\n .select(count)\n .from(ANSWER)\n .leftJoin(RATING_RESERVATION).on(RATING_RESERVATION.ANSWER.eq(ANSWER.ID_ANSWER)\n .and(RATING_RESERVATION.USED.eq(true).or(RATING_RESERVATION.TIMESTAMP.greaterOrEqual(timestamp))))\n .where(ANSWER.EXPERIMENT.eq(experiment))\n .and(ANSWER.WORKER_ID.notEqual(worker))\n .and(ANSWER.ID_ANSWER.notIn(\n DSL.select(RATING_RESERVATION.ANSWER).from(RATING_RESERVATION).where(RATING_RESERVATION.WORKER.eq(worker).and(RATING_RESERVATION.EXPERIMENT.eq(experiment)))))\n .and(\n ANSWER.QUALITY_ASSURED.eq(true).and(ANSWER.QUALITY.greaterOrEqual(\n DSL.select(EXPERIMENT.RESULT_QUALITY_THRESHOLD)\n .from(EXPERIMENT)\n .where(EXPERIMENT.ID_EXPERIMENT.eq(experiment))\n )).or(ANSWER.QUALITY_ASSURED.eq(false))\n )\n .groupBy(ANSWER.fields())\n .having(count.lessThan(\n DSL.select(EXPERIMENT.RATINGS_PER_ANSWER).from(EXPERIMENT).where(EXPERIMENT.ID_EXPERIMENT.eq(experiment))))\n .orderBy(ANSWER.QUALITY_ASSURED.desc())\n .limit(reserveNew)\n .fetchMap(Tables.ANSWER.ID_ANSWER, record -> record.into(Tables.ANSWER));\n\n List<RatingReservationRecord> reservations = toRate.values().stream()\n .map(answer -> new RatingReservationRecord(null, worker, experiment, answer.getIdAnswer(), timestamp, false))\n .collect(Collectors.toList());\n\n DSL.using(config).batchInsert(reservations).execute();\n\n Map<Integer, AnswerRecord> reserved = reservedRatings.entrySet().stream()\n .collect(Collectors.toMap(entry -> entry.getValue().getIdAnswer(), Map.Entry::getValue));\n\n toRate.putAll(reserved);\n\n return toRate;\n });\n\n logger.trace(\"Worker {} can rate {}\", worker, answers.values());\n\n List<Integer> answerIds = answers.values().stream()\n .map(AnswerRecord::getIdAnswer)\n .collect(Collectors.toList());\n\n Result<RatingReservationRecord> ratings = create.selectFrom(RATING_RESERVATION)\n .where(RATING_RESERVATION.ANSWER.in(answerIds))\n .and(RATING_RESERVATION.WORKER.eq(worker))\n .fetch();\n\n return ratings.stream()\n .collect(Collectors.toMap(RatingReservationRecord::getIdReserverdRating, record -> answers.get(record.getAnswer())));\n }",
"public static void loadRatings() {\r\n\t\tString line = \"\";\r\n\t\tList<String> lineArray = null;\r\n\t\tboolean first = true;\r\n\t\tProbabilityOfDefault pd;\r\n\t\tInteger year;\r\n\t\tDouble value;\r\n\t\tString rating;\r\n\t\t\r\n\t\tCalendar gc = GregorianCalendar.getInstance();\r\n\r\n\t\tDate asOfDate = BusinessDate.getInstance().getDate();\r\n\t\t\r\n\t\tRatingStore ratStore = RatingStore.getInstance();\r\n\t\t\r\n\t\tString delimiter = \"\\t\";\r\n\t\tScanner scanner = null;\r\n\t\tif (null != ps.getPreference(PreferencesStore.PD_FILE_DELIMITER)) { delimiter = ps.getPreference(PreferencesStore.PD_FILE_DELIMITER); }\r\n\t\r\n\t\t\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tscanner = new Scanner(new File(ps.getPreference(PreferencesStore.DIRECTORY) + ps.getPreference(PreferencesStore.PD_FILE)));\r\n\t\t while (scanner.hasNext()) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t \tline = scanner.nextLine();\r\n\t\t\t\tif (first) {\r\n\t\t\t\t\tfirst = false;\r\n\t\t\t\t\tline = scanner.nextLine();\r\n\t\t\t\t}\r\n\t\t\t\tlineArray = FileUtils.parseLine(line, delimiter);\r\n\t\t\t\t\r\n\t\t\t\tyear = InputHandlers.intMe(lineArray.get(1).replaceAll(\"y\", \"\"));\r\n\t\t\t\tvalue = InputHandlers.doubleMe(lineArray.get(2));\r\n\t\t\t\trating = lineArray.get(3);\r\n\t\t\t\t\r\n\t\t\t\tgc.setTime(asOfDate);\r\n\t\t\t\tgc.add(Calendar.YEAR, year);\r\n\t\t\t\t\t\r\n\t\t\t\tpd = new ProbabilityOfDefault(rating, gc.getTime(), value);\r\n\t\t\t\tratStore.getRating(rating).addPD(pd);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception fe) {\r\n\t\t\tfe.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tif (null != scanner) { scanner.close(); }\r\n\t\t}\r\n\t\t\r\n\t\tl.info(\"Loaded \" + ratStore.getSize() + \" ratings\");\r\n\t\t\r\n\t}",
"public void makeApprovedIfNull() {\n int x = getHifiveRating();\n if (x == 0) {\n setHifiveRating(HIFIVERATING_approved);\n }\n }",
"public void makeFirstRound() {\n Strategy tactics = null;\n ArrayList<Producer> auxProducerList = new ArrayList<>(listOfProducers.getList());\n for (Distributor dst : listOfDistributors.getList()) {\n if (dst.getSubscribedproducers().isEmpty()) {\n int auxNeededPower = dst.getEnergyNeededKW();\n if (dst.getProducerStrategy().equals(\"GREEN\")) {\n tactics = new GreenStrategy();\n } else if (dst.getProducerStrategy().equals(\"PRICE\")) {\n tactics = new PriceStrategy();\n } else if (dst.getProducerStrategy().equals(\"QUANTITY\")) {\n tactics = new QuantityStrategy();\n }\n tactics.sorter(auxProducerList);\n for (Producer p : auxProducerList) {\n if (!(p.getMaxDistributors() == p.getCurrDistributors())) {\n dst.addSubscribedproducer(p);\n p.addDistIDs(dst.getId());\n p.addObserver(dst);\n p.setCurrDistributors(p.getCurrDistributors() + 1);\n auxNeededPower -= p.getEnergyPerDistributor();\n if (auxNeededPower < 0) {\n break;\n }\n }\n }\n }\n }\n\n Distributor bestDist = listOfDistributors.getBestDistinRound();\n\n for (Consumer auxcons : listOfConsumers.getList()) {\n auxcons.setBudget(auxcons.getInitialBudget() + auxcons.getMonthlyIncome());\n auxcons.setIdofDist(bestDist.getId());\n auxcons.setMonthstoPay(bestDist.getContractLength());\n auxcons.setToPay(bestDist.getContractPrice());\n bestDist.addSubscribedconsumer(auxcons);\n if (auxcons.getBudget() >= auxcons.getToPay()) {\n auxcons.addtoBudget(-auxcons.getToPay());\n auxcons.reduceMonths();\n bestDist.addBudget(auxcons.getToPay());\n } else {\n auxcons.setDuepayment(auxcons.getToPay());\n auxcons.reduceMonths();\n }\n if (auxcons.getMonthstoPay() == 0) {\n auxcons.setIdofDist(-1);\n }\n }\n\n for (Distributor d : listOfDistributors.getList()) {\n if (d.isBankrupt()) {\n continue;\n }\n d.reduceBudget();\n if (d.getBudget() < 0) {\n d.setBankrupt(true);\n }\n }\n }",
"SpeechAwardPoints(int rating){\n\n currentPoints = rating;\n feedback = \"Your current rating is: \" + currentPoints + \"%\";\n }",
"public Scenario generate() {\n\n //generate random number of Passenger(all human)\n ArrayList liPsg = new ArrayList();\n int totalNumOfPsg = (int) (rd.nextDouble() * PassengerCountMax + PassengerCountMin); //at least one Psg\n for (int i = 0; i < totalNumOfPsg; i++) {\n liPsg.add(getRandomPerson());\n }\n //System.out.println(\"PassengerNum= \"+totalNumOfPsg);\n\n\n //generate random number of Pedestrians(with Max 5) & allocate person+animal randomly(human+animal)\n ArrayList liPdt = new ArrayList();\n int totalNumOfPdst = (int) (rd.nextDouble() * PedestrianCountMax + PedestrianCountMin);//at least one Pdg\n int NumOfPerson = (int) Math.round(rd.nextDouble() * totalNumOfPdst);//if only 1 pdt,along with randomDouble<0.5 , 0.4x*1 rounded=0, will only an animal\n //so if you are random being in pdt but pdt only an animal, you neither wont be in scenario, so your negative probability in scenario is higher.\n int NumOfAnimal = totalNumOfPdst - NumOfPerson;\n for (int i = 0; i < NumOfPerson; i++) {\n liPdt.add(getRandomPerson());\n }\n for (int i = 0; i < NumOfAnimal; i++) {\n liPdt.add(getRandomAnimal());\n }\n //System.out.println(\"PedestrianNum= \"+totalNumOfPdst+\" with \"+NumOfPerson+\" human and \"+NumOfAnimal+\" animals\");\n\n\n //allocating where you are, 0=you absence & do nothing, 1=you in car, 2=you on road !!!!yeah happy solving\n int allocate_of_user = (int) Math.round(rd.nextDouble() * 2);\n if (allocate_of_user == 1) {\n ((Person) liPsg.get(0)).setAsYou(true); //set the first psg is you. !!!!!important Cast Obj into Person!!!!\n } else if (allocate_of_user == 2) {\n for (int i = 0; i < liPdt.size(); i++) {\n if (liPdt.get(i) instanceof Person) {//check whether a person\n ((Person) liPdt.get(i)).setAsYou(true);\n break; // only set once than break rather than set all of people of pdt is you\n }\n }\n }\n\n //Scenario(ArrayList<Character> passengers, ArrayList<Character> pedestrians, boolean isLegalCrossing)\n S = new Scenario(liPsg, liPdt, rd.nextBoolean()); //isLegalCrossing = red or green light;\n return S;\n }",
"public void setRate(float rate) {\n\t\tthis.rate = rate;\n\t}",
"public void addRating(double rating) throws RatingOutOfBoundsException{\n if (rating < minRating || rating > maxRating){\n throw new RatingOutOfBoundsException();\n }\n double totalRating = (averageRating * (double) count) + rating;\n count++;\n averageRating = totalRating / (double) count;\n }",
"float genChance();",
"private void givenExchangeRateExistsForABaseAndDate() {\n }",
"public int getRate() {\n return rate_;\n }",
"public void applyInterest(double rate) {\n if ((rate > 0) && (balance < 0)) {\n withdraw((int) (-balance*rate));\n } \n if ((rate > 0) && (balance > 0)) {\n deposit((int) (balance*rate));\n }\n }",
"@Override\n\tpublic void verifyRateQuestionEnabledWithEveryQuestion() {\n\t\t\n\t}",
"abstract double rightProbability();",
"public void setRating(float rating) {\n this.rating = rating;\n }",
"public double getInstanceReward(Instance selectedInstance, boolean doBernoulliRewards, boolean isTrainingInstance, boolean verbose)\n {\n double[] probDist = classifyInstance(selectedInstance, false); \n \n //Determine Expected Reward from the returned Probability Distribution\n //Note that the following 5-point Likert scale was used\n //1 - Extremely unchallenging for me\n //2 - Somewhat unchallenging for me\n //3 - Appropriately challenging for me\n //4 - Somewhat challenging for me\n //5 - Extremely challenging for me\n double[] rewardsPerClass = new double[]{0, 1d/3d, 1, 1d/3d, 0}; //rewards per class as defined in paper, section 4.2 Phase 1.\n double expectedReward = (probDist[0] * rewardsPerClass[0]) +\n (probDist[1] * rewardsPerClass[1]) +\n (probDist[2] * rewardsPerClass[2]) +\n (probDist[3] * rewardsPerClass[3]) +\n (probDist[4] * rewardsPerClass[4]);\n \n if (verbose) {\n System.out.println(\"\");\n System.out.println(\"getInstanceReward called()...\");\n System.out.println(\"-probability of instance being class 1: \" + probDist[0]);\n System.out.println(\"-probability of instance being class 2: \" + probDist[1]);\n System.out.println(\"-probability of instance being class 3: \" + probDist[2]);\n System.out.println(\"-probability of instance being class 4: \" + probDist[3]);\n System.out.println(\"-probability of instance being class 5: \" + probDist[4]);\n System.out.println(\"-the expected reward for this level segment was determined to be: \" + expectedReward );\n System.out.println(\"-done\");\n }\n \n// //Determine rewards according to Bernoulli scheme / proportional reward\n// double reward = 0.0;\n// if (doBernoulliRewards) {\n// if (verbose) System.out.println(\"-returning reward of 1 with probablity of \" + probChallenging + \", else reward of 0 (Bernoulli rewards)\");\n// boolean returnBernoulliReward;\n// if ( Math.random() <= probChallenging ) returnBernoulliReward = true;\n// else returnBernoulliReward = false;\n// if (verbose) System.out.println(\"-boolean returnBernoulliReward: \" + returnBernoulliReward);\n// if (returnBernoulliReward) reward = 1.0;\n// else reward = 0.0; \n// }\n// else {\n// if (verbose) System.out.println(\"-returning reward \" + probChallenging + \" (regular non-Bernoulli rewards)\");\n// reward = probChallenging;\n// }\n// if (verbose) System.out.println(\"-done\");\n \n return expectedReward;\n }",
"public int generatePolicyNum(){\n\t\tRandom rnd = new Random();\n\t\tint polNum = rnd.nextInt(899999) + 100000; \t\n\t\t\n\t\treturn polNum;\t\t\t\n\t}",
"void addRating(Rating2 rating2);",
"@Override\n\tpublic double calRate() {\n\t\treturn 0.9f;\n\t}",
"@Override\n\tpublic float calculateRunRate() {\n\t\tint remaingrun=Math.abs((super.getTarget()-super.getCurrentscore()));\n\t\tfloat remaingOver=20-super.getCurrentover();\n\t\treturn remaingrun/remaingOver;\n\t}",
"public Object setintrate(double rate)\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to setintrate : \" + \"Agent\");\r\n/* 67 */ \tthis.intrate = rate;\r\n/* 68 */ \tthis.intratep1 = (this.intrate + 1.0D);\r\n/* 69 */ \treturn this;\r\n/* */ }",
"private double getDynamicRate(String resourceName) {\n logger.trace(\"BEGIN double getDynamicRate(String resourceName)\");\n double rate;\n RateEngineResponse response;\n RuleEngineClient client = new RuleEngineClient();\n\n response = client.getRate(resourceName);\n rate = response.getRate();\n //System.out.println(\"Got the response from rule engine. Rate: \" + response.getRate());\n logger.trace(\"END double getDynamicRate(String resourceName)\");\n return rate;\n }",
"public double getRate() {\n return rate;\n }",
"public double getRate() {\n return rate;\n }",
"public Builder setRate(int value) {\n \n rate_ = value;\n onChanged();\n return this;\n }",
"public void setAdaptiveRateAlgorithm(String algorithm);",
"public void setRating(double rating) throws RatingWasAlreadySetExecption {\n if (!isRated) {\n this.rating = rating;\n this.isRated = true;\n } else {\n throw new RatingWasAlreadySetExecption(\"Rating was set on an already rated tweet!\", this, rating);\n }\n\n }",
"protected RatingResult performRateEvaluationThreshold(String PriceModel, ArrayList<RateMapEntry> tmpRateModel, double valueToRate, double valueOffset, long CDRDate, boolean BreakDown) throws ProcessingException {\n int index = 0;\n double AllTiersValue = 0;\n RatingResult tmpRatingResult = new RatingResult();\n RatingBreakdown tmpBreakdown;\n\n // check that we have something to work on\n if (tmpRateModel == null) {\n throw new ProcessingException(\"Price Model <\" + PriceModel + \"> not defined\", getSymbolicName());\n }\n\n // For multi-packet rating, we have to apply the offset\n double effectiveValueToRate = valueToRate + valueOffset;\n\n // set the default value\n double rumValueUsed = 0;\n double rumValueUsedOffset = 0;\n\n // We need to loop through all the tiers until we have finshed\n // consuming all the rateable input\n while (index < tmpRateModel.size()) {\n\n // Get the root price model\n RateMapEntry tmpEntry = tmpRateModel.get(index);\n\n // Get the validty for this cdr\n tmpEntry = getRateModelEntryForTime(tmpEntry, CDRDate);\n\n // Validate that we have something we can work with\n if (tmpEntry == null) {\n message = \"CDR with <\" + CDRDate + \"> date not rated by model <\"\n + PriceModel + \"> because of missing validity coverage\";\n throw new ProcessingException(message, getSymbolicName());\n }\n\n // For positive rating cases\n double thisTierValue;\n double thisTierRUMUsed = 0;\n long thisTierBeatCount = 0;\n\n // ********************* Deal with the rating value **********************\n // See if this event crosses the lower tier threshold\n if (effectiveValueToRate > tmpEntry.getFrom()) {\n // see if we are in this tier\n if (effectiveValueToRate <= tmpEntry.getTo()) {\n // Calculate the amount in this tier - we use the offset to locate the\n // tier to use, but rate the original amount\n thisTierRUMUsed = valueToRate;\n rumValueUsed += thisTierRUMUsed;\n\n // Get the number of beats in this tier\n thisTierBeatCount = Math.round(thisTierRUMUsed / tmpEntry.getBeat());\n\n // Deal with unfinished beats\n if ((thisTierRUMUsed - thisTierBeatCount * tmpEntry.getBeat()) > 0) {\n thisTierBeatCount++;\n }\n\n // Deal with the empty beat\n if (thisTierBeatCount == 0) {\n thisTierBeatCount = 1;\n }\n } else if (tmpEntry.getFrom() == tmpEntry.getTo()) {\n // Singularity rate\n // Get the number of beats in this tier\n thisTierBeatCount = 1;\n }\n }\n\n // Calculate the value of the tier\n thisTierValue = (thisTierBeatCount * tmpEntry.getFactor()) * tmpEntry.getBeat() / tmpEntry.getChargeBase();\n\n // provide the rating breakdown if it is required\n if (BreakDown) {\n // initialise the breakdown if necessary\n if (tmpRatingResult.breakdown == null) {\n tmpRatingResult.breakdown = new ArrayList<>();\n }\n\n // provide the charging breakdown\n tmpBreakdown = new RatingBreakdown();\n tmpBreakdown.beat = tmpEntry.getBeat();\n tmpBreakdown.beatCount = thisTierBeatCount;\n tmpBreakdown.factor = tmpEntry.getFactor();\n tmpBreakdown.chargeBase = tmpEntry.getChargeBase();\n tmpBreakdown.ratedAmount = thisTierValue;\n tmpBreakdown.RUMRated = thisTierRUMUsed;\n tmpBreakdown.stepUsed = index;\n tmpBreakdown.tierFrom = tmpEntry.getFrom();\n tmpBreakdown.tierTo = tmpEntry.getTo();\n tmpBreakdown.validFrom = tmpEntry.getStartTime();\n\n // Store the breakdown\n tmpRatingResult.breakdown.add(tmpBreakdown);\n }\n\n // Increment the tier counter\n index++;\n\n // Accumulate the tier value\n AllTiersValue += thisTierValue;\n }\n\n // Roll up the final values \n tmpRatingResult.RatedValue = AllTiersValue;\n tmpRatingResult.RUMUsed = rumValueUsed - rumValueUsedOffset;\n\n // return OK\n return tmpRatingResult;\n }",
"@Test\n public void testInitialize() {\n System.out.println(\"Initialize\");\n instance.Initialize(); //calls individual Rate initializer\n assertNotNull(instance);\n }",
"Integer rateSong(User user, Song toRate, Integer rating)\n\t\tthrows IllegalArgumentException, IndexOutOfBoundsException, NullPointerException;",
"@Override\n public void withdraw(double amount) //Overridden method\n {\n elapsedPeriods++;\n \n if(elapsedPeriods<maturityPeriods)\n {\n double fees = getBalance()*(interestPenaltyRate/100)*elapsedPeriods;\n super.withdraw(fees);//withdraw the penalty\n super.withdraw(amount);//withdraw the actual amount\n \n }\n \n }",
"public void generatePriority() {\n\t\tpriority = .25 * frequency + .25 * age + .25 * links + .25 * money;\n\t}",
"public Integer getRate() {\r\n return rate;\r\n }",
"public void setRating(java.lang.String rating) {\n this.rating = rating;\n }",
"public static void setRatings (double irating){\n\t\t\t//ratings = irating;\n\t\t\tr = irating;\n\t}"
] | [
"0.6060857",
"0.6004596",
"0.5949738",
"0.58679503",
"0.5819153",
"0.5813864",
"0.5796652",
"0.5765595",
"0.57314885",
"0.5636161",
"0.5546626",
"0.5536281",
"0.55359906",
"0.55110323",
"0.5495199",
"0.5486852",
"0.5485733",
"0.54723704",
"0.5426155",
"0.54239863",
"0.54187435",
"0.54143643",
"0.5407376",
"0.5401289",
"0.5401194",
"0.53818077",
"0.53520036",
"0.53444594",
"0.53137565",
"0.5303397",
"0.5298856",
"0.52962625",
"0.52855283",
"0.52726686",
"0.5270711",
"0.524294",
"0.52324724",
"0.5231533",
"0.52263063",
"0.5223386",
"0.5216635",
"0.52066445",
"0.5185105",
"0.51845956",
"0.5169552",
"0.5168122",
"0.5156518",
"0.5156362",
"0.5142158",
"0.512555",
"0.51240253",
"0.511434",
"0.51113707",
"0.5103049",
"0.510161",
"0.510042",
"0.5096097",
"0.5093249",
"0.50896746",
"0.5081417",
"0.50800896",
"0.5071328",
"0.5070383",
"0.5067631",
"0.50630593",
"0.5059289",
"0.5052268",
"0.50359815",
"0.5032813",
"0.5032753",
"0.5031277",
"0.50266683",
"0.5025913",
"0.501622",
"0.5012056",
"0.5010153",
"0.50013363",
"0.5000272",
"0.49989823",
"0.49967268",
"0.49843243",
"0.49841017",
"0.4968393",
"0.49665004",
"0.49642476",
"0.4959369",
"0.49578723",
"0.49528193",
"0.49528193",
"0.49522567",
"0.49515304",
"0.49462262",
"0.49434164",
"0.4936614",
"0.49354467",
"0.4930223",
"0.49223766",
"0.49146882",
"0.49121934",
"0.4899675"
] | 0.6353241 | 0 |
Saves a TSDB dataObj into the database Pseudo Code 1. Create a TSDB client object (POJO object) 2. Convert the data object into a json string 3. Save the string into the database | private boolean saveRate(TSDBData rateObj) {
InfluxDBClient dbClient = new InfluxDBClient();
ObjectMapper mapper = new ObjectMapper();
String jsonData = null;
boolean result;
try {
jsonData = mapper.writeValueAsString(rateObj);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
result = dbClient.saveData(jsonData);
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void doSave(T objectToSave) throws SQLException;",
"void storeEditorData(int userid,String name,Object bodyContent){\n dbConnection();\n try{\n PGobject editorData = new PGobject();\n editorData.setType(\"json\");\n editorData.setValue(bodyContent.toString());\n\n stmt = con.prepareStatement(\"INSERT INTO editorData(name,bodyContent,userid)VALUES(?,?,?)\");\n stmt.setString(1,name);\n stmt.setObject(2,editorData);\n stmt.setInt(3,userid);\n\n stmt.executeUpdate();\n }\n catch(Exception e){\n e.printStackTrace();\n }\n finally{\n closeConnection();\n }\n \n }",
"public boolean save(T data) throws MIDaaSException;",
"public boolean save(Object o) {\n if (o instanceof String) {\n\n JsonParser parser = new JsonParser();\n\n JsonElement jsonElement = null;\n String jsonString = (String) o;\n\n try{\n while(!jsonString.startsWith(\"{\")){\n jsonString = jsonString.substring(1, jsonString.length()-2);\n }\n\n jsonElement = parser.parse(jsonString);\n dbClient.save(jsonElement.getAsJsonObject());\n return true;\n\n }catch(Exception e){\n e.printStackTrace();\n return false;\n }\n\n }\n\n return false;\n }",
"T save(T obj);",
"public static void WriteObject(String tableName, int id, Object obj) {\n try {\n conn = DriverManager.getConnection(connectionURL);\n byte[] testBytes = ConvertObject.getByteArrayObject(obj);\n PreparedStatement statement = conn.prepareStatement(\"INSERT INTO \" + tableName + \" (id, obj) VALUES(?,?)\");\n statement.setInt(1, id);\n statement.setBinaryStream(2,new ByteArrayInputStream(testBytes),testBytes.length);\n statement.executeUpdate();\n statement.close();\n conn.close();\n }\n catch(SQLException e) {\n e.printStackTrace();\n }\n }",
"public void save(Employee employee) {\n String objectStr = MyUtils.serializeIntoAString(employee);\n Connection connection = null;\n Statement stmt = null;\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n connection = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/MyDB\", \"root\", \"password\");\n stmt = connection.createStatement();\n stmt.execute(\"INSERT INTO EMPLOYEE VALUES(\" + objectStr + \")\");\n } catch (SQLException | ClassNotFoundException throwables) {\n throwables.printStackTrace();\n }\n }",
"T save(T object);",
"<T> Serializable save(T persistentObject);",
"@Override\n\tpublic void save(T obj) throws Exception {\n\t\t\n\t}",
"public void save(Object obj) throws HibException;",
"void saveSaves(Object data, Context context);",
"private void saveObject(Object object) {\n Connection connection = ConnectionPoll.getConnection();\n CRUDService crudService = new CRUDService(connection, object.getClass());\n try {\n Field[] fields = object.getClass().getDeclaredFields();\n Field id = null;\n for (Field f : fields) {\n if (f.isAnnotationPresent(Id.class)) {\n id = f;\n }\n }\n id.setAccessible(true);\n\n if (Integer.parseInt(id.get(object).toString()) != 0 && !id.get(object).equals(null)) {\n crudService.update((SimpleORMInterface) object);\n } else {\n crudService.insert((SimpleORMInterface) object);\n }\n id.setAccessible(false);\n ConnectionPoll.releaseConnection(connection);\n\n } catch (IllegalAccessException | NoSuchFieldException e) {\n e.printStackTrace();\n }\n }",
"public void saveObject(DBDoc object) {\n\t\tmongoTemplate.insert(object);\n\t}",
"public void save(CustomPojo aCustomPojo) {\n\t\t\n\t\tDBCollection table = db.getCollection(aCustomPojo.getClass().getSimpleName());\n\t\tBasicDBObject document = new BasicDBObject();\n\t\tdocument.put(\"name\", aCustomPojo.getName());\n\t\tdocument.put(\"description\", aCustomPojo.getDescription());\n\t\tdocument.put(\"createdDate\", new Date());\n\t\ttable.insert(document);\n\t}",
"public void save(T obj) {\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\t//session.save(obj);\n\t\tsession.persist(obj);\n\t}",
"public void sendDataToDB() throws JSONException, InstantiationException, IllegalAccessException, ClassNotFoundException, UnirestException, ParseException {\r\n\t\t\r\n\t\tArrayList<HashMap<String, String>> dataSet = new ArrayList<>();\r\n\t\t\r\n\t\tfor (int i = 0; i < dataArray.length(); i++) {\r\n\t\t\tHashMap<String, String> jsonObject = new HashMap<String, String>();\r\n\t\t\tjsonObject.put(\"id\" ,dataArray.getJSONObject(i).get(\"id\").toString());\r\n\t\t\tjsonObject.put(\"name\", dataArray.getJSONObject(i).get(\"name\").toString());\r\n\t\t\tjsonObject.put(\"free_bikes\", dataArray.getJSONObject(i).get(\"free_bikes\").toString());\r\n\t\t\tjsonObject.put(\"timestamp\", changeTimeStamptoUnixTimeString(dataArray.getJSONObject(i).get(\"timestamp\").toString()));\r\n\t\t\tjsonObject.put(\"latitude\", dataArray.getJSONObject(i).get(\"latitude\").toString());\r\n\t\t\tjsonObject.put(\"longitude\", dataArray.getJSONObject(i).get(\"longitude\").toString());\r\n\r\n\t\t\tdataSet.add(jsonObject);\r\n\t\t}\r\n\t\t\r\n\t\t// Send whole data to DBService\r\n\t\tUnirest.post(\"http://stadtraddbservice:6000/newData\")\r\n\t\t//Unirest.post(\"http://localhost:6000/newData\") // Fuer lokalen Test\r\n\t\t .body(new Gson().toJson(dataSet))\r\n\t\t .asString();\r\n\t}",
"@POST\n @Path(\"/database/save\")\n public Response databaseSave(@Context HttpServletRequest request,@Context HttpServletResponse response,@Context ServletContext servletContext) throws JsonGenerationException, JsonMappingException, IOException{\n System.out.println(\"Saving database\");\n Database2 db=Json.newObjectMapper(true).readValue(IOUtils2.toStringAndClose(request.getInputStream()), new TypeReference<Database2>() {});\n \n //System.out.println(\"New DB = \"+Json.newObjectMapper(true).writeValueAsString(db));\n db.save();\n \n Database2.resetInstance();\n Database2.get(); // reload instance in memory\n \n System.out.println(\"New Database Saved\");\n return Response.status(200).entity(Json.newObjectMapper(true).writeValueAsString(Database2.get())).build();\n }",
"@Override\n\tpublic void saveORUpdate(T obj) throws Exception {\n\t\t\n\t}",
"void save(String key, Object data, int expirySeconds) throws BusinessException;",
"void saveData() throws SerializerException;",
"private void saveData() {\n // Actualiza la información\n client.setName(nameTextField.getText());\n client.setLastName(lastNameTextField.getText());\n client.setDni(dniTextField.getText());\n client.setAddress(addressTextField.getText());\n client.setTelephone(telephoneTextField.getText());\n\n // Guarda la información\n DBManager.getInstance().saveData(client);\n }",
"void save(Client client) throws DAOException;",
"public String insertObj(Object obj)\r\n\t{\n\t\tthis.mongo.insert(obj);\r\n\t\t\r\n\t\treturn null;\r\n\t}",
"public void save(String json, Map<String,Object> properties);",
"public JSONObject save();",
"public <T> int save(T obj) {\r\n FollowItem followItem = (FollowItem)obj;\r\n String sql = \"insert into Follows (\"\r\n + \"UserID, ListingID) \"\r\n + \"values(\"\r\n + followItem.getUserId() + \",\"\r\n + followItem.getListingId() + \");\";\r\n return update(sql);\r\n }",
"int insert(ResourcePojo record);",
"T save(T t);",
"long save(T item) throws DaoException;",
"public void syncUpService(JSONObject obj) {\n ArrayList<ServiceModel> serviceModel = getServiceModelJSON(obj);\n insertServiceSQLite(serviceModel);\n }",
"@GET\n\t@Path(\"/testData\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic String testDatabaseInsert() throws UnknownHostException {\n\t\tMongoClientURI uri = new MongoClientURI( System.getenv(\"MONGOLAB_URI\") ); \n\t MongoClient client = new MongoClient(uri);\n \n // get/select database\n DB db = client.getDB(uri.getDatabase());\n \n // get collection named \"user\" from db\n DBCollection collection = db.getCollection(\"TSA\");\n \n // pase JSON string to BasicDBObject\n String jsonInput = \"{name: 'Jeremy', age: 25, country: 'United States'}\";\n BasicDBObject document = (BasicDBObject) JSON.parse(jsonInput);\n \n // insert\n WriteResult result = collection.insert(document);\n System.out.println(\"result: \" + result);\n \n client.close();\n\t\treturn result.toString();\n\t}",
"private boolean savePrice(ArrayList<ArrayList<Object>> objArr) {\n //TODO: create string array construction method with String... array\n //TODO: create generic method to create POJO object from objArr and map to JSON data\n logger.trace(\"BEGIN boolean savePrice(ArrayList<ArrayList<Object>> objArr)\");\n boolean result = false;\n TSDBData pricingData = new TSDBData();\n ArrayList<String> strArr = new ArrayList<String>();\n InfluxDBClient dbClient = new InfluxDBClient();\n ObjectMapper mapper = new ObjectMapper();\n String jsonData = null;\n\n strArr.add(\"resource\");\n strArr.add(\"userId\");\n strArr.add(\"usage\");\n strArr.add(\"price\");\n pricingData.setName(Loader.getSettings().getInfluxDBSettings().getCdrRecord());\n pricingData.setColumns(strArr);\n pricingData.setPoints(objArr);\n //get tags and put them into pricingData\n logger.trace(\"DATA boolean savePrice(ArrayList<ArrayList<Object>> objArr): pricingData=\" + pricingData);\n\n try {\n jsonData = mapper.writeValueAsString(pricingData);\n } catch (JsonProcessingException e) {\n logger.error(\"EXCEPTION JSONPROCESSINGEXCEPTION boolean savePrice(ArrayList<ArrayList<Object>> objArr)\");\n e.printStackTrace();\n }\n\n //System.out.println(jsonData);\n logger.trace(\"DATA boolean savePrice(ArrayList<ArrayList<Object>> objArr): jsonData=\" + jsonData);\n result = dbClient.saveData(jsonData);\n logger.trace(\"END boolean savePrice(ArrayList<ArrayList<Object>> objArr)\");\n return result;\n }",
"@Override\n public void write(Object obj) {\n if (obj != null) {\n if (!isUpsert()) {\n try {\n collection.insertOne((Document) obj);\n } catch (MongoException e) {\n System.err.println(e.getCode() + \" \" + e.getMessage());\n }\n } else {\n try {\n Document doc = (Document) obj;\n collection.updateOne(Filters.eq(\"_id\", doc.get(\"_id\")), new Document(\"$set\", doc), new UpdateOptions().upsert(true));\n } catch (MongoException e) {\n System.err.println(e.getCode() + \" \" + e.getMessage());\n }\n\n }\n }\n }",
"void save(Object entity);",
"public final /* synthetic */ void saveToDb() {\n DruidPooledConnection druidPooledConnection;\n DruidPooledConnection druidPooledConnection2;\n block18: {\n block17: {\n StringBuilder stringBuilder;\n PreparedStatement preparedStatement;\n MaplePet a2;\n if (!a2.a) {\n return;\n }\n try {\n druidPooledConnection2 = DBConPool.getInstance().getDataSource().getConnection();\n try {\n preparedStatement = druidPooledConnection2.prepareStatement(ConcurrentEnumMap.ALLATORIxDEMO(\";\\t*\\u0018:\\u001cN)\\u000b-\\u001dy=\\u001c:y\\u00008\\u0003<NdNfBy\\u0002<\\u0018<\\u0002ySyQuN:\\u00026\\u001d<\\u0000<\\u001d*NdNfBy\\b,\\u00025\\u0000<\\u001d*NdNfBy\\u001d<\\r6\\u0000=\\u001dySyQuN?\\u00028\\t*NdNfBy\\u000b!\\r5\\u001b=\\u000b=NdNfNuN*\\u001e<\\u000b=NdNfBy\\f,\\b?\\u001d2\\u00075\\u00020\\nySyQuN:\\u000f7>0\\r2;)NdNfBy\\u001d2\\u00075\\u00020\\nySyQy9\\u0011+\\u000b+y\\u001e<\\u001a0\\nySyQ\"));\n try {\n int n2;\n PreparedStatement preparedStatement2 = preparedStatement;\n PreparedStatement preparedStatement3 = preparedStatement;\n preparedStatement.setString(1, a2.h);\n preparedStatement3.setByte(2, a2.e);\n preparedStatement3.setShort(3, a2.B);\n preparedStatement2.setByte(4, a2.H);\n preparedStatement2.setInt(5, a2.J);\n preparedStatement.setShort(6, a2.k);\n stringBuilder = new StringBuilder();\n int n3 = n2 = 0;\n while (n3 < a2.d.length) {\n stringBuilder.append(a2.d[n2]);\n stringBuilder.append(KoreanDateUtil.ALLATORIxDEMO(\"V\"));\n n3 = ++n2;\n }\n }\n catch (Throwable throwable) {\n Throwable throwable2;\n if (preparedStatement != null) {\n try {\n preparedStatement.close();\n throwable2 = throwable;\n throw throwable2;\n }\n catch (Throwable throwable3) {\n throwable.addSuppressed(throwable3);\n }\n }\n throwable2 = throwable;\n throw throwable2;\n }\n }\n catch (Throwable throwable) {\n Throwable throwable4;\n if (druidPooledConnection2 != null) {\n try {\n druidPooledConnection2.close();\n throwable4 = throwable;\n throw throwable4;\n }\n catch (Throwable throwable5) {\n throwable.addSuppressed(throwable5);\n }\n }\n throwable4 = throwable;\n throw throwable4;\n }\n }\n catch (SQLException sQLException) {\n FilePrinter.printError(ConcurrentEnumMap.ALLATORIxDEMO(\"\\u0014\\u000f)\\u0002<><\\u001aw\\u001a!\\u001a\"), sQLException, KoreanDateUtil.ALLATORIxDEMO(\"e\\u001b`\\u001fB\\u0015R\\u0018\"));\n return;\n }\n {\n String string = stringBuilder.toString();\n PreparedStatement preparedStatement4 = preparedStatement;\n PreparedStatement preparedStatement5 = preparedStatement;\n PreparedStatement preparedStatement6 = preparedStatement;\n String string2 = string;\n preparedStatement6.setString(7, string2.substring(0, string2.length() - 1));\n preparedStatement6.setInt(8, a2.ALLATORIxDEMO);\n preparedStatement5.setInt(9, a2.I);\n preparedStatement5.setShort(10, a2.K);\n preparedStatement4.setInt(11, a2.M);\n preparedStatement4.setInt(12, a2.D);\n preparedStatement4.executeUpdate();\n a2.a = false;\n if (preparedStatement == null) break block17;\n druidPooledConnection = druidPooledConnection2;\n }\n preparedStatement.close();\n break block18;\n }\n druidPooledConnection = druidPooledConnection2;\n }\n if (druidPooledConnection == null) return;\n druidPooledConnection2.close();\n }",
"public static void save(Object o, String path) throws SlickException {\n\t\tObjectOutputStream outStream;\n\t\ttry {\n\t\t\toutStream = new ObjectOutputStream(new FileOutputStream(path));\n\t\t\toutStream.writeObject(o);\n\t\t\toutStream.flush();\n\t\t\toutStream.close();\n\t\t} catch (Exception ex) {\n\t\t\tthrow new SlickException(ex.getMessage(), ex.getCause());\n\t\t}\n\t}",
"void saveUserData(User user);",
"public interface SaveData {\n\tvoid saveChildAccountData (ChildAccount childAccount) throws JsonGenerationException, JsonMappingException, IOException;\n\n\tvoid saveDataFileBasedParentAccountData (DataFileBasedParentAccount parentAccount) throws JsonGenerationException, JsonMappingException, IOException;\n}",
"@Override\r\n\tpublic final void saveObjectData() throws BillingSystemException{\n\t}",
"@Override\n\tpublic void persist(T obj) throws Exception {\n\t\t\n\t}",
"@Override\r\n\tpublic void save(TQssql sql) {\n\r\n\t}",
"int insert(TbSerdeParams record);",
"@Override\n public void save(T pojo) {\n\n Map<Class, Set<ReflectionUtils.DataDescriptor>> valueMap = new HashMap<>();\n\n try {\n ReflectionUtils.valuesForClasses(valueMap, null, pojo);\n\n for (Map.Entry<Class, Set<ReflectionUtils.DataDescriptor>> entry : valueMap.entrySet()) {\n Insert insert = null;\n if (entry.getKey().getName().equals(pojo.getClass().getName())) {\n logger.info(\"Working on the root class \" + pojo);\n for (ReflectionUtils.DataDescriptor descriptor : entry.getValue()) {\n insert = QueryBuilder.insertInto(keySpace, tableName).values(ReflectionUtils.fieldNames(entry.getKey()),\n descriptor.getValues());\n\n logger.debug(\"Insert \" + insert);\n ResultSet res = session.execute(insert);\n logger.debug(\"Result \" + res);\n }\n } else {\n for (ReflectionUtils.DataDescriptor descriptor : entry.getValue()) {\n String nestedtableName = descriptor.getTableName();\n logger.debug(\"Insert builder \" + descriptor + \" into \" + keySpace + \".\" + nestedtableName);\n insert = QueryBuilder.insertInto(keySpace, nestedtableName).values(ReflectionUtils.fieldNames(entry.getKey()),\n descriptor.getValues());\n ResultSet res = session.execute(insert);\n logger.debug(\"Result \" + res);\n }\n }\n }\n }\n catch (HecateException e) {\n logger.error(\"Hecate problem \" + e);\n }\n }",
"public WriteResult saveRegistInfoByJSON(String JSONStr) throws UnknownHostException {\n\n DBCollection activityRouteInfoCollection = CommonDBManager.MongoDBConnect(\"RegistInfo\");\n DBObject dbObecjt = (DBObject) JSON.parse(JSONStr);\n WriteResult result = activityRouteInfoCollection.insert(dbObecjt);\n return result;\n }",
"@Test\n\tpublic void testSaveNSTJSONObject_1()\n\t\tthrows Exception {\n\t\tPatientAccessor fixture = new PatientAccessor(\"\");\n\t\tJSONObject jsonObj = new JSONObject();\n\n\t\tfixture.saveNSTJSONObject(jsonObj);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.IllegalStateException: _out shouldn't be null\n\t\t// at com.mongodb.DBPort.go(DBPort.java:110)\n\t\t// at com.mongodb.DBPort.call(DBPort.java:74)\n\t\t// at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:286)\n\t\t// at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:257)\n\t\t// at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:310)\n\t\t// at com.mongodb.DB.command(DB.java:274)\n\t\t// at com.mongodb.DB.command(DB.java:256)\n\t\t// at com.mongodb.DB.command(DB.java:313)\n\t\t// at com.mongodb.Mongo.getDatabaseNames(Mongo.java:393)\n\t\t// at com.comp2014group5.generic_database.FormDatabaseMongoImpl.<init>(FormDatabaseMongoImpl.java:24)\n\t\t// at com.comp2014.group5.patient_database.PatientAccessor.<init>(PatientAccessor.java:29)\n\t}",
"public boolean executeInsertIntoDB(final Class myClass,\n final String jsonString,\n final Boolean appendToObject) {\n if (jsonString == null || myClass == null) {\n return false;\n }\n if (!isValidWrite(myClass)) {\n return false;\n }\n Realm realm = DatabaseUtilities.buildRealm(this.realmConfiguration);\n try {\n realm.executeTransaction(new Realm.Transaction() {\n @Override\n public void execute(Realm realm) {\n if (MiscUtilities.isBooleanNullTrueFalse(appendToObject)) {\n realm.createOrUpdateObjectFromJson(myClass, jsonString);\n } else {\n realm.createObjectFromJson(myClass, jsonString);\n }\n }\n });\n realm.close();\n return true;\n } catch (IllegalArgumentException e1) {\n e1.printStackTrace();\n L.m(\"A RealmObject with no PrimaryKey cannot be updated. Does \" + myClass.getName() +\n \"have a @PrimaryKey designation over something?\");\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n if(!realm.isClosed()) {\n realm.close();\n }\n } catch (Exception e) {\n }\n }\n return false;\n }",
"T persist(T obj) throws PersistException;",
"@Override\n public void writeToDb(List<String> data) {\n\n try {\n openConnection();\n if (validateData((ArrayList<String>) data)) {\n for (String datum : data) {\n bufferedWriter.write(getDate() + \" - \" + datum);\n bufferedWriter.newLine();\n }\n bufferedWriter.write(\"==================\\n\");\n System.out.println(\"All data is written to MS SQL DB\");\n closeConnection();\n }\n } catch (IOException e) {\n System.err.println(\"ERROR!!!\");\n e.printStackTrace();\n }\n\n }",
"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 }",
"@Override\n\tpublic void WriteData(String obj) {\n\t\t\n\t}",
"public boolean save(Data model);",
"public void saveOneWord(Pojo.OneWord e){ \n template.save(e); \n}",
"<T> void saveOrUpdate(T persistentObject);",
"public <E extends Writeable> void storeObject(String sql, E e);",
"void updateEditorData(int userId,String name,Object bodyContent){\n dbConnection();\n try{\n PGobject editorData = new PGobject();\n editorData.setType(\"json\");\n editorData.setValue(bodyContent.toString());\n stmt = con.prepareStatement(\"UPDATE editorData SET name = ?,bodyContent = ? WHERE id = ?\");\n stmt.setString(1,name);\n stmt.setObject(2,editorData);\n stmt.setInt(3,userId);\n stmt.executeUpdate();\n }\n catch(Exception e){\n e.printStackTrace();\n }\n finally{\n closeConnection();\n }\n }",
"public T create(T object) throws SQLException;",
"public static String writeData(String obj){\n\t\tMap<String, Object> map = objectMapper.parser().parseMap(obj);\n\t\tif (map.keySet().containsAll(reqKeys)){\n\t\t\tKeyStorage.memStore.put(map.get(\"key\").toString().getBytes(), obj.getBytes());\n\t\t\tif (map.get(\"index\").equals(Boolean.TRUE)){\n\t\t\t\tValueIndexEngine.documentQueue(map);\n\t\t\t}\n\t\t\treturn okresp;\n\t\t}\n\t\treturn badresp;\n\t}",
"public void upsert( Map<String, ? extends Object> data, final ObjectCallback<Qualification> callback){\n\n /**\n Call the onBefore event\n */\n callback.onBefore();\n\n\n //Definging hashMap for data conversion\n Map<String, Object> hashMapObject = new HashMap<>();\n //Now add the arguments...\n \n hashMapObject.putAll(data);\n \n\n \n\n\n \n \n \n invokeStaticMethod(\"upsert\", hashMapObject, new Adapter.JsonObjectCallback() {\n \n @Override\n public void onError(Throwable t) {\n callback.onError(t);\n //Call the finally method..\n callback.onFinally();\n }\n\n @Override\n public void onSuccess(JSONObject response) {\n \n if(response != null){\n QualificationRepository qualificationRepo = getRestAdapter().createRepository(QualificationRepository.class);\n if(context != null){\n try {\n Method method = qualificationRepo.getClass().getMethod(\"addStorage\", Context.class);\n method.invoke(qualificationRepo, context);\n\n } catch (Exception e) {\n Log.e(\"Database Error\", e.toString());\n }\n\n //qualificationRepo.addStorage(context);\n }\n Map<String, Object> result = Util.fromJson(response);\n Qualification qualification = qualificationRepo.createObject(result);\n\n //Add to database if persistent storage required..\n if(isSTORE_LOCALLY()){\n //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string\n try {\n Method method = qualification.getClass().getMethod(\"save__db\");\n method.invoke(qualification);\n\n } catch (Exception e) {\n Log.e(\"Database Error\", e.toString());\n }\n\n }\n\n callback.onSuccess(qualification);\n }else{\n callback.onSuccess(null);\n }\n \n //Call the finally method..\n callback.onFinally();\n }\n });\n \n\n \n\n }",
"private static void saveData(String data) {\n }",
"public void save();",
"public void save();",
"public void save();",
"public void save();",
"public boolean executeInsertIntoDB(final Class myClass,\n final JSONObject jsonObject,\n final Boolean appendToObject) {\n if (jsonObject == null || myClass == null) {\n return false;\n }\n if (!isValidWrite(myClass)) {\n return false;\n }\n Realm realm = DatabaseUtilities.buildRealm(this.realmConfiguration);\n try {\n realm.executeTransaction(new Realm.Transaction() {\n @Override\n public void execute(Realm realm) {\n if (MiscUtilities.isBooleanNullTrueFalse(appendToObject)) {\n realm.createOrUpdateObjectFromJson(myClass, jsonObject);\n } else {\n realm.createObjectFromJson(myClass, jsonObject);\n }\n }\n });\n realm.close();\n return true;\n } catch (IllegalArgumentException e1) {\n e1.printStackTrace();\n L.m(\"A RealmObject with no PrimaryKey cannot be updated. Does \" + myClass.getName() +\n \"have a @PrimaryKey designation over something?\");\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n if(!realm.isClosed()) {\n realm.close();\n }\n } catch (Exception e) {\n }\n }\n return false;\n }",
"public boolean addData(String data){\r\n\r\n\t\t// the data parameter should be a json string with the following format:\r\n\t\t// \"Transmit ID\":\"Device ID\",\r\n \t\t//\t \"RSSI\":\"Decibels\",\r\n \t\t//\t \"Receive ID\":\"Device ID\"\r\n \t\t//\t \"GPS\":\"Location\",\r\n \t\t//\t \"IMU\":\"Orientation\",\r\n \t\t//\t \"Timestamp\":\"<UNIX time>\"\r\n \t\t//\tthis string will be parsed and its contents will be saved in the database \r\n \t\t\r\n\r\n\t}",
"private void saveData() {\n }",
"public int saveOrUpdate(o dto);",
"public void saveUserData(UserData userData){\n userDataRepository.save(userData);\n }",
"public void saveData ( ) {\n\t\tinvokeSafe ( \"saveData\" );\n\t}",
"public <T> String createRecord(T recordData) {\r\n\t\tHttpPost httpPost = new HttpPost(buildUrl(\"RECORDS_PATH\"));\r\n\t\tprepareRequestForJson(httpPost);\r\n\t\thttpPost.setEntity(createHttpEntityForJson(recordData));\r\n\t\treturn executeAndExtractEntity(httpPost);\r\n\t}",
"public interface IDBStorableModel {\n\n\t/**\n\t * Saves the model to db\n\t * \n\t * @param db\n\t * @return\n\t */\n\tpublic void store(DBConnection db) throws IOException;\n\t\n}",
"public void insert(@NotNull T object) {\n Logger logger = getLogger();\n try (Connection connection = getConnection();\n PreparedStatement preparedStatement = connection.prepareStatement(getInsert())) {\n\n logger.info(\"Inserting into DB\");\n setStatement(preparedStatement, object);\n logger.info(\"Executing statement: \" + preparedStatement);\n preparedStatement.executeUpdate();\n\n } catch (SQLException | NotEnoughDataException e) {\n logger.error(e.getMessage());\n }\n logger.info(\"Insert: success\");\n }",
"private void saveData(){\n databaseReference.setValue(new Teacher(0, \"\", 0.0));\n }",
"public boolean save(New object);",
"public void saveOrUpdate(Object obj) throws HibException;",
"@Override\n\tpublic void saveTOU(String id, String vno) {\n\t\tPreparedStatement stmt = null;\n\t\ttry {\n\t\t\tstmt = _conn.prepareStatement(SQL_SAVE_TOU);\n\t\t\tstmt.setString(1, id);\n\t\t\tstmt.setString(2, vno);\n\t\t\tstmt.setBoolean(3, false);\n\t\t\tint result = stmt.executeUpdate();\n\t\t\tif (result != 1)\n\t\t\t\tthrow new DomainObjectWriteException(String.format(\n\t\t\t\t\t\t\"Write failed, %d rows affected.\", result));\n\t\t}catch (Exception e) {\n\t\t\tLog.e(\"exc\", e.getMessage());\n\t\t\tthrow new DatabaseProviderException(e);\n\t\t} finally {\n\t\t\t H2Utils.close(stmt);\n\t\t}\n\t}",
"public void saveOrUpdate(Object aObject);",
"public void insertIntoDb(JSONObject data) {\n shortlistedSuppliersData.clear();\r\n shortlistedInventoryDetailsData.clear();\r\n basicSupplierData.clear();\r\n inventoryActivityAssignmentData.clear();\r\n inventoryActivityData.clear();\r\n\r\n if ( data == null)\r\n return;\r\n\r\n try {\r\n // handling shortlisted suppliers here\r\n JSONObject shortlistedSuppliers = data.getJSONObject(\"shortlisted_suppliers\");\r\n Iterator<?> shortlistedSupplierKeys = shortlistedSuppliers.keys();\r\n\r\n while ( shortlistedSupplierKeys.hasNext() ) {\r\n\r\n String shortlistedSupplierId = (String)shortlistedSupplierKeys.next();\r\n if ( shortlistedSuppliers.get(shortlistedSupplierId) instanceof JSONObject ) {\r\n\r\n JSONObject shortlistedSupplier = (JSONObject)shortlistedSuppliers.get(shortlistedSupplierId);\r\n String supplierContentType = shortlistedSupplier.getString(\"content_type_id\");\r\n\r\n ShortlistedSuppliersTable shortlistedSupplierObject =\r\n getShortlistedSupplierData(shortlistedSupplier, shortlistedSupplierId);\r\n\r\n if (shortlistedSupplierObject == null)\r\n continue;\r\n\r\n // work for BasicSupplier Data\r\n JSONObject supplierDetail = shortlistedSupplier.getJSONObject(\"supplier_detail\");\r\n BasicSupplierTable instance = getBasicSupplierData(supplierDetail, supplierContentType);\r\n if ( instance != null ) {\r\n basicSupplierData.add(instance);\r\n }\r\n\r\n //Log.e(\"In assigned Frag\",supplierDetail.toString());\r\n contactTableEntryList = ContactsTable.getContactDetails(supplierDetail);\r\n\r\n shortlistedSuppliersData.add(shortlistedSupplierObject);\r\n }\r\n }\r\n\r\n // handling shortlisted inventories here\r\n JSONObject shortlistedInventories = data.getJSONObject(\"shortlisted_inventories\");\r\n Iterator<?> shortlistedInventoryKeys = shortlistedInventories.keys();\r\n\r\n while ( shortlistedInventoryKeys.hasNext() ) {\r\n\r\n String shortlistedInventoryId = (String)shortlistedInventoryKeys.next();\r\n JSONObject shortlistedInventory = (JSONObject)shortlistedInventories.get(shortlistedInventoryId);\r\n\r\n ShortlistedInventoryDetailsTable instance = getShortlistedInventoryDetailsTableInstance(shortlistedInventory, shortlistedInventoryId);\r\n if ( instance == null)\r\n continue;\r\n shortlistedInventoryDetailsData.add(instance);\r\n }\r\n\r\n // handle inventory activities\r\n JSONObject inventoryActivities = data.getJSONObject(\"inventory_activities\");\r\n Iterator<?> inventoryActivityKeys = inventoryActivities.keys();\r\n\r\n while ( inventoryActivityKeys.hasNext() ) {\r\n\r\n String inventoryActivityId = (String)inventoryActivityKeys.next();\r\n JSONObject inventoryActivity = (JSONObject)inventoryActivities.get(inventoryActivityId);\r\n\r\n InventoryActivityTable inventoryActivityTable = getInventoryActivityInstance(inventoryActivity, inventoryActivityId);\r\n if (inventoryActivityTable == null)\r\n continue;\r\n inventoryActivityData.add(inventoryActivityTable);\r\n }\r\n\r\n // handling inventory activity assignment here\r\n\r\n JSONObject inventoryActivityAssignment = data.getJSONObject(\"inventory_activity_assignment\");\r\n Iterator<?> inventoryActivityAssignmentKeys = inventoryActivityAssignment.keys();\r\n\r\n while( inventoryActivityAssignmentKeys.hasNext() ) {\r\n\r\n String inventoryActivityAssignmentId = (String)inventoryActivityAssignmentKeys.next();\r\n JSONObject inventoryActivityAssignmentObject = (JSONObject)inventoryActivityAssignment.get(inventoryActivityAssignmentId);\r\n\r\n InventoryActivityAssignmentTable instance = getInventoryActivityAssignmentInstance(inventoryActivityAssignmentObject, inventoryActivityAssignmentId);\r\n if ( instance == null)\r\n continue;\r\n inventoryActivityAssignmentData.add(instance);\r\n\r\n }\r\n }\r\n catch (Exception e) {\r\n Log.d(\"insertIntoDb\", e.getMessage());\r\n }\r\n\r\n DataBaseHandler db = DataBaseHandler.getInstance(getContext());\r\n try {\r\n // bulk insert them all.\r\n\r\n ShortlistedSuppliersTable.insertBulk(db, shortlistedSuppliersData);\r\n ShortlistedInventoryDetailsTable.insertBulk(db, shortlistedInventoryDetailsData);\r\n BasicSupplierTable.insertBulk(db, basicSupplierData);\r\n InventoryActivityTable.insertBulk(db, inventoryActivityData);\r\n InventoryActivityAssignmentTable.insertBulk(db, inventoryActivityAssignmentData);\r\n ContactsTable.insertBulk(db,contactTableEntryList);\r\n\r\n Log.d(\"ShortlistedSuppTable\", Integer.toString( db.getTotalCount(ShortlistedSuppliersTable.getTableName())));\r\n Log.d(\"shortInvDetail\", Integer.toString( db.getTotalCount(ShortlistedInventoryDetailsTable.getTableName()))) ;\r\n Log.d(\"BasicSuppData\", Integer.toString(db.getTotalCount(BasicSupplierTable.getTableName()))) ;\r\n Log.d(\"InvActivity\", Integer.toString(db.getTotalCount(InventoryActivityTable.getTableName()))) ;\r\n Log.d(\"InvActivityAssignment\", Integer.toString(db.getTotalCount(InventoryActivityAssignmentTable.getTableName()))) ;\r\n\r\n }\r\n catch (Exception e) {\r\n Log.d(\"insertIntoDb\", e.getMessage());\r\n }\r\n finally {\r\n\r\n }\r\n }",
"@Override\n\tpublic void saveData(Object objectsToSave, String path) {\n\t\t\n\t\ttry {\n\t\t\tString objects = (String) objectsToSave;\n\t\t\tFileOutputStream fileOutputStream = new FileOutputStream(path);\n\t\t\tfileOutputStream.write(objects.getBytes());\n\t\t\tfileOutputStream.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}",
"public void saveObjectAndSync(final Object objectType) throws Exception;",
"public void save(Object instance);",
"void saveObject(DataObject sdo, XMLStreamWriter writer) throws XMLStreamException;",
"String insert(BookDO record);",
"void sendTransactionToServer()\n \t{\n \t\t//json + sql magic\n \t}",
"Dao.CreateOrUpdateStatus createOrUpdate(T data) throws SQLException, DaoException;",
"int insert(PmKeyDbObj record);",
"private void actuallyWriteData() {\r\n\t\t// Get rid of old data. Getting rid of trips, trip patterns, and blocks\r\n\t\t// is a bit complicated. Need to delete them in proper order because\r\n\t\t// of the foreign keys. Because appear to need to use plain SQL\r\n\t\t// to do so successfully (without reading in objects and then\r\n\t\t// deleting them, which takes too much time and memory). Therefore\r\n\t\t// deleting of this data is done here before writing the data.\r\n\t\tlogger.info(\"Deleting old blocks and associated trips from database...\");\r\n\t\tBlock.deleteFromSandboxRev(session);\r\n\r\n\t\tlogger.info(\"Deleting old trips from database...\");\r\n\t\tTrip.deleteFromSandboxRev(session);\r\n\r\n\t\tlogger.info(\"Deleting old trip patterns from database...\");\r\n\t\tTripPattern.deleteFromSandboxRev(session);\r\n\t\t\r\n\t\t// Now write the data to the database.\r\n\t\t// First write the Blocks. This will also write the Trips, TripPatterns,\r\n\t\t// Paths, and TravelTimes since those all have been configured to be\r\n\t\t// cascade=CascadeType.ALL .\r\n\t\tlogger.info(\"Saving {} blocks (plus associated trips) to database...\", \r\n\t\t\t\tgtfsData.getBlocks().size());\r\n\t\tint c = 0;\r\n\t\tfor (Block block : gtfsData.getBlocks()) {\r\n\t\t\tlogger.debug(\"Saving block #{} with blockId={} serviceId={} blockId={}\",\r\n\t\t\t\t\t++c, block.getId(), block.getServiceId(), block.getId());\r\n\t\t\twriteObject(block);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving routes to database...\");\r\n\t\tRoute.deleteFromSandboxRev(session);\r\n\t\tfor (Route route : gtfsData.getRoutes()) {\r\n\t\t\twriteObject(route);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving stops to database...\");\r\n\t\tStop.deleteFromSandboxRev(session);\r\n\t\tfor (Stop stop : gtfsData.getStops()) {\r\n\t\t\twriteObject(stop);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving agencies to database...\");\r\n\t\tAgency.deleteFromSandboxRev(session);\r\n\t\tfor (Agency agency : gtfsData.getAgencies()) {\r\n\t\t\twriteObject(agency);\r\n\t\t}\r\n\r\n\t\tlogger.info(\"Saving calendars to database...\");\r\n\t\tCalendar.deleteFromSandboxRev(session);\r\n\t\tfor (Calendar calendar : gtfsData.getCalendars()) {\r\n\t\t\twriteObject(calendar);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving calendar dates to database...\");\r\n\t\tCalendarDate.deleteFromSandboxRev(session);\r\n\t\tfor (CalendarDate calendarDate : gtfsData.getCalendarDates()) {\r\n\t\t\twriteObject(calendarDate);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving fare rules to database...\");\r\n\t\tFareRule.deleteFromSandboxRev(session);\r\n\t\tfor (FareRule fareRule : gtfsData.getFareRules()) {\r\n\t\t\twriteObject(fareRule);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving fare attributes to database...\");\r\n\t\tFareAttribute.deleteFromSandboxRev(session);\r\n\t\tfor (FareAttribute fareAttribute : gtfsData.getFareAttributes()) {\r\n\t\t\twriteObject(fareAttribute);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving frequencies to database...\");\r\n\t\tFrequency.deleteFromSandboxRev(session);\r\n\t\tfor (Frequency frequency : gtfsData.getFrequencies()) {\r\n\t\t\twriteObject(frequency);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving transfers to database...\");\r\n\t\tTransfer.deleteFromSandboxRev(session);\r\n\t\tfor (Transfer transfer : gtfsData.getTransfers()) {\r\n\t\t\twriteObject(transfer);\r\n\t\t}\r\n\t}",
"private ServerError moveToDB(String[] objJS, int i, JSONArray[] arrayJson, int serverVersion) {\n ServerError res = ServerError.NO_ERROR;\r\n\r\n // Since there is a JSONArray for each JSON object processed\r\n // going trough all the JSON object to get each JSON array file\r\n //for(int i = 0; i < numObjJS; i++)\r\n //{\r\n // Getting the JSON Array selected\r\n JSONArray jsonSel = arrayJson[i];\r\n //Log.e(\"SERVER\", \"JSON array selected: \"+ objJS[i]);\r\n\r\n // Set the instance for the values to insert into the lite db\r\n ContentValues values = new ContentValues();\r\n\r\n // Start going through the JSON Array selected\r\n for (int j = 0; j < jsonSel.length(); j++) {\r\n try {\r\n // Getting the every single JSON object of the main JSON Array selected\r\n JSONObject objSel = jsonSel.getJSONObject(j);\r\n // Moving to the DB passing by the object\r\n res = setValuesToDB(objSel, objJS[i], values, serverVersion);\r\n if (res.equals(ServerError.OLD_BUILD))\r\n return res;\r\n\r\n } catch (JSONException e) {\r\n e.printStackTrace();\r\n return ServerError.GENERAL;\r\n }\r\n }\r\n //}\r\n\r\n return res;\r\n }",
"private void saveToDb() {\r\n ContentValues values = new ContentValues();\r\n values.put(DbAdapter.KEY_DATE, mTime);\r\n if (mPayeeText != null && mPayeeText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_PAYEE, mPayeeText.getText().toString());\r\n if (mAmountText != null && mAmountText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_AMOUNT, mAmountText.getText().toString());\r\n if (mCategoryText != null && mCategoryText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_CATEGORY, mCategoryText.getText().toString());\r\n if (mMemoText != null && mMemoText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_MEMO, mMemoText.getText().toString());\r\n if (mTagText != null && mTagText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_TAG, mTagText.getText().toString());\r\n\r\n \tif (Utils.validate(values)) {\r\n \t\tmDbHelper.open();\r\n \t\tif (mRowId == null) {\r\n \t\t\tlong id = mDbHelper.create(values);\r\n \t\t\tif (id > 0) {\r\n \t\t\t\tmRowId = id;\r\n \t\t\t}\r\n \t\t} else {\r\n \t\t\tmDbHelper.update(mRowId, values);\r\n \t\t}\r\n \t\tmDbHelper.close();\r\n \t}\r\n\t}",
"EmployeeDetail save(EmployeeDetail detail) throws DBException;",
"public void upsert(final T obj, OnSuccessListener<Void> successes, OnFailureListener failureListener){\n if (obj.getId()==null) {\n db.collection(COLLECTION_NAME)\n .document()\n .set(obj.marshal())\n .addOnSuccessListener(successes)\n .addOnFailureListener(failureListener);\n return;\n }\n db.collection(COLLECTION_NAME)\n .document(obj.getId())\n .set(obj.marshal())\n .addOnSuccessListener(successes)\n .addOnFailureListener(failureListener);\n }",
"void save(T entity);",
"public abstract String toDBString();",
"Object convertJavaValueToDBValue(Object value, Class<?> javaType);",
"private void WriteFallToDatabase(String uuid, String latitude, String longitude) {\n\n // Create the JSON Object and the request queue to add it to\n JSONObject jsonData = new JSONObject();\n try{\n jsonData.put(\"hi\", latitude);\n jsonData.put(\"bye\", longitude);\n\n }catch (JSONException e){\n e.printStackTrace();\n }\n\n RequestQueue requestQueue = Volley.newRequestQueue(this);\n JSONObject jsonBodyObj = new JSONObject();\n\n // Specify URL to send the request to\n String url = \"http://81.109.61.10/manage\";\n try{\n jsonBodyObj.put(\"action\", \"insert_fall\");\n jsonBodyObj.put(\"uuid\", uuid);\n jsonBodyObj.put(\"timestamp\", getTimestamp());\n jsonBodyObj.put(\"data\", jsonData);\n }catch (JSONException e){\n e.printStackTrace();\n }\n\n final String requestBody = jsonBodyObj.toString();\n\n // Send POST request to the script\n JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST,\n url, null, new Response.Listener<JSONObject>(){\n\n @Override\n public void onResponse(JSONObject response) {\n Toast.makeText(getApplicationContext(), \"Fall data saved to online database\",Toast.LENGTH_SHORT).show();\n }\n\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n VolleyLog.e(\"Error: \", error.getMessage());\n }\n }){\n @Override\n public Map<String, String> getHeaders() throws AuthFailureError {\n HashMap<String, String> headers = new HashMap<String, String>();\n headers.put(\"Content-Type\", \"application/json\");\n return headers;\n }\n\n\n @Override public byte[] getBody() {\n byte[] bytes = requestBody.getBytes();\n return bytes;\n }\n };\n\n // Add request to the queue\n requestQueue.add(jsonObjectRequest);\n }",
"void update(T obj) throws PersistException;",
"public void insertClient(ClientVO clientVO);",
"public void storeTable(Table table) {\n Entity tableEntity = new Entity(\"Table\");\n tableEntity.setProperty(\"firstName\", table.getFirstName());\n tableEntity.setProperty(\"lastName\", table.getLastName());\n tableEntity.setProperty(\"email\", table.getEmail());\n tableEntity.setProperty(\"phoneNumber\", table.getPhoneNumber());\n tableEntity.setProperty(\"restName\", table.getRestName());\n tableEntity.setProperty(\"restAdd\", table.getRestAdd());\n tableEntity.setProperty(\"restDescrip\", table.getRestDescrip());\n tableEntity.setProperty(\"dateTime\", table.getDateTime());\n tableEntity.setProperty(\"maxSize\", table.getMaxSize());\n tableEntity.setProperty(\"otherNotes\", table.getOtherNotes());\n tableEntity.setProperty(\"members\", table.getMembers());\n tableEntity.setProperty(\"lat\", table.getLat());\n tableEntity.setProperty(\"lng\", table.getLng());\n \n DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n datastore.put(tableEntity);\n}",
"public void persist(DataOutputStream dos) throws Exception;"
] | [
"0.6831142",
"0.6774141",
"0.64445674",
"0.6443571",
"0.6314301",
"0.6302217",
"0.61327916",
"0.61172444",
"0.60277236",
"0.60156244",
"0.6013114",
"0.5996221",
"0.5970348",
"0.5931313",
"0.5927814",
"0.59097564",
"0.58932406",
"0.58856916",
"0.5880239",
"0.58728313",
"0.58425575",
"0.58024186",
"0.5775269",
"0.5767402",
"0.574181",
"0.5737244",
"0.5694194",
"0.5682692",
"0.5671455",
"0.56604147",
"0.5647432",
"0.5641981",
"0.5605743",
"0.5599391",
"0.559027",
"0.5588805",
"0.5584713",
"0.55809575",
"0.55789304",
"0.55787617",
"0.55553997",
"0.5555083",
"0.55480105",
"0.55422485",
"0.55334514",
"0.5533162",
"0.5523019",
"0.55130374",
"0.54985076",
"0.5485495",
"0.54852456",
"0.5464658",
"0.5452132",
"0.54437155",
"0.5440704",
"0.54095715",
"0.5407495",
"0.5404334",
"0.53879756",
"0.5385215",
"0.5382296",
"0.5382296",
"0.5382296",
"0.5382296",
"0.53768885",
"0.5374317",
"0.5373099",
"0.5359479",
"0.5357445",
"0.5356132",
"0.5355717",
"0.53552765",
"0.5345677",
"0.5339117",
"0.5334783",
"0.53336585",
"0.53332365",
"0.53299874",
"0.53213763",
"0.5318238",
"0.5315999",
"0.53092563",
"0.5305294",
"0.53037137",
"0.5298125",
"0.52938145",
"0.5292571",
"0.52886623",
"0.52663314",
"0.526109",
"0.5253406",
"0.52501595",
"0.5242038",
"0.5237859",
"0.5237824",
"0.52228284",
"0.52206826",
"0.5213363",
"0.52038604",
"0.5192411"
] | 0.5935687 | 13 |
Generates the static rate for a resource Pseudo Code 1. Get the current list of resources along with their static rates 2. Create a dataObj consisting of the resources along with its resources. | private TSDBData generateStaticRate() {
//TODO: check if there is generic method to to return rateData
ArrayList<String> strArr = StringUtil.strArr("resource", "rate", "rate_policy");
TSDBData rateData = createPOJOObject("rate", strArr, load.getStaticRate());
return rateData;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private TSDBData generateDynamicRate() {\n //TODO: replace with single method generateRate and parameter (static, dynamic)\n double rate;\n Random rateGenerator = new Random();\n TSDBData rateData = new TSDBData();\n ArrayList<String> strArr = null;\n ArrayList<Object> objArrNode;\n ArrayList<ArrayList<Object>> objArr = new ArrayList<ArrayList<Object>>();\n\n // Iterate through the list and generate the rate for each enabled meters\n for (int k = 0; k < enabledResourceList.size(); k++) {\n //rate = getDynamicRate(enabledResourceList.get(k).toString());\n rate = rateGenerator.nextInt((3 - 1) + 1) + 1;\n strArr = StringUtil.strArr(\"resource\", \"rate\", \"rate_policy\");\n //strArr.add(\"resource\");\n //strArr.add(\"rate\");\n //strArr.add(\"rate_policy\");\n objArrNode = new ArrayList<Object>();\n objArrNode.add(enabledResourceList.get(k));\n objArrNode.add(rate);\n objArrNode.add(Flag.getMeteringType());\n objArr.add(objArrNode);\n }\n\n rateData.setName(\"rate\");\n rateData.setColumns(strArr);\n rateData.setPoints(objArr);\n return rateData;\n }",
"com.yandex.ydb.rate_limiter.Resource getResource();",
"private double getDynamicRate(String resourceName) {\n logger.trace(\"BEGIN double getDynamicRate(String resourceName)\");\n double rate;\n RateEngineResponse response;\n RuleEngineClient client = new RuleEngineClient();\n\n response = client.getRate(resourceName);\n rate = response.getRate();\n //System.out.println(\"Got the response from rule engine. Rate: \" + response.getRate());\n logger.trace(\"END double getDynamicRate(String resourceName)\");\n return rate;\n }",
"com.yandex.ydb.rate_limiter.ResourceOrBuilder getResourceOrBuilder();",
"public ArrayList<Resource> getStaticInfo() {\n\t\tArrayList<Resource> resources = new ArrayList<Resource>();\n\n\t\t// ~~~ CPU\n\t\tResource cpuResource = new Resource();\n\t\tcpuResource.setResourceType(ResourceType.CPU);\n\t\tcpuResource.setName(clientStaticInfo.getCPUVendor() + \" CPU\");\n\n\t\tAttribute cpuSpeedAttribute = new Attribute();\n\t\tcpuSpeedAttribute.setAttributeType(AttributeType.CPUSpeed);\n\t\tcpuSpeedAttribute.setValue(Double.parseDouble(clientStaticInfo\n\t\t\t\t.getCPUSpeed()));\n\t\tcpuSpeedAttribute.setDate(new Date());\n\t\tcpuResource.addAttribute(cpuSpeedAttribute);\n\n\t\tresources.add(cpuResource);\n\t\t// ~~~ RAM\n\t\tResource ramResource = new Resource();\n\t\tramResource.setResourceType(ResourceType.RAM);\n\t\tramResource.setName(\"RAM\");\n\n\t\tAttribute ramTotalAttribute = new Attribute();\n\t\tramTotalAttribute.setAttributeType(AttributeType.TotalMemory);\n\t\tramTotalAttribute.setValue(Double.parseDouble(clientStaticInfo\n\t\t\t\t.getRAMInfo()));\n\t\tramTotalAttribute.setDate(new Date());\n\t\tramResource.addAttribute(ramTotalAttribute);\n\n\t\tresources.add(ramResource);\n\t\t// ~~~ OS\n\t\tResource osResource = new Resource();\n\t\tosResource.setResourceType(ResourceType.OS);\n\t\tosResource.setName(clientStaticInfo.getOSInfo());\n\n\t\tresources.add(osResource);\n\t\t// ~~~ SStorage\n\t\tResource sstorageResource = new Resource();\n\t\tsstorageResource.setResourceType(ResourceType.SStorage);\n\t\tsstorageResource.setName(\"SSTORAGE\");\n\n\t\tAttribute sstorageTotalAttribute = new Attribute();\n\t\tsstorageTotalAttribute.setAttributeType(AttributeType.TotalStorage);\n\t\tsstorageTotalAttribute.setValue(Double.parseDouble(clientStaticInfo\n\t\t\t\t.getSStorageInfo()));\n\t\tsstorageTotalAttribute.setDate(new Date());\n\t\tsstorageResource.addAttribute(sstorageTotalAttribute);\n\n\t\tresources.add(sstorageResource);\n\n\t\treturn resources;\n\t}",
"public ArrayList<Resource> getDynamicInfo() {\n\t\tArrayList<Resource> resources = new ArrayList<Resource>();\n\t\t// ~~~ CPU\n\t\tResource cpuResource = new Resource();\n\t\tcpuResource.setResourceType(ResourceType.CPU);\n\t\tcpuResource.setName(clientDynamicInfo.getCPUVendor() + \" CPU\");\n\n\t\tAttribute cpuUtilizationAttribute = new Attribute();\n\t\tcpuUtilizationAttribute.setAttributeType(AttributeType.CPUUtilization);\n\t\tcpuUtilizationAttribute.setValue(Double.parseDouble(clientDynamicInfo\n\t\t\t\t.getCPUUsage()));\n\t\tcpuUtilizationAttribute.setDate(new Date());\n\t\tcpuResource.addAttribute(cpuUtilizationAttribute);\n\n\t\tresources.add(cpuResource);\n\t\t// ~~~ RAM\n\t\tResource ramResource = new Resource();\n\t\tramResource.setResourceType(ResourceType.RAM);\n\t\tramResource.setName(\"RAM\");\n\n\t\tAttribute ramFreeAttribute = new Attribute();\n\t\tramFreeAttribute.setAttributeType(AttributeType.FreeMemory);\n\t\tramFreeAttribute.setValue(Double.parseDouble(clientDynamicInfo\n\t\t\t\t.getRAMFreeInfo()));\n\n\t\tramResource.addAttribute(ramFreeAttribute);\n\n\t\tramFreeAttribute.setDate(new Date());\n\n\t\tAttribute ramUtilizationAttribute = new Attribute();\n\t\tramUtilizationAttribute\n\t\t\t\t.setAttributeType(AttributeType.MemoryUtilization);\n\t\tramUtilizationAttribute.setValue(Double.parseDouble(clientDynamicInfo\n\t\t\t\t.getRAMUtilizationInfo()));\n\t\tramResource.addAttribute(ramUtilizationAttribute);\n\n\t\tresources.add(ramResource);\n\t\t// ~~~ SStorage\n\t\tResource sstorageResource = new Resource();\n\t\tsstorageResource.setResourceType(ResourceType.SStorage);\n\t\tsstorageResource.setName(\"SSTORAGE\");\n\n\t\tAttribute sstorageFreeAttribute = new Attribute();\n\t\tsstorageFreeAttribute.setAttributeType(AttributeType.FreeStorage);\n\t\tsstorageFreeAttribute.setValue(Double.parseDouble(clientDynamicInfo\n\t\t\t\t.getSStorageFreeInfo()));\n\t\tsstorageFreeAttribute.setDate(new Date());\n\t\tsstorageResource.addAttribute(sstorageFreeAttribute);\n\n\t\tAttribute sstorageUtilizationAttribute = new Attribute();\n\t\tsstorageUtilizationAttribute\n\t\t\t\t.setAttributeType(AttributeType.StorageUtilization);\n\t\tsstorageUtilizationAttribute.setValue(Double\n\t\t\t\t.parseDouble(clientDynamicInfo.getSStorageUtilizationInfo()));\n\t\tsstorageUtilizationAttribute.setDate(new Date());\n\t\tsstorageResource.addAttribute(sstorageUtilizationAttribute);\n\n\t\tresources.add(sstorageResource);\n\n\t\treturn resources;\n\t}",
"int getResourceCost();",
"double getRate();",
"public Rate rate() {\n _initialize();\n return rate;\n }",
"private void calculateRates() {\n if (rateOutput == null || !outputs.containsKey(rateOutput)) throw new RuntimeException(\"Insufficient data to calculate recipe rates\");\n recipesPerMinute = productionRate / outputs.get(rateOutput);\n\n for (String resource : inputs.keySet()) {\n ratesPerMinute.put(resource,-1.0 * recipesPerMinute * inputs.get(resource));\n }\n for (String resource: outputs.keySet()) {\n ratesPerMinute.put(resource, recipesPerMinute * outputs.get(resource));\n }\n }",
"List<ResourceSkuCosts> costs();",
"protected abstract Double getRate(T object);",
"protected double getDataRate() {\n\t\treturn (double) getThroughput() / (double) getElapsedTime();\n\t}",
"private boolean generateCdr(){\n //TODO: split it into smaller methods\n Object usage;\n double charge;\n String from, to;\n String[] time;\n int indexUsage;\n ArrayList usageListArr, usageArr;\n ArrayList columnArr;\n UDRServiceClient udrClient = new UDRServiceClient();\n RateResource rateResource = new RateResource();\n ArrayList<ArrayList<Object>> objArr = new ArrayList<ArrayList<Object>>();\n Double rate;\n TSDBData tsdbData;\n boolean result;\n String userid;\n ArrayList<ResourceUsage> resourceUsageArray;\n HashMap tags;\n POJOUtil pojoUtil = new POJOUtil();\n\n DateTimeUtil dateTimeUtil = new DateTimeUtil();\n time = dateTimeUtil.getRange();\n\n from = time[1];\n to = time[0];\n for (int i = 0; i < enabledResourceList.size(); i++) {\n tsdbData = rateResource.getResourceRate(enabledResourceList.get(i).toString(), from, to);\n rate = calculateRate(tsdbData);\n resourceUsageArray = udrClient.getResourceUsageData(enabledResourceList.get(i).toString(), from, to);\n for (ResourceUsage resource : resourceUsageArray) {\n columnArr = resource.getColumn();\n\n usageListArr = resource.getUsage();\n tags = resource.getTags();\n //indexUserId = columnArr.indexOf(\"userid\");\n userid = tags.get(\"userId\").toString();\n //userid = userid.substring(0, userid.length());\n indexUsage = columnArr.indexOf(\"mean\");\n // The below if condition differentiates between the gauge and cumulative meters of openstack\n if (indexUsage < 0) {\n indexUsage = columnArr.indexOf(\"usage\");//usage if we are not using the sum in the sql else \"sum\"\n }\n // Iterate through the usage arraylist to extract the userid and usage.\n // Multiple the usage with the rate of the resource and save it into an arraylist\n for (int j = 0; j < usageListArr.size(); j++) {\n usageArr = (ArrayList) usageListArr.get(j);\n usage = usageArr.get(indexUsage);\n // Calculate the charge for a resource per user\n Double d = Double.parseDouble(usage.toString());\n charge = (d * rate);\n String resources = enabledResourceList.get(i).toString();\n objArr = pojoUtil.populateList(usageListArr, objArr, resources, userid, usage, charge);\n }\n }\n\n }\n // Save the charge array into the database\n result = savePrice(objArr);\n return result;\n }",
"public Resource takeResource( Resource.Type type, int amount );",
"private Type stealResource() {\n \t\tint count = getResourceCount();\n \t\tif (count <= 0)\n \t\t\treturn null;\n \n \t\t// pick random card\n \t\tint select = (int) (Math.random() * count);\n \t\tfor (int i = 0; i < resources.length; i++) {\n \t\t\tif (select < resources[i]) {\n \t\t\t\tuseResources(Type.values()[i], 1);\n \t\t\t\treturn Type.values()[i];\n \t\t\t}\n \n \t\t\tselect -= resources[i];\n \t\t}\n \n \t\treturn null;\n \t}",
"@Override\n\tpublic Double metricValue() {\n\t\tthis.totalSampleSize = (int) Math.min(MAX_FQURIS_PER_TLD, (Math.round((double) totalURIs * POPULATION_PERCENTAGE)));\n\t\tList<String> lstUrisToDeref = new ArrayList<String>(totalSampleSize);\t\n\n\t\t\n\t\tfor(Tld tld : this.tldsReservoir.getItems()){\n\t\t\t//Work out ratio for the number of maximum TLDs in Reservior\n//\t\t\tdouble totalRatio = ((double) tldCount.get(tld.getUri())) * POPULATION_PERCENTAGE; // ratio between the total number of URIs of a TLD in a dataset against the overall total number of URIs\n//\t\t\tdouble representativeRatio = totalRatio / ((double) totalURIs * POPULATION_PERCENTAGE); // the ratio of the URIs of a TLD against the population sample for all URIs in a dataset\n//\t\t\tlong maxRepresentativeSample = Math.round(representativeRatio * (double) MAX_FQURIS_PER_TLD); // how big should the final reservior for a TLD be wrt the representative ratio\n\t\t\t\n\t\t\tlong maxRepresentativeSample = Math.round(((double) this.totalSampleSize / (double) totalURIs) * ((double) tldCount.get(tld.getUri())));\n\t\t\t// Re-sample the sample to have the final representative sample\n\t\t\tif (maxRepresentativeSample > 0){\n\t\t\t\tReservoirSampler<String> _tmpRes = new ReservoirSampler<String>((int)maxRepresentativeSample, true);\n\t\t\t\n\t\t\t\tfor(String uri : tld.getfqUris().getItems()){\n\t\t\t\t\t_tmpRes.add(uri);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlstUrisToDeref.addAll(_tmpRes.getItems());\n\t\t\t}\n\t\t}\n\t\tdouble metricValue = 0.0;\n\t\t\n\t\tthis.totalNumberOfURIs = (lstUrisToDeref.size() + this.nonSemanticResources);\n\t\t\n\t\tthis.totalCorrectReportedTypes = this.checkForMisreportedContentType(lstUrisToDeref);\n\t\tmetricValue = (double)this.totalCorrectReportedTypes / this.totalNumberOfURIs;\n\t\t\n\t\treturn metricValue;\n\t}",
"Rate initRate(Rate iRate)\n {\n iRate.updateElementValue(\"Rate\");\n return iRate;\n }",
"private boolean generateRate() {\n TSDBData rateObj;\n boolean result = false;\n\n if (Flag.getMeteringType().equalsIgnoreCase(\"static\")) {\n rateObj = generateStaticRate();\n } else {\n rateObj = generateDynamicRate();\n }\n if (rateObj.getPoints().size() > 0)\n result = saveRate(rateObj);\n return result;\n }",
"@Override\r\n\tpublic FPGAResource getHardwareResourceUsage() {\r\n\t\tint lutCount = 0;\r\n\r\n\t\tValue inputValue = getDataPort().getValue();\r\n\t\tfor (int i = 0; i < inputValue.getSize(); i++) {\r\n\t\t\tBit inputBit = inputValue.getBit(i);\r\n\t\t\tif (!inputBit.isConstant() && inputBit.isCare()) {\r\n\t\t\t\tlutCount++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tFPGAResource hwResource = new FPGAResource();\r\n\t\thwResource.addLUT(lutCount);\r\n\r\n\t\treturn hwResource;\r\n\t}",
"public List<ScheduleResource> neededSpecificResources();",
"@Override\n public void decorate(Resource resource, DecoratorContext context) {\n if (ResourceUtils.isFile(resource)) {\n // Sonar API includes many libraries like commons-lang and google-collections\n double value = RandomUtils.nextDouble();\n\n // Add a measure to the current File\n context.saveMeasure(ExampleMetrics.RANDOM, value);\n\n } else {\n // we sum random values on resources different than file. Another option would be to declare a Formula on metric declaration\n context.saveMeasure(ExampleMetrics.RANDOM, MeasureUtils.sum(true, context.getChildrenMeasures(ExampleMetrics.RANDOM)));\n }\n }",
"public static Collection getCostingRates() throws EnvoyServletException\n {\n try\n {\n return ServerProxy.getCostingEngine().getRates();\n }\n catch (Exception e)\n {\n throw new EnvoyServletException(e);\n }\n }",
"public int getRate() {\n return rate_;\n }",
"public Integer getRate() {\r\n return rate;\r\n }",
"public RandomResource(int instances_) {\n super(instances_);\n stream = new UniformStream(0.0, 1.0);\n waitingList = new Vector();\n }",
"public double getRate() {\n return rate;\n }",
"public double getRate() {\n return rate;\n }",
"ResponseEntity<List<GenericRates>> getGenericRates();",
"public float getRate(){\r\n return rate;\r\n }",
"private void getRandom(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\tString rate = \"0\";\n\t\ttry {\n\t\t\tRandom random = new Random();\n\t\t\tlong contentId;\n\t\t\tnoticiasList.clear();\n\t\t\tint num = ContentDB.getNumContents();\n\t\t\tPrintWriter out = res.getWriter();\n\t\t\tLong userId = Long.parseLong(req.getParameter(Constants.USER_IDENTIFIER));\n\t\t\tfor (int k = Constants.NUM_RESULTS - 50; k < Constants.NUM_RESULTS; k++) {\n\t\t\t\tcontentId = (long) (random.nextDouble() * num);\n\t\t\t\twhile (ContentDB.getTitleOfContent(contentId) == \"\") {\n\t\t\t\t\tcontentId = (long) (random.nextDouble() * num);\n\t\t\t\t}\n\t\t\t\tif (myRecommender.getPreferenceValue(userId, contentId) != null)\n\t\t\t\t\trate = \"1\";\n\n\t\t\t\tNoticia not = new Noticia(Long.toString(contentId), ContentDB.getTitleOfContent(contentId),\n\t\t\t\t\t\tContentDB.getVideoOfContent(contentId), ContentDB.getCaptureOfContent(contentId),\n\t\t\t\t\t\tContentDB.getDateOfContent(contentId), ContentDB.getContent(contentId),\n\t\t\t\t\t\tContentDB.getAuthorOfContent(contentId), rate, \"\");\n\n\t\t\t\tnoticiasList.add(not);\n\n\t\t\t}\n\t\t\tconjunto = new Conjunto(noticiasList);\n\t\t\tString ans = (String) gson.toJson(conjunto).subSequence(12, gson.toJson(conjunto).length() - 1);\n\t\t\tout.print(ans);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void setRate(int rate) { this.rate = rate; }",
"public float getRate() {\n\treturn durationStretch * nominalRate;\n }",
"void maritimeTrade(int ratio, String inputResource, String outResource);",
"public int getRate() {\n return rate_;\n }",
"public int getCustomInformationTransferRate();",
"public double getRate() {\n\t\treturn rate;\n\t}",
"@GetMapping(value = \"/{id}\", produces = MediaType.APPLICATION_JSON_VALUE)\n @PreAuthorize(value = \"isAuthenticated()\")\n public Rate getRateById(@PathVariable(name = \"id\", required = true) long id, HttpServletRequest request) throws Exception {\n return rateService.getRate(id);\n }",
"public static double genRandomRestPeriod() {\n return Simulator.randomGenerator.genRestPeriod();\n }",
"private void prepareRates() {\n // set the Currency as GBP (symbol) which is applicable in all rates\n Currency gbp = Currency.getInstance(\"GBP\");\n rates.add(new Rate(\"Morning\", gbp, 15d, LocalTime.of(5, 0), LocalTime.of(10, 0)));\n rates.add(new Rate(\"Evening\", gbp, 18d, LocalTime.of(16, 30), LocalTime.of(20, 0)));\n rates.add(new Rate(\"Night\", gbp, 20d, LocalTime.of(20, 0), LocalTime.of(23, 0)));\n rates.add(new Rate(\"Default\", gbp, 10d, null, null));\n }",
"public void setRate();",
"public int getTradeRate(ResourceType resourceType) {\n\t\treturn playerPieces.getTradeRate(resourceType);\n\t}",
"@Override\n\tpublic double getRate() {\n\t\treturn 7;\n\t}",
"@Scheduled(fixedRate = 8 * 1000 * 60 * 60)\n private void getRatesTask() {\n try {\n RestTemplate restTemplate = new RestTemplate();\n CurrencyDTO forObject = restTemplate.getForObject(fixerIoApiKey, CurrencyDTO.class);\n forObject.getRates().forEach((key, value) -> {\n Currency currency = new Currency(key, value);\n this.currencyRepository.save(currency);\n });\n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n }\n }",
"public double getRate() {\r\n\t\treturn (getRate(0)+getRate(1))/2.0;\r\n\t}",
"Optional<CompletableFuture<List<ResourceModel>>> generateResource(ResourceModel resource) throws IllegalIDException;",
"public int getStarvationRate ( ) {\n\t\treturn extract ( handle -> handle.getStarvationRate ( ) );\n\t}",
"@Override\r\n\tpublic void increaseDomesticTradeResourceAmount(ResourceType resource) {\n\t\t\r\n\t}",
"public double getRate( ) {\nreturn monthlyInterestRate * 100.0 * MONTHS;\n}",
"public int getChargeRate();",
"double requestCurrentRate(String fromCurrency,\n String toCurrency);",
"@Override\n public ObtainableResourceSet deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {\n JsonObject jsonObtainedResourceSet = json.getAsJsonObject();\n\n /* ----------------------------------------------------------------------------\n * Step 1: deserialize \"static\" resources, the ones that don't get multiplied\n * They are represented as a HashMap<ObtainableResource, Integer>\n * ----------------------------------------------------------------------------\n */\n\n /*\n * Create an intermediate object that\n * can be deserialized automatically as a HashMap<ObtainableResource, Integer>\n */\n JsonObject jsonStaticResourcesObject = new JsonObject();\n\n /*\n * Cycle on the types of static resources\n */\n for (ObtainableResource obtainableResource : ObtainableResource.values()) {\n // Get the number of resources of the current type\n JsonElement jsonObtainedResource = jsonObtainedResourceSet.get(obtainableResource.name());\n if (jsonObtainedResource != null) {\n int nObtained = jsonObtainedResource.getAsInt();\n jsonStaticResourcesObject.addProperty(obtainableResource.name(), nObtained);\n }\n }\n\n Type staticResourcesType = new TypeToken<HashMap<ObtainableResource, Integer>>() {\n }.getType();\n HashMap<ObtainableResource, Integer> staticResources = context.deserialize(jsonStaticResourcesObject, staticResourcesType);\n\n /* ----------------------------------------------------------------------------\n * Step 2: deserialize resources with multipliers\n * They are represented as a HashMap<RequiredResourceSet, Tuple<ObtainableResourceSet, Integer>>,\n * meaning the player gets Integer ObtainedResourceSets for each RequiredResourceSet he/she has\n * ----------------------------------------------------------------------------\n */\n HashMap<RequiredResourceSet, ObtainableResourceSet> multiplierResources = new HashMap<>();\n JsonArray jsonMultiplierResourcesArray = jsonObtainedResourceSet.getAsJsonArray(\"multipliers\");\n if (jsonMultiplierResourcesArray != null) {\n for (JsonElement jsonMultiplier : jsonMultiplierResourcesArray) {\n JsonObject jsonRequirements = jsonMultiplier.getAsJsonObject().getAsJsonObject(\"requirements\");\n JsonObject jsonResources = jsonMultiplier.getAsJsonObject().getAsJsonObject(\"resources\");\n\n RequiredResourceSet requirements = context.deserialize(jsonRequirements, RequiredResourceSet.class);\n ObtainableResourceSet resources = context.deserialize(jsonResources, ObtainableResourceSet.class);\n\n multiplierResources.put(requirements, resources);\n }\n }\n\n return new ObtainableResourceSet(staticResources, multiplierResources);\n }",
"public int get_resource_distance() {\n return 1;\r\n }",
"@Override\n\tvoid get_cost_per_sqarefeet() {\n\t\tcost=1800;\n\t}",
"@Override\r\n\tpublic void makeMaritimeTrade(ResourceType giveResource, ResourceType getResource, int ratio) {\n\t\t\r\n\t}",
"public ResourceInfoObject(ConcurrentHashMap<Integer, ArrayList<Double>> resourceInfo) {\n this.resourceInfo = resourceInfo;\n }",
"double getTransRate();",
"public float getRate() {\n\t\treturn rate;\n\t}",
"private static int chargeRate(Thing b, Thing s) {\n \t\tint rate=b.getStat(\"WP\");\r\n \t\t\r\n \t\t// bonus for appropraite recharge skill\r\n \t\trate=rate*(1+b.getStat(rechargeSkill(s)));\r\n \t\t\r\n \t\t// spell specific charge rate\r\n \t\t// default is 100\r\n \t\trate=(rate*s.getStat(\"ChargeRate\"));\r\n \t\t\r\n \t\t// more costly spells take longer to recharge\r\n \t\trate=rate/s.getStat(\"SpellCost\");\r\n \t\t\r\n \t\tif (rate<=0) {\r\n \t\t\tGame.warn(\"Spell.chargeRate(...)==0 for \"+s.name());\r\n \t\t}\r\n \t\t\r\n \t\treturn rate;\r\n \t}",
"static void populateDB() {\n initializeJSON();\n JSONArray thisArray = new JSONArray(getRateString());\n JSONObject desiredObject = thisArray.getJSONObject(0);\n Iterator<String> keyList = desiredObject.keys();\n\n CurrencyInterface dbConn = new DatabaseConnection();\n while (keyList.hasNext()) {\n String abbrev = keyList.next().toString();\n Object actualRates = desiredObject.get(abbrev);\n String actualRateStr = actualRates.toString();\n double rate = Double.parseDouble(actualRateStr);\n rate = 1/rate;\n // ^ actualRates produces an Integer object, can't cast directly to a Double\n // Also inverting value since values are given as USD/x where my calculations are x/USD.\n dbConn.saveCurrency(new Currency(abbrev, rate));\n }\n }",
"public ArrayList<ResourceType> calculateResourceTypeSimilarity(String requestedResourceTypeName){\r\n\t\tArrayList<ResourceType> resourceTypeArray = new ArrayList<ResourceType>();\r\n\t\tResourceType resourceType;\r\n\t\tArrayList<ResourceType> resourceTypeSimilarityArray = new ArrayList<ResourceType>();\r\n\r\n\t\t//get resource type information contents\r\n\t\tString line1;\r\n\t String line2;\r\n\t String line3;\r\n\t\tFile file = new File(\"D:/Workspace_J2EE/SECoG/Data/ResourceType/ResourceTypeInformationContents.txt\");\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(file))) {\r\n\t\t while ((line1 = br.readLine()) != null) {\r\n\t\t \tline2 = br.readLine();\r\n\t\t \tline3 = br.readLine();\r\n\t\t \tresourceType = new ResourceType(line1, line2, Float.parseFloat(line3));\r\n\t\t \t//System.out.println(\"line1,2,3 is: \" + line1 + \", \" + line2 + \", \" + line3);\r\n\t\t \t\r\n\t\t \tresourceTypeArray.add(resourceType);\r\n\t\t }\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t//get requested resource type index\r\n\t\tint requestedResourceTypeIndex = 0;\r\n\t\tfor(int i=1; i<resourceTypeArray.size(); i++){\r\n\t\t\t//System.out.println(resourceTypeArray.get(i).name);\r\n\t\t\tif(requestedResourceTypeName.equals(resourceTypeArray.get(i).name)){\r\n\t\t\t\trequestedResourceTypeIndex = i;\r\n\t\t\t\t//System.out.println(\"The requestedResourceTypeIndex is: \" + requestedResourceTypeIndex);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//calculate resource type similarity\r\n\t\tfor(int i=1; i<resourceTypeArray.size(); i++){\r\n\t\t\t//System.out.println(\"Comparison object is: \" + resourceTypeArray.get(i).name);\r\n\t\t\t/*if(i==requestedResourceTypeIndex){\r\n\t\t\t\tcontinue;\r\n\t\t\t}*/\r\n\t\t\t//System.out.println(\"Comparison object hierarchy is: \" + resourceTypeArray.get(i).hierarchy);\r\n\t\t\t\r\n\t\t\t//get nearest common parent node\r\n\t\t\tString requestedHierarchy = resourceTypeArray.get(requestedResourceTypeIndex).hierarchy;\r\n\t\t\tString currentHierarchy = resourceTypeArray.get(i).hierarchy;\r\n\t\t\tString commonParentHierchary = \"\";\r\n\t\t\t\r\n\t\t\tfor(int j=1; j<=Math.min(requestedHierarchy.length(), currentHierarchy.length()); j++){\r\n\t\t\t\tString subRequest = requestedHierarchy.substring(0, j);\r\n\t\t\t\tString subCurrent = currentHierarchy.substring(0, j);\r\n\t\t\t\t\r\n\t\t\t\tif(!subRequest.equals(subCurrent)){\r\n\t\t\t\t\tcommonParentHierchary = requestedHierarchy.substring(0, j-1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}else if(j == Math.min(requestedHierarchy.length(),currentHierarchy.length())){\r\n\t\t\t\t\tcommonParentHierchary = requestedHierarchy.substring(0, j);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//System.out.println(\"commonParentHierchary is: \" + commonParentHierchary);\r\n\t\t\t\r\n\t\t\t//get the similarity\r\n\t\t\tResourceType resourceTypeSimilarity;\r\n\t\t\tfor(int m=0; m<resourceTypeArray.size(); m++){\r\n\t\t\t\tcurrentHierarchy = resourceTypeArray.get(m).hierarchy;\r\n\t\t\t\t//System.out.println(\"current hierarchy is: \" + currentHierarchy);\r\n\t\t\t\t\r\n\t\t\t\tif(currentHierarchy.equals(commonParentHierchary)){\r\n\t\t\t\t\tresourceTypeSimilarity = new ResourceType(resourceTypeArray.get(i).name, resourceTypeArray.get(i).hierarchy, resourceTypeArray.get(m).informationContent);\r\n\t\t\t\t\t//System.out.println(\"currentSimilarity is: \" + currentSimilarity);\r\n\t\t\t\t\t\r\n\t\t\t\t\tresourceTypeSimilarityArray.add(resourceTypeSimilarity);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn resourceTypeSimilarityArray;\t\t\r\n\t}",
"private void add(EResource resource) {\n switch (resource) {\n case BRICK:\n brick++;\n break;\n case GRAIN:\n grain++;\n break;\n case LUMBER:\n lumber++;\n break;\n case ORE:\n ore++;\n break;\n case WOOL:\n wool++;\n break;\n }\n }",
"@Override\r\n\tpublic void increaseAmount(ResourceType resource) {\n\t\t\r\n\t}",
"public int getSamplingRate( ) {\r\n return samplingRate;\r\n }",
"public void addResources(Type type, int count) {\n \t\tresources[type.ordinal()] += count;\n \t}",
"public int getRate() {\r\n return Integer.parseInt(RATES[Rate]);\r\n }",
"double calculateRate(Temperature temperature, double Hrxn);",
"public int getResourceCount() {\n \t\tint sum = 0;\n \t\tfor (int i = 0; i < resources.length; i++)\n \t\t\tsum += resources[i];\n \t\treturn sum;\n \t}",
"public void create_dataset(double sampling_rate, double freq, int n) {\n double amplitude = 10.0d;\n double constant = freq/sampling_rate*2.0d*Math.PI;\n double sumTWD=0.0d;\n\n for (int i = 0; i < n; i++) {\n NavigationTools.TWD.add((Math.sin((double)i*constant)+Math.random()*0.2d)*amplitude);\n sumTWD += NavigationTools.TWD.getLast();\n }\n\n NavigationTools.TWD_longAVG=sumTWD/(double)n;\n }",
"public RateModel(final String iCurrency, final Double iRate, final Integer iSource) {\n this.name = iCurrency;\n this.rate = iRate;\n this.source = iSource;\n this.time = new Date();\n }",
"public String getAdaptiveRateAlgorithm();",
"double getCost();",
"double getCost();",
"ResponseEntity<List<TOURates>> getTouRates();",
"SwSchedulableResource createSwSchedulableResource();",
"private void fetchRatesData() {\r\n RequesterBean requesterBean = new RequesterBean();\r\n requesterBean.setFunctionType(GET_RATE_DATA);\r\n requesterBean.setDataObject(instituteRatesBean);\r\n \r\n AppletServletCommunicator appletServletCommunicator = new \r\n AppletServletCommunicator(CONNECTION_STRING, requesterBean);\r\n appletServletCommunicator.setRequest(requesterBean);\r\n appletServletCommunicator.send();\r\n ResponderBean responderBean = appletServletCommunicator.getResponse();\r\n \r\n if(responderBean == null) {\r\n //Could not contact server.\r\n CoeusOptionPane.showErrorDialog(COULD_NOT_CONTACT_SERVER);\r\n return;\r\n }\r\n \r\n if(responderBean.isSuccessfulResponse()) {\r\n Hashtable ratesData = (Hashtable)responderBean.getDataObject();\r\n hasMaintainCodeTablesRt = ((Boolean)ratesData.get(\"HAS_OSP_RIGHT\")).booleanValue();\r\n if( hasMaintainCodeTablesRt ){\r\n setFunctionType(TypeConstants.MODIFY_MODE);\r\n }else {\r\n setFunctionType(TypeConstants.DISPLAY_MODE);\r\n }\r\n //queryKey = RATES + ratesData.get(\"PARENT_UNIT_NUMBER\").toString();\r\n\r\n //Set title\r\n dlgRates.setTitle(RATES + \" for Unit \" + instituteRatesBean.getUnitNumber());\r\n queryEngine.addDataCollection(queryKey, ratesData);\r\n\r\n }else {\r\n //Server Error\r\n CoeusOptionPane.showErrorDialog(responderBean.getMessage());\r\n return;\r\n }\r\n }",
"public abstract double getDiscountRate();",
"public IShippingRate getRateObject();",
"public Long get_cacheparameterizedrequestsrate() throws Exception {\n\t\treturn this.cacheparameterizedrequestsrate;\n\t}",
"protected abstract double getDefaultCost();",
"@Override\n\tpublic double calculateRate(int distance, double weight) {\n\t\tdouble rate = 0;\n\t\tif (weight >= 0 && weight <= 2) {\n\t\t\trate = 0.0020;\n\t\t\trate = rate * distance;\n\n\t\t} else if (weight >= 3 && weight <= 8) {\n\t\t\trate = 0.0022;\n\t\t\trate = rate * distance;\n\t\t} else if (weight >= 9 && weight <= 15) {\n\t\t\trate = 0.0024;\n\t\t\treturn rate * distance;\n\t\t}\n\t\tif (weight >= 1*16 && weight <= 3*16) {\n\t\t\trate = 0.0150 * distance;\n\t\t} else if (weight >= 4*16 && weight <= 8*16) {\n\t\t\trate = 0.0160 * distance;\n\t\t} else if (weight >= 9 * 16) {\n\t\t\trate = 0.0170 * distance;\n\t\t}\n\n\t\treturn rate;\n\t}",
"public IResourceDepot createResourceDepot() {\n\n /*\n * Defining a ResourceDepot \"JackTruckDepot\" that can store DeliverGood and PickupGood.\n *\n */\n\n // We can store a maximum of 10 DeliverGood on our track (assuming that no other load is\n // present)\n // Further, we start with an initial load of 5 DeliverGoods.\n ILoadCapacity deliverGoodCapacity = new SimpleLoadCapacity(\"DeliverGood\", 10, 5);\n\n // We can store a maximum of 5 PickupGood on our track (assuming that no other load is present)\n ILoadCapacity pickupGoodCapacity = new SimpleLoadCapacity(\"PickupGood\", 5, 0);\n\n // Our depot can store a maximum of 10 total items. For example, 7 DeliverGoods\n // and 3 PickupGoods.\n IResourceDepot depot = new SimpleResourceDepot(\"JackTruckDepot\", 10);\n\n // Adding the capacities to our depot\n depot.add(deliverGoodCapacity);\n depot.add(pickupGoodCapacity);\n\n return depot;\n }",
"private void calculeStatAdd() {\n resourceA = this.getContext().getGame().getPlayer(idPlayer).getInventory().getValueRessource(type);\n int win = resourceA - resourceB;\n int diff = (resourceB - resourceA) + value;\n this.getContext().getStats().incNbRessourceWinPlayers(idPlayer,type,win);\n this.getContext().getStats().incNbRessourceExtendMaxPlayers(idPlayer,type,diff);\n }",
"ResponseEntity<List<TieredRates>> getTieredRates();",
"public int getSamplingRate() {\n return samplingRate;\n }",
"@PostConstruct\n private void myInit() {\n freshRates = rm.getLastRates(FRESH_AMOUNT);\n }",
"@Override\n public Double calculateRatio(String base, String dest) throws Exception {\n if (base == null || dest == null) {\n throw new NullInputException();\n }\n try {\n HttpClient client = HttpClient.newHttpClient();\n String url = String.format(urlFormat, host, base);\n HttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(url))\n .version(HttpClient.Version.HTTP_1_1)\n .GET()\n .build();\n HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n JSONObject jsObject = new JSONObject(response.body());\n JSONObject rates = jsObject.getJSONObject(\"rates\");\n\n return Double.parseDouble(rates.get(dest).toString());\n } catch (JSONException e) {\n throw new Exception(String.format(\"Failed to find currency id: %s\", dest), e);\n } catch (IOException | InterruptedException e) {\n throw new Exception(\"Failed to convert the currencies. Please try again later.\", e);\n }\n\n }",
"@Override\r\n\tpublic void handleRequest(ResourceVisualizationFactory rvf, ChartParameters params) {\r\n\t\tList<ResourceProperty> result = new ArrayList<ResourceProperty>();\r\n\t\ttry {\r\n\t\t\tString colorValue = retrieveValue(key, params);\r\n\t\t\tif(colorValue.matches(\"r[0-9]{1,3}g[0-9]{1,3}b[0-9]{1,3}\")){\r\n\t\t\t\tList<String> rgb = retrieveValues(colorValue,\"[rgb]\");\r\n\t\t\t\tfor(String rgbString: rgb) {\r\n\t\t\t\t\tint rgbValue = Integer.parseInt(rgbString);\r\n\t\t\t\t\tConstantResourceProperty resourcePropery = new ConstantResourceProperty(rgbValue);\r\n\t\t\t\t\tresult.add(resourcePropery);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(colorValue.matches(\"min[0-9]+(\\\\.[0-9]+)*max[0-9]+(\\\\.[0-9]+)*key(.)+\")) {\r\n\t\t\t\tSystem.out.println(colorValue);\r\n\t\t\t\tList<String> gs = retrieveValues(colorValue,\"(min|max|key)\");\r\n\t\t\t\tSystem.out.println(gs);\r\n\t\t\t\tString gsString1 = gs.get(0);\r\n\t\t\t\tfloat gsValue1 = Float.parseFloat(gsString1);\r\n\t\t\t\tString gsString2 = gs.get(1);\r\n\t\t\t\tfloat gsValue2 = Float.parseFloat(gsString2);\r\n\r\n\t\t\t\tString gsKey = gs.get(2);\r\n\t\t\t\tMetric gsMetric = sf.findMetric(gsKey);\r\n\t\t\t\tif(gsMetric == null){\r\n\t\t\t\t\tthrow new NoResultException(\"Grayscale metric not found\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tResourceProperty rp = new ScaledResourceProperty(gsValue1, gsValue2, 255, 0, sf, gsMetric);\r\n\r\n\t\t\t\tfor(int i=0;i<3;++i){\r\n\t\t\t\t\tresult.add(rp);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse throw new NoResultException(\"Color not recognized\");\r\n\t\t}\r\n\t\tcatch(NoResultException e) {\r\n\t\t\tLOG.info(\"retrieve color value failed, setting defaults\");\r\n\t\t\tfor(int i=0;i<3;++i){\r\n\t\t\t\tresult.add(DEFAULT_COLOR);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t((BoxFactory) rvf).setRedProperty(result.get(0));\r\n\t\t((BoxFactory) rvf).setGreenProperty(result.get(1));\r\n\t\t((BoxFactory) rvf).setBlueProperty(result.get(2));\r\n\t\t\r\n\t\tif(next != null) {\r\n\t\t\tnext.handleRequest(rvf, params);\r\n\t\t}\r\n\r\n\t}",
"public int getThisDataRate(){\r\n\t\tString option = (String) comboBox.getSelectedItem();\r\n\t\tif (option.equals(\"250kbs\")){\r\n\t\t\tdataRate = 0;\r\n\t\t}else if(option.equals(\"1mbs\")){\r\n\t\t\tdataRate = 1;\r\n\t\t}else{\r\n\t\t\tdataRate = 2;\r\n\t\t}\r\n\t\treturn dataRate;\r\n\t}",
"@Override\n\tpublic Money hourlyCostRate() {\n\t\treturn costRate().hourly();\n\t}",
"public static ArrayList<Integer> getRates(){\n\t\treturn heartRates;\n\t}",
"public Gps_dataResource() {\n }",
"public int getSessionCreateRate();",
"@Override\n\tpublic double calRate() {\n\t\treturn 0.9f;\n\t}",
"double getRating();",
"private HashMap<String, Integer> getProducedResources() {\n HashMap<String, Integer> producedResources = new HashMap<>();\n\n // Ajoute à la liste des ressources produites par le joueur la ressource produite par la merveille\n producedResources.merge(wonder.getWonderResource().toString(), 1, Integer::sum);\n\n // Parcourt toutes les constructions afin de compte les ressources produites par les constructions\n for (Card card: buildings) {\n Iterator iterator = card.getProducedResources().entrySet().iterator();\n\n while (iterator.hasNext()) {\n Map.Entry pair = (Map.Entry)iterator.next();\n\n // Si la ressource produite n'est pas une pièce, on l'ajoute à la liste des ressources produites\n if (!pair.getKey().equals(\"COIN\")) {\n producedResources.merge((String)pair.getKey(), (Integer)pair.getValue(), Integer::sum);\n }\n\n iterator.remove();\n }\n }\n\n return producedResources;\n }",
"public RandomResource(int instances_, long mgSeed_, long lcgSeed_) {\n super(instances_);\n stream = new UniformStream(0.0, 1.0, 0, mgSeed_, lcgSeed_);\n waitingList = new Vector();\n }",
"public abstract void setRate();",
"@Override\n public int getResourceCount() {\n for (Employee employee: employeesList){\n this.resourceCount += employee.getResourceCount();\n }\n return this.resourceCount+1;\n }",
"@ApiModelProperty(value = \"Rates that will be applied during the duration of the car rental requested. These rates are generally not inclusive of tax and are used by the car rental company to compute the total cost at the end of the rental period.\")\n public List<Rate> getRates() {\n return rates;\n }"
] | [
"0.6976638",
"0.6695883",
"0.6236558",
"0.61495876",
"0.6037755",
"0.5769019",
"0.5678333",
"0.56382906",
"0.5637266",
"0.55735075",
"0.5421919",
"0.54046243",
"0.54033893",
"0.5353337",
"0.52967155",
"0.52960384",
"0.5291717",
"0.516319",
"0.51128113",
"0.50240284",
"0.4993867",
"0.49728736",
"0.49492127",
"0.49440983",
"0.49071798",
"0.4876528",
"0.48749182",
"0.48749182",
"0.4858868",
"0.48583227",
"0.48519957",
"0.48484495",
"0.48414522",
"0.48266903",
"0.4823548",
"0.4815546",
"0.47911602",
"0.4775591",
"0.4768971",
"0.4756157",
"0.4752931",
"0.47431365",
"0.47271314",
"0.47270268",
"0.47267893",
"0.47038418",
"0.468921",
"0.46853754",
"0.4672259",
"0.4670644",
"0.46672976",
"0.46663547",
"0.46564874",
"0.46439955",
"0.4627637",
"0.46273398",
"0.4625667",
"0.46200463",
"0.4609329",
"0.46085346",
"0.46076468",
"0.45998564",
"0.45993546",
"0.45945692",
"0.45852354",
"0.45843142",
"0.4576742",
"0.45731527",
"0.45605758",
"0.45590812",
"0.4550086",
"0.4549329",
"0.4549329",
"0.45488286",
"0.45469",
"0.45464116",
"0.4538635",
"0.45377168",
"0.45353243",
"0.45336938",
"0.45293134",
"0.4526229",
"0.45206958",
"0.4515391",
"0.45144624",
"0.4506968",
"0.45065743",
"0.45032448",
"0.45027986",
"0.4497101",
"0.4483309",
"0.4481862",
"0.44805112",
"0.44793573",
"0.4479046",
"0.44682837",
"0.44656897",
"0.44522837",
"0.4445486",
"0.44427294"
] | 0.7956629 | 0 |
Generates the dynamic rate for a resource Pseudo Code 1. For every resources, create a rate through a random function with the value between a range. | private TSDBData generateDynamicRate() {
//TODO: replace with single method generateRate and parameter (static, dynamic)
double rate;
Random rateGenerator = new Random();
TSDBData rateData = new TSDBData();
ArrayList<String> strArr = null;
ArrayList<Object> objArrNode;
ArrayList<ArrayList<Object>> objArr = new ArrayList<ArrayList<Object>>();
// Iterate through the list and generate the rate for each enabled meters
for (int k = 0; k < enabledResourceList.size(); k++) {
//rate = getDynamicRate(enabledResourceList.get(k).toString());
rate = rateGenerator.nextInt((3 - 1) + 1) + 1;
strArr = StringUtil.strArr("resource", "rate", "rate_policy");
//strArr.add("resource");
//strArr.add("rate");
//strArr.add("rate_policy");
objArrNode = new ArrayList<Object>();
objArrNode.add(enabledResourceList.get(k));
objArrNode.add(rate);
objArrNode.add(Flag.getMeteringType());
objArr.add(objArrNode);
}
rateData.setName("rate");
rateData.setColumns(strArr);
rateData.setPoints(objArr);
return rateData;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private double genMultiplier() {\n return (random.nextInt(81) + 60)/100.0;\n }",
"private TSDBData generateStaticRate() {\n //TODO: check if there is generic method to to return rateData\n ArrayList<String> strArr = StringUtil.strArr(\"resource\", \"rate\", \"rate_policy\");\n TSDBData rateData = createPOJOObject(\"rate\", strArr, load.getStaticRate());\n return rateData;\n }",
"float genChance();",
"private static int addRandomScore() {\n Random ran = new Random();\n return ran.nextInt(201) + 400;\n }",
"private double getDynamicRate(String resourceName) {\n logger.trace(\"BEGIN double getDynamicRate(String resourceName)\");\n double rate;\n RateEngineResponse response;\n RuleEngineClient client = new RuleEngineClient();\n\n response = client.getRate(resourceName);\n rate = response.getRate();\n //System.out.println(\"Got the response from rule engine. Rate: \" + response.getRate());\n logger.trace(\"END double getDynamicRate(String resourceName)\");\n return rate;\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 }",
"public static double genRandomRestPeriod() {\n return Simulator.randomGenerator.genRestPeriod();\n }",
"public int generateStrength() {\n\t\tRandom rand = new Random();\n\t\tint strength = rand.nextInt(41) - 10;\n\t\treturn strength;\n\t}",
"private static double randomGenerator(double min, double max) {\n return (double)java.lang.Math.random() * (max - min +1) + min;\n }",
"public static double getRandomRating() {\n return (double) (RandomNumberGenerator.getRandomInt(0, 10) / 2d);\n }",
"com.yandex.ydb.rate_limiter.Resource getResource();",
"private void setRand(){\n rand = generator.nextInt(9) + 1;\n }",
"private double getRandom() {\n return 2*Math.random() - 1;\n }",
"private int randomWeight()\n {\n return dice.nextInt(1000000);\n }",
"double getRate();",
"public double getRandom() {\n return 20*Math.random() - 10;\n }",
"public static int customRandom(int range)\n {\n \tint random = (int)(Math.random()*10)%range;\n\t\n\treturn random;\n }",
"private int newSpeed() {\n //makes a random speed for the ball in (-50,-15)U(15,50)\n int n = r.nextInt(71) - 35;\n if (n < 0) {\n n = n - 15;\n } else {\n n = n + 15;\n }\n return n;\n }",
"public double GenerateTime() {\r\n double d = R.nextDouble();\r\n double generatedtime=mean+range*(d-0.5);\r\n return generatedtime;\r\n }",
"public static double random() {\r\n return uniform();\r\n }",
"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 int generatePolicyNum(){\n\t\tRandom rnd = new Random();\n\t\tint polNum = rnd.nextInt(899999) + 100000; \t\n\t\t\n\t\treturn polNum;\t\t\t\n\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 int getRandom() {\n int k = 1;\n ListNode node = this.head;\n int i = 0;\n ArrayList<Integer> reservoir = new ArrayList<Integer>();\n //先把前k个放进水塘\n while (i < k && node != null) {\n reservoir.add(node.val);\n node = node.next;\n i++;\n }\n // i++; // i == k => i == k+1 这样i就代表了现在已经处理过的总共数字个位\n i = 1;\n while (node != null) {\n //更换水塘里的数字的概率要是 k/(现在处理过的数字总数),所以因为i是从0开始,所以概率为从0\n // 到i的数当中选0 到k-1的数字,rand.nextInt(i) < k的概率是k/(现在处理过的数字总数)\n if (rand.nextInt(k+i) == i) {\n reservoir.set(rand.nextInt(k), node.val);\n }\n i++;\n node = node.next;\n }\n return reservoir.get(0);// or return reservoir when k > 1;\n }",
"public int dmg(){\r\n dmg = rand.nextInt(att);\r\n if(att == 1)\r\n dmg = 1;\r\n return dmg;\r\n }",
"int getRandom(int max);",
"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}",
"public int presetTriageNumber() {\r\n\t\tint triageRating = 0;\r\n\t\tint triageGenerator = random.nextInt(4);\r\n\t\tswitch (triageGenerator) {\r\n\t\tcase 0:\r\n\t\t\ttriageRating = 1;\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t\ttriageRating = 2;\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\ttriageRating = 3;\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\ttriageRating = 4;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn triageRating;\r\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}",
"Multiplication createRandomMultiplication();",
"Multiplication createRandomMultiplication();",
"private double generateRandomValue(int min, int max) {\n\t\tdouble number = (Math.random() * max * 100) / 100 + min;\n\t\treturn number;\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 }",
"public void generatePriority() {\n\t\tpriority = .25 * frequency + .25 * age + .25 * links + .25 * money;\n\t}",
"public RandomResource(int instances_) {\n super(instances_);\n stream = new UniformStream(0.0, 1.0);\n waitingList = new Vector();\n }",
"public abstract int getRandomDamage();",
"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 }",
"@Override\n public int orinar() {\n\n return (int) (Math.random() * 400) + 400;\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 int getRandomAmount(){\n return rand.nextInt(1000);\n }",
"public static int getRandomBalance(){\n return rand.nextInt(1000000);\n }",
"private int randomAge() {\n \tint low = 18;\n \tint high = 100;\n \tint offset = high - low;\n \tRandom r = new Random();\n \treturn r.nextInt(offset) + low;\n \t\n }",
"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}",
"public Rate rate() {\n _initialize();\n return rate;\n }",
"public void setRate(int rate) { this.rate = rate; }",
"private void random() {\n\n\t}",
"public synchronized int setPassengerWeight(){\n return random.nextInt((100-40)+1)+40;\n }",
"public static int getRndSalary() {\n return ThreadLocalRandom.current().nextInt(10, 100000 + 1);\n }",
"private int RandomResourceValue(int playerNumber) {\n\t\tArrayList<Integer> excludedNumbers = new ArrayList<>();\n\t\tfor (int i = 0; i < CurrentPlayer.resources.length; i++) {\n\t\t\tif (robberPlayers.get(playerNumber).resources[i] == 0)\n\t\t\t\texcludedNumbers.add(i);\n\t\t}\n\t\tRandom r = new Random();\n\t\tint randomVariable = 0;\n\t\trandomVariable = r.nextInt(5 - 0) + 0;\n\n\t\tif (excludedNumbers.size() < 5) {\n\t\t\twhile (excludedNumbers.contains(randomVariable)) {\n\t\t\t\trandomVariable = r.nextInt(5 - 0) + 0;\n\t\t\t}\n\t\t}\n\t\treturn randomVariable;\n\t}",
"public static int randomNext() { return 0; }",
"Randomizer getRandomizer();",
"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 int genRandomWaveNum(int min, int max){\n int m = genRandomInt(min, max);\n return m;\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 int randomGenerator(int min, int max) {\n int random = (int) ((Math.random()*((max-min)+1))+min);\n return random;\n }",
"public void updateRate(double r){\r\n rate *= r;\r\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 }",
"public void rollRandom() {\n\t\tthis.strength = randomWithRange();\r\n\t\tthis.wisdom = randomWithRange();\r\n\t\tthis.dexterity = randomWithRange();\r\n\t\tthis.constitution = randomWithRange();\r\n\t\tthis.intelligence = randomWithRange();\r\n\t\tthis.charisma = randomWithRange();\r\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 }",
"public void setRate();",
"public synchronized int setLuggageWeight(){\n return random.nextInt((30-0)+1)+0;\n }",
"public abstract double getGen(int i);",
"public void generate(int i) {\n\t\n if(i == 1) next += generateCoins();\n else if(i == 2) next += generateQuestionBox();\n else if(i == 3) next += generateWall();\n\n next += 400;\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 }",
"@Override\n\tpublic void makeDecision() {\n\t\tint powerMax = (int)(initPower) / 100;\n\t\tint powerMin = (int)(initPower * 0.3) / 100;\n\n\t\t// The value is calculated randomly from 0 to 10% of the initial power\n\t\tRandom rand = new Random();\n\t\tint actualPower = rand.nextInt((powerMax - powerMin) + 1) + powerMin;\n\t\tanswer.setConsumption(actualPower);\n\t}",
"public int randomDP() {\n\t\treturn(getRandomInteger(10,250));\n\t}",
"public RandomResource(int instances_, long mgSeed_, long lcgSeed_) {\n super(instances_);\n stream = new UniformStream(0.0, 1.0, 0, mgSeed_, lcgSeed_);\n waitingList = new Vector();\n }",
"public static int rollStrength(){\n num1 = (int)(Math.random()*(20-0+1)+0);\n return num1;\n }",
"public static int uniform(int N) {\r\n return random.nextInt(N);\r\n }",
"public static void randomInit(int r) { }",
"public void speedRange1()\n\t{\n\t\trange = (gen.nextInt(upper1 - lower1)+1) + lower1;\n\t\tspeedBalloonY1 = range;\n\t}",
"private Random rand()\n\t{\n\t\treturn new Random();\n\t}",
"private int _getRandomFromRange(int min, int max) {\n\t \n return min + random_.nextInt(max - min + 1);\n }",
"private double generateTimeServ() throws ExceptionInvalidTimeDelay {\n if (distribution != null) {\n if (distribution.equalsIgnoreCase(\"exp\")) {\n timeServ = FunRand.exp(parametr);\n } else if (distribution.equalsIgnoreCase(\"unif\")) {\n timeServ = FunRand.unif(parametr - paramDeviation, parametr + paramDeviation);\n } else if (distribution.equalsIgnoreCase(\"norm\")) {\n timeServ = FunRand.norm(parametr, paramDeviation);\n }\n } else {\n timeServ = parametr;\n }\n return timeServ;\n }",
"public abstract void setRate();",
"public float randomize() {\n return nextFloat(this.min, this.max);\n }",
"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 calcTraderPrice() {\r\n Random r = new Random();\r\n return rtl + r.nextInt(rth - rtl);\r\n }",
"public static int uniform( int N ) {\n return random.nextInt( N + 1 );\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}",
"public float randomQual() {\n\t\treturn((float) getRandomInteger(30,250));\n\t}",
"private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\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 double random(double theMin, double theMax, CCInterpolator theInterpolator) {\n\t\treturn theMin + random(theInterpolator) * (theMax - theMin);\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}",
"private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}",
"public interface IRandomAdapter {\n int nextInt(int max);\n}",
"public static double uniform() {\r\n return random.nextDouble();\r\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}",
"@Override\r\n public Double getValue() {\r\n return Math.random()*Integer.MAX_VALUE;\r\n \r\n }",
"@Override\r\n\tpublic int computeNextVal(boolean prediction) {\n\t\treturn (int) (Math.random()*10)%3;\r\n\t}",
"T getRandomAllowedValue();",
"double generate(double i_load, double cap, GridTime gt) {\n \r\n double max_boundary = cap * Math.min(1., prev_load_perc + rampperc); //These in MW\r\n double min_boundary = cap * Math.max(0., prev_load_perc - rampperc);\r\n \r\n \r\n //Determine load to ramp generator to\r\n if (i_load >= max_boundary) {\r\n prev_load_perc = Math.min(1., prev_load_perc + rampperc);\r\n i_load -= max_boundary;\r\n }\r\n else if (i_load <= min_boundary) {\r\n prev_load_perc = Math.max(0., prev_load_perc - rampperc);\r\n i_load -= min_boundary;\r\n }\r\n else {\r\n prev_load_perc = Math.max(0., Math.min(1., i_load / cap));\r\n i_load = 0.;\r\n }\r\n \r\n return i_load;\r\n }",
"protected int random(int min, int max) {\n\t\treturn this.rand.nextInt(max-min) + min;\n\t}",
"public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}",
"public static double rangedRandom(double a){\n\t\treturn -a + Calc.random(a * 2);\n\t}",
"private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}",
"private int rand(int lower, int higher) {\n\t\treturn lower + (int) ((higher - lower + 1) * Math.random());\n\t\t\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 }",
"@Override\n public long generateNewTimeToNextContract() {\n return new Random().nextInt(5);\n }"
] | [
"0.63622576",
"0.6212645",
"0.60962397",
"0.6018141",
"0.5947577",
"0.5861339",
"0.5838002",
"0.5734345",
"0.5681443",
"0.56242645",
"0.559271",
"0.55537826",
"0.5536752",
"0.54974097",
"0.5492895",
"0.549211",
"0.54878074",
"0.5463898",
"0.5458776",
"0.54565805",
"0.54553866",
"0.5450553",
"0.5441906",
"0.5430007",
"0.54274595",
"0.5423768",
"0.5414871",
"0.54067856",
"0.5401984",
"0.5394036",
"0.5394036",
"0.53895277",
"0.53733957",
"0.5362146",
"0.53616375",
"0.53501755",
"0.5325812",
"0.532491",
"0.528433",
"0.52815944",
"0.52708346",
"0.5270535",
"0.52691704",
"0.5263671",
"0.52491724",
"0.52423054",
"0.52369565",
"0.5233884",
"0.5232399",
"0.52323526",
"0.5229912",
"0.5222073",
"0.5213892",
"0.52137464",
"0.5211125",
"0.52068543",
"0.52066344",
"0.5201434",
"0.5189158",
"0.5186383",
"0.5179886",
"0.5165288",
"0.51604384",
"0.51515764",
"0.5131302",
"0.5123522",
"0.51232153",
"0.51185393",
"0.51176167",
"0.51153755",
"0.51121855",
"0.51014537",
"0.510098",
"0.5096267",
"0.50844896",
"0.507677",
"0.50737286",
"0.5071641",
"0.5071142",
"0.50682974",
"0.50650823",
"0.5057175",
"0.5057168",
"0.50559026",
"0.50552607",
"0.50549483",
"0.5052727",
"0.50515264",
"0.5048473",
"0.50428665",
"0.5042581",
"0.50424397",
"0.5040067",
"0.5035859",
"0.5033847",
"0.50327694",
"0.5025699",
"0.50219095",
"0.5012429",
"0.50105804"
] | 0.649263 | 0 |
Request for generating the dynamic rate from the rule engine Pseudo Code 1. Connect to the rule engine 2. Invoke the getRate method with the resource name 3. Return the generated rate | private double getDynamicRate(String resourceName) {
logger.trace("BEGIN double getDynamicRate(String resourceName)");
double rate;
RateEngineResponse response;
RuleEngineClient client = new RuleEngineClient();
response = client.getRate(resourceName);
rate = response.getRate();
//System.out.println("Got the response from rule engine. Rate: " + response.getRate());
logger.trace("END double getDynamicRate(String resourceName)");
return rate;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"com.yandex.ydb.rate_limiter.Resource getResource();",
"private TSDBData generateDynamicRate() {\n //TODO: replace with single method generateRate and parameter (static, dynamic)\n double rate;\n Random rateGenerator = new Random();\n TSDBData rateData = new TSDBData();\n ArrayList<String> strArr = null;\n ArrayList<Object> objArrNode;\n ArrayList<ArrayList<Object>> objArr = new ArrayList<ArrayList<Object>>();\n\n // Iterate through the list and generate the rate for each enabled meters\n for (int k = 0; k < enabledResourceList.size(); k++) {\n //rate = getDynamicRate(enabledResourceList.get(k).toString());\n rate = rateGenerator.nextInt((3 - 1) + 1) + 1;\n strArr = StringUtil.strArr(\"resource\", \"rate\", \"rate_policy\");\n //strArr.add(\"resource\");\n //strArr.add(\"rate\");\n //strArr.add(\"rate_policy\");\n objArrNode = new ArrayList<Object>();\n objArrNode.add(enabledResourceList.get(k));\n objArrNode.add(rate);\n objArrNode.add(Flag.getMeteringType());\n objArr.add(objArrNode);\n }\n\n rateData.setName(\"rate\");\n rateData.setColumns(strArr);\n rateData.setPoints(objArr);\n return rateData;\n }",
"double getRate();",
"private TSDBData generateStaticRate() {\n //TODO: check if there is generic method to to return rateData\n ArrayList<String> strArr = StringUtil.strArr(\"resource\", \"rate\", \"rate_policy\");\n TSDBData rateData = createPOJOObject(\"rate\", strArr, load.getStaticRate());\n return rateData;\n }",
"public Rate rate() {\n _initialize();\n return rate;\n }",
"com.yandex.ydb.rate_limiter.ResourceOrBuilder getResourceOrBuilder();",
"public int getRate() {\n return rate_;\n }",
"public Integer getRate() {\r\n return rate;\r\n }",
"public int getRate() {\n return rate_;\n }",
"public double getRate() {\n\t\treturn rate;\n\t}",
"public double getRate() {\n return rate;\n }",
"public double getRate() {\n return rate;\n }",
"public String getAdaptiveRateAlgorithm();",
"double requestCurrentRate(String fromCurrency,\n String toCurrency);",
"double calculateRate(Temperature temperature, double Hrxn);",
"public void setRate(int rate) { this.rate = rate; }",
"protected abstract Double getRate(T object);",
"public void setRate();",
"public int getSessionCreateRate();",
"protected abstract RateLimitRule createRule(HttpMessage msg) throws URIException;",
"public int getRate() {\r\n return Integer.parseInt(RATES[Rate]);\r\n }",
"public float getRate() {\n\t\treturn rate;\n\t}",
"public abstract void setRate();",
"public int getChargeRate();",
"private boolean generateRate() {\n TSDBData rateObj;\n boolean result = false;\n\n if (Flag.getMeteringType().equalsIgnoreCase(\"static\")) {\n rateObj = generateStaticRate();\n } else {\n rateObj = generateDynamicRate();\n }\n if (rateObj.getPoints().size() > 0)\n result = saveRate(rateObj);\n return result;\n }",
"@Get\n public String serviceRequest() {\n counter.increment(endpoint);\n\n boolean rateResult = false;\n boolean cdrResult = false;\n boolean tcdrResult = false;\n\n // Get the list of enabled resources\n enabledResourceList = getEnabledResources();\n // Service the request\n try {\n if (action.equalsIgnoreCase(\"rate\")) {\n logger.debug(\"Attempting to generate a Rate\");\n rateResult = generateRate();\n } else if (action.equalsIgnoreCase(\"cdr\")) {\n logger.debug(\"Attempting to generate a CDR\");\n cdrResult = generateCdr();\n } else if (action.equalsIgnoreCase(\"t-cdr\")) {\n logger.debug(\"Attempting to generate a CDR for T-nova\");\n tcdrResult = generateTNovaCdr();\n }\n // Construct the response\n if (rateResult) {\n return \"The rate generation was successful\";\n } else if (cdrResult) {\n return \"The cdr generation was successful\";\n } else if (tcdrResult) {\n return \"The T-Nova cdr generation was successful\";\n } else {\n return \"Operation Failed\";\n }\n }catch (Exception e){\n logger.error(\"Error while generating it: \"+e.getMessage());\n return \"Operation Failed\";\n }\n }",
"public float getRate(){\r\n return rate;\r\n }",
"public double getRate() {\r\n\t\treturn (getRate(0)+getRate(1))/2.0;\r\n\t}",
"public int getCustomInformationTransferRate();",
"public double calculateRate() {\n\t\tdouble rate = 0;\n\t\tfor (int i = 0; i < upgrades.size(); i++) {\n\t\t\trate += upgrades.get(i).getProduction();\n\t\t}\n\t\tbrain.setRate(rate);\n\t\treturn rate;\n\t}",
"@Override\n\tpublic double getRate() {\n\t\treturn 7;\n\t}",
"int getResourceCost();",
"public Long get_cacheparameterizedrequestsrate() throws Exception {\n\t\treturn this.cacheparameterizedrequestsrate;\n\t}",
"public float getRate() {\n\treturn durationStretch * nominalRate;\n }",
"public String getRateId() {\n return rateId;\n }",
"double getTransRate();",
"private void calculateRates() {\n if (rateOutput == null || !outputs.containsKey(rateOutput)) throw new RuntimeException(\"Insufficient data to calculate recipe rates\");\n recipesPerMinute = productionRate / outputs.get(rateOutput);\n\n for (String resource : inputs.keySet()) {\n ratesPerMinute.put(resource,-1.0 * recipesPerMinute * inputs.get(resource));\n }\n for (String resource: outputs.keySet()) {\n ratesPerMinute.put(resource, recipesPerMinute * outputs.get(resource));\n }\n }",
"public interface IRate {\n\t\n\t//writing the class outline\n\tpublic void setRate();\n\tpublic void increaseRate();\n}",
"public abstract double getDiscountRate();",
"Rate initRate(Rate iRate)\n {\n iRate.updateElementValue(\"Rate\");\n return iRate;\n }",
"@GetMapping(value = \"/{id}\", produces = MediaType.APPLICATION_JSON_VALUE)\n @PreAuthorize(value = \"isAuthenticated()\")\n public Rate getRateById(@PathVariable(name = \"id\", required = true) long id, HttpServletRequest request) throws Exception {\n return rateService.getRate(id);\n }",
"@Override\n\tpublic double calRate() {\n\t\treturn 0.9f;\n\t}",
"public int getStarvationRate ( ) {\n\t\treturn extract ( handle -> handle.getStarvationRate ( ) );\n\t}",
"public void setRate(Integer rate) {\r\n this.rate = rate;\r\n }",
"String getReviewrate();",
"int getSmpRate();",
"public static final double internalRateOfReturn (\n double irrEstimate,\n double [ ] cashFlows )\n //////////////////////////////////////////////////////////////////////\n {\n double irr = irrEstimate;\n\n double delta = -irr * 0.1;\n\n double oldNpv = 0.0;\n\n while ( true )\n {\n double npv = netPresentValue ( irr, cashFlows );\n\n if ( npv == 0.0 )\n {\n return irr;\n }\n\n if ( oldNpv < 0.0 )\n {\n if ( npv > 0.0 )\n {\n delta *= -0.9;\n }\n else if ( npv > oldNpv )\n {\n delta *= 1.1;\n }\n else if ( npv < oldNpv )\n {\n delta = -delta;\n }\n else\n {\n delta = 0.0;\n }\n }\n else if ( oldNpv > 0.0 )\n {\n if ( npv < 0.0 )\n {\n delta *= -0.9;\n }\n else if ( npv < oldNpv )\n {\n delta *= 1.1;\n }\n else if ( npv > oldNpv )\n {\n delta = -delta;\n }\n else\n {\n delta = 0.0;\n }\n }\n\n/*\nSystem.out.println ( \"irr = \" + irr + \", oldNpv = \" + oldNpv + \", npv = \" + npv + \", delta = \" + delta );\n\ntry{\nnew BufferedReader ( new InputStreamReader ( System.in ) ).readLine ( );\n}catch (Exception x ) { }\n*/\n\n if ( delta == 0.0 )\n {\n return irr;\n }\n\n irr += delta;\n\n oldNpv = npv;\n }\n }",
"public java.lang.Integer getRatetype() {\n\treturn ratetype;\n}",
"public void sendeRate(String spieler);",
"public Long get_cacherequestsrate() throws Exception {\n\t\treturn this.cacherequestsrate;\n\t}",
"private static int chargeRate(Thing b, Thing s) {\n \t\tint rate=b.getStat(\"WP\");\r\n \t\t\r\n \t\t// bonus for appropraite recharge skill\r\n \t\trate=rate*(1+b.getStat(rechargeSkill(s)));\r\n \t\t\r\n \t\t// spell specific charge rate\r\n \t\t// default is 100\r\n \t\trate=(rate*s.getStat(\"ChargeRate\"));\r\n \t\t\r\n \t\t// more costly spells take longer to recharge\r\n \t\trate=rate/s.getStat(\"SpellCost\");\r\n \t\t\r\n \t\tif (rate<=0) {\r\n \t\t\tGame.warn(\"Spell.chargeRate(...)==0 for \"+s.name());\r\n \t\t}\r\n \t\t\r\n \t\treturn rate;\r\n \t}",
"@Override\n\tpublic double calculateRate(int distance, double weight) {\n\t\tdouble rate = 0;\n\t\tif (weight >= 0 && weight <= 2) {\n\t\t\trate = 0.0020;\n\t\t\trate = rate * distance;\n\n\t\t} else if (weight >= 3 && weight <= 8) {\n\t\t\trate = 0.0022;\n\t\t\trate = rate * distance;\n\t\t} else if (weight >= 9 && weight <= 15) {\n\t\t\trate = 0.0024;\n\t\t\treturn rate * distance;\n\t\t}\n\t\tif (weight >= 1*16 && weight <= 3*16) {\n\t\t\trate = 0.0150 * distance;\n\t\t} else if (weight >= 4*16 && weight <= 8*16) {\n\t\t\trate = 0.0160 * distance;\n\t\t} else if (weight >= 9 * 16) {\n\t\t\trate = 0.0170 * distance;\n\t\t}\n\n\t\treturn rate;\n\t}",
"static double chooseRate(String selectedRate){\n JsonObject listRates = conversionRates.get(\"rates\").getAsJsonObject();\n return listRates.get(selectedRate).getAsDouble();\n\n }",
"public static double getValue(Exchange exchange, String name) {\n\n double rate = -1.0;\n\n switch (name) {\n case \"AUD\":\n rate = exchange.getRates().getAUD();\n break;\n case \"BGN\":\n rate = exchange.getRates().getBGN();\n break;\n case \"BRL\":\n rate = exchange.getRates().getBRL();\n break;\n case \"CAD\":\n rate = exchange.getRates().getCAD();\n break;\n case \"CHF\":\n rate = exchange.getRates().getCHF();\n break;\n case \"CNY\":\n rate = exchange.getRates().getCNY();\n break;\n case \"CZK\":\n rate = exchange.getRates().getCZK();\n break;\n case \"DKK\":\n rate = exchange.getRates().getDKK();\n break;\n case \"GBP\":\n rate = exchange.getRates().getGBP();\n break;\n case \"HKD\":\n rate = exchange.getRates().getHKD();\n break;\n case \"HRK\":\n rate = exchange.getRates().getHRK();\n break;\n case \"HUF\":\n rate = exchange.getRates().getHUF();\n break;\n case \"IDR\":\n rate = exchange.getRates().getIDR();\n break;\n case \"ILS\":\n rate = exchange.getRates().getILS();\n break;\n case \"INR\":\n rate = exchange.getRates().getINR();\n break;\n case \"JPY\":\n rate = exchange.getRates().getJPY();\n break;\n case \"KRW\":\n rate = exchange.getRates().getKRW();\n break;\n case \"MXN\":\n rate = exchange.getRates().getMXN();\n break;\n case \"MYR\":\n rate = exchange.getRates().getMYR();\n break;\n case \"NOK\":\n rate = exchange.getRates().getNOK();\n break;\n case \"NZD\":\n rate = exchange.getRates().getNZD();\n break;\n case \"PHP\":\n rate = exchange.getRates().getPHP();\n break;\n case \"PLN\":\n rate = exchange.getRates().getPLN();\n break;\n case \"RON\":\n rate = exchange.getRates().getRON();\n break;\n case \"RUB\":\n rate = exchange.getRates().getRUB();\n break;\n case \"SEK\":\n rate = exchange.getRates().getSEK();\n break;\n case \"SGD\":\n rate = exchange.getRates().getSGD();\n break;\n case \"THB\":\n rate = exchange.getRates().getTHB();\n break;\n case \"TRY\":\n rate = exchange.getRates().getTRY();\n break;\n case \"ZAR\":\n rate = exchange.getRates().getZAR();\n break;\n case \"EUR\":\n rate = exchange.getRates().getEUR();\n break;\n case \"USD\":\n rate = exchange.getRates().getUSD();\n break;\n default:\n break;\n }\n\n return rate;\n }",
"public void updateRate(double r){\r\n rate *= r;\r\n }",
"public double getPayRate()\r\n\t{\r\n\treturn payRate;\r\n\t}",
"int getMortgageRate();",
"public IShippingRate getRateObject();",
"public double pay(){\n\t\treturn payRate;\n\t}",
"public interface RateLimiter {\n\n String rateLimiterId();\n\n boolean isRateLimited(String identity);\n\n}",
"public boolean AskRate() {\n return Rate.rateWithCounter(getActivity(), getResources().getInteger(R.integer.rate_shows_after_X_starts), getResources().getString(R.string.rate_title), getResources().getString(R.string.rate_text), getResources().getString(R.string.unable_to_reach_market), getResources().getString(R.string.Alert_accept), getResources().getString(R.string.Alert_cancel));\n\n }",
"pb4server.ResurgenceAskReq getResurgenceAskReq();",
"Integer networkTickRate();",
"protected double getDataRate() {\n\t\treturn (double) getThroughput() / (double) getElapsedTime();\n\t}",
"public String getRegularRate() {\n return regularRate;\n }",
"double getCost();",
"double getCost();",
"abstract double calculateCurrentDiscountRate();",
"public PolicyBinderPage rateFunctionality(String policyNo) {\r\n\r\n RateApolicyPage rateapolicypage = new RateApolicyPage(driver);\r\n rateapolicypage.rateFunctionality(policyNo);\r\n return new PolicyBinderPage(driver);\r\n }",
"@Override\n public Double calculateRatio(String base, String dest) throws Exception {\n if (base == null || dest == null) {\n throw new NullInputException();\n }\n try {\n HttpClient client = HttpClient.newHttpClient();\n String url = String.format(urlFormat, host, base);\n HttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(url))\n .version(HttpClient.Version.HTTP_1_1)\n .GET()\n .build();\n HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n JSONObject jsObject = new JSONObject(response.body());\n JSONObject rates = jsObject.getJSONObject(\"rates\");\n\n return Double.parseDouble(rates.get(dest).toString());\n } catch (JSONException e) {\n throw new Exception(String.format(\"Failed to find currency id: %s\", dest), e);\n } catch (IOException | InterruptedException e) {\n throw new Exception(\"Failed to convert the currencies. Please try again later.\", e);\n }\n\n }",
"public static Collection getCostingRates() throws EnvoyServletException\n {\n try\n {\n return ServerProxy.getCostingEngine().getRates();\n }\n catch (Exception e)\n {\n throw new EnvoyServletException(e);\n }\n }",
"public int setRate(int rateToServer){\r\n\t\tint resultOfRate=1;\r\n\t\t//! send rate to server and check if ok.\r\n\t\tFLAG_RATED=true;\r\n\t\treturn resultOfRate;\r\n\t}",
"public int getThisDataRate(){\r\n\t\tString option = (String) comboBox.getSelectedItem();\r\n\t\tif (option.equals(\"250kbs\")){\r\n\t\t\tdataRate = 0;\r\n\t\t}else if(option.equals(\"1mbs\")){\r\n\t\t\tdataRate = 1;\r\n\t\t}else{\r\n\t\t\tdataRate = 2;\r\n\t\t}\r\n\t\treturn dataRate;\r\n\t}",
"@SOAPMethod(\"ConversionRate\")\n String conversionRate(@SOAPProperty(\"FromCurrency\") String fromCurrency,\n @SOAPProperty(\"ToCurrency\") String toCurrency);",
"public abstract double getCost();",
"@Override\n public Class<RateRecord> getRecordType() {\n return RateRecord.class;\n }",
"@Override protected double convertRate(double rate) {\n return super.convertRate(rate);\n }",
"private boolean generateCdr(){\n //TODO: split it into smaller methods\n Object usage;\n double charge;\n String from, to;\n String[] time;\n int indexUsage;\n ArrayList usageListArr, usageArr;\n ArrayList columnArr;\n UDRServiceClient udrClient = new UDRServiceClient();\n RateResource rateResource = new RateResource();\n ArrayList<ArrayList<Object>> objArr = new ArrayList<ArrayList<Object>>();\n Double rate;\n TSDBData tsdbData;\n boolean result;\n String userid;\n ArrayList<ResourceUsage> resourceUsageArray;\n HashMap tags;\n POJOUtil pojoUtil = new POJOUtil();\n\n DateTimeUtil dateTimeUtil = new DateTimeUtil();\n time = dateTimeUtil.getRange();\n\n from = time[1];\n to = time[0];\n for (int i = 0; i < enabledResourceList.size(); i++) {\n tsdbData = rateResource.getResourceRate(enabledResourceList.get(i).toString(), from, to);\n rate = calculateRate(tsdbData);\n resourceUsageArray = udrClient.getResourceUsageData(enabledResourceList.get(i).toString(), from, to);\n for (ResourceUsage resource : resourceUsageArray) {\n columnArr = resource.getColumn();\n\n usageListArr = resource.getUsage();\n tags = resource.getTags();\n //indexUserId = columnArr.indexOf(\"userid\");\n userid = tags.get(\"userId\").toString();\n //userid = userid.substring(0, userid.length());\n indexUsage = columnArr.indexOf(\"mean\");\n // The below if condition differentiates between the gauge and cumulative meters of openstack\n if (indexUsage < 0) {\n indexUsage = columnArr.indexOf(\"usage\");//usage if we are not using the sum in the sql else \"sum\"\n }\n // Iterate through the usage arraylist to extract the userid and usage.\n // Multiple the usage with the rate of the resource and save it into an arraylist\n for (int j = 0; j < usageListArr.size(); j++) {\n usageArr = (ArrayList) usageListArr.get(j);\n usage = usageArr.get(indexUsage);\n // Calculate the charge for a resource per user\n Double d = Double.parseDouble(usage.toString());\n charge = (d * rate);\n String resources = enabledResourceList.get(i).toString();\n objArr = pojoUtil.populateList(usageListArr, objArr, resources, userid, usage, charge);\n }\n }\n\n }\n // Save the charge array into the database\n result = savePrice(objArr);\n return result;\n }",
"@gw.internal.gosu.parser.ExtendedProperty\n public entity.RateTable[] getRateTables();",
"double getReliability();",
"@Override\n public RoomRatesEntity findOnlineRateForRoomType(Long roomTypeId, Date currentDate) throws NoAvailableOnlineRoomRateException {\n Query query = em.createQuery(\"SELECT r FROM RoomRatesEntity r JOIN r.roomTypeList r1 WHERE r1.roomTypeId = :roomTypeId\");\n query.setParameter(\"roomTypeId\", roomTypeId);\n List<RoomRatesEntity> roomRates = query.getResultList();\n\n //Check what rate type are present\n boolean normal = false;\n boolean promo = false;\n boolean peak = false;\n\n for (RoomRatesEntity roomRate : roomRates) {\n// if (!checkValidityOfRoomRate(roomRate)) { //skips expired/not started rates, price is determined by check in and check out date, it becomes not considered in our final prediction\n// continue;\n// }\n// if null do smt else\n if (roomRate.getIsDisabled() == false) {\n if (null != roomRate.getRateType()) {\n System.out.println(roomRate.getRateType());\n switch (roomRate.getRateType()) {\n case NORMAL:\n normal = true;\n \n break;\n case PROMOTIONAL:\n System.out.println(\"ValidStart \"+roomRate.getValidityStart()+\" ValidEnd: \"+roomRate.getValidityEnd()+\" CurrentDate: \"+currentDate);\n if (rateIsWithinRange(roomRate.getValidityStart(), roomRate.getValidityEnd(), currentDate)) {\n promo = true;\n }\n break;\n\n case PEAK:\n System.out.println(\"ValidStart \"+roomRate.getValidityStart()+\" ValidEnd: \"+roomRate.getValidityEnd()+\" CurrentDate: \"+currentDate);\n\n if (rateIsWithinRange(roomRate.getValidityStart(), roomRate.getValidityEnd(), currentDate)) {\n peak = true;\n }\n break;\n default:\n break;\n }\n }\n\n System.out.println(normal + \" \" + promo + \" \" + peak);\n //5 rules here\n if (normal && promo && peak) {\n //find promo\n Query rule = em.createQuery(\"SELECT r FROM RoomRatesEntity r JOIN r.roomTypeList r1 WHERE r1.roomTypeId = :roomTypeId AND r.rateType = :p ORDER BY r.ratePerNight ASC\");\n rule.setParameter(\"p\", RateType.PROMOTIONAL);\n rule.setParameter(\"roomTypeId\", roomTypeId);\n\n return (RoomRatesEntity) rule.getResultList().get(0);\n } else if (promo && peak && !normal || normal && peak && !promo) {\n //apply peak, assume only 1\n Query rule = em.createQuery(\"SELECT r FROM RoomRatesEntity r JOIN r.roomTypeList r1 WHERE r1.roomTypeId = :roomTypeId AND r.rateType = :p\");\n rule.setParameter(\"p\", RateType.PEAK);\n rule.setParameter(\"roomTypeId\", roomTypeId);\n\n return (RoomRatesEntity) rule.getSingleResult();\n } else if (normal && promo && !peak) {\n //apply promo\n Query rule = em.createQuery(\"SELECT r FROM RoomRatesEntity r JOIN r.roomTypeList r1 WHERE r1.roomTypeId = :roomTypeId AND r.rateType = :p ORDER BY r.ratePerNight ASC\");\n rule.setParameter(\"p\", RateType.PROMOTIONAL);\n rule.setParameter(\"roomTypeId\", roomTypeId);\n\n return (RoomRatesEntity) rule.getResultList().get(0);\n } else if (normal && !promo && !peak) {\n //apply normal\n Query rule = em.createQuery(\"SELECT r FROM RoomRatesEntity r JOIN r.roomTypeList r1 WHERE r1.roomTypeId = :roomTypeId AND r.rateType = :p\");\n rule.setParameter(\"p\", RateType.NORMAL);\n rule.setParameter(\"roomTypeId\", roomTypeId);\n\n return (RoomRatesEntity) rule.getSingleResult();\n }\n }\n\n }\n throw new NoAvailableOnlineRoomRateException(\"There is no available room rate to be used!\");\n }",
"public int getTradeRate(ResourceType resourceType) {\n\t\treturn playerPieces.getTradeRate(resourceType);\n\t}",
"@PostMapping(\"/exchange\")\n public ResponseEntity<ExchangeResult> getExchangeRate(@RequestBody ExchangeRequest exchangeRequest) {\n\n ExchangeResult result = currencyExchangeService.calculate(exchangeRequest);\n\n\n// 4. do nbp exchange downoloaderprzekazujemy date i walute(wartosci nie bo jąliczymy w serwisie)\n// 5. w nbp exchange downoloader wstzukyjemy rest tempplate\n// 6. majac wynik wracamy do currency exchange servise(typem zwracamyn bedzie obiekt ktory bedzie zawierał rating i error message(typ string))\n// i w momencie jak nie bedzie błedu uzupełniamy rating lub error , dodac boolena ktory nam powie czy jest ok czy nie\n// jak jest ok to wyciagamy stawke rate i dzielimy ją\n// 7. nastepnie mamy wynik\n\n\n return new ResponseEntity<>(result, result.getStatus());\n }",
"public Rate get(\n String baseCurrency,\n String currency\n ) throws RateQueryException {\n try {\n HttpResponse response = this.bitPayClient.get(\"rates/\" + baseCurrency + \"/\" + currency);\n final String content = this.bitPayClient.responseToJsonString(response);\n return JsonMapperFactory.create().readValue(content, Rate.class);\n } catch (JsonProcessingException e) {\n throw new RateQueryException(null,\n \"failed to deserialize BitPay server response (Rates) : \" + e.getMessage());\n } catch (Exception e) {\n throw new RateQueryException(null,\n \"failed to deserialize BitPay server response (Rates) : \" + e.getMessage());\n }\n }",
"public abstract int getCost();",
"public abstract int getCost();",
"public abstract int getCost();",
"int getCost();",
"int getCost();",
"int getCost();",
"double getRating();",
"public abstract R convertedTo(Currency resultCurrency, ScenarioFxRateProvider rateProvider);",
"public static JSONObject sendRequest(){\n \tJSONObject exchangeRates = null;\n \t \n try {\n \t stream = new URL(BASE_URL + \"?access_key=\" + ACCESS_KEY).openStream();\n \t BufferedReader rd = new BufferedReader(new InputStreamReader(stream, Charset.forName(\"UTF-8\")));\n \t exchangeRates = new JSONObject(streamToString(rd)).getJSONObject(\"rates\");;\n \n }catch(MalformedURLException e) {\n \t e.printStackTrace();\n \t \n }catch (IOException e) {\n \n e.printStackTrace();\n }catch (JSONException e) {\n \n e.printStackTrace();\n } \n\t\treturn exchangeRates;\n \n }",
"public double getRate( ) {\nreturn monthlyInterestRate * 100.0 * MONTHS;\n}",
"public void setAdaptiveRateAlgorithm(String algorithm);",
"@Override\n\tpublic double cost() {\n\t\treturn Double.parseDouble(rateOfLatte);\n\t}",
"public static double getRate(){\r\n Scanner s = new Scanner(System.in);\r\n double rate;\r\n do{\r\n System.out.print(\"Enter the current prime interest rate: \");\r\n rate = parseDouble(s.next());\r\n rate = rate * 0.01;\r\n }while(rate == -1);\r\n System.out.println(\"---------------------------------------------\");\r\n return rate;\r\n }",
"public Double getReturnRate() {\r\n return returnRate;\r\n }",
"void requestRateLimited();",
"public boolean adaptiveRateControlEnabled();"
] | [
"0.698578",
"0.68435675",
"0.681921",
"0.65546817",
"0.6442524",
"0.6172029",
"0.61413556",
"0.6133461",
"0.6103118",
"0.60501134",
"0.60432965",
"0.60432965",
"0.6041667",
"0.60083556",
"0.59588516",
"0.5919654",
"0.5898494",
"0.58866674",
"0.58855927",
"0.5884453",
"0.58660835",
"0.58639497",
"0.5862283",
"0.5849766",
"0.58178204",
"0.5762273",
"0.57540166",
"0.5748496",
"0.57155615",
"0.5687907",
"0.5638394",
"0.56046546",
"0.5573059",
"0.5556103",
"0.55377626",
"0.5520986",
"0.5494027",
"0.5492747",
"0.54844654",
"0.5474964",
"0.5471433",
"0.5468049",
"0.5451079",
"0.5436595",
"0.5436452",
"0.54248875",
"0.5391785",
"0.53281754",
"0.53248924",
"0.5306372",
"0.53021884",
"0.52932405",
"0.5292065",
"0.52722275",
"0.5253692",
"0.5225903",
"0.52177763",
"0.5212992",
"0.5211577",
"0.51281524",
"0.5112594",
"0.5100451",
"0.5093112",
"0.50808305",
"0.50655353",
"0.5063418",
"0.5063418",
"0.5060758",
"0.50597006",
"0.5047513",
"0.504694",
"0.5043593",
"0.5037677",
"0.50357157",
"0.50336283",
"0.5027615",
"0.5017837",
"0.5011045",
"0.50040436",
"0.50024056",
"0.5000257",
"0.4986647",
"0.4978345",
"0.49760088",
"0.49696207",
"0.49696207",
"0.49696207",
"0.4966968",
"0.4966968",
"0.4966968",
"0.49668455",
"0.49610388",
"0.4924909",
"0.49219498",
"0.49200022",
"0.49179024",
"0.49110454",
"0.49088427",
"0.48970842",
"0.48849428"
] | 0.80228406 | 0 |
Generate the CDR of all the users for the selected meters Pseudo Code 1. Get the list of selected meters 2. Query the UDR service to get the usage information under these meters for all the users for a time period 3. Get the rate for the same meters for a same time period 4. Combine the rate and usage to get the charge value 5. Save it in the db | private boolean generateCdr(){
//TODO: split it into smaller methods
Object usage;
double charge;
String from, to;
String[] time;
int indexUsage;
ArrayList usageListArr, usageArr;
ArrayList columnArr;
UDRServiceClient udrClient = new UDRServiceClient();
RateResource rateResource = new RateResource();
ArrayList<ArrayList<Object>> objArr = new ArrayList<ArrayList<Object>>();
Double rate;
TSDBData tsdbData;
boolean result;
String userid;
ArrayList<ResourceUsage> resourceUsageArray;
HashMap tags;
POJOUtil pojoUtil = new POJOUtil();
DateTimeUtil dateTimeUtil = new DateTimeUtil();
time = dateTimeUtil.getRange();
from = time[1];
to = time[0];
for (int i = 0; i < enabledResourceList.size(); i++) {
tsdbData = rateResource.getResourceRate(enabledResourceList.get(i).toString(), from, to);
rate = calculateRate(tsdbData);
resourceUsageArray = udrClient.getResourceUsageData(enabledResourceList.get(i).toString(), from, to);
for (ResourceUsage resource : resourceUsageArray) {
columnArr = resource.getColumn();
usageListArr = resource.getUsage();
tags = resource.getTags();
//indexUserId = columnArr.indexOf("userid");
userid = tags.get("userId").toString();
//userid = userid.substring(0, userid.length());
indexUsage = columnArr.indexOf("mean");
// The below if condition differentiates between the gauge and cumulative meters of openstack
if (indexUsage < 0) {
indexUsage = columnArr.indexOf("usage");//usage if we are not using the sum in the sql else "sum"
}
// Iterate through the usage arraylist to extract the userid and usage.
// Multiple the usage with the rate of the resource and save it into an arraylist
for (int j = 0; j < usageListArr.size(); j++) {
usageArr = (ArrayList) usageListArr.get(j);
usage = usageArr.get(indexUsage);
// Calculate the charge for a resource per user
Double d = Double.parseDouble(usage.toString());
charge = (d * rate);
String resources = enabledResourceList.get(i).toString();
objArr = pojoUtil.populateList(usageListArr, objArr, resources, userid, usage, charge);
}
}
}
// Save the charge array into the database
result = savePrice(objArr);
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"InternalResultsResponse<GasMeter> fetchAllGasMeters(InquiryDeviceRequest inquiryDeviceRequest);",
"public Breakdown generateReport(Date startDate, Date endDate, ArrayList<User> userList, double total) {\n\n //INTIATING VARIABLES\n Breakdown result = new Breakdown();\n\n HashMap<String, Breakdown> intenseMap = new HashMap<String, Breakdown>();\n HashMap<String, Breakdown> normalMap = new HashMap<String, Breakdown>();\n HashMap<String, Breakdown> mildMap = new HashMap<String, Breakdown>();\n\n int intenseCount = 0;\n int normalCount = 0;\n int mildCount = 0;\n\n result.addInList(intenseMap);\n result.addInList(normalMap);\n result.addInList(mildMap);\n\n AppUsageDAO auDAO = new AppUsageDAO();\n\n //If it is without demographic, userList is null\n if (userList == null) {\n userList = auDAO.retrieveUsers(startDate, endDate);\n }\n for (int i = 0; i < userList.size(); i++) {\n User currUser = userList.get(i);\n\n //get current user's app usge\n ArrayList<AppUsage> userUsage = auDAO.retrieveByUser(currUser.getMacAddress(), startDate, endDate);\n double totalSeconds = 0;\n\n Date nextDay = new Date(startDate.getTime() + 60 * 60 * 1000 * 24);\n\n Date oldTime = null;\n if (userUsage.size() > 0) {\n oldTime = userUsage.get(0).getDate();\n if (oldTime.after(nextDay)) {\n nextDay = new Date(nextDay.getTime() + 60 * 60 * 1000 * 24);\n }\n }\n\n for (int j = 1; j < userUsage.size(); j++) {\n AppUsage au = userUsage.get(j);\n Date newTime = au.getDate();\n boolean beforeAppeared = false;\n if (newTime.before(nextDay)) {\n beforeAppeared = true;\n //difference between app usage timing\n long difference = Utility.secondsBetweenDates(oldTime, newTime);\n\n //If difference less than/equal 2 minutes\n if (difference <= 2 * 60) {\n // add difference to totalSeconds if <= 2 mins\n totalSeconds += difference;\n } else {\n // add 10sec to totalSeconds if > 2 mins\n totalSeconds += 10;\n }\n\n } else { // NEW TIMING AFTER NEXT DAY\n nextDay = new Date(nextDay.getTime() + 60 * 60 * 1000 * 24);\n\n if (!beforeAppeared) {\n long difference = Utility.secondsBetweenDates(oldTime, newTime);\n if (difference <= 2 * 60) {\n // add difference to totalSeconds if <= 2 mins\n totalSeconds += difference;\n } else {\n // add 10sec to totalSeconds if > 2 mins\n totalSeconds += 10;\n }\n }\n }\n\n oldTime = newTime;\n\n }\n\n if (oldTime.before(nextDay)) {\n long difference = Utility.secondsBetweenDates(oldTime, nextDay);\n if (difference < 10) {\n totalSeconds += difference;\n } else {\n totalSeconds += 10;\n }\n } else {\n totalSeconds += 10;\n }\n\n //DIVIDE TO GET INTO DAYS\n long days = (endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24) + 1;\n totalSeconds /= days;\n\n //FILTER USER'S USAGE INTO CATEGORIES\n double totalHours = totalSeconds / (60 * 60);\n\n if (totalHours > 0) {\n if (totalHours < 1.0) {\n //MILD\n mildCount++;\n\n } else if (totalHours < 5.0) {\n //NORMAL\n normalCount++;\n\n } else {\n //INTENSE\n intenseCount++;\n\n }\n }\n\n }\n //Calculate percentage\n if (total == -1) {\n total = mildCount + normalCount + intenseCount;\n\n }\n\n int mildPercent = (int) Math.round(mildCount / total * 100);\n int normalPercent = (int) Math.round(normalCount / total * 100);\n int intensePercent = (int) Math.round(intenseCount / total * 100);\n\n //Put in maps\n intenseMap.put(\"intense-count\", new Breakdown(\"\" + intenseCount));\n intenseMap.put(\"intense-percent\", new Breakdown(\"\" + intensePercent));\n\n normalMap.put(\"normal-count\", new Breakdown(\"\" + normalCount));\n normalMap.put(\"normal-percent\", new Breakdown(\"\" + normalPercent));\n\n mildMap.put(\"mild-count\", new Breakdown(\"\" + mildCount));\n mildMap.put(\"mild-percent\", new Breakdown(\"\" + mildPercent));\n\n return result;\n }",
"private TSDBData generateDynamicRate() {\n //TODO: replace with single method generateRate and parameter (static, dynamic)\n double rate;\n Random rateGenerator = new Random();\n TSDBData rateData = new TSDBData();\n ArrayList<String> strArr = null;\n ArrayList<Object> objArrNode;\n ArrayList<ArrayList<Object>> objArr = new ArrayList<ArrayList<Object>>();\n\n // Iterate through the list and generate the rate for each enabled meters\n for (int k = 0; k < enabledResourceList.size(); k++) {\n //rate = getDynamicRate(enabledResourceList.get(k).toString());\n rate = rateGenerator.nextInt((3 - 1) + 1) + 1;\n strArr = StringUtil.strArr(\"resource\", \"rate\", \"rate_policy\");\n //strArr.add(\"resource\");\n //strArr.add(\"rate\");\n //strArr.add(\"rate_policy\");\n objArrNode = new ArrayList<Object>();\n objArrNode.add(enabledResourceList.get(k));\n objArrNode.add(rate);\n objArrNode.add(Flag.getMeteringType());\n objArr.add(objArrNode);\n }\n\n rateData.setName(\"rate\");\n rateData.setColumns(strArr);\n rateData.setPoints(objArr);\n return rateData;\n }",
"public DCU() {\r\n meters = new ArrayList<Meter>();\r\n id = \"unknown\";\r\n }",
"InternalResultsResponse<Device> fetchGasMeterById(DeviceRequest deviceRequest);",
"private TSDBData getBillingModel(HashMap<String, ArrayList<String>> clientInstanceMap, InfluxDBClient dbClient) {\n logger.trace(\"BEGIN TSDBData sumUsage(HashMap<String, ArrayList<String>> clientInstanceMap, InfluxDBClient dbClient)\");\n ArrayList<TSDBData> UDRs = new ArrayList<TSDBData>();\n Iterator it = clientInstanceMap.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry pair = (Map.Entry) it.next();\n String clientId = pair.getKey().toString();\n ArrayList<String> instances = (ArrayList<String>) pair.getValue();\n for (String instance : instances) {\n //System.out.println(\"instanceid = \" + instance);\n //System.out.println(\"clientid = \" + clientId);\n String queryString = \"SELECT sum(usage) FROM UDR WHERE clientId='\" +\n clientId + \"' AND instanceId='\" + instance +\n \"' GROUP BY clientID,instanceID\";\n logger.trace(\"DATA TSDBData sumUsage(...): query=\" + queryString);\n // TSDBData[] lastEvent = dbClient.query(queryString);\n //sends the event to array\n //lastEvents.add(lastEvent[0]);\n }\n System.out.println(pair.getKey() + \" = \" + pair.getValue());\n it.remove(); // avoids a ConcurrentModificationException\n }\n logger.trace(\"END ArrayList<TSDBData> captureLastEvents(HashMap<String, ArrayList<String>> clientInstanceMap, InfluxDBClient dbClient)\");\n return UDRs.get(0);\n }",
"public void getAllDataRelatedToMobility(HttpServletRequest req, HttpServletResponse resp,\n UserUcc userUcc, MobilityChoiceUcc mobilityChoiceUcc, OrganisationUcc organisationUcc,\n MobilityDocumentUcc mobilityDocumentUcc, MobilityUcc mobilityUcc,\n MobilityCancellationUcc mobilityCancellationUcc) {\n try {\n int currentUserId = (int) IhmUserServlet.getCurrentUser(req);\n UserDto currentUser = userUcc.findDto(currentUserId);\n\n /* User est connecté */\n if (currentUser != null) {\n Map<String, Object> data = new HashMap<>();\n\n /* Get the mobility choice */\n int idMobilityChoice = Integer.parseInt(req.getParameter(\"idMobility\"));\n MobilityChoiceDto mobilityChoiceDto = mobilityChoiceUcc.findDto(idMobilityChoice);\n data.put(\"mobilityChoice\", mobilityChoiceDto);\n\n /* Get the mobility */\n MobilityDto mobilityDto = mobilityUcc.findDto(idMobilityChoice);\n data.put(\"mobility\", mobilityDto);\n\n /* Get the student */\n if (currentUser.getTypeUser().equals(\"S\")) {\n data.put(\"user\", currentUser);\n } else {\n data.put(\"user\", userUcc.findDto(mobilityChoiceDto.getIdUser()));\n }\n\n /* Get the partner */\n if (mobilityChoiceDto.getPartner() != null && mobilityChoiceDto.getPartner() != 0) {\n data.put(\"org\", organisationUcc.findDto(mobilityChoiceDto.getPartner()));\n }\n\n /* Get the docs */\n List<MobilityDocumentDto> mobilityDocumentDtos =\n mobilityDocumentUcc.findAllDtosById(idMobilityChoice, \"idMobilityChoice\");\n data.put(\"docs\", mobilityDocumentDtos);\n\n\n /* Get the cancelation */\n data.put(\"cancelation\",\n mobilityCancellationUcc.findAllDtosById(idMobilityChoice, \"idMobilityChoice\"));\n\n String json = new Genson().serialize(data);\n resp.setContentType(\"application/json\");\n resp.getOutputStream().write(json.getBytes());\n\n }\n\n } catch (IOException exp) {\n exp.printStackTrace();\n } catch (InternalServerException exp1) {\n exp1.printStackTrace();\n } catch (IdNotFoundException exp2) {\n exp2.printStackTrace();\n } catch (TransactionErrorException exp3) {\n exp3.printStackTrace();\n }\n }",
"RampUpUsers getRampUpUsers();",
"RampDownUsers getRampDownUsers();",
"private void getHotelRoomRateCall(long cityId) {\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-DD\", Locale.ENGLISH);\n engCheckInDate = dateFormat.format(checkInDate);\n engCheckOutDate = dateFormat.format(checkOutDate);\n\n ArrayList<OccupancyDto> occupancyDtoArrayList = new ArrayList<>();\n HotelRoomRateRequest hotelRoomRateRequest = new HotelRoomRateRequest();\n hotelRoomRateRequest.setCheckInDate(new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH).format(checkInDate));\n hotelRoomRateRequest.setCheckOutDate(new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH).format(checkOutDate));\n hotelRoomRateRequest.setLanguageCode(UserDTO.getUserDTO().getLanguage());\n hotelRoomRateRequest.setCityId(cityId);\n hotelRoomRateRequest.setHotelId(Long.parseLong(destination.getKey()));\n hotelRoomRateRequest.setCurrencyCode(UserDTO.getUserDTO().getCurrency());\n\n for (int i = 0; i < hotelAccommodationsArrayList.size(); i++) {\n\n if (kidsAgeArrayList == null)\n kidsAgeArrayList = new ArrayList<>();\n kidsAgeArrayList.clear();\n\n if (hotelAccommodationsArrayList.get(i).getKids() > 0) {\n if (hotelAccommodationsArrayList.get(i).getKids() == 1) {\n kidsAgeArrayList.add(hotelAccommodationsArrayList.get(i).getKid1Age());\n } else if (hotelAccommodationsArrayList.get(i).getKids() == 2) {\n kidsAgeArrayList.add(hotelAccommodationsArrayList.get(i).getKid1Age());\n kidsAgeArrayList.add(hotelAccommodationsArrayList.get(i).getKid2Age());\n }\n }\n\n occupancyDtoArrayList.add(new OccupancyDto(hotelAccommodationsArrayList.get(i).getAdultsCount(), kidsAgeArrayList));\n hotelRoomRateRequest.setOccupancy(occupancyDtoArrayList);\n }\n\n HotelListingRequest hotelListingRequest = HotelListingRequest.getHotelListRequest();\n hotelListingRequest.setCheckInDate(new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH).format(checkInDate));\n hotelListingRequest.setCheckOutDate(new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH).format(checkOutDate));\n hotelListingRequest.setLanguageCode(UserDTO.getUserDTO().getLanguage());\n hotelListingRequest.setCityId(cityId);\n hotelListingRequest.setCurrencyCode(UserDTO.getUserDTO().getCurrency());\n hotelListingRequest.setOccupancy(hotelRoomRateRequest.getOccupancy());\n\n String request = new Gson().toJson(hotelRoomRateRequest);\n\n if (NetworkUtilities.isInternet(getActivity())) {\n hotelSearchPresenter.getHotelRoomRate(Constant.API_URL + Constant.HOTELSRATES, request, getActivity());\n\n } else\n Utilities.commonErrorMessage(context, context.getString(R.string.Network_not_avilable), context.getString(R.string.please_check_your_internet_connection), false, getFragmentManager());\n }",
"public boolean gen_plan(Users currentUser){\n\n\t\ttry {\n\t\t\tConnection connection = this.getConnection();\n\t\t\tString gender =Character.toString(currentUser.getGender());\n\n//\t\t\tif(search_intake_reference(gender,currentUser.getAge())) {\n\t\t\t\tArrayList<Double> plan = new ArrayList<Double>();\n\t\t\t\tPreparedStatement ref = connection.prepareStatement(\"SELECT * FROM intake_reference WHERE gender = ? AND min_age <= ? AND max_age >= ?\" );\n\t\t\t\tref.setString(1, gender);\n\t\t\t\tref.setInt(2, currentUser.getAge());\n\t\t\t\tref.setInt(3, currentUser.getAge());\n\t\t\t\tResultSet result = ref.executeQuery();\n\t\t\t\twhile (result.next()) {\n\t\t\t\t\tplan.add(result.getDouble(8));//fiber0\n\t\t\t\t\tplan.add(result.getDouble(9));//energy1\n\t\t\t\t\tplan.add(result.getDouble(10));//protein2\n\n\t\t\t\t\tplan.add(result.getDouble(4));//fiber_serve3\n\t\t\t\t\tplan.add(result.getDouble(5));//energy_serve4\n\t\t\t\t\tplan.add(result.getDouble(6));//meat_serve5\n\t\t\t\t\tplan.add(result.getDouble(7));//milk_serve6\n\t\t\t\t}\n\n\t\t\t\tref.close();\n\t\t\t\tresult.close();\n\n\t\t\t\tPreparedStatement stmt = connection.prepareStatement(\n\t\t\t\t\t\t\"INSERT INTO diet_plan VALUES (?,?,?,?,?,?,?,?,?,?)\");//id | fiber | energy | protein | food_name | food_amount\n\t\t\t\t//String gender = new StringBuilder().append(\"\").append(currentUser.getGender()).toString();\n\n\t\t\t\tstmt.setString(1, currentUser.getID());\n\n\t\t\t\tstmt.setDouble(2, plan.get(0));//fiber\n\t\t\t\tstmt.setDouble(3, plan.get(1));//energy\n\t\t\t\tstmt.setDouble(4, plan.get(2));//protein\n//\t\t\t\tstmt.setDouble(2, 0.5);//fiber\n//\t\t\t\tstmt.setDouble(3, 0.5);//energy\n//\t\t\t\tstmt.setDouble(4, 0.5);//protein\n\n\t\t\t\t//set the food_name\n\t//\t\t\tstmt.setString(5,\"default\");//default value\n\t//\t\t\t//set the food_amount\n\t\t\t\t//set the food_name\n\t\t\t String[] food_name = new String[2];\n\t\t\t food_name[0] = \"apple\";\n\t\t\t food_name[1] = \"milk\";\n\t\t\t Array sqlArray1 = connection.createArrayOf(\"text\",food_name);\n\t\t\t stmt.setArray(5,sqlArray1);\n\t\t\t //set the food_amount\n\t\t\t //int[] food_amount = new int[2];\n\t\t\t Integer[] food_amount = new Integer[2];\n\t\t\t food_amount[0] = 10;\n\t\t\t food_amount[1] = 5;\n\t\t\t Array sqlArray2 = connection.createArrayOf(\"integer\",food_amount);\n\t\t\t stmt.setArray(6,sqlArray2);\n\t//\t\t\tString[] food_name = new String[2];\n\t//\t\t\tint[] food_amount = new int[2];\n\t//\t\t\tstmt.setArray(5, food_name);//fiber_serve\n\t//\t\t\tstmt.setArray(6, food_amount);//energy_serve\n\t//\t\t\tstmt.setString(6,\"default\");//default value\n//\t\t\t\tstmt.setDouble(7, 0.5);//fiber_serve\n//\t\t\t\tstmt.setDouble(8, 0.5);//energy_serve\n//\t\t\t\tstmt.setDouble(9, 0.5);//meat_serve\n//\t\t\t\tstmt.setDouble(10, 0.5);//milk_serve\n\t\t\t\tstmt.setDouble(7, plan.get(3));//fiber_serve\n\t\t\t\tstmt.setDouble(8, plan.get(4));//energy_serve\n\t\t\t\tstmt.setDouble(9, plan.get(5));//meat_serve\n\t\t\t\tstmt.setDouble(10, plan.get(6));//milk_serve\n\n\t\t\t\tstmt.execute();\n\t\t\t\tstmt.close();\n\t\t\t\tconnection.close();\n\n//\t\t\t}\n//\t\t\telse {\n//\t\t\t\tPreparedStatement stmt = connection.prepareStatement(\n//\t\t\t\t\t\t\"INSERT INTO diet_plan VALUES (?,?,?,?,?,?,?,?,?,?)\");//id | fiber | energy | protein | food_name | food_amount\n//\n//\t\t\t\tstmt.setString(1, currentUser.getID());\n//\t\t\t\tstmt.setDouble(2, 40);//fiber\n//\t\t\t\tstmt.setDouble(3, 717);//energy\n//\t\t\t\tstmt.setDouble(4, 57);//protein\n//\t\t\t\t//set the food_name\n////\t\t\t\tstmt.setString(5,\"default\");//default value\n////\t\t\t\t//set the food_amount\n//\t\t\t\t//set the food_name\n//\t\t\t\t String[] food_name = new String[2];\n//\t\t\t\t food_name[0] = \"apple\";\n//\t\t\t\t food_name[1] = \"milk\";\n//\t\t\t\t Array sqlArray1 = connection.createArrayOf(\"text\",food_name);\n//\t\t\t\t stmt.setArray(5,sqlArray1);\n//\t\t\t\t //set the food_amount\n//\t\t\t\t //int[] food_amount = new int[2];\n//\t\t\t\t Integer[] food_amount = new Integer[2];\n//\t\t\t\t food_amount[0] = 10;\n//\t\t\t\t food_amount[1] = 5;\n//\t\t\t\t Array sqlArray2 = connection.createArrayOf(\"integer\",food_amount);\n//\t\t\t\t stmt.setArray(6,sqlArray2);\n////\t\t\t\tString[] food_name = new String[2];\n////\t\t\t\tint[] food_amount = new int[2];\n////\t\t\t\tstmt.setArray(5, food_name);//fiber_serve\n////\t\t\t\tstmt.setArray(6, food_amount);//energy_serve\n////\t\t\t\tstmt.setString(6,\"default\");//default value\n//\t\t\t\tstmt.setDouble(7, 8);//fiber_serve\n//\t\t\t\tstmt.setDouble(8, 6);//energy_serve\n//\t\t\t\tstmt.setDouble(9, 3);//meat_serve\n//\t\t\t\tstmt.setDouble(10, 2.5);//milk_serve\n//\n//\t\t\t\tstmt.execute();\n//\t\t\t\tstmt.close();\n//\t\t\t\tconnection.close();\n//\t\t\t}\n\n\t\t} catch (Exception e) {\n\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public static void generatereports(){\r\n\t\t\r\n\t\tAccount a = (Account) Cache.get(\"authUser\");\r\n\t\t\r\n\t\tDealer d = Dealer.find(\"byDealershipId\", a.uniquenumber).first();\r\n\t\tif(a!= null)\r\n\t\t{\r\n\t\t\t/*\r\n\t\t\t * Get the list of orders placed for this dealer\r\n\t\t\t *Classify it as Total Confirmed \r\n\t\t\t *Total Delivered and so on \r\n\t\t\t *\r\n\t\t\t */\r\n\t\t\tList<OrderCylinder> totalorders = OrderCylinder.find(\"byDealerId\",d).fetch();\r\n\t\t\t//List<OrderCylinder> confirmorders = OrderCylinder.f\r\n\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tDealerControllerMap.pleaselogin();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"public DataUsage getusageData(int uid)\n {\n Calendar calendar=Calendar.getInstance();\n long to=calendar.getTimeInMillis();\n calendar.add(Calendar.DAY_OF_MONTH,-30);\n long from=calendar.getTimeInMillis();\n\n double total=0;\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {\n NetworkStatsManager service=context.getSystemService(NetworkStatsManager.class);\n NetworkStats bucket= null;\n try {\n bucket = service.queryDetailsForUid(ConnectivityManager.TYPE_WIFI,\"\",from,to,uid);\n double received=0;\n double send=0;\n\n //get the details along with the time of data usage of an application\n while (bucket.hasNextBucket())\n {\n NetworkStats.Bucket tempbucket=new NetworkStats.Bucket();\n bucket.getNextBucket(tempbucket);\n received=(double)tempbucket.getRxBytes()+received;\n send=(double)tempbucket.getTxBytes()+send;\n }\n bucket.close();\n DataUsage temp =new DataUsage();\n double uploaded=send/(1024*1024);\n double downloaded=received/(1024*1024);\n\n total=(received+send)/(1024*1024);\n\n temp.setDownload(\"\"+String.format(\"%.2f\",downloaded));\n temp.setUpload(\"\"+String.format(\"%.2f\",uploaded));\n temp.setTotal(\"\"+String.format(\"%.2f\",total));\n return temp;\n\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n\n }\n\n return null;\n }",
"public double getCharges()\r\n {\r\n //variables\r\n double charges = 0.0;\r\n double parts = 0.0;\r\n double hours = 0.0;\r\n\r\n //get user input and change double\r\n parts = Double.parseDouble(chargeField.getText());\r\n hours = Double.parseDouble(hourField.getText());\r\n\r\n //math for charges\r\n charges = hours * LABOR_RATE + parts;\r\n return charges;\r\n }",
"public Breakdown generateDiurnalReport(Date startDate, String[] demoArr) {\n\n Breakdown result = new Breakdown();\n AppUsageDAO auDAO = new AppUsageDAO();\n Date startHour = startDate;\n SimpleDateFormat sdf = new SimpleDateFormat(\"HH:00\");\n //for each hour (for 24 loop)\n for (int i = 0; i < 24; i++) {\n\n HashMap<String, Breakdown> miniMap = new HashMap<String, Breakdown>();\n result.addInList(miniMap);\n\n Date endHour = new Date(startHour.getTime() + 1000 * 60 * 60);\n miniMap.put(\"period\", new Breakdown(sdf.format(startHour) + \"-\" + sdf.format(endHour)));\n\n //get number of targetted users\n Date endDate = new Date(startDate.getTime() + 1000 * 60 * 60 * 24);\n ArrayList<User> targetList = auDAO.retrieveUserByDemo(startDate, endDate, demoArr);\n int targetCount = targetList.size();\n //get userList for this hour, filtered by demo\n ArrayList<User> userList = auDAO.retrieveUserByDemo(startHour, endHour, demoArr);\n double secondsThisHour = 0;\n\n //for each user\n for (User user : userList) {\n\n //retrieve appUsageList\n ArrayList<AppUsage> auList = auDAO.retrieveByUserHourly(user.getMacAddress(), startHour, endHour);\n\n Date oldTime = null;\n if (auList.size() > 0) {\n oldTime = auList.get(0).getDate();\n }\n\n //For each appusage in appUsageList\n for (int j = 1; j < auList.size(); j++) {\n Date newTime = auList.get(j).getDate();\n\n //calculate usageTime and add to secondsThisHour\n //difference between app usage timing\n long difference = Utility.secondsBetweenDates(oldTime, newTime);\n\n //If difference less than/equal 2 minutes\n if (difference <= 2 * 60) {\n // add difference to totalSeconds if <= 2 mins\n secondsThisHour += difference;\n } else {\n // add 10sec to totalSeconds if > 2 mins\n secondsThisHour += 10;\n }\n\n oldTime = newTime;\n\n }\n //Add 10 seconds for the last appusage in the list\n if (auList.size() > 0) {\n Date lastTime = auList.get(auList.size() - 1).getDate();\n\n long difference = Utility.secondsBetweenDates(lastTime, endHour);\n\n if (difference > 10) {\n difference = 10;\n }\n secondsThisHour += difference;\n\n }\n\n }\n //divide by all users in this hour to get average usage time in this hour\n if (targetCount > 0) {\n secondsThisHour /= targetCount;\n\n }\n\n //store in breakdown\n long time = Math.round(secondsThisHour);\n miniMap.put(\"duration\", new Breakdown(\"\" + time));\n\n startHour = endHour;\n }\n\n return result;\n }",
"private void getCustomerData() {\r\n\t\t// get next customer data : from file or random number generator\r\n\t\t// set anyNewArrival and transactionTime\r\n\t\t// see readme file for more info\r\n\r\n\t\tif (dataSource == 1) { // file\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0/1 random or file input\r\n\t\t\t\t\tif (dataFile.hasNextInt()) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// checks for a line of information\r\n\t\t\t\t\t\tint data1 = dataFile.nextInt();\t\t\t\t\t\t\t\t\t\t\t\t\t\t// every line has 2 numbers of info\r\n\t\t\t\t\t\tint data2 = dataFile.nextInt();\r\n\t\t\t\t\t\tanyNewArrival \t= (((data1%100)+1)<= chancesOfArrival);\t\t// computes anyNewArrival boolean\r\n\t\t\t\t transactionTime = (data2%maxTransactionTime)+1;\t\t\t\t\t// computes transactionTime integer\r\n\t\t\t\t\t}\r\n\t\t} else { // random\r\n\t\t\tdataRandom = new Random();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// generates random boolean and int\r\n\t\t\tanyNewArrival \t= ((dataRandom.nextInt(100) + 1) <= chancesOfArrival);\r\n\t\t\ttransactionTime = dataRandom.nextInt(maxTransactionTime) + 1;\r\n\t\t}\r\n\t}",
"Map<UUID, Double> getOwners();",
"public static UserBill generateBill(String userName, UserContract contract, Collection<FlexOffer> flexOffers,\n\t\t\t\t\t\t\t\t\t\tTimeSeries userMeasurements) {\n\t\tUserBill bill = new UserBill();\n\n\t\tbill.setUserName(userName);\n\t\t\n\t\t// Calculate statistics \n\t\tfor(FlexOffer f : flexOffers) {\n\n /* Increment flexoffers*/\n bill.setNumFlexOffers(bill.getNumFlexOffers() + 1);\n\n /* Calculate total imbalance */\n if (f.getFlexOfferSchedule() != null) {\n bill.setExecutionImbalance(f.getFlexOfferSchedule().computeImbalance(userMeasurements, 0.0));\n }\n\n\t\t\tif(!isExecutedCorrectly(f, contract, userMeasurements)) {\n\t\t\t\tbill.setNumOfExecutedFlexOffers(bill.getNumOfExecutedFlexOffers() + 1);\n\n\t\t\t\t// No further reward given\n\t\t\t\tcontinue;\n\t\t\t}\n\n\n\t\t\t\t\n\t\t\t/* Add time flexibility part */\n\t\t\tbill.setTotalTimeFlex(bill.getTotalTimeFlex() + (f.getStartBeforeInterval() - f.getStartAfterInterval()));\n\t\t\t\n\t\t\t/* Add energy flexibility part */\n\t\t\tfor(FlexOfferSlice s : f.getFlexOfferProfileConstraints()) {\n\t\t\t\tbill.setTotalEnergyFlex(bill.getTotalEnergyFlex() + (s.getEnergyUpper(0) - s.getEnergyLower(0)));\n\t\t\t}\n\t\t\t\n\t\t\t/* Add scheduling part */\n\t\t\tif ((f.getDefaultSchedule() != null) && (f.getFlexOfferSchedule() != null) &&\n\t\t\t\t(f.getFlexOfferSchedule().getScheduleSlices().length == f.getFlexOfferProfileConstraints().length) &&\n\t\t\t\t(f.getFlexOfferSchedule().getScheduleSlices().length == f.getDefaultSchedule().getScheduleSlices().length) &&\n\t\t\t\t(!f.getFlexOfferSchedule().equals(f.getDefaultSchedule()))) {\n\t\t\t\t\n\t\t\t\t// Check if there're baseline deviations\n\t\t\t\tboolean deviations = f.getDefaultSchedule().getStartInterval() != f.getFlexOfferSchedule().getStartInterval();\n\t\t\t\tfor(int sid = 0; sid < f.getFlexOfferProfileConstraints().length; sid++) {\n\t\t\t\t\tif (Math.abs(f.getDefaultSchedule().getScheduleSlice(sid).getEnergyAmount() -\n\t\t\t\t\t\t\t\t f.getFlexOfferSchedule().getScheduleSlice(sid).getEnergyAmount()) > 1e-3) {\n\t\t\t\t\t\tdeviations = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\n\t\t\t\t\n\t\t\t\tif (deviations) {\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t/* Incremenent custom schedule activation count */\n\t\t\t\t\tbill.setNumCustomScheduleActivations(bill.getNumCustomScheduleActivations() + 1);\n\t\t\t\t\n\t\t\t\t\t/* Give a reward depending on deviations from default ... */\t\t\t\t\n\t\t\t\t\t/* ... for start-time deviation */\n\t\t\t\t\tbill.setTotalStartTimeDeviations(bill.getTotalStartTimeDeviations() + \n\t\t\t\t\t\t\tMath.abs(f.getFlexOfferSchedule().getStartInterval() - f.getDefaultSchedule().getStartInterval()));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t/* ... for energy deviations */\n\t\t\t\t\tfor(int i=0; i<f.getFlexOfferSchedule().getScheduleSlices().length; i++) {\n\t\t\t\t\t\tbill.setTotalEnergyDeviations(bill.getTotalEnergyDeviations() + Math.abs(f.getFlexOfferSchedule().getScheduleSlice(i).getEnergyAmount() -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t f.getDefaultSchedule().getScheduleSlice(i).getEnergyAmount()));\n\t\t\t\t\t}\t\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Compute actual reward amounts */\t\t\n\t\tbill.setRewardFixed(flexOffers.isEmpty() ? 0 : contract.getFixedReward());\n\t\tbill.setRewardTotalTimeFlex(bill.getTotalTimeFlex() * contract.getTimeFlexReward());\n\t\tbill.setRewardTotalEnergyFlex(bill.getTotalEnergyFlex() * contract.getEnergyFlexReward());\t\t\n\t\tbill.setRewardTotalSchedFixed(bill.getNumCustomScheduleActivations() * contract.getSchedulingFixedReward());\n\t\tbill.setRewardTotalSchedEST(bill.getTotalStartTimeDeviations() * contract.getSchedulingStartTimeReward());\n\t\tbill.setRewardTotalSchedEnergy(bill.getTotalEnergyDeviations() * contract.getSchedulingEnergyReward());\n\t\tbill.setRewardTotal(bill.getRewardFixed() + \n\t\t\t\t\t\t bill.getRewardTotalEnergyFlex() + \n\t\t\t\t\t\t bill.getRewardTotalSchedEnergy() +\n\t\t\t\t\t\t bill.getRewardTotalSchedEST() + \n\t\t\t\t\t\t bill.getRewardTotalSchedFixed() + \n\t\t\t\t\t\t bill.getRewardTotalTimeFlex());\n\t\t\n\t\treturn bill;\n\t}",
"@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic User requestVehicleACControl(long userId, String ACfeatureType, String ACStatus, String ACtemp,\n\t\t\tString ACFanSpeed, String rearACTemp) {\n\t\tdatasource = getDataSource();\n\t\tjdbcTemplate = new JdbcTemplate(datasource);\n\t\tlogger.info(\"IN requestVehicleACControl \");\n\t\tUser user = new User();\n\t\t// Check if head Unit is registered with given userID\n\t\tString check_query = \"select count(1) from headunit where user_id = ?\";\n\n\t\tint result = jdbcTemplate.queryForObject(check_query, new Object[] { userId }, Integer.class);\n\n\t\tif (result > 0) {\n\t\t\t// check if record exists for userID\n\t\t\t// get GCM key\n\t\t\tString gcm_key_query = \"select gcmregistartionkey from headunit where user_id = ?\";\n\n\t\t\tString query_result = (String) jdbcTemplate.queryForObject(gcm_key_query, new Object[] { userId },\n\t\t\t\t\tString.class);\n\n\t\t\tSystem.out.println(\"GCM KEY ============================= \" + query_result);\n\t\t\t// if GCM key available\n\t\t\t// preapre message\n\t\t\tif (query_result != null && !query_result.isEmpty()) {\n\t\t\t\tSender sender = new Sender(utilityObj.getGcmApiKeySimuapp());\n\t\t\t\t// build message based on featureType and featurestatus\n\t\t\t\tJSONObject obj = new JSONObject();\n\t\t\t\tobj.put(\"featuretype\", ACfeatureType);\n\t\t\t\tobj.put(\"featurestatus\", ACStatus);\n\t\t\t\tobj.put(\"actemp\", ACtemp);\n\t\t\t\tobj.put(\"acfanspeed\", ACFanSpeed);\n\t\t\t\tobj.put(\"rearactemp\", rearACTemp);\n\t\t\t\tString prepare_msg = obj.toJSONString();\n\t\t\t\tgcm_message = new Message.Builder().timeToLive(30).delayWhileIdle(true)\n\t\t\t\t\t\t.addData(MESSAGE_KEY, prepare_msg).build();\n\t\t\t\tResult gcm_result = null;\n\t\t\t\t// get gcm_message and gcm_register key\n\t\t\t\t// send message to that gcm_register_key\n\t\t\t\t// set message and status\n\t\t\t\ttry {\n\t\t\t\t\tgcm_result = sender.send(gcm_message, query_result, 1);\n\t\t\t\t\tlogger.info(\" IN REQUEST VEHICLE AC CONTROL SERVICE GCM REASULT : \" + gcm_result.toString());\n\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tuser.setUserid(userId);\n\t\t\t\tuser.setFeaturetype(ACfeatureType);\n\t\t\t\tuser.setFeaturestatus(ACStatus);\n\t\t\t\tuser.setStatus(true);\n\t\t\t\tuser.setMessage(prepare_msg);\n\t\t\t\tuser.setActemp(ACtemp);\n\t\t\t\tuser.setAcfanspeed(ACFanSpeed);\n\t\t\t\tuser.setRearactemp(rearACTemp);\n\t\t\t\tuser.setGcmregistartionkey(query_result);\n\t\t\t} else {\n\t\t\t\tuser.setMessage(\"NO GCM KEY FOUND\");\n\t\t\t}\n\t\t} else {\n\t\t\t// if head unit registered\n\t\t\t// set meassage and status\n\t\t\tuser.setStatus(false);\n\t\t\tuser.setMessage(\"NO HEAD UNIT REGISTERED FOR GIVEN USERID : \" + userId);\n\t\t\tlogger.info(\"NO HEAD UNIT REGISTERED FOR GIVEN USERID : \" + userId);\n\t\t}\n\t\treturn user;\n\t}",
"public void queryDevices(){\r\n\r\n\r\n reportsDb.get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {\r\n\r\n\r\n\r\n\r\n\r\n @Override\r\n public void onComplete(@NonNull Task<QuerySnapshot> task) {\r\n if(task.isSuccessful()){\r\n\r\n\r\n //Gets the snapshot of the database and added into a map data structure\r\n for (QueryDocumentSnapshot doc: task.getResult()){\r\n\r\n\r\n\r\n Map<String, Object> queryData = doc.getData();\r\n\r\n deviceID.add(doc.getId());\r\n deviceNames.add(queryData.get(\"Name\").toString());\r\n\r\n\r\n\r\n }\r\n\r\n //Passing in data into the recycler from the query, to create a list like view\r\n initialiseRecycler(deviceID, deviceNames);\r\n\r\n\r\n\r\n\r\n }\r\n\r\n }\r\n });\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n }",
"public String meterRead(String MuserName, String year, String month)\r\n\t{\r\n\t\t\r\n\t\tBufferedReader reader = null;\r\n\t\tfileName=\"meterreading.csv\";\r\n\t\tFile file = new File(fileName);\r\n\t\t\r\n\t\t\r\n\t\t//convert the month input\r\n\t\tswitch(month)\r\n\t\t{\r\n\t\t\tcase \"January\": monthDate=\".1.31\"; break;\r\n\t\t\tcase \"February\": monthDate=\".2.28\"; break;\r\n\t\t\tcase \"March\": monthDate=\".3.31\"; break;\r\n\t\t\tcase \"April\": monthDate=\".4.30\"; break;\r\n\t\t\tcase \"May\": monthDate=\".5.31\"; break;\r\n\t\t\tcase \"June\": monthDate=\".6.30\"; break;\r\n\t\t\tcase \"July\": monthDate=\".7.31\"; break;\r\n\t\t\tcase \"August\": monthDate=\".8.31\"; break;\r\n\t\t\tcase \"September\": monthDate=\".9.30\"; break;\r\n\t\t\tcase \"October\": monthDate=\".10.31\"; break;\r\n\t\t\tcase \"November\": monthDate=\".11.30\"; break;\r\n\t\t\tcase \"December\": monthDate=\".12.31\"; break;\r\n\t\t\tdefault: monthDate=\"NULL\";\r\n\t\t}\r\n\t\tdate=year+monthDate;\r\n\t\ttry\r\n\t\t{\r\n\t\t\treader=new BufferedReader(new FileReader(file));\r\n\t\t\twhile((bill=reader.readLine()) != null)\r\n\t \t{\r\n\t\t\t\t\r\n\t\t\t\tString Str[]=bill.split (\"\\\\,\");//split the every list of string in one line into\r\n\t\t\t\t\t\t\t\t\t\t\t\t//several string by \" , \"\r\n\t\r\n\t \t\twhile( (Str[0].equals(MuserName)) && (Str[1].equals(date)))\r\n\t \t\t{\r\n\t \t\t\t\r\n\t \t\t\teBill=Str[3];\r\n\t \t\t\tgBill=Str[5];\r\n\r\n\t \t\t\tSystem.out.print(\"The bill of the user \");\r\n\t \t\t\t\tSystem.out.print(MuserName);\r\n\t \t\t\tSystem.out.print(\" on \");\r\n\t \t\t\tSystem.out.print(year+\" \"+month);\r\n\t \t\t\tSystem.out.print(\" is: Electricity bill \");\r\n\t \t\t\tSystem.out.print(eBill);\r\n\t \t\t\tSystem.out.print(\"| Gas bill \");\r\n\t \t\t\tSystem.out.println(gBill+\"\\n\");\r\n\t \t\t\t//sBill[0]=eBill;\r\n\t \t\t\t//sBill[1]=gBill;\r\n\t \t\t\t//System.out.println(sBill[0]+\"****\");\r\n\t \t\t\tg=true;\r\n\t \t\t\tbreak;\r\n\t \t\t}\r\n\t \t\tif(g==true)\r\n\t \t\t\tbreak;\r\n\t \t\treturn \"NO\";\r\n\t \t}\r\n\t\t\treader.close();\r\n\t\t\treturn bill;\r\n\t\t}catch(IOException e)\r\n\t {\r\n\t\t\te.printStackTrace();\r\n\t }finally\r\n\t {\r\n\t \tif(reader!=null)\r\n\t \t{\r\n\t \t\ttry\r\n\t \t\t{\r\n\t \t\t\treader.close();\r\n\t \t\t}\r\n\t \t\tcatch(IOException e1) {\r\n\t \t\t\treturn \"NO\";\r\n\t \t\t}\r\n\t \t}\r\n\t }\r\n \treturn bill;\r\n\t}",
"private void setDistanceValues(){\n float [] sumDistances = new float[1];\n\n distanceValue =0.0;\n\n for(int i= 0; i < trackingList.size()-1;i++){\n double startLong = trackingList.get(i).getLongtitude();\n double startLat = trackingList.get(i).getLatitude();\n double endLong = trackingList.get(i+1).getLongtitude();\n double endLat = trackingList.get(i+1).getLatitude();\n\n Location.distanceBetween(startLat,startLong,endLat,endLong,sumDistances);\n \n distanceValue += sumDistances[0];\n }\n\n }",
"@RequestMapping(method = RequestMethod.POST)\n\tpublic String processRegistration(@ModelAttribute(\"convertMain\") userOption userDetails, \n\t\t\tMap<String, Object> model) {\n\t\t\n\t\tconveter myConverter = new conveter(userDetails.getUserInput());\n\t\t\n\t\t double resultMileToKilo =myConverter.convertMileToKilometers(myConverter.getUserInput());\n\t\tSystem.out.println(\"user input: \" +userDetails.getUserInput());\n\t\tSystem.out.println(\"convert from : \" + userDetails.getSelectedConvFrom());\n\t\tSystem.out.println(\"convert to : \" + userDetails.getSelectedConvTo());\n\t\t//System.out.println(\"mile: \"+myConverter.getUserInput()+\" to kilometers : \"+resultMileToKilo);\n\n\t\tif(userDetails.getSelectedConvFrom().equalsIgnoreCase(userDetails.getSelectedConvTo()))\n\t\t{\n\t\t\treturn \"errorPage\";\n\t\t}\n\t\t\n\t\t//compute\n\t\tdouble result=myConverter.computeCalc(userDetails.getSelectedConvFrom(), userDetails.getSelectedConvTo(), userDetails.getUserInput());\n\t\tString unitlength=myConverter.getUnit(userDetails.getSelectedConvTo());\n\t\t\n\t\t\n\t\tSystem.out.println(\"results: \"+result);\n\t\tmodel.put(\"resultsvalue\", result+unitlength);\n\t\treturn \"results\";\n\t\t\n\t\t\n\t}",
"public double getCredits(User user) throws Exception;",
"public void consume (User user) {\n \n for (StoredPower theirStoredPower : user.superPowers) {\n StoredPower myStoredPower = getOrCreateStoredPower(theirStoredPower.power);\n myStoredPower.used += theirStoredPower.used;\n \n // dont regift the icebreakers you get for free\n if (theirStoredPower.power == Power.ICE_BREAKER) {\n int add = Math.max(0, theirStoredPower.available - INITIAL_ICE_BREAKERS);\n myStoredPower.available += add;\n } else if (theirStoredPower.power == Power.KARMA) {\n int add = Math.max(0, theirStoredPower.available - INITIAL_KARMA);\n myStoredPower.available += add; \n } else {\n myStoredPower.available += theirStoredPower.available;\n }\n myStoredPower.level = Math.max(myStoredPower.level, theirStoredPower.level);\n myStoredPower.save();\n }\n \n for (Integer i : user.getSeenIceBreakers()) {\n this.addSeenIceBreaker(i);\n }\n \n for (KarmaKube k : user.getKubes()) {\n k.recipient_id = this.id;\n k.save(); \n }\n \n for (Long group_id : UserExclusion.userGroups(user.id)) {\n new UserExclusion(this.id, group_id);\n }\n \n this.coinCount += user.coinCount;\n this.coinsEarned += user.coinsEarned;\n this.chatTime += user.chatTime; \t\n this.messageCount += user.messageCount;\n this.gotMessageCount += user.gotMessageCount;\n this.joinCount += user.joinCount;\n this.offersMadeCount += user.offersMadeCount; \t\t\n this.offersReceivedCount += user.offersReceivedCount; \t\n this.revealCount += user.revealCount;\n this.save();\n \n user.delete();\n\t}",
"private void getMatches(){\r\n\t\tString cLong = commandList.get(2);//holds client's longitude in string form\r\n\t\tString cLat = commandList.get(3);//holds the client's latitude in String form\r\n\r\n\t\tArrayList<String> matchList = new ArrayList<>();//holds user names of found matches\r\n\t\t\r\n\t\tString[] clientPSliders = getPSliders(commandList.get(1));\r\n\r\n\t\t//load in SQL command to find matches using given client's min and max values\r\n\t\tcommand =\"SELECT location.userName FROM (location INNER JOIN users \"\r\n\t\t\t\t+ \"ON location.userName = users.userName) INNER JOIN personalSlider \"\r\n\t\t\t\t+ \"ON users.userName = personalSlider.userName WHERE (((location.longitude) <= \";\r\n\t\tcommand += roundLongUp(cLong) + \" And (location.longitude) >= \";\r\n\t\tcommand += roundLongDown(cLong) + \") AND ((location.latitude) <= \";\r\n\t\tcommand += roundLatUp(cLat) + \" And (location.latitude) >= \";\r\n\t\tcommand += roundLatDown(cLat) + \") AND ((personalSlider.pGender) >= \";\r\n\t\tcommand += commandList.get(4) + \" And (personalSlider.pGender) <= \" + commandList.get(5);\r\n\t\tcommand += \" AND ((personalSlider.pExpression) >= \" + commandList.get(6) +\r\n\t\t\t\t\" And (personalSlider.pExpression) <= \" + commandList.get(7) + \")\";\r\n\t\tcommand += \" AND ((personalSlider.pOrientation) >= \" + commandList.get(8) +\r\n\t\t\t\t\" And (personalSlider.pOrientation) <= \" + commandList.get(9) + \")));\";\r\n\r\n\t\t\r\n\t\ttry {//try block for sending SQL command\r\n\t\t\trs = stmt.executeQuery(command);//send command\r\n\r\n\t\t\twhile(rs.next()){//while there are matches\r\n\t\t\t\tmatchList.add(rs.getString(\"userName\"));//load userName\r\n\t\t\t}\r\n\r\n\t\t\t//each String[] is a match, 0 = userName, 1 = pGenderMin, .....6=pOrientationMax, 7=distance (used later)\r\n\t\t\tArrayList<String[]> fullMatches = getSeekingSlider(matchList);\r\n\r\n\t\t\t//remove the non-overlapping matches, pass clients ratings and the list of matches\r\n\t\t\tcrossMatch(strArrToIntArr(clientPSliders), fullMatches);\r\n\t\t\t\r\n\t\t\t//remove matches over 25 miles away\r\n\t\t\tlimitDistance(Double.valueOf(cLat), Double.valueOf(cLong), fullMatches);\r\n\t\t\t\r\n\t\t\trs = null;//null the result set\r\n\t\t\t\r\n\t\t\tString[] tempStrArr;//holds the personal slider for the current match\r\n\t\t\tfor(String[] currArr: fullMatches){//for all the remaining matches\r\n\t\t\t\ttempStrArr = getPSliders(currArr[0]);//get personal slider for current matches\r\n\t\t\t\tout.println(tempStrArr[0] + \", \" + tempStrArr[1] + \", \"//loads userName, pGen, pExpr, pOrient\r\n\t\t\t\t\t\t\t+ tempStrArr[2] + \", \" + tempStrArr[3] + \", \" + currArr[7]);//line 2\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\tout.println(e.getMessage());\r\n\t\t}\r\n\t}",
"private void populateCharges() {\n\t\tseenCharges.clear();\n\n\t\t// add bots and LEDs\n\t\tfor (int i = 0; i < seenBots.size(); i++) {\n\t\t\t// add the bot\n\t\t\tseenCharges.add(seenBots.get(i));\n\t\t\t// go through LEDs of bot and add\n\t\t\tfor (int j = 0; j < seenBots.get(i).getNoOfLEDs(); j++) {\n\t\t\t\tseenCharges.add(seenBots.get(i).LEDs.get(j));\n\t\t\t}\n\t\t}\n\t}",
"private void loadAllAvailableDriver(final LatLng location) {\n\n mMap.clear();\n mUserMarker = mMap.addMarker(new MarkerOptions()\n .icon(BitmapDescriptorFactory.fromResource(R.drawable.marker))\n .position(location)\n .title(\"Your Location\"));\n //move camera to this position\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(location, 15.0f));\n\n\n //Load all available drivers in 3 km distance\n DatabaseReference driverLocation = FirebaseDatabase.getInstance().getReference(Common.driver_tb1);\n GeoFire gf = new GeoFire(driverLocation);\n\n GeoQuery geoQuery = gf.queryAtLocation(new GeoLocation(location.latitude, location.longitude), distance);\n geoQuery.removeAllListeners();\n\n geoQuery.addGeoQueryEventListener(new GeoQueryEventListener() {\n @Override\n public void onKeyEntered(String key, final GeoLocation location) {\n //Using key to get email from table Users\n //Table users is table when drivers register account and update information\n FirebaseDatabase.getInstance().getReference(Common.user_driver_tb1)\n .child(key)\n .addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n //because rider and user model is same properties\n //so we can use Rider model to get User here\n Rider rider = dataSnapshot.getValue(Rider.class);\n\n //Add driver to map\n mMap.addMarker(new MarkerOptions()\n .position(new LatLng(location.latitude, location.longitude))\n .flat(true)\n .snippet(\"Phone :\")\n .icon(BitmapDescriptorFactory.fromResource(R.drawable.car)));\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n }\n\n @Override\n public void onKeyExited(String key) {\n\n }\n\n @Override\n public void onKeyMoved(String key, GeoLocation location) {\n\n }\n\n @Override\n public void onGeoQueryReady() {\n if (distance <= LIMIT) { //distance find upto 3 km\n distance++;\n loadAllAvailableDriver(location);\n\n }\n\n }\n\n @Override\n public void onGeoQueryError(DatabaseError error) {\n\n }\n });\n }",
"public float getDistances(User user, long time) {\n Log.d(TAG, \"getDistances\");\n //TODO: not try-catch like this\n try {\n float distance = user.getDistances(time);\n Log.d(TAG + \"getDistances\", \"distance =\" + String.valueOf(distance));\n return distance;\n } catch (Exception ex) {\n ex.printStackTrace();\n return Integer.MIN_VALUE;\n }\n }",
"private ArrayList<UserIdBean> getRegistrationGapUserIdList(\n\t\t\tint maxReturnLength, String curriculum,\n\t\t\tArrayList<UserIdBean> userList)\n\t\t\tthrows RegistrationGapUsersListSQLException,\n\t\t\tRegistrationGapUsersConnectionSQLException {\n\t\tString sourceMethod = \"getRegistrationGapUserIdList\";\n\t\tArrayList<UserIdBean> list = userList;\n\t\tString sql = null;\n\t\tString imSql = \"select p.username as username, p.id as id, ce.id as certId from tpt_ce_stud_certification stud \"\n\t\t\t\t+ \"inner join tpt_ext_ce_certification ce on ce.id = stud.certification_id \"\n\t\t\t\t+ \"inner join cmt_person p on p.id = stud.owner_id \"\n\t\t\t\t+ \"where stud.status = '100' and ce.inherited = '0' and p.custom0 = 'Incomplete' \"\n\t\t\t\t+ \"and ce.custom3 = ? \"\n\t\t\t\t+ \"and rownum <= ? and length(p.username) > 5 \"\n\t\t\t\t+ \" and extract(year from stud.expired_on) = ? \"\n\t\t\t\t+ \" and stud.id not in (select login_id from at_mlms_login_log where login_date < sysdate-1)\"\n\t\t\t\t+ \" order by p.username\";\n\t\tString shopSql = \"select p.username as username, p.id as id, ce.id as certId from tpt_ce_stud_certification stud \"\n\t\t\t\t+ \"inner join tpt_ext_ce_certification ce on ce.id = stud.certification_id \"\n\t\t\t\t+ \"inner join cmt_person p on p.id = stud.owner_id \"\n\t\t\t\t+ \"inner join AT_MLMS_AB_MISC_ATTRIBUTES m on m.person_id = stud.owner_id \"\n\t\t\t\t+ \"where stud.status = '100' and ce.inherited = '0' and m.SHOP_COMPLETION_STATUS = 'Incomplete' \"\n\t\t\t\t+ \"and ce.custom3 = ? \"\n\t\t\t\t+ \"and stud.id not in (select login_id from at_mlms_login_log where login_date < sysdate-1)\"\n\t\t\t\t+ \"and rownum <= ? and length(p.username) > 5 \"\n\t\t\t\t+ \" and extract(year from stud.expired_on) = ? \"\n\t\t\t\t+ \" order by p.username\";\n\t\tif (list == null) {\n\t\t\tlist = new ArrayList<UserIdBean>(maxReturnLength * 2);\n\t\t}\n\t\tlogger.logp(Level.FINER, sourceClass, sourceMethod,\n\t\t\t\t\" populating response with training data \");\n\t\tString curriculumStr = null;\n\n\t\tString username = null;\n\t\tString personId = null;\n\t\tConnection userListCon = null;\n\t\tUserIdBean userBean = null;\n\n\t\tResultSet rs = null;\n\t\t// CallableStatement cstmt = null;\n\t\tPreparedStatement pstmt = null;\n\n\t\tif (curriculum != null && curriculum.equalsIgnoreCase(\"IM\")) {\n\t\t\tcurriculumStr = \"Individual Marketplace\";\n\t\t\tsql = imSql;\n\t\t} else if (curriculum != null && curriculum.equalsIgnoreCase(\"SHOP\")) {\n\t\t\tcurriculumStr = \"SHOP Marketplace\";\n\t\t\tsql = shopSql;\n\t\t}\n\t\tlogger.logp(Level.FINER, sourceClass ,sourceMethod ,\" making database call to get list, input parameters \\n curriculumStr \"\n\t\t\t\t\t\t+ curriculumStr + \"\\n maxReturnLength \"\n\t\t\t\t\t\t+ maxReturnLength + \"\\n currentOfferingYear \"\n\t\t\t\t\t\t+ currentOfferingyear);\n\n\t\ttry {\n\t\t\tuserListCon = this.getConnection();\n\n\t\t\tpstmt = userListCon.prepareCall(sql);\n\t\t\tpstmt.setString(1, curriculumStr);\n\t\t\tpstmt.setInt(2, maxReturnLength);\n\t\t\tpstmt.setString(3, currentOfferingyear);\n\t\t\trs = pstmt.executeQuery();\n\n\t\t\tint count = 0;\n\t\t\t\n\t\t\twhile (rs.next()) {\n\t\t\t\tcount++;\n\t\t\t\tuserBean = new UserIdBean();\n\t\t\t\tuserBean.setUsername(rs.getString(\"username\"));\n\t\t\t\tuserBean.setPersonId(rs.getString(\"id\"));\n\t\t\t\tuserBean.setCurriculum(curriculum);\n\t\t\t\tuserBean.setCertificationId(rs.getString(\"certId\"));\n\t\t\t\tif (userBean.getUsername() != null && userBean.getPersonId() != null) {\n\t\t\t\t\tlist.add(userBean);\n\t\t\t\t\tlogger.logp(Level.FINER, sourceClass ,sourceMethod , \" username \" + userBean.getUsername());\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}//\n\t\t\tlogger.logp(Level.INFO, sourceClass ,sourceMethod ,curriculum + \" records returned from registation gap query, \" +\n\t\t\t\" size of response list is \" + list.size());\n\n\t\t} catch (SQLException e) {\n\t\t\t// if ME820 unexpected database error\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t\tthrow new RegistrationGapUsersListSQLException(sourceMethod + \" \"\n\t\t\t\t\t+ ErrorCodeType.ME_830.value() + \" \" + e.getMessage());\n\n\t\t} finally {\n\n\t\t\ttry {\n\t\t\t\tif (rs != null)\n\t\t\t\t\trs.close();\n\t\t\t\tif (pstmt != null)\n\t\t\t\t\tpstmt.close();\n\t\t\t\tif (userListCon != null)\n\t\t\t\t\tuserListCon.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\tlogger.logp(Level.SEVERE, sourceClass ,sourceMethod ,\"SQLException: Datasource resources closing error! \" + e.getMessage());\n\t\t\t\tthrow new RegistrationGapUsersListSQLException(sourceMethod\n\t\t\t\t\t\t+ \" \" + \"Datasource resources closing error!\", e);\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}",
"@Override\r\n public void onSensorChanged(SensorEvent event) {\r\n /*final DocumentReference dr = nFirestore.collection(\"User\").document(mAuth.getCurrentUser().getUid());*/\r\n if (running){\r\n steps = findViewById(R.id.steps);\r\n final Map<String,Object> userMap = new HashMap<>();\r\n Fitness.getHistoryClient(this, GoogleSignIn.getLastSignedInAccount(this))\r\n .readDailyTotal(DataType.TYPE_STEP_COUNT_DELTA)\r\n .addOnSuccessListener(\r\n new OnSuccessListener<DataSet>() {\r\n @Override\r\n public void onSuccess(DataSet dataSet) {\r\n long total =\r\n dataSet.isEmpty()\r\n ? 0\r\n : dataSet.getDataPoints().get(0).getValue(Field.FIELD_STEPS).asInt();\r\n getGroup();\r\n u.setSteps(String.valueOf(total));\r\n u.setTop(\"10\");\r\n u.setUid(mAuth.getCurrentUser().getUid());\r\n getTopPos();\r\n\r\n //u.setGroup(\"group\");\r\n /*userMap.get(\"group\") = getGroup().get(\"group\");*/\r\n //userMap.put(\"group\",getGroup().get(\"group\"));\r\n //userMap.put(\"steps\",String.valueOf(total));\r\n /*batch.update(dr,\"steps\",String.valueOf(total));*/\r\n //calculateTop();\r\n //top = calculateTop();\r\n //userMap.put(\"top\",String.valueOf(top));\r\n nFirestore.collection(\"user\").document(mAuth.getCurrentUser().getUid()).set(u);\r\n //nFirestore.collection(\"User\").document(mAuth.getCurrentUser().getUid()).set(getGroup().get(\"group\"));\r\n steps.setText(String.valueOf(total));\r\n\r\n }\r\n })\r\n .addOnFailureListener(\r\n new OnFailureListener() {\r\n @Override\r\n public void onFailure(@NonNull Exception e) {\r\n Log.w(TAGFit, \"There was a problem getting the step count.\", e);\r\n }\r\n });\r\n }\r\n }",
"public static void createElecUsage(ElectricityUsage electricityUsage) {\n URL url = null;\n HttpURLConnection connection = null;\n final String methodPath = \"/entities.electricityusage/\";\n try {\n Gson gson = new Gson();\n String stringUserJson = gson.toJson(electricityUsage);\n url = new URL(BASE_URI + methodPath);\n // open connection\n connection = (HttpURLConnection) url.openConnection();\n // set time out\n connection.setReadTimeout(10000);\n connection.setConnectTimeout(15000);\n // set connection method to POST\n connection.setRequestMethod(\"POST\");\n // set the output to true\n connection.setDoOutput(true);\n // set length of the data you want to send\n connection.setFixedLengthStreamingMode(stringUserJson.getBytes().length);\n // add HTTP headers\n connection.setRequestProperty(\"Content-Type\", \"application/json\");\n\n // send the POST out\n PrintWriter out = new PrintWriter(connection.getOutputStream());\n out.print(stringUserJson);\n out.close();\n Log.i(\"error\", new Integer(connection.getResponseCode()).toString());\n\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n connection.disconnect();\n }\n }",
"public static JSONObject optimisedGetAdvertisementsFromTheDb(String userName, String allTweetsString, int advertisementCount)\n\t{\n\t\t// Change the updating duration here\n\t\tlong userProfileRefreshRate = TimeUnit.SECONDS.toMillis(10);\n\t\t\n\t\tUserDAO userDAO = new UserDAO();\n \tUser user = userDAO.GetUser(userName);\n\n \tif(user == null)\n \t{\n \t\tSingleTweetRelationshipAnalyzer stra = new SingleTweetRelationshipAnalyzer();\n \tJSONObject newUserProfile = stra.TweetCategorizedUserProfileJSONObject(allTweetsString);\n \tuserDAO.PushNewUserToTheDatabase(userName, newUserProfile);\n \tuser = userDAO.GetUser(userName);\n \t}\n \t\n \tlong userCharatedProfileUpdatedTime = user.getUserCharacterProfileUpdatedTime();\n \t\n \tif(System.currentTimeMillis() >= (userCharatedProfileUpdatedTime + userProfileRefreshRate))\n \t{\n \t\tSystem.out.println(\"UPDATING ------> User Character Profile Updating...\");\n \t\tJSONObject newUserProfile = new SingleTweetRelationshipAnalyzer().TweetCategorizedUserProfileJSONObject(allTweetsString);\n \t\tnew UserDAO().updateUserCharacterProfileAndKeyWordProfile(userName, newUserProfile);\n \t}\n \t\n \tJSONParser parser = new JSONParser();\n \tJSONObject existingUserProfile = null;\n \t\n \ttry {\n\t\t\texistingUserProfile = OntologyReadyJSONConverter.mapDBFetchingJSONtoAlgorithmReadyJSONObj((JSONObject)parser.parse(user.getUserCharacterProfile()));\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n \tAdvertisementFetcher af = new AdvertisementFetcher();\n \tJSONObject productPrecentageJOUnmapped = af.getProductCountFinalPrecentages(existingUserProfile, advertisementCount);\n \tJSONObject productPrecentageJO = af.advertisementPrecentageProfile(productPrecentageJOUnmapped);\n \tint HTTPResopnseID = 500;\n \t\n \tAdvertisementDAO dao = new AdvertisementDAO();\n \tJSONObject recommendedAdvertisementsJO = dao.GetAdvertisementsJSONObject(productPrecentageJO, advertisementCount);\n \t \t\n \tif(recommendedAdvertisementsJO != null)\n \t{\n \t\tHTTPResopnseID = 200;\n \t}\n \t\n \tJSONObject finalReturningObj = new JSONObject();\n \tfinalReturningObj.put(\"recommendedAdvertisements\", recommendedAdvertisementsJO);\n \tfinalReturningObj.put(\"httpResponseId\", HTTPResopnseID);\n\t\t\n\t\treturn finalReturningObj;\n\t}",
"public List<Result> calculateResult()\n\t{\n\t\tpersons=calculatePersonWiseContribution(transactions,persons);\t\t\t\n\t\t\n\t\t//calculate total amount spend.\n\t\tfloat totalAmt=calculateTotalAmt(persons);\n\t\t\n\t\t//calculate total persons.\n\t\tint noOfPersons =calculateNoOfPersons(persons);\n\t\t\n\t\t//calculate amount to be contributed by each person (avg amt).\n\t\tfloat avgAmt=totalAmt/noOfPersons;\n\t\t\n\t\t//remove person who calculated = avg amt , since it is idle person hence doesnt participated in transfer money operation\n\t\tList <Person> activePersons=removePerson(persons,avgAmt);\n\t\t\n\t\t//Seperate list of persons who contributed > avg amt (credit list) and <avg amt (debit list).\t\t\n\t\tMap <String, List<Person>> creditDebitList=seperateCreditDebitPersonList(activePersons,avgAmt);\n\t\tList<Person> creditList=creditDebitList.get(\"CREDIT\");\n\t\tList<Person> debitList=creditDebitList.get(\"DEBIT\");\n\t\t\t\t\n\t\t//transfer money from debit list to credit list of persons and store the result.\n\t\t//return the result.\n\t\treturn calculate(creditList,debitList);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\t\n\t\n\t}",
"public void generateData(){\n\n users.add(new User(\"Knollwood\", \"Will\", \"password1\", \"312 Worthington Road\", 23, new ArrayList<Challenge>()));\n users.add(new User(\"Knollwood\", \"Chesapeake\", \"bae\", \"647 Contees Wharf Rd\", 215, new ArrayList<Challenge>()));\n users.add(new User(\"Knollwood\", \"Josh\", \"password2\", \"7405 Cliffbourne Court\", 24, new ArrayList<Challenge>()));\n users.add(new User(\"Knollwood\", \"Jameson\", \"password3\", \"315 Weatherbee Road\", 3, new ArrayList<Challenge>()));\n users.add(new User(\"Knollwood\", \"Franklin\", \"password4\", \"316 Murdock Road\", 9, new ArrayList<Challenge>()));\n users.add(new User(\"Knollwood\", \"Arietta\", \"password5\", \"401 Stevenson Lane\", 34, new ArrayList<Challenge>()));\n users.add(new User(\"Knollwood\", \"Joaquin\", \"pass\", \"7405 cliffborne ct\", 41, new ArrayList<Challenge>()));\n users.add(new User(\"Knollwood\", \"Beyonce\", \"\", \"7405 cliffborne ct\", 19, new ArrayList<Challenge>()));\n users.add(new User(\"Knollwood\", \"Testudo\", \"\", \"7405 cliffborne ct\", 63, new ArrayList<Challenge>()));\n users.add(new User(\"Knollwood\", \"Brick Tamland\", \"\", \"7405 cliffborne ct\", 0, new ArrayList<Challenge>()));\n\n\n\n challenges.add(new Challenge(\"FLY WITH AN E-TICKET\", Challenge.NOT_STARTED, \"The cost of processing a paper ticket is approximately $10, while processing \" +\n \"an e-ticket costs only $1. In the near future, e-tickets will be the only option, saving the airline industry $3 billion a year. In addition to financial \" +\n \"savings, the sheer amount of paper eliminated by this process is commendable.\"));\n challenges.add(new Challenge(\"GREENER LAWN CARE\", Challenge.NOT_STARTED, \"If you must water your lawn, do it early in the morning before any moisture is lost to evaporation. \" +\n \"Have a few weeds? Spot treat them with vinegar. Not sure if you should rake? Normal \" +\n \"clippings act as a natural fertilizer, let them be. If you've waited too long, rake by hand — it's excellent exercise.\"));\n challenges.add(new Challenge(\"TELECOMMUTE\", Challenge.NOT_STARTED, \"See if you can work out an arrangement with your employer that you work from home for some portion of the week.\" +\n \" Not only will you save money and gasoline, and you get to work in your pajamas!\"));\n challenges.add(new Challenge(\"GIVE IT AWAY\", Challenge.NOT_STARTED, \"Before you throw something away, think about if someone else might need it. Either donate to a charitable organization or \" +\n \"post it on a web site designed to connect people and things, such as Freecycle.org.\"));\n challenges.add(new Challenge(\"GO TO A CAR WASH\", Challenge.NOT_STARTED, \"Professional car washes are often more efficient with water consumption. If everyone in the U.S. who washes their\" +\n \" car themselves took just one visit to the car wash we could save nearly 8.7 billion gallons of water.\"));\n challenges.add(new Challenge(\"USE RECHARGABLE BATTERIES\", Challenge.NOT_STARTED, \"Each year 15 billion batteries produced and sold and most of them are disposable alkaline batteries. \" +\n \"Only a fraction of those are recycled. Buy a charger and a few sets of rechargeable batteries. Although it requires an upfront investment, it is one that should pay off in no time. \" +\n \"And on Christmas morning when all the stores are closed? You'll be fully stocked.\"));\n challenges.add(new Challenge(\"CHANGE YOUR LIGHT\", Challenge.NOT_STARTED, \"If every household in the United State replaced one regular lightbulb with one of those new compact fluorescent\" +\n \" bulbs, the pollution reduction would be equivalent to removing one million cars from the road.\\n\" +\n \"\\n\" +\n \"Don't like the color of light? Use these bulbs for closets, laundry rooms and other places where it won't irk you as much.\"));\n challenges.add(new Challenge(\"PLANT A TREE\", Challenge.NOT_STARTED, \"It's good for the air, the land, can shade your house and save on cooling (plant on the west side of your home), and they can \" +\n \"also improve the value of your property.\\n\" +\n \"\\n\" +\n \"Make it meaningful for the whole family and plant a tree every year for each member.\"));\n\n challenges.add(new Challenge(\"BAN BATHTIME!\", Challenge.NOT_STARTED, \"Have a no-bath week, and take showers instead. Baths require almost twice as much water. Not only will you reduce water \" +\n \"consumption, but the energy costs associated with heating the water.\"));\n\n challenges.add(new Challenge(\"GO VEGETARIAN ONCE A WEEK\", Challenge.NOT_STARTED, \"One less meat-based meal a week helps the planet and your diet. For example: It requires 2,500 gallons \" +\n \"of water to produce one pound of beef. You will also also save some trees. For each hamburger that originated from animals raised on rainforest land, approximately 55 square feet of forest have been destroyed.\"));\n\n// challenges.add(new Challenge(\"\", Challenge.NOT_STARTED, \"\"));\n\n users.get(0).returnChallenges().add(challenges.get(0).clone());\n users.get(0).returnChallenges().add(challenges.get(3).clone());\n users.get(1).returnChallenges().add(challenges.get(4).clone());\n users.get(1).returnChallenges().add(challenges.get(0).clone());\n users.get(2).returnChallenges().add(challenges.get(3).clone());\n users.get(2).returnChallenges().add(challenges.get(0).clone());\n users.get(3).returnChallenges().add(challenges.get(0).clone());\n users.get(3).returnChallenges().add(challenges.get(4).clone());\n users.get(4).returnChallenges().add(challenges.get(3).clone());\n users.get(4).returnChallenges().add(challenges.get(4).clone());\n users.get(5).returnChallenges().add(challenges.get(3).clone());\n users.get(5).returnChallenges().add(challenges.get(4).clone());\n\n Tree knollwood = new Tree(\"Knollwood\");\n// Tree stoneleigh = new Tree(\"StoneLeigh\");\n for(int i = 0; i < users.size(); i ++){\n knollwood.addUsers(users.get(i).clone());\n\n }\n// stoneleigh.addUsers(users.get(3).clone());\n// stoneleigh.addUsers(users.get(4).clone());\n\n\n// trees.add(stoneleigh);\n trees.add(knollwood);\n\n }",
"void getGivenUserRating(String uidRater, final RatingListResult result);",
"private String individualCalculationResupply(String[] valuesConsumables, String mglt, int Distance, int hours){\n return String.valueOf(Math.floor((Distance/Float.parseFloat(mglt))/\n ((Float.parseFloat(valuesConsumables[0]) * hours))));\n }",
"protected Totals extractRegularPaymentsForChart(String campusCode, Person puser, Date processRunDate, Batch batch) {\r\n LOG.debug(\"START - extractRegularPaymentsForChart()\");\r\n\r\n Totals totals = new Totals();\r\n\r\n java.sql.Date onOrBeforePaymentRequestPayDate = KfsDateUtils.convertToSqlDate(purapRunDateService.calculateRunDate(processRunDate));\r\n\r\n List<String> preqsWithOutstandingCreditMemos = new ArrayList<String>();\r\n\r\n Set<VendorGroupingHelper> vendors = creditMemoService.getVendorsOnCreditMemosToExtract(campusCode);\r\n for (VendorGroupingHelper vendor : vendors) {\r\n if (LOG.isDebugEnabled()) {\r\n LOG.debug(\"Processing Vendor: \" + vendor);\r\n }\r\n\r\n Map<String, List<PaymentRequestDocument>> bankCodePaymentRequests = new HashMap<String, List<PaymentRequestDocument>>();\r\n Map<String, List<VendorCreditMemoDocument>> bankCodeCreditMemos = new HashMap<String, List<VendorCreditMemoDocument>>();\r\n\r\n // Get all the matching credit memos\r\n Collection<VendorCreditMemoDocument> vendorMemos = creditMemoService.getCreditMemosToExtractByVendor(campusCode, vendor);\r\n for (VendorCreditMemoDocument cmd : vendorMemos) {\r\n List<VendorCreditMemoDocument> bankMemos = new ArrayList<VendorCreditMemoDocument>();\r\n if (bankCodeCreditMemos.containsKey(cmd.getBankCode())) {\r\n bankMemos = bankCodeCreditMemos.get(cmd.getBankCode());\r\n }\r\n\r\n bankMemos.add(cmd);\r\n bankCodeCreditMemos.put(cmd.getBankCode(), bankMemos);\r\n }\r\n\r\n // get all matching payment requests\r\n Collection<PaymentRequestDocument> vendorPreqs = paymentRequestService.getPaymentRequestsToExtractByVendor(campusCode, vendor, onOrBeforePaymentRequestPayDate);\r\n for (PaymentRequestDocument prd : vendorPreqs) {\r\n List<PaymentRequestDocument> bankPreqs = new ArrayList<PaymentRequestDocument>();\r\n if (bankCodePaymentRequests.containsKey(prd.getBankCode())) {\r\n bankPreqs = bankCodePaymentRequests.get(prd.getBankCode());\r\n }\r\n\r\n bankPreqs.add(prd);\r\n bankCodePaymentRequests.put(prd.getBankCode(), bankPreqs);\r\n }\r\n\r\n // if bank functionality enabled, create bundles by bank, else just by vendor\r\n if (bankService.isBankSpecificationEnabled()) {\r\n for (String bankCode : bankCodePaymentRequests.keySet()) {\r\n // if we have credit memos with bank code, process together, else let the preq go and will get picked up below\r\n // and processed as a single payment group\r\n if (bankCodeCreditMemos.containsKey(bankCode)) {\r\n processPaymentBundle(bankCodePaymentRequests.get(bankCode), bankCodeCreditMemos.get(bankCode), totals, preqsWithOutstandingCreditMemos, puser, processRunDate, batch);\r\n }\r\n }\r\n } else {\r\n if (vendorMemos.isEmpty()) {\r\n processPaymentBundle((List<PaymentRequestDocument>) vendorPreqs, (List<VendorCreditMemoDocument>) vendorMemos, totals, preqsWithOutstandingCreditMemos, puser, processRunDate, batch);\r\n }\r\n }\r\n }\r\n\r\n LOG.debug(\"processing PREQs without CMs\");\r\n\r\n Iterator<PaymentRequestDocument> paymentRequests = paymentRequestService.getPaymentRequestToExtractByChart(campusCode, onOrBeforePaymentRequestPayDate).iterator();\r\n while (paymentRequests.hasNext()) {\r\n PaymentRequestDocument prd = paymentRequests.next();\r\n // if in the list created above, don't create the payment group\r\n if (!preqsWithOutstandingCreditMemos.contains(prd.getDocumentNumber())) {\r\n PaymentGroup paymentGroup = processSinglePaymentRequestDocument(prd, batch, puser, processRunDate);\r\n\r\n totals.count = totals.count + paymentGroup.getPaymentDetails().size();\r\n totals.totalAmount = totals.totalAmount.add(paymentGroup.getNetPaymentAmount());\r\n }\r\n }\r\n\r\n\r\n LOG.debug(\"END - extractRegularPaymentsForChart()\");\r\n return totals;\r\n }",
"@Override\n public void takeDevices(RegisterDTO dto) throws NoUserFoundException, NoDeviceFoundException, SomeDeviceNotFoundException {\n DeviceUser user = userRepository.findByPin(dto.getPersonInformation()).orElse(null);\n // If no such user, throw exception\n if (user == null) throw new NoUserFoundException();\n\n\n // Convert device id-s from input to Device Object (via database). Filter out Null Objects\n List<Device> devices = Arrays.stream(dto.getDevices().trim().split(RENTAL_DEVICE_SEPARATOR))\n .map(String::trim)\n .collect(Collectors.toSet())\n .stream()\n .map(deviceRepository::findDeviceByIdent)\n .filter(Objects::nonNull)\n .collect(Collectors.toList());\n\n\n // If is empty, then there are no devices from user input\n if (devices.isEmpty()) throw new NoDeviceFoundException();\n\n // If some of the rentals associated with these devices are marked as not returned, mark them as returned\n List<Rental> rentals = devices.stream()\n .map(e -> rentalRepository.findByDeviceIdentAndIsReturned(e.getIdent(), false))\n .collect(Collectors.toList());\n\n for (Rental e : rentals) {\n if (e != null) {\n e.setIsReturned(true);\n rentalRepository.save(e);\n }\n }\n\n // Save new rentals\n LocalDateTime timestamp = LocalDateTime.now();\n devices.forEach(device -> rentalRepository.save(new Rental(null, user, device, timestamp, null, false, null)));\n\n // If some of the mapping failed, throw exception\n if (devices.size() != dto.getDevices().trim().split(RENTAL_DEVICE_SEPARATOR).length)\n throw new SomeDeviceNotFoundException();\n }",
"private void calculateRates() {\n if (rateOutput == null || !outputs.containsKey(rateOutput)) throw new RuntimeException(\"Insufficient data to calculate recipe rates\");\n recipesPerMinute = productionRate / outputs.get(rateOutput);\n\n for (String resource : inputs.keySet()) {\n ratesPerMinute.put(resource,-1.0 * recipesPerMinute * inputs.get(resource));\n }\n for (String resource: outputs.keySet()) {\n ratesPerMinute.put(resource, recipesPerMinute * outputs.get(resource));\n }\n }",
"private void fillUserDaily() throws Exception {\n Db db = getDb();\n try {\n db.enter();\n String sqlSelect = \"SELECT COUNT(*), SUM(volume_s_to_c), date(datetime), u.t_user_id, site_id, type, mime_type, auth, request_statuscode, COALESCE(a.t_http_agent_id, 0) FROM t_http_log_data l LEFT JOIN http.t_http_agent a ON (a.agent_name = l.user_agent AND ((a.version IS NULL AND l.agent_version IS NULL) OR a.version = l.agent_version)) INNER JOIN http.t_user u ON u.user_name = username WHERE NOT l.intranet GROUP BY date(datetime), u.t_user_id, site_id, type, mime_type, site_name, auth, request_statuscode, a.t_http_agent_id\";\n String sqlInsert = \"INSERT INTO http.t_user_daily (occurences, volume, calc_day, t_user_id, t_domain_site_id, trafic_type, mime_type_id, t_authorization_id, request_statuscode, t_http_agent_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n String sqlUpdate = \"UPDATE http.t_user_daily SET occurences = occurences + ?, volume = volume + ? WHERE calc_day = ? AND t_user_id = ? AND t_domain_site_id = ? AND trafic_type = ? AND mime_type_id = ? AND t_authorization_id = ? AND request_statuscode = ? AND t_http_agent_id = ?\";\n PreparedStatement pstSelect = db.prepareStatement(sqlSelect);\n PreparedStatement pstInsert = db.prepareStatement(sqlInsert);\n PreparedStatement pstUpdate = db.prepareStatement(sqlUpdate);\n ResultSet rs = db.executeQuery(pstSelect);\n if (rs.next()) {\n do {\n Integer mimeId = mime.getMimeTypeId(rs.getString(7));\n pstUpdate.setInt(1, rs.getInt(1));\n pstUpdate.setLong(2, rs.getLong(2));\n pstUpdate.setDate(3, rs.getDate(3));\n pstUpdate.setInt(4, rs.getInt(4));\n pstUpdate.setInt(5, rs.getInt(5));\n pstUpdate.setInt(6, rs.getInt(6));\n pstUpdate.setObject(7, mimeId);\n pstUpdate.setInt(8, rs.getInt(8));\n pstUpdate.setInt(9, rs.getInt(9));\n pstUpdate.setInt(10, rs.getInt(10));\n if (db.executeUpdate(pstUpdate) == 0) {\n pstInsert.setInt(1, rs.getInt(1));\n pstInsert.setLong(2, rs.getLong(2));\n pstInsert.setDate(3, rs.getDate(3));\n pstInsert.setInt(4, rs.getInt(4));\n pstInsert.setInt(5, rs.getInt(5));\n pstInsert.setInt(6, rs.getInt(6));\n pstInsert.setObject(7, mimeId);\n pstInsert.setInt(8, rs.getInt(8));\n pstInsert.setInt(9, rs.getInt(9));\n pstInsert.setInt(10, rs.getInt(10));\n db.executeUpdate(pstInsert);\n }\n } while (rs.next());\n } else {\n _logger.debug(\"No user daily to insert\");\n }\n } finally {\n db.exit();\n }\n }",
"@Override\n public void returnDevices(RegisterDTO dto) throws NoActiveRentalsFoundException {\n List<Rental> rentals = Arrays.stream(dto.getDevices().split(RENTAL_DEVICE_SEPARATOR))\n .map(deviceRepository::findDeviceByIdent)\n .filter(Objects::nonNull)\n .collect(Collectors.toSet())\n .stream()\n .map(e -> rentalRepository.findByDeviceIdentAndIsReturned(e.getIdent(), false))\n .filter(Objects::nonNull)\n .collect(Collectors.toList());\n\n\n // Find all rentals regarding user\n if (rentals.isEmpty()) throw new NoActiveRentalsFoundException();\n\n // Mark rentals as returned\n DeviceUser user = userRepository.findByPin(dto.getPersonInformation().trim()).orElse(null);\n LocalDateTime timestamp = LocalDateTime.now();\n\n for (Rental rental : rentals) {\n if (user != null) rental.setReturner(user);\n\n rental.setReturnTime(timestamp);\n rental.setIsReturned(true);\n rentalRepository.save(rental);\n }\n }",
"private String createValues() {\n String values = getLatitude(\"\");\n if (getLongitude() != FLOATNULL) {\n values = values + \",\" + getLongitude(\"\");\n } // if getLongitude\n if (getDepth() != FLOATNULL) {\n values = values + \",\" + getDepth(\"\");\n } // if getDepth\n if (getTemperatureMin() != FLOATNULL) {\n values = values + \",\" + getTemperatureMin(\"\");\n } // if getTemperatureMin\n if (getTemperatureMax() != FLOATNULL) {\n values = values + \",\" + getTemperatureMax(\"\");\n } // if getTemperatureMax\n if (getSalinityMin() != FLOATNULL) {\n values = values + \",\" + getSalinityMin(\"\");\n } // if getSalinityMin\n if (getSalinityMax() != FLOATNULL) {\n values = values + \",\" + getSalinityMax(\"\");\n } // if getSalinityMax\n if (getOxygenMin() != FLOATNULL) {\n values = values + \",\" + getOxygenMin(\"\");\n } // if getOxygenMin\n if (getOxygenMax() != FLOATNULL) {\n values = values + \",\" + getOxygenMax(\"\");\n } // if getOxygenMax\n if (getNitrateMin() != FLOATNULL) {\n values = values + \",\" + getNitrateMin(\"\");\n } // if getNitrateMin\n if (getNitrateMax() != FLOATNULL) {\n values = values + \",\" + getNitrateMax(\"\");\n } // if getNitrateMax\n if (getPhosphateMin() != FLOATNULL) {\n values = values + \",\" + getPhosphateMin(\"\");\n } // if getPhosphateMin\n if (getPhosphateMax() != FLOATNULL) {\n values = values + \",\" + getPhosphateMax(\"\");\n } // if getPhosphateMax\n if (getSilicateMin() != FLOATNULL) {\n values = values + \",\" + getSilicateMin(\"\");\n } // if getSilicateMin\n if (getSilicateMax() != FLOATNULL) {\n values = values + \",\" + getSilicateMax(\"\");\n } // if getSilicateMax\n if (getChlorophyllMin() != FLOATNULL) {\n values = values + \",\" + getChlorophyllMin(\"\");\n } // if getChlorophyllMin\n if (getChlorophyllMax() != FLOATNULL) {\n values = values + \",\" + getChlorophyllMax(\"\");\n } // if getChlorophyllMax\n if (dbg) System.out.println (\"<br>values = \" + values); // debug\n return values;\n }",
"public void writeTourResultsAllCarrier() {\n\t\tString fileName = this.outputFolder + \"total_tour_infos_per_vehicleType.csv\";\n\t\tFile file = new File(fileName);\n\n\t\ttry {\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(file));\n\t\t\tbw.write(fileName);\n\t\t\tbw.newLine();\n\t\t\tbw.write(\"____________________________________________________________________________\");\n\t\t\tbw.newLine();\n\n\t\t\tbw.write(\"personId; vehType Id;distance [m] ; distance [km] ;TravelTime [s]; TravelTime [h];\" +\n\t\t\t\t\t\"FuelConsumption[l]; Emission [t Co2]; FuelConsumptionRate[l/100m]; \" +\n\t\t\t\t\t\"EmissionRate [g/m]; \");\n\t\t\tbw.newLine();\n\n\n\n\t\t\t//\t\t\tKT:\n\t\t\tMap<Id<Person>, Double> personId2tourDistance = this.handler.getPersonId2TourDistances();\n\t\t\tMap<Id<Person>, Double> personId2tourTravelTimes = this.handler.getPersonId2TravelTimes();\n\n\t\t\tMap<Id<VehicleType>, VehicleTypeSpezificCapabilities> vehTypId2Capabilities = new TreeMap<Id<VehicleType>, VehicleTypeSpezificCapabilities>();\n\n\t\t\tCarrierVehicleTypes vehicleTypes = this.handler.getVehicleTypes();\n\n\t\t\t//preparation:\n\t\t\tfor (Id<VehicleType> vehicleTypeId : vehicleTypes.getVehicleTypes().keySet()){\n\t\t\t\tVehicleTypeSpezificCapabilities capabilities = this.handler.getVehTypId2Capabilities().get(vehicleTypeId);\n\t\t\t\tif (capabilities != null){\n\t\t\t\t\tvehTypId2Capabilities.put(vehicleTypeId, capabilities);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//write results:\n\t\t\tfor (Id<Person> personId :personId2tourDistance.keySet()) {\n\n\t\t\t\tDouble tourDistanceMeter = personId2tourDistance.get(personId);\n\t\t\t\tDouble tourTravelTimeSec = personId2tourTravelTimes.get(personId);\n\n\t\t\t\tId<VehicleType> vehTypeId = null;\n\n\t\t\t\tfor (Id<VehicleType> vehTypeIdsAvail : vehicleTypes.getVehicleTypes().keySet()) {\n\t\t\t\t\tif(personId.toString().contains(\"_\"+vehTypeIdsAvail.toString()+\"_\")){\n\t\t\t\t\t\tif (vehTypeIdsAvail.toString().endsWith(\"frozen\") == personId.toString().contains(\"frozen\")) {//only frozen\n\t\t\t\t\t\t\tvehTypeId = vehTypeIdsAvail;\n\t\t\t\t\t\t} else { //not \"frozen\"\n\t\t\t\t\t\t\tvehTypeId = vehTypeIdsAvail;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (vehTypeId == null) {\n\t\t\t\t\tlog.error(\"Vehicle type for person not defined: \" + personId);\n\t\t\t\t}\n\n\t\t\t\tdouble fuelConsuptionRate = (vehTypId2Capabilities.get(vehTypeId)).getFuelConsumtion()*1000; // Usually in l/100km\n\t\t\t\tdouble emissionsRatePerMeter = vehTypId2Capabilities.get(vehTypeId).getEmissionsPerMeter(); \n\n\t\t\t\tbw.write(personId + \";\" +\n\t\t\t\t\t\tvehTypeId + \";\" +\n\t\t\t\t\t\ttourDistanceMeter + \";\" + \n\t\t\t\t\t\ttourDistanceMeter/1000 + \";\" + //km\n\t\t\t\t\t\ttourTravelTimeSec + \";\" + \n\t\t\t\t\t\ttourTravelTimeSec/3600 + \";\" + \t//h\n\t\t\t\t\t\ttourDistanceMeter*fuelConsuptionRate/100/1000 + \";\" + // rate is in [liter/100km]\n\t\t\t\t\t\ttourDistanceMeter*emissionsRatePerMeter /1000000 +\";\" + \t// CO2-Ausstoss in t (= 1Mio g)\n\t\t\t\t\t\tfuelConsuptionRate+ \";\" + \n\t\t\t\t\t\temissionsRatePerMeter \n\t\t\t\t\t\t);\n\t\t\t\tbw.newLine();\n\n\t\t\t}\t\n\t\t\t\n\t\t\tlog.info(\"Output written to \" + fileName);\n\t\t\tbw.close();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void getMobilities(HttpServletRequest req, HttpServletResponse resp, UserUcc userUcc,\n MobilityUcc mobilityUcc) {\n try {\n UserDto userDto = userUcc.findDto((int) IhmUserServlet.getCurrentUser(req));\n String json;\n ArrayList<MobilityDto> mobilityDtos = new ArrayList<>();\n\n /*\n * Checks if you are connected setResponseMessage if null\n */\n if (userDto == null) {\n Utils.setResponseMessage(resp, CLIENT_NOT_SIGNED_IN);\n } else if (userDto.getTypeUser().equals(UserType.STUDENT.getUserType())) {\n /* a finir trouver toutes les mobilites de l'utilisateur connecté */\n mobilityDtos = new ArrayList<>(mobilityUcc.findAllMobilitiesByUser(userDto.getIdUser()));\n } else {\n mobilityDtos = new ArrayList<>(mobilityUcc.findAllDtos());\n }\n json = new Genson().serialize(mobilityDtos);\n resp.setContentType(\"application/json\");\n resp.getOutputStream().write(json.getBytes());\n } catch (IOException err) {\n err.printStackTrace();\n } catch (TransactionErrorException err1) {\n err1.printStackTrace();\n } catch (InternalServerException err2) {\n err2.printStackTrace();\n } catch (IdNotFoundException err3) {\n err3.printStackTrace();\n }\n }",
"private void fetchRatesData() {\r\n RequesterBean requesterBean = new RequesterBean();\r\n requesterBean.setFunctionType(GET_RATE_DATA);\r\n requesterBean.setDataObject(instituteRatesBean);\r\n \r\n AppletServletCommunicator appletServletCommunicator = new \r\n AppletServletCommunicator(CONNECTION_STRING, requesterBean);\r\n appletServletCommunicator.setRequest(requesterBean);\r\n appletServletCommunicator.send();\r\n ResponderBean responderBean = appletServletCommunicator.getResponse();\r\n \r\n if(responderBean == null) {\r\n //Could not contact server.\r\n CoeusOptionPane.showErrorDialog(COULD_NOT_CONTACT_SERVER);\r\n return;\r\n }\r\n \r\n if(responderBean.isSuccessfulResponse()) {\r\n Hashtable ratesData = (Hashtable)responderBean.getDataObject();\r\n hasMaintainCodeTablesRt = ((Boolean)ratesData.get(\"HAS_OSP_RIGHT\")).booleanValue();\r\n if( hasMaintainCodeTablesRt ){\r\n setFunctionType(TypeConstants.MODIFY_MODE);\r\n }else {\r\n setFunctionType(TypeConstants.DISPLAY_MODE);\r\n }\r\n //queryKey = RATES + ratesData.get(\"PARENT_UNIT_NUMBER\").toString();\r\n\r\n //Set title\r\n dlgRates.setTitle(RATES + \" for Unit \" + instituteRatesBean.getUnitNumber());\r\n queryEngine.addDataCollection(queryKey, ratesData);\r\n\r\n }else {\r\n //Server Error\r\n CoeusOptionPane.showErrorDialog(responderBean.getMessage());\r\n return;\r\n }\r\n }",
"@Override\n public String get_rates(String betrag, String currency, List<String> targetcurrencies) {\n String api = null;\n try {\n api = new String(Files.readAllBytes(Paths.get(\"src/resources/OfflineData.json\")));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n JSONObject obj = new JSONObject(api);\n ArrayList<String> calculatedrates = new ArrayList<>();\n if (currency.equals(\"EUR\")) {\n for (String targetcurrency : targetcurrencies) {\n float rate = obj.getJSONObject(\"rates\").getFloat(targetcurrency);\n calculatedrates.add((Float.parseFloat(betrag) * rate) + \" \" + targetcurrency + \" (Kurs: \" + rate + \")\");\n }\n } else {\n float currencyrate = obj.getJSONObject(\"rates\").getFloat(currency);\n for (String targetcurrency : targetcurrencies) {\n float rate = obj.getJSONObject(\"rates\").getFloat(targetcurrency);\n calculatedrates.add((Float.parseFloat(betrag) / currencyrate * rate) + \" \" + targetcurrency + \" (Kurs: \" + rate / currencyrate + \")\");\n }\n }\n return Data.super.display(betrag, currency, calculatedrates, obj.get(\"date\").toString());\n }",
"@Override\n public List<NominationDTO> findAllNomsForTheCurrentUser() {\n Contact userContact = _contactRepository.findByUserIsCurrentUser();\n //for this contact find its employed by BA\n BusinessAssociate ba = userContact.getEmployedBy();\n\n Set<Contract> baContracts = ba.getContracts();\n\n UserDetails user1 = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\n com.oilgascs.gps.security.GPSUserDetails user = (com.oilgascs.gps.security.GPSUserDetails)user1;\n // set the session bu if not set to \n /* if(user.getBu() == null) {\n\t BusinessUnit newBU = new BusinessUnit();\n\t newBU.setId((long)1);\n\t newBU.setBusinessUnit(\"B1\");\n\t user.setBu(newBU);\n }*/\n List<Long> contractIdList = new ArrayList<>();\n baContracts.forEach(contract->{\n //\tif(user.getBu().getBusinessUnit().equals(contract.getBusinessUnit()))\n \t\tcontractIdList.add(contract.getId());\n \t});\n\n List<Nomination> noms = _nomNominationRepository.findAllNomsByContractIdList(contractIdList);\n return noms.stream()\n .map(_nominationMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }",
"public final DrugInfoResultsVo processDrugInfoRequest(Collection<DrugInfoVo> drugs) {\n DrugInfoResultsVo results = new DrugInfoResultsVo();\n\n for (DrugInfoVo drugInfoVo : drugs) {\n try {\n synchronized (firstdatabank.dif.GlobalObjectManager.class) { // FDB locking contention\n ScreenDrug screenDrug = newScreenDrugInstance();\n\n screenDrug.load(drugInfoVo.getGcnSeqNo(), FDBDrugType.fdbDTGCNSeqNo);\n\n drugInfoVo.setDoseRoutes(convertDoseRoutes(screenDrug.getDoseRoutes()));\n drugInfoVo.setDoseTypes(convertDoseTypes(screenDrug.getDoseTypes()));\n\n DispensableDrug dispensableDrug = newDispensableDrugInstance();\n dispensableDrug.load(Long.valueOf(drugInfoVo.getGcnSeqNo()), FDBDispensableDrugLoadType.fdbDDLTGCNSeqNo,\n \"\", \"\", \"\");\n\n // Strength Units are lower case, but data from database in dose checks are upper case\n String strengthUnit = dispensableDrug.getStrengthUnit();\n\n if (strengthUnit != null) {\n strengthUnit = strengthUnit.toUpperCase();\n }\n\n drugInfoVo.setStrengthUnit(strengthUnit);\n }\n\n results.getDrugs().add(drugInfoVo);\n }\n catch (FDBException e) {\n results.getDrugsNotFound().add(drugInfoVo);\n }\n }\n\n return results;\n }",
"@Override\r\n\tpublic int execute(List<Long> idUserList)\r\n\t{\n\t\tfinal int k = 8;\r\n\t\tint m = (int) Math.pow(2, k);\r\n\r\n\t\t// M GRANDE, ARRAY DI GRANDEZZA m.\r\n\t\tint[] estimators = new int[m];\r\n\r\n//\t\tint total = 0;\r\n\t\tfor(long userId : idUserList)\r\n\t\t{\r\n\t\t\t// NUMERO GENERATO RANDOM TRA 0 E m (escluso)\r\n\t\t\tint i = (int) (Math.random() * m);\r\n\t\t\t// POSIZIONE DEL PRIMO 1 MENO SIGNIFICATIVO A PARTIRE DA DESTRA\r\n\t\t\tint b = Long.numberOfTrailingZeros(userId) + 1;\r\n\t\t\t// ALLA POSIZIONE i-esima VADO A METTERE IL MAX TRA IL VECCHIO VALORE E b\r\n\t\t\testimators[i] = Math.max(estimators[i], b);\r\n\t\t}\r\n\t\t// SOMMA DI TUTTI I VALORI ALL'INTERNO DELL'ARRAY\r\n//\t\tfor(int value : estimators) { total += value; }\r\n\t\t// ESPONENTE DELLA FORMULA (MEDIA)\r\n//\t\tdouble average = (1.0/(double) m) * total;\r\n\t\tdouble media = Arrays.stream(estimators).summaryStatistics().getAverage();\r\n\t\treturn (int) (ARRAY[k] * Math.pow(2, media));\r\n\t}",
"private static void getStatistics() {\r\n\r\n\t\tfloat totalWaitTime = 0;\r\n\t\tfloat totalRideTime = 0;\r\n\r\n\t\t// generate info about min wait time\r\n\t\tfloat minWaitTime = people.get(0).getWaitTime();\r\n\t\tString minWaitPerson = \"\";\r\n\t\ttotalWaitTime += minWaitTime;\r\n\t\tfor (int i=1; i<people.size(); i++) {\r\n\t\t\tif(people.get(i).getWaitTime() < minWaitTime){\r\n\t\t\t\tminWaitTime = people.get(i).getWaitTime();\r\n\t\t\t\tminWaitPerson = people.get(i).getPersonName();\r\n\t\t\t}\r\n\t\t\ttotalWaitTime += people.get(i).getWaitTime();\r\n\t\t}\r\n\r\n\t\t// generate info about min ride time\r\n\t\tfloat minRideTime = people.get(0).getRideTime();\r\n\t\tString minRidePerson = \"\";\r\n\t\ttotalRideTime += minRideTime;\r\n\t\tfor (int i=1; i<people.size(); i++) {\r\n\t\t\tif(people.get(i).getRideTime() < minRideTime){\r\n\t\t\t\tminRideTime = people.get(i).getRideTime();\r\n\t\t\t\tminRidePerson = people.get(i).getPersonName();\r\n\t\t\t}\r\n\t\t\ttotalRideTime += people.get(i).getRideTime();\r\n\t\t}\r\n\r\n\t\t// generate info about max wait time\r\n\t\tfloat maxWaitTime = people.get(0).getWaitTime();\r\n\t\tString maxWaitPerson = \"\";\r\n\t\tfor (int i=1; i<people.size(); i++) {\r\n\t\t\tif(people.get(i).getWaitTime() > maxWaitTime){\r\n\t\t\t\tmaxWaitTime = people.get(i).getWaitTime();\r\n\t\t\t\tmaxWaitPerson = people.get(i).getPersonName();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// generate info about max ride time\r\n\t\tfloat maxRideTime = people.get(0).getRideTime();\r\n\t\tString maxRidePerson = \"\";\r\n\t\tfor (int i=1; i<people.size(); i++) {\r\n\t\t\tif(people.get(i).getRideTime() > maxRideTime){\r\n\t\t\t\tmaxRideTime = people.get(i).getRideTime();\r\n\t\t\t\tmaxRidePerson = people.get(i).getPersonName();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.printf(\"Avg Wait Time: %.1f sec\\n\", totalWaitTime/people.size());\r\n\t\tSystem.out.printf(\"Avg Ride Time: %.1f sec\\n\\n\", totalRideTime/people.size());\r\n\r\n\t\tSystem.out.printf(\"Min Wait Time: %.1f sec (%s)\\n\", minWaitTime, minWaitPerson);\r\n\t\tSystem.out.printf(\"Min Ride Time: %.1f sec (%s)\\n\\n\", minRideTime, minRidePerson);\r\n\r\n\t\tSystem.out.printf(\"Max Wait Time: %.1f sec (%s)\\n\", maxWaitTime, maxWaitPerson);\r\n\t\tSystem.out.printf(\"Max Ride Time: %.1f sec (%s)\\n\\n\", maxRideTime, maxRidePerson);\r\n\r\n\t}",
"@Override\n\tpublic void getUsersInSelectedCity(Long cityID) {\n\t\tint counterProxy = 0;\n\t\tint firstElement = 0;\n\t\tint lastElement = 0;\n\n\t\tList<ProxyServer> proxyServerList = proxyServerService.getProxyServerByDestiny(\"user\");\n\n\t\t/**\n\t\t * 366 days in year max. Dividing birthdays into two sexes - 732\n\t\t */\n\t\tint requestOnProxy = 732 / proxyServerList.size();\n\t\tint remainingRequests = 732 % proxyServerList.size();\n\n\t\tList<String> queries = getListOfQueries(requestOnProxy, remainingRequests, cityID);\n\n\t\tList<UserFromVK> userFromVKList = userFromVkService.getAllUsersOfVk();\n\n\t\tExecutorService executorService = Executors.newFixedThreadPool(proxyServerList.size());\n\n\t\tfor (ProxyServer proxyServer : proxyServerList) {\n\t\t\tRestTemplate proxyTemplate = getRestTemplate(proxyServerList.get(counterProxy).getIp(), proxyServerList.get(counterProxy).getPort());\n\t\t\tlastElement += requestOnProxy;\n\t\t\tif (remainingRequests > 0) {\n\t\t\t\tremainingRequests--;\n\t\t\t\tlastElement += 1;\n\t\t\t}\n\n\t\t\tfinal int start = firstElement;\n\t\t\tfinal int finish = lastElement;\n\n\n\t\t\tFuture future = executorService.submit(new Thread(() -> {\n\t\t\t\t/**\n\t\t\t\t * Sending requests with the necessary delays to vk.api\n\t\t\t\t */\n\t\t\t\tfor (int i = start; i < finish; i++) {\n\t\t\t\t\tif (i > 0 && i % 3 == 0) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (i > 0 && i % 100 == 0) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(300_000);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tUsersRootObject usersRootObject = proxyTemplate.getForObject(queries.get(i), UsersRootObject.class);\n\t\t\t\t\tList<UserFromVK> foundedUsersFromVk = usersRootObject.getResponse().getItems();\n\n\t\t\t\t\tif (!userFromVKList.containsAll(foundedUsersFromVk)) {\n\t\t\t\t\t\tuserFromVkService.addListOfUsersOfVK(foundedUsersFromVk);\n\t\t\t\t\t} else if (userFromVKList.containsAll(foundedUsersFromVk) && foundedUsersFromVk.size() != 0) {\n\t\t\t\t\t\tList<UserFromVK> usersWhichNotInDB = new ArrayList<>();\n\n\t\t\t\t\t\tfor (UserFromVK user : foundedUsersFromVk) {\n\t\t\t\t\t\t\tif (!userFromVKList.contains(user)) {\n\t\t\t\t\t\t\t\tusersWhichNotInDB.add(user);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tuserFromVkService.addListOfUsersOfVK(usersWhichNotInDB);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\t\t\tfirstElement += lastElement;\n\t\t\tcounterProxy++;\n\t\t}\n\n\t\texecutorService.shutdown();\n\t}",
"@Query(\"select ((select count(distinct r.user) from Rendezvous r) * 100)/ count(u) from User u\")\n\tCollection<Double> dashboardRendezvousesRatioCreation();",
"@GetMapping(\"/users\")\n public List<UserDTO> getAllUsers() throws UserProductException {\n LOG.debug(\"in method getUserStatistics\");\n return userService.getAllUsers();\n }",
"@Override\n public void processUSData(int distance) {\n filter(distance);\n int distanceDiff = BAND_CENTER - this.distance; //the difference between the actual distance and bandcenter\n \n\n //when the distanceDiff is small , no need to adjust the speeds\n if (Math.abs(distanceDiff) <= BAND_WIDTH ) {\n LEFT_MOTOR.setSpeed(MOTOR_HIGH); \n RIGHT_MOTOR.setSpeed(MOTOR_HIGH);\n LEFT_MOTOR.forward();\n RIGHT_MOTOR.forward();\n }\n // if it is too close, back away so that the robot does not \n // touch the wall(for quick turn at the corner)\n else if (this.distance < 35) {\n LEFT_MOTOR.setSpeed(MOTOR_HIGH); \n RIGHT_MOTOR.setSpeed(MOTOR_HIGH + 40);\n LEFT_MOTOR.forward();\n RIGHT_MOTOR.backward();\n }\n //when the difference is within the accepted range\n else if (Math.abs(distanceDiff) <= MAX_DISTANCE_DIFF ){\n //when the actual distance is larger than the bandcenter\n //turn to the left slightly\n if(distanceDiff < 0) {\n LEFT_MOTOR.setSpeed(MOTOR_HIGH - 30); \n RIGHT_MOTOR.setSpeed(MOTOR_HIGH + 30);\n LEFT_MOTOR.forward();\n RIGHT_MOTOR.forward();\n }\n //when the actual distance is smaller than the bandcenter\n //turn to the right slightly\n else if (distanceDiff > 0) {\n LEFT_MOTOR.setSpeed(MOTOR_HIGH + 30); \n RIGHT_MOTOR.setSpeed(MOTOR_HIGH - 30);\n LEFT_MOTOR.forward();\n RIGHT_MOTOR.forward();\n }\n }\n //when the difference is not in the accepted range\n else if (Math.abs(distanceDiff) > MAX_DISTANCE_DIFF) {\n //when the actual distance is way smaller than the bandcenter\n //make a turn to the right so that the robot is not very far from the wall\n if (distanceDiff > 0) {\n LEFT_MOTOR.setSpeed(200); \n RIGHT_MOTOR.setSpeed(100);\n LEFT_MOTOR.forward();\n RIGHT_MOTOR.forward();\n }\n //when the actual distance is way larger than the bandcenter\n //make a wide turn to the left\n else if (distanceDiff < 0) {\n LEFT_MOTOR.setSpeed(100); \n RIGHT_MOTOR.setSpeed(200);\n LEFT_MOTOR.forward();\n RIGHT_MOTOR.forward();\n }\n }\n }",
"public void getNetworkFilterParameters(){\n Retrofit retrofit = ApiClient.getClient();\n\n ApiInterface apiInterface = retrofit.create(ApiInterface.class);\n\n apiInterface.getAccounts().enqueue(new Callback<List<FilterUserModel>>() {\n @Override\n public void onResponse(Call<List<FilterUserModel>> call, Response<List<FilterUserModel>> response) {\n Observable.just(Objects.requireNonNull(response.body()))\n .subscribeOn(Schedulers.io())\n .concatMapIterable((Function<List<FilterUserModel>, Iterable<FilterUserModel>>) filterUserModels -> {\n /**Save to DB*/\n database = FlowManager.getDatabase(DecagonDatabase.class);\n\n FastStoreModelTransaction<FilterUserModel> transaction = FastStoreModelTransaction\n .saveBuilder(FlowManager.getModelAdapter(FilterUserModel.class))\n .addAll(filterUserModels)\n .build();\n\n database.executeTransaction(transaction);\n\n return filterUserModels;\n }).subscribeOn(Schedulers.io())\n .observeOn(Schedulers.newThread())\n .concatMap((Function<FilterUserModel, ObservableSource<List<FilterCountryModel>>>) filterUserModel -> {\n\n Log.e(TAG,\" LIST<COLORS> : \" + filterUserModel.getColors().size() + \" LIST<COUNTRIES>: \" + filterUserModel.getCountries().size());\n\n /**Should add a condition here, if the size is zero, no need to resolve jack*/\n resolveColor(filterUserModel.getColors(), filterUserModel.getId());\n\n return resolveCountries(filterUserModel.getCountries(), filterUserModel.getId());\n }).subscribe(new Observer<List<FilterCountryModel>>() {\n @Override\n public void onSubscribe(Disposable d) {\n compositeDisposable.add(d);\n }\n\n @Override\n public void onNext(List<FilterCountryModel> filterCountryModels) {\n\n Log.e(TAG, \"LIST OF FILTER COUNTRY MODEL: \" + filterCountryModels.size());\n\n /**Save to DB*/\n database = FlowManager.getDatabase(DecagonDatabase.class);\n\n FastStoreModelTransaction<FilterCountryModel> transaction = FastStoreModelTransaction\n .saveBuilder(FlowManager.getModelAdapter(FilterCountryModel.class))\n .addAll(filterCountryModels)\n .build();\n\n database.executeTransaction(transaction);\n }\n\n @Override\n public void onError(Throwable e) {\n e.printStackTrace();\n }\n\n @Override\n public void onComplete() {\n\n }\n });\n }\n\n @Override\n public void onFailure(Call<List<FilterUserModel>> call, Throwable t) {\n call.cancel();\n t.printStackTrace();\n }\n });\n\n }",
"private boolean generateRate() {\n TSDBData rateObj;\n boolean result = false;\n\n if (Flag.getMeteringType().equalsIgnoreCase(\"static\")) {\n rateObj = generateStaticRate();\n } else {\n rateObj = generateDynamicRate();\n }\n if (rateObj.getPoints().size() > 0)\n result = saveRate(rateObj);\n return result;\n }",
"public ArrayList<SimUser> generateUsers(){\n simUserFact = new SimUserFactory();\r\n simUserStateFact = new SimUserStateFactory();\r\n \r\n ArrayList<SimUser> su = new ArrayList<SimUser>();\r\n\r\n // Generate a set amount of each type of user with their state set to shopping\r\n for(int x =0; x < COMPANYUSERS; x++)\r\n su.add(simUserFact.createUser(\"Company\", simUserStateFact.getUserState(\"Shopping\"), simUserStateFact));\r\n \r\n for(int x = 0; x < INDIVIDUALUSERS; x++)\r\n su.add(simUserFact.createUser(\"Person\", simUserStateFact.getUserState(\"Shopping\"), simUserStateFact));\r\n \r\n return su;\r\n }",
"@Override\n\tpublic Object evaluate(Row buffer) {\n\t\tlong totalTimeSpent = buffer.getLong(1);\n\n\t\tString userDeviceString = buffer.getString(0);\n\n\t\tString[] userDevice = userDeviceString.split(\",\");\n\n\t\tGson gson = new Gson();\n\n\t\tMap<String, Object> map = new HashMap<String, Object>();\n\n\t\tfor (String userDeviceInstance : userDevice) {\n\t\t\tString device = userDeviceInstance.split(\":\")[0];\n\t\t\tInteger timeSpentOnDeivce = Integer.parseInt(userDeviceInstance.split(\":\")[1]);\n\t\t\tfloat distribution = 0;\n\n\t\t\tif (totalTimeSpent == 0) {\n\t\t\t\tdistribution = 0;\n\t\t\t} else {\n\t\t\t\tdistribution = ((float) timeSpentOnDeivce / totalTimeSpent) * 100;\n\t\t\t}\n\n\t\t\tmap.put(device, String.format(\"%.2f\", distribution) + \"%\");\n\n\t\t}\n\n\t\tString json = gson.toJson(map);\n\n\t\treturn new Tuple3<String, Long, Long>(json, totalTimeSpent, buffer.getLong(2));\n\t}",
"public void buildConsultantData(){\r\n // Connect to database and perform select query on user table\r\n Database db = new Database();\r\n Connection connection = null;\r\n try{\r\n connection = db.jdbc_connection.connect();\r\n Statement statement = connection.createStatement(); // Set up statement\r\n \r\n String sql = \"SELECT userID, userName FROM user\";\r\n ResultSet results = statement.executeQuery(sql); \r\n \r\n while(results.next()) { \r\n int id = results.getInt(\"userID\");\r\n String name = results.getString(\"userName\");\r\n \r\n User user = new User(id, name);\r\n user_list.add(user);\r\n }\r\n \r\n combo_user.setItems(user_list);\r\n \r\n }catch(Exception e) {\r\n System.out.println(e.getMessage());\r\n }finally {\r\n try {\r\n connection.close();\r\n } catch (Exception e2) { // Closing databse error handling\r\n System.err.println(e2.getMessage());\r\n }\r\n } \r\n }",
"public static void sendEmergencyAssistanceAbnormalSpeed(Context context, @NonNull iEmergencyAssistanceAbnormalSpeed result) {\n final String Uid = objAccount.getCurrentUser().getUid();\n final objAccount currentAccount = objAccount.getAccountFromSQLite(context,Uid);\n\n final DatabaseReference mRef = FirebaseDatabase.getInstance()\n .getReference()\n .child(keyUtils.emergencyAssistanceList)\n .child(Uid)\n .push();\n\n //Get current location\n FusedLocationProviderClient mFusedLocationClient = LocationServices.getFusedLocationProviderClient(context);\n mFusedLocationClient.getLastLocation().addOnCompleteListener(new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n\n Location location = task.getResult();\n if (location != null) {\n ArrayList<String> listSeen = new ArrayList<>();\n listSeen.add(objAccount.getCurrentUser().getUid());\n\n ArrayList<String> listReceived = new ArrayList<>();\n listReceived.add(objAccount.getCurrentUser().getUid());\n\n String message = String.format(context.getResources().getString(R.string.We_find_driving_speed_unusually_low),\n currentAccount.getName(),\n currentAccount.getGender().toLowerCase().matches(keyUtils.MALE) ? context.getResources().getString(R.string.him) : context.getResources().getString(R.string.her));\n\n fb_emergencyAssistance emergencyAssistance = new fb_emergencyAssistance(location.getLatitude(),\n Uid,\n listReceived,\n listSeen,\n location.getLongitude(),\n message,\n keyUtils.TYPE_ABNORMAL_SPEED,\n Calendar.getInstance().getTimeInMillis());\n\n\n mRef.setValue(emergencyAssistance)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n result.onResult(true, \"Success\");\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n result.onResult(false, e.getMessage());\n }\n });\n }else\n result.onResult(false,\"Null location\");\n }\n });\n }",
"public String report() {\r\n\t\tsession2 = ServletActionContext.getRequest().getSession();\r\n\t\tlogger.info(session2);\r\n\t\tif (session2 == null || session2.getAttribute(\"login\") == null) {\r\n\t\t\tlogger.error(\"if=====session error reporting===='\");\r\n\t\t\treturn LOGIN;\r\n\t\t} else {\r\n\t\t\tfactory = LoginAndSession.getFactory();\r\n\t\t\tdao_userWise = (Productivity_user_wiseDao) factory.getBean(\"d27\");\r\n\t\t\tdao_propwise = (Productivity_property_wiseDao) factory.getBean(\"d29\");\r\n\t\t\tpcw = (Productivity_client_wiseDao) factory.getBean(\"d30\");\r\n\t\t\tif (colorRadio.equalsIgnoreCase(\"red\")) {\r\n\r\n\t\t\t\t// for all user\r\n\t\t\t\ttry {\r\n\t\t\t\t\tlst = dao_userWise\r\n\t\t\t\t\t\t\t.viewRecord(\"select puw.curr_date, puw.source_link, puw.infringing_link, puw.youtube,\"\r\n\t\t\t\t\t\t\t\t\t+ \" puw.social_media, puw.white_list, puw.grey_list, puw.duplicate , mu.name\"\r\n\t\t\t\t\t\t\t\t\t+ \" , puw.facebook, puw.instagram, puw.twitter, puw.vk, puw.periscope, puw.source_domain,\"\r\n\t\t\t\t\t\t\t\t\t+ \" puw.infringing_domain , puw.user_id \"\r\n\t\t\t\t\t\t\t\t\t+ \" from Productivity_user_wise puw, Markscan_users mu where puw.curr_date \"\r\n\t\t\t\t\t\t\t\t\t+ \" between '\" + date + \"' and '\" + date1 + \"' and mu.id= puw.user_id\");\r\n\t\t\t\t\tmonthlyGraph = new ArrayList<>();\r\n\r\n\t\t\t\t\tcud = (Crawle_url2Dao) factory.getBean(\"dash\");\r\n\r\n\t\t\t\t\t// lst1= cud.viewRecord(\"select DISTINCT count(domain_name)\r\n\t\t\t\t\t// ,date(created_on), link_logger from crawle_url3 where\r\n\t\t\t\t\t// user_id= 75 and created_on >'2017-06-01' and\r\n\t\t\t\t\t// link_logger=1 group by date(created_on)\")\r\n\r\n\t\t\t\t\tfor (int i = 0; i < lst.size(); i++) {\r\n\t\t\t\t\t\t obj = (Object[]) lst.get(i);\r\n\r\n\t\t\t\t\t\t data = new DashBoardData();\r\n\r\n\t\t\t\t\t\tdata.setDate(obj[0].toString());\r\n\t\t\t\t\t\tdata.setSource((Integer) obj[1]);\r\n\t\t\t\t\t\tdata.setInfringing((Integer) obj[2]);\r\n\r\n\t\t\t\t\t\tdata.setYoutube((Integer) obj[3]);\r\n\t\t\t\t\t\tdata.setSocial_media((Integer) obj[4]);\r\n\r\n\t\t\t\t\t\tdata.setWhite_list((Integer) obj[5]);\r\n\t\t\t\t\t\tdata.setGrey_list((Integer) obj[6]);\r\n\t\t\t\t\t\tdata.setDuplicate((Integer) obj[7]);\r\n\t\t\t\t\t\tdata.setProj_name(obj[8].toString()); // user_name\r\n\r\n\t\t\t\t\t\tdata.setFacebook((Integer) obj[9]);\r\n\t\t\t\t\t\tdata.setInstagram((Integer) obj[10]);\r\n\t\t\t\t\t\tdata.setTwitter((Integer) obj[11]);\r\n\t\t\t\t\t\tdata.setVk((Integer) obj[12]);\r\n\t\t\t\t\t\tdata.setPeriscope((Integer) obj[13]);\r\n\t\t\t\t\t\tdata.setSource_domain((Integer) obj[14]);\r\n\t\t\t\t\t\tdata.setInfringing_domain((Integer) obj[15]);\r\n\t\t\t\t\t\tdata.setUser_id((Integer) obj[16]);\r\n\t\t\t\t\t\tlst1 = dao_propwise.viewRecord(\r\n\t\t\t\t\t\t\t\t\"select DISTINCT cm.client_name , mp.name , cm.id from Productivity_property_wise ppw, \"\r\n\t\t\t\t\t\t\t\t\t\t+ \" Project_info pi, Client_master cm, Markscan_projecttype mp where \"\r\n\t\t\t\t\t\t\t\t\t\t+ \" ppw.project_id= pi.id and \"\r\n\t\t\t\t\t\t\t\t\t\t+ \" pi.client_type= cm.id and pi.project_type = mp.id and ppw.user_id =\"\r\n\t\t\t\t\t\t\t\t\t\t+ (Integer) obj[16] + \" and \" + \" ppw.created_on = '\" + obj[0].toString()\r\n\t\t\t\t\t\t\t\t\t\t+ \"'\");\r\n\t\t\t\t\t\tin_side = new ArrayList<>();\r\n\t\t\t\t\t\tfor (int i1 = 0; i1 < lst1.size(); i1++) {\r\n\t\t\t\t\t\t\t obj1 = (Object[]) lst1.get(i1);\r\n\r\n\t\t\t\t\t\t\tlst0 = dao_propwise.viewRecord(\"select sum( productivi0_.source_count), \"\r\n\t\t\t\t\t\t\t\t\t+ \" sum( productivi0_.infringing_count),sum( productivi0_.youtube), \"\r\n\t\t\t\t\t\t\t\t\t+ \" sum( productivi0_.facebook), sum(productivi0_.instagram), \"\r\n\t\t\t\t\t\t\t\t\t+ \" sum(productivi0_.twitter),sum(productivi0_.vk), sum(productivi0_.periscope) \"\r\n\t\t\t\t\t\t\t\t\t+ \" from Productivity_property_wise productivi0_, Project_info project_in1_ \"\r\n\t\t\t\t\t\t\t\t\t+ \" where project_in1_.id=productivi0_.project_id and \" + \" productivi0_.user_id=\"\r\n\t\t\t\t\t\t\t\t\t+ (Integer) obj[16] + \" and \" + \" productivi0_.created_on='\" + obj[0].toString()\r\n\t\t\t\t\t\t\t\t\t+ \"' and \" + \"project_in1_.client_type=\" + (Integer) obj1[2]);\r\n\r\n\t\t\t\t\t\t\tfor (int i0 = 0; i0 < lst0.size(); i0++) {\r\n\t\t\t\t\t\t\t\t obj0 = (Object[]) lst0.get(i0);\r\n\r\n\t\t\t\t\t\t\t\t craw = new Crawle_url2();\r\n\t\t\t\t\t\t\t\tcraw.setWid(obj1[0].toString()); // client_name\r\n\t\t\t\t\t\t\t\tcraw.setIs_valid(((Long) obj0[0]).intValue());// source\r\n\t\t\t\t\t\t\t\tcraw.setStatus(((Long) obj0[1]).intValue());// infringing\r\n\t\t\t\t\t\t\t\tcraw.setUser_id(((Long) obj0[2]).intValue());// youtube\r\n\t\t\t\t\t\t\t\tcraw.setProject_id(((Long) obj0[3]).intValue());// FB\r\n\t\t\t\t\t\t\t\tcraw.setType(((Long) obj0[4]).intValue());// instagram\r\n\t\t\t\t\t\t\t\tcraw.setVerified(((Long) obj0[5]).intValue());// twitter\r\n\t\t\t\t\t\t\t\tcraw.setSite_down(((Long) obj0[6]).intValue());// vk\r\n\t\t\t\t\t\t\t\tcraw.setIs_new(((Long) obj0[7]).intValue());// pscp\r\n\r\n\t\t\t\t\t\t\t\tin_side.add(craw);\r\n\t\t\t\t\t\t\t\tobj0=null;\r\n\t\t\t\t\t\t\t\tcraw=null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tobj1=null;\r\n\t\t\t\t\t\t\tlst0 = null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// System.out.println(client_names);\r\n\t\t\t\t\t\tdata.setInside(in_side);\r\n\r\n\t\t\t\t\t\tmonthlyGraph.add(data);\r\n\t\t\t\t\t\tlst1 = null;\r\n\t\t\t\t\t\tdata=null;\r\n\t\t\t\t\t\t\t\tobj=null;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlst = null;\r\n\t\t\t\t\tlst1 = null;\r\n\t\t\t\t\tlst0 = null;\r\n\t\t\t\t\tdao_userWise = null;\r\n\t\t\t\t\tdao_propwise = null;\r\n\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\treturn ERROR;\r\n\t\t\t\t}\r\n\t\t\t\tfinally{\r\n\t\t\t\t\tobj0=null;\r\n\t\t\t\t\tcraw=null;\r\n\t\t\t\t\tobj1=null;\r\n\t\t\t\t\tlst0 = null;\r\n\t\t\t\t\tlst1 = null;\r\n\t\t\t\t\tdata=null;\r\n\t\t\t\t\t\t\tobj=null;\r\n\t\t\t\t\t\t\tdao_userWise = null;\r\n\t\t\t\t\t\t\tdao_propwise = null;\r\n\t\t\t\t\t\t\tlst = null;\r\n\t\t\t\t\t\t\tfactory=null;\r\n\t\t\t\t\t\t\tdao_userWise=null;\r\n\t\t\t\t\t\t\tdao_propwise=null;\r\n\t\t\t\t\t\t\tsession2=null;\r\n\t\t\t\t}\r\n\t\t\t\tSystem.gc();\r\n\t\t\t\treturn \"allEmpReport\";\r\n\t\t\t} else if (colorRadio.equalsIgnoreCase(\"green\")) {\r\n\t\t\t\t// for single user\r\n\t\t\t\ttry {\r\n\t\t\t\t\tlst = dao_userWise\r\n\t\t\t\t\t\t\t.viewRecord(\"select puw.curr_date, puw.source_link, puw.infringing_link, puw.youtube, \"\r\n\t\t\t\t\t\t\t\t\t+ \" puw.social_media, puw.white_list, puw.grey_list, puw.duplicate , puw.facebook,\"\r\n\t\t\t\t\t\t\t\t\t+ \" puw.instagram, puw.twitter, puw.vk, puw.periscope, puw.source_domain, \"\r\n\t\t\t\t\t\t\t\t\t+ \" puw.infringing_domain from \" + \" Productivity_user_wise puw where puw.user_id=\"\r\n\t\t\t\t\t\t\t\t\t+ usertype + \" and puw.curr_date between\" + \" '\" + date + \"' and '\" + date1 + \"'\");\r\n\t\t\t\t\tmonthlyGraph = new ArrayList<>();\r\n\r\n\t\t\t\t\tfor (int i = 0; i < lst.size(); i++) {\r\n\t\t\t\t\t\t obj = (Object[]) lst.get(i);\r\n\r\n\t\t\t\t\t\t data = new DashBoardData();\r\n\t\t\t\t\t\tdata.setDate(obj[0].toString());\r\n\t\t\t\t\t\tdata.setSource((Integer) obj[1]);\r\n\t\t\t\t\t\tdata.setInfringing((Integer) obj[2]);\r\n\r\n\t\t\t\t\t\tdata.setYoutube((Integer) obj[3]);\r\n\t\t\t\t\t\tdata.setSocial_media((Integer) obj[4]);\r\n\r\n\t\t\t\t\t\tdata.setWhite_list((Integer) obj[5]);\r\n\t\t\t\t\t\tdata.setGrey_list((Integer) obj[6]);\r\n\t\t\t\t\t\tdata.setDuplicate((Integer) obj[7]);\r\n\r\n\t\t\t\t\t\tdata.setFacebook((Integer) obj[8]);\r\n\t\t\t\t\t\tdata.setInstagram((Integer) obj[9]);\r\n\t\t\t\t\t\tdata.setTwitter((Integer) obj[10]);\r\n\t\t\t\t\t\tdata.setVk((Integer) obj[11]);\r\n\t\t\t\t\t\tdata.setPeriscope((Integer) obj[12]);\r\n\t\t\t\t\t\tdata.setSource_domain((Integer) obj[13]);\r\n\t\t\t\t\t\tdata.setInfringing_domain((Integer) obj[14]);\r\n\r\n\t\t\t\t\t\tlst1 = dao_propwise.viewRecord(\r\n\t\t\t\t\t\t\t\t\"select DISTINCT cm.client_name , mp.name , cm.id from Productivity_property_wise ppw, \"\r\n\t\t\t\t\t\t\t\t\t\t+ \" Project_info pi, Client_master cm, Markscan_projecttype mp where \"\r\n\t\t\t\t\t\t\t\t\t\t+ \" ppw.project_id= pi.id and \"\r\n\t\t\t\t\t\t\t\t\t\t+ \" pi.client_type= cm.id and pi.project_type = mp.id and ppw.user_id =\"\r\n\t\t\t\t\t\t\t\t\t\t+ usertype + \" and \" + \" ppw.created_on = '\" + obj[0].toString() + \"'\");\r\n\t\t\t\t\t\tin_side = new ArrayList<>();\r\n\t\t\t\t\t\tfor (int i1 = 0; i1 < lst1.size(); i1++) {\r\n\t\t\t\t\t\t\t obj1 = (Object[]) lst1.get(i1);\r\n\r\n\t\t\t\t\t\t\tlst0 = dao_propwise.viewRecord(\"select sum( productivi0_.source_count), \"\r\n\t\t\t\t\t\t\t\t\t+ \" sum( productivi0_.infringing_count),sum( productivi0_.youtube), \"\r\n\t\t\t\t\t\t\t\t\t+ \" sum( productivi0_.facebook), sum(productivi0_.instagram), \"\r\n\t\t\t\t\t\t\t\t\t+ \" sum(productivi0_.twitter),sum(productivi0_.vk), sum(productivi0_.periscope) \"\r\n\t\t\t\t\t\t\t\t\t+ \" from Productivity_property_wise productivi0_, Project_info project_in1_ \"\r\n\t\t\t\t\t\t\t\t\t+ \" where project_in1_.id=productivi0_.project_id and \" + \" productivi0_.user_id=\"\r\n\t\t\t\t\t\t\t\t\t+ usertype + \" and \" + \" productivi0_.created_on='\" + obj[0].toString() + \"' and \"\r\n\t\t\t\t\t\t\t\t\t+ \"project_in1_.client_type=\" + (Integer) obj1[2]);\r\n\r\n\t\t\t\t\t\t\tfor (int i0 = 0; i0 < lst0.size(); i0++) {\r\n\t\t\t\t\t\t\t\t obj0 = (Object[]) lst0.get(i0);\r\n\r\n\t\t\t\t\t\t\t\t craw = new Crawle_url2();\r\n\t\t\t\t\t\t\t\tcraw.setWid(obj1[0].toString()); // client_name\r\n\t\t\t\t\t\t\t\tcraw.setIs_valid(((Long) obj0[0]).intValue());// source\r\n\t\t\t\t\t\t\t\tcraw.setStatus(((Long) obj0[1]).intValue());// infringing\r\n\t\t\t\t\t\t\t\tcraw.setUser_id(((Long) obj0[2]).intValue());// youtube\r\n\t\t\t\t\t\t\t\tcraw.setProject_id(((Long) obj0[3]).intValue());// FB\r\n\t\t\t\t\t\t\t\tcraw.setType(((Long) obj0[4]).intValue());// instagram\r\n\t\t\t\t\t\t\t\tcraw.setVerified(((Long) obj0[5]).intValue());// twitter\r\n\t\t\t\t\t\t\t\tcraw.setSite_down(((Long) obj0[6]).intValue());// vk\r\n\t\t\t\t\t\t\t\tcraw.setIs_new(((Long) obj0[7]).intValue());// pscp\r\n\r\n\t\t\t\t\t\t\t\tin_side.add(craw);\r\n\t\t\t\t\t\t\t\tobj0=null;\r\n\t\t\t\t\t\t\t\tcraw=null;\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\tobj1=null;\r\n\t\t\t\t\t\t\tlst0=null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdata.setInside(in_side);\r\n\t\t\t\t\t\tmonthlyGraph.add(data);\r\n\t\t\t\t\t\tobj=null;\r\n\t\t\t\t\t\tdata= null;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlst = null;\r\n\t\t\t\t\tlst1 = null;\r\n\t\t\t\t\tlst0 = null;\r\n\t\t\t\t\tdao_userWise = null;\r\n\t\t\t\t\tdao_propwise = null;\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\treturn ERROR;\r\n\t\t\t\t}\r\n\t\t\t\tfinally\r\n\t\t\t\t{\r\n\t\t\t\t\tlst = null;\r\n\t\t\t\t\tlst1 = null;\r\n\t\t\t\t\tlst0 = null;\r\n\t\t\t\t\tdao_userWise = null;\r\n\t\t\t\t\tdao_propwise = null;\r\n\t\t\t\t\tdata=null;\r\n\t\t\t\t\tcraw= null;\r\n\t\t\t\t\tfactory=null;\r\n\t\t\t\t\tdao_userWise=null;\r\n\t\t\t\t\tdao_propwise=null;\r\n\t\t\t\t\tsession2=null;\r\n\t\t\t\t}\r\n\t\t\t\tSystem.gc();\r\n\t\t\t\treturn \"empReport\";\r\n\t\t\t} else if (colorRadio.equalsIgnoreCase(\"blue\")) {\r\n\t\t\t\t// for client wise\r\n\t\t\t\ttry {\r\n\r\n\t\t\t\t\tlst = pcw.viewRecord(\"select pcw.curr_date, pcw.source_link, pcw.infringing_link, pcw.youtube,\"\r\n\t\t\t\t\t\t\t+ \" pcw.social_media, pcw.white_list, pcw.grey_list , pcw.facebook, pcw.instagram, pcw.twitter,\"\r\n\t\t\t\t\t\t\t+ \" pcw.vk, pcw.periscope, pcw.source_domain, pcw.infringing_domain from Productivity_client_wise \"\r\n\t\t\t\t\t\t\t+ \" pcw where pcw.curr_date between '\" + date + \"' and '\" + date1 + \"' and pcw.client_id=\"\r\n\t\t\t\t\t\t\t+ clientname);\r\n\t\t\t\t\tmonthlyGraph = new ArrayList<>();\r\n\r\n\t\t\t\t\tfor (int i = 0; i < lst.size(); i++) {\r\n\t\t\t\t\t\t obj = (Object[]) lst.get(i);\r\n\r\n\t\t\t\t\t\t data = new DashBoardData();\r\n\t\t\t\t\t\tdata.setDate(obj[0].toString());\r\n\t\t\t\t\t\tdata.setSource((Integer) obj[1]);\r\n\t\t\t\t\t\tdata.setInfringing((Integer) obj[2]);\r\n\r\n\t\t\t\t\t\tdata.setYoutube((Integer) obj[3]);\r\n\t\t\t\t\t\tdata.setSocial_media((Integer) obj[4]);\r\n\r\n\t\t\t\t\t\tdata.setWhite_list((Integer) obj[5]);\r\n\t\t\t\t\t\tdata.setGrey_list((Integer) obj[6]);\r\n\r\n\t\t\t\t\t\tdata.setFacebook((Integer) obj[7]);\r\n\t\t\t\t\t\tdata.setInstagram((Integer) obj[8]);\r\n\t\t\t\t\t\tdata.setTwitter((Integer) obj[9]);\r\n\t\t\t\t\t\tdata.setVk((Integer) obj[10]);\r\n\t\t\t\t\t\tdata.setPeriscope((Integer) obj[11]);\r\n\r\n\t\t\t\t\t\tdata.setSocial_media((Integer) obj[7] + (Integer) obj[8] + (Integer) obj[9] + (Integer) obj[10]\r\n\t\t\t\t\t\t\t\t+ (Integer) obj[11]);\r\n\r\n\t\t\t\t\t\tdata.setSource_domain((Integer) obj[12]);\r\n\t\t\t\t\t\tdata.setInfringing_domain((Integer) obj[13]);\r\n\r\n\t\t\t\t\t\tlst1 = dao_propwise.viewRecord(\r\n\t\t\t\t\t\t\t\t\"select DISTINCT mu.name, ppw.created_on ,ppw.user_id from Productivity_property_wise ppw ,\"\r\n\t\t\t\t\t\t\t\t\t\t+ \" Markscan_users mu where mu.id= ppw.user_id and ppw.client_id = \"\r\n\t\t\t\t\t\t\t\t\t\t+ clientname + \" and ppw.created_on='\" + obj[0].toString() + \"' \");\r\n\t\t\t\t\t\tin_side = new ArrayList<>();\r\n\t\t\t\t\t\tfor (int i1 = 0; i1 < lst1.size(); i1++) {\r\n\t\t\t\t\t\t\t obj1 = (Object[]) lst1.get(i1);\r\n\r\n\t\t\t\t\t\t\tlst0 = dao_propwise.viewRecord(\" select sum( productivi0_.source_count),\"\r\n\t\t\t\t\t\t\t\t\t+ \" sum(productivi0_.infringing_count),sum( productivi0_.youtube), \"\r\n\t\t\t\t\t\t\t\t\t+ \" sum(productivi0_.facebook),sum(productivi0_.instagram),sum(productivi0_.twitter) \"\r\n\t\t\t\t\t\t\t\t\t+ \" ,sum(productivi0_.vk),sum( productivi0_.periscope) from \"\r\n\t\t\t\t\t\t\t\t\t+ \" Productivity_property_wise productivi0_, Markscan_users markscan_u1_ where \"\r\n\t\t\t\t\t\t\t\t\t+ \" markscan_u1_.id=productivi0_.user_id and productivi0_.client_id= \" + clientname\r\n\t\t\t\t\t\t\t\t\t+ \" and productivi0_.created_on='\" + obj[0].toString() + \"' and \"\r\n\t\t\t\t\t\t\t\t\t+ \" productivi0_.user_id=\" + (Integer) obj1[2]);\r\n\r\n\t\t\t\t\t\t\tfor (int i0 = 0; i0 < lst0.size(); i0++) {\r\n\t\t\t\t\t\t\t\t obj0 = (Object[]) lst0.get(i0);\r\n\r\n\t\t\t\t\t\t\t\t craw = new Crawle_url2();\r\n\t\t\t\t\t\t\t\tcraw.setWid(obj1[0].toString()); // client_name\r\n\t\t\t\t\t\t\t\tcraw.setIs_valid(((Long) obj0[0]).intValue());// source\r\n\t\t\t\t\t\t\t\tcraw.setStatus(((Long) obj0[1]).intValue());// infringing\r\n\t\t\t\t\t\t\t\tcraw.setUser_id(((Long) obj0[2]).intValue());// youtube\r\n\t\t\t\t\t\t\t\tcraw.setProject_id(((Long) obj0[3]).intValue());// FB\r\n\t\t\t\t\t\t\t\tcraw.setType(((Long) obj0[4]).intValue());// instagram\r\n\t\t\t\t\t\t\t\tcraw.setVerified(((Long) obj0[5]).intValue());// twitter\r\n\t\t\t\t\t\t\t\tcraw.setSite_down(((Long) obj0[6]).intValue());// vk\r\n\t\t\t\t\t\t\t\tcraw.setIs_new(((Long) obj0[7]).intValue());// pscp\r\n\r\n\t\t\t\t\t\t\t\tin_side.add(craw);\r\n\t\t\t\t\t\t\t\tobj0=null;\r\n\t\t\t\t\t\t\t\tcraw=null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tobj1=null;\r\n\t\t\t\t\t\t\tlst0=null;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tdata.setInside(in_side);\r\n\r\n\t\t\t\t\t\tmonthlyGraph.add(data);\r\n\t\t\t\t\t\tobj= null;\r\n\t\t\t\t\t\tdata= null;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpcw = null;\r\n\t\t\t\t\tlst = null;\r\n\t\t\t\t\tlst1 = null;\r\n\t\t\t\t\tlst0 = null;\r\n\t\t\t\t\tdao_userWise = null;\r\n\t\t\t\t\tdao_propwise = null;\r\n\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\treturn ERROR;\r\n\t\t\t\t}\r\n\t\t\t\tfinally{\r\n\t\t\t\t\tpcw = null;\r\n\t\t\t\t\tlst = null;\r\n\t\t\t\t\tlst1 = null;\r\n\t\t\t\t\tlst0 = null;\r\n\t\t\t\t\tdao_userWise = null;\r\n\t\t\t\t\tdao_propwise = null;\r\n\t\t\t\t\tobj=null;\r\n\t\t\t\t\tdata=null;\r\n\t\t\t\t\tcraw=null;\r\n\t\t\t\t\tfactory=null;\r\n\t\t\t\t\tdao_userWise=null;\r\n\t\t\t\t\tdao_propwise=null;\r\n\t\t\t\t\tsession2=null;\r\n\t\t\t\t}\r\n\t\t\t\tSystem.gc();\r\n\t\t\t\treturn \"clientReport\";\r\n\t\t\t}\r\n\r\n\t\t\tfactory=null;\r\n\t\t\tdao_userWise=null;\r\n\t\t\tdao_propwise=null;\r\n\t\t\tsession2=null;\r\n\t\t\tSystem.gc();\r\n\t\t\treturn SUCCESS;\r\n\t\t}\r\n\t}",
"@Override\n public void calEscalator(String lineCode, Integer plateEscalatorNum,\n List<Integer> exportNumber, List<Integer> transferOutNumber,\n Double walkSpeed, Double plateformLength,\n Double upEscalatorWidth, Double floorWidth,\n String stationNameCode, PressureTimeTypeEnum pressureTimeTypeEnum) {\n\n List<PressureLevelResult> pressureLevelResultList = new ArrayList<>();\n\n for ( int i = 0; i < 8; i++ ) {\n\n Integer w = exportNumber.get(i);\n\n // 有换乘的加上换乘数据\n if ( transferOutNumber.size() > 0 )\n w += transferOutNumber.get(i);\n\n // 15min内,每组楼梯和扶梯服务的乘客数\n Integer q = w / plateEscalatorNum;\n // 输入时间\n Double t0 = plateformLength / ( 2 * plateEscalatorNum * walkSpeed );\n // 输入率\n Double lamda = 2 * w * walkSpeed / plateformLength;\n // 自动扶梯通过能力\n Double cEscalator = 2.25;\n // 楼梯通过能力\n Double cFloor = 0.89;\n\n // 排队系统输出率\n Double u = cEscalator * upEscalatorWidth / plateEscalatorNum + cFloor * floorWidth / plateEscalatorNum;\n\n // 输出时间\n Double t1 = w / ( plateEscalatorNum * u );\n\n // 最大排队乘客数Q = q1 - q0\n Double qMax = lamda * t0 - u * t0;\n\n // 排队中最大延误时间 ts\n Double ts = t1 - t0;\n\n // 平均排队乘客数Q\n Double qAvg = 0.5 * ( lamda - u ) * t0;\n\n // 排队乘客总的延误时间D\n\n Double result = qAvg * ts / 60;\n\n System.out.println( \"排队乘客总的延误时间D \" + result );\n\n\n PressureLevelResult pressureLevelResult = getPressureLevelResult(lineCode, stationNameCode,\n i, result, calEscalatorLevel( result ), PressureTypeEnum.Escalator,\n pressureTimeTypeEnum);\n\n pressureLevelResultList.add( pressureLevelResult );\n\n }\n\n// escalatorMap.put( \"line\" + lineCode, resultList );\n\n // 删除原来的 暂时从简\n savePressureResultData(lineCode, stationNameCode,\n pressureLevelResultList, PressureTypeEnum.Escalator, pressureTimeTypeEnum);\n\n }",
"public DTOSalida obtenerAccesosPlantilla(DTOOID dto) throws MareException\n { \n UtilidadesLog.info(\"DAOGestionComisiones.obtenerAccesosPlantilla(DTOOID dto): Entrada\"); \n StringBuffer query = new StringBuffer();\n RecordSet rs = new RecordSet(); \n DTOSalida dtos = new DTOSalida();\n BelcorpService bs = UtilidadesEJB.getBelcorpService(); \n query.append(\" SELECT DISTINCT A.ACCE_OID_ACCE OID, B.VAL_I18N DESCRIPCION \");\n query.append(\" FROM COM_PLANT_COMIS_ACCES A, V_GEN_I18N_SICC B, COM_PLANT_COMIS C \"); \n query.append(\" WHERE \");\n if(dto.getOid() != null) {\n query.append(\" A.PLCO_OID_PLAN_COMI = \" + dto.getOid() + \" AND \");\n }\n query.append(\" A.PLCO_OID_PLAN_COMI = C.OID_PLAN_COMI AND \"); \n query.append(\" C.CEST_OID_ESTA = \" + ConstantesCOM.ESTADO_ACTIVO + \" AND \"); \n \n query.append(\" B.ATTR_ENTI = 'SEG_ACCES' AND \"); \n query.append(\" B.ATTR_NUM_ATRI = 1 AND \");\n query.append(\" B.IDIO_OID_IDIO = \" + dto.getOidIdioma() + \" AND \");\n query.append(\" B.VAL_OID = A.ACCE_OID_ACCE \");\n query.append(\" ORDER BY DESCRIPCION \"); \n UtilidadesLog.debug(query.toString()); \n try {\n rs = bs.dbService.executeStaticQuery(query.toString());\n if(rs != null)\n dtos.setResultado(rs);\n }catch (Exception e) {\n UtilidadesLog.error(e);\n throw new MareException(e, UtilidadesError.armarCodigoError(CodigosError.ERROR_DE_ACCESO_A_BASE_DE_DATOS));\n } \n UtilidadesLog.info(\"DAOGestionComisiones.obtenerAccesosPlantilla(DTOOID dto): Salida\"); \n return dtos;\n }",
"public static String getUpdate(){\n //string joiner object to append string with new line as delimiter, for each user\n StringJoiner u = new StringJoiner(\"\\n\");\n\n //for each user in the user map\n for(User user : users.values()){\n //string joiner again for each user's info, delimited by space\n StringJoiner a = new StringJoiner(\" \");\n //add every info\n a.add(user.getUserID())\n .add(String.valueOf(user.getEcon()))\n .add(String.valueOf(user.getExp()))\n .add(String.valueOf(user.getRep()))\n .add(user.getDailyTime().toString())\n .add(user.getRepTime().toString());\n //add the collected info to each user\n u.add(a.toString());\n }\n //return data for all users\n return u.toString();\n }",
"public ArrayList<Double> search_plan(String user_id) {\n\t\tArrayList<Double> plan_info = new ArrayList<Double>(); // store the query result from plan table\n\t\ttry {\n\t\t\t//connect to the database with table: diet_plan\n\t\t\tConnection connection = this.getConnection();\n\t\t\t//prepare a SQL statement while leaving some parameters\n\t\t\tPreparedStatement stmt = connection.prepareStatement(\"SELECT fiber, energy, protein, fiber_serve, energy_serve, meat_serve, milk_serve FROM diet_plan where id = ? \");\n\t\t\t//PreparedStatement stmt = connection.prepareStatement(\"SELECT fiber, energy, protein, budget, fiber_serve, energy_serve, meat_serve, milk_serve FROM diet_plan where id = ? \");\n\t\t\tstmt.setString(1, user_id);//1 is the param location/index\n\t\t\tResultSet rs = stmt.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tplan_info.add(rs.getDouble(1));//fiber\n\t\t\t\tplan_info.add(rs.getDouble(2));//energy\n\t\t\t\tplan_info.add(rs.getDouble(3));//protein\n\t\t\t\t//plan.info.add(rs.getDouble(4));//budget\n\t\t\t\tplan_info.add(rs.getDouble(4));//fiber_serve\n\t\t\t\tplan_info.add(rs.getDouble(5));//energy_serve\n\t\t\t\tplan_info.add(rs.getDouble(6));//meat_serve\n\t\t\t\tplan_info.add(rs.getDouble(7));//milk_serve\n\t\t\t}\n\t\t\trs.close();\n\t\t\tstmt.close();\n\t\t\tconnection.close();\n\t\t} catch (Exception e) {\n\t\t\tlog.info(\"query error for search_plan: {}\", e.toString());\n\t\t\t//System.out.println(e);\n\t\t}\n\t\t//if (plan_info.size() != 0)\n\t\treturn plan_info;\n\n\t\t//throw new Exception(\"NOT FOUND\");\n\t}",
"private String calculateDistancePerAmount() {\n double distance = parser(getTextFromEditText(R.id.distanceEdit));\n double fuel = parser(getTextFromEditText(R.id.fuelEdit));\n double value = distance / fuel;\n return rounder(value);\n }",
"private static void calculateSimilarity() {\n \tLOG.info(\"Begin calculating spatial similarity between users.\");\n \t\n\t\t// Get a list of all users\n \tNeo4JUserDAO uDao = (Neo4JUserDAO) DAOFactory.instance().getUserDAO();\n\t\tList<Node> users = uDao.findAll();\n\t\t\n\t\tint usersCount = users.size();\n \tLOG.debug(\"Found {} users.\", usersCount);\n\t\t\n\t\t// Instantiate all needed classes for similarity measurement\n\t\tNeo4JSequenceExtractor ex = new Neo4JSequenceExtractor();\n\t\tex.setFromLevel(clArgs.calcSimilarityFromLevel);\n\t\tex.setToLevel(clArgs.calcSimilarityToLevel);\n\t\t\n\t\tNeo4JSequenceMatcher matcher = new Neo4JSequenceMatcher(\n\t\t\t\tclArgs.calcSimilaritySplitThreshold, \n\t\t\t\tclArgs.calcSimilarityMinSequenceLength,\n\t\t\t\tclArgs.calcSimilarityTempConstraintThreshold);\n\t\tNeo4JSimilarityAnalyzer analyzer = new Neo4JSimilarityAnalyzer();\n\t\t\n\t\t// Create matrix that holds similarity results\n\t\tdouble[][] similarityResults = new double[usersCount][usersCount];\n\t\t\n\t\t// Go through all pair-wise user combinations\n \tfor (int i = 0; i < usersCount; i++) {\n\t\t\tNode userOne = users.get(i);\n\t\t\tObject userOneId = uDao.getUserId(userOne);\n\t\t\t\n\t\t\t// Set current first user for sequence extraction\n\t\t\tex.setUserNodeOne(userOne);\n\t\t\t\n\t\t\tfor (int j = i + 1; j < usersCount; j++) {\n\t\t\t\tNode userTwo = users.get(j);\n\t\t\t\tObject userTwoId = uDao.getUserId(userTwo);\n\t\t\t\tLOG.info(\"Calculate similarity between user [{}] and [{}].\", userOneId, userTwoId);\n\t\t\t\t\n\t\t\t\tdouble similarity = 0.0;\n\t\t\t\t\n\t\t\t\t// Step 1: Extract cluster sequences of two users based on their hierarchical graphs\n\t\t\t\t// Set current second user for sequence extraction\n\t\t\t\tex.setUserNodeTwo(userTwo);\n\t\t\t\tMap<Integer, SequenceWrapper> clusterSequences = null;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t// Start extraction of cluster sequences\n\t\t\t\t\tLOG.info(\"Step 1: Extraction of cluster sequences from level {} to level {}.\", clArgs.calcSimilarityFromLevel, clArgs.calcSimilarityToLevel);\n\t\t\t\t\tclusterSequences = ex.extract();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLOG.error(\"An error occurred while extracting the sequences of common clusters of user [{}] and [{}]:\\n{}\", \n\t\t\t\t\t\t\tnew Object[] {userOneId, userTwoId, e});\n\t\t\t\t\tLOG.debug(\"Similarity measurement stopped for users [{}] and [{}].\", userOneId, userTwoId);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Step 2: Match the extracted cluster sequences to find maximal length similar sequences\n\t\t\t\tMap<Integer, List<Sequence<SimilarSequenceCluster>>> maxLengthSimilarSequences = null;\n\t\t\t\t\n\t\t\t\t// Matching is only possible if there is a valid result of step 1 \n\t\t\t\tif (clusterSequences != null && !clusterSequences.isEmpty()) {\n\t\t\t\t\tmatcher.setSequencesOnLevel(clusterSequences);\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Start matching of cluster sequences\n\t\t\t\t\t\tLOG.info(\"Step 2: Matching of cluster sequences.\");\n\t\t\t\t\t\tmaxLengthSimilarSequences = matcher.match();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tLOG.error(\"An error occurred while matching the sequences of common clusters of user [{}] and [{}]:\\n{}\", \n\t\t\t\t\t\t\t\tnew Object[] {userOneId, userTwoId, e});\n\t\t\t\t\t\tLOG.debug(\"Similarity measurement stopped for users [{}] and [{}].\", userOneId, userTwoId);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t// Step 3: Compute spatial similarity between the current two users\n\t\t\t\t\t// Similarity measurement is only possible with a valid result of step 2\n\t\t\t\t\tif (maxLengthSimilarSequences != null && !maxLengthSimilarSequences.isEmpty()) {\n\t\t\t\t\t\tanalyzer.setUserNodeOne(userOne);\n\t\t\t\t\t\tanalyzer.setUserNodeTwo(userTwo);\n\t\t\t\t\t\tanalyzer.setMaximalLengthSimilarSequencesOnLevel(maxLengthSimilarSequences);\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Start similarity measurement\n\t\t\t\t\t\t\tLOG.info(\"Step 3: Similarity measurement.\");\n\t\t\t\t\t\t\tsimilarity = analyzer.analyze();\n\t\t\t\t\t\t\tLOG.debug(\"Final similarity score: {}\", similarity);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Save similarity value in result matrix\n\t\t\t\t\t\t\tsimilarityResults[i][j] = similarity;\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tLOG.error(\"An error occurred while measuring similarity between user [{}] and [{}]:\\n{}\", \n\t\t\t\t\t\t\t\t\tnew Object[] {userOneId, userTwoId, e});\n\t\t\t\t\t\t\tLOG.debug(\"Similarity measurement stopped for users [{}] and [{}].\", userOneId, userTwoId);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\t// END: step 3\n\t\t\t\t}\t// END: step 2\n\t\t\t}\t// END: user two loop\n\t\t}\t// END: user one loop\n \t\n \tLOG.info(\"Finished calculating spatial similarity.\");\n \t\n \t// Normalize the similarity scores from 0 to 1\n \tif (clArgs.normalization) {\n\t \tLOG.info(\"Normalizing similarity scores.\");\n\t \tsimilarityResults = SimilarityNormalizer.normalize(similarityResults);\n \t}\n \t\n \t// The evaluation is requested\n \tif (clArgs.evaluation) {\n \t\tLOG.info(\"Evaluation is enabled.\");\n \t\t\n \t\t// Calculate simple evaluation\n \t\tLOG.info(\"Calculate similarity evaluation values.\");\n \t\tSimilarityEvaluation evaluation = SimilarityEvaluator.evaluate(similarityResults);\n \t\t\n \t\t// Build up other information to include in the evaluation files\n \t\tList<String> otherInformation = new ArrayList<String>();\n \t\tif (clArgs.automation) {\n \t\t\t// Clustering information is only included if the automation task is running\n \t\t\totherInformation.add(CommandLineArgs.CLUSTERING_OPTICS_XI);\n \t\t\totherInformation.add(String.valueOf(df.format(currentOpticsXi)));\n \t\t\totherInformation.add(CommandLineArgs.CLUSTERING_OPTICS_MIN_POINTS);\n \t\t\totherInformation.add(String.valueOf(df.format(currentOpticsMinPoints)));\n \t\t}\n \t\t\n \t\t// Add simple metrics from similarity measurement\n \t\totherInformation.add(SimilarityEvaluation.SIMILARITY_MIN);\n \t\totherInformation.add(String.valueOf(df.format(evaluation.getMin())));\n \t\totherInformation.add(SimilarityEvaluation.SIMILARITY_MAX);\n \t\totherInformation.add(String.valueOf(df.format(evaluation.getMax())));\n \t\totherInformation.add(SimilarityEvaluation.SIMILARITY_MEAN);\n \t\totherInformation.add(String.valueOf(df.format(evaluation.getSimilarityMean())));\n \t\totherInformation.add(SimilarityEvaluation.SIMILAR_USER_PAIRS);\n \t\totherInformation.add(String.valueOf(evaluation.getSimilarUserPairs()));\n \t\t\n \t\t// Write similarity results in a file\n \t\tLOG.info(\"Writing evaluation data to a file.\");\n \t\tArrayToCsvWriter.writeDoubles(similarityResults, clArgs.evaluationOutDir, otherInformation.toArray(new String[0]));\n \t}\n \t// Evaluation is not requested, write the similarity scores into the graph database\n \telse {\n \t\tLOG.info(\"Write similarity scores to the graph database.\");\n \t\t\n \t\tfor (int i = 0; i < similarityResults.length; i++) {\n \t\t\t// Get first user by id\n \t\t\tNode userOne = uDao.findUserById(i);\n \t\t\tfor (int j = i + 1; j < similarityResults.length; j++) {\n \t\t\t\tdouble similarityScore = similarityResults[i][j];\n \t\t\t\t// User pairs that are not similar (i.e., have a similarity score of zero) do not get a connection\n \t\t\t\tif (similarityScore > 0) {\n\t \t\t\t\t// Get second user by id\n\t \t\t\t\tNode userTwo = uDao.findUserById(j);\n\t \t\t\t\t\n\t \t\t\t\t// Add similarity relationship\n\t \t\t\t\tuDao.connectSimilarUsers(userOne, userTwo, similarityScore);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n }",
"@Retry(maxRetries=6,delayUnit=ChronoUnit.SECONDS,delay=10,durationUnit=ChronoUnit.MINUTES,maxDuration=5)\n @Fallback(LongFallbackHandler.class)\n @CircuitBreaker(delay=10,delayUnit = ChronoUnit.SECONDS, requestVolumeThreshold = 3, failureRatio = 1.0)\n @Timeout(value = 30, unit = ChronoUnit.SECONDS)\n public Long connect(String userId, Long miles) throws ConnectException, TimeoutException,CircuitBreakerOpenException,InterruptedException{\n int executionCounter = 0;\n \n if (logger.isLoggable(Level.FINE)) {\n logger.fine(\"CustomerClientFTConnectionBean.connect() called: \");\n }\n \n try {\n \n if (logger.isLoggable(Level.FINE)) {\n logger.fine(\"Delay Duration: \" + \"10 seconds\" + \n \" CustomerClientFTConnectionBean.connect() Service called, execution \" + executionCounter);\n }\n \n executionCounter++;\n \n Long totalMiles;\n \n if (secUtils.secureServiceCalls()) {\n Date date = new Date();\n \n String body = \"miles=\" + miles;\n \n String sigBody = secUtils.buildHash(body);\n String signature = secUtils.buildHmac(\"POST\",UPDATE_REWARD_PATH,userId,date.toString(),sigBody); \n \n totalMiles = customerClient.updateCustomerTotalMiles(userId, miles,userId, date.toString(), sigBody, signature).getMiles();\n } else {\n \n totalMiles = customerClient.updateCustomerTotalMiles(userId, miles).getMiles();\n }\n return totalMiles;\n \n } catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) {\n e.printStackTrace();\n executionCounter = 0;\n return null;\n }\n }",
"private void getDonationData() {\n\n if (UserManager.getToken(this) != null) {\n\n RequestManager.getDonationData(UserManager.getToken(this)).subscribe(new Observer<Result<DonationData>>() {\n @Override\n public void onSubscribe(Disposable d) {\n\n }\n\n @Override\n public void onNext(Result<DonationData> donationDataResult) {\n\n Gson gson = new Gson();\n String donationDataGson = gson.toJson(donationDataResult.getData());\n UserManager.setDonationData(donationDataGson, SignInActivity.this);\n }\n\n @Override\n public void onError(Throwable e) {\n\n }\n\n @Override\n public void onComplete() {\n\n }\n });\n\n }\n\n\n }",
"public String calculateDistance(Umpire ump, ArrayList<Club> clubs) throws IOException {\n \n Pair umpLatLong = new Pair<>(\"\", \"\");\n Pair clubLatLong = new Pair<>(\"\", \"\");\n ArrayList<Pair> clubLatLongArray = new ArrayList<>();\n String lat = database.getLatitudeFromUmpireDatabase(ump.getUmpireLicentie());\n String lon = database.getLongitudeFromUmpireDatabase(ump.getUmpireLicentie());\n if (lat == null || lon == null || lat.equals(Double.toString(0.0)) || lon.equals(Double.toString(0.0))) {\n System.out.println(\"lat, lon not present\");\n umpLatLong = getLocationUmpire(ump);\n database.updateUmpireLocationInDatabase(ump.getUmpireLicentie(), Double.toString((Double) umpLatLong.getKey()), Double.toString((Double) umpLatLong.getValue()));\n } else {\n umpLatLong = new Pair(lat, lon);\n }\n for (Club c : clubs) {\n String clat = database.getLatitudeFromClubDatabase(c.getClubNummer());\n String clon = database.getLongitudeFromClubDatabase(c.getClubNummer());\n Boolean force = Boolean.FALSE;\n if (clat == null || clon == null || clat.equals(Double.toString(0.0)) || clon.equals(Double.toString(0.0)) || Objects.equals(force, Boolean.TRUE)) {\n System.out.println(c.getClubNaam() + \": lat or lon club unknown or forced to recalculate location!\");\n clubLatLong = getLocationClub(c);\n clubLatLongArray.add(clubLatLong);\n database.updateClubLocationInDatabase(c.getClubNummer(), Double.toString((Double) clubLatLong.getKey()), Double.toString((Double) clubLatLong.getValue()));\n } else {\n System.out.println(c.getClubNaam() + \": lat and lon club in database.\");\n clubLatLongArray.add(new Pair(clat, clon));\n }\n \n }\n System.out.println(\"clubLatLongArray = \" + clubLatLongArray);\n String latUmp = (String) umpLatLong.getKey();\n String longUmp = (String) umpLatLong.getValue();\n System.out.println(\"latUmp = \" + latUmp + \", longUmp = \" + longUmp);\n String totalDistance = \"\";\n \n String originString = latUmp + \",\" + longUmp;\n System.out.println(\"Origin String = \" + originString);\n String destinationsString = \"\";\n \n ArrayList<String> destinationsArray = new ArrayList<>();\n for (Pair p : clubLatLongArray) {\n String clat = (String) p.getKey();\n String clon = (String) p.getValue();\n destinationsString = String.join(\",\", clat, clon);\n destinationsArray.add(destinationsString);\n }\n \n String destinationsLatLon = String.join(\";\", destinationsArray);\n System.out.println(\"Destinations String = \" + destinationsLatLon);\n \n try {\n //URL url = new URL(\"http://dev.virtualearth.net/REST/v1/Routes?wayPoint.1={wayPpoint1}&viaWaypoint.2={viaWaypoint2}&waypoint.3={waypoint3}&wayPoint.n={waypointN}&heading={heading}&optimize={optimize}&avoid={avoid}&distanceBeforeFirstTurn={distanceBeforeFirstTurn}&routeAttributes={routeAttributes}&timeType={timeType}&dateTime={dateTime}&maxSolutions={maxSolutions}&tolerances={tolerances}&distanceUnit={distanceUnit}&key={'\" + BingMapsKey + \"'}\");\n //URL url = new URL(\"https://dev.virtualearth.net/REST/v1/Routes/DistanceMatrix?origins={lat0,long0;lat1,lon1;latM,lonM}&destinations={lat0,lon0;lat1,lon1;latN,longN}&travelMode={travelMode}&startTime={startTime}&timeUnit={timeUnit}&key={'\"+BingMapsAPIKey+\"'}\");\n URL url = new URL(\"https://dev.virtualearth.net/REST/v1/Routes/DistanceMatrix?origins=\"+originString+\"&destinations=\"+destinationsLatLon+\"&travelMode=driving&key=LwvKKpyMS0B0X3uTAp0Y~q47SlJVuQ98QE6zlT_3gUA~AknQEc5Uo1JkymduJ8gUGcWDwPb5ZBifrtZM_R4-Q4ieHb__2JdktKpc6npU0WhZ\");\n\n HttpURLConnection con = (HttpURLConnection) url.openConnection();\n con.setRequestMethod(\"GET\");\n //https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=Ronse,Belgium&destinations=Ghent,Belgium&key=YOUR_API_KEY\n int status = con.getResponseCode();\n BufferedReader in = new BufferedReader(\n new InputStreamReader(con.getInputStream()));\n String inputLine;\n StringBuffer content = new StringBuffer();\n while ((inputLine = in.readLine()) != null) {\n content.append(inputLine);\n }\n in.close();\n System.out.println(\"inputLine = \" + inputLine);\n System.out.println(\"content = \" + content);\n String jsoncontent = content.toString();\n JSONObject obj = new JSONObject(jsoncontent);\n // read status and message\n String authResult = (String) obj.getString(\"authenticationResultCode\");\n System.out.println(\"authentication = \" + authResult);\n \n // Get resourceSets\n JSONArray resourceSets = (JSONArray) obj.get(\"resourceSets\"); \n for (int i = 0; i < resourceSets.length(); i++) {\n JSONArray resources = resourceSets.getJSONObject(i).getJSONArray(\"resources\");\n for (int j = 0; j < resources.length(); j++) {\n JSONArray results = resources.getJSONObject(j).getJSONArray(\"results\");\n JSONArray origins = resources.getJSONObject(j).getJSONArray(\"origins\");\n JSONArray destinations = resources.getJSONObject(i).getJSONArray(\"destinations\");\n for (int k = 0; k < results.length(); k++) {\n String distance = Float.toString(results.getJSONObject(k).getFloat(\"travelDistance\"));\n //String latitude = destinations.getJSONObject(k).getString(\"latitude\");\n String latitude = Float.toString(destinations.getJSONObject(k).getFloat(\"latitude\"));\n String longitude = Float.toString(destinations.getJSONObject(k).getFloat(\"longitude\"));\n System.out.println(\"club to look for: \" + clubs.get(k));\n System.out.println(\"Ump: \" + ump.getUmpireLicentie()+ \", club: \" + clubs.get(i).getClubNummer() + \", Latitude = \" + latitude + \", Longitude = \" + longitude + \", Distance: \" + distance);\n\n storeDistance(ump, clubs.get(k), distance);\n }\n }\n }\n \n \n } catch (MalformedURLException ex) {\n Logger.getLogger(ApiLocationDistance.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n \n return totalDistance;\n }",
"private void onAllTemperatures(RequestAllTemperatures r){\n\t\tgetContext().actorOf(DeviceGroupQuery.props(\n\t\t\t\tactorsIds, r.requestId, getSender(), new FiniteDuration(3, TimeUnit.SECONDS)));\n\t}",
"public void getAllMobilityChoices(HttpServletRequest req, HttpServletResponse resp,\n UserUcc userUcc, MobilityChoiceUcc mobilityChoiceUcc, OrganisationUcc organisationUcc) {\n try {\n int currentUserId = (int) IhmUserServlet.getCurrentUser(req);\n UserDto currentUser = userUcc.findDto(currentUserId);\n List<MobilityChoiceDto> mobilities;\n List<OrganisationDto> organisations;\n List<UserDto> users;\n\n /* If user is Student */\n if (currentUser.getTypeUser().equals(UserType.STUDENT.getUserType())) {\n mobilities = mobilityChoiceUcc.findAllDtosById(currentUserId, \"idUser\");\n } else {\n mobilities = mobilityChoiceUcc.findAllDtos();\n }\n organisations = organisationUcc.findAllDtos();\n users = userUcc.findAllDtos();\n Map<String, List> data = new HashMap<>();\n\n data.put(\"mobilities\", mobilities);\n data.put(\"organisations\", organisations);\n data.put(\"users\", users);\n\n String json = new Genson().serialize(data);\n resp.setContentType(\"application/json\");\n resp.getOutputStream().write(json.getBytes());\n } catch (IOException exp) {\n exp.printStackTrace();\n } catch (InternalServerException exp1) {\n exp1.printStackTrace();\n } catch (IdNotFoundException exp2) {\n exp2.printStackTrace();\n } catch (TransactionErrorException exp3) {\n exp3.printStackTrace();\n }\n }",
"@Override\n public Double buyDevice(String name, String type) {\n Cash c = null;\n Cheque ch = null;\n Card cd = null;\n \n Date d = new Date();\n \n switch (type) {\n case \"c1\":\n c = new Cash.Builder(d.toString())\n .build();\n break;\n case \"c2\":\n ch = new Cheque.Builder(d.toString())\n .build();\n break;\n case \"c3\":\n cd = new Card.Builder(d.toString())\n .build();\n break;\n }\n \n \n PurchaseVinyl v = new PurchaseVinyl.Builder()\n .setName(\"Let The Good Times Role\")\n .setPrice(3.99)\n .build();\n \n PurchaseVinyl v1 = new PurchaseVinyl.Builder()\n .setName(\"Thanks For The Meomories\")\n .setPrice(3.99)\n .build();\n \n List<PurchaseVinyl> vinylList = new ArrayList();\n vinylList.add(v);\n vinylList.add(v1);\n \n \n ProductPurchase pc = new ProductPurchase.Builder(d)\n .setVinylPurchases(vinylList)\n .setCardPurchases(cd)\n .setCashPurchases(c)\n .setChequePurchases(ch)\n .build();\n \n repo.save(pc);\n id = pc.getID();\n \n ProductPurchase pc2 = repo.findOne(id);\n for(int x = 0; pc2.getVinylPurchases().size() > x; x++){\n if(pc2.getVinylPurchases().get(x).getName().equals(name)){\n return pc2.getVinylPurchases().get(x).getPrice();\n }\n }\n return null; \n }",
"public void sample_U() {\n\t\t//Note, sumU and sumUUT are update in the update function itself. Hence, when\n\t\t//sample_U is called after the 1 iteration of all vertices, we already have the sum.\n\t\t\n\t\t//meanU = (SUM U_i)/N\n\t\tRealVector meanU = params.sumU.mapMultiply(1.0/datasetDesc.getNumUsers());\n\t\t//meanS = (SUM (U_i*U_i')/N)\n\t\tRealMatrix meanS = params.sumUUT.scalarMultiply(1.0/datasetDesc.getNumUsers());\n\t\t\n\t\t//mu0 = (beta0*mu0 + meanU)/(beta0 + N)\n\t\tRealVector mu0_ = (params.mu0_U.mapMultiply(params.beta0_U).add(meanU)).mapDivide((params.beta0_U + datasetDesc.getNumUsers()));\n\t\t\n\t\tdouble beta0_ = params.beta0_U + datasetDesc.getNumUsers();\n\t\tint nu0_ = params.nu0_U + datasetDesc.getNumUsers();\n\t\t\n\t\t//W0 = inv( inv(W0) + N*meanS + (beta0*N/(beta0 + N))(mu0 - meanU)*(mu0 - meanU)'\n\t\tRealVector tmp = params.mu0_U.subtract(meanU);\n\t\tRealMatrix mu0_d_meanU_T = tmp.outerProduct(tmp); \n\t\tmu0_d_meanU_T = mu0_d_meanU_T.scalarMultiply((params.beta0_U*datasetDesc.getNumUsers()/(params.beta0_U + datasetDesc.getNumUsers())));\n\t\tRealMatrix invW0_ = params.invW0_U.add(params.sumUUT).add(mu0_d_meanU_T);\n\t\t\n\t\t//Update all the values.\n\t\tparams.mu0_U = mu0_;\n\t\tparams.beta0_U = beta0_;\n\t\tparams.nu0_U = nu0_;\n\t\tparams.invW0_U = invW0_;\n\t\tparams.W0_U = (new LUDecompositionImpl(invW0_)).getSolver().getInverse();\n\t\t\n\t\t//Sample lambda_U and mu_U from the Gaussian Wishart distribution\n\t\t// http://en.wikipedia.org/wiki/Normal-Wishart_distribution#Generating_normal-Wishart_random_variates\n\t\t//Draw lambda_U from Wishart distribution with scale matrix w0_U.\n\t\tparams.lambda_U = sampleWishart(params.invW0_U, params.nu0_U);\n\t\t//Compute cov = inv(beta0*lambda) \n\t\tRealMatrix cov = (new LUDecompositionImpl(params.lambda_U.scalarMultiply(params.beta0_U))).getSolver().getInverse();\n\t\t//Draw mu_U from multivariate normal dist with mean mu0_U and covariance inv(beta0*lambda)\n\t\tMultivariateNormalDistribution dist = new MultivariateNormalDistribution(params.mu0_U.toArray(), \n\t\t\t\tcov.getData());\n\t\tparams.mu_U = new ArrayRealVector(dist.sample());\n\t\t\n\t\t//Reset the sum of latent factors.\n\t\tparams.sumU.mapMultiply(0);\n\t\tparams.sumUUT.scalarMultiply(0);\n\t}",
"private void calculateAndShowStatistics() {\n Map<Country, Float> countryWithMinInternetUsers = findCountryWithMinInternetUsers();\n Map<Country, Float> countryWithMinLiteracyRate = findCountryWithMinLiteracyRate();\n Map<Country, Float> countryWithMaxInternetUsers = findCountryWithMaxInternetUsers();\n Map<Country, Float> countryWithMaxLiteracyRate = findCountryWithMaxLiteracyRate();\n\n // Output header\n System.out.println(\"\\nStatistics based on the data provided in the database\\n\");\n\n // Output minimums\n screenPrinter.outputMinOrMax(\"minimum\", \"amount of Internet Users\", countryWithMinInternetUsers);\n screenPrinter.outputMinOrMax(\"minimum\", \"Adult Literacy Rate\",countryWithMinLiteracyRate);\n\n // Output maximums\n screenPrinter.outputMinOrMax(\"maximum\", \"amount of Internet Users\",countryWithMaxInternetUsers);\n screenPrinter.outputMinOrMax(\"maximum\", \"Adult Literacy Rate\",countryWithMaxLiteracyRate);\n System.out.println();\n\n // Find countries that have all the data\n List<Country> countriesWithoutMissingData = findAllCountiesWithoutMissingData();\n\n // Form two separate lists with just indicators\n List<Float> listOfInternetUsersRates = getListOfInternetUsersRates(countriesWithoutMissingData);\n List<Float> listOfLiteracyRates = getListOfLiteracyRates(countriesWithoutMissingData);\n\n // Calculate the correlation coefficient\n double correlationCoefficient = calculateCorCoeff(listOfInternetUsersRates, listOfLiteracyRates);\n// double pearsonCoefficient = calculateCoeffThirdParty(listOfInternetUsersRates, listOfLiteracyRates);\n\n // output correlation coefficient\n screenPrinter.outputCorrelation(correlationCoefficient);\n }",
"public void generateReportPluviometer() {\r\n\t\tReportsController reportsController = ControladorContexto\r\n\t\t\t\t.getContextBean(ReportsController.class);\r\n\t\ttry {\r\n\t\t\tconsultPluviometer();\r\n\t\t\treportsController.generateReportPluviometer(pluviometerPojoList,\r\n\t\t\t\t\tyear);\r\n\t\t\tsetStartDateReport(null);\r\n\t\t\tsetEndDateReport(null);\r\n\t\t} catch (Exception e) {\r\n\t\t\tControladorContexto.mensajeError(e);\r\n\t\t}\r\n\t}",
"public Vector listICPUserRegBasedOnReleaseId(String releaseId) throws SQLException {\n Debug.print(\"Inside the getUserAndMemberId\");\n Vector vObj = new Vector();\n try {\n makeConnection();\n String slelctStr = \"select A.assesment_level, A.assesment_date, A.no_of_days, B.area_name, \"+\n \" A.location, C.first_name, C.last_name, D.address1, D.country, D.state, \"+\n \"D.zip, D.phone_no, D.fax_no, E.membership_status, E.member_id, E.add_date, E.request_status,C.email_id, D.city,E.release_id,E.comments FROM \"+\n DBHelper.USEA_INSTRUCTOR_DETAILS+\" A, \"+DBHelper.USEA_AREA_MASTER+\" B, \"+DBHelper.USEA_MMS_USERMASTER+\" C, \"+\n DBHelper.USEA_CONTACT_DETAILS+\" D, \"+DBHelper.USEA_ICP_USER_DETAIL+\" E \"+\n \" where E.icp_meeting_id = A.icp_meeting_id and E.user_id = C.user_id and \"+\n \" A.usea_area_id = B.area_id and C.user_id = D.user_id and C.contact_type_id = D.contact_type_id and \"+\n \" E.release_id = ? \";\n PreparedStatement prepStmt = con.prepareStatement(slelctStr);\n prepStmt.setString(1, releaseId);\n rs = prepStmt.executeQuery();\n System.out.println(\"Inside the listICPUserReg status : \"+userId);\n if(rs.next()) {\n this.assesmentLevel = rs.getString(1);\n Date assesmentDate1 = rs.getDate(2);\n this.noOfDays = rs.getString(3);\n this.areaName = rs.getString(4);\n this.location = rs.getString(5);\n this.firstName = rs.getString(6);\n this.lastName = rs.getString(7);\n this.address1 = rs.getString(8);\n this.country = rs.getString(9);\n this.state = rs.getString(10);\n this.zip = rs.getString(11);\n this.phoneNo = rs.getString(12);\n this.faxNo = rs.getString(13);\n this.membershipStatus = rs.getString(14);\n this.memberId = rs.getString(15);\n Date addDate1 = rs.getDate(16);\n this.requestStatus = rs.getString(17);\n this.emailId = rs.getString(18);\n this.city = rs.getString(19);\n this.releaseId = rs.getString(20);\n this.comments = rs.getString(21);\n \n this.addDate = DBHelper.dateToString(addDate1);\n this.assesmentDate = DBHelper.dateToString(assesmentDate1);\n \n String [] userList = {assesmentLevel,assesmentDate,noOfDays,areaName,location,firstName,lastName,address1,\n country,state,zip,phoneNo,faxNo,membershipStatus,memberId,addDate,requestStatus,emailId,city,releaseId,comments};\n vObj.add(userList);\n }\n releaseConnection();\n }catch (SQLException e){\n e.printStackTrace();\n }finally {\n releaseConnection();\n }\n return vObj;\n }",
"synchronized public void writeResult(TripData tripData, long currentTimeMillis, Location location) {\n\t\tfloat avgCalcPower = 0.0f;\n\t\tdouble stdCalcPower = 0.0f;\n\t\tfloat avgCalcTorque = 0.0f;\n\t\tdouble stdCalcTorque = 0.0f;\n\t\tfloat avgCalcCrankCadence = 0.0f;\n\t\tdouble stdCalcCrankCadence = 0.0f;\n\t\tfloat avgCalcWheelSpeed = 0.0f;\n\t\tdouble stdCalcWheelSpeed = 0.0f;\n\t\tfloat avgCalcWheelDistance = 0.0f;\n\t\tdouble stdCalcWheelDistance = 0.0f;\n\t\t\n\t\ttry {\n\t\t\t// Calculate averages and sum square differences\n\t\t\tif (calculatedPowers.size() > 0) {\n\t\t\t\tavgCalcPower = MyMath.getAverageValueBD(calculatedPowers);\n\t\t\t\tstdCalcPower = MyMath.getStandardDeviationBD(calculatedPowers, avgCalcPower);\n\t\t\t}\n\t\t\tif (calculatedTorques.size() > 0) {\n\t\t\t\tavgCalcTorque = MyMath.getAverageValueBD(calculatedTorques);\n\t\t\t\tstdCalcTorque = MyMath.getStandardDeviationBD(calculatedTorques, avgCalcTorque);\n\t\t\t}\n\t\t\tif (calculatedCrankCadences.size() > 0) {\n\t\t\t\tavgCalcCrankCadence = MyMath.getAverageValueBD(calculatedCrankCadences);\n\t\t\t\tstdCalcCrankCadence = MyMath.getStandardDeviationBD(calculatedCrankCadences, avgCalcCrankCadence);\n\t\t\t}\n\t\t\tif (calculatedWheelSpeeds.size() > 0) {\n\t\t\t\tavgCalcWheelSpeed = MyMath.getAverageValueBD(calculatedWheelSpeeds);\n\t\t\t\tstdCalcWheelSpeed = MyMath.getStandardDeviationBD(calculatedWheelSpeeds, avgCalcWheelSpeed);\n\t\t\t}\n\t\t\tif (calculatedWheelDistances.size() > 0) {\n\t\t\t\tavgCalcWheelDistance = MyMath.getAverageValueBD(calculatedWheelDistances);\n\t\t\t\tstdCalcWheelDistance = MyMath.getStandardDeviationBD(calculatedWheelDistances, avgCalcWheelDistance);\n\t\t\t}\n\t\t\t\n\t\t\t// Save results to database\n\t\t\ttripData.addBikePowerDeviceReading(currentTimeMillis, \n\t\t\t\t\tcalculatedPowers.size(), avgCalcPower, stdCalcPower,\n\t\t\t\t\tcalculatedTorques.size(), avgCalcTorque, stdCalcTorque,\n\t\t\t\t\tcalculatedCrankCadences.size(), avgCalcCrankCadence, stdCalcCrankCadence,\n\t\t\t\t\tcalculatedWheelSpeeds.size(), avgCalcWheelSpeed, stdCalcWheelSpeed,\n\t\t\t\t\tcalculatedWheelDistances.size(), avgCalcWheelDistance, stdCalcWheelDistance);\n\n\t\t\tif (null != rawDataFile) {\n\t\t\t\trawDataFile.write(currentTimeMillis, location, calculatedPowers,\n\t\t\t\t\t\tcalculatedTorques, calculatedCrankCadences, calculatedWheelSpeeds, \n\t\t\t\t\t\tcalculatedWheelDistances);\n\t\t\t}\n\n\t\t\treset();\n\t\t}\n\t\tcatch(Exception ex) {\n\t\t\tLog.e(MODULE_TAG, ex.getMessage());\n\t\t}\n\t}",
"@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic User requestVehicleControl(long userId, String featureType, String featureStatus) {\n\t\tlogger.info(\"Call requestVehicleControl===========================\");\n\t\tdatasource = getDataSource();\n\t\tjdbcTemplate = new JdbcTemplate(datasource);\n\t\tUser user = new User();\n\t\t// Check if head Unit is registered with given userID\n\t\tString check_query = \"select count(1) from headunit where user_id = ?\";\n\n\t\tint result = jdbcTemplate.queryForObject(check_query, new Object[] { userId }, Integer.class);\n\n\t\tif (result > 0) {\n\n\t\t\t// check if record exists for userID\n\t\t\t// get GCM key\n\t\t\tString gcm_key_query = \"select gcmregistartionkey from headunit where user_id = ?\";\n\n\t\t\tString query_result = (String) jdbcTemplate.queryForObject(gcm_key_query, new Object[] { userId },\n\t\t\t\t\tString.class);\n\n\t\t\tSystem.out.println(\"GCM KEY ============================= \" + query_result);\n\t\t\t// if GCM key available\n\t\t\t// preapre message\n\t\t\tif (query_result != null && !query_result.isEmpty()) {\n\t\t\t\tSender sender = new Sender(utilityObj.getGcmApiKeySimuapp());\n\t\t\t\tJSONObject obj = new JSONObject();\n\t\t\t\t// build message based on featureType and featurestatus\n\t\t\t\tobj.put(\"featuretype\", featureType);\n\t\t\t\tobj.put(\"featurestatus\", featureStatus);\n\t\t\t\tString prepare_msg = obj.toJSONString();\n\t\t\t\tgcm_message = new Message.Builder().timeToLive(30).delayWhileIdle(true)\n\t\t\t\t\t\t.addData(MESSAGE_KEY, prepare_msg).build();\n\t\t\t\tlogger.info(\"IN requestVehicleControl GCM reg key==========\" + query_result);\n\t\t\t\tResult gcm_result = null;\n\t\t\t\t// get gcm_message and gcm_register key\n\t\t\t\t// send message to that gcm_register_key\n\t\t\t\t// set message and status\n\t\t\t\ttry {\n\t\t\t\t\tgcm_result = sender.send(gcm_message, query_result, 1);\n\t\t\t\t\tlogger.info(\"IN requestVehicleControl GCM SEND RESULT FROM GOOLGE API \" + gcm_result.toString());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tuser.setUserid(userId);\n\t\t\t\tuser.setStatus(true);\n\t\t\t\tuser.setGcmregistartionkey(query_result);\n\t\t\t\tuser.setMessage(prepare_msg);\n\t\t\t\tuser.setFeaturetype(featureType);\n\t\t\t\tuser.setFeaturestatus(featureStatus);\n\t\t\t} else {\n\t\t\t\tuser.setMessage(\"NO GCM KEY FOUND \");\n\t\t\t}\n\n\t\t} else {\n\t\t\t// if head unit registered\n\t\t\t// set meassage and status\n\t\t\tuser.setStatus(false);\n\t\t\tuser.setMessage(\"NO HEAD UNIT REGISTERED FOR GIVEN USERID : \" + userId);\n\n\t\t}\n\t\treturn user;\n\t}",
"public static void main(String[] args) {\r\n\t\t\r\n\t\t\r\n\t\t//I'm just declaring all the variables I need right now so I don't need to later.\r\n\t\tdouble miles;\r\n\t\t\r\n\t\tdouble feet;\r\n\t\t\r\n\t\tdouble inches;\r\n\t\t\r\n\t\tdouble meters; \r\n\t\t\r\n\t\t//Here I am printing the prompt for the user to input values I will need to convert to meters\r\n\t\tSystem.out.println(\"Enter miles:\");\r\n\t\t\t\t\r\n\t\t\tScanner userInput = new Scanner (System.in);\r\n\t\t\tmiles = userInput.nextDouble();\r\n\t\t\t\r\n\t\t\r\n\t\tSystem.out.println(\"Enter feet:\");\r\n\t\t\r\n\t\t\tScanner userInput2 = new Scanner (System.in);\r\n\t\t\tfeet = userInput2.nextDouble();\r\n\t\t\t\r\n\t\t\t\r\n\t\tSystem.out.println(\"Enter inches:\");\r\n\t\t\r\n\t\t\tScanner userInput3 = new Scanner (System.in);\r\n\t\t\tinches = userInput3.nextDouble();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t/*this is where I am converting all my values to feet, which will then convert to\r\n\t\t\t\t * meters.\r\n\t\t\t\t * \r\n\t\t\t\t * I am declaring new variables to represent converted values and also\r\n\t\t\t\t */\r\n\t\t\t\tdouble convertedMiles;\r\n\t\t\t\tconvertedMiles = miles*5280;\r\n\t\t\t\r\n\t\t\t\tdouble convertedFeet;\r\n\t\t\t\tconvertedFeet = feet*1;\r\n\t\t\t\r\n\t\t\t\tdouble convertedInches;\r\n\t\t\t\tconvertedInches = inches/12;\r\n\t\t\t\t\r\n\t\t//this statement is where I add together all my converted values to reach my total in feet\r\n\t\t//and then I divide by 3.3 to get to my meters, as specified in the directions\r\n\t\tmeters = (convertedMiles + convertedFeet + convertedInches)/3.3;\r\n\t\t\r\n\t\t//This statement declares a new variable that will convert from meters to a rounded version\r\n\t\t//so that I can have a variable that is rounded to the nearest tenth.\r\n\t\tdouble metersRounded = (double)Math.round((meters)*10)/10;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(miles + \" mile(s), \" + feet + \" foot(or feet) \" + inches + \r\n\t\t\t\t\t\t \" inch(es) = \" + metersRounded + \" meter(s).\");\r\n\t\t\r\n\t\tuserInput.close();\r\n\t\tuserInput2.close();\r\n\t\tuserInput3.close();\r\n\t\t\r\n\t\t\r\n\r\n\t}",
"private UserData[] getEnvoyUsers(){\n UserData sofort = setUserData(\"DE\", \"EUR\");\n //Set custom regexp validation rule, set more short random valid email\n emailValidationRule.setRegexp(\"[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-]{1,6}[.]{0,1}[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]{0,6}[.]{0,1}[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]{1,8}[@]{1,1}[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]{1,21}[.]{0,1}[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]{0,30}[.]{1,1}[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]{2,4}\");\n sofort.setEmail(emailValidationRule.generateValidString());\n// UserData ibanq = setUserData(\"JP\", \"USD\");\n// UserData moneta = setUserData(\"RU\", \"USD\");\n// UserData poli = setUserData(\"AU\", \"AUD\");\n return new UserData[]{\n// ideal, //0\n// prezelwy, //1\n// eKonto, //2\n// euteller, //3\n// ewire, //4\n sofort, //5\n// ibanq, //6\n// moneta, //7\n// poli //8\n };\n }",
"private String populateMtrRdr() {\n\t\tAppLog.begin();\n\t\ttry {\n\t\t\tMeterReaderDetails meterReaderDetails = new MeterReaderDetails();\n\t\t\tmeterReaderDetails.setMeterReaderEmployeeID(meterReaderID);\n\t\t\tList<MeterReaderDetails> meterReaderList = (ArrayList<MeterReaderDetails>) MRDTaggingDAO\n\t\t\t\t\t.getMeterReaderList(meterReaderDetails);\n\t\t\tStringBuffer meterReaderDropdown = new StringBuffer();\n\t\t\tmeterReaderDropdown\n\t\t\t\t\t.append(\"<select name=\\\"meterReaderID\\\" id=\\\"meterReaderID\\\" class=\\\"selectbox-long\\\">\");\n\t\t\tmeterReaderDropdown.append(\"\");\n\t\t\tmeterReaderDetails = null;\n\t\t\tif (null != meterReaderList && meterReaderList.size() > 0) {\n\t\t\t\tfor (int i = 0; i < meterReaderList.size(); i++) {\n\t\t\t\t\tmeterReaderDetails = (MeterReaderDetails) meterReaderList\n\t\t\t\t\t\t\t.get(i);\n\t\t\t\t\tmeterReaderDropdown.append(optionTagBeginPart1);\n\t\t\t\t\tmeterReaderDropdown.append(meterReaderDetails\n\t\t\t\t\t\t\t.getMeterReaderID());\n\t\t\t\t\tmeterReaderDropdown.append(optionTagBeginPart2);\n\t\t\t\t\tmeterReaderDropdown.append(meterReaderDetails\n\t\t\t\t\t\t\t.getMeterReaderName());\n\t\t\t\t\tmeterReaderDropdown.append(optionTagEnd);\n\t\t\t\t}\n\t\t\t}\n\t\t\tmeterReaderDropdown.append(selectTagEnd);\n\t\t\tinputStream = new StringBufferInputStream(meterReaderDropdown\n\t\t\t\t\t.toString());\n\t\t} catch (Exception e) {\n\t\t\tinputStream = new StringBufferInputStream(\n\t\t\t\t\t\"<font color='red' size='2'><li><span><b>ERROR:Sorry, There was problem while Processing Last Operation.</b></font>\");\n\t\t\tAppLog.error(e);\n\t\t}\n\t\tAppLog.end();\n\t\treturn SUCCESS;\n\t}",
"@Override\n public WeightedGraph<Long> computeTrustValues(\n DatasetLoader<? extends Rating> datasetLoader,\n Collection<Long> users) throws CannotLoadRatingsDataset {\n boolean printPartialResults;\n\n final RatingsDataset<? extends Rating> ratingsDataset = datasetLoader.getRatingsDataset();\n printPartialResults = ratingsDataset.allRatedItems().size() <= 100 && ratingsDataset.allUsers().size() <= 28;\n\n if (!Global.isInfoPrinted()) {\n printPartialResults = false;\n }\n\n int numTrustValuesThatNeedToBePropagated = 0;\n\n Map<Long, Map<Long, Number>> MSD = new TreeMap<>();\n Map<Long, Map<Long, Number>> UJaccard = new TreeMap<>();\n {\n int i = 1;\n for (Long idUser : users) {\n MSD.put(idUser, new TreeMap<>());\n UJaccard.put(idUser, new TreeMap<>());\n\n Map<Long, ? extends Rating> userRatings;\n try {\n userRatings = ratingsDataset.getUserRatingsRated(idUser);\n } catch (UserNotFound ex) {\n ERROR_CODES.USER_NOT_FOUND.exit(ex);\n return null;\n }\n\n //Para cada vecino calculo el MSD\n for (Long idUserNeighbor : users) {\n try {\n double meanUser = ratingsDataset.getMeanRatingUser(idUser);\n double meanUserNeighbour = ratingsDataset.getMeanRatingUser(idUserNeighbor);\n\n Map<Long, ? extends Rating> userNeighbourRatings = ratingsDataset.getUserRatingsRated(idUserNeighbor);\n\n Set<Long> commonItems = new TreeSet<>(userRatings.keySet());\n commonItems.retainAll(userNeighbourRatings.keySet());\n if (commonItems.isEmpty()) {\n numTrustValuesThatNeedToBePropagated++;\n continue;\n }\n double[] ratings = new double[commonItems.size()];\n double[] predictions = new double[commonItems.size()];\n\n //Compute predictions. At the same time, compute mand min of rating and prediction, to save cycles later on.\n double ratingMax = -Double.MAX_VALUE;\n double ratingMin = Double.MAX_VALUE;\n double predictionMax = -Double.MAX_VALUE;\n double predictionMin = Double.MAX_VALUE;\n\n {\n int index = 0;\n for (Long idItem : commonItems) {\n double rating = userRatings.get(idItem).getRatingValue().doubleValue();\n ratings[index] = rating;\n double prediction = meanUser + userNeighbourRatings.get(idItem).getRatingValue().doubleValue() - meanUserNeighbour;\n predictions[index] = prediction;\n index++;\n\n ratingMax = Math.max(ratingMax, rating);\n ratingMin = Math.min(ratingMin, rating);\n predictionMax = Math.max(predictionMax, prediction);\n predictionMin = Math.min(predictionMin, prediction);\n }\n }\n\n //Ratings MaxMin normalisation\n if (ratingMax == ratingMin) {\n for (int index = 0; index < ratings.length; index++) {\n ratings[index] = 1;\n }\n } else {\n for (int index = 0; index < ratings.length; index++) {\n ratings[index] = (ratings[index] - ratingMin) / (ratingMax - ratingMin);\n }\n }\n\n //Predictions MaxMin normalisation\n if (predictionMax == predictionMin) {\n for (int index = 0; index < predictions.length; index++) {\n predictions[index] = 1;\n }\n } else {\n for (int index = 0; index < ratings.length; index++) {\n predictions[index] = (predictions[index] - predictionMin) / (predictionMax - predictionMin);\n }\n }\n\n //Calculo el MSD\n double sumOfError = 0;\n for (int index = 0; index < ratings.length; index++) {\n sumOfError += Math.pow(ratings[index] - predictions[index], 2);\n }\n\n double MSD_of_pair = 1 - (sumOfError / commonItems.size());\n MSD.get(idUser).put(idUserNeighbor, MSD_of_pair);\n\n //Calculo el Jaccard\n double numUserRatings = userRatings.size();\n double numUserNeighborRatings = userNeighbourRatings.size();\n double numCommon = commonItems.size();\n double jaccard_of_pair = numCommon / (numUserRatings + numUserNeighborRatings - commonItems.size());\n UJaccard.get(idUser).put(idUserNeighbor, jaccard_of_pair);\n } catch (UserNotFound ex) {\n ERROR_CODES.USER_NOT_FOUND.exit(ex);\n }\n }\n\n fireProgressChanged(\"User-Based trust\", (int) ((i * 100.0f) / users.size()), -1);\n\n if (Global.isVerboseAnnoying()) {\n Global.showInfoMessage(new Date().toString() + \": User-based trust \" + ((i * 100.0f) / users.size()) + \"%\\n\");\n }\n i++;\n }\n }\n\n TreeMap<Long, Map<Long, Number>> usersTrust = new TreeMap<>();\n for (Long idUser : users) {\n usersTrust.put(idUser, new TreeMap<>());\n\n for (Long idUserNeighbour : users) {\n\n if (!UJaccard.containsKey(idUser) || !UJaccard.get(idUser).containsKey(idUserNeighbour) || !MSD.containsKey(idUser) || !MSD.get(idUser).containsKey(idUserNeighbour)) {\n continue;\n }\n\n usersTrust.get(idUser).put(idUserNeighbour, MSD.get(idUser).get(idUserNeighbour).doubleValue() * UJaccard.get(idUser).get(idUserNeighbour).doubleValue());\n\n }\n }\n\n UJaccard.clear();\n MSD.clear();\n\n if (propagate == false) {\n return new WeightedGraph<>(usersTrust);\n }\n\n fireProgressChanged(\"Trust propagation\", 0, -1);\n\n /**\n * Las confianzas propagadas se incluyen aqui para no ser tenidas en\n * cuenta al propagar confianza, sólo cuando ha finalizado el proceso.\n */\n Map<Long, Map<Long, Double>> propagatedTrusts = new TreeMap<>();\n {\n int i = 0;\n for (Long idSourceUser : users) {\n for (Long idTargetUser : users) {\n if (usersTrust.get(idSourceUser).containsKey(idTargetUser)) {\n //Los usuarios ya son adyacentes, no es necesario propagar.\n } else {\n if (!propagatedTrusts.containsKey(idSourceUser)) {\n propagatedTrusts.put(idSourceUser, new TreeMap<>());\n }\n //Propagate trust to complete this connection.\n if (printPartialResults) {\n Global.showInfoMessage(\"Propagating trust between user \" + idSourceUser + \" and user \" + idTargetUser + \"\\n\");\n }\n\n Set<Long> adyacentesAAmbos = new TreeSet<>(usersTrust.get(idSourceUser).keySet());\n adyacentesAAmbos.retainAll(usersTrust.get(idTargetUser).keySet());\n if (adyacentesAAmbos.isEmpty()) {\n //No tienen ningún adyacente en común, por lo que no se puede propagar, hay que contar este enlace para el porcentaje de progreso.\n } else {\n double numerador = 0;\n double denominador = 0;\n for (Long idIntermediateUser : adyacentesAAmbos) {\n double usersTrustAB = usersTrust.get(idSourceUser).get(idIntermediateUser).doubleValue();\n double usersTrustBC = usersTrust.get(idIntermediateUser).get(idTargetUser).doubleValue();\n int numCommonAB;\n try {\n TreeSet<Long> commonAB = new TreeSet<>(ratingsDataset.getUserRated(idSourceUser));\n commonAB.retainAll(ratingsDataset.getUserRated(idIntermediateUser));\n numCommonAB = commonAB.size();\n } catch (UserNotFound ex) {\n numCommonAB = 0;\n ERROR_CODES.USER_NOT_FOUND.exit(ex);\n }\n\n int numCommonBC;\n try {\n TreeSet<Long> commonBC = new TreeSet<>(ratingsDataset.getUserRated(idIntermediateUser));\n commonBC.retainAll(ratingsDataset.getUserRated(idTargetUser));\n numCommonBC = commonBC.size();\n } catch (UserNotFound ex) {\n numCommonBC = 0;\n ERROR_CODES.USER_NOT_FOUND.exit(ex);\n }\n\n //Efectivamente, numCommonAB y/o numCommonBC pueden ser cero si la confianza viene de haber sido propagada previamente (Esto ya no se aplica ya que la confianza propagada no se tiene en cuenta para propagar otros valores).\n double contribucionNumerador = numCommonAB * usersTrustAB + numCommonBC * usersTrustBC;\n double contribucionDenominador = numCommonAB + numCommonBC;\n numerador += contribucionNumerador;\n denominador += contribucionDenominador;\n }\n double PTrustAB = numerador / denominador;\n propagatedTrusts.get(idSourceUser).put(idTargetUser, PTrustAB);\n if (printPartialResults) {\n Global.showInfoMessage(\"Propagated trust between user \" + idSourceUser + \" and user \" + idTargetUser + \" --> \" + PTrustAB + \" (\" + (int) ((i * 100f) / numTrustValuesThatNeedToBePropagated) + \"%)\\n\");\n }\n }\n fireProgressChanged(\"User trust propagation\", (int) ((i * 100f) / numTrustValuesThatNeedToBePropagated), -1);\n i++;\n }\n }\n }\n }\n\n //Una vez todas las confianzas propagadas se han calculado, se introducen en el grafo.\n for (Long idSourceUser : propagatedTrusts.keySet()) {\n for (Long idTargetUser : propagatedTrusts.get(idSourceUser).keySet()) {\n double PTrustAB = propagatedTrusts.get(idSourceUser).get(idTargetUser);\n usersTrust.get(idSourceUser).put(idTargetUser, PTrustAB);\n }\n }\n\n fireProgressChanged(\"Finished trust calculation\", 100, -1);\n return new WeightedGraph<>(usersTrust);\n }",
"public static void ReadDWH_user() throws Exception {\n List<String> l_url_user = new ArrayList<String>();\n l_url_user.add(\"http://nifi01s.cyberservices.local:8080/nifi-api/process-groups/ef78487a-015f-1000-ee70-20fee4dd9b73/processors\");//User_dint\n\n String inputLine;\n int i_x = 1000;\n int j_y = 1000;\n\n BufferedReader in = null;\n Locations loc= new Locations();\n List<String> l_loc = new ArrayList<String>();\n l_loc=loc.getLocations();\n\n for (int k = 0; k < l_url_user.size(); k++) {\n URL oracle = new URL(\"http://dwh-schemaservice-stage.cyberservices.local:2876/schema-repo\");\n in = new BufferedReader(new InputStreamReader(oracle.openStream()));\n while ((inputLine = in.readLine()) != null) {\n if (inputLine.contains(\"user_\")) {\n SendConsumer(\"Consumer_\" + inputLine, \"stg_\" + inputLine+\"_batch\", 10, (10) + i_x, l_url_user.get(k), l_loc.get(k));\n SendMerge(\"MergeContent_\" + inputLine + \"_hour\", 600.0, (10) + i_x, \"* 02 * * * ?\", \"CRON_DRIVEN\", l_url_user.get(k));\n SendMerge(\"MergeContent_\" + inputLine + \"_day\", 600.0, 400 + i_x, \"10 sec\", \"TIMER_DRIVEN\", l_url_user.get(k));\n SendPutHdfs(\"PutHdfs_\" + inputLine + \"_hour\", 1200, (10) + i_x, \"/user/talend/staging/\" + inputLine+\"\"+l_loc.get(k)+\"/merge\", l_url_user.get(k));\n SendPutHdfs(\"PutHdfs_\" + inputLine + \"_error\", 600.0, (200) + i_x, \"/user/talend/logging/nifi/\" + inputLine + \"_batch\"+\"\"+l_loc.get(k), l_url_user.get(k));\n SendPutHdfs(\"PutHdfs_\" + inputLine + \"_failure\", 1200, (200) + i_x, \"/user/talend/logging/nifi/\" + inputLine + \"_batch\"+\"\"+l_loc.get(k), l_url_user.get(k));\n SendPutHdfs(\"PutHdfs_\" + inputLine + \"_day\", 1200, (400) + i_x, \"/user/talend/staging/\" + inputLine+\"\"+l_loc.get(k)+\"/merge\", l_url_user.get(k));\n SendGetHdfsDay(\"GetHdfs_\" + inputLine + \"_day\", 10, (400) + i_x, \"/user/talend/staging/\" + inputLine+\"\"+l_loc.get(k)+\"/merge\", \"* 10 23 * * ?\", \"CRON_DRIVEN\", l_url_user.get(k));\n\n SendGetHdfsDay(\"GetHdfs_\" + inputLine + \"_base\", -600, (10) + i_x, \"/user/talend/staging/\" + inputLine+\"\"+l_loc.get(k)+\"/merge\", \"0 10 0 ? * MON *\", \"CRON_DRIVEN\", l_url_user.get(k));\n SendMerge(\"MergeContent_\" + inputLine + \"_base\", -600.0, 200 + i_x, \"10 sec\", \"TIMER_DRIVEN\", l_url_user.get(k));\n SendPutHdfs(\"PutHdfs_\" + inputLine + \"_base\", -600, (400) + i_x, \"/user/talend/staging/\" + inputLine+\"\"+l_loc.get(k)+\"/base/\"+\"${now():format('yyyy-ww')}\", l_url_user.get(k));\n i_x = i_x + 1000;\n j_y = j_y + 1000;\n }\n }\n }\n in.close();\n\n }",
"public FillResult callFillService(FillRequest request) throws DataAccessException {\n FillResult fillResult;\n Database database = new Database();\n Connection conn = null;\n boolean doCommit = false;\n\n try {\n conn = database.openConnection();\n UserDAO userDAO = new UserDAO(conn);\n User user = userDAO.find(request.getUsername());\n\n if (user == null) {\n throw new Exception(\"Error: cannot find user in the database\");\n }\n\n PersonDAO personDAO = new PersonDAO(conn);\n personDAO.clear(request.getUsername());\n\n EventDAO eventDAO = new EventDAO(conn);\n eventDAO.clear(request.getUsername());\n\n //create person for logged in user\n Person person = new Person(user.getPersonID(), user.getUsername(), user.getFirstName(), user.getLastName(), user.getGender(), null, null, null);\n createPerson(person, conn);\n people.add(person);\n\n int randomBirthYear = RandomDataUtils.getRandomNumber(1950, 2021);\n person.setBirthYear(randomBirthYear);\n person.setGeneration(0);\n\n createEvents(person, randomBirthYear,false, conn);\n\n //NEED TO CREATE GENERATIONS AND EVENTS HERE\n Person currPerson = null;\n for (int i = 1; i <= request.getGenerations(); i++) {\n for (int j = 0; j < people.size(); j++) {\n currPerson = people.get(j);\n if (currPerson.getGeneration() == i - 1) {\n Person mom = new Person(StringUtil.getRandomPersonID(conn), user.getUsername(),\n RandomDataUtils.getInstance().getRandomFemaleName(),\n RandomDataUtils.getInstance().getRandomSurname(),\n \"f\", null, null, null);\n mom.setBirthYear(RandomDataUtils.getRandomNumber(currPerson.getBirthYear() - 40, currPerson.getBirthYear() - 20));\n mom.setGeneration(i);\n\n Person dad = new Person(StringUtil.getRandomPersonID(conn), user.getUsername(),\n RandomDataUtils.getInstance().getRandomMaleName(),\n currPerson.getLastName(), \"m\", null, null, mom.getPersonID());\n dad.setBirthYear(RandomDataUtils.getRandomNumber(mom.getBirthYear() - 4, mom.getBirthYear() + 4));\n dad.setGeneration(i);\n mom.setSpouseID(dad.getPersonID());\n\n createPerson(mom, conn);\n people.add(mom);\n\n createPerson(dad, conn);\n people.add(dad);\n\n createEvents(mom, mom.getBirthYear(), true, conn);\n createEvents(dad, dad.getBirthYear(), true, conn);\n\n createMarriageEvent(mom, dad, conn);\n\n currPerson.setMotherID(mom.getPersonID());\n currPerson.setFatherID(dad.getPersonID());\n\n personDAO.update(currPerson);\n }\n }\n }\n\n doCommit = true;\n fillResult = new FillResult(\"Successfully added \" + people.size() + \" persons and \" + events.size() + \" events to the database.\", true);\n }\n catch (Exception e) {\n doCommit = false;\n fillResult = new FillResult(\"Error: Could not fill the database\", false);\n }\n finally {\n try {\n database.closeConnection(doCommit);\n }\n catch (Exception e){\n e.printStackTrace();\n }\n }\n return fillResult;\n }",
"public Breakdown generateReportByDemo(Date startDate, Date endDate, String[] demoArr) {\n\n //INSTANTIATING VARIABLES\n UserDAO userDAO = new UserDAO();\n AppUsageDAO auDAO = new AppUsageDAO();\n ArrayList<User> userList = auDAO.retrieveUsers(startDate, endDate);\n\n double total = userList.size();\n\n Breakdown result = new Breakdown();\n\n ArrayList<String> schools = Utility.retrieveSchools();\n ArrayList<String> years = Utility.getYears();\n ArrayList<String> genders = Utility.getGenders();\n ArrayList<String> ccas = userDAO.getCCAs();\n Collections.sort(ccas);\n\n ArrayList<String> demo1List = new ArrayList<String>();\n ArrayList<String> demo2List = new ArrayList<String>();\n ArrayList<String> demo3List = new ArrayList<String>();\n ArrayList<String> demo4List = new ArrayList<String>();\n\n String demo1Type = \"\";\n String demo2Type = \"\";\n String demo3Type = \"\";\n String demo4Type = \"\";\n\n int demoCount = demoArr.length;\n if (demoCount > 0) {\n switch (demoArr[0]) {\n case \"gender\":\n demo1List = genders;\n demo1Type = \"gender\";\n break;\n case \"school\":\n demo1List = schools;\n demo1Type = \"school\";\n break;\n case \"year\":\n demo1List = years;\n demo1Type = \"year\";\n break;\n case \"cca\":\n demo1List = ccas;\n demo1Type = \"cca\";\n break;\n }\n }\n if (demoCount > 1) {\n switch (demoArr[1]) {\n case \"gender\":\n demo2List = genders;\n demo2Type = \"gender\";\n break;\n case \"school\":\n demo2List = schools;\n demo2Type = \"school\";\n break;\n case \"year\":\n demo2List = years;\n demo2Type = \"year\";\n break;\n case \"cca\":\n demo2List = ccas;\n demo2Type = \"cca\";\n break;\n }\n }\n if (demoCount > 2) {\n switch (demoArr[2]) {\n case \"gender\":\n demo3List = genders;\n demo3Type = \"gender\";\n break;\n case \"school\":\n demo3List = schools;\n demo3Type = \"school\";\n break;\n case \"year\":\n demo3List = years;\n demo3Type = \"year\";\n break;\n case \"cca\":\n demo3List = ccas;\n demo3Type = \"cca\";\n break;\n }\n }\n if (demoCount > 3) {\n switch (demoArr[3]) {\n case \"gender\":\n demo4List = genders;\n demo4Type = \"gender\";\n break;\n case \"school\":\n demo4List = schools;\n demo4Type = \"school\";\n break;\n case \"year\":\n demo4List = years;\n demo4Type = \"year\";\n break;\n case \"cca\":\n demo4List = ccas;\n demo4Type = \"cca\";\n break;\n }\n }\n\n //For each demo1\n for (String demo1 : demo1List) {\n HashMap<String, Breakdown> demo1Map = new HashMap<String, Breakdown>();\n ArrayList<User> demo1UserList = filterDemo(demo1, demo1Type, userList);\n demo1Map.put(demo1Type, new Breakdown(demo1));\n demo1Map.put(\"count\", new Breakdown(\"\" + demo1UserList.size()));\n Breakdown demo1bd = new Breakdown();\n demo1Map.put(\"breakdown\", demo1bd);\n\n result.addInList(demo1Map);\n\n //For each demo2\n for (String demo2 : demo2List) {\n HashMap<String, Breakdown> demo2Map = new HashMap<String, Breakdown>();\n ArrayList<User> demo2UserList = filterDemo(demo2, demo2Type, demo1UserList);\n demo2Map.put(demo2Type, new Breakdown(demo2));\n demo2Map.put(\"count\", new Breakdown(\"\" + demo2UserList.size()));\n Breakdown demo2bd = new Breakdown();\n demo2Map.put(\"breakdown\", demo2bd);\n\n demo1bd.addInList(demo2Map);\n\n //For each demo3\n for (String demo3 : demo3List) {\n HashMap<String, Breakdown> demo3Map = new HashMap<String, Breakdown>();\n ArrayList<User> demo3UserList = filterDemo(demo3, demo3Type, demo2UserList);\n demo3Map.put(demo3Type, new Breakdown(demo3));\n demo3Map.put(\"count\", new Breakdown(\"\" + demo3UserList.size()));\n Breakdown demo3bd = new Breakdown();\n demo3Map.put(\"breakdown\", demo3bd);\n\n demo2bd.addInList(demo3Map);\n\n//\t\t\t\t\t\n //For each demo4\n for (String demo4 : demo4List) {\n HashMap<String, Breakdown> demo4Map = new HashMap<String, Breakdown>();\n ArrayList<User> demo4UserList = filterDemo(demo4, demo4Type, demo3UserList);\n demo4Map.put(demo4Type, new Breakdown(demo4));\n demo4Map.put(\"count\", new Breakdown(\"\" + demo4UserList.size()));\n\n demo3bd.addInList(demo4Map);\n\n if (demoCount == 4) {\n Breakdown demo4report = generateReport(startDate, endDate, demo4UserList, total);\n demo4Map.put(\"breakdown\", demo4report);\n }\n }\n\n if (demoCount == 3) {\n //generate report if last demo\n Breakdown demo3report = generateReport(startDate, endDate, demo3UserList, total);\n demo3Map.put(\"breakdown\", demo3report);\n }\n\n }\n\n if (demoCount == 2) {\n //generate report if last demo\n Breakdown demo2report = generateReport(startDate, endDate, demo2UserList, total);\n demo2Map.put(\"breakdown\", demo2report);\n\n }\n }\n\n if (demoCount == 1) {\n //generate report if last demo\n Breakdown demo1report = generateReport(startDate, endDate, demo1UserList, total);\n demo1Map.put(\"breakdown\", demo1report);\n }\n }\n\n //CALCULATE PERCENTAGE\n if (demoCount > 0) {\n Breakdown bd1 = result;\n ArrayList<HashMap<String, Breakdown>> list1 = bd1.getBreakdown();\n\n generatePercentage(bd1, total);\n\n }\n\n if (demoCount > 1) {\n ArrayList<HashMap<String, Breakdown>> secondTier = result.getBreakdown();\n for (HashMap<String, Breakdown> secondMap : secondTier) {\n generatePercentage(secondMap.get(\"breakdown\"), total);\n }\n\n }\n if (demoCount > 2) {\n ArrayList<HashMap<String, Breakdown>> secondTier = result.getBreakdown();\n for (HashMap<String, Breakdown> secondMap : secondTier) {\n ArrayList<HashMap<String, Breakdown>> thirdTier = secondMap.get(\"breakdown\").getBreakdown();\n for (HashMap<String, Breakdown> thirdMap : thirdTier) {\n generatePercentage(thirdMap.get(\"breakdown\"), total);\n\n }\n\n }\n }\n if (demoCount > 3) {\n ArrayList<HashMap<String, Breakdown>> secondTier = result.getBreakdown();\n\n for (HashMap<String, Breakdown> secondMap : secondTier) {\n ArrayList<HashMap<String, Breakdown>> thirdTier = secondMap.get(\"breakdown\").getBreakdown();\n for (HashMap<String, Breakdown> thirdMap : thirdTier) {\n ArrayList<HashMap<String, Breakdown>> fourthTier = thirdMap.get(\"breakdown\").getBreakdown();\n for (HashMap<String, Breakdown> fourthMap : fourthTier) {\n generatePercentage(fourthMap.get(\"breakdown\"), total);\n }\n }\n\n }\n }\n\n return result;\n }",
"private void buildAdmin()\n {\n User admin = userServiceImpl.getUserByUsername(adminUsername);\n try\n {\n //If the application is started for the first time (e.g., the admin is not in the DB)\n if(admin==null)\n { \n \t registerUserService.save(adminUsername,password,Role.Admin); \n }\n //if the application has previously been started (e.g., the admin is already present in the DB)\n else\n {\n \t //Do nothing!! \n }\n \n //Always add this retails when started the application.\n \n \tCountry mexico = new Country();\n \tmexico.setCountryId(1);\n \tmexico.setCountryName(\"México\");\n\t\t\tmexico.setCurrency(\"Peso MXN\");\n\t\t\tmexico.setNickname(\"MX\");\n\t\t\taddCountryService.saveCountry(mexico);\t\n\t\t\t\n\t\t\t\n\t\t\tCountry usa = new Country();\n\t\t\tusa.setCountryId(2);\n\t\t\tusa.setCountryName(\"United States\");\n\t\t\tusa.setCurrency(\"USD\");\n\t\t\tusa.setNickname(\"US\");\n\t\t\taddCountryService.saveCountry(usa);\n\t\t\t\n\t\t\t\n\t\t\tRetail retail1 = new Retail();\n\t\t\tretail1.setRetailId(1);\n\t\t\tretail1.setRetailName(\"Amazon\");\n\t\t\tretail1.setCrawlerName(\"Amazon\");\n\t\t\tretail1.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail1);\n\t\t\t\n\t\t\t\n\t\t\tRetail retail2 = new Retail();\n\t\t\tretail2.setRetailId(2);\n\t\t\tretail2.setRetailName(\"Arome\");\n\t\t\tretail2.setCrawlerName(\"Arome\");\n\t\t\tretail2.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail2);\n\t\t\t\n\t\t\t\n\t\t\tRetail retail3 = new Retail();\n\t\t\tretail3.setRetailId(3);\n\t\t\tretail3.setRetailName(\"Chedraui\");\n\t\t\tretail3.setCrawlerName(\"Chedraui\");\n\t\t\tretail3.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail3);\n\t\t\t\n\t\t\t\n\t\t\tRetail retail4 = new Retail();\n\t\t\tretail4.setRetailId(4);\n\t\t\tretail4.setRetailName(\"Laeuropea\");\n\t\t\tretail4.setCrawlerName(\"Laeuropea\");\n\t\t\tretail4.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail4);\n\t\t\t\n\t\t\tRetail retail5 = new Retail();\n\t\t\tretail5.setRetailId(5);\n\t\t\tretail5.setRetailName(\"Linio\");\n\t\t\tretail5.setCrawlerName(\"Linio\");\n\t\t\tretail5.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail5);\n\t\t\t\n\t\t\tRetail retail6 = new Retail();\n\t\t\tretail6.setRetailId(6);\n\t\t\tretail6.setRetailName(\"Liverpool\");\n\t\t\tretail6.setCrawlerName(\"Liverpool\");\n\t\t\tretail6.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail6);\n\t\t\t\n\t\t\tRetail retail7 = new Retail();\n\t\t\tretail7.setRetailId(7);\n\t\t\tretail7.setRetailName(\"MercadoLibre\");\n\t\t\tretail7.setCrawlerName(\"MercadoLibre\");\n\t\t\tretail7.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail7);\n\t\t\t\n\t\t\tRetail retail8 = new Retail();\n\t\t\tretail8.setRetailId(8);\n\t\t\tretail8.setRetailName(\"NutritionDepot\");\n\t\t\tretail8.setCrawlerName(\"NutritionDepot\");\n\t\t\tretail8.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail8);\n\t\t\t\n\t\t\tRetail retail9 = new Retail();\n\t\t\tretail9.setRetailId(9);\n\t\t\tretail9.setRetailName(\"Osom\");\n\t\t\tretail9.setCrawlerName(\"Osom\");\n\t\t\tretail9.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail9);\n\t\t\t\n\t\t\tRetail retail10 = new Retail();\n\t\t\tretail10.setRetailId(10);\n\t\t\tretail10.setRetailName(\"PerfumesMexico\");\n\t\t\tretail10.setCrawlerName(\"PerfumesMexico\");\n\t\t\tretail10.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail10);\n\t\t\t\n\t\t\tRetail retail11 = new Retail();\n\t\t\tretail11.setRetailId(11);\n\t\t\tretail11.setRetailName(\"PerfumesOnline\");\n\t\t\tretail11.setCrawlerName(\"PerfumesOnline\");\n\t\t\tretail11.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail11);\n\t\t\t\n\t\t\t\n\t\t\tRetail retail12 = new Retail();\n\t\t\tretail12.setRetailId(12);\n\t\t\tretail12.setRetailName(\"Prissa\");\n\t\t\tretail12.setCrawlerName(\"Prissa\");\n\t\t\tretail12.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail12);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tRetail retail13 = new Retail();\n\t\t\tretail13.setRetailId(13);\n\t\t\tretail13.setRetailName(\"Sanborns\");\n\t\t\tretail13.setCrawlerName(\"Sanborns\");\n\t\t\tretail13.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail13);\n\t\t\t\n\t\t\t\n\t\t\tRetail retail14 = new Retail();\n\t\t\tretail14.setRetailId(14);\n\t\t\tretail14.setRetailName(\"Soriana\");\n\t\t\tretail14.setCrawlerName(\"Soriana\");\n\t\t\tretail14.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail14);\n\t\t\t\n\t\t\t\n\t\t\tRetail retail15 = new Retail();\n\t\t\tretail15.setRetailId(15);\n\t\t\tretail15.setRetailName(\"SuperWalmart\");\n\t\t\tretail15.setCrawlerName(\"SuperWalmart\");\n\t\t\tretail15.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail15);\n\t\t\t\n\t\t\t\n\t\t\tRetail retail16 = new Retail();\n\t\t\tretail16.setRetailId(16);\n\t\t\tretail16.setRetailName(\"SuplementosFitness\");\n\t\t\tretail16.setCrawlerName(\"SuplementosFitness\");\n\t\t\tretail16.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail16);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tRetail retail17 = new Retail();\n\t\t\tretail17.setRetailId(17);\n\t\t\tretail17.setRetailName(\"Walmart\");\n\t\t\tretail17.setCrawlerName(\"Walmart\");\n\t\t\tretail17.setCountry(mexico);\t\t\n\t\t\taddRetailService.saveRetail(retail17);\n }\n catch (Exception e)\n {\n e.printStackTrace();\n System.out.println(\"Errors occurred during initialization. System verification is required.\");\n }\n }",
"private int syncEnergyData() throws IOException {\n\n // initialize some useful dates\n Calendar today = Calendar.getInstance();\n //today.add(Calendar.MINUTE, -15);\n Calendar year_ago = Calendar.getInstance();\n year_ago.add(Calendar.YEAR, -1);\n Calendar week_ago = Calendar.getInstance();\n week_ago.add(Calendar.MONTH, -1);\n Calendar day_ago = Calendar.getInstance();\n day_ago.add(Calendar.DATE, -1);\n\n\n String consumption_point = \"carleton_campus_en_use\";\n String production_point = \"carleton_wind_production\";\n\n //get the two live data points for first screen\n\n String quarter_hourly_consumption = readEnergyJSON(day_ago.getTime(), today.getTime(), \"quarterhour\", consumption_point);\n Log.i(\"quarter_hourly_consumption\", quarter_hourly_consumption);\n // update liveConsumption based on data from most recent complete 1/4 hour\n String[] consumption_list = quarter_hourly_consumption.split(\"[\\n|\\r]\");\n String recent_consumption_line = consumption_list[consumption_list.length - 2];\n liveConsumption = (Double.parseDouble(recent_consumption_line.substring(recent_consumption_line.indexOf(';') + 1, recent_consumption_line.length())));\n\n // quarter-hourly windmill1 production for past 24 hours\n String quarter_hourly_production1 = readEnergyJSON(day_ago.getTime(), today.getTime(), \"quarterhour\", production_point);\n // update liveProduction based on data from most recent complete 1/4 hour\n String[] production1_list = quarter_hourly_production1.split(\"[\\n|\\r]\");\n String recent_production1_line = production1_list[production1_list.length - 2];\n liveProduction1 = (Double.parseDouble(recent_production1_line.substring(recent_production1_line.indexOf(';') + 1, recent_production1_line.length())));\n\n // update values stored in sharedPref for next time app loads\n SharedPreferences sharedPref = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);\n SharedPreferences.Editor ed = sharedPref.edit();\n ed.putFloat(\"liveConsumption\", (float)liveConsumption);\n ed.putFloat(\"liveProduction1\", (float)liveProduction1);\n ed.commit();\n\n\n // get all the graph data and save in files\n String[] time_units = {\"day\", \"hour\", \"quarterhour\"};\n Date[] start_dates = {year_ago.getTime(), week_ago.getTime(), day_ago.getTime()};\n String[] points = {consumption_point, production_point};\n String[] dependent_variables = {\"consumption\", \"production1\"};\n\n for (int i = 0; i < time_units.length; i++) {\n String increment = time_units[i];\n Date start = start_dates[i];\n\n for (int j = 0; j < points.length; j++) {\n String data = readEnergyJSON(start, today.getTime(), increment, points[j]);\n\n try {\n DataOutputStream out = new DataOutputStream(\n context.openFileOutput(increment + \"_\" + dependent_variables[j] +\n \"_data\", Context.MODE_PRIVATE));\n out.writeUTF(data);\n out.close();\n } catch (IOException e) {\n Log.i(\"syncEnergyData\", \"I/O Error\");\n }\n }\n }\n return 0;\n }",
"private void retrieveAllUserData() {\n retrieveBasicUserInfo();\n retrieveUsersRecentMedia();\n retrieveUsersLikedMedia();\n }",
"private Measurement getMeasurements(){\n Measurement measurement = new Measurement();\n\n //set to date of measurement added\n measurement.setDate(new Date());\n\n //retrieve measurement data from edit texts. if edit text is empty make measurement 0;\n String neckString = neckEditText.getText().toString();\n double neck = (!neckString.equals(\"\")) ? Double.parseDouble(neckString) : 0;\n measurement.setNeck(neck);\n\n String chestString = chestEditText.getText().toString();\n double chest = (!chestString.equals(\"\")) ? Double.parseDouble(chestString) : 0;\n measurement.setChest(chest);\n\n String shoulderString = shoulderEditText.getText().toString();\n double shoulders = (!shoulderString.equals(\"\")) ? Double.parseDouble(shoulderString) : 0;\n measurement.setShoulders(shoulders);\n\n String leftArmString = leftArmEditText.getText().toString();\n double leftArm = (!leftArmString.equals(\"\")) ? Double.parseDouble(leftArmString) : 0;\n measurement.setLeftArm(leftArm);\n\n String rightArmString = rightArmEditText.getText().toString();\n double rightArm = (!rightArmString.equals(\"\")) ? Double.parseDouble(rightArmString) : 0;\n measurement.setRightArm(rightArm);\n\n String leftForearmString = leftForearmEditText.getText().toString();\n double leftForearm = (!leftForearmString.equals(\"\")) ? Double.parseDouble(leftForearmString) : 0;\n measurement.setLeftForearm(leftForearm);\n\n String rightForearmString = rightForearmEditText.getText().toString();\n double rightForearm = (!rightForearmString.equals(\"\")) ? Double.parseDouble(rightForearmString) : 0;\n measurement.setRightForearm(rightForearm);\n\n String waistString = waistEditText.getText().toString();\n double waist = (!waistString.equals(\"\")) ? Double.parseDouble(waistString) : 0;\n measurement.setWaist(waist);\n\n String hipsString = hipsEditText.getText().toString();\n double hips = (!hipsString.equals(\"\")) ? Double.parseDouble(hipsString) : 0;\n measurement.setHips(hips);\n\n String leftLegString = leftLegEditText.getText().toString();\n double leftLeg = (!leftLegString.equals(\"\")) ? Double.parseDouble(leftLegString) : 0;\n measurement.setLeftLeg(leftLeg);\n\n String rightLegString = rightLegEditText.getText().toString();\n double rightLeg = (!rightLegString.equals(\"\")) ? Double.parseDouble(rightLegString) : 0;\n measurement.setRightLeg(rightLeg);\n\n String leftCalfString = leftCalfEditText.getText().toString();\n double leftCalf = (!leftCalfString.equals(\"\")) ? Double.parseDouble(leftCalfString) : 0;\n measurement.setLeftCalf(leftCalf);\n\n String rightCalfString = rightCalfEditText.getText().toString();\n double rightCalf = (!rightCalfString.equals(\"\")) ? Double.parseDouble(rightCalfString) : 0;\n measurement.setRightCalf(rightCalf);\n\n String weightString = weightEditText.getText().toString();\n double weight = (!weightString.equals(\"\")) ? Double.parseDouble(weightString) : 0;\n measurement.setWeight(weight);\n\n String bodyFatString = bodyFatEditText.getText().toString();\n double bodyFat = (!bodyFatString.equals(\"\")) ? Double.parseDouble(bodyFatString) : 0;\n measurement.setBodyFat(bodyFat);\n\n //below variables are should be retrieved from the Shared Preferences.\n int age = mSharedPreferences.getInt(Constants.AGE, 0);\n measurement.setAge(age);\n boolean male = mSharedPreferences.getBoolean(Constants.SEX, true);\n measurement.setMale(male);\n String activityLevel = mSharedPreferences.getString(Constants.ACTIVITY, \"\");\n\n if(activityLevel.equals(getString(R.string.sedentary))){\n measurement.setActivityLevel(Calculators.SEDENTERAY);\n } else if(activityLevel.equals(getString(R.string.light))){\n measurement.setActivityLevel(Calculators.LIGHT);\n }else if(activityLevel.equals(getString(R.string.moderate))){\n measurement.setActivityLevel(Calculators.MODERATE);\n }else if(activityLevel.equals(getString(R.string.very_active))){\n measurement.setActivityLevel(Calculators.VERY_ACTIVE);\n }else if(activityLevel.equals(getString(R.string.extremely_active))){\n measurement.setActivityLevel(Calculators.EXTREMELY_ACTIVE);\n }\n\n double height = mSharedPreferences.getFloat(Constants.HEIGHT,0);\n measurement.setHeight(height);\n\n //if weight is more than 0 use the Calculators class to calculate the rest of the measurement variables\n if(weight > 0){\n measurement.setRestingEnergyExpenditure(Calculators.getRestingEnergyExpenditure(weight, height, age, male));\n measurement.setTotalDailyEnergyExpenditure(Calculators.getTotalDailyEnergyExpenditure(measurement.getRestingEnergyExpenditure(), measurement.getActivityLevel()));\n measurement.setProteinAmount(Calculators.getProteinAmount(weight));\n measurement.setFatAmount(Calculators.getFatAmount(measurement.getTotalDailyEnergyExpenditure()));\n measurement.setCarbAmount(Calculators.getCarbAmount(measurement.getProteinAmount(), measurement.getFatAmount(), measurement.getTotalDailyEnergyExpenditure()));\n measurement.setBMI(Calculators.getBMI(height, weight, true));\n measurement.setBMICategory(Calculators.getBMICatagory(measurement.getBMI()));\n measurement.setWaistToHeightRatio(Calculators.waistToHeightRatio(waist, height));\n measurement.setWITHCategory(Calculators.getWTHCatagory(measurement.getWaistToHeightRatio(), male));\n }\n return measurement;\n }",
"private void populateLocationsAndIssuingUsersDropDowns(MarriageRegister notice) {\n //get current users location displaying lists,initial values are set by the service\n locationList = commonUtil.populateActiveUserLocations(user, language);\n userList = new HashMap<String, String>();\n List<User> users = userLocationDAO.getMarriageCertificateSignUsersByLocationId(locationList.keySet().\n iterator().next(), true);\n for (User u : users) {\n MRDivision mrDivisionMaleNotice = notice.getMrDivisionOfMaleNotice();\n MRDivision mrDivisionFemaleNotice = notice.getMrDivisionOfFemaleNotice();\n if ((mrDivisionMaleNotice != null && user.isAllowedAccessToMRDSDivision(mrDivisionMaleNotice.getMrDivisionUKey())) ||\n (mrDivisionFemaleNotice != null && user.isAllowedAccessToMRDSDivision(mrDivisionFemaleNotice.getMrDivisionUKey()))) {\n userList.put(u.getUserId(), NameFormatUtil.getDisplayName(u.getUserName(), 50));\n }\n }\n }",
"public static void customerGen() {\n BufferedReader fname, lname;\r\n ArrayList<String> firstN = new ArrayList(),\r\n lastN = new ArrayList();\r\n int id = (int)Math.pow(10,IDDIGIT - 1);\r\n try {\r\n fname = new BufferedReader(new FileReader(\"firstName.txt\"));\r\n lname = new BufferedReader(new FileReader(\"lastName.txt\"));\r\n String line;\r\n while((line = fname.readLine()) != null) {firstN.add(line);}\r\n while((line = lname.readLine()) != null) {lastN.add(line);}\r\n fname.close();\r\n lname.close();\r\n } catch(Exception e){e.printStackTrace();}\r\n for(int j = 0; j < COUNT; j++){\r\n id ++;\r\n String n = nameGen(firstN,lastN);\r\n long i = phoneGen();\r\n System.out.printf(\"insert into customer values(%d,%20s,%10d);\",id,n,i);\r\n }\r\n }",
"@Override\n\tpublic Double metricValue() {\n\t\tthis.totalSampleSize = (int) Math.min(MAX_FQURIS_PER_TLD, (Math.round((double) totalURIs * POPULATION_PERCENTAGE)));\n\t\tList<String> lstUrisToDeref = new ArrayList<String>(totalSampleSize);\t\n\n\t\t\n\t\tfor(Tld tld : this.tldsReservoir.getItems()){\n\t\t\t//Work out ratio for the number of maximum TLDs in Reservior\n//\t\t\tdouble totalRatio = ((double) tldCount.get(tld.getUri())) * POPULATION_PERCENTAGE; // ratio between the total number of URIs of a TLD in a dataset against the overall total number of URIs\n//\t\t\tdouble representativeRatio = totalRatio / ((double) totalURIs * POPULATION_PERCENTAGE); // the ratio of the URIs of a TLD against the population sample for all URIs in a dataset\n//\t\t\tlong maxRepresentativeSample = Math.round(representativeRatio * (double) MAX_FQURIS_PER_TLD); // how big should the final reservior for a TLD be wrt the representative ratio\n\t\t\t\n\t\t\tlong maxRepresentativeSample = Math.round(((double) this.totalSampleSize / (double) totalURIs) * ((double) tldCount.get(tld.getUri())));\n\t\t\t// Re-sample the sample to have the final representative sample\n\t\t\tif (maxRepresentativeSample > 0){\n\t\t\t\tReservoirSampler<String> _tmpRes = new ReservoirSampler<String>((int)maxRepresentativeSample, true);\n\t\t\t\n\t\t\t\tfor(String uri : tld.getfqUris().getItems()){\n\t\t\t\t\t_tmpRes.add(uri);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlstUrisToDeref.addAll(_tmpRes.getItems());\n\t\t\t}\n\t\t}\n\t\tdouble metricValue = 0.0;\n\t\t\n\t\tthis.totalNumberOfURIs = (lstUrisToDeref.size() + this.nonSemanticResources);\n\t\t\n\t\tthis.totalCorrectReportedTypes = this.checkForMisreportedContentType(lstUrisToDeref);\n\t\tmetricValue = (double)this.totalCorrectReportedTypes / this.totalNumberOfURIs;\n\t\t\n\t\treturn metricValue;\n\t}",
"public void DeductCharges () {\r\n\r\n\t\tdouble Temp = 0;\r\n\r\n\t\tfor ( Map.Entry<String, Double> CA : _ChargeAmounts.entrySet() ) {\r\n\r\n\t\t\tTemp += CA.getValue();;\r\n\r\n\t\t}\r\n\r\n\t\t_MonthlyChargeAmounts.put( _Tick.getMonthNumber(), Temp );\r\n\r\n\t\t_FundValue -= Temp;\r\n\r\n\t\tSystem.out.println( \"\\t\\t\\t \" + _Name + \" After Charges : \" + _FundValue );\r\n\t}",
"public static List<UserDto> selectAllUserDto() {\n\t\t// create a new UserDaoImpl\n\t\tud = new UserDaoImpl();\n\t\tlogger.info(\"UserDaoImpl created\");\n\n\t\t// get all users from the database\n\t\tList<User> users = ud.selectAllUser();\n\t\tlogger.info(\"Users retrieved from database\");\n\n\t\t// create an empty list of UseDtos\n\t\tList<UserDto> userDtos = new ArrayList<>();\n\t\tlogger.info(\"Empty UserDto list created\");\n\n\t\tlogger.info(\"Iterating through list of users\");\n\t\tfor (User u : users) {\n\t\t\tlogger.debug(\"User: \" + u);\n\n\t\t\t// create a new UserDto to add to the list\n\t\t\tUserDto userDto = new UserDto(u.getId(), u.getUsername(), u.getfName(), u.getlName(), u.getPriv(),\n\t\t\t\t\tu.getActivation());\n\t\t\tlogger.info(\"UserDto created\");\n\t\t\tlogger.debug(\"UserDto: \" + userDto);\n\n\t\t\t// adding UserDto to list\n\t\t\tlogger.info(\"Adding UserDto to list\");\n\t\t\tuserDtos.add(userDto);\n\t\t}\n\n\t\t// return the list of UserDtos\n\t\tlogger.info(\"Returning UserDto list\");\n\t\treturn userDtos;\n\t}",
"public void getUsersByDays() throws IOException, SystemException {\n List<UserSubscribeDTO> usersList = planReminderService.getUsersByDays();\n LOGGER.info(\"userLIst Recievec:\" + usersList);\n shootReminderMails(usersList);\n }",
"public void calculateFDR() {\n\t\tlogger.info(\"calculateFDR\");\n\t\t\n\t\tupdateDecoyStrategy();\n\t\t\n\t\tproteinModeller.calculateFDR();\n\t\t\n\t\tproteinModeller.sortReport(sortPanel.getSortPriorities(),\n\t\t\t\tsortPanel.getSortOrders());\n\t\t\n\t\tneedsRecaching = true;\n\t}",
"public static void queryUberAndStore(LocationAndTime locationAndTime,UberClientUtil uberClient){\n Map requestMap=new HashMap<>();\n requestMap.put(\"startLatitude\",locationAndTime.getStartLatitude());\n requestMap.put(\"startLongitude\",locationAndTime.getStartLongitude());\n requestMap.put(\"endLatitude\",locationAndTime.getEndLatitude());\n requestMap.put(\"endLongitude\",locationAndTime.getEndLongitude());\n List<Price> prices=uberClient.getPriceRequest(requestMap).getPrices();\n LocalDateTime localDateTime=Instant.ofEpochMilli(locationAndTime.getJourneyStartTime().getTime()).atZone( ZoneId.systemDefault()).toLocalDateTime();\n LocalDateTime now=LocalDateTime.now();\n LocalDateTime toDateTime=LocalDateTime.of( now.getYear(),now.getMonthValue(),now.getDayOfMonth() , localDateTime.getHour(), localDateTime.getMinute(), localDateTime.getSecond());\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss\");\n if(prices!=null){\n for(Price price:prices){\n price.setCurrentDate(formatter.format(toDateTime.atZone(ZoneId.systemDefault()).toInstant()));\n csvUtilUber.writeRecordToFile(price);\n }\n }\n\n\n\n\n }",
"public Vector listICPUserReg(String userId) throws SQLException {\n Debug.print(\"Inside the getUserAndMemberId\");\n Vector vObj = new Vector();\n try {\n makeConnection();\n String slelctStr = \"SELECT icp_meeting_id,user_id,membership_status,member_id,add_date,active_status,request_status,release_id FROM \"+\n DBHelper.USEA_ICP_USER_DETAIL+\" WHERE user_id = ? \";\n PreparedStatement prepStmt = con.prepareStatement(slelctStr);\n prepStmt.setString(1, userId);\n rs = prepStmt.executeQuery();\n System.out.println(\"Inside the listICPUserReg status : \"+userId);\n Debug.print(\" Query : \\n\"+slelctStr);\n while (rs.next()) {\n this.icpMeetingId = rs.getString(1);\n this.userId = rs.getString(2);\n this.membershipStatus = rs.getString(3);\n this.memberId = rs.getString(4);\n Date addDate1 = rs.getDate(5);\n this.activeStatus = rs.getString(6);\n this.requestStatus = rs.getString(7);\n this.releaseId = rs.getString(8);\n \n this.addDate = DBHelper.dateToString(addDate1);\n \n String [] userList = {icpMeetingId,userId,membershipStatus,memberId,addDate,activeStatus,requestStatus,releaseId};\n vObj.add(userList);\n }\n releaseConnection();\n }catch (SQLException e){\n e.printStackTrace();\n }finally {\n releaseConnection();\n }\n return vObj;\n }"
] | [
"0.5729615",
"0.54658014",
"0.5424895",
"0.53963804",
"0.5318598",
"0.51455504",
"0.5028957",
"0.49882022",
"0.49597943",
"0.49115965",
"0.48936146",
"0.48702002",
"0.48569587",
"0.4821464",
"0.48157644",
"0.4812511",
"0.4774883",
"0.4763545",
"0.47550812",
"0.47460762",
"0.47178906",
"0.4715231",
"0.47139114",
"0.4709598",
"0.4707122",
"0.46921974",
"0.46867833",
"0.46565983",
"0.46357664",
"0.46319574",
"0.4607838",
"0.4600635",
"0.4600439",
"0.45994753",
"0.45907313",
"0.4585022",
"0.45820743",
"0.4572662",
"0.45722273",
"0.45702502",
"0.45650837",
"0.45629022",
"0.4561767",
"0.45570463",
"0.45569825",
"0.45535183",
"0.4550601",
"0.4547495",
"0.45341825",
"0.45320752",
"0.4530793",
"0.45270514",
"0.45146504",
"0.45139024",
"0.45073733",
"0.45062086",
"0.45050117",
"0.44985697",
"0.44952708",
"0.44951418",
"0.4493388",
"0.44902498",
"0.44883382",
"0.44853166",
"0.44821706",
"0.44818714",
"0.44756442",
"0.4472664",
"0.44717655",
"0.44706565",
"0.44639608",
"0.44572976",
"0.44572678",
"0.4448599",
"0.4445984",
"0.4443961",
"0.444393",
"0.44413412",
"0.4430794",
"0.44196823",
"0.44188577",
"0.44161147",
"0.44149196",
"0.44123548",
"0.44048518",
"0.4403918",
"0.43989196",
"0.439732",
"0.43946543",
"0.439314",
"0.43911275",
"0.43884194",
"0.43882936",
"0.43845242",
"0.43784192",
"0.43775418",
"0.4373704",
"0.43660212",
"0.4365756",
"0.43648848"
] | 0.6585418 | 0 |
Generate the CDR for TNova service Pseudo Code 1. Get the list of selected meters 2. Query the UDR service to get the usage information under these meters for all the users for a time period 3. Get the rate for the same meters for a same time period 4. Combine the rate and usage to get the charge value 5. Save it in the db | private boolean generateTNovaCdr() throws Exception {
// TODO maybe continue here?
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean generateCdr(){\n //TODO: split it into smaller methods\n Object usage;\n double charge;\n String from, to;\n String[] time;\n int indexUsage;\n ArrayList usageListArr, usageArr;\n ArrayList columnArr;\n UDRServiceClient udrClient = new UDRServiceClient();\n RateResource rateResource = new RateResource();\n ArrayList<ArrayList<Object>> objArr = new ArrayList<ArrayList<Object>>();\n Double rate;\n TSDBData tsdbData;\n boolean result;\n String userid;\n ArrayList<ResourceUsage> resourceUsageArray;\n HashMap tags;\n POJOUtil pojoUtil = new POJOUtil();\n\n DateTimeUtil dateTimeUtil = new DateTimeUtil();\n time = dateTimeUtil.getRange();\n\n from = time[1];\n to = time[0];\n for (int i = 0; i < enabledResourceList.size(); i++) {\n tsdbData = rateResource.getResourceRate(enabledResourceList.get(i).toString(), from, to);\n rate = calculateRate(tsdbData);\n resourceUsageArray = udrClient.getResourceUsageData(enabledResourceList.get(i).toString(), from, to);\n for (ResourceUsage resource : resourceUsageArray) {\n columnArr = resource.getColumn();\n\n usageListArr = resource.getUsage();\n tags = resource.getTags();\n //indexUserId = columnArr.indexOf(\"userid\");\n userid = tags.get(\"userId\").toString();\n //userid = userid.substring(0, userid.length());\n indexUsage = columnArr.indexOf(\"mean\");\n // The below if condition differentiates between the gauge and cumulative meters of openstack\n if (indexUsage < 0) {\n indexUsage = columnArr.indexOf(\"usage\");//usage if we are not using the sum in the sql else \"sum\"\n }\n // Iterate through the usage arraylist to extract the userid and usage.\n // Multiple the usage with the rate of the resource and save it into an arraylist\n for (int j = 0; j < usageListArr.size(); j++) {\n usageArr = (ArrayList) usageListArr.get(j);\n usage = usageArr.get(indexUsage);\n // Calculate the charge for a resource per user\n Double d = Double.parseDouble(usage.toString());\n charge = (d * rate);\n String resources = enabledResourceList.get(i).toString();\n objArr = pojoUtil.populateList(usageListArr, objArr, resources, userid, usage, charge);\n }\n }\n\n }\n // Save the charge array into the database\n result = savePrice(objArr);\n return result;\n }",
"private TSDBData generateDynamicRate() {\n //TODO: replace with single method generateRate and parameter (static, dynamic)\n double rate;\n Random rateGenerator = new Random();\n TSDBData rateData = new TSDBData();\n ArrayList<String> strArr = null;\n ArrayList<Object> objArrNode;\n ArrayList<ArrayList<Object>> objArr = new ArrayList<ArrayList<Object>>();\n\n // Iterate through the list and generate the rate for each enabled meters\n for (int k = 0; k < enabledResourceList.size(); k++) {\n //rate = getDynamicRate(enabledResourceList.get(k).toString());\n rate = rateGenerator.nextInt((3 - 1) + 1) + 1;\n strArr = StringUtil.strArr(\"resource\", \"rate\", \"rate_policy\");\n //strArr.add(\"resource\");\n //strArr.add(\"rate\");\n //strArr.add(\"rate_policy\");\n objArrNode = new ArrayList<Object>();\n objArrNode.add(enabledResourceList.get(k));\n objArrNode.add(rate);\n objArrNode.add(Flag.getMeteringType());\n objArr.add(objArrNode);\n }\n\n rateData.setName(\"rate\");\n rateData.setColumns(strArr);\n rateData.setPoints(objArr);\n return rateData;\n }",
"InternalResultsResponse<GasMeter> fetchAllGasMeters(InquiryDeviceRequest inquiryDeviceRequest);",
"InternalResultsResponse<Device> fetchGasMeterById(DeviceRequest deviceRequest);",
"private TSDBData getBillingModel(HashMap<String, ArrayList<String>> clientInstanceMap, InfluxDBClient dbClient) {\n logger.trace(\"BEGIN TSDBData sumUsage(HashMap<String, ArrayList<String>> clientInstanceMap, InfluxDBClient dbClient)\");\n ArrayList<TSDBData> UDRs = new ArrayList<TSDBData>();\n Iterator it = clientInstanceMap.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry pair = (Map.Entry) it.next();\n String clientId = pair.getKey().toString();\n ArrayList<String> instances = (ArrayList<String>) pair.getValue();\n for (String instance : instances) {\n //System.out.println(\"instanceid = \" + instance);\n //System.out.println(\"clientid = \" + clientId);\n String queryString = \"SELECT sum(usage) FROM UDR WHERE clientId='\" +\n clientId + \"' AND instanceId='\" + instance +\n \"' GROUP BY clientID,instanceID\";\n logger.trace(\"DATA TSDBData sumUsage(...): query=\" + queryString);\n // TSDBData[] lastEvent = dbClient.query(queryString);\n //sends the event to array\n //lastEvents.add(lastEvent[0]);\n }\n System.out.println(pair.getKey() + \" = \" + pair.getValue());\n it.remove(); // avoids a ConcurrentModificationException\n }\n logger.trace(\"END ArrayList<TSDBData> captureLastEvents(HashMap<String, ArrayList<String>> clientInstanceMap, InfluxDBClient dbClient)\");\n return UDRs.get(0);\n }",
"@Get\n public String serviceRequest() {\n counter.increment(endpoint);\n\n boolean rateResult = false;\n boolean cdrResult = false;\n boolean tcdrResult = false;\n\n // Get the list of enabled resources\n enabledResourceList = getEnabledResources();\n // Service the request\n try {\n if (action.equalsIgnoreCase(\"rate\")) {\n logger.debug(\"Attempting to generate a Rate\");\n rateResult = generateRate();\n } else if (action.equalsIgnoreCase(\"cdr\")) {\n logger.debug(\"Attempting to generate a CDR\");\n cdrResult = generateCdr();\n } else if (action.equalsIgnoreCase(\"t-cdr\")) {\n logger.debug(\"Attempting to generate a CDR for T-nova\");\n tcdrResult = generateTNovaCdr();\n }\n // Construct the response\n if (rateResult) {\n return \"The rate generation was successful\";\n } else if (cdrResult) {\n return \"The cdr generation was successful\";\n } else if (tcdrResult) {\n return \"The T-Nova cdr generation was successful\";\n } else {\n return \"Operation Failed\";\n }\n }catch (Exception e){\n logger.error(\"Error while generating it: \"+e.getMessage());\n return \"Operation Failed\";\n }\n }",
"public DCU() {\r\n meters = new ArrayList<Meter>();\r\n id = \"unknown\";\r\n }",
"private void getCostAndEta() {\n\n GetVehiclesData vehiclesData = RetrofitClientInstance.getRetrofitInstance().create(GetVehiclesData.class);\n getVehicles.getVehiclesData(vehiclesData);\n setCostToLabel(getVehicles.getCost());\n setETAToLabel(getVehicles.getETA());\n\n }",
"public Breakdown generateReport(Date startDate, Date endDate, ArrayList<User> userList, double total) {\n\n //INTIATING VARIABLES\n Breakdown result = new Breakdown();\n\n HashMap<String, Breakdown> intenseMap = new HashMap<String, Breakdown>();\n HashMap<String, Breakdown> normalMap = new HashMap<String, Breakdown>();\n HashMap<String, Breakdown> mildMap = new HashMap<String, Breakdown>();\n\n int intenseCount = 0;\n int normalCount = 0;\n int mildCount = 0;\n\n result.addInList(intenseMap);\n result.addInList(normalMap);\n result.addInList(mildMap);\n\n AppUsageDAO auDAO = new AppUsageDAO();\n\n //If it is without demographic, userList is null\n if (userList == null) {\n userList = auDAO.retrieveUsers(startDate, endDate);\n }\n for (int i = 0; i < userList.size(); i++) {\n User currUser = userList.get(i);\n\n //get current user's app usge\n ArrayList<AppUsage> userUsage = auDAO.retrieveByUser(currUser.getMacAddress(), startDate, endDate);\n double totalSeconds = 0;\n\n Date nextDay = new Date(startDate.getTime() + 60 * 60 * 1000 * 24);\n\n Date oldTime = null;\n if (userUsage.size() > 0) {\n oldTime = userUsage.get(0).getDate();\n if (oldTime.after(nextDay)) {\n nextDay = new Date(nextDay.getTime() + 60 * 60 * 1000 * 24);\n }\n }\n\n for (int j = 1; j < userUsage.size(); j++) {\n AppUsage au = userUsage.get(j);\n Date newTime = au.getDate();\n boolean beforeAppeared = false;\n if (newTime.before(nextDay)) {\n beforeAppeared = true;\n //difference between app usage timing\n long difference = Utility.secondsBetweenDates(oldTime, newTime);\n\n //If difference less than/equal 2 minutes\n if (difference <= 2 * 60) {\n // add difference to totalSeconds if <= 2 mins\n totalSeconds += difference;\n } else {\n // add 10sec to totalSeconds if > 2 mins\n totalSeconds += 10;\n }\n\n } else { // NEW TIMING AFTER NEXT DAY\n nextDay = new Date(nextDay.getTime() + 60 * 60 * 1000 * 24);\n\n if (!beforeAppeared) {\n long difference = Utility.secondsBetweenDates(oldTime, newTime);\n if (difference <= 2 * 60) {\n // add difference to totalSeconds if <= 2 mins\n totalSeconds += difference;\n } else {\n // add 10sec to totalSeconds if > 2 mins\n totalSeconds += 10;\n }\n }\n }\n\n oldTime = newTime;\n\n }\n\n if (oldTime.before(nextDay)) {\n long difference = Utility.secondsBetweenDates(oldTime, nextDay);\n if (difference < 10) {\n totalSeconds += difference;\n } else {\n totalSeconds += 10;\n }\n } else {\n totalSeconds += 10;\n }\n\n //DIVIDE TO GET INTO DAYS\n long days = (endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24) + 1;\n totalSeconds /= days;\n\n //FILTER USER'S USAGE INTO CATEGORIES\n double totalHours = totalSeconds / (60 * 60);\n\n if (totalHours > 0) {\n if (totalHours < 1.0) {\n //MILD\n mildCount++;\n\n } else if (totalHours < 5.0) {\n //NORMAL\n normalCount++;\n\n } else {\n //INTENSE\n intenseCount++;\n\n }\n }\n\n }\n //Calculate percentage\n if (total == -1) {\n total = mildCount + normalCount + intenseCount;\n\n }\n\n int mildPercent = (int) Math.round(mildCount / total * 100);\n int normalPercent = (int) Math.round(normalCount / total * 100);\n int intensePercent = (int) Math.round(intenseCount / total * 100);\n\n //Put in maps\n intenseMap.put(\"intense-count\", new Breakdown(\"\" + intenseCount));\n intenseMap.put(\"intense-percent\", new Breakdown(\"\" + intensePercent));\n\n normalMap.put(\"normal-count\", new Breakdown(\"\" + normalCount));\n normalMap.put(\"normal-percent\", new Breakdown(\"\" + normalPercent));\n\n mildMap.put(\"mild-count\", new Breakdown(\"\" + mildCount));\n mildMap.put(\"mild-percent\", new Breakdown(\"\" + mildPercent));\n\n return result;\n }",
"public static void createElecUsage(ElectricityUsage electricityUsage) {\n URL url = null;\n HttpURLConnection connection = null;\n final String methodPath = \"/entities.electricityusage/\";\n try {\n Gson gson = new Gson();\n String stringUserJson = gson.toJson(electricityUsage);\n url = new URL(BASE_URI + methodPath);\n // open connection\n connection = (HttpURLConnection) url.openConnection();\n // set time out\n connection.setReadTimeout(10000);\n connection.setConnectTimeout(15000);\n // set connection method to POST\n connection.setRequestMethod(\"POST\");\n // set the output to true\n connection.setDoOutput(true);\n // set length of the data you want to send\n connection.setFixedLengthStreamingMode(stringUserJson.getBytes().length);\n // add HTTP headers\n connection.setRequestProperty(\"Content-Type\", \"application/json\");\n\n // send the POST out\n PrintWriter out = new PrintWriter(connection.getOutputStream());\n out.print(stringUserJson);\n out.close();\n Log.i(\"error\", new Integer(connection.getResponseCode()).toString());\n\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n connection.disconnect();\n }\n }",
"private TSDBData generateStaticRate() {\n //TODO: check if there is generic method to to return rateData\n ArrayList<String> strArr = StringUtil.strArr(\"resource\", \"rate\", \"rate_policy\");\n TSDBData rateData = createPOJOObject(\"rate\", strArr, load.getStaticRate());\n return rateData;\n }",
"private void getHotelRoomRateCall(long cityId) {\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-DD\", Locale.ENGLISH);\n engCheckInDate = dateFormat.format(checkInDate);\n engCheckOutDate = dateFormat.format(checkOutDate);\n\n ArrayList<OccupancyDto> occupancyDtoArrayList = new ArrayList<>();\n HotelRoomRateRequest hotelRoomRateRequest = new HotelRoomRateRequest();\n hotelRoomRateRequest.setCheckInDate(new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH).format(checkInDate));\n hotelRoomRateRequest.setCheckOutDate(new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH).format(checkOutDate));\n hotelRoomRateRequest.setLanguageCode(UserDTO.getUserDTO().getLanguage());\n hotelRoomRateRequest.setCityId(cityId);\n hotelRoomRateRequest.setHotelId(Long.parseLong(destination.getKey()));\n hotelRoomRateRequest.setCurrencyCode(UserDTO.getUserDTO().getCurrency());\n\n for (int i = 0; i < hotelAccommodationsArrayList.size(); i++) {\n\n if (kidsAgeArrayList == null)\n kidsAgeArrayList = new ArrayList<>();\n kidsAgeArrayList.clear();\n\n if (hotelAccommodationsArrayList.get(i).getKids() > 0) {\n if (hotelAccommodationsArrayList.get(i).getKids() == 1) {\n kidsAgeArrayList.add(hotelAccommodationsArrayList.get(i).getKid1Age());\n } else if (hotelAccommodationsArrayList.get(i).getKids() == 2) {\n kidsAgeArrayList.add(hotelAccommodationsArrayList.get(i).getKid1Age());\n kidsAgeArrayList.add(hotelAccommodationsArrayList.get(i).getKid2Age());\n }\n }\n\n occupancyDtoArrayList.add(new OccupancyDto(hotelAccommodationsArrayList.get(i).getAdultsCount(), kidsAgeArrayList));\n hotelRoomRateRequest.setOccupancy(occupancyDtoArrayList);\n }\n\n HotelListingRequest hotelListingRequest = HotelListingRequest.getHotelListRequest();\n hotelListingRequest.setCheckInDate(new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH).format(checkInDate));\n hotelListingRequest.setCheckOutDate(new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH).format(checkOutDate));\n hotelListingRequest.setLanguageCode(UserDTO.getUserDTO().getLanguage());\n hotelListingRequest.setCityId(cityId);\n hotelListingRequest.setCurrencyCode(UserDTO.getUserDTO().getCurrency());\n hotelListingRequest.setOccupancy(hotelRoomRateRequest.getOccupancy());\n\n String request = new Gson().toJson(hotelRoomRateRequest);\n\n if (NetworkUtilities.isInternet(getActivity())) {\n hotelSearchPresenter.getHotelRoomRate(Constant.API_URL + Constant.HOTELSRATES, request, getActivity());\n\n } else\n Utilities.commonErrorMessage(context, context.getString(R.string.Network_not_avilable), context.getString(R.string.please_check_your_internet_connection), false, getFragmentManager());\n }",
"public JSONObject getDNAgainstSalesForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n String companyId=reqParams.optString(\"companyid\");\n JSONObject jSONObject = new JSONObject();\n double taxableAmountCN = 0d;\n double totalAmountCN = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n\n /**\n * Get CN amount\n */\n reqParams.put(\"entitycolnum\", reqParams.optString(\"dnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"dnentityValue\"));\n List<Object> cnData = accEntityGstDao.getDNAgainstCustomer(reqParams);\n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n for (Object object : cnData) {\n Object[] data = (Object[]) object;\n String term = data[1] != null ? data[1].toString() : \"\";\n double termamount = data[0] != null ? (Double) data[0] : 0;\n\n totalAmountCN = (Double) data[3];\n if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n IGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n CGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n } else if (StringUtil.isNullOrEmpty(term)) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n }\n }\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountCN,companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\",authHandler.formattedAmount(taxableAmountCN+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n } else {\n reqParams.put(\"isDebitNoteTransaction\", true);\n jSONObject = accGSTReportService.getCreditNoteJSONArrayForGSTR3B(cnData, reqParams, companyId);\n reqParams.remove(\"isDebitNoteTransaction\");\n }\n return jSONObject;\n }",
"public JSONObject getDNForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n JSONObject jSONObject = new JSONObject();\n double taxableAmountCN = 0d;\n double totalAmountCN = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n\n /**\n * Get CN amount\n */\n List<Object> cnData = new ArrayList();\n if (!reqParams.optBoolean(\"onlycnagainstvendor\", false)) {\n reqParams.put(\"entitycolnum\", reqParams.optString(\"dnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"dnentityValue\"));\n cnData = gstr2Dao.getCNDNWithInvoiceDetailsInSql(reqParams);\n if (reqParams.has(\"zerorated\")) {\n reqParams.remove(\"zerorated\");\n }\n List<Object> cnDataWithoutInventory = gstr2Dao.getDNAgainstVendor(reqParams);\n if (cnDataWithoutInventory != null && !cnDataWithoutInventory.isEmpty()) {\n cnData.addAll(cnDataWithoutInventory);\n }\n }\n reqParams.put(\"isDebitNoteTransaction\", true);\n if (reqParams.has(\"cnentitycolnum\") && reqParams.has(\"cnentityValue\")) {\n /**\n * Return CN against vendors\n */\n if (reqParams.optBoolean(\"onlycnagainstvendor\", false)) {\n cnData.clear();\n reqParams.put(\"isDebitNoteTransaction\", false);\n }\n reqParams.put(\"entitycolnum\", reqParams.optString(\"cnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"cnentityValue\"));\n List<Object> dnAgainstCustomer = gstr2Dao.getCNAgainstVendor(reqParams);\n if (dnAgainstCustomer != null) {\n cnData.addAll(dnAgainstCustomer);\n } \n reqParams.put(\"entitycolnum\", reqParams.optString(\"dnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"dnentityValue\"));\n }\n String companyId = reqParams.optString(\"companyid\");\n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n for (Object object : cnData) {\n Object[] data = (Object[]) object;\n String term = data[1] != null ? data[1].toString() : \"\";\n double termamount = data[0] != null ? (Double) data[0] : 0;\n totalAmountCN = data[3] != null ? (Double) data[3] : 0;\n if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputIGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n IGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputCGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n CGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"InputCESS\").toString())) {\n CESSAmount += termamount;\n } else if (StringUtil.isNullOrEmpty(term)) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n }\n }\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountCN, companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount, companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount, companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount, companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount, companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount + CGSTAmount + SGSTAmount + CESSAmount, companyId));\n jSONObject.put(\"totalamount\", authHandler.formattedAmount(taxableAmountCN+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount, companyId));\n } else {\n jSONObject = accGSTReportService.getDebitNoteJSONArrayForGSTR3B(cnData, reqParams, companyId);\n }\n// jSONObject.put(\"totalamount\", authHandler.formattedAmount(totalAmountCN, companyId));\n return jSONObject;\n }",
"@Override\n public Double buyDevice(String name, String type) {\n Cash c = null;\n Cheque ch = null;\n Card cd = null;\n \n Date d = new Date();\n \n switch (type) {\n case \"c1\":\n c = new Cash.Builder(d.toString())\n .build();\n break;\n case \"c2\":\n ch = new Cheque.Builder(d.toString())\n .build();\n break;\n case \"c3\":\n cd = new Card.Builder(d.toString())\n .build();\n break;\n }\n \n \n PurchaseVinyl v = new PurchaseVinyl.Builder()\n .setName(\"Let The Good Times Role\")\n .setPrice(3.99)\n .build();\n \n PurchaseVinyl v1 = new PurchaseVinyl.Builder()\n .setName(\"Thanks For The Meomories\")\n .setPrice(3.99)\n .build();\n \n List<PurchaseVinyl> vinylList = new ArrayList();\n vinylList.add(v);\n vinylList.add(v1);\n \n \n ProductPurchase pc = new ProductPurchase.Builder(d)\n .setVinylPurchases(vinylList)\n .setCardPurchases(cd)\n .setCashPurchases(c)\n .setChequePurchases(ch)\n .build();\n \n repo.save(pc);\n id = pc.getID();\n \n ProductPurchase pc2 = repo.findOne(id);\n for(int x = 0; pc2.getVinylPurchases().size() > x; x++){\n if(pc2.getVinylPurchases().get(x).getName().equals(name)){\n return pc2.getVinylPurchases().get(x).getPrice();\n }\n }\n return null; \n }",
"@Override\n public String get_rates(String betrag, String currency, List<String> targetcurrencies) {\n String api = null;\n try {\n api = new String(Files.readAllBytes(Paths.get(\"src/resources/OfflineData.json\")));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n JSONObject obj = new JSONObject(api);\n ArrayList<String> calculatedrates = new ArrayList<>();\n if (currency.equals(\"EUR\")) {\n for (String targetcurrency : targetcurrencies) {\n float rate = obj.getJSONObject(\"rates\").getFloat(targetcurrency);\n calculatedrates.add((Float.parseFloat(betrag) * rate) + \" \" + targetcurrency + \" (Kurs: \" + rate + \")\");\n }\n } else {\n float currencyrate = obj.getJSONObject(\"rates\").getFloat(currency);\n for (String targetcurrency : targetcurrencies) {\n float rate = obj.getJSONObject(\"rates\").getFloat(targetcurrency);\n calculatedrates.add((Float.parseFloat(betrag) / currencyrate * rate) + \" \" + targetcurrency + \" (Kurs: \" + rate / currencyrate + \")\");\n }\n }\n return Data.super.display(betrag, currency, calculatedrates, obj.get(\"date\").toString());\n }",
"public void writeTourResultsAllCarrier() {\n\t\tString fileName = this.outputFolder + \"total_tour_infos_per_vehicleType.csv\";\n\t\tFile file = new File(fileName);\n\n\t\ttry {\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(file));\n\t\t\tbw.write(fileName);\n\t\t\tbw.newLine();\n\t\t\tbw.write(\"____________________________________________________________________________\");\n\t\t\tbw.newLine();\n\n\t\t\tbw.write(\"personId; vehType Id;distance [m] ; distance [km] ;TravelTime [s]; TravelTime [h];\" +\n\t\t\t\t\t\"FuelConsumption[l]; Emission [t Co2]; FuelConsumptionRate[l/100m]; \" +\n\t\t\t\t\t\"EmissionRate [g/m]; \");\n\t\t\tbw.newLine();\n\n\n\n\t\t\t//\t\t\tKT:\n\t\t\tMap<Id<Person>, Double> personId2tourDistance = this.handler.getPersonId2TourDistances();\n\t\t\tMap<Id<Person>, Double> personId2tourTravelTimes = this.handler.getPersonId2TravelTimes();\n\n\t\t\tMap<Id<VehicleType>, VehicleTypeSpezificCapabilities> vehTypId2Capabilities = new TreeMap<Id<VehicleType>, VehicleTypeSpezificCapabilities>();\n\n\t\t\tCarrierVehicleTypes vehicleTypes = this.handler.getVehicleTypes();\n\n\t\t\t//preparation:\n\t\t\tfor (Id<VehicleType> vehicleTypeId : vehicleTypes.getVehicleTypes().keySet()){\n\t\t\t\tVehicleTypeSpezificCapabilities capabilities = this.handler.getVehTypId2Capabilities().get(vehicleTypeId);\n\t\t\t\tif (capabilities != null){\n\t\t\t\t\tvehTypId2Capabilities.put(vehicleTypeId, capabilities);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//write results:\n\t\t\tfor (Id<Person> personId :personId2tourDistance.keySet()) {\n\n\t\t\t\tDouble tourDistanceMeter = personId2tourDistance.get(personId);\n\t\t\t\tDouble tourTravelTimeSec = personId2tourTravelTimes.get(personId);\n\n\t\t\t\tId<VehicleType> vehTypeId = null;\n\n\t\t\t\tfor (Id<VehicleType> vehTypeIdsAvail : vehicleTypes.getVehicleTypes().keySet()) {\n\t\t\t\t\tif(personId.toString().contains(\"_\"+vehTypeIdsAvail.toString()+\"_\")){\n\t\t\t\t\t\tif (vehTypeIdsAvail.toString().endsWith(\"frozen\") == personId.toString().contains(\"frozen\")) {//only frozen\n\t\t\t\t\t\t\tvehTypeId = vehTypeIdsAvail;\n\t\t\t\t\t\t} else { //not \"frozen\"\n\t\t\t\t\t\t\tvehTypeId = vehTypeIdsAvail;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (vehTypeId == null) {\n\t\t\t\t\tlog.error(\"Vehicle type for person not defined: \" + personId);\n\t\t\t\t}\n\n\t\t\t\tdouble fuelConsuptionRate = (vehTypId2Capabilities.get(vehTypeId)).getFuelConsumtion()*1000; // Usually in l/100km\n\t\t\t\tdouble emissionsRatePerMeter = vehTypId2Capabilities.get(vehTypeId).getEmissionsPerMeter(); \n\n\t\t\t\tbw.write(personId + \";\" +\n\t\t\t\t\t\tvehTypeId + \";\" +\n\t\t\t\t\t\ttourDistanceMeter + \";\" + \n\t\t\t\t\t\ttourDistanceMeter/1000 + \";\" + //km\n\t\t\t\t\t\ttourTravelTimeSec + \";\" + \n\t\t\t\t\t\ttourTravelTimeSec/3600 + \";\" + \t//h\n\t\t\t\t\t\ttourDistanceMeter*fuelConsuptionRate/100/1000 + \";\" + // rate is in [liter/100km]\n\t\t\t\t\t\ttourDistanceMeter*emissionsRatePerMeter /1000000 +\";\" + \t// CO2-Ausstoss in t (= 1Mio g)\n\t\t\t\t\t\tfuelConsuptionRate+ \";\" + \n\t\t\t\t\t\temissionsRatePerMeter \n\t\t\t\t\t\t);\n\t\t\t\tbw.newLine();\n\n\t\t\t}\t\n\t\t\t\n\t\t\tlog.info(\"Output written to \" + fileName);\n\t\t\tbw.close();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public JSONObject getAdvanceForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n String companyId=reqParams.optString(\"companyid\");\n JSONObject jSONObject = new JSONObject();\n double taxableAmountAdv = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n if (reqParams.optBoolean(\"at\")) {\n /**\n * Get Advance for which invoice not linked yet\n */\n\n reqParams.put(\"at\", true);\n List<Object> receiptList = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n JSONArray bulkData = gSTR1DeskeraServiceDao.createJsonForAdvanceDataFetchedFromDB(receiptList, reqParams);\n Map<String, JSONArray> advanceMap = AccountingManager.getSortedArrayMapBasedOnJSONAttribute(bulkData, GSTRConstants.receiptadvanceid);\n for (String advdetailkey : advanceMap.keySet()) {\n double rate = 0d;\n JSONArray adDetailArr = advanceMap.get(advdetailkey);\n JSONObject advanceobj = adDetailArr.getJSONObject(0);\n taxableAmountAdv += advanceobj.optDouble(GSTRConstants.receiptamount) - advanceobj.optDouble(GSTRConstants.receipttaxamount);\n for (int index = 0; index < adDetailArr.length(); index++) {\n JSONObject invdetailObj = adDetailArr.getJSONObject(index);\n String defaultterm = invdetailObj.optString(GSTRConstants.defaultterm);\n\n /**\n * Iterate applied GST and put its Percentage and Amount\n * accordingly\n */\n double termamount = invdetailObj.optDouble(GSTRConstants.termamount);\n double taxrate = invdetailObj.optDouble(GSTRConstants.taxrate);\n /**\n * calculate tax amount by considering partial case\n */\n termamount = (advanceobj.optDouble(GSTRConstants.receiptamount) - advanceobj.optDouble(GSTRConstants.receipttaxamount)) * invdetailObj.optDouble(GSTRConstants.taxrate) / 100;\n if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n IGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n CGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n }\n }\n }\n\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n// List<Object> AdvData = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n// for (Object object : AdvData) {\n// Object[] data = (Object[]) object;\n// String term = data[1].toString();\n// double termamount = (Double) data[0];\n// if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n// taxableAmountAdv += (Double) data[2];\n// IGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n// taxableAmountAdv += (Double) data[2];\n// CGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n// SGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n// SGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n// CESSAmount += termamount;\n// }\n// }\n } else {\n /**\n * Get Advance for which invoice isLinked\n */\n reqParams.put(\"atadj\", true);\n List<Object> receiptList = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n JSONArray bulkData = gSTR1DeskeraServiceDao.createJsonForAdvanceDataFetchedFromDB(receiptList, reqParams);\n Map<String, JSONArray> advanceMap = AccountingManager.getSortedArrayMapBasedOnJSONAttribute(bulkData, GSTRConstants.receiptadvanceid);\n for (String advdetailkey : advanceMap.keySet()) {\n double rate = 0d;\n JSONArray adDetailArr = advanceMap.get(advdetailkey);\n JSONObject advanceobj = adDetailArr.getJSONObject(0);\n taxableAmountAdv += advanceobj.optDouble(GSTRConstants.adjustedamount);\n for (int index = 0; index < adDetailArr.length(); index++) {\n JSONObject invdetailObj = adDetailArr.getJSONObject(index);\n String defaultterm = invdetailObj.optString(GSTRConstants.defaultterm);\n\n /**\n * Iterate applied GST and put its Percentage and Amount\n * accordingly\n */\n double termamount = invdetailObj.optDouble(GSTRConstants.termamount);\n double taxrate = invdetailObj.optDouble(GSTRConstants.taxrate);\n /**\n * calculate tax amount by considering partial case\n */\n termamount = advanceobj.optDouble(GSTRConstants.adjustedamount) * invdetailObj.optDouble(GSTRConstants.taxrate) / 100;\n if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n IGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n CGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n }\n }\n }\n\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n// List<Object> AdvDataLinked = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n// for (Object object : AdvDataLinked) {\n// Object[] data = (Object[]) object;\n// String term = data[1].toString();\n// double termamount = (Double) data[0];\n// taxableAmountAdv = (Double) data[2];\n// if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n// taxableAmountAdv += (Double) data[2];\n// IGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n// taxableAmountAdv += (Double) data[2];\n// CGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n// SGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n// SGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n// CESSAmount += termamount;\n// }\n// }\n }\n\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountAdv,companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\", authHandler.formattedAmount(taxableAmountAdv+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n return jSONObject;\n }",
"public int getCustomInformationTransferRate();",
"public void anualTasks(){\n List<Unit> units = unitService.getUnits();\n for(Unit unit: units){\n double amount = 10000; //@TODO calculate amount based on unit type\n Payment payment = new Payment();\n payment.setPaymentMethod(PaymentMethod.Cash);\n Calendar calendar = Calendar.getInstance();\n calendar.set(Calendar.MONTH, 1);\n calendar.set(Calendar.DATE, 30);\n payment.setDate(LocalDate.now());\n TimeZone tz = calendar.getTimeZone();\n ZoneId zid = tz == null ? ZoneId.systemDefault() : tz.toZoneId();\n payment.setAmount(amount);\n payment.setDueDate(LocalDateTime.ofInstant(calendar.toInstant(), zid).toLocalDate());\n payment.setClient(unit.getOwner());\n payment.setUnit(unit);\n payment.setRecurringInterval(365L);\n payment.setStatus(PaymentStatus.Pending);\n paymentService.savePayment(payment);\n }\n }",
"public static void getOneNearbyRestaurant(final int period, String latitude, String longitude, final RouteMakerFragment.MyHandler handler) {\n Parameters parameters = new Parameters();\n parameters.add(\"lng\", longitude);\n parameters.add(\"lat\", latitude);\n parameters.add(\"radius\", 1000);\n Log.e(\"lng\",longitude);\n Log.e(\"lat\",latitude);\n JuheData.executeWithAPI(APIConstants.DIET_INFO_ID, APIConstants.DIET_INFO_IP, JuheData.GET, parameters, new DataCallBack() {\n @Override\n public void resultLoaded(int err, String reason, String result) {\n\n if (err == 0) {\n try {\n JSONObject object = new JSONObject(result);\n Log.e(\"reason2\",object.getString(\"reason\"));\n JSONArray list = object.getJSONArray(\"result\");\n JSONObject restaurant = list.getJSONObject(new Random().nextInt(list.length()));\n RouteData.dietTempInfo[period] = new RouteData.DietTemp(period,\n restaurant.getString(\"name\"),\n restaurant.getString(\"latitude\"),\n restaurant.getString(\"longitude\"),\n restaurant.getString(\"address\"),\n restaurant.getString(\"phone\"),\n restaurant.getString(\"photos\"),\n Integer.parseInt(restaurant.getString(\"very_good_remarks\").equals(\"\")?\"0\":restaurant.getString(\"very_good_remarks\")) + Integer.parseInt(restaurant.getString(\"good_remarks\").equals(\"\")?\"0\":restaurant.getString(\"good_remarks\")),\n Integer.parseInt(restaurant.getString(\"common_remarks\").equals(\"\")?\"0\":restaurant.getString(\"common_remarks\")),\n Integer.parseInt(restaurant.getString(\"bad_remarks\").equals(\"\")?\"0\":restaurant.getString(\"bad_remarks\")) + Integer.parseInt(restaurant.getString(\"very_bad_remarks\").equals(\"\")?\"0\":restaurant.getString(\"very_bad_remarks\")),\n new StringBuilder(restaurant.getString(\"recommended_dishes\")).append(restaurant.getString(\"recommended_products\").equals(\"\") || restaurant.getString(\"recommended_dishes\").equals(\"\") ? \"\" : \",\").append((restaurant.getString(\"recommended_products\"))).toString());\n Message m = new Message();\n Bundle b = new Bundle();\n b.putBoolean(\"minus\", true);\n b.putString(\"source\", \"spot\");\n m.setData(b);\n handler.handleMessage(m);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }\n });\n }",
"public double getCharges()\r\n {\r\n //variables\r\n double charges = 0.0;\r\n double parts = 0.0;\r\n double hours = 0.0;\r\n\r\n //get user input and change double\r\n parts = Double.parseDouble(chargeField.getText());\r\n hours = Double.parseDouble(hourField.getText());\r\n\r\n //math for charges\r\n charges = hours * LABOR_RATE + parts;\r\n return charges;\r\n }",
"public ResponseCurrencyConversionBo converCurrency() {\n\n ResponseCurrencyConversionBo responseCurrencyConversionBo = new ResponseCurrencyConversionBo();\n\n try {\n long startTime = System.nanoTime();\n HttpClient client = HttpClientBuilder.create().build();\n String url = myPropertiesReader.getPropertyValue(\"unitconvertersUrl\");\n url = MessageFormat.format(url, requestCurrencyConversionBo.getSourceCountryCurrency(),requestCurrencyConversionBo.getTargetCountryCurrency());\n HttpGet post = new HttpGet(url);\n\n HttpResponse response = client.execute(post);\n if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {\n\n BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));\n\n String finalResult = \"\";\n StringBuffer result = new StringBuffer();\n String line = \"\";\n while ((line = rd.readLine()) != null) {\n result.append(line);\n }\n\n finalResult = result.toString();\n log.info(finalResult);\n String currencyRate = finalResult.substring(finalResult.indexOf(\"<p class=\\\"bigtext\\\">\"),finalResult.lastIndexOf(\"<p class=\\\"bigtext\\\">\"));\n log.info(currencyRate);\n currencyRate = currencyRate.replace(\"<p class=\\\"bigtext\\\">\",\"\").replace(\"</p>\",\"\");\n log.info(currencyRate);\n String[] currencyRateSplitByBR = currencyRate.split(\"<br>\");\n log.info(currencyRateSplitByBR[0]);\n String finalCurrencyRate = currencyRateSplitByBR[0].split(\"=\")[1].replaceAll(\"[a-zA-Z]\", \"\").trim();\n log.info(finalCurrencyRate);\n responseCurrencyConversionBo.setCurrencyRate(finalCurrencyRate);\n }\n } catch (Exception e) {\n e.printStackTrace();\n log.error(e.getMessage());\n }\n\n return responseCurrencyConversionBo;\n }",
"public static void calculatePersistentCSMACD() {\n ArrayList <Integer> arrivalRate = new ArrayList<Integer>();\n arrivalRate.add(7);\n arrivalRate.add(10);\n arrivalRate.add(20);\n double transmissionTime;\n for (int rate: arrivalRate) {\n System.out.printf(\"The values for a persistent CSMACD simulation with packet arrival rate of %d. (Number of nodes, efficiency, throughput(bps), throughput(mbps) %n\", rate);\n //Set transmission time for TA simulation so it doesnt take too long, we checked to see if the results are within +/- 5% in our report\n for (int nodes = 20; nodes <= 100; nodes += 20) {\n if(nodes > 60 && rate >= 10 ){\n transmissionTime = 100;\n } else if (rate == 20) {\n transmissionTime = 100;\n } else{\n transmissionTime = 1000;\n }\n Persistent persistentCSMACD = new Persistent(nodes, rate, 1000000, 1500, 10, 200000000, transmissionTime);\n persistentCSMACD.initalizeNodes();\n persistentCSMACD.startSimulation();\n persistentCSMACD.calculateEfficiency();\n }\n }\n\n }",
"private void getCustomerData() {\r\n\t\t// get next customer data : from file or random number generator\r\n\t\t// set anyNewArrival and transactionTime\r\n\t\t// see readme file for more info\r\n\r\n\t\tif (dataSource == 1) { // file\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0/1 random or file input\r\n\t\t\t\t\tif (dataFile.hasNextInt()) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// checks for a line of information\r\n\t\t\t\t\t\tint data1 = dataFile.nextInt();\t\t\t\t\t\t\t\t\t\t\t\t\t\t// every line has 2 numbers of info\r\n\t\t\t\t\t\tint data2 = dataFile.nextInt();\r\n\t\t\t\t\t\tanyNewArrival \t= (((data1%100)+1)<= chancesOfArrival);\t\t// computes anyNewArrival boolean\r\n\t\t\t\t transactionTime = (data2%maxTransactionTime)+1;\t\t\t\t\t// computes transactionTime integer\r\n\t\t\t\t\t}\r\n\t\t} else { // random\r\n\t\t\tdataRandom = new Random();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// generates random boolean and int\r\n\t\t\tanyNewArrival \t= ((dataRandom.nextInt(100) + 1) <= chancesOfArrival);\r\n\t\t\ttransactionTime = dataRandom.nextInt(maxTransactionTime) + 1;\r\n\t\t}\r\n\t}",
"private boolean generateRate() {\n TSDBData rateObj;\n boolean result = false;\n\n if (Flag.getMeteringType().equalsIgnoreCase(\"static\")) {\n rateObj = generateStaticRate();\n } else {\n rateObj = generateDynamicRate();\n }\n if (rateObj.getPoints().size() > 0)\n result = saveRate(rateObj);\n return result;\n }",
"public DTOSalida obtenerAccesosPlantilla(DTOOID dto) throws MareException\n { \n UtilidadesLog.info(\"DAOGestionComisiones.obtenerAccesosPlantilla(DTOOID dto): Entrada\"); \n StringBuffer query = new StringBuffer();\n RecordSet rs = new RecordSet(); \n DTOSalida dtos = new DTOSalida();\n BelcorpService bs = UtilidadesEJB.getBelcorpService(); \n query.append(\" SELECT DISTINCT A.ACCE_OID_ACCE OID, B.VAL_I18N DESCRIPCION \");\n query.append(\" FROM COM_PLANT_COMIS_ACCES A, V_GEN_I18N_SICC B, COM_PLANT_COMIS C \"); \n query.append(\" WHERE \");\n if(dto.getOid() != null) {\n query.append(\" A.PLCO_OID_PLAN_COMI = \" + dto.getOid() + \" AND \");\n }\n query.append(\" A.PLCO_OID_PLAN_COMI = C.OID_PLAN_COMI AND \"); \n query.append(\" C.CEST_OID_ESTA = \" + ConstantesCOM.ESTADO_ACTIVO + \" AND \"); \n \n query.append(\" B.ATTR_ENTI = 'SEG_ACCES' AND \"); \n query.append(\" B.ATTR_NUM_ATRI = 1 AND \");\n query.append(\" B.IDIO_OID_IDIO = \" + dto.getOidIdioma() + \" AND \");\n query.append(\" B.VAL_OID = A.ACCE_OID_ACCE \");\n query.append(\" ORDER BY DESCRIPCION \"); \n UtilidadesLog.debug(query.toString()); \n try {\n rs = bs.dbService.executeStaticQuery(query.toString());\n if(rs != null)\n dtos.setResultado(rs);\n }catch (Exception e) {\n UtilidadesLog.error(e);\n throw new MareException(e, UtilidadesError.armarCodigoError(CodigosError.ERROR_DE_ACCESO_A_BASE_DE_DATOS));\n } \n UtilidadesLog.info(\"DAOGestionComisiones.obtenerAccesosPlantilla(DTOOID dto): Salida\"); \n return dtos;\n }",
"public JSONObject getInvoiceForGSTR3BNillRated(JSONObject reqParams) throws JSONException, ServiceException {\n String companyId=reqParams.optString(\"companyid\");\n double taxableAmountInv = 0d;\n double taxableAmountCN = 0d;\n double taxableAmountAdv = 0d;\n double taxableAmountAdvAdjusted = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n int count=0;\n JSONObject jSONObject = new JSONObject();\n reqParams.put(\"entitycolnum\", reqParams.optString(\"invoiceentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"invoiceentityValue\"));\n// reqParams.put(\"isGSTINnull\", false);\n reqParams.put(\"GST3B\", !reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false));\n reqParams.remove(\"zerorated\");\n List invoiceData = accEntityGstDao.getNillInvoiceDataWithDetailsInSql(reqParams);\n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n for (Object object : invoiceData) {\n Object[] data = (Object[]) object;\n taxableAmountInv = data[0] != null ? (Double) data[0] : 0;\n count = data[1] != null ? ((BigInteger) data[1]).intValue() : 0;\n }\n\n//\n// /**\n// * Get CN amount\n// */\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"cnentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"cnentityValue\"));\n// reqParams.put(\"isGSTINnull\", false);\n// reqParams.put(\"GST3B\", true);\n// List cnData = accEntityGstDao.getNillCNDNWithInvoiceDetailsInSql(reqParams);\n// if (!cnData.isEmpty() && cnData.get(0) != null) {\n// taxableAmountCN = (Double) cnData.get(0);\n// }\n//\n// /**\n// * Get Advance for which invoice not linked yet\n// */\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n// reqParams.put(\"isGSTINnull\", false);\n// reqParams.put(\"GST3B\", true);\n// reqParams.put(\"at\", true);\n// reqParams.remove(\"atadj\");\n// List AdvData = accEntityGstDao.getNillAdvanceDetailsInSql(reqParams);\n// if (!AdvData.isEmpty() && AdvData.get(0) != null) {\n// taxableAmountAdv = (Double) AdvData.get(0);\n// }\n// /**\n// * Get Advance for which invoice isLinked\n// */\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n// reqParams.put(\"isGSTINnull\", false);\n// reqParams.put(\"GST3B\", true);\n// reqParams.remove(\"at\");\n// reqParams.put(\"atadj\", true);\n// AdvData = accEntityGstDao.getNillAdvanceDetailsInSql(reqParams);\n// if (!AdvData.isEmpty() && AdvData.get(0) != null) {\n// taxableAmountAdvAdjusted = (Double) AdvData.get(0);\n// }\n jSONObject.put(\"count\", count);\n jSONObject.put(\"Nature of Supplies\", \"e) Non GST outward supplies\");\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountInv,companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\", authHandler.formattedAmount(taxableAmountInv,companyId));\n } else {\n jSONObject = accGSTReportService.getSalesInvoiceJSONArrayForGSTR3B(invoiceData, reqParams, companyId);\n }\n return jSONObject;\n }",
"public void getAllDataRelatedToMobility(HttpServletRequest req, HttpServletResponse resp,\n UserUcc userUcc, MobilityChoiceUcc mobilityChoiceUcc, OrganisationUcc organisationUcc,\n MobilityDocumentUcc mobilityDocumentUcc, MobilityUcc mobilityUcc,\n MobilityCancellationUcc mobilityCancellationUcc) {\n try {\n int currentUserId = (int) IhmUserServlet.getCurrentUser(req);\n UserDto currentUser = userUcc.findDto(currentUserId);\n\n /* User est connecté */\n if (currentUser != null) {\n Map<String, Object> data = new HashMap<>();\n\n /* Get the mobility choice */\n int idMobilityChoice = Integer.parseInt(req.getParameter(\"idMobility\"));\n MobilityChoiceDto mobilityChoiceDto = mobilityChoiceUcc.findDto(idMobilityChoice);\n data.put(\"mobilityChoice\", mobilityChoiceDto);\n\n /* Get the mobility */\n MobilityDto mobilityDto = mobilityUcc.findDto(idMobilityChoice);\n data.put(\"mobility\", mobilityDto);\n\n /* Get the student */\n if (currentUser.getTypeUser().equals(\"S\")) {\n data.put(\"user\", currentUser);\n } else {\n data.put(\"user\", userUcc.findDto(mobilityChoiceDto.getIdUser()));\n }\n\n /* Get the partner */\n if (mobilityChoiceDto.getPartner() != null && mobilityChoiceDto.getPartner() != 0) {\n data.put(\"org\", organisationUcc.findDto(mobilityChoiceDto.getPartner()));\n }\n\n /* Get the docs */\n List<MobilityDocumentDto> mobilityDocumentDtos =\n mobilityDocumentUcc.findAllDtosById(idMobilityChoice, \"idMobilityChoice\");\n data.put(\"docs\", mobilityDocumentDtos);\n\n\n /* Get the cancelation */\n data.put(\"cancelation\",\n mobilityCancellationUcc.findAllDtosById(idMobilityChoice, \"idMobilityChoice\"));\n\n String json = new Genson().serialize(data);\n resp.setContentType(\"application/json\");\n resp.getOutputStream().write(json.getBytes());\n\n }\n\n } catch (IOException exp) {\n exp.printStackTrace();\n } catch (InternalServerException exp1) {\n exp1.printStackTrace();\n } catch (IdNotFoundException exp2) {\n exp2.printStackTrace();\n } catch (TransactionErrorException exp3) {\n exp3.printStackTrace();\n }\n }",
"@Override\n public void calEscalator(String lineCode, Integer plateEscalatorNum,\n List<Integer> exportNumber, List<Integer> transferOutNumber,\n Double walkSpeed, Double plateformLength,\n Double upEscalatorWidth, Double floorWidth,\n String stationNameCode, PressureTimeTypeEnum pressureTimeTypeEnum) {\n\n List<PressureLevelResult> pressureLevelResultList = new ArrayList<>();\n\n for ( int i = 0; i < 8; i++ ) {\n\n Integer w = exportNumber.get(i);\n\n // 有换乘的加上换乘数据\n if ( transferOutNumber.size() > 0 )\n w += transferOutNumber.get(i);\n\n // 15min内,每组楼梯和扶梯服务的乘客数\n Integer q = w / plateEscalatorNum;\n // 输入时间\n Double t0 = plateformLength / ( 2 * plateEscalatorNum * walkSpeed );\n // 输入率\n Double lamda = 2 * w * walkSpeed / plateformLength;\n // 自动扶梯通过能力\n Double cEscalator = 2.25;\n // 楼梯通过能力\n Double cFloor = 0.89;\n\n // 排队系统输出率\n Double u = cEscalator * upEscalatorWidth / plateEscalatorNum + cFloor * floorWidth / plateEscalatorNum;\n\n // 输出时间\n Double t1 = w / ( plateEscalatorNum * u );\n\n // 最大排队乘客数Q = q1 - q0\n Double qMax = lamda * t0 - u * t0;\n\n // 排队中最大延误时间 ts\n Double ts = t1 - t0;\n\n // 平均排队乘客数Q\n Double qAvg = 0.5 * ( lamda - u ) * t0;\n\n // 排队乘客总的延误时间D\n\n Double result = qAvg * ts / 60;\n\n System.out.println( \"排队乘客总的延误时间D \" + result );\n\n\n PressureLevelResult pressureLevelResult = getPressureLevelResult(lineCode, stationNameCode,\n i, result, calEscalatorLevel( result ), PressureTypeEnum.Escalator,\n pressureTimeTypeEnum);\n\n pressureLevelResultList.add( pressureLevelResult );\n\n }\n\n// escalatorMap.put( \"line\" + lineCode, resultList );\n\n // 删除原来的 暂时从简\n savePressureResultData(lineCode, stationNameCode,\n pressureLevelResultList, PressureTypeEnum.Escalator, pressureTimeTypeEnum);\n\n }",
"private int syncEnergyData() throws IOException {\n\n // initialize some useful dates\n Calendar today = Calendar.getInstance();\n //today.add(Calendar.MINUTE, -15);\n Calendar year_ago = Calendar.getInstance();\n year_ago.add(Calendar.YEAR, -1);\n Calendar week_ago = Calendar.getInstance();\n week_ago.add(Calendar.MONTH, -1);\n Calendar day_ago = Calendar.getInstance();\n day_ago.add(Calendar.DATE, -1);\n\n\n String consumption_point = \"carleton_campus_en_use\";\n String production_point = \"carleton_wind_production\";\n\n //get the two live data points for first screen\n\n String quarter_hourly_consumption = readEnergyJSON(day_ago.getTime(), today.getTime(), \"quarterhour\", consumption_point);\n Log.i(\"quarter_hourly_consumption\", quarter_hourly_consumption);\n // update liveConsumption based on data from most recent complete 1/4 hour\n String[] consumption_list = quarter_hourly_consumption.split(\"[\\n|\\r]\");\n String recent_consumption_line = consumption_list[consumption_list.length - 2];\n liveConsumption = (Double.parseDouble(recent_consumption_line.substring(recent_consumption_line.indexOf(';') + 1, recent_consumption_line.length())));\n\n // quarter-hourly windmill1 production for past 24 hours\n String quarter_hourly_production1 = readEnergyJSON(day_ago.getTime(), today.getTime(), \"quarterhour\", production_point);\n // update liveProduction based on data from most recent complete 1/4 hour\n String[] production1_list = quarter_hourly_production1.split(\"[\\n|\\r]\");\n String recent_production1_line = production1_list[production1_list.length - 2];\n liveProduction1 = (Double.parseDouble(recent_production1_line.substring(recent_production1_line.indexOf(';') + 1, recent_production1_line.length())));\n\n // update values stored in sharedPref for next time app loads\n SharedPreferences sharedPref = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);\n SharedPreferences.Editor ed = sharedPref.edit();\n ed.putFloat(\"liveConsumption\", (float)liveConsumption);\n ed.putFloat(\"liveProduction1\", (float)liveProduction1);\n ed.commit();\n\n\n // get all the graph data and save in files\n String[] time_units = {\"day\", \"hour\", \"quarterhour\"};\n Date[] start_dates = {year_ago.getTime(), week_ago.getTime(), day_ago.getTime()};\n String[] points = {consumption_point, production_point};\n String[] dependent_variables = {\"consumption\", \"production1\"};\n\n for (int i = 0; i < time_units.length; i++) {\n String increment = time_units[i];\n Date start = start_dates[i];\n\n for (int j = 0; j < points.length; j++) {\n String data = readEnergyJSON(start, today.getTime(), increment, points[j]);\n\n try {\n DataOutputStream out = new DataOutputStream(\n context.openFileOutput(increment + \"_\" + dependent_variables[j] +\n \"_data\", Context.MODE_PRIVATE));\n out.writeUTF(data);\n out.close();\n } catch (IOException e) {\n Log.i(\"syncEnergyData\", \"I/O Error\");\n }\n }\n }\n return 0;\n }",
"public void generateBill(){\n System.out.println(\" Supermercado la 33 \");\n System.out.println(getName());\n System.out.println(getId());\n System.out.println(LocalDate.now() + \" -- \" +LocalTime.now());\n //System.out.println(\"Cantidad Denominacion nombre precio \");\n for (int i=0; i<bill.getProducts().size(); i++){\n Product temporal = bill.getProducts().get(i);\n System.out.println(temporal.getAvailableQuantity().getAmount() + \" \" + temporal.getAvailableQuantity().getProductDenomination() + \" \"\n + temporal.getName() + \" \" + temporal.getAvailableQuantity().getAmount() * temporal.getPrice());\n }\n System.out.println(\"Total : \" + bill.calculateTotal());\n System.out.println(\" Gracias por su compra vuelva pronto \");\n\n }",
"@Override\n\tpublic Double metricValue() {\n\t\tthis.totalSampleSize = (int) Math.min(MAX_FQURIS_PER_TLD, (Math.round((double) totalURIs * POPULATION_PERCENTAGE)));\n\t\tList<String> lstUrisToDeref = new ArrayList<String>(totalSampleSize);\t\n\n\t\t\n\t\tfor(Tld tld : this.tldsReservoir.getItems()){\n\t\t\t//Work out ratio for the number of maximum TLDs in Reservior\n//\t\t\tdouble totalRatio = ((double) tldCount.get(tld.getUri())) * POPULATION_PERCENTAGE; // ratio between the total number of URIs of a TLD in a dataset against the overall total number of URIs\n//\t\t\tdouble representativeRatio = totalRatio / ((double) totalURIs * POPULATION_PERCENTAGE); // the ratio of the URIs of a TLD against the population sample for all URIs in a dataset\n//\t\t\tlong maxRepresentativeSample = Math.round(representativeRatio * (double) MAX_FQURIS_PER_TLD); // how big should the final reservior for a TLD be wrt the representative ratio\n\t\t\t\n\t\t\tlong maxRepresentativeSample = Math.round(((double) this.totalSampleSize / (double) totalURIs) * ((double) tldCount.get(tld.getUri())));\n\t\t\t// Re-sample the sample to have the final representative sample\n\t\t\tif (maxRepresentativeSample > 0){\n\t\t\t\tReservoirSampler<String> _tmpRes = new ReservoirSampler<String>((int)maxRepresentativeSample, true);\n\t\t\t\n\t\t\t\tfor(String uri : tld.getfqUris().getItems()){\n\t\t\t\t\t_tmpRes.add(uri);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlstUrisToDeref.addAll(_tmpRes.getItems());\n\t\t\t}\n\t\t}\n\t\tdouble metricValue = 0.0;\n\t\t\n\t\tthis.totalNumberOfURIs = (lstUrisToDeref.size() + this.nonSemanticResources);\n\t\t\n\t\tthis.totalCorrectReportedTypes = this.checkForMisreportedContentType(lstUrisToDeref);\n\t\tmetricValue = (double)this.totalCorrectReportedTypes / this.totalNumberOfURIs;\n\t\t\n\t\treturn metricValue;\n\t}",
"public net.wit.webservice.TerminalServiceXmlServiceStub.DirectChargeResponse directCharge(\n\n net.wit.webservice.TerminalServiceXmlServiceStub.DirectCharge directCharge14)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[7].getName());\n _operationClient.getOptions().setAction(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml/TerminalServiceXml/directChargeRequest\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n directCharge14,\n optimizeContent(new javax.xml.namespace.QName(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml\",\n \"directCharge\")), new javax.xml.namespace.QName(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml\",\n \"directCharge\"));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n net.wit.webservice.TerminalServiceXmlServiceStub.DirectChargeResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (net.wit.webservice.TerminalServiceXmlServiceStub.DirectChargeResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"directCharge\"))){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"directCharge\"));\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class);\n java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage());\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"directCharge\"));\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n if (_messageContext.getTransportOut() != null) {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }\n }",
"public static String createCharge(Request request, Response response) {\n Stripe.apiKey = \"sk_test_nKon8YMF1HyqAvNgvFpFHGbi\";\n CardChargeMakerParams cm = JsonUtil.getInstance().fromJson(request.body(), CardChargeMakerParams.class);\n\n // Get charge meta information\n String token = cm.getId();\n EntityManager em = DatabaseManager.getInstance().getEntityManager();\n TableSession session = em\n .find(TableSession.class, request.session().attribute(\"TableSessionKey\"));\n Transaction transaction = getCurrentTransaction(session.getRestaurantTable());\n int total = (int) (transaction.getTotal() * 100);\n\n // Create params\n Map<String, Object> params = new HashMap<>();\n params.put(\"amount\", total);\n params.put(\"currency\", \"gbp\");\n params.put(\"description\", \"Your meal at Oaxaca\");\n params.put(\"source\", token);\n\n try {\n // Charge customer card\n Charge charge = Charge.create(params);\n // Change status in database\n em.getTransaction().begin();\n\n Transaction temp = em.find(Transaction.class, transaction.getTransactionId());\n\n temp.setDatetimePaid(new Timestamp(System.currentTimeMillis()));\n temp.setIsPaid(true);\n session.getRestaurantTable().setStatus(TableStatus.NEEDS_CLEANING);\n em.getTransaction().commit();\n NotificationEndpoint.startNotificationService(temp);\n return \"success\";\n } catch (AuthenticationException | InvalidRequestException | CardException | APIConnectionException | APIException e) {\n e.printStackTrace();\n return \"failure\";\n } finally {\n em.close();\n }\n }",
"protected Totals extractRegularPaymentsForChart(String campusCode, Person puser, Date processRunDate, Batch batch) {\r\n LOG.debug(\"START - extractRegularPaymentsForChart()\");\r\n\r\n Totals totals = new Totals();\r\n\r\n java.sql.Date onOrBeforePaymentRequestPayDate = KfsDateUtils.convertToSqlDate(purapRunDateService.calculateRunDate(processRunDate));\r\n\r\n List<String> preqsWithOutstandingCreditMemos = new ArrayList<String>();\r\n\r\n Set<VendorGroupingHelper> vendors = creditMemoService.getVendorsOnCreditMemosToExtract(campusCode);\r\n for (VendorGroupingHelper vendor : vendors) {\r\n if (LOG.isDebugEnabled()) {\r\n LOG.debug(\"Processing Vendor: \" + vendor);\r\n }\r\n\r\n Map<String, List<PaymentRequestDocument>> bankCodePaymentRequests = new HashMap<String, List<PaymentRequestDocument>>();\r\n Map<String, List<VendorCreditMemoDocument>> bankCodeCreditMemos = new HashMap<String, List<VendorCreditMemoDocument>>();\r\n\r\n // Get all the matching credit memos\r\n Collection<VendorCreditMemoDocument> vendorMemos = creditMemoService.getCreditMemosToExtractByVendor(campusCode, vendor);\r\n for (VendorCreditMemoDocument cmd : vendorMemos) {\r\n List<VendorCreditMemoDocument> bankMemos = new ArrayList<VendorCreditMemoDocument>();\r\n if (bankCodeCreditMemos.containsKey(cmd.getBankCode())) {\r\n bankMemos = bankCodeCreditMemos.get(cmd.getBankCode());\r\n }\r\n\r\n bankMemos.add(cmd);\r\n bankCodeCreditMemos.put(cmd.getBankCode(), bankMemos);\r\n }\r\n\r\n // get all matching payment requests\r\n Collection<PaymentRequestDocument> vendorPreqs = paymentRequestService.getPaymentRequestsToExtractByVendor(campusCode, vendor, onOrBeforePaymentRequestPayDate);\r\n for (PaymentRequestDocument prd : vendorPreqs) {\r\n List<PaymentRequestDocument> bankPreqs = new ArrayList<PaymentRequestDocument>();\r\n if (bankCodePaymentRequests.containsKey(prd.getBankCode())) {\r\n bankPreqs = bankCodePaymentRequests.get(prd.getBankCode());\r\n }\r\n\r\n bankPreqs.add(prd);\r\n bankCodePaymentRequests.put(prd.getBankCode(), bankPreqs);\r\n }\r\n\r\n // if bank functionality enabled, create bundles by bank, else just by vendor\r\n if (bankService.isBankSpecificationEnabled()) {\r\n for (String bankCode : bankCodePaymentRequests.keySet()) {\r\n // if we have credit memos with bank code, process together, else let the preq go and will get picked up below\r\n // and processed as a single payment group\r\n if (bankCodeCreditMemos.containsKey(bankCode)) {\r\n processPaymentBundle(bankCodePaymentRequests.get(bankCode), bankCodeCreditMemos.get(bankCode), totals, preqsWithOutstandingCreditMemos, puser, processRunDate, batch);\r\n }\r\n }\r\n } else {\r\n if (vendorMemos.isEmpty()) {\r\n processPaymentBundle((List<PaymentRequestDocument>) vendorPreqs, (List<VendorCreditMemoDocument>) vendorMemos, totals, preqsWithOutstandingCreditMemos, puser, processRunDate, batch);\r\n }\r\n }\r\n }\r\n\r\n LOG.debug(\"processing PREQs without CMs\");\r\n\r\n Iterator<PaymentRequestDocument> paymentRequests = paymentRequestService.getPaymentRequestToExtractByChart(campusCode, onOrBeforePaymentRequestPayDate).iterator();\r\n while (paymentRequests.hasNext()) {\r\n PaymentRequestDocument prd = paymentRequests.next();\r\n // if in the list created above, don't create the payment group\r\n if (!preqsWithOutstandingCreditMemos.contains(prd.getDocumentNumber())) {\r\n PaymentGroup paymentGroup = processSinglePaymentRequestDocument(prd, batch, puser, processRunDate);\r\n\r\n totals.count = totals.count + paymentGroup.getPaymentDetails().size();\r\n totals.totalAmount = totals.totalAmount.add(paymentGroup.getNetPaymentAmount());\r\n }\r\n }\r\n\r\n\r\n LOG.debug(\"END - extractRegularPaymentsForChart()\");\r\n return totals;\r\n }",
"public int getChargeRate();",
"private void calculateRates() {\n if (rateOutput == null || !outputs.containsKey(rateOutput)) throw new RuntimeException(\"Insufficient data to calculate recipe rates\");\n recipesPerMinute = productionRate / outputs.get(rateOutput);\n\n for (String resource : inputs.keySet()) {\n ratesPerMinute.put(resource,-1.0 * recipesPerMinute * inputs.get(resource));\n }\n for (String resource: outputs.keySet()) {\n ratesPerMinute.put(resource, recipesPerMinute * outputs.get(resource));\n }\n }",
"public static void generatereports(){\r\n\t\t\r\n\t\tAccount a = (Account) Cache.get(\"authUser\");\r\n\t\t\r\n\t\tDealer d = Dealer.find(\"byDealershipId\", a.uniquenumber).first();\r\n\t\tif(a!= null)\r\n\t\t{\r\n\t\t\t/*\r\n\t\t\t * Get the list of orders placed for this dealer\r\n\t\t\t *Classify it as Total Confirmed \r\n\t\t\t *Total Delivered and so on \r\n\t\t\t *\r\n\t\t\t */\r\n\t\t\tList<OrderCylinder> totalorders = OrderCylinder.find(\"byDealerId\",d).fetch();\r\n\t\t\t//List<OrderCylinder> confirmorders = OrderCylinder.f\r\n\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tDealerControllerMap.pleaselogin();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"public JSONObject getInvoiceForGSTR3BZeroRated(JSONObject reqParams) throws JSONException, ServiceException {\n /**\n * Get Invoice total sum\n */\n String companyId=reqParams.optString(\"companyid\");\n reqParams.put(\"entitycolnum\", reqParams.optString(\"invoiceentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"invoiceentityValue\"));\n JSONObject jSONObject = new JSONObject();\n List<Object> invoiceData = accEntityGstDao.getInvoiceDataWithDetailsInSql(reqParams);\n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n double taxableAmountInv = 0d;\n double taxableAmountCN = 0d;\n double taxableAmountAdv = 0d;\n double taxableAmountAdvAdjusted = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n for (Object object : invoiceData) {\n Object[] data = (Object[]) object;\n// String term = data[1]!=null?data[1].toString():\"\";\n// double termamount = data[0]!=null?(Double) data[0]:0;\n taxableAmountInv = data[2]!=null?(Double) data[2]:0;\n }\n\n// /**\n// * Get CN amount\n// */\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"cnentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"cnentityValue\"));\n// reqParams.put(\"isGSTINnull\", false);\n// reqParams.put(\"GST3B\", true);\n// List<Object> cnData = accEntityGstDao.getCNDNWithInvoiceDetailsInSql(reqParams);\n// for (Object object : cnData) {\n// Object[] data = (Object[]) object;\n// String term = data[1].toString();\n// double termamount = (Double) data[0];\n// taxableAmountCN = (Double) data[2];\n// }\n//\n// /**\n// * Get Advance for which idx not linked yet\n// */\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n// reqParams.put(\"isGSTINnull\", false);\n// reqParams.put(\"GST3B\", true);\n// reqParams.put(\"at\", true);\n// reqParams.remove(\"atadj\");\n// List<Object> AdvData = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n// for (Object object : AdvData) {\n// Object[] data = (Object[]) object;\n// String term = data[1].toString();\n// double termamount = (Double) data[0];\n// taxableAmountAdv = (Double) data[2];\n//\n// }\n// /**\n// * Get Advance for which invoice isLinked\n// */\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n// reqParams.put(\"isGSTINnull\", false);\n// reqParams.put(\"GST3B\", true);\n// reqParams.remove(\"at\");\n// reqParams.put(\"atadj\", true);\n// AdvData = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n// for (Object object : AdvData) {\n// Object[] data = (Object[]) object;\n// String term = data[1].toString();\n// double termamount = (Double) data[0];\n// taxableAmountAdvAdjusted = (Double) data[2];\n//\n// }\n jSONObject.put(\"Nature of Supplies\", \"b) Outward taxable supplies (zero rated)\");\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountInv,companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\", authHandler.formattedAmount(taxableAmountInv,companyId));\n } else {\n jSONObject = accGSTReportService.getSalesInvoiceJSONArrayForGSTR3B(invoiceData, reqParams, companyId);\n }\n return jSONObject;\n }",
"@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic User requestVehicleACControl(long userId, String ACfeatureType, String ACStatus, String ACtemp,\n\t\t\tString ACFanSpeed, String rearACTemp) {\n\t\tdatasource = getDataSource();\n\t\tjdbcTemplate = new JdbcTemplate(datasource);\n\t\tlogger.info(\"IN requestVehicleACControl \");\n\t\tUser user = new User();\n\t\t// Check if head Unit is registered with given userID\n\t\tString check_query = \"select count(1) from headunit where user_id = ?\";\n\n\t\tint result = jdbcTemplate.queryForObject(check_query, new Object[] { userId }, Integer.class);\n\n\t\tif (result > 0) {\n\t\t\t// check if record exists for userID\n\t\t\t// get GCM key\n\t\t\tString gcm_key_query = \"select gcmregistartionkey from headunit where user_id = ?\";\n\n\t\t\tString query_result = (String) jdbcTemplate.queryForObject(gcm_key_query, new Object[] { userId },\n\t\t\t\t\tString.class);\n\n\t\t\tSystem.out.println(\"GCM KEY ============================= \" + query_result);\n\t\t\t// if GCM key available\n\t\t\t// preapre message\n\t\t\tif (query_result != null && !query_result.isEmpty()) {\n\t\t\t\tSender sender = new Sender(utilityObj.getGcmApiKeySimuapp());\n\t\t\t\t// build message based on featureType and featurestatus\n\t\t\t\tJSONObject obj = new JSONObject();\n\t\t\t\tobj.put(\"featuretype\", ACfeatureType);\n\t\t\t\tobj.put(\"featurestatus\", ACStatus);\n\t\t\t\tobj.put(\"actemp\", ACtemp);\n\t\t\t\tobj.put(\"acfanspeed\", ACFanSpeed);\n\t\t\t\tobj.put(\"rearactemp\", rearACTemp);\n\t\t\t\tString prepare_msg = obj.toJSONString();\n\t\t\t\tgcm_message = new Message.Builder().timeToLive(30).delayWhileIdle(true)\n\t\t\t\t\t\t.addData(MESSAGE_KEY, prepare_msg).build();\n\t\t\t\tResult gcm_result = null;\n\t\t\t\t// get gcm_message and gcm_register key\n\t\t\t\t// send message to that gcm_register_key\n\t\t\t\t// set message and status\n\t\t\t\ttry {\n\t\t\t\t\tgcm_result = sender.send(gcm_message, query_result, 1);\n\t\t\t\t\tlogger.info(\" IN REQUEST VEHICLE AC CONTROL SERVICE GCM REASULT : \" + gcm_result.toString());\n\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tuser.setUserid(userId);\n\t\t\t\tuser.setFeaturetype(ACfeatureType);\n\t\t\t\tuser.setFeaturestatus(ACStatus);\n\t\t\t\tuser.setStatus(true);\n\t\t\t\tuser.setMessage(prepare_msg);\n\t\t\t\tuser.setActemp(ACtemp);\n\t\t\t\tuser.setAcfanspeed(ACFanSpeed);\n\t\t\t\tuser.setRearactemp(rearACTemp);\n\t\t\t\tuser.setGcmregistartionkey(query_result);\n\t\t\t} else {\n\t\t\t\tuser.setMessage(\"NO GCM KEY FOUND\");\n\t\t\t}\n\t\t} else {\n\t\t\t// if head unit registered\n\t\t\t// set meassage and status\n\t\t\tuser.setStatus(false);\n\t\t\tuser.setMessage(\"NO HEAD UNIT REGISTERED FOR GIVEN USERID : \" + userId);\n\t\t\tlogger.info(\"NO HEAD UNIT REGISTERED FOR GIVEN USERID : \" + userId);\n\t\t}\n\t\treturn user;\n\t}",
"public JSONObject getCNForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n String companyId=reqParams.optString(\"companyid\");\n JSONObject jSONObject = new JSONObject();\n double taxableAmountCN = 0d;\n double totalAmountCN = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n\n /**\n * Get CN amount\n */\n reqParams.put(\"entitycolnum\", reqParams.optString(\"cnentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"cnentityValue\"));\n List<Object> cnData = accEntityGstDao.getCNDNWithInvoiceDetailsInSql(reqParams);\n List<Object> cnWithoutInventory = accEntityGstDao.getCNAgainstCustomer(reqParams);\n if (cnWithoutInventory != null && !cnWithoutInventory.isEmpty()) {\n cnData.addAll(cnWithoutInventory);\n }\n /**\n * Add data for Cash Sales refund \n */\n reqParams.put(\"entitycolnum\", reqParams.optString(\"paymententitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"paymententityValue\"));\n List<Object> refundlist = accEntityGstDao.getCashRefundWithInvoiceDetailsInSql(reqParams);\n if (refundlist != null && refundlist.size() > 0) {\n cnData.addAll(refundlist);\n } \n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n for (Object object : cnData) {\n Object[] data = (Object[]) object;\n String term = data[1] != null ? data[1].toString() : \"\";\n double termamount = data[0] != null ? (Double) data[0] : 0;\n\n totalAmountCN = (Double) data[3];\n if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n IGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n CGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n } else if (StringUtil.isNullOrEmpty(term)) {\n taxableAmountCN += data[2] != null ? (Double) data[2] : 0;\n }\n }\n\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountCN,companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\",authHandler.formattedAmount(taxableAmountCN+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n } else {\n jSONObject = accGSTReportService.getCreditNoteJSONArrayForGSTR3B(cnData, reqParams, companyId);\n }\n return jSONObject;\n }",
"public static void nonPersistentCSMACD() {\n ArrayList <Integer> arrivalRate = new ArrayList<Integer>();\n arrivalRate.add(7);\n arrivalRate.add(10);\n arrivalRate.add(20);\n double transmissionTime;\n for (int rate: arrivalRate) {\n System.out.printf(\"The values for a non-persistent CSMACD simulation with packet arrival rate of %d. (Number of nodes, efficiency, throughput(bps), throughput(mbps) %n\", rate);\n for (int nodes = 20; nodes <= 100; nodes += 20) {\n //Set transmission time for TA simulation so it doesnt take too long, we checked to see if the results are within +/- 5% in our report\n if(nodes > 60 && rate >= 10 ){\n transmissionTime = 100;\n } else if (rate == 20) {\n transmissionTime = 100;\n } else{\n transmissionTime = 1000;\n }\n NonPersistent NonPersistentCSMACD = new NonPersistent(nodes, rate, 1000000, 1500, 10, 200000000, transmissionTime);\n NonPersistentCSMACD.initalizeNodes();\n NonPersistentCSMACD.startSimulation();\n NonPersistentCSMACD.calculateEfficiency();\n }\n }\n\n }",
"public void generateCost() throws StandardException {\n\n double baseTableSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.BASE);\n double filterBaseTableSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.BASE,QualifierPhase.FILTER_BASE);\n double projectionSelectivity = computePhaseSelectivity(selectivityHolder,QualifierPhase.FILTER_PROJECTION);\n double totalSelectivity = computeTotalSelectivity(selectivityHolder);\n\n assert filterBaseTableSelectivity >= 0 && filterBaseTableSelectivity <= 1.0:\"filterBaseTableSelectivity Out of Bounds -> \" + filterBaseTableSelectivity;\n assert baseTableSelectivity >= 0 && baseTableSelectivity <= 1.0:\"baseTableSelectivity Out of Bounds -> \" + baseTableSelectivity;\n assert projectionSelectivity >= 0 && projectionSelectivity <= 1.0:\"projectionSelectivity Out of Bounds -> \" + projectionSelectivity;\n assert totalSelectivity >= 0 && totalSelectivity <= 1.0:\"totalSelectivity Out of Bounds -> \" + totalSelectivity;\n\n // Total Row Count from the Base Conglomerate\n double totalRowCount = scc.baseRowCount();\n assert totalRowCount >= 0 : \"totalRowCount cannot be negative -> \" + totalRowCount;\n // Rows Returned is always the totalSelectivity (Conglomerate Independent)\n scanCost.setEstimatedRowCount(Math.round(totalRowCount*totalSelectivity));\n\n double baseTableAverageRowWidth = scc.getBaseTableAvgRowWidth();\n double baseTableColumnSizeFactor = scc.baseTableColumnSizeFactor(totalColumns);\n\n // We use the base table so the estimated heap size and remote cost are the same for all conglomerates\n double colSizeFactor = baseTableAverageRowWidth*baseTableColumnSizeFactor;\n assert baseTableAverageRowWidth >= 0 : \"baseTableAverageRowWidth cannot be negative -> \" + baseTableAverageRowWidth;\n assert baseTableColumnSizeFactor >= 0 : \"baseTableColumnSizeFactor cannot be negative -> \" + baseTableColumnSizeFactor;\n\n double openLatency = scc.getOpenLatency();\n double closeLatency = scc.getCloseLatency();\n double localLatency = scc.getLocalLatency();\n double remoteLatency = scc.getRemoteLatency();\n double remoteCost = openLatency + closeLatency + totalRowCount*totalSelectivity*remoteLatency*(1+colSizeFactor/100d);\n assert openLatency >= 0 : \"openLatency cannot be negative -> \" + openLatency;\n assert closeLatency >= 0 : \"closeLatency cannot be negative -> \" + closeLatency;\n assert localLatency >= 0 : \"localLatency cannot be negative -> \" + localLatency;\n assert remoteLatency >= 0 : \"remoteLatency cannot be negative -> \" + remoteLatency;\n assert remoteCost >= 0 : \"remoteCost cannot be negative -> \" + remoteCost;\n // Heap Size is the avg row width of the columns for the base table*total rows\n // Average Row Width\n // This should be the same for every conglomerate path\n scanCost.setEstimatedHeapSize((long)(totalRowCount*totalSelectivity*colSizeFactor));\n // Should be the same for each conglomerate\n scanCost.setRemoteCost((long)remoteCost);\n // Base Cost + LookupCost + Projection Cost\n double congAverageWidth = scc.getConglomerateAvgRowWidth();\n double baseCost = openLatency+closeLatency+(totalRowCount*baseTableSelectivity*localLatency*(1+congAverageWidth/100d));\n assert congAverageWidth >= 0 : \"congAverageWidth cannot be negative -> \" + congAverageWidth;\n assert baseCost >= 0 : \"baseCost cannot be negative -> \" + baseCost;\n scanCost.setFromBaseTableRows(filterBaseTableSelectivity * totalRowCount);\n scanCost.setFromBaseTableCost(baseCost);\n double lookupCost;\n if (lookupColumns == null)\n lookupCost = 0.0d;\n else {\n lookupCost = totalRowCount*filterBaseTableSelectivity*(openLatency+closeLatency);\n scanCost.setIndexLookupRows(filterBaseTableSelectivity*totalRowCount);\n scanCost.setIndexLookupCost(lookupCost+baseCost);\n }\n assert lookupCost >= 0 : \"lookupCost cannot be negative -> \" + lookupCost;\n\n double projectionCost;\n if (projectionSelectivity == 1.0d)\n projectionCost = 0.0d;\n else {\n projectionCost = totalRowCount * filterBaseTableSelectivity * localLatency * colSizeFactor*1d/1000d;\n scanCost.setProjectionRows(scanCost.getEstimatedRowCount());\n scanCost.setProjectionCost(lookupCost+baseCost+projectionCost);\n }\n assert projectionCost >= 0 : \"projectionCost cannot be negative -> \" + projectionCost;\n\n double localCost = baseCost+lookupCost+projectionCost;\n assert localCost >= 0 : \"localCost cannot be negative -> \" + localCost;\n scanCost.setLocalCost(localCost);\n scanCost.setNumPartitions(scc.getNumPartitions());\n scanCost.setLocalCostPerPartition((baseCost + lookupCost + projectionCost)/scc.getNumPartitions());\n }",
"public void generateReportPluviometer() {\r\n\t\tReportsController reportsController = ControladorContexto\r\n\t\t\t\t.getContextBean(ReportsController.class);\r\n\t\ttry {\r\n\t\t\tconsultPluviometer();\r\n\t\t\treportsController.generateReportPluviometer(pluviometerPojoList,\r\n\t\t\t\t\tyear);\r\n\t\t\tsetStartDateReport(null);\r\n\t\t\tsetEndDateReport(null);\r\n\t\t} catch (Exception e) {\r\n\t\t\tControladorContexto.mensajeError(e);\r\n\t\t}\r\n\t}",
"public void trips(Object vehiclenum, Object startdate, Object enddate)\n\t\t\tthrows InterruptedException, ParseException, IOException, java.text.ParseException {\n\t\tdriver.findElementById(\"com.affluencesystems.admin:id/sp_selection\").click();\n\t\tdriver.findElementByXPath(\"//*[@text='Custom']\").click();\n\t\tdriver.findElementById(\"com.affluencesystems.admin:id/start_date_layout\").click();\n\t\tkeywords.setAndroidTripDatePicker(startdate);\n\t\tdriver.findElementById(\"com.affluencesystems.admin:id/end_date_layout\").click();\n\t\tkeywords.setAndroidTripDatePicker(enddate);\n\n\t\t// API Call\n\n\t\theaders.add(\"Authorization\",\n\t\t\t\t\"eyJraWQiOiJ3ZEJYOHZpbEVSanZEQ291MStsMEUwNG0zT3BOb2FaMml6UXZobkNKZHJBPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI1YTQ4ODhkOS1mZjlmLTQwNmQtYWYyOC1iYzEwZWVmOWVkOGUiLCJhdWQiOiI3aW5lZ3ZrOXNnYXI0MzY0ZXU4M3FkcjRlbSIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwiZXZlbnRfaWQiOiI0OWU5MjAxNC0xOGRiLTRhZjktYWU4My04MTc1NGVmM2M1NTciLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTYwODAxNDM2NSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLmFwLXNvdXRoLTEuYW1hem9uYXdzLmNvbVwvYXAtc291dGgtMV9PWEZkdlc3b08iLCJjb2duaXRvOnVzZXJuYW1lIjoiNWE0ODg4ZDktZmY5Zi00MDZkLWFmMjgtYmMxMGVlZjllZDhlIiwicGhvbmVfbnVtYmVyIjoiKzkxNzAzNjQ3ODI4MiIsImV4cCI6MTYwODAxNzk2NSwiaWF0IjoxNjA4MDE0MzY1LCJlbWFpbCI6IkluZm85ODc2QGdtYWlsLmNvbSJ9.IivlQcE7HkDYD5Fy-3fGdxnjE1K01KAyxbooRlG-BsBkTllVhzeWpqHIdUyPIes-pf8kvcCBJjkOe9mlzbq-grkXs_Acje5De94mK2dW7UWymOPMSNSy3ERc4l0a02wqLXaVErw06TVKk_Cg3Bhl6DH1J-H8CsHlMKwTlyLRbw3XqwPnAS_G9HJJac6UjXWvt964_7BoyPWJ0ImeKZcSyOaKqEV6i4hkhXJUQ8vX8o4zAhzfq3kdJmHTznCT2xZFapU9DTNXLyXfVbCCAxmIwz74LW1A_SNXNw4EPCU3bHK-yG0Gpsduv0JtEzAPdlHBS1kDQnHm_tRopvCn3Cna0g\");\n\t\theaders.add(\"userToken\", \"ZWkyNTRmYWR9NWliYn1hYTUxfTFhaGZ9ZDQ2MWMyYjI0Y2Np\");\n\t\tHttpEntity<String> entity = new HttpEntity<String>(headers);\n\t\tContents VehicleTrips = null;\n\n\t\ttry {\n\t\t\tVehicleTrips = template.exchange(\"http://apptest.myintelligo.com:8003/vehicletrips/gettriplistbyimeinumber/\"\n\t\t\t\t\t+ keywords.getVehicleImeinumber(vehiclenum) + \"/\" + keywords.getEpoachDate(startdate) + \"/\"\n\t\t\t\t\t+ keywords.getEpoachDate(enddate) + \"\", HttpMethod.GET, entity, Contents.class).getBody();\n\t\t} catch (Exception e) {\n\t\t\te.getStackTrace();\n\t\t}\n\n\t\tList<VehicleTripBean> vehicle = VehicleTrips.getContent();\n\t\tif (!(vehicle.size() == 0)) {\n\n\t\t\tfor (int i = 0; i < vehicle.size(); i++) {\n\t\t\t\tObject tripname = vehicle.get(i).getTripName();\n\t\t\t\tdriver.findElement(MobileBy.AndroidUIAutomator(\n\t\t\t\t\t\t\"new UiScrollable(new UiSelector().className(\\\"androidx.recyclerview.widget.RecyclerView\\\")).getChildByText(new UiSelector().className(\\\"android.widget.TextView\\\"),\\\"\"\n\t\t\t\t\t\t\t\t+ tripname + \"\\\")\"));\n\t\t\t\tdriver.findElementByXPath(\"//*[@text='\" + tripname + \"']\").click();\n\t\t\t\tThread.sleep(2000);\n\n\t\t\t\t// distance\n\n\t\t\t\tString distance2 = driver.findElementById(\"com.affluencesystems.admin:id/distance\").getText();\n\t\t\t\tString distance3 = (String) distance2.substring(0, distance2.length() - 3);\n\n\t\t\t\tString distance1 = FormatChanger.format(vehicle.get(i).getDistanceTravel() / 1000.0).toString();\n\t\t\t\tif (!(distance1.equals(\"0.0\"))) {\n\t\t\t\t\tSystem.out.println(distance1 + distance3);\n\t\t\t\t\tif (distance1.equals(distance3)) {\n\t\t\t\t\t\tSystem.out.println(\"distance is equal\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println(\"distance is not equal\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tString[] d = distance1.split(\".\");\n\t\t\t\t\tif (d[0].equals(distance3)) {\n\t\t\t\t\t\tSystem.out.println(\"distance is equal\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println(\"distance is not equal\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// time\n\t\t\t\tString time1 = driver.findElementById(\"com.affluencesystems.admin:id/time\").getText();\n\t\t\t\tint time = Math.round(vehicle.get(i).getTimeDuration());\n\t\t\t\tif (!(String.valueOf(time).equals(\"0\"))) {\n\t\t\t\t\tDate date = new Date(time * 1000);\n\t\t\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\t\t\tsdf.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n\t\t\t\t\tString formattedDate = sdf.format(date);\n\t\t\t\t\tSystem.out.println(formattedDate);\n\t\t\t\t\tif (time1.equals(formattedDate)) {\n\t\t\t\t\t\tSystem.out.println(\"Time is equal\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println(\"Time is not equal\");\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tString t = String.valueOf(time);\n\t\t\t\t\tt = \"00:00:00\";\n\t\t\t\t\tif (time1.equals(t)) {\n\t\t\t\t\t\tSystem.out.println(\"Time is equal\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println(\"Time is not equal\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// fuel\n\n\t\t\t\tString fuel2 = driver.findElementById(\"com.affluencesystems.admin:id/fuel\").getText();\n\t\t\t\tString fuel3 = (String) fuel2.substring(0, fuel2.length() - 2);\n\n\t\t\t\tString fuel1 = FormatChanger.format(vehicle.get(i).getFuelConsumed() / 1000.0).toString();\n\t\t\t\tSystem.out.println(fuel1 + fuel3);\n\t\t\t\tif (fuel1.equals(fuel3)) {\n\t\t\t\t\tSystem.out.println(\"fuel is equal\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"fuel is not equal\");\n\t\t\t\t}\n\n\t\t\t\t// mileage\n\t\t\t\tString mileage1 = driver.findElementById(\"com.affluencesystems.admin:id/mileage\").getText();\n\t\t\t\tString mileage2 = (String) mileage1.substring(0, mileage1.length() - 5);\n\t\t\t\tfloat dist1 = Float.valueOf(distance3);\n\t\t\t\tfloat fuel4 = Float.valueOf(fuel3);\n\t\t\t\tif (!(fuel3.equals(\"0\"))) {\n\t\t\t\t\tString mileage3 = FormatChanger.format(dist1 / fuel4).toString();\n\t\t\t\t\tSystem.out.println(mileage2 + mileage3);\n\t\t\t\t\tif (mileage2.equals(mileage3)) {\n\t\t\t\t\t\tSystem.out.println(\"mileage is equal\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println(\"mileage is not equal\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tString m = \"0\";\n\t\t\t\t\tif (mileage2.equals(m)) {\n\t\t\t\t\t\tSystem.out.println(\"mileage is equal\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println(\"mileage is not equal\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdriver.findElementById(\"com.affluencesystems.admin:id/dismiss\").click();\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"No Trips are there\");\n\t\t}\n\t}",
"private void fetchRatesData() {\r\n RequesterBean requesterBean = new RequesterBean();\r\n requesterBean.setFunctionType(GET_RATE_DATA);\r\n requesterBean.setDataObject(instituteRatesBean);\r\n \r\n AppletServletCommunicator appletServletCommunicator = new \r\n AppletServletCommunicator(CONNECTION_STRING, requesterBean);\r\n appletServletCommunicator.setRequest(requesterBean);\r\n appletServletCommunicator.send();\r\n ResponderBean responderBean = appletServletCommunicator.getResponse();\r\n \r\n if(responderBean == null) {\r\n //Could not contact server.\r\n CoeusOptionPane.showErrorDialog(COULD_NOT_CONTACT_SERVER);\r\n return;\r\n }\r\n \r\n if(responderBean.isSuccessfulResponse()) {\r\n Hashtable ratesData = (Hashtable)responderBean.getDataObject();\r\n hasMaintainCodeTablesRt = ((Boolean)ratesData.get(\"HAS_OSP_RIGHT\")).booleanValue();\r\n if( hasMaintainCodeTablesRt ){\r\n setFunctionType(TypeConstants.MODIFY_MODE);\r\n }else {\r\n setFunctionType(TypeConstants.DISPLAY_MODE);\r\n }\r\n //queryKey = RATES + ratesData.get(\"PARENT_UNIT_NUMBER\").toString();\r\n\r\n //Set title\r\n dlgRates.setTitle(RATES + \" for Unit \" + instituteRatesBean.getUnitNumber());\r\n queryEngine.addDataCollection(queryKey, ratesData);\r\n\r\n }else {\r\n //Server Error\r\n CoeusOptionPane.showErrorDialog(responderBean.getMessage());\r\n return;\r\n }\r\n }",
"public DataUsage getusageData(int uid)\n {\n Calendar calendar=Calendar.getInstance();\n long to=calendar.getTimeInMillis();\n calendar.add(Calendar.DAY_OF_MONTH,-30);\n long from=calendar.getTimeInMillis();\n\n double total=0;\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {\n NetworkStatsManager service=context.getSystemService(NetworkStatsManager.class);\n NetworkStats bucket= null;\n try {\n bucket = service.queryDetailsForUid(ConnectivityManager.TYPE_WIFI,\"\",from,to,uid);\n double received=0;\n double send=0;\n\n //get the details along with the time of data usage of an application\n while (bucket.hasNextBucket())\n {\n NetworkStats.Bucket tempbucket=new NetworkStats.Bucket();\n bucket.getNextBucket(tempbucket);\n received=(double)tempbucket.getRxBytes()+received;\n send=(double)tempbucket.getTxBytes()+send;\n }\n bucket.close();\n DataUsage temp =new DataUsage();\n double uploaded=send/(1024*1024);\n double downloaded=received/(1024*1024);\n\n total=(received+send)/(1024*1024);\n\n temp.setDownload(\"\"+String.format(\"%.2f\",downloaded));\n temp.setUpload(\"\"+String.format(\"%.2f\",uploaded));\n temp.setTotal(\"\"+String.format(\"%.2f\",total));\n return temp;\n\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n\n }\n\n return null;\n }",
"@Override\n\tpublic double calculateServiceCharge() {\n\t\treturn 10.19;\n\t}",
"public void DeductCharges () {\r\n\r\n\t\tdouble Temp = 0;\r\n\r\n\t\tfor ( Map.Entry<String, Double> CA : _ChargeAmounts.entrySet() ) {\r\n\r\n\t\t\tTemp += CA.getValue();;\r\n\r\n\t\t}\r\n\r\n\t\t_MonthlyChargeAmounts.put( _Tick.getMonthNumber(), Temp );\r\n\r\n\t\t_FundValue -= Temp;\r\n\r\n\t\tSystem.out.println( \"\\t\\t\\t \" + _Name + \" After Charges : \" + _FundValue );\r\n\t}",
"public static void queryUberAndStore(LocationAndTime locationAndTime,UberClientUtil uberClient){\n Map requestMap=new HashMap<>();\n requestMap.put(\"startLatitude\",locationAndTime.getStartLatitude());\n requestMap.put(\"startLongitude\",locationAndTime.getStartLongitude());\n requestMap.put(\"endLatitude\",locationAndTime.getEndLatitude());\n requestMap.put(\"endLongitude\",locationAndTime.getEndLongitude());\n List<Price> prices=uberClient.getPriceRequest(requestMap).getPrices();\n LocalDateTime localDateTime=Instant.ofEpochMilli(locationAndTime.getJourneyStartTime().getTime()).atZone( ZoneId.systemDefault()).toLocalDateTime();\n LocalDateTime now=LocalDateTime.now();\n LocalDateTime toDateTime=LocalDateTime.of( now.getYear(),now.getMonthValue(),now.getDayOfMonth() , localDateTime.getHour(), localDateTime.getMinute(), localDateTime.getSecond());\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss\");\n if(prices!=null){\n for(Price price:prices){\n price.setCurrentDate(formatter.format(toDateTime.atZone(ZoneId.systemDefault()).toInstant()));\n csvUtilUber.writeRecordToFile(price);\n }\n }\n\n\n\n\n }",
"private OtherChargesDTO[] getOtherCharges() {\n\t\tOtherChargesDTO[] others = null;\t\t\n\t\tif (lrcDTO != null) {\n\t\t\tif (gscDTO != null) {\n\t\t\t\t//Combine LRC GSC\n\t\t\t\tothers = combineLrcGsc(lrcDTO, gscDTO);\n\t\t\t} else {\n\t\t\t\tothers = lrcDTO;\n\t\t\t}\n\t\t} else if (gscDTO != null) {\n\t\t\tothers = gscDTO;\n\t\t}\t\t\n\t\tif(others == null){\n\t\t\t/*if(quotationDTO.getOtherCharges() != null){\n\t\t\tfor(int i = 0; i < quotationDTO.getOtherCharges().length; i++){\n\t\t\t\tSystem.out.println(\"Avail Staions==>\" + quotationDTO.getOtherCharges()[i].getStationCode());\n\t\t\t\tSystem.out.println(\"Avail LRC==>\" + quotationDTO.getOtherCharges()[i].getLrCharge());\n\t\t\t\tSystem.out.println(\"Avail GSC==>\" + quotationDTO.getOtherCharges()[i].getGsc());\n\t\t\t}}*/\n\t\t\treturn quotationDTO.getOtherCharges();\n\t\t}else{\n\t\t\tif(quotationDTO != null)\n\t\t\t\totherChargesDTO = quotationDTO.getOtherCharges();\n\t\t\tif(otherChargesDTO != null){\t\t\t\n\t\t\t\t//Update OtherChargesDTO with existing DTO\n\t\t\t\totherChargesDTO = updateOtherCharges(others, otherChargesDTO);\t\t\t\t\n\t\t\t\t/*for(int i = 0; i < otherChargesDTO.length; i++){\n\t\t\t\t\tSystem.out.println(\"Updated Staions==>\" + otherChargesDTO[i].getStationCode());\n\t\t\t\t\tSystem.out.println(\"Updated LRC==>\" + otherChargesDTO[i].getLrCharge());\n\t\t\t\t\tSystem.out.println(\"Updated GSC==>\" + otherChargesDTO[i].getGsc());\n\t\t\t\t}*/\n\t\t\treturn otherChargesDTO;\n\t\t\t}else{\n\t\t\t\tOtherChargesDTO[] othersAllStations = null;\n\t\t\t\ttry {\n\t\t\t\t\tothersAllStations = convertOthersAllStations(others);\n\t\t\t\t} catch (Exception e) {\t\t\t\t\t\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn othersAllStations;\n\t\t\t}\n\t\t}\t\t\n\t}",
"@Override\n protected LinkedHashMap<String, LinkedHashMap<String, Double>> doInBackground(String... strings) {\n if (strings.length == 0) {\n return null;\n }\n String fromCurrency = strings[0];\n String toCurrency = strings[1];\n\n URL requestUrl;\n requestUrl = NetworkUtils.buildUrl(fromCurrency, toCurrency);\n\n String responseFromUrl;\n LinkedHashMap<String, LinkedHashMap<String, Double>> resultFromJson;\n\n try {\n responseFromUrl = NetworkUtils\n .getResponseFromHttpUrl(requestUrl);\n\n\n resultFromJson\n = CryptoJsonUtils.getSimpleDataFromJson(responseFromUrl);\n return resultFromJson;\n\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n } catch (JSONException e) {\n e.printStackTrace();\n return null;\n }\n }",
"public static String getUsageByOption(String resid, String date, String option) {\n URL url = null;\n HttpURLConnection connection = null;\n String textResult = \"\";\n String methodPath = \"/entities.electricityusage/dailyUsage2/\";\n try {\n url = new URL(BASE_URI + methodPath + resid + \"/\" + date + \"/\" + option);\n // open the connection\n connection = (HttpURLConnection) url.openConnection();\n // set the time out\n connection.setReadTimeout(10000);\n connection.setConnectTimeout(15000);\n // set the connection method to GET\n connection.setRequestMethod(\"GET\");\n //add http headers to set your response type to json\n connection.setRequestProperty(\"Content-Type\", \"application/json\");\n connection.setRequestProperty(\"Accept\", \"application/json\");\n //Read the response\n Scanner inStream = new Scanner(connection.getInputStream());\n //read the input stream and store it as string\n while (inStream.hasNextLine()) {\n textResult += inStream.nextLine();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }finally {\n connection.disconnect();\n }\n return textResult;\n }",
"public Breakdown generateDiurnalReport(Date startDate, String[] demoArr) {\n\n Breakdown result = new Breakdown();\n AppUsageDAO auDAO = new AppUsageDAO();\n Date startHour = startDate;\n SimpleDateFormat sdf = new SimpleDateFormat(\"HH:00\");\n //for each hour (for 24 loop)\n for (int i = 0; i < 24; i++) {\n\n HashMap<String, Breakdown> miniMap = new HashMap<String, Breakdown>();\n result.addInList(miniMap);\n\n Date endHour = new Date(startHour.getTime() + 1000 * 60 * 60);\n miniMap.put(\"period\", new Breakdown(sdf.format(startHour) + \"-\" + sdf.format(endHour)));\n\n //get number of targetted users\n Date endDate = new Date(startDate.getTime() + 1000 * 60 * 60 * 24);\n ArrayList<User> targetList = auDAO.retrieveUserByDemo(startDate, endDate, demoArr);\n int targetCount = targetList.size();\n //get userList for this hour, filtered by demo\n ArrayList<User> userList = auDAO.retrieveUserByDemo(startHour, endHour, demoArr);\n double secondsThisHour = 0;\n\n //for each user\n for (User user : userList) {\n\n //retrieve appUsageList\n ArrayList<AppUsage> auList = auDAO.retrieveByUserHourly(user.getMacAddress(), startHour, endHour);\n\n Date oldTime = null;\n if (auList.size() > 0) {\n oldTime = auList.get(0).getDate();\n }\n\n //For each appusage in appUsageList\n for (int j = 1; j < auList.size(); j++) {\n Date newTime = auList.get(j).getDate();\n\n //calculate usageTime and add to secondsThisHour\n //difference between app usage timing\n long difference = Utility.secondsBetweenDates(oldTime, newTime);\n\n //If difference less than/equal 2 minutes\n if (difference <= 2 * 60) {\n // add difference to totalSeconds if <= 2 mins\n secondsThisHour += difference;\n } else {\n // add 10sec to totalSeconds if > 2 mins\n secondsThisHour += 10;\n }\n\n oldTime = newTime;\n\n }\n //Add 10 seconds for the last appusage in the list\n if (auList.size() > 0) {\n Date lastTime = auList.get(auList.size() - 1).getDate();\n\n long difference = Utility.secondsBetweenDates(lastTime, endHour);\n\n if (difference > 10) {\n difference = 10;\n }\n secondsThisHour += difference;\n\n }\n\n }\n //divide by all users in this hour to get average usage time in this hour\n if (targetCount > 0) {\n secondsThisHour /= targetCount;\n\n }\n\n //store in breakdown\n long time = Math.round(secondsThisHour);\n miniMap.put(\"duration\", new Breakdown(\"\" + time));\n\n startHour = endHour;\n }\n\n return result;\n }",
"public void calculoPersonal(){\n ayudantes = getAyudantesNecesarios();\n responsables = getResponsablesNecesarios();\n \n //Calculo atencion al cliente (30% total trabajadores) y RRPP (10% total trabajadores):\n \n int total = ayudantes + responsables;\n \n atencion_al_cliente = (total * 30) / 100;\n \n RRPP = (total * 10) / 100;\n \n //Creamos los trabajadores\n \n gestor_trabajadores.crearTrabajadores(RRPP, ayudantes,responsables,atencion_al_cliente);\n \n }",
"public OFMeterConfigStatsRequest buildMeterConfigRquest() {\n\t\t\treturn factory.buildMeterConfigStatsRequest().setMeterId(OFMeterSerializerVer13.ALL_VAL).build();\n\t\t}",
"@RequestMapping(value = \"/fundTransferDC\", method = RequestMethod.GET)\n\tpublic String fundTransferDC(Model model) {\n\t\tlogger.info(\"In fund transfer credit get method\");\n\n\t\tFundTransferSingleCreditRequest fundTransferDC = new FundTransferSingleCreditRequest();\n\n\t\tmodel.addAttribute(\"request\", fundTransferDC);\n\n\t\treturn \"fund_transfer_credit\";\n\t}",
"public JSONObject getInvoiceForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n /**\n * Get Invoice total sum\n */\n String companyId=reqParams.optString(\"companyid\");\n reqParams.put(\"entitycolnum\", reqParams.optString(\"invoiceentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"invoiceentityValue\"));\n JSONObject jSONObject = new JSONObject();\n List<Object> invoiceData = accEntityGstDao.getInvoiceDataWithDetailsInSql(reqParams);\n reqParams.remove(\"isb2cs\"); // remove to avoid CN index while fetching data\n double taxableAmountInv = 0d;\n double totalAmountInv = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n int count=0;\n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n for (Object object : invoiceData) {\n Object[] data = (Object[]) object;\n String term = data[1]!=null?data[1].toString():\"\";\n double termamount = data[0]!=null?(Double) data[0]:0;\n count = data[4]!=null?((BigInteger) data[4]).intValue():0;\n totalAmountInv = data[3]!=null?(Double) data[3]:0;\n if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n taxableAmountInv += data[2]!=null?(Double) data[2]:0;\n IGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n taxableAmountInv += data[2]!=null?(Double) data[2]:0;\n CGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n } else if(StringUtil.isNullOrEmpty(term)){\n taxableAmountInv += data[2]!=null?(Double) data[2]:0;\n }\n }\n jSONObject.put(\"count\", count);\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountInv, companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\", authHandler.formattedAmount(taxableAmountInv+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n } else {\n jSONObject = accGSTReportService.getSalesInvoiceJSONArrayForGSTR3B(invoiceData, reqParams, companyId);\n }\n return jSONObject;\n }",
"@Ignore\n @Test\n public void run_RL() {\n String configfile = \"C:\\\\Users\\\\gomes\\\\Desktop\\\\traffic_master\\\\n_Capstone_0426_9000.xml\";\n\n float duration = 3600f;\n float outdt = 300f;\n\n // Load ..............................\n api.OTM otm = null;\n\n try {\n otm = new api.OTM(configfile);\n\n// // Output requests .....................\n// List<Long> list_orig_link_ids = otm.scenario.get_link_ids();\n// otm.output.request_links_flow(null, list_orig_link_ids, outdt);\n// otm.output.request_links_veh(null, list_orig_link_ids, outdt);\n//\n// List<Long> ramp_ids = new ArrayList<>();\n// for(ActuatorInfo act_info : otm.scenario.get_actuators())\n// ramp_ids.add(act_info.target.getId());\n\n// ControllerCapacity controller = (ControllerCapacity) otm.scenario.get_actual_controller_with_id(1);\n\n // Qtable loop\n\n double[] sum_vehicles = new double[6];\n double[] sum_flow = new double[6];\n\n// for( int i=0 ; i<6 ; i++){\n//\n// // update control\n// for(Long ramp_id : ramp_ids) {\n// float rate_ramp = i*300f;\n// controller.set_rate_vph_for_actuator(ramp_id, rate_ramp);\n// }\n//\n// System.out.println(\"i=\" + i);\n//\n// otm.run(0,duration);\n//\n// // extract output .........................\n// sum_vehicles[i] = 0d;\n// sum_flow[i] = 0d;\n//\n// for(AbstractOutput output : otm.output.get_data()){\n//\n// if (output instanceof LinkFlow){\n//\n// for(Long link_id : list_orig_link_ids) {\n// Profile1D profile = ((LinkFlow) output).get_flow_profile_for_link_in_vph(link_id);\n// List<Double> values = profile.get_values();\n// // System.out.println(String.format(\"LinkFlow: id=%d num_values=%d\",link_id,values.size()));\n//\n// sum_flow[i] += values.stream().mapToDouble(x->x).sum();\n// }\n// }\n//\n//\n// if (output instanceof LinkVehicles) {\n// for(Long link_id : list_orig_link_ids) {\n// Profile1D profile = ((LinkVehicles) output).get_profile_for_linkid(link_id);\n// List<Double> values = profile.get_values();\n// // System.out.println(String.format(\"LinkVehicles: id=%d num_values=%d\",link_id,values.size()));\n//\n// sum_vehicles[i] += values.stream().mapToDouble(x->x).sum();\n// }\n// }\n//\n// }\n//\n// System.out.println(i + \"\\t\" + sum_flow[i] + \"\\t\" + sum_vehicles[i]);\n//\n// // do some Qtable calculation\n\n\n\n// }\n } catch (OTMException e) {\n e.printStackTrace();\n }\n\n }",
"private String calcRebillTPS() throws java.security.NoSuchAlgorithmException {\n\t\tString tps = BP_SECRET_KEY + BP_MERCHANT + TRANSACTION_TYPE + REBILL_ID;\n\t\treturn md5(tps);\n\t}",
"public void calculateCost()\n\t{\n\t\tLogManager lgmngr = LogManager.getLogManager(); \n\t\tLogger log = lgmngr.getLogger(Logger.GLOBAL_LOGGER_NAME);\n\t\tString s = \"\";\n\t\tint costperfeet = 0;\n\t\tif (this.materialStandard.equals(\"standard materials\") && this.fullyAutomated == false)\n\t\t\tcostperfeet = 1200;\n\t\telse if (this.materialStandard.equals(\"above standard materials\") && this.fullyAutomated == false)\n\t\t\tcostperfeet = 1500;\n\t\telse if(this.materialStandard.equals(\"high standard materials\") && this.fullyAutomated == false)\n\t\t\tcostperfeet = 1800;\n\t\telse if (this.materialStandard.equals(\"high standard materials\") && this.fullyAutomated == true)\n\t\t\tcostperfeet = 2500;\n\t\t\n\t\tint totalCost = costperfeet * this.totalArea;\n\t\t/*s = \"Total Cost of Construction is :- \";\n\t\twriter.printf(\"%s\" + totalCost, s);\n\t\twriter.flush();*/\n\t\tlog.log(Level.INFO, \"Total Cost of Construction is :- \" + totalCost);\n\t}",
"ShipmentCostEstimate createShipmentCostEstimate();",
"public PointRewardData getPointRewardData(Customer fromAccount, Customer toAccount, RewardCurrency fromRewardCurrency, RewardCurrency toRewardCurrency,double rewardQty, TransferPointSetting transferPointSetting ) {\n\n // Create the PointRewardData object\n PointRewardData pointRewardData = new PointRewardData();\n\n\n // Set the fields\n pointRewardData.setMerchantNo(toAccount.getCusMerchantNo());\n\n pointRewardData.setLoyaltyId(toAccount.getCusLoyaltyId());\n\n\n pointRewardData.setRwdCurrencyId(toRewardCurrency.getRwdCurrencyId());\n\n pointRewardData.setRwdCurrencyName(toRewardCurrency.getRwdCurrencyName());\n\n\n\n // Get the creditRewardQty\n double creditRewardQty = getCreditRewardQty(fromRewardCurrency,toRewardCurrency,rewardQty);\n\n pointRewardData.setRewardQty(creditRewardQty);\n\n pointRewardData.setTxnType(TransactionType.TRANSFER_POINT_TO);\n\n\n\n pointRewardData.setTxnLocation(toAccount.getCusLocation());\n\n pointRewardData.setTxnDate(new Date(new java.util.Date().getTime()));\n\n pointRewardData.setExpiryDt(getExpiryDateForPoints(transferPointSetting));\n\n\n // Check if tierAffected field is set\n if ( transferPointSetting.getTpsIsTierAffected() == IndicatorStatus.YES ) {\n\n pointRewardData.setAddToAccumulatedBalance(true);\n\n } else{\n\n pointRewardData.setAddToAccumulatedBalance(false);\n\n }\n\n\n // Return the object\n return pointRewardData;\n }",
"public double calculateDistance(double lat1, double lng1, double lat2, double lng2) {\n final String method = \"GET\";\n\n final String path = \"/calculateDistance\";\n\n final String body = \"\";\n final byte[] content = body.getBytes(StringUtils.UTF8);\n\n final Map parameters = new HashMap<>();\n parameters.put(\"lang\", \"en_US\");\n parameters.put(\"lat1\", Double.toString(lat1));\n parameters.put(\"lng1\", Double.toString(lng1));\n parameters.put(\"lat2\", Double.toString(lat2));\n parameters.put(\"lng2\", Double.toString(lng2));\n\n final Map headers = new HashMap<>();\n\n // Use components to create the api request\n ApiRequest localRequest =\n new ApiRequest(apiClient.getClass().getSimpleName())\n .withPath(path)\n .withHttpMethod(HttpMethodName.valueOf(method))\n .withHeaders(headers)\n .addHeader(\"Content-Type\", \"application/json\")\n .withParameters(parameters);\n\n // Only set body if it has content.\n if (body.length() > 0) {\n localRequest = localRequest\n .addHeader(\"Content-Length\", String.valueOf(content.length))\n .withBody(content);\n }\n\n final ApiRequest request = localRequest;\n\n // Make network call on background thread\n Thread getData = new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n Log.d(LOG_TAG,\n \"Invoking API w/ Request : \" +\n request.getHttpMethod() + \":\" +\n request.getPath());\n\n final ApiResponse response = apiClient.execute(request);\n\n final InputStream responseContentStream = response.getContent();\n final String responseData = IOUtils.toString(responseContentStream);\n Log.d(LOG_TAG, \"Response : \" + responseData);\n\n Log.d(LOG_TAG, response.getStatusCode() + \" \" + response.getStatusText());\n\n JSONObject responseJSONObject = new JSONObject(responseData);\n distance = Double.valueOf(responseJSONObject.get(\"distance\").toString());\n Log.d(LOG_TAG, \"Distance: \" + distance);\n } catch (final Exception exception) {\n Log.e(LOG_TAG, exception.getMessage(), exception);\n exception.printStackTrace();\n }\n }\n });\n\n getData.start();\n try {\n getData.join();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n return distance;\n }",
"public void getCISData() throws Exception {\n\t\tString sql = \"select max(convert(varchar,ctime,111)) day , max(clientip) ip, max(clienttoolversion) clientToolVersion from vdacleanup_uploadinfo where isInternalUpload='false' group by clientip \";\n\t\t\n\t\tlog.info(\"begin to fetch [vdacleanup_customer] \");\n\t\tArrayNode results = cisDataHelper.getAzureSqlResult(sql);\n\n\t\tIterator<JsonNode> nodeIterator = results.elements();\n\t\tlog.info(\"fetch [vdacleanup_customer] complete with total=\" + results.size());\n\t\tif(results.size() == 0) \n\t\t\treturn;\n\t\t\n\t\tList<Customer> list = new ArrayList<Customer>();\n\t\twhile(nodeIterator.hasNext()){\n\t\t\tJsonNode n = nodeIterator.next();\n\t\t\tCustomer u = new Customer();\t\t\n\t\t\tu.setClientIP(n.get(\"ip\").asText());\n\t\t\tu.setDay(n.get(\"day\").asText());\n\t\t\tu.setCountry(ip2Country.getCountryByIP(u.getClientIP()));\n\t\t\tu.setClientToolVersion(n.get(\"clientToolVersion\").asText());\n\t\t\tlist.add(u);\n\t\t}\t\t\n\t\tvdaCleanupCustomerRepository.deleteAll();\n\t\tvdaCleanupCustomerRepository.save(list);\n\t\tlog.info(\"[vdacleanup_customer] updated successfully....\");\n\t\t\n\t\t//2. get vdacleanup_uninstall_all data\n\t\tsql = \" select type,name,status,count(*) cnt \"\n\t\t\t+ \" from vdacleanup_uninstall_view a, vdacleanup_uploadinfo_view b \"\n\t\t\t+ \" where a.uploaduuid = b.uuid and b.isInternalUpload='false' group by type,name,status \";\n\t\t\t\t\n\t\tList<UninstallAll> listDashboard = new ArrayList<UninstallAll>();\n\t\t\n\t\tlog.info(\"begin to fetch [vdacleanup_uninstall_all] \");\n\t\tresults = cisDataHelper.getAzureSqlResult(sql);\n\t\tnodeIterator = results.elements();\n\t\tlog.info(\"fetch [vdacleanup_uninstall_all] complete with total=\" + results.size());\n\t\tif(results.size() == 0) \n\t\t\treturn;\n\t\t\n\t while(nodeIterator.hasNext()){\n\t \tJsonNode n = nodeIterator.next();\n\t \tUninstallAll u = new UninstallAll();\n\t \tu.setType(n.get(\"type\").asText());\n\t \tu.setCount(n.get(\"cnt\").asInt());\n\t \tu.setName(n.get(\"name\").asText());\n\t \tu.setStatus(n.get(\"status\").asText());\n\t \tlistDashboard.add(u);\t\n\t }\t\n\t \n\t vdaCleanupUninstallAllRepository.deleteAll();\n\t vdaCleanupUninstallAllRepository.save(listDashboard);\n\t log.info(\"[vdacleanup_uninstall_all] updated successfully....\");\n\t\t\n\t\t//3. get vdacleanup_uninstall_failed data\n\t\tsql = \" select type, name, returncode, errorid,count(*) cnt \"\n\t\t\t+ \" from vdacleanup_uninstall_view a, vdacleanup_uploadinfo_view b \"\n\t\t\t+ \" where a.uploaduuid = b.uuid and b.isInternalUpload='false' and a.status='Failed'\"\n\t\t\t+ \" group by type, name, returncode, errorid \";\n\t\t\t\t\n\t\tList<UninstallFailed> failedList = new ArrayList<UninstallFailed>();\n\t\t\n\t\tlog.info(\"begin to fetch [vdacleanup_uninstall_failed] \");\n\t\tresults = cisDataHelper.getAzureSqlResult(sql);\n\t\tnodeIterator = results.elements();\n\t\tlog.info(\"fetch [vdacleanup_uninstall_failed] complete with total=\" + results.size());\n\t\tif(results.size() == 0) \n\t\t\treturn;\n\t\t\n\t while(nodeIterator.hasNext()){\n\t \tJsonNode n = nodeIterator.next();\n\t \tUninstallFailed u = new UninstallFailed();\n\t \tu.setType(n.get(\"type\").asText());\n\t \tu.setCount(n.get(\"cnt\").asInt());\n\t \tu.setName(n.get(\"name\").asText());\n\t \tu.setErrorid(n.get(\"errorid\").asText());\n\t \tu.setReturncode(n.get(\"returncode\").asText());\n\t \tfailedList.add(u);\t\n\t }\t\n\t \n\t vdaCleanupUninstallFailedRepository.deleteAll();\n\t vdaCleanupUninstallFailedRepository.save(failedList);\n\t log.info(\"[vdacleanup_uninstall_failed] updated successfully....\");\n\t \n\t\t//4. get vdacleanup_reboot count data\n\t\tsql = \" select t.rebootTime, count(*) cnt from ( \"\n\t\t\t+ \" select uploaduuid, count(*) rebootTime \"\n\t\t\t+ \" from vdacleanup_reboot_view a, vdacleanup_uploadinfo_view b \"\n\t\t\t+ \" where a.uploaduuid = b.uuid and b.isInternalUpload='false' group by uploaduuid \"\n\t\t\t+ \" ) as t group by t.rebootTime\";\n\t\t\t\t\n\t\tList<RebootStat> rebootCountList = new ArrayList<RebootStat>();\n\t\t\n\t\tlog.info(\"begin to fetch [vdacleanup_reboot_view] \");\n\t\tresults = cisDataHelper.getAzureSqlResult(sql);\n\t\tnodeIterator = results.elements();\n\t\tlog.info(\"fetch [vdacleanup_reboot_view] complete with total=\" + results.size());\n\t\tif(results.size() == 0) \n\t\t\treturn;\n\t\t\n\t while(nodeIterator.hasNext()){\n\t \tJsonNode n = nodeIterator.next();\n\t \tRebootStat u = new RebootStat();\n\t \tu.setRebootTimes(n.get(\"rebootTime\").asText());\n\t \tu.setCount(n.get(\"cnt\").asInt());\n\t \trebootCountList.add(u);\t\n\t }\t\n\t \n\t vdaCleanupRebootStatRepository.deleteAll();\n\t vdaCleanupRebootStatRepository.save(rebootCountList);\n\t log.info(\"[vdacleanup_reboot_view] updated successfully....\");\n\t \n\t\t//5. get vdacleanup_metadata data\n\t\tsql = \" select os,vda,parameter, avg(datediff(ss, starttime, endtime)) secSpend, count(*) cnt \"\n\t\t\t+ \" from vdacleanup_metadata_view a, vdacleanup_uploadinfo_view b \"\n\t\t\t+ \" where a.uploaduuid = b.uuid and b.isInternalUpload='false' \"\n\t\t\t+ \" group by os,vda,parameter \";\n\t\t\t\t\n\t\tList<Metadata> metaDataList = new ArrayList<Metadata>();\n\t\t\n\t\tlog.info(\"begin to fetch [vdacleanup_metadata] \");\n\t\tresults = cisDataHelper.getAzureSqlResult(sql);\n\t\tnodeIterator = results.elements();\n\t\tlog.info(\"fetch [vdacleanup_metadata] complete with total=\" + results.size());\n\t\tif(results.size() == 0) \n\t\t\treturn;\n\t\t\n\t while(nodeIterator.hasNext()){\n\t \tJsonNode n = nodeIterator.next();\n\t \tMetadata u = new Metadata();\n\t \tu.setAvgTime(n.get(\"secSpend\").asInt());\n\t \tu.setOs(n.get(\"os\").asText());\n\t \tu.setParameter(n.get(\"parameter\").asText());\n\t \tu.setVda(n.get(\"vda\").asText());\n\t \tu.setCount(n.get(\"cnt\").asInt());\n\t \tmetaDataList.add(u);\t\n\t }\t\n\t \n\t vdaCleanupMetadataRepository.deleteAll();\n\t vdaCleanupMetadataRepository.save(metaDataList);\n\t log.info(\"[vdacleanup_metadata] updated successfully....\");\n\t \n\t updateLastUpdateTime(AppNames.VdaCleanup);\n\t}",
"private void populateCharges() {\n\t\tseenCharges.clear();\n\n\t\t// add bots and LEDs\n\t\tfor (int i = 0; i < seenBots.size(); i++) {\n\t\t\t// add the bot\n\t\t\tseenCharges.add(seenBots.get(i));\n\t\t\t// go through LEDs of bot and add\n\t\t\tfor (int j = 0; j < seenBots.get(i).getNoOfLEDs(); j++) {\n\t\t\t\tseenCharges.add(seenBots.get(i).LEDs.get(j));\n\t\t\t}\n\t\t}\n\t}",
"void chargeTf(double amount);",
"public static void sendEmergencyAssistanceAbnormalSpeed(Context context, @NonNull iEmergencyAssistanceAbnormalSpeed result) {\n final String Uid = objAccount.getCurrentUser().getUid();\n final objAccount currentAccount = objAccount.getAccountFromSQLite(context,Uid);\n\n final DatabaseReference mRef = FirebaseDatabase.getInstance()\n .getReference()\n .child(keyUtils.emergencyAssistanceList)\n .child(Uid)\n .push();\n\n //Get current location\n FusedLocationProviderClient mFusedLocationClient = LocationServices.getFusedLocationProviderClient(context);\n mFusedLocationClient.getLastLocation().addOnCompleteListener(new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n\n Location location = task.getResult();\n if (location != null) {\n ArrayList<String> listSeen = new ArrayList<>();\n listSeen.add(objAccount.getCurrentUser().getUid());\n\n ArrayList<String> listReceived = new ArrayList<>();\n listReceived.add(objAccount.getCurrentUser().getUid());\n\n String message = String.format(context.getResources().getString(R.string.We_find_driving_speed_unusually_low),\n currentAccount.getName(),\n currentAccount.getGender().toLowerCase().matches(keyUtils.MALE) ? context.getResources().getString(R.string.him) : context.getResources().getString(R.string.her));\n\n fb_emergencyAssistance emergencyAssistance = new fb_emergencyAssistance(location.getLatitude(),\n Uid,\n listReceived,\n listSeen,\n location.getLongitude(),\n message,\n keyUtils.TYPE_ABNORMAL_SPEED,\n Calendar.getInstance().getTimeInMillis());\n\n\n mRef.setValue(emergencyAssistance)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n result.onResult(true, \"Success\");\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n result.onResult(false, e.getMessage());\n }\n });\n }else\n result.onResult(false,\"Null location\");\n }\n });\n }",
"synchronized public void writeResult(TripData tripData, long currentTimeMillis, Location location) {\n\t\tfloat avgCalcPower = 0.0f;\n\t\tdouble stdCalcPower = 0.0f;\n\t\tfloat avgCalcTorque = 0.0f;\n\t\tdouble stdCalcTorque = 0.0f;\n\t\tfloat avgCalcCrankCadence = 0.0f;\n\t\tdouble stdCalcCrankCadence = 0.0f;\n\t\tfloat avgCalcWheelSpeed = 0.0f;\n\t\tdouble stdCalcWheelSpeed = 0.0f;\n\t\tfloat avgCalcWheelDistance = 0.0f;\n\t\tdouble stdCalcWheelDistance = 0.0f;\n\t\t\n\t\ttry {\n\t\t\t// Calculate averages and sum square differences\n\t\t\tif (calculatedPowers.size() > 0) {\n\t\t\t\tavgCalcPower = MyMath.getAverageValueBD(calculatedPowers);\n\t\t\t\tstdCalcPower = MyMath.getStandardDeviationBD(calculatedPowers, avgCalcPower);\n\t\t\t}\n\t\t\tif (calculatedTorques.size() > 0) {\n\t\t\t\tavgCalcTorque = MyMath.getAverageValueBD(calculatedTorques);\n\t\t\t\tstdCalcTorque = MyMath.getStandardDeviationBD(calculatedTorques, avgCalcTorque);\n\t\t\t}\n\t\t\tif (calculatedCrankCadences.size() > 0) {\n\t\t\t\tavgCalcCrankCadence = MyMath.getAverageValueBD(calculatedCrankCadences);\n\t\t\t\tstdCalcCrankCadence = MyMath.getStandardDeviationBD(calculatedCrankCadences, avgCalcCrankCadence);\n\t\t\t}\n\t\t\tif (calculatedWheelSpeeds.size() > 0) {\n\t\t\t\tavgCalcWheelSpeed = MyMath.getAverageValueBD(calculatedWheelSpeeds);\n\t\t\t\tstdCalcWheelSpeed = MyMath.getStandardDeviationBD(calculatedWheelSpeeds, avgCalcWheelSpeed);\n\t\t\t}\n\t\t\tif (calculatedWheelDistances.size() > 0) {\n\t\t\t\tavgCalcWheelDistance = MyMath.getAverageValueBD(calculatedWheelDistances);\n\t\t\t\tstdCalcWheelDistance = MyMath.getStandardDeviationBD(calculatedWheelDistances, avgCalcWheelDistance);\n\t\t\t}\n\t\t\t\n\t\t\t// Save results to database\n\t\t\ttripData.addBikePowerDeviceReading(currentTimeMillis, \n\t\t\t\t\tcalculatedPowers.size(), avgCalcPower, stdCalcPower,\n\t\t\t\t\tcalculatedTorques.size(), avgCalcTorque, stdCalcTorque,\n\t\t\t\t\tcalculatedCrankCadences.size(), avgCalcCrankCadence, stdCalcCrankCadence,\n\t\t\t\t\tcalculatedWheelSpeeds.size(), avgCalcWheelSpeed, stdCalcWheelSpeed,\n\t\t\t\t\tcalculatedWheelDistances.size(), avgCalcWheelDistance, stdCalcWheelDistance);\n\n\t\t\tif (null != rawDataFile) {\n\t\t\t\trawDataFile.write(currentTimeMillis, location, calculatedPowers,\n\t\t\t\t\t\tcalculatedTorques, calculatedCrankCadences, calculatedWheelSpeeds, \n\t\t\t\t\t\tcalculatedWheelDistances);\n\t\t\t}\n\n\t\t\treset();\n\t\t}\n\t\tcatch(Exception ex) {\n\t\t\tLog.e(MODULE_TAG, ex.getMessage());\n\t\t}\n\t}",
"private Double getDeductibles(int orNo, int storeCode) {\n\t\treturn getReturnedItemsAmount(orNo, storeCode) + getGiftCheckAmount(orNo, storeCode) + getPartialTransactionBalance(orNo, storeCode);\r\n\t}",
"public OFMeterStatsRequest buildMeterStatsRequest() {\n\t\t\treturn factory.buildMeterStatsRequest().setMeterId(OFMeterSerializerVer13.ALL_VAL).build();\n\t\t}",
"private void insertServiceRequest() {\n Random rand = new Random();\r\n service_id = rand.nextInt(Integer.MAX_VALUE);\r\n int tokenSeed = rand.nextInt(Integer.MAX_VALUE);\r\n current_token = md5(tokenSeed + \"\");\r\n\r\n Calendar cal = Calendar.getInstance();\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\r\n String fecha = sdf.format(cal.getTime());\r\n\r\n int deliver_state = 1;\r\n\r\n int costo = (int) Math.round(destinations.get(0).total_price);\r\n\r\n ArrayList<String> param = new ArrayList<>();\r\n param.add(service_id + \"\");\r\n param.add(current_token);\r\n param.add(fecha);\r\n param.add(deliver_state + \"\");\r\n param.add(id_cliente + \"\");\r\n param.add(costo + \"\");\r\n param.add(\"0\");\r\n RestClient.get().executeCommand(\"8\", param.toString(), new Callback<Response>() {\r\n @Override\r\n public void success(Response response, retrofit.client.Response response2) {\r\n\r\n insertRoutes();\r\n }\r\n\r\n @Override\r\n public void failure(RetrofitError error) {\r\n hideOverlay();\r\n showDialog(\r\n getResources().getString(\r\n R.string.msg_serverError_title),\r\n getResources().getString(\r\n R.string.msg_serverError), false, false);\r\n }\r\n });\r\n\r\n\r\n }",
"private String calculateDistancePerAmount() {\n double distance = parser(getTextFromEditText(R.id.distanceEdit));\n double fuel = parser(getTextFromEditText(R.id.fuelEdit));\n double value = distance / fuel;\n return rounder(value);\n }",
"private String populateMtrRdr() {\n\t\tAppLog.begin();\n\t\ttry {\n\t\t\tMeterReaderDetails meterReaderDetails = new MeterReaderDetails();\n\t\t\tmeterReaderDetails.setMeterReaderEmployeeID(meterReaderID);\n\t\t\tList<MeterReaderDetails> meterReaderList = (ArrayList<MeterReaderDetails>) MRDTaggingDAO\n\t\t\t\t\t.getMeterReaderList(meterReaderDetails);\n\t\t\tStringBuffer meterReaderDropdown = new StringBuffer();\n\t\t\tmeterReaderDropdown\n\t\t\t\t\t.append(\"<select name=\\\"meterReaderID\\\" id=\\\"meterReaderID\\\" class=\\\"selectbox-long\\\">\");\n\t\t\tmeterReaderDropdown.append(\"\");\n\t\t\tmeterReaderDetails = null;\n\t\t\tif (null != meterReaderList && meterReaderList.size() > 0) {\n\t\t\t\tfor (int i = 0; i < meterReaderList.size(); i++) {\n\t\t\t\t\tmeterReaderDetails = (MeterReaderDetails) meterReaderList\n\t\t\t\t\t\t\t.get(i);\n\t\t\t\t\tmeterReaderDropdown.append(optionTagBeginPart1);\n\t\t\t\t\tmeterReaderDropdown.append(meterReaderDetails\n\t\t\t\t\t\t\t.getMeterReaderID());\n\t\t\t\t\tmeterReaderDropdown.append(optionTagBeginPart2);\n\t\t\t\t\tmeterReaderDropdown.append(meterReaderDetails\n\t\t\t\t\t\t\t.getMeterReaderName());\n\t\t\t\t\tmeterReaderDropdown.append(optionTagEnd);\n\t\t\t\t}\n\t\t\t}\n\t\t\tmeterReaderDropdown.append(selectTagEnd);\n\t\t\tinputStream = new StringBufferInputStream(meterReaderDropdown\n\t\t\t\t\t.toString());\n\t\t} catch (Exception e) {\n\t\t\tinputStream = new StringBufferInputStream(\n\t\t\t\t\t\"<font color='red' size='2'><li><span><b>ERROR:Sorry, There was problem while Processing Last Operation.</b></font>\");\n\t\t\tAppLog.error(e);\n\t\t}\n\t\tAppLog.end();\n\t\treturn SUCCESS;\n\t}",
"public static String sendLiveRequest(){\n\n // The following line initializes the HttpGet Object with the URL in order to send a request\n HttpGet get = new HttpGet(BASE_URL + ENDPOINT + \"?access_key=\" + ACCESS_KEY);\n\n try {\n CloseableHttpResponse response = httpClient.execute(get);\n HttpEntity entity = response.getEntity();\n\n // the following line converts the JSON Response to an equivalent Java Object\n JSONObject exchangeRates = new JSONObject(EntityUtils.toString(entity));\n \n Date timeStampDate = new Date((long)(exchangeRates.getLong(\"timestamp\")*1000)); \n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n String formattedDate = dateFormat.format(timeStampDate);\n \n String USDUAH = \"1 \" + exchangeRates.getString(\"source\") + \" in UAH : \" + exchangeRates.getJSONObject(\"quotes\").getDouble(\"USDUAH\") + \" (Date: \" + formattedDate + \")\";\n String USDEUR = \"1 \" + exchangeRates.getString(\"source\") + \" in EUR : \" + exchangeRates.getJSONObject(\"quotes\").getDouble(\"USDEUR\") + \" (Date: \" + formattedDate + \")\"; \n String USDGBP = \"1 \" + exchangeRates.getString(\"source\") + \" in GBP : \" + exchangeRates.getJSONObject(\"quotes\").getDouble(\"USDGBP\") + \" (Date: \" + formattedDate + \")\";\n String USDJPY = \"1 \" + exchangeRates.getString(\"source\") + \" in JPY : \" + exchangeRates.getJSONObject(\"quotes\").getDouble(\"USDJPY\") + \" (Date: \" + formattedDate + \")\";\n return USDUAH+\"\\n\"+USDEUR+\"\\n\"+USDGBP+\"\\n\"+USDJPY;\n } catch (ClientProtocolException e) { \n e.printStackTrace();\n Main.logger.log(Level.SEVERE, \"Exception: \", e);\n } catch (IOException e) {\n e.printStackTrace();\n Main.logger.log(Level.SEVERE, \"Exception: \", e);\n } catch (ParseException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n Main.logger.log(Level.SEVERE, \"Exception: \", e);\n }\n\t\treturn null;\n }",
"@Scheduled(fixedRate = 8 * 1000 * 60 * 60)\n private void getRatesTask() {\n try {\n RestTemplate restTemplate = new RestTemplate();\n CurrencyDTO forObject = restTemplate.getForObject(fixerIoApiKey, CurrencyDTO.class);\n forObject.getRates().forEach((key, value) -> {\n Currency currency = new Currency(key, value);\n this.currencyRepository.save(currency);\n });\n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n }\n }",
"public String execute() {\n\t\ttry {\n\t\t\tHashMap<Integer, RigaVenditeCommercianti> map = new HashMap<Integer, RigaVenditeCommercianti>();\n\t\t\tlistaTotali = new LinkedList<RigaVenditeCommercianti>();\n\t\t\t\n\t\t\tFatture fatture = new Fatture();\n\t\t\tfatture.setOrderByCliente();\n\t\t\tCollection colFatture = fatture.getFatture(dataDal, dataAl);\n\t\t\tIterator itr = colFatture.iterator();\n\t\t\twhile (itr.hasNext()) {\n\t\t\t\tFattura fattura = (Fattura) itr.next();\t\n\t\t\t\tfattura.calcolaTotali();\n\t\t\t\tif (map.containsKey(fattura.getIdCliente().intValue())) {\n\t\t\t\t\t//Aggiungi totali alla riga attuale\n\t\t\t\t\tRigaVenditeCommercianti riga = map.get(fattura.getIdCliente().intValue());\n\t\t\t\t\triga.setTotaleFattura(riga.getTotaleFattura().add(fattura.getTotaleFattura()));\n\n\t\t\t\t\t//CALCOLO IMPONIBILI\n\t\t\t\t\tfattura.calcolaTotali();\n\t\t\t\t\tHashMap<BigDecimal, BigDecimal[]> imponibili = fattura.getImponibili();\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 4\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva1())) { //IVA AL 4\n\t\t\t\t\t\triga.setImponibile1(riga.getImponibile1().add(imponibili.get(riga.getIva1())[0]));\n\t\t\t\t\t\triga.setImposta1(riga.getImposta1().add(imponibili.get(riga.getIva1())[1]));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 10\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva2())) {\n\t\t\t\t\t\triga.setImponibile2(riga.getImponibile2().add(imponibili.get(riga.getIva2())[0]));\n\t\t\t\t\t\triga.setImposta2(riga.getImposta2().add(imponibili.get(riga.getIva2())[1]));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 20\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva2())) {\n\t\t\t\t\t\triga.setImponibile3(riga.getImponibile3().add(imponibili.get(riga.getIva3())[0]));\n\t\t\t\t\t\triga.setImposta3(riga.getImposta3().add(imponibili.get(riga.getIva3())[1]));\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t//Crea riga per cliente\n\t\t\t\t\tRigaVenditeCommercianti riga = new RigaVenditeCommercianti();\n\t\t\t\t\triga.setCliente(fattura.getCliente());\n\t\t\t\t\triga.setTotaleFattura(fattura.getTotaleFattura());\n\t\t\t\t\t\n\t\t\t\t\t//CALCOLO IMPONIBILI\n\t\t\t\t\tHashMap<BigDecimal, BigDecimal[]> imponibili = fattura.getImponibili();\n\t\t\t\t\tIvas dao = new Ivas();\n\t\t\t\t\tdao.setOrderByDescrizione(DataAccessObject.ORDER_ASC);\n\t\t\t\t\tCollection aliquote = dao.getElements();\n\t\t\t\t\t\n\t\t\t\t\tint index = 1;\n\t\t\t\t\tfor(Object obj : aliquote)\n\t\t\t\t\t{\n\t\t\t\t\t\tIva iva = (Iva)obj;\n\t\t\t\t\t\tif(iva.getValore().floatValue() < 4) continue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tBigDecimal imponibile = new BigDecimal(0);\n\t\t\t\t\t\tBigDecimal imposta = new BigDecimal(0);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(imponibili.containsKey(iva.getValore()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\timponibile = imponibili.get(iva.getValore())[0];\n\t\t\t\t\t\t\timposta = imponibili.get(iva.getValore())[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(index == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva1(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile1(imponibile);\n\t\t\t\t\t\t\triga.setImposta1(imposta);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(index == 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva2(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile2(imponibile);\n\t\t\t\t\t\t\triga.setImposta2(imposta);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(index == 3)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva3(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile3(imponibile);\n\t\t\t\t\t\t\triga.setImposta3(imposta);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(index == 3) break;\n\t\t\t\t\t\t\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tmap.put(fattura.getIdCliente().intValue(), riga);\n\t\t\t\t\tlistaTotali.add(riga);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tstampaErrore(\"PrintVendite.execute()\", e);\n\t\t\treturn ERROR;\n\t\t}\n\t\treturn SUCCESS;\n\t}",
"@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic User requestVehicleControl(long userId, String featureType, String featureStatus) {\n\t\tlogger.info(\"Call requestVehicleControl===========================\");\n\t\tdatasource = getDataSource();\n\t\tjdbcTemplate = new JdbcTemplate(datasource);\n\t\tUser user = new User();\n\t\t// Check if head Unit is registered with given userID\n\t\tString check_query = \"select count(1) from headunit where user_id = ?\";\n\n\t\tint result = jdbcTemplate.queryForObject(check_query, new Object[] { userId }, Integer.class);\n\n\t\tif (result > 0) {\n\n\t\t\t// check if record exists for userID\n\t\t\t// get GCM key\n\t\t\tString gcm_key_query = \"select gcmregistartionkey from headunit where user_id = ?\";\n\n\t\t\tString query_result = (String) jdbcTemplate.queryForObject(gcm_key_query, new Object[] { userId },\n\t\t\t\t\tString.class);\n\n\t\t\tSystem.out.println(\"GCM KEY ============================= \" + query_result);\n\t\t\t// if GCM key available\n\t\t\t// preapre message\n\t\t\tif (query_result != null && !query_result.isEmpty()) {\n\t\t\t\tSender sender = new Sender(utilityObj.getGcmApiKeySimuapp());\n\t\t\t\tJSONObject obj = new JSONObject();\n\t\t\t\t// build message based on featureType and featurestatus\n\t\t\t\tobj.put(\"featuretype\", featureType);\n\t\t\t\tobj.put(\"featurestatus\", featureStatus);\n\t\t\t\tString prepare_msg = obj.toJSONString();\n\t\t\t\tgcm_message = new Message.Builder().timeToLive(30).delayWhileIdle(true)\n\t\t\t\t\t\t.addData(MESSAGE_KEY, prepare_msg).build();\n\t\t\t\tlogger.info(\"IN requestVehicleControl GCM reg key==========\" + query_result);\n\t\t\t\tResult gcm_result = null;\n\t\t\t\t// get gcm_message and gcm_register key\n\t\t\t\t// send message to that gcm_register_key\n\t\t\t\t// set message and status\n\t\t\t\ttry {\n\t\t\t\t\tgcm_result = sender.send(gcm_message, query_result, 1);\n\t\t\t\t\tlogger.info(\"IN requestVehicleControl GCM SEND RESULT FROM GOOLGE API \" + gcm_result.toString());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tuser.setUserid(userId);\n\t\t\t\tuser.setStatus(true);\n\t\t\t\tuser.setGcmregistartionkey(query_result);\n\t\t\t\tuser.setMessage(prepare_msg);\n\t\t\t\tuser.setFeaturetype(featureType);\n\t\t\t\tuser.setFeaturestatus(featureStatus);\n\t\t\t} else {\n\t\t\t\tuser.setMessage(\"NO GCM KEY FOUND \");\n\t\t\t}\n\n\t\t} else {\n\t\t\t// if head unit registered\n\t\t\t// set meassage and status\n\t\t\tuser.setStatus(false);\n\t\t\tuser.setMessage(\"NO HEAD UNIT REGISTERED FOR GIVEN USERID : \" + userId);\n\n\t\t}\n\t\treturn user;\n\t}",
"@Override\n protected double calcTotalCost() {\n \n double totalCost, templateBasicRate = DEFAULT_BASIC_RATE;\n double extraBedrooms = 0, extraBathrooms = 0;\n\n // if there are extra beds/baths\n if (this.getNumBedrooms() > DEFAULT_NUM_BEDROOMS)\n extraBedrooms = this.getNumBedrooms() - DEFAULT_NUM_BEDROOMS;\n\n if (this.getNumBathrooms() > DEFAULT_NUM_BATHROOMS)\n extraBathrooms = this.getNumBathrooms() - DEFAULT_NUM_BATHROOMS;\n\n // multiply basic rate by 1.5 if the total area is >= 3,000 sq ft\n if (this.getTotalArea() >= 3000)\n templateBasicRate *= 1.5;\n\n // calculate total cost\n totalCost = (templateBasicRate + ((800 * extraBedrooms) + (500 * extraBathrooms)));\n\n // add tax\n totalCost += (TAX * totalCost);\n\n return totalCost;\n }",
"ResponseEntity<List<TOURates>> getTouRates();",
"@Override\n\tvoid get_cost_per_sqarefeet() {\n\t\tcost=1800;\n\t}",
"public void syncWithRTInfo() {\n new rtLocation(locationValueString).execute();\n new rtTemp(tempValueString).execute();\n new rtHumidity(humidityValueString).execute();\n new rtCondition(conditionValueString).execute();\n }",
"@RequestMapping(value = \"/fundtransferAdvice_dc\", method = RequestMethod.GET)\n\tpublic String fundtransferAdvice_dc(Model model) {\n\t\tlogger.info(\"In fund transfer advice credit get method\");\n\n\t\tFundTransferAdviceCreditRequest fundtransferAdvice_dcRequest = new FundTransferAdviceCreditRequest();\n\n\t\tmodel.addAttribute(\"request\", fundtransferAdvice_dcRequest);\n\n\t\treturn \"fund_transfer_advice_credit\";\n\t}",
"public interface LogisticsDataApi {\n\n\n /**\n * 用户类型:-1用户, 0-咨询会员,1-交易会员,2-商家会员\n * 会员认证 状态: 0 -未认证, 1 -已认证\n * 会员锁定 状态: 0 -正常, 1 -锁定, 2 -注销\n * /member/query_type_new?token GET 用户类型\n */\n @GET(\"member/query_type_new\")\n Observable<UserTypeData> getUserType(@Query(\"token\") String token);\n\n /**\n * 发布求购 publish\n *\n * 收货信息 member/get_member_delivery_address?token 取默认地址 / 没有默认取第一条\n *\n * 原料品名 baseData/query_breed?keyword\n * 原料牌号 baseData/query_spec?keyword & code // code 为 breed code\n * 生产厂家 baseData/query_brand?keyword\n *\n * 提交 求购数据 member/publish_buy - post reference: class: MemberPurchaseDTOs\n */\n\n\n // 收货地址\n @GET(\"member/get_member_delivery_address\")\n Observable<PublishData.AddressData> getAddressData(@Query(\"token\") String token);\n\n // breed\n @GET(\"baseData/query_breed\")\n Observable<PublishData> getBreedData(@Query(\"keyword\") String keyword);\n // spec\n @GET(\"baseData/query_spec\")\n Observable<PublishData> getSpecData(@Query(\"keyword\") String keyword,\n @Query(\"code\") String breedCode);\n // brand\n @GET(\"baseData/query_brand\")\n Observable<PublishData.PublishBrandData> getBrandData(@Query(\"keyword\") String keyword);\n\n\n\n // 提交 求购数据 post Content-Type为application/json todo\n @POST(\"member/publish_buy\")\n Observable<VerifyData> postPurchaseData(@Body RequestBody requestBody);\n\n\n /**\n * 发布求购 publish - 收货地址 新增/编辑 get\n @\"/member/save_member_delivery_address\" // 新增收货信息\n @\"/member/update_member_delivery_address\" // 编辑收货信息\n */\n // 新增收货信息\n @GET(\"member/save_member_delivery_address\")\n Observable<VerifyData> getSaveAddressData(\n @Query(\"token\") String token,\n @Query(\"address\") String address,\n @Query(\"contactName\") String contactName,\n @Query(\"mobile\") String mobile,\n @Query(\"isDefault\") String isDefault,\n @Query(\"provinceCode\") String provinceCode,\n @Query(\"provinceName\") String provinceName,\n @Query(\"cityCode\") String cityCode,\n @Query(\"cityName\") String cityName,\n @Query(\"districtCode\") String districtCode,\n @Query(\"districtName\") String districtName\n );\n\n // 修改收货信息 (memberDeliveryAddressId 新增地址没有此参数)\n @GET(\"member/update_member_delivery_address\")\n Observable<VerifyData> getUpdateAddressData(\n @Query(\"token\") String token,\n @Query(\"address\") String address,\n @Query(\"contactName\") String contactName,\n @Query(\"mobile\") String mobile,\n @Query(\"isDefault\") int isDefault,\n @Query(\"provinceCode\") String provinceCode,\n @Query(\"provinceName\") String provinceName,\n @Query(\"cityCode\") String cityCode,\n @Query(\"cityName\") String cityName,\n @Query(\"districtCode\") String districtCode,\n @Query(\"districtName\") String districtName,\n @Query(\"memberDeliveryAddressId\") String memberDeliveryAddressId\n );\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n /**\n * purchase\n * member/purchase_pool?token 求购池数据\n * member/my_purchase_list?token 我的求购\n * shop/my_quote_list?token 我的报价\n */\n @GET(\"member/purchase_pool\")\n Observable<PurchaseData> getPurchasePoolData(@Query(\"token\") String token,\n @Query(\"pageNum\") int pageNum,\n @Query(\"pageSize\") int pageSize);\n\n\n @GET(\"member/my_purchase_list\")\n Observable<PurchaseData> getMyPurchaseData(@Query(\"token\") String token,\n @Query(\"pageNum\") int pageNum,\n @Query(\"pageSize\") int pageSize);\n\n @GET(\"shop/my_quote_list\")\n Observable<PurchaseData> getMyQuoteData(@Query(\"token\") String token,\n @Query(\"pageNum\") int pageNum,\n @Query(\"pageSize\") int pageSize);\n\n /**\n * member/purchase_quote_list?token&memberPurchaseId 求购报价详情\n * shop/my_quote_detail?quoteId&token 报价详情\n */\n\n @GET(\"member/purchase_quote_list\")\n Observable<PurchaseQuoteData> getMyPurchaseDetailData(@Query(\"token\") String token,\n @Query(\"memberPurchaseId\") String memberPurchaseId);\n\n @GET(\"shop/my_quote_detail\")\n Observable<QuoteDetailData> getMyQuoteDetailData(@Query(\"token\") String token,\n @Query(\"quoteId\") String quoteId);\n\n\n /**\n * member/member_review_quote ?token&sellMemberQuoteId& reviewNote 买家复议\n * shop/sell_review_quote ? token& quoteId& price 卖家复议\n */\n\n @GET(\"member/member_review_quote\")\n Observable<VerifyData> getPurchaseReviewData(@Query(\"token\") String token,\n @Query(\"sellMemberQuoteId\") String sellMemberQuoteId,\n @Query(\"reviewNote\") String reviewNote);\n\n @GET(\"shop/sell_review_quote\")\n Observable<VerifyData> getQuoteReviewData(@Query(\"token\") String token,\n @Query(\"quoteId\") String quoteId,\n @Query(\"price\") String price);\n\n\n /** 商家报价\n * baseData/query_like_warehouse?companyShortName 模糊搜索仓库\n * baseData/query_warehouse?companyShortName 精准搜索仓库 1.创建新仓库校验 2.选择历史\n * shop/sell_price 报价 - 提交报价数据 post\n */\n\n @GET(\"baseData/query_like_warehouse\")\n Observable<WarehouseData> getFuzzyWarehouseData(@Query(\"companyShortName\") String companyShortName);\n\n @GET(\"baseData/query_warehouse\")\n Observable<WarehouseData.WarehouseCheckData> getWarehouseData(@Query(\"companyShortName\") String companyShortName);\n\n\n // 提交报价数据 post todo\n @FormUrlEncoded\n @POST(\"shop/sell_price\")\n Observable<VerifyData> postQuoteData(\n @Field(\"token\") String token,\n @Field(\"memberPurchaseId\") long memberPurchaseId,\n @Field(\"price\") double price,\n @Field(\"isSupplierDistribution\") int isSupplierDistribution, // 0 - no ; 1 - yes;\n @Field(\"deliveryDate\") String deliveryDate,\n @Field(\"warehouse\") String warehouse // warehouse json\n );\n\n\n\n\n\n\n /**\n * logistics\n * /app/logistics/from_address 出发地\n * /app/logistics/to_address?provFrom&cityFrom&distinctFrom 目的地\n * /app/logistics/query_price?provFrom&cityFrom&distinctFrom&provTo&cityTo&distinctTo&amount 价格\n * @return\n */\n\n // 出发地\n @GET(\"logistics/from_address\")\n Observable<LogisticsCityData> getFromData();\n\n // 目的地\n @GET(\"logistics/to_address\")\n Observable<LogisticsCityData> getDestinationData(@Query(\"provFrom\") String provFrom,\n @Query(\"cityFrom\") String cityFrom,\n @Query(\"distinctFrom\") String distinctFrom\n );\n\n // 价格\n @GET(\"logistics/query_price\")\n Observable<LogisticsResultData> getPriceData(@Query(\"provFrom\") String provFrom,\n @Query(\"cityFrom\") String cityFrom,\n @Query(\"distinctFrom\") String distinctFrom,\n @Query(\"provTo\") String provTo,\n @Query(\"cityTo\") String cityTo,\n @Query(\"distinctTo\") String distinctTo,\n @Query(\"amount\") int amount\n );\n\n\n /**\n * 一键下单页面计算:\n 采购单价:求购报价的价格;\n 运费单价:求购报价的运费单价;(非供配情况下,选择自提,重置为0)\n 资金服务费利率:未认证会员为0;\n 账期:使用授信(部分授信,或全部授信)默认为最大账期天数;款到发货,账期为0;\n\n 选择账期后计算-----------------------------------------------------\n\n 1.资金服务费 =(采购单价+运费单价)*数量*资金服务费利率*账期\n\n * 全部授信- 资金服务费 =(采购单价+运费单价)*数量*资金服务费利率*账期\n * 部分授信- 资金服务费 = 授信额度(自填)*资金服务费利率*账期\n\n\n 2.销售总货款 =(采购单价+运费单价)*数量 + 资金服务费\n\n 3.采购总货款 = 采购单价*数量\n\n 4.物流总货款 = 运费单价*数量\n\n 5.销售单价 = 销售总货款/数量\n\n\n 6.使用授信(授信金额)\n 全部授信-使用授信 =(采购单价+运费单价)* 数量 + 资金服务费\n 部分授信-使用授信 = 授信额度(自填);\n 款到发货-使用授信 = 0;\n\n 7.手续费 = 销售总货款*0.3%\n *\n * /member/purchase_check_create_order?token \t\t\t\t 检验能否一键下单\n * /member/query_purchase_create_order_details?token"eId 确认订单\n */\n\n // 检验能否一键下单\n @GET(\"member/purchase_check_create_order\")\n Observable<VerifyData> getOrderCheckData(@Query(\"token\") String token);\n\n // 确认订单\n @GET(\"member/query_purchase_create_order_details\")\n Observable<OrderConfirmData> getOrderConfirmData(@Query(\"token\") String token,\n @Query(\"quoteId\") String quoteId);\n\n /**\n * 保证金\n * order/check_deposit?token & receivableWay\n */\n @GET(\"order/check_deposit\")\n Observable<VerifyData> getCheckDepositData(@Query(\"token\") String token,\n @Query(\"receivableWay\") String receivableWay);\n\n /**\n * private Long memberPurchaseId = 0L;\t\t\t\t\t\t// 会员求购单Id\n private Long sellMemberQuoteId = 0L;\t\t\t\t\t // 报价单Id\n\n private Double saleSumQty = 0D;\t\t\t\t\t\t\t// 销售总重量\n private Double saleSumAmt = 0D;\t\t\t\t\t\t\t// 销售总金额\n private Double purchaseSumQty = 0D;\t\t\t\t\t\t// 采购总重量\n private Double purchaseSumAmt = 0D;\t\t\t\t\t\t// 采购总金额\n private Double logisticsSumCost = 0D;\t\t\t\t\t // 物流总货款\n private Double salePrice = 0D;\t\t\t\t\t\t\t // 销售单价\n\n private Integer distributionWay = 0;\t\t\t\t\t// 配送方式 0-供方配送 1-自提 2-平台配送\n private String deliveryDate = \"\";\t\t\t\t\t\t// 交货日期\n private Integer receivableWay = 0;\t\t\t\t\t\t// 结算方式 0-全额授信 1-部分授信 2-款到发货\n private Double creditAmount = 0D;\t\t\t\t\t\t// 授信金额\n private Integer receivableDay = 0;\t\t\t\t\t\t// 货到收款天数- 账期\n\n private String packagSpec = \"\";\t\t\t\t\t\t// 包装规格\n\n private Double memberMoneyRate = 0D;\t\t\t\t\t// 服务费利率\n private\tDouble serviceAmt = 0D;\t\t\t\t\t\t// 服务费\n */\n /**\n * /order/purchase_save_sale_order // 一键下单 todo\n */\n @FormUrlEncoded\n @POST(\"order/purchase_save_sale_order\")\n Observable<VerifyData> postOrderData(@Field(\"token\") String token,\n @Field(\"memberPurchaseId\") Long memberPurchaseId,\n @Field(\"sellMemberQuoteId\") Long sellMemberQuoteId,\n @Field(\"saleSumQty\") Double saleSumQty,\n @Field(\"saleSumAmt\") Double saleSumAmt,\n @Field(\"purchaseSumQty\") Double purchaseSumQty,\n @Field(\"purchaseSumAmt\") Double purchaseSumAmt,\n @Field(\"logisticsSumCost\") Double logisticsSumCost,\n @Field(\"salePrice\") Double salePrice,\n @Field(\"distributionWay\") int distributionWay,\n @Field(\"deliveryDate\") String deliveryDate,\n @Field(\"receivableWay\") int receivableWay,\n @Field(\"creditAmount\") Double creditAmount,\n @Field(\"receivableDay\") int receivableDay,\n @Field(\"packagSpec\") String packagSpec,\n @Field(\"memberMoneyRate\") Double memberMoneyRate,\n @Field(\"serviceAmt\") Double serviceAmt);\n\n\n\n\n\n /**\n * OrderFragment 订单列表\n * @param token\n * @param subStatus\n * 10-待审核 12-待支付手续费 11-待上传采购合同\n * 20-待收款 30-待付款 40-待发货 50-待确认收货\n * 90-交易失败 100-待开票? 101-待开票审核? 102-交易成功\n */\n @GET(\"order/query_order_list\")\n Observable<OrdersData> getOrderData(@Query(\"token\") String token,\n @Query(\"subStatus\") String subStatus,\n @Query(\"pageNum\") int pageNum,\n @Query(\"pageSize\") int pageSize);\n\n /**\n * 订单详情\n * order/query_order_detail?token&orderId\n */\n @GET(\"order/query_order_detail\")\n Observable<OrderDetailData> getOrderDetailData(@Query(\"token\") String token,\n @Query(\"orderId\") String orderId);\n\n /**\n * 支付手续费\n * order/member_purchase_alipay_create?token&orderSn&goodsAmount 支付宝 todo\n * order/member_purchase_wx_create?token&orderSn&goodsAmount 微信 todo\n * private String operateStatus;\t// 操作状态 null没有; A0-支付手续费; A1-开票申请; A2-申请展期\n */\n\n // 支付宝支付\n @FormUrlEncoded\n @POST(\"order/member_purchase_alipay_create\")\n Observable<OrderData> postAliPayData(@Field(\"token\") String token,\n @Query(\"orderId\") String orderId,\n @Field(\"orderSn\") String orderSn,\n @Field(\"goodsAmount\") String goodsAmount);\n\n\n\n // 微信支付\n @FormUrlEncoded\n @POST(\"order/member_purchase_wx_create\")\n Observable<OrderPayData> postWeChatPayData(@Field(\"token\") String token,\n @Query(\"orderId\") String orderId,\n @Field(\"orderSn\") String orderSn,\n @Field(\"goodsAmount\") String goodsAmount);\n\n /**\n * rder/query_extends_days_detail?orderId&token 展期详情\n * order/save_extends_days 申请展期\n */\n @GET(\"order/query_extends_days_detail\")\n Observable<ExtensionData> getExtensionData(@Query(\"token\") String token,\n @Query(\"orderId\") String orderId);\n\n /**\n * order/save_extends_days 申请展期\n * private String token ;\n private Long orderId = 0L; // 订单Id\n private String contractCode = \"\"; // 关联合同号\n private Double amount = 0D; // 金额\n private Integer days = 0; // 天数\n private String note = \"\"; // 备注\n */\n\n @FormUrlEncoded\n @POST(\"order/save_extends_days\")\n Observable<VerifyData> postExtensionData(@Field(\"token\") String token,\n @Query(\"orderId\") long orderId,\n @Field(\"contractCode\") String contractCode,\n @Field(\"amount\") double amount,\n @Field(\"days\") int days,\n @Field(\"note\") String note);\n\n}",
"public static void main(String[] args) {\n\r\n\t\tCustomer customer0 = new Customer(2007, \"35621485268\", \"José Felipe Martins\", true, 590.9);\r\n\t\tCustomer customer1 = new Customer(1950, \"47821485297\", \"Maria Alice Barros\", true, 700);\r\n\t\tCustomer customer2 = new Customer(850, \"25521485858\", \"Carlos Eduardo\", true, 750);\r\n\t\tCustomer customer3 = new Customer(2150, \"32412587548\", \"Gev Alisson\", true, 400);\r\n\t\t\r\n\t\t//2 Criar um programa que percorra uma lista de objetos do tipo \r\n\t\t//criado acima e calcule a média do campo vl_total apenas para os \r\n\t\t//itens que este valor seja maior que 560 e o capo id_customer \r\n\t\t//esteja entre 1500 e 2700.\r\n\t\t\r\n\t\tList<Customer> lista = new ArrayList<Customer>();\r\n\t\tlista.add(customer0);\r\n\t\tlista.add(customer1);\r\n\t\tlista.add(customer2);\r\n\t\tlista.add(customer3);\r\n\t\t\r\n\t\tCustomerControl control = new CustomerControl();\r\n\t\tdouble media = control.CalcMedia(lista);\r\n\r\n\t\t//3 Exibir a média final.\r\n\t\tSystem.out.println(\"a media é: \"+ media);\r\n\t\t\r\n\t\t//4 Imprima cada um dos obejtos selecionados para o cálculo da média. \r\n\t\tSystem.out.println(\"objetos selecionados para media\\n\");\r\n\t\tfor(Customer c : control.selecionarParaMedia(lista)){\r\n\t\t\tSystem.out.println(c.toString());\r\n\t\t}\r\n\t\t//5 - 5 Ordene pelo campo vlTotal os objetos selecionados para o cálculo da média. \r\n\t\tList<Customer> listaOrdenada = control.Ordenar(control.selecionarParaMedia(lista));\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\n resultado da lista ordenada\");\r\n\t\tfor(Customer c : listaOrdenada){\r\n\t\t\tSystem.out.println(c.toString());\r\n\t\t}\r\n\r\n\t}",
"public TransactionResponse processAllTransaction() throws ParseException {\n TransactionResponse response = new TransactionResponse();\n\n //User0\n response.setTransaction(new Transaction(\"user0\",\"0001\", \"type0\",\"user0_Billing\",\"user0_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-00\")));\n\n //User1\n response.setTransaction(new Transaction(\"user1\", \"0101\",\"type0\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user1\", \"0102\", \"type1\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-00\")));\n\n //User2\n response.setTransaction(new Transaction(\"user2\", \"0201\", \"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-01-00\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0202\", \"type2\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0203\",\"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n //User3\n response.setTransaction(new Transaction(\"user3\", \"0301\",\"type0\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user3\", \"0302\",\"type1\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n return response;\n }",
"@SuppressWarnings(\"unchecked\")\n\t\tpublic void run() {\n long throughputMeasurementStartTime = System.currentTimeMillis();\n\n byte[] reply;\n int reqId;\n int req = 0;\n\n Storage st = new Storage(nTXs);\n\n System.out.println(\"Executing experiment for \" + nTXs + \" ops\");\n\n for (int i = 0; i < nTXs; i++, req++) {\n long last_send_instant = System.nanoTime();\n if (dos) {\n reqId = proxy.generateRequestId((readOnly) ? TOMMessageType.UNORDERED_REQUEST : TOMMessageType.ORDERED_REQUEST); \n proxy.TOMulticast(request, reqId, (readOnly) ? TOMMessageType.UNORDERED_REQUEST : TOMMessageType.ORDERED_REQUEST); \n\n } else {\n \tif(readOnly) {\n \t\treply = proxy.invokeUnordered(request);\n \t} else {\n \t\treply = proxy.invokeOrdered(request);\n \t}\n }\n st.store(System.nanoTime() - last_send_instant);\n\n if (timeout > 0) {\n //sleeps timeout ms before sending next request\n try {\n\t\t\t\t\t\tThread.sleep(timeout);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n } \n\n } \n writeReportJSON(throughputMeasurementStartTime, st); \n }",
"public void calculateFDR() {\n\t\tlogger.info(\"calculateFDR\");\n\t\t\n\t\tupdateDecoyStrategy();\n\t\t\n\t\tproteinModeller.calculateFDR();\n\t\t\n\t\tproteinModeller.sortReport(sortPanel.getSortPriorities(),\n\t\t\t\tsortPanel.getSortOrders());\n\t\t\n\t\tneedsRecaching = true;\n\t}",
"private Cliente obtenerDatosGeneralesCliente(Long oidCliente, Periodo peri)\n throws MareException {\n UtilidadesLog.info(\" DAOSolicitudes.obtenerDatosGeneralesCliente(Long oidCliente, Periodo peri):Entrada\");\n \n StringBuffer nombreCli = new StringBuffer();\n\n // crear cliente\n Cliente cliente = new Cliente();\n cliente.setOidCliente(oidCliente);\n\n // completar oidEstatus\n BigDecimal oidEstatus = null;\n\n {\n BelcorpService bs1;\n RecordSet respuesta1;\n String codigoError1;\n StringBuffer query1 = new StringBuffer();\n\n try {\n bs1 = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError1 = CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError1));\n }\n\n try {\n query1.append(\" SELECT CLIE_OID_CLIE, \");\n query1.append(\" ESTA_OID_ESTA_CLIE \");\n query1.append(\" FROM MAE_CLIEN_DATOS_ADICI \");\n query1.append(\" WHERE CLIE_OID_CLIE = \" + oidCliente);\n respuesta1 = bs1.dbService.executeStaticQuery(query1.toString());\n \n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"******* respuesta1 \" + respuesta1);\n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError1 = CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError1));\n }\n\n if (respuesta1.esVacio()) {\n cliente.setOidEstatus(null);\n } else {\n oidEstatus = (BigDecimal) respuesta1\n .getValueAt(0, \"ESTA_OID_ESTA_CLIE\");\n cliente.setOidEstatus((oidEstatus != null) ? new Long(\n oidEstatus.longValue()) : null);\n }\n }\n // completar oidEstatusFuturo\n {\n BelcorpService bs2;\n RecordSet respuesta2;\n String codigoError2;\n StringBuffer query2 = new StringBuffer();\n\n try {\n bs2 = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError2 = CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError2));\n }\n\n try {\n query2.append(\" SELECT OID_ESTA_CLIE, \");\n query2.append(\" ESTA_OID_ESTA_CLIE \");\n query2.append(\" FROM MAE_ESTAT_CLIEN \");\n query2.append(\" WHERE OID_ESTA_CLIE = \" + oidEstatus);\n respuesta2 = bs2.dbService.executeStaticQuery(query2.toString());\n \n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"******* respuesta2 \" + respuesta2); \n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError2 = CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError2));\n }\n\n if (respuesta2.esVacio()) {\n cliente.setOidEstatusFuturo(null);\n } else {\n {\n BigDecimal oidEstatusFuturo = (BigDecimal) respuesta2\n .getValueAt(0, \"ESTA_OID_ESTA_CLIE\");\n cliente.setOidEstatusFuturo((oidEstatusFuturo != null) \n ? new Long(oidEstatusFuturo.longValue()) : null);\n }\n }\n }\n // completar periodoPrimerContacto \n {\n BelcorpService bs3;\n RecordSet respuesta3;\n String codigoError3;\n StringBuffer query3 = new StringBuffer();\n\n try {\n bs3 = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError3 = CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError3));\n }\n\n try {\n query3.append(\" SELECT A.CLIE_OID_CLIE, \");\n query3.append(\" A.PERD_OID_PERI, \");\n query3.append(\" B.PAIS_OID_PAIS, \");\n query3.append(\" B.CANA_OID_CANA, \");\n query3.append(\" B.MARC_OID_MARC, \");\n query3.append(\" B.FEC_INIC, \");\n query3.append(\" B.FEC_FINA, \");\n query3.append(\" C.COD_PERI \");\n query3.append(\" FROM MAE_CLIEN_PRIME_CONTA A, \");\n query3.append(\" CRA_PERIO B, \");\n query3.append(\" SEG_PERIO_CORPO C \");\n query3.append(\" WHERE A.CLIE_OID_CLIE = \" + oidCliente);\n query3.append(\" AND A.PERD_OID_PERI = B.OID_PERI \");\n query3.append(\" AND B.PERI_OID_PERI = C.OID_PERI \");\n respuesta3 = bs3.dbService.executeStaticQuery(query3.toString());\n \n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"******* respuesta3 \" + respuesta3); \n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError3 = CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError3));\n }\n\n if (respuesta3.esVacio()) {\n cliente.setPeriodoPrimerContacto(null);\n } else {\n Periodo periodo = new Periodo();\n\n {\n BigDecimal oidPeriodo = (BigDecimal) respuesta3\n .getValueAt(0, \"PERD_OID_PERI\");\n periodo.setOidPeriodo((oidPeriodo != null) \n ? new Long(oidPeriodo.longValue()) : null);\n }\n\n periodo.setCodperiodo((String) respuesta3\n .getValueAt(0, \"COD_PERI\"));\n periodo.setFechaDesde((Date) respuesta3\n .getValueAt(0, \"FEC_INIC\"));\n periodo.setFechaHasta((Date) respuesta3\n .getValueAt(0, \"FEC_FINA\"));\n periodo.setOidPais(new Long(((BigDecimal) respuesta3\n .getValueAt(0, \"PAIS_OID_PAIS\")).longValue()));\n periodo.setOidCanal(new Long(((BigDecimal) respuesta3\n .getValueAt(0, \"CANA_OID_CANA\")).longValue()));\n periodo.setOidMarca(new Long(((BigDecimal) respuesta3\n .getValueAt(0, \"MARC_OID_MARC\")).longValue()));\n cliente.setPeriodoPrimerContacto(periodo);\n }\n }\n // completar AmbitoGeografico\n {\n BelcorpService bs4;\n RecordSet respuesta4;\n String codigoError4;\n StringBuffer query4 = new StringBuffer();\n\n try {\n bs4 = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError4 = CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError4));\n }\n\n try {\n //jrivas 29/6/2005\n //Modificado INC. 19479\n SimpleDateFormat sdfFormato = new SimpleDateFormat(\"dd/MM/yyyy\");\n String fechaDesde = sdfFormato.format(peri.getFechaDesde());\n String fechaHasta = sdfFormato.format(peri.getFechaHasta());\n\n query4.append(\" SELECT sub.oid_subg_vent, reg.oid_regi, \");\n query4.append(\" zon.oid_zona, sec.oid_secc, \");\n query4.append(\" terr.terr_oid_terr, \");\n query4.append(\" sec.clie_oid_clie oid_lider, \");\n query4.append(\" zon.clie_oid_clie oid_gerente_zona, \");\n query4.append(\" reg.clie_oid_clie oid_gerente_region, \");\n query4.append(\" sub.clie_oid_clie oid_subgerente \");\n query4.append(\" FROM mae_clien_unida_admin una, \");\n query4.append(\" zon_terri_admin terr, \");\n query4.append(\" zon_secci sec, \");\n query4.append(\" zon_zona zon, \");\n query4.append(\" zon_regio reg, \");\n query4.append(\" zon_sub_geren_venta sub \");\n //jrivas 27/04/2006 INC DBLG50000361\n //query4.append(\" , cra_perio per1, \");\n //query4.append(\" cra_perio per2 \");\n query4.append(\" WHERE una.clie_oid_clie = \" + oidCliente);\n query4.append(\" AND una.ztad_oid_terr_admi = \");\n query4.append(\" terr.oid_terr_admi \");\n query4.append(\" AND terr.zscc_oid_secc = sec.oid_secc \");\n query4.append(\" AND sec.zzon_oid_zona = zon.oid_zona \");\n query4.append(\" AND zon.zorg_oid_regi = reg.oid_regi \");\n query4.append(\" AND reg.zsgv_oid_subg_vent = \");\n query4.append(\" sub.oid_subg_vent \");\n //jrivas 27/04/2006 INC DBLG50000361\n query4.append(\" AND una.perd_oid_peri_fin IS NULL \");\n \n // sapaza -- PER-SiCC-2013-0960 -- 03/09/2013\n //query4.append(\" AND una.ind_acti = 1 \");\n \n /*query4.append(\" AND una.perd_oid_peri_fin = \");\n query4.append(\" AND una.perd_oid_peri_ini = per1.oid_peri \");\n query4.append(\" per2.oid_peri(+) \");\n query4.append(\" AND per1.fec_inic <= TO_DATE ('\" + \n fechaDesde + \"', 'dd/MM/yyyy') \");\n query4.append(\" AND ( per2.fec_fina IS NULL OR \");\n query4.append(\" per2.fec_fina >= TO_DATE ('\" + fechaHasta \n + \"', 'dd/MM/yyyy') ) \");*/\n\n respuesta4 = bs4.dbService.executeStaticQuery(query4.toString());\n \n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"respuesta4: \" + respuesta4);\n \n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError4 = CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError4));\n }\n\n Gerente lider = new Gerente();\n Gerente gerenteZona = new Gerente();\n Gerente gerenteRegion = new Gerente();\n Gerente subGerente = new Gerente();\n\n if (respuesta4.esVacio()) {\n cliente.setAmbitoGeografico(null);\n } else {\n AmbitoGeografico ambito = new AmbitoGeografico();\n ambito.setOidSubgerencia(new Long(((BigDecimal) respuesta4\n .getValueAt(0, \"OID_SUBG_VENT\")).longValue()));\n ambito.setOidRegion(new Long(((BigDecimal) respuesta4\n .getValueAt(0, \"OID_REGI\")).longValue()));\n ambito.setOidZona(new Long(((BigDecimal) respuesta4\n .getValueAt(0, \"OID_ZONA\")).longValue()));\n ambito.setOidSeccion(new Long(((BigDecimal) respuesta4\n .getValueAt(0, \"OID_SECC\")).longValue()));\n\n //jrivas 29/6/2005\n //Modificado INC. 19479\n ambito.setOidTerritorio(new Long(((BigDecimal) respuesta4\n .getValueAt(0, \"TERR_OID_TERR\")).longValue()));\n\n if (respuesta4.getValueAt(0, \"OID_LIDER\") != null) {\n lider.setOidCliente(new Long(((BigDecimal) respuesta4\n .getValueAt(0, \"OID_LIDER\")).longValue()));\n }\n\n if (respuesta4.getValueAt(0, \"OID_GERENTE_ZONA\") != null) {\n gerenteZona.setOidCliente(new Long(((BigDecimal) respuesta4\n .getValueAt(0, \"OID_GERENTE_ZONA\")).longValue()));\n ;\n }\n\n if (respuesta4.getValueAt(0, \"OID_GERENTE_REGION\") != null) {\n gerenteRegion.setOidCliente(new Long(((BigDecimal) \n respuesta4.getValueAt(0, \"OID_GERENTE_REGION\"))\n .longValue()));\n }\n\n if (respuesta4.getValueAt(0, \"OID_SUBGERENTE\") != null) {\n subGerente.setOidCliente(new Long(((BigDecimal) respuesta4\n .getValueAt(0, \"OID_SUBGERENTE\")).longValue()));\n }\n\n ambito.setLider(lider);\n ambito.setGerenteZona(gerenteZona);\n ambito.setGerenteRegion(gerenteRegion);\n ambito.setSubgerente(subGerente);\n\n cliente.setAmbitoGeografico(ambito);\n }\n }\n // completar nombre\n {\n BelcorpService bs5;\n RecordSet respuesta5;\n String codigoError5;\n StringBuffer query5 = new StringBuffer();\n\n try {\n bs5 = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError5 = CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError5));\n }\n\n try {\n query5.append(\" SELECT OID_CLIE, \");\n query5.append(\" VAL_APE1, \");\n query5.append(\" VAL_APE2, \");\n query5.append(\" VAL_NOM1, \");\n query5.append(\" VAL_NOM2 \");\n query5.append(\" FROM MAE_CLIEN \");\n query5.append(\" WHERE OID_CLIE = \" + oidCliente.longValue());\n respuesta5 = bs5.dbService.executeStaticQuery(query5.toString());\n \n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"******* respuesta5 \" + respuesta5);\n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError5 = CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError5));\n }\n\n if (respuesta5.esVacio()) {\n cliente.setNombre(null);\n } else {\n \n if(respuesta5.getValueAt(0, \"VAL_NOM1\")!=null) {\n nombreCli.append((String) respuesta5.getValueAt(0, \"VAL_NOM1\"));\n }\n \n if(respuesta5.getValueAt(0, \"VAL_NOM2\")!=null) {\n if(nombreCli.length()!=0) {\n nombreCli.append(\" \");\n }\n nombreCli.append((String) respuesta5.getValueAt(0, \"VAL_NOM2\"));\n }\n \n if(respuesta5.getValueAt(0, \"VAL_APE1\")!=null) {\n if(nombreCli.length()!=0) {\n nombreCli.append(\" \");\n }\n nombreCli.append((String) respuesta5.getValueAt(0, \"VAL_APE1\"));\n }\n \n if(respuesta5.getValueAt(0, \"VAL_APE2\")!=null) {\n if(nombreCli.length()!=0) {\n nombreCli.append(\" \");\n }\n nombreCli.append((String) respuesta5.getValueAt(0, \"VAL_APE2\"));\n }\n \n cliente.setNombre(nombreCli.toString());\n }\n }\n\n UtilidadesLog.info(\" DAOSolicitudes.obtenerDatosGeneralesCliente(Long oidCliente, Periodo peri):Salida\");\n return cliente;\n }",
"@RequestMapping(method = RequestMethod.POST)\n\tpublic String processRegistration(@ModelAttribute(\"convertMain\") userOption userDetails, \n\t\t\tMap<String, Object> model) {\n\t\t\n\t\tconveter myConverter = new conveter(userDetails.getUserInput());\n\t\t\n\t\t double resultMileToKilo =myConverter.convertMileToKilometers(myConverter.getUserInput());\n\t\tSystem.out.println(\"user input: \" +userDetails.getUserInput());\n\t\tSystem.out.println(\"convert from : \" + userDetails.getSelectedConvFrom());\n\t\tSystem.out.println(\"convert to : \" + userDetails.getSelectedConvTo());\n\t\t//System.out.println(\"mile: \"+myConverter.getUserInput()+\" to kilometers : \"+resultMileToKilo);\n\n\t\tif(userDetails.getSelectedConvFrom().equalsIgnoreCase(userDetails.getSelectedConvTo()))\n\t\t{\n\t\t\treturn \"errorPage\";\n\t\t}\n\t\t\n\t\t//compute\n\t\tdouble result=myConverter.computeCalc(userDetails.getSelectedConvFrom(), userDetails.getSelectedConvTo(), userDetails.getUserInput());\n\t\tString unitlength=myConverter.getUnit(userDetails.getSelectedConvTo());\n\t\t\n\t\t\n\t\tSystem.out.println(\"results: \"+result);\n\t\tmodel.put(\"resultsvalue\", result+unitlength);\n\t\treturn \"results\";\n\t\t\n\t\t\n\t}",
"private String createValues() {\n String values = getLatitude(\"\");\n if (getLongitude() != FLOATNULL) {\n values = values + \",\" + getLongitude(\"\");\n } // if getLongitude\n if (getDepth() != FLOATNULL) {\n values = values + \",\" + getDepth(\"\");\n } // if getDepth\n if (getTemperatureMin() != FLOATNULL) {\n values = values + \",\" + getTemperatureMin(\"\");\n } // if getTemperatureMin\n if (getTemperatureMax() != FLOATNULL) {\n values = values + \",\" + getTemperatureMax(\"\");\n } // if getTemperatureMax\n if (getSalinityMin() != FLOATNULL) {\n values = values + \",\" + getSalinityMin(\"\");\n } // if getSalinityMin\n if (getSalinityMax() != FLOATNULL) {\n values = values + \",\" + getSalinityMax(\"\");\n } // if getSalinityMax\n if (getOxygenMin() != FLOATNULL) {\n values = values + \",\" + getOxygenMin(\"\");\n } // if getOxygenMin\n if (getOxygenMax() != FLOATNULL) {\n values = values + \",\" + getOxygenMax(\"\");\n } // if getOxygenMax\n if (getNitrateMin() != FLOATNULL) {\n values = values + \",\" + getNitrateMin(\"\");\n } // if getNitrateMin\n if (getNitrateMax() != FLOATNULL) {\n values = values + \",\" + getNitrateMax(\"\");\n } // if getNitrateMax\n if (getPhosphateMin() != FLOATNULL) {\n values = values + \",\" + getPhosphateMin(\"\");\n } // if getPhosphateMin\n if (getPhosphateMax() != FLOATNULL) {\n values = values + \",\" + getPhosphateMax(\"\");\n } // if getPhosphateMax\n if (getSilicateMin() != FLOATNULL) {\n values = values + \",\" + getSilicateMin(\"\");\n } // if getSilicateMin\n if (getSilicateMax() != FLOATNULL) {\n values = values + \",\" + getSilicateMax(\"\");\n } // if getSilicateMax\n if (getChlorophyllMin() != FLOATNULL) {\n values = values + \",\" + getChlorophyllMin(\"\");\n } // if getChlorophyllMin\n if (getChlorophyllMax() != FLOATNULL) {\n values = values + \",\" + getChlorophyllMax(\"\");\n } // if getChlorophyllMax\n if (dbg) System.out.println (\"<br>values = \" + values); // debug\n return values;\n }",
"@Override\n protected String doInBackground(String... params) {\n String report = RESTClientAPI.reportCaloriesBalancePerPeriod(userId,params[0],params[1]);\n return report;\n }",
"public String getAllDataForAttributes() throws Exception {\n\t\tactionStartTime = new Date();\n\t\ttry {\n\t\t\tif (lstObjectType != null && lstObjectType.size() > 0 && lstId != null && lstId.size() > 0 && lstObjectType.size() == lstId.size()) { //lstId = listObjectId\n\t\t\t\tList<PromotionCustAttrVO> lst = new ArrayList<PromotionCustAttrVO>();\n\t\t\t\tPromotionCustAttrVO vo;\n\t\t\t\tInteger objectType;\n\t\t\t\tLong objectId;\n\t\t\t\tCustomerAttribute attribute;\n\t\t\t\tAttributeColumnType attColType;\n\t\t\t\tList<AttributeDetailVO> lstAttDetail;\n\t\t\t\tfor (int i = 0; i < lstObjectType.size(); i++) {\n\t\t\t\t\tobjectType = lstObjectType.get(i);\n\t\t\t\t\tobjectId = lstId.get(i);\n\t\t\t\t\tif (objectType != null) {\n\t\t\t\t\t\tvo = new PromotionCustAttrVO();\n\t\t\t\t\t\tvo.setObjectType(objectType);\n\t\t\t\t\t\tvo.setObjectId(objectId);\n\t\t\t\t\t\tif (objectType.equals(AUTO_ATTRIBUTE)) {\n\t\t\t\t\t\t\tattribute = customerAttributeMgr.getCustomerAttributeById(objectId);\n\t\t\t\t\t\t\tif (attribute != null) {\n\t\t\t\t\t\t\t\tattColType = attribute.getValueType();\n\t\t\t\t\t\t\t\tvo.setValueType(attColType);// setValueType\n\t\t\t\t\t\t\t\tvo.setName(attribute.getName());\n\t\t\t\t\t\t\t\t// chi set du lieu cho kieu dropdownlist:\n\t\t\t\t\t\t\t\tif (attColType == AttributeColumnType.CHOICE || attColType == AttributeColumnType.MULTI_CHOICE) {\n\t\t\t\t\t\t\t\t\tlstAttDetail = promotionProgramMgr.getListPromotionCustAttVOCanBeSet(attribute.getId());\n\t\t\t\t\t\t\t\t\tvo.setListData(lstAttDetail);// setListData\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (objectType.equals(CUSTOMER_TYPE)) {\n\t\t\t\t\t\t\tList<ChannelTypeVO> listChannelTypeVO = promotionProgramMgr.getListChannelTypeVO();\n\t\t\t\t\t\t\tvo.setListData(listChannelTypeVO);//setListData\n\t\t\t\t\t\t} else if (objectType.equals(SALE_LEVEL)) {\n\t\t\t\t\t\t\tList<ProductInfoVO> listProductInfoVO = promotionProgramMgr.getListProductInfoVO();\n\t\t\t\t\t\t\tif (listProductInfoVO != null && listProductInfoVO.size() > 0) {\n\t\t\t\t\t\t\t\tfor (ProductInfoVO productInfoVO : listProductInfoVO) {\n\t\t\t\t\t\t\t\t\tList<SaleCatLevelVO> listSaleCatLevelVO = promotionProgramMgr.getListSaleCatLevelVOByIdPro(productInfoVO.getIdProductInfoVO());\n\t\t\t\t\t\t\t\t\tproductInfoVO.setListSaleCatLevelVO(listSaleCatLevelVO);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvo.setListProductInfoVO(listProductInfoVO);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlst.add(vo);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn JSON;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresult.put(\"list\", lst);\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tLogUtility.logErrorStandard(ex, R.getResource(\"web.log.message.error\", \"vnm.web.action.program.PromotionCatalogAction.getAllDataForAttributes\"), createLogErrorStandard(actionStartTime));\n\t\t\tresult.put(\"errMsg\", ValidateUtil.getErrorMsg(ConstantManager.ERR_SYSTEM));\n\t\t\tresult.put(ERROR, true);\n\t\t\treturn JSON;\n\t\t}\n\t\treturn JSON;\n\t}",
"@RequestMapping(params = \"action=fecha\")\r\n\t\tpublic String cargarResumenDiaMGC(Model model) {\r\n\t\t\tLong t1 = System.currentTimeMillis();\r\n\t\t\tthis.cargaDatosBasicos(model);\r\n\t\t\tmodel.addAttribute(\"resumen\", true);\r\n\r\n\t\t\tLong t2 = System.currentTimeMillis();\r\n\t\t\tLong t = (t2 - t1) / 1000;\r\n\t\t\tlog\r\n\t\t\t\t\t.info(\"El tiempo en el método cargarResumenDia de ResumenAccionesMGCPortlet es =\"\r\n\t\t\t\t\t\t\t+ t);\r\n\t\t\treturn \"accionesMGCResumen\";\r\n\t\t}",
"public interface CurrencyRatesUpdater {\n\n public static final String ERROR_CONNECTING = \"ERROR_CONNECTING\";\n public static final String ERROR_RESPONSE = \"ERROR_RESPONSE\";\n public static final String ERROR_UNKNOWN = \"ERROR_UNKNOWN\";\n\n public ResponseRateUpdate getRate(String fromCurrencyCode, String toCurrencyCode);\n\n public class ResponseRateUpdate {\n\n public ResponseRateUpdate() {\n }\n\n public ResponseRateUpdate(Double rateValue, Date rateDate) {\n this.rateValue = rateValue;\n this.rateDate = rateDate;\n }\n\n public ResponseRateUpdate(String error) {\n this.error = error;\n }\n\n private Double reverseRateValue;\n private Double rateValue;\n private Date rateDate;\n private String error;\n\n public Double getRateValue() {\n return rateValue;\n }\n\n public void setRateValue(Double rateValue) {\n this.rateValue = rateValue;\n }\n\n public Date getRateDate() {\n return rateDate;\n }\n\n public void setRateDate(Date rateDate) {\n this.rateDate = rateDate;\n }\n\n public Double getReverseRateValue() {\n return reverseRateValue;\n }\n\n public void setReverseRateValue(Double reverseRateValue) {\n this.reverseRateValue = reverseRateValue;\n }\n\n public String getError() {\n return error;\n }\n\n public void setError(String error) {\n this.error = error;\n }\n }\n}",
"public boolean gen_plan(Users currentUser){\n\n\t\ttry {\n\t\t\tConnection connection = this.getConnection();\n\t\t\tString gender =Character.toString(currentUser.getGender());\n\n//\t\t\tif(search_intake_reference(gender,currentUser.getAge())) {\n\t\t\t\tArrayList<Double> plan = new ArrayList<Double>();\n\t\t\t\tPreparedStatement ref = connection.prepareStatement(\"SELECT * FROM intake_reference WHERE gender = ? AND min_age <= ? AND max_age >= ?\" );\n\t\t\t\tref.setString(1, gender);\n\t\t\t\tref.setInt(2, currentUser.getAge());\n\t\t\t\tref.setInt(3, currentUser.getAge());\n\t\t\t\tResultSet result = ref.executeQuery();\n\t\t\t\twhile (result.next()) {\n\t\t\t\t\tplan.add(result.getDouble(8));//fiber0\n\t\t\t\t\tplan.add(result.getDouble(9));//energy1\n\t\t\t\t\tplan.add(result.getDouble(10));//protein2\n\n\t\t\t\t\tplan.add(result.getDouble(4));//fiber_serve3\n\t\t\t\t\tplan.add(result.getDouble(5));//energy_serve4\n\t\t\t\t\tplan.add(result.getDouble(6));//meat_serve5\n\t\t\t\t\tplan.add(result.getDouble(7));//milk_serve6\n\t\t\t\t}\n\n\t\t\t\tref.close();\n\t\t\t\tresult.close();\n\n\t\t\t\tPreparedStatement stmt = connection.prepareStatement(\n\t\t\t\t\t\t\"INSERT INTO diet_plan VALUES (?,?,?,?,?,?,?,?,?,?)\");//id | fiber | energy | protein | food_name | food_amount\n\t\t\t\t//String gender = new StringBuilder().append(\"\").append(currentUser.getGender()).toString();\n\n\t\t\t\tstmt.setString(1, currentUser.getID());\n\n\t\t\t\tstmt.setDouble(2, plan.get(0));//fiber\n\t\t\t\tstmt.setDouble(3, plan.get(1));//energy\n\t\t\t\tstmt.setDouble(4, plan.get(2));//protein\n//\t\t\t\tstmt.setDouble(2, 0.5);//fiber\n//\t\t\t\tstmt.setDouble(3, 0.5);//energy\n//\t\t\t\tstmt.setDouble(4, 0.5);//protein\n\n\t\t\t\t//set the food_name\n\t//\t\t\tstmt.setString(5,\"default\");//default value\n\t//\t\t\t//set the food_amount\n\t\t\t\t//set the food_name\n\t\t\t String[] food_name = new String[2];\n\t\t\t food_name[0] = \"apple\";\n\t\t\t food_name[1] = \"milk\";\n\t\t\t Array sqlArray1 = connection.createArrayOf(\"text\",food_name);\n\t\t\t stmt.setArray(5,sqlArray1);\n\t\t\t //set the food_amount\n\t\t\t //int[] food_amount = new int[2];\n\t\t\t Integer[] food_amount = new Integer[2];\n\t\t\t food_amount[0] = 10;\n\t\t\t food_amount[1] = 5;\n\t\t\t Array sqlArray2 = connection.createArrayOf(\"integer\",food_amount);\n\t\t\t stmt.setArray(6,sqlArray2);\n\t//\t\t\tString[] food_name = new String[2];\n\t//\t\t\tint[] food_amount = new int[2];\n\t//\t\t\tstmt.setArray(5, food_name);//fiber_serve\n\t//\t\t\tstmt.setArray(6, food_amount);//energy_serve\n\t//\t\t\tstmt.setString(6,\"default\");//default value\n//\t\t\t\tstmt.setDouble(7, 0.5);//fiber_serve\n//\t\t\t\tstmt.setDouble(8, 0.5);//energy_serve\n//\t\t\t\tstmt.setDouble(9, 0.5);//meat_serve\n//\t\t\t\tstmt.setDouble(10, 0.5);//milk_serve\n\t\t\t\tstmt.setDouble(7, plan.get(3));//fiber_serve\n\t\t\t\tstmt.setDouble(8, plan.get(4));//energy_serve\n\t\t\t\tstmt.setDouble(9, plan.get(5));//meat_serve\n\t\t\t\tstmt.setDouble(10, plan.get(6));//milk_serve\n\n\t\t\t\tstmt.execute();\n\t\t\t\tstmt.close();\n\t\t\t\tconnection.close();\n\n//\t\t\t}\n//\t\t\telse {\n//\t\t\t\tPreparedStatement stmt = connection.prepareStatement(\n//\t\t\t\t\t\t\"INSERT INTO diet_plan VALUES (?,?,?,?,?,?,?,?,?,?)\");//id | fiber | energy | protein | food_name | food_amount\n//\n//\t\t\t\tstmt.setString(1, currentUser.getID());\n//\t\t\t\tstmt.setDouble(2, 40);//fiber\n//\t\t\t\tstmt.setDouble(3, 717);//energy\n//\t\t\t\tstmt.setDouble(4, 57);//protein\n//\t\t\t\t//set the food_name\n////\t\t\t\tstmt.setString(5,\"default\");//default value\n////\t\t\t\t//set the food_amount\n//\t\t\t\t//set the food_name\n//\t\t\t\t String[] food_name = new String[2];\n//\t\t\t\t food_name[0] = \"apple\";\n//\t\t\t\t food_name[1] = \"milk\";\n//\t\t\t\t Array sqlArray1 = connection.createArrayOf(\"text\",food_name);\n//\t\t\t\t stmt.setArray(5,sqlArray1);\n//\t\t\t\t //set the food_amount\n//\t\t\t\t //int[] food_amount = new int[2];\n//\t\t\t\t Integer[] food_amount = new Integer[2];\n//\t\t\t\t food_amount[0] = 10;\n//\t\t\t\t food_amount[1] = 5;\n//\t\t\t\t Array sqlArray2 = connection.createArrayOf(\"integer\",food_amount);\n//\t\t\t\t stmt.setArray(6,sqlArray2);\n////\t\t\t\tString[] food_name = new String[2];\n////\t\t\t\tint[] food_amount = new int[2];\n////\t\t\t\tstmt.setArray(5, food_name);//fiber_serve\n////\t\t\t\tstmt.setArray(6, food_amount);//energy_serve\n////\t\t\t\tstmt.setString(6,\"default\");//default value\n//\t\t\t\tstmt.setDouble(7, 8);//fiber_serve\n//\t\t\t\tstmt.setDouble(8, 6);//energy_serve\n//\t\t\t\tstmt.setDouble(9, 3);//meat_serve\n//\t\t\t\tstmt.setDouble(10, 2.5);//milk_serve\n//\n//\t\t\t\tstmt.execute();\n//\t\t\t\tstmt.close();\n//\t\t\t\tconnection.close();\n//\t\t\t}\n\n\t\t} catch (Exception e) {\n\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public void init()\n {\n boolean tHotspot = true;\n // Figures below valid for 1000TPS\n double tGcRateFactor = 1000.0D / ((1000.0D * 1000.0) * cClientTransPerMicro) ;\n if (tHotspot)\n {\n // tax average 6ms, max 65, every 20 seconds\n // me1 27ms, max 83ms, every 20 seconds\n // me1s 27ms, max 87, every 22seconds\n mTaxJvm = new GcService(9908.0D*1000 * tGcRateFactor, 9.0D*1000); \n mMeJvm = new GcService(2509.0D*1000 * tGcRateFactor, 17.0D*1000); \n mMeStandbyJvm = new GcService(2257.0D*1000 * tGcRateFactor, 15.0D*1000);\n }\n else\n {\n // Metronome \n mTaxJvm = new GcService(100*1000, 500);\n mMeJvm = new GcService(100*1000, 500);\n mMeStandbyJvm = new GcService(100*1000, 500);\n }\n\n String tName;\n mClient.init(new ServerConfig(mClient, mClientTaxNwDelay, \"Client\", cClientCount, cClientCount, 0.1));\n {\n mClientTaxNwDelay.init(new ServerConfig(mClientTaxNwDelay, mTaxTcp, \"ClientTaxNwDelay\", 1, 1, 0.1)); \n {\n tName = \"TaxServer\";\n mTaxTcp.init(new ServerConfig(mTaxJvm, mTaxTcp, mTaxPool, tName + \"_Tcp\", 1, 1, 22)); \n mTaxPool.init(new ServerConfig(mTaxJvm, mTaxPool, mTaxMeNwDelay, tName + \"_ServerPool\", 5, 150, 11)); \n\n {\n mTaxMeNwDelay.init(new ServerConfig(mTaxMeNwDelay, mMePrimaryTcp, \"TaxMeNwDelay\", 1, 1, 100)); \n {\n tName=\"MatchingEngine\";\n mMePrimaryTcp.init(new ServerConfig(mMeJvm, mMePrimaryTcp, mMePrimaryServerPool, tName + \"Tcp\", 1, 1, 14));\n mMePrimaryServerPool.init(new ServerConfig(mMeJvm, mMePrimaryServerPool, mMePrimarySorter, tName + \"_ServerPool\", 5, 150, 12)); \n mMePrimarySorter.init(new ServerConfig(mMeJvm, mMePrimarySorter, mMePrimaryChainUnit0, tName + \"_Sorter\", 1, 1, 13));\n mMePrimaryChainUnit0.init(new ServerConfig(mMeJvm, mMePrimaryChainUnit0, mMePrimaryPostChain, tName + \"_ChainUnit0\", 1, 1, 59)); \n mMePrimaryBatchSender.init(new ServerConfig(mMeJvm, mMePrimaryBatchSender, mMeMesNwDelay, tName + \"_BatchSender\", 10, 10, 1)); \n mMePrimaryRecoveryLog.init(new ServerConfig(mMeJvm, mMePrimaryRecoveryLog, mMePrimaryPostChain, tName + \"_RecoveryLog\", 1, 1, 50)); \n mMePrimaryPostChain.init(new ServerConfig(mMeJvm, mMePrimaryPostChain, mMePrimaryResponsePool, tName + \"_PostChain\", 1, 1, 46)); \n mMePrimaryResponsePool.init(new ServerConfig(mMeJvm, mMePrimaryResponsePool, mMeTaxNwDelay, tName + \"_ResponsePool\", 5, 25, 16)); \n\n {\n mMeMesNwDelay.init(new ServerConfig(mMeMesNwDelay, mMeStandbyTcp, \"MeMesNwDelay\", 1, 1, 90)); \n {\n tName=\"MatchingEngineStandby\";\n mMeStandbyTcp.init(new ServerConfig(mMeStandbyJvm, mMeStandbyTcp, mMeStandbyServerPool, tName + \"_Tcp\", 1, 1, 13)); \n mMeStandbyServerPool.init(new ServerConfig(mMeStandbyJvm, mMeStandbyServerPool, mMesMeNwDelay, tName + \"_ServerPool\", 5, 150, 18)); \n }\n mMesMeNwDelay.init(new ServerConfig(mMesMeNwDelay, mMePrimaryPostChain, \"MesMeNwDelay\", 1, 1, 90)); \n }\n }\n mMeTaxNwDelay.init(new ServerConfig(mMeTaxNwDelay, mTaxCollector, \"MeTaxNwDelay\", 1, 1, 100));\n }\n } \n mTaxCollector.init(new ServerConfig(mTaxJvm, mTaxCollector, mTaxClientNwDelay, tName + \"_Collector\", 1, 1, 0.1)); \n mTaxClientNwDelay.init(new ServerConfig(mTaxClientNwDelay, null, \"TaxClientNwDelay\", 1, 1, 0.1));\n }\n }",
"CarPaymentMethod processHotDollars();",
"public void startdirectCharge(\n\n net.wit.webservice.TerminalServiceXmlServiceStub.DirectCharge directCharge14,\n\n final net.wit.webservice.TerminalServiceXmlServiceCallbackHandler callback)\n\n throws java.rmi.RemoteException{\n\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[7].getName());\n _operationClient.getOptions().setAction(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml/TerminalServiceXml/directChargeRequest\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env=null;\n final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n //Style is Doc.\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n directCharge14,\n optimizeContent(new javax.xml.namespace.QName(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml\",\n \"directCharge\")), new javax.xml.namespace.QName(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml\",\n \"directCharge\"));\n \n // adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // create message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message context to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n\n \n _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() {\n public void onMessage(org.apache.axis2.context.MessageContext resultContext) {\n try {\n org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope();\n \n java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(),\n net.wit.webservice.TerminalServiceXmlServiceStub.DirectChargeResponse.class,\n getEnvelopeNamespaces(resultEnv));\n callback.receiveResultdirectCharge(\n (net.wit.webservice.TerminalServiceXmlServiceStub.DirectChargeResponse)object);\n \n } catch (org.apache.axis2.AxisFault e) {\n callback.receiveErrordirectCharge(e);\n }\n }\n\n public void onError(java.lang.Exception error) {\n\t\t\t\t\t\t\t\tif (error instanceof org.apache.axis2.AxisFault) {\n\t\t\t\t\t\t\t\t\torg.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error;\n\t\t\t\t\t\t\t\t\torg.apache.axiom.om.OMElement faultElt = f.getDetail();\n\t\t\t\t\t\t\t\t\tif (faultElt!=null){\n\t\t\t\t\t\t\t\t\t\tif (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"directCharge\"))){\n\t\t\t\t\t\t\t\t\t\t\t//make the fault by reflection\n\t\t\t\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"directCharge\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class);\n java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage());\n\t\t\t\t\t\t\t\t\t\t\t\t\t//message class\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"directCharge\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew java.lang.Class[]{messageClass});\n\t\t\t\t\t\t\t\t\t\t\t\t\tm.invoke(ex,new java.lang.Object[]{messageObject});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t callback.receiveErrordirectCharge(new java.rmi.RemoteException(ex.getMessage(), ex));\n } catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrordirectCharge(f);\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrordirectCharge(f);\n } catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrordirectCharge(f);\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrordirectCharge(f);\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrordirectCharge(f);\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrordirectCharge(f);\n } catch (org.apache.axis2.AxisFault e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrordirectCharge(f);\n }\n\t\t\t\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t\t\t\t callback.receiveErrordirectCharge(f);\n\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 callback.receiveErrordirectCharge(f);\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 callback.receiveErrordirectCharge(error);\n\t\t\t\t\t\t\t\t}\n }\n\n public void onFault(org.apache.axis2.context.MessageContext faultContext) {\n org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext);\n onError(fault);\n }\n\n public void onComplete() {\n try {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n } catch (org.apache.axis2.AxisFault axisFault) {\n callback.receiveErrordirectCharge(axisFault);\n }\n }\n });\n \n\n org.apache.axis2.util.CallbackReceiver _callbackReceiver = null;\n if ( _operations[7].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) {\n _callbackReceiver = new org.apache.axis2.util.CallbackReceiver();\n _operations[7].setMessageReceiver(\n _callbackReceiver);\n }\n\n //execute the operation client\n _operationClient.execute(false);\n\n }",
"@RequestMapping(path=\"/initPaymentGet\", method = RequestMethod.GET)//, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)\n\tpublic ResponseEntity<Object> test() {\n\t\tlogger.info(\"Init payment\");\n\t\t//System.out.println(\"DTO: \" + btcDTO.getPrice_currency());\n\t\tString pom = \"\";\n\t\tRestTemplate restTemplate = new RestTemplate();\n\t\t\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\theaders.add(\"Authorization\", \"ab7fzPdN49-xBVoY_LdSifCZiVrqCbdcfjWdweJS\");\n\t\tResponseEntity<String> responseEntity = new RestTemplate().exchange(CREATE_ORDER_API, HttpMethod.GET,\n\t\t\t\tnew HttpEntity<String>(pom, headers), String.class);\n\n\t\t//restTemplate.getForEntity(\"https://google.rs\", String.class);\n\t\t//ResponseEntity<String> response = restTemplate.getForEntity(\"https://api-sandbox.coingate.com/v2/orders\", String.class);\n\t\t//ResponseEntity<String> response = restTemplate.postForEntity(\"https://api.coingate.com/v2/orders\", btcDTO, String.class);\n\t\t\n\t\treturn new ResponseEntity<Object>(responseEntity,HttpStatus.OK);\n\t}"
] | [
"0.694999",
"0.5785911",
"0.57022923",
"0.5599027",
"0.5525465",
"0.5443698",
"0.51456684",
"0.51331246",
"0.5132765",
"0.51076734",
"0.51025283",
"0.5070332",
"0.50510067",
"0.50452065",
"0.5023069",
"0.497227",
"0.4943914",
"0.49227822",
"0.49221504",
"0.48904502",
"0.48848954",
"0.4881245",
"0.48804674",
"0.4848099",
"0.48267308",
"0.4825405",
"0.48096082",
"0.47984338",
"0.4798091",
"0.479053",
"0.47897434",
"0.4768551",
"0.47644037",
"0.47571757",
"0.47564423",
"0.4755522",
"0.47435868",
"0.47372392",
"0.4729178",
"0.47251973",
"0.4724143",
"0.46998167",
"0.46951973",
"0.46936488",
"0.467453",
"0.46625867",
"0.46576408",
"0.46563345",
"0.46518236",
"0.46490502",
"0.46410257",
"0.4632672",
"0.46326172",
"0.46285728",
"0.46200436",
"0.46039575",
"0.46021357",
"0.45935157",
"0.4575889",
"0.45711228",
"0.45690477",
"0.45659828",
"0.45469353",
"0.4542875",
"0.45390642",
"0.45347518",
"0.4533926",
"0.45313713",
"0.45256215",
"0.4516094",
"0.45133594",
"0.4513267",
"0.45132208",
"0.45125255",
"0.45076767",
"0.45063335",
"0.45020393",
"0.44979334",
"0.4496842",
"0.44941247",
"0.44924873",
"0.44901258",
"0.44862524",
"0.44835487",
"0.4477386",
"0.44718134",
"0.4471134",
"0.44664684",
"0.44612187",
"0.44604543",
"0.4441542",
"0.4437478",
"0.44373032",
"0.44369432",
"0.44297335",
"0.442889",
"0.44256267",
"0.44233152",
"0.44209847",
"0.44204405",
"0.44160947"
] | 0.0 | -1 |
This method computes the cost of a period based on the established period of charging, the time that has being used and the price. Pseudo Code: 1. Get which time policy has been selected (D, W, M and Y for day, week, month and year) 2. Apply the quantity that comes in the period String (1,2,3...) 3. Computes the price and returns it | private double computeCost(String period, long time, double price) {
logger.debug("Computing the price of the UDR.");
final int secondsPerDay = 86400;
final int secondsPerWeek = 604800;
final int secondsPerMonth = 2592000;//Based in 30 day month.
//TODO: Base the seconds per month in the real number of days of the month.
final int secondsPerYear = 31536000;
double finalPrice = 0.0;
int timePeriod = Integer.parseInt(String.valueOf(period.charAt(1)));
char periodPolicy = period.charAt(2);
switch (periodPolicy) {
case 'D':
finalPrice = (time / secondsPerDay * timePeriod) * price;
break;
case 'W':
finalPrice = (time / secondsPerWeek * timePeriod) * price;
break;
case 'M':
finalPrice = (time / secondsPerMonth * timePeriod) * price;
break;
case 'Y':
finalPrice = (time / secondsPerYear * timePeriod) * price;
break;
}
return finalPrice;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public Double computeCost(double time) {\n // get the time period and policy type\n int timePeriod = Integer.parseInt(period.substring(1, period.length()-1));\n char periodPolicy = period.charAt(period.length()-1);\n\n double finalPrice = 0.0;\n\n // compute the final price\n switch (periodPolicy) {\n case 'D':\n final int secondsPerDay = 86400;\n finalPrice = (time / (secondsPerDay * timePeriod)) * periodCost;\n break;\n case 'W':\n final int secondsPerWeek = 604800;\n finalPrice = (time / (secondsPerWeek * timePeriod)) * periodCost;\n break;\n case 'M':\n final int secondsPerMonth = secondsInMonth(2015, 10); // TODO do this based on real date\n finalPrice = (time / (secondsPerMonth * timePeriod)) * periodCost;\n break;\n case 'Y':\n final int secondsPerYear = 31536000;\n finalPrice = (time / (secondsPerYear * timePeriod)) * periodCost;\n break;\n }\n\n return finalPrice;\n }",
"private void calculatePrice() {\r\n int price = 0;\r\n int day = show.getDateTime().getDayOfMonth();\r\n int month = show.getDateTime().getMonthValue();\r\n \r\n for (int i = 0; i < seats.size(); i++) {\r\n String option = seats.get(i);\r\n \r\n if (Arrays.stream(sectionNames).parallel().anyMatch(option::contains)) {\r\n String section = option.replaceAll(\"\\\\d\",\"\");\r\n int number = Integer.parseInt(option.replaceAll(\"\\\\D+\",\"\"));\r\n \r\n if (section.equals(\"m\")) {\r\n if (number <= 100) {\r\n price += mainFloorPrice;\r\n } else {\r\n price += mainFloorPremium;\r\n }\r\n } else if (section.equals(\"sb\")) {\r\n if (number <= 25) {\r\n price += southBalconyPrice;\r\n } else {\r\n price += southBalconyPremium;\r\n }\r\n } else if (section.equals(\"wb\")) {\r\n price += westBalconyPrice;\r\n } else if (section.equals(\"eb\")) {\r\n price += eastBalconyPrice;\r\n }\r\n }\r\n }\r\n \r\n if (seats.size() >= 5 && seats.size() <= 10 && !(month == 12 && (day == 26 || day == 27))) {\r\n price -= (2 * seats.size());\r\n }\r\n \r\n if (seats.size() >= 11 && seats.size() <= 20 && !(month == 12 && (day == 26 || day == 27))) {\r\n price -= (5 * seats.size());\r\n }\r\n \r\n if (month == 12 && (day == 26 || day == 27)) {\r\n price = seats.size() * 20;\r\n }\r\n \r\n totalPrice = price;\r\n }",
"public void determineWeeklyPay(){\r\n weeklyPay = commission*sales;\r\n }",
"double calculatePrice(VehicleType vehicleType, Date entryTime, Date exitTime);",
"public double calcCost(){\n double cost = 0;\n cost += pMap.get(size);\n cost += cMap.get(crust);\n //Toppings are priced at 3.00 for 3-4 topppings, and 4.0 for 5+ toppings\n \n if(toppings !=null)\n {\n if((toppings.length == 3) || (toppings.length == 4)){\n cost += 3.0;\n }\n if (toppings.length > 4){\n cost += 4.0;\n }\n }\n \n return cost;\n }",
"public double getPrice(RequiredSpecs specs, int waitingTime){\r\n\t\tdouble priceMemory;\r\n\t\tdouble priceCPU;\r\n\t\tif(canRun(specs)){\r\n\t\t\tpriceMemory = specs.getMemory()*this.pricePerMemoryUnit*(1 - getFractionMemoryTaken());\r\n\t\t\tpriceCPU = specs.getCpu()*this.pricePerCpuUnit*(1 - getFractionCpuTaken());\r\n\t\t}else{\r\n\t\t\tpriceMemory = specs.getMemory()*this.pricePerMemoryUnit - this.discountPerWaitingSecond * waitingTime;\r\n\t\t\tpriceCPU = specs.getCpu()*this.pricePerCpuUnit - this.discountPerWaitingSecond * waitingTime;\r\n\t\t}\r\n\t\tdouble finalPrice = (priceMemory + priceCPU)*specs.getTime()*this.pricePerSecond;\r\n\t\tif(finalPrice <= 0){\r\n\t\t\treturn this.minPrice;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn (priceMemory + priceCPU)*specs.getTime()*this.pricePerSecond;\r\n\t\t}\r\n\t}",
"private void calculatePrice() {\n\t\tint temp = controller.getQualityPrice(hotel.getText(), quality.getText());\n\n\t\ttemp *= getDays();\n\n\t\tif (discountChoice > 0) {\n\t\t\tdouble discountTmp = (double) discountChoice / 100;\n\t\t\ttemp *= (1.00 - discountTmp);\n\t\t}\n\n\t\tprice.setText(Integer.toString(temp));\n\n\t}",
"public void period() {\n\t\tPeriod annually = Period.ofYears(1);\n\t\tPeriod quarterly = Period.ofMonths(3);\n\t\tPeriod everyThreeWeeks = Period.ofWeeks(3);\n\t\tPeriod everyOtherDay = Period.ofDays(2);\n\t\tPeriod everyYearAndAWeek = Period.of(1, 0, 7);\n\t\tLocalDate date = LocalDate.of(2014, Month.JANUARY, 20);\n\t\tdate = date.plus(annually);\n\t\tSystem.out.println(date);\n\t\tSystem.out.println(Period.of(0, 20, 47)); // P20M47D\n\t\tSystem.out.println(Period.of(2, 20, 47)); // P2Y20M47D\n\t}",
"double calculatePrice();",
"public double calculateCost(Purchase purchase);",
"public int calcMarketPrice() {\r\n player = Context.getInstance().getPlayer();\r\n //Random r = new Random();\r\n int techLevel = player.getCurrentPlanet().getTechLevel();\r\n Event event = player.getCurrentPlanet().getEvent();\r\n Resource resource = player.getCurrentPlanet().getResource();\r\n double price = basePrice;\r\n price += (ipl * (techLevel - mtlb)) + variance;\r\n if (player.getCurrentPlanet().getTechLevel() == this.ttp) {\r\n price *= Context.TECH_PRICE_MULT;\r\n }\r\n if (event.equals(this.ie)) {\r\n price *= event.getUpMult();\r\n } else if (event.equals(this.de)) {\r\n price *= event.getDownMult();\r\n }\r\n if (resource.equals(this.cr)) {\r\n price *= resource.getDownMult();\r\n } else if (resource.equals(this.er)) {\r\n price *= resource.getUpMult();\r\n }\r\n price *= (((double) player.getTrader() / DFIFTY) + 1.0);\r\n int finalPrice = (int) price;\r\n if (player.getTrader() > 0) {\r\n double discountedPrice = price;\r\n double trader = (double) player.getTrader();\r\n discountedPrice -= (price) * (4.0 * trader / PERCENT);\r\n return (int) discountedPrice;\r\n } else {\r\n return finalPrice;\r\n }\r\n }",
"public double calculatePayment (int hours);",
"public abstract double cost(List<Drink> drinks, Double originalPrice, String pattern);",
"double getPeriod();",
"double computePrintingCost(double price){\n //TODO calculate price and return it\n return price * printer.countCharactersPrinted();\n }",
"public void calcularCost() {\r\n cost = 0;\r\n int a = 0;\r\n try {\r\n String r = DataR.toString()+ \" \" + horaR;\r\n String d = DataD.toString()+ \" \" + horaD;\r\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\r\n Date dateR = simpleDateFormat.parse(r);\r\n Date dateD = simpleDateFormat.parse(d);\r\n a = (int) ((dateD.getTime() - dateR.getTime())/(1000*3600));\r\n \r\n \r\n } catch (ParseException ex) {\r\n Logger.getLogger(Reserva.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n if(a > 24) {\r\n cost += 15*(a/(24));\r\n a -= (((int)(a/24))*24);\r\n }\r\n if(a%3600 == 0) {\r\n cost += 1;\r\n }\r\n if(a%3600 > 0) {\r\n cost += 1;\r\n }\r\n \r\n }",
"public void computer()\n\t{\n\t\tif( this.days <= 5 )\n\t\t\tthis.charge = 500 * this.days ; \n\t\telse if( this.days <= 10)\n\t\t\tthis.charge = 400 * (this.days-5) + 2500 ; \n\t\telse\n\t\t\tthis.charge = 200 * (this.days-10) + 2500 + 2000 ;\n\t}",
"double getStockCostBasis(String date) throws IllegalArgumentException;",
"public float getCost(Date hour) {\r\n Iterator<Date> it = schedule.iterator();\r\n int i = 0;\r\n while (it.hasNext()) {\r\n if (it.next().after(hour)) {\r\n return cost.get(i);\r\n }\r\n i++;\r\n }\r\n return defaultCost;\r\n }",
"@Test\r\n\tpublic void testGetPlannedCapacity_Linear_Interval() {\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerLinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 300, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*150.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerLinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 450, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerLinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 900, 1500), 1e-8);\r\n\t\t\t\t\r\n\t\t\r\n\t}",
"double ComputeCost(double order, double tipPercent, double serviceRating, double foodRating)\r\n {\r\n // kazda gwiazdka to 2 procent od sumy zamówienia\r\n return order + order * (tipPercent/100) + (serviceRating * 0.02) * order + (foodRating * 0.02) * order;\r\n }",
"private double calculatePrice(String product) {\n randomDelay();\n return Math.random() * product.charAt(0) + product.charAt(1);\n }",
"protected double getPay() {\n\t\tint extraHrs = 0;\n\t\tif (this.hoursWrkd > 40) {\n\t\t\textraHrs = this.hoursWrkd - 40;\n\t\t\treturn (hourlyRate * 40) + (extraHrs * (hourlyRate * 1.5));\n\t\t} else {\n\t\t\treturn hoursWrkd * hourlyRate;\n\t\t}\t\t\n\t}",
"public int calculatePayDollarsPerHour() {\n int dollarsPerHour = BASE_RATE_DOLLARS_PER_HOUR;\n\n if (getHeight() >= TALL_INCHES && getWeight() < THIN_POUNDS)\n dollarsPerHour += TALL_THIN_BONUS_DOLLARS_PER_HOUR;\n if (isCanTravel())\n dollarsPerHour += TRAVEL_BONUS_DOLLARS_PER_HOUR;\n if (isSmokes())\n dollarsPerHour -= SMOKER_DEDUCTION_DOLLARS_PER_HOUR;\n\n return dollarsPerHour;\n }",
"org.hl7.fhir.Period getAppliesPeriod();",
"@Override\n public double getTotalCommission() {\n double cost = 0.0;\n //increase cost for each report in the order\n for (Report report : reports.keySet()) {\n //report cost depends on the WorkType\n //audits are not capped by max employee count\n //regular orders are limited by max employee count\n int employeeCount = reports.get(report);\n cost += workType.calculateReportCost(report, employeeCount);\n }\n //increase cost of order based on priority\n //critical orders increase based on their critical loading\n //regular orders don't have an effect\n cost = priorityType.loadCost(cost);\n return cost;\n }",
"private double crunchPut(Option o) {\n int i; \n int countTrial;\n double deltaT;\n deltaT = o.getTerm() / numIntervals;\n double NumTrial;\n double trialAverage = 0;\n double trialPayoff;\n double temp = 0;\n double simulationRunningSum, simulationAveragePayoff;\n double stock;\n Random r = new Random();\n simulationRunningSum = 0.0;\n for (countTrial = 1; countTrial <= numTrials; countTrial++) {\n stock = o.getsNought();\n NumTrial = 0.0;\n double nns = 0;\n for (i = 0; i < numIntervals; i++) {\n nns = r.nextGaussian();\n stock = stock * Math.exp((o.getRiskFreeRate() - o.getVolatility() * o.getVolatility() / 2) * deltaT\n + o.getVolatility() * nns * Math.sqrt(deltaT));\n NumTrial += stock;\n temp = stock;\n }\n if (o.getStyle() == OptionStyle.ASIAN) {\n trialAverage = NumTrial / numIntervals;\n } else if ((o.getStyle() == OptionStyle.AMERICAN) || (o.getStyle() == OptionStyle.EUROPEAN)) {\n trialAverage = temp;\n }\n trialPayoff = Math.max(o.getStrikeP() - trialAverage, 0.0);\n simulationRunningSum += trialPayoff;\n }\n simulationAveragePayoff = simulationRunningSum / numTrials;\n double valueOfOption;\n valueOfOption = simulationAveragePayoff * Math.exp(-o.getRiskFreeRate() * o.getTerm());\n System.out.print(valueOfOption);\n return valueOfOption;\n }",
"public double calcCost() {\n if (pizzaSize.equals(\"small\")) {\n return 10.0 + ((cheeseToppings + pepperoniToppings + veggieToppings) * 2);\n\n }\n else if (pizzaSize.equals(\"medium\")) {\n return 12.0 + ((cheeseToppings + pepperoniToppings + veggieToppings) * 2);\n }\n else {\n return 14.0 + ((cheeseToppings + pepperoniToppings + veggieToppings) * 2);\n }\n }",
"public double getCharges()\r\n {\r\n //variables\r\n double charges = 0.0;\r\n double parts = 0.0;\r\n double hours = 0.0;\r\n\r\n //get user input and change double\r\n parts = Double.parseDouble(chargeField.getText());\r\n hours = Double.parseDouble(hourField.getText());\r\n\r\n //math for charges\r\n charges = hours * LABOR_RATE + parts;\r\n return charges;\r\n }",
"float calculatePrice () \n\t{\n\t\tfloat final_price = 0;\n\t\tfinal_price = (float)(price * quantity); // price * number of items\n\t\tfinal_price += final_price*(.10); // add tax\n\t\tif(perishable.equals(\"P\"))\n\t\t{\n\t\t\tfloat ship = (float)(20* weight)*quantity; // add shipping\n\t\t\tship += ship*.20;\n\t\t\tfinal_price += ship;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfinal_price += (20* weight)*quantity; // add shipping\n\t\t}\n\t\treturn final_price;\n\t}",
"public static String[] getItemPrice(String type, String entity, String item, String uom, String curr) {\n\r\n String[] TypeAndPrice = new String[2]; \r\n String Type = \"none\";\r\n String price = \"0\";\r\n String pricecode = \"\";\r\n\r\n try{\r\n Connection con = null;\r\n if (ds != null) {\r\n con = ds.getConnection();\r\n } else {\r\n con = DriverManager.getConnection(url + db, user, pass); \r\n }\r\n Statement st = con.createStatement();\r\n ResultSet res = null;\r\n try{\r\n \r\n // customer based pricing\r\n if (type.equals(\"c\")) {\r\n res = st.executeQuery(\"select cm_price_code from cm_mstr where cm_code = \" + \"'\" + entity + \"'\" + \";\");\r\n while (res.next()) {\r\n pricecode = res.getString(\"cm_price_code\");\r\n } \r\n // if there is no pricecode....it defaults to billto\r\n if (! pricecode.isEmpty()) {\r\n entity = pricecode;\r\n }\r\n\r\n res = st.executeQuery(\"select cpr_price from cpr_mstr where cpr_cust = \" + \"'\" + entity + \"'\" + \r\n \" AND cpr_item = \" + \"'\" + item + \"'\" +\r\n \" AND cpr_uom = \" + \"'\" + uom + \"'\" +\r\n \" AND cpr_curr = \" + \"'\" + curr + \"'\" +\r\n \" AND cpr_type = 'LIST' \"+ \";\");\r\n while (res.next()) {\r\n price = res.getString(\"cpr_price\").replace('.', defaultDecimalSeparator);\r\n Type = \"cust\";\r\n\r\n }\r\n }\r\n\r\n // vendor based pricing\r\n if (type.equals(\"v\")) {\r\n res = st.executeQuery(\"select vd_price_code from vd_mstr where vd_addr = \" + \"'\" + entity + \"'\" + \";\");\r\n while (res.next()) {\r\n pricecode = res.getString(\"vd_price_code\");\r\n } \r\n // if there is no pricecode....it defaults to billto\r\n if (! pricecode.isEmpty()) {\r\n entity = pricecode;\r\n }\r\n\r\n res = st.executeQuery(\"select vpr_price from vpr_mstr where vpr_vend = \" + \"'\" + entity + \"'\" + \r\n \" AND vpr_item = \" + \"'\" + item + \"'\" +\r\n \" AND vpr_uom = \" + \"'\" + uom + \"'\" +\r\n \" AND vpr_curr = \" + \"'\" + curr + \"'\" + \r\n \" AND vpr_type = 'LIST' \"+ \";\");\r\n while (res.next()) {\r\n price = res.getString(\"vpr_price\").replace('.', defaultDecimalSeparator);\r\n Type = \"vend\";\r\n\r\n }\r\n }\r\n\r\n\r\n // if there is no customer specific price...then pull price from item master it_sell_price\r\n if ( price.equals(\"0\") ) {\r\n if (type.equals(\"c\")) { \r\n res = st.executeQuery(\"select it_sell_price as itemprice from item_mstr where it_item = \" + \"'\" + item + \"'\" + \";\");\r\n } else {\r\n res = st.executeQuery(\"select it_pur_price as itemprice from item_mstr where it_item = \" + \"'\" + item + \"'\" + \";\"); \r\n }\r\n while (res.next()) {\r\n price = res.getString(\"itemprice\").replace('.', defaultDecimalSeparator); \r\n Type = \"item\";\r\n }\r\n }\r\n\r\n TypeAndPrice[0] = Type;\r\n TypeAndPrice[1] = String.valueOf(price);\r\n\r\n }\r\n catch (SQLException s){\r\n MainFrame.bslog(s);\r\n } finally {\r\n if (res != null) {\r\n res.close();\r\n }\r\n if (st != null) {\r\n st.close();\r\n }\r\n con.close();\r\n }\r\n }\r\n catch (Exception e){\r\n MainFrame.bslog(e);\r\n }\r\n return TypeAndPrice;\r\n\r\n }",
"double calculateNewPrice(double discount_rate, double price);",
"public double calculatePrice(Model model)\n\t{\n\t\t//sum each of the price components price value\n\t\tString finalprice = \"\";\n\t\tdouble pc_price = -1, lower_limit = -1, upper_limit = -1, function_price = -1,finalvalue=0;\n\t\tfor(PriceComponent pc : this.priceComponents)\n\t\t{\n\t\t\tpc_price = -1; lower_limit = -1; upper_limit = -1;function_price = -1;\n\t\t\t//get the variables and define their value\n\t\t\tif(pc.getPriceFunction() != null)\n\t\t\t{\n\t\t\t\tif (pc.getPriceFunction().getSPARQLFunction() != null) {\n\t\t\t\t\tcom.hp.hpl.jena.query.Query q = ARQFactory.get().createQuery(pc.getPriceFunction().getSPARQLFunction());\n\t\t\t\t\tQueryExecution qexecc = ARQFactory.get().createQueryExecution(q, model);\t\n\t\t\t\t\t\n\t\t\t\t\tResultSet rsc = qexecc.execSelect();\n//\t\t\t\t\tSystem.out.println(q.toString());\n\t\t\t\t\tfunction_price = rsc.nextSolution().getLiteral(\"result\").getDouble();// final result is store in the ?result variable of the query\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pc.getComponentCap() != null) {\n\t\t\t\tupper_limit = pc.getComponentCap().getValue();\n\t\t\t}\n\n\t\t\tif (pc.getComponentFloor() != null) {\n\t\t\t\tlower_limit =pc.getComponentFloor().getValue();\n\t\t\t}\n\n\t\t\tif (pc.getPrice() != null) {\n\t\t\t\tpc_price = pc.getPrice().getValue();\n\t\t\t}\n\t\t\t\n\t\t\tif(function_price >=0)\n\t\t\t{\n\t\t\t\tif(function_price > upper_limit && upper_limit >= 0)\n\t\t\t\t\tfunction_price = upper_limit;\n\t\t\t\telse if(function_price < lower_limit && lower_limit >=0)\n\t\t\t\t\tfunction_price = lower_limit;\n\t\t\t}\n\t\t\t\n\t\t\tif(pc_price >= 0)\n\t\t\t{\n\t\t\t\tif(pc_price > upper_limit && upper_limit >=0)\n\t\t\t\t\tpc_price = upper_limit;\n\t\t\t\telse if(pc_price < lower_limit && lower_limit >= 0)\n\t\t\t\t\tpc_price = lower_limit;\n\t\t\t}\n\t\t\t\n\t\t\tif(pc.getPrice() != null && pc.getPriceFunction() != null)\n\t\t\t\tSystem.out.println(\"Dynamic and static price? offer->\"+this.name+\",pc->\"+pc.getName() + \"price ->\"+pc_price);//throw expection?\n\t\t\t\n\t\t\t\n\t\t\tif(pc.isDeduction())\n\t\t\t{\n\t\t\t\tif(function_price >= 0)\n\t\t\t\t{\n\t\t\t\t\tfinalprice = finalprice+\" - \" +function_price;\n\t\t\t\t\tfinalvalue-=function_price;\n\t\t\t\t}\n\t\t\t\tif(pc_price >= 0)\n\t\t\t\t{\n\t\t\t\t\tfinalprice = finalprice+\" - \" +pc_price;\n\t\t\t\t\tfinalvalue-=pc_price;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(function_price >= 0)\n\t\t\t\t{\n\t\t\t\t\tfinalprice = finalprice+\" + \" +function_price;\n\t\t\t\t\tfinalvalue+=function_price;\n\t\t\t\t}\n\t\t\t\tif(pc_price >= 0)\n\t\t\t\t{\n\t\t\t\t\tfinalprice = finalprice+\" + \" +pc_price;\n\t\t\t\t\tfinalvalue+=pc_price;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//conditions to verify that the final price is inside the interval defined by the lower and upper limit, in case these exist\n\t\tif(this.getPriceCap() != null)\n\t\t{\n\t\t\tif(this.getPriceCap().getValue() >= 0 && finalvalue < this.getPriceCap().getValue())\n\t\t\t\tfinalvalue = this.getPriceCap().getValue();\n\t\t}\n\t\tif(this.getPriceFloor() != null)\n\t\t{\n\t\t\tif(this.getPriceFloor().getValue() >= 0 && finalvalue > this.getPriceFloor().getValue())\n\t\t\t\tfinalvalue = this.getPriceFloor().getValue();\n\t\t}\n\t\t\t\t\n\t\treturn finalvalue;\n\t}",
"public void calculateCost()\n\t{\n\t\tLogManager lgmngr = LogManager.getLogManager(); \n\t\tLogger log = lgmngr.getLogger(Logger.GLOBAL_LOGGER_NAME);\n\t\tString s = \"\";\n\t\tint costperfeet = 0;\n\t\tif (this.materialStandard.equals(\"standard materials\") && this.fullyAutomated == false)\n\t\t\tcostperfeet = 1200;\n\t\telse if (this.materialStandard.equals(\"above standard materials\") && this.fullyAutomated == false)\n\t\t\tcostperfeet = 1500;\n\t\telse if(this.materialStandard.equals(\"high standard materials\") && this.fullyAutomated == false)\n\t\t\tcostperfeet = 1800;\n\t\telse if (this.materialStandard.equals(\"high standard materials\") && this.fullyAutomated == true)\n\t\t\tcostperfeet = 2500;\n\t\t\n\t\tint totalCost = costperfeet * this.totalArea;\n\t\t/*s = \"Total Cost of Construction is :- \";\n\t\twriter.printf(\"%s\" + totalCost, s);\n\t\twriter.flush();*/\n\t\tlog.log(Level.INFO, \"Total Cost of Construction is :- \" + totalCost);\n\t}",
"public static double calcularCosto(String tipoLicencia, int vigencia) {\n float monto = 0;\n switch(tipoLicencia){\n case \"Clase A\": \n switch(vigencia){\n case 1: monto = 20;\n break;\n case 3: monto = 25;\n break;\n case 4: monto = 30;\n break;\n case 5: monto = 40;\n break;\n }\n break;\n case \"Clase B\": switch(vigencia){\n case 1: monto = 20;\n break;\n case 3: monto = 25;\n break;\n case 4: monto = 30;\n break;\n case 5: monto = 40;\n break;\n }\n break;\n case \"Clase C\": switch(vigencia){\n case 1: monto = 23;\n break;\n case 3: monto = 30;\n break;\n case 4: monto = 35;\n break;\n case 5: monto = 47;\n break;\n }\n break;\n case \"Clase D\": switch(vigencia){\n case 1: monto = 20;\n break;\n case 3: monto = 25;\n break;\n case 4: monto = 30;\n break;\n case 5: monto = 40;\n break;\n }\n break;\n case \"Clase E\": switch(vigencia){\n case 1: monto = 29;\n break;\n case 3: monto = 39;\n break;\n case 4: monto = 44;\n break;\n case 5: monto = 59;\n break;\n }\n break;\n case \"Clase F\": switch(vigencia){\n case 1: monto = 20;\n break;\n case 3: monto = 25;\n break;\n case 4: monto = 30;\n break;\n case 5: monto = 40;\n break;\n }\n break;\n case \"Clase G\": switch(vigencia){\n case 1: monto = 20;\n break;\n case 3: monto = 25;\n break;\n case 4: monto = 30;\n break;\n case 5: monto = 40;\n break;\n }\n break;\n } \n return monto;\n }",
"private void calcCoins() {\n\t\tint changeDueRemaining = (int) Math.round((this.changeDue - (int) this.changeDue) * 100);\n\n\t\tif (changeDueRemaining >= 25) {\n\t\t\tthis.quarter += changeDueRemaining / 25;\n\t\t\tchangeDueRemaining = changeDueRemaining % 25;\n\t\t}\n\t\tif (changeDueRemaining >= 10) {\n\t\t\tthis.dime += changeDueRemaining / 10;\n\t\t\tchangeDueRemaining = changeDueRemaining % 10;\n\t\t}\n\t\tif (changeDueRemaining >= 5) {\n\t\t\tthis.nickel += changeDueRemaining / 5;\n\t\t\tchangeDueRemaining = changeDueRemaining % 5;\n\t\t}\n\t\tif (changeDueRemaining >= 1) {\n\t\t\tthis.penny += changeDueRemaining / 1;\n\t\t}\n\t}",
"@Override\n public double getCost(int hours) {\n\n if (hours < 2) {\n\n return 30;\n } else if (hours < 4) {\n\n return 70;\n } else if (hours < 24) {\n\n return 100;\n } else {\n\n int days = hours / 24;\n return days * 100;\n }\n }",
"private void billing_calculate() {\r\n\r\n // need to search patient before calculating amount due\r\n if (billing_fullNameField.equals(\"\")){\r\n JOptionPane.showMessageDialog(this, \"Must search for a patient first!\\nGo to the Search Tab.\",\r\n \"Need to Search Patient\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n if (MainGUI.pimsSystem.lookUpAppointmentDate(currentPatient).equals(\"\")){\r\n JOptionPane.showMessageDialog(this, \"No Appointment to pay for!\\nGo to Appointment Tab to make one.\",\r\n \"Nothing to pay for\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n\r\n // patient has been searched - get info from patient info panel\r\n else {\r\n\r\n currentPatient = MainGUI.pimsSystem.patient_details\r\n (pInfo_lastNameTextField.getText(), Integer.parseInt(pInfo_ssnTextField.getText()));\r\n // patient has a policy, amount due is copay: $50\r\n // no policy, amount due is cost amount\r\n double toPay = MainGUI.pimsSystem.calculate_charge(currentPatient, billing_codeCB.getSelectedItem().toString());\r\n billing_amtDueField.setText(\"$\" + doubleToDecimalString(toPay));\r\n\r\n\r\n\r\n JOptionPane.showMessageDialog(this, \"Amount Due Calculated.\\nClick \\\"Ok\\\" to go to Payment Form\",\r\n \"Calculate\", JOptionPane.DEFAULT_OPTION);\r\n\r\n paymentDialog.setVisible(true);\r\n }\r\n\r\n }",
"int getPeriod();",
"public double getPrice(Movie movie, double time);",
"public void update() \n\t{\n\t\tString inst = \"\";\n\t\tfloat cash = getCash();\n\t\tfloat quantity = getPosition(inst);\n\t\tfloat price = getPrice(inst);\n\n\t\t_data.add(new Float(price));\n\t\t\n\t\tif (_data.size() > _period)\n\t\t{\n\t\t\t_data.remove(0);\n\t\t\n\t\t\tfloat min = Float.MAX_VALUE;\n\t\t\tfloat max = Float.MIN_VALUE;\n\t\t\t\n\t\t\tfor (int i = 0; i < _data.size(); i++)\n\t\t\t{\n\t\t\t\tFloat value = (Float)_data.get(i);\n\t\t\t\t\n\t\t\t\tif (value.floatValue() > max)\n\t\t\t\t{\n\t\t\t\t\tmax = value.floatValue();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (value.floatValue() < min)\n\t\t\t\t{\n\t\t\t\t\tmin = value.floatValue();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfloat buylevel = min + (min * _minwin);\n\t\t\tfloat sellevel = max - (max * _maxloss);\n\t\t\tfloat sellevel2 = min + (min * _maxwin);\n\t\t\t\n\t\t\t// if price has risen by min win\n\t\t\t// but is below maximum win and\n\t\t\t// below maximum loss then buy\n\t\t\tif (price > buylevel && \n\t\t\t\t\tprice < sellevel2 &&\n\t\t\t\t\tbuylevel < sellevel &&\n\t\t\t\t\tprice > _previous)\n\t\t\t{\n\t\t\t\tif (cash > 0) \n\t\t\t\t{\n\t\t\t\t\taddAmountOrder(inst, cash);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (price < sellevel &&\n\t\t\t\t\tbuylevel > sellevel &&\n\t\t\t\t\tprice < _previous)\n\t\t\t{\n\t\t\t\tif (quantity > 0)\n\t\t\t\t{\n\t\t\t\t\taddQuantityOrder(inst, -quantity);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (price > sellevel2 &&\n\t\t\t\t\tprice > _previous)\n\t\t\t{\n\t\t\t\tif (quantity > 0)\n\t\t\t\t{\n\t\t\t\t\taddQuantityOrder(inst, -quantity);\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t_data.remove(0);\n\t\t}\n\t\t\n\t\t_previous = price;\n\t}",
"public void calculateCost(){\n if(this.isChair){\n for(int i = 0; i < this.chairs.length; i++){\n this.cost += this.chairs[i].getPrice();\n }\n }\n //if furniture type is chair, add up cost of all items in list\n if(this.isDesk){\n for(int i = 0; i < this.desks.length; i++){\n this.cost += this.desks[i].getPrice();\n }\n }\n //if furniture type is chair, add up cost of all items in list\n if(this.isFiling){\n for(int i = 0; i < this.filingCabinets.length; i++){\n this.cost += this.filingCabinets[i].getPrice();\n }\n }\n //if furniture type is chair, add up cost of all items in list\n if(this.isLamp){\n for(int i = 0; i < this.lamps.length; i++){\n this.cost += this.lamps[i].getPrice();\n }\n }\n }",
"public double usageCost() {\r\n double totalCost = 0;\r\n for (Booking aBooking: getBookings()) {\r\n long diff = (aBooking.getDateTo().getTime() \r\n - aBooking.getDateFrom().getTime());\r\n int noOfDays = (int) ((diff / (1000 * 60 * 60 * 24)) + 1);\r\n totalCost += noOfDays * 50;\r\n }\r\n return totalCost;\r\n }",
"private void periodCertification() {\n if (((st0 & MASK) == 0) && (st1 == 0) && (st2 == 0) && (st3 == 0)) {\n st0 = 'T';\n st1 = 'I';\n st2 = 'N';\n st3 = 'Y';\n }\n }",
"public double calcPrice() {\r\n\t\tdouble drinkPrice = getBasePrice();\r\n\t\tif(this.getSize()==SIZE.MEDIUM) {\r\n\t\t\tdrinkPrice+=getSizeUpPrice();\r\n\t\t}\r\n\t\telse if(this.getSize()==SIZE.LARGE) {\r\n\t\t\tdrinkPrice+=getSizeUpPrice();\r\n\t\t\tdrinkPrice+=getSizeUpPrice();\r\n\t\t}\r\n\t\t\r\n\t\tif(onWeekend) {\r\n\t\t\tdrinkPrice+=0.6;\r\n\t\t}\r\n\t\treturn drinkPrice;\r\n\t}",
"public static Strategy getDollarCostStrategyObject(Map<String, Double> tickerWeightMap,\n LocalDateTime startDate,\n LocalDateTime endDate, int frequency,\n double amount, double commission,\n String strategyName) {\n return new DollarCostStrategy(tickerWeightMap, amount, startDate, endDate, frequency,\n commission, strategyName);\n }",
"@Test\n public void scopeOfRatingsIsCoveringTp() {\n LocalDateTime firstTime = LocalDateTime.of(2017, Month.JANUARY, 1, 0, 0);\n\n //start with creating tp (proportional), a little bit ahead\n // |------|\n TimePeriod tp = new TimePeriod(firstTime.plusHours(1), firstTime.plusHours(8));\n\n\n /**match tp with ratings and chunkEnd so we have (proportional scale)\n * ratings |o---------||\n * tp: |-------|\n *\n */\n ScoreTime rStart = new ScoreTime(firstTime, 6);\n LocalDateTime chunkEnd = firstTime.plusHours(10); //=> several hours after tp.end\n\n //this is the method we are testing\n double[] avgscoreAndWeight = RatingTime.calcAvgAndWeight(tp, Arrays.asList(rStart),\n chunkEnd);\n assertEquals(6.0, avgscoreAndWeight[0]);\n\n /* weight should equal durationOfRatingsInScopeOfTp/tp.duration\n ratingsInScopeOfTp = 7 hours\n tp.duration = 7 hours.\n weight should be 7/7 = 1.0\n */\n\n assertEquals(1.0, avgscoreAndWeight[1], 0.01);\n }",
"public void calculateEndPrice(int TotalPrice, int Discount) {\n\n }",
"io.grpc.user.task.PriceCondition getCondition();",
"BigInteger getPeriod();",
"public double Floater_pricing_price(\n\t\t\t\n\t\t\tdouble issue_date \n\t\t\t, double mat_date \n\t\t\t, double interval \n\t\t\t, double ipm \n\t\t\t, double adr_flag \n\t\t ,double spread \n\t\t , double price_date \n\t\t , double reval_date \n\t\t , double ipmethod \n\t\t , double[] time_ref \n\t\t , double[] time_dis \n\t\t , double[] ytm_mat_ref \n\t\t , double[] ytm_mat_dis \n\t\t , double numytm_ref \n\t\t , double numytm_dis \n\t\t , double[] tim_bump \n\t\t , double numytm_bump \n\t\t , double fixedrate \n\t\t , double cpn_period \n\t\t , double n_cpn \n\t\t , double[] dcconv \n\t\t , double[] report \n\t\t \n\t\t\t);",
"public double calcCost() {\n // $2 per topping.\n double cost = 2 * (this.cheese + this.pepperoni + this.ham);\n // size cost\n switch (this.size) {\n case \"small\":\n cost += 10;\n break;\n case \"medium\":\n cost += 12;\n break;\n case \"large\":\n cost += 14;\n break;\n default:\n }\n return cost;\n }",
"public double calculatedConsuption(){\nint tressToSow=0;\n\nif (getKiloWatts() >=1 && getKiloWatts() <= 1000){\n\ttressToSow = 8;\n}\nelse if (getKiloWatts() >=1001 && getKiloWatts ()<=3000){\n\ttressToSow = 35;\n}\nelse if (getKiloWatts() > 3000){\n\ttressToSow=500;\n}\nreturn tressToSow;\n}",
"public double precioFinal(){\r\n \r\n double plus = 0;\r\n \r\n switch(consumoElectrico){\r\n case 'A':\r\n plus +=100;\r\n break;\r\n case 'B':\r\n plus += 80;\r\n break;\r\n case 'C':\r\n plus +=60;\r\n break;\r\n case 'D':\r\n plus +=50;\r\n break;\r\n case 'E':\r\n plus+=30;\r\n break;\r\n case 'F':\r\n plus+=10;\r\n break;\r\n \r\n }\r\n \r\n \r\n if(peso>=0 && peso<=19){\r\n plus+=10;\r\n }else if(peso >=20 && peso<= 49){\r\n plus+=50;\r\n }else if(peso >= 50 && peso<=79){\r\n plus+=80;\r\n }else if(peso>=80){\r\n plus+=100;\r\n }\r\n return precioBase+plus;\r\n }",
"private double crunchCall(Option o) { \n int i;\n int countTrial;\n double deltaT;\n deltaT = o.getTerm() / numIntervals;\n double NumTrial;\n double trialAverage = 0;\n double trialPayoff;\n double temp = 0;\n double simulationRunningSum, simulationAveragePayoff;\n double stock;\n Random r = new Random();\n simulationRunningSum = 0.0;\n for (countTrial = 1; countTrial <= numTrials; countTrial++) {\n stock = o.getsNought();\n NumTrial = 0.0;\n double nns = 0;\n for (i = 0; i < numIntervals; i++) {\n nns = r.nextGaussian();\n stock = stock * Math.exp((o.getRiskFreeRate() - o.getVolatility() * o.getVolatility() / 2) * deltaT\n + o.getVolatility() * nns * Math.sqrt(deltaT));\n NumTrial += stock;\n temp = stock;\n\n }\n if (o.getStyle() == OptionStyle.ASIAN) {\n trialAverage = NumTrial / numIntervals;\n } else if ((o.getStyle() == OptionStyle.AMERICAN) || (o.getStyle() == OptionStyle.EUROPEAN)) {\n trialAverage = temp;\n }\n\n trialPayoff = Math.max(trialAverage - o.getStrikeP(), 0.0);\n simulationRunningSum += trialPayoff;\n }\n simulationAveragePayoff = simulationRunningSum / numTrials;\n double valueOfOption;\n valueOfOption = simulationAveragePayoff * Math.exp(-o.getRiskFreeRate() * o.getTerm());\n return valueOfOption;\n }",
"public abstract double calculateQuarterlyFees();",
"double purchasePrice();",
"double getCost();",
"double getCost();",
"public double selPeriodo(int periodo, int estrato) {\n double perTasa = 0;\n if (periodo == 201611) {\n if (estrato == 1) {\n perTasa = tasaNov16_1;\n }\n if (estrato == 2) {\n perTasa = tasaNov16_2;\n }\n if (estrato == 3) {\n perTasa = tasaNov16_3;\n }\n if (estrato == 4) {\n perTasa = tasaNov16_4;\n }\n if (estrato == 5) {\n perTasa = tasaNov16_5;\n }\n if (estrato == 6) {\n perTasa = tasaNov16_6;\n }\n }\n if (periodo == 201610) {\n if (estrato == 1) {\n perTasa = tasaOct16_1;\n }\n if (estrato == 2) {\n perTasa = tasaOct16_2;\n }\n if (estrato == 3) {\n perTasa = tasaOct16_3;\n }\n if (estrato == 4) {\n perTasa = tasaOct16_4;\n }\n if (estrato == 5) {\n perTasa = tasaOct16_5;\n }\n if (estrato == 6) {\n perTasa = tasaOct16_6;\n }\n }\n if (periodo == 201609) {\n if (estrato == 1) {\n perTasa = tasaSep16_1;\n }\n if (estrato == 2) {\n perTasa = tasaSep16_2;\n }\n if (estrato == 3) {\n perTasa = tasaSep16_3;\n }\n if (estrato == 4) {\n perTasa = tasaSep16_4;\n }\n if (estrato == 5) {\n perTasa = tasaSep16_5;\n }\n if (estrato == 6) {\n perTasa = tasaSep16_6;\n }\n }\n if (periodo == 201608) {\n if (estrato == 1) {\n perTasa = tasaAgo16_1;\n }\n if (estrato == 2) {\n perTasa = tasaAgo16_2;\n }\n if (estrato == 3) {\n perTasa = tasaAgo16_3;\n }\n if (estrato == 4) {\n perTasa = tasaAgo16_4;\n }\n if (estrato == 5) {\n perTasa = tasaAgo16_5;\n }\n if (estrato == 6) {\n perTasa = tasaAgo16_6;\n }\n }\n if (periodo == 201607) {\n if (estrato == 1) {\n perTasa = tasaJul16_1;\n }\n if (estrato == 2) {\n perTasa = tasaJul16_2;\n }\n if (estrato == 3) {\n perTasa = tasaJul16_3;\n }\n if (estrato == 4) {\n perTasa = tasaJul16_4;\n }\n if (estrato == 5) {\n perTasa = tasaJul16_5;\n }\n if (estrato == 6) {\n perTasa = tasaJul16_6;\n }\n }\n if (periodo == 201606) {\n if (estrato == 1) {\n perTasa = tasaJun16_1;\n }\n if (estrato == 2) {\n perTasa = tasaJun16_2;\n }\n if (estrato == 3) {\n perTasa = tasaJun16_3;\n }\n if (estrato == 4) {\n perTasa = tasaJun16_4;\n }\n if (estrato == 5) {\n perTasa = tasaJun16_5;\n }\n if (estrato == 6) {\n perTasa = tasaJun16_6;\n }\n }\n if (periodo == 201605) {\n if (estrato == 1) {\n perTasa = tasaMay16_1;\n }\n if (estrato == 2) {\n perTasa = tasaMay16_2;\n }\n if (estrato == 3) {\n perTasa = tasaMay16_3;\n }\n if (estrato == 4) {\n perTasa = tasaMay16_4;\n }\n if (estrato == 5) {\n perTasa = tasaMay16_5;\n }\n if (estrato == 6) {\n perTasa = tasaMay16_6;\n }\n }\n if (periodo == 201604) {\n if (estrato == 1) {\n perTasa = tasaAbr16_1;\n }\n if (estrato == 2) {\n perTasa = tasaAbr16_2;\n }\n if (estrato == 3) {\n perTasa = tasaAbr16_3;\n }\n if (estrato == 4) {\n perTasa = tasaAbr16_4;\n }\n if (estrato == 5) {\n perTasa = tasaAbr16_5;\n }\n if (estrato == 6) {\n perTasa = tasaAbr16_6;\n }\n }\n if (periodo == 201603) {\n if (estrato == 1) {\n perTasa = tasaMar16_1;\n }\n if (estrato == 2) {\n perTasa = tasaMar16_2;\n }\n if (estrato == 3) {\n perTasa = tasaMar16_3;\n }\n if (estrato == 4) {\n perTasa = tasaMar16_4;\n }\n if (estrato == 5) {\n perTasa = tasaMar16_5;\n }\n if (estrato == 6) {\n perTasa = tasaMar16_6;\n }\n }\n if (periodo == 201602) {\n if (estrato == 1) {\n perTasa = tasaFeb16_1;\n }\n if (estrato == 2) {\n perTasa = tasaFeb16_2;\n }\n if (estrato == 3) {\n perTasa = tasaFeb16_3;\n }\n if (estrato == 4) {\n perTasa = tasaFeb16_4;\n }\n if (estrato == 5) {\n perTasa = tasaFeb16_5;\n }\n if (estrato == 6) {\n perTasa = tasaFeb16_6;\n }\n }\n if (periodo == 201601) {\n if (estrato == 1) {\n perTasa = tasaEne16_1;\n }\n if (estrato == 2) {\n perTasa = tasaEne16_2;\n }\n if (estrato == 3) {\n perTasa = tasaEne16_3;\n }\n if (estrato == 4) {\n perTasa = tasaEne16_4;\n }\n if (estrato == 5) {\n perTasa = tasaEne16_5;\n }\n if (estrato == 6) {\n perTasa = tasaEne16_6;\n }\n }\n if (periodo == 201512) {\n if (estrato == 1) {\n perTasa = tasaDic_1;\n }\n if (estrato == 2) {\n perTasa = tasaDic_2;\n }\n if (estrato == 3) {\n perTasa = tasaDic_3;\n }\n if (estrato == 4) {\n perTasa = tasaDic_4;\n }\n if (estrato == 5) {\n perTasa = tasaDic_5;\n }\n if (estrato == 6) {\n perTasa = tasaDic_6;\n }\n }\n if (periodo == 201511) {\n if (estrato == 1) {\n perTasa = tasaNov_1;\n }\n if (estrato == 2) {\n perTasa = tasaNov_2;\n }\n if (estrato == 3) {\n perTasa = tasaNov_3;\n }\n if (estrato == 4) {\n perTasa = tasaNov_4;\n }\n if (estrato == 5) {\n perTasa = tasaNov_5;\n }\n if (estrato == 6) {\n perTasa = tasaNov_6;\n }\n }\n if (periodo == 201510) {\n if (estrato == 1) {\n perTasa = tasaOct_1;\n }\n if (estrato == 2) {\n perTasa = tasaOct_2;\n }\n if (estrato == 3) {\n perTasa = tasaOct_3;\n }\n if (estrato == 4) {\n perTasa = tasaOct_4;\n }\n if (estrato == 5) {\n perTasa = tasaOct_5;\n }\n if (estrato == 6) {\n perTasa = tasaOct_6;\n }\n }\n if (periodo == 201509) {\n if (estrato == 1) {\n perTasa = tasaSep_1;\n }\n if (estrato == 2) {\n perTasa = tasaSep_2;\n }\n if (estrato == 3) {\n perTasa = tasaSep_3;\n }\n if (estrato == 4) {\n perTasa = tasaSep_4;\n }\n if (estrato == 5) {\n perTasa = tasaSep_5;\n }\n if (estrato == 6) {\n perTasa = tasaSep_6;\n }\n }\n if (periodo == 201508) {\n if (estrato == 1) {\n perTasa = tasaAgo_1;\n }\n if (estrato == 2) {\n perTasa = tasaAgo_2;\n }\n if (estrato == 3) {\n perTasa = tasaAgo_3;\n }\n if (estrato == 4) {\n perTasa = tasaAgo_4;\n }\n if (estrato == 5) {\n perTasa = tasaAgo_5;\n }\n if (estrato == 6) {\n perTasa = tasaAgo_6;\n }\n }\n if (periodo == 201507) {\n if (estrato == 1) {\n perTasa = tasaJul_1;\n }\n if (estrato == 2) {\n perTasa = tasaJul_2;\n }\n if (estrato == 3) {\n perTasa = tasaJul_3;\n }\n if (estrato == 4) {\n perTasa = tasaJul_4;\n }\n if (estrato == 5) {\n perTasa = tasaJul_5;\n }\n if (estrato == 6) {\n perTasa = tasaJul_6;\n }\n }\n if (periodo == 201506) {\n if (estrato == 1) {\n perTasa = tasaJun_1;\n }\n if (estrato == 2) {\n perTasa = tasaJun_2;\n }\n if (estrato == 3) {\n perTasa = tasaJun_3;\n }\n if (estrato == 4) {\n perTasa = tasaJun_4;\n }\n if (estrato == 5) {\n perTasa = tasaJun_5;\n }\n if (estrato == 6) {\n perTasa = tasaJun_6;\n }\n }\n if (periodo == 201505) {\n if (estrato == 1) {\n perTasa = tasaMay_1;\n }\n if (estrato == 2) {\n perTasa = tasaMay_2;\n }\n if (estrato == 3) {\n perTasa = tasaMay_3;\n }\n if (estrato == 4) {\n perTasa = tasaMay_4;\n }\n if (estrato == 5) {\n perTasa = tasaMay_5;\n }\n if (estrato == 6) {\n perTasa = tasaMay_6;\n }\n }\n if (periodo == 201504) {\n if (estrato == 1) {\n perTasa = tasaAbr_1;\n }\n if (estrato == 2) {\n perTasa = tasaAbr_2;\n }\n if (estrato == 3) {\n perTasa = tasaAbr_3;\n }\n if (estrato == 4) {\n perTasa = tasaAbr_4;\n }\n if (estrato == 5) {\n perTasa = tasaAbr_5;\n }\n if (estrato == 6) {\n perTasa = tasaAbr_6;\n }\n }\n return perTasa;\n }",
"public double cost()\n\t{\n\t\t//initiates the price variable\n\t\tdouble price = 0;\n\t\t\n\t\t//if the customer is aged between 18 and 64 years and is not a student\n\t\tif (this.age >= 18 && this.age <= 64 && !this.isStudent)\n\t\t{\n\t\t\t//the price is $10\n\t\t\tprice = 10;\n\t\t}\n\t\t\n\t\t//if not, but it has less than 18 years\n\t\telse if (this.age < 18)\n\t\t{\n\t\t\t//the price is 7\n\t\t\tprice = 7;\n\t\t}\n\t\t\n\t\t//why between 10 and 25 if people aged less than 18 pay 7 dollars?\n\t\t//it would not make sense someone aged 17 and is not a student pay $7\n\t\t//if someone aged 17 and is a student pay $8.50\n\t\t\n\t\t//if not, but the age is bigger than 10 and less than 25 and is a student\n\t\telse if (this.age >= 10 && this.age <= 25 && this.isStudent)\n\t\t{\n\t\t\t//give 15% of discount\n\t\t\tprice = 0.85f * 10;\n\t\t}\n\t\t\n\t\t//if not, but the age is bigger than 25 and is a students\n\t\telse if (this.age > 25 && this.isStudent)\n\t\t{\n\t\t\t//give 10% of discount\n\t\t\tprice = 0.90f * 10;\n\t\t}\n\t\t\n\t\t//if not, but the age is bigger than 64 and is not a student\n\t\telse if (this.age > 64 && !this.isStudent)\n\t\t{\n\t\t\t//give 7% of discount\n\t\t\tprice = 0.93f * 10;\n\t\t}\n //returns the price \n\t\treturn price;\n\t}",
"org.hl7.fhir.Period addNewAppliesPeriod();",
"public double runPrice(int age) {\n\t\t// PriceCRUD for calculating price later\n\t\tPriceCRUD<CinemaClassPrice> cinemaClassCRUD = new PriceCRUD<>(CinemaClassPrice.class);\n\t\tPriceCRUD<MovieTypePrice> movieTypeCRUD = new PriceCRUD<>(MovieTypePrice.class);\n\t\tPriceCRUD<DayPrice> dayCRUD = new PriceCRUD<>(DayPrice.class);\n\t\tPriceCRUD<AgePrice> ageCRUD = new PriceCRUD<>(AgePrice.class);\n\t\t\n\t\t// Get cinema class price\n\t\tCinemaCRUD<Cinema> cinemaCRUD = new CinemaCRUD<Cinema>(Cinema.class, Showtimes.getCineplexId());\n\t\tCinemaClass cinemaClass = cinemaCRUD.getCinemaType(this.showtimes.getCinemaId());\n\t\tCinemaClassPrice cinemaClassPrice = cinemaClassCRUD.getElementPrice(cinemaClass);\n\t\t\n\t\t// Get movie type price\n\t\tMovieCRUD<Movie> movieCRUD = new MovieCRUD<>(Movie.class);\n\t\tMovieType movieType = movieCRUD.getMovieById(this.showtimes.getMovieId()).getType();\n\t\tMovieTypePrice movieTypePrice = movieTypeCRUD.getElementPrice(movieType);\n\t\t\n\t\t// Get Day type price\n\t\tDayType dayType = DateTimeHelper.getDayType(this.showtimes.getDate());\n\t\tDayPrice dayTypePrice = dayCRUD.getElementPrice(dayType);\n\t\t\n\t\t// Get Age Range Price\n\t\tAgePrice agePrice = ageCRUD.getElementPrice(age);\n\t\t\n\t\t// Print receipt for 1 ticket\n\t\tSystem.out.println(cinemaClassPrice.toString());\n\t\tSystem.out.println(movieTypePrice.toString());\n\t\tSystem.out.println(dayTypePrice.toString());\n\t\tSystem.out.println(agePrice.toString());\n\t\tdouble ticketPrice = cinemaClassPrice.getPrice()+movieTypePrice.getPrice()+dayTypePrice.getPrice()+agePrice.getPrice();\n\t\tSystem.out.println(\"Ticket price: \"+ticketPrice);\n\t\t\n\t\treturn ticketPrice;\n\t}",
"public int calculatePrice() {\n int price = 5;\n if(hasWhippedCream) {\n price += 1;\n }\n if(hasChocolate) {\n price += 2;\n }\n return quantity * price;\n }",
"public double calculatePay() \r\n\t{\r\n\t\treturn (payRate*hoursWorked);\r\n\t}",
"public DataElementChartResult generateChartDataPeriodWise( List<Date> selStartPeriodList,\n List<Date> selEndPeriodList, List<String> periodNames, List<DataElement> dataElementList,\n List<DataElementCategoryOptionCombo> decocList, OrganisationUnit orgUnit )\n throws Exception\n {\n DataElementChartResult dataElementChartResult;\n\n String[] series = new String[dataElementList.size()];\n String[] categories = new String[selStartPeriodList.size()];\n Double[][] data = new Double[dataElementList.size()][selStartPeriodList.size()];\n String chartTitle = \"OrganisationUnit : \" + orgUnit.getShortName();\n String xAxis_Title = \"Time Line\";\n String yAxis_Title = \"Value\";\n\n int serviceCount = 0;\n\n for ( DataElement dataElement : dataElementList )\n {\n DataElementCategoryOptionCombo decoc;\n\n DataElementCategoryCombo dataElementCategoryCombo = dataElement.getCategoryCombo();\n\n List<DataElementCategoryOptionCombo> optionCombos = new ArrayList<DataElementCategoryOptionCombo>(\n dataElementCategoryCombo.getOptionCombos() );\n\n if ( deSelection.equalsIgnoreCase( OPTIONCOMBO ) )\n {\n decoc = decocList.get( serviceCount );\n\n series[serviceCount] = dataElement.getName() + \" : \" + decoc.getName();\n \n CaseAggregationCondition caseAggregationCondition = caseAggregationConditionService\n .getCaseAggregationCondition( dataElement, decoc );\n\n if ( caseAggregationCondition == null )\n {\n selectedStatus.add( \"no\" );\n }\n else\n {\n selectedStatus.add( \"yes\" );\n }\n\n yseriesList.add( dataElement.getName() + \" : \" + decoc.getName() );\n }\n else\n {\n decoc = dataElementCategoryService.getDefaultDataElementCategoryOptionCombo();\n series[serviceCount] = dataElement.getName();\n\n CaseAggregationCondition caseAggregationCondition = caseAggregationConditionService\n .getCaseAggregationCondition( dataElement, decoc );\n\n if ( caseAggregationCondition == null )\n {\n selectedStatus.add( \"no\" );\n }\n else\n {\n selectedStatus.add( \"yes\" );\n }\n\n yseriesList.add( dataElement.getName() );\n }\n\n int periodCount = 0;\n for ( Date startDate : selStartPeriodList )\n {\n Date endDate = selEndPeriodList.get( periodCount );\n String drillDownPeriodName = periodNames.get( periodCount );\n String tempStartDate = format.formatDate( startDate );\n String tempEndDate = format.formatDate( endDate );\n\n categories[periodCount] = periodNames.get( periodCount );\n //PeriodType periodType = periodService.getPeriodTypeByName( periodTypeLB );\n\n String values = orgUnit.getId() + \":\" + dataElement.getId() + \":\" + decoc.getId() + \":\" + periodTypeLB\n + \":\" + tempStartDate + \":\" + tempEndDate;\n selectedValues.add( values );\n\n String drillDownData = orgUnit.getId() + \":\" + \"0\" + \":\" + dataElement.getId() + \":\" + decoc.getId()\n + \":\" + periodTypeLB + \":\" + tempStartDate + \":\" + tempEndDate + \":\" + drillDownPeriodName + \":\"\n + deSelection + \":\" + aggChecked;\n selectedDrillDownData.add( drillDownData );\n\n Double aggDataValue = 0.0;\n \n if ( deSelection.equalsIgnoreCase( OPTIONCOMBO ) )\n {\n //System.out.println( \" Inside deSelection.equalsIgnoreCase( OPTIONCOMBO ) \" );\n if ( aggDataCB != null )\n {\n Double temp = aggregationService.getAggregatedDataValue( dataElement, decoc, startDate,\n endDate, orgUnit );\n if ( temp != null )\n aggDataValue += temp;\n //aggDataValue = temp;\n }\n else\n {\n Collection<Period> periods = periodService.getPeriodsBetweenDates( startDate, endDate );\n for ( Period period : periods )\n {\n DataValue dataValue = dataValueService.getDataValue( orgUnit, dataElement, period, decoc );\n try\n {\n aggDataValue += Double.parseDouble( dataValue.getValue() );\n }\n catch ( Exception e )\n {\n }\n }\n }\n }\n else\n {\n //System.out.println( \" Inside not deSelection.equalsIgnoreCase( OPTIONCOMBO ) \" );\n Iterator<DataElementCategoryOptionCombo> optionComboIterator = optionCombos.iterator();\n while ( optionComboIterator.hasNext() )\n {\n DataElementCategoryOptionCombo decoc1 = (DataElementCategoryOptionCombo) optionComboIterator.next();\n\n if ( aggDataCB != null )\n {\n Double temp = aggregationService.getAggregatedDataValue( dataElement, decoc1, startDate,\n endDate, orgUnit );\n if ( temp != null )\n aggDataValue += temp;\n //aggDataValue = temp;\n }\n else\n {\n Collection<Period> periods = periodService.getPeriodsBetweenDates( startDate, endDate );\n for ( Period period : periods )\n {\n DataValue dataValue = dataValueService.getDataValue( orgUnit, dataElement, period, decoc1 );\n try\n {\n aggDataValue += Double.parseDouble( dataValue.getValue() );\n }\n catch ( Exception e )\n {\n }\n }\n }\n }\n }\n //System.out.println( \" Data is : \" + aggDataValue );\n data[serviceCount][periodCount] = aggDataValue;\n\n if ( dataElement.getType().equalsIgnoreCase( DataElement.VALUE_TYPE_INT ) )\n {\n if ( dataElement.getNumberType().equalsIgnoreCase( DataElement.VALUE_TYPE_INT ) )\n {\n data[serviceCount][periodCount] = Math.round( data[serviceCount][periodCount]\n * Math.pow( 10, 0 ) )\n / Math.pow( 10, 0 );\n }\n else\n {\n data[serviceCount][periodCount] = Math.round( data[serviceCount][periodCount]\n * Math.pow( 10, 1 ) )\n / Math.pow( 10, 1 );\n }\n }\n periodCount++;\n }\n\n serviceCount++;\n }\n dataElementChartResult = new DataElementChartResult( series, categories, data, chartTitle, xAxis_Title,\n yAxis_Title );\n\n return dataElementChartResult;\n }",
"private double calculateRentalPrice(double rentalPricePerDay, Date start, Date end) {\n\t\treturn rentalPricePerDay * Math.ceil((end.getTime() - start.getTime()) / (1000 * 60 * 60 * 24D));\n\t}",
"void calculate() {\n if (price <= 1000)\n price = price - (price * 2 / 100);\n else if (price > 1000 && price <= 3000)\n price = price - (price * 10 / 100);\n else\n price = price - (price * 15 / 100);\n }",
"CarPaymentMethod processHotDollars();",
"public int getHowManyInPeriod();",
"abstract double calculateCurrentDiscountRate();",
"public Double getCostInterval();",
"@Test\n public void computeFactor_SummerTimeWeek() {\n long startTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-03-13 00:00:00\");\n long endTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-03-25 23:59:59\");\n BillingInput billingInput = BillingInputFactory.newBillingInput(\n \"2012-03-01 00:00:00\", \"2012-04-01 00:00:00\");\n\n // when\n double factor = calculator.computeFactor(PricingPeriod.WEEK,\n billingInput, startTimeUsage, endTimeUsage, true, true);\n\n // then\n assertEquals(2, factor, 0);\n }",
"public double[] ConsumptionDecisionRule(double[] Kt, double[] Zt) {\r\n\t\t// LOGGER.info(\"Kt[0]=\" + Kt[0] + \" , Zt[0]=\" + Zt[0]);\r\n\t\tdouble[] result = new double[N];\r\n\t\tdouble[] W_t = new double[N];\r\n\t\t// double[] result = Kt;\r\n\t\t// fact[9] = iT / (double) T;\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\r\n\t\t\t// Compute wage\r\n\t\t\tW_t[i] = (1 - delta) * Kt[i] + Zt[i] * Math.pow(Kt[i], alpha);\r\n\t\t\t// LOGGER.info(\"Kt[i]=\" + Kt[i] + \" , W_t=\" + W_t);\r\n\r\n\t\t\t// fact[0] = Kt[i];\r\n\t\t\t// fact[1] = Zt[i];\r\n\t\t\t// fact[2] = W_t[i];\r\n\r\n\t\t\t// result[i] = (W_t[i] * 0.34);\r\n\r\n\t\t\t// S[sc=640619,15461196 at 2000, 3x[C 0,35 [], C 0,256 [6], C -0,032 [4]]]\r\n\t\t\t// result[i] = W_t[i] * (0.35 + 0.256 * factValues[6] - 0.032 * factValues[4]);\r\n\t\t\t// S[sc=673175,23434734 at 2000, 4x[C 0,448 [6], C 0,35 [], C -0,192 [8, 8, 8], C -0,032 [4]]]\r\n\t\t\t// result[i] = W_t[i] * (0.35 + 0.448 * fact[6] - 0.192 * fact[8] * fact[8] * fact[8] - 0.032 * fact[4]);\r\n\r\n\t\t\t// S[sc=684511.51178919 at 5000, 6x[C 0.576 [6], C 0.35 [], C -0.256 [4, 5, 8], C -0.128 [8, 8, 8], C 0.032\r\n\t\t\t// [3], C -0.032 [4]]]\r\n\t\t\t// result[i] = W_t[i]\r\n\t\t\t// * (0.35 + 0.576 * fact[6] - 0.256 * fact[4] * fact[5] * fact[8] - 0.128 * fact[8] * fact[8] * fact[8] +\r\n\t\t\t// 0.032\r\n\t\t\t// * fact[3] - 0.032 * fact[4]);\r\n\r\n\t\t\t// S[sc=713249.61733519 at 17000, 10x[C 0.57042768 [6], C -0.42834052 [4, 5, 8], C 0.35726662 [], C\r\n\t\t\t// -0.19234839 [8, 8, 8], C 0.0618062 [3], C 0.03906074 [3, 3], C -0.0354908 [6, 8, 8], C -0.032 [4], C\r\n\t\t\t// 0.02872478 [3, 6, 6], C -0.01470091 [4, 8]]]\r\n\t\t\t// result[i] = W_t[i]\r\n\t\t\t// * (0.35726662 + 0.57042768 * fact[3] - 0.42834052 * fact[1] * fact[2] * fact[5] - 0.19234839 * fact[5] *\r\n\t\t\t// fact[5]\r\n\t\t\t// * fact[5] + 0.0618062 * fact[2] + 0.03906074 * fact[2] * fact[2] - 0.0354908 * fact[3] * fact[5] *\r\n\t\t\t// fact[5]\r\n\t\t\t// - 0.032 * fact[1] + 0.02872478 * fact[0] * fact[3] * fact[3] - 0.01470091 * fact[1] * fact[5]);\r\n\t\t\tresult[i] = W_t[i]\r\n\t\t\t\t\t* ( //\r\n\t\t\t\t\t0.40334336 + 0.22997859 * fact[3] + 0.21837595 * fact[3] * fact[3] + 0.15973829 * fact[3] * fact[4] + -0.10161004\r\n\t\t\t\t\t\t\t* fact[1] * fact[5] + -0.020384 * fact[1] * fact[1] * fact[5]\r\n\t\t\t);\r\n\t\t\t// Keep only valid solutions\r\n\t\t\tresult[i] = Math.max(result[i], VERY_SMALL * W_t[i]);\r\n\t\t\t// to have a valid result\r\n\t\t\tresult[i] = Math.min(result[i], W_t[i] * (1.0 - VERY_SMALL));\r\n\t\t}\r\n\r\n\t\t// LOGGER.info(\"Kt[0]=\" + Kt[0] + \" , Zt[0]=\" + Zt[0] + \" , \" + result[0] + \" for \" + iT);\r\n\t\t// int s = 0;\r\n\t\t// LOGGER.info(\"Kt[\" + s + \"]=\" + Kt[s] + \" , Zt[]=\" + Zt[s] + \" , W_t[]=\" + W_t[s] + \" , \" + result[s] +\r\n\t\t// \" for \" + iT);\r\n\t\tiT++;\r\n\t\treturn result;\r\n\t}",
"private String calculateResupply(String consumables, String mglt, int Distance) {\n String [] valuesConsumables = consumables.split(\" \");\n\n if (valuesConsumables[1].equals(Consumables.DAY) ||\n valuesConsumables[1].equals(Consumables.DAYS)){\n\n return individualCalculationResupply(valuesConsumables, mglt, Distance, Consumables.DAY_HOURS);\n }else if (valuesConsumables[1].equals(Consumables.WEEK)\n || valuesConsumables[1].equals(Consumables.WEEKS)){\n\n return individualCalculationResupply(valuesConsumables, mglt, Distance, Consumables.WEEK_HOURS);\n }else if (valuesConsumables[1].equals(Consumables.MONTH)\n || valuesConsumables[1].equals(Consumables.MONTHS)){\n\n return individualCalculationResupply(valuesConsumables, mglt, Distance, Consumables.MONTH_HOURS);\n }else if (valuesConsumables[1].equals(Consumables.YEAR)\n || valuesConsumables[1].equals(Consumables.YEARS)){\n\n return individualCalculationResupply(valuesConsumables, mglt, Distance, Consumables.YEAR_HOURS);\n }\n System.out.println(valuesConsumables[0]);\n return \"\";\n }",
"static int amount_to_pay(String Q, String P, int[] cost){\n int max_amount = 0;\n\n\t\tfor (int i = 0; i < P.length(); i++) {\n\t\t\tint amount = getAmountToPay(P, Q, cost, i);\n\t\t\tif (amount > max_amount) {\n\t\t\t\tmax_amount = amount;\n\t\t\t}\n\t\t}\n \n return max_amount;\n }",
"private int calculatePrice() {\n int price = numberOfCoffees * 5;\n\n return price;\n\n\n }",
"@Test\n public void firstRatingAfterTpStartANDChunkEndBeforeTpEndTest() {\n LocalDateTime firstTime = LocalDateTime.of(2017, Month.JANUARY, 1, 0, 0);\n\n //start with creating tp (proportional)\n // |-----|\n TimePeriod tp = new TimePeriod(firstTime, firstTime.plusHours(6));\n\n /**match tp with ratings so we have (proportional scale)\n * ratings |-o--||\n * tp: |-----|\n *\n */\n ScoreTime rStart = new ScoreTime(firstTime.plusHours(2), 4);\n LocalDateTime chunkEnd = firstTime.plusHours(5); //=> 1 hour before tp.end\n\n //this is the method we are testing\n double[] avgscoreAndWeight = RatingTime.calcAvgAndWeight(tp, Arrays.asList(rStart),\n chunkEnd);\n assertEquals(4.0, avgscoreAndWeight[0]);\n\n /* weight should equal durationOfRatingsInScopeOfTp/tp.duration\n ratingsInScopeOfTp = 3 hours\n tp.duration = 6 hours.\n weight should be 3/6 = 1/2 = 0.5...\n */\n\n assertEquals(0.5, avgscoreAndWeight[1]);\n }",
"@Test\n public void computeFactor_WinterTimeWeek() {\n long startTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-10-17 00:00:00\");\n long endTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-10-27 23:59:59\");\n BillingInput billingInput = BillingInputFactory.newBillingInput(\n \"2012-10-01 00:00:00\", \"2012-11-01 00:00:00\");\n\n // when\n double factor = calculator.computeFactor(PricingPeriod.WEEK,\n billingInput, startTimeUsage, endTimeUsage, true, true);\n\n // then\n assertEquals(2, factor, 0);\n }",
"double calculateDeliveryCost(Cart cart);",
"public double calculateWIP() {\n\t\tdouble totalDeliveryRate = 0.0;\n\t\tdouble totalLeadTime = 0.0;\n LinkedList<Card> completedCards = BoardManager.get().getCurrentBoard().getCardsOf(Role.COMPLETED_WORK);\n for (Card card : completedCards) {\n totalLeadTime += (int) DAYS.between(card.getCreationDate(versions), card.getCompletionDate(versions));\n\t\t\ttotalDeliveryRate += card.getStoryPoints();\t\n\n }\n\t\ttotalDeliveryRate = totalDeliveryRate/ (BoardManager.get().getCurrentBoard().getAge()); // avrage of cards delivered per time unit\n\t\ttotalLeadTime = totalLeadTime / completedCards.size(); // avarage time it takes to finish a card\n return Math.round(totalDeliveryRate * totalLeadTime * 100D) / 100D;\n }",
"public double fineAsToHours(int numOfDays,int h1,int h2,int m1, int m2){\n double fine=0.0;\n int y=0;\n\n //if overdue is minus there is no need to calculate a fine\n if(numOfDays<0){\n fine=0.0;\n }\n\n //if it is 0 if the reader returns book on or before the due hour, again no fine\n //if reader returns book after due hour minutes will be taken in to count\n else if(numOfDays==0){\n if(h2<=h1){\n fine=0.0;\n }\n else{\n //ex:if due=10.30, returnTime=12.20, fine will be charged only for 10.30 to 11.30 period\n //which is returnTime-1-due\n if(m2<m1){\n y=(h2-h1)-1;\n fine=y*0.2;\n }\n //if returnTime=12.45 fine will be charged for 10.30 to 12.45 period\n //which is returnTime-due\n else if(m2>=m1){\n y=h2-h1;\n fine=y*0.2;\n }\n }\n }\n\n //if over due is 3days or less\n else if(numOfDays<=3){\n //ex: due=7th 10.30, returned=9th 9.30\n //finr will be charged for 24h and the extra hours from 8th, and extra hours from 9th\n if(h2<=h1){\n y=((numOfDays-1)*24)+((24-h1)+h2);\n fine=y*0.2;\n }\n else{\n //ex: due=7th 10.30, returned= 9th 12.15\n //total 2*24h will be added. plus, time period frm 9th 10.30 to 11.30\n if(m2<m1){\n y=(numOfDays*24)+((h2-h1)-1);\n fine=y*0.2;\n }\n else if(m2>=m1){\n //returned=9th 12.45\n //total 2*24h, plus 2hours difference from 10.30 to 12.30\n y=(numOfDays*24)+(h2-h1);\n fine=y*0.2;\n }\n }\n\n }\n\n\n //same logic and will multiply the 1st 3 days form 0.2 as to the requirement\n\n else if(numOfDays>3){\n if(h2<=h1){\n y=((numOfDays-4)*24)+((24-h1)+h2);\n fine=(y*0.5)+(24*3*0.2);\n }\n\n else{\n if(m2<m1){\n y=((numOfDays-3)*24)+((h2-h1)-1);\n fine=(y*0.5)+(3*24*0.2);\n }\n\n else if(m2>m1){\n y=((numOfDays-3)*24)+(h2-h1);\n fine=(y*0.5)+(3*24*0.2);\n }\n }\n\n\n }\n\n return fine;\n\n }",
"public double updateCosts( ) {\n\t\tif (BenefitDetails.getsDiscount(fname, lname)) {\n\t\t\tyearlyBenefitCost = BenefitDetails.dependentRate * BenefitDetails.discount;\n\t\t} else {\n\t\t\tyearlyBenefitCost = BenefitDetails.dependentRate;\n\t\t}\n\n\t\treturn yearlyBenefitCost;\n\t}",
"@Override \n\tpublic TradeAction tick(double price) {\n\t\tma10before=average(priceQ10);\n\t\t\n\t\tif (priceQ10.size()<10)\n\t\t{\n\t\t\tpriceQ10.offer(price);\n\t\t}\n\t\tif(priceQ10.size()==10)\n\t\t{\n\t\t\tpriceQ10.poll();\n\t\t\tpriceQ10.offer(price);\t\t\n\t\t}\n\t\t\n\t\t ma10after=average(priceQ10);\n\t\t \n\t\t// 60 days moving average\n\t\tma60before=average(priceQ60);\n\t\tif (priceQ60.size()<60)\n\t\t{\n\t\t\tpriceQ60.offer(price);\n\t\t}\n\t\tif(priceQ60.size()==60)\n\t\t{\n\t\t\tpriceQ60.poll();\n\t\t\tpriceQ60.offer(price);\t\t\n\t\t}\n\t\tma60after=average(priceQ60);\n\t\t\t\n\t\t//buy when its 10 day moving average goes above the 60 day moving average\n\t\tif((ma10before < ma60before) & (ma10after > ma60after))\n\t\t{\n\t\t\tprofit = profit - price;\n\t\t\t//System.out.println(\"buy\");\n\t\t\t//System.out.println(\"profit is\");\n\t\t\t//System.out.println(profit);\n\t\t\tif(mark==1){\n\t\t\t\tmark=-1;\n\t\t\t\treturn TradeAction.BUY;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn TradeAction.DO_NOTHING;\n\t\t\t\n\t\t}\n\t\t//buy when its 10 day moving average goes below the 60 day moving average\n\t\tif((ma10before > ma60before) & (ma10after < ma60after))\n\t\t{\n\t\t\tprofit = profit + price;\n\t\t\t//System.out.println(\"sell\");\n\t\t\t//System.out.println(\"profit is\");\n\t\t\t//System.out.println(profit);\n\t\t\tif(mark==-1){\n\t\t\t\tmark=1;\n\t\t\t\treturn TradeAction.SELL;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn TradeAction.DO_NOTHING;\n\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn TradeAction.DO_NOTHING;\t\t\t\n\t\t}\n\n\t}",
"private PtoPeriodDTO accruePto(PtoPeriodDTO init, Employee employee) {\n\n\t\tDouble hoursAllowed = init.getHoursAllowed().doubleValue();\n\t\tDouble daysInPeriod = init.getDaysInPeriod().doubleValue();\n\t\tDouble dailyAccrual = hoursAllowed / daysInPeriod;\n\n\t\tlog.info(\"Daily Accrual Rate for this PTO Period: \" + dailyAccrual);\n\n\t\t// Check what the current date is, take the number of days difference\n\t\t// Since the beginning of the period\n\t\t\n\t\tDate beginDate = determineBeginDate(employee);\t\t\n\t\tDate endDate = ZonedDateTimeToDateConverter.INSTANCE.convert(init.getEndDate());\n\t\tDate today = ZonedDateTimeToDateConverter.INSTANCE.convert(ZonedDateTime.now());\n\t\t\n\t\tLong diff = today.getTime() - beginDate.getTime();\n\t\tLong daysPassed = (long) ((TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS)));\n\t\tlog.info(\"Days Passed: \" + daysPassed);\n\t\tLong hoursAccrued = (long) ((TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS)) * dailyAccrual);\n\t\tlog.info(\"Hours: \" + hoursAccrued);\n\t\tinit.setHoursAccrued(hoursAccrued);\n\t\tinit = deductTimeOff(init);\n\t\treturn init;\n\t\t\n\t}",
"@Override\n public double sendCostCalculated(String length, String vehicleType) {\n\n double numOfKm = Double.parseDouble(length);\n double totalCost = 50.0;\n\n if ((numOfKm - 1) < 1) {\n return totalCost;\n }\n\n double nextLength = numOfKm - 1;\n\n switch (vehicleType) {\n case \"budget\":\n totalCost += nextLength * 35;\n break;\n case \"hybrid\":\n totalCost += nextLength * 55;\n break;\n default:\n totalCost += nextLength * 45;\n }\n\n return totalCost;\n }",
"@Override\n\tpublic double GetValue() {\n\t\tdouble spot = inputs.getSpot();\n\t\tdouble strike = inputs.getStrike();\n\t\tdouble vol = inputs.getVol();\n\t\tint noSteps=inputs.getNoSteps();\n\t\tdouble expiry=inputs.getExpiry();\n\t OptionType type=inputs.getType();\n\t ExerciseType exercise=inputs.getExercise();\n\t InterestRate interestRate=inputs.getR();\n\t\t\n\t double timestep = expiry/noSteps;\n\t double DF = Math.exp(-interestRate.GetRate(1.)*timestep);\n\t double temp1 = Math.exp((interestRate.GetRate(1.) + vol * vol)*timestep);\n\t double temp2 = 0.5 * (DF + temp1);\n\t double up = temp2 + Math.sqrt(temp2*temp2 - 1);\n\t double down = 1/ up;\n\t double probaUp = (Math.exp(interestRate.GetRate(1.) * timestep) - down)/(up -down) ;\n\t double probaDown = 1 - probaUp;\n\n\t //stock price tree\n\t\tstockPrice[0][0]=spot;\n\t for (int n = 1; n <= noSteps; n ++) {\n for (int j = n; j > 0; j--){\n \tstockPrice[j][n] = up * stockPrice[j-1][n-1];\n }\n \t\tstockPrice[0][n] = down * stockPrice[0][n-1];\n }\n\t \n\t //last column set payoffs\n\t\tfor (int j = 0; j <= noSteps; j++) {\n\t\t\t\tif(type.equals(OptionType.CALL)) {\n\t\t\t\t\tpayOff[j][noSteps] = Math.max(this.stockPrice[j][noSteps] - strike, .0);\n\t\t\t\t}else {\n\t\t\t\t\tpayOff[j][noSteps] = Math.max(strike - this.stockPrice[j][noSteps], .0);\n\t\t\t\t}\n\t\t}\n\n\t\t\n\t //payoff tree in backwardation\n\t \n\t for (int i = noSteps ; i >= 1; i--) {\n for (int j = 0; j <= i-1; j++) {\n\t \tif(exercise.equals(ExerciseType.AMERICAN)) { \n\t //American\t\n\t \t\tif(type.equals(OptionType.CALL)) {\n\t \t\t\t\tpayOff[j][i-1] = Math.max(DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]) ,\n\t \t\t\t\tMath.max(this.stockPrice[j][i-1] - strike, .0));\n\t \t\t\t\n\t \t\t}else \tpayOff[j][i-1] = Math.max(DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]) ,\n\t \t\t\t\tMath.max(strike - this.stockPrice[j][i-1] , .0));\n\t \t}else { \n\t \t\t\t//European put and call option\n\t \t\t\t\tpayOff[j][i-1] = DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]);\n\t }\n }\n }\n\t \n\t double deltaUp = (payOff[0][2]-payOff[1][2])/(stockPrice[0][2]-stockPrice[1][2]);\n\t double deltaDown = (payOff[1][2]-payOff[2][2])/(stockPrice[1][2]-stockPrice[2][2]);\n\t delta = (deltaUp + deltaDown) /2;\n\t gamma = (deltaUp-deltaDown)/((stockPrice[0][2]-stockPrice[2][2])/2);\n\t theta = (payOff[1][2]-payOff[0][0])/(365*2*timestep);//time in days\n\t \n\t long rounded = Math.round(payOff[0][0]*10000);\n\t return rounded/10000.0;\n\t}",
"private double objectiveFunction(final Map<DateTime, Position> position,\n\t\t\tfinal Schedule scheduleOfOtherDevices) {\n\t\tdouble fitness = 0;\n\n\t\tfor (DateTime currentRun : position.keySet()) {\n\t\t\tPosition currentPosition = position.get(currentRun);\n\t\t\tAmount<Power> loadNeededForEverySlotOfRun = currentPosition\n\t\t\t\t\t.getChosenValue();\n\n\t\t\tDateTime currentTime = currentPosition.getPossibleRun()\n\t\t\t\t\t.getEarliestStartTime();\n\t\t\twhile (currentTime.isBefore(currentRun.plus(currentPosition\n\t\t\t\t\t.getPossibleRun().getLengthOfRun()))) {\n\t\t\t\tCostFunction costFunction = pricingService\n\t\t\t\t\t\t.getCostFunction(currentTime);\n\n\t\t\t\tif (costFunction == null) {\n\t\t\t\t\t/*\n\t\t\t\t\t * LOG.error(\n\t\t\t\t\t * \"No cost function for time {} found. Substituting with {}\\navailable cost functions:\\n{}\"\n\t\t\t\t\t * , currentTime, DEFAULT_COSTS, StringUtils.join(\n\t\t\t\t\t * pricingService.getCostFunctions(), '\\n'));\n\t\t\t\t\t */\n\t\t\t\t\t/*\n\t\t\t\t\t * throw new IllegalArgumentException( String.format(\n\t\t\t\t\t * \"No cost function for time %s found\\navailable cost functions:\\n%s\"\n\t\t\t\t\t * , currentTime, StringUtils.join(\n\t\t\t\t\t * pricingService.getCostFunctions(), '\\n')));\n\t\t\t\t\t */\n\t\t\t\t\tfitness += DEFAULT_COSTS;\n\t\t\t\t} else {\n\t\t\t\t\tMap<DateTime, Slot> schedule = scheduleOfOtherDevices\n\t\t\t\t\t\t\t.getSchedule();\n\t\t\t\t\tif (schedule == null || schedule.get(currentTime) == null) {\n\t\t\t\t\t\tfitness += costFunction.getPrice()\n\t\t\t\t\t\t\t\t.getCostAtConsumption(\n\t\t\t\t\t\t\t\t\t\tloadNeededForEverySlotOfRun\n\t\t\t\t\t\t\t\t\t\t\t\t.divide(1000));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfitness += costFunction.getPrice()\n\t\t\t\t\t\t\t\t.getCostAtConsumption(\n\t\t\t\t\t\t\t\t\t\tloadNeededForEverySlotOfRun.plus(\n\t\t\t\t\t\t\t\t\t\t\t\tschedule.get(currentTime)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getLoad())\n\t\t\t\t\t\t\t\t\t\t\t\t.divide(1000));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcurrentTime = currentTime.plusMinutes(Constants.SLOT_INTERVAL);\n\t\t\t}\n\t\t}\n\t\treturn fitness;\n\t}",
"private double manufacturePhase(double time) {\n\n\t\tif (person != null) {\n\t\t\tif (person.isOutside()) {\n\t\t\t\tendTask();\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\telse if (robot != null) {\n\t\t\tif (robot.isOutside()) {\n\t\t\t\tendTask();\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t// Check if workshop has malfunction.\n\t\tif (workshop.getBuilding().getMalfunctionManager().hasMalfunction()) {\n\t\t\tendTask();\n\t\t\treturn 0;\n\t\t}\n\n\t\telse {\n\t // Cancel any manufacturing processes that's beyond the skill of any people\n\t // associated with the settlement.\n\t\t\tManufactureGood.cancelDifficultManufacturingProcesses(workshop.getBuilding().getSettlement());\n\t \n\t\t\t// Determine amount of effective work time based on \"Materials Science\"\n\t\t\t// skill.\n\t\t\tdouble workTime = time;\n\t\t\tint skill = getEffectiveSkillLevel();\n\t\t\tif (skill == 0) {\n\t\t\t\tworkTime /= 2;\n\t\t\t} else {\n\t\t\t\tworkTime += workTime * (.2D * (double) skill);\n\t\t\t}\n\t\n\t\t\t// Apply work time to manufacturing processes.\n\t\t\twhile ((workTime > 0D) && !isDone()) {\n\t\t\t\tManufactureProcess process = getRunningManufactureProcess();\n\t\t\t\tif (process != null) {\n\t\t\t\t\tdouble remainingWorkTime = process.getWorkTimeRemaining();\n\t\t\t\t\tdouble providedWorkTime = workTime;\n\t\t\t\t\tif (providedWorkTime > remainingWorkTime) {\n\t\t\t\t\t\tprovidedWorkTime = remainingWorkTime;\n\t\t\t\t\t}\n\t\t\t\t\tprocess.addWorkTime(providedWorkTime);\n\t\t\t\t\tworkTime -= providedWorkTime;\n\t\n\t\t\t\t\tif ((process.getWorkTimeRemaining() <= 0D) && (process.getProcessTimeRemaining() <= 0D)) {\n\t\t\t\t\t\tworkshop.endManufacturingProcess(process, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse {\n\t\n\t\t\t\t\tif (person != null) {\n\t\t\t\t\t\tif (!person.getSettlement().getManufactureOverride())\n\t\t\t\t\t\t\tprocess = createNewManufactureProcess();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if (robot != null) {\n\t\t\t\t\t\tif (!robot.getSettlement().getManufactureOverride())\n\t\t\t\t\t\t\tprocess = createNewManufactureProcess();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (process == null) {\n\t\t\t\t\t\tendTask();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\tif (process != null)\n\t\t\t\t\t// Prints description\n\t\t\t\t\tsetDescription(Conversion.capitalize(process.toString())); // $NON-NLS-1$\n\t\t\t\telse\n\t\t\t\t\tsetDescription(Msg.getString(\"Task.description.manufactureGood.inspecting\")); //$NON-NLS-1$\n\t\n\t\t\t}\n\t\n\t\t\t// Add experience\n\t\t\taddExperience(time);\n\t\n\t\t\t// Check for accident in workshop.\n\t\t\tcheckForAccident(time);\n\n\t\t}\n\t\t\n\t\treturn 0D;\n\t}",
"@Test\n\tpublic void test_PNL_2Deals_Aggreg_buy(){\n\t\tpa.addTransaction(new Trade(new Date(), new Date(), \"\", 0.10, AAPL, 10.0, 10.0));\n\t\tpa.addTransaction(new Trade(new Date(), new Date(), \"\", 0.10, AAPL, 10.0, 15.0));\n\t\tassertEquals( \"150.00\", nf.format(new PNLImpl(pa, AAPL,16.00).getPNLUnrealized(false)) );\n\t}",
"public static void main (String [] args)\n {\n DecimalFormat mine = new DecimalFormat(\"$#,##0.00\");\n String name = \"\" ;\n String product = \" \";\n char choice = ' ';\n char prod;\n int qty = 0;\n int count = 0;\n double cost_of_product=0.0;\n double cost_of_shipment = 0.0;\n char deliveryType;\n double total_cost_of_product = 0.0;\n int total_Gizmo = 0;\n int total_Widget = 0;\n double total_Cost = 0;\n double total_Gizmo_Cost = 0;\n double total_Widget_Cost = 0; // list of variables\n\n System.out.print(\"Please enter your name: \");\n name = GetInput.readLine(); //customer enters name\n\n do {\n System.out.print(\"What product would you like to order (W/G): \");\n product =GetInput.readLine();\n prod = Character.toUpperCase(product.charAt(0));\n prod = validateProduct(prod); //validate W or G\n if(prod == 'W')\n {\n System.out.print(\"What quantity of Widgets do you want to order?: \");\n qty = GetInput.readLineInt();\n qty = widgetQty(qty);\n\n }\n else\n {\n System.out.print(\"What quantity of Gizmos do you want to order?: \");\n qty = GetInput.readLineInt();\n qty = gizmoQty(qty);\n } //qty of widgets/gizmos\n\n cost_of_product = Orders.productCost(qty, prod); //connecting TestOrders and Orders\n\n System.out.print(\"What shipping method would you like (F/U)?: \");\n deliveryType = Character.toUpperCase(GetInput.readLineNonwhiteChar());\n deliveryType = validateShipping(deliveryType); //selecting F or U shipping\n\n cost_of_shipment = Orders.shippingCost(qty, prod, deliveryType);\n //connecting TestOrders and Orders\n\n System.out.println(\"\\nCustomer: \" + name );//Detail report\n System.out.println(\"Ordered \" + qty +\" \"\n +(prod == 'W' ? \"Widgets \":\"Gizmos \") + \"costing \" + mine.format(cost_of_product) + \".\");\n System.out.println(\"Shipped via \"+ (deliveryType =='F' ? \"Fred \":\"USPS \")\n + \"costing \" + mine.format(cost_of_shipment) + \".\");\n\n total_cost_of_product = Orders.totalCost(cost_of_product, cost_of_shipment);\n //connecting TestOrders and Orders\n\n System.out.println(\"Total order cost is \" + mine.format(total_cost_of_product));\n\n count = count + 1; // order counter\n\n if(prod =='G')\n {\n total_Gizmo = total_Gizmo + qty;\n total_Gizmo_Cost = total_Gizmo_Cost + total_cost_of_product;\n }\n else\n {\n total_Widget = total_Widget + qty;\n total_Widget_Cost = total_Widget_Cost + total_cost_of_product;\n }\n\n total_Cost = total_Cost + total_cost_of_product;\n\n System.out.println(\"\\nDo you wish to make another order?: \");\n choice = GetInput.readLineNonwhiteChar(); //user enters Y/N to continue\n }while ((choice == 'Y') || (choice == 'y')); // end of do/while loop\n\n System.out.println(\"\\nSummary Report\"); //summary report\n System.out.println(count + \" Total Orders\");\n System.out.print(\"Total quantity of Gizmos ordered: \" + total_Gizmo\n + \" at a cost of \" + mine.format(total_Gizmo_Cost) );\n System.out.print(\"\\nTotal quantity of Widgets ordered: \" + total_Widget\n + \" at a cost of \" + mine.format(total_Widget_Cost));\n System.out.println(\"\\nTotal sales amount: \" + mine.format(total_Cost));\n }",
"public abstract double applyDiscount(double p);",
"public void calculateCost() {\n \tdouble costToShipPack;\n \tint numOfPacks = 1;\n \t\n \tfor(Package p: this.packages) {\n \t\tcostToShipPack = 3 + (p.calcVolume() - 1);\n \t\tthis.totalAmounts.put(\"Package \"+numOfPacks, costToShipPack);\n \t\tnumOfPacks++;\n \t}\n \t\n }",
"public static void main(String[] args) throws InterruptedException {\n Item item1 = new Item(\"Coca-cola\", 200);\n System.out.println(\"Price before discount: \" + item1.getPrice());\n System.out.println(\"Price after discount: \" + item1.calculateDiscount()); //should be same price, 200, there's no doscount for this type\n\n ItemWithDiscount item2 = new ItemWithDiscount(\"Coca-cola Zero\", 2.0);\n System.out.println(\"\\nPrice before discount: \" + item2.getPrice());\n item2.setDiscount(10);\n System.out.println(\"Price after discount: \" + item2.calculateDiscount()); // 2 - 0.2 = 1.8\n\n\n //CHECK BUY PAY DISCOUNT\n BuyMorePayLess item04 = new BuyMorePayLess(\"Milk\", 10);\n BuyMorePayLess item05 = new BuyMorePayLess(\"Milk\", 10);\n BuyMorePayLess item06 = new BuyMorePayLess(\"Milk\", 1);\n item04.setBuyPayOffer(3,2);\n item04.calculateDiscount();\n\n //Check TakeItAll discount\n ItemTakeItAll item07 = new ItemTakeItAll(\"Tuna\",5.00);\n ItemTakeItAll item08 = new ItemTakeItAll(\"Tuna\",5.00);\n\n// item07.setDiscount(10);\n item07.setMinimumNumber(1);\n System.out.println(\"##################\" + item07.calculateDiscount());\n\n // USERS\n LoyalCustomer customer01 = new LoyalCustomer(\"Giorgi Tsipuria\", \"giobaski\", \"123\",\n \"Gonsiori 33\",\"55945239\");\n\n //B A S K E T S\n Basket basket01 = new Basket(\"Tartu 46\", \"Kairi\", customer01);\n basket01.insertItem(item1); //200 -> 200\n basket01.insertItem(item2); // 2.0 -> 1.8\n System.out.println(\"Total payment in basket: \" + basket01.caclulatePayment()); //201.8 + 201.8 * 0.1 = 221.98\n\n\n\n\n\n //1. Create Store\n Store store = new Store(\"Raua 16\");\n\n //2. sign into store\n Cashier currentCashier = store.cashierAuthentication();\n\n //3.\n Menu currentMenu = store.openMenu();\n\n //4. new basket\n currentMenu.openNewBasket(customer01);\n\n\n //5.Cashier starts adding items into new basket\n System.out.println(currentMenu.getBasket());\n currentMenu.getBasket().insertItem(item1);\n currentMenu.getBasket().insertItem(item2);\n\n\n System.out.println(\"######Basket By ID:\");\n currentMenu.printBasketInfoById(2);\n System.out.println(\"########\");\n\n\n //6. Calculate total price for the current basket\n currentMenu.getBasket().caclulatePayment();\n System.out.println(currentMenu.getBasket());\n System.out.println(\"currents items: \");\n System.out.println(currentMenu.getBasket().getItems());\n\n //7. Logout cashier\n Thread.sleep(10000);\n currentMenu.exit();\n\n\n // Additional features\n System.out.println(\"points of the loyal customer: \" + customer01.getPoints());\n\n System.out.println(\"Bonus for cashier: \" + currentCashier.calculateBonus() + \" Euros\");\n\n\n\n\n\n\n }",
"private void convertReqsInCriterions(){\n\t\tArrayList<Criterion> criteria = this.data.getCriteria();\n\t\t\n\t\tfor(Requirement req : this.data.getRequirements()){\n\t\t\tif(req.isCriterion()){\n\t\t\t\t//create new criterion\n\t\t\t\tCriterion crit = new Criterion();\n\t\t\t\tif(req.getQuantType() != null)\n\t\t\t\t\tcrit.setName(req.getQuantType().getValue());\n\t\t\t\telse if(req.getQualType() != null)\n\t\t\t\t\tcrit.setName(req.getQualType().getValue());\n\t\t\t\telse\n\t\t\t\t\t//this is a price requirement\n\t\t\t\t\tcrit.setName(\"price\");\n\t\t\t\t\n\t\t\t\tString[] msg = {crit.getName(), \"General\"};\n\t\t\t\tif(this.methodID == CloudAid.SAW){\n\t\t\t\t\tFloat weight = Float.parseFloat(CloudAid.askData(CloudAid.GET_WEIGHT, msg, null));\n\t\t\t\t\tcrit.setWeight(weight);\n\t\t\t\t}\n\t\t\t\t//get the criterion preference direction\n\t\t\t\tString res = CloudAid.askData(CloudAid.GET_PREFERENCE_DIRECTION, msg, null);\n\t\t\t\tif(res.equalsIgnoreCase(\"y\")){\n\t\t\t\t\tcrit.setPreferenceDirection(\"max\");\n\t\t\t\t}else if(res.equalsIgnoreCase(\"n\")){\n\t\t\t\t\tcrit.setPreferenceDirection(\"min\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcriteria.add(crit);\n\t\t\t}\n\t\t}\n\t\tthis.data.setCriteria(criteria);\n\t\t\n\t\t//convert each serpiceTemplate requirements\n\t\tfor(ServiceTemplate template : this.data.getServiceTemplates()){\n\t\t\tArrayList<Criterion> templateCriteria = template.getCriteria();\n\t\t\tfor(Requirement req: template.getRequirements()){\n\t\t\t\tif(req.isCriterion()){\n\t\t\t\t\t//create new criterion\n\t\t\t\t\tCriterion crit = new Criterion();\n\t\t\t\t\tif(req.getQuantType() != null)\n\t\t\t\t\t\tcrit.setName(req.getQuantType().getValue());\n\t\t\t\t\telse if(req.getQualType() != null)\n\t\t\t\t\t\tcrit.setName(req.getQualType().getValue());\n\t\t\t\t\telse\n\t\t\t\t\t\t//this is a price requirement\n\t\t\t\t\t\tcrit.setName(\"price\");\n\t\t\t\t\t\n\t\t\t\t\tString[] msg = {crit.getName(), template.getType()};\n\t\t\t\t\tif(this.methodID == CloudAid.SAW){\n\t\t\t\t\t\tFloat weight = Float.parseFloat(CloudAid.askData(CloudAid.GET_WEIGHT, msg, null));\n\t\t\t\t\t\tcrit.setWeight(weight);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//get the criterion preference direction\n\t\t\t\t\tString res = CloudAid.askData(CloudAid.GET_PREFERENCE_DIRECTION, msg, null);\n\t\t\t\t\tif(res.equalsIgnoreCase(\"y\")){\n\t\t\t\t\t\tcrit.setPreferenceDirection(\"max\");\n\t\t\t\t\t}else if(res.equalsIgnoreCase(\"n\")){\n\t\t\t\t\t\tcrit.setPreferenceDirection(\"min\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\ttemplateCriteria.add(crit);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttemplate.setCriteria(templateCriteria);\n\t\t}\n\t}",
"public abstract double getCost();",
"double GetTaskPrice(int Catalog_ID);",
"private static void wageComputation() {\n Random random = new Random();\n while ( totalEmpHrs < MAX_HRS_IN_MONTHS && totalWorkingDays < numOfWorkingDays ) {\n int empCheck = (int) Math.floor(Math.random() * 10) % 3;\n switch (empCheck) {\n case IS_FULL_TIME:\n empHrs = 8;\n break;\n case IS_PART_TIME:\n empHrs = 4;\n break;\n default:\n }\n totalEmpHrs = totalEmpHrs + empHrs;\n }\n\n int empWage = totalEmpHrs * EMP_RATE_PER_HOUR;\n System.out.println(\"Employee Wage is : \" + empWage);\n }",
"public final double calculateCarbon() {\n\n if (calories > 2000) {\n allowedCarbonPerYear = 2200 * quantity;\n\n } else {\n allowedCarbonPerYear = 2000 * quantity;\n }\n allowedCarbonPerDay = (double) allowedCarbonPerYear / (double) 365;\n // String strDouble = String.format(\"%.2f\", allowedCarbonPerDay);\n // System.out.println(strDouble);\n return allowedCarbonPerDay;\n\n }",
"public double getCost() {\n double price = 0;\n price += this.numPizzas * this.pizzaType.getCost();\n if(this.numPizzas >= 20) // Discount if >=20 pizzas\n return price * 0.9;\n else if(this.numPizzas >= 10) // Discount if between 10 and 20 pizzas\n return price * 0.95;\n return price; // No discount\n }"
] | [
"0.7704654",
"0.5737509",
"0.56438065",
"0.5544376",
"0.5502434",
"0.54536986",
"0.54102707",
"0.5368175",
"0.5260587",
"0.5252559",
"0.524806",
"0.5242518",
"0.5231174",
"0.51814425",
"0.51746017",
"0.51631325",
"0.5154602",
"0.5130876",
"0.51242507",
"0.51152706",
"0.50779873",
"0.5075925",
"0.50645226",
"0.5050782",
"0.50332093",
"0.5030242",
"0.5020802",
"0.50190216",
"0.5008052",
"0.50019795",
"0.49958694",
"0.49853772",
"0.4983781",
"0.498004",
"0.49763525",
"0.49742863",
"0.49704784",
"0.49700728",
"0.49676403",
"0.4951607",
"0.4915178",
"0.49097657",
"0.4907945",
"0.4898475",
"0.48962748",
"0.4894386",
"0.48935032",
"0.4893203",
"0.4883371",
"0.48713744",
"0.4863591",
"0.48629203",
"0.4849938",
"0.48485047",
"0.4847472",
"0.4843009",
"0.48424834",
"0.48377845",
"0.48377845",
"0.48344865",
"0.4823662",
"0.48235852",
"0.48166484",
"0.48062345",
"0.48031032",
"0.47804984",
"0.4774184",
"0.4774179",
"0.47628415",
"0.47580144",
"0.47534108",
"0.47519875",
"0.47509292",
"0.47464398",
"0.474589",
"0.47416338",
"0.47392857",
"0.4732276",
"0.47271892",
"0.47258118",
"0.4725547",
"0.47236073",
"0.4721639",
"0.47176504",
"0.4710975",
"0.47082424",
"0.47069308",
"0.46993005",
"0.46939817",
"0.46841037",
"0.4684062",
"0.46834168",
"0.4681444",
"0.46786195",
"0.46732274",
"0.46728668",
"0.4670298",
"0.46658137",
"0.4662385",
"0.46604797"
] | 0.751986 | 1 |
Gets sum of usage of clientID/instanceID mappings and returns ArrayList of last events. | private TSDBData getBillingModel(HashMap<String, ArrayList<String>> clientInstanceMap, InfluxDBClient dbClient) {
logger.trace("BEGIN TSDBData sumUsage(HashMap<String, ArrayList<String>> clientInstanceMap, InfluxDBClient dbClient)");
ArrayList<TSDBData> UDRs = new ArrayList<TSDBData>();
Iterator it = clientInstanceMap.entrySet().iterator();
while (it.hasNext()) {
Map.Entry pair = (Map.Entry) it.next();
String clientId = pair.getKey().toString();
ArrayList<String> instances = (ArrayList<String>) pair.getValue();
for (String instance : instances) {
//System.out.println("instanceid = " + instance);
//System.out.println("clientid = " + clientId);
String queryString = "SELECT sum(usage) FROM UDR WHERE clientId='" +
clientId + "' AND instanceId='" + instance +
"' GROUP BY clientID,instanceID";
logger.trace("DATA TSDBData sumUsage(...): query=" + queryString);
// TSDBData[] lastEvent = dbClient.query(queryString);
//sends the event to array
//lastEvents.add(lastEvent[0]);
}
System.out.println(pair.getKey() + " = " + pair.getValue());
it.remove(); // avoids a ConcurrentModificationException
}
logger.trace("END ArrayList<TSDBData> captureLastEvents(HashMap<String, ArrayList<String>> clientInstanceMap, InfluxDBClient dbClient)");
return UDRs.get(0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private HashMap<String, ArrayList<String>> getInstanceIdsPerClientId(TSDBData[] tsdbData) {\n logger.trace(\"BEGIN HashMap<String,ArrayList<String>> getInstanceIdsPerClientId(TSDBData[] tsdbData)\");\n HashMap<String, ArrayList<String>> map = new HashMap<String, ArrayList<String>>();\n for (TSDBData obj : tsdbData) {\n ArrayList<String> columns = obj.getColumns();\n ArrayList<ArrayList<Object>> points = obj.getPoints();\n int clientidIndex = -1;\n int instanceidIndex = -1;\n for (int i = 0; i < columns.size(); i++) {\n if (columns.get(i).equals(\"clientId\"))\n clientidIndex = i;\n else if (columns.get(i).equals(\"instanceId\"))\n instanceidIndex = i;\n }\n for (int i = 0; i < points.size(); i++) {\n String clientId = points.get(i).get(clientidIndex).toString();\n String InstanceId = points.get(i).get(instanceidIndex).toString();\n if (!(map.containsKey(clientId))) {\n map.put(clientId, new ArrayList<String>());\n if (!(map.get(clientId).contains(InstanceId))) {\n map.get(clientId).add(InstanceId);\n }\n } else {\n if (!(map.get(clientId).contains(InstanceId))) {\n map.get(clientId).add(InstanceId);\n }\n\n }\n }\n }\n logger.trace(\"END HashMap<String,ArrayList<String>> getInstanceIdsPerClientId(TSDBData[] tsdbData)\");\n return map;\n }",
"java.util.List<java.lang.Long> getUpdateCountsList();",
"Collection<CalendarEvent> getActiveEvents(long when)\n{\n List<CalendarEvent> rslt = new ArrayList<CalendarEvent>();\n try {\n getAllEvents(when);\n rslt.addAll(cal_events);\n }\n catch (Exception e) {\n BasisLogger.logE(\"GOOGLECAL: problem getting events\",e);\n }\n return rslt;\n}",
"private List<Number> setStatistics() {\n // the total waiting time for customers who have been served\n double totalWatingTime = 0;\n // the average waiting time for customers who have been served\n double aveWaitingTime = 0;\n // the number of customers served\n int numOfCusServed = 0;\n // the number of customers who left without being served\n int numOfCusLeft = 0;\n\n for (Event newEvent : this.eventsList) {\n // update number Of customer served\n if (newEvent instanceof ServeEvent) {\n numOfCusServed++;\n }\n // update the total waiting time\n if (newEvent instanceof WaitEvent) {\n double nextAvailableTime = newEvent.getCurrentServer().getNextAvailableTime().get();\n double customerArrivalTime = newEvent.getCustomer().getArrivalTime();\n double startTime = this.eventsList.stream()\n .filter(x -> (x instanceof ServeEvent)\n && (x.getCustomer().getId() == newEvent.getCustomer().getId()))\n .findFirst().get().getStartTime();\n double waitTime = startTime - customerArrivalTime;\n totalWatingTime += waitTime;\n }\n // update the number of customer left\n if (newEvent instanceof LeaveEvent) {\n numOfCusLeft++;\n }\n }\n\n // calculate the average waiting time\n if (numOfCusServed != 0) {\n aveWaitingTime = totalWatingTime / numOfCusServed;\n }\n\n return new ArrayList<>(Arrays.asList(aveWaitingTime, numOfCusServed, numOfCusLeft));\n }",
"MailboxUsageMailboxCounts get() throws ClientException;",
"Map<UUID, Double> getOwners();",
"Map<Long,LinkedList<Event>> getAllEvents(List<Long> inRequestIds);",
"static Map<Integer, Event> getEvents() {\n\t\treturn events;\n\t}",
"public static List<ClientReservedTime> getClientReservedTimes(int clientID) {\n\t\tConnection conn = DBConnection.getConnection();\n\t\tList<ClientReservedTime> clientReservedTimes = new ArrayList<>();\n\t\ttry {\n\t\t\tStatement stmt = conn.createStatement();\n\t\t\tString command = \"SELECT \" +\n\t\t\t\t\t\" r.ID AS id,\" +\n\t\t\t\t\t\" r.DAY_ID AS dayID,\" +\n\t\t\t\t\t\" r.ST_TIME AS startTime,\" +\n\t\t\t\t\t\" r.DURATION AS duration,\" +\n\t\t\t\t\t\" r.RES_CODE_ID AS reserveCode,\" +\n\t\t\t\t\t\" r.RESERVE_GR_TIME AS gregorianDate,\" +\n\t\t\t\t\t\" r.CLIENT_ID as clientID,\" +\n\t\t\t\t\t\" SUM(rs.SERVICE_PRICE) AS cost,\" +\n\t\t\t\t\t\" c.ID AS companyID,\" +\n\t\t\t\t\t\" c.COMP_NAME AS companyName,\" +\n\t\t\t\t\t\" c.COVER_URL AS companyCover,\" +\n\t\t\t\t\t\" u.ID AS unitID,\" +\n\t\t\t\t\t\" u.UNIT_NAME AS unitName,\" +\n\t\t\t\t\t\" IFNULL(com.comment, ' ') AS comment,\" +\n\t\t\t\t\t\" IFNULL(com.SERVICE_RATE, 0) AS commentRate,\" +\n\t\t\t\t\t\" IFNULL(com.ID, 0) AS commentID,\" +\n\t\t\t\t\t\" IFNULL(com.SERVICE_RATE, 0) AS serviceRate,\" +\n\t\t\t\t\t\" IF(com.ID IS NULL and date_add(now(), interval r.DURATION minute)\" +\n \" > r.RESERVE_GR_TIME, TRUE, FALSE) AS commentable\" +\n\t\t\t\t\t\" FROM\" +\n\t\t\t\t\t\" alomonshi.reservetimes r\" +\n\t\t\t\t\t\" LEFT JOIN\" +\n\t\t\t\t\t\" alomonshi.comments com ON com.RES_TIME_ID = r.ID\" +\n\t\t\t\t\t\" AND com.IS_ACTIVE IS TRUE\" +\n\t\t\t\t\t\" LEFT JOIN\" +\n\t\t\t\t\t\" reservetimeservices rs ON rs.RES_TIME_ID = r.ID\" +\n\t\t\t\t\t\" AND rs.IS_ACTIVE IS TRUE\" +\n\t\t\t\t\t\" LEFT JOIN\" +\n\t\t\t\t\t\" units u ON r.UNIT_ID = u.ID AND u.IS_ACTIVE IS TRUE\" +\n\t\t\t\t\t\" LEFT JOIN\" +\n\t\t\t\t\t\" companies c ON u.COMP_ID = c.ID AND c.IS_ACTIVE IS TRUE\" +\n\t\t\t\t\t\" WHERE\" +\n\t\t\t\t\t\" r.STATUS = \" + ReserveTimeStatus.RESERVED.getValue() +\n\t\t\t\t\t\" AND r.CLIENT_ID = \" + clientID +\n\t\t\t\t\t\" GROUP BY r.ID\" +\n\t\t\t\t\t\" ORDER BY r.DAY_ID DESC, r.ST_TIME DESC \";\n\t\t\tResultSet rs = stmt.executeQuery(command);\n\t\t\tfillClientReserveTimeList(rs, clientReservedTimes);\n\t\t}catch(SQLException e) {\n\t\t\tLogger.getLogger(\"Exception\").log(Level.SEVERE, \"Exception \" + e);\n\t\t\treturn null;\n\t\t}finally {\n\t\t\tif(conn != null) {\n\t\t\t\ttry {\n\t\t\t\t\t\tconn.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\tLogger.getLogger(\"Exception\").log(Level.SEVERE, \"Exception \" + e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn clientReservedTimes;\n\t}",
"public java.util.List<java.lang.Long>\n getUpdateCountsList() {\n return java.util.Collections.unmodifiableList(updateCounts_);\n }",
"public ArrayList<String> getEventIdsList(){\n return this.eventIdsList;\n }",
"public ArrayList findAllRoomsWSummary(){\n List <Room> allRooms= roomRepository.findAll();\n System.out.println(\"All rooms is:\");\n System.out.println(allRooms.toString());\n//Set an array list that contains all the data to return to the client\n ArrayList<RoomSummaryMap> dataToReturnToClient = new ArrayList<>();\n\n for (Room room : allRooms) {\n// If there is no associated msg, assign an empty array to the lastMsg.\n if(room.getAssociated_messages().size()<1){\n System.out.println(\"size is less than 1\");\n RoomSummaryMap mapObject= new RoomSummaryMap(room.getId(),room.getName(),\n room.getImage(),\n room.getCreatedBy(),\n room.getAssociated_messages(), \"\");\n System.out.println(\"map object is:\");\n System.out.println(mapObject);\n\n dataToReturnToClient.add(mapObject);\n\n continue;\n }\n System.out.println(\"Size is more than 1\");\n// Else, add the last msg\n String lasMsgObjId=\n room.getAssociated_messages().get(room.getAssociated_messages().size()-1).toString();\n//Query the db for this message\n Message messageInstance= messageService.findbyId(lasMsgObjId);\n dataToReturnToClient.add(new RoomSummaryMap(room.getId(),room.getName(),\n room.getImage(),\n room.getCreatedBy(),\n room.getAssociated_messages(), messageInstance.getMessage()));\n }\n\n System.out.println(\"data to return to client inside room service\");\n System.out.println(dataToReturnToClient);\n return dataToReturnToClient;\n }",
"public Collection<SapEvent> getEvents(final SessionContext ctx)\n\t{\n\t\treturn EVENTSHANDLER.getValues( ctx, this );\n\t}",
"private List<String> getDataFromApi() throws IOException {\n // List the next 10 events from the primary calendar.\n DateTime now = new DateTime(System.currentTimeMillis());\n List<String> eventStrings = new ArrayList<String>();\n Events events = mService.events().list(\"primary\")\n .setMaxResults(10)\n .setTimeMin(now)\n .setOrderBy(\"startTime\")\n .setSingleEvents(true)\n .execute();\n List<Event> items = events.getItems();\n\n for (Event event : items) {\n DateTime start = event.getStart().getDateTime();\n if (start == null) {\n // All-day events don't have start times, so just use\n // the start date.\n start = event.getStart().getDate();\n }\n eventStrings.add(\n String.format(\"%s (%s)\", event.getSummary(), start));\n }\n return eventStrings;\n }",
"public ArrayList<Event> getEvents(){return new ArrayList<Event>(events);}",
"public int getNumberOfMultiUpdated(Identity owner, Map<String, Long> sinceTimes);",
"private ArrayList<Item> getEvents() {\n\t\tArrayList<Item> events = Magical.getStorage().getList(\n\t\t\t\tStorage.EVENTS_INDEX);\n\t\treturn events;\n\t}",
"public List<EventMember> getTimeKeepingEventMemberListByEventId( long eventId);",
"public static ArrayList<Events> getEventsArrayList(){\n if (EVENTS_ARRAY_LIST.isEmpty()){\n EVENTS_ARRAY_LIST.addAll(generateEventList());\n }\n return EVENTS_ARRAY_LIST;\n }",
"CompletableFuture<Map<String, Object>> getAccumulators();",
"public java.util.List<java.lang.Long>\n getUpdateCountsList() {\n return updateCounts_;\n }",
"public Map<Long, Long> getInstanceCount() {\n if (instanceCountMap == null) {\n FxSharedUtils.getMappedFunction(new FxSharedUtils.ParameterMapper<Long, Long>() {\n @Override\n public Long get(Object key) {\n return EJBLookup.getTypeEngine().getInstanceCount(Long.valueOf(key.toString()));\n }\n }, true);\n }\n return instanceCountMap;\n }",
"@RequestMapping(value = \"/discovery-client/instances\", method = RequestMethod.GET)\n public Map<String, Integer> getAllInstances() {\n final Map<String, Integer> response = new HashMap<>();\n\n final Applications applications = discoveryClient.getApplications();\n final List<Application> applicationList = applications.getRegisteredApplications();\n\n //TODO Java 8 Stream\n // Get instances from eureka\n for (final Application app : applicationList) {\n response.put(app.getName(), app.getInstances().size());\n }\n\n return response;\n }",
"public static ArrayList<NumberOfMsgFrom> getUnseenMessagesNumberForAdmin() {\r\n\t\tSystem.out.println(\"CustomerBAL.getUnseenMessagesNumberForAdmin()\");\r\n\t\tString msgfrom;\r\n\t\tint msgfromid;\r\n\t\tTimestamp dateTime;\r\n\t\tString prettyTime;\r\n\t\tint appliance_id;\r\n\t\t// connection.Connect.init2();\r\n\t\tPrettyTime p = new PrettyTime();\r\n\t\tArrayList<NumberOfMsgFrom> list = new ArrayList<>();\r\n\t\tNumberOfMsgFrom bean;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tConnection connection = Connect.getConnection();\r\n\t\t\tif (connection != null) {\r\n\r\n\t\t\t\tCallableStatement prepareCall = connection\r\n\t\t\t\t\t\t.prepareCall(\"{CALL get_unseen_messages_number_for_admin()}\");\r\n\t\t\t\tResultSet resultSet = prepareCall.executeQuery();\r\n\t\t\t\t// End Stored Procedure\r\n\t\t\t\twhile (resultSet.next()) {\r\n\t\t\t\t\tmsgfrom = resultSet.getString(1);\r\n\t\t\t\t\tmsgfromid = resultSet.getInt(2);\r\n\t\t\t\t\tdateTime = resultSet.getTimestamp(3);\r\n\t\t\t\t\tappliance_id = resultSet.getInt(4);\r\n\t\t\t\t\tDate date = new Date(dateTime.getTime());\r\n\t\t\t\t\tprettyTime = p.format((date));\r\n\r\n\t\t\t\t\tbean = new NumberOfMsgFrom();\r\n\t\t\t\t\tbean.setMsg_form(msgfrom);\r\n\t\t\t\t\tbean.setMsg_id(msgfromid);\r\n\t\t\t\t\tbean.setMsg_time(prettyTime);\r\n\t\t\t\t\tbean.setAppliance_id(appliance_id);\r\n\t\t\t\t\tlist.add(bean);\r\n\t\t\t\t}\r\n\t\t\t\t// rs.close();\r\n\t\t\t\t// con.close();\r\n\t\t\t\tconnection.close();\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlogger.error(\"\", e);\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\r\n\t\t}\r\n\t\treturn list;\r\n\r\n\t}",
"public ArrayList<ClientHandler> getClientList()\n {\n return clientList;\n }",
"List<RecordCount> getRecordCounts(String clientId) throws Exception;",
"public abstract Map<Object,Map<String,Integer>> getEventHandlerCounts();",
"public synchronized long getEntries() {\n return entries;\n }",
"public Collection getUpdatedObjectIds() {\n if (_payload == PAYLOAD_EXTENTS)\n throw new UserException(s_loc.get(\"extent-only-event\"));\n return (_updates == null) ? Collections.EMPTY_LIST : _updates;\n }",
"public List<Integer> getAllIDClient(){\n\t\tPreparedStatement ps = null;\n\t\tResultSet resultatRequete =null;\n\t\t\n\t\ttry {\n\t\t\tString requeteSqlGetAll=\"SELECT id_client FROM clients\";\n\t\t\tps = this.connection.prepareStatement(requeteSqlGetAll);\n\t\t\t\n\t\t\tresultatRequete = ps.executeQuery();\n\n\t\t\tClient client = null;\n\t\t\t\n\t\t\tList<Integer> listeIDClient = new ArrayList <>();\n\n\t\t\twhile (resultatRequete.next()) {\n\t\t\t\tint idClient = resultatRequete.getInt(1);\n\t\t\t\t\n\t\t\t\tlisteIDClient.add(idClient);\n\t\t\t\t\n\t\t\t}//end while\n\t\t\treturn listeIDClient;\n\t\t\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tif(resultatRequete!= null) resultatRequete.close();\n\t\t\t\tif(ps!= null) ps.close();\n\t\t\t\t\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public java.util.ArrayList getAutoEventCollection()\n {\n return _autoEventList;\n }",
"public Map<String,ClientHandler> getUserList()\n {\n return userList;\n }",
"public Set<Long> getCallees(ThreadInfo thread) {\n Map<Long, MethodStats> perCalleeStats = mPerThreadStatsByCallee.row(thread.getId());\n return perCalleeStats.keySet();\n }",
"Map<String, ClientMetrics> getClientMetrics();",
"public List<String> getHotels() {\n\t\t// FILL IN CODE\n\t\tlock.lockRead();\n\t\ttry{\n\t\t\tList<String> hotelIds = new ArrayList<>();\n\t\t\tif(hotelIds != null){\n\t\t\t\thotelIds = new ArrayList<String>(hotelMap.keySet());\n\t\t\t}\n\t\t\treturn hotelIds;\n\t\t}\n\t\tfinally{\n\t\t\tlock.unlockRead();\n\t\t}\n\t}",
"public Map getServicesInUseMap() {\n \t\tsynchronized (contextLock) {\n \t\t\treturn servicesInUse;\n \t\t}\n \t}",
"List<Integer> getIdUsersWithExpiredLifeTimeList( Timestamp currentTimestamp );",
"public static Collection<Access.AccessStatsEntry> getStatistics() {\n accessorQueueLen.count = accessorQueue.size();\n\n return stats;\n }",
"private static List<Event> getMyEvents(List<Registration> registrations) {\n List<Event> result = new ArrayList<>();\n for (Registration registration : registrations) {\n result.add(registration.getEvent());\n }\n return result;\n }",
"public ArrayList<String> getEvents() {\n // TODO\n return res;\n }",
"public Long getCalls() {\r\n return calls;\r\n }",
"@Transactional\r\n\tprotected Map<String, Liability> clientAggregate(Message<Liability> margins) {\r\n\r\n\t\tMap<String, Liability> aggregation = new HashMap<String, Liability>();\r\n\t\tif (margins != null) {\r\n\t\t\tRatesContainer rates = ratesProvider.getLatestRates();\r\n\t\t\tList<String> FCMs = memberService.getEnclearFCMs();\r\n\r\n\t\t\tfor (Liability l : margins.getDetails()) {\r\n\t\t\t\tString member = l.getMnemonic();\r\n\t\t\t\tif( FCMs.contains(member) ) {\r\n\t\t\t\t\tString type = l.getClient().getClientIdentifierType();\r\n\t\t\t\t\tString id = l.getClient().getClientIdentifier();\r\n\t\t\t\t\tString key = type + id;\r\n\r\n\t\t\t\t\t// Only clients' liabilities will enter here\r\n\t\t\t\t\tif (StringUtils.hasText(key)) {\r\n\t\t\t\t\t\tClient client = clientDao.add(id, type);\r\n\t\t\t\t\t\tl.setClient(client); // set with the persisted obj\r\n\r\n\t\t\t\t\t\tBigDecimal value = l.getValue();\r\n\t\t\t\t\t\tint scale = value.scale();\r\n\t\t\t\t\t\tfinal BigDecimal usd;\r\n\t\t\t\t\t\tif (Currency.USD.getCode().equals(l.getCurrency())){\r\n\t\t\t\t\t\t\tusd = value;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tAmount foreignAmount = new Amount(value, new Currency(l.getCurrency()));\r\n\t\t\t\t\t\t\t// the client's total liability in USD is used for the LSV and CVM\r\n\t\t\t\t\t\t\tusd = foreignAmount.convert(Currency.USD, rates).getValue().setScale(2, RoundingMode.HALF_EVEN);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// if it doesn't already exist put\r\n\t\t\t\t\t\tLiability m = aggregation.get(key);\r\n\t\t\t\t\t\tif (m == null) {\r\n\t\t\t\t\t\t\tm = l.clone();\r\n\t\t\t\t\t\t\tm.setValue(usd);\r\n\t\t\t\t\t\t\tm.setCurrency(Currency.USD.getCode());\r\n\t\t\t\t\t\t\taggregation.put(key, m);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tBigDecimal total = usd.add(m.getValue());\r\n\t\t\t\t\t\t\tm.setValue(total);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn aggregation;\r\n\t}",
"public EventList getEvents(String userName) {\n try {\n PreparedStatement s = sql.prepareStatement(\"SELECT userId, eventName, startMonth, startDay, startYear, startHour, startMinute\" +\n \", endMonth, endDay, endYear, endHour, endMinute FROM Events WHERE userId=?\");\n s.setInt(1, getIdOfUser(userName));\n s.execute();\n ResultSet results = s.getResultSet();\n\n EventList events = new EventList();\n if (!results.isBeforeFirst()) {\n return events;\n }\n\n while (!results.isLast()) {\n results.next();\n Event e = new Event(userName, results.getString(2),\n results.getInt(3), results.getInt(4), results.getInt(5),\n results.getInt(6), results.getInt(7), results.getInt(8),\n results.getInt(9), results.getInt(10), results.getInt(11),\n results.getInt(12));\n events.add(e);\n }\n results.close();\n s.close();\n events.sort();\n\n return events;\n } catch (SQLException e) {\n System.err.println(\"SQLE\");\n sqlException(e);\n return null;\n }\n }",
"public ArrayList<Long>\n getTimeStamps() \n {\n return pTimeStamps; \n }",
"public Collection<Long> getAvailableItems();",
"private Set<Map.Entry<String, Integer>> getEndpointFrequencyEntrySet() {\n return endpointVisitFrequency.entrySet();\n }",
"List<ResourceUsage> getLast30DaysMemoryInfo() {\n return daoInterface.getLast30DaysMemoryInfo();\n\n }",
"List<Long> getServers();",
"public List<Event> getEvents() {\n List<Event> events = new ArrayList<>();\n\n Query query = new Query(\"Event\");\n PreparedQuery results = datastore.prepare(query);\n\n for (Entity entity : results.asIterable()) {\n try {\n String idString = entity.getKey().getName();\n UUID eventId = UUID.fromString(idString);\n String speaker = (String) entity.getProperty(\"speaker\");\n String organization = (String) entity.getProperty(\"organization\");\n String eventDate = (String) entity.getProperty(\"eventDate\");\n Location location = (Location) entity.getProperty(\"location\");\n List<String> amenities = getAmenities(eventId);\n String externalLink = (String) entity.getProperty(\"externalLink\");\n PublicType publicType = (PublicType) entity.getProperty(\"publicType\");\n long ownerId = (long) entity.getProperty(\"ownerId\");\n List<ThreadComment> thread = getThread(eventId);\n // long timeStamp = (long) entity.getProperty(\"timestamp\");\n\n Event event = new Event(eventId, speaker, organization, eventDate, location, amenities, externalLink,\n publicType, ownerId);\n event.copyThread(thread);\n events.add(event);\n // An exception can occur here for multiple reasons (Type casting error, any\n // property not existing, key error, etc...)\n } catch (Exception e) {\n System.err.println(\"Error reading event.\");\n System.err.println(entity.toString());\n e.printStackTrace();\n }\n }\n\n return events;\n }",
"public int[] getIDs(){\r\n\t\tint[] id = new int[Config.MAX_CLIENTS];\r\n\t\tfor(int i=0; i< Config.MAX_CLIENTS;i++){\r\n\t\t\tid[i] = clients[i].getID();\r\n\t\t}\r\n\t\treturn id;\r\n\t}",
"private void getEcoleList(){\r\n\t\tEcoleRequestFactory rf = GWT.create(EcoleRequestFactory.class);\r\n\t\trf.initialize(this.getEventBus(), new EventSourceRequestTransport(this.getEventBus()));\r\n\t\tEcoleRequestContext rc = rf.ecoleRequest();\r\n\t\trc.listAllActive().fire(new Receiver<List<EcoleProxy>>(){\r\n\t\t\t@Override\r\n\t\t\tpublic void onSuccess(List<EcoleProxy> response){\r\n\t\t\t\tgetView().setEcoleAddList(response);\r\n\t\t\t}\r\n\t\t\t@Override\r\n\t\t\tpublic void onFailure(ServerFailure error){\r\n\t\t\t\tWindow.alert(error.getMessage());\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"@objid (\"f29e2e4a-e5e9-43fa-b193-525c198df148\")\n EList<Message> getUsage();",
"public Map<String, List<CalendarEvent>> getEvents(){ return _safeEvents; }",
"private ArrayList<Client> getClientsFaileds3ConsecutiveTimes(Server server){\n ArrayList<Client> clientsFaileds3ConsecutiveTimes = new ArrayList<Client>();\n \n for(Client client:server.getClients()){\n if(client.isClientStateFailed()){\n clientsFaileds3ConsecutiveTimes.add(client);\n }\n }\n return clientsFaileds3ConsecutiveTimes; \n }",
"@Query (\"SELECT c.client, COUNT(c.client) from Reserva AS c group by c.client order by COUNT(c.client)DESC\")\r\n public List<Object[]> countTotalReservationsByClient();",
"public List<LogEvent> getEvents() {\n return publicEvents;\n }",
"public int clientsCount(){\n return clientsList.size();\n }",
"private Map<ServerFile, Integer> totalFiles(){\n\t\tMap<ServerFile, Integer> ret = new HashMap<ServerFile, Integer>();\n\t\tfor (ClientObj c : clients){\n\t\t\tfor (ServerFile f : c.getFiles()){\n\t\t\t\tif (!ret.containsKey(f))\n\t\t\t\t\tret.put(f, 1);\n\t\t\t\telse\n\t\t\t\t\tret.put(f, ret.get(f) + 1);\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}",
"@Override\n\tpublic ArrayList<Map<String, String>> get() {\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyyMMdd\");\n\t\tDate current = new Date();\n\t\tString date = format.format(current);\t\t\t\t\n\t\t// 유효기간이 지난 데이터는 리턴하지 않는다.\n\t\tArrayList<Map<String, String>> list = new ArrayList<Map<String, String>>();\n\t\tString sql = \"SELECT * FROM \" + EventDBHelper.TABLE + \" WHERE \" + ENABLEDATE + \">=\" + date + \" ORDER BY \" + ENABLEDATE + \" ASC\";\n\t\tmCursor = mDB.rawQuery(sql, null);\n\n\t\tif (mCursor.moveToFirst()) {\n\t\t\twhile (!mCursor.isAfterLast()) {\n\t\t\t\tMap<String, String> map = new HashMap<String, String>();\n\t\t\t\tmap.put(ESTID, mCursor.getString(mCursor.getColumnIndex(ESTID)));\n\t\t\t\tmap.put(EVENTID, mCursor.getString(mCursor.getColumnIndex(EVENTID)));\n\t\t\t\tmap.put(ENABLEDATE,\tmCursor.getString(mCursor.getColumnIndex(ENABLEDATE)));\n\t\t\t\tmap.put(DESC, mCursor.getString(mCursor.getColumnIndex(DESC)));\n\t\t\t\tlist.add(map);\n\t\t\t\tmCursor.moveToNext();\n\t\t\t}\n\t\t}\n\n\t\treturn list;\n\t}",
"@Test\r\n public void getEventTicketInstanceList() {\r\n System.out.println(\"getEventTicketInstanceList begin.\");\r\n\r\n // Model ID of event ticket instances you want to get.\r\n String modelId = \"eventTicketModelTest\";\r\n\r\n // Get a list of the event ticket instances.\r\n String urlSegment = \"eventticket/instance\";\r\n List<HwWalletObject> responseInstances = walletBuildService.getInstances(urlSegment, modelId, 5);\r\n System.out.println(\"Event ticket instances list: \" + CommonUtil.toJson(responseInstances));\r\n }",
"Map<String, Long> getVisitIpLogs();",
"public List<Events> getAllSystemEventsListForAll();",
"public ArrayList<Client> clientList() {\n\t\tint counter = 1; // 일딴 보류\n\t\tConnection conn = null;\n\t\tPreparedStatement pstmt = null;\n\t\tResultSet rs = null;\n\t\tString query = \"select * from client\";\n\t\tArrayList<Client> client = new ArrayList<Client>();\n\t\tClient object = null;\n\t\ttry {\n\t\t\tconn = getConnection();\n\t\t\tpstmt = conn.prepareStatement(query);\n\t\t\trs = pstmt.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tobject = new Client();\n\t\t\t\tString cId = rs.getString(\"cId\");\n\t\t\t\tString cPhone = rs.getString(\"cPhone\");\n\t\t\t\tString cName = rs.getString(\"cName\");\n\t\t\t\tint point = rs.getInt(\"cPoint\");\n\t\t\t\tint totalPoint = rs.getInt(\"totalPoint\");\n\n\t\t\t\tobject.setcId(cId);\n\t\t\t\tobject.setcPhone(cPhone);\n\t\t\t\tobject.setcName(cName);\n\t\t\t\tobject.setcPoint(point);\n\t\t\t\tobject.setTotalPoint(totalPoint);\n\n\t\t\t\tclient.add(object);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif (conn != null) {\n\t\t\t\t\tconn.close();\n\t\t\t\t}\n\t\t\t\tif (pstmt != null) {\n\t\t\t\t\tpstmt.close();\n\t\t\t\t}\n\t\t\t\tif (rs != null) {\n\t\t\t\t\trs.close();\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}\n\t\treturn client;\n\t}",
"public Map<String,Long> getOnJobTotalTimes(String accessKey, Set<String> entityIds, long startTime, long endTime) throws org.apache.thrift.TException;",
"public static ArrayList<Client> getClients() {\n return clients;\n }",
"public void getFriendRequests() {\n DocumentReference userDocument = dbref.getUserDocument();\n userDocument.collection(\"PendingFriendRequest\").addSnapshotListener(new EventListener<QuerySnapshot>() {\n @Override\n public void onEvent(@Nullable QuerySnapshot value,\n @Nullable FirebaseFirestoreException e) {\n if (e != null) {\n Log.w(TAG, \"Listen failed.\", e);\n return;\n }\n\n for (QueryDocumentSnapshot doc : value) {\n\n Users user = doc.toObject(Users.class);\n Instructors.add(user);\n }\n printFriendRequestNames();\n }\n });\n }",
"public Map allRatedAndAverage() {\n begin();\n\n return finalRecs;\n }",
"long getUpdateCounts(int index);",
"java.util.List<online_info>\n getInfoList();",
"public static ArrayList<Long> getRecommendation(){\n return new ArrayList<Long>();\n }",
"Map<Long, Integer> getUsersWithPendingMeeting();",
"public Collection<Dealsusagetb> getDusages() {\n Collection<Dealsusagetb> usages = res.readEntity(gDUsages);\n dusages = new ArrayList<>();\n for (Dealsusagetb usage : usages) {\n if(usage.getStatus() == 1) {\n dusages.add(usage);\n }\n }\n return dusages;\n }",
"public int getCount() {\n\t\treturn events.size();\n\t}",
"long getJoinedEventsCount();",
"java.util.List<frame.socket.common.proto.Login.ActAmount> \n getActAmountList();",
"public ArrayList<Event> getEvents(){\n return this.events;\n }",
"public abstract Map<String, Event> getEvents();",
"public static ArrayList<Integer> get4WeekWaterUsage() {\n try {\n Connection connection = DriverManager.getConnection(\"jdbc:postgresql://127.0.0.1:10000/tiana18\", \"tiana18web\", \"TrafalgarLaw18\");\n ResultSet result = connection.createStatement().executeQuery(\"select * from public.fourweekevaluation;\");\n connection.close();\n ArrayList<Integer> list = new ArrayList<Integer>();\n while(result.next()) {\n int val = result.getInt(\"waterusage\");\n list.add(val);\n }\n return list;\n }\n catch(Exception e) {\n return null;\n }\n }",
"public static List<Long> getData_entryDates() {\r\n\t\treturn data_entryDates;\r\n\t}",
"List<ResourceUsage> getLast24HoursMemoryInfo() {\n return daoInterface.getLast24HoursMemoryInfo();\n\n }",
"public Integer[] getClientValues() {\n return clientValues;\n }",
"public void addGETEvent()\r\n\t{\r\n\t\tfor(Event recordedEvent : eventsCount)\r\n\t\t{\r\n\t\t\tif(recordedEvent.getRequestType().equals(RequestMethod.GET))\r\n\t\t\t{\r\n\t\t\t\trecordedEvent.setAccessCount(recordedEvent.getAccessCount() + 1);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static Map<String, Client> getClientMap() {\r\n return clientMap;\r\n }",
"long getOwnedEntryCount();",
"interface ClientMetrics {\n void incrementReadRequest();\n\n void incrementWriteRequest();\n\n String getHostName();\n\n long getReadRequestsCount();\n\n long getWriteRequestsCount();\n\n void incrementFilteredReadRequests();\n\n long getFilteredReadRequests();\n }",
"public abstract Map<IBinder, ClientTransactionItem> getActivitiesToBeDestroyed();",
"public static ArrayList<Long> getPopular(){\n return new ArrayList<Long>();\n }",
"public static ArrayList<Integer> get4WeekPowerUsage() {\n try {\n Connection connection = DriverManager.getConnection(\"jdbc:postgresql://127.0.0.1:10000/tiana18\", \"tiana18web\", \"TrafalgarLaw18\");\n ResultSet result = connection.createStatement().executeQuery(\"select * from public.fourweekevaluation;\");\n connection.close();\n ArrayList<Integer> list = new ArrayList<Integer>();\n while(result.next()) {\n int val = result.getInt(\"powerusage\");\n list.add(val);\n }\n return list;\n }\n catch(Exception e) {\n return null;\n }\n }",
"public Collection<GlobalIdEntry> getAllEntries();",
"private List<String> getDataFromApi() throws IOException {\n // List the next 10 events from the primary calendar.\n DateTime now = new DateTime(System.currentTimeMillis());\n Date nowToday = new Date(System.currentTimeMillis());\n Date now2 = new Date();\n Log.d(\"TIME\", now2.toString()); // Fri Apr 14 11:45:53 GMT-04:00 2017\n String show = DateFormat.getTimeInstance().format(nowToday); // 오후 4:22:40\n String show2 = DateFormat.getDateInstance().format(nowToday); // 2017. 4. 7.\n String show3 = DateFormat.getDateTimeInstance().format(nowToday); // 2017. 4. 7. 오후 4:22:40\n // String show4 = DateFormat.getDateInstance().format(now); 이건 안됌 에러\n\n\n java.text.SimpleDateFormat toDateTime = new java.text.SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ssZ\");\n //Date todayDate = new Date();\n // String todayName = dayName.format(todayDate);\n\n java.util.Calendar calendar = java.util.Calendar.getInstance();\n\n calendar.setTime(nowToday);\n calendar.add(Calendar.HOUR, 2);\n Date twoFromNow = calendar.getTime();\n\n\n\n List<String> eventStrings = new ArrayList<String>();\n Events events = mService.events().list(\"primary\")\n .setMaxResults(10)\n .setTimeMin(now)\n .setTimeMax(new DateTime(twoFromNow, TimeZone.getDefault()))\n .setOrderBy(\"startTime\")\n .setSingleEvents(true)\n .execute();\n\n\n List<Event> items = events.getItems();\n // List<Map<String, String>> pairList = new ArrayList<Map<String, String>>();\n // String nowDay = now.toString().substring(0, now.toString().indexOf(\"T\"));\n\n\n for (Event event : items) {\n DateTime start = event.getStart().getDateTime();\n\n // Only get events with exact start time set, exclude all day\n if (start != null) {\n eventStrings.add(\n String.format(\"%s //// %s)\", event.getSummary(), start));\n }\n\n\n }\n\n return eventStrings;\n }",
"public ArrayList<Integer> getUsedUDays() {\n return pastUDays;\n }",
"public ArrayList<ApplianceTimedEvent> generateRepeatedUsagePeriod(int startTime, int day, int addDays, int span, Time interval){\n\n ArrayList<ApplianceTimedEvent> hours = new ArrayList<ApplianceTimedEvent>();\n \n Time start = new Time(startTime, day);\n Time currentTime = universe.getUniverseTime();\n /*BUG FIX by Darius... The generated time was in the past so we need to make sure\n the new TimedEvent is in the future. I have added this code to adjust it therefore.*/\n if(start.compare(currentTime) < 0){\n\n start = new Time(start.getCurrentHour(), start.getCurrentDay());\n if(start.compare(currentTime) < 0) start = start.advanceTime(new Time(0,0,1,0,0));\n }\n\n //determine end time\n Time end = start.clone();\n\n end = end.advanceTime(new Time(span,0,0,0,0));\n \n //Create timed event to represent usage period\n ApplianceTimedEvent ate = new ApplianceTimedEvent(this,\n start,\n end,\n new ApplianceUseCommand(this),\n interval);\n //add event to list\n hours.add(ate); \n \n // Adds an identical timed event to the Arraylist\n //for every additional day specified.\n //Adds for a maximum of 6 additional days --> 7 days in a week.\n for(int i = 0; i<addDays && i<6; i++){\n //advance start and end times by one day\n start = start.advanceTime(new Time(0,1,0,0,0));\n end = end.advanceTime(new Time(0,1,0,0,0));\n //create identical timed event with start/end times advanced by one day.\n ate = new ApplianceTimedEvent(this,\n start,\n end,\n new ApplianceUseCommand(this),\n interval);\n //add to list\n hours.add(ate); \n }\n\n return hours;\n }",
"@Nonnull\n Map<String, Set<TCSResource<?>>> getAllocations();",
"@Override\n public List<ClientStatisticsRecord> clientRecords(\n String clientKey,\n int page,\n int pageSize) {\n Pageable pageRequest = new PageRequest(page, pageSize);\n return recordRepository.findByClientKey(clientKey, pageRequest).getContent();\n }",
"public List<HotspotClient> getHotspotClientsList() {\n List<HotspotClient> clients = new ArrayList<HotspotClient>();\n synchronized (mHotspotClients) {\n for (HotspotClient client : mHotspotClients.values()) {\n clients.add(new HotspotClient(client));\n }\n }\n return clients;\n }",
"public List<Map<String, Object>> ListStatistics(Timestamp start, Timestamp end) {\n\t\treturn statisticsMapper.ListStatistics(start,end);\n\t}",
"public ArrayList<Event> getEventsForUser(String uid) {\r\n // Gets the events collection and creates a query string for host ID\r\n MongoCollection<Document> events = mongoDB.getCollection(\"Events\");\r\n Document query = new Document(\"hostID\", new ObjectId(uid));\r\n ArrayList<Event> list = new ArrayList<>();\r\n for (Event e : events.find(query, Event.class)) {\r\n list.add(e);\r\n }\r\n return list;\r\n }",
"@WebMethod public List<Event> getAllEvents();",
"public ArrayList<Client> getClientList() {\n return this.clientList;\n }",
"public static ArrayList<HashMap<String, String>> getUnseenMessagesFromAppliance() {\r\n\t\tPrettyTime p = new PrettyTime();\r\n\t\tArrayList<HashMap<String, String>> list = new ArrayList<>();\r\n\r\n\t\ttry (Connection connection = Connect.getConnection();) {\r\n\t\t\t// Begin Stored Procedure -- Jeevan\r\n\t\t\tCallableStatement prepareCall = connection\r\n\t\t\t\t\t.prepareCall(\"{CALL get_unseen_status_messages_from_appliance()}\");\r\n\t\t\tResultSet result = prepareCall.executeQuery();\r\n\t\t\t// End Stored Procedure\r\n\t\t\twhile (result.next()) {\r\n\t\t\t\tHashMap<String, String> map = new HashMap<>();\r\n\t\t\t\tmap.put(\"messageId\", String.valueOf(result.getInt(\"alarm_id\")));\r\n\t\t\t\tmap.put(\"messageFrom\", result.getString(\"appliance_GSMno\"));\r\n\t\t\t\tTimestamp dateTime = result.getTimestamp(\"alarm_time\");\r\n\t\t\t\tDate date = new Date(dateTime.getTime());\r\n\t\t\t\t// System.out.println(p.format((date)));\r\n\t\t\t\tmap.put(\"messageDate\", p.format((date)));\r\n\t\t\t\tmap.put(\"applianceId\", result.getString(\"appliance_id\"));\r\n\t\t\t\tlist.add(map);\r\n\t\t\t}\r\n\t\t\tresult.close();\r\n\t\t\tprepareCall.close();\r\n\t\t\tconnection.close();\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlogger.error(\"\", e);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn list;\r\n\r\n\t}"
] | [
"0.5637176",
"0.5486621",
"0.54747695",
"0.5254279",
"0.5244751",
"0.5153446",
"0.5135016",
"0.5122536",
"0.50785935",
"0.50017214",
"0.49928045",
"0.495837",
"0.49513057",
"0.49412426",
"0.49048412",
"0.4904499",
"0.49025327",
"0.488479",
"0.48808566",
"0.48794797",
"0.487673",
"0.48510933",
"0.48273188",
"0.48257068",
"0.48224464",
"0.4813145",
"0.4809289",
"0.47934124",
"0.4777847",
"0.477756",
"0.47769243",
"0.47726947",
"0.47449628",
"0.47397205",
"0.47158587",
"0.47154248",
"0.47040427",
"0.47020748",
"0.46998847",
"0.46961305",
"0.46935442",
"0.46858835",
"0.46830362",
"0.4681668",
"0.4678453",
"0.46703792",
"0.46668142",
"0.4664413",
"0.4659018",
"0.46410835",
"0.4626367",
"0.46259695",
"0.46245128",
"0.46170405",
"0.46133107",
"0.46127835",
"0.46087217",
"0.46061486",
"0.4605493",
"0.4603494",
"0.4601674",
"0.46010172",
"0.4594598",
"0.45887384",
"0.4581405",
"0.45766267",
"0.4575666",
"0.45754358",
"0.457325",
"0.45690107",
"0.45678154",
"0.4558029",
"0.45569625",
"0.4552646",
"0.4552041",
"0.45487618",
"0.45464966",
"0.45461327",
"0.4542946",
"0.4541984",
"0.45363832",
"0.45335597",
"0.4531696",
"0.45312086",
"0.4524123",
"0.45234686",
"0.45224229",
"0.4520525",
"0.45157447",
"0.45091388",
"0.45062056",
"0.45055288",
"0.4504543",
"0.4503714",
"0.4503452",
"0.4499754",
"0.4495408",
"0.44901392",
"0.44860607",
"0.44784704"
] | 0.64366996 | 0 |
Concatenates two column Arrays. | private ArrayList<String> concatColumns(ArrayList<String>... columns) {
if (columns.length < 1) {
return null;
} else if (columns.length < 2) {
return columns[0];
} else {
ArrayList<String> concatenated = new ArrayList<String>();
for (ArrayList<String> column : columns) {
for (String col : column) {
concatenated.add(col);
}
}
return concatenated;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Cell[] concatArray(Cell[] arr1, Cell[] arr2) {\r\n\t\tCell[] concat = new Cell[arr1.length + arr2.length];\r\n\t\tfor (int k = 0; k < concat.length; k++) {\r\n\t\t\tif (k < arr1.length) {\r\n\t\t\t\tconcat[k] = arr1[k];\r\n\t\t\t} else {\r\n\t\t\t\tconcat[k] = arr2[k - arr1.length];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn concat;\r\n\t}",
"private Position[] concatArrays(Position[] first, Position[] second)\r\n {\r\n int size = first.length + second.length;\r\n Position[] a = new Position[size];\r\n int pt = 0;\r\n\r\n for (Position tmpPos : first)\r\n {\r\n a[pt] = tmpPos;\r\n pt++;\r\n }\r\n\r\n for (Position tmpPos : second)\r\n {\r\n a[pt] = tmpPos;\r\n pt++;\r\n }\r\n\r\n return a;\r\n }",
"Integer[] concatArrays(Integer[] array1, Integer[] array2);",
"public String[] concatArrays(String[] input1, String[] input2){\n String[] result = new String[input1.length + input2.length];\n System.arraycopy(input1, 0, result, 0, input1.length);\n System.arraycopy(input2, 0, result, input1.length, result.length - input1.length);\n return result;\n }",
"private String[] combine(String array1[], String array2[]) {\n\t\tint length = array1.length + array2.length;\r\n\t\tString result[] = new String[length];\r\n\t\tSystem.arraycopy(array1, 0, result, 0, array1.length);\r\n\t\tSystem.arraycopy(array2, 0, result, array1.length, array2.length);\r\n\t\treturn result;\r\n\t}",
"public static String[] concatenateArray(String[] a, String[] b) {\n String[] r = new String[a.length + b.length];\n\n for (int i = 0; i < a.length; i++) {\n r[i] = a[i];\n }\n\n for (int i = 0; i < b.length; i++) {\n r[a.length + i] = b[i];\n }\n\n return r;\n }",
"public static Object[] arrayConcatenate(Object[] input, Object[] a1, Object[] a2) {\r\n\t\tint i = 0;\r\n\t\tfor(int j = 0; j < a1.length; j++) {\r\n\t\t\tinput[i] = a1[j];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tfor(int j = 0; j < a2.length; j++) {\r\n\t\t\tinput[i] = a2[j];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn input;\r\n\t}",
"public static <T> T[] concat(T[] first, T[] second) {\r\n\t\tT[] result = Arrays.copyOf(first, first.length + second.length);\r\n\t\tSystem.arraycopy(second, 0, result, first.length, second.length);\r\n\t\treturn result;\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n public static <T> T[] concat(T[] left, T[] right) {\n T[] res;\n\n if (ArrayUtils.isEmpty(left)) {\n res = right;\n } else if (ArrayUtils.isEmpty(right)) {\n res = left;\n } else {\n res = (T[]) Array.newInstance(left[0].getClass(), left.length + right.length);\n System.arraycopy(left, 0, res, 0, left.length);\n System.arraycopy(right, 0, res, left.length, right.length);\n }\n\n return res;\n }",
"private static byte[] concatenateByteArrays(byte[] first, byte[] second) {\n int firstLength = first.length;\n int secondLength = second.length;\n\n byte[] ret = new byte[first.length + second.length];\n System.arraycopy(first, 0, ret, 0, first.length);\n System.arraycopy(second, 0, ret, first.length, second.length);\n\n return ret;\n }",
"public static JSONArray concatArrays(JSONArray first, JSONArray second) {\n JSONArray concatenatedArray = new JSONArray();\n if (first == null && second == null) {\n return concatenatedArray;\n } else {\n if (first == null) return second;\n if (second == null) return first;\n\n first.forEach(concatenatedArray::put);\n second.forEach(concatenatedArray::put);\n return concatenatedArray;\n }\n }",
"public static byte[] concat(byte[] a, byte[] b) {\n\n if (b == null) {\n return a;\n }\n\n int aLen = a.length;\n int bLen = b.length;\n byte[] c = new byte[aLen + bLen];\n System.arraycopy(a, 0, c, 0, aLen);\n System.arraycopy(b, 0, c, aLen, bLen);\n return c;\n }",
"public static byte[] concat(final byte[] bytes1, final byte[] bytes2) {\n\t\tfinal byte[] result = new byte[bytes1.length + bytes2.length];\n\t\tSystem.arraycopy(bytes1, 0, result, 0, bytes1.length);\n\t\tSystem.arraycopy(bytes2, 0, result, bytes1.length, bytes2.length);\n\t\treturn result;\n\t}",
"private byte[] concateByteArray(byte[] firstarray, byte[] secondarray){\r\n\tbyte[] output = new byte[firstarray.length + secondarray.length];\r\n\tint i=0;\r\n\tfor(i=0;i<firstarray.length;i++){\r\n\t output[i] = firstarray[i];\r\n\t}\r\n\tint index=i;\r\n\tfor(i=0;i<secondarray.length;i++){\r\n\t output[index] = secondarray[i];\r\n\t index++;\r\n\t}\r\n\treturn output;\r\n}",
"public static JSONArray concatJSONArrayWithAmmendment(JSONArray Array1, JSONArray Array2, String taxclasstype) throws JSONException {\n for (int i = 0; i < Array2.length(); i++) {\n if (Array2.optJSONObject(i) != null) {\n Array1.put(Array2.optJSONObject(i).put(\"taxclasstype\", taxclasstype));\n }\n }\n return Array1;\n }",
"private static byte[] concat(byte[]... arrays) {\n int length = 0;\n for (byte[] array : arrays) {\n length += array.length;\n }\n final byte[] res = new byte[length];\n int pos = 0;\n for (byte[] array : arrays) {\n System.arraycopy(array, 0, res, pos, array.length);\n pos += array.length;\n }\n return res;\n }",
"void doMerge() {\n int[] temp = new int[arr.length + brr.length];\n int count = 0;\n for (int i = 0; i < arr.length; i++) {\n temp[i] = arr[i];\n count++;\n }\n for (int i = 0; i < brr.length; i++) {\n temp[count++] = brr[i];\n }\n for (int i = 0; i < temp.length; i++) {\n System.out.println( temp[i] );\n }\n String a[] = {\"A\", \"E\", \"I\"};\n String b[] = {\"O\", \"U\"};\n List<String> list = new ArrayList( Arrays.asList( a ) );\n list.addAll( Arrays.asList( b ) );\n Object[] c = list.toArray();\n System.out.println( Arrays.toString( c ) );\n }",
"public void joinTwoArrayList(ArrayList<E> array1 , ArrayList<E> array2){\n\t\tint length2 = array2.size();\n\t\tfor(int i=0 ; i<length2 ; i++){\n\t\t\tarray1.add(array2.getElement(i));\n\t\t}\n\t}",
"@SuppressWarnings(\"unchecked\")\n\tpublic static String[] union(String[] t1, String[] t2) {\n \tSet<String> set = new HashSet<String>();\n \tfor(String t : t1) set.add(t);\n \tfor(String t : t2) set.add(t);\n \treturn set.toArray(new String[]{});\n }",
"public static double [] combineArray(double []num1, double []num2){\n\t\t\n\t\t double []sum=new double[num1.length + num2.length];\n\n\t\t for (int i=0; i<num1.length; i++){\n\t\t sum[i]+=num1[i];\n\t\t }\n\t\t for (int i=0; i<num2.length; i++){\n\t\t \tsum[i+num1.length]+=num2[i];\n\t\t }\n\t\t\treturn sum;\n\t}",
"public static String[] merge(String[] arr1, String[] arr2) {\n StringList list = new StringList(arr1);\n list.merge(arr2);\n return list.toArray();\n }",
"static String unionOfBothArrays(final int[] arr1, final int[] arr2) {\n\t\tString res = \"\";\n\t\tfor (int i = 0; i < arr1.length; i++) {\n\t\t\tres += arr1[i] + \" \";\n\t\t}\n\t\tres += intersectionOfBothArrays(arr1, arr2);\n\t\treturn res.trim();\n\t}",
"Nda<V> concatAt( int axis, Nda<V> other, Nda<V>... ndArrays );",
"public static Term[] combineTwoTermArrays(Term[] first, Term[] second) {\n\t\tTerm[] newRA;\n\t\tif(first==null) {\n\t\t\tnewRA= new Term[second.length];\n\t\t}else {\n\t\t\tnewRA= new Term[first.length+second.length];\n\t\t\tint k = 0;\n\t\t\tfor (int i = 0; i < first.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tnewRA[k] = new Term(first[i].dispTerm().toCharArray());\n\t\t\t\t\tk++;\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = 0; i < second.length; i++) {\n\t\t\t\tnewRA[k] = new Term(second[i].dispTerm().toCharArray());\n\t\t\t\tk++;\n\t\t\t} \n\t\t}\n\t\treturn newRA;\n\t}",
"public static int[] combine(int[] a, int[] b){\n if(a.length == 0 && b.length == 0)\n return new int[0];\n else if(a.length == 0)\n return b;\n else if(b.length == 0)\n return a;\n else {\n int[] combinedArray = new int[a.length + b.length];\n System.arraycopy(a, 0, combinedArray, 0, a.length);\n System.arraycopy(b, 0, combinedArray, a.length, b.length);\n\n return combinedArray;\n }\n }",
"Nda<V> concatAt( int axis, Nda<V> other );",
"private static void merge(int[] array, int[] left, int[] right) {\n\n int i;\n\n for(i = 0; i < left.length; i++) {\n\n array[i] = left[i];\n }\n\n for (int j = 0; j < right.length; j++, i++) {\n\n array[i] = right[j];\n }\n }",
"public T concatColumns( SimpleBase... matrices ) {\n convertType.specify0(this, matrices);\n T A = convertType.convert(this);\n\n int numCols = A.numCols();\n int numRows = A.numRows();\n for (int i = 0; i < matrices.length; i++) {\n numRows = Math.max(numRows, matrices[i].numRows());\n numCols += matrices[i].numCols();\n }\n\n SimpleMatrix combined = SimpleMatrix.wrap(convertType.commonType.create(numRows, numCols));\n\n A.ops.extract(A.mat, 0, A.numRows(), 0, A.numCols(), combined.mat, 0, 0);\n int col = A.numCols();\n for (int i = 0; i < matrices.length; i++) {\n Matrix m = convertType.convert(matrices[i]).mat;\n int cols = m.getNumCols();\n int rows = m.getNumRows();\n A.ops.extract(m, 0, rows, 0, cols, combined.mat, 0, col);\n col += cols;\n }\n\n return (T)combined;\n }",
"private double[] merge(double[]... arrays) {\n int count = 0;\n for (double[] array : arrays) {\n count += array.length;\n }\n // Create new array and copy all array contents\n double[] mergedArray = new double[count];\n int start = 0;\n for (double[] array: arrays)\n {\n System.arraycopy(array, 0, mergedArray, start, array.length);\n start += array.length;\n }\n return mergedArray;\n }",
"public static <T> String concatMatrix(String glueLines, String glueColumns, T[][] array) {\n\t\treturn concatMatrix(glueLines,glueColumns,array,o->o.toString());\n\t}",
"public static byte[] byteAppend(byte[] buf1, byte[] buf2) {\n byte[] ret = new byte[buf1.length + buf2.length];\n System.arraycopy(buf1, 0, ret, 0, buf1.length);\n System.arraycopy(buf2, 0, ret, buf1.length, buf2.length);\n return ret;\n }",
"public static <T> String concatMatrix(String glueLines, String glueColumns, int[][] array) {\n\t\tif (array.length==0) return \"\";\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor (int i=0; i<array.length; i++) {\n\t\t\tif (i>0)sb.append(glueLines);\n\t\t\tfor (int j=0; j<array[i].length; j++) {\n\t\t\t\tif (j>0) sb.append(glueColumns);\n\t\t\t\tsb.append(array[i][j]);\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public void concat(Matrix matrix) {\n\t\t\n\t}",
"public static <T> String concatMatrix(String glueLines, String glueColumns, double[][] array) {\n\t\tif (array.length==0) return \"\";\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor (int i=0; i<array.length; i++) {\n\t\t\tif (i>0)sb.append(glueLines);\n\t\t\tfor (int j=0; j<array[i].length; j++) {\n\t\t\t\tif (j>0) sb.append(glueColumns);\n\t\t\t\tsb.append(array[i][j]);\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}",
"private String[] merge(String[] left, String[] right) {\n\t\tString[] result = new String[left.length + right.length];\n\t\t\n\t\tint leftIndex = 0;\n\t\tint rightIndex = 0;\n\t\tint resultIndex = 0;\n\t\t\n\t\t/*\n\t\t * Add current string from the left array if it is alphabetically before\n\t\t * the current string from the right array, or the other way around.\n\t\t */\n\t\twhile(leftIndex < left.length && rightIndex < right.length) {\n\t\t\t\n\t\t\tif(left[leftIndex].compareTo(right[rightIndex]) <= 0) {\n\t\t\t\tresult[resultIndex++] = left[leftIndex++];\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tresult[resultIndex++] = right[rightIndex++];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * Add anything that is left.\n\t\t */\n\t\tfor(int k = leftIndex; k < left.length; k++) {\n\t\t\tresult[resultIndex++] = left[k];\n\t\t}\n\t\t\n\t\tfor(int k = rightIndex; k < right.length; k++) {\n\t\t\tresult[resultIndex++] = right[k];\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"public int[] merge(int[] oneArr, int[] twoArr) {\n int lenOneArr = oneArr.length , lenTwoArr = twoArr.length ; // Длинна 1-го и 2-го массива\n int[] threeArr = new int[lenOneArr + lenTwoArr];\n int i = 0, j = 0;\n while (i < lenOneArr && j < lenTwoArr) {\n if (oneArr[i] < twoArr[j]) {\n threeArr[i + j] = oneArr[i];\n i++;\n } else {\n threeArr[i + j] = twoArr[j];\n j++;\n }\n }\n while (i < lenOneArr) { // Если достигнут конец одного из массива цикл дописывает оставшуюся часть доконца.\n threeArr[i + j] = oneArr[i];\n i++;\n }\n while (j < lenTwoArr) {\n threeArr[i + j] = twoArr[j];\n j++;\n }\n return threeArr;\n }",
"private static void mergeSortedArrays(int[] arr1, int[] arr2, int length1, int length2) {\n\t\tint j = 0;\n\t\tStringBuilder sb = new StringBuilder();\n\t\tif (length1 > length2) {\n\t\t\tfor (int i = length1 - length2; i < length1; i++) {\n\t\t\t\tarr1[i] = arr2[j++];\n\t\t\t}\n\t\t\tArrays.sort(arr1);\n\t\t\tfor (int i = 0; i < arr1.length; i++) {\n\t\t\t\tsb.append(arr1[i] + \" \");\n\t\t\t}\n\t\t} else {\n\t\t\tfor (int i = length2 - length1; i < length2; i++) {\n\t\t\t\tarr2[i] = arr1[j++];\n\t\t\t}\n\t\t\tArrays.sort(arr2);\n\t\t\tfor (int i = 0; i < arr2.length; i++) {\n\t\t\t\tsb.append(arr2[i] + \" \");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sb.toString());\n\t}",
"int[] concat(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n st[0] = s1;\r\n\t\tst[1] = t2;\r\n\t\t\r\n\t\taddEdge(t1, epssymbol, s2);\r\n\t\t\r\n\t\treturn st;\r\n\t}",
"@SafeVarargs\n public static <T> Array<T> concat(Array<? extends T> ...arrays)\n {\n Array<T> out = new Array<>();\n\n for (Array<? extends T> array: arrays)\n out.addAll(array);\n\n return out;\n }",
"public static <T> String concatMatrix(String glueLines, String glueColumns, float[][] array) {\n\t\tif (array.length==0) return \"\";\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor (int i=0; i<array.length; i++) {\n\t\t\tif (i>0)sb.append(glueLines);\n\t\t\tfor (int j=0; j<array[i].length; j++) {\n\t\t\t\tif (j>0) sb.append(glueColumns);\n\t\t\t\tsb.append(array[i][j]);\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}",
"@SafeVarargs\n static <R,C> DataFrame<R,C> concatColumns(DataFrame<R,C>... frames) {\n return DataFrame.factory().concatColumns(Arrays.asList(frames).iterator());\n }",
"public static void main(String[] args) {\n\t\tint []arr1= {12,13,44};\r\n\t\tint []arr2= {44,45,47,50};\r\n\t\tint i,j;\r\n\t\tint count=0;\r\n\t\t\r\n\t\tint []merge=new int[arr1.length+arr2.length];\r\n\t\tfor(i=0;i<arr1.length;i++)\r\n\t\t{\r\n\t\t\tmerge[i]=arr1[i];\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\t\tfor(i=0;i<arr2.length;i++)\r\n\t\t\t{\r\n\t\t\t\tmerge[count++]=arr2[i];\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tfor(i=0;i<merge.length;i++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\" \" +merge[i]);\r\n\t\t\t}\r\n\t\t\r\n\r\n\t}",
"private Register[] createJoinResult(Register[] left, Register[] right) {\n Register[] result = new Register[left.length + right.length - 1]; // -1 because of joining key\n\n int pos = 0;\n for (int i = 0; i < left.length; i++) {\n result[pos++] = left[i];\n }\n\n for (int i = 0; i < right.length; i++) {\n if (i != rightJoinAttributeIndex) {\n result[pos++] = right[i];\n }\n }\n\n return result;\n }",
"private static int[] merge( int[] a, int[] b )\n {\n int[] retList = new int[a.length + b.length];\n\t int aPos = 0, bPos = 0;\n\t for(int x = 0; x < retList.length; x ++) {\n\t\t if(aPos < a.length && bPos < b.length) {\n\t\t\t if(a[aPos] < b[bPos]) {\n\t\t\t\t retList[x] = a[aPos];\n\t\t\t\t aPos ++;\n\t\t\t }\n\t\t\t else {\n\t\t\t\t retList[x] = b[bPos];\n\t\t\t\t bPos ++;\n\t\t\t }\n\t\t }\n\t\t else if(aPos < a.length) {\n\t\t\t retList[x] = a[aPos];\n\t\t\t aPos ++;\n\t\t }\n\t\t else {\n\t\t\t retList[x] = b[bPos];\n\t\t\t bPos ++;\n\t\t }\n\t }\n return retList;\n }",
"@Override\n\tpublic void merge(MutableAggregationBuffer buffer1, Row buffer2) {\n\t\tif (buffer1.getString(0) == null) {\n\t\t\tbuffer1.update(0, buffer2.getString(0));\n\t\t} else\n\t\t\tbuffer1.update(0, buffer1.getString(0) + \",\" + buffer2.getString(0));\n\n\t\tbuffer1.update(1, buffer1.getLong(1) + buffer2.getLong(1));\n\t\tbuffer1.update(2, buffer1.getLong(2) + buffer2.getLong(2));\n\n\t}",
"public JSONArray concatArray(final JSONArray... arguments) throws JSONException {\n final JSONArray result = new JSONArray();\n for (final JSONArray arr : arguments) {\n for (int i = 0; i < arr.length(); i++) {\n result.put(arr.get(i));\n }\n }\n return result;\n }",
"public static Comparable[] merge( Comparable[] leftPart, Comparable[] rightPart ) {\n\n int cursorLeft = 0, cursorRight = 0, counter = 0;\n\n Comparable[] merged = new Comparable[leftPart.length + rightPart.length];\n\n\n\n while ( cursorLeft < leftPart.length && cursorRight < rightPart.length ) {\n\n\n if ( leftPart[cursorLeft].compareTo(rightPart[cursorRight])<0) {\n\n merged[counter] = leftPart[cursorLeft];\n\n cursorLeft++;\n\n } else {\n\n merged[counter] = rightPart[cursorRight];\n\n cursorRight++;\n\n }\n\n\n\n counter++;\n\n }\n\n\n\n if ( cursorLeft < leftPart.length ) {\n\n System.arraycopy( leftPart, cursorLeft, merged, counter, merged.length - counter );\n\n }\n\n if ( cursorRight < rightPart.length ) {\n\n System.arraycopy( rightPart, cursorRight, merged, counter, merged.length - counter );\n\n }\n\n\n\n return merged;\n\n }",
"public static byte[] mergeByteArrays(byte[] a,byte[] b){\r\n\t\treturn mergeByteArrays(a, b, new byte[0], new byte[0], new byte[0], new byte[0], new byte[0]);\r\n\t}",
"public static <T> String concatMatrix(String glueLines, String glueColumns, T[][] array, Function<T,String> transformer) {\n\t\tif (array.length==0) return \"\";\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor (int i=0; i<array.length; i++) {\n\t\t\tif (i>0)sb.append(glueLines);\n\t\t\tfor (int j=0; j<array[i].length; j++) {\n\t\t\t\tif (j>0) sb.append(glueColumns);\n\t\t\t\tsb.append(transformer.apply(array[i][j]));\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}",
"private static void merge(int[] num1, int[] num2) {\n\t\tint len = num1.length + num2.length;\n\n\t\tint[] temp = new int[len];\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint count = 0;\n\t\twhile (i < num1.length && j < num2.length) {\n\t\t\tif (num1[i] < num2[j]) {\n\t\t\t\ttemp[count++] = num1[i++];\n\t\t\t \n\t\t\t} else {\n\t\t\t\ttemp[count++] = num2[j++];\n\t\t\t \n\t\t\t}\n\t\t}\n\n\t\twhile (i < num1.length) {\n\t\t\ttemp[count++] = num1[i++];\n\t\t}\n\t\twhile (j < num2.length) {\n\t\t\ttemp[count++] = num2[j++];\n\t\t}\n\t\tfor (int ind = 0; ind < temp.length; ind++) {\n\t\t\tSystem.out.print(temp[ind] + \" \");\n\t\t}\n\t}",
"public static void mergeArrays(int[] arrayA, int[] arrayB, int a,\n int b, int[] arrayC)\n {\n int i = 0, j = 0, k = 0;\n \n // Traverse both array\n while (i<a && j <b)\n {\n \n if (arrayA[i] < arrayB[j])\n \tarrayC[k++] = arrayA[i++];\n else\n \tarrayC[k++] = arrayB[j++];\n }\n \n // Store remaining elements of first array\n while (i < a)\n \tarrayC[k++] = arrayA[i++];\n \n // Store remaining elements of second array\n while (j < b)\n \tarrayC[k++] = arrayB[j++];\n }",
"public synchronized static byte[] Append ( byte[] packetA, byte[] packetB )\n {\n // Create a new array whose size is equal to sum of packets\n // being added\n byte packetAB [] = new byte [ packetA.length + packetB.length ];\n\n // First paste in packetA\n for ( int i=0; i < packetA.length; i++ )\n packetAB [i] = packetA [i];\n\n // Now start pasting packetB\n for ( int i=0; i < packetB.length; i++ )\n packetAB [i+packetA.length] = packetB [i];\n\n return packetAB;\n }",
"private static int[] merge( int[] a, int[] b ) \n { \n\tint[] retArr = new int[a.length + b.length];\n\tint aCounter = 0;\n\tint bCounter = 0;\n\tint index = 0;\n while (aCounter < a.length && bCounter < b.length){\n\t if (a[aCounter] < b[bCounter]){\n\t\tretArr[index] = a[aCounter];\n\t\tindex++;\n\t\taCounter++;\n\t }\n\t else {\n\t\tretArr[index] = b[bCounter];\n\t\tindex++;\n\t\tbCounter++;\n\t }\n\t}\n\tif (aCounter < a.length){\n\t for (int x = aCounter; x < a.length; x++){\n\t\tretArr[index] = a[x];\n\t\tindex++;\n\t }\n\t}\n\telse if (bCounter < b.length){\n\t for (int x = bCounter; x < b.length; x++){\n\t\tretArr[index] = b[x];\n\t\tindex++;\n\t }\n\t}\n\tprintArray(retArr);\n\tSystem.out.println();\n\treturn retArr;\n }",
"public static byte[] byteAppend(byte[] buf1, byte[] buf2, int len) {\n if (len > buf2.length)\n len = buf2.length;\n byte[] ret = new byte[buf1.length + len];\n System.arraycopy(buf1, 0, ret, 0, buf1.length);\n System.arraycopy(buf2, 0, ret, buf1.length, len);\n return ret;\n }",
"static int[] merge(int[] a, int[] b) {\n\t\tint m = a.length, n = b.length;\n\t\tint[] res = new int[m + n];\n\t\tint i = 0, j = 0, k = 0;\n\t\twhile (i < m || j < n) {\n\t\t\tif (i == m)\n\t\t\t\tres[k++] = b[j++];\n\t\t\telse if (j == n)\n\t\t\t\tres[k++] = a[i++];\n\t\t\telse if (a[i] < b[j])\n\t\t\t\tres[k++] = a[i++];\n\t\t\telse\n\t\t\t\tres[k++] = b[j++];\n\t\t}\n\t\treturn res;\n\t}",
"private static int[] merge( int[] a, int[] b ) \n {\n\tint[] c = new int[a.length+b.length];\n\n\tint x=0;\n\tint y=0;\n\tint z=0;\n\n\twhile (x < a.length || y < b.length){\n\t if (x>=a.length) {\n\t\tc[z]=b[y];\n\t\ty++;\n\t }\n\t else if (y>=b.length) {\n\t\tc[z]=a[x];\n\t\tx++;\n\t }\n\n\t else if (a[x] >= b[y]) {\n\t\tc[z] = b[y];\n\t\ty++;\t\t\n\t }\n\t else if (a[x] < b[y]) {\n\t\tc[z] = a[x];\n\t\tx++;\t\t\n\t }\n\t z++;\n\t}\n\treturn c;\n\n }",
"public static <T> T[] concat(T[] first, T[]... rest) {\n\n\t\t//Read rest\n\t\tint totalLength = first.length;\n\t\tfor (T[] array : rest) {\n\t\t\ttotalLength += array.length;\n\t\t}\n\n\t\t//Concat with arraycopy\n\t\tT[] result = Arrays.copyOf(first, totalLength);\n\t\tint offset = first.length;\n\t\tfor (T[] array : rest) {\n\t\t\tSystem.arraycopy(array, 0, result, offset, array.length);\n\t\t\toffset += array.length;\n\t\t}\n\t\treturn result;\n\n\t}",
"public static String[] merge(String[] arr1, String[] arr2, String arr3[]) {\n StringList list = new StringList(arr1);\n list.merge(arr2);\n list.merge(arr3);\n return list.toArray();\n }",
"public static <T> T[] concatAll(T[] first, T[]... rest) {\n\t\t int totalLength = first.length;\n\t\t for (T[] array : rest) {\n\t\t totalLength += array.length;\n\t\t }\n\t\t T[] result = Arrays.copyOf(first, totalLength);\n\t\t int offset = first.length;\n\t\t for (T[] array : rest) {\n\t\t System.arraycopy(array, 0, result, offset, array.length);\n\t\t offset += array.length;\n\t\t }\n\t\t return result;\n\t\t}",
"private static int[] mergeSortedArrays(int[] arr1, int[] arr2) {\n if (arr1 == null\n || arr2 == null\n || arr1.length == 0\n || arr2.length == 0) {\n return new int[]{-1};\n }\n\n int[] mergedArr = new int[arr1.length + arr2.length];\n int lengthOfArrOne = arr1.length;\n int lengthOfArrTwo = arr2.length;\n int indexForFirstArr = 0;\n int indexForSecondArr = 0;\n int indexForMergedArr = 0;\n while (indexForFirstArr < lengthOfArrOne\n && indexForSecondArr < lengthOfArrTwo) {\n if (arr1[indexForFirstArr] < arr2[indexForSecondArr]) {\n mergedArr[indexForMergedArr++] = arr1[indexForFirstArr++];\n } else {\n mergedArr[indexForMergedArr++] = arr2[indexForSecondArr++];\n }\n\n //increase index counter\n //indexForFirstArr++;\n //indexForSecondArr++;\n }\n\n //append the remaining array\n if(indexForFirstArr == lengthOfArrOne\n && indexForSecondArr < lengthOfArrTwo){\n for(int index = indexForSecondArr; indexForSecondArr<lengthOfArrTwo; indexForSecondArr++){\n mergedArr[indexForMergedArr++] = arr2[index];\n }\n }else if(indexForFirstArr < lengthOfArrOne\n && indexForSecondArr == lengthOfArrTwo){\n for(int index = indexForFirstArr; indexForFirstArr<lengthOfArrOne; indexForFirstArr++){\n mergedArr[indexForMergedArr++] = arr1[index];\n }\n }\n\n //decrease the extra space in the last index\n --indexForMergedArr;\n\n return mergedArr;\n }",
"public void copy(double a[], double b[]) {\n System.arraycopy(b, 0, a, 0, dimension);\n }",
"public static byte[] concatBytes(byte[] ...bytes) throws IOException\n {\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n for(byte[] b : bytes){\n output.write(b);\n }\n return output.toByteArray();\n \n }",
"private static int[] merge( int[] a, int[] b )\n {\n int[] ans = new int[(a.length + b.length)]; //create new array with the combined lengths\n int a1 = 0; //counter for a's position\n int b1 = 0; //counter for b's position\n while (a1 < a.length || b1 < b.length) { //iterates while either counter is not at the end of each array\n\t if (a1 == a.length) { //if you finished with all of a add the remaining b elements\n\t ans[a1 + b1] = b[b1]; \n\t b1 += 1;\n\t }\n\t else if (b1 == b.length) { //if you finished with all of b add the remaining a elements\n\t ans[a1 + b1] = a[a1];\n\t a1 += 1;\n\t }\n\t else if (a[a1] > b[b1]) { //if the current element at position a1 is larger than the one at b1, add the lower b1 to the new array and move to next b position\n\t ans[a1 + b1] = b[b1];\n\t b1 += 1;\n\t }\n\t else {\n\t ans[a1 + b1] = a[a1]; //otherwise add the element at a1 and move to next a position \n\t a1 += 1;\n\t }\n }\n return ans; //return the sorted merged array\t \t \n }",
"public static byte[] concatByteArrays(byte[] first, byte[]... rest) {\r\n int totalLength = first.length;\r\n for (byte[] array : rest) {\r\n totalLength += array.length;\r\n }\r\n byte[] result = Arrays.copyOf(first, totalLength);\r\n int offset = first.length;\r\n for (byte[] array : rest) {\r\n System.arraycopy(array, 0, result, offset, array.length);\r\n offset += array.length;\r\n }\r\n return result;\r\n }",
"public ByteArray combineWith(final byte[] bytesToAppend)\n\t{\n\t\t// holds the byte array to return\n\t\tbyte[] byteReturn = new byte[bytes.length + bytesToAppend.length];\n\t\t\n\t\t// copy the first array\n\t\tfor (int i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\tbyteReturn[i] = bytes[i];\n\t\t}\n\t\t\n\t\t// append the second array\n\t\tfor (int i = 0; i < bytesToAppend.length; i++)\n\t\t{\n\t\t\tbyteReturn[i + bytes.length] = bytesToAppend[i];\n\t\t}\n\t\t\n\t\t// return the new combined array\n\t\treturn new ByteArray(byteReturn);\n\t}",
"private static int[] union(int[] items1, int[] items2) {\n\t\tSet<Integer> itemSet = new HashSet<Integer>();\n\t\tfor(int i : items1) {\n\t\t\titemSet.add(i);\n\t\t}\n\t\tfor(int i : items2){\n\t\t\titemSet.add(i);\n\t\t}\n\t\tint[] items = new int[itemSet.size()];\n\t\tint i = 0;\n\t\tfor(int val : itemSet){\n\t\t\titems[i++] = val; \n\t\t}\n\t\treturn items;\n\t}",
"Concat createConcat();",
"public static int[] interleave_arrays(int[] array1, int[] array2) {\n\t\t// {0, 1, 2, 3}, {4, 5, 6, 7} -> {0, 4, 1, 5, 2, 6, 3, 7}\n\t\tint combined_length = array1.length + array2.length;\n\t\tint[] result = new int[combined_length];\n\n\t\tfor (int i = 0; i < result.length / 2; i++) {\n\t\t\tresult[2 * i] = array1[i];\n\t\t\tresult[2 * i + 1] = array2[i];\n\t\t}\n\t\treturn result;\n\t}",
"public static int[] mergeTwoSortedArrays(int[] a, int[] b){\n System.out.println(\"Merging these two arrays \");\n System.out.print(\"left array -> \");\n print(a);\n System.out.print(\"right array -> \");\n print(b);\n int i = 0, j =0, k = 0;\n int[] ans = new int[a.length + b.length];\n while(i < a.length && j < b.length){\n if(a[i] <= b[j]){\n ans[k] = a[i];\n i++;\n k++;\n }else{\n ans[k] = b[j];\n j++;\n k++;\n }\n }\n\n while(i < a.length){\n ans[k] = a[i];\n k++;\n i++;\n }\n\n while(j < b.length){\n ans[k] = b[j];\n k++;\n j++;\n }\n\n return ans;\n}",
"static void Adding(int[][] array, int[][] second_array) {\n System.out.println(\"\\t\\t\\t<<=======================================================>>\");\n System.out.println(\"\\t\\t\\t\\tHere's Your Addition of Mutli_Dimentional Matrix::\");\n for (int i = 0; i < array.length; i++) {\n for (int j = 0; j < second_array.length; j++) {\n System.out.print(array[i][j] + second_array[i][j] + \" \");\n }\n System.out.println();\n }\n }",
"private static byte[] joins(final byte[] prefix, final byte[] suffix) {\n byte[] ret = new byte[prefix.length + suffix.length];\n System.arraycopy(prefix, 0, ret, 0, prefix.length);\n System.arraycopy(suffix, 0, ret, prefix.length, suffix.length);\n return ret;\n }",
"public static int[][] add(int[][] a, int[][] b) {\n\t\tint[][] C = new int[4][4];\n\t\t \n for (int q = 0; q < C.length; q++) {\n for (int w = 0; w < C[q].length; w++) {\n C[q][w] = a[q][w] + b[q][w];\n }\n }\n \n for (int q = 0; q < b.length; q++ ){\n for(int w = 0; w < C[q].length;w++){\n }\n }\n \n return C;\n \n \n }",
"private void addCombinedOccurence(List<AttributeSource> originalAttributeSources, List<Attribute> unionAttributeList,\n\t\t\tExampleSetBuilder builder, Example leftExample, Example rightExample) {\n\t\tdouble[] unionDataRow = new double[unionAttributeList.size()];\n\t\tint attributeIndex = 0;\n\t\tfor (AttributeSource attributeSource : originalAttributeSources) {\n\t\t\tif (attributeSource.getSource() == AttributeSource.FIRST_SOURCE) {\n\t\t\t\tunionDataRow[attributeIndex] = leftExample.getValue(attributeSource.getAttribute());\n\t\t\t} else if (attributeSource.getSource() == AttributeSource.SECOND_SOURCE) {\n\t\t\t\tunionDataRow[attributeIndex] = rightExample.getValue(attributeSource.getAttribute());\n\t\t\t}\n\t\t\tattributeIndex++;\n\t\t}\n\t\tbuilder.addRow(unionDataRow);\n\t}",
"public int[] merge(int left[], int right[]) {\n int[] merged = new int[left.length + right.length];\n int leftPos = 0;\n int rightPos = 0;\n int curIndex = 0;\n\n while (leftPos < left.length && rightPos < right.length) {\n if (left[leftPos] < right[rightPos]) {\n merged[curIndex] = left[leftPos];\n leftPos++;\n } else {\n merged[curIndex] = right[rightPos];\n rightPos++;\n }\n curIndex++;\n }\n\n System.arraycopy(left, leftPos, merged, curIndex, left.length - leftPos);\n System.arraycopy(right, rightPos, merged, curIndex, right.length - rightPos);\n return merged;\n }",
"public static void merge (int[] result, int[] a1, int[] a2) {\r\n\t\tint len1 = a1.length;\r\n\t\tint len2 = a2.length;\r\n\t\t\r\n\t\tint i = 0;\r\n\t\tint j = 0;\r\n\t\tint k = 0;\r\n\t\t\r\n\t\twhile (i < len1 && j < len2) {\r\n\t\t\tif (a1[i] < a2[j]) {\r\n\t\t\t\tresult[k] = a1[i];\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tresult[k] = a2[j];\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t}\r\n\t\twhile (i < len1) {\r\n\t\t\tresult[k] = a1[i];\r\n\t\t\ti++;\r\n\t\t\tk++;\r\n\t\t}\r\n\t\twhile (j < len2) {\r\n\t\t\tresult[k] = a2[j];\r\n\t\t\tj++;\r\n\t\t\tk++;\r\n\t\t}\r\n\t}",
"private static int[] merge(int array1[], int array2[]) {\n\n\t\tint totalNumbers = array1.length + array2.length;\n\t\tint mergedArray[] = new int[totalNumbers];\n\n\t\tint pointerInArray1 = 0, pointerInArray2 = 0;\n\n\t\tfor (int i = 0; i < totalNumbers; i++) {\n\t\t\tif (pointerInArray1 >= array1.length) {\n\t\t\t\tmergedArray[i] = array2[pointerInArray2++];\n\t\t\t} else if (pointerInArray2 >= array2.length) {\n\t\t\t\tmergedArray[i] = array1[pointerInArray1++];\n\t\t\t} else if (array1[pointerInArray1] < array2[pointerInArray2]) {\n\t\t\t\tmergedArray[i] = array1[pointerInArray1++];\n\t\t\t} else {\n\t\t\t\tmergedArray[i] = array2[pointerInArray2++];\n\t\t\t}\n\t\t}\n\n\t\treturn mergedArray;\n\t}",
"public static int[][] add(int[][] x,int[][] y){\n int[][] result = new int[x.length][x.length];\n for (int i = 0; i < x.length; i++) {\n for (int j = 0; j < x.length; j++) {\n result[i][j] = x[i][j] + y[i][j];\n }\n }\n return result;\n }",
"public String devolver_campos_concatenados(){\n String dato_concatenado=\"\";\n campos_concaenados=\" \";\n for (int j=0;j<numero_campos;j++){\n if(j==numero_campos-1){\n dato_concatenado=campos[j];\n }else{\n dato_concatenado=campos[j]+\", \";\n }\n campos_concaenados=campos_concaenados+dato_concatenado;\n }\n \n return campos_concaenados;\n }",
"public static <R> Tuple<R> concat(Tuple<R> a, Tuple<R> b) {\n\t\tLinkedList<R> list = new LinkedList<>();\n\t\tfor (R element : a) {\n\t\t\tlist.add(element);\n\t\t}\n\n\t\tfor (R element : b) {\n\t\t\tlist.add(element);\n\t\t}\n\n\t\treturn new Tuple<>(list);\n\t}",
"@SuppressWarnings(\"unchecked\")\n\tpublic static <T> T[] concatArrays(T[]... arrays) {\n\t\tint c = 0;\n\t\tCollection<Class<?>> classes = new HashSet<Class<?>>();\n\t\tfor (T[] a : arrays) {\n\t\t\tc+=a.length;\n\t\t\tclasses.add(a.getClass().getComponentType());\n\t\t}\n\n\t\tT[] re = (T[]) Array.newInstance(ReflectionUtils.getCommonSuperClass(classes), c);\n\t\tc=0;\n\t\tfor (T[] a : arrays) {\n\t\t\tSystem.arraycopy(a, 0, re, c, a.length);\n\t\t\tc+=a.length;\n\t\t}\n\t\treturn re;\n\t}",
"private static int[] merge(int[] integers, int[] integers2) {\n\t\tint[] c = new int[integers.length + integers2.length];\n int i = 0, j = 0;\n for (int k = 0; k < c.length; k++) {\n if (i >= integers.length) c[k] = integers2[j++];\n else if (j >= integers2.length) c[k] = integers[i++];\n else if (integers[i] <= integers2[j]) c[k] = integers[i++];\n else c[k] = integers2[j++];\n }\n return c;\n }",
"public static void main(String[] args) {\n\t\tint arr1[] = {1, 3, 5};\n\t\tint arr2[] = {2, 3, 3};\n\t\tint a[] = merge(arr1, arr2);\n\t\tfor (int i = 0; i )\n\t\tSystem.out.println();\n\t}\n\t\n\tpublic static int[] merge (int arr1[], int arr2[]){\n\t\tint result[] = new int[arr1.length + arr2.length];\n\t\tint idex_arr1 = 0;\n\t\tint idex_arr2 = 0;\n\t\tint idex_result = 0;\n\t\t//index arr1 < index arr2, result [0] = arr1[0]\n\t\twhile (idex_arr1 < arr1.length || idex_arr2 < arr2.length)\n\t\t{\n\t\t\tif (idex_arr2 >= arr2.length)\n\t\t\t{\n\t\t\t\tresult[idex_result++] = arr1[idex_arr1++];\n\t\t\t}\n\t\t\telse if (idex_arr1 < arr1.length)\n\t\t\t{\n\t\t\t\tif (arr1[idex_arr1] < arr2[idex_arr2])\n\t\t\t\t\tresult[idex_result++] = arr1[idex_arr1++];\n\t\t\t\telse\n\t\t\t\t\tresult[idex_result++] = arr2[idex_arr2++];\n\t\t\t} else {\n\t\t\t\tresult[idex_result++] = arr2[idex_arr2++];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"public String concate(String x, String y)\n\t{\n\t\treturn x.concat(y);\n\t}",
"private static void merge(int arr[], int[] buf, int a, int aLen, int b, int bLen) {\n int from = a;\n\n int aEnd = a + aLen;\n int bEnd = b + bLen;\n\n int i = 0;\n\n while (a < aEnd || b < bEnd) {\n if (b >= bEnd || (a < aEnd && arr[a] < arr[b])) {\n buf[i] = arr[a];\n ++a;\n } else {\n buf[i] = arr[b];\n ++b;\n }\n ++i;\n }\n\n System.arraycopy(buf, 0, arr, from, aLen + bLen);\n }",
"public static void main(String[] args) {\nint[] array1 = {5,2,8,23,14};\nint[] array2 = {67,32,7,4,61};\nint add = array1[0];\nint [] second = new int [5];\nfor(int i = 0; i<=second.length-1;i++) {\n\tsecond[i] = (array1[i] + array2[i]);\n\tSystem.out.println(second[i]);\n\t}\n}",
"public static void main(String[] args) {\n\n int[] ints1={1,2,3};\n int[] ints2 ={3,2,1};\n\n System.out.println(Arrays.toString(addElements(ints1,ints2)) );\n }",
"public void addColumns(Column[] cols) {\n\n\t\t//\t\t\tAllocate a new array.\n\t\tint number = cols.length;\n\t\tint cnt = columns.length + number;\n\t\tColumn[] newColumns = new Column[cnt];\n\n\t\t// copy current columns.\n\t\tSystem.arraycopy(columns, 0, newColumns, 0, columns.length);\n\n\t\t//\t\t\tANCA: need to expand the Column[] cols\n\n\t\tfor (int k = 0; k < cols.length; k++) {\n\n\t\t\tString columnClass = (cols[k].getClass()).getName();\n\t\t\tColumn expandedColumn = null;\n\n\t\t\t//if col is the first column in the table add it as is and initialize subset\n\t\t\tint numRows = super.getNumRows();\n\t\t\tif (columns.length == 0) {\n\t\t\t\tif (subset.length == 0) {\n\t\t\t\t\tnumRows = cols[k].getNumRows();\n\t\t\t\t\tsubset = new int[numRows];\n\t\t\t\t\tfor (int i = 0; i < this.getNumRows(); i++) {\n\t\t\t\t\t\tsubset[i] = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// LAM-tlr, I moved this down from inside the above condition. If it is\n\t\t\t\t// inside the condition above, after the first column is added, the rest of\n\t\t\t\t// the columns are empty.\n\t\t\t\texpandedColumn = cols[k];\n\t\t\t} else {\n\t\t\t\t// LAM-tlr, I moved this down from above. If we are to use the column\n\t\t\t\t// as is, we don't need to reallocate it.\n\t\t\t\ttry {\n\t\t\t\t\texpandedColumn =\n\t\t\t\t\t\t(Column) Class.forName(columnClass).newInstance();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(e);\n\t\t\t\t}\n\t\t\t\texpandedColumn.addRows(numRows);\n\t\t\t\texpandedColumn.setLabel(cols[k].getLabel());\n\t\t\t\texpandedColumn.setComment(cols[k].getComment());\n\t\t\t\texpandedColumn.setIsScalar(cols[k].getIsScalar());\n\t\t\t\texpandedColumn.setIsNominal(cols[k].getIsNominal());\n\n\t\t\t\t//initialize all values as missing for the beginning\n\t\t\t\tfor (int j = 0; j < numRows; j++)\n\t\t\t\t\texpandedColumn.setValueToMissing(true, j);\n\n\t\t\t\t//set the elements of the column where appropriate as determined by subset\n\t\t\t\tObject el;\n\t\t\t\tfor (int i = 0; i < subset.length; i++) {\n\t\t\t\t\tel = cols[k].getObject(i);\n\t\t\t\t\texpandedColumn.setObject(el, subset[i]);\n\t\t\t\t\texpandedColumn.setValueToMissing(false, subset[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tnewColumns[columns.length + k] = expandedColumn;\n\t\t}\n\t\tcolumns = newColumns;\n\n\t}",
"public abstract void merge (org.apache.spark.sql.expressions.MutableAggregationBuffer buffer1, org.apache.spark.sql.Row buffer2) ;",
"public static void add(int[][] matrix1, int[][] matrix2) {\n\tfor(int x=0;x<matrix1.length; x++) {\r\n\t\tfor(int y=0;y<matrix2.length;y++) {\r\n\t\t\tSystem.out.print(matrix1[x][y] +matrix2[x][y] + \" \");\r\n\t\t\t}\r\n\t\tSystem.out.println();\r\n\t\t}\t\r\n\t}",
"public static void main(String[] args) {\n\t\tint[][] no1 = {{1,2,3},{4,5,6}};\r\n\t\t\r\n\t\tint[][] no2 = new int[3][2];\r\n\t\t\r\n\t\tfor(int[]arr : no1) {\r\n\t\t\tSystem.out.println(Arrays.toString(arr));\r\n\t\t}\r\n\t\tfor(int i=0; i<no2.length; i++) {\r\n\t\t\tfor(int j=0; j<no2[i].length; j++) {\r\n\t\t\t\tno2[i][j] = no1[j][i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\tfor(int[]arr : no2) {\r\n\t\t\tSystem.out.println(Arrays.toString(arr));\r\n\t\t}\r\n\t}",
"private static void merge(int[] a, int[] b) {\n\t\tint aI = a.length-1;\r\n\t\tint bI = b.length-1;\r\n\t\tint posI=a.length-b.length-1;\r\n\t\t\r\n\t\r\n\t\twhile (aI>=0 ) {\r\n\t\t\tif(a[posI]> b[bI]) {//missing the test for posI>=0 see mergeInPlace(int a[],int b[])\r\n\t\t\t\ta[aI]=a[posI];\r\n\t\t\t\tposI--;\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\ta[aI]=b[bI];\r\n\t\t\t\tbI--;\r\n\r\n\t\t\t}\r\n\t\t\taI--;\r\n\t\t}\r\n\t\t\r\n\t\tfor (int x:a) {\r\n\t\t\tSystem.out.println(x);\r\n\t\t}\r\n\t}",
"private int[][] addOneCol(int[][] ints) {\n\n int vertexLength = getRow(ints);\n int edgesLength = getCol(ints);\n\n int[][] temp = new int[vertexLength][edgesLength + 1];\n for (int i = 0; i < vertexLength; i++) {\n for (int j = 0; j < edgesLength; j++) {\n temp[i][j] = ints[i][j];\n }\n }\n return temp;\n }",
"public static double[] vectorAddition(double[] a, double[] b) {\r\n\t\tdouble[] retval = new double[a.length];\r\n\t\tfor(int i = 0; i < a.length; i += 1) {\r\n\t\t\tretval[i] = a[i] + b[i];\r\n\t\t}\r\n\t\treturn retval;\r\n\t}",
"protected void mergeOrderedArrays(int[] firstArray, int[] secondArray, int[] mergedArray) {\n int firstArrayIndex=0, secondArrayIndex=0, mergedArrayIndex=0;\n\n while (firstArrayIndex < firstArray.length && secondArrayIndex < secondArray.length) {\n mergedArray[mergedArrayIndex++] = (firstArray[firstArrayIndex] > secondArray[secondArrayIndex])\n ? secondArray[secondArrayIndex++] : firstArray[firstArrayIndex++];\n }\n\n while (firstArrayIndex < firstArray.length) {\n mergedArray[mergedArrayIndex++] = firstArray[firstArrayIndex++];\n }\n\n while (secondArrayIndex < secondArray.length) {\n mergedArray[mergedArrayIndex++] = secondArray[secondArrayIndex++];\n }\n }",
"static <R,C> DataFrame<R,C> concatColumns(Iterable<DataFrame<R,C>> frames) {\n return DataFrame.factory().concatColumns(frames.iterator());\n }",
"public static int[] array(int[] arr1, int[] arr2) {\n\n int[] arr3 = new int[arr1.length + arr2.length]; //now the length = 5\n int j = 0;//will represent indexes of 3rd array\n\n for (int each : arr1) { //1, 2, 3\n arr3[j++] = each;\n }\n\n for (int each : arr2) {\n arr3[j++] = each;\n }\n\n return arr3;\n }",
"static void mergeWithoutExtraSpace(int[] arr1, int[] arr2) {\n int lastIndexOfArr1 = arr1.length - 1;\n int firstIndexOfArr2 = 0;\n\n while (lastIndexOfArr1 >= 0 && firstIndexOfArr2 < arr2.length) {\n if (arr1[lastIndexOfArr1] > arr2[firstIndexOfArr2]) {\n int temp = arr1[lastIndexOfArr1];\n arr1[lastIndexOfArr1] = arr2[firstIndexOfArr2];\n arr2[firstIndexOfArr2] = temp;\n lastIndexOfArr1--;\n firstIndexOfArr2++;\n } else\n\n /*This is the condition when arr1[lastIndexOfArr1] > arr2[firstIndexOfArr2], that means after this\n * situation, Arr1's all left to current elements would be smaller then right elements of arr2 so we are\n * breaking this loop here.\n * */\n break;\n\n }\n\n //Now arr1 has all element lower than any element of arr2 so now sort them individually and print them\n Arrays.sort(arr1);\n Arrays.sort(arr2);\n\n for (int t : arr1) {\n System.out.print(t + \" \");\n }\n System.out.println(\"*\");\n for (int t : arr2) {\n System.out.print(t + \" \");\n }\n System.out.println(\"*\");\n\n StringBuilder sb = new StringBuilder();\n for (int value : arr1) {\n sb.append(value).append(\" \");\n }\n\n for (int value : arr2) {\n sb.append(value).append(\" \");\n }\n System.out.println(sb);\n }",
"public static void merge(int[] arr1, int[] arr2, int[] arr3) {\r\n\t\r\n\t\tint m = arr1.length, n = arr2.length, i = 0, j = 0, k = 0;\r\n\t \r\n // Traverse both array.\r\n while (i < m && j < n) {\r\n // Check if current element of first array is smaller than current element of second array.\r\n \t// If yes, store first array element and increment first array index. \r\n \t// Otherwise do same with second array.\r\n if (arr1[i] < arr2[j]) {\r\n arr3[k] = arr1[i];\r\n i++;\r\n } else {\r\n arr3[k] = arr2[j];\r\n j++;\r\n }\r\n \r\n k++;\r\n }\r\n \r\n // Store remaining elements of first array.\r\n while (i < m) {\r\n arr3[k] = arr1[i];\r\n i++;\r\n k++;\r\n }\r\n \r\n // Store remaining elements of second array.\r\n while (j < n) {\r\n arr3[k] = arr2[j];\r\n j++;\r\n k++;\r\n }\r\n\t}",
"public static int[] merge(int[] arr1, int[] arr2) {\n int[] merged = new int[arr1.length + arr2.length];\n\n int arr1Index = 0;\n int arr2Index = 0;\n int mergedIndex = 0;\n\n // Keep taking values from arr1 or arr2 until the merged array is full.\n while (mergedIndex < merged.length) {\n\n if (arr1Index < arr1.length && arr2Index < arr2.length) {\n /*\n * Still have values in both arr1 and arr2 that have not been\n * used, so take the smaller of the two and put it into merged.\n */\n if (arr1[arr1Index] < arr2[arr2Index]) {\n merged[mergedIndex] = arr1[arr1Index];\n arr1Index++;\n }\n else {\n merged[mergedIndex] = arr2[arr2Index];\n arr2Index++;\n }\n }\n else if (arr1Index < arr1.length) {\n /*\n * There are still values in arr1 that have not been used but\n * arr2 has been exhausted so take the next value from arr1.\n */\n merged[mergedIndex] = arr1[arr1Index];\n arr1Index++;\n }\n else {\n /*\n * There are still values in arr2 that have not been used but\n * arr1 has been exhausted so take the next value from arr2.\n */\n merged[mergedIndex] = arr2[arr2Index];\n arr2Index++;\n }\n\n mergedIndex++;\n }\n\n return merged;\n }",
"public String[][] combine(String[][] roster, String[][] attendance) {\r\n\r\n\t\t//comment here\r\n\t\tfor(int i = 0; i < getRosterRowCount(); i++ ) {\r\n\t\t\tfor(int j = 0; j < getAttendanceRowCount(); j++ ) {\r\n\r\n\t\t\t\tif(roster[i][5].compareTo(attendance[j][0]) == 0) {\r\n\r\n\t\t\t\t\troster[i][6]= attendance[j][1];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}//end of for loop\r\n\r\n\t\tthis.roster = roster;\r\n\t\treturn roster;\r\n\t}"
] | [
"0.77817965",
"0.72010875",
"0.70216894",
"0.70017964",
"0.6959023",
"0.6905474",
"0.68206173",
"0.67844826",
"0.66926515",
"0.66307133",
"0.657629",
"0.6453463",
"0.62933767",
"0.6261994",
"0.6199176",
"0.611361",
"0.6113201",
"0.60732496",
"0.60492635",
"0.6015048",
"0.6010294",
"0.59733593",
"0.5952728",
"0.5938234",
"0.5911358",
"0.58244836",
"0.57751334",
"0.5731532",
"0.5719979",
"0.5693536",
"0.56763107",
"0.56430674",
"0.56380796",
"0.56328267",
"0.5623639",
"0.55967265",
"0.5584179",
"0.55757004",
"0.55754656",
"0.5566564",
"0.55155843",
"0.54952866",
"0.5447588",
"0.54376614",
"0.54272884",
"0.541908",
"0.5367363",
"0.53660655",
"0.5360436",
"0.5350802",
"0.53345877",
"0.5324247",
"0.53187674",
"0.531414",
"0.53135824",
"0.52836365",
"0.52732176",
"0.52722585",
"0.52698815",
"0.5254017",
"0.52264106",
"0.5209408",
"0.5207678",
"0.52046275",
"0.520218",
"0.5187125",
"0.5182937",
"0.51721895",
"0.5167064",
"0.5166657",
"0.5161104",
"0.51529825",
"0.5152469",
"0.5136677",
"0.5130127",
"0.5123095",
"0.5119688",
"0.5114503",
"0.5106942",
"0.50765413",
"0.5062362",
"0.5056093",
"0.5054365",
"0.5048419",
"0.50469106",
"0.5036958",
"0.5005976",
"0.50018835",
"0.5000869",
"0.49993667",
"0.49971998",
"0.49963242",
"0.499214",
"0.49882185",
"0.49740395",
"0.4967598",
"0.49668586",
"0.4962858",
"0.49594343",
"0.49589097"
] | 0.676861 | 8 |
This method takes the POJOobject that contains all events, extracts all clientIDs and maps instanceIds to them which are saved to a HashMap. | private HashMap<String, ArrayList<String>> getInstanceIdsPerClientId(TSDBData[] tsdbData) {
logger.trace("BEGIN HashMap<String,ArrayList<String>> getInstanceIdsPerClientId(TSDBData[] tsdbData)");
HashMap<String, ArrayList<String>> map = new HashMap<String, ArrayList<String>>();
for (TSDBData obj : tsdbData) {
ArrayList<String> columns = obj.getColumns();
ArrayList<ArrayList<Object>> points = obj.getPoints();
int clientidIndex = -1;
int instanceidIndex = -1;
for (int i = 0; i < columns.size(); i++) {
if (columns.get(i).equals("clientId"))
clientidIndex = i;
else if (columns.get(i).equals("instanceId"))
instanceidIndex = i;
}
for (int i = 0; i < points.size(); i++) {
String clientId = points.get(i).get(clientidIndex).toString();
String InstanceId = points.get(i).get(instanceidIndex).toString();
if (!(map.containsKey(clientId))) {
map.put(clientId, new ArrayList<String>());
if (!(map.get(clientId).contains(InstanceId))) {
map.get(clientId).add(InstanceId);
}
} else {
if (!(map.get(clientId).contains(InstanceId))) {
map.get(clientId).add(InstanceId);
}
}
}
}
logger.trace("END HashMap<String,ArrayList<String>> getInstanceIdsPerClientId(TSDBData[] tsdbData)");
return map;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract Map<String, Serializable> getEventKeyAndIdMap();",
"Map<Long,LinkedList<Event>> getAllEvents(List<Long> inRequestIds);",
"public abstract java.util.Map<java.lang.String, java.lang.Integer> idiosyncraticEventIncidenceCountMap();",
"public Map<String, Object> toMap(){\n Map<String, Object> newEvent = new HashMap<>();\n newEvent.put(\"uid\", getUid());\n newEvent.put(\"name\", getName());\n newEvent.put(\"host\", getHost());\n newEvent.put(\"hostContribution\", isHostContribution());\n newEvent.put(\"startTime\", getEpochTime());\n newEvent.put(\"location\", getLocation());\n newEvent.put(\"description\", getDescription());\n newEvent.put(\"coverImageUrl\", getCoverImageUrl());\n newEvent.put(\"amountNeeded\", getAmountNeeded());\n return newEvent;\n }",
"public abstract Map<String, Event> getEvents();",
"static Map<Integer, Event> getEvents() {\n\t\treturn events;\n\t}",
"public static Map<String, String> fetchInstanceIds(String surveyId,\r\n \t\t\tString serverBase) throws Exception {\r\n \t\tMap<String, String> values = new HashMap<String, String>();\r\n \t\tString instanceString = fetchDataFromServer(serverBase\r\n \t\t\t\t+ DATA_SERVLET_PATH + DataBackoutRequest.LIST_INSTANCE_ACTION\r\n \t\t\t\t+ \"&\" + DataBackoutRequest.SURVEY_ID_PARAM + \"=\" + surveyId\r\n \t\t\t\t+ \"&\" + DataBackoutRequest.INCLUDE_DATE_PARAM + \"=true\");\r\n \t\tif (instanceString != null) {\r\n \t\t\tStringTokenizer strTok = new StringTokenizer(instanceString, \",\");\r\n \t\t\twhile (strTok.hasMoreTokens()) {\r\n \t\t\t\tString instanceId = strTok.nextToken();\r\n \t\t\t\tString dateString = \"\";\r\n \t\t\t\tif (instanceId.contains(\"|\")) {\r\n \t\t\t\t\tdateString = instanceId\r\n \t\t\t\t\t\t\t.substring(instanceId.indexOf(\"|\") + 1);\r\n \t\t\t\t\tinstanceId = instanceId.substring(0, instanceId\r\n \t\t\t\t\t\t\t.indexOf(\"|\"));\r\n \t\t\t\t}\r\n \t\t\t\tvalues.put(instanceId, dateString);\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn values;\r\n \t}",
"public static Map<String, Client> getClientMap() {\r\n return clientMap;\r\n }",
"public void readIDs() {\n try {\n FileInputStream fileIn = new FileInputStream(\"temp/ids.ser\");\n ObjectInputStream in = new ObjectInputStream(fileIn);\n ids = (HashMap<String, Member>) in.readObject();\n in.close();\n fileIn.close();\n } catch (IOException e) {\n ids = new HashMap<>();\n } catch (ClassNotFoundException c) {\n System.out.println(\"Class HashMap not found\");\n c.printStackTrace();\n return;\n }\n\n }",
"public abstract Map<Object,Map<String,Integer>> getEventHandlerCounts();",
"Map<String, Object> getServiceSpecificObjects();",
"@SuppressWarnings(\"unused\")\n private static <T extends AbstractApiIdentifiableDTO> Map<Long, T> generateIdMap(List<T> idList) {\n Map<Long, T> results = new HashMap<>(idList.size());\n\n for (T idSingle : idList) {\n results.put(idSingle.getId(), idSingle);\n }\n\n return results;\n }",
"public IdMap() {\n\t\tthis.add(new TextItems());\n\t\tthis.add(new DateTimeEntity());\n\t\tthis.add(EntityCreator.createJson(false));\n\t\tthis.add(EntityCreator.createJson(true));\n\t\tthis.add(new ObjectMapEntry());\n\t\tthis.add(EntityCreator.createXML());\n\t}",
"public List<Event> getEvents() {\n List<Event> events = new ArrayList<>();\n\n Query query = new Query(\"Event\");\n PreparedQuery results = datastore.prepare(query);\n\n for (Entity entity : results.asIterable()) {\n try {\n String idString = entity.getKey().getName();\n UUID eventId = UUID.fromString(idString);\n String speaker = (String) entity.getProperty(\"speaker\");\n String organization = (String) entity.getProperty(\"organization\");\n String eventDate = (String) entity.getProperty(\"eventDate\");\n Location location = (Location) entity.getProperty(\"location\");\n List<String> amenities = getAmenities(eventId);\n String externalLink = (String) entity.getProperty(\"externalLink\");\n PublicType publicType = (PublicType) entity.getProperty(\"publicType\");\n long ownerId = (long) entity.getProperty(\"ownerId\");\n List<ThreadComment> thread = getThread(eventId);\n // long timeStamp = (long) entity.getProperty(\"timestamp\");\n\n Event event = new Event(eventId, speaker, organization, eventDate, location, amenities, externalLink,\n publicType, ownerId);\n event.copyThread(thread);\n events.add(event);\n // An exception can occur here for multiple reasons (Type casting error, any\n // property not existing, key error, etc...)\n } catch (Exception e) {\n System.err.println(\"Error reading event.\");\n System.err.println(entity.toString());\n e.printStackTrace();\n }\n }\n\n return events;\n }",
"public ArrayList<String> getEventIdsList(){\n return this.eventIdsList;\n }",
"public Map<String, Object> getIds() {\n return ids;\n }",
"public Map<String, List<CalendarEvent>> getEvents(){ return _safeEvents; }",
"public abstract Map<IBinder, ClientTransactionItem> getActivitiesToBeDestroyed();",
"@Override\n public int hashCode() {\n return _instanceId.hashCode();\n }",
"Collection<CalendarEvent> getActiveEvents(long when)\n{\n List<CalendarEvent> rslt = new ArrayList<CalendarEvent>();\n try {\n getAllEvents(when);\n rslt.addAll(cal_events);\n }\n catch (Exception e) {\n BasisLogger.logE(\"GOOGLECAL: problem getting events\",e);\n }\n return rslt;\n}",
"protected void getEventIDs() throws Throwable\n {\n _eventID = _helper.getProperties().getRetrievePendingEventId();\n _ackEventID = _helper.getProperties().getRetrievePendingAckEventId();\n }",
"@Override\n public HashMap<String, Object> toMap() {\n\n HashMap<String,Object> hashMap=new HashMap<>();\n hashMap.put(ApodClientAPI.APOD_START_DATE,APOD_START_DATE);\n hashMap.put(ApodClientAPI.APOD_END_DATE,APOD_END_DATE);\n hashMap.put(ApodClientAPI.APOD_API_KEY,ApodClientAPI.APOD_API_KEY_VALUE);\n\n\n return hashMap;\n }",
"private static Map<String, Map<String, String>> getEventRelationships(Document doc,\n\t\t\tMap<String, String> eiidMappings) {\n\t\tMap<String, Map<String, String>> result = new HashMap<String, Map<String, String>>();\n\n\t\t// Get TLINKs\n\t\tElement root = doc.getDocumentElement();\n\t\tElement[] tlinkElems = \n\t\t\t\tXMLParser.getElementsByTagNameNR(root, \"TLINK\");\n\t\tfor (Element e : tlinkElems) {\n\t\t\tString eventInstanceID = e.getAttribute(\"eventInstanceID\");\n\t\t\tString relatedToEventInstance = e.getAttribute(\"relatedToEventInstance\");\n\t\t\tString relType = e.getAttribute(\"relType\");\n\n\t\t\tif (eventInstanceID.length() > 0 && relatedToEventInstance.length() > 0\n\t\t\t\t\t&& relType.length() > 0) {\n\t\t\t\t\n\t\t\t\tif (eiidMappings != null) {\n\t\t\t\t\teventInstanceID = eiidMappings.get(eventInstanceID);\n\t\t\t\t\trelatedToEventInstance = eiidMappings.get(relatedToEventInstance);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tMapUtils.doublePut(result, eventInstanceID, relatedToEventInstance, relType);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Get SLINKs\n\t\tElement[] slinkElems =\n\t\t\t\tXMLParser.getElementsByTagNameNR(root, \"SLINK\");\n\t\tfor (Element e : slinkElems) {\n\t\t\tString eventInstanceID = e.getAttribute(\"eventInstanceID\");\n\t\t\tString subordinatedEventInstance = e.getAttribute(\"subordinatedEventInstance\");\n\t\t\tString relType = e.getAttribute(\"relType\");\n\t\t\t\n\t\t\tif (eventInstanceID.length() > 0 && subordinatedEventInstance.length() > 0\n\t\t\t\t\t&& relType.length() > 0) {\n\t\t\t\t\n\t\t\t\tif (eiidMappings != null) {\n\t\t\t\t\teventInstanceID = eiidMappings.get(eventInstanceID);\n\t\t\t\t\tsubordinatedEventInstance = eiidMappings.get(subordinatedEventInstance);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tMapUtils.doublePut(result, eventInstanceID, subordinatedEventInstance, relType);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}",
"Map<ContactId, GroupChatEvent.Status> getGroupChatEvents(String chatId);",
"@Override\n public int hashCode() {\n return Objects.hash(getAssociatedUsername(), getEventID(), getPersonID(), getLatitude(),\n getLongitude(), getCountry(), getCity(), getEventType(), getYear());\n }",
"private void initEvents(){\n ArrayList<Event> en = new ArrayList();\n en.add(new Event_MessangerOfGods(this.village));\n en.add(new Event_PaganPriest(this.village));\n this.events = en;\n }",
"public Map<String, Object> getPrimaryKey() {\n Map<String, Object> ret = new LinkedHashMap<String, Object>(6);\n ret.put(\"atrfAudUid\", getAtrfAudUid());\n return ret;\n }",
"private static <T extends AbstractApiIdentifiableDTO> Map<Long, List<T>> generateIdMapList(List<T> idList) {\n Map<Long, List<T>> results = new HashMap<>();\n\n for (T idSingle : idList) {\n Long sourceId = idSingle.getId();\n if (results.containsKey(sourceId)) {\n results.get(sourceId).add(idSingle);\n } else {\n // ID didn't exist so add a new list\n List<T> list = new ArrayList<>(1);\n list.add(idSingle);\n results.put(sourceId, list);\n }\n }\n\n return results;\n }",
"@Override\n public final java.util.Map<String, Object> getAttributesCalled(java.util.Map<String, Object> properties, RemoteServiceInfo source) {\n java.util.Map<String, Object> attributes = new java.util.HashMap<String, Object>();\n attributes.put(\"id\", _id);\n return attributes;\n }",
"public Map<String, Object> map() {\n Map<String, Object> tomcatInstanceMap = new HashMap<>();\n tomcatInstanceMap.put(\"instanceUUID\", tomcatInstanceUUID);\n tomcatInstanceMap.put(\"instanceName\", instanceName);\n tomcatInstanceMap.put(\"environmentName\", environmentName);\n tomcatInstanceMap.put(\"tomcatVersion\", tomcatVersion);\n tomcatInstanceMap.put(\"destinationFolder\", destinationFolder.getAbsolutePath());\n tomcatInstanceMap.put(\"compressed\", compressed);\n tomcatInstanceMap.put(\"primaryPort\", primaryPort);\n tomcatInstanceMap.put(\"protocolPrimaryPort\", protocolPrimaryPort);\n tomcatInstanceMap.put(\"shutdownPort\", shutdownPort);\n tomcatInstanceMap.put(\"ajpPort\", ajpPort);\n tomcatInstanceMap.put(\"secureInstance\", secureInstance);\n tomcatInstanceMap.put(\"securePort\", securePort);\n tomcatInstanceMap.put(\"protocolSecurePort\", protocolSecurePort);\n tomcatInstanceMap.put(\"keystoreSourceFilename\", keystoreSourceFilename);\n tomcatInstanceMap.put(\"keystoreCredentials\", keystoreCredentials);\n tomcatInstanceMap.put(\"jvmOptionXms\", jvmOptionXms);\n tomcatInstanceMap.put(\"jvmOptionXmx\", jvmOptionXmx);\n tomcatInstanceMap.put(\"jvmOptionXss\", jvmOptionXss);\n tomcatInstanceMap.put(\"jvmOptionXXMaxMetaspaceSize\", jvmOptionXXMaxMetaspaceSize);\n tomcatInstanceMap.put(\"jvmOptions\", jvmOptions);\n tomcatInstanceMap.put(\"instanceManagement\", instanceManagement);\n /**\n * Serialize our Instance Management Properties\n */\n List<Map<String,String>> instanceManagementPropertiesMapList =\n new ArrayList<>(instanceManagementProperties.size());\n for(TomcatInstanceProperty tomcatInstanceProperty : instanceManagementProperties) {\n instanceManagementPropertiesMapList.add(tomcatInstanceProperty.map());\n }\n tomcatInstanceMap.put(\"instanceManagementProperties\", instanceManagementPropertiesMapList);\n /**\n * Serialize our Instance Properties\n */\n List<Map<String,String>> instancePropertiesMapList =\n new ArrayList<>(instanceProperties.size());\n for(TomcatInstanceProperty tomcatInstanceProperty : instanceProperties) {\n instancePropertiesMapList.add(tomcatInstanceProperty.map());\n }\n tomcatInstanceMap.put(\"instanceProperties\", instancePropertiesMapList);\n /**\n * Return the Map for Persisting as YAML.\n */\n return tomcatInstanceMap;\n }",
"void parseEventList() {\n\t\tfor (int eventsId : events.keySet()) {\n\t\t\tfinal Event event = events.get(eventsId);\n\t\t\tif (users.get(event.getUser().getName()).isActiveStatus()\n\t\t\t\t\t&& !event.isViewed()\n\t\t\t\t\t&& event.getInnerSisdate().compareTo(\n\t\t\t\t\t\t\tnew GregorianCalendar()) >= 0) {\n\t\t\t\tevent.setViewed(true);\n\t\t\t\tfinal SimpleDateFormat fm = new SimpleDateFormat(\n\t\t\t\t\t\t\"dd.MM.yyyy-HH:mm:ss\");\n\t\t\t\tt.schedule(new TimerTask() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tif (event.isActive()) {\n\t\t\t\t\t\t\tgenerateEventMessage(\"User \"\n\t\t\t\t\t\t\t\t\t+ event.getUser().getName()\n\t\t\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t\t\t+ fm.format(event.getInnerSisdate()\n\t\t\t\t\t\t\t\t\t\t\t.getTime()) + \" \" + event.getText());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}, event.getInnerSisdate().getTime());\n\n\t\t\t}\n\t\t}\n\n\t}",
"public Map<String, Object> getPrimaryKey() {\n Map<String, Object> ret = new LinkedHashMap<String, Object>(6);\n ret.put(\"iduser\", Integer.valueOf(getIduser()));\n return ret;\n }",
"@Override\n public int hashCode()\n {\n return Objects.hash(getEventVersionId());\n }",
"public void collectPhoneNumbers1(Map<String,Object> VerifiedParents) {\n for (Map.Entry<String, Object> entry : VerifiedParents.entrySet()){\n\n //Get user map\n Map singleUser = (Map) entry.getValue();\n //Get phone field and append to list\n phoneNumbers.add((String) singleUser.get(\"email\"));\n }\n// Toast.makeText(getApplicationContext(), \"It is running\",\n// Toast.LENGTH_SHORT).show();\n\n }",
"public int[] getIDs(){\r\n\t\tint[] id = new int[Config.MAX_CLIENTS];\r\n\t\tfor(int i=0; i< Config.MAX_CLIENTS;i++){\r\n\t\t\tid[i] = clients[i].getID();\r\n\t\t}\r\n\t\treturn id;\r\n\t}",
"public int hashCode()\n {\n return 37 * 17 + this.EAS_event_ID;\n }",
"public ArrayList<String> intDayToEventIDs(int day){\n ArrayList<String> events = new ArrayList<>();\n for(Event event: this.eventList){\n if(event.getStartTime().getDayOfMonth() == day){\n events.add(event.getEventId());\n }\n }\n return events;\n }",
"public Collection<SapEvent> getEvents(final SessionContext ctx)\n\t{\n\t\treturn EVENTSHANDLER.getValues( ctx, this );\n\t}",
"public Map<String, Object> getPrimaryKey() {\n Map<String, Object> ret = new LinkedHashMap<String, Object>(6);\n ret.put(\"btrAudUid\", getBtrAudUid());\n return ret;\n }",
"@Override\n public KimbleClient[] clientStartInfo() {\n return clients;\n }",
"protected Map createAttachmentsMap() {\n return new HashMap();\n }",
"@Override\n\t\tpublic int hashCode()\n\t\t{\n\t\t\treturn absorber.getObjectId();\n\t\t}",
"public Map<String, Cliente> getClientes() {\n\t\treturn clientes;\n\t}",
"private HashMap<String,String> toMap(EventType eventType,int eventCapacity,String eventID,\n LocalDateTime startTime,LocalDateTime endTime,String roomID,\n List<String> speakerIDs, List<String> attendeeIDs){\n HashMap<String,String> map = new HashMap<>();\n map.put(\"eventType\",eventType.toString());\n map.put(\"eventCapacity\",Integer.toString(eventCapacity));\n map.put(\"eventID\",eventID);\n map.put(\"startTime\", startTime.format(format));\n map.put(\"endTime\",endTime.format(format));\n map.put(\"roomID\",roomID);\n if(attendeeIDs.size()!=0){\n map.put(\"attendeeIDs\",toString(attendeeIDs));\n } else{\n map.put(\"attendeeIDs\",\"\");\n }\n if(speakerIDs.size()!=0){\n map.put(\"speakerIDs\",toString(speakerIDs));\n } else{\n map.put(\"speakerIDs\",\"\");\n }\n return map;\n }",
"Map getIDPEXDataMap();",
"public Map<String, Object> getPrimaryKey() {\n Map<String, Object> ret = new LinkedHashMap<String, Object>(6);\n ret.put(\"masp\", getMasp());\n return ret;\n }",
"public Map<String, Object> getPrimaryKey() {\r\n Map<String, Object> ret = new LinkedHashMap<String, Object>(6);\r\n ret.put(\"idContacto\", Integer.valueOf(getIdContacto()));\r\n return ret;\r\n }",
"private List<EventInfo> map(List<EventLog> entries) {\n List<EventInfo> events = new ArrayList<>();\n for (EventLog entry : entries) {\n events.add(map(entry));\n }\n return events;\n }",
"@Override\n\t\t\tpublic void onGetBookIdsStart() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\t\tpublic void onGetBookIdsStart() {\n\t\t\t\t\t\n\t\t\t\t}",
"@Override\n\t\t\t\tpublic void onGetBookIdsStart() {\n\t\t\t\t\t\n\t\t\t\t}",
"@Override\r\n public Set<String> getObjectIdList() throws HarvesterException {\r\n Set<String> objectIdList = new HashSet<String>();\r\n try {\r\n String[] row = null;\r\n int rowCount = 0;\r\n boolean done = false;\r\n while (!done && (row = csvReader.readNext()) != null) {\r\n rowCount++;\r\n currentRow++;\r\n objectIdList.add(createRecord(row));\r\n if (rowCount % batchSize == 0) {\r\n log.debug(\"Batch size reached at row {}\", currentRow);\r\n break;\r\n }\r\n done = (maxRows > 0) && (currentRow < maxRows);\r\n }\r\n hasMore = (row != null);\r\n } catch (IOException ioe) {\r\n throw new HarvesterException(ioe);\r\n }\r\n if (objectIdList.size() > 0) {\r\n log.debug(\"Created {} objects\", objectIdList.size());\r\n }\r\n return objectIdList;\r\n }",
"public Map<String, Object> getPrimaryKey() {\n Map<String, Object> ret = new LinkedHashMap<String, Object>(6);\n ret.put(\"idacquirente\", Integer.valueOf(getIdacquirente()));\n return ret;\n }",
"public HashMap<Integer, HashMap<String, String>> getXMLMessageDataForCollabFromDB(ArrayList<Integer> interIDs) throws SQLException, NumberFormatException, XPathExpressionException, ParserConfigurationException, SAXException, IOException{\n\t HashMap<Integer, HashMap<String, String>> result = new HashMap();\n\t String query = null;\n\t HashMap<String, String> message;\n\t HashMap<String, ArrayList<String>> messageMap;\n\t \n//\t Select parentEventID,eventID,resourceName,roomName,networkID, buddyName, intemployeeID, containerID, contentType, contentSubType, resourceID, attributes\n\t \n\t String parentEventId;\n\t String eventId;\n\t String roomName;\n\t String networkId;\n\t String buddyName;\n\t String intEmployeeId;\n\t String employeeId = null;\n\t String containerId;\n\t String networkName;\n\t String employeeEmail = null;\n\t \n\t int contentTypeID;\n\t String contentType;\n\t int contentSubTypeID;\n\t String contentSubType = null;\n\t int resourceID;\n\t SQLXML attributes;\n\t int actionID;\n\t String actionType;\n\t ArrayList<String> resources;\n\t String resourceName;\n\t String resourceURL;\n\t String text;\n\t String messageAttributes = null;\n\t HashMap<String, String> msgAttributes = null;\n\t \n//\t stmt = getConnection(dbParams).createStatement();\n\t \n\t DOMSource domSource;\n\t Document document;\n\t XPath xpath = XPathFactory.newInstance().newXPath();\n\t \n\t String expression = \"//name[.='event.action']/following-sibling::*[1][name()='value']\";\n\t \n\t //loop through each interID\n\t for(int interID : interIDs){\n\t \n\t message = new HashMap();\n\t \n\t query = \"Select parentEventID,eventID,roomName,networkID, buddyName, intemployeeID, containerID, contentType, contentSubType, resourceID, attributes from Interactions where interID = \"+interID;\n//\t System.out.println(query);\n\t rs = stmt.executeQuery(query);\n\t rs.next();\n\t parentEventId = rs.getString(1);\n\t eventId = rs.getString(2);\n\t roomName = rs.getString(3);\n\t networkId = rs.getString(4);\n\t buddyName = rs.getString(5);\n\t intEmployeeId = rs.getString(6);\n\t containerId = rs.getString(7);\n\t contentTypeID = rs.getInt(8);\n\t contentSubTypeID = rs.getInt(9);\n\t resourceID = rs.getInt(10);\n\t attributes = rs.getSQLXML(11);\n\t \n\t\t domSource = attributes.getSource(DOMSource.class);\n\t\t document = (Document) domSource.getNode();\n\t\t actionID = Integer.parseInt(xpath.evaluate(expression, document));\n\t\t \n\t\t //Get contentType\n\t\t contentType = getContentType(stmt, contentTypeID);\n\t\t //Get ContentSubType\n\t\t if(contentSubTypeID != -1){\n\t\t \t contentSubType = getContentSubType(stmt, contentSubTypeID);\t \n\t\t }\n\t\t \n\t\t //Get Action Type\n\t\t actionType = getActionType(actionID);\n\t\t //Get Resource Name and URL\n\t\t resources = getResourceNameAndURL(resourceID);\n\t\t resourceName = resources.get(0);\n\t\t resourceURL = resources.get(1);\n//\t\t Get Network Name\n\t\t networkName = getNetworkName(networkId);\n//\t\t Get EmployeeId\n\t\t if(intEmployeeId != null){\n\t\t \t employeeId = getEmployeeId(stmt, intEmployeeId);\n//\t\t\t Get Employee Email\n\t\t\t \n\t\t\t employeeEmail = getEmployeeEmail(stmt, intEmployeeId);\n\t\t\t if(employeeEmail == null){\n\t\t\t \t employeeEmail = buddyName;\n\t\t\t }\n\t\t }\n\t\t \n\n\t\t \n\t\t //Get Message Table data\n\t\t query = \"Select text from Messages where interID = \"+interID;\n//\t\t System.out.println(query);\n\t rs = stmt.executeQuery(query);\n\t rs.next();\n\t text = rs.getString(1).trim().replaceAll(\"\\n\", \"\").replaceAll(\"\\r\", \"\");\n\t\t\t query = \"Select attributes from Messages where interID = \"+interID + \" and attributes is not null\";\n//\t\t\t System.out.println(query);\n\t\t rs = stmt.executeQuery(query);\n\t\t if(rs.next()){\n\t\t \t messageAttributes = rs.getString(1);\n\t\t }\n\t\t \t \n\t msgAttributes = new HashMap();\n\t //Get Attribute Names and Values\n\t\t if(messageAttributes != null){\n\t\t \t \n\t\t \t msgAttributes = getMessageAttributes(messageAttributes); \t \n\t\t }\n\t \n\t \n\t //Add all the values\n\t message.put(\"parentEventID\", parentEventId);\n\t message.put(\"eventId\", eventId);\n\t message.put(\"containerId\", containerId);\n\t message.put(\"roomName\", roomName);\n\t message.put(\"buddyName\", buddyName);\n\t message.put(\"networkID\", networkId);\n\t message.put(\"networkName\", networkName);\n\t message.put(\"employeeId\", employeeId);\n\t message.put(\"employeeEmail\", employeeEmail);\n\t message.put(\"intEmployeeID\", intEmployeeId);\n\t message.put(\"Content type\", contentType);\n\t if(contentSubTypeID != 0){\n\t \t message.put(\"Content sub-type\", contentSubType); \n\t }\n\t \n\t message.put(\"Action\", actionType);\n\t message.put(\"Resource name\", resourceName);\n\t message.put(\"Resource URL\", resourceURL);\n\t message.put(\"Text\", text);\n\t if(msgAttributes.size() > 0){\n\t \t message.putAll(msgAttributes); \n\t }\n\t \n//\t for(String attName : msgAttributes.keySet()){\n//\t message.put(attName, msgAttributes.get(attName));\n//\t }\n\n\t ArrayList<String> fileNames = getFileListsForCollab(interID);\n\t StringBuffer fileName = new StringBuffer();\n\t if(fileNames.size() > 0){\n\t \t for(int i = 0 ; i < fileNames.size(); i++){\n\t \t\t fileName.append(fileNames.get(i));\n\t \t\t if(i + 1 != fileNames.size()){\n\t \t\t\t fileName.append(\"#\");\n\t \t\t }\n\t \t }\n\t \t message.put(\"File\", fileName.toString());\n\t }\n\t \n\t result.put(interID, message);\n\t }\n\t \n\t return result;\n\t }",
"protected void buildHashMapForAssociationClasses(Package pack)\n {\n\n for (Iterator elementIter = pack.GetElements().iterator();elementIter.hasNext();)\n {\n Element element = (Element)elementIter.next();\n // Check the validity of the class\n checkElement(element);\n\n /////////////////////////////////\n // A numeric subtype qualifies the Type of the main element. For Class: 1 = Parameterised, 2 = Instantiated, 3 = Both, 0 = Neither, 17 = Association Class\n // If 17, because an Association Class has been created through the user interface, MiscData(3) will contain the ID of the related Association.\n // http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/element2.htm\n /////////////////////////////////\n if(element.GetSubtype() == 17)\n {\n _hashMapForAssociationClasses.put(EAConnection.getInstance().getRepository().GetConnectorByID(Integer.parseInt(element.MiscData(3))).GetConnectorGUID(), element.GetElementGUID());\n }\n }\n for (Iterator packageIter = pack.GetPackages().iterator();packageIter.hasNext();)\n {\n Package subPackage = (Package)packageIter.next();\n buildHashMapForAssociationClasses(subPackage);\n }\n }",
"public Collection getPersistedObjectIds() {\n if (_payload != PAYLOAD_OIDS_WITH_ADDS) {\n if (_payload == PAYLOAD_OIDS)\n throw new UserException(s_loc.get(\"no-added-oids\"));\n throw new UserException(s_loc.get(\"extent-only-event\"));\n }\n return (_addIds == null) ? Collections.EMPTY_LIST : _addIds;\n }",
"private void processData(Set<String> ids) {\n\t\tlog.debug(\"Starting processData\");\n\t\ttry (EventDao eventDao = new EventDao(connection)) {\n\t\t\tfor (String id : ids) {\n\t\t\t\tLogEvent startEvent = startedMap.get(id);\n\t\t\t\tLogEvent finishEvent = finishedMap.get(id);\n\t\t\t\tif (startEvent != null && finishEvent != null) {\n\t\t\t\t\tlog.debug(\"Calling converter for id {} \", id);\n\t\t\t\t\tEvent event = eventConverter.EventDTOToEvent(startEvent, finishEvent);\n\t\t\t\t\tlog.debug(\"Conversion complete, saving data\");\n\t\t\t\t\teventDao.save(event);\n\t\t\t\t\tlog.debug(\"Save Complete\");\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"Failure processing event {}\", id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public HashMap<Integer, User> process(List<User> list) {\n HashMap<Integer, User> listMap = new HashMap<>();\n Iterator<User> iterator = list.iterator();\n while (iterator.hasNext()) {\n User temp = iterator.next();\n if (temp != null) {\n listMap.put(temp.getId(), temp);\n }\n }\n return listMap;\n }",
"private static Map<String, Integer> getSourceMap() {\n\t\tList<Source> sources = SourceService.findAll();\n\t\tMap<String, Integer> sourceMap = new HashMap<String, Integer>();\n\t\t\n\t\tfor (Source source : sources) {\n\t\t\tsourceMap.put(source.getDomain(), source.getId());\n\t\t}\n\t\t\n\t\treturn sourceMap;\n\t}",
"public Map<String, Object> getPrimaryKey() {\n Map<String, Object> ret = new LinkedHashMap<String, Object>(6);\n ret.put(\"regItemUid\", getRegItemUid());\n return ret;\n }",
"public Map<ComponentId, CHILD> getComponentMap() {\n return Collections.unmodifiableMap(producerById);\n }",
"public Map<String,String> getMapaAsociaciones(){\r\n\r\n\t\treturn mapaClientes;\r\n\t}",
"private AeRegistration() {\n\t\tnotifications = new HashMap<String, List<JSONObject>>();\n\t\tsubscriptions = new HashMap<String,String>();\n\t\tsubscribedToResourcesSet = new HashMap<String,String>();\n\t\tsubscriptionsPerSessions = new HashMap<String, Set<String>>();\n\t}",
"private Map<String, String> m15124a(Map<String, String> map) {\n String str;\n String str2;\n HashMap hashMap = new HashMap();\n if (map != null) {\n for (Entry entry : map.entrySet()) {\n Object key = entry.getKey();\n Object value = entry.getValue();\n if (!(key instanceof String) || !(value instanceof String)) {\n C7262l b = this.f13489a.mo23049b();\n StringBuilder sb = new StringBuilder();\n sb.append(\"Unexpected class type in trackEvent(); all keys and values passed as parameters must be String. Encountered \");\n sb.append(key.getClass().getCanonicalName());\n sb.append(\"/\");\n sb.append(value.getClass().getCanonicalName());\n sb.append(\"; will use toString() value instead, which may be unexpected...\");\n b.mo22913a(\"EventServiceImpl\", sb.toString());\n str = key.toString();\n str2 = value.toString();\n } else {\n str = (String) key;\n str2 = (String) value;\n }\n hashMap.put(str, str2);\n }\n }\n return hashMap;\n }",
"static Map<String, Handlers> getIntentMap()\n\t{\n\t\tMap<String, Handlers> h_map = new HashMap<>();\n\t\t\n\t\t\n\t\th_map.put (ADDRESS_ADD , Handlers.NODE_CREATE);\n\t\th_map.put (ADDRESS_ASSOCIATE , Handlers.LINK_CREATE);\n\t\th_map.put (ADDRESS_DELETE , Handlers.NODE_DELETE);\n\t\th_map.put (EVENT_ADD , Handlers.NODE_CREATE_AND_LINK);\n\t\th_map.put (EVENT_DELETE , Handlers.NODE_DELETE);\n\t\th_map.put (GROUP_ADD , Handlers.NODE_CREATE);\n\t\th_map.put (GROUP_DELETE , Handlers.NODE_DELETE);\n\t\th_map.put (GROUP_MEMBER_ADD , Handlers.LINK_CREATE);\n\t\th_map.put (GROUP_MEMBER_DELETE, Handlers.LINK_DELETE);\n\t\th_map.put (PERSON_ADD , Handlers.NODE_CREATE);\n\t\th_map.put (PERSON_DELETE , Handlers.NODE_DELETE);\n\t\th_map.put (SUBSCRIPTION_ADD , Handlers.NODE_CREATE_AND_MULTILINK);\n\t\th_map.put (SUBSCRIPTION_DELETE, Handlers.NODE_DELETE);\n\t\th_map.put (USER_DELETE , Handlers.NODE_DELETE);\n\t\th_map.put (USER_REGISTER , Handlers.REGISTER_USER);\n\n\t\treturn h_map;\n\t}",
"@Override\n\tpublic Map<String, Object> readHitos(int id) {\n\t\treturn hitosDao.readHitos(id);\n\t}",
"private HashMap<String,String> createQueryMap() {\n\t\t\n\t\tHashMap<String, String> map = new HashMap<String, String>();\n\t\t\n\t\t// Only include Pages with the CenterNet Event template\n\t\tmap.put(\"type\",\"cq:Page\");\n\t\tmap.put(\"path\", Constants.EVENTS);\n\t\tmap.put(\"property\",\"jcr:content/cq:template\");\n\t map.put(\"property.value\", Constants.EVENT_TEMPLATE);\n\n\t if (tags != null) {\n\t \tmap = addTagFilter(map);\n\t }\n\n\t // Only include Events whose start time is in the future\n\t map.put(\"relativedaterange.property\", PN_QUERY_START_TIME);\n\t map.put(\"relativedaterange.lowerBound\", \"-0d\");\n\t \n\t // Include all hits\n\t //map.put(\"p.limit\", maxNum.toString());\n\t map.put(\"p.limit\", maxNum);\n\t map.put(\"p.guessTotal\", \"true\");\n\t \n\t // Order by Start Time\n\t map.put(\"orderby\", PN_QUERY_START_TIME);\n\t map.put(\"orderby.sort\", \"asc\");\n\t \n\t\treturn map;\n\t\t\n\t}",
"private Map<String, Object> getSubServiceMap() {\n\t\tlog.info(\"*****Inside getSubservice method **\");\n\t\tMap<String, Object> serviceMap = null;\n\n\t\ttry {\n\n\t\t\tserviceMap = new HashMap<String, Object>();\n\t\t\tserviceMap.put(ResourceResolverFactory.SUBSERVICE, \"sam\");\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t\tStringWriter errors = new StringWriter();\n\t\t\te.printStackTrace(new PrintWriter(errors));\n\t\t\tlog.info(\"errors ***\" + errors.toString());\n\t\t}\n\t\tlog.info(\"*****getSubservice Method End**\");\n\t\t\n\t\treturn serviceMap;\n\n\t}",
"private static Map<String, Integer> assignVertexIds(DAG dag) {\n Map<String, Integer> vertexIdMap = new LinkedHashMap<>();\n final int[] vertexId = {0};\n dag.forEach(v -> vertexIdMap.put(v.getName(), vertexId[0]++));\n return vertexIdMap;\n }",
"void storeEvents()\n {\n this.storedPresences = new ArrayList<Presence>();\n this.storeEvents = true;\n }",
"public void getDisasterMaps( List<String> idList, AsyncHttpResponseHandler handler ) {\n String apiURL = \"\";\n \n for ( String id : idList ) {\n apiURL = String.format(DETAILS_URL, id);\n // Log.d(\"DEBUG\", \"Making 2nd call to \" + apiURL );\n client.get(apiURL, handler);\n }\n \n }",
"public Map<EventKey, EventMethod> createEventMap() {\n\t\tfinal Map<EventKey, EventMethod> eventMap = new EnumMap<>(EventKey.class);\n\t\tfinal Pair<Map<String, Object>, Set<Class<?>>> eventPair = prepareEventPair();\n\n\t\tfor (Class<?> eventClass : eventPair.getSecond()) {\n\t\t\tfor (Method eventMethod : prepareEventMethods(eventClass)) {\n\t\t\t\teventMap.put(eventMethod.getAnnotation(EventMapping.class).key(),\n\t\t\t\t\t\tnew EventMethod(eventPair.getFirst().get(eventClass.getName()), eventMethod));\n\t\t\t}\n\t\t}\n\t\treturn eventMap;\n\t}",
"public HashMap<Integer, User> process(List<User> list) {\n HashMap<Integer, User> map = new HashMap<>();\n for (User user : list) {\n int userId = user.getId();\n map.putIfAbsent(userId, user);\n }\n return map;\n }",
"@JsonProperty(\"events\")\n\t@DsonOutput(Output.API)\n\tMap<String, Object> getJsonEvents() {\n\t\tSystemMetaData smd = SystemMetaData.getInstance();\n\n\t\tMap<String, Object> processed = mapOf(\n\t\t\t\"synchronous\", smd.get(\"events.processed.synchronous\", 0L),\n\t\t\t\"asynchronous\", smd.get(\"events.processed.asynchronous\", 0L)\n\t\t);\n\n\t\treturn mapOf(\n\t\t\t\"processed\", processed,\n\t\t\t\"processing\", smd.get(\"events.processing\", 0L),\n\t\t\t\"broadcast\", smd.get(\"events.broadcast\", 0L),\n\t\t\t\"queued\", smd.get(\"events.queued\", 0L),\n\t\t\t\"dequeued\", smd.get(\"events.dequeued\", 0L)\n\t\t);\n\t}",
"private void fetchAllEvents() {\n progressDialog.show();\n StringRequest stringRequest = new StringRequest(Request.Method.GET,\n Constants.URL_ALL_EVENTS,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n try {\n progressDialog.dismiss();\n\n // response is a JSONArray\n JSONArray jArray = new JSONArray(response);\n\n // extracting JSONObjects from each element of JSONArray\n for (int i = 0; i < jArray.length(); i++) {\n JSONObject jb = jArray.getJSONObject(i);\n int id = jb.getInt(\"id\");\n String name = jb.getString(\"name\");\n String venue = jb.getString(\"venue\");\n String event_date = jb.getString(\"event_date\");\n String reg_deadline = jb.getString(\"reg_deadline\");\n String description = jb.getString(\"description\");\n int organizer_id = jb.getInt(\"organizer_id\");\n\n // creating a new Event object\n Event event = new Event(id, name, venue, event_date,\n reg_deadline, description, organizer_id);\n\n // add object to the array list\n arrayList.add(event);\n // notifying the adapter for the change\n adapter.notifyDataSetChanged();\n\n }\n } catch (JSONException e) {\n Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_LONG).show();\n e.printStackTrace();\n }\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.hide();\n Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_LONG).show();\n }\n }) {\n\n };\n RequestHandler.getInstance(this).addToRequestQueue(stringRequest);\n }",
"private HashMap<String,String> listToMap(List<List<String>> nestedList){\n HashMap<String,String> map=new HashMap<>();\n map.put(\"eventType\",nestedList.get(0).get(0));\n map.put(\"eventCapacity\",nestedList.get(1).get(0));\n map.put(\"eventID\",nestedList.get(2).get(0));\n map.put(\"startTime\",nestedList.get(3).get(0));\n map.put(\"endTime\",nestedList.get(4).get(0));\n map.put(\"roomID\",nestedList.get(5).get(0));\n map.put(\"speakerIDs\",toString(nestedList.get(6)));\n map.put(\"attendeeIDs\",toString(nestedList.get(7)));\n return map;\n }",
"public static void eventList() {\n\t\tfor (Map.Entry<Calendar, TreeSet<Event>> entry : calendarToEvent.entrySet()) {\n\t\t\tTreeSet<Event> value = entry.getValue();\n\t\t\tfor (Event e: value) {\n\t\t\t\tSystem.out.println(e.toString());\n\t\t\t}\n\t\t}\n\t}",
"public static Map<Integer,Employee1> getEmployeeList(){\r\n\t return employees;\r\n\t \r\n }",
"void onContainerStarted(ContainerId containerId,\n Map<String, ByteBuffer> allServiceResponse);",
"public Map<String, Object> toMap() {\n Map<String, Object> map = new HashMap<>();\n map.put(\"message\", message);\n map.put(\"senderID\", senderID);\n map.put(\"time\", time);\n return map;\n }",
"private void createEvents()\r\n\t{\r\n\t\teventsCount.add(new Event(RequestMethod.PUT, 0));\r\n\t\teventsCount.add(new Event(RequestMethod.GET, 0));\r\n\t\teventsCount.add(new Event(RequestMethod.POST, 0));\r\n\t}",
"private Map<String, Object> enrich(StreamlineEvent event) {\r\n\r\n\r\n Map<String, Object> enrichedValues = new HashMap<String, Object>();\r\n\r\n StrSubstitutor strSub = new StrSubstitutor(event);\r\n\r\n String enrichSQLToExecute = strSub.replace(this.enrichmentSQLStatement);\r\n ResultSet rst = null;\r\n Statement statement = null;\r\n try {\r\n\r\n LOG.info(\"The SQL with substitued fields to be executed is: \"\r\n + enrichSQLToExecute);\r\n\r\n statement = sqlServerConnection.createStatement();\r\n rst = statement.executeQuery(enrichSQLToExecute);\r\n\r\n if (rst.next()) {\r\n int columnCount = rst.getMetaData().getColumnCount();\r\n for (int i = 1, count=0; i <= columnCount; i++) {\r\n enrichedValues.put(enrichedOutPutFields[count++],\r\n Strings.nullToEmpty(rst.getString(i)));\r\n }\r\n } else {\r\n String errorMsg = \"No results found for enrichment query: \"\r\n + enrichSQLToExecute;\r\n LOG.error(errorMsg);\r\n throw new RuntimeException(errorMsg);\r\n }\r\n } catch (SQLException e) {\r\n String errorMsg = \"Error enriching event[\" + event\r\n + \"] with enrichment sql[\" + this.enrichmentSQLStatement + \"]\";\r\n LOG.error(errorMsg, e);\r\n throw new RuntimeException(errorMsg, e);\r\n\r\n } finally {\r\n DbUtils.closeQuietly(rst);\r\n DbUtils.closeQuietly(statement);\r\n\r\n }\r\n\r\n return enrichedValues;\r\n }",
"@Override\n \t\tprotected void setup(Context context){\n \t\t\tint port = 5701 + context.getTaskAttemptID().getId()%numInstances;\n \t\t\t//System.out.println(\"Connecting to port \" + port);\n \t\t\tClientConfig clientConfig = new ClientConfig();\n \t\t\tclientConfig.addAddress(\"127.0.0.1:\" + port);\n \t\t\tthis.client = HazelcastClient.newHazelcastClient(clientConfig);\n \t\t\tthis.map = client.getMap(\"kmer\");\n \t\t}",
"public static Map<String, Map<String, String>> getSessionIds(String pmaControlURL, String pmaCoreSessionID) {\n\t\tJSONArray fullSessions = getSessions(pmaControlURL, pmaCoreSessionID);\n\t\tMap<String, Map<String, String>> newSession = new HashMap<>();\n\t\tfor (int i = 0; i < fullSessions.length(); i++) {\n\t\t\tMap<String, String> sessData = new HashMap<String, String>();\n\t\t\ttry {\n\t\t\t\tsessData.put(\"LogoPath\", fullSessions.getJSONObject(i).getString(\"LogoPath\"));\n\t\t\t\tsessData.put(\"StartsOn\", fullSessions.getJSONObject(i).getString(\"StartsOn\"));\n\t\t\t\tsessData.put(\"EndsOn\", fullSessions.getJSONObject(i).getString(\"EndsOn\"));\n\t\t\t\tsessData.put(\"ModuleId\", fullSessions.getJSONObject(i).getString(\"ModuleId\"));\n\t\t\t\tsessData.put(\"State\", fullSessions.getJSONObject(i).getString(\"State\"));\n\t\t\t\tnewSession.put(fullSessions.getJSONObject(i).getString(\"Id\"), sessData);\n\t\t\t} catch (JSONException e) {\n\t\t\t\t// ignore\n\t\t\t}\n\t\t}\n\t\treturn newSession;\n\t}",
"public abstract void setEvents(Map<String, Event> events);",
"@Override\n public void onApplicationEvent(HeartbeatEvent event) {\n\n final Collection<String> discoveryUrls = config.getServiceUrl().values();\n\n logger.info(\"discovery URLS\" + discoveryUrls);\n\n int serverCount = 0;\n String defaultZone = \"\";\n\n for (final String discoveryUrl : discoveryUrls) {\n defaultZone += (serverCount > 0 ? (\",\" + discoveryUrl) : discoveryUrl);\n serverCount++;\n if (serverCount == DISCOVERY_SERVER_URL_MAX_COUNT) {\n break;\n }\n }\n\n config.getServiceUrl().put(DISCOVERY_CLIENT_ZONE, defaultZone);\n\n }",
"public static Map appointments(String _response) throws JSONException {\r\n JSONObject obj = new JSONObject(_response);\r\n JSONArray info = obj.getJSONArray(\"appointments\");\r\n /*String apptData = null;\r\n for (int i = 0; i < info.length(); i++) {\r\n JSONObject appointment = info.getJSONObject(i);\r\n apptData = appointment.getString(\"id\");\r\n System.out.println(\"Appointment Id: \" + apptData);\r\n apptData = appointment.getString(\"title\");\r\n System.out.println(\"title: \" + apptData);\r\n apptData = appointment.getString(\"created\");\r\n System.out.println(\"created: \" + apptData);\r\n apptData = appointment.getString(\"start\");\r\n System.out.println(\"start: \" + apptData);\r\n apptData = appointment.getString(\"end\");\r\n System.out.println(\"end: \" + apptData);\r\n apptData = appointment.getString(\"note\");\r\n System.out.println(\"note: \" + apptData);\r\n System.out.println(\" \");\r\n\r\n }*/\r\n\r\n Map<String, String> apptData = new HashMap<>();\r\n for (int i = 0; i < info.length(); i++) {\r\n JSONObject appointment = info.getJSONObject(i);\r\n String id = appointment.getString(\"id\");\r\n apptData.put(\"AppointmetnId\", id);\r\n String title = appointment.getString(\"title\");\r\n apptData.put(\"title\", title);\r\n String created = appointment.getString(\"created\");\r\n apptData.put(\"created\", created);\r\n String start = appointment.getString(\"start\");\r\n apptData.put(\"start\", start);\r\n String end = appointment.getString(\"end\");\r\n apptData.put(\"end\", end);\r\n String note = appointment.getString(\"note\");\r\n apptData.put(\"note\", note);\r\n\r\n }\r\n return apptData;\r\n\r\n }",
"public java.util.Map<java.lang.String, java.lang.String> getAppClientParas() {\n return internalGetAppClientParas().getMap();\n }",
"public void transmitEvents(){\n Log.info(\"Transmitting Events\", EventShare.class);\n for(Entry<Class, List<EventTrigger>> eventGroup: HandlerRegistry.getHandlers().entrySet()){\n String annotation = eventGroup.getKey().getName();\n for(EventTrigger trigger : eventGroup.getValue()){\n if(trigger.getServer()!=this) { // do not send own events...\n if(trigger.getMethod()!=null){ // its a local event\n if(trigger.getMethod().isAnnotationPresent(ES.class)){\n try {\n eventBusServer.write(new ESSharedEvent(annotation, trigger.getTrigger()));\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }else {\n try {\n eventBusServer.write(new ESSharedEvent(annotation, trigger.getTrigger()));\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n }\n }\n }",
"@SuppressWarnings({ \"unchecked\" })\r\n\tpublic static Map<Class, Integer> getPacketToID() {\n\t\tif (packetToID == null) {\r\n\t\t\ttry {\r\n\t\t\t\tField packetsField = FuzzyReflection.fromClass(Packet.class, true).getFieldByType(\"java\\\\.util\\\\.Map\");\r\n\t\t\t\tpacketToID = (Map<Class, Integer>) FieldUtils.readStaticField(packetsField, true);\r\n\t\t\t\t\r\n\t\t\t} catch (IllegalAccessException e) {\r\n\t\t\t\tthrow new RuntimeException(\"Unable to retrieve the packetClassToIdMap\", e);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn packetToID;\r\n\t}",
"public void clearEvents()\n {\n ClientListener.INSTANCE.clear();\n BackingMapListener.INSTANCE.clear();\n }",
"public ArrayList<Client> parseClients(HashMap<String, ArrayList<String>> clientInfo) {\r\n ArrayList<Client> clients = new ArrayList<Client>();\r\n // Create Client with the content in each row and add it to the ArrayList\r\n // clients\r\n for (int i = 0; i < clientInfo.get(\"email\").size(); i++) {\r\n clients\r\n .add(new Client(clientInfo.get(\"email\").get(i), clientInfo.get(\"personalAddress\").get(i),\r\n clientInfo.get(\"creditCardNumber\").get(i), clientInfo.get(\"expiry\").get(i),\r\n clientInfo.get(\"firstName\").get(i), clientInfo.get(\"lastName\").get(i)));\r\n }\r\n return clients;\r\n }",
"public Map<String, Object> toMetadataHash() {\n\t\tMap<String, Object> hash = new LinkedHashMap<String, Object>();\n\t\thash.put(\"environment\", appService.getEnvironment());\n\t\thash.put(\"app\", appService.toMetadataHash());\n\t\thash.put(\"api\", apiService.toMetadataHash());\n\t\thash.put(\"sso\", ssoService.toMetadataHash());\n\t\thash.put(\"connec\", connecService.toMetadataHash());\n\t\thash.put(\"webhook\", webhookService.toMetadataHash());\n\n\t\treturn hash;\n\t}",
"@Override\n public void run() {\n FirebaseFirestore.getInstance().collection(\"users/\" + companyID + \"/trips\")\n .addSnapshotListener(new EventListener<QuerySnapshot>() {\n @Override\n public void onEvent(@Nullable QuerySnapshot value, @Nullable FirebaseFirestoreException e) {\n if (e != null) {\n Log.w(TAG, \"Listen failed.\", e);\n return;\n }\n tripList.clear();//clear the ArrayList, because this method get all the document id instead of\n //the one that just created\n for (QueryDocumentSnapshot doc : value) {\n if (doc.getId() != null) {\n tripList.add(doc.getId());//store the document IDs to ArrayList\n\n Log.d(TAG, \"Retrieved data: \" + doc.getId());\n }\n }\n showTripList();//show trip name to listView\n }\n });\n }",
"public java.util.Map<java.lang.String, java.lang.String> getAppClientParas() {\n return internalGetAppClientParas().getMap();\n }",
"@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Client)) {\r\n return false;\r\n }\r\n Client other = (Client) object;\r\n if ((this.idclient == null && other.idclient != null) || (this.idclient != null && !this.idclient.equals(other.idclient))) {\r\n return false;\r\n }\r\n return true;\r\n }",
"protected Map<E, ListenerEntry<? extends E>> createMap() {\n\t\treturn new WeakHashMap<>();\n\t}",
"@RequestMapping(value = \"/discovery-client/instances\", method = RequestMethod.GET)\n public Map<String, Integer> getAllInstances() {\n final Map<String, Integer> response = new HashMap<>();\n\n final Applications applications = discoveryClient.getApplications();\n final List<Application> applicationList = applications.getRegisteredApplications();\n\n //TODO Java 8 Stream\n // Get instances from eureka\n for (final Application app : applicationList) {\n response.put(app.getName(), app.getInstances().size());\n }\n\n return response;\n }",
"public abstract java.util.Map<java.lang.String, java.lang.Integer> systemicEventIncidenceCountMap();",
"@Override\n public void actionPerformed(NetworkEvent evt) {\n JSONParser jsonp = new JSONParser();\n \n try {\n //renvoi une map avec clé = root et valeur le reste\n Map<String, Object> tasks = jsonp.parseJSON(new CharArrayReader(new String(con.getResponseData()).toCharArray()));\n System.out.println(\"rooot:\" +tasks.get(\"root\"));\n\n List<Map<String, Object>> list = (List<Map<String, Object>>) tasks.get(\"root\");\n \n \n\n\n for (Map<String, Object> obj : list) {\n \n \n Evenement event = new Evenement();\n \n int id = Integer.parseInt(obj.get(\"idEvt\").toString());\n int nbp = Integer.parseInt(obj.get(\"nb_place\").toString());\n int nbpp = Integer.parseInt(obj.get(\"nbParticipants\").toString());\n SimpleDateFormat format= new SimpleDateFormat(\"yyyy/MM/dd\");\n Date dateDb= format.parse(obj.get(\"dateDebut\").toString());\n System.out.println(dateDb);\n Date dateF= format.parse(obj.get(\"dateFin\").toString());\n System.out.println(dateF);\n \n event.setIdEvt(id);\n event.setCinUser(obj.get(\"cin\").toString());\n event.setLieu(obj.get(\"lieu\").toString());\n event.setDateDebut(dateDb);\n event.setDateFin(dateF);\n event.setType(obj.get(\"type\").toString());\n event.setTitre(obj.get(\"titre\").toString());\n event.setDescription(obj.get(\"description\").toString());\n event.setImageEvt(obj.get(\"image_evt\").toString());\n event.setNbPlace(nbp);\n event.setNbParticipants(nbpp);\n \n\n \n \n listTasks.add(event);\n\n }\n } catch (IOException ex) {\n } catch (ParseException ex) {\n System.out.println(ex.getMessage());\n \n }\n\n }"
] | [
"0.6147382",
"0.55996937",
"0.5458974",
"0.54518926",
"0.53888226",
"0.535826",
"0.53511894",
"0.5281494",
"0.52389556",
"0.5103385",
"0.5057628",
"0.50544417",
"0.5021554",
"0.4981929",
"0.49318543",
"0.49155092",
"0.4906772",
"0.48980096",
"0.4874697",
"0.48676163",
"0.4861786",
"0.48396218",
"0.4829509",
"0.4807532",
"0.48020503",
"0.47952384",
"0.47793403",
"0.4775245",
"0.47708076",
"0.4767926",
"0.47589776",
"0.47522065",
"0.4735475",
"0.47076637",
"0.47049072",
"0.46983165",
"0.46962106",
"0.46951202",
"0.4689797",
"0.4679373",
"0.46774018",
"0.46769035",
"0.46672824",
"0.46438646",
"0.46238115",
"0.46230587",
"0.46170846",
"0.46129405",
"0.46129242",
"0.45735416",
"0.45735416",
"0.45652995",
"0.45557606",
"0.4555481",
"0.45552897",
"0.4553562",
"0.4549335",
"0.45450455",
"0.45242488",
"0.452199",
"0.45210162",
"0.4520839",
"0.45186222",
"0.45133543",
"0.4511976",
"0.45028698",
"0.44970724",
"0.44888878",
"0.44871467",
"0.44838107",
"0.44787052",
"0.4477744",
"0.4471128",
"0.44690308",
"0.4463969",
"0.4457963",
"0.4453963",
"0.44502348",
"0.444933",
"0.4446193",
"0.44391862",
"0.44329673",
"0.44253162",
"0.44242626",
"0.44237366",
"0.44218856",
"0.4420609",
"0.4419795",
"0.44174767",
"0.4415582",
"0.44155252",
"0.44142643",
"0.44140998",
"0.44093257",
"0.44070566",
"0.44058615",
"0.44044277",
"0.44015482",
"0.43985358",
"0.4396285"
] | 0.6564211 | 0 |
Calculate the average rate for a time period Pseudo Code 1. Get the array of rates for a resource 2. Add the rates and get the average value 3. Return the average rate. | private Double calculateRate(TSDBData tsdbData) {
logger.trace("BEGIN Double calculateRate(TSDBData tsdbData)");
int rateIndex;
int rateDataPoints;
Double rate = 0.0;
ArrayList dataPointsArray;
rateIndex = tsdbData.getColumns().indexOf("rate");
rateDataPoints = tsdbData.getPoints().size();
for (int i = 0; i < tsdbData.getPoints().size(); i++) {
dataPointsArray = tsdbData.getPoints().get(i);
rate = rate + Double.parseDouble(dataPointsArray.get(rateIndex) + "");
}
logger.trace("DATA Double calculateRate(TSDBData tsdbData): rate=" + rate);
rate = rate / tsdbData.getPoints().size();
logger.trace("END Double calculateRate(TSDBData tsdbData)");
return rate;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void calculateRates() {\n if (rateOutput == null || !outputs.containsKey(rateOutput)) throw new RuntimeException(\"Insufficient data to calculate recipe rates\");\n recipesPerMinute = productionRate / outputs.get(rateOutput);\n\n for (String resource : inputs.keySet()) {\n ratesPerMinute.put(resource,-1.0 * recipesPerMinute * inputs.get(resource));\n }\n for (String resource: outputs.keySet()) {\n ratesPerMinute.put(resource, recipesPerMinute * outputs.get(resource));\n }\n }",
"double getRate();",
"public double getAvg(){\n double avg=0;\n for(int x=0; x<max; x++){\n avg=avg+times[x];\n }\n avg=avg/max;\n return avg;\n }",
"public double getRate() {\r\n\t\treturn (getRate(0)+getRate(1))/2.0;\r\n\t}",
"private double getDynamicRate(String resourceName) {\n logger.trace(\"BEGIN double getDynamicRate(String resourceName)\");\n double rate;\n RateEngineResponse response;\n RuleEngineClient client = new RuleEngineClient();\n\n response = client.getRate(resourceName);\n rate = response.getRate();\n //System.out.println(\"Got the response from rule engine. Rate: \" + response.getRate());\n logger.trace(\"END double getDynamicRate(String resourceName)\");\n return rate;\n }",
"public double getAverageRate() {\n return (leftEnc.getRate() + rightEnc.getRate()) / 2;\n }",
"public Rate rate() {\n _initialize();\n return rate;\n }",
"public static double cal(final int ratePerHrs, final int totalHrs){\n\tfinal double cal= ratePerHrs*totalHrs;\n\treturn cal;\n}",
"public static void computeAvg(functionRuntimes fRT)\r\n {\r\n\r\n }",
"public long calulateAverageTime()\r\n {\r\n long sum = 0;\r\n long avgTime = 0;\r\n\r\n //Get the sum of all the times \r\n for(long time : this.listOfTimes)\r\n {\r\n sum += time;\r\n }//end for \r\n\r\n //calculate the average time \r\n if(this.gamesCompleted>0)\r\n avgTime = sum / this.gamesCompleted;\r\n else\r\n avgTime = sum;\r\n\r\n return avgTime;\r\n }",
"private void computeAverageFrequencyDelayValue() {\n\tthis.averageFrequencyDelayValue = value * this.averageDelay;\n }",
"public static void calculateAvg(double[] avgPArr, int itemNum) {\n\n for (int i = 0; i < avgPArr.length; i++)\n avgPArr[i] /= itemNum;\n\n }",
"public double calculateOverallRating() {\n Rating[] ratingArray = this.ratings;\n double sum = 0.0;\n for(int i = 0; i < ratingArray.length; i++) {\n if (ratingArray[i] != null) { // Making sure it has a rating\n sum = sum + ratingArray[i].getScore();\n } else {\n sum = sum + 0.0;\n }\n }\n return sum;\n }",
"public double getAverageUsage() {\n \tif(lastData.size() > 0) {\n\t \tdouble total = 0.0;\n\t \t\n\t \tfor(double data : lastData) {\n\t \t\ttotal += data;\n\t \t}\n\t \t\n \t\tSystem.out.println(\"Current average load (last minute): \" + total / lastData.size());\n\t \t\n\t \treturn total / lastData.size();\n \t} else {\n \t\t// Calculate CPU usage\n \t\tdouble per = 0;\n\t\t\ttry {\n\t\t\t\tper = sigar.getCpuPerc().getCombined();\n\t\t\t} catch (SigarException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n \t\t\n \t\treturn per;\n \t}\n }",
"public double getMean() {\n double timeWeightedSum = 0;\n\n for (int i = 0; i < accumulate.size() - 1; i++) {\n timeWeightedSum += accumulate.get(i).value\n * (accumulate.get(i + 1).timeOfChange\n - accumulate.get(i).timeOfChange);\n\n }\n LOG_HANDLER.logger.finer(\"timeWeightedSum Value: \" + timeWeightedSum\n + \"totalOfQuueueEntries: \" + totalOfQueueEntries);\n return timeWeightedSum / totalOfQueueEntries;\n }",
"public double calculateRate() {\n\t\tdouble rate = 0;\n\t\tfor (int i = 0; i < upgrades.size(); i++) {\n\t\t\trate += upgrades.get(i).getProduction();\n\t\t}\n\t\tbrain.setRate(rate);\n\t\treturn rate;\n\t}",
"public double getRate( ) {\nreturn monthlyInterestRate * 100.0 * MONTHS;\n}",
"private int getMean(int[] times) {\n\n\t\t//Initialise mean and sum to 0\n\t\tint mean = 0;\n\t\tint sum = 0;\n\n\t\t//Loop through all the times\n\t\tfor (int i = 0; i < times.length; i++) {\n\n\t\t\t//Add to the sum\n\t\t\tsum += times[i];\n\t\t}\n\n\t\t//Calculate and return the mean\n\t\tmean = sum/times.length;\n\t\treturn mean;\n\t}",
"public void average(){\n\t\tfor(PlayerWealthDataAccumulator w : _wealthData.values()){\n\t\t\tw.average();\n\t\t}\n\t}",
"public void average() {\n\t\tif (averaged)\n\t\t\tthrow new AssertionError(\"can't average twice!!\");\n\t\t\n\t\tscale = 1.0/(double)t;\n\t\t\n\t\tfor (int i = 0; i < w.length; i++)\n\t\t\tw[i] = (t+1.0)*w[i] - wupdates[i];\n\t\t\n\t\taveraged = true;\n\t\n\t}",
"public Map allRatedAndAverage() {\n begin();\n\n return finalRecs;\n }",
"public double rateOfChange(int periods, int t)\n {\n if(periods>t || periods<1)\n throw new IndexOutOfBoundsException(\"ROC(\" + periods + \") is undefined at time \" + t);\n return 100.0*(x[t] - x[t - periods])/x[t - periods];\n }",
"@Test\n public void firstRatingsIsLate() {\n LocalDateTime firstTime = LocalDateTime.of(2017, Month.JANUARY, 1, 0, 0);\n\n //start with creating tp (proportional)\n // |------|\n TimePeriod tp = new TimePeriod(firstTime.plusHours(0), firstTime.plusHours(7));\n\n\n /**match tp with ratings and chunkEnd so we have (proportional scale)\n * ratings |--o----||\n * tp: |-------|\n *\n */\n ScoreTime rStart = new ScoreTime(firstTime.plusHours(2), 3);\n LocalDateTime chunkEnd = firstTime.plusHours(7); //=> same as tp.end\n\n //this is the method we are testing\n double[] avgscoreAndWeight = RatingTime.calcAvgAndWeight(tp, Arrays.asList(rStart),\n chunkEnd);\n assertEquals(3.0, avgscoreAndWeight[0]);\n\n /* weight should equal durationOfRatingsInScopeOfTp/tp.duration\n timeOfRatingsInScopeOfTp = 5 hours\n tp.duration = 7 hours.\n weight should be 5/7\n */\n\n assertEquals(5. / 7., avgscoreAndWeight[1], 0.01);\n }",
"static double average(double[] data){\n\n // Initializing total placeholder \n double total = 0;\n\n // Traversing data array and adding to total sum\n for (double d : data) {\n total += d;\n }\n\n // Computing average\n double average = (double) total / data.length;\n\n return average;\n }",
"private void PeriodMeanEvaluation () {\n\n float x = 0;\n for(int i = 0; i < 3; i++)\n {\n for(int j = 0; j < numberOfSample; j++)\n {\n x = x + singleFrame[j][i];\n }\n meanOfPeriodCoord[i] = (x/numberOfSample);\n x = 0;\n }\n }",
"@Test\n public void scopeOfRatingsIsCoveringTp() {\n LocalDateTime firstTime = LocalDateTime.of(2017, Month.JANUARY, 1, 0, 0);\n\n //start with creating tp (proportional), a little bit ahead\n // |------|\n TimePeriod tp = new TimePeriod(firstTime.plusHours(1), firstTime.plusHours(8));\n\n\n /**match tp with ratings and chunkEnd so we have (proportional scale)\n * ratings |o---------||\n * tp: |-------|\n *\n */\n ScoreTime rStart = new ScoreTime(firstTime, 6);\n LocalDateTime chunkEnd = firstTime.plusHours(10); //=> several hours after tp.end\n\n //this is the method we are testing\n double[] avgscoreAndWeight = RatingTime.calcAvgAndWeight(tp, Arrays.asList(rStart),\n chunkEnd);\n assertEquals(6.0, avgscoreAndWeight[0]);\n\n /* weight should equal durationOfRatingsInScopeOfTp/tp.duration\n ratingsInScopeOfTp = 7 hours\n tp.duration = 7 hours.\n weight should be 7/7 = 1.0\n */\n\n assertEquals(1.0, avgscoreAndWeight[1], 0.01);\n }",
"public double average(){\r\n\t\t//create variable to hold the values\r\n\t\tdouble average = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < this.data.length; i++){\r\n\t\t\t//add current index\r\n\t\t\taverage += this.data[i];\r\n\t\t\t}\r\n\t\treturn (average/this.data.length);\r\n\t}",
"private double calculatePer(double currentRate, Map<String, String> earningsPerShare) {\n double current = parseToDoubleOrZero(earningsPerShare.get(fundamentalData.getCurrentYear()).replace(\",\", \".\"));\n return currentRate / current;\n }",
"public void averageWith(TimeStampAccumulator t){\n\t\tif(_time != t._time){\n\t\t\tSystem.err.println(\"Error : TimeStampAccumulator times do not match\");\n\t\t}\n\t\tif(t._wealthData.size() == _wealthData.size()){\n\t\t\tfor(PlayerWealthDataAccumulator p : t._wealthData.values()){\n\t\t\t\t_wealthData.get(p.ownerID).averageWith(p);\n\t\t\t}\n\t\t}\n\t}",
"public Double computeAverage(){\n\t\tdouble total = 0; //double used to keep total value of elements in arr to determine average\n\t\t\n\t\tfor(int i = 0; i < arr.length; i++)//loop through array and add the total\n\t\t{\n\t\t\ttotal += arr[i].doubleValue(); //add current value of element in arr to total's value\n\t\t}\n\t\t\n\t\tDouble result = total/arr.length; //returns the average as a Double\n\t\t\n\t\treturn result;\n\t}",
"double average();",
"double calculateRate(Temperature temperature, double Hrxn);",
"public double updatePeriodic()\n {\n double Angle = getRawAngle();\n\n if (FirstCall)\n {\n AngleAverage = Angle;\n }\n\n AngleAverage -= AngleAverage / NumAvgSamples;\n AngleAverage += Angle / NumAvgSamples;\n\n return (AngleAverage);\n }",
"protected double getDataRate() {\n\t\treturn (double) getThroughput() / (double) getElapsedTime();\n\t}",
"List<AverageTicket> getAverageTicket(Company company, ENUM_AVERAGE_PERIOD period, Integer quantity) throws Exception;",
"double average() { // used double b/c I want decimal places\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tsum = sum + array[i];\n\t\t}\n\t\tdouble average = (double) sum / array.length;\n\t\treturn average;\n\n\t}",
"public double getAverage(){\n double total = 0;\n for(double s : scores)total += s;\n return total/scores.length;\n }",
"private void calculateAvg() {\n\t\tDescriptiveStatistics stats = new DescriptiveStatistics();\n\t\tfor (QueryInfo oneQ : this.maxQueries) {\n\t\t\tstats.addValue(oneQ.getGapCount() * oneQ.getFrequency());\n\t\t}\n\t\tthis.avgGain = stats.getMean();\n\t\tthis.medianGain = stats.getPercentile(50);\n\t\tthis.quartiles = stats.getPercentile(75);\n\t}",
"private TSDBData generateStaticRate() {\n //TODO: check if there is generic method to to return rateData\n ArrayList<String> strArr = StringUtil.strArr(\"resource\", \"rate\", \"rate_policy\");\n TSDBData rateData = createPOJOObject(\"rate\", strArr, load.getStaticRate());\n return rateData;\n }",
"double getAvgControl();",
"private double getAvg() {\n\n double sum = 0;\n\n for (Map.Entry<Integer, Double> entry : values.entrySet()) {\n sum += entry.getValue();\n }\n\n if (values.size() > 0) {\n return sum / values.size();\n } else {\n throw new IllegalStateException(\"no values\");\n }\n }",
"private Double getAdjRelativeRate(CurrencyType curr, int asOfDate, int interval) {\n CurrencySnapshot snap = curr.getSnapshotForDate(asOfDate);\n if (snap != null) {\n int snapDate = snap.getDateInt();\n // System.err.println(curr+\" \"+asOfDate+\" \"+interval+\" \"+snap);\n // First look in interval before the date: (T-I .. T]\n if ((DateUtil.incrementDate(asOfDate, 0, 0, -interval) < snapDate) && (snapDate <= asOfDate)) {\n return 1.0 / curr.adjustRateForSplitsInt(snapDate, snap.getRate());\n }\n // Now look in interval after the date: [T .. T+I)\n snap = curr.getSnapshotForDate(asOfDate + interval);\n if ((snap != null)\n && (asOfDate <= snapDate)\n && (snapDate < DateUtil.incrementDate(asOfDate, 0, 0, interval))) {\n return 1.0 / curr.adjustRateForSplitsInt(snapDate, snap.getRate());\n }\n }\n // No rate in interval\n return Double.NaN;\n }",
"public double calcAvg() {\n\t\treturn (double)calcSum() / data.size();\n }",
"public double avgWait()\r\n {\r\n //find the average value in an arraylist\r\n double avgWait = 0;\r\n double sum = servedCustomers.get(0).getwaitTime();\r\n for(int i = 1; i < servedCustomers.size(); i++){\r\n sum += servedCustomers.get(i).getwaitTime();\r\n }\r\n avgWait = sum/servedCustomers.size();\r\n return avgWait;\r\n }",
"public double average(){\n double avg = 0;\n double sum = 0;\n for (T t : arr) {\n // sum += t.doubleValue();\n }\n\n return sum / arr.length;\n }",
"public double getUnderlyingPoolRecoveryRateMean(final UnderlyingPool underlyingPool) {\n\n ArgumentChecker.notNull(underlyingPool, \"Underlying pool\");\n\n final MeanCalculator mean = new MeanCalculator();\n\n final double[] recoveryRates = underlyingPool.getRecoveryRates();\n\n return mean.evaluate(recoveryRates);\n }",
"public static final double internalRateOfReturn (\n double irrEstimate,\n double [ ] cashFlows )\n //////////////////////////////////////////////////////////////////////\n {\n double irr = irrEstimate;\n\n double delta = -irr * 0.1;\n\n double oldNpv = 0.0;\n\n while ( true )\n {\n double npv = netPresentValue ( irr, cashFlows );\n\n if ( npv == 0.0 )\n {\n return irr;\n }\n\n if ( oldNpv < 0.0 )\n {\n if ( npv > 0.0 )\n {\n delta *= -0.9;\n }\n else if ( npv > oldNpv )\n {\n delta *= 1.1;\n }\n else if ( npv < oldNpv )\n {\n delta = -delta;\n }\n else\n {\n delta = 0.0;\n }\n }\n else if ( oldNpv > 0.0 )\n {\n if ( npv < 0.0 )\n {\n delta *= -0.9;\n }\n else if ( npv < oldNpv )\n {\n delta *= 1.1;\n }\n else if ( npv > oldNpv )\n {\n delta = -delta;\n }\n else\n {\n delta = 0.0;\n }\n }\n\n/*\nSystem.out.println ( \"irr = \" + irr + \", oldNpv = \" + oldNpv + \", npv = \" + npv + \", delta = \" + delta );\n\ntry{\nnew BufferedReader ( new InputStreamReader ( System.in ) ).readLine ( );\n}catch (Exception x ) { }\n*/\n\n if ( delta == 0.0 )\n {\n return irr;\n }\n\n irr += delta;\n\n oldNpv = npv;\n }\n }",
"private TSDBData generateDynamicRate() {\n //TODO: replace with single method generateRate and parameter (static, dynamic)\n double rate;\n Random rateGenerator = new Random();\n TSDBData rateData = new TSDBData();\n ArrayList<String> strArr = null;\n ArrayList<Object> objArrNode;\n ArrayList<ArrayList<Object>> objArr = new ArrayList<ArrayList<Object>>();\n\n // Iterate through the list and generate the rate for each enabled meters\n for (int k = 0; k < enabledResourceList.size(); k++) {\n //rate = getDynamicRate(enabledResourceList.get(k).toString());\n rate = rateGenerator.nextInt((3 - 1) + 1) + 1;\n strArr = StringUtil.strArr(\"resource\", \"rate\", \"rate_policy\");\n //strArr.add(\"resource\");\n //strArr.add(\"rate\");\n //strArr.add(\"rate_policy\");\n objArrNode = new ArrayList<Object>();\n objArrNode.add(enabledResourceList.get(k));\n objArrNode.add(rate);\n objArrNode.add(Flag.getMeteringType());\n objArr.add(objArrNode);\n }\n\n rateData.setName(\"rate\");\n rateData.setColumns(strArr);\n rateData.setPoints(objArr);\n return rateData;\n }",
"public void setRate(double annualRate) {\nmonthlyInterestRate = annualRate / 100.0 / MONTHS;\n}",
"public double getAverage(){\n return getTotal()/array.length;\n }",
"@Test\n public void testGetMeanRate() {\n System.out.println(\"getMeanRate\");\n RateList instance = new RateList();\n Rate r2 = new Rate(4);\n Rate r3 = new Rate(3);\n Rate r4 = new Rate(5);\n instance.registerRate(r2);\n instance.registerRate(r3);\n instance.registerRate(r4);\n double expResult = 4.0;\n double result = instance.getMeanRate();\n assertEquals(expResult, result, 0.0);\n }",
"double getMeanPrice() {\n List<Double> allPrices = new ArrayList<>();\n\n for (Firm firm : firms) {\n List<Double> pricesOfFirm = firm.getPrices();\n allPrices.addAll(pricesOfFirm.subList(pricesOfFirm.size() - SimulationManager.sizeOfExaminationInterval, pricesOfFirm.size()));\n }\n\n return Calculation.round(Calculation.getMean(allPrices), 2);\n }",
"public List<BigDecimal> getHourlyAverage() {\r\n\t\tif (hourlyAverage == null)\r\n\t\t\thourlyAverage = new ArrayList<BigDecimal>();\r\n\t\tint minuteInterval = loadForecast.getMinuteInterval();\r\n\r\n\t\tif (minuteInterval == 0 || intervals == null || intervals.size() == 0)\r\n\t\t\treturn hourlyAverage;\r\n\t\t/*\r\n\t\t * \r\n\t\t */\r\n\t\tBigDecimal total = new BigDecimal(\"0\");\r\n\t\tBigDecimal average = new BigDecimal(\"0\");\r\n\t\tInteger intervalsPerHour = 60 / minuteInterval;\r\n\t\tfor (int i = 0; i < intervals.size(); i++) {\r\n\t\t\tLoadForecastInterval interval = intervals.get(i);\r\n\t\t\ttotal = total.add(interval.getValue());\r\n\t\t\tif (i == 0 || i % intervalsPerHour == 0) {\r\n\t\t\t\taverage = total.divide(new BigDecimal(intervalsPerHour));\r\n\t\t\t\thourlyAverage.add(average);\r\n\t\t\t\ttotal = new BigDecimal(\"0\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn hourlyAverage;\r\n\t}",
"double avg(){\n\t\tdouble sum = 0.0;\n\t\tfor(int i=0;i<num.length;i++)\n\t\t\tsum+=num[i].doubleValue();\n\t\treturn sum/num.length;\n\t}",
"private float calculateAverage(List<Float> tempVoltages) {\r\n\t\t\r\n\t\tfloat runningTotal = 0;\r\n\t\tfor(float i : tempVoltages){\r\n\t\t\trunningTotal += i;\r\n\t\t}\r\n\t\trunningTotal /= tempVoltages.size();\r\n\t\treturn runningTotal;\r\n\t}",
"protected abstract Double getRate(T object);",
"public void updateRate(double r){\r\n rate *= r;\r\n }",
"public double getRatingAverage() {\n return average;\n }",
"public void getAvg()\n {\n this.avg = sum/intData.length;\n }",
"private float calculateMean()\n { \n int numberEmployees = employees.size();\n float total = 0, meanGrossPay = 0;\n // Create an array of all gross pays\n float[] allGrossPay = new float[numberEmployees];\n \n // Call method to return an array of float containing all gross pays\n allGrossPay = calculateAllGrossPay();\n // Find total gross pay\n for (int i = 0; i < numberEmployees; i++)\n {\n total += allGrossPay[i];\n }\n // Find mean and return it\n if (numberEmployees > 0)\n {\n meanGrossPay = total/numberEmployees;\n \n }\n return meanGrossPay;\n }",
"public double getAverageReturnPerTrade(){\n\t\treturn Math.round(averageReturnPerTrade*10000.0)/100.0;\n\t}",
"double average(double[] doubles) {\n double total = 0.0;\n //int count = 0;\n for (double d: doubles) {\n total = total + d;\n //count = count + 1;\n }\n //return total / count;\n return total / doubles.length;\n }",
"protected double getPaymentRate() {\n\t\tdouble rate = 0;\n\n\t\tfor (PayloadBuilderSet set : sets) {\n\t\t\tif (set.isActive())\n\t\t\t\trate += set.getPaymentRate();\n\t\t}\n\n\t\treturn rate;\n\t}",
"private Map<String, Double> countAverageRateForOrganization(List<Organization> organizations) {\n\n Map<String, Double> average = new HashMap<>();\n for (Organization org : organizations) {\n Double avg = feedbackServiceImpl.getAsListByOrganization(org.getName()).stream().mapToDouble((feed) -> feed.getRate()).average().orElse(0);\n average.put(org.getName(), avg);\n }\n return average;\n }",
"public abstract double calcAvRating();",
"public int getRate() {\r\n return Integer.parseInt(RATES[Rate]);\r\n }",
"public double getAverageTimeInQueue() {\n\t\tif (count == 0) {\n\t\t\treturn Double.NaN;\n\t\t} else {\n\t\t\treturn sumTimeInQueue/count;\n\t\t}\n\t}",
"public double averagePrice() {\r\n\t\tdouble sum = 0;\r\n\t\tfor(Integer price : ticketPrice) {\r\n\t\t\tsum+=price;\r\n\t\t}\r\n\t\treturn sum/ticketPrice.size();\r\n\t}",
"public int average()\n {\n int average = 0;\n int sum = 0;\n\n for ( int index = 0; index < data.length; index++ )\n {\n sum = sum + data[index];\n }\n average = sum / data.length;\n\n return average;\n }",
"static double averageDoubleArray(double[] inputArray) {\n\t\tdouble doubleSum = 00.00;\n\t\tfor (double element : inputArray) { \n\t\t\tdoubleSum += element;\n\t\t}\n\t\tdouble average = doubleSum / inputArray.length; \n\t\treturn average;\n\t}",
"public static double avg(double[] array) {\r\n\t\tdouble ret = sum(array);\r\n\t\treturn ret / array.length;\r\n\t}",
"public static double getAvgResponseTime() {\n return responseTime.getAvg();\n }",
"public int avgTrafficPerDay(){\r\n \r\n int trav=apstate.gettravellers();\r\n\t\tint days=apstate.getdays();\r\n\t\tint items=apstate.getitems();\r\n \r\n int avg_traffic_per_day=trav/days;\r\n \r\n return avg_traffic_per_day;\r\n }",
"public double average(int first, int last){\n double final = 0;\n for(int i = first; i < last; i++){\n final += scores[i];\n }\n return final/(last-first+1);\n}",
"private float averageBeat(){\n float avgBeat = 0f;\n List<Float> beatRed = DataManager.getInstance().getBeatRed();\n List<Float> beatIR = DataManager.getInstance().getBeatIR();\n\n for(int i = 0; i < beatRed.size() && i < beatIR.size(); i ++ ){\n chartFragment.addRedData(beatRed.get(i));\n chartFragment.addIRData(beatIR.get(i));\n avgBeat += beatRed.get(i);\n avgBeat += beatIR.get(i);\n }\n avgBeat = avgBeat / (beatRed.size() + beatIR.size());\n\n if (tcpTask != null )\n this.tcpTask.addData(\"\" + avgBeat);\n beatLabel.setText(\"Beat : \" + avgBeat);\n return avgBeat;\n }",
"@Override\n public Double average() {\n return (sum() / (double) count());\n }",
"public double setAvg(Review reviewp) {\n\t\tint number=0;\n\t\tint mark=0;\n\t\tdouble br=0;\n\t\tfor(Review review: reviews) {\n\t\t\tif(review.getRestaurant().getName().equals(reviewp.getRestaurant().getName()) &&\n\t\t\t\t\treview.getStatus().equals(ReviewStatus.ACCEPTED)) {\n\t\t\t\t\t\tnumber++;\n\t\t\t\t\t\tmark+=review.getRating();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif(mark==0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn mark/number;\n\t}",
"static double calculateAverage(int[] array) {\n\n double sum = 0;\n\n for (int i = 0; i < array.length; i++) {\n\n sum = sum + (double) array[i];\n\n\n }\n\n return sum / array.length;//returning average\n\n }",
"public float getRate() {\n\treturn durationStretch * nominalRate;\n }",
"public double getRate() {\n return rate;\n }",
"public double getRate() {\n return rate;\n }",
"@Test\n public void testAverage() throws Exception {\n Assert.assertTrue(fireHydrants.canSellHydrants());\n Assert.assertTrue(fireHydrants.sellHydrants());\n fakeTicker.setTimeInSecs(5 * 60);\n Assert.assertTrue(fireHydrants.canSellHydrants());\n Assert.assertTrue(fireHydrants.sellHydrants());\n Assert.assertFalse(fireHydrants.canSellHydrants());\n fakeTicker.setTimeInSecs(10 * 60);\n Assert.assertTrue(fireHydrants.sellHydrants());\n fakeTicker.setTimeInSecs(15 * 60);\n Assert.assertTrue(fireHydrants.canSellHydrants());\n Assert.assertTrue(fireHydrants.sellHydrants());\n fakeTicker.setTimeInSecs(20 * 60);\n Assert.assertTrue(fireHydrants.sellHydrants());\n fakeTicker.setTimeInSecs(25 * 60);\n Assert.assertTrue(fireHydrants.sellHydrants());\n fakeTicker.setTimeInSecs(30 * 60);\n Assert.assertTrue(fireHydrants.sellHydrants());\n fakeTicker.setTimeInSecs(35 * 60);\n Assert.assertTrue(fireHydrants.canSellHydrants());\n Assert.assertTrue(fireHydrants.sellHydrants());\n fakeTicker.setTimeInSecs(40 * 60);\n Assert.assertTrue(fireHydrants.sellHydrants());\n fakeTicker.setTimeInSecs(45 * 60);\n Assert.assertTrue(fireHydrants.sellHydrants());\n\n //11th request fails, as it crossed the limit of 10 requests in 60 mins.\n Assert.assertFalse(fireHydrants.canSellHydrants());\n\n fakeTicker.setTimeInSecs(60 * 60);\n //Next 60 mins\n //Fails as it reached the avg limit of 5 per hour.\n Assert.assertFalse(fireHydrants.sellHydrants());\n }",
"private static double meanVal(double[] arrayOfSamples){\n\t\tdouble total = 0;\n\t\t for (double i :arrayOfSamples){\n\t\t \ttotal += i;\n\t\t }\n\t return total/arrayOfSamples.length;\n\t}",
"public float getAverageBetweenPoint(){\n return getMetric()/list.size();\n }",
"public int getTotalRate(CustomerType customerType, LocalDate initialDate, LocalDate endDate) {\n return Stream.iterate(initialDate, date -> date.plusDays(1))\n .limit(endDate.getDayOfMonth() - initialDate.getDayOfMonth() + 1)\n .map(date -> {\n if (date.getDayOfWeek().equals(DayOfWeek.SATURDAY) || date.getDayOfWeek().equals(DayOfWeek.SUNDAY))\n return this.rate.get(customerType).getWeekendRate();\n return this.rate.get(customerType).getWeekdayRate();\n })\n .reduce((total, next) -> total + next).get();\n }",
"public static final double annualSavingsNeeded (\n double f,\n double r,\n double t )\n //////////////////////////////////////////////////////////////////////\n {\n return f * r / ( Math.pow ( 1.0 + r, t ) - 1.0 );\n }",
"public double calAveragePriceListReBook(double totalPrice, int numOfReBook) {\n double average = totalPrice / numOfReBook;\n return average;\n }",
"public double getRate() {\n\t\treturn rate;\n\t}",
"public double getAverage(User user) throws Exception;",
"public static double average(int[] arr)\n {\n // your code goes here\n\t\tdouble sum =0;\n int i;\n for(i=0;i< arr.length;i++)\n {\n sum+=arr[i];\n }\n\t\t\n\t\treturn sum/arr.length; \n\t}",
"int getMortgageRate();",
"public double averageOfArray() {\n double sum = 0;\n double average = 0;\n int i;\n for (i = 0; i < sirDeLa1La100.length; i++) {\n sum = sum + sirDeLa1La100[i];\n }\n average = sum / sirDeLa1La100.length;\n return average;\n }",
"public int getRate() {\n return rate_;\n }",
"double getAvgTreatment();",
"public Integer getRate() {\r\n return rate;\r\n }",
"public double movingAverage(int periods, int t)\n {\n if(periods>t + 1 || periods<1)\n throw new IndexOutOfBoundsException(\"MA(\" + periods + \") is undefined at time \" + t);\n double sum = 0.0;\n for(int i = t - periods + 1; i<=t; i++)\n sum += x[i];\n return sum/periods;\n }",
"public double getAverage()\n {\n return getSum() / 2.0;\n }",
"org.hl7.fhir.Period getAppliesPeriod();",
"private double calcAvgY(List<Review> Reviews) {\n\t\tdouble avg = 0.0;\n\t\tint count = 0;\n\t\tfor (int i = 0; i < Reviews.size(); i++) {\n\t\t\tavg += Reviews.get(i).getNumStars();\n\t\t\tcount++;\n\t\t}\n\t\treturn avg / count;\n\t}",
"public static double average(double[] array){\n double sum = 0;\n for (int i = 0; i < array.length; i++) {\n sum += array[i];\n }\n return sum/array.length;\n }"
] | [
"0.60044384",
"0.59957486",
"0.5901183",
"0.5725512",
"0.571166",
"0.5664603",
"0.56547165",
"0.56333923",
"0.561614",
"0.5586534",
"0.55618316",
"0.5556125",
"0.5529448",
"0.5518546",
"0.5502061",
"0.5478964",
"0.5472615",
"0.5463405",
"0.5444757",
"0.53909606",
"0.53758156",
"0.53727293",
"0.53633624",
"0.5355152",
"0.53476816",
"0.5326256",
"0.53247124",
"0.53202176",
"0.5309938",
"0.5308934",
"0.5295047",
"0.52878714",
"0.52875197",
"0.5281081",
"0.5272466",
"0.5250215",
"0.5248045",
"0.52404815",
"0.5231763",
"0.52082425",
"0.5205613",
"0.52029616",
"0.5202079",
"0.5200072",
"0.51872706",
"0.51709294",
"0.51658714",
"0.515531",
"0.51542836",
"0.5154269",
"0.5149033",
"0.5145533",
"0.51419294",
"0.51197",
"0.51160437",
"0.5107622",
"0.50986123",
"0.50978655",
"0.508775",
"0.50857127",
"0.50843644",
"0.5078462",
"0.5077971",
"0.50716054",
"0.50690174",
"0.5064922",
"0.5048448",
"0.50464725",
"0.5044623",
"0.5044517",
"0.5042537",
"0.5034085",
"0.5031325",
"0.5030827",
"0.5024308",
"0.5019134",
"0.5016643",
"0.50159407",
"0.501476",
"0.5009916",
"0.5009916",
"0.5003221",
"0.49980012",
"0.49966648",
"0.49965322",
"0.4992322",
"0.49886364",
"0.49833536",
"0.49826172",
"0.49800003",
"0.49774367",
"0.49769852",
"0.49718454",
"0.4966656",
"0.49643567",
"0.4964144",
"0.49623013",
"0.4961186",
"0.49594733",
"0.49579665"
] | 0.5585382 | 10 |
Save the price generated into the DB Pseudo Code 1. Create the dataobj containing the details 2. Save it into the db | private boolean savePrice(ArrayList<ArrayList<Object>> objArr) {
//TODO: create string array construction method with String... array
//TODO: create generic method to create POJO object from objArr and map to JSON data
logger.trace("BEGIN boolean savePrice(ArrayList<ArrayList<Object>> objArr)");
boolean result = false;
TSDBData pricingData = new TSDBData();
ArrayList<String> strArr = new ArrayList<String>();
InfluxDBClient dbClient = new InfluxDBClient();
ObjectMapper mapper = new ObjectMapper();
String jsonData = null;
strArr.add("resource");
strArr.add("userId");
strArr.add("usage");
strArr.add("price");
pricingData.setName(Loader.getSettings().getInfluxDBSettings().getCdrRecord());
pricingData.setColumns(strArr);
pricingData.setPoints(objArr);
//get tags and put them into pricingData
logger.trace("DATA boolean savePrice(ArrayList<ArrayList<Object>> objArr): pricingData=" + pricingData);
try {
jsonData = mapper.writeValueAsString(pricingData);
} catch (JsonProcessingException e) {
logger.error("EXCEPTION JSONPROCESSINGEXCEPTION boolean savePrice(ArrayList<ArrayList<Object>> objArr)");
e.printStackTrace();
}
//System.out.println(jsonData);
logger.trace("DATA boolean savePrice(ArrayList<ArrayList<Object>> objArr): jsonData=" + jsonData);
result = dbClient.saveData(jsonData);
logger.trace("END boolean savePrice(ArrayList<ArrayList<Object>> objArr)");
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void save(BuyTicketModel value) {\n String sql = \"insert into buyticket values(?,?,?,?,?,?,?,?,?,?,?,?) \";\r\n \r\n try {\r\n PreparedStatement pstm = database.getCon().prepareStatement(sql);\r\n pstm.setString(1, value.getSlno());\r\n pstm.setString(2, value.getCustomername());\r\n pstm.setString(10,value.getContact());\r\n pstm.setString(3, value.getDestination());\r\n pstm.setString(4, value.getTime());\r\n pstm.setString(5, value.getFare());\r\n pstm.setString(6, value.getComment());\r\n pstm.setString(7, value.getDate());\r\n pstm.setString(8, value.getPayment());\r\n pstm.setString(9, value.getSeat());\r\n pstm.setString(11, value.getType());\r\n pstm.setString(12, value.getBusname());\r\n \r\n \r\n pstm.executeUpdate();\r\n pstm.close();\r\n \r\n } catch (SQLException ex) {\r\n Logger.getLogger(BuyTicketImpl.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n }",
"public void save(PosPrice posPrice) throws DataAccessException {\n super.save(posPrice);\n }",
"@Override\r\n\tpublic int createPrice(ProductRaw_Price price) {\n\t\tprice.setStatus(0);\r\n\t\treturn productRaw_PriceDao.insert(price);\r\n\t}",
"public void saveOrUpdate(PosPrice posPrice) throws DataAccessException{\n super.saveOrUpdate(posPrice);\n }",
"@Override\n\tpublic void savePrice(Goods goods) {\n\t\tgoodsMapper.insert(goods);\n\t}",
"int insert(ProductPricelistEntityWithBLOBs record);",
"@Override\n\tpublic void doSave(SellOfer model, HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\t\t if(StringUtil.isEmpty(model.getPrice())){\n\t\t\t model.setPrice(\"0\");\n\t\t }\n\t\t double dprice =Double.parseDouble(model.getPrice());\n\t BigDecimal bg = new BigDecimal(dprice/10000);\n\t double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();\n\t model.setPrice(f1+\"\");\n\t model.setSource(\"001\");\n\t\t\n\t\tsuper.doSave(model, request, response);\n\t}",
"public void saveDate(View view) {\n// create an object of order\n Order order = new Order(name, Integer.parseInt(price));\n dbHandler.addOrder(order);\n Toast.makeText(getApplicationContext(), \"Hooray! Data Saved in DB\", Toast.LENGTH_SHORT).show();\n }",
"void saveProduct(Product product);",
"void save(Bill bill);",
"public static Response createBook(String title, double price){\n Book b = new Book();\n b.setTitle(title);\n b.setPrice(price);\n EntityTransaction t = em.getTransaction();\n t.begin();\n em.persist(b);\n t.commit();\n return Response.ok().build();\n }",
"public void saveProduct(Product product);",
"public void addtoDB(String plate,String date,double km,ObservableList<Service> serv){\n \n plate = convertToDBForm(plate);\n \n try {\n stmt = conn.createStatement();\n } catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n if(!checkTableExists(plate)){ \n try {\n stmt.execute(\"CREATE TABLE \" + plate + \"(DATA VARCHAR(12),QNT DOUBLE,DESC VARCHAR(50),PRICE DOUBLE,KM DOUBLE);\");\n }catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }\n \n for(int i=0;i<serv.size();i++){\n \n double qnt = serv.get(i).getQnt();\n String desc = serv.get(i).getDesc();\n double price = serv.get(i).getPrice();\n \n try {\n stmt.executeUpdate(\"INSERT INTO \" + plate + \" VALUES('\" + date + \"',\" + Double.toString(qnt) + \",'\" + desc + \"',\" + Double.toString(price) + \",\" + Double.toString(km) + \");\");\n }catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }\n \n try {\n stmt.close();\n } catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n\n }",
"void save(String key, Object data, int expirySeconds) throws BusinessException;",
"public void persistToDatabase(Stock stock, int id) throws ParseException {\n\n\n // Creating the config instance & passing the hibernate config file.\n Configuration config = new Configuration();\n config.configure(\"hibernate.cfg.xml\");\n\n // Session object to start the db transaction.\n Session s = config.buildSessionFactory().openSession();\n\n // Transaction object to begin the db transaction.\n Transaction t = s.beginTransaction();\n\n Stock_infoDAO stock_infoDAO = new Stock_infoDAO();\n stock_infoDAO.setId(id);\n stock_infoDAO.setSymbol(stock.getSymbol());\n BigDecimal price = new BigDecimal(stock.getPrice());\n stock_infoDAO.setPrice(price);\n\n String inDate= stock.getTime();\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n\n Timestamp ts = new Timestamp(((java.util.Date)dateFormat.parse(inDate)).getTime());\n stock_infoDAO.setTime(ts);\n\n\n // Saving the stockinfo object to the db.\n s.persist(stock_infoDAO);\n\n // Committing the transaction in the db.\n t.commit();\n\n System.out.println(\"\\n===================\\n\");\n\n\n // Closing the session object.\n s.close();\n }",
"Product save(Product product);",
"int insertSelective(ProductPricelistEntityWithBLOBs record);",
"void insert(PaymentTrade record);",
"private void insertData() \n {\n for (int i = 0; i < 3; i++) {\n TarjetaPrepagoEntity entity = factory.manufacturePojo(TarjetaPrepagoEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n for(int i = 0; i < 3; i++)\n {\n PagoEntity pagos = factory.manufacturePojo(PagoEntity.class);\n em.persist(pagos);\n pagosData.add(pagos);\n\n }\n \n data.get(2).setSaldo(0.0);\n data.get(2).setPuntos(0.0);\n \n double valor = (Math.random()+1) *100;\n data.get(0).setSaldo(valor);\n data.get(0).setPuntos(valor); \n data.get(1).setSaldo(valor);\n data.get(1).setPuntos(valor);\n \n }",
"int insert(GoodsPo record);",
"private void saveToDb() {\r\n ContentValues values = new ContentValues();\r\n values.put(DbAdapter.KEY_DATE, mTime);\r\n if (mPayeeText != null && mPayeeText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_PAYEE, mPayeeText.getText().toString());\r\n if (mAmountText != null && mAmountText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_AMOUNT, mAmountText.getText().toString());\r\n if (mCategoryText != null && mCategoryText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_CATEGORY, mCategoryText.getText().toString());\r\n if (mMemoText != null && mMemoText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_MEMO, mMemoText.getText().toString());\r\n if (mTagText != null && mTagText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_TAG, mTagText.getText().toString());\r\n\r\n \tif (Utils.validate(values)) {\r\n \t\tmDbHelper.open();\r\n \t\tif (mRowId == null) {\r\n \t\t\tlong id = mDbHelper.create(values);\r\n \t\t\tif (id > 0) {\r\n \t\t\t\tmRowId = id;\r\n \t\t\t}\r\n \t\t} else {\r\n \t\t\tmDbHelper.update(mRowId, values);\r\n \t\t}\r\n \t\tmDbHelper.close();\r\n \t}\r\n\t}",
"@Valid\n\tvoid create(Price Price);",
"int insertGenDetail(Integer uid, Integer merid, Double paymoney, Double sendmoney, Double tomoney, Double balance, Double topupbalance, Double givebalance, String ordernum, Date createTime, Integer paysource, String remark);",
"int insert(cskaoyan_mall_order_goods record);",
"public void insertItemDetails(String itemName, Integer quantityOfItem, Double rateOfItem);",
"@Insert({\n \"insert into PURCHASE (ID, SDATE, \",\n \"STYPE, SMONEY, TOUCHING, \",\n \"ACCOUNT, CHECKSTATUS, \",\n \"DEMO1, DEMO2, DEMO3)\",\n \"values (#{id,jdbcType=DECIMAL}, #{sdate,jdbcType=TIMESTAMP}, \",\n \"#{stype,jdbcType=VARCHAR}, #{smoney,jdbcType=DECIMAL}, #{touching,jdbcType=VARCHAR}, \",\n \"#{account,jdbcType=VARCHAR}, #{checkstatus,jdbcType=DECIMAL}, \",\n \"#{demo1,jdbcType=DECIMAL}, #{demo2,jdbcType=VARCHAR}, #{demo3,jdbcType=DECIMAL})\"\n })\n int insert(Purchase record);",
"public void save() {\n ProductData.saveData(tree);\n }",
"@Override\n\tpublic void create(StockDataRecord bo) throws SQLException, BusinessObjectException {\n\t\tthis.addRecord( bo.getPapername().toString(), bo.getDate().toString(), bo.getTime().toString(), Double.toString(bo.getClose()), Double.toString(bo.getVolume()) );\n\t\tbo.get();\n\t\t\n\t}",
"@NotNull\n public Order doSave(@NotNull Order o) {\n try {\n Connection cn = ConPool.getConnection();\n PreparedStatement st;\n if (o.getOperator() != null) {\n if (o.getId() < 1) {\n st = cn.prepareStatement(\n \"INSERT INTO `order` (user, totalPrice, \"\n + \"numberOfProduct, date, operator) values (?,?,?,?,?);\",\n Statement.RETURN_GENERATED_KEYS\n );\n st.setString(1, o.getUser().getUsername());\n st.setDouble(2, o.getTotPrice());\n st.setInt(3, o.getNumberOfItems());\n st.setString(4, o.getData());\n st.setString(5, o.getOperator().getUsername());\n } else {\n st = cn.prepareStatement(\"INSERT INTO `order`( user, id,\"\n + \" totalprice, numberOfProduct, date, operator)\"\n + \" values (?,?,?,?,?,?);\");\n st.setString(1, o.getUser().getUsername());\n st.setInt(2, o.getId());\n st.setDouble(3, o.getTotPrice());\n st.setInt(4, o.getNumberOfItems());\n st.setString(5, o.getData());\n st.setString(6, o.getOperator().getUsername());\n }\n } else {\n if (o.getId() < 1) {\n st = cn.prepareStatement(\n \"INSERT INTO `order` (user, totalPrice, \"\n + \"numberOfProduct, date) values (?,?,?,?);\",\n Statement.RETURN_GENERATED_KEYS\n );\n st.setString(1, o.getUser().getUsername());\n st.setDouble(2, o.getTotPrice());\n st.setInt(3, o.getNumberOfItems());\n st.setString(4, o.getData());\n } else {\n st = cn.prepareStatement(\"INSERT INTO `order`( user, id,\"\n + \" totalprice, numberOfProduct, date)\"\n + \" values (?,?,?,?,?);\");\n st.setString(1, o.getUser().getUsername());\n st.setInt(2, o.getId());\n st.setDouble(3, o.getTotPrice());\n st.setInt(4, o.getNumberOfItems());\n st.setString(5, o.getData());\n }\n }\n\n st.executeUpdate();\n if (o.getId() < 1) {\n ResultSet rs = st.getGeneratedKeys();\n rs.next();\n o.setId(rs.getInt(1));\n }\n for (Product p : o.getAllProducts()) {\n if (p instanceof DigitalProduct) {\n st = cn.prepareStatement(\n \"INSERT INTO digitalpurchasing (digitalProduct, `order`, quantity) \"\n + \"VALUES (?,?, ?);\");\n st.setInt(1, p.getId());\n st.setInt(2, o.getId());\n st.setInt(3, o.getQuantitySingleProduct(p.getId(), p.getClass()));\n\n if (st.executeUpdate() != 1) {\n throw new RuntimeException(\"INSERT error.\");\n }\n } else if (p instanceof PhysicalProduct) {\n st = cn.prepareStatement(\n \"INSERT INTO physicalpurchasing (physicalProduct, `order`, quantity) \"\n + \"VALUES (?,?, ?);\");\n st.setInt(1, p.getId());\n st.setInt(2, o.getId());\n st.setInt(3, o.getQuantitySingleProduct(p.getId(), p.getClass()));\n if (st.executeUpdate() != 1) {\n throw new RuntimeException(\"INSERT error.\");\n }\n }\n }\n st.close();\n cn.close();\n return o;\n } catch (SQLException e) {\n throw new RuntimeException(e);\n }\n }",
"private void saveData() {\n readViews();\n final BookEntry bookEntry = new BookEntry(mNameString, mQuantityString, mPriceString, mSupplier, mPhoneString);\n AppExecutors.getInstance().diskIO().execute(new Runnable() {\n @Override\n public void run() {\n // Insert the book only if mBookId matches DEFAULT_BOOK_ID\n // Otherwise update it\n // call finish in any case\n if (mBookId == DEFAULT_BOOK_ID) {\n mDb.bookDao().insertBook(bookEntry);\n } else {\n //update book\n bookEntry.setId(mBookId);\n mDb.bookDao().updateBook(bookEntry);\n }\n finish();\n }\n });\n }",
"void createItem (String name, String description, double price);",
"public void insertBillFood(Bill billFood) {\nString sql = \"INSERT INTO bills ( Id_food, Id_drink, Id_employees, Price, Serial_Number_Bill, TOTAL ) VALUES (?,?,?,?,?,?)\";\n \ntry {\n\tPreparedStatement ps = ConnectionToTheBase.getConnectionToTheBase().getConnection().prepareStatement(sql);\n\t \n\t\n\t\tps.setInt(1, billFood.getIdF());\n\t\tps.setString(2,null);\n\t ps.setInt(3, billFood.getIdE());\n\t\tps.setDouble(4, billFood.getPrice());\n\t\tps.setString(5, billFood.getSerialNumber());\n\t\tps.setDouble(6, billFood.getTotal());\n\t\tps.execute();\n\t\t\n\t\n\t \n} catch (SQLException e) {\n\t// TODO Auto-generated catch block\n\te.printStackTrace();\n}\n\n\t\n\t\n}",
"int insert(PurchasePayment record);",
"@Override\r\n\tpublic final void saveObjectData() throws BillingSystemException{\n\t}",
"private void saveItemPriceTrend(final Price price) {\n try {\n ItemPriceEntity itemPrice = mDatabaseAccess.itemsDAO().selectLastItemPrice(\n price.getId());\n double sellPercentage = 0;\n double buyPercentage = 0;\n // calculates the sell and buy percentage if a price already exists\n if (itemPrice != null) {\n sellPercentage = 1 - (price.getSells().getUnitPrice() / itemPrice.getSellPrice());\n buyPercentage = 1 - (price.getBuys().getUnitPrice() / itemPrice.getBuyPrice());\n }\n // insert the data\n mDatabaseAccess.trendDAO().insertTrend(\n new TrendEntity(price.getId(), TrendType.BuyItems, buyPercentage));\n mDatabaseAccess.trendDAO().insertTrend(\n new TrendEntity(price.getId(), TrendType.SellItems, sellPercentage));\n } catch (Exception ex) {\n Log.e(TAG, \"Failed to process the item trend with the ID: \" + price.getId(), ex);\n }\n }",
"public void save_order_without_payment(String advert, String userWhoGive,String userWhoGet,Date date,Date start, Date finish,Float price);",
"public void savePosPay(PosPay posPay) throws DataAccessException;",
"public void insert(int id, String name,double cost,String description){\r\n \tService service = new Service();\r\n \tservice.setId(id);\r\n \tservice.setName(name);\r\n \tservice.setCost(cost);\r\n \tservice.setDescription(description);\r\n \tsession.save(service);\r\n \tsession.beginTransaction().commit();\r\n }",
"@Insert({\n \"insert into order (id, orderid, \",\n \"name, price, userid)\",\n \"values (#{id,jdbcType=BIGINT}, #{orderid,jdbcType=VARCHAR}, \",\n \"#{name,jdbcType=VARCHAR}, #{price,jdbcType=BIGINT}, #{userid,jdbcType=VARCHAR})\"\n })\n int insert(Order record);",
"private boolean saveRate(TSDBData rateObj) {\n InfluxDBClient dbClient = new InfluxDBClient();\n\n ObjectMapper mapper = new ObjectMapper();\n String jsonData = null;\n boolean result;\n try {\n jsonData = mapper.writeValueAsString(rateObj);\n } catch (JsonProcessingException e) {\n e.printStackTrace();\n }\n result = dbClient.saveData(jsonData);\n return result;\n }",
"@Transactional\n\tpublic void save(final PrintDataBean printDataBean) \n\t{\n\t\tjdbcTemplate = custom.getJdbcTemplate();\n\tif(printDataBean.getId() == 0)\t{\n\t\t\n\t\t\n\tKeyHolder keyHolder = new GeneratedKeyHolder();\n\tint update = jdbcTemplate.update(\n\t\t\tnew PreparedStatementCreator() {\n\t\t\t\t\tpublic PreparedStatement \n\t\t\t\t\tcreatePreparedStatement(Connection connection) throws SQLException {\n\t\n\t\t\t\t\tif(printDataBean.getCreatedTime() == null)\n\t\t\t\t\t{\n\t\t\t\t\tprintDataBean.setCreatedTime( new Date());\n\t\t\t\t\t}\n\t\t\t\t\tjava.sql.Timestamp createdTime = \n\t\t\t\t\t\tnew java.sql.Timestamp(printDataBean.getCreatedTime().getTime()); \n\t\t\t\t\t\t\t\n\t\t\t\t\tif(printDataBean.getUpdatedTime() == null)\n\t\t\t\t\t{\n\t\t\t\t\tprintDataBean.setUpdatedTime( new Date());\n\t\t\t\t\t}\n\t\t\t\t\tjava.sql.Timestamp updatedTime = \n\t\t\t\t\t\tnew java.sql.Timestamp(printDataBean.getUpdatedTime().getTime()); \n\t\t\t\t\t\t\t\n\t\t\t\t\tPreparedStatement ps =\n\t\t\t\t\t\t\t\t\tconnection.prepareStatement(INSERT_SQL,new String[]{\"id\"});\n\t\t\t\t\t\n//\t\t\t\t\t`items` , `quantity` , `price` , `totalamount` , `discount` , `netamount` , \n//\t\t\t\t\t`totalnetamount` , `vatamount` , `paidamount` , \n//\t\t\t\t\t`dueamount` , `grossamount` , `previousdueamount` , invoiceid \n\tps.setTimestamp(1, createdTime);\nps.setTimestamp(2, updatedTime);\nps.setString(3, printDataBean.getItems());\nps.setString(4, printDataBean.getQuantity());\nps.setString(5, printDataBean.getPrice());\nps.setString(6, printDataBean.getTotalamount());\nps.setString(7, printDataBean.getDiscount());\nps.setString(8, printDataBean.getNetamount());\nps.setString(9, printDataBean.getTotalnetamount());\nps.setString(10, printDataBean.getVatamount());\nps.setString(11, printDataBean.getPaidamount());\nps.setString(12, printDataBean.getDueamount());\nps.setString(13, printDataBean.getGrossamount());\nps.setString(14, printDataBean.getPreviousdueamount());\nps.setString(15, printDataBean.getInvoiceid());\nps.setString(16, printDataBean.getCustomerId());\nps.setString(17, printDataBean.getReturncylinderinvoice());\nps.setString(18, printDataBean.getCylinderDeliverTruck());\nps.setString(19, printDataBean.getCylinderReturnTruck());\nps.setString(20, printDataBean.getCylinderId());\n\n\n\n\t\t\t\t\t\t\treturn ps;\n\t\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tkeyHolder);\n\t\t\t\t\n\t\t\t\tNumber unId = keyHolder.getKey();\n\t\t\t\tprintDataBean.setId(unId.intValue());\n\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\tString sql = \"UPDATE accessoriesmaster set typeofaccessory = ? ,suppliername = ? ,madein = ? ,lponumber = ? ,remarks = ? ,status = ? where id = ? \";\n\t\n\t\t\tjdbcTemplate.update(sql, new Object[]{});\n\t\t}\n\t}",
"private void saveExpositionInDB(String badgeID, int expoSiteId, int expoMonth, int expoYear,\n Date expoDateBegin, Date expoDateEnd, String expoValue)\n throws SQLException {\n\n // do not process exposition is its value is 'M'.\n if(expoValue.equalsIgnoreCase(\"M\")){\n Logger.log(\"Skipped exposition because value is 'M'. (\"+badgeID+\",\"+expoMonth+\",\"+expoValue+\")\",Logger.ERROR_LEVEL_INFO);\n }\n else{\n try{\n // check if value is an integer, otherwise, skip\n Integer.parseInt(expoValue);\n\n // find badgePersonId exposed to this exposition\n psGetPersonIds.setString(1,badgeID);\n psGetPersonIds.setInt(2,expoSiteId);\n psGetPersonIds.setString(3,expoYear+\"\");\n psGetPersonIds.setString(4,expoYear+\"\");\n psGetPersonIds.setTimestamp(5,new Timestamp(expoDateBegin.getTime()));\n psGetPersonIds.setTimestamp(6,new Timestamp(expoDateEnd.getTime()));\n psGetPersonIds.setTimestamp(7,new Timestamp(expoDateBegin.getTime()));\n psGetPersonIds.setTimestamp(8,new Timestamp(expoDateEnd.getTime()));\n ResultSet rs = psGetPersonIds.executeQuery();\n\n // convert to site-id to site-name\n String expoSite = \"\";\n if(expoSiteId==1) expoSite = \"DOEL\";\n else if(expoSiteId==2) expoSite = \"TIHANGE\";\n else if(expoSiteId==3) expoSite = \"IRE\";\n else if(expoSiteId==4) expoSite = \"OTHER\";\n\n // at least one badge found, so add the expoValue to table Items.\n int personCount = 0, personid;\n while(rs.next()){\n // get personid belonging to the found badge\n personid = rs.getInt(\"BadgePersonId\");\n\n // create 3 items to be stored\n itemVOs = new Vector();\n\n // expoValue\n itemType = PREFIX+\"ITEM_TYPE_DOSIMETRY_\"+expoSite+\"_GLOBAL_MONTH\"+expoMonth;\n itemVO = new ItemVO(new Integer(IdentifierFactory.getInstance().getTemporaryNewIdentifier()),itemType,expoValue,new Date(),null);\n itemVOs.add(itemVO);\n\n // badgeID\n itemType = PREFIX+\"ITEM_TYPE_DOSIMETRY_BADGEID_\"+expoSite;\n itemVO = new ItemVO(new Integer(IdentifierFactory.getInstance().getTemporaryNewIdentifier()),itemType,badgeID,new Date(),null);\n itemVOs.add(itemVO);\n\n // expoYear\n itemType = PREFIX+\"ITEM_TYPE_DOSIMETRY_REGISTRATIONYEAR\";\n itemVO = new ItemVO(new Integer(IdentifierFactory.getInstance().getTemporaryNewIdentifier()),itemType,expoYear+\"\",new Date(),null);\n itemVOs.add(itemVO);\n\n storeTransaction(personid,itemVOs,expoSite,expoYear);\n personCount++;\n }\n\n rs.close();\n psGetPersonIds.close();\n // rs empty, no badge found\n if(personCount == 0){\n Logger.log(\"No Badges with BadgeId (\"+badgeID+\") for site (\"+expoSite+\",\"+expoSiteId+\") found in year (\"+expoYear+\").\",Logger.ERROR_LEVEL_INFO);\n }\n }\n // expoValue is no integer\n catch(NumberFormatException e){\n Logger.log(\"Exposition value is no Integer. (\"+badgeID+\",\"+expoMonth+\",\"+expoValue+\")\",Logger.ERROR_LEVEL_ERROR);\n if(Debug.enabled) Debug.println(\"ERROR : Exposition value is no Integer. (\"+badgeID+\",\"+expoMonth+\",\"+expoValue+\")\");\n }\n }\n }",
"int insert(ItemStockDO record);",
"int insert(ItemStockDO record);",
"HashMap saveOrderPaymentTE(long orderIdi,double monto,String hdnRa,String hdnVoucher,String hdnComentario,String hdnNumLogin,String hdnUser,Integer hdnFlgVep,Double txtCuotaInicial, Double hdnMontoFinanciado,Integer hdnNumCuotas)throws SQLException, Exception, RemoteException;",
"void insert(Disproduct record);",
"private void saveData() {\n }",
"int insert(BusinessRepayment record);",
"public void setPrice(double price){this.price=price;}",
"public void AddDataRecordtoDB(View view) {\n\n //get the running distance from textview\n TextView TV_distance = (TextView)findViewById(R.id.data_length);\n Double runningDistance = Double.parseDouble(TV_distance.getText().toString());\n System.out.println(\"distance is :\"+runningDistance);\n\n //get the calories from textview\n TextView TV_calories = (TextView)findViewById(R.id.data_calories);\n Double runningCalories = Double.parseDouble(TV_calories.getText().toString());\n System.out.println(\"calorie is :\"+runningCalories);\n\n // new an running \"entity\"\n Runningdata NewRunningdata = new Runningdata();\n NewRunningdata.setDistance(runningDistance);\n NewRunningdata.setCalorie(runningCalories);\n NewRunningdata.setStarttime(startTime);\n\n // using \"dao\" to manipulate database\n runningdao.insert(NewRunningdata);\n System.out.println(\"I did insertion\");\n }",
"public void WriteData(Products p)\n {\n auditService.writeLog(\"ENTER ProductServiceIO WriteData\");\n\n try {\n if(p instanceof Food){\n\n String sqlAdd = \"INSERT INTO products (`type`, `Name`, `Price`, `ExpireDate`) VALUES (?,?,?,?)\";\n PreparedStatement statement = connection.prepareStatement(sqlAdd);\n\n statement.setString(1, \"Food\");\n statement.setString(2, p.getProductName());\n statement.setDouble(3, p.getProductPrice());\n\n java.sql.Date x = new Date(((Food) p).getExpireDate().getTime());\n statement.setDate(4, x);\n\n statement.executeUpdate();\n\n }\n if(p instanceof Electronics){\n\n String sqlAdd = \"INSERT INTO products (`type`, `Name`, `Price`, `WarrentyTime`, `DeliveryPrice`) VALUES (?,?,?,?,?)\";\n PreparedStatement statement = connection.prepareStatement(sqlAdd);\n\n statement.setString(1, \"Electronics\");\n statement.setString(2, p.getProductName());\n statement.setDouble(3, p.getProductPrice());\n statement.setInt(4, ((Electronics) p).getWarrantyTime());\n statement.setDouble(5, ((Electronics) p).getDeliveryPrice());\n\n statement.executeUpdate();\n\n }\n if(p instanceof Furniture) {\n\n String sqlAdd = \"INSERT INTO products (`type`, `Name`, `Price`, `DeliveryPrice`, `Wantdelivery`) VALUES (?,?,?,?,?)\";\n PreparedStatement statement = connection.prepareStatement(sqlAdd);\n\n statement.setString(1, \"Furniture\");\n statement.setString(2, p.getProductName());\n statement.setDouble(3, p.getProductPrice());\n statement.setDouble(4, ((Furniture) p).getDeliveryPrice());\n statement.setString(5, String.valueOf(((Furniture) p).isWantDelivery()));\n\n statement.executeUpdate();\n }\n\n auditService.writeLog(\"EXIT ProductServiceIO WriteData\");\n }\n catch ( SQLException e) {\n e.printStackTrace();\n }\n }",
"int insert(DashboardGoods record);",
"@Override\r\n\tpublic void save(XftPayment xtp) {\n\t\ttry {\r\n\t\t\tlogger.info(\"save..........servicr.....:\"+JSONUtils.beanToJson(xtp));\t\r\n\t\t\txftPaymentMapper.insert(xtp);\r\n\t\t}catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"int insert(Goods record);",
"@Override\n\tpublic Produit saveProduit(Produit p) {\n\t\tString sql = \"INSERT INTO public.produit(id,designation, quantite, prix) VALUES ( ?,?, ?, ?)\";\n\t\t\n\t\tConnection connection = SingletonConnection.getConnection();\n\t\ttry {\n\t\t\t\n\t\t\tPreparedStatement ps = connection.prepareStatement(sql);\n\t\t\tps.setInt(1, p.getId());\n\t\t\tps.setString(2, p.getDesignation());\n\t\t\tps.setInt(3, p.getQuantite());\n\t\t\tps.setDouble(4, p.getPrix());\n\n\t\t\t\n\t\t\tps.executeUpdate();\n\t\t\t\n\t\t\t/*\n\t\t\t * Dans l'affichage nous aurons besoin de l'Id du produit\n\t\t\t * Pour recuperer l'Id du produit on execute une requete SELECT:\n\t\t\t */\n\n\t\t\t\n\t\t\tps.close();\n\t\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t// On retourne un object de type Produit. \n\t\treturn p;\n\t}",
"int insert(UserPonumberGoods record);",
"public void save()throws Exception{\n if(!pname1.getText().isEmpty() && !qty1.getText().isEmpty() && !prc1.getText().isEmpty() && !rsp1.getText().isEmpty() ){\r\n s_notif1.setId(\"hide\");\r\n ArrayList<Product> ar = new ArrayList<>();\r\n com.mysql.jdbc.Connection conn = db.getConnection();\r\n Statement stm = conn.createStatement();\r\n int rs = stm.executeUpdate(\"UPDATE products SET \"\r\n + \"name='\"+pname1.getText()+\"', \"\r\n + \"qty='\"+qty1.getText()+\"', \"\r\n + \"price='\"+prc1.getText()+\"',\"\r\n + \"re_stock_point='\"+rsp1.getText()+\"' WHERE ID ='\"+S_ID+\"';\");\r\n if(rs > 0){\r\n s_notif1.setId(\"show\");\r\n }\r\n }\r\n loadData();\r\n }",
"public void saveToDB(String sellerID, ArrayList<String> data) throws SQLException {\n\t\tString sql = \"update contactseller_seller_feedback_stastics set positive_month_1 = ?, positive_month_3= ?, positive_year_1= ?, positive_lifetime= ?, neutral_month_1= ?, neutral_month_3= ?, neutral_year_1= ?, neutral_lifetime= ?, negative_month_1= ?, negative_month_3= ?, negative_year_1= ?, negative_lifetime= ?, count_month_1= ?, count_month_3= ?, count_year_1= ?, count_lifetime= ? where seller_id = ? and country = ?\";\r\n\t\tPreparedStatement pstmt = conn.prepareStatement(sql);\r\n\r\n\t\tfor (int i = 0; i < data.size(); i++) {\r\n\t\t\tpstmt.setString(i + 1, data.get(i).replace(\",\", \"\"));\r\n\t\t}\r\n\t\tpstmt.setString(data.size() + 1, sellerID);\r\n\t\tpstmt.setString(data.size() + 2, this.country.toString());\r\n\t\tpstmt.addBatch();\r\n\t\tpstmt.executeBatch();\r\n\t\t// conn.close();\r\n\t\tSystem.out.println(\"inserted\");\r\n\r\n\t}",
"Rate save(Rate u);",
"int insert(SellType record);",
"int insert(Product record);",
"int insert(FinancialManagement record);",
"@Override\r\n\t@Transactional\r\n\tpublic void doService() {\n\t\tTbookingrecord booking = new Tbookingrecord();\r\n\t\tbooking.setId(Long.valueOf(31622L));\r\n\t\tbooking.setInstrumentid(2);\r\n\t\tbooking.setUserid(3);\r\n\t\tmappper.insertSelective(booking);\r\n\t\tlogger.debug(booking);\r\n\t\t//int i = 1/0;\r\n\t}",
"public void save()\n\t{\t\n\t\tfor (Preis p : items) {\n\t\t\titmDAO.create(p.getItem());\n\t\t\tprcDAO.create(p);\n\t\t}\n\t\tstrDAO.create(this);\n\t}",
"Product storeProduct(Product product);",
"private void insertItemPrice(final Price price) {\n try {\n boolean isItemExisting = false;\n ItemEntity knownItem = mDatabaseAccess.itemsDAO().selectItem(price.getId());\n // item is not known yet. Load the item via the REST API\n if (knownItem == null) {\n Item newItem = mItemAccess.getItemWithWifi(price.getId());\n if (newItem != null) {\n mDatabaseAccess.itemsDAO().insertItems(new ItemEntity(newItem));\n isItemExisting = true;\n }\n } else {\n isItemExisting = true;\n }\n\n // add the price only if the item reference is known and exists\n if (isItemExisting) {\n ItemPriceEntity newPrice = new ItemPriceEntity(\n price.getId(),\n price.getBuys().getUnitPrice(),\n price.getSells().getUnitPrice(),\n System.currentTimeMillis());\n mDatabaseAccess.itemsDAO().insertItemPrice(newPrice);\n } else {\n Log.w(TAG, String.format(\n \"The Item to the price id '%d' doesn't exist. the price will be skipped\",\n price.getId()));\n }\n } catch (Exception ex) {\n Log.e(TAG, \"Failed to process the item price with the ID: \" + price.getId(), ex);\n }\n }",
"HashMap saveOrderPaymentTE(long orderIdi,double monto,String hdnRa,String hdnVoucher,String hdnComentario,String hdnNumLogin,String hdnUser,int paymenttype,long paymentOrderQuotaId)throws SQLException, Exception, RemoteException;",
"int insert(ErpOaLicKey record);",
"int insert(CartDO record);",
"int insert(ScoreProduct record);",
"@Override\n\tpublic void saveEntityObj(StdMilkRate e) {\n\t}",
"@Test\r\n public void testSave() {\r\n try {\r\n // save via SkuPricingMappings\r\n Mockito.doAnswer(new Answer<Void>() {\r\n @Override\r\n public Void answer(InvocationOnMock invocation) throws Throwable {\r\n Object[] arguments = invocation.getArguments();\r\n if (arguments != null && arguments.length > 0 && arguments[0] != null) {\r\n SkuPriceMapping skuPriceMapping = (SkuPriceMapping) arguments[0];\r\n SkuPricingMappings.put(skuPriceMapping.getSku(), skuPriceMapping);\r\n }\r\n return null;\r\n }\r\n }).when(pricingDAOMock).save(Mockito.any(SkuPriceMapping.class));\r\n\r\n // getPrice via SkuPricingMappings\r\n Mockito.when(pricingDAOMock.getPrice(Mockito.anyString())).thenAnswer(new Answer<Integer>() {\r\n @Override\r\n public Integer answer(InvocationOnMock invocation) throws Throwable {\r\n Object[] arguments = invocation.getArguments();\r\n if (arguments != null && arguments.length > 0 && arguments[0] != null) {\r\n String sku = (String) arguments[0];\r\n if (SkuPricingMappings.containsKey(sku)) {\r\n return SkuPricingMappings.get(sku).getPrice();\r\n }\r\n }\r\n return null;\r\n }\r\n });\r\n \r\n SkuPriceMapping skuPriceMapping = new SkuPriceMapping(\"one\", 1);\r\n pricingService.save(skuPriceMapping);\r\n \r\n Integer expectedPrice = skuPriceMapping.getPrice();\r\n Integer actualPrice = pricingService.getPrice(skuPriceMapping.getSku());\r\n Assert.assertEquals(expectedPrice, actualPrice);\r\n \r\n // Verify behavior\r\n Mockito.verify(pricingDAOMock).save(skuPriceMapping);\r\n Mockito.verify(pricingDAOMock).getPrice(\"one\");\r\n \r\n } catch (SkuNotFoundException e) {}\r\n }",
"EmployeeDetail save(EmployeeDetail detail) throws DBException;",
"public void putNewPrice(String symbol, double price);",
"boolean saveExpense(Expenses exp);",
"private ContentValues storeProductInfo(long id) {\n // Reference to the Edit Text Field in the AddClient xml to the the user TYPE INPUT\n EditText et_product_name = findViewById(R.id.et_client_product);\n EditText et_product_dews = findViewById(R.id.et_client_dews);\n EditText et_product_actual_price = findViewById(R.id.et_client_product_actualPrice);\n EditText et_product_selling_price = findViewById(R.id.et_client_product_sellingPrice);\n EditText et_product_size = findViewById(R.id.et_client_product_size);\n String size = et_product_size.getText().toString().isEmpty()?\"null\":et_product_size.getText().toString();\n\n // this has the current date when the client as been has brought the product.\n String strTodayDate = getTodayDate();\n int actualPrice = Integer.parseInt(String.valueOf(et_product_actual_price.getText()).trim());\n int sellingPrice = Integer.parseInt(String.valueOf(et_product_selling_price.getText()).trim());\n // This content value is then inserted in the product info\n ContentValues productInfoValues = new ContentValues();\n productInfoValues.put(clientContract.ClientInfo.COLUMN_FK_ID,id);\n productInfoValues.put(clientContract.ClientInfo.COLUMN_PRODUCT_NAME,et_product_name.getText().toString().trim());\n productInfoValues.put(clientContract.ClientInfo.COLUMN_PRODUCT_SIZE,size);\n productInfoValues.put(clientContract.ClientInfo.COLUMN_ACTUAL_PRICE, actualPrice);\n productInfoValues.put(clientContract.ClientInfo.COLUMN_SELLING_PRICE,sellingPrice);\n productInfoValues.put(clientContract.ClientInfo.COLUMN_PROFIT,sellingPrice-actualPrice);\n productInfoValues.put(clientContract.ClientInfo.COLUMN_PROFILE_DATE,strTodayDate);\n productInfoValues.put(clientContract.ClientInfo.COLUMN_PAYMENT_MODE,mPaymentMode);\n productInfoValues.put(clientContract.ClientInfo.COLUMN_PRODUCT_IMAGE,getImage());\n String strDews = et_product_dews.getText().toString().trim();\n int dews = 0;\n if(!strDews.isEmpty()){\n dews = Integer.parseInt(et_product_dews.getText().toString().trim());\n }\n productInfoValues.put(clientContract.ClientInfo.COLUMN_PENDING,dews);\n return productInfoValues;\n }",
"public void setPrice(BigDecimal price) {\n this.price = price;\n }",
"public void setPrice(BigDecimal price) {\n this.price = price;\n }",
"int insert(Payment record);",
"@Override\n\tpublic int save(RotateBID record) {\n\t\trecord.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\tBigDecimal total= new BigDecimal(0);\n\t\tif(\"招标采购\".equals(record.getBidType())) {\n\t\t\tList<RotateBIDPurchase> purchaseList=record.getPurchaseList();\n\t\t\tfor(RotateBIDPurchase purchase:purchaseList) {\n\t\t\t\tpurchase.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\t\t\ttotal = total.add(purchase.getQuantity());\n\t\t\t}\n\t\t}else {\n\t\t\tList<RotateBIDSale> saleList=record.getSaleList();\n\t\t\tfor(RotateBIDSale sale:saleList) {\n\t\t\t\tsale.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\t\t\ttotal= total.add(sale.getTotal());\n\t\t\t}\n\t\t}\n\t\trecord.setTotal(total);\n\t\trecord.setCreateDate(new Date());\n//\t\trecord.setCreator(TokenManager.getToken().getName());\n\t\treturn dao.save(record);\n\t}",
"public void setPrice(BigDecimal price) {\r\n this.price = price;\r\n }",
"public void setPrice(BigDecimal price) {\r\n this.price = price;\r\n }",
"public boolean save(Product product);",
"public void saveData() {\n if (dataComplete()) {\n if(validLengths())\n {\n Item old_item = items.get(item_index);\n int item_purchase_status = 0;\n if (!item_purchased.isChecked()) {\n item_purchase_status = 1;\n }\n\n ds.open();\n Item new_item = new Item(old_item.id, item_name.getText().toString(), item_category.getText().toString(),\n item_description.getText().toString(), Double.parseDouble(item_price.getText().toString()), item_purchase_status);\n boolean success = ds.editEntry(new_item);\n ds.close();\n\n if (success) {\n exit();\n } else {\n empty_error.setVisibility(empty_error.INVISIBLE);\n overflow_error.setVisibility(overflow_error.INVISIBLE);\n unexpected_error.setVisibility(unexpected_error.VISIBLE);\n }\n }\n else\n {\n empty_error.setVisibility(empty_error.INVISIBLE);\n unexpected_error.setVisibility(unexpected_error.INVISIBLE);\n overflow_error.setVisibility(overflow_error.VISIBLE);\n }\n } else {\n unexpected_error.setVisibility(unexpected_error.INVISIBLE);\n overflow_error.setVisibility(overflow_error.INVISIBLE);\n empty_error.setVisibility(empty_error.VISIBLE);\n }\n }",
"int insert(ItoProduct record);",
"protected void saveValues() {\n dataModel.persist();\n }",
"public void saveJbdTravelPoint2014(JbdTravelPoint2014 jbdTravelPoint2014);",
"public void saveData ( ) {\n\t\tinvokeSafe ( \"saveData\" );\n\t}",
"public void setPrice(double price)\n {\n this.price = price;\n }",
"public void saveJpmProductSaleNew(JpmProductSaleNew jpmProductSaleNew);",
"public void setPrice(double price)\n {\n this.price = price;\n }",
"@Override\n\t@Transactional\n\tpublic Product createProduct(String name, Float price, Float weight, Supplier supplier, Date sdf) {\n\t\tProduct newProduct = new Product(name, price, supplier, weight, sdf);\n\t\treturn repository.persist(newProduct);\n\n\t}",
"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 setPriceEntered (BigDecimal PriceEntered);",
"public void setPrice(Date price) {\n this.price = price;\n }",
"int insert(OrderPO record);",
"private void insertData() {\n\n for (int i = 0; i < 3; i++) {\n ProveedorEntity proveedor = factory.manufacturePojo(ProveedorEntity.class);\n BonoEntity entity = factory.manufacturePojo(BonoEntity.class);\n int noOfDays = 8;\n Date dateOfOrder = new Date();\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(dateOfOrder);\n calendar.add(Calendar.DAY_OF_YEAR, noOfDays);\n Date date = calendar.getTime();\n entity.setExpira(date);\n noOfDays = 1;\n calendar = Calendar.getInstance();\n calendar.setTime(dateOfOrder);\n calendar.add(Calendar.DAY_OF_YEAR, noOfDays);\n date = calendar.getTime();\n entity.setAplicaDesde(date);\n entity.setProveedor(proveedor);\n em.persist(entity);\n ArrayList lista=new ArrayList<>();\n lista.add(entity);\n proveedor.setBonos(lista);\n em.persist(proveedor);\n pData.add(proveedor);\n data.add(entity); \n }\n }",
"public void saveOrUpdatePosPay(PosPay posPay) throws DataAccessException;",
"public abstract void saveOrder(Order order);",
"private void insertData() {\r\n \r\n TeatroEntity teatro = factory.manufacturePojo(TeatroEntity.class);\r\n em.persist(teatro);\r\n FuncionEntity funcion = factory.manufacturePojo(FuncionEntity.class);\r\n List<FuncionEntity> lista = new ArrayList();\r\n lista.add(funcion);\r\n em.persist(funcion);\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n sala.setFuncion(lista);\r\n em.persist(sala);\r\n data.add(sala);\r\n }\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n em.persist(sala);\r\n sfdata.add(sala);\r\n }\r\n \r\n }"
] | [
"0.6641166",
"0.6618838",
"0.6530976",
"0.64706355",
"0.64513516",
"0.6417909",
"0.63966006",
"0.63644373",
"0.6328773",
"0.6136618",
"0.6123842",
"0.61123896",
"0.60986286",
"0.6069324",
"0.60490966",
"0.6044331",
"0.6022922",
"0.6009948",
"0.6002936",
"0.60009575",
"0.59991294",
"0.5980376",
"0.59621125",
"0.59447134",
"0.59291756",
"0.5924724",
"0.592175",
"0.5910582",
"0.5896003",
"0.5886127",
"0.58830094",
"0.58722025",
"0.5867283",
"0.58420664",
"0.5828514",
"0.5821589",
"0.58211684",
"0.5821148",
"0.5804259",
"0.5790612",
"0.57838625",
"0.57820606",
"0.5778581",
"0.5778581",
"0.57686675",
"0.5759693",
"0.57592857",
"0.5746688",
"0.5742234",
"0.57394165",
"0.57295257",
"0.5726281",
"0.5721941",
"0.5721173",
"0.57195705",
"0.5714757",
"0.57102954",
"0.5708398",
"0.5707585",
"0.5702246",
"0.5700068",
"0.56972367",
"0.5697193",
"0.5676946",
"0.5675102",
"0.56721956",
"0.56690717",
"0.5666183",
"0.566448",
"0.5663198",
"0.56610227",
"0.5659719",
"0.56550753",
"0.56455505",
"0.5635924",
"0.56333244",
"0.5627825",
"0.5627825",
"0.5624484",
"0.5622287",
"0.5610871",
"0.5610871",
"0.56083643",
"0.5602114",
"0.56020933",
"0.5598755",
"0.55965894",
"0.5594187",
"0.5589815",
"0.55861896",
"0.55854785",
"0.5583941",
"0.5579584",
"0.5578231",
"0.5570708",
"0.5566763",
"0.5565733",
"0.55618864",
"0.55581665",
"0.55571496"
] | 0.64519954 | 4 |
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread. The general contract of the method run is that it may take any action whatsoever. | @Override
public void run() {
try {
evenSemaphore.acquire();
while (true) {
if(count % 2 == 0){
System.out.println(Thread.currentThread().getName() + " 偶数 " + count);
count++;
if (count > 20) {
return;
}
oddSemaphore.release();
evenSemaphore.acquire();
TimeUnit.SECONDS.sleep(1);
}
if (count > 20) {
break;
}
}
} catch (InterruptedException e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface Startable extends Runnable {\n \n /**\n * Waits until the thread this object is running in is finished before returning.\n */\n public void join();\n \n /**\n * Checks whether the component is done with its work.\n * @return <code>true</code> if the component is finished its work\n */\n public boolean isDone();\n \n /**\n * Sets the thread that this object is running in.\n * \n * @param t the thread that this object is running in\n */\n public void setThread(Thread t);\n\n /**\n * Gets the thread that this object is running in.\n * \n * @return the thread that this object is running in\n */\n public Thread getThread();\n\n}",
"public void run(){\n //logic to execute in a thread \n }",
"private void startRunnableThread() {\n customRunnable = new CustomRunnable();\n customThread = new CustomThread(customRunnable);\n customRunnable.setTag(customThread.tag);\n customThread.start();\n\n }",
"void startThread();",
"ThreadStart createThreadStart();",
"public final void run() {\r\n }",
"void runInThread(Runnable runnable) {\n try {\n Thread thread = new Thread(runnable::run);\n thread.start();\n } catch (Exception ex) {\n log.info(ex.getMessage());\n }\n\n }",
"@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tinvoke();\n\t\t\t\t\t}",
"public interface MainThread {\n void post(Runnable runnable);\n}",
"public MyRunnable(){\t\n\t}",
"@Override\n // Thread creation\n // Run method from the Runnable class.\n public void run() {\n p.println(\"Current thread = \" + Thread.currentThread().getName());\n // Shows when a task is being executed concurrently with another thread,\n // then puts the thread to bed (I like saying that)\n try {\n p.println(\"Doing a task during : \" + name);\n Thread.currentThread().sleep(time);\n }\n // Exception for when a thread is interrupted.\n catch (InterruptedException e) {\n e.printStackTrace();\n }\n }",
"public void start() {\n // EFFECTS: starts a new thread from this instance.\n (new Thread(instance)).start();\n }",
"public void run() {\r\n }",
"@Override\r\n public Thread newThread(Runnable r) {\n Thread t = new Thread(r, \"example-runner\");\r\n t.setDaemon(true);\r\n return t;\r\n }",
"@Override\r\n\tpublic Thread newThread(Runnable arg0) {\n\t\treturn null;\r\n\t}",
"@Override\r\n\tabstract public void run();",
"public void run();",
"public void run();",
"public void run();",
"public void run();",
"public void run();",
"public void start() {\n\n\t\tif (worker.isAlive()) {\n\t\t\tthrow new IllegalStateException(\n\t\t\t \"Worker thread is still alive, unexpected.\");\n\t\t}\n\n\t\tif (runflag.get()) {\n\t\t\tthrow new IllegalStateException(\n\t\t\t \"Runflag is inconsistant with thread, unexpected.\");\n\t\t}\n\n\t\trunflag.set(true);\n\t\tworker.start();\n\t}",
"public void createThread() {\n }",
"public void run() {\n }",
"public void run() {\n }",
"public void run() {\n }",
"public void run() {\n }",
"public synchronized void start() {\n\t\tif (running)\n\t\t\treturn;\n\t\tthread = new Thread(this);\n\t\tthread.start();\n\t\trunning = true;\n\t}",
"public void start ()\n {\n Thread th = new Thread (this);\n // start this thread\n th.start ();\n\n }",
"public void run()\n {\n }",
"public void run()\n {\n }",
"@Override\r\n\tpublic abstract void run();",
"public void start() {\n if (runner == null) {\n runner = new Thread(this, \"Runner\");\n runner.start();\n }\n }",
"public synchronized void start() {\r\n\t\tthread = new Thread(this);\r\n\t\tthread.start();\r\n\t\tisRunning = true;\r\n\t }",
"public void run()\n\t{\n\t}",
"public void run () { run (true); }",
"public IThread createThread() throws IllegalWriteException, BBException;",
"public synchronized void dispatch(Runnable runnable) {\n\t\tif (!isStart) {\n\t\t\tthrow new IllegalStateException();\n\t\t}\n\t\tif (runnable != null) {\n\t\t\tqueue.push(runnable);\n\t\t} else {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t}",
"public void start() {\n\t\tmyThread = new Thread(this); myThread.start();\n\t}",
"interface Runnable {\n void execute() throws Throwable;\n default void run() {\n try {\n execute();\n } catch(Throwable t) {\n throw new RuntimeException(t);\n }\n }\n }",
"@Override\n public void startThread() {\n Log.d(TAG, \"Starting \" + getName() + \" thread!\");\n if (!started)\n start();\n running = enabled;\n doStartAction();\n }",
"@Override\n abstract public void run();",
"public interface Interactor extends Runnable {\n void run();\n}",
"@Override\n protected Thread createThread(final Runnable runnable, final String name) {\n return new Thread(runnable, Thread.currentThread().getName() + \"-exec\");\n }",
"public void start() {\n if (!started) {\n thread = new Thread(this);\n thread.start();\n started = true;\n }\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tSystem.out.println(\"Thread working\");\n\t\t\t}",
"public void run() {\n }",
"@Override\n\tpublic Thread newThread(Runnable r) {\n\t\t\n\t\tThread th = new Thread(r,\" custum Thread\");\n\t\treturn th;\n\t}",
"public void run() {/* THE CODE HERE IS A THE @OVERRIDE FOR START() METHOD */\n\t}",
"public void run() {\n\n }",
"public void run()\n {\n\n }",
"public void start() {\n thread = new Thread(this);\n thread.setPriority(Thread.MIN_PRIORITY);\n thread.start();\n }",
"public synchronized void start() {\n if (!running) {\n running = true;\n thread = new Thread(this);\n thread.start();\n }\n }",
"public synchronized void start() {\n if (!running) {\n running = true;\n thread = new Thread(this);\n thread.start();\n }\n }",
"public void run() {\n\n\n }",
"@Override\r\n public void run() {}",
"public void run(){\n\t}",
"public void start()\n\t{\n\t\tthread = new Thread(this);\n\t\tthread.start();\n\t}",
"@Override\n\tpublic void run() {\n\t\tsuper.run();\n\t}",
"private interface CheckedRunnable {\n void run() throws Exception;\n }",
"public synchronized void start() {\n if (!this.isRunning) {\n isRunning = true;\n thread = new Thread(this);\n thread.start();\n }\n }",
"public void startThread(){\n\t\trunning = true;\n\t\tthread = new Thread(this);\n\t\tthread.start();\n\t}",
"public void Start() {\r\n\t\tthread.run();\r\n\t}",
"private void start(){\n isRunning = true;\n thread = new Thread(this);\n thread.start();\n }",
"public void run() {\n\t}",
"public void run() {\n\t}",
"public Thread startThread() {\n Thread thread = createThread();\n thread.start();\n return thread;\n }",
"private void startNormalThread() {\n customThread = new CustomThread();\n customThread.start();\n }",
"public void run() {\n super.run();\n }",
"public void start(){\n thread.start();\n }",
"@Override\npublic void run() {\n perform();\t\n}",
"@Override\n public void run()\n {\n super.run();\n }",
"@Override\n\tpublic void run()\n\t{\n\t}",
"public static void run(){}",
"private Thread startTestThread(Runnable runnable) {\n Thread t = new Thread(runnable);\n t.setDaemon(true);\n return t;\n }",
"@Override\n protected void runInListenerThread(Runnable runnable) {\n runnable.run();\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\"ok, here is \" + Thread.currentThread().getName() + \" \" + \"thread, i'll do something here..\");\n\t\t\t}",
"public void run() {\r\n\t\t// overwrite in a subclass.\r\n\t}",
"public void start() {\n\t\tai = new Thread(this);\n\t\tai.start();\n\t}",
"public abstract void run();",
"public abstract void run();",
"public abstract void run();",
"public static OnRun onRun( Runnable run )\n\t{\n\t\treturn new OnRun( run );\n\t}",
"public static void run() {\n }",
"public void run() {\n System.out.println(ANSI_GREEN + \"Hello from anonymous class thread\");\n }",
"@Override\n public void run() {\n }",
"public void start() {\r\n isRunning = true;\r\n Thread thread = new myThread();\r\n thread.start();\r\n }",
"public void start() {\n\t\tif(t == null) {\n\t\t\tt = new Thread(this);\n\t\t\tt.start();\n\t\t}\n\t}",
"public synchronized void start() {\r\n\r\n\t\tif (!running) {\r\n\t\t\trunning = true;\r\n\t\t\tnew Thread(this, name).start();\r\n\t\t}\r\n\t}",
"public void start() {\n\n\t\tisRunning = true;\n\t\tthread = new Thread(this);\n\t\tthread.start();\n\n\t}",
"@Override\n public synchronized void start()\n {\n if (run)\n return;\n run = true;\n super.start();\n }",
"private static void ThreadCreationOldWay() {\r\n\t\tThread t1 = new Thread(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\tSystem.out.println(\"This is a runnable method done in old fashion < 1.8\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tt1.start();\r\n\t}",
"void runInAudioThread(Runnable runnable) {\n executor.execute(runnable);\n }",
"public void start() {\r\n\t\trunning = true;\r\n\t\tt = new Thread(this);\r\n\t\tt.start();\r\n\t}",
"@Override\n\tpublic void run() {\n\t\tLog.i(tag, \"run\");\n\t}",
"public void run()\r\n\t{\r\n\t\t\r\n\t}",
"public final void run() {\n //We get a hold on the thread where this unit is going to be executed\n //so shutdown() can interrupt it if called.\n thread = Thread.currentThread();\n running = true;\n \n try {\n init();\n } catch (RuntimeException ex) {\n stop();\n aborted = true;\n onRunAborted(ex);\n }\n\n try {\n if (!isFinished() && !isStopping()) {\n internalRun();\n }\n } catch (RuntimeException ex) {\n aborted = true;\n onRunAborted(ex);\n throw ex;\n } finally {\n try {\n cleanup();\n } catch (RuntimeException ex) {\n onRunAborted(ex);\n }\n\n running = false;\n //Remove the thread reference\n thread = null;\n }\n }",
"public static void main(String args[ ]){\r\nMythread rt = new Mythread(); /* main thread created the runnable object*/\r\nThread t = new Thread(rt); /*main thread creates child thread and passed the runnable object*/\r\nt.start();\r\nfor(int i=0; i<10; i++){\r\nSystem.out.println(\"Main Thread\");\r\n}\r\n}",
"public void startThread(View view) {\n //startNormalThread();\n startRunnableThread();\n }",
"public Thread startAndRun() {\r\n\t\tThread gameThread = new Thread(this, \"Coffee Bean Game Thread\");\r\n\t\tgameThread.start();\r\n\r\n\t\treturn gameThread;\r\n\t}",
"public void start() {\r\n running = true;\r\n new Thread(this).start();;\r\n }"
] | [
"0.70473224",
"0.6959602",
"0.68878573",
"0.67356926",
"0.6643415",
"0.6577995",
"0.65193015",
"0.64961",
"0.64958775",
"0.64664197",
"0.6445248",
"0.6440278",
"0.63915735",
"0.63882184",
"0.6380882",
"0.63735896",
"0.6365825",
"0.6365825",
"0.6365825",
"0.6365825",
"0.6365825",
"0.63543785",
"0.63454515",
"0.63437545",
"0.63437545",
"0.63437545",
"0.63437545",
"0.63392586",
"0.63368493",
"0.6327092",
"0.6327092",
"0.63239115",
"0.6321643",
"0.6301088",
"0.62997013",
"0.6297369",
"0.6283746",
"0.6277204",
"0.62668836",
"0.62612015",
"0.62602514",
"0.6251977",
"0.6250475",
"0.6249973",
"0.6242773",
"0.62417054",
"0.62377614",
"0.62300646",
"0.62264925",
"0.62208146",
"0.6220532",
"0.6204852",
"0.6201891",
"0.6201891",
"0.61734533",
"0.6170797",
"0.61686003",
"0.61657786",
"0.6165558",
"0.616299",
"0.6161155",
"0.6156426",
"0.61504734",
"0.614835",
"0.6148117",
"0.6148117",
"0.61437917",
"0.61338526",
"0.6124855",
"0.6106988",
"0.6105737",
"0.6094519",
"0.60895914",
"0.607938",
"0.6078346",
"0.6075824",
"0.6071704",
"0.60705787",
"0.606861",
"0.60676324",
"0.60676324",
"0.60676324",
"0.6065932",
"0.6064583",
"0.60640186",
"0.60613763",
"0.6059428",
"0.6053541",
"0.6042298",
"0.6030652",
"0.6027097",
"0.6019386",
"0.6014102",
"0.60088587",
"0.6001446",
"0.5994374",
"0.59904784",
"0.59899616",
"0.5980388",
"0.598031",
"0.59799296"
] | 0.0 | -1 |
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread. The general contract of the method run is that it may take any action whatsoever. | @Override
public void run() {
try {
evenSemaphore.acquire();
while (true) {
if(count % 2 != 0){
System.out.println(Thread.currentThread().getName() + " 奇数 " + count);
count++;
if (count > 20) {
return;
}
evenSemaphore.release();
oddSemaphore.acquire();
TimeUnit.SECONDS.sleep(1);
}
}
} catch (InterruptedException e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface Startable extends Runnable {\n \n /**\n * Waits until the thread this object is running in is finished before returning.\n */\n public void join();\n \n /**\n * Checks whether the component is done with its work.\n * @return <code>true</code> if the component is finished its work\n */\n public boolean isDone();\n \n /**\n * Sets the thread that this object is running in.\n * \n * @param t the thread that this object is running in\n */\n public void setThread(Thread t);\n\n /**\n * Gets the thread that this object is running in.\n * \n * @return the thread that this object is running in\n */\n public Thread getThread();\n\n}",
"public void run(){\n //logic to execute in a thread \n }",
"private void startRunnableThread() {\n customRunnable = new CustomRunnable();\n customThread = new CustomThread(customRunnable);\n customRunnable.setTag(customThread.tag);\n customThread.start();\n\n }",
"void startThread();",
"ThreadStart createThreadStart();",
"public final void run() {\r\n }",
"void runInThread(Runnable runnable) {\n try {\n Thread thread = new Thread(runnable::run);\n thread.start();\n } catch (Exception ex) {\n log.info(ex.getMessage());\n }\n\n }",
"@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tinvoke();\n\t\t\t\t\t}",
"public interface MainThread {\n void post(Runnable runnable);\n}",
"public MyRunnable(){\t\n\t}",
"@Override\n // Thread creation\n // Run method from the Runnable class.\n public void run() {\n p.println(\"Current thread = \" + Thread.currentThread().getName());\n // Shows when a task is being executed concurrently with another thread,\n // then puts the thread to bed (I like saying that)\n try {\n p.println(\"Doing a task during : \" + name);\n Thread.currentThread().sleep(time);\n }\n // Exception for when a thread is interrupted.\n catch (InterruptedException e) {\n e.printStackTrace();\n }\n }",
"public void start() {\n // EFFECTS: starts a new thread from this instance.\n (new Thread(instance)).start();\n }",
"public void run() {\r\n }",
"@Override\r\n public Thread newThread(Runnable r) {\n Thread t = new Thread(r, \"example-runner\");\r\n t.setDaemon(true);\r\n return t;\r\n }",
"@Override\r\n\tpublic Thread newThread(Runnable arg0) {\n\t\treturn null;\r\n\t}",
"@Override\r\n\tabstract public void run();",
"public void run();",
"public void run();",
"public void run();",
"public void run();",
"public void run();",
"public void start() {\n\n\t\tif (worker.isAlive()) {\n\t\t\tthrow new IllegalStateException(\n\t\t\t \"Worker thread is still alive, unexpected.\");\n\t\t}\n\n\t\tif (runflag.get()) {\n\t\t\tthrow new IllegalStateException(\n\t\t\t \"Runflag is inconsistant with thread, unexpected.\");\n\t\t}\n\n\t\trunflag.set(true);\n\t\tworker.start();\n\t}",
"public void createThread() {\n }",
"public void run() {\n }",
"public void run() {\n }",
"public void run() {\n }",
"public void run() {\n }",
"public synchronized void start() {\n\t\tif (running)\n\t\t\treturn;\n\t\tthread = new Thread(this);\n\t\tthread.start();\n\t\trunning = true;\n\t}",
"public void start ()\n {\n Thread th = new Thread (this);\n // start this thread\n th.start ();\n\n }",
"public void run()\n {\n }",
"public void run()\n {\n }",
"public void start() {\n if (runner == null) {\n runner = new Thread(this, \"Runner\");\n runner.start();\n }\n }",
"@Override\r\n\tpublic abstract void run();",
"public synchronized void start() {\r\n\t\tthread = new Thread(this);\r\n\t\tthread.start();\r\n\t\tisRunning = true;\r\n\t }",
"public void run()\n\t{\n\t}",
"public void run () { run (true); }",
"public IThread createThread() throws IllegalWriteException, BBException;",
"public synchronized void dispatch(Runnable runnable) {\n\t\tif (!isStart) {\n\t\t\tthrow new IllegalStateException();\n\t\t}\n\t\tif (runnable != null) {\n\t\t\tqueue.push(runnable);\n\t\t} else {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t}",
"public void start() {\n\t\tmyThread = new Thread(this); myThread.start();\n\t}",
"@Override\n public void startThread() {\n Log.d(TAG, \"Starting \" + getName() + \" thread!\");\n if (!started)\n start();\n running = enabled;\n doStartAction();\n }",
"interface Runnable {\n void execute() throws Throwable;\n default void run() {\n try {\n execute();\n } catch(Throwable t) {\n throw new RuntimeException(t);\n }\n }\n }",
"@Override\n abstract public void run();",
"public interface Interactor extends Runnable {\n void run();\n}",
"@Override\n protected Thread createThread(final Runnable runnable, final String name) {\n return new Thread(runnable, Thread.currentThread().getName() + \"-exec\");\n }",
"public void start() {\n if (!started) {\n thread = new Thread(this);\n thread.start();\n started = true;\n }\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tSystem.out.println(\"Thread working\");\n\t\t\t}",
"public void run() {\n }",
"@Override\n\tpublic Thread newThread(Runnable r) {\n\t\t\n\t\tThread th = new Thread(r,\" custum Thread\");\n\t\treturn th;\n\t}",
"public void run() {/* THE CODE HERE IS A THE @OVERRIDE FOR START() METHOD */\n\t}",
"public void run() {\n\n }",
"public void run()\n {\n\n }",
"public void start() {\n thread = new Thread(this);\n thread.setPriority(Thread.MIN_PRIORITY);\n thread.start();\n }",
"public synchronized void start() {\n if (!running) {\n running = true;\n thread = new Thread(this);\n thread.start();\n }\n }",
"public synchronized void start() {\n if (!running) {\n running = true;\n thread = new Thread(this);\n thread.start();\n }\n }",
"public void run() {\n\n\n }",
"@Override\r\n public void run() {}",
"public void start()\n\t{\n\t\tthread = new Thread(this);\n\t\tthread.start();\n\t}",
"public void run(){\n\t}",
"@Override\n\tpublic void run() {\n\t\tsuper.run();\n\t}",
"public synchronized void start() {\n if (!this.isRunning) {\n isRunning = true;\n thread = new Thread(this);\n thread.start();\n }\n }",
"private interface CheckedRunnable {\n void run() throws Exception;\n }",
"public void startThread(){\n\t\trunning = true;\n\t\tthread = new Thread(this);\n\t\tthread.start();\n\t}",
"public void Start() {\r\n\t\tthread.run();\r\n\t}",
"private void start(){\n isRunning = true;\n thread = new Thread(this);\n thread.start();\n }",
"public void run() {\n\t}",
"public void run() {\n\t}",
"public Thread startThread() {\n Thread thread = createThread();\n thread.start();\n return thread;\n }",
"private void startNormalThread() {\n customThread = new CustomThread();\n customThread.start();\n }",
"public void run() {\n super.run();\n }",
"public void start(){\n thread.start();\n }",
"@Override\npublic void run() {\n perform();\t\n}",
"@Override\n public void run()\n {\n super.run();\n }",
"@Override\n\tpublic void run()\n\t{\n\t}",
"public static void run(){}",
"private Thread startTestThread(Runnable runnable) {\n Thread t = new Thread(runnable);\n t.setDaemon(true);\n return t;\n }",
"@Override\n protected void runInListenerThread(Runnable runnable) {\n runnable.run();\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\"ok, here is \" + Thread.currentThread().getName() + \" \" + \"thread, i'll do something here..\");\n\t\t\t}",
"public void start() {\n\t\tai = new Thread(this);\n\t\tai.start();\n\t}",
"public void run() {\r\n\t\t// overwrite in a subclass.\r\n\t}",
"public abstract void run();",
"public abstract void run();",
"public abstract void run();",
"public static OnRun onRun( Runnable run )\n\t{\n\t\treturn new OnRun( run );\n\t}",
"public void run() {\n System.out.println(ANSI_GREEN + \"Hello from anonymous class thread\");\n }",
"public static void run() {\n }",
"public void start() {\r\n isRunning = true;\r\n Thread thread = new myThread();\r\n thread.start();\r\n }",
"@Override\n public void run() {\n }",
"public void start() {\n\t\tif(t == null) {\n\t\t\tt = new Thread(this);\n\t\t\tt.start();\n\t\t}\n\t}",
"public synchronized void start() {\r\n\r\n\t\tif (!running) {\r\n\t\t\trunning = true;\r\n\t\t\tnew Thread(this, name).start();\r\n\t\t}\r\n\t}",
"public void start() {\n\n\t\tisRunning = true;\n\t\tthread = new Thread(this);\n\t\tthread.start();\n\n\t}",
"@Override\n public synchronized void start()\n {\n if (run)\n return;\n run = true;\n super.start();\n }",
"private static void ThreadCreationOldWay() {\r\n\t\tThread t1 = new Thread(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\tSystem.out.println(\"This is a runnable method done in old fashion < 1.8\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tt1.start();\r\n\t}",
"void runInAudioThread(Runnable runnable) {\n executor.execute(runnable);\n }",
"public void start() {\r\n\t\trunning = true;\r\n\t\tt = new Thread(this);\r\n\t\tt.start();\r\n\t}",
"@Override\n\tpublic void run() {\n\t\tLog.i(tag, \"run\");\n\t}",
"public void run()\r\n\t{\r\n\t\t\r\n\t}",
"public final void run() {\n //We get a hold on the thread where this unit is going to be executed\n //so shutdown() can interrupt it if called.\n thread = Thread.currentThread();\n running = true;\n \n try {\n init();\n } catch (RuntimeException ex) {\n stop();\n aborted = true;\n onRunAborted(ex);\n }\n\n try {\n if (!isFinished() && !isStopping()) {\n internalRun();\n }\n } catch (RuntimeException ex) {\n aborted = true;\n onRunAborted(ex);\n throw ex;\n } finally {\n try {\n cleanup();\n } catch (RuntimeException ex) {\n onRunAborted(ex);\n }\n\n running = false;\n //Remove the thread reference\n thread = null;\n }\n }",
"public static void main(String args[ ]){\r\nMythread rt = new Mythread(); /* main thread created the runnable object*/\r\nThread t = new Thread(rt); /*main thread creates child thread and passed the runnable object*/\r\nt.start();\r\nfor(int i=0; i<10; i++){\r\nSystem.out.println(\"Main Thread\");\r\n}\r\n}",
"public void start() {\r\n running = true;\r\n new Thread(this).start();;\r\n }",
"public Thread startAndRun() {\r\n\t\tThread gameThread = new Thread(this, \"Coffee Bean Game Thread\");\r\n\t\tgameThread.start();\r\n\r\n\t\treturn gameThread;\r\n\t}",
"public void startThread(View view) {\n //startNormalThread();\n startRunnableThread();\n }"
] | [
"0.70486647",
"0.69597656",
"0.68883115",
"0.67373145",
"0.6644344",
"0.6578161",
"0.65179926",
"0.64961547",
"0.64943063",
"0.6465665",
"0.6443635",
"0.64434725",
"0.63917446",
"0.63879454",
"0.6379522",
"0.6372614",
"0.6365644",
"0.6365644",
"0.6365644",
"0.6365644",
"0.6365644",
"0.635816",
"0.63444424",
"0.6343813",
"0.6343813",
"0.6343813",
"0.6343813",
"0.6342508",
"0.63391775",
"0.6327277",
"0.6327277",
"0.6324864",
"0.6322937",
"0.63044643",
"0.62999827",
"0.6297874",
"0.628196",
"0.62771165",
"0.62700784",
"0.62620467",
"0.6259564",
"0.62507623",
"0.6249143",
"0.6247489",
"0.6246156",
"0.6242443",
"0.6237669",
"0.6228293",
"0.62272686",
"0.62208885",
"0.6220756",
"0.6207702",
"0.6205109",
"0.6205109",
"0.61735237",
"0.6170319",
"0.616902",
"0.6168809",
"0.6165251",
"0.61642617",
"0.616105",
"0.6159043",
"0.6153514",
"0.61508286",
"0.6148351",
"0.6148351",
"0.6145686",
"0.61352545",
"0.61250436",
"0.61101574",
"0.6104578",
"0.60942656",
"0.6089291",
"0.60797274",
"0.6078567",
"0.6074785",
"0.6072855",
"0.6071753",
"0.6070143",
"0.60668176",
"0.60668176",
"0.60668176",
"0.6064968",
"0.60648245",
"0.6064678",
"0.60624",
"0.6061024",
"0.60567206",
"0.6045435",
"0.60337025",
"0.6029297",
"0.6017678",
"0.6012949",
"0.601168",
"0.60010666",
"0.59948033",
"0.5991198",
"0.5990117",
"0.59832036",
"0.59819764",
"0.5981051"
] | 0.0 | -1 |
/ put bubblesort in deeper nested loops. To improve this takes a crossover of bubblesort and a deletion of the whole block (Harder than simply deleting bloat) does the magnitude of the outer loop matter? its removal is an optimisation, regardless of if it adds 0 or 1 wasted loops. | public Sort1LoopCloneProblem(int numReps){
setString(numReps);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void bubbleSort(long [] a){\n\t\tint upperBound=a.length-1;\n\t\tint lowerBound =0;\n\t\tint swaps=0;\n\t\tint iterations=0;\n\t\twhile(upperBound>=lowerBound){\n\t\t\tfor(int i=0,j=1;i<=upperBound && j<=upperBound; j++,i++){\n\t\t\t\tlong lowerOrderElement = a[i];\n\t\t\t\tlong upperOrderElement = a[j];\n\t\t\t\titerations++;\n\t\t\t\tif(lowerOrderElement>upperOrderElement){ //swap positions\n\t\t\t\t\ta[i] = a[j];\n\t\t\t\t\ta[j]= lowerOrderElement;\n\t\t\t\t\tswaps=swaps+1;\n\t\t\t\t}\n\t\t\t\telse{ // sorted.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tupperBound--;\n//\t\tSystem.out.println(\"upperBound:- \" +upperBound);\n//\t\tSystem.out.println(\"lowerBound:- \" +lowerBound);\n\t\t}displayArr(a);\n\t\t\n\t\tSystem.out.println(\"Total Swaps:- \" + swaps);\n\t\tSystem.out.println(\"Total Iterations:- \" + iterations);\n\t}",
"public void bubbleSort() {\n\t\tint n = data.size();\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\tfor (int j = 1; j < n - i; j++) {\n\t\t\t\tif (data.get(j - 1) > data.get(j)) {\n\t\t\t\t\tswap(j, j - 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}",
"private static Integer[] optimisedBubbleSort(Integer[] n) {\n int len = n.length - 1;\n boolean swapped = false;\n for (int i = 0; i < len; i++) {\n for (int j = 0; j < len - i; j++) {\n if (n[j] > n[j + 1]) {\n int temp = n[j];\n n[j] = n[j + 1];\n n[j + 1] = temp;\n swapped = true;\n }\n }\n if(swapped == false) {\n break;\n }\n }\n return n;\n }",
"public static void bubbleSortAlgo(int[] arr) {\n for(int i = 1; i<arr.length-1; i++){\n // inner loop to compare each element with it's next one in every iteration in one complete outer loop\n for(int j = 0; j<arr.length -1; j++){\n if(isSmaller(arr, j+1, j)){ // compares the jth element from it's next element\n swap(arr, j+1, j); // if ismaller condition is true swaps both the elements\n }\n }\n }\n \n }",
"public void bubbleSort() {\n \tfor (int i = 0; i < contarElementos()-1; i++) {\n\t\t\tboolean intercambiado= false;\n\t\t\tfor (int j = 0; j < contarElementos()-1; j++) {\n\t\t\t\tif (encontrarNodoEnElndice(j).getElemento().compareTo(encontrarNodoEnElndice(j+1).getElemento())>0) {\n\t\t\t\t\tintercambiar(j, j+1);\n\t\t\t\t\tintercambiado=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!intercambiado) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n }",
"static int[] bubbleSort(int[] a) {\n int n = a.length;\n while(n > 0) {\n int newLastN = 0; // if no swap occurred in last step we won't need to run next iteration\n for (int i = 1; i < n; i++) {\n comparisonCount++;\n if (a[i - 1] > a[i]) {\n swapCount++;\n swap(a, i - 1, i);\n newLastN = i;\n }\n }\n n = newLastN;\n }\n return a;\n }",
"public void bubbleSort(){\n for(int i = arraySize -1; i > 1; i--){\n for(int j = 0; j < i; j++){\n // Use < to change it to Descending order\n if(theArray[j] > theArray[j+1]){\n swapValues(j, j+1);\n printHorizontalArray(i, j);\n }\n printHorizontalArray(i, j);\n }\n }\n }",
"public void bubbleSort(ArrayList <Integer> list){\n System.out.println();\n System.out.println(\"Bubble Sort\");\n System.out.println();\n\n steps = 0;\n for (int outer = 0; outer < list.size() - 1; outer++){\n for (int inner = 0; inner < list.size()-outer-1; inner++){\n steps += 3;//count one compare and 2 gets\n if (list.get(inner)>(list.get(inner + 1))){\n steps += 4;//count 2 gets and 2 sets\n int temp = list.get(inner);\n list.set(inner,list.get(inner + 1));\n list.set(inner + 1,temp);\n }\n }\n }\n }",
"@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 }",
"void bubbleSort(int arr[]) {\r\n\r\n int n = arr.length;\r\n boolean swapped;\r\n for(int i = 0; i < n-1; i++) { //denotes pass #\r\n for(int j = 0; j < n-i-1; j++) { //denotes element in the pass\r\n if(arr[j] > arr[j+1]) {\r\n //swapping of the element\r\n arr[j] += arr[j+1];\r\n arr[j+1] = arr[j] - arr[j+1];\r\n arr[j] -= arr[j+1];\r\n swapped = true;\r\n\r\n } //end of if block\r\n }//end of element checking loop\r\n //if no 2 elements were swapped by inner loop, then break\r\n if (swapped == false)\r\n break;\r\n }//end of pass loop\r\n }",
"public static void bubbleSort(Array a) {\n int temp;\n for (int i = 0; i < a.length - 1; i++) { // for passes\n int flag = 0;\n for (int j = 0; j < a.length - 1 - i; j++) { // for iteration\n if (a.get(j) > a.get(j + 1)) {\n temp = a.get(j);\n a.set(j, a.get(j + 1));\n a.set(j + 1, temp);\n flag = 1;\n }\n }\n if (flag == 0) break; // if the list is already sorted\n }\n }",
"public void wiggleSortSubOptimal(int[] nums) {\n Arrays.sort(nums);\n \n for (int i = 1; i < nums.length - 1; i += 2)\n swap(nums, i, i + 1);\n }",
"public void sort(){\n for(int i = array.length-1;i >= 0;i--){\n sink(i);\n }\n while(size > 0){\n swap(0, size-1);\n size -= 1;\n sink(0);\n }\n }",
"public void bubbleSort() {\n boolean unordered = false;\n do {\n unordered = false;\n for (int i = 0; i < array.length - 1; i++) {\n if (((Comparable) array[i]).compareTo(array[i + 1]) > 0) {\n T temp = array[i + 1];\n array[i + 1] = array[i];\n array[i] = temp;\n unordered = true;\n }\n }\n } while (unordered);\n }",
"static void bubbleSort(int[] arr) {\n\t\tboolean swapped; //using swapped for optimization, inner loop will continue only if swapping is possible\n\t\tfor(int i=0;i<arr.length-1;i++) {\n\t\t\tswapped =false;\n\t\t\tfor(int j =0;j<arr.length-i-1;j++) {\n\t\t\t\tif(arr[j]>arr[j+1]) {\n\t\t\t\t\tint temp = arr[j+1]; \n\t\t arr[j+1] = arr[j]; \n\t\t arr[j] = temp;\n\t\t swapped = true;\n\t\t\t\t}\n\t\t\t\t// IF no two elements were \n\t // swapped by inner loop, then break \n\t\t\t\t if (swapped == false) \n\t\t break;\n\t\t\t}\n\t\t}\n\t\tfor(int a:arr) \n\t\t{ \n\t\t\tSystem.out.print(a+ \" \");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t}",
"public void setBubbleSort() \n\t{\n\t\tint last = recordCount + NOT_FOUND; //array.length() - 1\n\n\t\twhile(last > RESET_VALUE) //last > 0\n\t\t{\n\t\t\tint localIndex = RESET_VALUE; \n\t\t\tboolean swap = false;\n\n\t\t\twhile(localIndex < last) \n\t\t\t{\n\t\t\t\tif(itemIDs[localIndex] > itemIDs[localIndex + 1]) \n\t\t\t\t{\n\t\t\t\t\tsetSwapArrayElements(localIndex);\n\t\t\t\t\tswap = true;\n\t\t\t\t}\n\t\t\t\tlocalIndex++;\n\t\t\t}\n\n\t\t\tif(swap == false) \n\t\t\t{\n\t\t\t\tlast = RESET_VALUE;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tlast = last + NOT_FOUND;\n\t\t\t}\n\n\t\t}//END while(last > RESET_VALUE)\n\t\treturn;\n\t}",
"public static void bubbleSort() {\r\n\t\tfor(int i = nodeArrList.size() -1; i > 0; i--) {\r\n\t\t\tfor(int j = 0; j < i; j++) {\r\n\t\t\t\tif(nodeArrList.get(j).frequency > nodeArrList.get(j +1).frequency) {\r\n\t\t\t\t\tHuffmanNode temp = nodeArrList.get(j);\r\n\t\t\t\t\tnodeArrList.set(j, nodeArrList.get(j + 1));\r\n\t\t\t\t\tnodeArrList.set(j + 1, temp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static void sortBubble(int[] tab) {\n boolean alreadySorted=false;\n int temp;\n int n=tab.length;\n int i=0;\n if(tab.length!=0){\n while (i<n-1 && !alreadySorted){\n alreadySorted=true;\n for (int j=0; j<n-1-i;j++){\n if (tab[j]>tab[j+1]){\n alreadySorted=false;\n temp=tab[j];\n tab[j]=tab[j+1];\n tab[j+1]=temp;\n }\n }\n i=i+1;\n }\n }\n}",
"public static void BubbleSort(int[] a) {\n\t int n = a.length;\n\t int temp = 0;\n\n\t for(int i = 0; i < n; i++) {\n\t for(int j=1; j < (n-i); j++) {\n\t if(a[j-1] > a[j]) {\n\t temp = a[j-1];\n\t a[j-1] = a[j];\n\t a[j] = temp;\n\t }\n\t }\n\t }\n\t}",
"private void bubbleSort(T[] arr) {\n boolean swaps;\n for (int i = 0; i < n - 1; i++) { // since we always compare two elements, we will need to iterate up to (n - 1) times\n swaps = false;\n for (int j = 1; j < n - i; j++) // we reduce the inspected area by one element at each loop, because the largest element will already be pushed to the right\n if (arr[j].compareTo(arr[j - 1]) < 0) {\n swap(arr, j, j - 1); // the swap method is implemented further\n swaps = true;\n }\n if (!swaps) break; // we stop if there were no swaps during the last iteration\n }\n }",
"public void oldSort()\n\t{\n\t\tfor (int index = 0; index < arraySize; index++) {\n\t\t\tfor (int secondIndex = index + 1; secondIndex < arraySize; secondIndex++) {\n\t\t\t\tint temp = 0;\n\t\t\t\tif (array[index] > array[secondIndex]) {\n\t\t\t\t\ttemp = array[index];\n\t\t\t\t\tarray[index] = array[secondIndex];\n\t\t\t\t\tarray[secondIndex] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public static void bubbleSort(int [] arr){\n int temp = 0; //temporary variable\n boolean flag = false; //mark if any reversion has happened\n for (int i = 0; i < arr.length - 1;i++){\n\n for (int j = 0; j < arr.length - 1-i; j++) {\n //if the previous number is bigger than the latter, reverse\n if (arr[j] > arr[j + 1]) {\n flag = true;\n temp = arr[j];\n arr[j] = arr[j + 1];\n arr[j + 1] = temp;\n }\n }\n\n //System.out.printf(\"After the %d round of sorting\",i+1);\n //System.out.println(Arrays.toString(arr));\n\n if(!flag){\n break;\n } else {\n flag = false;\n //reset flag to true to do the next check\n }\n }\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public void bubbleSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2; //init, check condition\r\n\t\tfor (int i = list.size() - 1; i >= 0; i --){\r\n\t\t\tsteps += 2; //init, check condition\r\n\t\t\tfor (int j = 0; j < i ; j ++){\r\n\t\t\t\tsteps += 5;\r\n\t\t\t\tif (list.get(j).compareTo(list.get(j + 1)) < 0){\r\n\t\t\t\t\tsteps += 2;\r\n\t\t\t\t\tswap(list, j, j + 1);\r\n\t\t\t\t\tsteps += 5;\r\n\t\t\t\t}\r\n\t\t\t\tsteps += 2;\r\n\t\t\t}\r\n\t\t\tsteps += 2;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Bubble Sort\");\r\n\t\tSystem.out.println();\r\n\t}",
"@Override\n\t\tpublic void run() {\n\t\t\tfor (int i = 0; i < 1000000; i++) {\n\t\t\t\tint[] a = Util.generateRandomArray(500, 200000);\n\t\t\t\tint[] b = a.clone();\n\t\t\t\t\n\t\t\t\ta = sort(a);\n\t\t\t\tArrays.sort(b);\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < b.length; j++) {\n\t\t\t\t\tUtil.Assert(a[j] == b[j], \"shit\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Heap sort ok\");\n\t\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"\\tSelection\\tBubble\\tInsertion\\tCollections\\tQuick\\tinPlaceQuick\\tMerge\");\r\n\t\tfor (int n = 1000; n <= 7000; n += 500) {\r\n\t\t\tAPArrayList<Double> lists = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listb = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listi = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listc = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listq = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listipq = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listm = new APArrayList<Double>();\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\t\tDouble val = Math.random();\r\n\t\t\t\tlists.add(val);\r\n\t\t\t\tlistb.add(val);\r\n\t\t\t\tlisti.add(val);\r\n\t\t\t\tlistc.add(val);\r\n\t\t\t\tlistq.add(val);\r\n\t\t\t\tlistipq.add(val);\r\n\t\t\t\tlistm.add(val);\r\n\t\t\t}\r\n\r\n\t\t\tlong selStartTime = System.nanoTime();\r\n\t\t\tlists.selectionSort();\r\n\t\t\tlong selEndTime = System.nanoTime();\r\n\t\t\tlong selSortTime = selEndTime - selStartTime;\r\n\t\t\tlists.clear();\r\n\t\t\t\r\n\t\t\tlong bubStartTime = System.nanoTime();\r\n\t\t\tlistb.bubbleSort();\r\n\t\t\tlong bubEndTime = System.nanoTime();\r\n\t\t\tlong bubSortTime = bubEndTime - bubStartTime;\r\n\t\t\tlistb.clear();\r\n\t\t\t\r\n\t\t\tlong insStartTime = System.nanoTime();\r\n\t\t\tlisti.insertionSort();\r\n\t\t\tlong insEndTime = System.nanoTime();\r\n\t\t\tlong insSortTime = insEndTime - insStartTime;\r\n\t\t\tlisti.clear();\r\n\t\t\t\r\n\t\t\tlong CollStartTime = System.nanoTime();\r\n\t\t\tlistc.sort();\r\n\t\t\tlong CollEndTime = System.nanoTime();\r\n\t\t\tlong CollSortTime = CollEndTime - CollStartTime;\r\n\t\t\tlistc.clear();\r\n\t\t\t\r\n\t\t\tlong quickStartTime = System.nanoTime();\r\n\t\t\tlistq.simpleQuickSort();\r\n\t\t\tlong quickEndTime = System.nanoTime();\r\n\t\t\tlong quickSortTime = quickEndTime - quickStartTime;\r\n\t\t\tlistq.clear();\r\n\t\t\t\r\n\t\t\tlong inPlaceQuickStartTime = System.nanoTime();\r\n\t\t\tlistipq.inPlaceQuickSort();\r\n\t\t\tlong inPlaceQuickEndTime = System.nanoTime();\r\n\t\t\tlong inPlaceQuickSortTime = inPlaceQuickEndTime - inPlaceQuickStartTime;\r\n\t\t\tlistipq.clear();\r\n\t\t\t\r\n\t\t\tlong mergeStartTime = System.nanoTime();\r\n\t\t\tlistm.mergeSort();\r\n\t\t\tlong mergeEndTime = System.nanoTime();\r\n\t\t\tlong mergeSortTime = mergeEndTime - mergeStartTime;\r\n\t\t\tlistq.clear();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(n + \"\\t\" + selSortTime + \"\\t\" + bubSortTime + \"\\t\" + insSortTime + \"\\t\" + CollSortTime + \"\\t\" + quickSortTime + \"\\t\" + inPlaceQuickSortTime + \"\\t\" + mergeSortTime);\r\n\t\t}\r\n\t}"
] | [
"0.63851166",
"0.62953085",
"0.62743723",
"0.6254775",
"0.6239921",
"0.62176687",
"0.62123173",
"0.61141574",
"0.6111701",
"0.6105639",
"0.6049964",
"0.6040918",
"0.6012974",
"0.6003301",
"0.60020745",
"0.5980459",
"0.59384507",
"0.59377855",
"0.5915532",
"0.5895548",
"0.5883523",
"0.58767474",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.58699906",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5869743",
"0.5797168",
"0.57847065",
"0.57532954"
] | 0.0 | -1 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. | @Override
public Type evaluateType() throws Exception {
return new IntegerType();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void habilitar() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"@Override\r\n\t\tpublic void action()\r\n\t\t{\r\n// throw new UnsupportedOperationException(\"Not supported yet.\");\r\n\t\t}",
"public void remove()\n/* */ {\n/* 99 */ throw new UnsupportedOperationException();\n/* */ }",
"public void remove()\n/* */ {\n/* 110 */ throw new UnsupportedOperationException();\n/* */ }",
"@Override\n public boolean isSupported() {\n return true;\n }",
"@Override\n public String toString() {\n throw new UnsupportedOperationException(\"implement me!\");\n }",
"private void cargartabla() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"private void HargaKamera() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"@Override\n public void remove() {\n throw new UnsupportedOperationException(); \n }",
"@Override\r\npublic int method() {\n\treturn 0;\r\n}",
"@Override\n\tpublic void remove() {\n\t\tthrow new UnsupportedOperationException();\t\t\n\t}",
"@Override\n\tpublic void remove() {\n\t\tthrow new UnsupportedOperationException();\t\t\n\t}",
"@Override\n public boolean isSupported() {\n return true;\n }",
"private static UnsupportedOperationException getModificationUnsupportedException()\n {\n throw new UnsupportedOperationException(\"Illegal operation. Specified list is unmodifiable.\");\n }",
"@Override\r\n public void remove() throws UnsupportedOperationException {\r\n throw new UnsupportedOperationException(\"Me ei poisteta\");\r\n }",
"Boolean mo1305n() {\n throw new UnsupportedOperationException(getClass().getSimpleName());\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"public boolean isEnabled() {\n/* 945 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\r\n\t\t\tpublic void remove() {\r\n\t\t\t\tthrow new UnsupportedOperationException();\r\n\t\t\t}",
"@Override\r\n\t\tpublic void remove() {\r\n\t\t\tthrow new UnsupportedOperationException();\r\n\t\t}",
"void Salvar(String nome) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"protected void input_back(){\n throw new UnsupportedOperationException();\n }",
"@Override\n\tpublic void remove() {\n\t\tthrow new UnsupportedOperationException();\n\t}",
"public UnsupportedCycOperationException() {\n super();\n }",
"public int getListSelection() {\n/* 515 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public void remove(){\r\n\t\t\tthrow new UnsupportedOperationException();\r\n\t\t}",
"@SuppressWarnings(\"static-method\")\n\tpublic void open() {\n\t\tthrow new UnsupportedOperationException();\n\t}",
"@Override\n\t\t\tpublic void remove() {\n\t\t\t\tthrow new UnsupportedOperationException();\n\t\t\t}",
"@Override\n public void remove() {\n throw new UnsupportedOperationException();\n }",
"@Override\n public void remove() {\n throw new UnsupportedOperationException();\n }",
"@Override\n public void remove() {\n throw new UnsupportedOperationException();\n }",
"private void atualizar_tbl_pro_profs() {\n throw new UnsupportedOperationException(\"Not supported yet.\");\n//To change body of generated methods, choose Tools | Templates.\n }",
"@Override\n\t/**\n\t * feature is not supported\n\t */\n\tpublic void remove() {\n\t}",
"@Override\n public void remove() {\n throw new UnsupportedOperationException();\n }",
"@Override\n public void remove() {\n throw new UnsupportedOperationException();\n }",
"public void remove() throws UnsupportedOperationException {\n\t\t\tthrow new UnsupportedOperationException(\"Myö ei poisteta\");\n\t\t}",
"private String printStackTrace() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"@Override\n public void makeVisible() {\n throw new UnsupportedOperationException(\"operation not supported\");\n }",
"public void _reportUnsupportedOperation() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"Operation not supported by parser of type \");\n sb.append(getClass().getName());\n throw new UnsupportedOperationException(sb.toString());\n }",
"@Override\r\n public void actionPerformed(ActionEvent e) {\r\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\r\n }",
"public void remove() {\r\n \r\n throw new UnsupportedOperationException();\r\n }",
"public void showDropDown() {\n/* 592 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public void remove() {\n\t\tthrow new UnsupportedOperationException();\n\t}",
"public void remove() {\n\t\tthrow new UnsupportedOperationException();\n\t}",
"public int zzef() {\n throw new UnsupportedOperationException();\n }",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n public String toString() {\n throw new UnsupportedOperationException();\n //TODO: Complete this method!\n }",
"@Override\npublic boolean isEnabled() {\n\treturn false;\n}",
"@Override\n public void refresh() {\n throw new UnsupportedOperationException(\"operation not supported\");\n }",
"public boolean isImportantForAccessibility() {\n/* 1302 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n public String writeToString() {\n throw new UnsupportedOperationException();\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}",
"private String getText() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"@Deprecated\n/* */ public int getActions() {\n/* 289 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n\tprotected Object clone() {\n\t\tthrow new UnsupportedOperationException();\n\t}",
"public String getDisplayVariant() {\n/* 656 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n public boolean getObsolete()\n {\n return false;\n }",
"@Override\n public void close() {\n throw new UnsupportedOperationException(\"Not supported yet.\");\n }",
"public String getName() {\n/* 341 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\npublic boolean isEnabled() {\n\treturn true;\n}",
"public int mo1265e() {\n throw new UnsupportedOperationException(getClass().getSimpleName());\n }",
"public MissingMethodArgumentException() {\n }",
"public ListAdapter getAdapter() {\n/* 431 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public CollectionItemInfo getCollectionItemInfo() {\n/* 1114 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public CharSequence getContentDescription() {\n/* 1531 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n public void cancel() {\n throw new UnsupportedOperationException();\n }",
"public void remove() {\n throw new UnsupportedOperationException();\r\n }",
"@Override\n public final void remove() {\n throw new UnsupportedOperationException();\n }",
"public void remove() {\n throw new UnsupportedOperationException();\n }",
"public void remove() {\n throw new UnsupportedOperationException();\n }",
"public void remove() {\r\n throw new UnsupportedOperationException();\r\n }",
"public void remove() throws UnsupportedOperationException {\n\t\t\tthrow new UnsupportedOperationException( \"remove() Not implemented.\" );\n\t\t}",
"private ExampleVersion() {\n throw new UnsupportedOperationException(\"Illegal constructor call.\");\n }",
"public boolean isSelected() {\n/* 3021 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"private void chk() {\n if (clist != null)\n throw new UnsupportedOperationException();\n }",
"public void remove() {\n\t\t\tthrow new UnsupportedOperationException();\n\t\t}",
"@Override\n\tpublic void e() {\n\n\t}",
"public boolean isEditable() {\n/* 1014 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n\tpublic int method() {\n\t\treturn 0;\n\t}",
"private void m50366E() {\n }",
"@Deprecated\n\tprivate void oldCode()\n\t{\n\t}",
"public boolean mo1266f() {\n throw new UnsupportedOperationException(getClass().getSimpleName());\n }",
"public void remove() {\n throw new UnsupportedOperationException();\n }",
"@Override\n public void actionPerformed(ActionEvent ae) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"private void someUtilityMethod() {\n }",
"private void someUtilityMethod() {\n }",
"public void remove() {\n throw new UnsupportedOperationException();\n }",
"public void remove() {\n throw new UnsupportedOperationException();\n }",
"private CollectionUtils() {\n\t\tthrow new UnsupportedOperationException();\n\t}",
"default boolean isDeprecated() {\n return false;\n }",
"public String formNotImplemented()\r\n {\r\n return formError(\"501 Method not implemented\",\"Service not implemented, programer was lazy\");\r\n }",
"@Override\n\tpublic String getMoreInformation() {\n\t\tthrow new UnsupportedOperationException();\n\t}",
"public void m23075a() {\n }",
"private void setText() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"@Override\n\tpublic void dosomething() {\n\t\t\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"public int getObjectPropCode() {\n/* 108 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public void toggle() {\n/* 135 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public String getSuggestSelection() {\n/* 113 */ throw new RuntimeException(\"Stub!\");\n/* */ }"
] | [
"0.77446616",
"0.73747396",
"0.69675475",
"0.69103026",
"0.679555",
"0.6773403",
"0.6770247",
"0.6653279",
"0.6639254",
"0.6624963",
"0.6609852",
"0.6609852",
"0.65904075",
"0.6587144",
"0.6556081",
"0.6498715",
"0.646223",
"0.64508164",
"0.6429958",
"0.6420191",
"0.63830656",
"0.6381792",
"0.6380077",
"0.6374775",
"0.63646626",
"0.6360934",
"0.63585365",
"0.6354074",
"0.6334804",
"0.6334804",
"0.6334804",
"0.63308907",
"0.63252705",
"0.6323875",
"0.6323875",
"0.6315088",
"0.62904316",
"0.627976",
"0.62779266",
"0.6273486",
"0.6265351",
"0.62468797",
"0.62265015",
"0.62265015",
"0.6220381",
"0.62034804",
"0.62021",
"0.6199093",
"0.6199054",
"0.6193756",
"0.6192856",
"0.6178756",
"0.6178756",
"0.6164126",
"0.61629283",
"0.61600536",
"0.6146004",
"0.61259615",
"0.6124475",
"0.61239016",
"0.6121794",
"0.61143947",
"0.6112622",
"0.6108596",
"0.6102378",
"0.60911953",
"0.60900307",
"0.6089391",
"0.60871637",
"0.60867316",
"0.60867316",
"0.6080782",
"0.60579383",
"0.6057934",
"0.6049543",
"0.6046169",
"0.60433006",
"0.60249174",
"0.602282",
"0.6016133",
"0.60160875",
"0.6014706",
"0.6008987",
"0.6007667",
"0.5997495",
"0.5994424",
"0.5987989",
"0.5987989",
"0.5986435",
"0.5986435",
"0.5982427",
"0.59808403",
"0.5978356",
"0.596971",
"0.59673727",
"0.5966042",
"0.59653425",
"0.5962882",
"0.59572893",
"0.59524727",
"0.5951003"
] | 0.0 | -1 |
private static String userFileName; private static String | public User(String email, String username, String password)
{
this.email = email;
this.username = username;
this.password = password;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"File getFile() { return user_file; }",
"public String getFileName ();",
"public String getFileName() {\n/* 43:43 */ return this.fileName;\n/* 44: */ }",
"public String GetFileName() {\r\n\treturn fileName;\r\n }",
"public String getFILE_NAME() { return FILE_NAME; }",
"String getFileName();",
"String getFileName();",
"String getFileName();",
"String getFileName();",
"String getFileName();",
"public String getFileName();",
"public String getFileName();",
"public String getFileName() \n {\n return fileName;\n }",
"public abstract String getFileName();",
"public String getFileName()\r\n {\r\n return sFileName;\r\n }",
"private RandomAccessFile getUserFile(String username) {\n\t\tchar firstChar = username.toLowerCase().charAt(0); // LOWERCASE\n\t\tif((firstChar >= 'a' && firstChar <= 'z')) {\n\t\t\tsynchronized(this.usersFiles) {\n\t\t\t\tif(this.usersFiles[firstChar-97] == null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.usersFiles[firstChar-97] = new RandomAccessFile(this.baseDir + \"users/\" + firstChar + \".dat\", \"rw\");\n\t\t\t\t\t\treturn this.usersFiles[firstChar-97];\n\t\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn this.usersFiles[firstChar-97];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tsynchronized(this.usersFiles) {\n\t\t\t\tif(this.usersFiles[26] == null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.usersFiles[26] = new RandomAccessFile(this.baseDir + \"users/symbols.dat\", \"rw\");\n\t\t\t\t\t\treturn this.usersFiles[26];\n\t\t\t\t\t}\n\t\t\t\t\tcatch(FileNotFoundException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn this.usersFiles[26];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public String getFileName(){\n\t\treturn _fileName;\n\t}",
"protected String getFileName() {\n\t\treturn fileName;\n\t}",
"public String getFileName()\r\n {\r\n return fileName;\r\n }",
"public String getFileName()\n {\n return getString(\"FileName\");\n }",
"String getUserDatabaseFilePath();",
"public String getFileName(){\n\t\treturn fileName;\n\t}",
"protected String getFileNamePath()\n {\n String sep = System.getProperty(\"file.separator\", \"/\");\n// String path = System.getProperty(\"user.dir\", \".\");\n\n String filename = getPath() + sep + \"sec.dat\";\n\n return filename;\n }",
"protected String getSharedFileName()\n\t\t{\n\t\t\treturn null;\n\t\t}",
"@Override\n\tprotected String getFileName() {\n\t\treturn null;\n\t}",
"public void setFileName(String fileName) {\n/* 39:39 */ this.fileName = fileName;\n/* 40: */ }",
"public String getCustomFileName()\r\n {\r\n return customFileName;\r\n }",
"public String getBaseName () {\n \n return this.username;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName()\r\n/* 11: */ {\r\n/* 12:45 */ return this.fileName;\r\n/* 13: */ }",
"void set(File local,String name,UserFileType ft)\n{\n user_file = local;\n if (user_file != null && (name == null || name.length() == 0)) \n name = user_file.getName();\n if (name.startsWith(\"/s6/\")) {\n name = name.substring(4);\n }\n else if (name.startsWith(\"s:\")) {\n name = name.substring(2);\n }\n access_name = name;\n file_mode = ft;\n}",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"@Override\n protected String getFileName() {\n return null;\n }",
"@Override\n protected String getFileName() {\n return null;\n }",
"@Override\n protected String getFileName() {\n return null;\n }",
"public static File name(Scanner user) {\n System.out.println(\"Input file name\");\n String fileName = user.nextLine();\n File file = new File(fileName);\n return file;\n }",
"public String getFileName ()\n\t{\n\t\treturn FileName;\n\t}",
"public String getDataFileName() {\treturn dataFileName;\t}",
"@Override\n protected String getFileName() {\n return path;\n }",
"public final String getFileName()\r\n {\r\n return _fileName;\r\n }",
"public String getFileName() {\r\n return fileName;\r\n }",
"public String getFileName() {\r\n return fileName;\r\n }",
"public String getFileName() {\r\n return fileName;\r\n }",
"public static File getUserDir()\n {\n return fUserDir;\n }",
"public String getFileName()\r\n\t{\r\n\t\treturn settings.getFileName();\r\n\t}",
"@Override\n\tpublic String getFileName() {\n\t\treturn null;\n\t}",
"BucsUserFile(File f,String unm,UserFileType ft)\n{\n this();\n set(f,unm,ft);\n}",
"private String getFileName() {\n\t\t// retornamos el nombre del fichero\n\t\treturn this.fileName;\n\t}",
"private String nakedFileName() {\n return f.getName().split(\"\\\\.\")[0];\n }",
"public String getFileName()\n\t{\n\t\treturn fileName;\n\t}",
"public String getFileName()\n\t{\n\t\treturn fileName;\n\t}",
"public String filename (){\r\n\t\t\treturn _filename;\r\n\t\t}",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"String getFilename();",
"public String getFile_name() {\n\t\treturn file_name;\n\t}",
"String getFilePath();",
"public static String getUserConfigFileName(Context context, String userId) {\r\n\t\tString result = \"\";\r\n\t\tif (TextUtils.isEmpty(userId)) {\r\n\t\t\treturn result;\r\n\t\t} else {\r\n\t\t\tSharedPreferences prefs = PreferenceManager\r\n\t\t\t\t\t.getDefaultSharedPreferences(context);\r\n\t\t\tif (prefs != null) {\r\n\t\t\t\tString key = getUserConfigFileNameKey(userId);\r\n\t\t\t\tresult = prefs.getString(key, \"\");\r\n\t\t\t\tif (TextUtils.isEmpty(result)) {\r\n\t\t\t\t\tresult = String.format(\"user-config-%s\", userId);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}",
"public void setFileName(String fileName)\r\n/* 16: */ {\r\n/* 17:49 */ this.fileName = fileName;\r\n/* 18: */ }",
"@Override\n public String getFilename()\n {\n return \"\";\n }",
"File getFilePath()\r\n\t{\r\n\t\treturn fFilePath;\r\n\t}",
"public String getFilename();",
"public String getOriginalFileName();",
"@Test\r\n\tpublic void getFileName() {\n\t\tString test = \"form-data; name=\\\"uploadFile\\\"; filename=\\\"james.png\\\"\";\r\n\r\n\t\t/***When***/\r\n\t\tString result = futil.getFileName(test);\r\n\t\t/***Then***/\r\n\t\t//assertEquals(\"sally.png\", result);\r\n\t\tassertEquals(\"james.png\", result);\r\n\r\n\t}",
"@Override\n public Path getUserPrefsFilePath() {\n return userPrefsStorage.getUserPrefsFilePath();\n }",
"public String getFileName() {\n return this.fileName;\n }",
"public String getFileName() {\n return this.fileName;\n }",
"public String getFilename(){\n\t\treturn filename;\n\t}",
"public String getFilename(){\n\t\treturn filename;\n\t}",
"public String getDataFileName() {\n return dataFileName;\n }",
"public String getFileName() {\r\n\t\treturn fileName;\r\n\t}",
"public String getFileName() {\r\n\t\treturn fileName;\r\n\t}",
"public String getFileName() {\r\n\t\treturn fileName;\r\n\t}",
"public String getFileName() {\n return filename;\n }",
"public String getFilename()\n {\n return filename;\n }",
"public String getFileName() {\n\t\treturn fileName;\n\t}",
"public String getFileName() {\n\t\treturn fileName;\n\t}",
"public String getFileName() {\n\t\treturn fileName;\n\t}",
"public String getFileName() {\n\t\treturn fileName;\n\t}",
"public String getFileName() {\n\t\treturn fileName;\n\t}",
"protected String getRoleFileName() \n\t{\n\t\treturn roleFileName;\n\t}",
"private String beautiplyFileNameReferer() {\r\n\r\n\t\tif (checkBeautiplyImagesExixtence()) {\r\n\t\t\ttry {\r\n\t\t\t\tString fname = beautiplyFileNameGenerator();\r\n\t\t\t\tFileInputStream fis = context.openFileInput(fname);\r\n\t\t\t\treturn fname;\r\n\t\t\t} catch (FileNotFoundException e4) {\r\n\t\t\t\treturn beautiplyFileNameReferer();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\r\n\t}",
"public void setFileName(String fileName)\r\n {\r\n sFileName = fileName;\r\n }",
"public String getFilename()\r\n\t{\r\n\t\treturn _filename; \r\n\t}",
"public String getFilename() {\n\treturn(filename);\n }"
] | [
"0.6960743",
"0.6785937",
"0.67281544",
"0.6675303",
"0.6650943",
"0.65997154",
"0.65997154",
"0.65997154",
"0.65997154",
"0.65997154",
"0.6598829",
"0.6598829",
"0.65867406",
"0.6565726",
"0.65152526",
"0.64911604",
"0.6435627",
"0.64072716",
"0.64023155",
"0.6369962",
"0.6362067",
"0.63559955",
"0.6346515",
"0.63228196",
"0.63134164",
"0.6312324",
"0.6302849",
"0.628499",
"0.6284032",
"0.6272585",
"0.6237416",
"0.62244934",
"0.62244934",
"0.62244934",
"0.62244934",
"0.62244934",
"0.62244934",
"0.62244934",
"0.62244934",
"0.62244934",
"0.6216039",
"0.6216039",
"0.6216039",
"0.620706",
"0.6174193",
"0.61720884",
"0.61669904",
"0.6162342",
"0.6151622",
"0.6151622",
"0.6151622",
"0.6141877",
"0.6138777",
"0.61320096",
"0.6118439",
"0.61167353",
"0.6087775",
"0.6081314",
"0.6081314",
"0.60758585",
"0.60753083",
"0.60753083",
"0.60753083",
"0.60753083",
"0.60753083",
"0.60753083",
"0.60753083",
"0.60753083",
"0.60753083",
"0.60753083",
"0.60578597",
"0.6051637",
"0.60393196",
"0.6033472",
"0.6020041",
"0.5989032",
"0.5962443",
"0.59533876",
"0.5949481",
"0.59343344",
"0.59222126",
"0.5920047",
"0.5920047",
"0.59197795",
"0.59197795",
"0.59147465",
"0.59095776",
"0.59095776",
"0.59095776",
"0.59050715",
"0.58973706",
"0.58928293",
"0.58928293",
"0.58928293",
"0.58928293",
"0.58928293",
"0.58917207",
"0.58798015",
"0.5877512",
"0.5856582",
"0.5849708"
] | 0.0 | -1 |
Advance the iterator and set the new voteBlock. | void nextVoteBlock() {
try {
if (iter.hasNext()) {
voteBlock = iter.next();
} else {
voteBlock = null;
}
} catch (IOException e) {
// Even if the error is transient, we are trying to keep in
// synch. If we later tried to catch up, we could have a
// bunch of URLs we'd already counted for other voters. So
// call this Entry finished.
installErrorIterator(e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void nextVoteBlock(Entry e) {\n // There's no way to tell the PriorityQueue that the entry has\n // changed, and needs to be resorted, other than remove/add.\n participantsQueue.remove(e);\n e.nextVoteBlock();\n participantsQueue.add(e);\n }",
"public abstract void setNextBlockInstant();",
"private void setNextSuccessor() {\n if (lastBlock != null) // if it is the first block, do nothing\n lastBlock.addSuccessor(currentBlock);\n blocks.add(currentBlock); // Add currentBlock to the global list of blocks\n lastBlock = currentBlock;\n }",
"public void setNext()\n {\n\t int currentIndex = AL.indexOf(currentObject);\n\t currentObject = AL.get(currentIndex +1);\n\t \n\t// never let currentNode be null, wrap to head\n\tif (currentObject == null)\n\t\tcurrentObject = firstObject;\n }",
"public void next(){\n\t\tif(generated)\n\t\t\tcurr++;\n\t}",
"public void next(){\n\t\tboundIndex = (boundIndex+1)%buttonBounds.length;\n\t\tupdateButtonBounds();\n\t}",
"public void next() {\n\t\titerator.next();\n\t}",
"public abstract void blockNext();",
"@Override\n public void advance() {\n if (isCurrent()) {\n prev = cursor;\n cursor = cursor.getNext();\n } else {\n throw new IllegalStateException(\"There is no current element.\");\n }\n }",
"ListIter (int index){\n int blockNum=0;\n int aggSize=0;\n while (aggSize+dataBlocks[blockNum].getSize() <= index){\n aggSize+=dataBlocks[blockNum].getSize();\n blockNum++;\n }\n cursorBlock = blockNum;\n cursorElement = index-aggSize;\n cursor = index;\n }",
"public void next() {\n if (hasNext()) {\n setPosition(position + 1);\n }\n }",
"public void next()\n\t{\n\t\tif(this.curseur < this.listeTapis.size() - 1)\n\t\t{\n\t\t\tthis.curseur++;\n\t\t}\n\t}",
"@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public void putNext(Waiter waiter, Waiter newValue) {\n this.waiterNextUpdater.lazySet(waiter, newValue);\n }",
"public void nextSet(){\n this.fillVector();\n }",
"public abstract void generateNextBlock();",
"public abstract void setNextBlockResource(int resourceNum);",
"public void advance( )\r\n {\r\n\t if(isCurrent() != true){// Implemented by student.\r\n\t throw new IllegalStateException(\"no current element\");\r\n\t }\r\n\t else\r\n\t \t precursor = cursor;\r\n\t \t cursor = cursor.getLink(); // Implemented by student.\r\n }",
"void updateBlock(Block block) ;",
"public void next() {\n\t\telements[(currentElement - 1)].turnOff();\n\t\tif (elements.length > currentElement) {\n\t\t\telements[currentElement].turnOn();\n\t\t\tcurrentElement++;\n\t\t} else {\n\t\t\texit();\n\t\t}\n\t}",
"public void nextHard() {\n\t\titerator.next();\n\t}",
"public void setNextNode(ElectionNode nextNode) {\r\n this.nextNode = nextNode;\r\n }",
"private void setNextIterator() {\n\t\t\t\n\t\t\tfor (int i = index; i < inconsistencies.size(); i++){\n\t\t\t\tSet<LPGInconsistency> inconsistencyList = inconsistencies.get(i);\n\t\t\t\tif (!inconsistencyList.isEmpty()) {\n\t\t\t\t\titerator = inconsistencyList.iterator();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tindex++;\n\t\t\t}\n\t\t}",
"protected void assignCurrentValue() {\n\t\tcurrentValue = new Integer(counter + incrValue);\n\t}",
"@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public void putNext(Waiter waiter, Waiter newValue) {\n waiter.next = newValue;\n }",
"@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public void putNext(Waiter waiter, Waiter newValue) {\n UNSAFE.putObject(waiter, WAITER_NEXT_OFFSET, newValue);\n }",
"@Override\n\tpublic void initIterator() {\n\t\tcurrentUser = 0;\n\t}",
"private final void advance() {\n if (currentIterator == null) {\n currentIterator = intMaps[index].entrySet().iterator();\n } else {\n if (!currentIterator.hasNext()) {\n // we want advance to next iterator only when this iterator is exhausted\n if (index < intMaps.length - 1) {\n // we can advance to next iterator only if currentIterator is not the last iterator\n ++index;\n if (!fetched[index]) {\n GetAllCustomMap.this.fetchValuesForIndex(index);\n }\n currentIterator = intMaps[index].entrySet().iterator();\n } else {\n // we can not advance to next iterator because this iterator is the last iterator\n }\n } else {\n // we do not want to advance to next iterator because this iterator is not fully exhausted\n }\n }\n }",
"public void addVote() {\n this.votes++;\n }",
"public void nextTurn(){\n\t\tthis.setCurrentElement(this.getCurrentElement().getNext());\n\t}",
"public void advance() {\n if( mMatches.hasNext() ) {\n setCurrent( mMatches.next() );\n }\n }",
"public void next()\n {\n if (size != 0)\n {\n current = current.next();\n }\n }",
"private void prepareNext() {\n this.hasNext = false;\n while (!this.hasNext && this.nodesIterator.hasNext()) {\n this.next = this.nodesIterator.next();\n this.hasNext = this.computeHasNext();\n }\n }",
"void setNextValue() {\n this.value = this.value * 2;\n }",
"T nextBlock() throws IOException, NoSuchElementException;",
"public void nextIteration()\n {\n actuelIteration++;\n }",
"public void setIteratorEnd() {\n iter = (next > 0 ? next - 1 : -1);\n }",
"private void advance() {\n assert currentItemState == ItemProcessingState.COMPLETED || currentIndex == -1\n : \"moving to next but current item wasn't completed (state: \" + currentItemState + \")\";\n currentItemState = ItemProcessingState.INITIAL;\n currentIndex = findNextNonAborted(currentIndex + 1);\n retryCounter = 0;\n requestToExecute = null;\n executionResult = null;\n assert assertInvariants(ItemProcessingState.INITIAL);\n }",
"void seek(String url) {\n if (url == null) {\n throw new ShouldNotHappenException(\"url is null.\");\n }\n if (StringUtil.compareToNullHigh(peekUrl(), url) > 0) {\n throw new ShouldNotHappenException(\"Current URL is \"+\n\t\t\t\t\t peekUrl()+\", past \"+url);\n }\n for (Entry e : participantsList) {\n participantsQueue.remove(e);\n // todo(bhayes): Change VoteBlockIterator to support a \"seek\"\n // operation.\n\n // VoteBlocks.getVoteBlock(url) has [unused] code trying to do\n // something similar. It creates a VoteBlocksIterator, and\n // iterates over the whole VoteBlocks, [ignoring that it should\n // already be in URL order] looking for a VoteBlock with the\n // given URL, and returns that block. What we could use is a\n // method VoteBlocksIterator.seek(url) that fast-forwards to\n // the right place. But we don't want to just get the VoteBlock,\n // we want to advance the iterator.\n // \n while (StringUtil.compareToNullHigh(e.getUrl(), url) < 0) {\n\te.nextVoteBlock();\n }\n participantsQueue.add(e);\n }\n // NOTE: Since the voters' iterators may not read from disk the\n // same as in the initial poll, some or all of the voters which\n // had the URL in the initial poll may deny having it now.\n // peekUrl() may not equal url.\n if (StringUtil.compareToNullHigh(peekUrl(), url) < 0) {\n throw new ShouldNotHappenException(\"Current URL is \"+\n\t\t\t\t\t peekUrl()+\", before \"+url);\n }\n }",
"void setNext(HashNode newNext){\n\t\tnext = newNext; \n\t}",
"public void addKickVote()\n\t{\n\t\tthis.numberOfKickVotes++;\n\t}",
"public T next(){\r\n\t\t\tif (expectedModCount != modCount){\r\n\t\t\t\tthrow new ConcurrentModificationException();\r\n\t\t\t}\r\n\t\t\tT passed = current;\r\n\t\t\tif ((currentNode.next==endMarker)&&(currentNode.getLast()==current)){\r\n\t\t\t\tcurrentNode = endMarker;\r\n\t\t\t\tcurrent = null;\r\n\t\t\t\treturn passed;\r\n\t\t\t}\r\n\t\t\tif (currentNode.indexOf(current)==currentNode.getArraySize()-1){\r\n\t\t\t\tcurrentNode = currentNode.next;\r\n\t\t\t\tcurrent = currentNode.getFirst();\r\n\t\t\t\tidx = 0;\r\n\t\t\t\treturn passed;\r\n\t\t\t}\t\r\n\t\t\tidx++;\r\n\t\t\tcurrent = currentNode.get(idx);\r\n\t\t\treturn passed;\r\n\t\t}",
"@Override\n public void processElection() {\n if (context.getState().equals(LEADER) || !context.getActive()) {\n return;\n }\n\n log.info(\"Peer #{} Start election\", context.getId());\n\n context.setState(CANDIDATE);\n Long term = context.incCurrentTerm();\n context.setVotedFor(context.getId());\n\n List<Integer> peersIds = context.getPeers().stream().map(Peer::getId).collect(Collectors.toList());\n long voteGrantedCount = 1L;\n long voteRevokedCount = 0L;\n\n //while didn't get heartbeat from leader or new election started\n while (checkCurrentElectionStatus(term)) {\n List<AnswerVoteDTO> answers = getVoteFromAllPeers(term, peersIds);\n peersIds = new ArrayList<>();\n for (AnswerVoteDTO answer : answers) {\n if (answer.getStatusCode().equals(OK)) {\n if (answer.getTerm() > context.getCurrentTerm()) {\n //• If RPC request or response contains term T > currentTerm: set currentTerm = T, convert to follower (§5.1)\n context.setTermGreaterThenCurrent(answer.getTerm());\n return;\n }\n if (answer.isVoteGranted()) {\n log.info(\"Peer #{} Vote granted from {}\", context.getId(), answer.getId());\n context.getPeer(answer.getId()).setVoteGranted(true);\n voteGrantedCount++;\n } else\n log.info(\"Peer #{} Vote revoked from {}\", context.getId(), answer.getId());\n voteRevokedCount++;\n } else {\n log.info(\"Peer #{} No vote answer from {}\", context.getId(), answer.getId());\n peersIds.add(answer.getId());\n }\n }\n if (voteGrantedCount >= context.getQuorum()) {\n winElection(term);\n return;\n } else if (voteRevokedCount >= context.getQuorum()) {\n loseElection(term);\n return;\n } //else retry\n delay();\n }\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tfor (int i = 0; i < 2 /* rounds */; i++) {\n\t\t\t\t\tfor (Delegate delegate : votes.keySet()) {\n\t\t\t\t\t\tif (votes.get(delegate) != null) {\n\t\t\t\t\t\t\t// Already voted.\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentlyVoting = delegate;\n\t\t\t\t\t\tlblCurrentVoter.setText(delegate.getName());\n\t\t\t\t\t\tlblCurrentVoter.setIcon(delegate.getSmallIcon());\n\n\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\t\tfinal List<Map<Vote, JButton>> maplist = Arrays.asList(\n\t\t\t\t\t\t\t\tbuttons_roundOne, buttons_roundTwo);\n\t\t\t\t\t\tfor (Map<Vote, JButton> map : maplist) {\n\t\t\t\t\t\t\tfor (Vote vote : map.keySet()) {\n\t\t\t\t\t\t\t\tmap.get(vote)\n\t\t\t\t\t\t\t\t\t\t.setText(\n\t\t\t\t\t\t\t\t\t\t\t\tdelegate.getStatus().hasVetoPower ? vote.vetoText\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: vote.normalText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tsynchronized (votingThread) {\n\t\t\t\t\t\t\t\tvotingThread.wait();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinal Vote cast = votes.get(delegate);\n\t\t\t\t\t\tif (cast == Vote.PASS) {\n\t\t\t\t\t\t\tvotes.put(delegate, null);\n\t\t\t\t\t\t\t// So he goes again.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\t\t\tbutton.setEnabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlayout.show(pnlVoting, pnlSecondRound.getName());\n\t\t\t\t}\n\t\t\t\t// When done, disable again.\n\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\tbutton.setEnabled(false);\n\t\t\t\t}\n\t\t\t\tcurrentlyVoting = null;\n\t\t\t\tlblCurrentVoter.setText(null);\n\t\t\t\tlblCurrentVoter.setIcon(null);\n\t\t\t\tpnlVoting.setVisible(false);\n\t\t\t}",
"public void next() {\n\t\t}",
"@Override\n public void updateToNextDoc() {\n if(idx < postingList.size())\n idx += postingList.get(idx+1)+2;\n }",
"@Override \n public void updateVote(String keyString) throws EntityNotFoundException {\n Key entityKey = KeyFactory.stringToKey(keyString);\n Entity entity = ds.get(entityKey);\n int currentCount = ((Long) entity.getProperty(\"voteCount\")).intValue();\n entity.setProperty(\"voteCount\", currentCount + 1);\n ds.put(entity);\n }",
"@Override\n protected void setBlock(Block block) {\n super.setBlock(block);\n updateAffectedBlocks();\n }",
"private void updateBlockBuffer() {\n for (Block b : blockBuffer) {\n if (++b.ttl > BLOCK_CACHE_THRESH) {\n blockBuffer.remove(b);\n }\n }\n\n prevBlockBufferSize = blockBuffer.size();\n }",
"public void Next() {\n OCCwrapJavaJNI.Interface_EntityIterator_Next(swigCPtr, this);\n }",
"public void setIteratorBegin() {\n iter = (next > 0 ? 0 : -1);\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 }",
"private void getNextReady() {\n if (!iter.hasNext())\n nextItem = null;\n else {\n Map.Entry<T, Counter> entry = iter.next();\n nextItem = entry.getKey();\n remainingItemCount = entry.getValue();\n }\n }",
"public MyListIter(int index) {\n super();\n //iter.current = index;\n current = index;\n }",
"private void setBlock(Block block) {\r\n this.block = block;\r\n }",
"private void setVoteOrder() {\n\t\tfor (int i = 1; i < temp.size(); i++) {\n\t\t\t// deleting the comma from the name\n\t\t\tString s = temp.elementAt(i).replaceAll(\",\", \"\");\n\t\t\t// creating a vector \"tempVoteOrder\" to store the preferences of\n\t\t\t// each voter\n=======\n\t\t\tCandidats.add(candidat);\n\t\t\ttempCandidats = tempCandidats.replaceFirst(\n\t\t\t\t\ttempCandidats.substring(0, tempCandidats.indexOf(\",\") + 1),\n\t\t\t\t\t\"\");// delete the first candidat in the String\n\t\t}\n\t\tfor (int j = 0; j < Candidats.size(); j++)\n\t\t\tCandidats.elementAt(j).setVowsPerRound(Candidats.size());// fill the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// vector\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// size\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"candidats\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// by\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0's\n\t}",
"void moveNext()\n\t{\n\t\tif (cursor != null) \n\t\t{\n\t\t\tif (cursor == back) \n\t\t\t{\n\t\t\t\tcursor = null;\n index = -1; //added cause i was failing the test scripts and forgot to manage the indices \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcursor = cursor.next; //moves cursor toward back of the list\n index++; //added cause i was failing to the test scripts and forgot to manage the indicies\n\t\t\t}\n\t\t}\n\t}",
"public void setNext(CommitNode x){\r\n\t\tnext = x;\r\n\t}",
"public void setNext(MyNode<? super E> _next)\n\t{\n\t\tthis.next = _next;\n\t\t//this.next = _next;\n\t}",
"public void setBlock(Block newBlock) {\n\t\tthis.block = newBlock;\n\t}",
"public void setNext(Tile next){\n\t\tthis.next=next;\n\t}",
"private void findNextBlock(MatrixIndex cursor) {\n while (isFreeBlock(cursor) || !inBounds(cursor)){\n incrementMatrixIndex(cursor);\n }\n }",
"public void next() {\n if (highlight.getMatchCount() > 0) {\n Point point = highlight.getNextMatch(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n return;\n }\n Point point = file.getNextModifiedPoint(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n }",
"@Override\n\t\tpublic Item next() {\n\t\t\tItem item=current.item;\n\t\t\tcurrent=current.next;\n\t\t\treturn item;\n\t\t}",
"@Override\n public Integer next() {\n Integer res = next;\n advanceIter();\n return res;\n }",
"@ActionTrigger(action=\"KEY-NXTBLK\", function=KeyFunction.NEXT_BLOCK)\n\t\tpublic void spriden_NextBlock()\n\t\t{\n\t\t\t\n\t\t\t\tgoBlock(toStr(\"SOUNDEX\"));\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t}",
"public Node setNextNode(Node node);",
"@Override\n\tpublic void next()\n\t{\n\n\t}",
"@Override\n void advance() {\n }",
"public R next(){\n return (R) newList.get(index++);\n }",
"public void setNextCell(Cell next)\r\n {\r\n this.next = next;\r\n }",
"public void next()\r\n\t{\r\n\t\tif(state<3)\r\n\t\t\tstate++;\r\n\t\telse\r\n\t\t\tstate=1;\r\n\t}",
"private void rewindBlockIteratorToFirstInlineeBlock(\n ListIterator<BasicBlock> blockIterator, BasicBlock firstInlineeBlock) {\n while (blockIterator.hasPrevious() && blockIterator.previous() != firstInlineeBlock) {\n // Do nothing.\n }\n assert IteratorUtils.peekNext(blockIterator) == firstInlineeBlock;\n }",
"public void setNext(ObjectListNode p) {\n next = p;\n }",
"private synchronized void loadSecondaryBlock(boolean next) {\n int step = (next) ? 1 : -2;\n if ((currentBlock + step) < 0) return;//return early if we are already at the beginning\n Controller.INSTANCE.run(() -> {\n String content = fullContent.get(currentBlock) + fullContent.get(currentBlock + step);\n mine.setContent(content);\n return Unit.INSTANCE;\n });\n }",
"public void nextIteration() {t++;}",
"public void setNextElement(Element<T> nextElement) \n\t{\n\t\tthis.nextElement = nextElement;\n\t}",
"public void updateAge(int block, int age){\n\t\tblocks[block].updateAge(age);\n\t\tsortBlocks();\n\t}",
"@Override\r\n\tpublic void next() {\n\n\t}",
"@Override\n public void start() {\n if (size > 0) {\n cursor = head;\n prev = null;\n } else {\n cursor = null; }\n }",
"public abstract int getNextBlock(int block) throws IOException;",
"public void setNext(Node<E> next) { this.next = next; }",
"private void advanceInvaders() {\n\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\tfor (Invader i : row) {\n\t\t\t\ti.setY(i.getY() + 4);\n\t\t\t}\n\t\t}\n\t}",
"public void moveNext() {\n\t\tcurrentElement++;\n\t}",
"private void primeNext() {\n if (currentIterator != null && currentIterator.hasNext()) {\n return;\n }\n\n // Move to the next collection.\n collectionIndex++;\n\n // If we are out of bounds, we are done.\n if (collectionIndex >= collections.length) {\n currentIterator = null;\n return;\n }\n\n currentIterator = collections[collectionIndex].iterator();\n\n // This iterator may be empty, so just try to prime again.\n primeNext();\n }",
"public void next() {\n addTracksToQueue();\n player.skipToNext();\n }",
"public void setAllNextIntentionToSend(long nextIntentionToSend) {\n\t\tfor (DownstreamPeerState peer : _downstreamPeerByNode.values()) {\n\t\t\tpeer.nextIntentionOffsetToSend = nextIntentionToSend;\n\t\t\tpeer.pendingVoteRequest = null;\n\t\t}\n\t}",
"public SkipListNode<K> setNext(int i, SkipListNode<K> node)\n {\n\treturn next.set(i,node);\n }",
"@Override\n\t\tpublic int next() {\n\t\t\treturn current++;\n\t\t}",
"private void eat() {\r\n\t\tthis.energy = this.baseEnergy;\r\n\t\tArrayList<Block> foodNeighbors = (ArrayList<Block>)this.getBlock().getAdjacent(prey, \"2457\");\r\n\t\twhile (foodNeighbors.size() > 0) {\r\n\t\t\tint randomNeighbor = r.nextInt(foodNeighbors.size());\r\n\t\t\tBlock b = this.getBlock();\r\n\t\t\tBlock t = foodNeighbors.get(randomNeighbor);\r\n\t\t\tif (!t.getNextCell().getNextState().equals(predator)) {\r\n\t\t\t\tmoveCell(this, b, t, new WaTorCell(this.getBlock(), new WaTorState(State.EMPTY_STATE),\r\n\t\t\t\t\t\tthis.ageToReproduce, this.baseEnergy));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tfoodNeighbors.remove(t);\r\n\t\t}\r\n\t\tcellPreyRules(new WaTorState(WaTorState.WATOR_PREDATOR));\r\n\t}",
"private void resetIterator() {\n\t\titerator = head;\n\t}",
"public void setNext(ListNode<Item> next) {\n this.next = next;\n }",
"public void setAt(int iterator, T element) {\n data[iterator] = element;\n }",
"@Override\r\n\tprotected void doNext() {\n\t\t\r\n\t}",
"@Override\n\tpublic Integer next() {\n\t return iterator.next();\n\t}",
"public void setIterator(Iterator iterator) {\n/* 96 */ this.iterator = iterator;\n/* */ }",
"@Override\n public String next() {\n return bikes[currentIndex++];\n }",
"private void trueRevertBlock() {\r\n\t\tthis.reverted = true;\r\n\t\tif (instances_.containsKey(this.block)) {\r\n\t\t\tPaperLib.getChunkAtAsync(this.block.getLocation()).thenAccept(result -> {\r\n\t\t\t\tTempBlock last = instances_.get(this.block).getLast();\r\n\t\t\t\tthis.block.setBlockData(last.newData); //Set the block to the next in line TempBlock\r\n\t\t\t});\r\n\t\t} else { //Set to the original blockstate\r\n\t\t\tPaperLib.getChunkAtAsync(this.block.getLocation()).thenAccept(result -> revertState());\r\n\t\t}\r\n\r\n\t\tREVERT_QUEUE.remove(this);\r\n\t\tif (this.revertTask != null) {\r\n\t\t\tthis.revertTask.run();\r\n\t\t}\r\n\r\n\t\tfor (TempBlock attached : attachedTempBlocks) {\r\n\t\t\tattached.revertBlock();\r\n\t\t}\r\n\t}",
"public void next(){\n if(stageNum < (defineStageNum)) {\n stageNum++;\n }else {\n stageNum = startStageNum;\n }\n }",
"public void setNext(Node n) { next = n; }",
"public void inc(){\n this.current += 1;\n }"
] | [
"0.6461405",
"0.5704368",
"0.5569756",
"0.5348855",
"0.5328955",
"0.5319437",
"0.52788454",
"0.5265593",
"0.51109457",
"0.50648767",
"0.5061989",
"0.5051859",
"0.50305074",
"0.5023814",
"0.49992096",
"0.497667",
"0.49751204",
"0.4957323",
"0.49493852",
"0.49201444",
"0.49009934",
"0.48992822",
"0.4893207",
"0.4884746",
"0.48455673",
"0.4827091",
"0.4823887",
"0.4823617",
"0.48120725",
"0.47980812",
"0.47979006",
"0.4794936",
"0.47786137",
"0.47544476",
"0.47513184",
"0.47353125",
"0.47302642",
"0.47219858",
"0.47175872",
"0.47155145",
"0.47124538",
"0.47071704",
"0.46941644",
"0.4674867",
"0.4667549",
"0.4666015",
"0.46617785",
"0.46610922",
"0.4658291",
"0.46537006",
"0.46390155",
"0.4624245",
"0.4615315",
"0.46112332",
"0.46014464",
"0.4596415",
"0.45929015",
"0.45844895",
"0.45586538",
"0.45573875",
"0.455235",
"0.45521268",
"0.45436707",
"0.45412323",
"0.4533037",
"0.453244",
"0.45298728",
"0.45288837",
"0.45266673",
"0.45219097",
"0.45197585",
"0.45195135",
"0.4518816",
"0.4516091",
"0.4514405",
"0.45070386",
"0.45020807",
"0.45007074",
"0.4499288",
"0.44964147",
"0.44905323",
"0.44871303",
"0.44870883",
"0.44869414",
"0.44828153",
"0.44806015",
"0.44774696",
"0.44764444",
"0.44748518",
"0.44743177",
"0.44740355",
"0.4470505",
"0.4470153",
"0.4467294",
"0.4466797",
"0.44662672",
"0.44658452",
"0.44639897",
"0.44635049",
"0.44606403"
] | 0.7184621 | 0 |
null sorts after everything else. | public int compare(Entry o1, Entry o2) {
String url1 = o1.getUrl();
String url2 = o2.getUrl();
return StringUtil.compareToNullHigh(url1, url2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean getSortNoNull();",
"public void sortByDefault() {\r\n\t\tcomparator = null;\r\n\t}",
"public List<ValueType> sort() {\r\n // TODO\r\n return null;\r\n }",
"boolean getMoveSortNoNull();",
"@Test\n\tpublic void testSortNullArray() {\n\t\tint[] array = null;\n\t\tAssert.assertNull(array);\n\t}",
"public void sortOccurred() {\n //SET ALL THE ROWS TO -1, (THEY INITIALIZE TO 0).\n \tfor(int i = 0; i < data.length; i++) {\n \t\tdata[i] = null;\n \t\trowIndexLookup[i] = -1;\n \t}\t\t\n }",
"@Override\n\tpublic int[] sort(int[] numbers) {\n\t\treturn null;\n\t}",
"public void sort() {\n }",
"public void sort() {\n if (sorter != null)\n sort(sorter);\n }",
"@Override\n \tpublic void sort() {\n \t\tArrays.sort(data);\n \t}",
"public void sortTasks() {\n tasks.sort(null);\n }",
"public boolean getSortNoNull() {\n return sortNoNull_;\n }",
"void sort();",
"void sort();",
"@Test (expected=java.lang.NullPointerException.class)\n public void case1SortNoElem() {\n data.runAlgo(algoUnderTest);\n\n }",
"public void sortCompetitors(){\n\t\t}",
"public boolean getSortNoNull() {\n return sortNoNull_;\n }",
"public void sort() {\n\t\tdivider(0, array.size() - 1);\n\t}",
"@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}",
"@Override\n\tpublic String sort(String content) {\n\t\treturn null;\n\t}",
"public void removeSort() {\n this.sortOrder = null;\n }",
"public String doSort();",
"public void sort()\n {\n\tstrack.sort((Node n1, Node n2) ->\n\t{\n\t if (n1.getCost() < n2.getCost()) return -1;\n\t if (n1.getCost() > n2.getCost()) return 1;\n\t return 0;\n\t});\n }",
"public void sort() {\n if(c==null) {\n int middle;\n\n Comparable[] left, right;\n\n\n if (unsorted.length <= 1) {\n\n sorted = unsorted;\n\n } else {\n\n middle = unsorted.length / 2;\n\n\n left = new Comparable[middle];\n\n right = new Comparable[unsorted.length - middle];\n\n\n System.arraycopy(unsorted, 0, left, 0, middle);\n\n System.arraycopy(unsorted, middle, right, 0, unsorted.length - middle);\n\n\n // Внимание! Опа, рекурсия :)\n\n SimpleMerger leftSort = new SimpleMerger(left, c);\n\n SimpleMerger rightSort = new SimpleMerger(right,c);\n\n\n leftSort.sort();\n\n rightSort.sort();\n\n\n sorted = merge(leftSort.getSorted(), rightSort.getSorted());\n\n }\n }else{\n\n int middle;\n\n Object[] left, right;\n\n\n if (unsorted2.length <= 1) {\n\n sorted2 = unsorted2;\n\n } else {\n\n middle = unsorted2.length / 2;\n\n\n left = new Object[middle];\n\n right = new Object[unsorted2.length - middle];\n System.arraycopy(unsorted2, 0, left, 0, middle);\n\n System.arraycopy(unsorted2, middle, right, 0, unsorted2.length - middle);\n\n\n\n\n SimpleMerger leftSort = new SimpleMerger(left,c);\n\n SimpleMerger rightSort = new SimpleMerger(right,c);\n\n\n leftSort.sort();\n\n rightSort.sort();\n\n\n\n sorted2 = merge2(leftSort.getSorted2(), rightSort.getSorted2());\n\n }\n\n }\n }",
"public static void sort(java.util.List arg0)\n { return; }",
"@Override\n\tpublic List<Spittle> findAllSorted() {\n\t\treturn null;\n\t}",
"void sortV();",
"public void sort() {\n\tqsort(a,0,a.length-1);\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 }",
"public T caseDefSort(DefSort object)\n {\n return null;\n }",
"public void sort() {\r\n // sort the process variables\r\n Arrays.sort(pvValues, categoryComparator);\r\n fireTableDataChanged();\r\n }",
"JDKSort() {\n }",
"private void sort() {\n\t\tCollections.sort(this.entities, comparator);\n\t}",
"@Override\r\n public void sort(WordList toSort, Comparator<String> comp) throws NullPointerException{\r\n // TODO\r\n\tif(comp == null || toSort == null) {\r\n\t\tthrow new NullPointerException();\r\n\t}\r\n\tmergeSortRec(toSort,comp,0,toSort.length()-1);\r\n }",
"public void sort() {\n ListNode start = head;\n ListNode position1;\n ListNode position2;\n\n // Going through each element of the array from the second element to the end\n while (start.next != null) {\n start = start.next;\n position1 = start;\n position2 = position1.previous;\n // Checks if previous is null and keeps swapping elements backwards till there\n // is an element that is bigger than the original element\n while (position2 != null && (position1.data < position2.data)) {\n swap(position1, position2);\n numberComparisons++;\n position1 = position2;\n position2 = position1.previous;\n }\n }\n }",
"public static <T extends Comparable<? super T>> int nullSafeComparator(final T one, final T two) {\n if (one == null ^ two == null) {\n return (one == null) ? -1 : 1;\n }\n\n if (one == null && two == null) {\n return 0;\n }\n\n return one.compareTo(two);\n }",
"@Test(timeout = SHORT_TIMEOUT, expected = IllegalArgumentException.class)\n public void testNullArrMergeSort() {\n Sorting.mergeSort(null, comp);\n }",
"protected void sort() {\n\n\t\tCollections.sort(this.myRRList);\n\t}",
"private Sort() { }",
"private static void sortingMemo() {\n\t\t\n\t}",
"@Override\n\tpublic Comparator<? super K> comparator() {\n\t\treturn null;\n\t}",
"public final Comparator<? super Node<N>> comparator() {\n return null;\n }",
"public void sort(){\n ListNode t, x, b = new ListNode(null, null);\n while (firstNode != null){\n t = firstNode; firstNode = firstNode.nextNode;\n for (x = b; x.nextNode != null; x = x.nextNode) //b is the first node of the new sorted list\n if (cmp.compare(x.nextNode.data, t.data) > 0) break;\n t.nextNode = x.nextNode; x.nextNode = t;\n if (t.nextNode==null) lastNode = t;\n }\n firstNode = b.nextNode;\n }",
"public boolean getMoveSortNoNull() {\n return moveSortNoNull_;\n }",
"private void sort(int[] fields) {\n\t\tsort(fields, (currentSort.length == 1 && currentSort[0] == fields[0]) ? !reverseSort : false);\r\n\t}",
"public void sort(){\n\t\t\n\t\tif(Q.size() != 1){\n\t\t\tArrayQueue<E> tempQueue1 = Q.dequeue();\n\t\t\tArrayQueue<E> tempQueue2 = Q.dequeue();\n\t\t\tArrayQueue<E> tempQueue3 = merge(tempQueue1, tempQueue2);\n\t\t\tQ.enqueue(tempQueue3);\n\t\t\tsort();\n\t\t}\n\t\t\n\t}",
"public void sortChildsZ(){\n\t\tif(childList != null && childList.size() > 0){\n\t\t\tCollections.sort(childList);\n\t\t\tfor(Ent e: childList){\n\t\t\t\te.sortChildsZ();\n\t\t\t}\n\t\t}\n\t}",
"@Test\n public void testSomeValid() {\n ArrayList<Flight> someNull = new ArrayList<>();\n someNull.add(null);\n someNull.add(null);\n someNull.add(f1);\n\n // The null elements should be put at the end of the list\n sortFlights.sortFlightsBy(someNull, SortFlights.SortParameter.TIME);\n assertNotNull(someNull.get(0));\n assertEquals(f1, someNull.get(0));\n assertNull(someNull.get(1));\n assertNull(someNull.get(2));\n }",
"public static java.util.Comparator reverseOrder()\n { return null; }",
"public String sortOriginOrReturn();",
"@Override\n public void sort() {\n for (int i = 0; i < size; i++) {\n for (int j = i + 1; j < size; j++) {\n if (((Comparable) data[i]).compareTo(data[j]) > 0) {\n E c = data[i];\n data[i] = data[j];\n data[j] = c;\n\n }\n }\n }\n }",
"@Override\n public void sort(int[] a) {\n a[0] = 0;\n a[a.length - 1] = 0;\n }",
"public void jsort() {\n\tArrays.sort(data);\n }",
"Comparator<T> sortBy();",
"public Builder clearSortNoNull() {\n \n sortNoNull_ = false;\n onChanged();\n return this;\n }",
"public void sortAllRows(){\n\t\t/* code goes here */ \n\t\t\n\t\t\n\t\t//WHY SHOULD THEY BE SORTED LIKE THE EXAMPLE SAYS???????\n\t\t\n\t}",
"public boolean getMoveSortNoNull() {\n return moveSortNoNull_;\n }",
"@Test(timeout = TIMEOUT, expected = IllegalArgumentException.class)\n public void testMergeNull() {\n Integer[] arr = {4, 2, 1, 3};\n Sorting.mergeSort(null, comparator);\n Sorting.mergeSort(arr, null);\n }",
"@Test(timeout = SHORT_TIMEOUT, expected = IllegalArgumentException.class)\n public void testNullArrInsertionSort() {\n Sorting.insertionSort(null, comp);\n }",
"public Weet[] sortArray(Weet[] nonNullWeets) {\n for (int j = 1; j < nonNullWeets.length; j++) {\n /* Check all possibilities for comparison */\n for (int k = 0; k < ((nonNullWeets.length) - j); k++) {\n /**\n * Use native comparison function to return true iff the non-null weet at index k\n * was posted strictly earlier than the non-null weet at index (k + 1). If true,\n * shift the earlier weet by one index using a temporary Weet.\n */\n if ((nonNullWeets[k].getDateWeeted().before(nonNullWeets[k + 1].getDateWeeted()))) {\n Weet tempWeet = nonNullWeets[k];\n nonNullWeets[k] = nonNullWeets[k + 1];\n nonNullWeets[k + 1] = tempWeet;\n }\n }\n }\n return nonNullWeets;\n }",
"public void oldSort()\n\t{\n\t\tfor (int index = 0; index < arraySize; index++) {\n\t\t\tfor (int secondIndex = index + 1; secondIndex < arraySize; secondIndex++) {\n\t\t\t\tint temp = 0;\n\t\t\t\tif (array[index] > array[secondIndex]) {\n\t\t\t\t\ttemp = array[index];\n\t\t\t\t\tarray[index] = array[secondIndex];\n\t\t\t\t\tarray[secondIndex] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public void sort(){\r\n\t\t\t// we pass this doubly linked list's head to merge sort it\r\n\t\t\tthis.head = mergeSort(this.head);\r\n\t\t}",
"private PerfectMergeSort() {}",
"@Override\n\t\tpublic int compare(Object arg0, Object arg1) {\n\t\t\treturn 0;\n\t\t}",
"@Override\n public List<OrderByExpression> resultsOrderedBy() {\n return null;\n }",
"public static <T extends Comparable<? super T>> void mergeSort(List<T> a){\n // create tmp array \n List<T> tmpArray = new ArrayList<>();\n for(int i = 0; i < a.size(); i++){\n tmpArray.add(null);\n }\n\n // call mergeSort method\n mergeSort(a, tmpArray, 0, a.size()-1);\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 }",
"public void sortEventsByValue() {\n for (OrgEvent event : events) {\n event.setCompareByTime(false);\n }\n Collections.sort(events);\n }",
"public FastNondominatedSorting() {\r\n\t\tthis(new ParetoDominanceComparator());\r\n\t}",
"public static void main(String[] args) {\n\t\tint a[]= {4,5,5,5,4,6,9,6,4};\n\t ArrayList<Integer> al=new ArrayList<Integer>();\n\t \n\t for(int i=0;i<a.length;i++)\n\t {\n\t \t al.add(a[i]);\n\t }\n\t al.sort(null);\n\t \n\t System.out.println(al);\n\t}",
"@Override\n\t\t\tpublic int compare(Entry<Character, Integer> o1,\n\t\t\t\t\tEntry<Character, Integer> o2) {\n\t\t\t\tif(o2.getValue()!=null&&o1.getValue()!=null&&o2.getValue().compareTo(o1.getValue())>0){ \n\t return 1; \n\t }else{ \n\t return -1; \n\t } \n\t\t\t}",
"@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 synchronized ColumnSort getDefaultSort() {\r\n return f_title.equals(SUMMARY_COLUMN) ? ColumnSort.SORT_UP : ColumnSort.UNSORTED;\r\n }",
"public void mergesort()\n { sort(this.heap, 0, heap.size()-1);\n }",
"@Test\n public void testNullElements() {\n ArrayList<Flight> nullFlights = new ArrayList<>();\n nullFlights.add(null);\n nullFlights.add(null);\n sortFlights.sortFlightsBy(nullFlights, SortFlights.SortParameter.TIME);\n for (Flight f : nullFlights) {\n // All elements should still just be null\n assertNull(f);\n }\n }",
"public void sort() {\n\n try {\n if (cards != null) {\n cards.sort(Comparator.comparing(Flashcard::getRepetitionDate));\n LogHelper.writeToLog(Level.INFO, \"Karten von Model.Deck \" + name + \" sortiert.\");\n\n } else {\n LogHelper.writeToLog(Level.INFO, \"Karten von Model.Deck \" + name + \" nicht sortiert (null).\");\n }\n } catch (Exception ex) {\n LogHelper.writeToLog(Level.INFO, \"Fehler beim Sortieren der Karten\" + ex);\n }\n }",
"public String sortBy();",
"private Rule[] sortRules(Rule[] rules){\n \t\t\n \t\tArrayList<Rule> temp = new ArrayList<Rule>();\n \t\t\n \t\tfor(int i = 0; i < rules.length; i++){\n \t\t\t\n \t\t\tif(!rules[i].isElseFilter()){\n \t\t\t\ttemp.add(rules[i]);\n \t\t\t}\n \t\t}\n \t\t\n \t\tfor(int i = 0; i < rules.length; i++){\n \t\t\t\n \t\t\tif(rules[i].isElseFilter()){\n \t\t\t\ttemp.add(rules[i]);\n \t\t\t}\n \t\t\t\n \t\t}\n \t\t\n \t\tRule[] newRules = new Rule[temp.size()];\t\t\n \t\treturn temp.toArray(newRules);\n \t}",
"public void sort() {\n Card.arraySort(this.cards, this.topCard);\n }",
"public JwComparator<AcActionAutoCorrectedLog> getCorrectedDataComparatorNullsLower()\n {\n return CorrectedDataComparatorNullsLower;\n }",
"@Override\r\n\tpublic void addSort() {\n\t\t\r\n\t}",
"@Override\n public void sort(IAlg algorithm, boolean decrescent){}",
"public static <T extends Comparable <? super T>> void defaultSort(List <T> list){\r\n\t\tlist.sort(Comparator.naturalOrder()); //will use a built-in variation of mergesort\r\n\t\t//alternative: Collections.sort(list);\r\n\t}",
"@Test(expectedExceptions = IllegalArgumentException.class)\n\tpublic void testSortEmptyArray() {\n\t\tint[] array = {};\n\t\tArrayQuickSort.sort(array);\n\t}",
"public void sort()\n {\n RecordComparator comp = new RecordComparator(Context.getCurrent().getApplicationLocale());\n if (comp.hasSort)\n sort(comp);\n }",
"public synchronized void firstSort(){\n Process temp;\n for(int j = 0; j<queue.length;j++){\n temp = null;\n for(int i = 0; i<pros.proSize(); i++){\n if(i==0){\n temp = new Process((pros.getPro(i)));\n }else if(temp.getArrivalTime() == pros.getPro(i).getArrivalTime()){\n if(temp.getId() > pros.getPro(i).getId()){\n temp = pros.getPro(i);\n }\n }else if (temp.getArrivalTime() > pros.getPro(i).getArrivalTime()){\n temp = pros.getPro(i);\n }\n }\n queue[j] = temp;\n pros.remove(temp.getId());\n }\n for(int i = 0; i< queue.length; i++){\n pros.addPro(queue[i]);\n }\n }",
"private static ListNode sortList(ListNode head) {\n if (head == null || head.next == null) {\n return head;\n }\n ListNode mid = getMid(head);\n ListNode left = sortList(head);\n ListNode right = sortList(mid);\n return merge(left, right);\n }",
"public void SortDepartmentsAscending() {\n\t\tcurr = head;\n\t\twhile (curr.next != null) {\n\t\t\tif (curr.data.students.getStudentCount() > curr.next.data.students.getStudentCount()) {\n\t\t\t\tDepartment tempData = curr.data;\n\t\t\t\tcurr.data = curr.next.data;\n\t\t\t\tcurr.next.data = tempData;\n\t\t\t} curr = curr.next;\n\t\t}\n\t}",
"public SoilTypeComparator() {\n\t\tthis.descending = true;\n\t}",
"public Comparator<? super K> comparator() {\n/* 102 */ return null;\n/* */ }",
"public void sort() {\n compares = 0;\n shuttlesort((int[]) indexes.clone(), indexes, 0, indexes.length);\n }",
"@Override\r\n\t\tpublic int compareTo(Object o) {\n\t\t\treturn 0;\r\n\t\t}",
"@Override\n\t\t\tpublic int compareTo(Object o) {\n\t\t\t\treturn 0;\n\t\t\t}",
"public void sortObjectList(){\n\t\tint counter = gameObjectsList.size() - 1;\n\t\tif (gameObjectsList == null || gameObjectsList.size() == 0){\n\t\t\treturn;\n\t\t}\n\t\tquicksort(0, counter);\n\t}",
"public JwComparator<AcActionAutoCorrectedLog> getScannedPostCodeComparatorNullsLower()\n {\n return ScannedPostCodeComparatorNullsLower;\n }",
"void sort() {\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\t\t\t\tif (array[j - 1] > array[j]) { // if the first term is larger\n\t\t\t\t\t\t\t\t\t\t\t\t// than the last term, then the\n\t\t\t\t\t\t\t\t\t\t\t\t// temp holds the previous term\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];// swaps places within the array\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}",
"@Test(timeout = SHORT_TIMEOUT, expected = IllegalArgumentException.class)\n public void testNullArrSelectionSort() {\n Sorting.selectionSort(null, comp);\n }",
"public JwComparator<AcActionAutoCorrectedLog> getActualPostCodeComparatorNullsLower()\n {\n return ActualPostCodeComparatorNullsLower;\n }",
"public Builder clearMoveSortNoNull() {\n \n moveSortNoNull_ = false;\n onChanged();\n return this;\n }",
"@Test(timeout = SHORT_TIMEOUT, expected = IllegalArgumentException.class)\n public void testNullArrQuickSort() {\n Sorting.quickSort(null, comp, new Random(1301));\n }",
"@Test(timeout = SHORT_TIMEOUT, expected = IllegalArgumentException.class)\n public void testNullArrCocktailShakerSort() {\n Sorting.cocktailSort(null, comp);\n }"
] | [
"0.7388629",
"0.73375607",
"0.6683283",
"0.6665908",
"0.65582955",
"0.6541051",
"0.65327674",
"0.64685524",
"0.64295745",
"0.64083767",
"0.64012104",
"0.63861924",
"0.63455635",
"0.63455635",
"0.6340732",
"0.6322746",
"0.6311932",
"0.6259498",
"0.62518877",
"0.6239966",
"0.6239029",
"0.62223434",
"0.6167614",
"0.616369",
"0.6072445",
"0.60534316",
"0.6051042",
"0.6047878",
"0.6021152",
"0.60159737",
"0.6015606",
"0.60051423",
"0.59756166",
"0.5972995",
"0.5963708",
"0.59370905",
"0.5925876",
"0.5920035",
"0.5919951",
"0.5909403",
"0.59007406",
"0.5896546",
"0.5874064",
"0.5861604",
"0.5852739",
"0.58518076",
"0.58507985",
"0.58492506",
"0.5847732",
"0.5842135",
"0.58399516",
"0.58380014",
"0.58373326",
"0.5835799",
"0.5830344",
"0.5820209",
"0.5815798",
"0.5811069",
"0.57985306",
"0.579677",
"0.5796611",
"0.5793814",
"0.57643783",
"0.5763169",
"0.57554555",
"0.57521755",
"0.5750326",
"0.57304883",
"0.57277477",
"0.5727696",
"0.57253915",
"0.57194036",
"0.5716988",
"0.5712098",
"0.5709589",
"0.57085174",
"0.5707307",
"0.57027817",
"0.57001185",
"0.56977713",
"0.5696467",
"0.5694947",
"0.5691502",
"0.56840056",
"0.5664196",
"0.56596595",
"0.56568044",
"0.5656415",
"0.5654056",
"0.56496745",
"0.56493795",
"0.56462395",
"0.5639448",
"0.56360626",
"0.5635976",
"0.5631124",
"0.5626053",
"0.5623064",
"0.5617157",
"0.5616265",
"0.5609747"
] | 0.0 | -1 |
Release unneeded resources used by this object at the end of a poll. | void release() {
for (Entry e : participantsList) {
e.release();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void dispose() {\n story = null;\n backlog = null;\n parent = null;\n }",
"public void dispose()\n {\n while( m_count > 0 )\n {\n int i = m_count - 1;\n try\n {\n m_factory.decommission( m_pool[ i ] );\n }\n catch( Exception e )\n {\n // To be backwards compatible, we have to support the logger having not been set.\n if( ( getLogger() != null ) && ( getLogger().isDebugEnabled() ) )\n {\n getLogger().debug( \"Error decommissioning object\", e );\n }\n }\n m_pool[ i ] = null;\n m_count--;\n }\n }",
"public void release() {\n if (this.compositeDisposable != null) {\n this.compositeDisposable.clear();\n }\n }",
"public void release() {\n HiLog.info(LOG_LABEL, \"release.\", new Object[0]);\n this.mCallMapById.clear();\n this.mRemote = null;\n disconnect();\n destroyHandler();\n this.mContext = null;\n this.mPendingCallAudioState = null;\n this.mCurrentCallAudioState = null;\n this.mPendingCanAddCall = null;\n this.mPreAddedCall = null;\n this.mPendingDisconnectPreAddedCall = null;\n this.mIsConnected = false;\n this.mIsBound = false;\n this.mIsInCallServiceBinded = false;\n this.mIsPreConnected = false;\n Listener listener = this.mListener;\n if (listener != null) {\n listener.onReleased(this);\n this.mListener = null;\n }\n }",
"private void release() {\n\t\tinitialized = false;\n\t\tpause();\n\t\tsetOnCompletionListener(null);\n\t\tgetMp().release();\n\t\tmp = null;\n\t}",
"private void releaseResources() {\n\t\tstopForeground(true);\n\t\taudioManager.unregisterRemoteControlClient(remoteControlClient);\n\t\taudioManager.unregisterMediaButtonEventReceiver(remoteReceiver);\n\t\t\n\t\tif (mediaPlayer != null){\n\t\t\tmediaPlayer.reset();\n\t\t\tmediaPlayer.release();\n\t\t\tmediaPlayer = null;\n\t\t}\n\t\t\n\t\tif (wifiLock.isHeld()) {\n\t\t\twifiLock.release();\n\t\t}\n\t}",
"public void releaseResource() {\n if (!isPreConnected() && !isInCallServiceBinded() && this.mCallMapById.isEmpty() && this.mPreAddedCall == null && this.mPendingDisconnectPreAddedCall == null) {\n release();\n }\n }",
"@Override\n protected final void deallocate() {\n ByteBuf wrapped = unwrap();\n recyclerHandle.recycle(this);\n wrapped.release();\n }",
"public void clean(){\n\t\tsynchronized(this.lock){\n\t\t\tint index=0;\n\t\t\tfor(ResourceStatus<T> resourceStatus:this.resourcesStatus){\n\t\t\t\tif(resourceStatus!=null){\n\t\t\t\t\tif(!resourceStatus.isInUse()){\n\t\t\t\t\t\tlong lastTime=resourceStatus.getLastNotInUseTime();\n\t\t\t\t\t\tlong currentTime=System.currentTimeMillis();\n\t\t\t\t\t\tT resource=resourceStatus.getResource();\n\t\t\t\t\t\tif((currentTime-lastTime)>=this.resourceAliveTime){\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tdestroyResource(resource);\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\tlogger.error(Constants.Base.EXCEPTION, e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.resourcesStatus[index]=null;\n\t\t\t\t\t\t\tthis.currentSize--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}\n\t}",
"public void finalize() {\n acquire.release();\n }",
"public void finalize() {\n acquire.release();\n }",
"public void release() {\n\t\tsuper.release();\r\n\t\tinnerContent = null;\r\n\t\tlabelHead = null;\r\n\t\tscroll = null;\r\n\t}",
"public void finalize() {\r\n byteBuffer2 = null;\r\n byteBuffer4 = null;\r\n byteBuffer8 = null;\r\n progressBar = null;\r\n tagBuffer = null;\r\n\r\n if (raFile != null) {\r\n\r\n try {\r\n raFile.close();\r\n } catch (final IOException ioe) {\r\n // Do nothing\r\n }\r\n }\r\n\r\n raFile = null;\r\n }",
"public void release() {\r\n return;\r\n }",
"public void release() { \r\n\t remoteControlClient = null;\r\n\t }",
"@Override\n public void dispose(){\n if(handle <= 0) return;\n free(handle);\n handle = 0;\n }",
"public void release()\r\n\t{\r\n\t\tsuper.release();\r\n\t\t_href = null;\r\n\t\t_box = null;\r\n\t\t_bracket = null;\r\n\t\t_bracketFont = null;\r\n\r\n\t}",
"protected void cleanup() {\n try {\n if (_in != null) {\n _in.close();\n _in = null;\n }\n if (_out != null) {\n _out.close();\n _out = null;\n }\n if (_socket != null) {\n _socket.close();\n _socket = null;\n }\n } catch (java.io.IOException e) {\n }\n }",
"public void shutDown() {\n collector.removePool(this);\n factory.poolClosing(this);\n\n // close all objects\n synchronized (objects) {\n for (Iterator it = objects.values().iterator(); it.hasNext();) {\n ObjectRecord rec = (ObjectRecord) it.next();\n if (null != rec) {\n if (rec.isInUse())\n factory.returnObject(rec.getClientObject());\n factory.deleteObject(rec.getObject());\n rec.close();\n }\n }\n objects.clear();\n deadObjects.clear();\n }//end of synch\n\n factory = null;\n poolName = null;\n initialized = false;\n }",
"private void cleanupResources() {\n Log.d(TAG, \"Initiating resource cleanup\");\n if (mWorkerThread != null) {\n mWorkerThread.quitSafely();\n try {\n mWorkerThread.join();\n mWorkerThread = null;\n } catch (InterruptedException e) {\n Log.e(TAG, \"Failed to join on mWorkerThread\");\n }\n }\n //mListener = null;//Release later when being finalized\n mDisplayHandler = null;\n mERDHandler = null;\n mContext = null;\n surface = null;\n mIface = null;\n mLocalWfdDevice = null;\n mPeerWfdDevice = null;\n mActionListener = null;\n Log.d(TAG, \"Done with resource cleanup\");\n }",
"public final void dispose() {\n lock.writeLock().lock();\n try {\n if (available) {\n available = false;\n _dispose();\n }\n } finally {\n lock.writeLock().unlock();\n }\n }",
"public void finalize() {\n\n if (mBtManager != null) {\n //mBtManager.stop();\n mBtManager.setHandler(null);\n }\n mBtManager = null;\n mContext = null;\n mConnectionInfo = null;\n }",
"@Override\n public void release() {\n\n super.release();\n collection = null;\n labelName = null;\n labelProperty = null;\n name = null;\n property = null;\n style = null;\n styleClass = null;\n\n }",
"public void releaseResources();",
"@Override\n\tpublic void releaseAllResources() {\n\t}",
"private void cleanup() {\n if (mPosterBytes != null) {\n try {\n mPosterBytes.close();\n } catch (IOException ignored) {\n // Ignored.\n } finally {\n mPosterBytes = null;\n }\n }\n }",
"@Override\n public void release() {\n }",
"@Override\n protected void cleanup() {\n bundle.setParameter(BundleParameter.NODE_BUNDLE_ELAPSED_PARAM, accumulatedElapsed.get());\n this.dataProvider = null;\n usedClassLoader.dispose();\n usedClassLoader = null;\n //taskNotificationDispatcher.setBundle(this.bundle = null);\n this.taskList = null;\n this.uuidList = null;\n setJobCancelled(false);\n this.taskWrapperList = null;\n timeoutHandler.clear();\n }",
"public void dispose() {\n if (python != null) {\n python.shutdown();\n }\n }",
"public void dispose() {\n processDispose(false);\n }",
"public void dispose() {\n\t\tBusinessObject owner = getOwner();\n\t\tif (owner != null) {\n\t\t\t// remove potential owner's pointer to this\n\t\t\towner.removeChild(this);\n\t\t\t// remove pointer to owner\n\t\t\t_ownerProperty().setValue(null);\n\t\t}\n\t\t\n\t\t// free all children {\n\t\tif (children != null) {\n\t\t\tBusinessObject[] array = new BusinessObject[children.size()];\n\t\t\tchildren.values().toArray(array);\n\t\t\tfor (BusinessObject bo : array) {\n\t\t\t\tbo.dispose();\n\t\t\t}\n\t\n\t\t\tchildren.clear();\n\t\t\tchildren = null;\t// not needed anymore\n\t\t}\n\t\t\n\t\t// remove all link records\n\t\tif (childLinks != null) {\n\t\t\tchildLinks.clear();\n\t\t\tchildLinks = null;\t// not needed anymore\n\t\t}\n\t\tif (childLinkedAttributes != null) {\n\t\t\tchildLinkedAttributes.clear();\n\t\t\tchildLinkedAttributes = null;\n\t\t}\n\t\t\n\t\t// stop anyone from listening to this object\n\t\tlisteners.clear();\n\t}",
"public void release() {\n this.buffer = EMPTY_ARRAY;\n this.elementsCount = 0;\n }",
"public void release() {\r\n pageEL = null;\r\n params = null;\r\n super.release();\r\n }",
"public void stopPollingThread() {\n pool.shutdown();\n }",
"@Override\n\tpublic void release() {\n\t\tif (!bullet.isRecycled()) {\n\t\t\tbullet.recycle();\n\t\t}\n\t}",
"protected void finalize() {\n this.asClient.close();\n this.asClient = null;\n }",
"public void release()\n\t{\n\t\t// System.out.println(usedBy.getName() + \": Releasing \" + toString());\n\t\tthis.usedBy = null;\n\t}",
"@Override\n public void release() {\n }",
"@Override\n public void release() {\n output = null;\n super.release();\n }",
"public void disposeResources()\n {\n for (Disposable disposable : this.disposableObjects) {\n disposable.dispose();\n }\n }",
"private void ensureConnectionRelease() {\n if (responseConnection != null) {\n responseConnection.releaseConnection();\n responseConnection = null;\n }\n }",
"@SuppressWarnings(\"unused\")\n\t\t\tprivate void dispose() {\n\t\t\t\t\n\t\t\t}",
"private void cleanup() {\n\t\tif (myListener!=null)\n\t\t\t_prb.removeListener(myListener);\n\t}",
"@Override\n public void cleanup() {\n if (this.inputStream != null) {\n try {\n this.inputStream.close();\n }\n catch (IOException var1_1) {}\n }\n this.defaultFetcher.cleanup();\n }",
"public void deallocate() {\n\tsetLoaded(false);\n\n if (!externalAudioPlayer) {\n if (audioPlayer != null) {\n audioPlayer.close();\n audioPlayer = null;\n }\n }\n \n\tif (!externalOutputQueue) {\n\t outputQueue.close();\n\t}\n }",
"public void cleanup() {\n sendBuffer(baos);\n shutdown();\n }",
"@Override\n public void release() {\n \n }",
"public static void release() {\n\t}",
"public void release() {\n\t\tsynchronized (this) {\n\t\t\tcount++;\n\t\t\tthis.notifyAll();\n\t\t}\n\t}",
"@Override\r\n\tpublic void release()\r\n\t{\n\t}",
"@Override\n\t\tprotected void finalize() throws Throwable {\n\t\t\tif (pool != null) {\n\t\t\t\tdone();\n\t\t\t\tpool = null;\n\t\t\t}\n\t\t}",
"public void release() {\n }",
"public void dispose() {\n\t\twhile(unackHead != null) {\n\t\t\tcancel(unackHead);\n\t\t\tunackHead = unackHead.next;\n\t\t}\n\t\tif(curChunker != null)\n\t\t\tcurChunker.dispose();\n\t}",
"public void finalize() {\r\n destImage = null;\r\n srcImage = null;\r\n mask = null;\r\n\r\n if (keepProgressBar == false) {\r\n disposeProgressBar();\r\n }\r\n\r\n try {\r\n super.finalize();\r\n } catch (Throwable er) { }\r\n }",
"void dispose() {}",
"private void releaseMediaPlayerResources(){\n if(mRingTonePlayer != null){\n mRingTonePlayer.stop();\n mRingTonePlayer.release();\n mRingTonePlayer = null;\n }\n }",
"public void toss() {\n\t\t\tif (pool != null) {\n\t\t\t\tpool.creator.destroy(content);\n\t\t\t}\n\t\t\t// Don't allow finalize to put it back in.\n\t\t\tpool = null;\n\t\t}",
"public void cleanup() {\r\n }",
"public void cleanup();",
"public void release() {\n\t\tif (state == State.RECORDING) {\n\t\t\tstopRecord();\n\t\t}\n\t\tif (audioRecorder != null) {\n\t\t\taudioRecorder.release();\n\t\t}\n\t\tstate = State.INITIALIZING;\n\t\tsRecorderManager = null;\n\t\taudioRecorder = null;\n\t}",
"public void release() {\n\n mTextureRender = null;\n mSurfaceTexture = null;\n }",
"@Override\n public void release() {\n\n if(trackerResultOverlay != null) {\n overlay.remove(trackerResultOverlay);\n trackerResultOverlay.clear();\n }\n\n if(detectorResultOverlay != null) {\n overlay.remove(detectorResultOverlay);\n detectorResultOverlay.clear();\n textBlockBuffer.clear();\n }\n\n }",
"@Override\n public void close() {\n while (!blocks.isEmpty()) {\n blocks.poll().clean();\n }\n }",
"public void free() {\n if (relRootCM.isOpen())\n relRootCM.close();\n if (relReachableCM.isOpen())\n relReachableCM.close();\n if (relCICM.isOpen())\n relCICM.close();\n if (relCMCM.isOpen())\n relCMCM.close();\n }",
"protected void cleanupOnClose() {\n\t}",
"@Override\n\tpublic void release() {\n\t}",
"public void release() {\n\t\t\treset();\n\t\t\tmCurrentMediaPlayer.release();\n\t\t}",
"@Override\n\tpublic void release() {\n\t\tsuper.release();\n\t\t\n\t\tthis.privilegeCode = null;\n\t\tthis.controlId = null;\n\t\tthis.controlType = null;\n\t\tthis.desc = null;\n\t}",
"public void free() {\n byteBase.free();\n byteBase = null;\n }",
"public void release()\r\n throws IOException\r\n {\r\n // nothing needs to be done\r\n }",
"protected void finalize() throws Throwable {\n\t\tcleanup();\n\n\t\t//kill the scsynth\n\t\t_scsynthLauncher.killScsynth();\n\t\t\n\t\t// free the UDP port from JavaOSC\n\t\tif (_receiver != null)\n\t\t\t_receiver.close();\n\n\t}",
"@Override\n public void release() {\n super.release();\n init();\n }",
"public void release() {\n }",
"public void cleanup() {\n }",
"protected void finalize() {\n\t\tclose();\n\t}",
"protected void finalize() {\n close();\n }",
"private void cleanUp() {\n\t\tVisualizerView mVisualizerView = MusicApplication.getInstance()\n\t\t\t\t.getVisualizerView();\n\t\tif (mVisualizerView != null) {\n\t\t\tmVisualizerView.updateVisualizer(new byte[] {});\n\t\t}\n\t\t//\t\tif (mCurrentMediaPlayer != null) {\n\t\t//\t\t\tmCurrentMediaPlayer.reset();\n\t\t//\t\t\t//\t\t\tmCurrentMediaPlayer = null;\n\t\t//\t\t\tsetState(IDLE);\n\t\t//\t\t\tcom.dj.util.Log.i(this.getClass().getSimpleName(),\n\t\t//\t\t\t\t\t\" 歌曲停止,释放资源。mCurrentMediaPlayer: \" + mCurrentMediaPlayer);\n\t\t//\t\t\t//\t\t\tcleanEQ();\n\t\t//\t\t}\n\t}",
"public void finalize() {\r\n srcImage = null;\r\n destImage = null;\r\n buffer = null;\r\n validBuffer = null;\r\n idealBuffer = null;\r\n objectBuffer = null;\r\n super.finalize();\r\n }",
"public void dispose() {\n\t\tif (!disposed.compareAndSet(false, true))\n\t\t\treturn;\n\n\t\tqueueThread.interrupt();\n\t}",
"public void release()\n \t{\n \t\tif( iterator == null )\n \t\t{\n \t\t\tindex = new SpatialIndex();\n \t\t\tedgeAllocator = 0;\n \t\t\tmergeOps = null;\n \t\t\t\n \t\t\tSystem.gc();\n \t\t}\n \t}",
"public void cleanup() throws ResourceException {\n checkIfDestroyed();\n\n logger.fine(\" 8.- (\" + myId + \") ManagedConnection::cleanup called\");\n\n invalidateJavaMailConnections();\n }",
"public void drain() {\n\t\tsynchronized (list) {\n\t\t\tfor (int i = 0; i < list.size(); ++i) {\n\t\t\t\tPooled<T> pt = list.remove();\n\t\t\t\tcreator.destroy(pt.content);\n\t\t\t\tpt.logTarget.log(\"Pool drained \", creator.toString());\n\t\t\t}\n\t\t\tcount = spares = 0;\n\t\t}\n\n\t}",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tif (qrBmp != null && !qrBmp.isRecycled()) {\n\t\t\tqrBmp.recycle();\n\t\t}\n\t\tqrBmp = null;\n\t\tSystem.gc();\n\t}",
"public void releaseCollection() {\n\t\tcourseDictionary = null;\n\t\t}",
"private void release() {\n noxItemCatalog.release();\n noxItemCatalog.deleteObserver(catalogObserver);\n }"
] | [
"0.68281484",
"0.68129",
"0.6803907",
"0.6776638",
"0.66657656",
"0.6645523",
"0.66016537",
"0.65757746",
"0.65704554",
"0.65129215",
"0.65129215",
"0.647409",
"0.64474183",
"0.64393616",
"0.6422315",
"0.6404969",
"0.6391512",
"0.6382453",
"0.636706",
"0.6355518",
"0.63472503",
"0.6343253",
"0.63115656",
"0.6279752",
"0.6227819",
"0.62258315",
"0.6223298",
"0.6213863",
"0.6198504",
"0.61917233",
"0.6188722",
"0.61768377",
"0.61757773",
"0.61354375",
"0.61342555",
"0.61317635",
"0.6130167",
"0.6125737",
"0.6122195",
"0.61085314",
"0.6106574",
"0.6104126",
"0.6100422",
"0.6090527",
"0.6086801",
"0.60849285",
"0.60779494",
"0.60409975",
"0.60405475",
"0.60318893",
"0.6022912",
"0.60214776",
"0.602112",
"0.60089105",
"0.59995055",
"0.59979826",
"0.5995648",
"0.5990624",
"0.5979723",
"0.59751296",
"0.596869",
"0.59522444",
"0.5944186",
"0.59408635",
"0.5940066",
"0.59389424",
"0.5938598",
"0.59379774",
"0.59340155",
"0.5933827",
"0.5928922",
"0.59251875",
"0.59241617",
"0.5919402",
"0.5917482",
"0.59164536",
"0.58978975",
"0.58966094",
"0.589571",
"0.5895406",
"0.5895128",
"0.5893534",
"0.5893456",
"0.5893456",
"0.5893456",
"0.5893456",
"0.5893456",
"0.5893456",
"0.5893456",
"0.5893456",
"0.5893456",
"0.5893456",
"0.5893456",
"0.5893456",
"0.5893456",
"0.5893456",
"0.5893456",
"0.5893456",
"0.58907163",
"0.58879715",
"0.5882773"
] | 0.0 | -1 |
Peek at the next URL known to any participant. | String peekUrl() {
Entry e = participantsQueue.peek();
if (e == null) {
return null;
}
return e.getUrl();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void seek(String url) {\n if (url == null) {\n throw new ShouldNotHappenException(\"url is null.\");\n }\n if (StringUtil.compareToNullHigh(peekUrl(), url) > 0) {\n throw new ShouldNotHappenException(\"Current URL is \"+\n\t\t\t\t\t peekUrl()+\", past \"+url);\n }\n for (Entry e : participantsList) {\n participantsQueue.remove(e);\n // todo(bhayes): Change VoteBlockIterator to support a \"seek\"\n // operation.\n\n // VoteBlocks.getVoteBlock(url) has [unused] code trying to do\n // something similar. It creates a VoteBlocksIterator, and\n // iterates over the whole VoteBlocks, [ignoring that it should\n // already be in URL order] looking for a VoteBlock with the\n // given URL, and returns that block. What we could use is a\n // method VoteBlocksIterator.seek(url) that fast-forwards to\n // the right place. But we don't want to just get the VoteBlock,\n // we want to advance the iterator.\n // \n while (StringUtil.compareToNullHigh(e.getUrl(), url) < 0) {\n\te.nextVoteBlock();\n }\n participantsQueue.add(e);\n }\n // NOTE: Since the voters' iterators may not read from disk the\n // same as in the initial poll, some or all of the voters which\n // had the URL in the initial poll may deny having it now.\n // peekUrl() may not equal url.\n if (StringUtil.compareToNullHigh(peekUrl(), url) < 0) {\n throw new ShouldNotHappenException(\"Current URL is \"+\n\t\t\t\t\t peekUrl()+\", before \"+url);\n }\n }",
"private String nextURL() {\n\n\t\tString url;\n\t\t// Search the next url until the unique url is found\n\t\tdo {\n\t\t\turl = this.pagesToVisit.remove(0);\n\t\t} while (this.pagesVisited.contains(url));\n\t\tthis.pagesVisited.add(url);\n\t\treturn url;\n\n\t}",
"private String nextUrl()\n {\n String nextUrl;\n do\n {\n nextUrl = this.pagesToVisit.remove(0);\n } while(this.pagesVisited.contains(nextUrl));\n this.pagesVisited.add(nextUrl);\n return nextUrl;\n }",
"String nextLink();",
"private myPoint getNextRoute(){\n\t\ttry {\n\t\t\treturn this.Route.take();\n\t\t} catch (InterruptedException e) {\n\t\t\treturn null;\n\t\t}\n\t}",
"private String fetchUrl() {\n\t\tString url;\n\t\tint depth;\n\t\tdo\n\t\t{\n\t\t\tLandingPage lp = this.pagesToVisit.remove(0);\n\t\t\turl = lp.getUrl();\n\t\t\tdepth = lp.getDepth();\n\t\t\t\n\t\t}while(this.pagesVisited.containsKey(url) || !(isvalidURL(url)));\n\t\tthis.pagesVisited.put(url,depth);\n\t\treturn url;\n\t}",
"public Z peek() {\n return mNext;\n }",
"public boolean getNext();",
"private @Nullable\n Future<FeedType> loadNext(final AtomicReference<OptionType<URI>> next_ref) {\n final OptionType<URI> next_opt = next_ref.get();\n if (next_opt.isSome()) {\n final Some<URI> next_some = (Some<URI>) next_opt;\n final URI next = next_some.get();\n\n final Pair<ListenableFuture<FeedType>, URI> in_loading = this.loading.get();\n if (in_loading == null) {\n LOG.debug(\"no feed currently loading; loading next feed: {}\", next);\n return this.loadNextActual(next);\n }\n\n final URI loading_uri = in_loading.getRight();\n if (!loading_uri.equals(next)) {\n LOG.debug(\"different feed currently loading; loading next feed: {}\", next);\n return this.loadNextActual(next);\n }\n\n LOG.debug(\"already loading next feed, not loading again: {}\", next);\n }\n\n return null;\n }",
"public URLSpout() {\n \tURLSpout.activeThreads = new AtomicInteger();\n \tlog.debug(\"Starting URL spout\");\n \t\n \ttry { \t\t\n\t\t\treader = new BufferedReader(new FileReader(\"URLDisk.txt\"));\n\t\t\tint num_lines = XPathCrawler.getInstance().getFileCount().get();\n\t\t\tfor (int i = 0; i < num_lines; i++) {\n\t\t\t\treader.readLine(); //set reader to latest line\n\t\t\t}\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n }",
"public Linkable next();",
"private void findNext() {\n \tthis.find(true);\n }",
"Object peek();",
"public WebElement getNext_page() {\n\t\treturn null;\n\t}",
"String getNext();",
"String getNext();",
"public Integer peek() {\n return next;\n }",
"Split getNext();",
"public boolean next () throws Exception;",
"public String nextURL()\n {\n if (empty())\n return null;\n int start = position;\n if (!consume(\"url(\"))\n return null;\n\n skipWhitespace();\n\n String url = nextCSSString();\n if (url == null)\n url = nextLegacyURL(); // legacy quote-less url(...). Called a <url-token> in the CSS3 spec.\n\n if (url == null) {\n position = start;\n return null;\n }\n\n skipWhitespace();\n\n if (empty() || consume(\")\"))\n return url;\n\n position = start;\n return null;\n }",
"void next();",
"public int peek();",
"IEmpleado next();",
"public E next() {\r\n\r\n\t\tE result = null;\r\n\t\tif (hasNext()) {\r\n\t\t\tresult = links.get(counter);\r\n\t\t\tcounter++;\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"boolean usesNext() {\n return next != null;\n }",
"Object getNextElement() throws NoSuchElementException;",
"public void next();",
"public void next();",
"public Object peek();",
"public Object peek();",
"public Integer peek() {\n if (next != null) {\n return next;\n }\n\n if (iterator.hasNext()) {\n next = iterator.next();\n return next;\n }\n\n return null;\n }",
"public Object peek(){\n return this.nextObject;\n }",
"public Integer peek() {\n if (next == null) {\n return -1;\n }\n return next;\n }",
"public void skipToNext() {\n try {\n mSessionBinder.next(mContext.getPackageName(), mCbStub);\n } catch (RemoteException e) {\n Log.wtf(TAG, \"Error calling next.\", e);\n }\n }",
"public E peek() throws NoSuchElementException;",
"public void gotoNext(){\r\n if(curr == null){\r\n return;\r\n }\r\n prev = curr;\r\n curr = curr.link;\r\n }",
"public void next() {\n addTracksToQueue();\n player.skipToNext();\n }",
"public Post next() {\n return _next;\n }",
"private void fetchNextBlock() {\n try {\n \tSearchClient _client = new SearchClient(\"cubansea-instance\");\n \tWebSearchResults _results = _client.webSearch(createNextRequest());\n \t\tfor(WebSearchResult _result: _results.listResults()) {\n \t\t\tresults.add(new YahooSearchResult(_result, cacheStatus+1));\n \t\t\tcacheStatus++;\n \t\t}\n \t\tif(resultCount == -1) resultCount = _results.getTotalResultsAvailable().intValue();\n } catch (IOException e) {\n\t\t\tthrow new TechnicalError(e);\n\t\t} catch (SearchException e) {\n\t\t\tthrow new TechnicalError(e);\n\t\t}\n\t}",
"public WalkIn peek() {\n if(isEmpty()) System.err.println(\"The queue is empty! Nobody is next!\");\n \n return first.getData();\n }",
"private void advanceToNextReader(){\r\n\t\tcurrentReader = null;\r\n\t\treaderQueueIndex++;\r\n\t}",
"int peek();",
"int peek();",
"public IpAddress nextHop() {\n return nextHop;\n }",
"public abstract void goNext();",
"private synchronized BackStep peek() {\r\n\t\t\treturn stack[top];\r\n\t\t}",
"@Test\n public void peekTest() {\n assertThat(\"work1\", is(this.queue.peek()));\n }",
"public abstract void next();",
"public List<Url> getNextUrls(Url url, int limit)\r\n\t{\n\t\treturn null;\r\n\t}",
"public void goToNext() {\r\n\t\tif (curr == null)\r\n\t\t\treturn;\r\n\t\tprev = curr;\r\n\t\tcurr = curr.link;\r\n\t}",
"public void nextTask()\n {\n Task next = null;\n \n if (!pq.isEmpty()) next = pq.remove();\n \n if (next == null)\n {\n System.out.println(\"There are no tasks in the list.\");\n }\n else\n {\n //System.out.println(pq.peek());\n System.out.println(next.getDescription());\n }\n }",
"public void next() {\n\t\tif ((position == 0) && (pause != 3)) {\n\t\t\tpause++;\n\t\t} else {\n\t\t\tposition++;\n\t\t\tpause = 0;\n\t\t\tif (position == (origionalMessage.length() + 10)) {\n\t\t\t\tposition = 0;\n\t\t\t}\n\t\t}\n\n\t}",
"@Nonnull\n public Optional<ENTITY> peekNext()\n {\n return hasNext() ? Optional.of(items.get(index + 1)) : Optional.empty();\n }",
"public Address getNextHop()\n {\n return (Address)route.get(getHopCount()+1);\n }",
"public Pageable next() {\n\t\t\t\treturn null;\r\n\t\t\t}",
"public CardNode peek() {\n\t\treturn cardPathCollection.get(cardPathCollection.size());\n\t}",
"protected T nextUnvisited() {\r\n\t\tfor (T node: getNodes()) {\r\n\t\t\tif (!visited.contains(node)) {\r\n\t\t\t\treturn node;\r\n\t\t\t}\r\n\t\t} \r\n\t\t\treturn null;\r\n\t}",
"@Override\n public Document getNextPage(Document doc) throws IOException {\n if (isStopped()) {\n throw new IOException(\"Ripping interrupted\");\n }\n // Find next page\n Elements hrefs = doc.select(\".ptt a\");\n if (hrefs.isEmpty()) {\n LOGGER.info(\"doc: \" + doc.html());\n throw new IOException(\"No navigation links found\");\n }\n // Ensure next page is different from the current page\n String nextURL = hrefs.last().attr(\"href\");\n if (nextURL.equals(this.lastURL)) {\n LOGGER.info(\"lastURL = nextURL : \" + nextURL);\n throw new IOException(\"Reached last page of results\");\n }\n // Sleep before loading next page\n sleep(PAGE_SLEEP_TIME);\n // Load next page\n Document nextPage = getPageWithRetries(new URL(nextURL));\n this.lastURL = nextURL;\n return nextPage;\n }",
"public C getNext();",
"T peek();",
"T peek();",
"T peek();",
"T peek();",
"@Override\n\tpublic Object peek() {\n\t\treturn list.getFirst();\n\t}",
"public Integer peek() {\n if (hasNext()){\n if (list.isEmpty()){\n Integer next = iterator.next();\n list.add(next);\n return next;\n }else {\n return list.get(list.size()-1);\n }\n }else {\n return null;\n }\n }",
"private MovingEntity nextAttacker(MovingEntity currAttacker, ArrayList<MovingEntity> availableAttackers){\n int currIndex = availableAttackers.indexOf(currAttacker);\n\n if(currIndex < availableAttackers.size() - 1){\n //System.out.println(currAttacker.getID() + \" just finished attacking, next attacker is \" + availableAttackers.get(currIndex + 1).getID());\n return availableAttackers.get(currIndex + 1);\n } else {\n return null;\n }\n }",
"public static void main(String[] args) throws IOException {\n Deque<String> urlsToVisit = new ArrayDeque<String>();\n // Keep track of which URLs we have visited, so we don't get ourselves stuck in a loop.\n List<String> visitedUrls = new ArrayList<String>();\n // Keep track of how we got to each page, so that we can find our trace back to the BEGIN_URL.\n Hashtable<String, String> referrers = new Hashtable<String, String>();\n boolean pathFound = false;\n\n // Begin with the BEGIN_URL\n urlsToVisit.push(BEGIN_URL);\n\n while(!urlsToVisit.isEmpty() && !pathFound) {\n String currentUrl = urlsToVisit.pop();\n visitedUrls.add(currentUrl);\n\n Elements paragraphs = wf.fetchWikipedia(BASE_URL + currentUrl);\n List<String> pageUrls = new ArrayList<String>();\n\n for (Element p : paragraphs) {\n pageUrls.addAll(getLinksFromParagraph(p));\n }\n\n // Reverse the order of all page urls so that when we're done pushing all the URLS\n // to the stack, the first URL in the page will be the first URL in the current page.\n Collections.reverse(pageUrls);\n\n // Add all the URLs to the list of URLs to visit.\n for (String newUrl : pageUrls) {\n if(!visitedUrls.contains(newUrl)) {\n urlsToVisit.push(newUrl);\n // Record how we ended up at newUrl.\n referrers.put(newUrl, currentUrl);\n\n // Check if one of the links in this page is the END_URL; which means we'll be done!\n if (newUrl.equals(END_URL)) {\n pathFound = true;\n }\n }\n }\n }\n\n if (pathFound) {\n System.out.println(\"=================\");\n System.out.println(\"Path found!\");\n System.out.println(\"=================\");\n\n // Back trace how we ended up at END_URL.\n String backtraceUrl = END_URL;\n System.out.println(backtraceUrl);\n while(backtraceUrl != BEGIN_URL) {\n String referrerUrl = referrers.get(backtraceUrl);\n System.out.println(referrerUrl);\n backtraceUrl = referrerUrl;\n }\n } else {\n System.out.println(\"=================\");\n System.out.println(\"No path found :(\");\n System.out.println(\"=================\");\n }\n }",
"public abstract boolean isNextVisited();",
"void setNext(final UrlArgumentBuilder next);",
"@Test\n public void testPeek() {\n\tFileBackedBlockingQueue<String> queue = new FileBackedBlockingQueue.Builder<String>()\n\t\t.directory(TEST_DIR)\n\t\t.serializer(new StringSerializer())\n\t\t.segmentSize((TEST_STRING.length() + Segment.ENTRY_OVERHEAD_SIZE + 10) * 100)\n\t\t.build();\n\tfor (int i = 0; i < 2000; i++)\n\t queue.add(TEST_STRING + i);\n\tfor (int i = 0; i < 2000; i++)\n\t Assert.assertEquals(queue.peek(), queue.poll());\n }",
"private void next() {\n Timeline currentTimeline = simpleExoPlayerView.getPlayer().getCurrentTimeline();\n if (currentTimeline.isEmpty()) {\n return;\n }\n int currentWindowIndex = simpleExoPlayerView.getPlayer().getCurrentWindowIndex();\n if (currentWindowIndex < currentTimeline.getWindowCount() - 1) {\n player.seekTo(currentWindowIndex + 1, C.TIME_UNSET);\n } else if (currentTimeline.getWindow(currentWindowIndex, new Timeline.Window(), false).isDynamic) {\n player.seekTo(currentWindowIndex, C.TIME_UNSET);\n }\n }",
"private boolean isThereMoreData() {\n return nextUrl != null;\n }",
"private String getNextLink(JSONObject json, String oldUrl, QueryTargetInfo info) {\n String rtn = \"\";\n\n try {\n JSONObject searchMeta = json.getJSONObject(\"search_metadata\");\n rtn = URL_BASE + searchMeta.getString(\"next_results\");\n } catch (JSONException jsonEx) {\n return null;\n }\n\n return rtn;\n }",
"IList<T> getNext();",
"public int findNext(Resource resource);",
"public InetAddress getNextHop() {\n return nextHop;\n }",
"public abstract void next ();",
"public void Next();",
"public String nextLink() {\n return this.nextLink;\n }",
"public String nextLink() {\n return this.nextLink;\n }",
"public String nextLink() {\n return this.nextLink;\n }",
"public String nextLink() {\n return this.nextLink;\n }",
"T peek(){\n\tif(m.size() == 0){\n\t throw new NoSuchElementException();\n\t}\n\tT answer = m.get(0);\n\treturn answer;\n }",
"Piece getNextPiece();",
"public E peekFirst();",
"@Override\n public Integer next() {\n if (next == null) {\n throw new NoSuchElementException();\n }\n Integer toReturn = next;\n next = null;\n if (peekingIterator.hasNext()) {\n next = peekingIterator.next();\n }\n return toReturn;\n }",
"public void setNext(Linkable nextObject);",
"public void nextHard() {\n\t\titerator.next();\n\t}",
"public int peekFront();",
"public T peek();",
"public T peek();",
"public T peek();",
"public String peek();",
"protected abstract void nextRequest ();",
"@Override\n public ZmailHit peekNext() throws ServiceException {\n ZmailHit toRet = null;\n if (nextHits.size() > 0) {\n // already have some hits, so our job is easy!\n toRet = nextHits.get(0);\n } else {\n // we don't have any buffered SearchResults, try to get more\n while (toRet == null) {\n // Check to see if we need to refil mDBHits\n if ((dbHitsIter == null || !dbHitsIter.hasNext()) && !endOfHits) {\n if (fetch == null) {\n switch (context.getResults().getFetchMode()) {\n case NORMAL:\n fetch = isTopLevelQueryOp() ? DbSearch.FetchMode.MAIL_ITEM : DbSearch.FetchMode.ID;\n break;\n case IMAP:\n fetch = DbSearch.FetchMode.IMAP_MSG;\n break;\n case IDS:\n fetch = DbSearch.FetchMode.ID;\n break;\n case MODSEQ:\n fetch = DbSearch.FetchMode.MODSEQ;\n break;\n case PARENT:\n fetch = DbSearch.FetchMode.PARENT;\n break;\n default:\n assert false : context.getResults().getFetchMode();\n }\n }\n\n if (executeMode == null) {\n if (hasNoResults()) {\n executeMode = QueryExecuteMode.NO_RESULTS;\n } else if (luceneOp == null) {\n executeMode = QueryExecuteMode.NO_LUCENE;\n } else if (shouldExecuteDbFirst()) {\n luceneOp.clearFilterClause();\n executeMode = QueryExecuteMode.DB_FIRST;\n } else {\n executeMode = QueryExecuteMode.LUCENE_FIRST;\n }\n }\n\n getNextChunk();\n }\n\n // at this point, we've filled mDBHits if possible (and initialized its iterator)\n if (dbHitsIter != null && dbHitsIter.hasNext()) {\n DbSearch.Result sr = dbHitsIter.next();\n // Sometimes, a single search result might yield more than one Lucene document -- e.g. an RFC822\n // message with separately-indexed MIME parts. Each of these parts will turn into a separate\n // ZmailHit at this point, although they might be combined together at a higher level (via a\n // HitGrouper).\n Collection<Document> docs = luceneChunk != null ? luceneChunk.getHit(sr.getIndexId()) : null;\n\n if (docs == null || !ZmailQueryResultsImpl.shouldAddDuplicateHits(sr.getType())) {\n ZmailHit toAdd = context.getResults().getZmailHit(context.getMailbox(), sr, null, fetch);\n if (toAdd != null) {\n // make sure we only return each hit once\n if (!mSeenHits.containsKey(toAdd)) {\n mSeenHits.put(toAdd, toAdd);\n nextHits.add(toAdd);\n }\n }\n } else {\n for (Document doc : docs) {\n ZmailHit toAdd = context.getResults().getZmailHit(context.getMailbox(), sr, doc, fetch);\n if (toAdd != null) {\n // make sure we only return each hit once\n if (!mSeenHits.containsKey(toAdd)) {\n mSeenHits.put(toAdd, toAdd);\n nextHits.add(toAdd);\n }\n }\n }\n }\n\n if (nextHits.size() > 0) {\n toRet = nextHits.get(0);\n }\n } else {\n return null;\n }\n }\n }\n\n return toRet;\n }",
"private synchronized Loader getNextLoader(int[] cache, int index) {\n if (this.closed) {\n return null;\n }\n if (cache == null) {\n return getLoader(index);\n } else if (index >= cache.length) {\n return null;\n } else {\n Loader loader = (Loader) this.loaders.get(cache[index]);\n if (DEBUG_LOOKUP_CACHE) {\n System.out.println(\"HASCACHE: Loading from : \" + cache[index] + \" = \" + loader.getBaseURL());\n }\n }\n }",
"int next();",
"private void getNextReady() {\n if (!iter.hasNext())\n nextItem = null;\n else {\n Map.Entry<T, Counter> entry = iter.next();\n nextItem = entry.getKey();\n remainingItemCount = entry.getValue();\n }\n }",
"public BSCObject next()\n {\n if (ready_for_fetch)\n {\n // the next sibling is waiting to be returned, so just return it\n ready_for_fetch = false;\n return sibling;\n }\n else if (hasNext())\n {\n // make sure there is a next sibling; if so, return it\n ready_for_fetch = false;\n return sibling;\n }\n else\n throw new NoSuchElementException();\n }",
"private Node<S> popUnvisited(){\n if (this.next != null){\n Node<S> next = this.next;\n // Put next to null to indicate that\n // this node was consumed. Next call\n // to hasNext has to compute the next\n // node beforehand to check if there is\n // another one valid.\n this.next = null;\n return next;\n } else {\n this.next = popNextUnvisitedNode();\n return this.next;\n }\n }"
] | [
"0.6550826",
"0.6228325",
"0.6192391",
"0.5768297",
"0.5724908",
"0.5583892",
"0.55295235",
"0.5297868",
"0.52442914",
"0.5231545",
"0.5222845",
"0.51695055",
"0.5169057",
"0.5168554",
"0.51567507",
"0.51567507",
"0.51471186",
"0.51147294",
"0.50609475",
"0.5035255",
"0.5029989",
"0.50279236",
"0.5010332",
"0.50042015",
"0.50037986",
"0.49980032",
"0.49943325",
"0.49943325",
"0.4973576",
"0.4973576",
"0.49666643",
"0.49619362",
"0.49606654",
"0.4954784",
"0.49544775",
"0.49468794",
"0.4942679",
"0.49401188",
"0.49386322",
"0.49317187",
"0.49266008",
"0.49225026",
"0.49225026",
"0.4922314",
"0.49183515",
"0.49066126",
"0.4905287",
"0.48906213",
"0.4888453",
"0.48802614",
"0.4878017",
"0.4868575",
"0.4861495",
"0.4854951",
"0.48542812",
"0.48537272",
"0.48490742",
"0.48471168",
"0.48425528",
"0.48421857",
"0.48421857",
"0.48421857",
"0.48421857",
"0.48377323",
"0.48332638",
"0.4823091",
"0.48227546",
"0.48226088",
"0.4818018",
"0.48138434",
"0.48131672",
"0.48093766",
"0.48081437",
"0.48078445",
"0.48057166",
"0.48050064",
"0.48050055",
"0.479648",
"0.47902006",
"0.47902006",
"0.47902006",
"0.47902006",
"0.47830904",
"0.47818932",
"0.47796062",
"0.47788903",
"0.47714695",
"0.47685835",
"0.47647646",
"0.47588265",
"0.47588265",
"0.47588265",
"0.47559172",
"0.47515002",
"0.4750628",
"0.47430125",
"0.47419125",
"0.47396332",
"0.47345212",
"0.47213298"
] | 0.70660853 | 0 |
Skip all the voters' URLs which are less than the given's URL. Can be useful when checking a repair. The poller has the given URL. | void seek(String url) {
if (url == null) {
throw new ShouldNotHappenException("url is null.");
}
if (StringUtil.compareToNullHigh(peekUrl(), url) > 0) {
throw new ShouldNotHappenException("Current URL is "+
peekUrl()+", past "+url);
}
for (Entry e : participantsList) {
participantsQueue.remove(e);
// todo(bhayes): Change VoteBlockIterator to support a "seek"
// operation.
// VoteBlocks.getVoteBlock(url) has [unused] code trying to do
// something similar. It creates a VoteBlocksIterator, and
// iterates over the whole VoteBlocks, [ignoring that it should
// already be in URL order] looking for a VoteBlock with the
// given URL, and returns that block. What we could use is a
// method VoteBlocksIterator.seek(url) that fast-forwards to
// the right place. But we don't want to just get the VoteBlock,
// we want to advance the iterator.
//
while (StringUtil.compareToNullHigh(e.getUrl(), url) < 0) {
e.nextVoteBlock();
}
participantsQueue.add(e);
}
// NOTE: Since the voters' iterators may not read from disk the
// same as in the initial poll, some or all of the voters which
// had the URL in the initial poll may deny having it now.
// peekUrl() may not equal url.
if (StringUtil.compareToNullHigh(peekUrl(), url) < 0) {
throw new ShouldNotHappenException("Current URL is "+
peekUrl()+", before "+url);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Document getPageWithRetries(URL url) throws IOException {\n Document doc;\n int retries = 3;\n while (true) {\n sendUpdate(STATUS.LOADING_RESOURCE, url.toExternalForm());\n LOGGER.info(\"Retrieving \" + url);\n doc = Http.url(url)\n .referrer(this.url)\n .cookies(cookies)\n .get();\n if (doc.toString().contains(\"IP address will be automatically banned\")) {\n if (retries == 0) {\n throw new IOException(\"Hit rate limit and maximum number of retries, giving up\");\n }\n LOGGER.warn(\"Hit rate limit while loading \" + url + \", sleeping for \" + IP_BLOCK_SLEEP_TIME + \"ms, \" + retries + \" retries remaining\");\n retries--;\n try {\n Thread.sleep(IP_BLOCK_SLEEP_TIME);\n } catch (InterruptedException e) {\n throw new IOException(\"Interrupted while waiting for rate limit to subside\");\n }\n }\n else {\n return doc;\n }\n }\n }",
"public boolean shouldSkip(String url)\n\t{\n\t\tboolean temp_bool = false;\t\n\t\t\n\t\t//Trying URLs with and without / at end \n\t\tString new_url;\n\t\tif (url.substring(url.length()-1).equals(\"/\"))\n\t\t{\n\t\t\tnew_url = url.substring(0,url.length()-1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnew_url = url + \"/\";\n\t\t}\n\t\t\n\t\t//Searching disallowed links\n\t\tif (best_match!=null && robot.getDisallowedLinks(best_match) !=null)\n\t\t{\n\t\t\tfor (String s: robot.getDisallowedLinks(best_match))\n\t\t\t{\n\t\t\t\tif (url.contains(s) || new_url.contains(s))\n\t\t\t\t{\n\t\t\t\t\tif (robot.getAllowedLinks(best_match)!=null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Searching allowed links\n\t\t\t\t\t\tfor (String s2: robot.getAllowedLinks(best_match))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Returning longer match\n\t\t\t\t\t\t\tif ((url.contains(s2) || new_url.contains(s2)) && s2.length() > s.length())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttemp_bool = false;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ttemp_bool = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn temp_bool;\n\t}",
"public Observable<DownloadType> notSupportHead(final String url)\r\n throws IOException {\r\n\r\n return mDownloadApi\r\n .GET_withIfRange(TEST_RANGE_SUPPORT, readLastModify(url), url)\r\n .map(new Function<Response<Void>, DownloadType>() {\r\n @Override\r\n public DownloadType apply(Response<Void> response)\r\n throws Exception {\r\n if (serverFileNotChange(response)) {\r\n return getWhenServerFileNotChange(response, url);\r\n } else if (serverFileChanged(response)) {\r\n return getWhenServerFileChanged(response, url);\r\n } else {\r\n return typeFactory.unable();\r\n }\r\n }\r\n })\r\n .compose(Utils.<DownloadType>retry(MAX_RETRY_COUNT));\r\n }",
"public void validateLauncherUrls() {\n log.info(\"Validating the existing launcher URL list for missing deployments...\");\n\n for (String launcherUrl : getTotalLaunchers()) {\n log.info(\"Validating [Launcher URL] \" + launcherUrl + \"...\");\n String objectName = getObjectNameFromLauncherUrl(launcherUrl);\n if (!runtimeClient.deploymentExists(objectName) || !runtimeClient.serviceExists(objectName)) {\n log.info(\"Found an invalid launcher [URL] \" + launcherUrl);\n // Just remove the reference to launcher now\n // cleanOrphan* jobs will clean any orphan deployments\n // desired count check will scale up if free count is reduced\n unregisterLauncherIfExists(launcherUrl);\n }\n }\n }",
"public void waitUntilUrl(WebDriver driver, String previousURL) throws NumberFormatException, IOException {\n\t\t\t\t\tlong start = System.currentTimeMillis();\n\t\t\t\t\tfinal String oldURL = previousURL.toLowerCase();\n\t\t\t\t\tWebDriverWait wait = new WebDriverWait(driver, 30);\n\t\t\t\t\tExpectedCondition<Boolean> e = new ExpectedCondition<Boolean>() {\n\t\t\t\t public Boolean apply(WebDriver driver) {\n\t\t\t\t return (driver.getCurrentUrl() != oldURL);\n\t\t\t\t }\n\t\t\t\t };\n\t\t\t\t wait.until(e);\n\t\t\t\t fileWriterPrinter(\"Waiting time for New URL:\" + padSpace(58 - \"Waiting time for New URL:\".length()) + waitTimeConroller(start, 30, driver.getCurrentUrl()) + \" sec\");\n\t\t\t\t}",
"List<WebURL> Filter(List<WebURL> urls){\n return null;\n }",
"public List<Url> getNextUrls(Url url, int limit)\r\n\t{\n\t\treturn null;\r\n\t}",
"private boolean notTooManySkips(ArrayList<Integer> jValues)\r\n\t{\r\n\t\tint length = jValues.size();\r\n\t\tint span = jValues.get(jValues.size() - 1) - jValues.get(0) + 1;\r\n\r\n\t\treturn span - length <= MAX_SKIPS;\r\n\t}",
"public static void doHighLatencyPeers(ArrayList<PEPeer> peers_to_choke, ArrayList<PEPeer> peers_to_unchoke, boolean allow_snubbed) {\n\n if (peers_to_choke.size() == 0) {\n\n return;\n }\n\n // System.out.println( \"doHLP: \" + peers_to_choke + \", \" + peers_to_unchoke );\n\n Iterator<PEPeer> choke_it = peers_to_choke.iterator();\n\n int to_remove = 0;\n\n while (choke_it.hasNext()) {\n\n PEPeer peer = choke_it.next();\n\n if (AENetworkClassifier.categoriseAddress(peer.getIp()) != AENetworkClassifier.AT_PUBLIC) {\n\n if (isUnchokable(peer, allow_snubbed)) {\n\n // System.out.println( \" removed \" + peer );\n\n choke_it.remove();\n\n to_remove++;\n\n } else {\n\n // it isn't unchokable so we need to choke it whatever\n\n }\n }\n }\n\n // if we've removed any chokes then we need to balance things by removing an equal number\n // of unchokes\n\n if (to_remove > 0) {\n\n ListIterator<PEPeer> unchoke_it = peers_to_unchoke.listIterator(peers_to_unchoke.size());\n\n // preferrably balance with high latency peers\n\n while (unchoke_it.hasPrevious()) {\n\n PEPeer peer = unchoke_it.previous();\n\n if (AENetworkClassifier.categoriseAddress(peer.getIp()) != AENetworkClassifier.AT_PUBLIC) {\n\n // System.out.println( \" balanced with \" + peer );\n\n unchoke_it.remove();\n\n to_remove--;\n\n if (to_remove == 0) {\n\n return;\n }\n }\n }\n\n if (to_remove > 0) {\n\n unchoke_it = peers_to_unchoke.listIterator(peers_to_unchoke.size());\n\n while (unchoke_it.hasPrevious()) {\n\n PEPeer peer = unchoke_it.previous();\n\n unchoke_it.remove();\n\n to_remove--;\n\n if (to_remove == 0) {\n\n return;\n }\n }\n }\n }\n }",
"public Object[] chechEarlyLink(String url) {\n\t\tString mostRecentHTML = \"\";\n\t\tboolean success;\n\t\tprocessor.printSys(\"Original URL of Early Link: \" + url);\n\t\ttry {\n\t\t\tHttpURLConnection con = settings.isUsingProxy() ? (HttpURLConnection)(new URL(url).openConnection(proxyBuilder.getProxy())) : (HttpURLConnection)(new URL(url).openConnection());\n\t\t\tcon.setUseCaches(false);\n\t\t\tcon.setConnectTimeout(8000);\n\t\t\tcon.setInstanceFollowRedirects(false);\n\t\t\tcon.connect();\n\t\t\tString location = con.getHeaderField(\"Location\");\n\t\t\tprocessor.printSys(\"Response Code: \" + con.getResponseCode() + \", Early Link Redirected to: \" + location);\n\t\t\tmostRecentHTML = connectionToString(con);\n\t\t\tsuccess = location == null; //if the redirect location was null, this worked\n\t\t} catch (MalformedURLException e) {\n\t\t\tsuccess = false;\n\t\t} catch (IOException e) {\n\t\t\tsuccess = false;\n\t\t}\n\n\t\treturn new Object[]{success, mostRecentHTML};\n\t}",
"boolean isSite271(String url) {\n if (url.startsWith(\"http://pay.88vipbet.com/onlinePay\")) {\r\n return true;\r\n }\r\n return false;\r\n }",
"@Override\n public boolean shouldVisit(Page referringPage, WebURL url) {\n\t String href = url.getURL();\n\t allUrlsObject.visitAllUrls(referringPage,url);\n\t // to keep track of all the urls extracted\n\t urlsExtracted++;\n\t uniqueUrlsExtracted.add(href);\n\t return href.startsWith(\"http://www.nytimes.com/\");\n}",
"public ApiResponse setExcludeFromProxy(String url) {\n try {\n return api.core.excludeFromProxy(Pattern.quote(Pattern.compile(url).pattern()) + \".*\");\n } catch (Exception e) {\n LogManager.suitLogger.error(\"Failed to add regex to exclude from proxy !\", e);\n }\n return null;\n }",
"@Scheduled(fixedRate = checkRate)\n public void CheckValidated() {\n log.info(\"Checking if links still valid and alive\");\n try{\n for(ShortURL s : urlList) {\n UrlValidatorAndCheckerImpl urlValidatorAndChecker = new UrlValidatorAndCheckerImpl(s.getTarget());\n if(!urlValidatorAndChecker.execute()){\n log.info(\"URL {} dead or not valid anymore.\", s.getTarget());\n s.setMode(HttpStatus.GONE.value());\n } else{\n s.setMode(HttpStatus.TEMPORARY_REDIRECT.value());\n }\n }\n } catch( NullPointerException e) {\n //No se ha inicializado aun\n }\n }",
"public void getUrlWaitUntil(WebDriver driver, int seconds, String newURL) throws NumberFormatException, IOException {\n\t\t\t\t\tfinal String previousURL = driver.getCurrentUrl();\n\t\t\t\t\tfinal String URL = newURL.toLowerCase();\n\t\t\t\t\t\n\t\t\t\t// First (initial) connection:\n\t\t\t\t\tint i = 1;\n\t\t\t\t\tint s = 1;\n\t\t\t\t // driver.get(URL);\n\t\t\t\t // waitUntilUrl(driver, seconds, previousURL);\n\t\t\t\t\tlong start = System.currentTimeMillis();\n\t\t\t\t\t\n\t\t\t\t // \"Try Again\" connection manager, if required (up to 10 times):\t\t\t\t\t\n\t\t\t\t\tString xpathTryAgainButton = \"//*[contains(@id,'error')][@id='errorTryAgain'][text()='Try Again']\";\t\t\t\t\t\n\t\t\t\t\t// List<WebElement> list; int s = list.size(); int s = driver.findElements(By.xpath(xpathTryAgainButton)).size();\t\t\t\t\t\n\t\t\t\t\twhile ((s > 0) && (i <= 10)) {\n\t\t\t\t\t\t driver.get(URL);\n\t\t\t\t\t\t waitUntilUrl(driver, seconds, previousURL);\t\t\t\t\t \n\t\t\t\t\t\t s = driver.findElements(By.xpath(xpathTryAgainButton)).size();\n\t\t\t\t\t\t if (s > 0) { i = i + 1; }\n\t\t\t\t\t}\t\n\t\t\t\t\tif (i > 1) {\n\t\t\t\t\t fileWriterPrinter(\"Try Again attempts: \" + i);\n\t\t\t\t fileWriterPrinter(\"Try Again time spent: \" + waitTimeConroller(start, seconds, newURL) + \" sec\\n\");\n\t\t\t\t\t }\t\n\t\t\t\t}",
"@Scheduled(fixedRate = 30 * 60 * 1000)\n public void CheckSafe() {\n log.info(\"Checking if links still safe\");\n try {\n googleSafeBrowsingUrlVerifier = new GoogleSafeBrowsingUrlVerifier();\n for(ShortURL s : urlList) {\n if(!googleSafeBrowsingUrlVerifier.isSafe(s.getTarget())){\n log.info(\"URL {} not safe anymore.\", s.getTarget());\n s.setSafe(false);\n s.setMode(HttpStatus.GONE.value());\n } else{\n s.setSafe(true);\n s.setMode(HttpStatus.TEMPORARY_REDIRECT.value());\n }\n }\n } catch( NullPointerException e) {\n //No se ha inicializado aun\n }\n }",
"private static boolean pingURL(String url, int timeout) {\n try {\n HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();\n connection.setConnectTimeout(timeout);\n connection.setReadTimeout(timeout);\n connection.setRequestMethod(\"HEAD\");\n int responseCode = connection.getResponseCode();\n return (200 <= responseCode && responseCode <= 399);\n } catch (IOException exception) {\n return false;\n }\n }",
"InputFilter[] checkUrlLengthLimit(final Context context);",
"public void checkRedirect(String url){\n if (url.contains(\"?attredirects=0\")){\n String new_url = url.replaceAll(\"\\\\battredirects=0\\\\b\", \"\");\n images.set(current_image, new_url);\n }\n }",
"private Boolean almostAllScraped(int x, int y) {\n if (x == 0 && y > 0) {\n return false;\n } else if (x == 0 && y == 0) {\n return false;\n } else if (x > y) {\n return true;\n }\n double d = (double) ((double) (y - x) / (double) y);\n return d <= 0.01; //stop scraping if true\n //return x >= y - 1;\n }",
"boolean isLimited();",
"public static void main(String[] args) throws Exception {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\LOVELY\\\\selenium20\\\\chromedriver_win32 (1)\\\\chromedriver.exe\");\r\n\t\tSystem.setProperty(\"webdriver.chrome.silentOutput\", \"true\");\r\n\t\tChromeDriver driver=new ChromeDriver();\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.manage().timeouts().implicitlyWait(5000, TimeUnit.MILLISECONDS);\r\n\t\tdriver.get(\"https://www.spicejet.com/\");\r\n\t\tint chl=0,cwl=0,cbl=0;\r\n\t\tList<WebElement> l1=driver.findElements(By.xpath(\"(//a)|(//link)|(//script)|(//base)|(//area)|(//href)|(//img)\"));\r\n\t\t\r\n\t\t//List<WebElement> l2=new ArrayList<WebElement>();\r\n\t\t\r\n\t\tfor(WebElement e:l1) {\r\n\t\t\t\r\n\t\t\tif(e.getAttribute(\"href\")!=null) {\r\n\t\t\t\t//l2.add(e);\r\n\t\t\t\tString href_val=e.getAttribute(\"href\");\r\n\t\t\t\tif(!href_val.equals(\"\")) {\r\n\t\t\t\t\tif(href_val.startsWith(\"http\")||href_val.startsWith(\"https\")) {\r\n\t\t\t\t\t\tchl++;\r\n\t\t\t\t\t\tURL url=new URL(href_val);\r\n\t\t\t\t\t\tURLConnection con=url.openConnection();\r\n\t\t\t\t\t\tHttpURLConnection httpCon=(HttpURLConnection) con;\r\n\t\t\t\t\t\t// httpCon.setConnectTimeout(5000);\r\n\t\t\t\t\t\t httpCon.connect();\r\n\t\t\t\t\t\t String res=httpCon.getResponseMessage();\r\n\t\t\t\t\t\t httpCon.disconnect();\r\n\t\t\t\t\t\t if(res.equalsIgnoreCase(\"OK\")||res.equalsIgnoreCase(\"Accepted\")||res.equalsIgnoreCase(\"Found\")||res.equalsIgnoreCase(\"200\")||res.equalsIgnoreCase(\"202\")||res.equalsIgnoreCase(\"302\")) \r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t cwl++;\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\t cbl++;\r\n\t\t\t\t\t\t\t System.out.println(href_val+\":\"+res);\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\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t}\r\n\t\tSystem.out.println(\"Count all link type elements:\"+chl);\r\n\t\tSystem.out.println(\"Total no of working links: \"+cwl);\r\n\t\tSystem.out.println(\"Total no of broken links: \"+cbl);\r\n\t\tdriver.close();\r\n\t\t\r\n\t\t}",
"@Override\r\n public boolean shouldVisit(WebURL url) {\r\n String href = url.getURL().toLowerCase();\r\n return !FILTERS.matcher(href).matches() && href.startsWith(\"http://fksis.bsuir.by/\");\r\n// \"http://www.ics.uci.edu/\");\r\n }",
"public boolean requiresChecking(ReferencedURL rurl)\n\t{\n\t\t// DO NOT CHANGE THIS METHOD without also changing the other methods in\n\t\t// this policy class, and also the documented policy in the class\n\t\t// comments.\n\n\t\tfinal long lastCheck = rurl.getLastChecked().getTime();\n\n\t\tif( lastCheck < oneMonthAgo() )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif( !rurl.isSuccess() && rurl.getTries() < triesUntilDisabled )\n\t\t{\n\t\t\tif( lastCheck < oneDayAgo() )\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"@Scheduled(fixedRate = checkRate)\n public void CheckExpired() {\n log.info(\"Checking if links expired\");\n try {\n for(ShortURL s : urlList) {\n // Si la fecha guardada es antes que este momento\n Date then1 = s.getExpirationDate();\n java.util.Date then2= new java.util.Date(then1.getTime());\n Instant then = then2.toInstant();\n Instant now = ZonedDateTime.now().toInstant();\n if(then.isBefore(now)){\n log.info(\"URL {} expired.\", s.getUri().toString());\n s.setMode(HttpStatus.GONE.value());\n }\n }\n } catch( NullPointerException e) {\n //No se ha inicializado aun\n }\n\n }",
"public boolean checkPageUrlContains(String fraction) {\n return new WebDriverWait(webDriver, DRIVER_WAIT_TIME)\n .until(ExpectedConditions.urlContains(fraction));\n }",
"private boolean userNotAlreadyFollowing(String url) {\n mStatusTextView.setText(\"\");\n\n if (WearFeedEntry.isFollowingUrl(url)) {\n mStatusTextView.setText(getActivity().getString(R.string.already_following_feed));\n return false;\n }\n\n return true;\n }",
"public static void main(String... args) {\n List<Integer> data = new ArrayList<Integer>();\n data.add(1);\n data.add(1);\n data.add(1);\n data.add(1);\n data.add(2);\n data.add(2);\n data.add(3);\n data.add(4);\n data.add(4);\n data.add(4);\n data.add(4);\n data.add(5);\n data.add(5);\n data.add(5);\n data.add(5);\n data.add(6);\n data.add(6);\n data.add(7);\n data.add(7);\n data.add(7);\n data.add(8);\n data.add(9);\n data.add(10);\n data.add(10);\n data.add(10);\n data.add(10);\n data.add(10);\n data.add(11);\n data.add(12);\n data.add(12);\n\n int count = droppedRequests(data);\n System.out.println(count);\n }",
"private static boolean cancelPotentialDownload(String url, ImageView imageView) {\n BitmapDownloaderTask bitmapDownloaderTask = getBitmapDownloaderTask(imageView);\n\n if (bitmapDownloaderTask != null) {\n String bitmapUrl = bitmapDownloaderTask.url;\n if ((bitmapUrl == null) || (!bitmapUrl.equals(url))) {\n bitmapDownloaderTask.cancel(true);\n } else {\n // The same URL is already being downloaded.\n return false;\n }\n }\n return true;\n }",
"public ApiResponse setExcludeFromSpider(String url) {\n try {\n return api.spider.excludeFromScan(Pattern.quote(Pattern.compile(url).pattern()) + \".*\");\n } catch (Exception e) {\n LogManager.suitLogger.error(\"Failed to add regex to exclude from spider scan !\", e);\n }\n return null;\n }",
"public Urls getNotApprovedUrls() {\n\t\tPropertySelector propertySelector = new PropertySelector(\"approved\");\n\t\tpropertySelector.defineEqual(Boolean.FALSE);\n\t\treturn getUrls(propertySelector);\n\t}",
"public static ArrayList<PEPeer> getNextOptimisticPeers(ArrayList<PEPeer> all_peers, boolean factor_reciprocated, boolean allow_snubbed,\n int num_needed) {\n ArrayList<PEPeer> optimistics = new ArrayList<PEPeer>();\n for (int i = 0; i < all_peers.size(); i++) {\n PEPeer peer = all_peers.get(i);\n\n if (isUnchokable(peer, false) && peer.isChokedByMe()) {\n optimistics.add(peer);\n }\n }\n\n if (optimistics.isEmpty() && allow_snubbed) { // try again, allowing snubbed peers as last resort\n for (int i = 0; i < all_peers.size(); i++) {\n PEPeer peer = all_peers.get(i);\n\n if (isUnchokable(peer, true) && peer.isChokedByMe()) {\n optimistics.add(peer);\n }\n }\n }\n\n if (optimistics.isEmpty())\n return null; // no unchokable peers avail\n\n // factor in peer reciprocation ratio when picking optimistic peers\n\n ArrayList<PEPeer> result = new ArrayList<PEPeer>(optimistics.size());\n\n if (factor_reciprocated) {\n\n ArrayList<PEPeerTransport> ratioed_peers = new ArrayList<PEPeerTransport>(optimistics.size());\n long[] ratios = new long[optimistics.size()];\n Arrays.fill(ratios, Long.MIN_VALUE);\n\n // order by upload ratio\n for (int i = 0; i < optimistics.size(); i++) {\n PEPeer peer = optimistics.get(i);\n\n // score of >0 means we've uploaded more, <0 means we've downloaded more\n long score = peer.getStats().getTotalDataBytesSent() - peer.getStats().getTotalDataBytesReceived();\n\n UnchokerUtil.updateLargestValueFirstSort(score, ratios, peer, ratioed_peers, 0); // higher value = worse score\n }\n\n for (int i = 0; i < num_needed && ratioed_peers.size() > 0; i++) {\n\n double factor = 1F / (0.8 + 0.2 * Math.pow(RandomUtils.nextFloat(), -1)); // map to sorted list using a logistic curve\n\n int pos = (int) (factor * ratioed_peers.size());\n\n result.add(ratioed_peers.remove(pos));\n }\n } else {\n\n for (int i = 0; i < num_needed && optimistics.size() > 0; i++) {\n\n int rand_pos = new Random().nextInt(optimistics.size());\n\n result.add(optimistics.remove(rand_pos));\n }\n }\n\n return (result);\n\n // TODO:\n // in downloading mode, we would be better off optimistically unchoking just peers we are interested in ourselves,\n // as they could potentially reciprocate. however, new peers have no pieces to share, and are not interesting to\n // us, and would never be unchoked, and thus would never get any data.\n // we could use a deterministic method for new peers to get their very first piece from us\n }",
"public boolean beforeCrawl(CrawlableURL crawlableURL, int priority);",
"public boolean checkPageUrlToBe(String url) {\n return new WebDriverWait(webDriver, DRIVER_WAIT_TIME).until(ExpectedConditions.urlToBe(url));\n }",
"private void checkSpeedAndReserved()\n\t{\n\t\t// only check every 5 seconds\n\t\tif(mainloop_loop_count % MAINLOOP_FIVE_SECOND_INTERVAL != 0)\n\t\t\treturn;\n\n\t\tfinal int\t\t\t\tnbPieces\t=_nbPieces;\n\t\tfinal PEPieceImpl[] pieces =pePieces;\n\t\t//for every piece\n\t\tfor (int i =0; i <nbPieces; i++)\n\t\t{\n\t\t\t// placed before null-check in case it really removes a piece\n\t\t\tcheckEmptyPiece(i);\n\n\n\t\t\tfinal PEPieceImpl pePiece =pieces[i];\n\t\t\t// these checks are only against pieces being downloaded\n\t\t\t// yet needing requests still/again\n\t\t\tif (pePiece !=null)\n\t\t\t{\n\t\t\t\tfinal long timeSinceActivity =pePiece.getTimeSinceLastActivity()/1000;\t\t\t\t\n\n\t\t\t\tint pieceSpeed =pePiece.getSpeed();\n\t\t\t\t// block write speed slower than piece speed\n\t\t\t\tif (pieceSpeed > 0 && timeSinceActivity*pieceSpeed*0.25 > DiskManager.BLOCK_SIZE/1024)\n\t\t\t\t{\n\t\t\t\t\tif(pePiece.getNbUnrequested() > 2)\n\t\t\t\t\t\tpePiece.setSpeed(pieceSpeed-1);\n\t\t\t\t\telse\n\t\t\t\t\t\tpePiece.setSpeed(0);\n\t\t\t\t}\n\n\n\t\t\t\tif(timeSinceActivity > 120)\n\t\t\t\t{\n\t\t\t\t\tpePiece.setSpeed(0);\n\t\t\t\t\t// has reserved piece gone stagnant?\n\t\t\t\t\tfinal String reservingPeer =pePiece.getReservedBy();\n\t\t\t\t\tif(reservingPeer !=null)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal PEPeerTransport pt = getTransportFromAddress(reservingPeer);\n\t\t\t\t\t\t// Peer is too slow; Ban them and unallocate the piece\n\t\t\t\t\t\t// but, banning is no good for peer types that get pieces reserved\n\t\t\t\t\t\t// to them for other reasons, such as special seed peers\n\t\t\t\t\t\tif (needsMD5CheckOnCompletion(i))\n\t\t\t\t\t\t\tbadPeerDetected(reservingPeer, i);\n\t\t\t\t\t\telse if (pt != null)\n\t\t\t\t\t\t\tcloseAndRemovePeer(pt, \"Reserved piece data timeout; 120 seconds\", true);\n\n\t\t\t\t\t\tpePiece.setReservedBy(null);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!piecePicker.isInEndGameMode()){\n\t\t\t\t\t\tpePiece.checkRequests();\n\t\t\t\t\t}\n\n\t\t\t\t\tcheckEmptyPiece(i);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}",
"private boolean caughtTwenty(){\n\t\treturn (theTrainer.getPokedex().size() >= 20);\n\t}",
"@Override\r\n\tpublic int leggiPagine(Scanner s) throws UrlNonValidoException {\r\n\t\tint x = 0;\r\n\t\tPaginaWeb pag;\r\n\t\t\r\n\t\ttry {\r\n\t\t\twhile( (pag = PaginaWeb.leggi(s)) != null ) {\r\n\t\t\t\tif( pag.puntaAHost(urlBase) ) { // Il metodo non richiama aggiungiPagina perche' il comportamento e' indefinito nel caso di dynamic binding.\r\n\t\t\t\t\tif(super.aggiungiPagina(pag))\r\n\t\t\t\t\t\tx++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (NoSuchElementException e) {\r\n\t\t\treturn x;\r\n\t\t}\r\n\t\treturn x;\r\n\t}",
"public void enqueue(String url) {\n while(is_locked){\n try {\n // timer_counter = timer_counter + 1;\n // if (timer_counter == 20) {\n // is_locked = false;\n // }\n Thread.sleep(100);\n } catch(InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }\n\n is_locked = true;\n queue.add(url);\n is_locked = false;\n \n }",
"@Override\n\tpublic void setMaxNumOfUrls(int maxNumOfUrls) {\n\t\t\n\t}",
"public void wapTinyurl() {\n String url = \"http://m.nuomi.com/mianyang/deal/l5kkhcqr\";\r\n Pattern p = Pattern.compile(\"^http://\\\\w+\\\\.nuomi\\\\.com/\\\\w+/deal/(\\\\w+$)\");\r\n Matcher m = p.matcher(url);\r\n if (m.find()) {\r\n p(m.group(1));\r\n }\r\n }",
"private void innerCrawl(URL url, int limit) {\n\t\t\tsynchronized(urls) {\n\t\t\t\tif(urls.size() <= limit) {\n\t\t\t\t\tqueue.execute(new CrawlWorker(url.toString()));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"@Override\n public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {\n Log.v(\"WVClient.onReceiveError\", \" receieved an error\" + error);\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n onSendUpdate(\"WVClient has received an error!\");\n }\n });\n\n //do what would be done in processHTML but avoid anything to do with scraping, move onto next page\n crawlComplete = false;\n\n if (masterEmailSet.size() > 20){\n //if more than twenty emails have been discovered, the crawl is done\n crawlComplete = true;\n }\n\n if (masterEmailSet.size() > 0 && !searchTerm.equals(\"\")){\n //if at least one email with the search term has been found, crawl is done\n crawlComplete = true;\n }\n\n\n if (collectedLinks.iterator().hasNext() && !crawlComplete){\n //if there's another link and crawl isn't deemed complete, hit next URL\n browser.post(new Runnable() {\n @Override\n public void run() {\n Log.v(\"processHTML\", \" loading page on browser:\" + collectedLinks.iterator().next());\n visitedLinks.add(collectedLinks.iterator().next());\n browser.loadUrl(collectedLinks.iterator().next());\n }\n });\n }\n }",
"public void run()\n\t\t{\n\t\t\tint num = 0;\n\t\t\ttry{\n\t\t\t\tlog.debug(\"Dealing with: \" + url.toString() + \" From : \" + urlp);\n\t\t\t\t\n\t\t\t\tSocket socket = new Socket(url.getHost(), PORT);\n\t\t\t\tPrintWriter writer = new PrintWriter(socket.getOutputStream());\n\t\t\t\tBufferedReader reader = \n\t\t\t\t\tnew BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\t\tString request = \"GET \" + url.getPath() + \" HTTP/1.1\\n\" +\n\t\t\t\t\t\t\t\t\"Host: \" + url.getHost() + \"\\n\" +\n\t\t\t\t\t\t\t\t\"Connection: close\\n\" + \n\t\t\t\t\t\t\t\t\"\\r\\n\";\n\t\t\t\twriter.println(request);\n\t\t\t\twriter.flush();\n\t\t\n\t\t\t\tString line = reader.readLine();\n\t\t\t\t// filter the head message of the response\n\t\t\t\twhile(line != null && line.length() != 0)\n\t\t\t\t{\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t}\n\t\t\t\t// keep the html context\n\t\t\t\twhile (line != null) \n\t\t\t\t{\n\t\t\t\t\tcontext += line + \"\\n\";\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t}\n\t\t\t\treader.close();\n\t\t\t\twriter.close();\n\t\t\t\tsocket.close();\n\t\t\t\t//log.debug(context);\n\t\t\t\tstripper = new TagStripper(context);\n\t\t\t\tlog.debug(\"Removing script and style from: \" + url.toString());\n\t\t\t\tstripper.removeComments();\n\t\t\t\tstripper.removeScript();\n\t\t\t\tstripper.removeStyle();\n\t\t\t\tlog.debug(\"Getting links from: \" + url.toString());\n\t\t\t\tArrayList<String> link = new ArrayList<String>();\n\t\t\t\tstripper.buildLinks(url.toString());\n\t\t\t\t\n\t\t\t\tlink = stripper.getLinks();\n\t\t\t\tfor(String tmp : link) {\n\t\t\t\t\tif(getCount() < pageNum ) {\n\t\t\t\t\t\t// find if the link has been already visited\n\t\t\t\t\t\tif(!urlList.contains(tmp)) {\n\t\t\t\t\t\t\tworkers.execute(new SingleHTMLFetcher(new URL(tmp), this.url.toString()));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tString title = stripper.getTitle();\n\t\t\t\tif(title == null)\n\t\t\t\t\ttitle = \"NO title\";\n\t\t\t\ttitle = title.replaceAll(\"&[^;]*;\", \"\");\n\t\t\t\tlog.debug(\"Removing tags from: \" + url.toString());\n\t\t\t\tstripper.removeTags();\n\t\t\t\tstripper.removeSymbol();\n\t\t\t\tString snippet = stripper.getSnippet(title);\n\t\t\t\tdb.savePageInfo(connection, title, snippet, url.toString());\n\t\t\t\tcontext = stripper.getContext();\n\t\t\t\tString[] words = context.toLowerCase().split(\"\\\\s\");\n\t\t\t\tArrayList<String> wordsList = new ArrayList<String>();\n\t\t\t\tfor (int i = 0; i < words.length; i++) {\n\t\t\t\t\t// delete non-word character\n\t\t\t\t\twords[i] = words[i].replaceAll(\"\\\\W\", \"\").replace(\"_\",\n\t\t\t\t\t\t\t\"\");\n\t\t\t\t\tif(words[i].length() != 0)\n\t\t\t\t\t\twordsList.add(words[i]);\n\t\t\t\t}\n\t\t\t\tfor (String w : wordsList) {\n\t\t\t\t\tif (w.length() != 0) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tindex.addNum(w, url.toString(), num);\n\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\tnum++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlog.debug(\"URL: \" + url.toString() + \" is finished!\");\n\t\t\t\tdecrementPending();\n\t\t\t}catch(Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}",
"private boolean linkIsViableWiFi(Location v1, AdhocPacket other) {\n\t\tLocation v2 = other.getLocation();\n\n\t\tif (v1 == null || v2 == null) {\n\t\t\tlog_nodisplay(\"Link not viable: GPS disabled\");\n\t\t\treturn false;\n\t\t}\n\n\t\tfloat distance = v1.distanceTo(v2);\n\t\tlong threshold = 70;\n\t\tboolean viable = (distance < threshold);\n\n\t\tlog_nodisplay(String.format(\n\t\t\t\t\"Link %s: %.1f meters apart (threshold %d). v1=%s v2=%s\",\n\t\t\t\tviable ? \"viable\" : \"not viable\", distance, threshold, v1, v2));\n\n\t\treturn viable;\n\t}",
"@Test\n public void pacDownloadFromURLShouldNotUseProxy() throws Exception {\n ProxySelector oldOne = ProxySelector.getDefault();\n try {\n ProxySelector.setDefault(new ProxySelector() {\n @Override\n public List<Proxy> select(URI uri) {\n throw new UsedProxyException(\"Should not download via proxy\");\n }\n\n @Override\n public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {\n // Not used\n }\n });\n PacProxySelector pacProxySelector = new PacProxySelector(\n new UrlPacScriptSource(\"http://www.test.invalid/wpad.pac\"));\n List<Proxy> ret = pacProxySelector.select(TestUtil.HTTPS_TEST_URI);\n assertEquals(\"Should return no proxy for invalid pac url\", Proxy.NO_PROXY, ret.get(0));\n } finally {\n ProxySelector.setDefault(oldOne);\n }\n }",
"@Override\r\n\tpublic int compareTo(urlObject o) {\n\t\treturn this.counts-o.getCounts()==0?this.getUrl().compareTo(o.getUrl()):\r\n\t\t\to.getCounts()-this.getCounts();\r\n\t}",
"boolean wasPreviouslyVerified(String url);",
"WebPage limit(int limit);",
"private static boolean isUnknownSource(String url) {\n return false;\n }",
"public static boolean shouldnotVisit(String url) {\n\t\tString href = url.toLowerCase();\n\n\t\treturn BINARY_FILES_EXTENSIONS.matcher(href).matches();\n\t}",
"public void setMaxRequestUrlsReported(int value) {\n this.maxRequestUrlsReported = value;\n }",
"private boolean tienePermiso(String urlStr){\n return true;\n }",
"private boolean linkIsViableDSRC(Location v1, AdhocPacket other) {\n\t\tLocation v2 = other.getLocation();\n\n\t\tif (v1 == null || v2 == null) {\n\t\t\tlog_nodisplay(\"Link not viable: GPS disabled\");\n\t\t\treturn false;\n\t\t}\n\n\t\tfloat distance = v1.distanceTo(v2);\n\t\tlong threshold = 250;\n\t\tboolean viable = (distance < threshold);\n\n\t\tlog_nodisplay(String.format(\n\t\t\t\t\"Link %s: %.1f meters apart (threshold %d). v1=%s v2=%s\",\n\t\t\t\tviable ? \"viable\" : \"not viable\", distance, threshold, v1, v2));\n\n\t\treturn viable;\n\t}",
"private void updateDownloadUrls() {\n VideoData videoData = VideoHelper.getFullData(getContentResolver(), mVideoId);\n if (!videoData.isOnAir()) {\n if (ZypeConfiguration.isDownloadsEnabled(this)\n && (ZypeConfiguration.isDownloadsForGuestsEnabled(this) || SettingsProvider.getInstance().isLoggedIn())) {\n getDownloadUrls(mVideoId);\n }\n }\n }",
"public void testBrokenLinks() throws InterruptedException {\n\t\tJavascriptExecutor jse = (JavascriptExecutor) (driver);\n\t\ttry {\n\t\t\tThread.sleep(5000);\n\t\t} catch (InterruptedException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tList<WebElement> allLinks = driver.findElements(By.xpath(\"//a\"));\n\n\t\tint totalLinks = 0, failedLinks = 0;\n\n\t\tfor (WebElement link : allLinks) {\n\t\t\tString src = link.getAttribute(\"href\");\n\t\t\t// System.out.println(src);\n\n\t\t\tif (null != src && src.trim().startsWith(\"javascript\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (null != src && (!(src.startsWith(\"http://\") || src.startsWith(\"https://\")))) {\n\t\t\t\tsrc = baseUrl + src;\n\n\t\t\t}\n\t\t\t// System.out.println(\"Source:\"+src);\n\t\t\tif (null != src) {\n\t\t\t\ttotalLinks++;\n\t\t\t\tThread.sleep(200);\n\t\t\t\t// String linkName=link.getText();\n\t\t\t\tString linkName = ((String) jse.executeScript(\"var e=arguments[0];return e.innerText;\", link))\n\t\t\t\t\t\t.replaceAll(\"\\n\", \"\").trim();\n\t\t\t\tif (linkName.trim().equals(\"\"))\n\t\t\t\t\tThread.sleep(200);\n\t\t\t\t{\n\t\t\t\t\tlinkName = ((String) jse.executeScript(\"var e=arguments[0];return e.innerHTML;\", link))\n\t\t\t\t\t\t\t.replaceAll(\"\\n\", \"\").trim();\n\t\t\t\t}\n\t\t\t\tURL url;\n\t\t\t\tHttpURLConnection conn;\n\t\t\t\tint response = 0;\n\t\t\t\ttry {\n\t\t\t\t\turl = new URL(src);\n\t\t\t\t\tconn = (HttpURLConnection) url.openConnection();\n\t\t\t\t\tresponse = conn.getResponseCode();\n\t\t\t\t\tif (response != HttpURLConnection.HTTP_OK) {\n\t\t\t\t\t\tSystem.out.println(\"Link: \" + linkName + \"is broken\");\n\t\t\t\t\t\tSystem.out.println(\"Broken URL: \" + src);\n\t\t\t\t\t\tSystem.out.println(\"Resonse is: \" + response);\n\t\t\t\t\t\tfailedLinks++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println(\"Link: \" + linkName + \"is Working\");\n\t\t\t\t\t}\n\t\t\t\t} catch (MalformedURLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tSystem.out.println(\"Link: \" + linkName + \"is broken\");\n\t\t\t\t\tfailedLinks++;\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tSystem.out.println(\"Link: \" + linkName + \"is broken\");\n\t\t\t\t\tfailedLinks++;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"Total Links Verified:\" + totalLinks + \"\\n Failed Links Count :\" + failedLinks);\n\n\t}",
"private boolean checkSiteVisited(String url)\r\n\t{\r\n\t\tfor (int i = 0; i < siteVisited; i++)\r\n\t\t{\r\n\t\t\tif (webVisited[0][i].equals(url))\t\t\t//this url has been visited by user before\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}",
"private static boolean testNotFound() {\r\n\t\t// use ExecutorService to manage threads\r\n\t\tExecutorService executor = Executors.newFixedThreadPool(1);\r\n\t\t\r\n\t\tlogger.finest(\"sending request\");\r\n\t\tURL url = urlList.get(0);\r\n\t\t\r\n\t\ttry {\r\n\t\t\tURL notFoundURL = new URL(url.getProtocol(), url.getHost(), url.getPort(), url.getFile() + \"random\");\r\n\t\t\tHttpClient client = new HttpClient(notFoundURL);\r\n\t\t\texecutor.execute(client);\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t\tlogger.severe(\"problem formatting URL\");\r\n\t\t}\r\n\t\t\r\n\t\t// wait for test to finish\r\n\t\tlogger.finest(\"waiting for request to complete...\");\r\n\t\texecutor.shutdown(); \r\n\t\twhile (!executor.isTerminated())\r\n\t\t\tThread.yield(); // return the control to system\r\n\t\tlogger.finest(\"not found request completed\");\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"@Test(priority = 1)\n public void printBrokenLinks() {\n\t HttpURLConnection httpCon;\n\t /*\n\t * filter all the anchor tags whose href attribute is empty/broken/third party domain link and are commented.\n\t */\n\t List<WebElement> anchorElem = driver.findElements(By.tagName(\"a\")).stream().filter(elem->elem.getAttribute(\"href\")!=null || elem.getAttribute(\"href\").startsWith(\"javaScript:void(0)\")).\n\t\t\t filter(elem-> !elem.getAttribute(\"href\").isBlank() ||\n\t\t\t !elem.getAttribute(\"href\").isEmpty() ||\n\t\t\t !elem.getAttribute(\"href\").startsWith(baseUrl)).collect(Collectors.toList());\n\t for (WebElement anchor : anchorElem) {\n\t\tString url = anchor.getAttribute(\"href\");\n\t\t/*Get the http connection. connect to link and get response code\n\t\t * Use HEAD request method. GET can be used. But, we need only response code.\n\t\t * \n\t\t */\n\t\ttry {\n\t\t\tSystem.out.println(url);\n\t\t\thttpCon = (HttpURLConnection) new URL(url).openConnection();\n\t\t\thttpCon.setRequestMethod(\"HEAD\");\n\t\t\thttpCon.connect();\n\t\t\tint respCode = httpCon.getResponseCode();\n\t\t\tif(respCode >= 400) {\n\t\t\t\tSystem.out.println(url+\" is a broken link.\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}finally {\n\t\t\t\n\t\t}\n\t}\n\t\t\t\t\t\n\t\t\t \n\t \n }",
"@Override\n public void run()\n {\n Document doc = null;\n try\n {\n // Politeness policy\n try\n {\n // Used so that we don't have multiple threads sleeping, instead the rest just wait on the\n // semaphore\n if (PolitenessPolicy()) return;\n\n doc = Jsoup.connect(threadVertex.getUrl()).get();\n }\n catch (InterruptedException e)\n {\n e.printStackTrace();\n return;\n }\n }\n catch (UnsupportedMimeTypeException e)\n {\n// System.out.println(\"--unsupported document type, do nothing\");\n return;\n }\n catch (HttpStatusException e)\n {\n// System.out.println(\"--invalid link, do nothing\");\n return;\n }\n catch (IOException e)\n {\n e.printStackTrace();\n return;\n }\n finally\n {\n politenessInteger.incrementAndGet();\n }\n\n Elements links = doc.select(\"a[href]\");\n for (Element link : links)\n {\n String v = link.attr(\"abs:href\");\n// System.out.println(\"Found: \" + v);\n\n// Document temp = null;\n if (!Util.ignoreLink(threadVertex.getUrl(), v))\n {\n // This was originally trying to catch invalid links before adding them to the graph\n // but I realized those are also valid notes, just leaf nodes.\n // This also greatly speeds up the execution of the program.\n// try\n// {\n// try\n// {\n// // Used so that we don't have multiple threads sleeping, instead the rest just wait on the\n// // semaphore\n// if (PolitenessPolicy()) return;\n//\n// temp = Jsoup.connect(v).get();\n// }\n// catch (InterruptedException e)\n// {\n// e.printStackTrace();\n// return;\n// }\n// }\n// catch (UnsupportedMimeTypeException e)\n// {\n// System.out.println(\"--unsupported document type, do nothing\");\n// return;\n// }\n// catch (HttpStatusException e)\n// {\n// System.out.println(\"--invalid link, do nothing\");\n// return;\n// }\n// catch (IOException e)\n// {\n// e.printStackTrace();\n// return;\n// }\n\n Vertex newVertex = new Vertex(v);\n\n // We need to synchronize the graph and the queue among each thread\n // This avoids dirty reads and dirty writes\n synchronized(graph)\n {\n synchronized(urlQueue)\n {\n if (!graph.containsKey(newVertex.getUrl()))\n {\n int newVertexDepth = threadVertex.getDepth() + 1;\n int currentPages = graph.size();\n\n if (currentPages < maxPages && newVertexDepth <= maxDepth)\n {\n // Set the new vertex's depth and add an ancestor\n newVertex.setDepth(newVertexDepth);\n newVertex.addAncestor(threadVertex);\n\n // Update the current vertex to have this one as a child\n threadVertex.addChild(newVertex);\n graph.put(threadVertex.getUrl(), threadVertex);\n\n // Place the new vertex in the discovered HashMap and place it in the queue\n graph.put(newVertex.getUrl(), newVertex);\n\n urlQueue.add(newVertex);\n }\n }\n else\n {\n // Done to update relationships of ancestors and children\n Vertex oldVertex = graph.get(newVertex.getUrl());\n\n oldVertex.addAncestor(threadVertex);\n threadVertex.addChild(oldVertex);\n\n graph.put(oldVertex.getUrl(), oldVertex);\n graph.put(threadVertex.getUrl(), threadVertex);\n }\n }\n }\n }\n else\n {\n// System.out.println(\"--ignore\");\n return;\n }\n }\n }",
"private static List<PwPair> removeDuplicateSiteUrls(List<PwPair> allPwPairs) {\n List<PwPair> filteredPwPairs = new ArrayList<>();\n Set<String> siteUrls = new HashSet<>();\n for (PwPair pwPair : allPwPairs) {\n String siteUrl = pwPair.getPwsResult().getSiteUrl();\n if (!siteUrls.contains(siteUrl)) {\n siteUrls.add(siteUrl);\n filteredPwPairs.add(pwPair);\n }\n }\n return filteredPwPairs;\n }",
"public List<String> getUrlsToCheck(CachedUrl cu) {\n List<String> res = new ArrayList<String>(3);\n Properties props;\n switch (detectNoSubstanceRedirectUrl) {\n case First:\n return ListUtil.list(cu.getUrl());\n case Last:\n props = cu.getProperties();\n String url = props.getProperty(CachedUrl.PROPERTY_CONTENT_URL);\n if (url == null) {\n\turl = cu.getUrl();\n }\n return ListUtil.list(url);\n case All:\n return AuUtil.getRedirectChain(cu);\n }\n return res;\n }",
"public void printTopBlockers(){\n Player topBlocker1 = players.get(0);\n Player topBlocker2 = players.get(0);\n // Iterates through the players ArrayList and sets the stop blocker as topBlocker1\n for (Player player : players){\n if (player.getBlockStat() > topBlocker1.getBlockStat()){\n topBlocker1 = player;\n }\n }\n\n // If topBlocker1 is the first item in the players ArrayList then topBlocker2 will be\n // initialized with the second item\n if (topBlocker1 == players.get(0)){\n topBlocker2 = players.get(1);\n }\n // Iterates through the players ArrayList and sets the stop attacker as topBlocker2\n for (Player player : players){\n if (player != topBlocker1){\n if (player.getBlockStat() > topBlocker2.getBlockStat()){\n topBlocker2 = player;\n }\n }\n }\n topBlocker1.printPlayerInfo();\n topBlocker2.printPlayerInfo();\n }",
"public ArrayList<String> search(String url) {\n Pattern msnPattern = Pattern.compile(\".*msn.com.*\");\n Pattern foolPattern = Pattern.compile(\".*fool.com.*\");\n Matcher foolMatcher = foolPattern.matcher(url);\n Matcher msnMatcher = msnPattern.matcher(url);\n\n ArrayList<String> stockArticles = new ArrayList<String>();\n if (foolMatcher.matches()) {\n Connection connection = Jsoup.connect(\"https://www.fool.com/market-movers/\");\n try {\n Document htmlDocument = connection.get();\n Elements linksOnPage = htmlDocument.select(\"h4\");\n for (Element link : linksOnPage) {\n stockArticles.add(link.text());\n }\n }\n catch (IOException e) {\n System.out.println(e);\n }\n } else if (msnMatcher.matches()) {\n Connection connection2 = Jsoup.connect(\"http://www.msn.com/en-us/money/investing\");\n try {\n Document htmlDocument2 = connection2.get();\n Elements linksOnPage2 = htmlDocument2.select(\"h3\");\n for (Element link : linksOnPage2) {\n stockArticles.add(link.text());\n }\n }\n catch (IOException e) {\n System.out.println(e);\n }\n } else {\n Connection connection3 = Jsoup.connect(\"https://www.nytimes.com/topic/organization/new-york-stock-exchange\");\n try {\n Document htmlDocument3 = connection3.get();\n Elements linksOnPage3 = htmlDocument3.select(\"h2\");\n for (Element link : linksOnPage3) {\n stockArticles.add(link.text());\n }\n }\n catch (IOException e) {\n System.out.println(e);\n }\n }\n return stockArticles;\n }",
"@Test\r\n public void incorrectUrlTest(){\r\n boolean noException = false;\r\n \r\n try {\r\n extractor = new HTMLExtractor(\"google.co.uk\");\r\n noException = true;\r\n } catch (IOException e) {\r\n // TODO Auto-generated catch block\r\n System.out.println(e.getMessage());\r\n }\r\n\r\n assertTrue(\"should not throw an exception\", noException);\r\n }",
"protected Driver findPassthru(String url) throws SQLException {\n P6ModuleManager.getInstance();\n \n String realUrl = extractRealUrl(url);\n Driver passthru = null;\n for (Driver driver: registeredDrivers() ) {\n try {\n if (driver.acceptsURL(extractRealUrl(url))) {\n passthru = driver;\n break;\n }\n } catch (SQLException e) {\n }\n }\n if( passthru == null ) {\n throw new SQLException(\"Unable to find a driver that accepts \" + realUrl);\n }\n return passthru;\n }",
"private String nextUrl()\n {\n String nextUrl;\n do\n {\n nextUrl = this.pagesToVisit.remove(0);\n } while(this.pagesVisited.contains(nextUrl));\n this.pagesVisited.add(nextUrl);\n return nextUrl;\n }",
"public void iterateThroughtEachElement(){\r\n ArrayList<String> links = examineHTML.getHrefOffers();\r\n \r\n int index = 0;\r\n \r\n for(String link:links){\r\n getHTMLOffer(link, index);\r\n ++index;\r\n }\r\n /*for(int i = 0; i < 10; i++){\r\n getHTMLOffer(links.get(i), index);\r\n ++index;\r\n }*/\r\n \r\n analyzeEachOffer();\r\n }",
"private boolean isValidExtension(String url){\n for (String ext : IGNORED_EXTENSIONS) {\n if (url.contains(ext)) {\n return false;\n }\n }\n return true;\n }",
"@Override\n public void onReceivedError(final WebView view, int errorCode, String description, String failingUrl) {\n Log.w(TAG, String.format(\"%d: Could not load %s: %s\", errorCode, failingUrl, description));\n view.loadData(getString(R.string.blank_page), \"text/html\", null);\n Toast.makeText(activity, \"Network error\", Toast.LENGTH_SHORT).show();\n final String retryUrl = failingUrl;\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(activity, \"Retrying...\", Toast.LENGTH_SHORT).show();\n view.loadUrl(retryUrl);\n }\n }, 5000);\n //super.onReceivedError(view, errorCode, description, failingUrl);\n }",
"private Set<String> findNewUrls(Document doc) {\n Set<String> newUrlSet = new HashSet<>();\n\n for (Element ah : doc.select(\"a[href]\")) {\n String href = ah.attr(\"abs:href\");\n\n if (!urlSet.contains(href) // Check if this is a new URL\n && href.contains(domain) // Check if the URL is from the same domain\n && isValidExtension(href) // Check that the file extension is not in the list of excluded extensions\n && !href.contains(\"mailto:\") // Check that the href is not an email address\n ) {\n newUrlSet.add(href);\n }\n\n }\n\n processNewUrls(newUrlSet);\n return newUrlSet;\n }",
"protected abstract void startPing(Set<String> urls);",
"public void soldierRomCheck(final ArrayList<String> urls) {\n if (romInt == 1) {\n firmwareVersion = firmwarename.substring(26); //Shorting the Build Number to only show the firmware version.\n cFirmwareVersion.setText(firmwareVersion);\n cFirmware = Double.parseDouble(firmwareVersion); //Making the firmware version a double.\n new Thread(new Runnable() {\n\n public void run() {\n\n try {\n //Getting Changelog file from URL\n URL url = new URL(soldierFile);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setConnectTimeout(60000);\n\n //Defining the BufferedReader to read from the file\n BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));\n\n String str;\n //Reading the entire text file.\n while ((str = in.readLine()) != null) {\n urls.add(str);\n }\n in.close();\n } catch (Exception e) {\n Log.d(\"MyTag\", e.toString());\n }\n\n //On finish\n runOnUiThread(new Runnable() {\n public void run() {\n lFirmwareVersion.setText(urls.get(0)); //Setting the latest firmware version to be the first line of changelog file.\n lFirmware = Double.parseDouble(lFirmwareVersion.getText().toString());\n fwColor(); //Colorizing the firmware text.\n }\n });\n\n }\n }).start();\n } else {\n //If SoLdieR's rom isn't selected, making everything disappear.\n cFirmwareVersion.setText(\"\");\n lFirmwareVersion.setText(\"\");\n fTitle.setText(\"\");\n cfText.setText(\"\");\n lfText.setText(\"\");\n soldierxdaButton.setVisibility(View.GONE);\n soldiersiteButton.setVisibility(View.GONE);\n dlromButton.setVisibility(View.GONE);\n changelogLink.setClickable(false);\n changelogLink.setText(\"\");\n }\n }",
"private String getURL(String feedUrl) {\n\tStringBuilder sb = null;\n\ttry {\n for(int i = 3; i>0; i--) {\n\t sb = new StringBuilder();\n URL url = new URL(feedUrl);\n//User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.22) Gecko/20110902 Firefox/3.6.22 GTB7.1 ( .NET CLR 3.5.30729)\n//Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\n//Accept-Language: en-us,en;q=0.5\n//Accept-Encoding: gzip,deflate\n//Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\n//Keep-Alive: 115\n//Connection: keep-alive\n//\tHttpsURLConnection uc = (HttpsURLConnection) url.openConnection();\n\tHttpURLConnection uc = (HttpURLConnection) url.openConnection();\n\tuc.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.22) Gecko/20110902 Firefox/3.6.22 GTB7.1 ( .NET CLR 3.5.30729)\");\n//Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\n\tuc.setRequestProperty(\"Accept\", \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\");\n\tuc.setRequestProperty(\"Accept-Language\", \"en-us,en;q=0.5\");\n\tuc.setRequestProperty(\"Accept-Encoding\", \"gzip,deflate\");\n\tuc.setRequestProperty(\"Accept-Charset\", \"ISO-8859-1,utf-8;q=0.7,*;q=0.7\");\n\tuc.setRequestProperty(\"Keep-Alive\", \"115\");\n\tuc.setRequestProperty(\"Connection\", \"keep-alive\");\n//Keep-Alive: 115\n//Connection: keep-alive\n//\tif (userName != null && password != null) {\n//\t\tuc.setRequestProperty(\"Authorization\", \"Basic \" + encodedAuthenticationString);\n//\t}\n\t// ori setting??\n//\tuc.setReadTimeout(TIME_OUT);\n//\tuc.setFollowRedirects(true);\n//\tuc.setInstanceFollowRedirects(true);\n//\tuc.setAllowUserInteraction(true);\n\tuc.setDoOutput(true);\n\tuc.setDoInput(true);\n\tuc.setUseCaches(false);\n\tuc.setRequestMethod(\"POST\");\n\tuc.setRequestProperty(\"Content-Type\", \"text/xml\");\n\t\n\tBufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));//uc.getInputStream()\n\tString inputLine;\n//\t'aa7c.com')\" onmouseout=\"menuLayers.hide()\">Available</a>\n\tboolean refreshAgain = false;\n\twhile ((inputLine = in.readLine()) != null) {\n//\t\tSystem.out.println(inputLine);\n\t\tsb.append(inputLine);\n\t\tif( inputLine.contains(\"Refresh\") ) {\n\t\t\trefreshAgain = true;\n\t\t\tSystem.out.println(\"Refresh\");\n\t\t}\n\t}\n\tin.close();\n\tuc.disconnect();\t\t\n//\tRefresh\n\tif( refreshAgain ) {\n\t Thread.sleep(1000);\n\t}\n\telse break;\n }\n }catch(Exception ee){}\nreturn sb.toString();\n}",
"protected void VerifyUrlDoesntHaveAnError() {\n\t\tif (urlHasAnError())\n\t\t\tReports.logAMessage(LogStatus.ERROR, \"BasePage: URL has an error\");\n\t}",
"@Override\n\tpublic Collection<URL> getUrlsToFilter() {\n\t\tSet<URL> filterSet = new HashSet<URL>();\n\t\tString url=\"http://www.infoq.com/news/2012/11/Panel-WinRT-Answers;jsessionid=91AB81A159E85692E6F1199644E2053C \";\n\t\tfilterSet.add(URL.valueOf(url));\n\t\treturn filterSet;\n\t}",
"private void checkPoints() {\n if (mPointsManager.getScore() < 20 && !SharedDataManager.isHuntReady(this)) {\n /* Before the 30 points 'reward', player must have no locked target in history */\n if (SharedDataManager.isLockedTargetInHistory(MainActivity.this)) {\n return;\n }\n mPointsManager.setScore(30);\n updateInfo();\n try {\n if (!requestingPoints) {\n requestingPoints = true;\n /* Update the value in the server database if possible */\n mPointsManager.updateInDatabase(MainActivity.this, new ResponseTask.OnResponseTaskCompleted() {\n @Override\n public void onResponseTaskCompleted(Request request, Response response, OHException ohex, Object data) {\n /* It's ok if the request was not successful, the update will be done later */\n requestingPoints = false;\n }\n });\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }",
"private static ArrayList<Result> pruneResults(ArrayList<Result> pruneThis, int limit){\n\t\tArrayList<Result> sortednodups = sortByScore(pruneThis);\n\t\tArrayList<Result> pruned = new ArrayList<Result>();\n\t\tfor (int i = 0; i<limit && i < pruneThis.size(); i++){\n\t\t\tpruned.add(sortednodups.get(i));\n\t\t}\n\t\treturn pruned; \n\t}",
"public int getNonResourceUrlsCount() {\n return nonResourceUrls_.size();\n }",
"private boolean isNotValidRss(final String url) throws FeedException, IOException {\n final SyndFeed feed = FeedHandler.getFeed(url);\n final List<SyndEntry> items = feed.getEntries();\n if (items.isEmpty()) {\n return true;\n }\n for (SyndEntry item : items) {\n if (item.getPublishedDate() == null) {\n return true;\n }\n }\n return false;\n }",
"boolean isXingPay(String url) {\n if (url.startsWith(\"https://gate.lfbpay.com\")) {\r\n return true;\r\n }\r\n return false;\r\n }",
"public URLSpout() {\n \tURLSpout.activeThreads = new AtomicInteger();\n \tlog.debug(\"Starting URL spout\");\n \t\n \ttry { \t\t\n\t\t\treader = new BufferedReader(new FileReader(\"URLDisk.txt\"));\n\t\t\tint num_lines = XPathCrawler.getInstance().getFileCount().get();\n\t\t\tfor (int i = 0; i < num_lines; i++) {\n\t\t\t\treader.readLine(); //set reader to latest line\n\t\t\t}\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n }",
"private boolean urlInLinkedList(URL url, LinkedList<String> set){\n boolean returnBoolean = false;\n\n for (String setItem : set){\n if (NetworkUtils.urlHostPathMatch(NetworkUtils.makeURL(setItem), url)) {\n// Log.v(\"DLAsync.urlInHashSet\", \" just found \" + url.toString() + \" in \" + set.toString());\n returnBoolean = true;\n }\n }\n return returnBoolean;\n }",
"@Test(expected = AssumptionViolatedException.class)\n public void assumeThatURLDoesNotRespond() throws MalformedURLException {\n assumeThat(new URL(\"http\", \"XXXFubarXXX\", 8888, \"/index\"), URLMatchers.respondsWithStatus(200));\n assertThat(\"test should have halted because we used Assume.assumeThat()\", false, is(true));\n }",
"private void searchNext(CrawlingSession executor, Link link) {\n HTMLLinkExtractor htmlLinkExtractor = HTMLLinkExtractor.getInstance();\n// htmlLinkExtractor.setWorking(link);\n \n Source source = CrawlingSources.getInstance().getSource(link.getSourceFullName());\n if(source == null) return;\n \n SessionStore store = SessionStores.getStore(source.getCodeName());\n if(store == null) return;\n\n List<Link> collection = htmlLinkExtractor.getLinks(link, /*link.getSource(),*/ pagePaths);\n// List<Link> collection = htmlLinkExtractor.getLinks(srResource);\n List<Link> nextLinks = createNextLink(link, collection);\n if(nextLinks.size() < 1) return;\n if(userPaths == null && contentPaths == null) {\n executor.addElement(nextLinks, link.getSourceFullName());\n return;\n }\n \n \n if(nextLinks.size() < 2) {\n executor.addElement(nextLinks, link.getSourceFullName());\n }\n \n// long start = System.currentTimeMillis();\n \n int [] posts = new int[nextLinks.size()];\n for(int i = 0; i < nextLinks.size(); i++) {\n try {\n posts[i] = PageDownloadedTracker.searchCode(nextLinks.get(i), true);\n } catch (Throwable e) {\n posts[i] = -1;\n LogService.getInstance().setThrowable(link.getSourceFullName(), e);\n// executor.abortSession();\n// return;\n }\n }\n \n int max = 1;\n for(int i = 0; i < posts.length; i++) {\n if(posts[i] > max) max = posts[i];\n }\n \n// System.out.println(\" thay max post la \"+ max);\n \n List<Link> updateLinks = new ArrayList<Link>();\n for(int i = 0; i < posts.length; i++) {\n if(posts[i] >= max) continue;\n updateLinks.add(nextLinks.get(i));\n }\n \n// long end = System.currentTimeMillis();\n// System.out.println(\"step. 4 \"+ link.getUrl()+ \" xu ly cai ni mat \" + (end - start));\n \n executor.addElement(updateLinks, link.getSourceFullName());\n \n /*int minPost = -1;\n Link minLink = null;\n List<Link> updateLinks = new ArrayList<Link>();\n for(int i = 0; i < nextLinks.size(); i++) {\n Link ele = nextLinks.get(i);\n int post = 0;\n try {\n post = PostForumTrackerService2.getInstance().read(ele.getAddressCode());\n } catch (Exception e) {\n LogService.getInstance().setThrowable(link.getSource(), e);\n }\n if(post < 1) {\n updateLinks.add(ele);\n continue;\n } \n\n if(minPost < 0 || post < minPost){\n minLink = ele;\n minPost = post; \n } \n }\n\n if(minLink != null) updateLinks.add(minLink);\n executor.addElement(updateLinks, link.getSource());*/\n }",
"String checkAndTrimUrl(String url);",
"public void testBrokenLinks(String fileName) {\n\t\tJavascriptExecutor jse = (JavascriptExecutor) (driver);\n\t\ttry {\n\t\t\tThread.sleep(5000);\n\t\t} catch (InterruptedException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tList<WebElement> allLinks = driver.findElements(By.xpath(\"//a\"));\n\n\t\tint totalLinks = 0, failedLinks = 0;\n\n\t\tfor (WebElement link : allLinks) {\n\t\t\tString src = link.getAttribute(\"href\");\n\t\t\t// System.out.println(src);\n\t\t\tif (null != src && src.trim().startsWith(\"javascript\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (null != src && (!(src.startsWith(\"http://\") || src.startsWith(\"https://\")))) {\n\t\t\t\tsrc = baseUrl + src;\n\t\t\t}\n\t\t\t// System.out.println(\"Source:\"+src);\n\t\t\tif (null != src) {\n\t\t\t\ttotalLinks++;\n\t\t\t\t// String linkName=link.getText();\n\t\t\t\tString linkName = ((String) jse.executeScript(\"var e=arguments[0];return e.innerText;\", link))\n\t\t\t\t\t\t.replaceAll(\"\\n\", \"\").trim();\n\t\t\t\tif (linkName.trim().equals(\"\")) {\n\t\t\t\t\tlinkName = ((String) jse.executeScript(\"var e=arguments[0];return e.innerHTML;\", link))\n\t\t\t\t\t\t\t.replaceAll(\"\\n\", \"\").trim();\n\t\t\t\t}\n\t\t\t\tURL url;\n\t\t\t\tHttpURLConnection conn;\n\t\t\t\tint response = 0;\n\t\t\t\ttry {\n\t\t\t\t\turl = new URL(src);\n\t\t\t\t\tconn = (HttpURLConnection) url.openConnection();\n\t\t\t\t\tresponse = conn.getResponseCode();\n\t\t\t\t\tif (response != HttpURLConnection.HTTP_OK) {\n\t\t\t\t\t\tSystem.out.println(\"Link: \" + linkName + \"is broken\");\n\t\t\t\t\t\tSystem.out.println(\"Broken URL: \" + src);\n\t\t\t\t\t\tSystem.out.println(\"Resonse is: \" + response);\n\t\t\t\t\t\tfailedLinks++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println(\"Link: \" + linkName + \"is Working\");\n\t\t\t\t\t}\n\t\t\t\t} catch (MalformedURLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tSystem.out.println(\"Link: \" + linkName + \"is broken\");\n\t\t\t\t\tfailedLinks++;\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tSystem.out.println(\"Link: \" + linkName + \"is broken\");\n\t\t\t\t\tfailedLinks++;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"Total Links Verified:\" + totalLinks + \"\\n Failed Links Count :\" + failedLinks);\n\n\t\twriteToExcel(fileName);\n\t}",
"private boolean testURLIsValid(String itemName) {\n if (itemName.endsWith(\".html\")) {\n if (itemName.contains(\"manual\") || itemName.contains(\"MediaRecorder-iframe\")) {\n // return itemName.contains(\"none-manual\");\n return false;\n } else {\n return true;\n }\n }\n\n return false;\n }",
"@Test\n public void downloadThrottled() throws Exception {\n //given\n Flowable<URL> urls = Urls.all().take(20);\n //ojo al parametro del flatmap que indica el maximo de concurrencia\n Flowable<Pair<URI, String>> pairs = urls.flatMap(url -> UrlDownloader.downloadThrottled(url)\n .subscribeOn(Schedulers.io())\n .map(htmlstr -> Pair.of(toUri(url), htmlstr)), 10);\n Single<Map<URI, String>> var = pairs.toMap((Pair<URI, String> pair) -> pair.getLeft(), (Pair<URI, String> pair) -> pair.getRight());\n Map<URI, String> bodies2 = var.blockingGet();\n Map<URI, String> bodies = pairs.toMap(Pair::getLeft, Pair::getRight).blockingGet();\n\n\n Map<URI, String> bodies3 = urls.flatMap(url -> UrlDownloader.downloadThrottled(url)\n .subscribeOn(Schedulers.io())\n .map(htmlstr -> Pair.of(toUri(url), htmlstr)), 10).toMap(Pair::getLeft, Pair::getRight).blockingGet();\n\n //when\n //Use UrlDownloader.downloadThrottled()\n\n\n //then\n assertThat(bodies).containsEntry(new URI(\"http://www.twitter.com\"), \"<html>www.twitter.com</html>\");\n assertThat(bodies).containsEntry(new URI(\"http://www.adobe.com\"), \"<html>www.adobe.com</html>\");\n assertThat(bodies).containsEntry(new URI(\"http://www.bing.com\"), \"<html>www.bing.com</html>\");\n }",
"public int getNonResourceUrlsCount() {\n return nonResourceUrls_.size();\n }",
"private void downloadImagesIfMissing()\t{\n\n\t\tarrayOfImageIDsToDownload = getArrayOfMissingImages(getImageIDs(shopName));\t\t\n\n\t\tif(networkIsAvailable() && !(arrayOfImageIDsToDownload.length == 1 && arrayOfImageIDsToDownload[0].equals(\"\")) && arrayOfImageIDsToDownload.length != 0 )\t{\n\n\t\t\tpDialog = new ProgressDialog (DisplayActivity.this);\n\t\t\tpDialog.setMessage(\"Downloading \"+arrayOfImageIDsToDownload.length+\" Image(s)...\");\n\t\t\tpDialog.show();\t\n\n\t\t\timageCounter=0;\n\t\t\t\n\t\t\tString url = \"http://www.loyal3.co.za/downloadImage?image=\"+arrayOfImageIDsToDownload[imageCounter].trim()+\"&res=\"+screenSize();\n\n\t\t\tnew DownloadAdvertImages().execute(url);\n\n\t\t} else {\n\n\t\t\tsetLogo(getLogoID(shopName), logoButton);\n\t\t\t\t\t\n\t\t\tsetAdvertFlipper();\t//Mag dalk die 2 moet omruil.\n\t\t\tsetAdvertImages();\n\t\t}\n\t}",
"private static boolean less(Comparable v, Comparable w)\n\t{\n\t\tif(v.compareTo(w)<0) {\n\t\t\treturn true; \n\t\t}\n\t\treturn false; \n\t}",
"private static void skipByExample(List<Integer> numbers) {\n\t\tList<Integer> skippedNumbers = numbers.stream().skip(5).collect(Collectors.toList());\r\n\t\tint fifthNumber = numbers.stream().skip(5 - 1).findFirst().orElse(0);\r\n\t\tList<Integer> firstFiveNumber = numbers.stream().limit(5).collect(Collectors.toList());\r\n\t\tSystem.out.println(skippedNumbers); // Output: [6, 7, 8, 9, 10]\r\n\t\tSystem.out.println(\"5th number = \" + fifthNumber);\r\n\t\tSystem.out.println(\"Limit of 5 number = \" + firstFiveNumber);\r\n\t}",
"public void verifyCandlesAndDiffuserUrl() {\n String URL = driver.getCurrentUrl();\n Assert.assertEquals(\"https://tws-uk-qa.azurewebsites.net/category/homeware-furniture-home-accessories-candles-diffusers\", URL);\n }",
"public boolean echoLimiterEnabled();",
"@SuppressWarnings(\"unused\")\n private static boolean isURLExists(String urlName) throws Exception {\n // SSLContext sslcontext = SSLContext.getInstance(\"TLSv1\");\n //\n // sslcontext.init(null,\n // null,\n // null);\n // SSLSocketFactory noSSLv3Factory = new NoSSLv3Factory(sslcontext.getSocketFactory());\n //\n // HttpsURLConnection.setDefaultSSLSocketFactory(noSSLv3Factory);\n //\n // HttpsURLConnection con = (HttpsURLConnection) new URL(urlName).openConnection();\n //\n // HttpsURLConnection.setFollowRedirects(false);\n // con.setConnectTimeout(1000);\n // con.setReadTimeout(1000);\n // con.setRequestMethod(\"HEAD\");\n //\n // return con.getResponseCode() == HttpsURLConnection.HTTP_OK;\n\n // Runtime runtime = Runtime.getRuntime();\n // Process proc = runtime.exec(\"ping \" + urlName); //<- Try ping -c 1 www.serverURL.com\n // int mPingResult = proc.waitFor();\n // if (mPingResult == 0) {\n // Log.e(\"thanh.dao\", \"isURLExists: \" + true);\n // return true;\n // } else {\n // Log.e(\"thanh.dao\", \"isURLExists: \" + false);\n // return false;\n // }\n\n Jsoup.connect(urlName).timeout(CONNECT_TIMEOUT).get();\n return true;\n }",
"private void pullLinks(String htmlPage) {\n\n Document doc = Jsoup.parse(htmlPage);\n Elements links = doc.select(\"a[href]\");\n\n for (Element link : links) {\n\n String possibleUrl = link.attr(\"abs:href\");\n\n if (!possibleUrl.equals(\"\")) {\n// Log.v(\"pullLinks\", \" will try to make URL from\" + possibleUrl);\n //if the link attr isn't empty, make a URL\n URL theUrl = NetworkUtils.makeURL(possibleUrl);\n\n if (RegexUtils.urlDomainNameMatch(firstLinkAsString, theUrl.toString())) {\n //if the string version of url is within the same domain as original query\n if (!visitedLinks.contains(theUrl.toString())) {\n// Log.v(\"DLAsyncTask.pullLinks\", \" thinks that \" + theUrl.toString() + \" wasn't visited, add into collected...\");\n collectedLinks.add(theUrl.toString());\n }\n }\n }\n\n }\n }",
"@Test\n public final void testSmallerThanMax() {\n for (ArrayList<TradeGood> planetsGoods : goods) {\n for (TradeGood good : planetsGoods) {\n assertTrue(good.getPrice() < good.type.mhl);\n }\n }\n }",
"private synchronized void validateLookupCache(int index, String urlNoFragString) {\n if (this.lookupCacheURLs != null && lookupCacheEnabled) {\n if (index >= this.lookupCacheURLs.length || !urlNoFragString.equals(URLUtil.urlNoFragString(this.lookupCacheURLs[index]))) {\n if (DEBUG || DEBUG_LOOKUP_CACHE) {\n System.out.println(\"WARNING: resource lookup cache invalidated for lookupCacheLoader at \" + index);\n }\n disableAllLookupCaches();\n }\n }\n }",
"private void processPrdDetails(String url,boolean firstTime )\n {\n ResponseEntity<?> responseEntity = processRequest(url, HttpMethod.GET, getRepoPrTypRef());\n List<GitRepoDetails> prlist = (List<GitRepoDetails>) responseEntity.getBody();\n String relLink=getRelLink(responseEntity.getHeaders(),firstTime);\n if(firstTime && !\"Not Found\".equalsIgnoreCase(relLink))\n { responseCount +=calulatedCount;}\n else\n {responseCount +=prlist.size();}\n firstTime=false;\n if(!\"Not Found\".equalsIgnoreCase(relLink)){\n processPrdDetails(relLink,firstTime);\n }\n }",
"@Test\n public void testManualTest()\n {\n\t UrlValidator urlVal = new UrlValidator(null, null, UrlValidator.ALLOW_ALL_SCHEMES);\n\t //sanity check\n\t ResultPair sane = new ResultPair(\"http://www.amazon.com\", true);\n\t collector.checkThat(sane.item, sane.valid, equalTo(urlVal.isValid(sane.item)));\n\t //test manualUrls\n\t for(ResultPair res : this.m_fileUrls)\n\t {\n\t\t collector.checkThat(res.item, res.valid, equalTo(urlVal.isValid(res.item)));\n\t }\n }"
] | [
"0.5470429",
"0.5383481",
"0.50611216",
"0.5032351",
"0.4957688",
"0.4953103",
"0.48966452",
"0.489318",
"0.4881537",
"0.48687416",
"0.48219866",
"0.47932857",
"0.47763476",
"0.47751656",
"0.47648725",
"0.4757302",
"0.46995202",
"0.4687421",
"0.46811998",
"0.46522304",
"0.46387804",
"0.46292195",
"0.46191186",
"0.46184134",
"0.46182364",
"0.46043727",
"0.46017048",
"0.45973364",
"0.45970038",
"0.45875043",
"0.45747986",
"0.45736244",
"0.45562327",
"0.45457175",
"0.45225155",
"0.45218766",
"0.4491146",
"0.4483344",
"0.44825646",
"0.44696417",
"0.44690493",
"0.4460795",
"0.44572192",
"0.4451375",
"0.4440294",
"0.44302842",
"0.44213757",
"0.44156522",
"0.4409961",
"0.4408108",
"0.4381425",
"0.43784726",
"0.43731317",
"0.43577176",
"0.43513346",
"0.43497702",
"0.4346456",
"0.43410948",
"0.43399176",
"0.43287453",
"0.43235433",
"0.43222514",
"0.4316172",
"0.4315756",
"0.4309909",
"0.4303273",
"0.43026143",
"0.43020445",
"0.43013376",
"0.4296151",
"0.42948344",
"0.42905176",
"0.4288179",
"0.42774856",
"0.42766446",
"0.42718145",
"0.42708963",
"0.42654574",
"0.42608076",
"0.42600074",
"0.42528734",
"0.42441213",
"0.42432806",
"0.42357",
"0.42356086",
"0.4226517",
"0.4225332",
"0.42243648",
"0.4224031",
"0.42196825",
"0.42140087",
"0.42135856",
"0.4213563",
"0.421256",
"0.4211347",
"0.42056954",
"0.41988644",
"0.4198565",
"0.41885853",
"0.4185347"
] | 0.5771248 | 0 |
Called only from testing | boolean voteSpoiled(ParticipantUserData participant) {
for (Entry e : participantsList) {
if (e.userData == participant) {
return e.voteSpoiled();
}
}
throw new ShouldNotHappenException("participant unknown.");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void onFirstUse() {}",
"@Override\r\n\t\t\tpublic void test() {\n\t\t\t}",
"@Override\n public void perish() {\n \n }",
"private stendhal() {\n\t}",
"private void test() {\n\n\t}",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void setup() {\n }",
"public final void mo51373a() {\n }",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n public void test() {\n \n }",
"@Override\n protected void initialize() \n {\n \n }",
"protected void setup() {\r\n }",
"@Before\n\t public void setUp() {\n\t }",
"private ProtomakEngineTestHelper() {\r\n\t}",
"@Override\n public void setup() {\n }",
"@Override\n public void setup() {\n }",
"@Override\n protected void tearDown() {\n }",
"@Override\n @Before\n public void setUp() throws IOException {\n }",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n\tprotected void postRun() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n public void setup() {\n\n }",
"@Override\n @Before\n public void before() throws Exception {\n\n super.before();\n }",
"@Override\n\tpublic void beforeClassSetup() {\n\t\t\n\t}",
"public void mock(){\n\n }",
"@Override\r\n\tprotected void doVerify() {\n\t\t\r\n\t}",
"@Override\n protected void init() {\n }",
"protected void mo6255a() {\n }",
"@Override\r\n\tpublic void sssDoLwTestInit() {\n\r\n\t}",
"protected Doodler() {\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}",
"private test5() {\r\n\t\r\n\t}",
"@Override\n public void setUp() throws Exception {}",
"@Override\r\n protected void setUp() {\r\n // nothing yet\r\n }",
"@Override\n\tpublic void afterClassSetup() {\n\t\t\n\t}",
"protected void initialize() {}",
"protected void initialize() {}",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t}",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}",
"@Override\n public void setUp() {\n }",
"@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 comer() \r\n\t{\n\t\t\r\n\t}",
"protected void setupLocal() {}",
"public void testSetBasedata() {\n }",
"protected void runBeforeIteration() {}",
"@Override\n protected void prot() {\n }",
"@Override\n protected void tearDown() throws Exception {\n\n }",
"@Override\n public void beforeStart() {\n \n }",
"@Override\n\tpublic void anular() {\n\n\t}",
"public void smell() {\n\t\t\n\t}",
"private FlyWithWings(){\n\t\t\n\t}",
"@Override\n public void initialize() { \n }",
"@Override\n public void init() {\n }",
"@Override\r\n\tpublic void onStart(ITestContext Result) {\n\t\t\r\n\t}",
"@Override\n\tpublic void afterInit() {\n\t\t\n\t}",
"@Override\n\tpublic void afterInit() {\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 }",
"@Override\n\tpublic void test() {\n\t\t\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void runTest() {\n }",
"public void setup() {\n }",
"@Override\n public void preRun() {\n super.preRun();\n }",
"@Override\n\tpublic void onStart(ITestContext result) {\n\t\t\n\t}",
"@Override\n void init() {\n }",
"@Override\n\tprotected void initialize() {\n\t}",
"@Override\n\tprotected void initialize() {\n\t}",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void mo4359a() {\n }",
"@Override\n\tprotected void interr() {\n\t}",
"@Before\n\tpublic void setUp() {\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Before\r\n\tpublic void setup() {\r\n\t}"
] | [
"0.6698778",
"0.65608686",
"0.64087415",
"0.6354835",
"0.6327425",
"0.62489504",
"0.62489504",
"0.62489504",
"0.62489504",
"0.62489504",
"0.62489504",
"0.62449944",
"0.6065476",
"0.6061684",
"0.60571694",
"0.6048137",
"0.6040899",
"0.6021546",
"0.6004741",
"0.59813845",
"0.59807783",
"0.59562254",
"0.59562254",
"0.59101963",
"0.5909335",
"0.5897831",
"0.58944815",
"0.5876849",
"0.5870795",
"0.58628124",
"0.5860752",
"0.58568317",
"0.5855618",
"0.58511454",
"0.5844536",
"0.5841899",
"0.5835769",
"0.58350736",
"0.58350736",
"0.58301246",
"0.58180934",
"0.58167535",
"0.5804347",
"0.58021003",
"0.58021003",
"0.5789504",
"0.578175",
"0.5773769",
"0.5773769",
"0.5773769",
"0.5757119",
"0.5752495",
"0.575043",
"0.575043",
"0.57476723",
"0.5745562",
"0.57441485",
"0.5740173",
"0.5733812",
"0.5730558",
"0.5728715",
"0.5725097",
"0.5718552",
"0.5716232",
"0.5715941",
"0.5710681",
"0.5709626",
"0.57086116",
"0.57086116",
"0.5708256",
"0.5708256",
"0.5708256",
"0.5708256",
"0.5708256",
"0.5708256",
"0.5708256",
"0.57077414",
"0.57061374",
"0.57041484",
"0.57035863",
"0.57018304",
"0.5700154",
"0.5699695",
"0.56983334",
"0.56983334",
"0.56944543",
"0.56944543",
"0.56944543",
"0.56944543",
"0.56944543",
"0.56944543",
"0.56944543",
"0.56944543",
"0.56944543",
"0.56944543",
"0.5694445",
"0.5684483",
"0.56824356",
"0.56775594",
"0.56765306",
"0.5670794"
] | 0.0 | -1 |
Move the entry to the next vote block. | private void nextVoteBlock(Entry e) {
// There's no way to tell the PriorityQueue that the entry has
// changed, and needs to be resorted, other than remove/add.
participantsQueue.remove(e);
e.nextVoteBlock();
participantsQueue.add(e);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void nextVoteBlock() {\n try {\n\tif (iter.hasNext()) {\n\t voteBlock = iter.next();\n\t} else {\n\t voteBlock = null;\n\t}\n } catch (IOException e) {\n\t// Even if the error is transient, we are trying to keep in\n\t// synch. If we later tried to catch up, we could have a\n\t// bunch of URLs we'd already counted for other voters. So\n\t// call this Entry finished.\n\tinstallErrorIterator(e);\n }\n }",
"void moveNext()\n\t{\n\t\tif (cursor != null) \n\t\t{\n\t\t\tif (cursor == back) \n\t\t\t{\n\t\t\t\tcursor = null;\n index = -1; //added cause i was failing the test scripts and forgot to manage the indices \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcursor = cursor.next; //moves cursor toward back of the list\n index++; //added cause i was failing to the test scripts and forgot to manage the indicies\n\t\t\t}\n\t\t}\n\t}",
"public void moveForwardOneBlock() {\n\t\tBlockInterface nextBlock = this.currentBlock.goesto(previousBlock);\n\t\tthis.previousBlock = this.currentBlock;\n\t\tthis.currentBlock = nextBlock;\n\t\tif(nextBlock instanceof BlockStation){\n\t\t\tString nbname = ((BlockStation)nextBlock).getStationName();\n\t\t\tif(schedule.containsKey(nbname)){\n\t\t\t\tschedule.remove(nbname);\n\t\t\t\t((SchedulePane)c.schedulepane).reloadSchedual();\n\t\t\t}\n\t\t}\n\t}",
"public void nextTurn(){\n\t\tthis.setCurrentElement(this.getCurrentElement().getNext());\n\t}",
"@ActionTrigger(action=\"KEY-NXTBLK\", function=KeyFunction.NEXT_BLOCK)\n\t\tpublic void spriden_NextBlock()\n\t\t{\n\t\t\t\n\t\t\t\tgoBlock(toStr(\"SOUNDEX\"));\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t}",
"public void moveNext() {\n\t\tcurrentElement++;\n\t}",
"private void moveNext(PositionTracker tracker) {\n\t\t \n\t\t //initiate if-else statement\n\t\t if(tracker.getExactColumn() == (tracker.getMaxColumns() - 1)) {\n\t\t\t \n\t\t\t //invoke the setExactRow method\n\t\t\t tracker.setExactRow(tracker.getExactRow() + 1);\n\t\t\t \n\t\t\t //invoke the setExactColumn method\n\t\t\t tracker.setExactColumn(0);\n\t\t\t \n\t\t }else {\n\t\t\t \n\t\t\t //invoke the setExactColumn method\n\t\t\t tracker.setExactColumn(tracker.getExactColumn() + 1);\n\t\t }//end if-else\n\t }",
"@Override\n protected void moveToNextRow(){\n incrementRow();\n resetXPos();\n if(getRow()%2 == 1){\n incrementYPos(getHeight()+getHeight());\n }\n resetCol();\n setPointDirection();\n }",
"public void next(){\n\t\tboundIndex = (boundIndex+1)%buttonBounds.length;\n\t\tupdateButtonBounds();\n\t}",
"public void goToNext() {\r\n\t\tif (curr == null)\r\n\t\t\treturn;\r\n\t\tprev = curr;\r\n\t\tcurr = curr.link;\r\n\t}",
"public void next()\n\t{\n\t\tif(this.curseur < this.listeTapis.size() - 1)\n\t\t{\n\t\t\tthis.curseur++;\n\t\t}\n\t}",
"private void moveToNextSplit() {\n closeCurrentSplit();\n\n if (_splits.hasNext()) {\n StashSplit split = _splits.next();\n String key = String.format(\"%s/%s\", _rootPath, split.getKey());\n _currentIterator = new StashSplitIterator(_s3, _bucket, key);\n } else {\n _currentIterator = null;\n }\n }",
"public void MoveNext()\r\n \t{\r\n\r\n\t try{\r\n\t\t if(!rsTution.next())rsTution.last();\r\n\t\t Display();\r\n\r\n\r\n\t }catch(SQLException sqle)\r\n\t {System.out.println(\"Move Next Error:\"+sqle);}\r\n \t}",
"public void nextFrame() {\r\n frame++;\r\n if( frame > lastEditFrame + frameDelay ) {\r\n // The last transaction is 'done'\r\n transaction = null;\r\n }\r\n }",
"private void setNextSuccessor() {\n if (lastBlock != null) // if it is the first block, do nothing\n lastBlock.addSuccessor(currentBlock);\n blocks.add(currentBlock); // Add currentBlock to the global list of blocks\n lastBlock = currentBlock;\n }",
"@Override\n public boolean moveBlock(Box pos) {\n if (indexPossibleBlock == 1) {\n if (pos.getCounter() == 3)\n completeTowers++;\n pos.build(4);\n } else {\n super.moveBlock(pos);\n if (pos.getCounter() == 4)\n completeTowers++;\n }\n return true;\n }",
"public void nextTurn(){\n players.add(currentPlayer);//Added to the back\n currentPlayer = players.pop();//Pull out the first player in line to go next\n }",
"public void advance() {\n\t\tif(isFinalFrame(current)) {\n\t\t\tthrow new IllegalStateException(\"Invalid Entry\"); // input sanitization if last frame (cant advance further )\n\t\t\t\n\t\t}\n\t\tif (!current.movesFinished()) { // input sanitization -- cant advance if the user hasnt exercised all the frames moves\n\t\t\tthrow new IllegalStateException(\"Invalid Entry\");\n\t\t}\n\t\telse current = frames.get(frames.indexOf(current) + 1); // else updates the current frame to frame at next index. \n\t}",
"public void setNext()\n {\n\t int currentIndex = AL.indexOf(currentObject);\n\t currentObject = AL.get(currentIndex +1);\n\t \n\t// never let currentNode be null, wrap to head\n\tif (currentObject == null)\n\t\tcurrentObject = firstObject;\n }",
"public void next() {\n addTracksToQueue();\n player.skipToNext();\n }",
"public void nextTurn(){\n\t\tplayers[currentPlayer].setNotCurrentPlayer();\n\t\t\n\t\t//increment current player to advance to next player\n\t\tcurrentPlayer = (currentPlayer + 1) % players.length;\n\t\t\n\t\t//update the new current player\n\t\tupdateCurrentPlayerView();\n\t}",
"public void makeNextMove() {\n\t\ttakeNextNonTabuedCheapestStep();\n\t\t}",
"private void postVote() {\n if ( unvotedParties() == 0 )\n TransactionManager.getTransactionManager().resolveTransaction(txId);\n }",
"@Override\n public void updateToNextDoc() {\n if(idx < postingList.size())\n idx += postingList.get(idx+1)+2;\n }",
"protected void next() {\n\t\t// Next node\n\t\tnode = path.remove(0);\n\t\ttransition(NavigatorState.ROTATE_TO);\n\t}",
"public void voteRollback() {\n synchronized ( this ) {\n rbVotes++; \n votedCommit = false;\n }\n preVote();\n postVote();\n }",
"public void postponeNext()\n {\n\tif (toDo.size() > 0)\n\t {\n\t\tTask t = toDo.get(0);\n\t\ttoDo.remove(0);\n\t\ttoDo.add(t);\n\t }\n }",
"public void nextLevelTogo() {\n if (this.myClearedLines % 2 == 0) {\n myLinesToGo = 2;\n } else {\n myLinesToGo = 1;\n }\n }",
"public void advanceToEndOfNextTrick() {\n\n if (isGameOver()) {\n return;\n }\n \n if (isFirstTurn) {\n startTurn();\n isFirstTurn=false;\n }\n else {\n state=state.withTrickCollected();\n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().updateScore(state.score());\n }\n }\n\n if (isGameOver()) {\n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().setWinningTeam(findWinningTeam());\n }\n return;\n }\n\n if (!isFirstTurn && state.isTerminal()) {\n startTurn();\n }\n\n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().updateScore(state.score());\n pId.getValue().updateTrick(state.trick());\n }\n\n while (!(state.trick().isFull())) {\n playNextPlayer();\n }\n }",
"@Override\n public void next(Lift lift) {\n if (lift.getCurrentFloor() <= 0) {\n lift.setCurrentFloor(lift.getCurrentFloor() + 1);\n lift.setDirection(Direction.UP);\n lift.setState(new OutLiftState(maxFloor, waitingPassenger));\n } else {\n lift.setCurrentFloor(lift.getCurrentFloor() - 1);\n lift.setDirection(Direction.DOWN);\n lift.setState(new OutLiftState(maxFloor, waitingPassenger));\n }\n\n }",
"public void nextTurn() {\r\n ArrayList<Bomb> copy_bombs = new ArrayList<>(this.bombs);\r\n for (Bomb b : copy_bombs) {\r\n if(b.getDelay() == 1){\r\n this.explode = true;\r\n }\r\n b.tick();\r\n b.explode(this);\r\n }\r\n this.ordering = new LinkedList<>();\r\n this.fillPlayerQueue();\r\n if (this.random_order) {\r\n Collections.shuffle((List)this.ordering);\r\n }\r\n\r\n this.turn_number++;\r\n }",
"public void next() {\n\t\telements[(currentElement - 1)].turnOff();\n\t\tif (elements.length > currentElement) {\n\t\t\telements[currentElement].turnOn();\n\t\t\tcurrentElement++;\n\t\t} else {\n\t\t\texit();\n\t\t}\n\t}",
"public void nextTurn() {\n\t\tLog.d(TAG, \"nextTurn()\");\t\t\n\t\ttickPeople();\n\t\t//doEvents();\n\t\tupdateBar();\n\t}",
"public void move() {\n\t\t\tar.setAhead(10 * fahrtrichtung);\n\n\t\t\t// Wie schnell sich der Roboter drehen soll\n\t\t\tar.setTurnRight(45 * drehrichtung);\n\t\t\tar.execute();\n\t\t\tfarbschema = farbschema * (-1);\n\t\t}",
"public void moveUp()\n\t{\n\t\trow++;\n\t}",
"private void nextTurn(){\n\t\tint[] currentTurnInfo = mTurnIndicator.nextTurn(); \n\t\tif(currentTurnInfo[TurnView.TURN_POSITION] > -1){\n\t\t\t// highlight the current player\n\t\t\tCombatAdapter adapter = (CombatAdapter) getList().getAdapter();\n\t\t\tadapter.setCurrentTurn(currentTurnInfo[TurnView.TURN_POSITION]);\n\t\t\t// change the turn in the game table\n\t\t\tGameTable.setTurn(GameSQLDataSource.getDatabase(getActivity()), mEncounterRowID, currentTurnInfo[TurnView.TURN_POSITION]);\n\t\t\t// set the label\n\t\t\tmTurn.setText(currentTurnInfo[TurnView.TURN_INIT] + \"\");\n\t\t\t// increment the round if necessary\n\t\t\tif(currentTurnInfo[TurnView.TURN_POSITION] == 0){\n\t\t\t\tint round = GameTable.addRound(GameSQLDataSource.getDatabase(getActivity()), mEncounterRowID);\n\t\t\t\tmRound.setText(round + \"\");\n\t\t\t}\n\t\t}\n\t}",
"public void setNextNode(ElectionNode nextNode) {\r\n this.nextNode = nextNode;\r\n }",
"public void setNext(Tile next){\n\t\tthis.next=next;\n\t}",
"@Override\n public void stepUp(Cell currentCell) {\n if(currentCell.getOldNoOfAliveNeighbours()==3)\n {\n currentCell.setState(new Alive());\n }\n }",
"private static void arrangeVoteStructure() {\n\n System.out.println(\"Please enter the vote preference as a sequence: > \");\n Scanner in = new Scanner(System.in);\n\n // while (true) {\n\n // System.out.println(\"Please enter the vote preference as a sequence: > \");\n\n String voteKey = in.nextLine();\n\n /**\n if(voteKey.contentEquals(\"tally\")){\n System.out.println(\"You have completed voting..\");\n break;\n }\n */\n\n // split the voteKey by letter. eg:- A\n\n String votes[] = voteKey.split(\" \");\n\n\n for (int x = 0; x < numberOfCandidates; x++) {\n for (int y = x; y < votes.length; y++) {\n\n //Add vote to each candidate's HashMap.\n\n candidateVotes.get(votes[y].charAt(0)).add(counter);\n counter++;\n break;\n }\n }\n // }\n }",
"private synchronized void loadSecondaryBlock(boolean next) {\n int step = (next) ? 1 : -2;\n if ((currentBlock + step) < 0) return;//return early if we are already at the beginning\n Controller.INSTANCE.run(() -> {\n String content = fullContent.get(currentBlock) + fullContent.get(currentBlock + step);\n mine.setContent(content);\n return Unit.INSTANCE;\n });\n }",
"private void moveToNextStoryNode(StoryPaths storyPath) {\n System.out.println(\"moving to next storynode\"); //debug\n //Depletes resources\n Resource resourceNeeded=storyPath.getResourceNeeded();\n if (resourceNeeded!=null) {\n int amountNeeded=storyPath.getAmountNeeded();\n if (resourceNeeded.getDepletable()) {\n resourceNeeded.decreaseStock(amountNeeded);\n resourceManager.updateDatabase(resourceNeeded);\n }\n }\n int nextPage=storyPath.getNextPage();\n // for chane event: decide success or failure\n if (storyPath.isChanceEvent()) {\n double chance=storyPath.getChance();\n boolean failure=Math.random()<chance;\n if (failure) {\n nextPage=storyPath.getNextPage2();\n Toast.makeText(getApplicationContext(),\"Failure\",Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(getApplicationContext(),\"Succeed\",Toast.LENGTH_SHORT).show();\n }\n }\n // Move to next story node\n user.setCurrentStoryNode(nextPage);\n user.updateDatabase();\n refresh();\n //Obtain new items\n //TODO: let user click something to obtain the item instead of obtaining automatically\n Resource resourceObtained=currentStory.getResourceGained();\n if (resourceObtained!=null) {\n int amountGained = currentStory.getAmountGained();\n resourceObtained.increaseStock(amountGained);\n resourceManager.updateDatabase(resourceObtained);\n }\n updateResourceText();\n }",
"public void move() {\n if (this.nextMove.equals(\"a\")) { // move down\n this.row = row + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"b\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"b\")) { // move right\n this.col = col + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"c\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"c\")) { // move up\n this.row = row - 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"a\";\n progress = 0;\n }\n }\n }",
"public abstract void blockNext();",
"public abstract void setNextBlockInstant();",
"private void nextStep(){\n if(vMaze == null)\n mainMessage.setText(\"You must load a maze first!\");\n else try{\n vMaze.step();\n tileBox.getChildren().clear();\n tileBox.getChildren().add(vMaze.getTiles());\n\n mainMessage.setText(\"You took one step.\");\n if(vMaze.getRouteFinder().isFinished())\n mainMessage.setText(\"You reached the end!\");\n } catch (NoRouteFoundException e){\n mainMessage.setText(e.getMessage());\n }\n }",
"public void rotateNextPlayer(){\n\t\t\n\t\tif(this.toRight)\n\t\t\tthis.nextElem = (this.nextElem + 1) % players.size();\n\t\telse\t\t\t\n\t\t\tthis.nextElem = (this.nextElem - 1 + players.size()) % players.size();\n\t}",
"public void up()\n {\n if (this.index >= 0 && this.index < this.morphs.size())\n {\n MorphType type = this.morphs.get(this.index);\n\n if (type.morphs.size() > 1)\n {\n type.up();\n this.resetTime();\n }\n }\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}",
"@Override\n\tpublic void makeNextMove() \n\t{\n\t}",
"public void addVote() {\n this.votes++;\n }",
"protected void nextDirection()\n {\n if (this.lastKeyDirection == Canvas.LEFT)\n {\n this.lastKeyDirection = keyDirection = Canvas.RIGHT;\n xTotalDistance = 0;\n //yTotalDistance = 0;\n }\n else if (this.lastKeyDirection == Canvas.RIGHT)\n {\n this.lastKeyDirection = keyDirection = Canvas.LEFT;\n xTotalDistance = 0;\n //yTotalDistance = 0;\n }\n }",
"public void movePointerForward() throws EndTaskException {\n\t\tpickBeeper();\n\t\tmove();\n\t\tputBeeper();\n\t}",
"public synchronized void moveSnake() {\n\t\tif(!this.isDead()) { // as long as the snake is alive\n\t\t\tSegment temp = tail; // set a temp segment to have a handle on the head\n\t\t\t\n\t\t\twhile(temp!=null) { // while temp is not null\n\t\t\t\ttemp.move(); // move temp\n\t\t\t\ttemp = temp.getSeg(); // make temp the segment temp has a handle on (i.e. the segment in front of it)\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"public void nextPlayer() {\r\n if (currentPlayer == totalPlayer) {\r\n currentPlayer = 1;\r\n } else {\r\n currentPlayer++;\r\n }\r\n }",
"public void movePoint(int slots) {\n if (0 >= this.pointInventory + slots) {\n this.pointInventory = 0;\n }\n else this.pointInventory = Math.min(this.lenInventory - 1, this.pointInventory + slots);\n }",
"public void PrepareNextJogada() {\n if (vez == listaJogadores.size() - 1) {\n vez = 0;\n\n } else {\n vez++;\n }\n }",
"@Override\n public void run() {\n if (getCurrentItem() + 1 == adapter.getCount()) {\n adapter.markAsFinished();\n }\n\n // Transition to next question\n setCurrentItem(getCurrentItem() + 1);\n\n pendingTransition = false;\n }",
"private void next() {\n if (position < tracks.size()) {\n Player.getInstance().stop();\n\n // Set a new position:\n ++position;\n\n ibSkipPreviousTrack.setImageDrawable(getResources()\n .getDrawable(R.drawable.ic_skip_previous_track_on));\n\n try {\n Player.getInstance().play(tracks.get(position));\n } catch (IOException playerException) {\n playerException.printStackTrace();\n }\n\n setImageDrawable(ibPlayOrPauseTrack, R.drawable.ic_pause_track);\n setCover(Player.getInstance().getCover(tracks.get(position), this));\n\n tvTrack.setText(tracks.get(position).getName());\n tvTrackEndTime.setText(playerUtils.toMinutes(Player.getInstance().getTrackEndTime()));\n }\n\n if (position == tracks.size() - 1) {\n ibSkipNextTrack.setImageDrawable(getResources()\n .getDrawable(R.drawable.ic_skip_next_track_off));\n }\n }",
"@Override\n\tpublic void move(){\n\t\tSector tail = null;\n\t\tif(hit){\n\t\t\ttail = getNext();\n\t\t\tif(tail == null){\t\n\t\t\t\tselfDestruct();\n\t\t\t} else {\t\t\n\t\t\t\tsector.setInhabitant(null);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tsectors.add(sector);\n\t\tSector nextSector = quadrant.getNext(sector, velocity[0]);\t\n\t\tif(nextSector == null){\n\t\t\thit = true;\n\t\t} else {\n\t\t\tSpaceObject object = nextSector.getInhabitant();\n\t\t\tif(object != null) {\n\t\t\t\tobject.bump(this);\n\t\t\t} else {\n\t\t\t\tsetSector(nextSector); \n\t\t\t}\n\t\t} \n\t}",
"public void moveToNextStep() {\n Step.Phase nextPhase = currentStep.GetNextPhase();\n changeCurrentStep(nextPhase);\n if (currentStep.getCurrentPhase().equals(Step.Phase.COMPLETED) ||\n currentStep.getCurrentPhase().equals(Step.Phase.FAILED)) {\n setCompleteTime(System.currentTimeMillis());\n }\n }",
"public void runTillNextPhase () throws NormalizeNullVectorException\n {\n \tint currentPhase = getPhase ();\n \tLearningEditProposal bestEditProposal = getBestEdit (true, true);\n while ((bestEditProposal != null) && (currentPhase == getPhase ()))\n {\n step ( bestEditProposal.getEdit ());\n bestEditProposal = getBestEdit (true, true);\n }\n }",
"void seek(String url) {\n if (url == null) {\n throw new ShouldNotHappenException(\"url is null.\");\n }\n if (StringUtil.compareToNullHigh(peekUrl(), url) > 0) {\n throw new ShouldNotHappenException(\"Current URL is \"+\n\t\t\t\t\t peekUrl()+\", past \"+url);\n }\n for (Entry e : participantsList) {\n participantsQueue.remove(e);\n // todo(bhayes): Change VoteBlockIterator to support a \"seek\"\n // operation.\n\n // VoteBlocks.getVoteBlock(url) has [unused] code trying to do\n // something similar. It creates a VoteBlocksIterator, and\n // iterates over the whole VoteBlocks, [ignoring that it should\n // already be in URL order] looking for a VoteBlock with the\n // given URL, and returns that block. What we could use is a\n // method VoteBlocksIterator.seek(url) that fast-forwards to\n // the right place. But we don't want to just get the VoteBlock,\n // we want to advance the iterator.\n // \n while (StringUtil.compareToNullHigh(e.getUrl(), url) < 0) {\n\te.nextVoteBlock();\n }\n participantsQueue.add(e);\n }\n // NOTE: Since the voters' iterators may not read from disk the\n // same as in the initial poll, some or all of the voters which\n // had the URL in the initial poll may deny having it now.\n // peekUrl() may not equal url.\n if (StringUtil.compareToNullHigh(peekUrl(), url) < 0) {\n throw new ShouldNotHappenException(\"Current URL is \"+\n\t\t\t\t\t peekUrl()+\", before \"+url);\n }\n }",
"public void nextPlayer() {\n\t\tif (currentPlayer.equals(vServerThread.get(0))){\n\t\t\tcurrentPlayer=vServerThread.get(1);\n\t\t} else if (currentPlayer.equals(vServerThread.get(1))){\n\t\t\tcurrentPlayer=vServerThread.get(0);\n\t\t}\n\t}",
"public void next() {\n if (highlight.getMatchCount() > 0) {\n Point point = highlight.getNextMatch(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n return;\n }\n Point point = file.getNextModifiedPoint(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n }",
"private void nextPiece() {\n if (_c == M && _r <= M) {\n _c = 1;\n _r++;\n } else if (_r > M) {\n _move = null;\n } else {\n _c++;\n }\n }",
"public void gotoNext(){\r\n if(curr == null){\r\n return;\r\n }\r\n prev = curr;\r\n curr = curr.link;\r\n }",
"public void goToPointer() throws EndTaskException {\n\t\twhile (notNextToABeeper()) {\n\t\t\tmove();\n\t\t}\n\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tfor (int i = 0; i < 2 /* rounds */; i++) {\n\t\t\t\t\tfor (Delegate delegate : votes.keySet()) {\n\t\t\t\t\t\tif (votes.get(delegate) != null) {\n\t\t\t\t\t\t\t// Already voted.\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentlyVoting = delegate;\n\t\t\t\t\t\tlblCurrentVoter.setText(delegate.getName());\n\t\t\t\t\t\tlblCurrentVoter.setIcon(delegate.getSmallIcon());\n\n\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\t\tfinal List<Map<Vote, JButton>> maplist = Arrays.asList(\n\t\t\t\t\t\t\t\tbuttons_roundOne, buttons_roundTwo);\n\t\t\t\t\t\tfor (Map<Vote, JButton> map : maplist) {\n\t\t\t\t\t\t\tfor (Vote vote : map.keySet()) {\n\t\t\t\t\t\t\t\tmap.get(vote)\n\t\t\t\t\t\t\t\t\t\t.setText(\n\t\t\t\t\t\t\t\t\t\t\t\tdelegate.getStatus().hasVetoPower ? vote.vetoText\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: vote.normalText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tsynchronized (votingThread) {\n\t\t\t\t\t\t\t\tvotingThread.wait();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinal Vote cast = votes.get(delegate);\n\t\t\t\t\t\tif (cast == Vote.PASS) {\n\t\t\t\t\t\t\tvotes.put(delegate, null);\n\t\t\t\t\t\t\t// So he goes again.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\t\t\tbutton.setEnabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlayout.show(pnlVoting, pnlSecondRound.getName());\n\t\t\t\t}\n\t\t\t\t// When done, disable again.\n\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\tbutton.setEnabled(false);\n\t\t\t\t}\n\t\t\t\tcurrentlyVoting = null;\n\t\t\t\tlblCurrentVoter.setText(null);\n\t\t\t\tlblCurrentVoter.setIcon(null);\n\t\t\t\tpnlVoting.setVisible(false);\n\t\t\t}",
"protected void execute() {\r\n if (dumper.isLimitSwitchPressed()) {\r\n dumper.stop();\r\n state = STATE_SUCCESS;\r\n }\r\n if (increment >= maxSeek) {\r\n dumper.stop();\r\n state = STATE_FAILURE;\r\n }\r\n switch (state) {\r\n case STATE_SEEK_LEFT:\r\n if (dumper.getPosition() >= desiredPosition) {\r\n desiredPosition = startPosition - increment;\r\n dumper.foward();\r\n state = STATE_SEEK_RIGHT;\r\n }\r\n break;\r\n case STATE_SEEK_RIGHT:\r\n if (dumper.getPosition() <= desiredPosition) {\r\n increment += 0.05;\r\n desiredPosition = startPosition + increment;\r\n dumper.backward();\r\n state = STATE_SEEK_LEFT;\r\n }\r\n break;\r\n }\r\n }",
"public void nextPlayerInTurn() {\n currentPlayerTurn= playersTurns.poll();\n if (currentPlayerTurn != null) {\n eventListener.addEventObject(new PlayerEvent(currentPlayerTurn.getPlayerName(),EventNamesConstants.PlayerTurnArrived));\n currentPlayerName = currentPlayerTurn.getPlayerName();\n }\n else {\n currentPlayerName = \"None\";\n }\n }",
"public void doNextMove(Player player) {\r\n int newX = xCoord;\r\n int newY = yCoord;\r\n switch (currentDirection) {\r\n case 1:\r\n newX = xCoord + 1;\r\n break;\r\n case 2:\r\n newY = yCoord + 1;\r\n break;\r\n case -1:\r\n newX = xCoord - 1;\r\n break;\r\n case -2:\r\n newY = yCoord - 1;\r\n break;\r\n }\r\n if (checkValidMove(newX, newY)) {\r\n // System.out.println(xCoord + \" \" + yCoord);\r\n // System.out.println(newX + \" \" + newY);\r\n moveTo(newX, newY);\r\n // System.out.println(xCoord + \" \" + yCoord);\r\n\r\n } else {\r\n turnAround();\r\n doNextMove(player);\r\n }\r\n }",
"public void advance( )\r\n {\r\n\t if(isCurrent() != true){// Implemented by student.\r\n\t throw new IllegalStateException(\"no current element\");\r\n\t }\r\n\t else\r\n\t \t precursor = cursor;\r\n\t \t cursor = cursor.getLink(); // Implemented by student.\r\n }",
"public void goToEntry() {\n this.step(GameMap.instance().getEntryTile());\n }",
"private void doNextRow(){\n\t\tmove();\n\t\twhile (frontIsClear()){\n\t\t\talternateBeeper();\n\t\t}\n\t\tcheckPreviousSquare();\t\n\t}",
"public void move(int index)\n\t{\n\t\tnextSpot = index + moveDirection(index);\n\t}",
"protected void siftUp() {\r\n\t\tint child = theHeap.size() - 1, parent;\r\n\r\n\t\twhile (child > 0) {\r\n\t\t\tparent = (child - 1) >> 1;\t// >> 1 is slightly faster than / 2\r\n\t\t\t\t\t\t\t\t\t\t// => parent = (child - 1) / 2\r\n\t\t\tif (compare(theHeap.get(child), theHeap.get(parent)) >= 0)\r\n\t\t\t\tbreak;\r\n\t\t\tswap(parent, child);\r\n\t\t\tchild = parent;\r\n\t\t}\r\n\t}",
"public synchronized void beginVoting() {\n\t\tvotingThread = new Thread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// votes should be filled with [each delegate] -> `null`\n\t\t\t\tfor (int i = 0; i < 2 /* rounds */; i++) {\n\t\t\t\t\tfor (Delegate delegate : votes.keySet()) {\n\t\t\t\t\t\tif (votes.get(delegate) != null) {\n\t\t\t\t\t\t\t// Already voted.\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentlyVoting = delegate;\n\t\t\t\t\t\tlblCurrentVoter.setText(delegate.getName());\n\t\t\t\t\t\tlblCurrentVoter.setIcon(delegate.getSmallIcon());\n\n\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\t\tfinal List<Map<Vote, JButton>> maplist = Arrays.asList(\n\t\t\t\t\t\t\t\tbuttons_roundOne, buttons_roundTwo);\n\t\t\t\t\t\tfor (Map<Vote, JButton> map : maplist) {\n\t\t\t\t\t\t\tfor (Vote vote : map.keySet()) {\n\t\t\t\t\t\t\t\tmap.get(vote)\n\t\t\t\t\t\t\t\t\t\t.setText(\n\t\t\t\t\t\t\t\t\t\t\t\tdelegate.getStatus().hasVetoPower ? vote.vetoText\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: vote.normalText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tsynchronized (votingThread) {\n\t\t\t\t\t\t\t\tvotingThread.wait();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinal Vote cast = votes.get(delegate);\n\t\t\t\t\t\tif (cast == Vote.PASS) {\n\t\t\t\t\t\t\tvotes.put(delegate, null);\n\t\t\t\t\t\t\t// So he goes again.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\t\t\tbutton.setEnabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlayout.show(pnlVoting, pnlSecondRound.getName());\n\t\t\t\t}\n\t\t\t\t// When done, disable again.\n\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\tbutton.setEnabled(false);\n\t\t\t\t}\n\t\t\t\tcurrentlyVoting = null;\n\t\t\t\tlblCurrentVoter.setText(null);\n\t\t\t\tlblCurrentVoter.setIcon(null);\n\t\t\t\tpnlVoting.setVisible(false);\n\t\t\t}\n\t\t});\n\t\tvotingThread.start();\n\t}",
"public void nextMove(Field field) {\n for (int i = 1; i <= 9; i++) {\n if (field.setMarker(i, marker)) {\n break;\n }\n }\n }",
"public void handleNextRound() {\n\t\t\r\n\t}",
"private void advance() {\n assert currentItemState == ItemProcessingState.COMPLETED || currentIndex == -1\n : \"moving to next but current item wasn't completed (state: \" + currentItemState + \")\";\n currentItemState = ItemProcessingState.INITIAL;\n currentIndex = findNextNonAborted(currentIndex + 1);\n retryCounter = 0;\n requestToExecute = null;\n executionResult = null;\n assert assertInvariants(ItemProcessingState.INITIAL);\n }",
"public void nextTurn() {\n do {\n colonySimulator.nextTurn(curTurn);\n curTurn++;\n try {\n Thread.sleep(200);\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n } while (!stepping && queenAlive);\n }",
"public void voteCommit() {\n boolean b = preVote();\n synchronized ( this ) {\n if ( b == true ) \n commitVotes++; \n else {\n rbVotes++;\n votedCommit = false;\n }\n }\n postVote();\n }",
"public void moveToCurrentRow() throws SQLException {\n\n try {\n debugCodeCall(\"moveToCurrentRow\");\n checkClosed();\n insertRow = null;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }",
"protected void moveRow (int row)\r\n {\r\n int move = 0;\r\n \r\n if (row < _currentRow)\r\n { move = _currentRow - row; }\r\n \r\n else if (row > _currentRow)\r\n { move = row - _currentRow; }\r\n \r\n _currentRow = row;\r\n }",
"public void next() {\n Solver<ArrayList<Integer>> mySolver =\n new Solver<ArrayList<Integer>>();\n ArrayList<ArrayList<Integer>> Solution =\n mySolver.SolveBFS(this);\n\n //Reset 'tried' to none\n tried = new HashSet<ArrayList<Integer>>();\n\n //Set up the nextState\n ArrayList<Integer> nextState = new ArrayList<Integer>();\n\n if(Solution.size() == 0) {\n //No Solution\n } else if (Solution.size() == 1) {\n nextState = Solution.get(0);\n curBoard = nextState;\n } else {\n nextState = Solution.get(1);\n curBoard = nextState;\n moveCount++;\n }\n clearStack();\n\n\tsetChanged();\n\tnotifyObservers();\n }",
"@Override\n public void advance() {\n if (isCurrent()) {\n prev = cursor;\n cursor = cursor.getNext();\n } else {\n throw new IllegalStateException(\"There is no current element.\");\n }\n }",
"public abstract void putNext(Waiter waiter, Waiter waiter2);",
"protected void loadNextPage(){\n\n if(!isShowingSearchedVotes) {\n setLoadingMoreItems(true);\n RikdagskollenApp.getInstance().getRiksdagenAPIManager().getVotes(new VoteCallback() {\n\n @Override\n public void onVotesFetched(List<Vote> votes) {\n setShowLoadingView(false);\n voteList.addAll(votes);\n getAdapter().notifyDataSetChanged();\n setLoadingMoreItems(false);\n }\n\n @Override\n public void onFail(VolleyError error) {\n setLoadingMoreItems(false);\n decrementPage();\n }\n }, getPageToLoad());\n\n incrementPage();\n }\n }",
"private void moveCursorToRow(int row) {\n\t\ttry {\n\t\t\tint count = 0;\n\t\t\twhile (row != count && rs.next()) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\tcatch (SQLException se) {\n\t\t\tthrow getExceptionTranslator().translate(\"Attempted to move ResultSet to last committed row\", getSql(), se);\n\t\t}\n\t}",
"public void next()\n {\n if (mHistoryIdx == mCommandList.size()) {\n return;\n }\n\n mCommandList.get(mHistoryIdx++).redo();\n this.setChanged();\n this.notifyObservers(mHistoryIdx);\n }",
"private void trickleDown(int index) {\n Map.Entry<String, Double> smallest;\n Map.Entry<String, Double> top = this.get(index);\n int currentSize = this.size();\n\n while (index < currentSize / 2) { // while node has at leat one child\n Map.Entry<String, Double> left = LEFT(this.get(index));\n Map.Entry<String, Double> right = RIGHT(this.get(index));\n\n // find smaller child\n // if right child exists\n if (right != null && left.getValue().compareTo(right.getValue()) > 0) {\n smallest = right;\n } else {\n smallest = left;\n }\n\n // top <= smallest ?\n if (top.getValue().compareTo(smallest.getValue()) <= 0) {\n break;\n }\n\n // shift child up\n int smallestIndex = this.indexOf(smallest);\n Collections.swap(this, index, smallestIndex);\n index = smallestIndex;\n } // end while\n }",
"private Action doNextMove(Action move){\n\t\t// update east or north\n\t\tif (move == Action.East){\n\t\t\teast++;\n\t\t} else if (move == Action.West){\n\t\t\teast--;\n\t\t} else if (move == Action.North){\n\t\t\tnorth++;\n\t\t} else if (move == Action.South){\n\t\t\tnorth--;\n\t\t}\n\t\treturn move;\n\t}",
"public void setNextCell(Cell next)\r\n {\r\n this.next = next;\r\n }",
"public void next()\r\n\t{\r\n\t\tif(state<3)\r\n\t\t\tstate++;\r\n\t\telse\r\n\t\t\tstate=1;\r\n\t}",
"public void moveVertex() {\r\n\t\tPriorityQueue<Vertex2D> pq = new PriorityQueue<Vertex2D>(3,(a,b) -> a.id - b.id);\r\n\t\tpq.add(this); pq.add(this.previous); pq.add(this.next);\r\n\t\t\r\n\t\tsynchronized(pq.poll()) {\r\n\t\t\tsynchronized(pq.poll()) {\r\n\t\t\t\tsynchronized(pq.poll()) {\r\n\t\t\t\t\t//Actually move the vertex \"this\"\r\n\t\t\t\t\tdouble r1 = Star.rnd.nextDouble();\r\n\t\t\t\t\tdouble r2 = Star.rnd.nextDouble();\r\n\t\t\t\t\tdouble newX = (1 - Math.sqrt(r1)) * previous.x + (Math.sqrt(r1) * (1 - r2)) * this.x + (Math.sqrt(r1) * r2) * next.x;\r\n\t\t\t\t\tdouble newY = (1 - Math.sqrt(r1)) * previous.y + (Math.sqrt(r1) * (1 - r2)) * this.y + (Math.sqrt(r1) * r2) * next.y;\r\n\t\t\t\t\tthis.x = newX;\r\n\t\t\t\t\tthis.y = newY;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public E nextStep() {\r\n\t\tthis.current = this.values[Math.min(this.current.ordinal() + 1, this.values.length - 1)];\r\n\t\treturn this.current;\r\n\t}",
"public static void nextTurn(){\n\t\tPlayerButton [][] ary = GameBoard.getPBAry();\n\t\t\n\t\tfor( int x=0; x< ary.length; x++ ){\n\t\t\tfor( int y=0; y<ary[x].length; y++ ){\n\t\t\t\tary[x][y].setMovable( false );\n\t\t\t}\n\t\t}\n\t\t\n\t\tcurr++;\n\t\tif(curr >= players.size())\n\t\t\tcurr=0;\n\n\t\tif(players.get(curr).hasBeenKicked()){\n\t\t\tnextTurn();\n\t\t}\n\t}",
"public void nextTurn() {\r\n activePlayer = nextPlayer;\r\n advanceNextPlayer();\r\n }",
"private void promote() {\r\n //promote gives more money\r\n increment();\r\n }"
] | [
"0.71136475",
"0.57954633",
"0.5790584",
"0.5657253",
"0.55882263",
"0.55638516",
"0.5544045",
"0.5537236",
"0.5501666",
"0.54603195",
"0.5414915",
"0.5398531",
"0.53629804",
"0.534247",
"0.5294644",
"0.52878785",
"0.52842605",
"0.5282642",
"0.5276306",
"0.5270531",
"0.52408993",
"0.5234245",
"0.5231291",
"0.52255285",
"0.5220786",
"0.5144577",
"0.51152426",
"0.5114793",
"0.5101271",
"0.50979847",
"0.5086508",
"0.5069149",
"0.50654674",
"0.50470084",
"0.50445694",
"0.5025379",
"0.5023132",
"0.5022885",
"0.4998668",
"0.49978408",
"0.49884748",
"0.49880806",
"0.49672276",
"0.49669597",
"0.49598652",
"0.49528283",
"0.49500483",
"0.49318182",
"0.4930494",
"0.49232945",
"0.4915842",
"0.49128157",
"0.49086255",
"0.49024147",
"0.48969737",
"0.4896814",
"0.48954424",
"0.48823592",
"0.48788896",
"0.4875826",
"0.4874603",
"0.48737034",
"0.4868469",
"0.48599783",
"0.4851753",
"0.4851011",
"0.484877",
"0.48398554",
"0.48371047",
"0.48354313",
"0.48350543",
"0.48330182",
"0.48304534",
"0.4826535",
"0.48240417",
"0.48228815",
"0.4819122",
"0.48162782",
"0.48129845",
"0.48061243",
"0.4802989",
"0.48025605",
"0.48000008",
"0.47926685",
"0.47892013",
"0.47845727",
"0.4784141",
"0.47810704",
"0.4779777",
"0.4777748",
"0.47723788",
"0.47691813",
"0.47682464",
"0.47647807",
"0.47634998",
"0.47630727",
"0.47623357",
"0.47605386",
"0.475509",
"0.4750024"
] | 0.78866464 | 0 |
Skips the next instruction if the key stored in VX is not pressed | @Before
public void createOpCode() {
opCode = new OpCodeEXA1();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void handleSkipAction(ActionEvent event){\n sender.sendInput(\"skip action\");\n }",
"private void chkKeyPressed(KeyEvent e) {\r\n if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {\r\n cerrarVentana(false);\r\n } else if (UtilityPtoVenta.verificaVK_F11(e)) {\r\n aceptaCantidadIngresada(\"VK_F11\");\r\n //DVELIZ\r\n //cerrarVentana(true);\r\n \r\n \r\n } else if (UtilityPtoVenta.verificaVK_F12(e)) {\r\n if (vIndTieneSug) {\r\n aceptaCantidadIngresada(\"VK_F12\");\r\n //DVELIZ\r\n //cerrarVentana(true);\r\n }\r\n }\r\n }",
"public void pressed() \r\n\t{\r\n\t\tparity = !parity;\r\n\t\t\r\n\t}",
"@Override\n\t\t\tpublic boolean onKeyDown (int keycode) {\n\t\t\t\treturn false;\n\t\t\t}",
"public void keyTraversed(TraverseEvent e) {\n \t\t\t\tif (e.detail == SWT.TRAVERSE_ESCAPE\n \t\t\t\t\t|| e.detail == SWT.TRAVERSE_RETURN) {\n \t\t\t\t\te.doit = false;\n \t\t\t\t}\n \t\t\t}",
"private void consumeNextKeyTyped(KeyEvent paramKeyEvent)\n/* */ {\n/* 1082 */ this.consumeNextKeyTyped = true;\n/* */ }",
"private void chkKeyPressed(KeyEvent e) {\n \n if (e.getKeyCode() == KeyEvent.VK_ESCAPE) \n { \n FarmaVariables.vAceptar = true;\n this.setVisible(false);\n this.dispose();\n e.consume();\n //cerrarVentana(true); \n } \n \n else if (venta.reference.UtilityPtoVenta.verificaVK_F11(e)) \n {\n if (datosValidados()) {\n try {\n ingresarCantidad();\n FarmaUtility.aceptarTransaccion();\n cerrarVentana(false);\n } catch (SQLException sql) {\n FarmaUtility.liberarTransaccion();\n log.error(\"\",sql);\n FarmaUtility.showMessage(this, \n \"Ocurrió un error al registrar la cantidad : \\n\" +\n sql.getMessage(), txtCruce);\n cerrarVentana(false);\n }\n }\n }\n }",
"private void chkKeyPressed(KeyEvent e) {\n\t\tif (venta.reference.UtilityPtoVenta.verificaVK_F11(e)) {\n\t\t\tif(tblListaDetallePedido.getRowCount() > 0)\n {\n if(!validaChecksTable())\n {\n FarmaUtility.showMessage(this,\"No es posible realizar la operación. Existen productos sin selección de lotes.\",tblListaDetallePedido);\n return;\n }\n if(componentes.gs.componentes.JConfirmDialog.rptaConfirmDialog(this,\"Está seguro de generar el pedido institucional?\"))\n cerrarVentana(true);\n }\n\t\t} else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {\n\t\t\tcerrarVentana(false);\n\t\t}\n }",
"private void checkKey(){\n if(Greenfoot.isKeyDown(\"z\") && getJumping() == false){\n jump();\n }\n if(getCanMove()){\n if(Greenfoot.isKeyDown(\"right\")){\n moveRight();\n facingRight = true;\n }\n if(Greenfoot.isKeyDown(\"left\")){\n moveLeft();\n facingRight = false;\n }\n }\n if(Greenfoot.isKeyDown(\"x\") && getThrowing() == false){\n throwKnife(facingRight);\n changeThrowing(true);\n }\n }",
"@Override\n public boolean keyUp(int keycode) {\n return false;\n }",
"@Override\n\t\t\tpublic boolean keyDown(int keycode) {\n\t\t\t\treturn false;\n\t\t\t}",
"public void actionPerformed(ActionEvent e) {\n \t\t\t\tscreen.game.skip();\n \t\t\t}",
"@Override\n\tpublic boolean keyUp(int keycode) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean keyUp(int keycode) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean keyUp(int keycode) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean keyUp(int keycode) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean keyUp(int keycode) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean keyUp(int keycode) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean keyUp(int keycode) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean keyUp(int keycode) {\n\t\treturn false;\n\t}",
"@Override\n public boolean keyDown(int arg0) {\n return false;\n }",
"@Override\n\tpublic boolean keyDown(int keycode) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean keyDown(int keycode) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean keyDown(int keycode) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean keyDown(int keycode) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean keyDown(int keycode) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean keyDown(int keycode) {\n\t\treturn false;\n\t}",
"@Override\r\n\tpublic boolean onKeyDown(int arg0, KeyEvent arg1) {\n\t\treturn false;\r\n\t}",
"protected void scanNoSkip() throws TableFunctionMalformedException {\r\n\t\t\t\r\n\t\tint kw;\r\n\t\t\r\n\t\tgetName();\r\n\t\t\r\n\t\tkw = lookup(value);\r\n\t\tif (kw == -1)\r\n\t\t\ttoken = 'x';\r\n\t\telse\r\n\t\t\ttoken = kwcode[kw];\r\n\t\t// Debug.println(\"\\n!!!Value = \" + value);\r\n\t}",
"@Override\n\t\t\tpublic boolean keyUp(int keycode) {\n\t\t\t\treturn false;\n\t\t\t}",
"private void pressAnyKey() {\n Scanner myScanner = new Scanner(System.in);\n System.out.println(\"Press Enter key to continue...\");\n myScanner.nextLine();\n }",
"public void setKeyDown() {\r\n keys[KeyEvent.VK_P] = false;\r\n }",
"private boolean handleMovementByKey() {\n\t\tboolean moved = false;\n\t\tif (keyCode != 0) {\n\t\t\tmoved = true;\n\t\t\tdouble moveRate = 10.0 / 1000;\t// degrees per second\n\t\t\t\n\t\t\tif ((keyStateMask & SWT.SHIFT) != 0) {\n\t\t\t\tmoveRate = moveRate * 10.0;\n\t\t\t}\n\t\t\telse if ((keyStateMask & SWT.ALT) != 0) {\n\t\t\t\tmoveRate = moveRate / 5.0;\n\t\t\t}\n\t\t\t\n\t\t\tlong moveTime = 0;\n\t\t\tif (keyStopTime != 0) {\n\t\t\t\tmoveTime = keyStopTime - keyStartTime;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlong currentTime = System.currentTimeMillis();\n\t\t\t\tmoveTime = currentTime - keyStartTime;\n\t\t\t\tkeyStartTime = currentTime;\n\t\t\t}\n\t\t\t\n\t\t\tfloat move = (float)(moveRate * moveTime);\n\t\t\t\n\t\t\tswitch (keyCode) {\n\t\t\tcase 16777219:\n\t\t\t\t// left\n\t\t\t\tviewAzimuth = fixAzimuth(viewAzimuth - move);\n\t\t\t\tbreak;\n\t\t\tcase 16777220:\n\t\t\t\t// right\n\t\t\t\tviewAzimuth = fixAzimuth(viewAzimuth + move);\n\t\t\t\tbreak;\n\t\t\tcase 16777217:\n\t\t\t\t// up\n\t\t\t\tviewElevation = fixElevation(viewElevation + move);\n\t\t\t\tbreak;\n\t\t\tcase 16777218:\n\t\t\t\t// down\n\t\t\t\tviewElevation = fixElevation(viewElevation - move);\n\t\t\t\tbreak;\n\t\t\tcase 97:\n\t\t\t\t// a\n\t\t\t\tviewVFOV = fixFOV(viewVFOV - (move * fovAdjFactor));\n\t\t\t\tbreak;\n\t\t\tcase 122:\n\t\t\t\t// z\n\t\t\t\tviewVFOV = fixFOV(viewVFOV + (move * fovAdjFactor));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif (keyStopTime != 0) {\n\t\t\t\tkeyCode = 0;\n\t\t\t\tkeyStartTime = 0;\n\t\t\t}\n\t\t}\n\t\treturn moved;\n\t}",
"@Test\n\tpublic final void nextPositionStopTest() {\n\t\tplayer.setRight(false);\n\t\tplayer.setLeft(false);\n\t\tplayer.getNextXPosition();\n\t\tassertEquals(player.getDx(), 0, 0);\n\t}",
"@Override\n public boolean onKeyDown(int keyCode, KeyEvent event) {\n if (mPausing) {\n return true;\n }\n switch (keyCode) {\n }\n return super.onKeyDown(keyCode, event);\n }",
"private void chkKeyPressed(KeyEvent e) {\n\t\tif (venta.reference.UtilityPtoVenta.verificaVK_F11(e)) {\n\t\t\tif (datosValidados())\n\t\t\t\tif (componentes.gs.componentes.JConfirmDialog.rptaConfirmDialog(this,\n\t\t\t\t\t\t\"Esta seguro que desea afectar la página?\")) {\n\t\t\t\t\tVariablesInventario.vNumPag = cmbPagina.getSelectedItem()\n\t\t\t\t\t\t\t.toString().trim();\n\t\t\t\t\tcerrarVentana(true);\n\t\t\t\t}\n\t\t} else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {\n\t\t\tcerrarVentana(false);\n\t\t}\n\t}",
"private boolean isPressed(KeyCode key) {\n \t\n return keys.getOrDefault(key, false);\n }",
"public void keyPressed() {\n\t ackEvent();\n if (key == ' ') {\n pauseTic = !pauseTic;\n EventQueue.getInstance().togglePause();\n }\n if (key == '.') {\n EventQueue.getInstance().beginEvents();\n } else if (key == '\\n') {\n if (pauseTic) { //only let this run if the display is paused\n StringManager.getInstance().ticAllOneCycle();\n }\n }else KeyMap.getInstance().run(key);\n }",
"@Override\n public boolean onKey(View v, int keyCode, KeyEvent event) {\n if (event.getAction() == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_DEL && currentView.getId() != R.id.otp1 && currentView.getText().length() == 0) {\n previousView.setText(null);\n previousView.requestFocus();\n return true;\n }\n else if (currentView.getId() != R.id.otp6 && currentView.getText().length() > 0) {\n nextView.requestFocus();\n }\n return false;\n }",
"@Override\n\tpublic boolean onKey(View v, int keyCode, KeyEvent event) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic void keyPressed(KeyEvent e) \n\t{\n\t\tint key = e.getKeyCode();\n\t\tif(key == e.VK_SPACE)\n\t\t{\n\t\t\thome = false;\n\t\t\tinstruction = false;\n\t\t}\n\t\tif(key == e.VK_R)\n\t\t{\n\t\t\thome = true;\n\t\t}\n\t\tif(key == e.VK_Z)\n\t\t{\n\t\t\thome = false;\n\t\t}\n\t\tif(key == e.VK_B)\n\t\t{\n\t\t\thome = true;\n\t\t}\n\t}",
"public void onKeyEvent(String ke) {\n if (ke.equals(\"b\")) {\n bfs = true;\n dfs = false;\n manual = false;\n reset();\n }\n else if (ke.equals(\"d\")) {\n bfs = false;\n dfs = true;\n manual = false;\n reset();\n }\n else if (ke.equals(\"p\")) {\n bfs = false;\n dfs = false;\n manual = true;\n reset();\n }\n else if (ke.equals(\"r\")) {\n boardSetup();\n }\n else if (manual) {\n if (p.hasNext()) {\n if (ke.equals(\"left\")) {\n p.moveLeft();\n }\n else if (ke.equals(\"up\")) {\n p.moveUp();\n }\n else if (ke.equals(\"right\")) {\n p.moveRight();\n }\n else if (ke.equals(\"down\")) {\n p.moveDown();\n }\n }\n }\n }",
"public void keyPressed() { \n\t\twantsFrameBreak = true;\n\t\t//key = e.getKeyChar();\n\t\tkeyPressed = true;\n\t\tif (System.nanoTime() - acted > .033e9f) {\n\t\t\t_keyPressed();\n\t\t}\n\t}",
"private boolean consumeProcessedKeyEvent(KeyEvent paramKeyEvent)\n/* */ {\n/* 1095 */ if ((paramKeyEvent.getID() == 400) && (this.consumeNextKeyTyped)) {\n/* 1096 */ paramKeyEvent.consume();\n/* 1097 */ this.consumeNextKeyTyped = false;\n/* 1098 */ return true;\n/* */ }\n/* 1100 */ return false;\n/* */ }",
"@Override\n public void onDirectLeftKeyPress() {\n \n }",
"@Override\n public void onDirectLeftKeyPress() {\n \n }",
"public boolean onKeyDown(int keyCode, KeyEvent event) {\n\t\treturn false;\n\t}",
"@Override\n public boolean keyUp(int arg0) {\n return false;\n }",
"@OnlyIn(Dist.CLIENT)\n\tprivate boolean isPressing(int key){\n\t\tlong window = Minecraft.getInstance().getMainWindow().getHandle();\n\t\treturn GLFW.glfwGetKey(window, key) == GLFW.GLFW_PRESS;\n\t}",
"public boolean takeControl() {\r\n\t\tif(Button.ESCAPE.isDown())\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}",
"public boolean isHotkeySet ()\n {\n return keyCode != null;\n }",
"public void skipToNext() {\n try {\n mSessionBinder.next(mContext.getPackageName(), mCbStub);\n } catch (RemoteException e) {\n Log.wtf(TAG, \"Error calling next.\", e);\n }\n }",
"public void keyDown(int keycode){\n this.heldKeys[keycode+1] = 0;\n this.showCursor = true;\n this.frameCount = 0;\n //Keys that should only be pressed once\n if(keycode == Input.Keys.ENTER){\n if(this.enterText != null) {\n this.enterText.action(this.sOut.toString());\n }\n this.sOut = new StringBuilder();\n this.curPos = 0;\n }\n }",
"void keyPressed() {\n if (key == 'w') {\n up = true;\n }\n if (key == 's') {\n down = true;\n }\n if (key == 'a') {\n left = true;\n\n }\n if (key == 'd') {\n right = true;\n\n }\n \n if (key == 27) {\n pause = !pause;\n }\n\n // player.turnToDir(0);\n}",
"void preProcessKeyEvent(KeyEvent e) {\n if (e.isActionKey() && e.getKeyCode() == KeyEvent.VK_F1 &&\n e.isControlDown() && e.isShiftDown()) {\n list(System.out, 0);\n }\n }",
"@Override\n public final void actionPerformed(ActionEvent e) {\n if (!isKeyPressed) {\n isKeyPressed = true;\n keyPressed();\n }\n }",
"private boolean isPressed(KeyCode key) {\n\t\treturn keys.getOrDefault(key, false);\n\t}",
"public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {\n if (actionId == EditorInfo.IME_NULL\n || actionId == EditorInfo.IME_ACTION_DONE\n || actionId == EditorInfo.IME_ACTION_NEXT) {\n handleNext();\n return true;\n }\n return false;\n }",
"void correctKeyPress();",
"public void keyPressed() {\n if (keyCode == ENTER){\n if (2 == currentPage) {\n currentPage = 3;\n }\n if (1 == currentPage) {\n tmpframecount = frameCount;\n currentPage = 2;\n }\n else if (0 == currentPage) {\n currentPage = 1;\n }\n }\n if (key == 'z' || key == 'Z') shoot = true;\n if (key == 'x' || key == 'X') useBomb = true;\n if (key == 'r' ||key == 'R') restart = true;\n if (currentPage == 1){\n if (keyCode == 49) flightType = 1;\n if (keyCode == 50) flightType = 2;\n if (keyCode == 51) flightType = 3;\n if (keyCode == 52) flightType = 4;\n }\n if (keyCode == UP) {\n up = true;\n changeFlightType(0);\n }\n if (keyCode == DOWN) {\n down = true;\n changeFlightType(1);\n }\n if (keyCode == LEFT) {\n left = true;\n changeFlightType(2);\n }\n if (keyCode == RIGHT) {\n right = true;\n changeFlightType(3);\n }\n}",
"public void invalidSkip() {\n JOptionPane.showMessageDialog(frame, \"Invalid skip\", \"Invalid skip\", JOptionPane.ERROR_MESSAGE);\n\n }",
"private void chkKeyPressed(KeyEvent e) {\n\t\tif (UtilityPtoVenta.verificaVK_F1(e)) // Reservado para ayuda\n\t\t{\n\t\t} else if (UtilityPtoVenta.verificaVK_F11(e)) {\n \n boolean valor=true;\n if (datosValidados()){\n //JCORTEZ 14.03.09 solo para tipo ticket no se podra modificar la cola de impresion con una que ya exista\n if (VariablesImpresoras.vTipoComp.trim().equalsIgnoreCase(ConstantsPtoVenta.TIP_COMP_TICKET)){\n if(!validaRuta()){\n FarmaUtility.showMessage(this,\"No se puede asignar una ruta de impresion que ya existe.\",txtColaImpresion);\n valor=false;\n }\n }\n if(valor)\n if (JConfirmDialog.rptaConfirmDialog(this,\"¿Está seguro que desea grabar los datos ?\")) {\n try {\n if (existenDatos) {\n actualizarImpresora();\n } else {\n insertarImpresora();\n actualizaNumeracionImpresoras();\n }\n\n FarmaUtility.aceptarTransaccion();\n FarmaUtility.showMessage(this,\"La operación se realizó correctamente\",txtDescImpresora);\n\n } catch (SQLException ex) {\n FarmaUtility.liberarTransaccion();\n FarmaUtility.showMessage(this,\"Error al grabar datos de la impresora: \\n\"+ ex.getMessage(), txtDescImpresora);\n log.error(\"\",ex);\n\n }\n cerrarVentana(true);\n }\n }\n\n\t\t} else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {\n\t\t\tcerrarVentana(false);\n\t\t}\n\n\t}",
"private void leftServoButtonKeyPressed(java.awt.event.KeyEvent evt) { \n this.lServoWarn.setEnabled(true);\n if(!this.leftServo){\n this.controller.setLeftServo(true);\n this.leftServo = true;\n }\n }",
"@Override\r\n public void keyReleased(KeyEvent e) {\n keys[e.getKeyCode()] = false;\r\n // if(e.getKeyCode()==KeyEvent.VK_SPACE)\r\n // System.out.println(\"libero\");\r\n }",
"public void keyUp(int keycode){\n this.heldKeys[keycode+1] = -1;\n }",
"@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\tctrl = false;\r\n\t}",
"public static void keepGoing() {\n System.out.println(\"Would you like to continue? \");\n char contin= sc.next().charAt(0); \n }",
"@Override\r\n\tpublic boolean keyEvent(KeyEvent event) {\n\t\treturn false;\r\n\t}",
"@Override\n public void onSkipPressed() {\n setCurrentSlide(4);\n }",
"public void keyPressed(KeyEvent e) {\n\t\t\t\tgetCmdNXT().commandPressedTerrorist(e.getKeyChar());\r\n\t\t\t}",
"boolean mo1311a(KeyEvent keyEvent);",
"@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\tif (e.getKeyCode() == e.VK_I) {\n\t\t\ttpanel.resume();\n\t\t\ttpanel.pause = false;\n\t\t\tthis.toBack();\n\t\t}\n\t}",
"public void setKeyReleased(int keyCode){\n this.keys[keyCode] = false;\n\n }",
"public void keyPressed(int key) {\n\t\tif(key==GameSystem.DOWN){\n\t\t\tif(dSelected==DEATH.RESTART){\n\t\t\t\tdSelected=DEATH.BACKTOMENU;\n\t\t\t}\n\t\t}\n\t\telse if(key==GameSystem.UP){\n\t\t\tif(dSelected==DEATH.BACKTOMENU){\n\t\t\t\tdSelected=DEATH.RESTART;\n\t\t\t}\t\n\t\t}\n\t\telse if(key==GameSystem.CONFIRM){\n\t\t\tif(dSelected==DEATH.BACKTOMENU){\n\t\t\t\tGameSystem.TWO_PLAYER_MODE=false;\n\t\t\t\tGameSystem.PLAYER_ONE_CHOSEN=false;\n\t\t\t\tMenu.backToMenu();\n\t\t\t}\n\t\t\telse if(dSelected==DEATH.RESTART){\n\t\t\t\tMenu.toGameMode();\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void onDirectUpKeyPress() {\n \n }",
"@Override\n public void onDirectUpKeyPress() {\n \n }",
"@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\tcdx = 0;\r\n\t}",
"static void jump_when_parity_not(String passed){\n\t\tif(!P)\n\t\t\tcomplete_jump_req(passed.substring(4));\n\t}",
"public void skip() {\n if (!keepPlaying) {\n return;\n }\n keepPlaying = false;\n\n for (int i = currentPlaybackStrokeIndex; i < strokes.size(); i++) {\n while (!strokes.get(i).step(drawView)) {\n Log.d(TAG, \"Turboing\");\n }\n }\n doEndOfReplay();\n\n activity.onPlaybackEnded();\n }",
"public final void keyPressed(KeyEvent keyevent) {\n idleTime = 0; //idleTime\n int i = keyevent.getKeyCode(); //get the code\n int j = keyevent.getKeyChar(); //get the char\n\n //start detection algorithms xD\n\n\n /*\n if(i == 38) { //up\n client.inputString = \"fail\";\n client.inputTaken = true;\n }\n \n if(i == 40) { //down\n client.inputString = \"fail\";\n client.inputTaken = true;\n }\n */\n\n\n if (i == 86) { //V\n pressingV = true;\n }\n if (i == 17) { //CTRL\n pressingCtrl = true;\n }\n\n if (i == KeyEvent.VK_F1) {\n client.setTab(0);\n }\n if (i == KeyEvent.VK_F2) {\n client.setTab(1);\n }\n if (i == KeyEvent.VK_F3) {\n client.setTab(2);\n }\n if (i == KeyEvent.VK_F4) {\n client.setTab(3);\n }\n if (i == KeyEvent.VK_F5) {\n client.setTab(4);\n }\n if (i == KeyEvent.VK_F6) {\n client.setTab(5);\n }\n if (i == KeyEvent.VK_F7) {\n client.setTab(6);\n }\n if (i == KeyEvent.VK_F8) {\n client.setTab(8);\n }\n if (i == KeyEvent.VK_F9) {\n client.setTab(9);\n }\n if (i == KeyEvent.VK_ESCAPE) {\n client.setTab(10); //logout tab\n }\n if (i == KeyEvent.VK_F10) {\n client.setTab(11);\n }\n if (i == KeyEvent.VK_F11) {\n client.setTab(12);\n }\n if (i == KeyEvent.VK_F12) {\n client.setTab(13);\n }\n\n //WTF do these DO!!!\n if (j < 30) {\n j = 0;\n }\n\n\n if (i == 37) //left arrow\n {\n j = 1;\n }\n if (i == 39) //right arrow\n {\n j = 2;\n }\n if (i == 38) //up arrow\n {\n j = 3;\n }\n if (i == 40) //down arrow\n {\n j = 4;\n }\n\n\n if (i == 17) {\n j = 5;\n }\n if (i == 8) {\n j = 8;\n }\n if (i == 127) {\n j = 8;\n }\n if (i == 9) {\n j = 9;\n }\n if (i == 10) {\n j = 10;\n }\n if (i >= 112 && i <= 123) {\n j = (1008 + i) - 112;\n }\n if (i == 36) {\n j = 1000;\n }\n if (i == 35) {\n j = 1001;\n }\n if (i == 33) {\n j = 1002;\n }\n if (i == 34) {\n j = 1003;\n }\n\n if (j > 0 && j < 128) {\n keyArray[j] = 1;\n }\n if (j > 4) { //not arrow keys\n charQueue[anInt33] = j; //writeIndex for the key code\n anInt33 = anInt33 + 1 & 0x7f; //writeIndex\n }\n }",
"private void leftServoButtonKeyReleased(java.awt.event.KeyEvent evt) { \n this.lServoWarn.setEnabled(false);\n this.controller.setLeftServo(false);\n this.leftServo = false;\n }",
"@Override\n public boolean onKey(View v, int keyCode, KeyEvent event) {\n oKeys = EnumSet.noneOf(UserInteractionKeyEnum.class);\n return false;\n }",
"public void keyCheck() {\n if (right) {\n ship.rotateRight();\n }\n if (left) {\n ship.rotateLeft();\n }\n if (up) {\n ship.accelerate();\n }\n if (down) {\n ship.decelerate();\n }\n if (spacebar) {\n if (one){\n fireMiniGun();\n }\n if (two){\n fireEnergyBlaster();\n }\n if (three) {\n fireGrenadeLauncher();\n }\n }\n }",
"@Override\n\tpublic void keyPressed() {\n\t\tif (key == ENTER || key == RETURN) {\n\t\t\tnewGame();\n\t\t\treturn;\n\t\t}\n\n\t\tif (state == State.GAME_OVER)\n\t\t\treturn;\n\n\t\tif (key == ' ') {\n\t\t\tTimer_Procedures.togglePauseResume(this);\n\t\t\treturn;\n\t\t}\n\n\t\t// no fair playing with timer paused\n\t\tif (state != State.PLAYING)\n\t\t\treturn;\n\n\t\tString legal = \"QWERTYUASDFGHJZXCVVBNMqwertyuasdfghjzxcvbnm+=-_Pp \";\n\t\tif (legal.indexOf(key) < 0) {\n\t\t\tmessage = 8;\n\t\t\treturn;\n\t\t}\n\n\t\tif (\"+=-_ \".indexOf(key) >= 0) {\n\t\t\tswitch (key) {\n\t\t\tcase ' ':\n\t\t\t\tTimer_Procedures.togglePauseResume(this);\n\t\t\t\tbreak;\n\t\t\tcase '=':\n\t\t\tcase '+':\n\t\t\t\tgrid.addColumn();\n\t\t\t\tbreak;\n\t\t\tcase '_':\n\t\t\tcase '-':\n\t\t\t\tstate = State.FIND_SET;\n\t\t\t\thighlightCounter = 0;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tint col = \"qazQAZ\".indexOf(key) >= 0 ? 0\n\t\t\t\t: \"wsxWSX\".indexOf(key) >= 0 ? 1\n\t\t\t\t\t\t: \"edcEDC\".indexOf(key) >= 0 ? 2\n\t\t\t\t\t\t\t\t: \"rfvRFV\".indexOf(key) >= 0 ? 3\n\t\t\t\t\t\t\t\t\t\t: \"tgbTGB\".indexOf(key) >= 0 ? 4\n\t\t\t\t\t\t\t\t\t\t\t\t: \"yhnYHN\".indexOf(key) >= 0 ? 5 : \"ujmUJM\".indexOf(key) >= 0 ? 6 : 7;\n\t\tint row = \"qwertyuQWERTYU\".indexOf(key) >= 0 ? 0 : \"asdfghjASDFGHJ\".indexOf(key) >= 0 ? 1 : 2;\n\n\t\tif (col < currentCols) {\n\t\t\tgrid.updateSelected(col, row);\n\t\t} else {\n\t\t\tmessage = 8;\n\t\t}\n\t}",
"private void checkKeys() \n {\n ignite(Greenfoot.isKeyDown(\"up\"));\n\n if(Greenfoot.isKeyDown(\"left\")) {\n setRotation(getRotation() - 5);\n } \n if(Greenfoot.isKeyDown(\"right\")) {\n setRotation(getRotation() + 5);\n }\n if(Greenfoot.isKeyDown(\"space\")) {\n fire(\"GreenLaser\", getGunReloadTime());\n \n } \n }",
"protected void keyPressed(int keyCode) {\n if( !isBluetoothMode ){\n\t\t\tprocessKeyCode(keyCode) ;\n\t\t}\n\t\telse{\n\t\t\tbluetoothServerProcessing(keyCode) ;\n\t\t}\n if( softKey.isLeftSoftkey(keyCode)){\n\t shouldStop=true;\n\t if( server != null ){\n\t \tserver.sendByte((byte)DataTransmiting.MESSAGE_EXIT_GAME) ;\n\t }\n\t midlet.showMenuScreen(false);\n }\t\n\t}",
"@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tevent(e, vt.get(4));\r\n\t\t\t}",
"@Override\r\n public void handle(KeyEvent event){\n if (event.getCode() == KeyCode.LEFT) {\r\n //rotate counter-clockwise by one degree\r\n L = false;\r\n //Moves player right\r\n } else if (event.getCode() == KeyCode.RIGHT) {\r\n \r\n R = false;\r\n \r\n \r\n //Moves player up\r\n } else if (event.getCode() == KeyCode.UP) {\r\n Forward = false;\r\n deltaX5 = 0;\r\n deltaY5 = 0; \r\n \r\n }\r\n }",
"@Override\r\n\tpublic void skip() {\n\t\tSystem.out.println(\"Skip\");\r\n\t}",
"private void jtbMSSVKeyTyped(java.awt.event.KeyEvent evt) {\n char c = evt.getKeyChar();\n if(!(Character.isDigit(c) || (c == KeyEvent.VK_BACK_SPACE) || c == KeyEvent.VK_DELETE)){\n evt.consume();\n } \n }",
"public boolean isKeyDown(int keyCode){\n return keys[keyCode];\n }",
"public static void pressEnterToContinue() {\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Press Enter to continue...\");\n\t\tinput.nextLine();\n\t}",
"public void verifySkip()\n\t{\n\t\tAssert.assertEquals(continueButton.getText(), \"Skip\");\n\t}",
"@Override\r\n\tpublic void keyPressedAction(GlobalKeyEvent event) {\n\t\tSystem.out.println(event.getVirtualKeyCode()+\"press\");\r\n\t\t// TODO OCR\r\n\t\tif (Scope.getInstace().getPrefInfo().getOcrKey() == event.getVirtualKeyCode()\r\n\t\t\t\t&& !Scope.getInstace().isOcrFlag()&&Scope.getInstace().isOcrToggleFlag()) {\r\n\t\t\tocrHookAction();\r\n\t\t\tScope.getInstace().setOcrFlag(true);\r\n\t\t}\r\n\t}",
"boolean isCtrlKeyDown();",
"@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tevent(e, vt.get(2));\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tevent(e, vt.get(3));\r\n\t\t\t}",
"public boolean keyInput(int code, int action);",
"private static void pause() {\n System.out.println(\"Press Any Key To Continue...\");\n new java.util.Scanner(System.in).nextLine();\n }",
"public void keyPressed(KeyEvent e) {\n if (e.getKeyCode() == KeyEvent.VK_RIGHT) {\n right = true;\n }\n if (e.getKeyCode() == KeyEvent.VK_LEFT) {\n left = true;\n }\n if (e.getKeyCode() == KeyEvent.VK_UP) {\n up = true;\n }\n if (e.getKeyCode() == KeyEvent.VK_DOWN) {\n down = true;\n }\n // space bar = shoot\n if (e.getKeyCode() == KeyEvent.VK_SPACE) {\n spacebar = true;\n }\n // key 3 = Grenade Launcher\n if (e.getKeyCode() == KeyEvent.VK_3){\n if (SwitchCount > 50) {\n if (three == false){\n ship.counter = 75;\n three = true;\n two = false;\n one = false;\n }\n SwitchCount = 0;\n }\n }\n // key 2 = Energy Blaster\n if (e.getKeyCode() == KeyEvent.VK_2){\n if (SwitchCount > 50) {\n if (two == false){\n ship.counter = 175;\n three = false;\n two = true;\n one = false;\n }\n SwitchCount = 0;\n }\n }\n // key 1 = Bullets\n if (e.getKeyCode() == KeyEvent.VK_1){\n if (SwitchCount > 50) {\n if (one == false){\n ship.counter = 75;\n three = false;\n two = false;\n one = true;\n }\n SwitchCount = 0;\n }\n }\n }",
"public void keyPressed(KeyEvent event){\r\n\t\t\tchar input = event.getKeyChar();\r\n\t\t\tSystem.out.println(event.getExtendedKeyCode());\r\n\t\t\tif(event.getExtendedKeyCode()== 10){\r\n\t\t\t equals.doClick();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tswitch(input){\r\n\t\t\t\tcase '0': button0.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '1': button1.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '2': button2.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '3': button3.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '4': button4.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '5': button5.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '6': button6.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '7': button7.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '8': button8.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '9': button9.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '.': dot.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '+': plus.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '-': minus.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '/': divide.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '*': multiply.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '=': equals.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '\b': del.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '\u001b': clear.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'c': clear.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tdefault: break;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t}"
] | [
"0.6181892",
"0.59624994",
"0.5726039",
"0.57075024",
"0.5600684",
"0.5557655",
"0.5532411",
"0.54945636",
"0.54911894",
"0.53823924",
"0.5378907",
"0.5368882",
"0.53454655",
"0.53454655",
"0.53454655",
"0.53454655",
"0.53454655",
"0.53454655",
"0.53454655",
"0.53454655",
"0.5344038",
"0.5338676",
"0.5338676",
"0.5338676",
"0.5338676",
"0.5338676",
"0.5338676",
"0.53370535",
"0.53365284",
"0.53331023",
"0.53325725",
"0.53278047",
"0.53211343",
"0.53038454",
"0.5303248",
"0.52692425",
"0.5268608",
"0.52683586",
"0.526684",
"0.5262628",
"0.5251186",
"0.52479273",
"0.521787",
"0.5209863",
"0.52060765",
"0.52060765",
"0.5204149",
"0.51901305",
"0.51891947",
"0.5174581",
"0.51711255",
"0.5164871",
"0.51627177",
"0.5161543",
"0.5159959",
"0.5159329",
"0.51526445",
"0.51512456",
"0.514969",
"0.514638",
"0.5144295",
"0.5133521",
"0.5131209",
"0.51268",
"0.51222605",
"0.511886",
"0.51187676",
"0.5113766",
"0.510427",
"0.5102955",
"0.5102403",
"0.5099554",
"0.50916773",
"0.50856864",
"0.50727236",
"0.50727236",
"0.5072489",
"0.5070619",
"0.5069085",
"0.50577974",
"0.50509626",
"0.5043211",
"0.50378597",
"0.5021706",
"0.5021477",
"0.50181496",
"0.5015998",
"0.5003608",
"0.5001093",
"0.4997215",
"0.49860707",
"0.4985203",
"0.49798393",
"0.49645638",
"0.4963541",
"0.49599683",
"0.49531275",
"0.49521095",
"0.49517566",
"0.49504367",
"0.4947792"
] | 0.0 | -1 |
Compares searchNodeA with searchNodeB. check for the existence of nodes (x,y,d2) where d2 is less than or equal to d. If there are any such nodes (x,y,d2), then (x,y,d) should not be added to the frontier. | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
SearchNode other = (SearchNode) obj;
if (x != other.x)
return false;
if (y != other.y)
return false;
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int distanceBetweenNodes(Node node, int d1, int d2){\r\n ArrayList<Integer> path1 = nodeToRootPath(node, d1);\r\n ArrayList<Integer> path2 = nodeToRootPath(node, d2);\r\n \r\n //Traverse from behind to avoid time complexity\r\n int i = path1.size() - 1;\r\n int j = path2.size() - 1;\r\n \r\n //Check for valid iterations and till the time data is common, first occurence of diff data in arraulist is the time to stop\r\n while(i>=0 && j>=0 && path1.get(i) == path2.get(j)){\r\n i--; j--;\r\n }\r\n \r\n //Here returning i+1 and j+1 means there are i+1 elements left and j+1 elements left which are not common in \r\n //both ArrayList so answer will be addition of these, it will give us the distance between two nodes\r\n //+1 is two times for two edges between i to LCA and j to LCA\r\n return (i+1) + (j+1);\r\n }",
"public static int distanceBetweenNodes(Node node, int d1, int d2){\n ArrayList<Integer> al1= nodeToRootPath(node,d1);\n ArrayList<Integer> al2=nodeToRootPath(node,d2);\n\n if(al1.size()==0 || al2.size()==0)\n return -1;\n int l1=al1.size()-1;\n int l2=al2.size()-1;\n\n while(l1>=0 && l2>=0)\n {\n if(al1.get(l1)==al2.get(l2))\n {\n l1--;l2--;continue;\n }\n else break;\n }\n return l1+l2+2;\n }",
"default boolean isReachable(int vidxa, int vidxb) {\n Deque<Integer> stack = new ArrayDeque<>(16);\n BitSet vset = new BitSet(getVertexCount());\n while (!stack.isEmpty()) {\n int current = stack.pop();\n if (!vset.get(current)) {\n vset.set(current);\n if (current == vidxb) {\n return true;\n }\n for (int i = 0, n = this.getNextCount(current); i < n; i++) {\n int next = this.getNext(current, i);\n stack.push(next);\n }\n }\n }\n return false;\n }",
"@Override\r\n public int compare(Node x, Node y)\r\n {\n if (x.getD() < y.getD())\r\n {\r\n return -1;\r\n }\r\n else if (x.getD() > y.getD())\r\n {\r\n return 1;\r\n }\r\n return 0;\r\n }",
"@Override\n public ArrayList<GraphEdge> getRoute(GraphNode a, GraphNode b) {\n \tHashMap<GraphNode, Double> distances = new HashMap<GraphNode, Double>();\n \tHashMap<GraphNode, GraphEdge> predecessor = new HashMap<GraphNode, GraphEdge>();\n \tHashSet<GraphNode> visited = new HashSet<GraphNode>();\n \t\n \tArrayList<GraphEdge> result = new ArrayList<GraphEdge>();\n\t\n \t//Initialize distances, predecessor, and visited\n \tfor(GraphNode g : drivableNodes) {\n \t distances.put(g, Double.MAX_VALUE);\n \t predecessor.put(g, null);\n \t}\n \t\n \tint remaining = drivableNodes.size();\n \t\n \t//Put starting node\n \tdistances.put(a, 0.0);\n \t//predecessor.put(a, null);\n \t\n \t//Main loop\n \twhile(remaining > 0) {\n \t GraphNode closest = null;\n \t double minDist = Double.MAX_VALUE;\n\n \t for(GraphNode n : distances.keySet()) {\n \t\tdouble dist = distances.get(n);\n \t\tif(!visited.contains(n) &&\n \t\t\tdist != Double.MAX_VALUE &&\n \t\t\t(minDist == Double.MAX_VALUE || dist < minDist)) {\n \t\t closest = n;\n \t\t minDist = dist;\n \t\t}\n \t }\n \t \n \t if(closest == null)\n \t\treturn null;\n \t \n \t if(closest.equals(b))\n \t\tbreak;\n \t \n \t visited.add(closest);\n \t \n \t for(GraphEdge edge : closest.getEdges()) {\n \t\tGraphNode adjacent = edge.getOtherNode(closest);\n \t\tif(adjacent != null && !visited.contains(adjacent)) {\n \t\t //Map distance value for the other Node\n \t\t double otherDist = distances.get(adjacent);\n \t\t //Weight of edge from closest node to adjacent node\n \t\t double weight = edge.getWeight();\n \t\t String way = edge.getWay();\n \t\t \n \t\t if(otherDist == Double.MAX_VALUE ||\n \t\t\t weight + minDist < otherDist) {\n \t\t\tdistances.put(adjacent, weight + minDist);\n \t\t\t\n \t\t\t//Make new edge in correct order\n \t\t\tGraphEdge corrected = new GraphEdge(closest, adjacent, weight, way);\n \t\t\t\n \t\t\tpredecessor.put(adjacent, corrected);\n \t\t }\n \t\t}\n \t }\n\n \t remaining--;\n \t}\n \t\n \t//Backtrack to build route\n \tif(distances.get(b) == Double.MAX_VALUE) {\n \t return null;\n \t} else {\n \t //buildPath(predecessor, a, b, result);\n \t //Non recursive version\n \t Stack<GraphEdge> stack = new Stack<GraphEdge>(); \n \t while(!b.equals(a)) {\n \t\tGraphEdge edge = predecessor.get(b);\n \t\t\n \t\t//Make sure vertices are in correct order\n \t\tGraphNode start = edge.getOtherNode(b);\n \t\t//double weight = edge.getWeight();\n \t\t//GraphEdge corrected = new GraphEdge(start, b, weight);\n \t\t\n \t\tstack.push(edge);\n \t\tb = start;\n \t }\n \t \n \t while(!stack.isEmpty()) {\n \t\tGraphEdge edge = stack.pop();\n \t\tresult.add(edge);\n \t }\n \t}\n \t\n\treturn result;\n }",
"public static void main(String[] args) {\n\t\tNode a = new Node(10);\r\n\t\tNode b = new Node(-5);\r\n\t\tNode c = new Node(-10);\r\n\t\tNode d = new Node(5);\r\n\t\tNode e = new Node(25);\r\n\t\tNode f = new Node(36);\r\n\t\ta.left = b;\r\n\t\tb.left = c;\r\n\t\tb.right = d;\r\n\t\ta.right = e;\r\n\t\te.right = f;\r\n\t\tboolean found1 = search(a,22);\r\n\t\tboolean found2 = search(a,5);\r\n\t\tSystem.out.println(found1);\r\n\t\tSystem.out.println(found2);\r\n\t}",
"private int[] shrtst_Path_Dijkstra_Algo(int[][] matrx, int sNode, int[] forward_tab_dist, int[] list_Prevoius_Nodes) \n\t{\n\t\tArrayList<Integer> visitedNodes_M = new ArrayList<>(); //3. set of visited vertices is initially empty\n\t\tArrayList<Integer> unvisitedNodes_Q = new ArrayList<>(); //4. the queue initially contains all vertices\n\t\t\n\t\t//1. Distance to source vertex = 0\n\t\tforward_tab_dist[sNode] = 0;\n\n\t\t//2. Initialize: Set all other distances to infinity\n\t\tint k=0;\n\t\twhile(k < matrx.length)\n\t\t{\n\t\t\tunvisitedNodes_Q.add(k);\n\t\t\tif(k != sNode)\n\t\t\t{\n\t\t\t\tforward_tab_dist[k] = INFINITE_DIST;\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\t\t\n\t\t//list of previous nodes, to traverse back\n\t\tlist_Prevoius_Nodes[sNode] = sNode;\n\t\t\n\t\t//5. While queue is not empty\n\t\twhile(!unvisitedNodes_Q.isEmpty())\n\t\t{\n\t\t\tint minDist = INFINITE_DIST;\n\t\t\tint u_minDistNode = -1;\n\t\t\t\n\t\t\t//6. select the element of Q with min distance\n\t\t\tint l = 0;\n\t\t\twhile(l < unvisitedNodes_Q.size())\n\t\t\t{\n\t\t\t\tint n = unvisitedNodes_Q.get(l);\n\t\t\t\tif(!(forward_tab_dist[n] <= minDist))\n\t\t\t\t{\n\t\t\t\t\tl++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tu_minDistNode = n;\n\t\t\t\t\tminDist = forward_tab_dist[n];\n\t\t\t\t}\n\t\t\t\tl++;\n\t\t\t}\n\t\t\t//No minimum distance node found then return\n\t\t\tif(u_minDistNode == -1)\n\t\t\t{\tbreak;\t}\n\t\t\t\n\t\t\t//7. add u to list of visited vertices\n\t\t\tvisitedNodes_M.add(u_minDistNode);\n\t\t\t\n\t\t\tint index = unvisitedNodes_Q.indexOf(u_minDistNode);\t//remove this node from unvisited nodes\n\t\t\tunvisitedNodes_Q.remove(index);\n\t\t\t\n\t\t\t//8.0 algo - consider neighbor as direct distance nodes except source\n\t\t\tfor(int v=0; v<matrx.length; v++)\n\t\t\t{\n\t\t\t\t//matrix[minDistNode_u][v] > 0 ensures it is not source node\n\t\t\t\t//unvisitedNodes_Q.contains(v) only check for unvisited nodes\n\t\t\t\t\n\t\t\t\tif(unvisitedNodes_Q.contains(v) && matrx[u_minDistNode][v] > 0)\n\t\t\t\t{\n\t\t\t\t\tint val = forward_tab_dist[u_minDistNode] + matrx[u_minDistNode][v];\n\t\t\t\t\tif(val < forward_tab_dist[v])\n\t\t\t\t\t{\n\t\t\t\t\t\t//stores shortest distance\n\t\t\t\t\t\tforward_tab_dist[v] = val;\n\t\t\t\t\t\t//stores last node for back traversal to find path\n\t\t\t\t\t\tlist_Prevoius_Nodes[v] = u_minDistNode;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn forward_tab_dist;\n\t}",
"@Override\n List<NodeData> pathFind() throws NoPathException {\n System.out.println(\"Starting Scenic\");\n\n frontier.add(start);\n\n while(!frontier.isEmpty()) {\n StarNode current = frontier.getLast();\n frontier.removeLast(); // pop the priority queue\n if(current.getXCoord() == goal.getXCoord() && current.getYCoord() == goal.getYCoord()) {\n // If we are at the goal, we need to backtrack through the shortest path\n System.out.println(\"At target!\");\n finalList.add(current); // we have to add the goal to the path before we start backtracking\n while(!(current.getXCoord() == start.getXCoord() && current.getYCoord() == start.getYCoord())) {\n finalList.add(current.getPreviousNode());\n current = current.getPreviousNode();\n System.out.println(current.getNodeID());\n }\n return finalList;\n }\n else {\n // we need to get all the neighbor nodes, identify their costs, and put them into the queue\n LinkedList<StarNode> neighbors = current.getNeighbors();\n // we also need to remove the previous node from the list of neighbors because we do not want to backtrack\n neighbors.remove(current.getPreviousNode());\n\n for (StarNode newnode : neighbors) {\n int nodePlace = this.listContainsId(frontier, newnode);\n if(nodePlace > -1) {\n if (frontier.get(nodePlace).getF() > actionCost(newnode) + distanceToGo(newnode, goal)) {\n System.out.println(\"Here\");\n frontier.remove(frontier.get(nodePlace));\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n }\n else {\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n\n // This fixes the problem with infinitely looping elevators (I hope)\n if(current.getNodeType().equals(\"ELEV\") && newnode.getNodeType().equals(\"ELEV\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"ELEV\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n if(current.getNodeType().equals(\"STAI\") && newnode.getNodeType().equals(\"STAI\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"STAI\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n // this is where the node is put in the right place in the queue\n Collections.sort(frontier);\n }\n }\n }\n throw new NoPathException(start.getLongName(), goal.getLongName());\n }",
"@Override\r\n public boolean breadthFirstSearch(T start, T end) {\r\n Vertex<T> startV = vertices.get(start);\r\n Vertex<T> endV = vertices.get(end);\r\n\r\n Queue<Vertex<T>> queue = new LinkedList<Vertex<T>>();\r\n Set<Vertex<T>> visited = new HashSet<>();\r\n\r\n queue.add(startV);\r\n visited.add(startV);\r\n\r\n while(queue.size() > 0){\r\n Vertex<T> next = queue.poll();\r\n if(next == null){\r\n continue;\r\n }\r\n if(next == endV){\r\n return true;\r\n }\r\n\r\n for (Vertex<T> neighbor: next.getNeighbors()){\r\n if(!visited.contains(neighbor)){\r\n visited.add(neighbor);\r\n queue.add(neighbor);\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }",
"private int[][] searchAdjNodes(int nodeA) {\n\t\tint[] backNodes = new int[vertices[nodeA].length];\n\t\tint backNodesIndex = 0;\n\t\tint[] forwardNodes = new int[vertices[nodeA].length];\n\t\tint forwardNodesIndex = 0;\n\t\tfor (int nodeB : vertices[nodeA]) {\n\t\t\tif (edgeVisited[connectivity[nodeA][nodeB]])\n\t\t\t\tcontinue;\n\t\t\telse if (nodeVisited[nodeB] >= 0)\n\t\t\t\tbackNodes[backNodesIndex++] = nodeB;\n\t\t\telse\n\t\t\t\tforwardNodes[forwardNodesIndex++] = nodeB;\n\t\t}\n\t\tint[][] result = new int[2][];\n\t\t// Then arrange backNodes with depth from small to large\n\t\tint[] backNodesKey = new int[backNodesIndex];\n\t\tfor (int i = 0; i < backNodesIndex; i++)\n\t\t\tbackNodesKey[i] = nodeVisited[backNodes[i]];\n\t\tresult[0] = SortIntSet.sort(Arrays.copyOf(backNodes, backNodesIndex),\n\t\t\t\tbackNodesKey);\n\n\t\t// arrange forward edge/nodes with label from small to large\n\t\tint[] forwardNodesKey = new int[forwardNodesIndex];\n\t\tint[] forwardEdgeKey = new int[forwardNodesIndex];\n\t\tfor (int i = 0; i < forwardNodesIndex; i++) {\n\t\t\tint nodeID = forwardNodes[i];\n\t\t\tforwardNodesKey[i] = connectivity[nodeID][nodeID];\n\t\t\tforwardEdgeKey[i] = edgeLabel[connectivity[nodeA][nodeID]];\n\t\t}\n\t\tresult[1] = SortIntSet.sort(\n\t\t\t\tArrays.copyOf(forwardNodes, forwardNodesIndex), forwardEdgeKey,\n\t\t\t\tforwardNodesKey);\n\t\treturn result;\n\t}",
"boolean withinD(double d, double x, double y, double x2, double y2) {\r\n\t\tif (x == Double.NEGATIVE_INFINITY)\r\n\t\t\tx = x2;\r\n\t\tif (y == Double.NEGATIVE_INFINITY)\r\n\t\t\ty = y2;\r\n\t\tdouble[] origin = {x,y};\r\n\t\tdouble[] point = {x2, y2};\r\n\t\tdouble dist = Physics.len( origin, 0 , point, 0);\r\n\t\treturn dist <= d;\r\n\t}",
"@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }",
"private void searchForNearest(KdNode kdNode, Point2D p, RectHV rectangle) {\n int comparison;\n // 2 rectangles that will store the coordinates of the rectangles that are delimited by kdNode's children,\n // used in order to calculate the distance to them and see if it's worth looking down the path inside them as well\n // (i.e. if the distance from point p to the rectangle is less than the distance to an already established nearest)\n RectHV rectLeftBelow, rectRightAbove;\n\n if (kdNode.point.equals(p)) {\n // if the point we're looking at actually equals the query point, we return here,\n // as we can no longer find a distance lower than 0\n nearest = kdNode.point;\n return;\n }\n\n // if the point in the current node is closer to the searched node, we update nearest\n if (p.distanceSquaredTo(kdNode.point) < p.distanceSquaredTo(nearest))\n nearest = kdNode.point;\n\n if (kdNode.dimension) { // if this KdNode is vertical (root.dimension == true), then we have left/right rectangles\n rectLeftBelow = new RectHV(rectangle.xmin(), rectangle.ymin(),\n kdNode.point.x(), rectangle.ymax());\n rectRightAbove = new RectHV(kdNode.point.x(), rectangle.ymin(),\n rectangle.xmax(), rectangle.ymax());\n }\n else { // if this KdNode is horizontal (root.dimension == false), then we have below/above rectangles\n rectLeftBelow = new RectHV(rectangle.xmin(), rectangle.ymin(),\n rectangle.xmax(), kdNode.point.y());\n rectRightAbove = new RectHV(rectangle.xmin(), kdNode.point.y(),\n rectangle.xmax(), rectangle.ymax());\n }\n // we look at which rectangle is nearest to the query point, in order to go down that path first\n comparison = Double.compare(rectLeftBelow.distanceSquaredTo(p),\n rectRightAbove.distanceSquaredTo(p));\n\n if (comparison < 0) { // if distance to left/lower rectangle is lower than to right/upper\n if (kdNode.left != null) {\n if (rectLeftBelow.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.left, p, rectLeftBelow);\n }\n // if it's larger than to nearest, the distance to the other\n // rectangle will certainly be even larger, so we return here\n else return;\n }\n if (kdNode.right != null) {\n if (rectRightAbove.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.right, p, rectRightAbove);\n }\n // else return; // return statement not needed, if (comparison < 0) statement terminates here anyway\n }\n }\n else { // comparison < 0, the opposite situation holds: distance to right/upper rectangle is lower than to left/lower\n if (kdNode.right != null) {\n if (rectRightAbove.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.right, p, rectRightAbove);\n }\n else return;\n }\n if (kdNode.left != null) {\n if (rectLeftBelow.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.left, p, rectLeftBelow);\n }\n }\n\n }\n }",
"private void checkNodesToSearch() {\n if (nodesToSearch == null || nodesToSearch.length == 0) {\n Graph graph;\n if (Lookup.getDefault().lookup(DataTablesController.class).isShowOnlyVisible()) {\n graph = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraphVisible();\n } else {\n graph = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraph();\n }\n nodesToSearch = graph.getNodes().toArray();\n }\n }",
"void findSearchOrder() {\n boolean filled = false;\n for(int node: queryGraphNodes.keySet()) {\n\n vertexClass vc = queryGraphNodes.get(node);\n searchOrderSeq.add(node);\n for(int edge: queryGraphNodes.get(node).edges.keySet()) {\n filled = calcOrdering(edge);\n if (filled)\n break;\n }\n if(searchOrderSeq.size() == queryGraphNodes.size())\n break;\n\n }\n\n }",
"public void connect(int a, int b) {\n int a_root = find(a);\r\n int b_root = find(b);\r\n if(a_root!=b_root){\r\n graph[a_root] = b_root;\r\n count-=1;\r\n }\r\n \r\n }",
"public static int runBFS(int[][]map, coordinate src1, coordinate src2){\n\t \n boolean visited[][] = new boolean[dim][dim]; //visited boolean 2d array that is the same size as 2d map\n coordinate visit1[][]=new coordinate[dim][dim]; // this is the one used to hold previous location\n coordinate visit2[][]=new coordinate[dim][dim]; // this is the one used to hold previous location\n\t \n\t visit1[0][0]=new coordinate(0,0); //same as BFS\n \n\t visit2[dim-1][dim-1] = new coordinate(dim-1,dim-1);\n\t //marked both the 0,0 and dim-1, dim-1 srcs as visited\n\t \n\t Queue<QueueNode> queue1 = new LinkedList<>(); //queue for src1\n\t Queue<QueueNode> queue2 = new LinkedList<>(); //queue for src2\n\t \n\t QueueNode sn1 = new QueueNode(src1, 0, src1); //src node 1 queue node\n\t QueueNode sn2 = new QueueNode(src2, 0, src2);\n\t \n\t ArrayList<coordinate> pathHold1 = new ArrayList<>(); //for first path\n\t ArrayList<coordinate> pathHold2 = new ArrayList<>(); //for second path \n\t \n\t visited[src1.x][src1.y] = true; //mark the start node as visited inside of the visited boolean 2d array for first src\n\t visited[src2.x][src2.y] = true; //mark the start node as visited inside of the visited boolean 2d array for second src\n\t \n\t System.out.println();\n\t \n\t queue1.add(sn1);\n\t queue2.add(sn2);\n\t //added the start nodes\n\t \n\t QueueNode current1 = null;\n\t QueueNode current2 = null;\n\t //to be used later to hold current node being looked at\n\t coordinate c1 = null;\n\t coordinate c2 = null;\n\t\t//coordinates to be examined\n\t \n\t while(!queue1.isEmpty()&&!queue2.isEmpty()){\n\t //keep iterating so long as queues have items -- but if one becomes empty, check at each iteration\n\t\t\t//to avoid null pointer so we are not dequeuing from empty queue\n int maxFringe = 0;\n\t\t//use this to check max fringe at each time we add to either queue\n if(queue1.size()>maxFringe || queue2.size()>0) {\n \t if(queue1.size()>maxFringe) {\n \t\t maxFringe=queue1.size();\n \t }else {\n \t\t maxFringe=queue2.size();\n \t }\n }\n\t \n\t \tif(!queue1.isEmpty()) { \n\t\t\t\t//while first queue is not empty, pop\n\t \t\t current1 = queue1.peek(); // this is n\n\t c1 = current1.point;\n\t \t\t visited[c1.x][c1.y]=true; //mark this node as visited, will check neighbors later\n\t boolean inFringe = false;\n\t inFringe = compareFringe(c1, queue2); //see if intersect or not\n\t \n\t \n\t // compare current point to the queue2 fringe. If not in fringe\n\t if(inFringe) {\n\t \t //we have found the duplicate \n\t \t System.out.println(\"duplicate\");\n\t \t intersect = c1;\n\t\t System.out.println(\"Intersect is :\"+c1.x+\",\"+c1.y);\n\t\t visit1[c1.x][c1.y]=current1.prev; //set prev node or where we came from\n\t\t \n\t\t System.out.println(\"We have reached our goal!\");\n\t\t \n\t\t if(current2 != null) {\n\t\t\t\t\t //so long as paths have values, add length and return\n\t\t return current1.pathTotal+current2.pathTotal;\n\t\t }else {\n\t\t\t\t\t //else return only one path \n\t\t \t return current1.pathTotal;\n\t\t }\n\t }\n\t\t\t\t//this is getting the neighbors, same as BFS\n\t \n\t int row1 = 0;\n\t int col1 = 0;\n\t \n\t for (int i = 0; i < 4; i++) { \n\t row1= c1.x + rowNum1[i]; \n\t col1 = c1.y + colNum1[i]; \n\t //grab neighbor of current\n\t if (cellValid(row1, col1) && map[row1][col1] == 1 && !visited[row1][col1]){ \n\t \t \n\t // mark cell as visited and enqueue it \n\t visited[row1][col1] = true; //we visited the node so mark it\n\t visit1[row1][col1] = new coordinate(c1.x, c1.y); //set prev as current coord\n\n\t QueueNode Adjcell = new QueueNode(new coordinate(row1, col1), current1.pathTotal + 1, new coordinate(row1-rowNum1[i], col1-colNum1[i])); \n\t queue1.add(Adjcell); //make it a queueNode to add to q1 for first path\n\t }else if(cellValid(row1, col1) && map[row1][col1] == 1 && (visited[row1][col1]&&visit2[row1][col1]!=null)){\n\t \t // System.out.println(\"already visited\"+row1+\",\"+col1); \n\t\t\t\t //check if already visited and valid (not off grid) and = 1 so we can take path -- \n\t\t\t\t //if so, this means we found intersect\n\t\t\t\t //make sure node has been visited in other path to guarantee it is intersect\n\t \t intersect=new coordinate(row1,col1); //set intersect\n\t \t visit1[intersect.x][intersect.y]=new coordinate(c1.x, c1.y); //set where we came from\n\t \t //current1.pathTotal++;\n\t \t printfin(visit1, visit2); //used to print final path -- set map\n \n int nodesExplored1 = 0;\n int nodesExplored2 = 0;\n for(coordinate coor : pathHold1){\n nodesExplored1++;\n }\n for(coordinate coor : pathHold2){\n nodesExplored2++;\n }\n\t\t\t\t \n\t\t\t\t //get number of nodes expanded in each path, add together\n\n int fin = nodesExplored1+nodesExplored2; //this is final explored nodes in each path\n System.out.println(\"Nodes explored: \" + fin);\n \n\t \t return pathsize; //return total pathsize\n\t \t //break;\n\t }\n\t \n\t \n\t } \n\t //once all of the neighbors have been visited, dequeue from queue 1 in path 1\n\t queue1.remove(); \n\t pathHold1.add(c1); //add to explored\n\t \n\t }\n\t \t//now to the same in path2 from (dim-1, dim-1) as src2\n\t \tif(!queue2.isEmpty()) {\n\t \t\t\n\t \t\t current2 = queue2.peek(); // this is n\n\t c2 = current2.point;\n\t \t\t visited[c2.x][c2.y]=true;\n\t boolean inFringe = false;\n\t inFringe = compareFringe(c2, queue1);\n\t \n\t // compare current point to the queue2 fringe. If not in fringe\n\t if(inFringe) {\n\t \t //we have found the duplicate \n\t \t System.out.println(\"duplicate\");\n\t \t intersect = c2;\n\t\t // System.out.println(\"Intersect is :\"+c2.x+\",\"+c2.y);\n\t\t visit2[c2.x][c2.y]=current2.prev;\n\t\t \n\t\t System.out.println(\"We have reached our goal!\");\n\t\t \n\t\t \n\t\t if(current1 != null) {\n\t\t\t return current1.pathTotal+current2.pathTotal;\n\t\t\t }else {\n\t\t\t \t return current2.pathTotal;\n\t\t\t }\n\t }\n\t \n\t \t// get neighbors\n\t int row2 = 0;\n\t int col2 = 0;\n\t \n\t for (int i = 0; i < 4; i++) { \n\t row2= c2.x + rowNum2[i]; \n\t col2 = c2.y + colNum2[i]; \n\t \n\t \n\t if (cellValid(row2, col2) && map[row2][col2] == 1 && !visited[row2][col2]){ \n\t \t \n\t // mark cell as visited and enqueue it \n\t visited[row2][col2] = true; \n\t visit2[row2][col2] = new coordinate(c2.x, c2.y);\n\n\t QueueNode Adjcell2 = new QueueNode(new coordinate(row2, col2), current2.pathTotal + 1, new coordinate(row2-rowNum2[i], col2-colNum2[i])); \n\t queue2.add(Adjcell2);\n\t }else if(cellValid(row2, col2) && map[row2][col2] == 1 && (visited[row2][col2]&&visit1[row2][col2]!=null)){\n\t \t \n\t \t intersect=new coordinate(row2,col2);\n\t \t \n\t \t visit2[intersect.x][intersect.y]=new coordinate(c2.x, c2.y);\n\t \n\t \n\t printfin(visit1, visit2);\n\t int nodesExplored1 = 0;\n int nodesExplored2 = 0;\n for(coordinate coor : pathHold1){\n nodesExplored1++;\n }\n for(coordinate coor : pathHold2){\n nodesExplored2++;\n }\n\n int fin = nodesExplored1+nodesExplored2;\n System.out.println(\"Nodes explored: \" + fin);\n\t \t return pathsize;\n\t \t \n\t }\n\t \n\t } \n\t //once all of the neighbors have been visited, dequeue \n\t queue2.remove(); \n\t pathHold2.add(c2);\n\t \t\t\n\t \t}\n\n\t }\n \n int nodesExplored1 = 0;\n int nodesExplored2 = 0;\n for(coordinate coor : pathHold1){\n nodesExplored1++;\n }\n for(coordinate coor : pathHold2){\n nodesExplored2++;\n }\n\n int fin = nodesExplored1+nodesExplored2;\n System.out.println(\"Nodes explored: \" + fin);\n\t //if here, means no path was found\n\t return -1;\n\t \n\t }",
"public static int graphNodeComparison(Vector3D targetNodePosition, GraphNode a, GraphNode b) {\n Vector3D aPos = getPositionOf(a);\n Vector3D bPos = getPositionOf(b);\n\n float aDiff = Vector3D.getDistanceBetween(aPos, targetNodePosition);\n float bDiff = Vector3D.getDistanceBetween(bPos, targetNodePosition);\n\n float diff = aDiff - bDiff;\n int intDiff = Math.round(diff * DIFF_SCALE);\n\n if (intDiff == 0)\n intDiff = (int)Math.signum(diff);\n\n return intDiff;\n }",
"public static void bfs(int a, int b) {\n\t\t\r\n\t\tQueue<Node> q = new LinkedList<>();\r\n\t\t\r\n\t\tq.add(new Node(a,b));\r\n\t\t\r\n\t\twhile(!q.isEmpty()) {\r\n\t\t\t\r\n\t\t\tNode n = q.remove();\r\n\t\t\t\r\n\t\t\tint x = n.x;\r\n\t\t\tint y = n.y;\r\n\t\t\t\r\n\t\t\tif(x+1 <= N && map[x+1][y] > map[x][y]) {\r\n\t\t\t\tif(visited[x+1][y] != 1) {\r\n\t\t\t\t\tq.add(new Node(x+1,y));\r\n\t\t\t\t\tvisited[x+1][y] = cnt;\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\tif(x-1 > 0 && map[x-1][y] > map[x][y]) {\r\n\t\t\t\tif(visited[x-1][y] != 1) {\r\n\t\t\t\t\tq.add(new Node(x-1,y));\r\n\t\t\t\t\tvisited[x-1][y] = cnt;\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\tif(y-1 > 0 && map[x][y-1] > map[x][y]) {\r\n\t\t\t\tif(visited[x][y-1] != 1) {\r\n\t\t\t\t\tq.add(new Node(x,y-1));\r\n\t\t\t\t\tvisited[x][y-1] = cnt;\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\tif(y+1 <=N && map[x][y+1] > map[x][y]) {\r\n\t\t\t\tif(visited[x][y+1] != 1) {\r\n\t\t\t\t\tq.add(new Node(x,y+1));\r\n\t\t\t\t\tvisited[x][y+1] = cnt;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\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}",
"private int BFS() {\n adjList.cleanNodeFields();\n\n //Queue for storing current shortest path\n Queue<Node<Integer, Integer>> q = new LinkedList<>();\n\n //Set source node value to 0\n q.add(adjList.getNode(startNode));\n q.peek().key = 0;\n q.peek().d = 0;\n q.peek().visited = true;\n\n //Helper variables\n LinkedList<Pair<Node<Integer, Integer>, Integer>> neighbors;//Array of pairs <neighborKey, edgeWeight>\n Node<Integer, Integer> neighbor, u;\n long speed = (long) (cellSideLength * 1.20);\n\n while (!isCancelled() && q.size() != 0) {\n u = q.poll();\n\n //Marks node as checked\n checkedNodesGC.fillRect((u.value >> 16) * cellSideLength + 0.5f,\n (u.value & 0x0000FFFF) * cellSideLength + 0.5f,\n (int) cellSideLength - 1, (int) cellSideLength - 1);\n\n //endNode found\n if (u.value == endNode) {\n //Draws shortest path\n Node<Integer, Integer> current = u, prev = u;\n\n while ((current = current.prev) != null) {\n shortestPathGC.strokeLine((prev.value >> 16) * cellSideLength + cellSideLength / 2,\n (prev.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2,\n (current.value >> 16) * cellSideLength + cellSideLength / 2,\n (current.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2);\n prev = current;\n }\n return u.d;\n }\n\n //Wait after checking node\n try {\n Thread.sleep(speed);\n } catch (InterruptedException interrupted) {\n if (isCancelled())\n break;\n }\n\n //Checking Neighbors\n neighbors = adjList.getNeighbors(u.value);\n for (Pair<Node<Integer, Integer>, Integer> neighborKeyValuePair : neighbors) {\n neighbor = neighborKeyValuePair.getKey();\n //Relaxation step\n //Checks if neighbor hasn't been checked, if so the assign the shortest path\n if (!neighbor.visited) {\n //Adds checked neighbor to queue\n neighbor.key = u.d + 1;\n neighbor.d = u.d + 1; //Assign shorter path found to neighbor\n neighbor.prev = u;\n neighbor.visited = true;\n q.add(neighbor);\n }\n }\n }\n return Integer.MAX_VALUE;\n }",
"@Override\n\tpublic void search() {\n\t\tpq = new IndexMinPQ<>(graph.getNumberOfStations());\n\t\tpq.insert(startIndex, distTo[startIndex]);\n\t\twhile (!pq.isEmpty()) {\n\t\t\tint v = pq.delMin();\n\t\t\tnodesVisited.add(graph.getStation(v));\n\t\t\tnodesVisitedAmount++;\n\t\t\tfor (Integer vertex : graph.getAdjacentVertices(v)) {\t\n\t\t\t\trelax(graph.getConnection(v, vertex));\n\t\t\t}\n\t\t}\n\t\tpathWeight = distTo[endIndex];\n\t\tpathTo(endIndex);\n\t}",
"private static boolean compareEdges(S2Point a0, S2Point a1, S2Point b0, S2Point b1) {\n if (a1.lessThan(a0)) {\n S2Point temp = a0;\n a0 = a1;\n a1 = temp;\n }\n if (b1.lessThan(b0)) {\n S2Point temp = b0;\n b0 = b1;\n b1 = temp;\n }\n return a0.lessThan(b0) || (a0.equalsPoint(b0) && b0.lessThan(b1));\n }",
"public static void main(String[] args) {\n\n BDNode a = new BDNode(\"A\");\n BDNode b = new BDNode(\"B\");\n BDNode c = new BDNode(\"C\");\n BDNode d = new BDNode(\"D\");\n BDNode e = new BDNode(\"E\");\n\n a.link(b);\n a.link(d);\n b.link(a);\n b.link(c);\n b.link(e);\n c.link(b);\n c.link(d);\n d.link(a);\n d.link(c);\n d.link(e);\n e.link(b);\n e.link(d);\n\n BDNode target = e;\n\n/*\n // BFS\n Queue<BDNode> queue = new LinkedList<>();\n queue.offer(a);\n\n while(!queue.isEmpty()) {\n BDNode n = queue.poll();\n n.visit();\n System.out.println(n); // 찾는 여정 출력\n\n if(n.equals(target)) {\n System.out.println(\"BFS Found! \" + n);\n break;\n }\n\n for (BDNode l : n.links) {\n if(l.isVisited()) continue;\n if (queue.contains(l)) continue;\n queue.offer(l);\n }\n\n // 위랑 같은 표현\n// n.links.stream()\n// .filter(l -> !queue.contains(l))\n// .forEach(queue::offer);\n }\n*/\n\n // DFS\n Stack<BDNode> stack = new Stack<>();\n stack.push(a);\n\n while(!stack.isEmpty()) {\n BDNode n = stack.pop();\n n.visit();\n System.out.println(n); // 찾는 여정 출력\n\n if (n.equals(target)) {\n System.out.println(\"DFS Found! \" + n);\n break;\n }\n\n for (BDNode l : n.links) {\n if (l.isVisited()) continue;\n if (stack.contains(l)) continue;\n\n stack.push(l);\n }\n }\n\n\n }",
"public int check_node(double x1,double y1) //checks the existence of a particular co-ordinate\r\n\t{\n\t\tfor(int i=0;i<nodes.size();i++)\t\t // it returns that index or returns -1;\r\n\t\t{\r\n\t\t\tif(nodes.get(i)[0]==x1 && nodes.get(i)[1]==y1 )\r\n\t\t\t\treturn i;\r\n\t\t}\r\n\t\t return -1;\r\n\t}",
"public List<GeographicPoint> dijkstra(GeographicPoint start, \n\t\t\t\t\t\t\t\t\t\t GeographicPoint goal, Consumer<GeographicPoint> nodeSearched)\n\t{\n\t\t// TODO: Implement this method in WEEK 4\n\n\t\t// Hook for visualization. See writeup.\n\t\t//nodeSearched.accept(next.getLocation());\n\t\t\n\t\t//initialize distance of each MapNode from start to infinity\n\t\t\n\t\tSet<GeographicPoint> visited = new HashSet<GeographicPoint>();\n\t\tPriorityQueue<MapNode> queue = new PriorityQueue<MapNode>();\n\t\tHashMap<GeographicPoint, List<GeographicPoint>> path = new HashMap<GeographicPoint, List<GeographicPoint>>();\n\t\tint count = 0;\n\t\t\n\t\tif (!map.containsKey(start) || !map.containsKey(goal))\n\t\t\treturn null;\n\t\t\n\t\tfor (GeographicPoint temp : map.keySet())\n\t\t\tpath.put(temp, new ArrayList<GeographicPoint>());\n\t\t\n\t\tMapNode startNode = map.get(start);\n\t\tstartNode.setTimeToStart(0.0);\n\t\tstartNode.setDistanceToStart(0.0);\n\t\tqueue.add(startNode);\n\t\t\n\t\twhile (!queue.isEmpty()) {\n\t\t\tMapNode currNode = queue.poll();\n\t\t\tnodeSearched.accept(currNode.getLocation());\n\t\t\t\n\t\t\tif (!visited.contains(currNode.getLocation())) {\n\t\t\t\tvisited.add(currNode.getLocation());\n\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\tif (currNode.getLocation().equals(goal))\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tHashMap<MapEdge, GeographicPoint> neighbours = currNode.getNeighbours();\n\t\t\t\tfor (MapEdge edge : neighbours.keySet()) {\n\t\t\t\t\t\n\t\t\t\t\tif (!visited.contains(edge.getEnd())) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tMapNode addNode = map.get(neighbours.get(edge));\n\t\t\t\t\t\tdouble tempTime = currNode.getTimeToStart() + ((edge.getDistance())/(edge.getSpeedLimit()));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (tempTime < addNode.getTimeToStart()) {\n\t\t\t\t\t\t\taddNode.setTimeToStart(tempTime);\n\t\t\t\t\t\t\tqueue.add(addNode);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tList<GeographicPoint> temp = path.get(neighbours.get(edge));\n\t\t\t\t\t\t\ttemp.add(currNode.getLocation());\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\tSystem.out.println(\"Dijkstra: \" + count);\n\t\treturn backTrack(path,goal);\n\t}",
"private void checkConnection( SquareNode a , SquareNode b ) {\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tSquareEdge edgeA = a.edges[i];\n\t\t\tif( edgeA == null )\n\t\t\t\tcontinue;\n\n\t\t\tSquareNode common = edgeA.destination(a);\n\t\t\tint commonToA = edgeA.destinationSide(a);\n\t\t\tint commonToB = CircularIndex.addOffset(commonToA,1,4);\n\n\t\t\tSquareEdge edgeB = common.edges[commonToB];\n\t\t\tif( edgeB != null && edgeB.destination(common) == b ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tfail(\"Failed\");\n\t}",
"private Path aStar(AStarNode start, AStarNode end) {\n\n\t/*pre-search setup*/\n astarSetup(end);\n AStarNode current = start;\n current.updateDist(0.0F);\n ArrayList<AStarNode> openSet = new ArrayList<>(getNodes().size());\n addNode(openSet, start);\n start.setFound(true);\n\n while (!openSet.isEmpty()) { // While there are nodes to evaluate\n if (current.equals(end)) // When reached the destination\n return createPath(start, end);\n openSet.remove(current); // Removes the node whose shortest distance from start position is determined\n current.setVisited(true); // marking the field that is added to closedSet\n \n for (AStarNode neighbor : current.getConnections()) { \n if (!neighbor.isVisited() && !neighbor.found()) { // if it is not seen before, add to open list\n addNode(openSet,neighbor);\n neighbor.setFound(true);\n neighbor.setPrevious(current);\n neighbor.setHeruistic(end);\n neighbor.updateDist(current.getDist() + current.getDistTo(neighbor));\n }\n else if(!neighbor.isVisited()){ //If seen before, update cost.\n double tempGScore = current.getDist() + current.getDistTo(neighbor);\n if (neighbor.getDist() > tempGScore) {\n neighbor.updateDist(tempGScore);\n neighbor.setPrevious(current);\n neighbor.setHeruistic(end);\n }\n }\n }\n current = getMinFScore(openSet); // setting next node as a node with minimum fScore.\n }\n\t\n\t/*If search ends without returning a path, there is no possible path.*/\n throw new PathFindingAlgorithm.AlgorithmFailureException();\n }",
"public CustomGraphSearch(boolean bInsertFront) {\n\tSystem.out.println(\"bInsertFront: \" + bInsertFront);\n\tinsertFront = bInsertFront;\n }",
"private Point[] d(Point[] left, Point[] right){\n\t\tif(left == null | right == null){\r\n\t\t\tif(left == null)\r\n\t\t\t\treturn right;\r\n\t\t\telse\r\n\t\t\t\treturn left;\r\n\t\t}\r\n\r\n\t\tdouble dLeft = Math.sqrt(Math.pow(left[0].getX()-left[1].getX(), 2) + Math.pow(left[0].getY()-left[1].getY(), 2));\r\n\t\tdouble dRight = Math.sqrt(Math.pow(right[0].getX()-right[1].getX(), 2) + Math.pow(right[0].getY()-right[1].getY(), 2));\r\n\t\t\r\n\t\tdouble minD = Math.min(dLeft, dRight);\r\n\t\tif(dLeft == minD)\r\n\t\t\treturn left;\r\n\t\telse \r\n\t\t\treturn right;\r\n\t}",
"public boolean breadthFirstSearch(int vertexA, int vertexB, HashMap<Integer, ArrayList<Integer>> adjMapList) {\n\t\tQueue<Integer> queue = new LinkedList<Integer>();\n\t\tHashSet<Integer> visited = new HashSet<Integer>();\n\t\tqueue.add(vertexA);\n\t\tvisited.add(vertexA);\n\t\twhile (!queue.isEmpty()) {\n\t\t\tInteger curr = queue.remove();\n\t\t\tif (curr == vertexB) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tArrayList<Integer> neighbors = adjMapList.get(curr);\n\t\t\tfor (Integer vertex : neighbors) {\n\t\t\t\tif (!visited.contains(vertex)) {\n\t\t\t\t\tvisited.add(vertex);\n\t\t\t\t\tqueue.add(vertex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"private static void breadthFirstSearch(int source, ArrayList<ArrayList<Integer>> nodes) {\n\t\tArrayList<ArrayList<Integer>> neighbours = nodes;\n\t\tQueue<Integer> queue= new LinkedList<Integer>();\n\t\t\n\t\tboolean[] visited = new boolean[nodes.size()];\n\t\t\n\t\tqueue.add(source);\n\t\tvisited[source]=true;\n\t\t\n\t\twhile(!queue.isEmpty()) {\n\t\t\tint k =queue.remove();\n\t\t\tSystem.out.println(k);\n\t\t\tfor(int p : nodes.get(k)) {\n\t\t\t\tif(!visited[p]) {\n\t\t\t\t\tqueue.add(p);\n\t\t\t\t\tvisited[p]=true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}",
"@Override\n public boolean link(T dataX, T dataY) throws NodeNotFoundException { return link(dataX, dataY, 1.0); }",
"private static void search(graph M, graph D, Tuple[] h){\n\t\tint v = M.V[0];\n\t\tint q = 0; //q keeps track of the index in the Tuple array where a new tuple is placed\n\t\tfor(; q < h.length && h[q] != null; q++){\n\t\t\t;\t\t\t\n\t\t}\n\t\tfor(int i = 0; i < D.V.length; i++){\n\t\t\tint w = D.V[i];\n\t\t \tTuple t = new Tuple(v, w);\n\t\t\th[q] = t; //add a new tuple\n\t\t\tboolean OK = true;\n\t\t\tfor (int k = 0; k < M.V.length; k++){\n\t\t\t\tboolean shouldBreak = false;\n\t\t\t\tfor (int j = 0; j < M.V.length; j++){\n\t\t\t\t\tif (M.matrix[M.V[k]][M.V[j]] == 0){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\tThis is part of the pseudo-code that I tried to incorporate\n\t\t\t\t\tI could not quite get it to work, I believe the problem is \n\t\t\t\t\tin the big if statement. Instead I wrote a different chunk of code\n\t\t\t\t\tthat determines in the th should be printed.\n\t\t\t\t\t*/\n// \t\t\t\t\tif ( (M.V[k] == v && searchH(M.V[j], h) != null) || (M.V[j] == v && searchH(M.V[k], h) != null) ){\n// \t\t\t\t\t\tif(D.matrix[searchH(M.V[k], h).y][searchH(M.V[j], h).y] == 0){\n// \t\t\t\t\t\t\tOK = false;\n// \t\t\t\t\t\t\tshouldBreak = true;\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}\n\t\t\t\tif(shouldBreak == true){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (OK == true){\n\t\t\t\tif(M.V.length == 1){\n\t\t\t\tboolean isGood = true;\n\t\t\t\t/*\n\t\t\t\tThis is what determines if h should be printed.\n\t\t\t\tEssentially it checks h against the adjacency matrices,\n\t\t\t\tand if the edges are present, it prints them out.\n\t\t\t\t*/\n\t\t\t\t\tfor(int g = 0; g < h.length && isGood == true; g++){\n\t\t\t\t\t\tfor(int f = g+1; f < h.length && isGood == true; f++){\n\t\t\t\t\t\t\tif(M.matrix[h[g].x][h[f].x] == 1 && D.matrix[h[g].y][h[f].y] == 0){\n\t\t\t\t\t\t\t\tisGood = false;\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(isGood == true){\n\t\t\t\t\t\tSystem.out.println(printH(h));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\tHere I rebuild the vertex arrays and attached them to a new graph\n\t\t\t\tfor use as an argument in the recursive call.\n\t\t\t\t*/\n\t\t\t\telse{\t\t\n\t\t\t\t\tint[] modelTemp = rebuildV(v, M.V);\n\t\t\t\t\tint[] dataTemp = rebuildV(D.V[i], D.V);\n\n\t\t\t\t\tTuple[] h2 = new Tuple[h.length];\n\t\t\t\t\tfor(int p = 0; p < h.length; p++){\n\t\t\t\t\t\th2[p] = h[p];\n\t\t\t\t\t}\n\t\t\t\t\tgraph M2 = new graph();\n\t\t\t\t\tgraph D2 = new graph();\n\t\t\t\t\t\n\t\t\t\t\tM2.V = modelTemp;\n\t\t\t\t\tD2.V = dataTemp;\n\t\t\t\t\tM2.matrix = M.matrix;\n\t\t\t\t\tD2.matrix = D.matrix;\n\t\t\t\t\t\n\t\t\t\t\t//recursive call\n\t\t\t\t\tsearch(M2, D2, h2);\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"BetweennessCentrality(UndirectedWeightedGraph graph, String nodeId) throws NotFoundNodeException {\r\n\r\n\t\t\r\n\t\tthis.nodeId = nodeId;\r\n\r\n\t\tif (!graph.containsNode(nodeId)) {\r\n\t\t\tthrow new NotFoundNodeException(graph, nodeId);\r\n\t\t}\r\n\t\t\r\n\t\tArrayList<String> nodeArrayList = new ArrayList<String>( graph.getNodeList().keySet() );\r\n\t\t\t\t\r\n\t\tShortestPathMatrix sMatrix = graph.getShortestPathMatrix();\r\n\r\n\t\tfor (int i = 0; i < nodeArrayList.size(); i++) {\r\n\t\t\t\r\n\t\t\tString startId = nodeArrayList.get(i);\r\n\t\t\tif (startId.equals(nodeId)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// for each end node, different from start node, nodeId\r\n\t\t\tfor (int j = i; j < nodeArrayList.size(); j++) {\r\n\t\t\t\tString endId = nodeArrayList.get(j);\r\n\t\t\t\tif (endId.equals(nodeId) ) {\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// find the number and the list of shortest path between 1st and 2nd node\r\n\t\t\t\tShortestPath shortestPath = sMatrix.getShortestPath(startId, endId);\r\n\t\t\t\tArrayList<ArrayList<String>> pathList = shortestPath.getPathList();\r\n\t\t\t\t\t\r\n\t\t\t\tint sigma1 = 0;\r\n\t\t\t\tint sigma2 = pathList.size(); \r\n\t\t\t\t\t\r\n\t\t\t\t// find the number of SP go through third node\r\n\t\t\t\tfor (ArrayList<String> path : pathList) {\r\n\t\t\t\t\tif (path.contains(nodeId)) {\r\n\t\t\t\t\t\tsigma1 += 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// add sigma1 / sigma2 into bcl\r\n\t\t\t\tbcm += ((double) sigma1 / sigma2);\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void checkEdgeExistance(Node a, Node b, int weight) {\n for (Edge edge : a.getEdges()) {\n if (edge.getSource() == a && edge.getDestination() == b) {\n edge.setWeight(weight);\n return;\n }\n }\n a.getEdges().add(new Edge(a, b, weight));\n }",
"void addDirectedEdge(final Node first, final Node second)\n {\n if ( first == second )\n {\n return;\n }\n else if (first.connectedNodes.contains(second))\n return;\n else\n first.connectedNodes.add(second);\n }",
"@Override\r\n public int compare(searchNode e1, searchNode e2) {\r\n //if node 1 has a a lower FScore than node 2, return -1 which will put e1 BEFORE e2\r\n if (e1.getFScore() < e2.getFScore()) {\r\n return -1;\r\n }\r\n //if node 1 has a higher FScore than node 2, return 1 which will put e2 BEFORE e1\r\n if (e1.getFScore() > e2.getFScore()) {\r\n return 1;\r\n }\r\n //else return they are same whichw ill keep order same\r\n return 0;\r\n }",
"public boolean dependentOn(PDGNode node1, PDGNode node2);",
"public ReferenceNode searchMatchNodeForDist(double[] data) {\n ReferenceNode node = nodeList.get(0);\n double distSqr = node.calculateDistanceSqrForLearning(data);\n ReferenceNode winningNode = node;\n double newDistSqr = 0.0d;\n for (int i = 1; i < nodeList.size(); i++) {\n node = nodeList.get(i);\n newDistSqr = node.calculateDistanceSqrForLearning(data);\n if (newDistSqr < distSqr) {\n winningNode = node;\n distSqr = newDistSqr;\n }\n }\n return winningNode;\n }",
"@Override\n public int test(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2) {\n // There are 6 possible edge orderings at a shared vertex (all\n // of these orderings are circular, i.e. abcd == bcda):\n //\n // (1) a2 b2 b0 a0: A contains B\n // (2) a2 a0 b0 b2: B contains A\n // (3) a2 a0 b2 b0: A and B are disjoint\n // (4) a2 b0 a0 b2: A and B intersect in one wedge\n // (5) a2 b2 a0 b0: A and B intersect in one wedge\n // (6) a2 b0 b2 a0: A and B intersect in two wedges\n //\n // In cases (4-6), the boundaries of A and B cross (i.e. the boundary\n // of A intersects the interior and exterior of B and vice versa).\n // Thus we want to distinguish cases (1), (2-3), and (4-6).\n //\n // Note that the vertices may satisfy more than one of the edge\n // orderings above if two or more vertices are the same. The tests\n // below are written so that we take the most favorable\n // interpretation, i.e. preferring (1) over (2-3) over (4-6). In\n // particular note that if orderedCCW(a,b,c,o) returns true, it may be\n // possible that orderedCCW(c,b,a,o) is also true (if a == b or b == c).\n\n if (orderedCCW(a0, a2, b2, ab1)) {\n // The cases with this vertex ordering are 1, 5, and 6,\n // although case 2 is also possible if a2 == b2.\n if (orderedCCW(b2, b0, a0, ab1)) {\n return 1; // Case 1 (A contains B)\n }\n\n // We are in case 5 or 6, or case 2 if a2 == b2.\n return (a2.equalsPoint(b2)) ? 0 : -1; // Case 2 vs. 5,6.\n }\n // We are in case 2, 3, or 4.\n return orderedCCW(a0, b0, a2, ab1) ? 0 : -1; // Case 2,3 vs. 4.\n }",
"private boolean isItThisNode(KdNode kdNode, Point2D p) {\n int comparison;\n\n if (kdNode == null) return false;\n if (kdNode.point.equals(p))\n return true;\n\n if (kdNode.dimension) { // if this KdNode is vertical (root.dimension == true)\n comparison = Double.compare(p.x(), kdNode.point.x());\n if (comparison == 0) comparison = Double.compare(p.y(), kdNode.point.y());\n }\n else { // if this KdNode is horizontal (root.dimension == false)\n comparison = Double.compare(p.y(), kdNode.point.y());\n if (comparison == 0) comparison = Double.compare(p.x(), kdNode.point.x());\n }\n\n if (comparison > 0) {\n if (kdNode.right == null) {\n // dead end when searching for where point should be, it is not in the set\n return false;\n }\n else {\n return isItThisNode(kdNode.right, p);\n }\n }\n else { // comparison < 0\n if (kdNode.left == null) {\n // dead end when searching for where point should be, it is not in the set\n return false;\n }\n else {\n return isItThisNode(kdNode.left, p);\n }\n }\n }",
"public int breadthFirstSearch(T srcId, T destId)\n {\n if (nodeList.isEmpty())\n {\n System.out.println(\"Empty graph\");\n return -1;\n }\n \n // queue used during the traversal\n LinkedList<QueueNode> queue = new LinkedList();\n \n // keeps track of node which are visited and added into the queue\n HashMap<T, Integer> visited = new HashMap();\n \n // find srcNode with id = srcId in graph\n GraphNode srcNode = nodeList.get(srcId);\n \n // if srcNode is not there in graph, breadth first traversal which starts at srcNode cannot be done \n if (srcNode == null)\n {\n System.out.println(\"Source vertex not found\");\n return -1;\n }\n \n int minNumberTrials = -1;\n \n // add srcNode in queue, mark it as visited\n queue.add(new QueueNode(srcNode, 0));\n visited.put(srcNode.nodeId, 1);\n \n while (!queue.isEmpty())\n {\n QueueNode currentNode = queue.remove();\n \n // if destination node found\n if (currentNode.graphNode.nodeId == destId)\n {\n minNumberTrials = currentNode.level;\n break;\n }\n \n // first neighbor of current graph node\n GraphNode neighbor = currentNode.graphNode.next;\n \n // add all neighbors of current graph node into the queue\n while (neighbor != null)\n {\n // if this neighbor is not visited earlier, mark it as visited\n // add it to the queue at appropriate level\n if (visited.get(neighbor.nodeId) == null)\n {\n visited.put(neighbor.nodeId, 1);\n queue.add(new QueueNode(findGraphNode(neighbor.nodeId), currentNode.level + 1));\n }\n neighbor = neighbor.next; \n }\n }\n \n return minNumberTrials;\n }",
"public boolean DijkstraHelp(int src, int dest) {\n PriorityQueue<Entry>queue=new PriorityQueue();//queue storages the nodes that we will visit by the minimum tag\n //WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n initializeTag();\n initializeInfo();\n node_info first=this.ga.getNode(src);\n first.setTag(0);//distance from itself=0\n queue.add(new Entry(first,first.getTag()));\n while(!queue.isEmpty()) {\n Entry pair=queue.poll();\n node_info current= pair.node;\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n Collection<node_info> listNeighbors = this.ga.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for(node_info n:Neighbors) {\n\n if(n.getTag()>ga.getEdge(n.getKey(),current.getKey())+current.getTag())\n {\n n.setTag(current.getTag() + ga.getEdge(n.getKey(), current.getKey()));//compute the new tag\n }\n queue.add(new Entry(n,n.getTag()));\n }\n }\n Iterator<node_info> it=this.ga.getV().iterator();\n while(it.hasNext()){\n if(it.next().getInfo()==null) return false;\n }\n return true;\n }",
"private static void disjkstraAlgorithm(Node sourceNode, GraphBuilder graph){\n PriorityQueue<Node> smallestDisQueue = new PriorityQueue<>(graph.nodeArr.size(), new Comparator<Node>() {\n @Override\n public int compare(Node first, Node sec) {\n if(first.distance == Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return 0;\n }\n else if(first.distance == Integer.MAX_VALUE && sec.distance != Integer.MAX_VALUE){\n return 1;\n } else if(first.distance != Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return -1;\n }\n else\n return (int) (first.distance - sec.distance);\n }\n });\n\n smallestDisQueue.add(sourceNode); //add the node to the queue\n\n // until all vertices are know get the vertex with smallest distance\n\n while(!smallestDisQueue.isEmpty()) {\n\n Node currNode = smallestDisQueue.poll();\n// System.out.println(\"Curr: \");\n// System.out.println(currNode);\n if(currNode.known)\n continue; //do nothing if the currNode is known\n\n currNode.known = true; // otherwise, set it to be known\n\n for(Edge connectedEdge : currNode.connectingEdges){\n Node nextNode = connectedEdge.head;\n if(!nextNode.known){ // Visit all neighbors that are unknown\n\n long weight = connectedEdge.weight;\n if(currNode.distance == Integer.MAX_VALUE){\n continue;\n }\n else if(nextNode.distance == Integer.MAX_VALUE && currNode.distance == Integer.MAX_VALUE) {\n continue;\n }\n\n else if(nextNode.distance> weight + currNode.distance){//Update their distance and path variable\n smallestDisQueue.remove(nextNode); //remove it from the queue\n nextNode.distance = weight + currNode.distance;\n\n smallestDisQueue.add(nextNode); //add it again to the queue\n nextNode.pathFromSouce = currNode;\n\n// System.out.println(\"Next: \");\n// System.out.println(nextNode);\n }\n }\n }\n// System.out.println(\"/////////////\");\n }\n }",
"public static Vector<int []> BFS(int[] startPosition,int[] unexploreNode, mapNode[][] nodes){\n\t\t\r\n\t\tVector<int []> shortestPath;\r\n\t\t\r\n\t\t//initial all nodes' status to UN-visited\r\n\t\tfor(int i = 0; i < nodes.length; i++)\r\n\t\t{\r\n\t\t\tfor(int j = 0; j < nodes[i].length;j++)\r\n\t\t\t{\r\n\t\t\t\tnodes[i][j].setTotDistance(999999999);//set the initial distance to INF\r\n\t\t\t\tnodes[i][j].gridPosition[0] = i;//save current node x position\r\n\t\t\t\tnodes[i][j].gridPosition[1] = j;//save current node y position\r\n\t\t\t\tnodes[i][j].setNodeVistied(false);//set all nodes are not visited yet\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//create start node and add it into the execution queue\r\n\t\tmapNode tempNode = new mapNode();\r\n\t\ttempNode = nodes[startPosition[0]][startPosition[1]];\r\n\t\tVector<mapNode> tempQueue = new Vector<mapNode>();\r\n\t\ttempQueue.add(tempNode);\r\n\t\t//main loop: check all nodes on the map\r\n\t\twhile(tempQueue.size() != 0)\r\n\t\t{\r\n\t\t\t//create four nearby nodes\r\n\t\t\tmapNode tempTopNode = new mapNode();\r\n\t\t\tmapNode tempBottomNode = new mapNode();\r\n\t\t\tmapNode tempLeftNode = new mapNode();\r\n\t\t\tmapNode tempRightNode = new mapNode();\r\n\t\t\t\t\r\n\t\t\t//update Top node information from original nodes matrix\r\n\t\t\tif(tempQueue.get(0).topNode != null)\r\n\t\t\t{\r\n\t\t\t\ttempTopNode = nodes[tempQueue.get(0).topNode.gridPosition[0]][tempQueue.get(0).topNode.gridPosition[1]];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttempTopNode = null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//update Bottom node information from original nodes matrix\r\n\t\t\tif(tempQueue.get(0).bottomNode != null)\r\n\t\t\t{\r\n\t\t\t\ttempBottomNode = nodes[tempQueue.get(0).bottomNode.gridPosition[0]][tempQueue.get(0).bottomNode.gridPosition[1]];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttempBottomNode = null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//update Left node information from original nodes matrix\r\n\t\t\tif(tempQueue.get(0).leftNode != null)\r\n\t\t\t{\r\n\t\t\t\ttempLeftNode = nodes[tempQueue.get(0).leftNode.gridPosition[0]][tempQueue.get(0).leftNode.gridPosition[1]];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttempLeftNode = null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//update Right node information from original nodes matrix\r\n\t\t\tif(tempQueue.get(0).rightNode != null)\r\n\t\t\t{\r\n\t\t\t\ttempRightNode = nodes[tempQueue.get(0).rightNode.gridPosition[0]][tempQueue.get(0).rightNode.gridPosition[1]];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttempRightNode = null;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t//start re-calculate distance of each node\r\n\t\t\t//check the top node and update new distance\r\n\t\t\tif(tempTopNode != null)\r\n\t\t\t{\r\n\t\t\t\tif(tempTopNode.getNodeVisited() == false && tempTopNode.getOwnElevation() != 999999999 && tempTopNode.getStatus() != Status.EXPLORED )\r\n\t\t\t\t{\r\n\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t//record the path\r\n\t\t\t\t\tfor(int m = 0; m < tempQueue.get(0).getTotPath().size(); m++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\ttempXY = tempQueue.get(0).getTotPath().get(m);\r\n\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//check new node to see if exists in path\r\n\t\t\t\t\tif(checkPositionInPath(tempPath, tempQueue.get(0).gridPosition[0], tempQueue.get(0).gridPosition[1]) == false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\ttempXY2 = tempQueue.get(0).gridPosition;\r\n\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\ttempTopNode.setTotPath(tempPath);\r\n\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\ttempTopNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\tnodes[tempTopNode.gridPosition[0]][tempTopNode.gridPosition[1]] = tempTopNode;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(tempTopNode.gridPosition[0] == unexploreNode[0] && tempTopNode.gridPosition[1] == unexploreNode[1]){\r\n\t\t\t\t\t//print out the end node\r\n\t\t\t\t\t//print out the total distance between two points\r\n\t\t\t\t\t//print out the total number node of path\r\n\t\t\t\t\t//System.out.println(\"End Point: \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[0]+1)+\" \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[1]+1));\r\n\t\t\t\t\t//System.out.println(\"Total Distance: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotDistance());\r\n\t\t\t\t\t//System.out.println(\"Total number of nodes: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotPath().size());\r\n\t\t\t\t\tshortestPath = nodes[unexploreNode[0]][unexploreNode[1]].getTotPath();\r\n\t\t\t\t\tshortestPath.add(unexploreNode);\r\n\t\t\t\t\treturn shortestPath;\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(nodes[tempTopNode.gridPosition[0]][tempTopNode.gridPosition[1]].getNodeVisited()== false && checkNodeInQueue(tempQueue, tempTopNode.gridPosition[0], tempTopNode.gridPosition[1]) == false && tempTopNode.getOwnElevation() != 999999999)\r\n\t\t\t\t{\r\n\t\t\t\t\t//check un-visited nodes and add new node into execution queue\r\n\t\t\t\t\ttempQueue.add(tempTopNode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//check the bottom node and update new distance\r\n\t\t\tif(tempBottomNode != null)\r\n\t\t\t{\r\n\t\t\t\tif(tempBottomNode.getNodeVisited() == false && tempBottomNode.getOwnElevation() != 999999999 && tempBottomNode.getStatus() != Status.EXPLORED)\r\n\t\t\t\t{\r\n\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t//record the path\r\n\t\t\t\t\tfor(int m = 0; m < tempQueue.get(0).getTotPath().size(); m++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\ttempXY = tempQueue.get(0).getTotPath().get(m);\r\n\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//check new node to see if it exists in path\r\n\t\t\t\t\tif(checkPositionInPath(tempPath, tempQueue.get(0).gridPosition[0], tempQueue.get(0).gridPosition[1]) == false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\ttempXY2 = tempQueue.get(0).gridPosition;\r\n\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\ttempBottomNode.setTotPath(tempPath);\r\n\t\t\t\t\ttempBottomNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\tnodes[tempQueue.get(0).bottomNode.gridPosition[0]][tempQueue.get(0).bottomNode.gridPosition[1]] = tempBottomNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(tempBottomNode.gridPosition[0] == unexploreNode[0] && tempBottomNode.gridPosition[1] == unexploreNode[1]){\r\n\t\t\t\t\t//System.out.println(\"End Point: \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[0]+1)+\" \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[1]+1));\r\n\t\t\t\t\t//System.out.println(\"Total Distance: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotDistance());\r\n\t\t\t\t\t//System.out.println(\"Total number of nodes: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotPath().size());\r\n\t\t\t\t\tshortestPath = nodes[unexploreNode[0]][unexploreNode[1]].getTotPath();\r\n\t\t\t\t\tshortestPath.add(unexploreNode);\r\n\t\t\t\t\treturn shortestPath;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(nodes[tempBottomNode.gridPosition[0]][tempBottomNode.gridPosition[1]].getNodeVisited()== false && checkNodeInQueue(tempQueue, tempBottomNode.gridPosition[0], tempBottomNode.gridPosition[1]) == false && tempBottomNode.getOwnElevation() != 999999999)\r\n\t\t\t\t{\r\n\t\t\t\t\t//check un-visited nodes and add new node into execution queue\r\n\t\t\t\t\ttempQueue.add(tempBottomNode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//check the left node and update new distance\r\n\t\t\tif(tempLeftNode != null)\r\n\t\t\t{\r\n\t\t\t\tif(tempLeftNode.getNodeVisited() == false && tempLeftNode.getOwnElevation() != 999999999 && tempLeftNode.getStatus() != Status.EXPLORED)\r\n\t\t\t\t{\r\n\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t//record the path\r\n\t\t\t\t\tfor(int m = 0; m < tempQueue.get(0).getTotPath().size(); m++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\ttempXY = tempQueue.get(0).getTotPath().get(m);\r\n\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//check new node to see if it exists in path\r\n\t\t\t\t\tif(checkPositionInPath(tempPath, tempQueue.get(0).gridPosition[0], tempQueue.get(0).gridPosition[1]) == false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\ttempXY2 = tempQueue.get(0).gridPosition;\r\n\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\ttempLeftNode.setTotPath(tempPath);\r\n\t\t\t\t\ttempLeftNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\tnodes[tempQueue.get(0).leftNode.gridPosition[0]][tempQueue.get(0).leftNode.gridPosition[1]] = tempLeftNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(tempLeftNode.gridPosition[0] == unexploreNode[0] && tempLeftNode.gridPosition[1] == unexploreNode[1]){\r\n\t\t\t\t\t//System.out.println(\"End Point: \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[0]+1)+\" \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[1]+1));\r\n\t\t\t\t\t//System.out.println(\"Total Distance: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotDistance());\r\n\t\t\t\t\t//System.out.println(\"Total number of nodes: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotPath().size());\r\n\t\t\t\t\tshortestPath = nodes[unexploreNode[0]][unexploreNode[1]].getTotPath();\r\n\t\t\t\t\tshortestPath.add(unexploreNode);\r\n\t\t\t\t\treturn shortestPath;\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(nodes[tempLeftNode.gridPosition[0]][tempLeftNode.gridPosition[1]].getNodeVisited()== false && checkNodeInQueue(tempQueue, tempLeftNode.gridPosition[0], tempLeftNode.gridPosition[1]) == false && tempLeftNode.getOwnElevation() != 999999999)\r\n\t\t\t\t{\r\n\t\t\t\t\t//check un-visited nodes and add new node into execution queue\r\n\t\t\t\t\ttempQueue.add(tempLeftNode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//check the right node and update new distance\r\n\t\t\tif(tempRightNode != null)\r\n\t\t\t{\r\n\t\t\t\tif(tempRightNode.getNodeVisited() == false && tempRightNode.getOwnElevation() != 999999999 && tempRightNode.getStatus() != Status.EXPLORED)\r\n\t\t\t\t{\r\n\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t//record the path\r\n\t\t\t\t\tfor(int m = 0; m < tempQueue.get(0).getTotPath().size(); m++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\ttempXY = tempQueue.get(0).getTotPath().get(m);\r\n\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//check to see if new node existed in path\r\n\t\t\t\t\tif(checkPositionInPath(tempPath, tempQueue.get(0).gridPosition[0], tempQueue.get(0).gridPosition[1]) == false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\ttempXY2 = tempQueue.get(0).gridPosition;\r\n\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\ttempRightNode.setTotPath(tempPath);\r\n\t\t\t\t\ttempRightNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\tnodes[tempQueue.get(0).rightNode.gridPosition[0]][tempQueue.get(0).rightNode.gridPosition[1]] = tempRightNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(tempRightNode.gridPosition[0] == unexploreNode[0] && tempRightNode.gridPosition[1] == unexploreNode[1]){\r\n\t\t\t\t\t//System.out.println(\"End Point: \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[0]+1)+\" \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[1]+1));\r\n\t\t\t\t\t//System.out.println(\"Total Distance: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotDistance());\r\n\t\t\t\t\t//System.out.println(\"Total number of nodes: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotPath().size());\r\n\t\t\t\t\tshortestPath = nodes[unexploreNode[0]][unexploreNode[1]].getTotPath();\r\n\t\t\t\t\tshortestPath.add(unexploreNode);\r\n\t\t\t\t\treturn shortestPath;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(nodes[tempRightNode.gridPosition[0]][tempRightNode.gridPosition[1]].getNodeVisited()== false && checkNodeInQueue(tempQueue, tempRightNode.gridPosition[0], tempRightNode.gridPosition[1]) == false && tempRightNode.getOwnElevation() != 999999999)\r\n\t\t\t\t{\r\n\t\t\t\t\t//check un-visited nodes and add new node into execution queue\r\n\t\t\t\t\ttempQueue.add(tempRightNode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//set current node to visited node and\r\n\t\t\t//remove current node from execution queue\r\n\t\t\ttempQueue.get(0).setNodeVistied(true);\r\n\t\t\tnodes[tempQueue.get(0).gridPosition[0]][tempQueue.get(0).gridPosition[1]].setNodeVistied(true);\r\n\t\t\ttempQueue.remove(0);\t\r\n\t\t}\r\n\t\t//print out the end node\r\n\t\t//print out the total distance between two points\r\n\t\t//print out the total number node of path\r\n\t\tSystem.out.println(\"End 5 Point: \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[0]+1)+\" \"+(nodes[unexploreNode[0]][unexploreNode[1]].gridPosition[1]+1));\r\n\t\tSystem.out.println(\"Total Distance: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotDistance());\r\n\t\tSystem.out.println(\"Total number of nodes: \"+nodes[unexploreNode[0]][unexploreNode[1]].getTotPath().size());\r\n\t\tshortestPath = nodes[unexploreNode[0]][unexploreNode[1]].getTotPath();\r\n\t\tshortestPath.add(unexploreNode);\r\n\t\treturn shortestPath;\t\t\r\n\t}",
"private void dijkstra(final NavigableSet<Node> queue) {\n Node firstNode, neighbor;\n while (!queue.isEmpty()) {\n // vertex with shortest distance (first iteration will return source)\n firstNode = queue.pollFirst();\n assert firstNode != null;\n if (!explored.contains(firstNode.coordinate)) {\n explored.add(firstNode.coordinate);\n }\n if (firstNode.dist == Integer.MAX_VALUE)\n // we can ignore u (and any other remaining vertices) since they are unreachable\n break;\n //look at distances to each neighbour\n for (Map.Entry<Node, Integer> temp : firstNode.neighbours.entrySet()) {\n neighbor = temp.getKey(); //the neighbour in this iteration\n if (!explored.contains(neighbor.coordinate)) {\n explored.add(neighbor.coordinate);\n }\n final int alternateDist = firstNode.dist + temp.getValue();\n if (alternateDist < neighbor.dist) { // shorter path to neighbour found\n queue.remove(neighbor);\n neighbor.dist = alternateDist;\n neighbor.previous = firstNode;\n queue.add(neighbor);\n }\n }\n }\n }",
"public final void connectIfNotFound(N n1, E edge, N n2) {\n if (!isConnected(n1, edge, n2)) {\n connect(n1, edge, n2);\n }\n }",
"public static void main(String[] args) {\n int[] listA = {4,1,8,4,5};\n int[] listB = {5,0,1,8,4,5};\n int intersectVal = 8;\n int skipA = 2, skipB = 3;\n ListNode headA = new ListNode(listA[0]);\n ListNode headB = new ListNode(listB[0]);\n ListNode nodeA = headA;\n for (int i = 1; i < skipA; i++) {\n nodeA.next = new ListNode(listA[i]);\n nodeA = nodeA.next;\n }\n ListNode nodeB = headB;\n for (int i = 1; i < skipB; i++) {\n nodeB.next = new ListNode(listB[i]);\n nodeB = nodeB.next;\n }\n\n nodeA.next = new ListNode(listA[skipA]);\n nodeB.next = nodeA.next;\n nodeA = nodeA.next;\n for (int i = skipA + 1; i < listA.length; i++) {\n nodeA.next = new ListNode(listA[i]);\n nodeA = nodeA.next;\n }\n\n\n ListNode intersectionNode = getIntersectionNode(headA, headB);\n System.out.println(intersectionNode.val);\n }",
"private void buildPath( PriorityQueue<SearchNode<T>> nodes ) {\n\t\tNode<T> v;\n\t\tSearchNode<T> su, sv;\n\t\tWeightedEdge<T> we;\n\n\t\twhile ( ! nodes.isEmpty() ) { // while Q is not empty:\n\t\t\tsu = nodes.poll(); // u = Q.min()\n\t\t\tif ( su.isUnreachable() ) { break; } //\n\n\t\t\tfor ( Edge<T> edge : su.getEdges() ) { // for each\n\t\t\t\twe = (WeightedEdge<T>)edge; //\n\t\t\t\tv = we.getOtherNode( su.getNode() ); // neighbor v of u\n\t\t\t\tsv = getSearchNode( v ); //\n\t\t\t\tint uToV = su.getDistance() + we.getWeight();// alt = dist[u] + length(u, v)\n\t\t\t\tif (uToV < sv.getDistance() ) { // if alt < dist[v]\n\t\t\t\t\tnodes.remove( sv ); // ( force recalc )\n\t\t\t\t\tsv.setDistance( uToV ); // dist[v] <- alt\n\t\t\t\t\tsv.setPrevious( su.getNode() ); // prev[v] <- u\n\t\t\t\t\tnodes.add( sv ); // Q.decrease_priority(v, alt) (dist recalc)\n\t\t\t\t} // end if\n\t\t\t} // end for\n\t\t} // end while\n\t}",
"@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }",
"private void findIntersection(Node head1, Node head2) {\n if (head1 == null || head2 == null) {\n System.out.println(\"No intersection found\");\n return;\n }\n Set<Node> set = new HashSet<Node>();\n boolean flag = false;\n\n for (Node temp = head1; temp != null; temp = temp.next)\n set.add(temp);\n for (Node temp = head2; temp != null; temp = temp.next)\n if (!set.add(temp)) {\n System.out.println(\"Intersection found at \" + temp.data);\n flag = true;\n break;\n }\n if (!flag) {\n System.out.println(\"No intersection found\");\n }\n }",
"public void recordNodeDistances(Node start, Node end)\n {\n HashSet<Node> inStack = new HashSet<Node>();\n LinkedList<Node> nodeStack = new LinkedList<Node>();\n\n nodeStack.push(start);\n\n Node curNode;\n\n while(!nodeStack.isEmpty())\n {\n //shortest distance from end to start = shortest distance of neighbor to start\n curNode = nodeStack.peekFirst();\n Collection<? extends Node> neighbors = curNode.getNeighbors();\n\n if(curNode == end) //if we've reached the end\n {\n nodeDists.put(curNode, 0); //the distance to the end is 0 (obviously)\n\n inStack.remove(curNode); //remove from our store of nodes that are in the stack\n nodeStack.removeFirst();\n }\n else\n {\n boolean readyForEval = true; //is node ready to have the min distance calculated?\n\n for (Node n : neighbors)\n {\n if (!nodeDists.containsKey(n) && !inStack.contains(n))\n {\n nodeStack.addFirst(n); //in order to calculate the min distance to target any neighbors not in\n inStack.add(n); //the stack must have already been calculated. Neighbors still in the stack\n //are to be considered closer to the source and, thus, \"behind\" curNode\n readyForEval = false;\n }\n }\n\n if (readyForEval)\n {\n int minDist = getMinDist(curNode); //get the minimum distance from this node to the target\n\n nodeDists.put(curNode, minDist); //if unreachable, distance is maxValue\n nodeStack.removeFirst();\n inStack.remove(curNode);\n }\n }\n }\n }",
"private void checkTargetsReachable(){\n\t\tPathfinder pathfinder = new Pathfinder(collisionMatrix);\n\t\tLinkedList<Node> removeList = new LinkedList<Node>();\n\t\tboolean pathWasFound = false;\n\t\tLinkedList<Node> currentPath;\n\t\tLinkedList<Node> reversePath;\n\t\t\n\t\t//Go through all starting positions\n\t\tfor(LinkedList<Node> startList : targets){\n\t\t\tprogress += 8;\n\t\t\tsetProgress(progress);\n\t\t\tfor(Node startNode : startList){\n\t\t\t\t\n\t\t\t\tboolean outsideMap = (startNode.getCollisionXPos(scaleCollision) < 0 || startNode.getCollisionXPos(scaleCollision) >= (collisionMatrix.length-1) || startNode.getCollisionYPos(scaleCollision) < 0 || startNode.getCollisionYPos(scaleCollision) >= (collisionMatrix.length-1));\n\t\t\t\t\n\t\t\t\tpathWasFound = false;\n\t\t\t\t//Make sure that target is inside of map\n\t\t\t\tif(!outsideMap){\n\t\t\t\t\t//Check against all target positions\n\t\t\t\t\tfor(LinkedList<Node> targetList : targets){\n\t\t\t\t\t\tfor(Node targetNode : targetList){\n\t\t\t\t\t\t\t//Only check against targets that have not already been marked as unreachable\n\t\t\t\t\t\t\tboolean selfCheck = (targetNode.getXPos() != startNode.getXPos() || targetNode.getYPos() != startNode.getYPos());\n\t\t\t\t\t\t\tif(!removeList.contains(targetNode) && selfCheck){\n\t\t\t\t\t\t\t\t//Check if this path has already been checked\n\t\t\t\t\t\t\t\tif(!preCalculatedPaths.containsKey(startNode.toStringCollision(scaleCollision) + \"-\" + targetNode.toStringCollision(scaleCollision))){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tcurrentPath = new LinkedList<Node>();\n\t\t\t\t\t\t\t\t\t//Check if a path can be found for this start and target node\n\t\t\t\t\t\t\t\t\tif(pathfinder.findPath(startNode.getCollisionXPos(scaleCollision), startNode.getCollisionYPos(scaleCollision), targetNode.getCollisionXPos(scaleCollision), targetNode.getCollisionYPos(scaleCollision), currentPath)){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(Frame.USE_PRECALCULATED_PATHS)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tpreCalculatedPaths.put(startNode.toStringCollision(scaleCollision) + \"-\" + targetNode.toStringCollision(scaleCollision), currentPath);\n\t\t\t\t\t\t\t\t\t\t\treversePath = new LinkedList<Node>();\n\t\t\t\t\t\t\t\t\t\t\treversePath.addAll(currentPath);\n\t\t\t\t\t\t\t\t\t\t\tCollections.reverse(reversePath);\n\t\t\t\t\t\t\t\t\t\t\treversePath.removeFirst();\n\t\t\t\t\t\t\t\t\t\t\treversePath.add(startNode);\n\t\t\t\t\t\t\t\t\t\t\tpreCalculatedPaths.put(targetNode.toStringCollision(scaleCollision) + \"-\" + startNode.toStringCollision(scaleCollision) ,reversePath);\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\tpathWasFound = true;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tpathWasFound = true;\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}\n\t\t\t\t//Remove nodes which we cannot find a path from\n\t\t\t\tif(!pathWasFound){\n\t\t\t\t\tremoveList.add(startNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Go through the remove list and remove unreachable nodes\n\t\tfor(Node node : removeList){\n\t\t\tfor(LinkedList<Node> startList : targets){\n\t\t\t\tstartList.remove(node);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public boolean addConnection(String firstNodeName, String secondNodeName) throws NodeException {\n\n try {\n if (containsNode(getSingleNode(firstNodeName)) && containsNode(getSingleNode(secondNodeName))) {\n getSingleNode(firstNodeName).newNeighbour(getSingleNode(secondNodeName));\n getSingleNode(secondNodeName).newNeighbour(getSingleNode(firstNodeName));\n return true;\n }\n } catch (NodeException e) {\n throw new NodeException(\"Jeden z Vámi zadaných prvků neexistuje!\");\n }\n\n return false;\n }",
"boolean isConnected(int a, int b) {\n\t\tint nodea = getRoot(a); //logN\r\n\t\tint nodeb = getRoot(b); //logN\r\n\t\tSystem.out\r\n\t\t\t\t.println(a + \" and \" + b + \" CONNECTED?: \" + (nodea == nodeb));\r\n\t\treturn nodea == nodeb;\r\n\t}",
"void DFSearch(BFSNode n){\n\t\tn.discovered=true;\r\n\t\tSystem.out.print(\" discovered\");\r\n\t\tn.preProcessNode();\r\n\t\tfor( Integer edg: n.edges){\r\n\t\t\tn.processEdge(edg);\r\n\t\t\tif(!nodes[edg].discovered){\r\n\t\t\t\tnodes[edg].parent = n; \r\n\t\t\t\tnodes[edg].depth = n.depth +1;\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.print(\"{new track with parent [\"+ nodes[edg].parent.value+\"] }\");\r\n\t\t\t\tDFSearch(nodes[edg]);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(nodes[edg] != n.parent){\r\n\t\t\t\t\tSystem.out.print(\"{LOOP}\");\r\n\t\t\t\t\tif(nodes[edg].depth < n.reachableLimit.depth){\r\n\t\t\t\t\t\tn.reachableLimit = nodes[edg];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.print(\"{second visit}\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"back from node [ \"+n.value +\" ]\");\r\n\t\tn.postProcessNode();\r\n\t\tn.processed = true;\r\n\t\t\r\n\t}",
"public ListNode getIntersectionNode(ListNode headA, ListNode headB) {\n \n ListNode first = headA;\n ListNode second = headB;\n \n //iterate till both pointer point to null\n while(first != null || second != null){\n if(first == null)\n headB = headB.next;\n else\n first = first.next;\n \n if(second == null)\n headA= headA.next;\n else\n second = second.next;\n } \n while(headA != headB){\n headB = headB.next;\n headA= headA.next;\n }\n \n return headA;\n }",
"@Test\n public void notConnectedDueToRestrictions() {\n int sourceNorth = graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int sourceSouth = graph.edge(0, 3).setDistance(2).set(speedEnc, 10, 10).getEdge();\n int targetNorth = graph.edge(1, 2).setDistance(3).set(speedEnc, 10, 10).getEdge();\n int targetSouth = graph.edge(3, 2).setDistance(4).set(speedEnc, 10, 10).getEdge();\n\n assertPath(calcPath(0, 2, sourceNorth, targetNorth), 0.4, 4, 400, nodes(0, 1, 2));\n assertNotFound(calcPath(0, 2, sourceNorth, targetSouth));\n assertNotFound(calcPath(0, 2, sourceSouth, targetNorth));\n assertPath(calcPath(0, 2, sourceSouth, targetSouth), 0.6, 6, 600, nodes(0, 3, 2));\n }",
"public boolean esDeterministico(){\n NodoA x, y;\n x = primerElemento();\n y = x.getLigaDer();\n boolean bandera = true;\n while(x != cabeza){\n while(y != cabeza){\n if(y.getSimbolo().equals( x.getSimbolo())){\n \n if(!listaND.contains(x)){\n listaND.add(x);\n }\n \n bandera= false;\n }\n y = y.getLigaDer();\n }\n \n x = x.getLigaDer();\n y = x.getLigaDer();\n \n \n }\n \n return bandera;\n \n }",
"private void breadthFirstSearch (int start, int[] visited, int[] parent){\r\n Queue< Integer > theQueue = new LinkedList< Integer >();\r\n boolean[] identified = new boolean[getNumV()];\r\n identified[start] = true;\r\n theQueue.offer(start);\r\n while (!theQueue.isEmpty()) {\r\n int current = theQueue.remove();\r\n visited[current] = 1; //ziyaret edilmis vertexler queuedan cikarilan vertexlerdir\r\n Iterator < Edge > itr = edgeIterator(current);\r\n while (itr.hasNext()) {\r\n Edge edge = itr.next();\r\n int neighbor = edge.getDest();\r\n if (!identified[neighbor]) {\r\n identified[neighbor] = true;\r\n theQueue.offer(neighbor);\r\n parent[neighbor] = current;\r\n }\r\n }\r\n }\r\n }",
"void dijkstra(int strtval){\n PriorityQueue<Integer> pq = new PriorityQueue<>(new Comparator<Integer>(){\n @Override\n public int compare(Integer i1, Integer i2){\n Node n1 = dlist.get(i1);\n Node n2 = dlist.get(i2);\n return n1.getDist() > n2.getDist()?1 : n1.getDist() < n2.getDist()? -1:0;\n }\n });\n\n Node stnode = dlist.get(strtval);\n stnode.setval(strtval);\n stnode.setDist(0);\n seen.add(strtval);\n pq.add(strtval);\n while(!pq.isEmpty()){\n strtval = pq.poll();\n LinkedList<Node> alist = grp.getOrDefault(strtval, null);\n if(alist != null){\n for(Node node : alist){\n //see distance and then decide if needs to be added to qu is not seen.\n int nval = node.getval();\n int nweg = node.getDist();\n int ddist = dlist.get(nval).getDist();\n int odist = dlist.get(strtval).getDist();\n if(ddist > odist+nweg){\n dlist.get(nval).setval(strtval);\n dlist.get(nval).setDist(odist+nweg);\n }\n //if alerady seen do not cal the distance again.\n if(!seen.contains(nval)){\n seen.add(nval);\n pq.add(nval);\n }\n }\n }\n }\n //print here:\n for(int key: dlist.keySet()){\n System.out.println(key+\" dist:\"+dlist.get(key).getDist()+\" prev:\"+dlist.get(key).getval());\n }\n }",
"private static void commonNodesBSTFind(Node r1, Node r2)\n {\n if(r1 == null || r2==null)\n return;\n commonNodesBSTFind(r1.left, r2);\n findNode(r2,r1.data);\n commonNodesBSTFind(r1.right,r2);\n }",
"void BFS(int s, int d) \r\n { \r\n int source = s;\r\n int destination = d;\r\n boolean visited[] = new boolean[V];\r\n int parent[] = new int[V];\r\n \r\n // Create a queue for BFS \r\n LinkedList<Integer> queue = new LinkedList<Integer>(); \r\n \r\n // Mark the current node as visited and enqueue it \r\n \r\n visited[s]=true; \r\n queue.add(s); \r\n System.out.println(\"Search Nodes: \");\r\n while (queue.size() != 0) \r\n { \r\n int index = 0;\r\n \r\n // Dequeue a vertex from queue and print it \r\n \r\n s = queue.poll();\r\n \r\n System.out.print(convert2(s)); \r\n \r\n if(s == destination)\r\n {\r\n break;\r\n }\r\n \r\n System.out.print(\" -> \");\r\n while(index < adj[s].size()) \r\n { \r\n \r\n \r\n int n = adj[s].get(index); \r\n if (!visited[n]) \r\n { \r\n visited[n] = true;\r\n parent[n] = s;\r\n queue.add(n); \r\n }\r\n index = index+ 2;\r\n \r\n \r\n }\r\n \r\n \r\n \r\n }\r\n int check = destination;\r\n int cost = 0, first, second = 0;\r\n String string = \"\" + convert2(check);\r\n while(check!=source)\r\n {\r\n \r\n first = parent[check];\r\n string = convert2(first) + \" -> \" + string;\r\n while(adj[first].get(second) != check)\r\n {\r\n second++;\r\n }\r\n cost = cost + adj[first].get(second +1);\r\n check = first;\r\n second = 0;\r\n \r\n }\r\n \r\n System.out.println(\"\\n\\nPathway: \");\r\n \r\n System.out.println(string);\r\n \r\n \r\n System.out.println(\"\\nTotal cost: \" + cost);\r\n }",
"@Override\n\tpublic boolean addToFrontier(PuzzleState aState) {\n\t\t\n\t\tif(Searched.contains(aState)) {\n\t\t\treturn false;\n\t\t}\n\t\telse if (Frontier.contains(aState)) {\n\t\t\tfor(PuzzleState n : Frontier) {\n\t\t\t\tif(n.getEvaluationFunction() <= aState.getEvaluationFunction())\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tFrontier.add(aState);\n\t\treturn true;\n\t}",
"@Override\n public int test(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2) {\n // For A not to intersect B (where each loop interior is defined to be\n // its left side), the CCW edge order around ab1 must be a0 b2 b0 a2.\n // Note that it's important to write these conditions as negatives\n // (!OrderedCCW(a,b,c,o) rather than Ordered(c,b,a,o)) to get correct\n // results when two vertices are the same.\n return (orderedCCW(a0, b2, b0, ab1) && orderedCCW(b0, a2, a0, ab1) ? 0 : -1);\n }",
"public List<GeographicPoint> aStarSearch(GeographicPoint start, \n\t\t\t\t\t\t\t\t\t\t\t GeographicPoint goal, Consumer<GeographicPoint> nodeSearched)\n\t{\n\t\t// TODO: Implement this method in WEEK 4\n\t\t\n\t\t// Hook for visualization. See writeup.\n\t\t//nodeSearched.accept(next.getLocation());\n\t\tSet<GeographicPoint> visited = new HashSet<GeographicPoint>();\n\t\tPriorityQueue<MapNode> queue = new PriorityQueue<MapNode>(numVertices, new AStarComparator());\n\t\tHashMap<GeographicPoint, List<GeographicPoint>> path = new HashMap<GeographicPoint, List<GeographicPoint>>();\n\t\tint count = 0;\n\t\t\n\t\tif (!map.containsKey(start) || !map.containsKey(goal))\n\t\t\treturn null;\n\t\t\n\t\tfor (GeographicPoint temp : map.keySet())\n\t\t\tpath.put(temp, new ArrayList<GeographicPoint>());\n\t\t\n\t\tMapNode startNode = map.get(start);\n\t\tstartNode.setTimeToStart(0.0);\n\t\tstartNode.setPredictedTime(0.0);\n\t\tstartNode.setDistanceToStart(0.0);\n\t\tstartNode.setPredictedDistance(0.0);\n\t\tqueue.add(startNode);\n\t\t\n\t\twhile (!queue.isEmpty()) {\n\t\t\tMapNode currNode = queue.poll();\n\t\t\tnodeSearched.accept(currNode.getLocation());\n\t\t\t\n\t\t\tif (!visited.contains(currNode.getLocation())) {\n\t\t\t\tvisited.add(currNode.getLocation());\n\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\tif (currNode.getLocation().equals(goal))\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tHashMap<MapEdge, GeographicPoint> neighbours = currNode.getNeighbours();\n\t\t\t\tfor (MapEdge edge : neighbours.keySet()) {\n\t\t\t\t\tif (!visited.contains(edge.getEnd())) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tMapNode addNode = map.get(neighbours.get(edge));\n\t\t\t\t\t\tdouble tempPath = currNode.getDistanceToStart() + edge.getDistance();\n\t\t\t\t\t\tdouble tempTime = currNode.getTimeToStart() + ((edge.getDistance())/(edge.getSpeedLimit()));\n\n\t\t\t\t\t\tif (tempTime < addNode.getPredictedTime()) {\n\n\t\t\t\t\t\t\taddNode.setDistanceToStart(tempPath);\n\t\t\t\t\t\t\taddNode.setTimeToStart(tempTime);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble predict = tempPath + edge.getEnd().distance(goal);\n\n\t\t\t\t\t\t\taddNode.setPredictedDistance(predict);\n\t\t\t\t\t\t\taddNode.setPredictedTime(predict/edge.getSpeedLimit());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tqueue.add(addNode);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tList<GeographicPoint> temp = path.get(neighbours.get(edge));\n\t\t\t\t\t\t\ttemp.add(currNode.getLocation());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Astarsearch: \" + count);\n\t\treturn backTrack(path,goal);\n\t}",
"public static Node searchBFSInvalidDes(int mat[][], int i, int j, int x,\n\t\t\tint y) {\n\t\tfor (int n = 1; n < 30; n++) {\n\t\t\tfor (int p = 1; p < 30; p++) {\n\t\t\t\tvisited[n][p] = false;\n\t\t\t}\n\t\t}\n\n\t\t// create an empty queue\n\t\tQueue<Node> q = queue;\n\t\tq.clear();\n\t\t// mark source cell as visited and enqueue the source node\n\t\tvisited[j][i] = true;\n\t\tNode root = NodeFactory.createNode(i, j, 0, null, null);\n\t\tq.add(root);\n\n\t\t// stores length of longest path from source to destination\n\t\tint min_dist = Integer.MAX_VALUE;\n\t\tNode node = null;\n\t\t// run till queue is not empty\n\t\twhile (!q.isEmpty()) {\n\t\t\t// pop front node from queue and process it\n\t\t\tnode = q.poll();\n\n\t\t\t// (i, j) represents current cell and dist stores its\n\t\t\t// minimum distance from the source\n\t\t\ti = node.x;\n\t\t\tj = node.y;\n\t\t\tint dist = node.dist;\n\n\t\t\t// if destination is found, update min_dist and stop\n\t\t\tif (i == x && j == y) {\n\t\t\t\tmin_dist = dist;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// check for all 4 possible movements from current cell\n\t\t\t// and enqueue each valid movement\n\t\t\tfor (Direction dir : DIRECTIONS) {\n\t\t\t\t// check if it is possible to go to position\n\t\t\t\t// (i + row[k], j + col[k]) from current position\n\t\t\t\tint nx = i + dir.x;\n\t\t\t\tint ny = j + dir.y;\n\t\t\t\tif (isValid(mat, visited, nx, ny) || ((nx == x) && ny == y)) {\n\t\t\t\t\t// mark next cell as visited and enqueue it\n\t\t\t\t\tvisited[ny][nx] = true;\n\t\t\t\t\tint ndist = dist + 1;\n\t\t\t\t\tNode newNode = NodeFactory.createNode(nx, ny, ndist, dir,\n\t\t\t\t\t\t\tnode);\n\t\t\t\t\t// Node newNode =new Node(node, nx, ny, ndist, dir);\n\t\t\t\t\tq.add(newNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (min_dist == Integer.MAX_VALUE)\n\t\t\treturn null;\n\t\treturn node;\n\t}",
"@Override\n\t//loc1 is the start location,loc2 is the destination\n\tpublic ArrayList<MapCoordinate> bfsSearch(MapCoordinate loc1, MapCoordinate loc2, Map m) {\n\t\tSystem.out.println(\"come into bfsSearch\");\n\t\tif(m.isAgentHasAxe() && m.isAgentHasKey()){\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\t//Visited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation()); //add to visited every loop\n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0,s.getLocation()); //add to head\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move east\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){ //this is important else if(cTemp!='~'), not barely else,\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move north\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' &&s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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}\n\t\t\treturn null;\n\t\t}else if(m.isAgentHasAxe()){ //only have axe\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\t//Visited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation()); //add visited every loop\n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0,s.getLocation()); //add to head\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move north\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}else if(m.isAgentHasKey()){ //only have key\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\t//Visited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation());\n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0, s.getLocation()); //add to head,in this fashion, return the right order of route\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY()); \n\t\t\t\tif(m.hasCoordinate(temp)){//state move east\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY()); //state that move west\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1); //state move north\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1); //state move south\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t\n\t\t/*\n\t\t * \n\t\t **/\t\t\n\t\telse{ //have no key and axe\n\t\t\tSystem.out.println(\"come into the last elas clause\");\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\tVisited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\t//int i=0;\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\t//i++;\n\t\t\t\t//System.out.println(\"come into while: \"+i);\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation()); //add visited, let program won't stuck in \n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tSystem.out.println(\"return computed route\");\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0, s.getLocation()); //add to head\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\tfor(MapCoordinate mc:route){\n\t\t\t\t\t\t//System.out.println(\"print returned route in bfssearch\");\n\t\t\t\t\t\tSystem.out.print(\"mc:\"+mc.getX()+\" \"+mc.getY()+\"->\");\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\t//System.out.println(\"1 if\");\n\t\t\t\t\tif(s.getPrevState()!=null &&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if\");\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 if\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 if\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 else\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.add(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tSystem.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1);\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*'&&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\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\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1);\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}//do not do any action for not enough stones situation\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}//do not do any action for not enough stones situation\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\treturn null;\n\t\t}\n\t}",
"public int compare(Object nodes1, Object nodes2) {\r\n\t\tdouble w1 = 0.0;\r\n\t\tIterator it = ((Set)nodes1).iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tDouble v = ((Node) it.next()).getWeightValueUnsynchronized(\"value\");\r\n\t\t\tw1 += (v==null ? 1.0 : v.doubleValue());\r\n\t\t}\r\n\t\tdouble w2 = 0.0;\r\n\t\tit = ((Set)nodes2).iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tDouble v = ((Node) it.next()).getWeightValueUnsynchronized(\"value\");\r\n\t\t\tw2 += (v==null ? 1.0 : v.doubleValue());\r\n\t\t}\r\n\t\tint res = Double.compare(w2, w1);\r\n\t\tif (res==0) { // oops, must figure out how they differ\r\n\t\t\tSet ns1 = (Set) nodes1;\r\n\t\t\tSet ns2 = (Set) nodes2;\r\n\t\t\tint ns1sz = ns1.size();\r\n\t\t\tint ns2sz = ns2.size();\r\n\t\t\tif (ns1sz>ns2sz) return -1; // more nodes, the better\r\n\t\t\telse if (ns1sz<ns2sz) return 1;\r\n\t\t\t// go through the *very* expensive nodes discrimination\r\n\t\t\tIterator it1 = ns1.iterator();\r\n\t\t\tIntSet nis1 = new IntSet();\r\n\t\t\twhile (it1.hasNext()) {\r\n\t\t\t\tNode n = (Node) it1.next();\r\n\t\t\t\tnis1.add(new Integer(n.getId()));\r\n\t\t\t}\r\n\t\t\tIterator it2 = ns2.iterator();\r\n\t\t\tIntSet nis2 = new IntSet();\r\n\t\t\twhile (it2.hasNext()) {\r\n\t\t\t\tNode n = (Node) it2.next();\r\n\t\t\t\tnis2.add(new Integer(n.getId()));\r\n\t\t\t}\r\n\t\t\treturn nis2.compareTo(nis1);\r\n\t\t}\r\n\t\treturn res;\r\n\t}",
"public void d1()\n {\n if((w1_x_coordinate == d1_x_coordinate)&&(w1_y_coordinate == d1_y_coordinate)&&(prev_w1_x_coordinate!=w1_x_coordinate)&&(prev_w1_y_coordinate!=w1_y_coordinate))\n {\n prev_w1_x_coordinate = w1_x_coordinate;\n prev_w1_y_coordinate = w1_y_coordinate; //last_w1d1_contact_globaltick = globaltick;\n push(8,9,0);\n }\n else\n {\n if(((w1_x_coordinate != d1_x_coordinate)||(w1_y_coordinate != d1_y_coordinate))&&((prev_w1_x_coordinate!=w1_x_coordinate)||(prev_w1_y_coordinate!=w1_y_coordinate)))\n {\n //System.out.print(\"w1 and d1 are Out of Range! \\n\");\n }\n else if((w1_x_coordinate == d1_x_coordinate)&&(w1_y_coordinate == d1_y_coordinate)&&(prev_w1_x_coordinate==w1_x_coordinate)&&(prev_w1_y_coordinate==w1_y_coordinate))\n {\n //System.out.print(\"w1 and d1 are In Range, However w1 is Stationary and stale contact is prevented! \\n\");\n }\n else\n {\n //System.out.print(\"w1 not pushing data to d1! \\n\");\n }\n }\n }",
"public static int lca(Node node, int d1, int d2) {\n ArrayList<Integer> al1=nodeToRootPath(node,d1);\n ArrayList<Integer> al2=nodeToRootPath(node,d2);\n\n\n int l1=al1.size()-1;\n int l2=al2.size()-1;\n\n while(l1>=0 && l2>=0){\n if(al1.get(l1)==al2.get(l2))\n {\n l1--;\n l2--;\n continue;\n }\n else\n break;\n }\n if(l1==al1.size()-1)\n return -1;\n return al1.get(l1+1);\n }",
"private void search(int offset, MetricSpaceObject query, ResultCollector collector, double parentToQueryDistance) {\n buffer.position(offset);\n\n //the node should consist of a pointer to each child node then the point data, then the value data\n double nodeRadius = buffer.getDouble();\n double parentToThisDistance = buffer.getDouble();\n int left = buffer.getInt();\n int right = buffer.getInt();\n \n double searchRadius = collector.getRadius();\n\n //check if we can skip a distance calculation using the triangle inequality\n if (!optimise || Double.isNaN(parentToQueryDistance)\n || Math.abs(parentToThisDistance - parentToQueryDistance) <= nodeRadius + searchRadius)\n {\n int vantagePointId = buffer.getInt();\n double distance = query.getDistance(vantagePointId);\n\n if (distance <= searchRadius) {\n //this point is within the distance threshold to the query object, so add it to the results\n collector.add(new SearchResult(query.getObjectID(), vantagePointId, distance));\n \n //update the search radius in case the add changed it\n searchRadius = collector.getRadius();\n }\n\n if (left != 0 && distance <= nodeRadius + searchRadius) {\n //points within a distance threshold to the query object could be inside the radius,\n //so search the left subtree\n search(left, query, collector, distance);\n }\n\n if (right != 0 && distance >= nodeRadius - searchRadius) {\n //points within a distance threshold to the query object could be outside the radius,\n //so search the right subtree\n search(right, query, collector, distance);\n }\n }\n else if (right != 0) {\n search(right, query, collector, Double.NaN);\n }\n }",
"public HashMap<Integer, Integer> findAugumentPath() {\n if (debug == 1) printFree();\n HashMap<Integer, Integer> Path = new HashMap<>();\n if (V1.isEmpty() || V2.isEmpty()) {\n if (debug == 1) System.out.println(\"V1||V2 is empty\");\n return Path;\n }\n\n GM.clearAllEdge();\n for (int i = 0; i < x.length; i++) {\n for (int j : x[i].getDomain()) {\n GM.addEdge(i, Map.get(j));\n }\n }\n GM.adjList[X].clear();\n for (int i : V1) {\n GM.addEdge(X, i);\n }\n for (int i = 0; i < x.length; i++) {\n if (MaxMatch[i] != 0) GM.addEdge(MaxMatch[i], i);\n }\n if (debug == 1) System.out.println(GM);\n\n // DFS từ X. Gặp 1 đỉnh thuộc V2 thì break\n boolean[] visited = new boolean[nbOfVertex + 10];\n int[] prev = new int[nbOfVertex + 10];\n prev[X] = -1;\n int last = -1;\n\n Stack<Integer> S = new Stack<>();\n S.push(X);\n while (!S.isEmpty() && last == -1) {\n int top = S.pop();\n //System.out.println(\"Popped \" + top);\n if (!visited[top]) {\n visited[top] = true;\n for (int next : GM.adjList[top])\n if (!visited[next]) {\n prev[next] = top;\n if (V2.contains(next)) {\n last = next;\n //System.out.println(\"Here \" + next);\n break;\n }\n S.push(next);\n //System.out.println(\"Pushed \" + next);\n }\n }\n }\n if (last == -1) {\n //System.out.println(\"Cant find any augument path\\n\");\n } else {\n //System.out.println(\"Constructing augument path\");\n //int step = 0;\n while (last != -1) {\n int from = prev[last];\n if (from == X) break;\n Path.put(from, last);\n ////System.out.println(Math.min(from, last) + \" --> \" + Math.max(from, last));\n last = from;\n //step++;\n //if(step>10) break;\n }\n if (debug == 1) System.out.println(\"Construct augument path completed \" + Path.size());\n if (debug == 1) printCurrentAugumentPath(Path);\n }\n //System.out.println(Path.size());\n return Path;\n }",
"static void iterativeDfs(Node startingNode) {\n Set<Node> markedAsVisited = new HashSet<>();\n\n // creates a stack for piling up the nodes to visit\n ArrayDeque<Node> toBeVisited = new ArrayDeque<>();\n\n // sets the starting node as to be visited\n toBeVisited.push(startingNode);\n\n // adds the starting node to the set of marked as visited nodes\n markedAsVisited.add(startingNode);\n\n // while there nodes to visit\n while (!toBeVisited.isEmpty()) {\n\n // gets the current node\n Node current = toBeVisited.pop();\n\n // processes the node\n System.out.print(\"Node \" + current.val + \", \");\n\n // loops over the neighbours of the current node\n for (Node neighbour: current.neighbours) {\n\n // if the neighbour has not been already visited\n if (! markedAsVisited.contains(neighbour)) {\n\n // adds the neighbour to the ones to be visited\n toBeVisited.push(neighbour);\n\n // adds the neighbour to the set of marked as visited nodes\n markedAsVisited.add(neighbour);\n }\n }\n }\n }",
"public List<GeographicPoint> bfs(GeographicPoint start, \n\t\t\t \t\t\t\t\t GeographicPoint goal, Consumer<GeographicPoint> nodeSearched)\n\t{\n\t\t// TODO: Implement this method in WEEK 3\n\t\t\n\t\t// Hook for visualization. See writeup.\n\t\t//nodeSearched.accept(next.getLocation());\n\t\t\n\t\tSet<GeographicPoint> visited = new HashSet<GeographicPoint>();\n\t\tList<GeographicPoint> queue = new ArrayList<GeographicPoint>();\n\t\tHashMap<GeographicPoint, List<GeographicPoint>> prev = new HashMap<GeographicPoint, List<GeographicPoint>>();\n\t\t\n\t\tfor (GeographicPoint temp : map.keySet())\n\t\t\tprev.put(temp, new ArrayList<GeographicPoint>());\n\t\t\n\t\tif (!map.containsKey(start) || !map.containsKey(goal)) \n\t\t\treturn null;\n\t\t\n\t\tqueue.add(start);\n\t\twhile (!queue.isEmpty() && !visited.contains(goal)) {\n\t\t\t\n\t\t\tGeographicPoint currPoint = queue.get(0);\n\t\t\tMapNode currNode = map.get(currPoint);\n\t\t\tnodeSearched.accept(currPoint);\n\t\t\t\n\t\t\tqueue.remove(0);\n\t\t\tHashMap<MapEdge, GeographicPoint> neighbours = currNode.getNeighbours();\n\t\t\tfor (GeographicPoint n : neighbours.values()) {\n\t\t\t\tif (n.equals(start))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!visited.contains(n)) {\n\t\t\t\t\tqueue.add(n);\n\t\t\t\t\tvisited.add(n);\n\t\t\t\t\tprev.get(n).add(currPoint);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn backTrack(prev, goal);\n\t}",
"private int checkNeighbours(ArrayList<ArrayList<T>> currNodes, ArrayList<T> goal, int distance, ArrayList<ArrayList<T>> checkedNodes) {\n if (currNodes.contains(goal)) {\n return distance;\n }\n \n ArrayList<ArrayList<T>> neighbours = new ArrayList<ArrayList<T>>();\n //Go through all nodes at level\n for (int i = 0; i < currNodes.size(); i++) {\n ArrayList<T> node = currNodes.get(i);\n T nodeLabel = node.get(0);\n ArrayList<T> connectedNodes = neighbours(nodeLabel);\n //Go through all the connected nodes\n for (int n = 0; n < connectedNodes.size(); n++) {\n ArrayList<T> conNode = labelToVert(connectedNodes.get(n));\n //If the node hasn't yet been checked, add it to the list of neighbours\n if (!checkedNodes.contains(conNode)) {\n neighbours.add(conNode);\n }\n }\n }\n //Determine if source and target are disconnected\n if (neighbours.size() == 0) return disconnectedDist;\n \n checkedNodes.addAll(currNodes);\n //Perform the same set of checks on the next unchecked neighbours\n return checkNeighbours(neighbours, goal, ++distance, checkedNodes);\n }",
"void djcalc(LinkedList<Edge> l[],int cn, int visited[],Nodedj n[],int sn, LinkedList<Integer> path[]){\n\t\n\t\tLinkedList<Nodedj> neighbour = new LinkedList<Nodedj>();\n\t\tIterator<Edge> it1 = l[sn].iterator();\n\t\tn[sn].cost = 0;\n\t\twhile(it1.hasNext())\n\t\t{\n\t\t\tEdge e= (Edge)it1.next();\n\t\t\tn[e.adjIndex].cost = e.cost;\n\t\t\tneighbour.add(n[e.adjIndex]);\n\t\t\tvisited[sn] = 1;\n\t\t\tpath[e.adjIndex].add(e.adjIndex);\n\n\t\t}\n\t\n\t\t/*The sort function is implemented in the Nodedj class*/\n\t\n\t\tCollections.sort(neighbour);\n\t\twhile(!neighbour.isEmpty()){\n\n\t\t\t/*Used for adding nodes into the neghbor list depending on its distance*/\n\t\n\t\t\tNodedj tempn = neighbour.remove();\n\t\t\tIterator<Edge> it2 = l[tempn.index].iterator();\n\t\t\tvisited[tempn.index] = 1;\n\t\t\twhile(it2.hasNext())\n\t\t\t{\n\t\t\t\tEdge e= (Edge)it2.next();\n\t\t\t\tif(visited[e.adjIndex]!=1 && !neighbour.contains(n[e.adjIndex])){\n\t\t\t\t\tneighbour.add(n[e.adjIndex]);\n\n\t\t\t\t}\n\t\t\t\tdouble tempcost;\n\t\t\t\ttempcost= e.cost+n[tempn.index].cost;\n\t\t\t\tif(tempcost < n[e.adjIndex].cost){\n\t\t\t\t\tn[e.adjIndex].cost = tempcost;\n\t\t\t\t\tpath[e.adjIndex].clear();\n\t\t\t\t\tfor(int i=0; i < path[tempn.index].size(); i++){\n\t\t\t\t\t\tpath[e.adjIndex].add(path[tempn.index].get(i));\n\t\t\t\t\t}\n\t\t\t\t\tpath[e.adjIndex].add(e.adjIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t\tCollections.sort(neighbour);\n\t\t}\n\n\t}",
"public void addNode()\r\n\t{\r\n\t\tArrayList<PolygonD> objectsInScene = new ArrayList<PolygonD>();\r\n\t\tobjectsInScene.addAll(objects);\r\n\t\tobjectsInScene.add(currentShape);\r\n\t\t\r\n\t\tPointD mousePoint = new PointD(lastPointOnScreen); \r\n\t\tmousePoint.setX(mousePoint.getX() - worldCenter.getX());\r\n\t\tmousePoint.setY(mousePoint.getY() - worldCenter.getY());\r\n\t\t\r\n\t\tPolygonD nearestObject = null;\r\n\t\tDouble minDistance = 100.;//threshold for adding points\r\n\t\tint pointIndex = 0;\r\n\t\tfor(PolygonD obj : objectsInScene)\r\n\t\t\tif(obj.getVerts().size()>0){\r\n\t\t\t\tPointD p = obj.getVert(0);\r\n\t\t\t\tfor(int i = 1; i < obj.getVerts().size(); i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"i = \"+i);\r\n\t\t\t\t\tDouble d = distanceToLine(new Vector(p, obj.getVert(i)), mousePoint);\r\n\t\t\t\t\tSystem.out.println(\"d = \"+d);\r\n\t\t\t\t\tif(d != null && d < minDistance)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(d + \"<\"+ minDistance);\r\n\t\t\t\t\t\tnearestObject = obj;\r\n\t\t\t\t\t\tminDistance = d;\r\n\t\t\t\t\t\tpointIndex = i;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tSystem.out.println(d + \">=\"+ minDistance);\r\n\t\t\t\t\tp = obj.getVert(i);\r\n\t\t\t\t}\r\n\t\t\t\t//handle last side\r\n\t\t\t\tDouble d = distanceToLine(new Vector(obj.getVert(0), obj.getVert(obj.getVerts().size()-1)), mousePoint);\r\n\t\t\t\tif(d != null && d < minDistance)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(d + \"<\"+ minDistance);\r\n\t\t\t\t\tnearestObject = obj;\r\n\t\t\t\t\tminDistance = d;\r\n\t\t\t\t\tpointIndex = obj.getVerts().size();\r\n\t\t\t\t\tSystem.out.println(\"i = \"+pointIndex);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tSystem.out.println(d + \">=\"+ minDistance);\r\n\t\t\t}\r\n\t\tSystem.out.println(\"minDistance \"+minDistance +\" pointIndex = \"+pointIndex);\r\n\r\n\t\tif(nearestObject != null)\r\n\t\t{\r\n\t\t\tnearestObject.getVerts().add(pointIndex, mousePoint);\r\n\t\t\tSystem.out.println(nearestObject);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tcurrentShape.add(mousePoint);\r\n\t\t}\r\n\t}",
"@Override\n public int test(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2) {\n // This is similar to WedgeContainsOrCrosses, except that we want to\n // distinguish cases (1) [A contains B], (3) [A and B are disjoint],\n // and (2,4,5,6) [A intersects but does not contain B].\n\n if (orderedCCW(a0, a2, b2, ab1)) {\n // We are in case 1, 5, or 6, or case 2 if a2 == b2.\n return orderedCCW(b2, b0, a0, ab1) ? 1 : -1; // Case 1 vs. 2,5,6.\n }\n // We are in cases 2, 3, or 4.\n if (!orderedCCW(a2, b0, b2, ab1)) {\n return 0; // Case 3.\n }\n\n // We are in case 2 or 4, or case 3 if a2 == b0.\n return (a2.equalsPoint(b0)) ? 0 : -1; // Case 3 vs. 2,4.\n }",
"private double heuristic(Node a, Node b){\n\n // absolute value of the differences in floors\n return Math.abs(a.getFloor() - b.getFloor());\n }",
"public static void liveDemo() {\n Scanner in = new Scanner( System.in );\n float srcTank1, srcTank2, destTank;\n int alternetPaths;\n Graph mnfld = new Graph();\n boolean runSearch = true;\n\n //might need to limit query results, too large maybe?\n //newnodes = JDBC.graphInformation(); //returns arraylist of nodes\n //mnfld.setPipes(newnodes); //set nodes to the manifold\n //JDBC.insertConnections(mnfld);\n\n//\t\t /*\n//\t\t\tfor (int i = 0; i < newnodes.length(); i++) { //length might be wrong\n//\t\t\t\t//need to look for way to add edges by looking for neighbor nodes i think\n//\t\t\t\t//loop through nodes and create Edges\n//\t\t\t\t//might need new query\n//\t\t\t\tnewedges.addEdge(node1,node2,cost);\n//\t\t\t}\n//\n//\t\t\tmnfld.setConnections(newedges);\n//\n//\t\t\tup to this point, graph should be global to Dijkstra and unused.\n//\t\t\tloop until user leaves page\n//\t\t\tget input from user for tanks to transfer\n//\t\t\tfind shortest path between both tanks\n//\t\t\tend loop\n//\t\t\tthis will change depending how html works so not spending any time now on it\n//\t\t*/\n //shortestPath.runTest();\n\n shortestPath.loadGraph( mnfld );\n while (runSearch) {\n // Gets user input\n System.out.print( \"First Source Tank: \" );\n srcTank1 = in.nextFloat();\n System.out.print( \"Second Source Tank: \" );\n srcTank2 = in.nextFloat();\n System.out.print( \"Destination Tank: \" );\n destTank = in.nextFloat();\n System.out.print( \"Desired Number of Alternate Paths: \" );\n alternetPaths = in.nextInt();\n\n // Prints outputs\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"True shortest with alt paths\" );\n Dijkstra.findAltPaths( mnfld, alternetPaths, srcTank1, destTank );\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Lineup Considering used connections\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ), true );\n mnfld.getPipe( destTank ).printLine();\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Lineup Considering only open connections\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ), false );\n mnfld.getPipe( destTank ).printLine();\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Merge Lineup\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ) );\n System.out.println( \"\\t Original Lineup: \" );\n mnfld.getPipe( destTank ).printLine();\n System.out.println( \"\\t Merged Lineup: \" );\n Dijkstra.mergePaths( mnfld, srcTank2, mnfld.getPipe( destTank ).getPath(), mnfld.getPipe( destTank ) );\n System.out.print( \"\\nRun another search [1:Yes, 0:No] :: \" );\n if (in.nextInt() == 0) runSearch = false;\n else System.out.println( \"\\n\\n\\n\" );\n }\n\n\n }",
"public void swapNodes(int data1, int data2) {\n\t\tif(head == null || size == 1) {\n\t\t\tSystem.out.println(\"List is empty or only one node present!!\");\n\t\t\treturn;\n\t\t}\n\t\tNode node1 = null;\n\t\tNode node1Prev = null;\n\t\tNode node2 = null;\n\t\tNode node2Prev = null;\n\t\tNode start = head;\n\t\tif(start.data == data1) {\n\t\t\tnode1Prev = null;\n\t\t\tnode1 = start;\n\t\t}\n\t\tif(start.data == data2) {\n\t\t\tnode2Prev = null;\n\t\t\tnode2 = start;\n\t\t}\n\t\twhile(start.next != null) {\n\t\t\tif(start.next.data == data1) {\n\t\t\t\tnode1Prev = start;\n\t\t\t\tnode1 = start.next;\n\t\t\t}\n\t\t\tif(start.next.data == data2) {\n\t\t\t\tnode2Prev = start;\n\t\t\t\tnode2 = start.next;\n\t\t\t}\n\t\t\tstart = start.next;\n\t\t}\n\n\t\tif(node1 != null && node2 != null) {\n\t\t\tif(node1Prev == null) {\n\t\t\t\thead = node2;\n\t\t\t}\n\t\t\tif(node2Prev == null) {\n\t\t\t\thead = node1;\n\t\t\t}\n\t\t\tNode tempNext = node2.next;\n\t\t\tif(node1Prev != null)\n\t\t\t\tnode1Prev.next = node2;\n\t\t\tnode2.next = node1.next;\n\n\t\t\tif(node2Prev != null)\n\t\t\t\tnode2Prev.next = node1;\n\t\t\tnode1.next = tempNext;\n\t\t}\n\t}",
"public static ArrayList<edges<String, Double>> Dijkstra(String CHAR1, String CHAR2, graph<String,Float> g) {\n\t\tPriorityQueue<ArrayList<edges<String, Double>>> active = \n\t\t\tnew PriorityQueue<ArrayList<edges<String, Double>>>(10,new Comparator<ArrayList<edges<String, Double>>>() {\n\t\t\t\tpublic int compare(ArrayList<edges<String, Double>> path1, ArrayList<edges<String, Double>> path2) {\n\t\t\t\t\tedges<String, Double> dest1 = path1.get(path1.size() - 1);\n\t\t\t\t\tedges<String, Double> dest2 = path2.get(path2.size() - 1);\n\t\t\t\t\tif (!(dest1.getLabel().equals(dest2.getLabel())))\n\t\t\t\t\t\treturn dest1.getLabel().compareTo(dest2.getLabel());\n\t\t\t\t\treturn path1.size() - path2.size();\n\t\t\t\t}\n\t\t\t});\n\t\t\tSet<String> known = new HashSet<String>();\n\t\t\tArrayList<edges<String, Double>> begin = new ArrayList<edges<String, Double>>();\n\t\t\tbegin.add(new edges<String, Double>(CHAR1, 0.0));\n\t\t\tactive.add(begin);\t\t\n\t\t\twhile (!active.isEmpty()) {\n\t\t\t\tArrayList<edges<String, Double>> minPath = active.poll();\n\t\t\t\tedges<String, Double> endOfMinPath = minPath.get(minPath.size() - 1);\n\t\t\t\tString minDest = endOfMinPath.getDest();\n\t\t\t\tdouble minCost = endOfMinPath.getLabel();\n\t\t\t\tif (minDest.equals(CHAR2)) {\n\t\t\t\t\treturn minPath;\n\t\t\t\t}\n\t\t\t\tif (known.contains(minDest))\n\t\t\t\t\tcontinue;\n\t\t\t\tSet<edges<String,Float>> children = g.childrenOf(minDest);\n\t\t\t\tfor (edges<String, Float> e : children) {\n\t\t\t\t\tif (!known.contains(e.getDest())) {\n\t\t\t\t\t\tdouble newCost = minCost + e.getLabel();\n\t\t\t\t\t\tArrayList<edges<String, Double>> newPath = new ArrayList<edges<String, Double>>(minPath); \n\t\t\t\t\t\tnewPath.add(new edges<String, Double>(e.getDest(), newCost));\n\t\t\t\t\t\tactive.add(newPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tknown.add(minDest);\n\t\t\t}\n\t\t\treturn null;\n\t}",
"public void checkIndependence(Node a, Node b, Node observed) {\n /*\n * Compute paths from a to b\n * */\n List<List<Node>> pathsFromAtoB = findUndirectedPaths(a, b);\n\n /*\n * Find if there is a path that contains observed\n * */\n for(List<Node> path : pathsFromAtoB) {\n for (Node node : path) {\n if (node.value == observed.value) {\n /*\n * At this point, we know that observed is on the path, between a and b\n * this means that there must be an edge that enters observed and an edge that exists observed\n * */\n System.out.println(a.value + \" _|_ \" + b.value + \" | \" + observed.value + \" - true\");\n return;\n }\n }\n }\n\n /*\n * The criteria isn't matched\n * */\n System.out.println(a.value + \" _|_ \" + b.value + \" | \" + observed.value + \" - false\");\n }",
"public static void compare () {\r\n for (int i = 0; i < dim; i++) {\r\n for (int j = 0; j < dim; j++) {\r\n if (d[i][j] != adjacencyMatrix[i][j])// here \r\n {\r\n System.out.println(\"Comparison failed\");\r\n \r\n return;\r\n }\r\n }\r\n }\r\n System.out.println(\"Comparison succeeded\");\r\n }",
"private void relax(DijkstraNode dijkNode) {\n Node originalNode = dijkNode.getOriginalNode();\n\n for(Node neighborNode : getNeighbors(originalNode)) {\n DijkstraNode neighborDijkNode = nodeMap.get(neighborNode);\n int oldDistance = neighborDijkNode.getDistance();\n int newDistance = dijkNode.getDistance() + originalNode.getEdgeWeight(neighborNode);\n\n if(oldDistance > newDistance) {\n neighborDijkNode.setDistance(newDistance);\n neighborDijkNode.setPredecessor(dijkNode);\n // https://stackoverflow.com/questions/1871253/updating-java-priorityqueue-when-its-elements-change-priority\n // you have to remove and re-insert the node, because ProrityQueue won't update automatically.\n // it works by putting the new element at the right position\n distanceQueue.remove(neighborDijkNode);\n distanceQueue.add(neighborDijkNode);\n }\n }\n }",
"private void BFS() {\n\n int fruitIndex = vertices.size()-1;\n Queue<GraphNode> bfsQueue = new LinkedList<>();\n bfsQueue.add(vertices.get(0));\n while (!bfsQueue.isEmpty()) {\n GraphNode pollNode = bfsQueue.poll();\n pollNode.setSeen(true);\n for (GraphNode node : vertices) {\n if (node.isSeen()) {\n continue;\n } else if (node.getID() == pollNode.getID()) {\n continue;\n } else if (!los.isIntersects(pollNode.getPoint(), node.getPoint())) {\n pollNode.getNeigbours().add(node);\n if (node.getID() != fruitIndex) {\n bfsQueue.add(node);\n node.setSeen(true);\n }\n }\n }\n }\n }",
"private boolean computeSearchDirection() {\n\t\t// Compute the function's gradient\n\t\tfunction.computeGradient(temp0_Nx1.data);\n\n\t\t// compute the change in gradient\n\t\tfor( int i = 0; i < N; i++ ) {\n\t\t\ty.data[i] = temp0_Nx1.data[i] - g.data[i];\n\t\t\tg.data[i] = temp0_Nx1.data[i];\n\t\t}\n\n\t\t// Update the inverse Hessian matrix\n\t\tif( iterations != 0 ) {\n\t\t\tEquationsBFGS.inverseUpdate(B, s, y, temp0_Nx1, temp1_Nx1);\n\t\t}\n\n\t\t// compute the search direction\n\t\tCommonOps_DDRM.mult(-1,B,g, searchVector);\n\n\t\t// use the line search to find the next x\n\t\tif( !setupLineSearch(fx, x.data, g.data, searchVector.data) ) {\n\t\t\t// the search direction has a positive derivative, meaning the B matrix is\n\t\t\t// no longer SPD. Attempt to fix the situation by resetting the matrix\n\t\t\tresetMatrixB();\n\t\t\t// do the search again, it can't fail this time\n\t\t\tCommonOps_DDRM.mult(-1,B,g, searchVector);\n\t\t\tsetupLineSearch(fx, x.data, g.data, searchVector.data);\n\t\t} else if(Math.abs(derivAtZero) <= gtol ) {\n\t\t\tif( verbose != null ) {\n\t\t\t\tverbose.printf(\"finished select direction, gtest=%e\\n\",Math.abs(derivAtZero));\n\t\t\t}\n\n\t\t\t// the input might have been modified by the function. So copy it\n\t\t\tSystem.arraycopy(function.getCurrentState(),0,x.data,0,N);\n\t\t\treturn terminateSearch(true);\n\t\t}\n\n\t\tmode = 1;\n\t\titerations++;\n\t\treturn false;\n\t}",
"@Test\n \tpublic void whereClauseForNodeExactDominance() {\n \t\tnode23.addJoin(new Dominance(node42, 10));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\"),\n \t\t\t\tjoin(\"=\", \"_rank23.level\", \"_rank42.level\", -10)\n \t\t);\n \t}",
"public void connect(int a, int b) {\n int root_a = find(a);\n int root_b = find(b);\n if (root_a != root_b) {\n father[root_a] = root_b;\n count --;\n }\n }",
"@Override\n\tprotected boolean checkAndAddNodeToList(Node currNode, int x, int y) {\n\t\tint cost = currNode.getCurrentPathCost()+1;\n\t\tint h = heuristic(x,y);\n\t\tif (h+cost < this.maze[x][y]) {\n\t\t\tthis.pq.add(new Node(currNode, x, y, cost, h));\n\t\t\tthis.maze[x][y] = h+cost;\n\t\t\tthis.expands++;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public static int lca(Node node, int d1, int d2){\r\n ArrayList<Integer> path1 = nodeToRootPath(node, d1);\r\n ArrayList<Integer> path2 = nodeToRootPath(node, d2);\r\n \r\n //Traverse from behind to avoid time complexity\r\n int i = path1.size() - 1;\r\n int j = path2.size() - 1;\r\n \r\n //Check for valid iterations and till the time data is common, first occurence of diff data in arraylist is the time to stop\r\n while(i>=0 && j>=0 && path1.get(i) == path2.get(j)){\r\n i--; j--;\r\n }\r\n \r\n //Return the last common element from behind in ArrayList\r\n return path1.get(i+1);\r\n }",
"private boolean isDFltdFMin()\n {\n double fLow = (x2.getF(0) < x1.getF(0)) ? x2.getF(0) : x1.getF(0);\n double dF = Math.abs(fLowBor-fLow);\n return (dF < dFMin) ? true : false;\n }",
"public void connect(int a, int b) {\n\t\tint rootA = find(a);\n\t\tint rootB = find(b);\n\t\tif (rootA != rootB) {\n\t\t\tgraph[rootA] = rootB;\n\t\t}\n }",
"public boolean differ(Object a, Object b) {\n Node set1 = find(getNode(a));\n Node set2 = find(getNode(b));\n\n return set1 != set2;\n }",
"@Override\n\t/*\n\t * public int checkNodeInDBByCoordinate(Coordinate coordinate) {\n\t * \n\t * ResultSet resultSet = null; int x = coordinate.getX(); int y =\n\t * coordinate.getY(); try {\n\t * \n\t * String checkNodesInDB =\n\t * \"select id from routefinder.node where x=? and y=?\"; pstmt =\n\t * conn.prepareStatement(checkNodesInDB); pstmt.setInt(1, x);\n\t * pstmt.setInt(2, y); resultSet = pstmt.executeQuery(); if\n\t * (resultSet.next()) { return resultSet.getInt(\"id\"); } else {\n\t * System.out.println(\"Cannot find node \" + x + \", \" + y); return -1; } }\n\t * catch (SQLException se) { se.printStackTrace(); return -1; } finally {\n\t * JdbcConnect.resultClose(resultSet, pstmt); } }\n\t */\n\tpublic int checkNodeRelationInDBByNodeRelation(NodeRelation[] nodeRelation) {\n\t\treturn 0;\n\t}",
"public Map<Node<T>, Cost> dijkstra(T start) throws NodeNotFoundException {\n Node<T> origin = findNode(start);\n Map<Node<T>, Cost> costs = new HashMap<>();\n List<Node<T>> alreadyVisited = new ArrayList<>();\n\n // Step 1 : Initialization\n // Set every cost to infinity, except for the starting summit which is set to 0\n for(Node<T> node : getNodes()) {\n if(origin.equals(node)) { costs.put(node, new Cost(0.0)); }\n else { costs.put(node, new Cost()); }\n }\n\n while(ArrayMethods.similarity(getNodes(), alreadyVisited) != order()) {\n // Step 2 : Taking the node with the smallest cost\n Node<T> reference = Cost.findMin(costs, alreadyVisited);\n\n // Step 3 : Updating the table with the costs from that node\n for(WeightedLink link : findLinks(reference.getData())) {\n Node<T> other = (Node<T>) link.getOther(reference);\n Cost oldCost = costs.get(other);\n double old = oldCost.getCost();\n double cost = link.getWeight() + costs.get(reference).getCost();\n\n costs.put(other, (cost < old) ? new Cost(cost, reference) : oldCost);\n }\n\n // Step 4 : Repeat with the smallest costing summit that wasn't visited already\n alreadyVisited.add(reference);\n }\n\n return costs;\n }",
"private int[] optimum(int x1, int y1, int x2, int y2) {\n if (lookupNodes[x1][y1][x2][y2] != Integer.MAX_VALUE) {\n return new int[]{lookupNodes[x1][y1][x2][y2], lookupDepth[x1][y1][x2][y2]};\n }\n if (hasOneColor(x1, y1, x2, y2)) {\n lookupNodes[x1][y1][x2][y2] = 1;\n lookupDepth[x1][y1][x2][y2] = 0;\n return new int[]{1, 0};\n }\n int nodes;\n int depth;\n for (int X = x1; X < x2; X++) {\n nodes = optimum(x1, y1, X, y2)[0] + optimum(X+1, y1, x2, y2)[0] + 1;\n depth = Math.max(optimum(x1, y1, X, y2)[1], optimum(X+1, y1, x2, y2)[1]) + 1;\n updateLookupNodes(nodes, x1, y1, x2, y2);\n updateLookupDepth(depth, x1, y1, x2, y2);\n }\n for (int Y = y1; Y < y2; Y++) {\n nodes = optimum(x1, y1, x2, Y)[0] + optimum(x1, Y+1, x2, y2)[0] + 1;\n depth = Math.max(optimum(x1, y1, x2, Y)[1], optimum(x1, Y+1, x2, y2)[1]) + 1;\n updateLookupNodes(nodes, x1, y1, x2, y2);\n updateLookupDepth(depth, x1, y1, x2, y2);\n }\n return new int[]{lookupNodes[x1][y1][x2][y2], lookupDepth[x1][y1][x2][y2]};\n }",
"public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }",
"public static UniformCostSearchNode search(UniformCostSearchNode root){\n PriorityQueue<UniformCostSearchNode> frontier = new PriorityQueue<UniformCostSearchNode>();\n\n // hash set for fast verification of closed nodes\n HashSet<UniformCostSearchNode> closed = new HashSet<UniformCostSearchNode>();\n\n closed.add(root);\n frontier.add(root);\n\n while(frontier.size() != 0){\n UniformCostSearchNode current = frontier.remove();\n if(current.isGoalState()){\n System.out.println(\"UCS Nodes explored: \" + closed.size());\n return current;\n }\n\n for(UniformCostSearchNode neighbor : current.getNeighbors()){\n if(!closed.contains(neighbor)) {\n if (!frontier.contains(neighbor)) {\n frontier.add(neighbor);\n }\n }\n }\n }\n\n System.out.println(\"UCS Search failed, nodes explored: \" + closed.size());\n // search failed\n return null;\n }"
] | [
"0.554544",
"0.54310375",
"0.5334786",
"0.5202404",
"0.515976",
"0.5138248",
"0.5135036",
"0.5134658",
"0.5112613",
"0.50713164",
"0.5070246",
"0.50648993",
"0.50480455",
"0.50250024",
"0.50180906",
"0.49951053",
"0.4984327",
"0.4983281",
"0.49675113",
"0.4947962",
"0.4940642",
"0.49369705",
"0.4924283",
"0.490126",
"0.48969585",
"0.48871344",
"0.48728013",
"0.48725605",
"0.4861554",
"0.48605382",
"0.48591313",
"0.4841477",
"0.48362848",
"0.4829547",
"0.48196942",
"0.48142055",
"0.48086306",
"0.48049977",
"0.47937724",
"0.47933447",
"0.47930276",
"0.47925052",
"0.47923043",
"0.47830513",
"0.4778734",
"0.4777665",
"0.47599548",
"0.47575313",
"0.47492853",
"0.4749232",
"0.47476307",
"0.47440425",
"0.47423384",
"0.4741061",
"0.4734824",
"0.47301012",
"0.47293282",
"0.4722058",
"0.4715496",
"0.4713051",
"0.47100258",
"0.4703628",
"0.4700764",
"0.46910325",
"0.46790424",
"0.46677634",
"0.46645603",
"0.46588948",
"0.46518853",
"0.46507746",
"0.46506444",
"0.46439064",
"0.4640411",
"0.4638437",
"0.46368742",
"0.46314076",
"0.46297836",
"0.4627182",
"0.4626853",
"0.46265537",
"0.4623067",
"0.46183422",
"0.4617688",
"0.4611587",
"0.46112663",
"0.46088603",
"0.46087554",
"0.4603417",
"0.460225",
"0.46006614",
"0.45997927",
"0.45945966",
"0.4583076",
"0.45775115",
"0.4575292",
"0.4574934",
"0.45747483",
"0.4569437",
"0.45647952",
"0.45605278"
] | 0.45930284 | 92 |
Expands search node with its neighbours. | public List<SearchNode> expand() {
List<SearchNode> neighbours = new ArrayList<>();
if (this.getX() > 0) {
SearchNode left = new SearchNode(this.getX() - 1, this.getY(), this.getDepth() + 1);
neighbours.add(left);
}
if (this.getX() < 14) {
SearchNode right = new SearchNode(this.getX() + 1, this.getY(), this.getDepth() + 1);
neighbours.add(right);
}
if (this.getY() > 0) {
SearchNode up = new SearchNode(this.getX(), this.getY() - 1, this.getDepth() + 1);
neighbours.add(up);
}
if (this.getY() < 14) {
SearchNode down = new SearchNode(this.getX(), this.getY() + 1, this.getDepth() + 1);
neighbours.add(down);
}
return neighbours;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void expandNode() {\r\n\t\t\t// Dijkstra's algorithm to handle separately\r\n\t\t\tif (dijkstra.isSelected()) {\r\n\t\t\t\tCell u;\r\n\t\t\t\t// 11: while Q is not empty:\r\n\t\t\t\tif (graph.isEmpty()) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// 12: u := vertex in Q (graph) with smallest distance in dist[]\r\n\t\t\t\t// ;\r\n\t\t\t\t// 13: remove u from Q (graph);\r\n\t\t\t\tu = graph.remove(0);\r\n\t\t\t\t// Add vertex u in closed set\r\n\t\t\t\tclosedSet.add(u);\r\n\t\t\t\t// If target has been found ...\r\n\t\t\t\tif (u.row == targetPos.row && u.col == targetPos.col) {\r\n\t\t\t\t\tfound = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// Counts nodes that have expanded.\r\n\t\t\t\texpanded++;\r\n\t\t\t\t// Update the color of the cell\r\n\t\t\t\tgrid[u.row][u.col] = CLOSED;\r\n\t\t\t\t// 14: if dist[u] = infinity:\r\n\t\t\t\tif (u.dist == INFINITY) {\r\n\t\t\t\t\t// ... then there is no solution.\r\n\t\t\t\t\t// 15: break;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t\t// 16: end if\r\n\t\t\t\t}\r\n\t\t\t\t// Create the neighbors of u\r\n\t\t\t\tArrayList<Cell> neighbors = createSuccesors(u, false);\r\n\t\t\t\t// 18: for each neighbor v of u:\r\n\t\t\t\tfor (Cell v : neighbors) {\r\n\t\t\t\t\t// 20: alt := dist[u] + dist_between(u, v) ;\r\n\t\t\t\t\tint alt = u.dist + distBetween(u, v);\r\n\t\t\t\t\t// 21: if alt < dist[v]:\r\n\t\t\t\t\tif (alt < v.dist) {\r\n\t\t\t\t\t\t// 22: dist[v] := alt ;\r\n\t\t\t\t\t\tv.dist = alt;\r\n\t\t\t\t\t\t// 23: previous[v] := u ;\r\n\t\t\t\t\t\tv.prev = u;\r\n\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\tgrid[v.row][v.col] = FRONTIER;\r\n\t\t\t\t\t\t// 24: decrease-key v in Q;\r\n\t\t\t\t\t\t// (sort list of nodes with respect to dist)\r\n\t\t\t\t\t\tCollections.sort(graph, new CellComparatorByDist());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// The handling of the other four algorithms\r\n\t\t\t} else {\r\n\t\t\t\tCell current;\r\n\t\t\t\tif (dfs.isSelected() || bfs.isSelected()) {\r\n\t\t\t\t\t// Here is the 3rd step of the algorithms DFS and BFS\r\n\t\t\t\t\t// 3. Remove the first state, Si, from OPEN SET ...\r\n\t\t\t\t\tcurrent = openSet.remove(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Here is the 3rd step of the algorithms A* and Greedy\r\n\t\t\t\t\t// 3. Remove the first state, Si, from OPEN SET,\r\n\t\t\t\t\t// for which f(Si) ≤ f(Sj) for all other\r\n\t\t\t\t\t// open states Sj ...\r\n\t\t\t\t\t// (sort first OPEN SET list with respect to 'f')\r\n\t\t\t\t\tCollections.sort(openSet, new CellComparatorByF());\r\n\t\t\t\t\tcurrent = openSet.remove(0);\r\n\t\t\t\t}\r\n\t\t\t\t// ... and add it to CLOSED SET.\r\n\t\t\t\tclosedSet.add(0, current);\r\n\t\t\t\t// Update the color of the cell\r\n\t\t\t\tgrid[current.row][current.col] = CLOSED;\r\n\t\t\t\t// If the selected node is the target ...\r\n\t\t\t\tif (current.row == targetPos.row && current.col == targetPos.col) {\r\n\t\t\t\t\t// ... then terminate etc\r\n\t\t\t\t\tCell last = targetPos;\r\n\t\t\t\t\tlast.prev = current.prev;\r\n\t\t\t\t\tclosedSet.add(last);\r\n\t\t\t\t\tfound = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// Count nodes that have been expanded.\r\n\t\t\t\texpanded++;\r\n\t\t\t\t// Here is the 4rd step of the algorithms\r\n\t\t\t\t// 4. Create the successors of Si, based on actions\r\n\t\t\t\t// that can be implemented on Si.\r\n\t\t\t\t// Each successor has a pointer to the Si, as its predecessor.\r\n\t\t\t\t// In the case of DFS and BFS algorithms, successors should not\r\n\t\t\t\t// belong neither to the OPEN SET nor the CLOSED SET.\r\n\t\t\t\tArrayList<Cell> succesors;\r\n\t\t\t\tsuccesors = createSuccesors(current, false);\r\n\t\t\t\t// Here is the 5th step of the algorithms\r\n\t\t\t\t// 5. For each successor of Si, ...\r\n\t\t\t\tfor (Cell cell : succesors) {\r\n\t\t\t\t\t// ... if we are running DFS ...\r\n\t\t\t\t\tif (dfs.isSelected()) {\r\n\t\t\t\t\t\t// ... add the successor at the beginning of the list\r\n\t\t\t\t\t\t// OPEN SET\r\n\t\t\t\t\t\topenSet.add(0, cell);\r\n\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\r\n\t\t\t\t\t\t// ... if we are runnig BFS ...\r\n\t\t\t\t\t} else if (bfs.isSelected()) {\r\n\t\t\t\t\t\t// ... add the successor at the end of the list OPEN SET\r\n\t\t\t\t\t\topenSet.add(cell);\r\n\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\r\n\t\t\t\t\t\t// ... if we are running A* or Greedy algorithms (step 5\r\n\t\t\t\t\t\t// of A* algorithm) ...\r\n\t\t\t\t\t} else if (aStar.isSelected() || guloso.isSelected()) {\r\n\t\t\t\t\t\t// ... calculate the value f(Sj) ...\r\n\t\t\t\t\t\tint dxg = current.col - cell.col;\r\n\t\t\t\t\t\tint dyg = current.row - cell.row;\r\n\t\t\t\t\t\tint dxh = targetPos.col - cell.col;\r\n\t\t\t\t\t\tint dyh = targetPos.row - cell.row;\r\n\t\t\t\t\t\tif (diagonal.isSelected()) {\r\n\t\t\t\t\t\t\t// with diagonal movements\r\n\t\t\t\t\t\t\t// calculate 1000 times the Euclidean distance\r\n\t\t\t\t\t\t\tif (guloso.isSelected()) {\r\n\t\t\t\t\t\t\t\t// especially for the Greedy ...\r\n\t\t\t\t\t\t\t\tcell.g = 0;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcell.g = current.g + (int) ((double) 1000 * Math.sqrt(dxg * dxg + dyg * dyg));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcell.h = (int) ((double) 1000 * Math.sqrt(dxh * dxh + dyh * dyh));\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// without diagonal movements\r\n\t\t\t\t\t\t\t// calculate Manhattan distances\r\n\t\t\t\t\t\t\tif (guloso.isSelected()) {\r\n\t\t\t\t\t\t\t\t// especially for the Greedy ...\r\n\t\t\t\t\t\t\t\tcell.g = 0;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcell.g = current.g + Math.abs(dxg) + Math.abs(dyg);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcell.h = Math.abs(dxh) + Math.abs(dyh);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcell.f = cell.g + cell.h;\r\n\t\t\t\t\t\t// ... If Sj is neither in the OPEN SET nor in the\r\n\t\t\t\t\t\t// CLOSED SET states ...\r\n\t\t\t\t\t\tint openIndex = isInList(openSet, cell);\r\n\t\t\t\t\t\tint closedIndex = isInList(closedSet, cell);\r\n\t\t\t\t\t\tif (openIndex == -1 && closedIndex == -1) {\r\n\t\t\t\t\t\t\t// ... then add Sj in the OPEN SET ...\r\n\t\t\t\t\t\t\t// ... evaluated as f(Sj)\r\n\t\t\t\t\t\t\topenSet.add(cell);\r\n\t\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\r\n\t\t\t\t\t\t\t// Else ...\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// ... if already belongs to the OPEN SET, then ...\r\n\t\t\t\t\t\t\tif (openIndex > -1) {\r\n\t\t\t\t\t\t\t\t// ... compare the new value assessment with the\r\n\t\t\t\t\t\t\t\t// old one.\r\n\t\t\t\t\t\t\t\t// If old <= new ...\r\n\t\t\t\t\t\t\t\tif (openSet.get(openIndex).f <= cell.f) {\r\n\t\t\t\t\t\t\t\t\t// ... then eject the new node with state\r\n\t\t\t\t\t\t\t\t\t// Sj.\r\n\t\t\t\t\t\t\t\t\t// (ie do nothing for this node).\r\n\t\t\t\t\t\t\t\t\t// Else, ...\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// ... remove the element (Sj, old) from the\r\n\t\t\t\t\t\t\t\t\t// list\r\n\t\t\t\t\t\t\t\t\t// to which it belongs ...\r\n\t\t\t\t\t\t\t\t\topenSet.remove(openIndex);\r\n\t\t\t\t\t\t\t\t\t// ... and add the item (Sj, new) to the\r\n\t\t\t\t\t\t\t\t\t// OPEN SET.\r\n\t\t\t\t\t\t\t\t\topenSet.add(cell);\r\n\t\t\t\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// ... if already belongs to the CLOSED SET,\r\n\t\t\t\t\t\t\t\t// then ...\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t// ... compare the new value assessment with the\r\n\t\t\t\t\t\t\t\t// old one.\r\n\t\t\t\t\t\t\t\t// If old <= new ...\r\n\t\t\t\t\t\t\t\tif (closedSet.get(closedIndex).f <= cell.f) {\r\n\t\t\t\t\t\t\t\t\t// ... then eject the new node with state\r\n\t\t\t\t\t\t\t\t\t// Sj.\r\n\t\t\t\t\t\t\t\t\t// (ie do nothing for this node).\r\n\t\t\t\t\t\t\t\t\t// Else, ...\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// ... remove the element (Sj, old) from the\r\n\t\t\t\t\t\t\t\t\t// list\r\n\t\t\t\t\t\t\t\t\t// to which it belongs ...\r\n\t\t\t\t\t\t\t\t\tclosedSet.remove(closedIndex);\r\n\t\t\t\t\t\t\t\t\t// ... and add the item (Sj, new) to the\r\n\t\t\t\t\t\t\t\t\t// OPEN SET.\r\n\t\t\t\t\t\t\t\t\topenSet.add(cell);\r\n\t\t\t\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\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}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"public abstract List<Node> expand();",
"private void dijkstras() {\n LinkedList<Integer> openNodeList = new LinkedList<Integer>();\n openNodeList.add(grid.length - 1);\n Integer curGrid = -1;\n\n while ( openNodeList.size() > 0 ) {\n curGrid = getBestGrid(openNodeList,curGrid);\n\n for ( int i = 0; i < grid[curGrid].edges.size() - 1; i++ ) {\n Integer tmp = grid[curGrid].edges.get(i).arrayIndex;\n if ( !grid[tmp].bFinalized && !openNodeList.contains(tmp)) {\n //System.out.println(\"Adding:\\t\" + tmp + \":\\t\" + grid[tmp].cost);\n grid[tmp].setHead(curGrid);\n grid[tmp].cost = grid[curGrid].cost + grid[curGrid].edges.get(i).Exposure;\n openNodeList.add(tmp);\n }\n }\n\n grid[curGrid].bFinalized = true;\n openNodeList.removeFirstOccurrence(curGrid);\n }\n }",
"private void GreedySearch(){\n\n Queue<Node> expanded = new LinkedList<>();\n ArrayList<Node> fringe = new ArrayList<>();\n ArrayList<Node> fringeTemp = new ArrayList<>();\n\n\n Node current = startNode;\n\n while(expanded.size() < 1000){\n\n if(current.getDigit().getDigitString().equals(goalNode.getDigit().getDigitString())){\n //goal is reached.\n solutionPath(current);\n expanded.add(current);\n printExpanded(expanded);\n System.exit(0);\n }\n\n\n boolean b = cycleCheck(current,expanded);\n\n if(!b) {\n expanded.add(current);\n }\n\n if(!b){\n\n if(current.getDigit().last_changed != 0){\n\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child first digit\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n\n }\n }\n\n if(current.getDigit().last_changed != 1){\n\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n if(current.getDigit().last_changed != 2){\n if ((Integer.parseInt(current.getDigit().getThird_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n //+1 child\n if ((Integer.parseInt(current.getDigit().getThird_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n }\n\n\n\n for(Node n : fringe){\n heuristicSetter(n);\n\n }\n\n fringeTemp.addAll(fringe);\n //now all the nodes in fringe have the heuristic value.\n //We can get the last added minm\n Node minm;\n if(fringeTemp.size() != 0){\n minm = fringeTemp.get(0);\n }else{\n break;\n }\n for(int i = 1; i<fringeTemp.size(); i++){\n if(fringeTemp.get(i).getHeuristic() <= minm.getHeuristic()){\n minm = fringeTemp.get(i);\n }\n }\n\n //now we have the minm for the next stage.\n current = minm;\n fringeTemp.remove(minm);\n fringe.clear();\n }\n\n //While loop ends\n System.out.println(\"No solution found.\");\n printExpanded(expanded);\n\n\n\n }",
"protected void enlarge ()\n {\n // The new capacity of the graph\n int newLength = 1 + vertices.length + ENLARGE_VALUE * vertices.length / 100;\n\n E[] newVertices = (E[]) new Object[newLength];\n Node[] newAdjacencySequences = new Node[newLength];\n \n for (int index = 0; index <= lastIndex; index++)\n {\n newVertices[index] = vertices[index];\n vertices[index] = null;\n newAdjacencySequences[index] = adjacencySequences[index];\n adjacencySequences[index] = null;\n }\n\n vertices = newVertices;\n adjacencySequences = newAdjacencySequences;\n }",
"private void expandNode(final Node previewNode) {\n\t\tif (this.debugOut)\n\t\t\tSystem.out.println(\"@expandNode (\" + previewNode.getTile().getPosVector() + \"): \");\n\t\tDirection dir[];\n\t\tdir = Direction.values();\n\t\tfor (int i = 3; i >= 0; i--) {\n\n\t\t\tVector2 newPos = calcNewPos(previewNode.getTile().getPosVector(), dir[i]);\n\t\t\tif (this.debugOut)\n\t\t\t\tSystem.out.print(\"Pos \" + newPos + \" got: \");\n\n\t\t\tif (newPos.getX() >= this.state.getCurrViewSizeLimit().getX()\n\t\t\t\t\t|| newPos.getY() >= this.state.getCurrViewSizeLimit().getY() || newPos.getX() < 0\n\t\t\t\t\t|| newPos.getY() < 0) {\n\t\t\t\tif (this.debugOut) {\n\t\t\t\t\tSystem.out.println(\"OUT (out of level/array limits)\");\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Ignore walls and pits\n\t\t\t// preview node cant be a wall or something\n\t\t\t// make no sense @see PacmanSuche\n\n\t\t\tNode successor = new Node(state.getTile(newPos), previewNode);\n\t\t\tTileType sucType = successor.getTile().getTileType();\n\n\t\t\tif (sucType == TileType.WALL || sucType == TileType.PIT) {\n\t\t\t\tthis.closedList.add(successor);\n\t\t\t\tif (this.debugOut)\n\t\t\t\t\tSystem.out.println(\"OUT (wall/pit)\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (this.closedList.contains(successor)) {\n\t\t\t\tif (this.debugOut)\n\t\t\t\t\tSystem.out.println(\"OUT (is already in closedList)\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tevaluateNode(successor);\n\t\t\tif (this.debugOut)\n\t\t\t\tSystem.out.print(\"[\" + successor.getValue() + \"]\");\n\t\t\taddNode(successor);\n\t\t}\n\t}",
"private final void relaxNeighbors(_Node unsettledNode)\r\n {\r\n for (_Edge destinationEdge : map.getDestinations(unsettledNode))\r\n {\r\n \tif (isSettled(destinationEdge.getEndNode())) continue;\r\n \tint shortDist = getShortestDistance(unsettledNode) + destinationEdge.getWeight();// map.getDistance(unsettledNode, destinationEdge.getEndNode());\r\n if (shortDist <= getShortestDistance(destinationEdge.getEndNode()))\r\n {\r\n setShortestDistance(destinationEdge.getEndNode(), shortDist);\r\n setPredecessor(destinationEdge.getEndNode(),unsettledNode);\r\n }\r\n } \r\n }",
"ArrayList<PathFindingNode> neighbours(PathFindingNode node);",
"public void addNode() {\n if (nodeCount + 1 > xs.length)\n resize();\n nodeCount++;\n }",
"private static void expandSearchNode(Unit unit, GameMap map, SearchNode currentNode, Queue<SearchNode> searchQueue,\n int[][] costGrid, boolean theoretical)\n {\n XYCoord[] coordsToCheck = { new XYCoord(currentNode.x + 1, currentNode.y), new XYCoord(currentNode.x - 1, currentNode.y),\n new XYCoord(currentNode.x, currentNode.y + 1), new XYCoord(currentNode.x, currentNode.y - 1) };\n\n for( XYCoord next : coordsToCheck )\n {\n // Check that we could potentially move into this space.\n if( checkSpace(unit, map, currentNode, next, theoretical) )\n {\n // If we can move there for less cost than previously discovered,\n // then update the cost grid and re-queue the next node.\n int costSoFar = costGrid[currentNode.x][currentNode.y];\n int moveCost = findMoveCost(unit, next.xCoord, next.yCoord, map);\n int newNextCost = costSoFar + moveCost;\n int oldNextCost = costGrid[next.xCoord][next.yCoord];\n\n // If we are playing \"What if\" then don't worry too much about move cost.\n int movePower = Math.min(unit.model.movePower, unit.fuel) - costSoFar;\n boolean canMove = (theoretical) ? true : (moveCost <= movePower);\n\n if( canMove && (newNextCost < oldNextCost) )\n {\n costGrid[next.xCoord][next.yCoord] = newNextCost;\n searchQueue.add(new SearchNode(next, currentNode));\n }\n }\n }\n }",
"public abstract List<AStarNode> getNeighbours();",
"private void addAllNeighbours(@NonNull final Location searchLoc) {\n for (int x = -1; x < 2; x++) {\n for (int y = -1; y < 2; y++) {\n if ((x == 0) && (y == 0)) {\n continue;\n }\n final long foundKey = Location.getKey(searchLoc.getScX() + x, searchLoc.getScY() + y,\n searchLoc.getScZ());\n synchronized (unchecked) {\n if (!unchecked.contains(foundKey)) {\n unchecked.add(foundKey);\n }\n }\n }\n }\n \n final long foundKey = Location.getKey(searchLoc.getScX(), searchLoc.getScY(), searchLoc.getScZ() + 1);\n synchronized (unchecked) {\n if (!unchecked.contains(foundKey)) {\n unchecked.add(foundKey);\n }\n }\n }",
"public void BFS() {\n visitedCells = 1;\n\n // Initialize the vertices\n for (int j = 0; j < maze.getGrid().length; j++) {\n for (int k = 0; k < maze.getGrid().length; k++) {\n Cell cell = maze.getGrid()[j][k];\n cell.setColor(\"WHITE\");\n cell.setDistance(0);\n cell.setParent(null);\n }\n }\n\n Cell sourceCell = maze.getGrid()[0][0];\n Cell neighbor = null;\n Cell currentCell;\n int distance = 0;\n\n // Initialize the source node\n sourceCell.setColor(\"GREY\");\n sourceCell.setDistance(0);\n sourceCell.setParent(null);\n\n queue.add(sourceCell);\n\n // Visits each cell until the queue is empty\n while (!queue.isEmpty()) {\n currentCell = queue.remove();\n\n for (int i = 0; i < currentCell.mazeNeighbors.size(); i++) {\n neighbor = currentCell.mazeNeighbors.get(i);\n\n // Stop the search if you reach the final cell\n if (neighbor.x == r - 1 && neighbor.y == r - 1) {\n distance++;\n if (distance == 10)\n distance = 0;\n neighbor.setDistance(distance);\n neighbor.setParent(currentCell);\n neighbor.visited = true;\n visitedCells++;\n break;\n }\n\n // Checks each neighbor and adds it to the queue if its color is white\n if (neighbor.getColor().equalsIgnoreCase(\"WHITE\")) {\n distance++;\n if (distance == 10)\n distance = 0;\n neighbor.setColor(\"GREY\");\n neighbor.setDistance(distance);\n neighbor.setParent(currentCell);\n neighbor.visited = true;\n queue.add(neighbor);\n visitedCells++;\n }\n }\n // Stop the search if you reach the final cell\n if (neighbor.x == r - 1 && neighbor.y == r - 1)\n break;\n\n currentCell.setColor(\"BLACK\");\n }\n }",
"private void expandTree() {\n tree.expand();\n }",
"public void addToNeighbours(Tile N) {\n \r\n neighbours.add(N);\r\n }",
"private Board newNeighbor(int searchNode, int target)\n {\n char[] temp = blocks.clone();\n temp[searchNode] = temp[target];\n temp[target] = (char) 0;\n return new Board(convertTo2D(temp));\n }",
"private void setNeighboringMines(){\n\t\t//cycle the board\n\t\tfor (int r = 0; r < board.length; r++)\n\t\t\tfor (int c = 0; c < board[r].length; c++){\n\t\t\t\tint neighborCount = 0;\n\t\t\t\tif(!board[r][c].isMine()) {\n\t\t\t\t\t//checks if there is mines touching\n\t\t\t\t\tneighborCount = neighboringMines(r, c);\n\t\t\t\t\tif (neighborCount > 0) {\n\t\t\t\t\t\tboard[r][c].setIsNeighboringMine(true);\n\t\t\t\t\t\tboard[r][c].setNumNeighboringMines\n\t\t\t\t\t\t\t\t(neighborCount);\n\t\t\t\t\t} else if (neighborCount == 0) {\n\t\t\t\t\t\tboard[r][c].setNumNeighboringMines(0);\n\t\t\t\t\t\tboard[r][c].setIsNeighboringMine(false);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void removeNeighbours(){\n\t\tgetNeighbours().removeAll(getNeighbours());\n\t}",
"private Node selectAndExpandNewNode() {\n // Start at the root\n Node node = root;\n\n // Iterate down the tree until reaching a goal state\n while (node.getState().getPos() < problemSpec.getN()) {\n // Get the best action from the current node using UCT\n Action action = selectBestAction(node);\n\n // Simulate a single action\n FromStateSimulator FSS = new FromStateSimulator(problemSpec);\n FSS.setStartState(node.getState(), stepsDone + node.getStepsFromRoot());\n FSS.step(action);\n State newState = FSS.getCurrentState();\n\n // Get the node representing the outcome of the transition\n Node child = node.childWithStateAction(newState, action);\n\n // If this outcome node has not been added to the tree, add it\n if (child == null) {\n Node newNode = new Node(newState, FSS.getSteps());\n newNode.setParentNodeAndAction(node, action);\n node.addChildNode(newNode);\n\n // Return this new node\n return newNode;\n }\n\n // Now repeat the process using this child node\n node = child;\n }\n\n return node;\n }",
"private void resize() {\n int newSize = (xs.length * 3) / 2;\n int[] newXs = new int[newSize];\n int[] newYs = new int[newSize];\n int[] newIn = new int[newSize];\n int[] newOut = new int[newSize];\n int[][] newRoads = new int[newSize][newSize];\n int[][] newDist = new int[newSize][newSize];\n boolean[] newVal = new boolean[newSize];\n System.arraycopy(xs, 0, newXs, 0, nodeCount);\n System.arraycopy(ys, 0, newYs, 0, nodeCount);\n System.arraycopy(inDegree, 0, newIn, 0, nodeCount);\n System.arraycopy(outDegree, 0, newOut, 0, nodeCount);\n System.arraycopy(invalid, 0, newVal, 0, nodeCount);\n for (int i = 0; i < nodeCount; i++) {\n System.arraycopy(roads[i], 0, newRoads[i], 0, nodeCount);\n System.arraycopy(distances[i], 0, newDist[i], 0, nodeCount);\n }\n xs = newXs;\n ys = newYs;\n inDegree = newIn;\n outDegree = newOut;\n roads = newRoads;\n distances = newDist;\n invalid = newVal;\n }",
"private LinkedList<int[]> neighborFinder(){\n LinkedList<int[]> neighborhood= new LinkedList<>();\n int[] curr_loc = blankFinder();\n int x = curr_loc[0];\n int y = curr_loc[1];\n if(x >0){\n neighborhood.add(new int[]{x-1, y});\n }\n if(x < n-1){\n neighborhood.add(new int[]{x+1, y});\n }\n if(y > 0){\n neighborhood.add(new int[]{x, y-1});\n }\n if(y < n-1) {\n neighborhood.add(new int[]{x, y+1});\n }\n\n\n return neighborhood;\n }",
"@SuppressWarnings(\"unchecked\")\r\n private void expand() {\r\n // if the capacity is 0, expand the table by adding 1 to capacity\r\n if (capacity == 0) {\r\n capacity = 1;\r\n hashTable = new LinkedList[capacity]; // New hash table with capacity of 1\r\n return;\r\n }\r\n\r\n int originalCapacity = capacity; // Capacity before expanding\r\n capacity *= 2;\r\n LinkedList<HashNode>[] newList = new LinkedList[capacity]; // New hash table with double capacity\r\n\r\n // iterate every element in the old hash table and rehash them back into the new hash table\r\n for (int i = 0; i < originalCapacity; i++) {\r\n // if the linked list in each node is not null, rehash all elements in it\r\n if (hashTable[i] != null) {\r\n for (HashNode node : hashTable[i]) {\r\n KeyType tempKey = node.key; // The node in the linked list\r\n int newIndex = hashFunction(tempKey); // index after rehashing the key\r\n // If the new index's linked list is null, create one and add the node.\r\n // Otherwise, directly add the node\r\n if (newList[newIndex] == null) {\r\n newList[newIndex] = new LinkedList<>();\r\n }\r\n newList[newIndex].add(new HashNode(node.key, node.value));\r\n }\r\n }\r\n }\r\n // assign the reference to the new hash table\r\n hashTable = newList;\r\n }",
"public ArrayList<SearchNode> neighbors() {\n ArrayList<SearchNode> neighbors = new ArrayList<SearchNode>();\n // StdOut.println(\"before: \" + this.snBoard);\n Iterable<Board> boards = new ArrayList<Board>();\n boards = this.snBoard.neighbors();\n // StdOut.println(\"after: \" + this.snBoard);\n for (Board b: boards) {\n // StdOut.println(b);\n // StdOut.println(\"checking: \"+b);\n // StdOut.println(\"checking father: \"+this.getPredecessor());\n if (this.getPredecessor() == null) {\n SearchNode sn = new SearchNode(b,\n b.hamming(),\n this,\n b.manhattan(),\n this.moves+1);\n // StdOut.println(\"checking: \"+(this.priority - this.snBoard.hamming()));\n // StdOut.println(\"checking: \"+(this.priority - this.snBoard.hamming()));\n // sn.addMovesToPriority(this.priority - this.snBoard.hamming()+1);\n neighbors.add(sn);\n } else { \n if (!b.equals(this.getPredecessor().snBoard)) {\n SearchNode sn = new SearchNode(b,\n b.hamming(),\n this,\n b.manhattan(),\n this.moves+1);\n neighbors.add(sn);\n }\n }\n \n }\n return neighbors;\n }",
"private void relax(DijkstraNode dijkNode) {\n Node originalNode = dijkNode.getOriginalNode();\n\n for(Node neighborNode : getNeighbors(originalNode)) {\n DijkstraNode neighborDijkNode = nodeMap.get(neighborNode);\n int oldDistance = neighborDijkNode.getDistance();\n int newDistance = dijkNode.getDistance() + originalNode.getEdgeWeight(neighborNode);\n\n if(oldDistance > newDistance) {\n neighborDijkNode.setDistance(newDistance);\n neighborDijkNode.setPredecessor(dijkNode);\n // https://stackoverflow.com/questions/1871253/updating-java-priorityqueue-when-its-elements-change-priority\n // you have to remove and re-insert the node, because ProrityQueue won't update automatically.\n // it works by putting the new element at the right position\n distanceQueue.remove(neighborDijkNode);\n distanceQueue.add(neighborDijkNode);\n }\n }\n }",
"@SuppressWarnings(\"unchecked\")\n void expand()\n {\n // Remember the old table.\n Object[] old = this.buckets;\n\n // Figure out the capacity of the new table, making it somewhat\n // unpredictable.\n int newCapacity = 2 * this.buckets.length + rand.nextInt(10);\n\n // Create a new table of that capacity.\n this.buckets = new Object[newCapacity];\n\n // Reset the size since we'll be adding elements in a moment.\n this.size = 0;\n\n // Move all the values from the old table to their appropriate\n // location in the new table.\n for (int i = 0; i < old.length; i++)\n {\n AssociationList<K, V> bucket = (AssociationList<K, V>) old[i];\n if (bucket != null)\n {\n AssociationList<K, V>.Node current = bucket.front.next;\n while (current != null)\n {\n this.set(current.key, current.value);\n current = current.next;\n } // while\n } // if (bucket != null)\n } // for\n }",
"public void addNode( SearchNode n, boolean fromStart ) {\n\n\t\tSearchNode [][] nodes_as_image = fromStart ? nodes_as_image_from_start : nodes_as_image_from_goal;\n\n\t\tif( nodes_as_image[n.z] == null ) {\n\t\t\tnodes_as_image[n.z] = new SearchNode[width*height];\n\t\t}\n\n\t\tif( nodes_as_image[n.z][n.y*width+n.x] != null ) {\n\t\t\t// Then there's already a node there:\n\t\t\treturn;\n\t\t}\n\n\t\tif( n.searchStatus == OPEN_FROM_START ) {\n\n\t\t\topen_from_start.add( n );\n\t\t\tnodes_as_image[n.z][n.y*width+n.x] = n;\n\n\t\t} else if( n.searchStatus == OPEN_FROM_GOAL ) {\n\t\t\tassert bidirectional && definedGoal;\n\n\t\t\topen_from_goal.add( n );\n\t\t\tnodes_as_image[n.z][n.y*width+n.x] = n;\n\n\t\t} else if( n.searchStatus == CLOSED_FROM_START ) {\n\n\t\t\tclosed_from_start.add( n );\n\t\t\tnodes_as_image[n.z][n.y*width+n.x] = n;\n\n\t\t} else if( n.searchStatus == CLOSED_FROM_GOAL ) {\n\t\t\tassert bidirectional && definedGoal;\n\n\t\t\tclosed_from_goal.add( n );\n\t\t\tnodes_as_image[n.z][n.y*width+n.x] = n;\n\n\t\t}\n\n\t}",
"public void addToNextMoves(GameTile[][] visibleMap) {\r\n\t\t\r\n\t\t//Breadth First Search Code\r\n//\t\tWumpusState state = new WumpusState(visibleMap, playerX, playerY, wumpusX, wumpusY);\r\n\r\n\t\tQueue<WumpusState> queue = new LinkedList<WumpusState>();\t\t\t\t//use the queue in the same way\t\r\n\t\tHashMap<String, Boolean> visitedStates = new HashMap<String, Boolean>();\t//add all children to the queue, \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//add all the children to the hash and set values to true.\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//once all the children have been visited, generate children sequentially for the children that already been added \r\n\t\tWumpusState state = new WumpusState(visibleMap, playerX, playerY);\r\n\t\tlong nodesExpanded = 0;\r\n\t\t\r\n\t\tqueue.add(state);\r\n\t\twhile(!queue.isEmpty()) {\r\n\t\t\tWumpusState currentState = queue.remove();\r\n\t\t\tSystem.out.println(currentState.toString());\r\n\t\t\tif(currentState.getPlayerX() == 4 && currentState.getPlayerY() == 1) {\r\n\t\t\t\tnodesExpanded = visitedStates.size();\r\n\t\t\t\tSystem.out.println(\"Nodes Expanded: \"+nodesExpanded);\r\n\t\t\t\tArrayList<AgentAction> actions = currentState.getAllActions();\r\n\t\t\t\tfor(int i=1;i<actions.size(); i++) {\r\n\t\t\t\t\tSystem.out.println(actions.get(i));\r\n\t\t\t\t\tnextMoves.add(actions.get(i));\r\n\t\t\t\t}\r\n\t\t\t\tnextMoves.add(AgentAction.declareVictory);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif(visitedStates.containsKey(currentState.toString())) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvisitedStates.put(currentState.toString(), true);\r\n\t\t\t\tWumpusState[] childrenOfCurrentChild = currentState.generateChildrenStates();\r\n\t\t\t\tfor(int j=0; j<childrenOfCurrentChild.length; j++) {\r\n\t\t\t\t\tif(childrenOfCurrentChild[j]!=null) {\r\n\t\t\t\t\t\tqueue.add(childrenOfCurrentChild[j]);\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}",
"private void expand(XGraph.XVertex source, Graph.Edge edge) {\n source.seen = true;\n XGraph.XEdge xEdge = (XGraph.XEdge) edge;\n if (source.isComponent()) {\n //Expand the component, with original edge's end vertex as root\n expand(graph.getVertex(xEdge.getOriginal().toVertex()), xEdge.getOriginal());\n } else if (edge != null) {\n source.stEdge = xEdge.getOriginal();\n }\n //explore other components\n for (Graph.Edge e : source) {\n if (!graph.getVertex(e.toVertex()).seen) {\n expand(graph.getVertex(e.toVertex()), e);\n }\n }\n }",
"private void dfsVisit(Node node) {\n\t\tStack<Node>stack = new Stack<>();\r\n\t\tstack.push(node); //add source node to queue\r\n\t\twhile(!stack.isEmpty()) {\r\n\t\t\tNode presentNode = stack.pop();\r\n\t\t\tpresentNode.setVisited(true);\r\n\t\t\tSystem.out.print(presentNode.getName()+\" \");\r\n\t\t\tfor(Node neighbor: presentNode.getNeighbors()) { //for each neighbor of present node\r\n\t\t\t\tif(!neighbor.isVisited()) { //if neighbor is not visited then add it to queue\r\n\t\t\t\t\tstack.push(neighbor);\r\n\t\t\t\t\tneighbor.setVisited(true);\r\n\t\t\t\t}\r\n\t\t\t}//end of for loop\r\n\t\t}//end of while loop\r\n\t\t\r\n\t}",
"public static void expandirNodo(Nodo nodoAexp , ArrayList<Nodo>frontera ,\n \t\t HeuristicaInterf heur, HashMap <String, String> mapaEstadosgen ){ \n //listado de nodos posibles al expandir\n ArrayList <Accion> acciones = nodoAexp.estado.accionesPosibles(null);\n Iterator<Accion> itrAcciones = acciones.iterator();\n\n \n int mejorCosto = -1 ;\n \n ArrayList<Nodo> mejoresNodos = new ArrayList<Nodo>();\n \n int costoTotalNodo = 0 ;\n \n \twhile (itrAcciones.hasNext()) {\n \t\t\n Accion accion = itrAcciones.next();\n \n Tablero nuevoEstado = nodoAexp.estado.clonar();\n nuevoEstado.mover( accion ); \n \n //control para evitar evaluar heuristicas para estados ya generados\n String hashmatriz = nuevoEstado.toStrHash();\n \n if ( mapaEstadosgen.containsKey( hashmatriz )){\n \tcontinue ;\n }\n \n mapaEstadosgen.put(hashmatriz, hashmatriz);\n \n \n // se obtine el costo del posible nodo a expandir y se crea un tablero con el estado correspóndiente\n int costoH = heur.heuristica (nuevoEstado.matriz, Problema.MATRIZ_META );\n \n Nodo nuevoNodo = new Nodo(nodoAexp,nuevoEstado,accion,costoH );\n \n costoTotalNodo = nuevoNodo.getCosto();\n \n if ( mejorCosto < 0 ) mejorCosto = costoTotalNodo ;\n \n if (costoTotalNodo <= mejorCosto ){\n\t\t\n \tmejorCosto = costoTotalNodo ;\n \t\n \tmejoresNodos.add( nuevoNodo );\n } \n \n //System.out.println(nuevoNodo.getAccion()+\" queda \"+nuevoEstado.toString()+\" costo \"+nuevoNodo.getCosto());\n \n \t}\n \tint tam = mejoresNodos.size();\n \t\n \tfor(int i = 0 ; i <tam ; i++){\n \t\tif( mejoresNodos.get(i).getCosto() <= mejorCosto )\n \t\t\t\n \t\t\tfrontera.add(mejoresNodos.get( i ));\n \t}\n }",
"public abstract LinkedList<Integer> getNeighbours(int index);",
"private void expandNode(Node parentNode) {\n VBox childrenVBox = parentNode.getChildrenVBox();\n PlaceManager placeManager = PlaceManager.getInstance();\n Place sourcePlace = placeManager.getPlace(parentNode.getNodeId());\n ArrayList<Place> childrenPlaces = sourcePlace.getChildren();\n\n if (!childrenPlaces.isEmpty()) {\n for (Place place : childrenPlaces) {\n String id = place.getId();\n String name = place.getName();\n String type = place.getType().toString();\n String displayName = place.toString();\n Node childNode = new Node(id, name, type, displayName, controller);\n nodes.add(childNode);\n childrenVBox.getChildren().add(childNode.getContainerPane());\n childrenVBox.layout();\n }\n }\n redrawEdges(parentNode);\n }",
"private void expandFrom(int r, int c)\n {\n if(withinBounds(r,c) == false)\n return;\n\n if(visited[r][c] == false)\n return;\n\n if(visited[r][c] == true)\n visited[r][c] = false;\n\n expandFrom(r-1,c-1);\n expandFrom(r-1,c);\n expandFrom(r-1,c+1);\n expandFrom(r,c+1);\n expandFrom(r+1,c+1);\n expandFrom(r+1,c);\n expandFrom(r+1,c-1);\n expandFrom(r,c-1);\n }",
"private void expandCapacity() {\n T[] tempVertices = (T[])(new Object[vertices.length * 2]);\n int[][] tempEdges = new int[vertices.length * 2][vertices.length * 2];\n \n for (int i = 0; i < n; i++) {\n tempVertices[i] = vertices[i];\n for (int j = 0; j < n; j++) {\n tempEdges[i][j] = edges[i][j];\n }\n }\n \n vertices = tempVertices;\n edges = tempEdges;\n }",
"protected void expand() {\n matrix = matrix.power(e);\n }",
"@Nonnull\n static <T> Node<T> expandLeafNode(int maxSize,\n boolean forwardOrder,\n @Nonnull LeafNode<T> nodeToFill,\n @Nonnull Iterator<? extends T> values)\n {\n assert maxSize >= nodeToFill.size();\n final LeafBuilder<T> builder = new LeafBuilder<>(forwardOrder);\n final Indexed<T> nodeValues = nodeToFill.values();\n final Iterable<T> prefill = forwardOrder ? IndexedIterator.fwd(nodeValues) : IndexedIterator.rev(nodeValues);\n for (T t : prefill) {\n builder.add(t);\n }\n while (values.hasNext() && (builder.size < maxSize)) {\n builder.add(values.next());\n }\n return builder.build();\n }",
"public void updateNeighbourhood(ArrayList<Node> newNeighbors) {\n\t\tif (newNeighbors.isEmpty() && CDState.getCycle() < crashCycle ){\n\t\t\tthrow new RuntimeException(\"no neighbor found-isolated node\");\n\t\t}\n\t\n\t\tArrayList<Node> added = new ArrayList<Node>(newNeighbors);\n\t\t//added has now all the neighbors(new and old)\n\t\t//remove all the old neighbors\n\t\tadded.removeAll(this.getNeighbors());\n\n\t\tArrayList<Node> removed = new ArrayList<Node>(this.getNeighbors());\n\t\t//removed has now all the old neighbors\n\t\tremoved.removeAll(newNeighbors);\n\n\t\tthis.setNeighbors(newNeighbors);\n\n\t\tDiscoveryListener universeProtocol = (DiscoveryListener) \n\t\t\t\tcurrentNode.getProtocol(universeProtocolId);\n\t\t\n\t\t//add to the list of ur neighbors\n\t\tif (!added.isEmpty()){\n\t\t\t// Notify the higher layers that certain nodes have been discovered.\n\t\t\t//System.out.println(\"cadded\"+ CDState.getCycle() +\",Node: \"+currentNode.getID());\n\t\t\tuniverseProtocol.notifyAddedNodes(currentNode, added);\n\t\t}\n\t\t\n\t\tif (!removed.isEmpty()){\n\t\t\t// Notify the higher layers that certain nodes have been removed.\n\t\t\t//System.out.println(\"cremoved\"+ CDState.getCycle() +\",Node: \"+currentNode.getID());\n\t\t\tuniverseProtocol.notifyRemovedNodes(currentNode, removed);\n\t\t}\n\t\t//System.out.println(\"Node \"+currentNode.getID() + \" neighbors: \" + neighbors.size()); \n\t\tif(neighbors.size()> Neighbor_Threshold){\n\t\t\tthrow new RuntimeException(\"PASSS the maximum number of neighbors plz reduce the discovery radius!\");\n\t\t}\n\t}",
"private void e_Neighbours(int u){ \n int edgeDistance = -1; \n int newDistance = -1; \n \n // All the neighbors of v \n for (int i = 0; i < adj.get(u).size(); i++) { \n Node v = adj.get(u).get(i); \n \n // If current node hasn't already been processed \n if (!settled.contains(v.node)) { \n edgeDistance = v.cost; \n newDistance = dist[u] + edgeDistance; \n \n // If new distance is cheaper in cost \n if (newDistance < dist[v.node]) \n dist[v.node] = newDistance; \n \n // Add the current node to the queue \n pq.add(new Node(v.node, dist[v.node])); \n } \n } \n }",
"public void expandAllNodes(JTree tree, int startingIndex, int rowCount){\n for(int i=startingIndex;i<rowCount;++i){\n tree.expandRow(i);\n }\n\n if(tree.getRowCount()!=rowCount){\n expandAllNodes(tree, rowCount, tree.getRowCount());\n }\n}",
"public abstract boolean setNodeExpanded(int nodeIndex,boolean true_is_yes);",
"protected void addingNode( SearchNode n ) { }",
"private static int getCheapestEdgeToExploredNodes(int nextMinValNode, \n\t\t\tHashMap<Integer,HashMap<Integer,Double>> sourceGTree, \n\t\t\tLinkedList<Integer> nodesInMstree) {\n int newNode=0;\n double cheapestWeight = Double.POSITIVE_INFINITY;\n\n\t/* looping over unexplored nodes from nextMinValNode */\n for (Map.Entry<Integer, Double> edge : sourceGTree.get(nextMinValNode).entrySet()) {\n\n /* not yet in mst */\n if (!nodesInMstree.contains(edge.getKey())) continue;\n\n /* this edge is not better */\n if ( edge.getValue() >= cheapestWeight ) continue;\n\n\t /* this is better , so save it */\n newNode = edge.getKey();\n cheapestWeight = edge.getValue();\n }\n\n return newNode;\n }",
"private void resize(int newCapacity)\n {\n Node[] buffer = new Node[newCapacity];\n\n for (Node bucket : buckets)\n {\n if (bucket != null)\n {\n Node current = bucket;\n while (current != null)\n {\n int h = current.hashCode();\n h = h % buffer.length;\n if (h < 0) { h = -h; }\n\n buffer[h] = current;\n current = current.next;\n }\n }\n }\n buckets = buffer;\n }",
"@Override\n protected KPMPSolution nextNeighbour() {\n List<KPMPSolutionWriter.PageEntry> edgePartition = bestSolution.getEdgePartition().stream().map(KPMPSolutionWriter.PageEntry::clone).collect(toCollection(ArrayList::new));\n KPMPSolution neighbourSolution = new KPMPSolution(bestSolution.getSpineOrder(), edgePartition, bestSolution.getNumberOfPages());\n edge = edgePartition.get(index);\n originalPageIndex = edge.page;\n newPageIndex = pageCounter;\n edgePartition.get(index).page = newPageIndex;\n index++;\n numberOfIterations++;\n return neighbourSolution;\n }",
"@Override\n\tpublic void search() {\n\t\tpq = new IndexMinPQ<>(graph.getNumberOfStations());\n\t\tpq.insert(startIndex, distTo[startIndex]);\n\t\twhile (!pq.isEmpty()) {\n\t\t\tint v = pq.delMin();\n\t\t\tnodesVisited.add(graph.getStation(v));\n\t\t\tnodesVisitedAmount++;\n\t\t\tfor (Integer vertex : graph.getAdjacentVertices(v)) {\t\n\t\t\t\trelax(graph.getConnection(v, vertex));\n\t\t\t}\n\t\t}\n\t\tpathWeight = distTo[endIndex];\n\t\tpathTo(endIndex);\n\t}",
"private void expand(){\n \n int newSize = size + expand;\n E[] tempArray = (E[]) new Object[newSize];\n for(int n = 0; n < size; n++){\n tempArray[n] = stackArray[n]; \n }\n stackArray = tempArray;\n size = newSize;\n }",
"@Override\n List<NodeData> pathFind() throws NoPathException {\n System.out.println(\"Starting Scenic\");\n\n frontier.add(start);\n\n while(!frontier.isEmpty()) {\n StarNode current = frontier.getLast();\n frontier.removeLast(); // pop the priority queue\n if(current.getXCoord() == goal.getXCoord() && current.getYCoord() == goal.getYCoord()) {\n // If we are at the goal, we need to backtrack through the shortest path\n System.out.println(\"At target!\");\n finalList.add(current); // we have to add the goal to the path before we start backtracking\n while(!(current.getXCoord() == start.getXCoord() && current.getYCoord() == start.getYCoord())) {\n finalList.add(current.getPreviousNode());\n current = current.getPreviousNode();\n System.out.println(current.getNodeID());\n }\n return finalList;\n }\n else {\n // we need to get all the neighbor nodes, identify their costs, and put them into the queue\n LinkedList<StarNode> neighbors = current.getNeighbors();\n // we also need to remove the previous node from the list of neighbors because we do not want to backtrack\n neighbors.remove(current.getPreviousNode());\n\n for (StarNode newnode : neighbors) {\n int nodePlace = this.listContainsId(frontier, newnode);\n if(nodePlace > -1) {\n if (frontier.get(nodePlace).getF() > actionCost(newnode) + distanceToGo(newnode, goal)) {\n System.out.println(\"Here\");\n frontier.remove(frontier.get(nodePlace));\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n }\n else {\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n\n // This fixes the problem with infinitely looping elevators (I hope)\n if(current.getNodeType().equals(\"ELEV\") && newnode.getNodeType().equals(\"ELEV\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"ELEV\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n if(current.getNodeType().equals(\"STAI\") && newnode.getNodeType().equals(\"STAI\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"STAI\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n // this is where the node is put in the right place in the queue\n Collections.sort(frontier);\n }\n }\n }\n throw new NoPathException(start.getLongName(), goal.getLongName());\n }",
"public void addNeighbor(MyNode myNode){\r\n if (!neighbors.contains(myNode)) {\r\n neighbors.add(myNode);\r\n }\r\n }",
"private void resizeAndTransfer() {\r\n Node<K, V>[] newData = new Node[data.length * 2];\r\n\r\n for (int i = 0; i < data.length; i++) {\r\n if (data[i] != null) {\r\n addExistingElement(new Node(data[i].key, data[i].value), newData);\r\n Node currentElement = data[i];\r\n while (currentElement.next != null) {\r\n currentElement = currentElement.next;\r\n addExistingElement(new Node(currentElement.key, currentElement.value), newData);\r\n }\r\n }\r\n }\r\n data = newData;\r\n }",
"private void addNodeNeighbour(Node aNode, int aX, int aY, Node[][] allNodes) {\n if (aX >= 0 && aX < allNodes.length && aY >=0 && aY < allNodes[0].length) {\n aNode.addNeighbour(allNodes[aX][aY]);\n }\n }",
"void removeNeighbors();",
"public void changingNeighbor() {\n }",
"public MyNode(Station station){\r\n this.station=station;\r\n this.neighbors=new LinkedList<MyNode>();\r\n }",
"void addNeighborEdge(Edge e) {\n\t\t\t_neighborEdges.put(e,false);\n\t\t}",
"private void recalculateNeighbours(int x, int y) {\r\n\t\tTile t = map.getTile(x, y + 1, 0);\r\n\t\tif (t != null) {\r\n\t\t\tt.toMap(this, x, y + 1, false);\r\n\t\t}\r\n\t\tt = map.getTile(x + 1, y, 0);\r\n\t\tif (t != null) {\r\n\t\t\tt.toMap(this, x + 1, y, false);\r\n\t\t}\r\n\t\tt = map.getTile(x, y - 1, 0);\r\n\t\tif (t != null) {\r\n\t\t\tt.toMap(this, x, y - 1, false);\r\n\t\t}\r\n\t\tt = map.getTile(x - 1, y, 0);\r\n\t\tif (t != null) {\r\n\t\t\tt.toMap(this, x - 1, y, false);\r\n\t\t}\r\n\t}",
"private void expandTree() {\n for (int i=0; i<tree.getRowCount(); i++) {\n tree.expandRow(i);\n }\n }",
"private void expandAllNodes(JTree tree, int startingIndex, int rowCount) {\n for (int i = startingIndex; i < rowCount; ++i) {\n tree.expandRow(i);\n }\n\n if (tree.getRowCount() != rowCount) {\n expandAllNodes(tree, rowCount, tree.getRowCount());\n\n }\n }",
"@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }",
"public void addNeighbor(Node node){\n neighbors.add(node);\n liveNeighbors.add(node);\n }",
"public void rebuild() {\n\t\tif (!divided) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint totalChildren = 0;\n\t\tfor (QuadTreeNode<E> q : nodes) {\n\t\t\t// If there is a divided child then we cant do anything\n\t\t\tif (q.isDivided()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\ttotalChildren += q.numPoints();\n\t\t}\n\t\t\n\t\t// If the sum of all the children contained in the sub nodes\n\t\t// is greater than allowed then we cant do anything\n\t\tif (totalChildren > QUADTREE_NODE_CAPACITY) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Add all the nodes from the children to this node then remvoe the nodes\n\t\tpoints = new HashMap<Point, E>();\n\t\tfor (QuadTreeNode<E> q : nodes) {\n\t\t\tpoints.putAll(q.points);\n\t\t}\n\t\t\n\t\tnodes.clear();\n\t\tdivided = false;\n\t}",
"public abstract boolean \tgetNodeExpanded(int nodeIndex);",
"private void updateNodes(){\n ArrayList<Node> tempBoard = new ArrayList<>();\n\n for(int i = 0; i < board.size(); i++){\n Node node = new Node(board.get(i).getCoordinates());\n\n tempBoard.add(node);\n }\n\n\n //check each node for number of live nodes next to it to determine next iteration\n for(int i = 0; i < board.size(); i++){\n int liveCount = 0;\n\n Coordinate current = board.get(i).getCoordinates();\n\n Coordinate above = new Coordinate(current.getX(), current.getY() - 1);\n if(searchBoard(above) != -1){\n Node aboveNode = board.get(searchBoard(above));\n if(aboveNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate bellow = new Coordinate(current.getX(), current.getY() + 1);\n if(searchBoard(bellow) != -1){\n Node bellowNode = board.get(searchBoard(bellow));\n if(bellowNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate right = new Coordinate(current.getX() + 1, current.getY());\n if(searchBoard(right) != -1){\n Node rightNode = board.get(searchBoard(right));\n if(rightNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate left = new Coordinate(current.getX() - 1, current.getY());\n if(searchBoard(left) != -1){\n Node leftNode = board.get(searchBoard(left));\n if(leftNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate topLeft = new Coordinate(current.getX() - 1, current.getY() - 1);\n if(searchBoard(topLeft) != -1){\n Node topLeftNode = board.get(searchBoard(topLeft));\n if(topLeftNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate topRight = new Coordinate(current.getX() + 1, current.getY() - 1);\n if(searchBoard(topRight) != -1){\n Node topRightNode = board.get(searchBoard(topRight));\n if(topRightNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate bottomLeft = new Coordinate(current.getX() - 1, current.getY() + 1);\n if(searchBoard(bottomLeft) != -1){\n Node bottomLeftNode = board.get(searchBoard(bottomLeft));\n if(bottomLeftNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate bottomRight = new Coordinate(current.getX() + 1, current.getY() + 1);\n if(searchBoard(bottomRight) != -1){\n Node bottomRightNode = board.get(searchBoard(bottomRight));\n if(bottomRightNode.getState()){\n liveCount++;\n }\n }\n\n //determine if node is alive or dead in next frame\n if(board.get(i).getState()){\n if(liveCount <= 1){\n tempBoard.get(i).setState(false);\n } else if(liveCount >= 3){\n tempBoard.get(i).setState(false);\n } else {\n tempBoard.get(i).setState(true);\n }\n } else {\n if(liveCount == 3){\n tempBoard.get(i).setState(true);\n } else {\n tempBoard.get(i).setState(false);\n }\n }\n }\n\n //update current board with new states\n for(int i = 0; i < tempBoard.size(); i++){\n board.get(i).setState(tempBoard.get(i).getState());\n }\n }",
"public void expand() {\n\t\tconvertHeadToTailComponent();\n\t\taddNewHead();\n\t}",
"public Node() {\n neighbors = new ArrayList<>();\n sizeOfSubtree = 0;\n containedPaths = new long[k];\n startingPaths = new long[k];\n }",
"private void expand(int newCapacity) {\r\n\t\tcapacity = newCapacity;\r\n\t\tsize = 0;\r\n\t\tLinkedList<KVPair>[] hashMapNew = hashMapArray;\r\n\t\thashMapArray = new LinkedList[newCapacity];\r\n\t\tfor (LinkedList<KVPair> i : hashMapNew) {\r\n\t\t\tif (i != null) {\r\n\t\t\t\tfor (int j = 0; j < i.size(); j++) {\r\n\t\t\t\t\tK putKey = i.get(j).getKey();\r\n\t\t\t\t\tV putValue = i.get(j).getValue();\r\n\t\t\t\t\tput(putKey, putValue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n\tvoid createNeighbourhood() {\n\t\t\n\t}",
"public Node<S> next() {\n Node<S> current = popUnvisited();\n // Take the associated state\n S currentState = current.transition().to();\n // Explore the adjacent neighbors\n for(Transition<S> successor : this.successors.from(currentState)){\n // If the neighbor is still unexplored\n if (!this.visited.containsKey(successor.to())){\n // Create the associated neighbor\n Node<S> successorNode = factory.node(current, successor);\n this.stack.push(successorNode);\n }\n }\n this.visited.put(currentState, current);\n return current;\n }",
"private static void disjkstraAlgorithm(Node sourceNode, GraphBuilder graph){\n PriorityQueue<Node> smallestDisQueue = new PriorityQueue<>(graph.nodeArr.size(), new Comparator<Node>() {\n @Override\n public int compare(Node first, Node sec) {\n if(first.distance == Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return 0;\n }\n else if(first.distance == Integer.MAX_VALUE && sec.distance != Integer.MAX_VALUE){\n return 1;\n } else if(first.distance != Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return -1;\n }\n else\n return (int) (first.distance - sec.distance);\n }\n });\n\n smallestDisQueue.add(sourceNode); //add the node to the queue\n\n // until all vertices are know get the vertex with smallest distance\n\n while(!smallestDisQueue.isEmpty()) {\n\n Node currNode = smallestDisQueue.poll();\n// System.out.println(\"Curr: \");\n// System.out.println(currNode);\n if(currNode.known)\n continue; //do nothing if the currNode is known\n\n currNode.known = true; // otherwise, set it to be known\n\n for(Edge connectedEdge : currNode.connectingEdges){\n Node nextNode = connectedEdge.head;\n if(!nextNode.known){ // Visit all neighbors that are unknown\n\n long weight = connectedEdge.weight;\n if(currNode.distance == Integer.MAX_VALUE){\n continue;\n }\n else if(nextNode.distance == Integer.MAX_VALUE && currNode.distance == Integer.MAX_VALUE) {\n continue;\n }\n\n else if(nextNode.distance> weight + currNode.distance){//Update their distance and path variable\n smallestDisQueue.remove(nextNode); //remove it from the queue\n nextNode.distance = weight + currNode.distance;\n\n smallestDisQueue.add(nextNode); //add it again to the queue\n nextNode.pathFromSouce = currNode;\n\n// System.out.println(\"Next: \");\n// System.out.println(nextNode);\n }\n }\n }\n// System.out.println(\"/////////////\");\n }\n }",
"public void expand() {\n\t\tSpaceship sp = getTheSpaceship();\n\t\tsp.expandDoor();\n\t}",
"public List<Location> neighbors (Location pos);",
"private void addNode(final Node expansionCandidate) {\n\t\tif (expansionCandidate.getValue().getRisk() > goal.getRiskTolerance()) {\n\t\t\tthis.closedList.add(expansionCandidate);\n\t\t\tif (this.debugOut)\n\t\t\t\tSystem.out.println(\" OUT (risk too high)\");\n\t\t\treturn;\n\t\t}\n\n\t\tint newIndex = 0;\n\t\tfor (Node n : this.openList) {\n\t\t\tif (n.getValue().getAstar() < expansionCandidate.getValue().getAstar()) {\n\t\t\t\tnewIndex++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.openList.add(newIndex, expansionCandidate);\n\t\tif (this.debugOut)\n\t\t\tSystem.out.println(\" placed in openList index: \" + newIndex);\n\t}",
"void Explore(int vertex){\n // first mark it as true as it has been visited\n visited[vertex]=true;\n\n //now make the pre at the counterPre index this vertex\n pre[counterPre] = vertex;\n // also increase the counterPre for next iteration\n counterPre+=1;\n\n // do exploration\n // using Iterator to iterate the adjList\n Iterator<Integer> i = adjList[vertex].listIterator();\n while(i.hasNext()){\n int ver = i.next();\n\n // check is it visited or not if not then again explore that ver\n if (visited[ver]==false){\n Explore(ver);\n }\n }\n }",
"private int searchNext(JmtCell prev) {\r\n \t\tRectangle boundspadre = GraphConstants.getBounds((prev).getAttributes()).getBounds();\r\n \t\tObject[] listEdges = null;\r\n \t\tGraphModel graphmodel = graph.getModel();\r\n \t\tList<Object> next = new ArrayList<Object>();\r\n \r\n \t\tif (flag1 == false && prev.seen == false) {\r\n \r\n \t\t\t// Rectangle bounds =\r\n \t\t\t// GraphConstants.getBounds(((JmtCell)prev).getAttributes()).getBounds();\r\n \t\t\tif (!flag2) {\r\n \t\t\t\tboundspadre.setLocation(x, y + ((e + 1) * (42 + heightMax)) - (int) (boundspadre.getHeight() / 2) + 30);\r\n \t\t\t} else {\r\n \t\t\t\tboundspadre.setLocation(x - (int) (boundspadre.getWidth() / 2), y + ((e + 1) * (42 + heightMax))\r\n \t\t\t\t\t\t- (int) (boundspadre.getHeight() / 2) + 30);\r\n \t\t\t}\r\n \r\n \t\t\tGraphConstants.setBounds(prev.getAttributes(), boundspadre);\r\n \t\t\tx = (int) boundspadre.getCenterX() + widthMax + 50;\r\n \t\t\tprev.seen = true;\r\n \t\t\tflag2 = true;\r\n \t\t}\r\n \r\n \t\t// inserisco tutti gli archi uscenti e entranti di min.get(j) in\r\n \t\t// listEdges\r\n \t\tlistEdges = DefaultGraphModel.getOutgoingEdges(graphmodel, prev);\r\n \t\tVector<Object> listEdgestmp = new Vector<Object>();\r\n \t\tfor (Object listEdge : listEdges) {\r\n \t\t\tJmtCell qq = (JmtCell) (graphmodel.getParent(graphmodel.getTarget(listEdge)));\r\n \t\t\tif (!(qq).seen) {\r\n \t\t\t\tlistEdgestmp.add(listEdge);\r\n \t\t\t}\r\n \t\t}\r\n \t\tlistEdges = listEdgestmp.toArray();\r\n \r\n \t\tint numTarget = listEdges.length;\r\n \t\tif (numTarget == 0) {\r\n \t\t\treturn 1;\r\n \t\t}\r\n \r\n \t\tfor (int k = 0; k < numTarget; k++) {\r\n \t\t\tnext.add((graphmodel.getParent(graphmodel.getTarget(listEdges[k]))));\r\n \t\t}\r\n \r\n \t\tint j = 1;\r\n \t\tif (inRepositionSons == false && ((JmtCell) next.get(0)).seen == false) {\r\n \t\t\tj = searchNext((JmtCell) next.get(0));\r\n \t\t} else if (inRepositionSons == true && ((JmtCell) next.get(0)).seen == false) {\r\n \r\n \t\t\tRectangle bounds = GraphConstants.getBounds(((JmtCell) next.get(0)).getAttributes()).getBounds();\r\n \t\t\tbounds.setLocation((int) (boundspadre.getCenterX()) + widthMax + 50 - (int) (bounds.getWidth() / 2), (int) boundspadre.getCenterY()\r\n \t\t\t\t\t- (int) (bounds.getHeight() / 2));\r\n \t\t\tGraphConstants.setBounds(((JmtCell) next.get(0)).getAttributes(), bounds);\r\n \r\n \t\t\t((JmtCell) next.get(0)).seen = true;\r\n \t\t\tj = searchNext((JmtCell) next.get(0));\r\n \t\t}\r\n \r\n \t\tif (numTarget > 0) {\r\n \t\t\tif (!flag) {\r\n \t\t\t\trepositionSons(prev, next, j - 1, 1);\r\n \t\t\t} else {\r\n \t\t\t\trepositionSons(prev, next, -1, 0);\r\n \t\t\t}\r\n \t\t\tflag = false;\r\n \t\t}\r\n \r\n \t\t(prev).sons = 0;\r\n \t\tfor (int w = 0; w < numTarget; w++) {\r\n \t\t\tprev.sons += ((JmtCell) next.get(w)).sons;\r\n \t\t}\r\n \r\n \t\treturn prev.sons;\r\n \t}",
"private int BFS() {\n adjList.cleanNodeFields();\n\n //Queue for storing current shortest path\n Queue<Node<Integer, Integer>> q = new LinkedList<>();\n\n //Set source node value to 0\n q.add(adjList.getNode(startNode));\n q.peek().key = 0;\n q.peek().d = 0;\n q.peek().visited = true;\n\n //Helper variables\n LinkedList<Pair<Node<Integer, Integer>, Integer>> neighbors;//Array of pairs <neighborKey, edgeWeight>\n Node<Integer, Integer> neighbor, u;\n long speed = (long) (cellSideLength * 1.20);\n\n while (!isCancelled() && q.size() != 0) {\n u = q.poll();\n\n //Marks node as checked\n checkedNodesGC.fillRect((u.value >> 16) * cellSideLength + 0.5f,\n (u.value & 0x0000FFFF) * cellSideLength + 0.5f,\n (int) cellSideLength - 1, (int) cellSideLength - 1);\n\n //endNode found\n if (u.value == endNode) {\n //Draws shortest path\n Node<Integer, Integer> current = u, prev = u;\n\n while ((current = current.prev) != null) {\n shortestPathGC.strokeLine((prev.value >> 16) * cellSideLength + cellSideLength / 2,\n (prev.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2,\n (current.value >> 16) * cellSideLength + cellSideLength / 2,\n (current.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2);\n prev = current;\n }\n return u.d;\n }\n\n //Wait after checking node\n try {\n Thread.sleep(speed);\n } catch (InterruptedException interrupted) {\n if (isCancelled())\n break;\n }\n\n //Checking Neighbors\n neighbors = adjList.getNeighbors(u.value);\n for (Pair<Node<Integer, Integer>, Integer> neighborKeyValuePair : neighbors) {\n neighbor = neighborKeyValuePair.getKey();\n //Relaxation step\n //Checks if neighbor hasn't been checked, if so the assign the shortest path\n if (!neighbor.visited) {\n //Adds checked neighbor to queue\n neighbor.key = u.d + 1;\n neighbor.d = u.d + 1; //Assign shorter path found to neighbor\n neighbor.prev = u;\n neighbor.visited = true;\n q.add(neighbor);\n }\n }\n }\n return Integer.MAX_VALUE;\n }",
"public static LinkedList2 generateNeighbors(LocNode state) {\n\t \n\t \n\t\n\t LinkedList2 Neighbors = new LinkedList2();\n\t \n\n\t\n\tchar [][] Matrix = state.getData(); \n\t\n\t\n\t\n\tchar [][] Neighbor = copyMatrix(Matrix);\n\n\t\t\n\t\tfor(int i=0 ;i<size ;i++ ) {\n\t\tfor (int j=0 ;j<size ;j++) {\n\t\t\tif (Neighbor[i][j]=='-'||Neighbor[i][j]=='v') {\n\t\t\t\tNeighbor[i][j]='c';\n\t\t\t\t\n\t\t\t\t\n\t updateVisibility(i,j,Neighbor);\n\t \n\t Neighbors.insert(Neighbor, calculateOpjectiveFunction(Neighbor));\n\t \n\t \n\t \n\t\t\t\tNeighbor = copyMatrix(Matrix);\n\t\n\t\t\t\n\t\t\t}\n\t\t}\t\n\t\t}\n\t\t\n\tLinkedList2 ApplyingRemoveAction=removeOneCamera(state.data);\n\t\n\n\tif(!ApplyingRemoveAction.empty()){\n\t\t\n\t\tApplyingRemoveAction.findFirst();\n\t\twhile(!ApplyingRemoveAction.last()) {\n\t\t\t Neighbors.insert(ApplyingRemoveAction.retrieve_data(), ApplyingRemoveAction.retrieve_opjectiveFunctoin());\n\t\t\t ApplyingRemoveAction.findNext();\n\t\t}\n\t\t\n\t\t Neighbors.insert(ApplyingRemoveAction.retrieve_data(), ApplyingRemoveAction.retrieve_opjectiveFunctoin());\n\t}\n\t\t\n\t\t\n\t return Neighbors;\n\t \n\t \n}",
"void renewNeighbourClusters() {\n neighbourClusters = new HashMap<Cluster, Integer>();\n\n for (Person p : members) {\n for (Person x : p.getFriends()) {\n if (!members.contains(x)) {\n Cluster xC = x.getCluster();\n if (!neighbourClusters.containsKey(xC)) {\n neighbourClusters.put(xC, 1);\n } else {\n neighbourClusters.put(xC, neighbourClusters.get(xC) + 1);\n }\n }\n }\n }\n\n }",
"@Override\n\tprotected boolean checkAndAddNodeToList(Node currNode, int x, int y) {\n\t\tint cost = currNode.getCurrentPathCost()+1;\n\t\tint h = heuristic(x,y);\n\t\tif (h+cost < this.maze[x][y]) {\n\t\t\tthis.pq.add(new Node(currNode, x, y, cost, h));\n\t\t\tthis.maze[x][y] = h+cost;\n\t\t\tthis.expands++;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"@Override\n public List<node_data> shortestPath(int src, int dest) {\n reset();\n for (node_data node : G.getV()) {\n node.setWeight(Double.POSITIVE_INFINITY);\n }\n\n DWGraph_DS.Node currentNode = (DWGraph_DS.Node) G.getNode(src);\n currentNode.setWeight(0);\n PriorityQueue<node_data> unvisitedNodes = new PriorityQueue(G.nodeSize(), weightComperator);\n unvisitedNodes.addAll(G.getV());\n HashMap<Integer, node_data> parent = new HashMap<>();\n parent.put(src, null);\n\n while (currentNode.getWeight() != Double.POSITIVE_INFINITY) {\n if (G.getNode(dest).getTag() == 1) {\n break;\n }\n for (edge_data edge : G.getE(currentNode.getKey())) {\n DWGraph_DS.Node neighbor = (DWGraph_DS.Node) G.getNode(edge.getDest());\n double tmpWeight = currentNode.getWeight() + edge.getWeight();\n if (tmpWeight < neighbor.getWeight()) {\n neighbor.setWeight(tmpWeight);\n unvisitedNodes.remove(neighbor);\n unvisitedNodes.add(neighbor);\n parent.put(neighbor.getKey(), currentNode);\n }\n }\n currentNode.setTag(1);\n if(currentNode.getKey()==dest) break;\n unvisitedNodes.remove(currentNode);\n currentNode = (DWGraph_DS.Node) unvisitedNodes.poll();\n }\n /*\n Rebuild the path list\n */\n if (!parent.keySet().contains(dest)) return null;\n List<node_data> pathList = new ArrayList<>();\n currentNode = (DWGraph_DS.Node) G.getNode(dest);\n while (parent.get(currentNode.getKey()) != null) {\n pathList.add(currentNode);\n currentNode = (DWGraph_DS.Node) parent.get(currentNode.getKey());\n }\n Collections.reverse(pathList);\n return pathList;\n }",
"private PersistentLinkedList<T> pop() {\n //the latest element won't become empty\n int index = this.treeSize - 1;\n Node<T> newRoot = new Node<>(branchingFactor);\n\n Node<T> currentNode = this.root;\n Node<T> currentNewNode = newRoot;\n\n ArrayList<Node<T>> newNodes = new ArrayList<>();\n newNodes.add(newRoot);\n ArrayList<Integer> newNodesIndices = new ArrayList<>();\n\n for (int b = base; b > 1; b = b / branchingFactor) {\n TraverseData traverseData = traverseOneLevel(\n new TraverseData(currentNode, currentNewNode, newRoot, index, b));\n currentNode = traverseData.currentNode;\n currentNewNode = traverseData.currentNewNode;\n newNodes.add(currentNewNode);\n newNodesIndices.add(index / b);\n index = traverseData.index;\n }\n newNodesIndices.add(index);\n\n for (int i = 0; i < branchingFactor && i < index; i++) {\n currentNewNode.set(i, currentNode.get(i));\n }\n currentNewNode.set(index, null);\n\n if (index == 0) {\n int latestIndex = newNodes.size() - 2;\n newNodes.get(latestIndex).set(newNodesIndices.get(latestIndex), null);\n\n for (int i = latestIndex; i > 0; i--) {\n if (newNodesIndices.get(i) == 0) {\n newNodes.get(i - 1).set(newNodesIndices.get(i - 1), null);\n } else {\n break;\n }\n }\n }\n\n if (newNodes.size() > 1) {\n int nonNullChildren = 0;\n for (Node<T> child : newRoot.children) {\n if (child != null) {\n nonNullChildren++;\n }\n }\n if (nonNullChildren == 1) { //need new root\n newRoot = newRoot.get(0);\n return new PersistentLinkedList<>(newRoot, this.branchingFactor, this.depth - 1,\n this.base / branchingFactor, this.treeSize - 1, unusedTreeIndices,\n indexCorrespondingToTheFirstElement, indexCorrespondingToTheLatestElement);\n }\n }\n return new PersistentLinkedList<>(newRoot, this.branchingFactor, this.depth, this.base,\n this.treeSize - 1, unusedTreeIndices, indexCorrespondingToTheFirstElement,\n indexCorrespondingToTheLatestElement);\n }",
"private void expand() {\n int capacity = newCapacity();\n IntIntMap h = new IntIntMap(capacity);\n for (int i = 0; i < entries.length; i += 2) {\n if (entries[i] != EMPTY) {\n h.put(entries[i], entries[i + 1]);\n }\n }\n this.entries = h.entries;\n this.threshold = h.threshold;\n this.modulo = h.modulo;\n this.modulo2 = h.modulo2;\n }",
"public void addEdge(){\n Node[] newAdjacent = new Node[adjacent.length + 1];\n for (int i = 0; i < adjacent.length; i++) {\n newAdjacent[i] = adjacent[i];\n }\n adjacent = newAdjacent;\n }",
"GameBoardVertex(GameBoardVertex neighbor){this.neighbors.add(neighbor);}",
"protected abstract void rebuildNetwork(int numNodes);",
"void reserveNodes(int nodeCount) {\n\t\tm_list_nodes.setCapacity(nodeCount);\n\t}",
"public void UpNumberOfVisitedNodes() {\n NumberOfVisitedNodes++;\n }",
"private neighbor_t(Builder builder) {\n super(builder);\n }",
"private void expandCapacity() {\n heap = Arrays.copyOf(heap, heap.length * 2);\n }",
"public Collection<N> neighbors();",
"private void getNeighbors() {\n\t\tRowIterator iterator = currentGen.iterateRows();\n\t\twhile (iterator.hasNext()) {\n\t\t\tElemIterator elem = iterator.next();\n\t\t\twhile (elem.hasNext()) {\n\t\t\t\tMatrixElem mElem = elem.next();\n\t\t\t\tint row = mElem.rowIndex();\n\t\t\t\tint col = mElem.columnIndex();\n\t\t\t\tint numNeighbors = 0;\n\t\t\t\tfor (int i = -1; i < 2; i++) { // loops through row above,\n\t\t\t\t\t\t\t\t\t\t\t\t// actual row, and row below\n\t\t\t\t\tfor (int j = -1; j < 2; j++) { // loops through column left,\n\t\t\t\t\t\t\t\t\t\t\t\t\t// actual column, coloumn\n\t\t\t\t\t\t\t\t\t\t\t\t\t// right\n\t\t\t\t\t\tif (!currentGen.elementAt(row + i, col + j).equals(\n\t\t\t\t\t\t\t\tfalse)) // element is alive, add 1 to neighbor\n\t\t\t\t\t\t\t\t\t\t// total\n\t\t\t\t\t\t\tnumNeighbors += 1;\n\t\t\t\t\t\telse { // element is not alive, add 1 to its total\n\t\t\t\t\t\t\t\t// number of neighbors\n\t\t\t\t\t\t\tInteger currentNeighbors = (Integer) neighbors\n\t\t\t\t\t\t\t\t\t.elementAt(row + i, col + j);\n\t\t\t\t\t\t\tneighbors.setValue(row + i, col + j,\n\t\t\t\t\t\t\t\t\tcurrentNeighbors + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tneighbors.setValue(row, col, numNeighbors - 1); // -1 to account\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// for counting\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// itself as a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// neighbor\n\t\t\t}\n\t\t}\n\t}",
"private static void breadthFirstSearch(int source, ArrayList<ArrayList<Integer>> nodes) {\n\t\tArrayList<ArrayList<Integer>> neighbours = nodes;\n\t\tQueue<Integer> queue= new LinkedList<Integer>();\n\t\t\n\t\tboolean[] visited = new boolean[nodes.size()];\n\t\t\n\t\tqueue.add(source);\n\t\tvisited[source]=true;\n\t\t\n\t\twhile(!queue.isEmpty()) {\n\t\t\tint k =queue.remove();\n\t\t\tSystem.out.println(k);\n\t\t\tfor(int p : nodes.get(k)) {\n\t\t\t\tif(!visited[p]) {\n\t\t\t\t\tqueue.add(p);\n\t\t\t\t\tvisited[p]=true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}",
"@Override\n\tpublic void addNode(Node node) {\n\t\tfrontier.addLast(node);\n\t\tif(frontier.size() > maxSize)\n\t\t\tmaxSize = frontier.size();\n\t}",
"public void setNumberOfVisitedNodes(int numberOfVisitedNodes) {\n NumberOfVisitedNodes = numberOfVisitedNodes;\n }",
"private void computeShortestPath(){\n T current = start;\n boolean atEnd = false;\n while (!unvisited.isEmpty()&& !atEnd){\n int currentIndex = vertexIndex(current);\n LinkedList<T> neighbors = getUnvisitedNeighbors(current); // getting unvisited neighbors\n \n //what is this doing here???\n if (neighbors.isEmpty()){\n \n }\n \n // looping through to find distances from start to neighbors\n for (T neighbor : neighbors){ \n int neighborIndex = vertexIndex(neighbor); \n int d = distances[currentIndex] + getEdgeWeight(current, neighbor);\n \n if (d < distances[neighborIndex]){ // if this distance is less than previous distance\n distances[neighborIndex] = d;\n closestPredecessor[neighborIndex] = current; // now closest predecessor is current\n }\n }\n \n if (current.equals(end)){\n atEnd = true;\n }\n else{\n // finding unvisited node that is closest to start node\n T min = getMinUnvisited();\n if (min != null){\n unvisited.remove(min); // remove minimum neighbor from unvisited\n visited.add(min); // add minimum neighbor to visited\n current = min;\n }\n }\n }\n computePath();\n totalDistance = distances[vertexIndex(end)];\n }",
"public void createNodesOfPixels() {\n makeGrayscale();\n WritableImage pixelPop = copyImage(holderImg);\n PixelReader pr = pixelPop.getPixelReader();\n for (int i = 0; i < h; i++) {\n for (int j = 0; j < w; j++) {\n Color color = pr.getColor(j, i);\n if (color.equals(Color.WHITE)) {\n pathNodes[(i * w) + j] = new GraphNodeAL(i);\n }\n }\n }\n\n for (int i = 0; i < pathNodes.length; i++) {\n if (pathNodes[i] != null) {\n if ((i - w) >= 0 && pathNodes[i - w] != null) { // pixel above\n pathNodes[i].connectToNodeDirected(pathNodes[i - w], 1);\n }\n if ((i + w) < pathNodes.length && pathNodes[i + w] != null) { // pixel below\n pathNodes[i].connectToNodeDirected(pathNodes[i + w], 1);\n }\n if ((i - 1) >= 0 && pathNodes[i - 1] != null && ((i - 1) % w) != 0) { // pixel left\n pathNodes[i].connectToNodeDirected(pathNodes[i - 1], 1);\n }\n if ((i + 1) < pathNodes.length && pathNodes[i + 1] != null && ((i + 1) % w) != 0) { // pixel right\n pathNodes[i].connectToNodeDirected(pathNodes[i + 1], 1);\n }\n }\n }\n }",
"public void explore(int row, BoardBuilder board) {\n if(row >= nQueens) addSolution(board);\n else for(int column = 0; column < nQueens; column++) {\n if(!board.threatened(new Coord(row, column))) {\n BoardBuilder daughter = board.clone();\n daughter.placeQueen(new Coord(row, column));\n explore(row + 1, daughter);\n }\n }\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList<Node<A>> neighbours(){\n\t\t\n\t\tArrayList<Node<A>> output = new ArrayList<Node<A>>();\n\t\t\n\t\tif (g == null) return output;\n\t\t\n\t\tfor (Object o: g.getEdges()){\n\n\t\t\t\n\t\t\tif (((Edge<?>)o).getTo().equals(this)) {\n\t\t\t\t\n\t\t\t\tif (!output.contains(((Edge<?>)o).getFrom()))\n\t\t\t\t\t\toutput.add((Node<A>) ((Edge<?>)o).getFrom());\n\t\t\t\t\n\t\t\t}\n\n\t\t} \n\t\treturn output;\n\t\t\n\t}",
"public static UniformCostSearchNode search(UniformCostSearchNode root){\n PriorityQueue<UniformCostSearchNode> frontier = new PriorityQueue<UniformCostSearchNode>();\n\n // hash set for fast verification of closed nodes\n HashSet<UniformCostSearchNode> closed = new HashSet<UniformCostSearchNode>();\n\n closed.add(root);\n frontier.add(root);\n\n while(frontier.size() != 0){\n UniformCostSearchNode current = frontier.remove();\n if(current.isGoalState()){\n System.out.println(\"UCS Nodes explored: \" + closed.size());\n return current;\n }\n\n for(UniformCostSearchNode neighbor : current.getNeighbors()){\n if(!closed.contains(neighbor)) {\n if (!frontier.contains(neighbor)) {\n frontier.add(neighbor);\n }\n }\n }\n }\n\n System.out.println(\"UCS Search failed, nodes explored: \" + closed.size());\n // search failed\n return null;\n }",
"public List<MoveEdge> getEdgeNeighborhood(final LabeledUndirectedGraph<N, E> sk) {\n final List<MoveEdge> neighborood = new ArrayList<>();\n final LabeledUndirectedGraph<N, E> csk = new LabeledUndirectedGraph<>(sk);\n // For each spanning edges...\n csk.getEdges().forEach(edge -> {\n csk.removeEdge(edge);\n final List<Set<N>> nodes = new ArrayList<>(csk.getSubGraphsNodes());\n if (nodes.size() == 2) {\n final Set<E> candidates = new HashSet<>();\n csk.getRemovedEdges().stream()\n .filter(redge -> (!redge.equals(edge))\n && ((nodes.get(0).contains(redge.getNode1()) && nodes.get(1).contains(redge.getNode2()))\n || (nodes.get(0).contains(redge.getNode2()) && nodes.get(1).contains(redge.getNode1()))))\n .forEachOrdered(redge -> candidates.add(redge));\n candidates.forEach(candidate -> neighborood.add(new MoveEdge(edge, candidate, sk)));\n }\n csk.addEdge(edge);\n });\n return neighborood;\n }",
"public boolean DijkstraHelp(int src, int dest) {\n PriorityQueue<Entry>queue=new PriorityQueue();//queue storages the nodes that we will visit by the minimum tag\n //WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n initializeTag();\n initializeInfo();\n node_info first=this.ga.getNode(src);\n first.setTag(0);//distance from itself=0\n queue.add(new Entry(first,first.getTag()));\n while(!queue.isEmpty()) {\n Entry pair=queue.poll();\n node_info current= pair.node;\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n Collection<node_info> listNeighbors = this.ga.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for(node_info n:Neighbors) {\n\n if(n.getTag()>ga.getEdge(n.getKey(),current.getKey())+current.getTag())\n {\n n.setTag(current.getTag() + ga.getEdge(n.getKey(), current.getKey()));//compute the new tag\n }\n queue.add(new Entry(n,n.getTag()));\n }\n }\n Iterator<node_info> it=this.ga.getV().iterator();\n while(it.hasNext()){\n if(it.next().getInfo()==null) return false;\n }\n return true;\n }",
"public NeighbourhoodCache(boolean disable) {\n this.disable = disable;\n this.cachedNeighborhoods = new HashMap<CacheKey, List<AdjacentVertexWithEdge>>(MaxCacheSize);\n this.lruQueue = new ArrayDeque<CacheKey>(MaxCacheSize);\n }"
] | [
"0.6704117",
"0.6173976",
"0.58178896",
"0.5807595",
"0.56903726",
"0.56502503",
"0.5539601",
"0.54700893",
"0.5465859",
"0.54644597",
"0.5428894",
"0.54267174",
"0.54189914",
"0.54163617",
"0.54146063",
"0.5376946",
"0.5366787",
"0.5365449",
"0.53614354",
"0.53266215",
"0.53192455",
"0.53184867",
"0.53135407",
"0.5311754",
"0.52925676",
"0.52795285",
"0.5273819",
"0.526248",
"0.52474725",
"0.52261794",
"0.52121335",
"0.52098435",
"0.52035666",
"0.52021545",
"0.5187691",
"0.5181294",
"0.5174752",
"0.5165659",
"0.51586735",
"0.51575315",
"0.51511323",
"0.5145649",
"0.51369107",
"0.5136228",
"0.5134981",
"0.51257056",
"0.5123057",
"0.5097773",
"0.50933456",
"0.5088882",
"0.50831056",
"0.50810814",
"0.5069469",
"0.5030359",
"0.50202435",
"0.5006642",
"0.50050426",
"0.50024635",
"0.49926454",
"0.4982923",
"0.49820837",
"0.4981636",
"0.49797833",
"0.49776188",
"0.4973131",
"0.49691987",
"0.4945267",
"0.4944482",
"0.49287403",
"0.49193737",
"0.49088115",
"0.49071515",
"0.4904664",
"0.4898915",
"0.48981145",
"0.48867765",
"0.48846033",
"0.48813102",
"0.48782238",
"0.48760554",
"0.48742896",
"0.48688006",
"0.4864548",
"0.48611364",
"0.48576555",
"0.48529327",
"0.48526433",
"0.48430228",
"0.48398256",
"0.48177496",
"0.48123372",
"0.48083135",
"0.48083133",
"0.48034868",
"0.4800178",
"0.4795692",
"0.47916505",
"0.478974",
"0.47856253",
"0.47849336"
] | 0.75723296 | 0 |
Applies current locale to resource bundle. | private void updateBundle() {
this.bundle = ResourceBundle.getBundle("languages", this.locales.get(this.currentLocaleIndex));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void setLocale(Locale locale) {\n// Recarga las entradas de la tabla con la nueva localizacion \n RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, locale);\n}",
"public void updateLocale() {\r\n\t\tsuper.updateLocale();\r\n\t}",
"public static void forceLocale(Context context) {\r\n\t\tfinal String language = getSavedLanguage(context);\r\n\t\t\r\n\t\tif (language == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tDebug.logE(\"force locale\", \"language \" + language);\r\n\t\t\r\n\t\tResources res = context.getResources();\r\n\r\n\t\tConfiguration config = res.getConfiguration();\r\n\t\ttry {\r\n\t\t\tconfig.locale = new Locale(language);\r\n\t\t} catch(Throwable e) {\r\n\t\t\t;\r\n\t\t}\r\n\t res.updateConfiguration(config, context.getResources().getDisplayMetrics());\r\n\t}",
"public static void resolveRestApiLocale() {\n\t\t((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest()\n\t\t\t\t.setAttribute(LocaleResolver.REST_API_LOCALE, CoreResources.getSystemLocale());\n\t\tresolveLocale();\n\t}",
"private void setLocale() {\n\t\tLocale locale = new Locale(this.getString(R.string.default_map_locale));\n Locale.setDefault(locale);\n Configuration config = new Configuration();\n config.locale = locale;\n getBaseContext().getResources().updateConfiguration(config,\n getBaseContext().getResources().getDisplayMetrics());\n\t}",
"public void setPreferredLocale(Locale locale);",
"public void setLocale (Locale locale) {\n _locale = locale;\n _cache.clear();\n _global = getBundle(_globalName);\n }",
"public void setLocale(final Locale locale) {\r\n messages = ResourceBundle.getBundle(PATH_TO_BUNDLE_FILE, locale);\r\n }",
"ResourceBundle getResourceBundle(Locale locale);",
"private void initLanguage() {\n try {\n Resources resources = getApplicationContext().getResources();\n DisplayMetrics displayMetrics = resources.getDisplayMetrics();\n Configuration configuration = resources.getConfiguration();\n Locale locale = new Locale(\"es\", \"ES\");\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {\n configuration.setLocale(locale);\n } else {\n //noinspection deprecation\n configuration.locale = locale;\n }\n resources.updateConfiguration(configuration, displayMetrics);\n } catch (Throwable throwable) {\n Log.d(TAG, \"Couldn't apply ES language.\", throwable);\n }\n }",
"public void componentsLocaleChanged() {\n\t\ttextRes = PeralexLibsBundle.getResource();\n\n\t\tlocaleChanged();\n\t}",
"public void setLocale(Locale locale) {\n fLocale = locale;\n }",
"@Override\n protected void attachBaseContext(Context base) {\n super.attachBaseContext(Application.Companion.getLocaleManager().setLocale(base));\n }",
"void changeLanguage() {\n\n this.currentLocaleIndex++;\n if(this.currentLocaleIndex > this.locales.size() - 1) this.currentLocaleIndex = 0;\n this.updateBundle();\n }",
"private void setLocale( String localeName )\r\n\t{\r\n\t\tConfiguration conf = getResources().getConfiguration();\r\n\t\tconf.locale = new Locale( localeName );\r\n\t\t\r\n\t\tsetCurrentLanguage( conf.locale.getLanguage() );\r\n\r\n\t\tDisplayMetrics metrics = new DisplayMetrics();\r\n\t\tgetWindowManager().getDefaultDisplay().getMetrics( metrics );\r\n\t\t\r\n\t\t// the next line just changes the application's locale. It changes this\r\n\t\t// globally and not just in the newly created resource\r\n\t\tResources res = new Resources( getAssets(), metrics, conf );\r\n\t\t// since we don't need the resource, just allow it to be garbage collected.\r\n\t\tres = null;\r\n\r\n\t\tLog.d( TAG, \"setLocale: locale set to \" + localeName );\r\n\t}",
"public interface ResourceManager {\r\n\r\n\t/**\r\n\t * Adds a resource bundle to be managed by the resource manager.\r\n\t * \r\n\t * @param bundleBaseName - the base name of the bundle to add.\r\n\t * @param locales - an array with the locales to consider for the bundle to add \r\n\t */\r\n\tvoid addBundle(String bundleBaseName, Locale... locales);\r\n\t\r\n\t/**\r\n\t * Gets the localized text for the specified bundle key, and for the resource manager default locale\r\n\t * \r\n\t * @param bundleKey\t- the key of the requested text in the resource bundle\r\n\t * @return the requested localized text\r\n\t */\r\n\tString getString(String bundleKey);\r\n\r\n\t/**\r\n\t * Gets the localized text for the specified bundle key and for the specified locale.\r\n\t * \r\n\t * @param bundleKey\t- the key of the requested text in the resource bundle\r\n\t * @param locale\t- the locale of the resource bundle\r\n\t * @return the requested localized text\r\n\t */\r\n\tString getString(String bundleKey, Locale locale);\r\n\r\n\t/**\r\n\t * Gets the localized text for the specified bundle key,\r\n\t * in the resource bundle with the given base name, and for the resource manager default locale\r\n\t * \r\n\t * @param bundleKey\t\t - the key of the requested text in the resource bundle\r\n\t * @param bundleBaseName - the name of the bundle where the localized text should be found\r\n\t * @return the requested localized text\r\n\t */\r\n\tString getString(String bundleKey, String bundleBaseName);\r\n\r\n\t/**\r\n\t * Gets the localized text for the specified bundle key,\r\n\t * from the resource bundle with the given base name, and for the specified locale.\r\n\t * \r\n\t * @param bundleKey\t\t - the key of the requested text in the resource bundle\r\n\t * @param bundleBaseName - the name of the bundle where the localized text should be found\r\n\t * @param locale \t\t - the locale of the resource bundle\r\n\t * @return the requested localized text\r\n\t */\r\n\tString getString(String bundleKey, String bundleBaseName, Locale locale);\r\n\r\n\t/**\r\n\t * Gets the localized text message for the specified bundle key, and for the resource manager default locale.<br/>\r\n\t * If the requested message contains place holders, they will be substituted by the given arguments\r\n\t * \r\n\t * @param bundleKey - the key of the requested message in the resource bundle\r\n\t * @param args \t\t- an object array with substitution parameters for the message\r\n\t * @return the requested localized text message\r\n\t */\r\n\tString getMessage(String bundleKey, Object... args);\r\n\r\n\t/**\r\n\t * Gets the localized text message for the specified bundle key, and for the specified locale.<br/>\r\n\t * If the requested message contains place holders, they will be substituted by the given arguments\r\n\t * \r\n\t * @param bundleKey - the key of the requested message in the resource bundle\r\n\t * @param args \t\t- an object array with substitution parameters for the message\r\n\t * @return the requested localized text message\r\n\t */\r\n\tString getMessage(String bundleKey, Locale locale, Object... args);\r\n\r\n\t/**\r\n\t * Gets the localized text message for the specified bundle key, and for the resource manager default locale.<br/>\r\n\t * If the requested message contains place holders, they will be substituted by the given arguments\r\n\t * \r\n\t * @param bundleKey \t - the key of the requested message in the resource bundle\r\n\t * @param bundleBaseName - the name of the bundle where the value should be found\r\n\t * @param locale\t\t - the locale of the resource bundle\r\n\t * @param args \t\t\t - an object array with substitution parameters for the message\r\n\t * @return the requested localized text message\r\n\t */\r\n\tString getMessage(String bundleKey, String bundleBaseName, Object... args);\r\n\r\n\t/**\r\n\t * Gets the localized text message for the specified bundle key,\r\n\t * from the resource bundle with the given base name, and for the specified locale.<br/>\r\n\t * If the requested message contains place holders, they will be substituted by the given arguments\r\n\t * \r\n\t * @param bundleKey \t - the key of the requested message in the resource bundle\r\n\t * @param bundleBaseName - the name of the bundle where the localized text message should be found\r\n\t * @param locale\t\t - the locale of the resource bundle\r\n\t * @param args \t\t\t - the array with substitution parameters for the message\r\n\t * @return the requested localized text message\r\n\t */\r\n\tString getMessage(String bundleKey, String bundleName, Locale locale, Object... args);\r\n\t\r\n\t/**\r\n\t * Gets the localized object for the specified bundle key, and for the resource manager default locale<br/>\r\n\t * This method should be used only if resources are stored in a subclass of {@link ResourceBundle}\r\n\t * \r\n\t * @param bundleKey - the key of the requested localized object in the resource bundle\r\n\t * @return the requested localized object\r\n\t */\r\n\tObject getObject(String bundleKey);\r\n\t\r\n\t/**\r\n\t * Gets the localized object for the specified bundle key, and for specified locale<br/>\r\n\t * This method should be used only if resources are stored in a subclass of {@link ResourceBundle}\r\n\t * \r\n\t * @param bundleKey - the key of the requested localized object in the resource bundle\r\n\t * @param locale\t- the locale of the resource bundle\r\n\t * @return the requested localized object\r\n\t */\r\n\tObject getObject(String bundleKey, Locale locale);\r\n\t\r\n\t/**\r\n\t * Gets the localized object for the specified bundle key,\r\n\t * from the resource bundle with the given name, and for the resource manager default locale<br/>\r\n\t * This method should be used only if resources are stored in a subclass of {@link ResourceBundle}\r\n\t * \r\n\t * @param bundleKey \t - the key of the requested localized object in the resource bundle\r\n\t * @param bundleBaseName - the name of the bundle where the localized object should be found\r\n\t * @return the requested localized object\r\n\t */\r\n\tObject getObject(String bundleKey, String bundleBaseName);\r\n\t\r\n\t/**\r\n\t * Gets the localized object for the specified bundle key,\r\n\t * from the resource bundle with the given name, and for specified locale<br/>\r\n\t * This method should be used only if resources are stored in a subclass of {@link ResourceBundle}\r\n\t * \r\n\t * @param bundleKey \t - the key of the requested localized object in the resource bundle\r\n\t * @param bundleBaseName - the name of the bundle where the localized object should be found\r\n\t * @param locale\t \t - the locale of the resource bundle\r\n\t * @return the requested localized object\r\n\t */\r\n\tObject getObject(String bundleKey, String bundleBaseName, Locale locale);\r\n\t\r\n\t/**\r\n\t * Indicates if the resource manager has to return <code>null</code> if a resource is missing\r\n\t * @return <code>true</code> if the resource manager has to return <code>null</code> for missing\r\n\t * resources, <code>false</code> otherwise\r\n\t */\r\n\tboolean isNullable();\r\n\t\r\n\t/**\r\n\t * Indicates if the resource manager has to return <code>null</code> if a resource is missing\r\n\t * @param nullable - <code>true</code> if the resource manager has to return <code>null</code>\r\n\t * \t\t\t\t\t for missing resource, <code>false</code> otherwise\r\n\t */\r\n\tvoid setNullable(boolean nullable);\r\n\r\n\t/**\r\n\t * Gets a set with the locales managed by the resource manager\r\n\t * @return a set of the locales managed by the resource manager\r\n\t */\r\n\tSet<Locale> getManagedLocales();\r\n\r\n\t/**\r\n\t * Gets the locale currently used as default by the resource manager\r\n\t * @return the locale currently used as default by the resource manager\r\n\t */\r\n\tLocale getDefaultLocale();\r\n}",
"@RequestMapping(value = \"/messageresource/localize\", method = RequestMethod.GET)\n\tpublic String localizeMessageResource(Model model, Locale locale) {\n\n\t\tlogger.debug(\"localizeMessageResource()\");\n\n\t\tMessageResourceTranslationBackingBean messageResourceTranslationBackingBean = new MessageResourceTranslationBackingBeanImpl();\n\t\tmessageResourceTranslationBackingBean.setCurrentMode(MessageResource.CurrentMode.LOCALIZE);\n\t\tmodel.addAttribute(\"messageResourceTranslationFormModel\", messageResourceTranslationBackingBean);\n\t\tLong defaultLocale = Long.valueOf(Constants.REFERENCE_LOCALE__EN);\n\t\tsetTranslationDropDownContents(model, locale);\n\t\tsetDropDownContents(model, null, locale);\t\t\n\t\tmodel.addAttribute(\"defaultLocale\", defaultLocale);\n\t\t\n\t\treturn \"messages/messageresource_localize\";\n\n\t}",
"public static void initialSystemLocale(Context context)\n {\n LogpieSystemSetting setting = LogpieSystemSetting.getInstance(context);\n if (setting.getSystemSetting(KEY_LANGUAGE) == null)\n {\n String mLanguage = Locale.getDefault().getLanguage();\n if (mLanguage.equals(Locale.CHINA) || mLanguage.equals(Locale.CHINESE))\n {\n setting.setSystemSetting(KEY_LANGUAGE, CHINESE);\n }\n else\n {\n setting.setSystemSetting(KEY_LANGUAGE, ENGLISH);\n }\n }\n }",
"ResourceBundle loadBundle (String path, Locale locale);",
"public Future<String> locale() throws DynamicCallException, ExecutionException {\n return call(\"locale\");\n }",
"private void setLanguageForApp(){\n String lang = sharedPreferences.getString(EXTRA_PREF_LANG,\"en\");\n\n Locale locale = new Locale(lang);\n Resources resources = getResources();\n Configuration configuration = resources.getConfiguration();\n DisplayMetrics displayMetrics = resources.getDisplayMetrics();\n configuration.setLocale(locale);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){\n getApplicationContext().createConfigurationContext(configuration);\n } else {\n resources.updateConfiguration(configuration,displayMetrics);\n }\n getApplicationContext().getResources().updateConfiguration(configuration, getApplicationContext().getResources().getDisplayMetrics());\n }",
"public void setLocale(Locale locale) {\n\n\t}",
"public void setLocale(Locale l) {\n if (!initialized)\n super.setLocale(l);\n else {\n locale = l;\n initNames();\n }\n }",
"private void loadLocale() {\n\t\tSharedPreferences sharedpreferences = this.getSharedPreferences(\"CommonPrefs\", Context.MODE_PRIVATE);\n\t\tString lang = sharedpreferences.getString(\"Language\", \"en\");\n\t\tSystem.out.println(\"Default lang: \"+lang);\n\t\tif(lang.equalsIgnoreCase(\"ar\"))\n\t\t{\n\t\t\tmyLocale = new Locale(lang);\n\t\t\tsaveLocale(lang);\n\t\t\tLocale.setDefault(myLocale);\n\t\t\tandroid.content.res.Configuration config = new android.content.res.Configuration();\n\t\t\tconfig.locale = myLocale;\n\t\t\tthis.getBaseContext().getResources().updateConfiguration(config, this.getBaseContext().getResources().getDisplayMetrics());\n\t\t\tCommonFunctions.lang = \"ar\";\n\t\t}\n\t\telse{\n\t\t\tmyLocale = new Locale(lang);\n\t\t\tsaveLocale(lang);\n\t\t\tLocale.setDefault(myLocale);\n\t\t\tandroid.content.res.Configuration config = new android.content.res.Configuration();\n\t\t\tconfig.locale = myLocale;\n\t\t\tthis.getBaseContext().getResources().updateConfiguration(config, this.getBaseContext().getResources().getDisplayMetrics());\n\t\t\tCommonFunctions.lang = \"en\";\n\t\t}\n\t}",
"public final void setLocale( Locale locale )\n {\n }",
"public void setLocale(Locale locale)\n {\n this.locale = locale;\n }",
"public void setLocale(Locale locale) {\n\t\t\n\t\tif(locale == null) throw new IllegalArgumentException(\"locale must be not null!\");\n\t\t\n\t\tLocale oldLocale = this.locale; \n\t\t\n\t\tif(oldLocale != locale) {\n\t\t\t\n\t\t\tresourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE_NAME, locale, control);\n\t\t\t\n\t\t\tthis.locale = locale;\n\t\t\t\n\t\t\tPropertiesManager propertiesManager = PropertiesManager.getInstance();\n\t\t\t\n\t\t\tString language = locale.getLanguage();\n\t\t\tString country = locale.getCountry();\n\t\t\tString variant = locale.getVariant();\n\t\t\t\n\t\t\tpropertiesManager.setProperty(\"locale.language\", language);\n\t\t\tpropertiesManager.setProperty(\"locale.country\", country);\n\t\t\tpropertiesManager.setProperty(\"locale.variant\", variant);\n\n\t\t\tfireLocaleChanged(oldLocale, locale);\n\t\t}\n\t}",
"private void translate()\r\n\t{\r\n\t\tLocale locale = Locale.getDefault();\r\n\t\t\r\n\t\tString language = locale.getLanguage();\r\n\t\t\r\n\t\ttranslate(language);\r\n\t}",
"protected void setLocale(Locale locale) {\n this.locale = locale;\n }",
"@Override\n\tpublic void setLocale(Locale loc) {\n\t}",
"public Object applyLocaleSettings(IApplicationContext context, Map<String, Object> parameters) throws Exception;",
"public void setLocale (\r\n String strLocale) throws java.io.IOException, com.linar.jintegra.AutomationException;",
"public static final void setLocaleFromPreferences(Context ctx) {\n String firstLocale = ctx.getResources().getConfiguration().locale.toString().substring(0, 2);\n String currentLocale = PreferenceManager.getDefaultSharedPreferences(ctx).getString(\"locale\", firstLocale);\n /**\n * Locale locale = new Locale((String) currentLocale); config.locale =\n * locale; Locale.setDefault(locale);\n */\n setLocale(ctx, currentLocale);\n }",
"private void setLocale(String lang) {\n Locale myLocale = new Locale(lang);\n Resources res = getResources();\n DisplayMetrics dm = res.getDisplayMetrics();\n Configuration conf = res.getConfiguration();\n conf.setLocale(myLocale);\n res.updateConfiguration(conf, dm);\n Intent refresh = new Intent(this, MainActivity.class);\n startActivity(refresh);\n finish();\n }",
"public void setLocale(Locale locale) {\r\n this.locale = locale;\r\n }",
"@Override\n public void setLocale(Locale arg0) {\n\n }",
"public static void changeBundle(Locale language) {\r\n\t\tMessages.resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME,\r\n\t\t\t\tlanguage);\r\n\t}",
"public static void setApplicationLanguage(Context context, String code) {\n\t\tResources res = context.getResources();\n\t\tConfiguration androidConfiguration = res.getConfiguration();\n\t\t\n\t\tandroidConfiguration.locale = new Locale(code);\n\t\tres.updateConfiguration(androidConfiguration, res.getDisplayMetrics());\n\t}",
"public void setLocale(Locale locale) {\n this.locale = locale;\n }",
"public void setLocale(Locale locale) {\n this.locale = locale;\n }",
"public void switchLanguage(){\n Locale myLocale = new Locale(\"de\");\r\n // get current Locale\r\n String currentLocale = scanActivity.getResources().getConfiguration().locale\r\n .toString();\r\n // set Locale to english if current Locale is german\r\n if (currentLocale.equals(\"de\")) {\r\n myLocale = new Locale(\"en\");\r\n }\r\n // sets the Locale in the configuration and updates the\r\n // configuration\r\n DisplayMetrics metrics = scanActivity.getResources().getDisplayMetrics();\r\n Configuration config = scanActivity.getResources().getConfiguration();\r\n config.locale = myLocale;\r\n scanActivity.getResources().updateConfiguration(config, metrics);\r\n // recreates the app in order to show the selected language\r\n scanActivity.recreate();\r\n }",
"public void localize(){\n String file=System.getProperty(\"user.home\")+ File.separator + \"rex.properties\";\n Properties rexProp = new Properties();\n try{\n\n rexProp.load(new FileInputStream(new File(file)));\n \n }catch(Exception e){\n S.out(\"Error reading rex.properties file\"); \n }\n strLanguage= rexProp.getProperty(\"Language\");\n \n if (strLanguage!=\"\"){\n Locale oLang= new Locale(strLanguage);\n I18n.setCurrentLocale(oLang);\n }\n else{\n I18n.setCurrentLocale(Locale.getDefault()); //set default locale\n }\n\n }",
"@RequestMapping(value = \"/localechange/{locale}\", method = RequestMethod.GET)\r\n public String changeLocale(@PathVariable(\"locale\") String locale, HttpServletRequest request, HttpServletResponse response) {\r\n if (locale != null) {\r\n if (locale.equals(\"de\")) {\r\n RequestContextUtils.getLocaleResolver(request).setLocale(request, response, Locale.GERMAN);\r\n } else {\r\n RequestContextUtils.getLocaleResolver(request).setLocale(request, response, Locale.ENGLISH);\r\n }\r\n }\r\n return \"redirect:/home\";\r\n }",
"protected void localeChanged() {\n\t}",
"public void applyI18n(){\n if (lastLocale != null && \n lastLocale == I18n.getCurrentLocale()) {\n return;\n }\n lastLocale = I18n.getCurrentLocale();\n \n strHelpLabel= I18n.getString(\"label.help1\")+ version;\n strHelpLabel+=I18n.getString(\"label.help2\");\n strHelpLabel+=I18n.getString(\"label.help3\");\n strHelpLabel+=I18n.getString(\"label.help4\");\n strHelpLabel+=I18n.getString(\"label.help5\");\n strHelpLabel+=I18n.getString(\"label.help6\");\n strHelpLabel+=I18n.getString(\"label.help7\");\n strHelpLabel+=I18n.getString(\"label.help8\");\n helpLabel.setText(strHelpLabel);\n }",
"public void setLocalizedResourceBundle(String path) {\n resourceBundlePath = path;\n resource = ResourceBundle.getBundle(path);\n }",
"@ZAttr(id=345)\n public void setLocale(String zimbraLocale) throws com.zimbra.common.service.ServiceException {\n HashMap<String,Object> attrs = new HashMap<String,Object>();\n attrs.put(Provisioning.A_zimbraLocale, zimbraLocale);\n getProvisioning().modifyAttrs(this, attrs);\n }",
"public void setApplicationLanguage() {\n\t\tinitializeMixerLocalization();\n\t\tinitializeRecorderLocalization();\n\t\tinitializeMenuBarLocalization();\n\t\tsetLocalizedLanguageMenuItems();\n\t\tboardController.setLocalization(bundle);\n\t\tboardController.refreshSoundboard();\n\t}",
"public String locale() throws DynamicCallException, ExecutionException {\n return (String)call(\"locale\").get();\n }",
"public interface LocaleContext {\n Locale getLocale();\n}",
"protected Locale getCurrentLocale()\n\t{\n\t\tLocale locale = getArchLocale();\n\t\tif (locale == null) {\n\t\t\t//Fallback to Spring locale\n\t\t\tlocale = LocaleContextHolder.getLocale();\n\t\t}\n\t\treturn locale;\n\t}",
"public void attachBaseContext(Context context) {\n super.attachBaseContext(LocaleHelper.setLocale(context));\n }",
"String getCurrentLocaleString();",
"private ResourceBundle getBundle(final Locale aLocale) {\n\t\treturn ResourceBundle.getBundle(\"dsm-report\", aLocale, getClass().getClassLoader());\n\t}",
"private void init() {\n\t\t\n\t\tPropertiesManager propertiesManager = PropertiesManager.getInstance();\n\t\tFile localeDirectory = new File(propertiesManager.getProperty(\"locale.directory\", LOCALE_DIRECTORY));\n\n\t\tlocales = new ArrayList<Locale>();\n\n\t\ttry {\n\t\t\t\n\t\t\tClassUtils.addClassPathFile(localeDirectory);\n\t\t\t\n\t\t\t// Находим все доступные локали\n\t\t\tlocales = findAvailableLocales(localeDirectory);\n\n\t\t} catch(Exception ignore) {}\n\n\t\tfallbackLocale = Locale.ENGLISH;\n\t\tcontrol = new Control();\n\n\t\tif(!locales.contains(Locale.ENGLISH)) {\n\t\t\tlocales.add(0, fallbackLocale);\n\t\t}\n\n\t\tdefaultLocale = locales.get(locales.indexOf(Locale.ENGLISH));\n\t\t\n\t\tString language = propertiesManager.getProperty(\"locale.language\", \"\");\n\t\tString country = propertiesManager.getProperty(\"locale.country\", \"\");\n\t\tString variant = propertiesManager.getProperty(\"locale.variant\", \"\");\n\t\t\n\t\tLocale locale = new Locale(language, country, variant);\n\t\t\n\t\tif(locales.contains(locale)) {\n\t\t\tlocale = locales.get(locales.indexOf(locale));\n\t\t} else {\n\t\t\tlocale = defaultLocale;\n\t\t}\n\n\t\tsetLocale(locale);\n\t\t\n\t\tif(FontEditor.DEBUG) {\n\t\t\t\n\t\t\tfor(Locale l : locales) {\n\t\t\t\tSystem.out.println(\"locale found -> \" + l.getDisplayLanguage(Locale.ENGLISH));\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Total locale(s) found: \" + locales.size());\n\t\t\tSystem.out.println();\n\t\t}\n//System.out.println(\">>> \" + getValue(\"shitd\"));\n\t}",
"void addBundle(String bundleBaseName, Locale... locales);",
"public void setLocale(Locale locale) {\n/* 462 */ ParamChecks.nullNotPermitted(locale, \"locale\");\n/* 463 */ this.locale = locale;\n/* 464 */ setStandardTickUnits(createStandardDateTickUnits(this.timeZone, this.locale));\n/* */ \n/* 466 */ fireChangeEvent();\n/* */ }",
"protected void setLocale(Locale locale) {\n this.locale = locale;\n }",
"public clTranslation(String resource) {\n this.resource = resource;\n locale = Locale.getDefault();\n loadResource();\n }",
"public static void changeAppLocale(Context ctx, String lang) {\n Locale locale = new Locale(lang);\n Locale.setDefault(locale);\n Configuration config = new Configuration();\n config.locale = locale;\n ctx.getResources().updateConfiguration(config, ctx.getResources().getDisplayMetrics());\n }",
"private Resources getLocalizedResources(Context context) {\n Configuration conf = context.getResources().getConfiguration();\n conf = new Configuration(conf);\n conf.setLocale(new Locale(LocaleHelper.getLocaleCode(context)));\n Context localizedContext = context.createConfigurationContext(conf);\n return localizedContext.getResources();\n }",
"public clTranslation(String resource, Locale locale) {\n this.resource = resource;\n this.locale = locale;\n loadResource();\n }",
"public void initialize()\n {\n Locale locale = Locale.getDefault();\n var rb = ResourceBundle.getBundle(\"translation\",locale);\n\n customerPerCountryLabel.setText(rb.getString(\"CustomersPerCountry\"));\n backButton.setText(rb.getString(\"Back\"));\n\n\n }",
"public void updateI18N() {\n\t\t/* Update I18N in the menuStructure */\n\t\tappMenu.updateI18N();\n\t\t/* Pack all */\n\t\tLayoutShop.packAll(shell);\n\t}",
"protected Locale resolveLocale()\n\t{\n\t\tLocale locale = getArchLocale();\n\t\tif (locale == null) {\n\t\t\tlocale = getFallbackLocale();\n\t\t}\n\t\tif (locale == null) {\n\t\t\t//Fallback to Spring locale\n\t\t\tlocale = LocaleContextHolder.getLocale();\n\t\t}\n\t\treturn locale;\n\t}",
"public String toBundleName(String baseName, Locale locale) {\n\n \tif(locale == fallbackLocale) {\n \t \treturn DefaultResourceBundle.class.getName();\n\t\t\t}\n\n\t\t\tif(locale == Locale.ROOT) {\n \t \treturn DefaultResourceBundle.class.getName();\n \t }\n\n\t\t\tString language = locale.getLanguage();\n\t\t\tString country = locale.getCountry();\n\t\t\tString variant = locale.getVariant();\n\n\t\t\tif(language == \"\" && country == \"\" && variant == \"\") {\n \t \treturn DefaultResourceBundle.class.getName();\n \t }\n\n\t\t\treturn super.toBundleName(baseName, locale);\n }",
"public interface LocaleProvider {\n\tLocale getLocale();\n}",
"public void setFallbackLocale(Locale locale) { this.fallbackLocale = locale; }",
"public abstract ResourceBundle getBundle();",
"public Locale getLocale() { return this.locale; }",
"public SrvI18n() {\n try { //to fix Android Java\n messages = ResourceBundle.getBundle(\"MessagesBundle\");\n } catch (Exception e) {\n Locale locale = new Locale(\"en\", \"US\");\n messages = ResourceBundle.getBundle(\"MessagesBundle\", locale);\n }\n }",
"public void setLocale(Locale loc) {\n this.response.setLocale(loc);\n }",
"static private void loadBundle() {\r\n\r\n\t\tfinal Locale loc;\r\n\r\n\t\t//load the default or a forced locale\r\n\t\tif (strLanguage == null) {\r\n\t\t\tloc = Locale.getDefault();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tloc = new Locale(strLanguage);\r\n\t\t}\r\n\r\n\t\tresBundle = RiskUtil.getResourceBundle(TranslationBundle.class,\"Risk\",loc);\r\n\r\n\t\t// this will work MOST of the time, but does not in lobby\r\n\t\t// for some reason it stops the classes from loading, and does not find the files\r\n\t\t//resBundle = ResourceBundle.getBundle(\"net.yura.domination.engine.translation.Risk\", loc );\r\n\r\n\r\n\t}",
"public void setLocale(String locale) {\n locale = fixLocale(locale);\n this.locale = locale;\n this.uLocale = new ULocale(locale);\n String lang = uLocale.getLanguage();\n if (locale.equals(\"fr_CA\") || lang.equals(\"en\")) {\n throw new RuntimeException(\"Skipping \" + locale);\n }\n cldrFile = cldrFactory.make(locale, false);\n UnicodeSet exemplars = cldrFile.getExemplarSet(\"\",WinningChoice.WINNING);\n usesLatin = exemplars != null && exemplars.containsSome(LATIN_SCRIPT);\n for (DataHandler dataHandler : dataHandlers) {\n dataHandler.reset(cldrFile);\n }\n }",
"public void setRequestedLocale(final Locale val) {\n requestedLocale = val;\n }",
"void setCurrentLocaleIndex(int value) {\n\n this.currentLocaleIndex = value;\n this.updateBundle();\n }",
"private void setLanguage() {\n ResourceBundle labels = ResourceBundle.getBundle\n (\"contactmanager.Contactmanager\", Locale.getDefault()); \n this.setTitle(labels.getString(\"title\"));\n }",
"void localizationChaneged();",
"@SuppressWarnings(\"deprecation\")\r\n public void setLanguage(String langTo) {\n Locale locale = new Locale(langTo);\r\n Locale.setDefault(locale);\r\n\r\n Configuration config = new Configuration();\r\n\r\n config.setLocale(locale);//config.locale = locale;\r\n\r\n if (Build.VERSION.SDK_INT == Build.VERSION_CODES.N) {\r\n createConfigurationContext(config);\r\n } else {\r\n getResources().updateConfiguration(config, getResources().getDisplayMetrics());\r\n }\r\n\r\n //createConfigurationContext(config);\r\n getResources().updateConfiguration(config, getApplicationContext().getResources().getDisplayMetrics());//cannot resolve yet\r\n //write into settings\r\n SharedPreferences.Editor editor = mSettings.edit();\r\n editor.putString(APP_PREFERENCES_LANGUAGE, langTo);\r\n editor.apply();\r\n //get appTitle\r\n if(getSupportActionBar()!=null){\r\n getSupportActionBar().setTitle(R.string.app_name);\r\n }\r\n\r\n }",
"java.lang.String getLocale();",
"public void temp() {\n\t\t\n\t\tString language = locale.getLanguage();\n\t\tSystem.out.println(language);\n\t\t\n\t\tif(language.equals(\"ru\")) {\n\t\t\tsetLocale(new Locale(\"en\", \"US\"));\n\t\t} else {\n\t\t\tsetLocale(new Locale(\"ru\", \"UA\"));\n\t\t}\n\t}",
"public static void setLocale(Locale newLocale) {\n if (newLocale == null) {\n newLocale = Locale.getDefault();\n }\n localeInfo.set(newLocale);\n }",
"@Override\n\tpublic final void setLocale(final Locale locale)\n\t{\n\t\tif (httpServletResponse != null)\n\t\t{\n\t\t\thttpServletResponse.setLocale(locale);\n\t\t}\n\t}",
"public void setLocale(String value) {\n setAttributeInternal(LOCALE, value);\n }",
"public void setLocale(String value) {\n setAttributeInternal(LOCALE, value);\n }",
"private static Locale getUserPreferredLocale() {\n\t\tfinal ResourceLoader rl = new ResourceLoader();\n\t\treturn rl.getLocale();\n\t}",
"public void setLocale(String locale)\n\t\t{\n\t\t this.setLocaleLocked(locale);\n\t\t}",
"private String addLocaleToTemplateTypeResourcePath(String path, String locale) {\n\n if (StringUtils.isNotBlank(locale)) {\n return path + PATH_SEPARATOR + locale.toLowerCase();\n } else {\n return path;\n }\n }",
"public static void updateLocale(HttpServletRequest request, Locale locale) {\n\t\tupdateLocale(request.getSession(), locale);\n\t}",
"protected void setLocale(Locale locale) {\n this.locale = LocaleHelper.normalize(locale);\n }",
"private LocalizationProvider() {\r\n\t\tthis.language = DEFAULT_LANGUAGE;\r\n\t\tthis.bundle = ResourceBundle.getBundle(\"hr.fer.zemris.java.hw11.jnotepadapp.local.languages\",\r\n\t\t\t\tLocale.forLanguageTag(language));\r\n\t}",
"static private void setLanguage(String strL) {\r\n\r\n\t\tstrLanguage = strL;\r\n\r\n\t\t// need to reload it again!\r\n\t\tloadBundle();\r\n\t}",
"public String getLocale()\n {\n return (m_taskVector == null || m_taskVector.size() == 0) ?\n DEFAULT_LOCALE :\n taskAt(0).getSourceLanguage();\n }",
"public Locale getCurrentLocale() {\r\n\t\t// NOTE: should be written in some properties file\r\n\t\tLocale defaultLocale = getLocale();\r\n\t\tLocale locale = getUsersLocale();\r\n\t\t\r\n\t\tif (locale == null) {\r\n\t\t\treturn defaultLocale;\r\n\t\t}\r\n\t\treturn locale;\r\n\t}",
"public String getLocale() {\n return this.locale;\n }",
"String getLocalizedString(Locale locale);",
"Language(Locale locale) {\n this.locale = locale;\n }",
"public void changeLanguage(View v) {\n Resources res = getResources();\n DisplayMetrics dm = res.getDisplayMetrics();\n Configuration config = res.getConfiguration();\n\n String targetLanguage;\n\n // Log.d(\"en-US\", targetLanguage);\n\n if ( config.locale.toString().equals(\"pt\") ) {\n targetLanguage = \"en-US\";\n } else {\n targetLanguage = \"pt\";\n }\n\n Locale newLang = new Locale(targetLanguage);\n\n config.locale = newLang;\n res.updateConfiguration(config, dm);\n\n // Reload current page with new language\n Intent refresh = new Intent(this, Settings.class);\n startActivity(refresh);\n }",
"public void setResourceBundle(ResourceBundle rb) {\n resourcesBundle = rb;\n loader.setResources(rb);\n }",
"private Locale getLocale() {\n Locale selectedLocale = (Locale) Sessions.getCurrent().getAttribute(Attributes.PREFERRED_LOCALE);\n if (selectedLocale != null) {\n return selectedLocale;\n }\n Locale defaultLocale = ((HttpServletRequest) Executions.getCurrent().getNativeRequest()).getLocale();\n Sessions.getCurrent().setAttribute(org.zkoss.web.Attributes.PREFERRED_LOCALE, defaultLocale);\n return defaultLocale;\n }"
] | [
"0.67527443",
"0.64280486",
"0.618957",
"0.61204535",
"0.61198425",
"0.6076342",
"0.6023254",
"0.5996667",
"0.5909292",
"0.58942646",
"0.58772",
"0.58759934",
"0.5857093",
"0.58403766",
"0.5821699",
"0.57602364",
"0.57492983",
"0.574383",
"0.5735469",
"0.5711554",
"0.5678343",
"0.5667787",
"0.5663374",
"0.5661419",
"0.56548834",
"0.5654225",
"0.5639049",
"0.56358945",
"0.5610892",
"0.5607042",
"0.5583302",
"0.5581126",
"0.5580857",
"0.5579442",
"0.5541624",
"0.55397576",
"0.55145824",
"0.5513631",
"0.5489819",
"0.5489819",
"0.5489538",
"0.54831177",
"0.54797184",
"0.5463832",
"0.54449266",
"0.54235107",
"0.5414181",
"0.54131824",
"0.5398765",
"0.5381918",
"0.53772515",
"0.53767926",
"0.5345925",
"0.53346705",
"0.53095233",
"0.5285418",
"0.52801293",
"0.5278898",
"0.5277784",
"0.52775884",
"0.5270426",
"0.52482706",
"0.52342576",
"0.522957",
"0.52259254",
"0.5216056",
"0.52159154",
"0.521163",
"0.52097064",
"0.520514",
"0.5195511",
"0.51803917",
"0.5180002",
"0.5175849",
"0.5168042",
"0.5165729",
"0.51646084",
"0.514835",
"0.51452374",
"0.5141155",
"0.5138883",
"0.513506",
"0.5130911",
"0.5122658",
"0.5122658",
"0.51211435",
"0.51210153",
"0.5096486",
"0.5089979",
"0.50808114",
"0.5078742",
"0.5077665",
"0.50690436",
"0.5055197",
"0.5036523",
"0.5020308",
"0.50198656",
"0.5014416",
"0.501248",
"0.50115126"
] | 0.679073 | 0 |
Increments current locale pointer. | void changeLanguage() {
this.currentLocaleIndex++;
if(this.currentLocaleIndex > this.locales.size() - 1) this.currentLocaleIndex = 0;
this.updateBundle();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void incrementCurrent() {\n current++;\n }",
"public void inc(){\n this.current += 1;\n }",
"public void updateLocale() {\r\n\t\tsuper.updateLocale();\r\n\t}",
"void setCurrentLocaleIndex(int value) {\n\n this.currentLocaleIndex = value;\n this.updateBundle();\n }",
"public void increasecounter() {\n\t\tmPref.edit().putInt(PREF_CONVERTED, counter + 1).commit();\r\n\t}",
"public void incrementCurrentIndex() {\n currentIndex++;\n }",
"public void inc()\n {\n _level++;\n calculateIndentationString();\n }",
"public void incrementCurrentRoundNumber() {\n\t\t\n\t\tcurrentRoundnumber = currentRoundnumber +1;\n\t}",
"public void increment() {\n increment(1);\n }",
"public void increment() {\n\t\tif (m_bYear) {\n\t\t\tm_value++;\n\t\t\tif (m_value > 9999)\n\t\t\t\tm_value = 0;\n\t\t} else {\n\t\t\tm_value++;\n\t\t\tif (m_value > 11)\n\t\t\t\tm_value = 0;\n\n\t\t}\n\t\trepaint();\n\t}",
"public void inc() {\n inc(1);\n }",
"@Override\n public void advance() {\n if (isCurrent()) {\n prev = cursor;\n cursor = cursor.getNext();\n } else {\n throw new IllegalStateException(\"There is no current element.\");\n }\n }",
"protected void localeChanged() {\n\t}",
"public void\t\t\t\t\t\t\tincreaseLevel()\t\t\t\t\t\t\t\t{ this.currentLevel += 1; }",
"public void incOffset( Integer increment ) {\n offset += increment;\n }",
"public void increase() {\r\n\r\n\t\tincrease(1);\r\n\r\n\t}",
"public void IncrementCounter()\r\n {\r\n \tif (startAtUsed==false\r\n \t\t\t|| (!counter.encounteredAlready)) {\r\n \t\t// Defer setting the startValue until the list\r\n \t\t// is actually encountered in the main document part,\r\n \t\t// since otherwise earlier numbering (using the\r\n \t\t// same abstract number) would use this startValue\r\n \tcounter.setCurrentValue(this.startValue); \r\n \tlog.debug(\"not encounteredAlready; set to startValue \" + startValue);\r\n \tcounter.encounteredAlready = true;\r\n \tstartAtUsed = true;\r\n \t}\r\n counter.IncrementCounter();\r\n }",
"@Override\n public final void noteAbsoluteEntryPoint(int currentValue, ClassicLang lang) {\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 }",
"public int IncrementOffset() {\n int oldOffset = offset;\n offset += MachineDependent.WORDSIZE;\n return oldOffset;\n }",
"public void increment() {\n sync.increment();\n }",
"public void increase()\n {\n setCount(getCount() + 1);\n }",
"public void increment(int symbol);",
"public static void increment() {\n\t\tcount.incrementAndGet();\n//\t\tcount++;\n\t}",
"private void incrementCounter()\r\n\t{\r\n\t\tthis.counter++;\r\n\t}",
"public void incValue(){\n\t\tif(this.value < 9){\n\t\t\tthis.value++;\n\t\t}\n\t\telse{\n\t\t\tthis.value = 0;\n\t\t}\n\t}",
"public void incrementLevel()\r\n {\r\n counts.addFirst( counts.removeFirst() + 1 );\r\n }",
"private void nextLevel()\n\t{\n\t\tMapInstance.getInstance().setSelectedLevel(MapInstance.getInstance().getSelectedLevel() + 1);\n\t}",
"public static void increase(){\n c++;\n }",
"public void increment() {\n mNewNotificationCount.setValue(mNewNotificationCount.getValue() + 1);\n }",
"@Override\r\n\tpublic int isMoveNextTo18Plus()\r\n\t{\r\n\t\treturn 1;\r\n\t}",
"public void refreshLocale() {\n this.mWifiTracker.refreshLocale();\n }",
"public void increment(){\n\t\twordCount += 1;\n\t}",
"private Token advance() {\n if(!isAtEnd()) current++;\n return previous();\n }",
"protected void assignCurrentValue() {\n\t\tcurrentValue = new Integer(counter + incrValue);\n\t}",
"public void advance( )\r\n {\r\n\t if(isCurrent() != true){// Implemented by student.\r\n\t throw new IllegalStateException(\"no current element\");\r\n\t }\r\n\t else\r\n\t \t precursor = cursor;\r\n\t \t cursor = cursor.getLink(); // Implemented by student.\r\n }",
"private void increaseCurrentPlayerIndex() {\n\t\tcurrentPlayer++;\n\t\tif(currentPlayer>3)\n\t\t\tcurrentPlayer=0;\n\t}",
"public void incrementIndex() {\n\t\tindex++;\n\t\tif (nextItem != null) {\n\t\t\tnextItem.incrementIndex();\n\t\t}\n\t}",
"public void add()\n {\n set(++ current);\n }",
"private void increaseOneToQuantity() {\n String previousValueString = mQuantityEditText.getText().toString();\n int previousValue;\n if (previousValueString.isEmpty() || previousValueString.equals(\"0\")) {\n return;\n }\n else {\n previousValue = Integer.parseInt(previousValueString);\n mQuantityEditText.setText(String.valueOf(previousValue + 1));\n }\n }",
"public void incrementRow() {\n setRowAndColumn(row + 1, column);\n }",
"public void mo38280a(Locale locale) {\n this.f27040c = locale;\n }",
"private void advanceTime() {\r\n myCurrentTimeLabel.setText(DateFormat.getDateTimeInstance().format(new Date()));\r\n }",
"public void goNextLevel(){\r\n setCurrentLevel(currentLevel.getNextLevel());\r\n }",
"public void moveNext() {\n\t\tcurrentElement++;\n\t}",
"public static synchronized void increment() {\n counter++;\n }",
"public void increaseScore(){\n this.inc.seekTo(0);\n this.inc.start();\n this.currentScore++;\n }",
"private void inc_x()\n {\n synchronized(mLock_IndexX) { set_x(get_x() + 1); }\n }",
"public void increment() {\n this.data++;\n }",
"public void setLocale (\r\n String strLocale) throws java.io.IOException, com.linar.jintegra.AutomationException;",
"public static synchronized void increment() {\r\n\t\tcount++;\r\n\t}",
"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}",
"default void inc(long value) {\n\t\tcount(Math.abs(value));\n\t}",
"@Override\n void advance() {\n }",
"public void addLocaleChangeListener(LocaleChangeListener l) {\n\t\t\n\t\tlistenerList.add(LocaleChangeListener.class, l);\n }",
"private static void increaseReference(Counter counter) {\n counter.advance(1);\n }",
"public void increment() {\n items++;\n }",
"public void increment()\n // Increments this IncDate to represent the next day.\n {\n\t boolean ly = false;\n\t if(((year % 4 == 0) && year % 100 != 0) || year % 400 == 0) {\n\t\t //leap year\n\t\t ly = true;\n\t }\n\t if ((month == 2 && day == 28 && !ly) || (month == 2 && day == 29 && ly)) {\n\t\t month = 3;\n\t\t day = 1;\n\t } else if (month == 2 && day == 28 && !ly) {\n\t\t day ++;\n\t } else if ((month == 4 || month == 6 || month == 9 || month == 11) && day == 30){\n\t\t month ++;\n\t\t day = 1;\n\t } else if ((month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10) && day == 31){\n\t\t System.out.println(\"month is \" + month);\n\t\t month ++;\n\t\t day = 1;\n\t } else if ((month == 12) && day == 31) {\n\t\t year ++;\n\t\t month = 1;\n\t\t day = 1;\n\t } else {\n\t\t day ++;\n\t }\n }",
"@Override\n\t\tpublic int next() {\n\t\t\treturn current++;\n\t\t}",
"public void inputNext() {\n ++this.currentIndex;\n this.currentUnit = getUnit(this.currentIndex);\n this.currentChName = this.currentUnit.chName;\n }",
"@Override\n\tpublic void setLocale(Locale loc) {\n\t}",
"public void switchLanguage(){\n Locale myLocale = new Locale(\"de\");\r\n // get current Locale\r\n String currentLocale = scanActivity.getResources().getConfiguration().locale\r\n .toString();\r\n // set Locale to english if current Locale is german\r\n if (currentLocale.equals(\"de\")) {\r\n myLocale = new Locale(\"en\");\r\n }\r\n // sets the Locale in the configuration and updates the\r\n // configuration\r\n DisplayMetrics metrics = scanActivity.getResources().getDisplayMetrics();\r\n Configuration config = scanActivity.getResources().getConfiguration();\r\n config.locale = myLocale;\r\n scanActivity.getResources().updateConfiguration(config, metrics);\r\n // recreates the app in order to show the selected language\r\n scanActivity.recreate();\r\n }",
"public int increase() {\r\n return ++value;\r\n }",
"public void increment(){\n value+=1;\n }",
"public void inputPrev() {\n --this.currentIndex;\n this.currentUnit = getUnit(this.currentIndex);\n this.currentChName = this.currentUnit.chName;\n }",
"public void incCounter()\n {\n counter++;\n }",
"private char advance() {\n current++;\n return source.charAt(current - 1);\n }",
"public void setLocale(Locale locale) {\n\n\t}",
"public void incrementOrder() {\n mOrder++;\n }",
"public void setLocale(Locale locale) {\n fLocale = locale;\n }",
"protected void resetNextAdvanceLineNumber() {\n this.nextAdvanceLineNumber = new Integer(1);\n }",
"public void incrementAmount() { amount++; }",
"protected void incrementSeqNum() {\n intToNetworkByteOrder(mySeqNum++, sequenceNum, 0, 4);\n }",
"@Override\n public synchronized void increment() {\n count++;\n }",
"public void increaseDisplayOrder(int incDisplayOrder){\n\t\tupdateDisplayOrder(this.displayOrder + incDisplayOrder);\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 void inc(String name) {\n inc(name, 1);\n }",
"private void changeLocateAndRestart(String lCode) {\n\t\t\n\t\t\n\t\t Locale locale = new Locale(lCode);\n\t Locale.setDefault(locale);\n\t Configuration config = new Configuration();\n\t config.locale = locale;\n\t con.getApplicationContext().getResources().updateConfiguration(config, null);\n\n\t \n\t PersistData.setStringData(con, \"LNG\", lCode);\n\t \n\t Log.e(\"Storing language code \", lCode);\n\t \n\t \n\t \n\t /*\n\t * most important, can create bug. Rememer the sequence, otherwise it won't work.\n\t */\n\t \n\t \n\t /*\n\t * Call finish method first\n\t * \n\t */\n\t MainActivity.this.finish();\n\t \n\t /*\n\t * then call same activity to restart.\n\t */\n\t \n\t Intent i=new Intent(con, MainActivity.class);\n\t\t \n\t\t startActivity(i);\n\n\t\t\n\t}",
"@Override\n\tpublic void inc(Rule rule, String categoryOrContextProperty,\n\t\t\tString subCategoryOrVocabulary, String counterName, String term,\n\t\t\tlong incrementOffset) throws Exception {\n\t\t\n\t}",
"private void m145782l() {\n this.f119477j.f119578d |= 16;\n if ((this.f119477j.f119578d & 16) == 0) {\n String locale = this.f119477j.f119580f.toString();\n nativeRegisterLocalizedCollators(this.f119482o, locale);\n if (!this.f119478k) {\n try {\n mo115433a(\"CREATE TABLE IF NOT EXISTS android_metadata (locale TEXT)\", null, null);\n String c = mo115440c(\"SELECT locale FROM android_metadata UNION SELECT NULL ORDER BY locale DESC LIMIT 1\", null, null);\n if (c == null || !c.equals(locale)) {\n mo115433a(\"BEGIN\", null, null);\n mo115433a(\"DELETE FROM android_metadata\", null, null);\n mo115433a(\"INSERT INTO android_metadata (locale) VALUES(?)\", new Object[]{locale}, null);\n mo115433a(\"REINDEX LOCALIZED\", null, null);\n mo115433a(\"COMMIT\", null, null);\n }\n } catch (RuntimeException e) {\n StringBuilder sb = new StringBuilder(\"Failed to change locale for db '\");\n sb.append(this.f119477j.f119576b);\n sb.append(\"' to '\");\n sb.append(locale);\n sb.append(\"'.\");\n throw new SQLiteException(sb.toString(), e);\n } catch (Throwable th) {\n mo115433a(\"ROLLBACK\", null, null);\n throw th;\n }\n }\n }\n }",
"void setUnitIncrement(Adjustable adj, int u);",
"@Override\n public void move() {\n _location.x++;\n }",
"public void AdvancePos() {\n \tswitch (data3d.TrackDirection){\n \tcase 0:\n \tc2.PositionValue += 1;\n \tc2.PositionValue = (c2.PositionValue % c2.getMaxPos());\n \tbreak;\n \tcase 1:\n \tc3.PositionValue += 1;\n \tc3.PositionValue = (c3.PositionValue % c3.getMaxPos());\n \tbreak;\n \tcase 2:\n \tc1.PositionValue += 1;\n \tc1.PositionValue = (c1.PositionValue % c1.getMaxPos());\n \tbreak;\n \tcase 3:\n \tdata3d.setElement((data3d.ActiveElement + 1) % data3d.Elements);\n \tcase 4:\n \tdata3d.setTime((data3d.ActiveTime + 1) % data3d.Times);\n \t}\n }",
"public void goNextLine () throws IOException {\n\t\treader.goNextLine();\n\t\tcurrentLine = reader.getCurrentLine();\n\t}",
"@Override\r\n\tpublic int increase() throws Exception {\n\t\treturn 0;\r\n\t}",
"public void incQty() {\n b.qty.setText(\"\" + ++qty);\n\n }",
"@Override\n public void setLocale(Locale arg0) {\n\n }",
"public void incrank() {\n\t\trank++;\n\t}",
"@Override\n public Lexeme<PXStylesheetTokenType> advance() {\n Lexeme<PXStylesheetTokenType> candidate = lexer.nextLexeme();\n\n while (candidate == null && lexerStack != null && !lexerStack.isEmpty()) {\n // pop lexer\n lexer = lexerStack.pop();\n\n // notify the parser that we've done so\n lexerDidPopSource();\n\n // try getting the next lexeme from the newly activated lexer\n candidate = lexer.nextLexeme();\n }\n\n return currentLexeme = candidate;\n }",
"private synchronized void increment() {\n count++;\n atomicInteger.incrementAndGet();\n }",
"public final void nextRow() {\n this.line++;\n }",
"public void advance() {\n if( mMatches.hasNext() ) {\n setCurrent( mMatches.next() );\n }\n }",
"public void moveUp(){\n if(currentText != null) {\n //If this is not the very first text\n if (lineIndex > 0) {\n //Move up\n lineIndex--;\n currentText = texts.get(lineIndex);\n\n //Try to use the saved character index as the character index\n if (savedCharacterIndex != -1) {\n characterIndex = savedCharacterIndex;\n }\n\n //Ensure that character index is within the bounds of the text\n if (characterIndex > currentText.getCharacterEdges().length - 1) {\n //Save the character index\n if (characterIndex > savedCharacterIndex) {\n savedCharacterIndex = characterIndex;\n }\n characterIndex = currentText.getCharacterEdges().length - 1;\n }\n\n //Update the position\n updatePosition();\n }\n //If this is the first line then put the cursor at the start of the line instead\n else {\n //The saved character index should no longer be restored\n savedCharacterIndex = -1;\n\n characterIndex = 0;\n updateXPosition(true);\n }\n }\n }",
"public void setPreferredLocale(Locale locale);",
"public int increase()\n {\n return this.increase(1);\n }",
"public long inc(final String key) {\n String c = get(key);\n if (c == null) c = \"0\";\n final long l = Long.parseLong(c) + 1;\n put(key, Long.toString(l));\n return l;\n }",
"public void componentsLocaleChanged() {\n\t\ttextRes = PeralexLibsBundle.getResource();\n\n\t\tlocaleChanged();\n\t}",
"public void advancePC(int offset) {\n pc = nPC;\n nPC += offset;\n }",
"public boolean incrementX()\n {\n return setPosition(this.position.getXPosition() + 1, this.position.getYPosition());\n }",
"public void increasePaymentCounter() throws SQLException{\n\t\tConnection conn = DataSource.getConnection();\n\t\ttry{\n\t\n\t\t\tString query = \"Update loan \"\n\t\t\t\t\t\t+ \" SET current_payment_counter = current_payment_counter+1\"\n\t\t\t\t\t\t+ \" WHERE client_id = '\"+this.client_id+\"' AND start_date = '\"+this.start_date+\"';\";\n\t\t\tStatement stat = conn.createStatement();\n\t\t\tstat.execute(query);\n\t\t\t\n\t\t}finally{\n\t\t\tconn.close();\n\t\t}\n\t}"
] | [
"0.59830844",
"0.59573513",
"0.57438785",
"0.56182563",
"0.54880035",
"0.54783803",
"0.541031",
"0.53926045",
"0.5358521",
"0.53234595",
"0.5289054",
"0.524413",
"0.5213334",
"0.5209228",
"0.5170696",
"0.51682997",
"0.516763",
"0.5144282",
"0.5140964",
"0.5124982",
"0.50975484",
"0.50894403",
"0.50890213",
"0.50803226",
"0.5060884",
"0.5023962",
"0.5019994",
"0.49754915",
"0.49529448",
"0.49522918",
"0.4950594",
"0.4938137",
"0.49318317",
"0.49236447",
"0.49174276",
"0.49132013",
"0.49000138",
"0.48976025",
"0.48668042",
"0.48487252",
"0.484823",
"0.48446125",
"0.48401514",
"0.4829737",
"0.48099953",
"0.4804728",
"0.47879878",
"0.4783769",
"0.47820616",
"0.4766583",
"0.47620845",
"0.47504693",
"0.47436392",
"0.47351736",
"0.47346246",
"0.47326773",
"0.47293225",
"0.47223228",
"0.4720606",
"0.47202983",
"0.47130188",
"0.47051018",
"0.47040617",
"0.46950585",
"0.46937534",
"0.4690428",
"0.46904075",
"0.46862805",
"0.46859154",
"0.46856907",
"0.4671896",
"0.4671758",
"0.4667798",
"0.46593636",
"0.4655669",
"0.46542752",
"0.46542332",
"0.46499094",
"0.4646504",
"0.4645449",
"0.46404034",
"0.46382567",
"0.46296898",
"0.46257246",
"0.46185824",
"0.46072343",
"0.46017337",
"0.46000496",
"0.45969266",
"0.4596614",
"0.45953456",
"0.45934105",
"0.45910248",
"0.45841545",
"0.45828763",
"0.45824826",
"0.45808575",
"0.45795998",
"0.45756596",
"0.45752674"
] | 0.5924692 | 2 |
Sets current language to new pointer. | void setCurrentLocaleIndex(int value) {
this.currentLocaleIndex = value;
this.updateBundle();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setLanguage(Language language);",
"public void setLanguage(String newLanguage) {\r\n language = newLanguage;\r\n }",
"private void changeLanguage(String newLanguage){\n\tif (newLanguage.contentEquals(\"FR\")){\n\t\t((GameActivity) activity).setStringPreferences(\"language\", \"1\");\n\t} else if (newLanguage.contentEquals(\"UK\")){\n\t\t((GameActivity) activity).setStringPreferences(\"language\", \"2\");\n\t}\n\t\n\t/*\n\tprefLanguage = ((GameActivity) activity).getPreference(\"language\", \"1\");\n\tif (prefLanguage.contentEquals(\"1\")){\n\t\tresourcesManager.tts.setLanguage(Locale.FRENCH);\n\t} else if (prefLanguage.contentEquals(\"2\")){\n\t\tresourcesManager.tts.setLanguage(Locale.ENGLISH);\t\n\t}\n\t*/\n\t\n\t\n\t\n\t/*\n\tif (newLanguage.contentEquals(\"FR\")){\n\t\tresourcesManager.tts.setLanguage(Locale.FRENCH);\n\t\tlocalLanguage=0;\n\t} else if (newLanguage.contentEquals(\"UK\")){\n\t\tresourcesManager.tts.setLanguage(Locale.ENGLISH);\t\n\t\tlocalLanguage=1;\n\t}\n\t*/\n\t\n}",
"static private void setLanguage(String strL) {\r\n\r\n\t\tstrLanguage = strL;\r\n\r\n\t\t// need to reload it again!\r\n\t\tloadBundle();\r\n\t}",
"void changeLanguage() {\n\n this.currentLocaleIndex++;\n if(this.currentLocaleIndex > this.locales.size() - 1) this.currentLocaleIndex = 0;\n this.updateBundle();\n }",
"public void switchLanguage(){\n Locale myLocale = new Locale(\"de\");\r\n // get current Locale\r\n String currentLocale = scanActivity.getResources().getConfiguration().locale\r\n .toString();\r\n // set Locale to english if current Locale is german\r\n if (currentLocale.equals(\"de\")) {\r\n myLocale = new Locale(\"en\");\r\n }\r\n // sets the Locale in the configuration and updates the\r\n // configuration\r\n DisplayMetrics metrics = scanActivity.getResources().getDisplayMetrics();\r\n Configuration config = scanActivity.getResources().getConfiguration();\r\n config.locale = myLocale;\r\n scanActivity.getResources().updateConfiguration(config, metrics);\r\n // recreates the app in order to show the selected language\r\n scanActivity.recreate();\r\n }",
"public void setLanguage(Language l)\n\t{\n\t\tm_language = l;\n\t}",
"public void setLanguage(String pLanguage) throws DynamicCallException, ExecutionException{\n call(\"setLanguage\", pLanguage).get();\n }",
"void updateLang() {\n if (lang == null)\n lang = game.q;\n }",
"public void xsetLanguage(org.apache.xmlbeans.XmlNMTOKEN language)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlNMTOKEN target = null;\n target = (org.apache.xmlbeans.XmlNMTOKEN)get_store().find_attribute_user(LANGUAGE$14);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlNMTOKEN)get_store().add_attribute_user(LANGUAGE$14);\n }\n target.set(language);\n }\n }",
"public void xsetLanguage(org.apache.xmlbeans.XmlNMTOKEN language)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlNMTOKEN target = null;\n target = (org.apache.xmlbeans.XmlNMTOKEN)get_store().find_attribute_user(LANGUAGE$14);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlNMTOKEN)get_store().add_attribute_user(LANGUAGE$14);\n }\n target.set(language);\n }\n }",
"protected static void setLanguage(Language lang) {\r\n\t\tInterface.lang = lang;\r\n\t}",
"public void setLanguage(String language);",
"public void setLanguage (String language) {\n\t\tthis.language=language;\n\t\tthis.update();\n\t}",
"@Override\n public void setLanguage(String lang) {\n }",
"private void switchLanguage( ){\n \tString xpathEnglishVersion = \"//*[@id=\\\"menu-item-4424-en\\\"]/a\";\n \tif( driver.findElement( By.xpath( xpathEnglishVersion ) ).getText( ).equals( \"English\" ) ) {\n \t\tSystem.out.println( \"Change language to English\" );\n \t\tdriver.findElement( By.xpath( xpathEnglishVersion ) ).click( );\n \t\tIndexSobrePage.sleepThread( );\n \t}\n }",
"private void setLanguage(String currentLang) {\n AppSharedPreference.getInstance().putString(this, AppSharedPreference.PREF_KEY.CURRENT_LANGUAGE, currentLang);\n AppSharedPreference.getInstance().putString(this, AppSharedPreference.PREF_KEY.CURRENT_LANGUAGE_CODE, String.valueOf(languageCode));\n tvEnglish.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);\n tvChineseTrad.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);\n tvChineseSimple.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);\n tvMalyalm.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);\n tvHindi.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);\n tvUrdu.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);\n switch (currentLang) {\n case Constants.AppConstant.CHINES_TRAD:\n tvChineseTrad.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_check_green, 0);\n break;\n case Constants.AppConstant.CHINES_SIMPLE:\n tvChineseSimple.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_check_green, 0);\n break;\n case Constants.AppConstant.MALAYALAM:\n tvMalyalm.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_check_green, 0);\n break;\n case Constants.AppConstant.HINDI:\n tvHindi.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_check_green, 0);\n break;\n case Constants.AppConstant.ARABIC:\n tvUrdu.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_check_green, 0);\n break;\n default:\n tvEnglish.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_check_green, 0);\n }\n }",
"public Future<Void> setLanguage(String pLanguage) throws DynamicCallException, ExecutionException{\n return call(\"setLanguage\", pLanguage);\n }",
"public static void setlanguage(Context ctx, String latitude) {\n\t\tEditor editor = getSharedPreferences(ctx).edit();\n\t\teditor.putString(language, latitude);\n\t\teditor.commit();\n\t}",
"@Override\n public final void switchTemporarily(ClassicLang newLang) {\n }",
"public void updateLanguage() {\n this.title.setText(LanguageStringMap.get().getMap().get(TITLE_KEY));\n this.skinSwitcher.updateLanguage();\n this.langSwitcher.updateLanguage();\n this.pawnSwitcher.updateLanguage();\n this.musicManager.updateLanguage();\n this.back.setText(LanguageStringMap.get().getMap().get(BACK_KEY));\n }",
"public void setEditorLanguage(EditorLanguage lang) {\n if(lang == null) {\n lang = new EmptyLanguage();\n }\n this.mLanguage = lang;\n if(mSpanner != null) {\n mSpanner.setCallback(null);\n }\n mSpanner = new TextColorProvider(lang.createAnalyzer());\n mSpanner.setCallback(this);\n if(mText != null) {\n mSpanner.analyze(mText);\n }\n if(mACPanel != null) {\n mACPanel.hide();\n mACPanel.setProvider(lang.createAutoComplete());\n }\n if(mCursor != null){\n mCursor.setLanguage(mLanguage);\n }\n invalidate();\n }",
"public void setLanguage(final String lang)\r\n {\r\n // We grant to JavaScript the same privileges as the core applet\r\n\r\n AccessController.doPrivileged(new PrivilegedAction<Object>()\r\n {\r\n public Object run()\r\n {\r\n LabelManager.setLang(lang);\r\n return null;\r\n }\r\n });\r\n }",
"@Override\n\tpublic void notifyLanguageChanged(GameLanguageInfo oldValue) {\n\t\tGameLanguageInterface languageModel = nativeModel.getLanguage();\n\t\tIterator<Entry<LanguageNode, ReadOnlyStringWrapper>> iterator = currentLanguageNodes.entrySet().iterator();\n\t\twhile(iterator.hasNext()) {\n\t\t\tEntry<LanguageNode, ReadOnlyStringWrapper> entry = iterator.next();\n\t\t\tentry.getValue().set(languageModel.get(entry.getKey()));\n\t\t}\n\t}",
"public void resetLanguage() {\n BlockConnectorShape.resetConnectorShapeMappings();\n getWorkspace().getEnv().resetAllGenuses();\n BlockLinkChecker.reset();\n }",
"@SuppressLint(\"SetTextI18n\")\n @Override\n public void setLanguage() {\n if (Value.language_flag == 0) {\n title.setText(title_text);\n back.setText(\"back\");\n copyright.setText(Value.copyright_text + Value.ver);\n nowTime.setText(Value.updatestring + Value.updateTime);\n } else if (Value.language_flag == 1) {\n title.setText(title_text);\n back.setText(\"返回\");\n copyright.setText(Value.copyright_text + Value.ver);\n nowTime.setText(Value.updatestring + Value.updateTime);\n } else if (Value.language_flag == 2) {\n title.setText(title_text);\n back.setText(\"返回\");\n copyright.setText(Value.copyright_text + Value.ver);\n nowTime.setText(Value.updatestring + Value.updateTime);\n }\n }",
"public void changeLanguage(View v) {\n Resources res = getResources();\n DisplayMetrics dm = res.getDisplayMetrics();\n Configuration config = res.getConfiguration();\n\n String targetLanguage;\n\n // Log.d(\"en-US\", targetLanguage);\n\n if ( config.locale.toString().equals(\"pt\") ) {\n targetLanguage = \"en-US\";\n } else {\n targetLanguage = \"pt\";\n }\n\n Locale newLang = new Locale(targetLanguage);\n\n config.locale = newLang;\n res.updateConfiguration(config, dm);\n\n // Reload current page with new language\n Intent refresh = new Intent(this, Settings.class);\n startActivity(refresh);\n }",
"public void xsetLang(org.apache.xmlbeans.XmlLanguage lang)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlLanguage target = null;\n target = (org.apache.xmlbeans.XmlLanguage)get_store().find_attribute_user(LANG$28);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlLanguage)get_store().add_attribute_user(LANG$28);\n }\n target.set(lang);\n }\n }",
"public void setLang(LANG language) {\n\t\tthis.language = language;\n\t}",
"public void setApplicationLanguage() {\n\t\tinitializeMixerLocalization();\n\t\tinitializeRecorderLocalization();\n\t\tinitializeMenuBarLocalization();\n\t\tsetLocalizedLanguageMenuItems();\n\t\tboardController.setLocalization(bundle);\n\t\tboardController.refreshSoundboard();\n\t}",
"public void updateLanguage() {\n try {\n getUserTicket().setLanguage(EJBLookup.getLanguageEngine().load(updateLanguageId));\n } catch (FxApplicationException e) {\n new FxFacesMsgErr(e).addToContext();\n }\n }",
"public void setLanguage(java.lang.String language)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(LANGUAGE$14);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(LANGUAGE$14);\n }\n target.setStringValue(language);\n }\n }",
"public void setLanguage(java.lang.String language)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(LANGUAGE$14);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(LANGUAGE$14);\n }\n target.setStringValue(language);\n }\n }",
"private void changeLanguage(String selectedLang) {\n if (AppUtils.getInstance().isInternetAvailable(this)) {\n hitChangeLanguageApi(selectedLang);\n\n }\n }",
"public final void setLanguage(@Nullable final String languageParam) {\n this.language = languageParam;\n }",
"public void setLanguage(String s) {\n\t\tlanguage = s;\n\t}",
"public void xsetXmlLang(org.apache.xmlbeans.XmlNMTOKEN xmlLang)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlNMTOKEN target = null;\n target = (org.apache.xmlbeans.XmlNMTOKEN)get_store().find_attribute_user(XMLLANG$26);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlNMTOKEN)get_store().add_attribute_user(XMLLANG$26);\n }\n target.set(xmlLang);\n }\n }",
"private void setLanguageScreen(){\n\t\t\n\t\tscreenUI.clearScreen();\n\t\tscreenUI.drawText(2, 1, \"Choose a language/Wybierz język:\");\n\t\tscreenUI.drawText(1, 3, \"[a]: English\");\n\t\tscreenUI.drawText(1, 4, \"[b]: Polski\");\n\t}",
"@Override\r\n\t\tpublic void setLang(String lang)\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}",
"@Override\n public void updateLanguage() {\n if (isEnglish) {\n languageButton.setText(R.string.alien_painter_language_chinese);\n exitButton.setText(R.string.alien_painter_exit);\n retryButton.setText(R.string.alien_painter_retry);\n scoreboardButton.setText(R.string.alien_painter_scoreboard_button);\n painterTextViewInstructions.setText(R.string.alien_painter_instructions);\n replayButton.setText(R.string.alien_painter_replay);\n } else {\n languageButton.setText(R.string.alien_painter_language_english);\n exitButton.setText(R.string.alien_painter_exit_chinese);\n retryButton.setText(R.string.alien_painter_retry_chinese);\n scoreboardButton.setText(R.string.alien_painter_scoreboard_button_chinese);\n painterTextViewInstructions.setText(R.string.alien_painter_instructions_chinese);\n replayButton.setText(R.string.alien_painter_replay_chinese);\n }\n }",
"public void setLanguage(String localeString) {\n\t\tdatabaseOperation.execute(\"UPDATE \" + DatabaseContents.LANGUAGE + \" SET language = '\" + localeString + \"'\");\n\t}",
"public void setLanguage(Language lang) {\n\t\tGuiElements guiElems = GuiElements.getInstance();\n\t\tframe.setTitle(guiElems.getFrameTitle(lang));\n\t\tconvBtn.setText(guiElems.getConvertBtnText(lang));\n\t\tswitchBtn.setText(guiElems.getSwitchScalesText(lang));\n\t}",
"public Builder setLanguage(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n language_ = value;\n onChanged();\n return this;\n }",
"private void setLanguageForApp(){\n String lang = sharedPreferences.getString(EXTRA_PREF_LANG,\"en\");\n\n Locale locale = new Locale(lang);\n Resources resources = getResources();\n Configuration configuration = resources.getConfiguration();\n DisplayMetrics displayMetrics = resources.getDisplayMetrics();\n configuration.setLocale(locale);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){\n getApplicationContext().createConfigurationContext(configuration);\n } else {\n resources.updateConfiguration(configuration,displayMetrics);\n }\n getApplicationContext().getResources().updateConfiguration(configuration, getApplicationContext().getResources().getDisplayMetrics());\n }",
"public void setLanguage(String aLanguage) {\n\t\tthis.language = aLanguage;\n\t}",
"public Builder setLanguage(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n language_ = value;\n onChanged();\n return this;\n }",
"public void setLanguage(String language) {\n _language = language;\n }",
"public void setLanguage(String language) {\r\n this.language = language;\r\n }",
"@SuppressWarnings(\"deprecation\")\r\n public void setLanguage(String langTo) {\n Locale locale = new Locale(langTo);\r\n Locale.setDefault(locale);\r\n\r\n Configuration config = new Configuration();\r\n\r\n config.setLocale(locale);//config.locale = locale;\r\n\r\n if (Build.VERSION.SDK_INT == Build.VERSION_CODES.N) {\r\n createConfigurationContext(config);\r\n } else {\r\n getResources().updateConfiguration(config, getResources().getDisplayMetrics());\r\n }\r\n\r\n //createConfigurationContext(config);\r\n getResources().updateConfiguration(config, getApplicationContext().getResources().getDisplayMetrics());//cannot resolve yet\r\n //write into settings\r\n SharedPreferences.Editor editor = mSettings.edit();\r\n editor.putString(APP_PREFERENCES_LANGUAGE, langTo);\r\n editor.apply();\r\n //get appTitle\r\n if(getSupportActionBar()!=null){\r\n getSupportActionBar().setTitle(R.string.app_name);\r\n }\r\n\r\n }",
"public void setLanguage(String languageName) {\n\t\tsetProperty(LANGUAGE_PROPERTY, languageName);\n\t\tthis.myLanguage = languageName;\n\t}",
"public org.apache.xmlbeans.XmlAnySimpleType addNewLanguage()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlAnySimpleType target = null;\n target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().add_attribute_user(LANGUAGE$14);\n return target;\n }\n }",
"public void setLanguage(java.lang.String language) {\n this.language = language;\n }",
"public void setLanguage(java.lang.String language) {\n this.language = language;\n }",
"public void updateLanguage() {\n buttonPlay.setText(GameConfiguration.getText(\"playButton\"));\n buttonSettings.setText(GameConfiguration.getText(\"settingsButton\"));\n buttonHighScores.setText(GameConfiguration.getText(\"highScores\"));\n }",
"private void changeLanguage(Language lang) {\n this.resources = ResourceBundle.getBundle(UIController.RESOURCE_PATH + lang);\n uiController.setLanguage(lang);\n fileLoadButton.setText(resources.getString(\"LoadSimulationXML\"));\n uiController.setTitle(resources.getString(\"Launch\"));\n }",
"@Override\n\tpublic void setTargetLanguage(java.lang.String targetLanguage) {\n\t\t_scienceApp.setTargetLanguage(targetLanguage);\n\t}",
"private void translate()\r\n\t{\r\n\t\tLocale locale = Locale.getDefault();\r\n\t\t\r\n\t\tString language = locale.getLanguage();\r\n\t\t\r\n\t\ttranslate(language);\r\n\t}",
"public void setLang(java.lang.String lang)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(LANG$28);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(LANG$28);\n }\n target.setStringValue(lang);\n }\n }",
"public void addCountryLanguage(String newLanguage) {\n languages.add(newLanguage);\n }",
"private void setLocale(String lang) {\n Locale myLocale = new Locale(lang);\n Resources res = getResources();\n DisplayMetrics dm = res.getDisplayMetrics();\n Configuration conf = res.getConfiguration();\n conf.setLocale(myLocale);\n res.updateConfiguration(conf, dm);\n Intent refresh = new Intent(this, MainActivity.class);\n startActivity(refresh);\n finish();\n }",
"@Test\n public void testSetLanguage() {\n assertEquals(Language.EN, navigationBean.getSessionUser().getLanguage());\n\n navigationBean.getSessionUser().setLanguage(Language.DE);\n assertFalse(SAMPLE_LANGUAGE.equals(navigationBean.getSessionUser().getLanguage()));\n\n navigationBean.getSessionUser().setLanguage(Language.BAY);\n assertFalse(SAMPLE_LANGUAGE.equals(navigationBean.getSessionUser().getLanguage()));\n }",
"@DISPID(-2147413012)\n @PropPut\n void language(\n java.lang.String rhs);",
"public Language(String lang) {\n this.lang = lang;\n /*\n lexerFactory = new LexerFactory();\n generatorFactory = new GeneratorFactory();\n parserFactory = new ParserFactory();\n */\n }",
"public void setLanguage(String language)\n\t{\n\t\tthis.language = language;\n\t}",
"public void set(Configuration conf, GraphType graphType, T language) {\n get(graphType).set(conf, language);\n }",
"private void setLanguage(String language_) {\n\n //by default assign language to language_. This may change below.\n language = language_;\n\n //---------- set the default file extensions ----------\n switch (language_) {\n case IAGConstant.LANGUAGE_CPP:\n //extensions = IAGConstant.CPP_EXTENSIONS;\n break;\n case IAGConstant.LANGUAGE_PYTHON3:\n //extensions = IAGConstant.PYTHON_EXTENSIONS;\n break;\n case IAGConstant.LANGUAGE_AUTO:\n //extensions = IAGConstant.PYTHON_AND_CPP_EXTENSIONS;\n break;\n default:\n //extensions = IAGConstant.PYTHON_AND_CPP_EXTENSIONS;;\n language = LANGUAGE_AUTO; //invalid language specified: use AUTO by default\n }\n\n }",
"public Language saveLanguage(Language newLanguage) {\n\t\treturn languageRepository.save(newLanguage);\r\n\t}",
"public static void setLanguage(Context context, String language) {\r\n\t\tputString(context, \"app-language\", language, false);\r\n\t\tputString(context, \"old-app-language\", language, true);\r\n\t\tforceLocale(context);\r\n\t}",
"public static void removelanguage(Context ctx) {\n\n\t\tgetSharedPreferences(ctx).edit().putString(language, null)\n\t\t\t\t.commit();\n\n\t}",
"public void setLanguage(String language) {\n this.language = language;\n }",
"public void setLanguage(String language) {\n this.language = language;\n }",
"public void setLanguage(String languageKey) {\n String[] languages = {ResourceBundle.getBundle(LANGUAGE).getString(languageKey), SYNTAX};\n translations = getPatterns(languages);\n }",
"public void setLanguage(String lang, String country, String variant) {\n mSelf.setLanguage(lang, country, variant);\n }",
"private void setLanguage() {\n ResourceBundle labels = ResourceBundle.getBundle\n (\"contactmanager.Contactmanager\", Locale.getDefault()); \n this.setTitle(labels.getString(\"title\"));\n }",
"public void setLanguage (String language) {\n switch (language.toLowerCase()) {\n default -> this.language = Language.ENGLISH;\n case \"french\" -> this.language = Language.FRENCH;\n case \"german\" -> this.language = Language.GERMAN;\n case \"spanish\" -> this.language = Language.SPANISH;\n case \"italian\" -> this.language = Language.ITALIAN;\n }\n }",
"public void setXmlLang(java.lang.String xmlLang)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(XMLLANG$26);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(XMLLANG$26);\n }\n target.setStringValue(xmlLang);\n }\n }",
"public void setLanguageList(Language[] languageList) {\n this.languageList = languageList;\n }",
"Builder addInLanguage(Language value);",
"Language create(Language language);",
"OldLanguage(Element oldLanguageElement) throws JDOMException, SAXException {\n\t\tthis.oldLangFile = null;\n\t\tparseOldLanguage(oldLanguageElement, false);\n\t}",
"public void putPrimaryLanguage(String value){\n editor.putString(PRIMARY_LANGUAGE, value);\n editor.apply();\n }",
"public Language(String name) {\n this.name = name;\n }",
"public void setLanguage(org.apache.xmlbeans.XmlAnySimpleType language)\n {\n generatedSetterHelperImpl(language, LANGUAGE$14, 0, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_SINGLETON);\n }",
"public void setLang() {\n new LanguageManager() {\n @Override\n public void engLanguage() {\n mFirstCurrencyTitle = getString(R.string.converter_main_currency_eng);\n mSaleTitle = getString(R.string.converter_sale_eng);\n mPurchaseTitle = getString(R.string.converter_purchase_eng);\n mCountTitle = getString(R.string.converter_count_of_currencies_eng);\n eTTitle.setText(getResources().getString(R.string.drawer_item_converter_eng));\n tVChosenCurrency.setText(mMainListForActions.get(mPositionOfCurInList)\n .getCurrency().getTitleEng().toUpperCase());\n tVChosenOrganizationTitle.setText(mMainListForActions.get(mPositionOfCurInList)\n .getOrganizations().get(mPositionOfOrgInList).getTitleEng());\n tVSecondCurrency.setText(mMainListForActions.get(mPositionOfCurInList)\n .getCurrency().getTitleEng().toUpperCase().concat(\" (\").concat(mCurrencyShortForm).concat(\")\"));\n mCurrencyDialogTitle = getString(R.string.drawer_item_currencies_eng);\n mOrganizationDialogTitle = getString(R.string.drawer_item_organizations_eng);\n mActionDialogTitle = getString(R.string.converter_dialog_action_title_eng);\n mToastFailure = getString(R.string.converter_toast_failure_eng);\n mTitle = getResources().getString(R.string.drawer_item_converter_eng);\n mMessage = getString(R.string.dialog_template_text_eng);\n mTitleButtonOne = getString(R.string.dialog_template_edit_eng);\n mTitleButtonTwo = getString(R.string.dialog_template_create_eng);\n mToastEdited = getString(R.string.converter_toast_template_edit_eng);\n mToastCreated = getString(R.string.converter_toast_template_create_eng);\n mMessageFinal = getString(R.string.converter_final_dialog_text_eng);\n mTitleButtonOneFinal = getString(R.string.converter_final_dialog_yes_eng);\n mTitleButtonTwoFinal = getString(R.string.converter_final_dialog_no_eng);\n }\n\n @Override\n public void ukrLanguage() {\n mFirstCurrencyTitle = getString(R.string.converter_main_currency_ukr);\n mSaleTitle = getString(R.string.converter_sale_ukr);\n mPurchaseTitle = getString(R.string.converter_purchase_ukr);\n mCountTitle = getString(R.string.converter_count_of_currencies_ukr);\n eTTitle.setText(getResources().getString(R.string.drawer_item_converter_ukr));\n tVChosenCurrency.setText(mMainListForActions.get(mPositionOfCurInList)\n .getCurrency().getTitleUkr().toUpperCase());\n tVChosenOrganizationTitle.setText(mMainListForActions.get(mPositionOfCurInList)\n .getOrganizations().get(mPositionOfOrgInList).getTitleUkr());\n tVSecondCurrency.setText(mMainListForActions.get(mPositionOfCurInList)\n .getCurrency().getTitleUkr().toUpperCase().concat(\" (\").concat(mCurrencyShortForm).concat(\")\"));\n mCurrencyDialogTitle = getString(R.string.drawer_item_currencies_ukr);\n mOrganizationDialogTitle = getString(R.string.drawer_item_organizations_ukr);\n mActionDialogTitle = getString(R.string.converter_dialog_action_title_ukr);\n mToastFailure = getString(R.string.converter_toast_failure_ukr);\n mTitle = getResources().getString(R.string.drawer_item_converter_ukr);\n mMessage = getString(R.string.dialog_template_text_ukr);\n mTitleButtonOne = getString(R.string.dialog_template_edit_ukr);\n mTitleButtonTwo = getString(R.string.dialog_template_create_ukr);\n mToastEdited = getString(R.string.converter_toast_template_edit_ukr);\n mToastCreated = getString(R.string.converter_toast_template_create_ukr);\n mMessageFinal = getString(R.string.converter_final_dialog_text_ukr);\n mTitleButtonOneFinal = getString(R.string.converter_final_dialog_yes_ukr);\n mTitleButtonTwoFinal = getString(R.string.converter_final_dialog_no_ukr);\n }\n\n @Override\n public void rusLanguage() {\n mFirstCurrencyTitle = getString(R.string.converter_main_currency_rus);\n mSaleTitle = getString(R.string.converter_sale_rus);\n mPurchaseTitle = getString(R.string.converter_purchase_rus);\n mCountTitle = getString(R.string.converter_count_of_currencies_rus);\n eTTitle.setText(getResources().getString(R.string.drawer_item_converter_rus));\n tVChosenCurrency.setText(mMainListForActions.get(mPositionOfCurInList)\n .getCurrency().getTitleRus().toUpperCase());\n tVChosenOrganizationTitle.setText(mMainListForActions.get(mPositionOfCurInList)\n .getOrganizations().get(mPositionOfOrgInList).getTitleRus());\n tVSecondCurrency.setText(mMainListForActions.get(mPositionOfCurInList)\n .getCurrency().getTitleRus().toUpperCase().concat(\" (\").concat(mCurrencyShortForm).concat(\")\"));\n mCurrencyDialogTitle = getString(R.string.drawer_item_currencies_rus);\n mOrganizationDialogTitle = getString(R.string.drawer_item_organizations_rus);\n mActionDialogTitle = getString(R.string.converter_dialog_action_title_rus);\n mToastFailure = getString(R.string.converter_toast_failure_rus);\n mTitle = getResources().getString(R.string.drawer_item_converter_rus);\n mMessage = getString(R.string.dialog_template_text_rus);\n mTitleButtonOne = getString(R.string.dialog_template_edit_rus);\n mTitleButtonTwo = getString(R.string.dialog_template_create_rus);\n mToastEdited = getString(R.string.converter_toast_template_edit_rus);\n mToastCreated = getString(R.string.converter_toast_template_create_rus);\n mMessageFinal = getString(R.string.converter_final_dialog_text_rus);\n mTitleButtonOneFinal = getString(R.string.converter_final_dialog_yes_rus);\n mTitleButtonTwoFinal = getString(R.string.converter_final_dialog_no_rus);\n }\n };\n getDataForActionDialog();\n setData();\n }",
"public static void changeBundle(Locale language) {\r\n\t\tMessages.resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME,\r\n\t\t\t\tlanguage);\r\n\t}",
"public void setLanguage(String language) {\n\t\tthis.language = language;\n\t}",
"public void setLanguage(String language) {\n this.standardPairs.put(Parameters.LANGUAGE, language);\n }",
"public Language(String languageId) {\r\n\t\tthis.languageId = languageId;\r\n\t}",
"void onLanguageSelected();",
"public Builder setLanguage(String language) {\n/* 1569 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public void SetUsersLearningLanguage(String lang) {\n if (AppSettings.Instance().IsValidBCP47Code(lang))\n userLearningLang = lang;\n else\n throw new IllegalArgumentException(\"Tried to set Users Learning Language to: \" + lang + \" which is incorrect or unsupported\");\n }",
"public void setLanguage(String lang) {\n\t\tthis.language = lang;\n\t}",
"public void setLanguageId(int v) throws TorqueException\n {\n \n if (this.languageId != v)\n {\n this.languageId = v;\n setModified(true);\n }\n \n \n if (aLanguageRelatedByLanguageId != null && !(aLanguageRelatedByLanguageId.getLanguageId() == v))\n {\n aLanguageRelatedByLanguageId = null;\n }\n \n }",
"public Builder setLanguage(String language) {\n try {\n _locbld.setLanguage(language);\n } catch (InvalidLocaleIdentifierException e) {\n throw new IllegalArgumentException(e);\n }\n return this;\n }",
"public void setLanguageRelatedByLanguageId(Language v) throws TorqueException\n {\n if (v == null)\n {\n setLanguageId( 1000);\n }\n else\n {\n setLanguageId(v.getLanguageId());\n }\n aLanguageRelatedByLanguageId = v;\n }",
"public void setCurrent_word(String current_word){\n\t\tthis.current_word = current_word;\n\t}",
"private void setDefaultLanguage() {\n this.setLanguage(Locale.getDefault().getDisplayLanguage());\n }",
"public void addLanguage(String language){\n if(!this.languages.contains(language)){this.languages.add(language);}\n }",
"Builder addInLanguage(Text value);",
"public void setLang(AVT v)\n {\n m_lang_avt = v;\n }",
"public static void setApplicationLanguage(Context context, String code) {\n\t\tResources res = context.getResources();\n\t\tConfiguration androidConfiguration = res.getConfiguration();\n\t\t\n\t\tandroidConfiguration.locale = new Locale(code);\n\t\tres.updateConfiguration(androidConfiguration, res.getDisplayMetrics());\n\t}"
] | [
"0.6816161",
"0.67508465",
"0.64980674",
"0.6493099",
"0.6387665",
"0.63861275",
"0.6381363",
"0.63465697",
"0.62368184",
"0.62334377",
"0.62334377",
"0.62284017",
"0.61988604",
"0.6190123",
"0.6136133",
"0.61050946",
"0.608979",
"0.6073478",
"0.6069051",
"0.60180736",
"0.5984997",
"0.59631336",
"0.59166396",
"0.59159964",
"0.5886394",
"0.5885768",
"0.58745503",
"0.5858209",
"0.582883",
"0.58248585",
"0.5787075",
"0.57755643",
"0.57755643",
"0.57076067",
"0.57042783",
"0.5701823",
"0.57001776",
"0.569887",
"0.5677874",
"0.5669209",
"0.5628263",
"0.56239355",
"0.56179863",
"0.5613719",
"0.5612852",
"0.5606786",
"0.56011564",
"0.5585309",
"0.5585181",
"0.5544416",
"0.5535668",
"0.5532354",
"0.5532354",
"0.5532274",
"0.5531326",
"0.55049515",
"0.54976743",
"0.5490917",
"0.54858047",
"0.5483881",
"0.5479521",
"0.54647243",
"0.54614395",
"0.54605037",
"0.5460466",
"0.54565394",
"0.54493743",
"0.5445442",
"0.5439133",
"0.5426544",
"0.5426544",
"0.54225475",
"0.5414486",
"0.5409815",
"0.54096174",
"0.5408552",
"0.53942776",
"0.53806233",
"0.53799623",
"0.5363825",
"0.5360231",
"0.5344185",
"0.53254163",
"0.53167886",
"0.5304454",
"0.5301117",
"0.52947736",
"0.5289707",
"0.52845246",
"0.5283835",
"0.5283586",
"0.5277584",
"0.5274236",
"0.5265139",
"0.52577",
"0.52297205",
"0.5224026",
"0.5204006",
"0.52007985",
"0.5198354",
"0.519245"
] | 0.0 | -1 |
add error style to simulate a failed command | @Test
public void commandBox_commandSucceedsAfterFailedCommand_textClearedAndErrorStyleClassRemoved() {
commandBox.getStyleClass().add(CommandBox.ERROR_STYLE_CLASS);
commandBox.runCommand(COMMAND_THAT_SUCCEEDS);
assertEquals("", commandBox.getCommandInput());
assertEquals(defaultStyleOfCommandBox, commandBox.getStyleClass());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setStyleToIndicateCommandFailure() {\n //override style and disable syntax highlighting\n commandTextField.overrideStyle(ERROR_STYLE_CLASS);\n }",
"public void addExceptionStyle();",
"void drawError(String message);",
"public static Text error(Text error) {\n\t\treturn error.setStyle(error.getStyle().setFormatting(Formatting.RED));\n\t}",
"@Override\r\n\tpublic final void showCommandError(String command, String message) {\n\t}",
"protected abstract void error(String err);",
"void setError();",
"public void addError(String message);",
"private void setErrorUI() {\n err = new JLabel(\" \");\n err.setBorder(BorderFactory.createMatteBorder(0, 15, 0, 15, new Color(248, 248, 251)));\n err.setFont(new Font(\"Nunito\", Font.PLAIN, 12));\n err.setForeground(new Color(247, 37, 133));\n err.setAlignmentX(Component.CENTER_ALIGNMENT);\n }",
"abstract void consoleError(String error);",
"abstract void error(String error);",
"private void printFailCommandResult(CommandResult result) {\n String commandType = result.getCommand().getCommandType();\n switch (commandType) {\n case Command.COMMAND_DONE:\n switch (result.getResultDescription()) {\n case CommandResult.INVALID_NUMBER:\n printInvalidTaskNotExistedMessage();\n break;\n case CommandResult.INVALID_TASK_ALREADY_DONE:\n printInvalidTaskAlreadyDoneMessage(result);\n break;\n }\n break;\n case Command.COMMAND_ADD_TODO:\n case Command.COMMAND_ADD_DEADLINE:\n case Command.COMMAND_ADD_EVENT:\n printInvalidAddTaskMessage(result);\n break;\n case Command.COMMAND_DELETE:\n printInvalidTaskNotExistedMessage();\n break;\n case Command.COMMAND_FIND:\n printInvalidKeywordMessage();\n break;\n default:\n printInvalidCommandMessage();\n break;\n }\n }",
"public void error();",
"void errorBox(String title, String message);",
"public abstract void setError(String message);",
"public void error(String message);",
"public void setErrorText(String error, int color){\n errorText.setTextColor(color);\n errorText.setText(error);\n }",
"@Test\n public void executeWithFailure() {\n new SimpleCommandFailure(\"badRequest\", HystrixRuntimeException.FailureType.COMMAND_EXCEPTION).execute();\n }",
"private void correctError()\r\n\t{\r\n\t\t\r\n\t}",
"@Override\n\tpublic void setWrongError() {\n\t\t\n\t}",
"public String createErrorMessage(CommandSender sender, MCommand command);",
"public abstract Error errorCheck(Model m, String command);",
"private void setLabelColorError(JLabel label){\n Font font = label.getFont();\n \n if(normalFont == null)\n normalFont = font;\n \n Font boldFont = new Font(font.getFontName(), Font.BOLD, font.getSize());\n label.setFont(boldFont);\n label.setForeground(errorColor);\n }",
"@Override\n\tpublic void adjustToError() {\n\t\t\n\t}",
"void showError(String message);",
"void showError(String message);",
"public BadCommandException(String cmd){\n super(cmd);\n }",
"public void setErrorMode(int mode) {}",
"@Override\n\tpublic void error(Marker marker, CharSequence message) {\n\n\t}",
"@Override\n\tpublic void error(CharSequence message) {\n\n\t}",
"public void showError(String error);",
"private String printColorError(List<Card> hand, Card upCard,\n UnoPlayer.Color calledColor, ArrayList<Integer> validPlays,\n UnoPlayer.Color newColor)\n {\n String s = \"\";\n s += \"Whoops -- your callColor() method has an error!\\n\";\n s += \"You were given this hand:\\n\";\n for (int i = 0; i < hand.size(); i++)\n {\n s += \" \" + i + \". \" + hand.get(i) + \"\\n\";\n }\n\n s += \"and the up card was: \" + upCard + \"\\n\";\n if (upCard.getRank() == UnoPlayer.Rank.WILD\n || upCard.getRank() == UnoPlayer.Rank.WILD_D4)\n {\n s += \"and the called color was: \" + calledColor + \"\\n\";\n }\n s += \"and you (wrongly) returned \" + newColor + \".\\n\";\n return s;\n }",
"private void error(String message) {\n errors++;\n System.err.println(\"Line \" + token.line + \",\"\n + \" Col \" + token.col + \": \"\n + message);\n }",
"public void correctErrors();",
"public void doError (int status, String message) {\n\tthis.statusCode = Integer.toString (status);\n\tHttpHeader header = responseHandler.getHeader (\"HTTP/1.0 400 Bad Request\");\n\tStringBuilder error = \n\t new StringBuilder (HtmlPage.getPageHeader (this, \"400 Bad Request\") +\n\t\t\t \"Unable to handle request:<br><b>\" + \n\t\t\t message +\n\t\t\t \"</b></body></html>\\n\");\n\theader.setContent (error.toString ());\n\tsendAndClose (header);\n }",
"public abstract void showErrorBox(Throwable error);",
"public void setErrorIndex(int index) {\r\n this.textErrorIndex = index;\r\n }",
"public void error(String string) {\n\t\t\n\t}",
"java.lang.String getErr();",
"void setContainerStatusError(RuleContextContainer rccContext, String sStatusInfo)\r\n throws StorageProviderException;",
"public void makeError(){\n\t\tisError = true;\n\t}",
"public static void handleInvalidCommandException() {\n System.out.println(\"\\tSorry sir, I do not recognise this command.\");\n Help.execute();\n Duke.jarvis.printDivider();\n }",
"void error() {\n status = ERROR;\n System.out.println(\"error\");\n stateChanged();\n }",
"protected abstract void setErrorCode();",
"@Override\n\t\tpublic void setInvalidMess(String errmess) {\n\n\t\t}",
"private String formatError(String message) {\n return \"error : \" + message;\n }",
"public static void exposeError(String errorMessage) {\r\n CmdUx.printHBars(errorMessage);\r\n }",
"@Override\n\tpublic void error(Marker marker, Message msg) {\n\n\t}",
"@Test\n void testFailure_unrecognizedStatus() {\n assertThrows(\n IllegalArgumentException.class,\n () ->\n runCommandForced(\n \"--client=NewRegistrar\",\n \"--registrar_request=true\",\n \"--reason=Test\",\n \"--domain_name=example.tld\",\n \"--apply=foo\"));\n }",
"public void setErr(PrintStream err);",
"public void error(ValidationType type, String validationName, String content);",
"public void estiloError() {\r\n /**Bea y Jose**/\r\n\t}",
"@Override\n\tprotected void error(char c, InterimResult ir)\n\t{\n\t\tErrorAction error = new ErrorAction();\n\t\terror.execute(ir, c);\t\t\n\t}",
"private void error(String string) {\n\t\r\n}",
"protected void failed()\r\n {\r\n //overwrite\r\n }",
"public void printErrorParse() {\n\t\tSystem.out.println(ConsoleColors.RED + \"Invalid option. Please re-enter a valid option.\" + ConsoleColors.RESET);\n\t\t\n\t}",
"void err( Object msg );",
"private void syntaxError(String message, int line) {\n\t\tString error = String.format(\"Syntax error: %s on line %d.\", message,\r\n\t\t\t\tline);\r\n\t\terrors.add(error);\r\n\r\n\t\tthis.syntaxError = true;\r\n\t}",
"public void setError() {\r\n this.textErrorIndex = textIndex;\r\n }",
"void notSupported(String errorcode);",
"void setContainerStatusActionError(RuleContextContainer rccContext, String sStatusInfo)\r\n throws StorageProviderException;",
"public void Error(){\n }",
"public void sendError()\n {\n \tString resultText = Integer.toString(stdID);\n \tresultText += \": \";\n\t\tfor(int i = 0; i<registeredCourses.size();i++)\n\t\t{\n\t\t\tresultText += registeredCourses.get(i);\n\t\t\tresultText += \" \";\n\t\t}\n\t\tresultText += \"--\";\n\t\tresultText += \" \";\n\t\tresultText += Integer.toString(semesterNum);\n\t\tresultText += \" \";\n\t\tresultText += Integer.toString(0); \n\t\tresultText += \" \";\n\t\tprintResults.writeResult(resultText);\n \tSystem.exit(1);\n }",
"@Override\n\tpublic void error(Object message) {\n\n\t}",
"private static void displayError(Shell shell, String msg) {\n MessageBox mbox = new MessageBox(shell, SWT.ICON_ERROR|SWT.OK);\n mbox.setMessage(msg);\n mbox.setText(\"USBDM - Can't create launch configuration\");\n mbox.open();\n }",
"void failure(String category);",
"@Override\n\tpublic void error(Marker marker, CharSequence message, Throwable t) {\n\n\t}",
"@Override\n\tpublic void error(CharSequence message, Throwable t) {\n\n\t}",
"@Override\n\tpublic void error(String message, Object p0, Object p1, Object p2, Object p3) {\n\n\t}",
"private void failedClientResponse(String error) {\n JSONObject j = new JSONObject();\n j.put(\"statuscode\", 400);\n j.put(\"sequence\", ++sequence);\n j.put(\"response\", new JSONArray().add(error));\n output.println(j);\n output.flush();\n }",
"void outputError(String message) {\n\n fatalCount++;\n/*\n if (fatalCount == 1) {\n //fatalErrorsTable.addRow(ec.cr1ColRow(\n // \"Fatal errors\", true, \"red\", IHAlign.CENTER));\n TableRow row = new TableRow();\n row.addCell(new TableDataCell(\n \"<font color=red><b>Fatal errors</b></font>\").setHAlign(IHAlign.CENTER));\n fatalErrorsTable.addRow(row);\n } // if (fatalCount == 1)\n //fatalErrorsTable.addRow(ec.cr1ColRow(message));\n TableRow row = new TableRow();\n row.addCell(new TableDataCell(message));\n fatalErrorsTable.addRow(row);\n*/\n ec.writeFileLine(reportFile, message);\n if (dbg) System.out.println(\"<br>outputError: message = \" + message);\n }",
"@Override\n\tpublic void error(Marker marker, String message) {\n\n\t}",
"public void setError(int code, String fmt, Object... args) {\n this.state = new State(code, String.format(String.valueOf(fmt), args));\n }",
"public abstract void\n fail(ValidationError error);",
"@Override\n\tpublic void setFailedError() {\n\t\tnew Customdialog_Base(this, \"정보가 올바르지 않습니다.\").show();\n\t}",
"public void setGestureLineErrorColor(@ColorInt int color) {\n this.mGestureLineErrorColor = color;\n }",
"abstract void error(String error, Exception[] exceptions);",
"private void error(@Nonnull Token pptok, boolean is_error)\r\n throws IOException,\r\n LexerException {\r\n StringBuilder buf = new StringBuilder();\r\n buf.append('#').append(pptok.getText()).append(' ');\r\n /* Peculiar construction to ditch first whitespace. */\r\n Token tok = source_token_nonwhite();\r\n ERROR:\r\n for (;;) {\r\n switch (tok.getType()) {\r\n case NL:\r\n case EOF:\r\n break ERROR;\r\n default:\r\n buf.append(tok.getText());\r\n break;\r\n }\r\n tok = source_token();\r\n }\r\n if (is_error)\r\n error(pptok, buf.toString());\r\n else\r\n warning(pptok, buf.toString());\r\n }",
"void showError(String errorMessage);",
"public ParseResult failureAt (Object input, int error) {\n return failureAt(input, error, 1);\n }",
"@Override\n\tpublic void error(Marker marker, Object message) {\n\n\t}",
"protected void addError(AeExpressionValidationResult aResult, String aMessage, Object[] aArgs) {\r\n String msg = MessageFormat.format(aMessage, aArgs);\r\n aResult.addError(msg);\r\n }",
"public void setError(int value) {\n this.error = value;\n }",
"@Override\n\tpublic void error(Message msg) {\n\n\t}",
"void showErrorMsg(String string);",
"@Override\r\n\tpublic void err(ServiceStatistics serviceStatistics) {\n\t\t\r\n\t}",
"@Override\n public void showError() {\n }",
"public static void errorStyle(EditText edt, int color){\n Drawable drawable = edt.getBackground(); // get current EditText drawable\n drawable.setColorFilter(color, PorterDuff.Mode.SRC_ATOP); // change the drawable color\n\n if(Build.VERSION.SDK_INT > 16) {\n edt.setBackground(drawable); // set the new drawable to EditText\n }else{\n edt.setBackgroundDrawable(drawable); // use setBackgroundDrawable because setBackground required API 16\n }\n }",
"public void onError(String err, String nick);",
"String getErrorLinePattern();",
"public void markAsFailed() {\n execution.setErrorReported();\n }",
"public void makeErrors() {\n Random rnd = new Random();\n String charset = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz\";\n for (int i = 0; i < message.length(); i += 3) {\n message.setCharAt(i + rnd.nextInt(3),\n charset.charAt(rnd.nextInt(charset.length())));\n }\n }",
"public void Error(String error) throws RemoteException;",
"@Override\n\tpublic void error(Marker marker, Message msg, Throwable t) {\n\n\t}",
"void showResultMoError(String e);",
"void error (String msg) throws RootException;",
"private void wrapError(String code, String message) {\r\n recentErrorCode = code;\r\n\r\n\t\t/* \r\n\t\t *\t<error>\r\n\t\t *\t\t<code>TEAL_8453</code>\r\n\t\t *\t\t<message>[request_id=201203082] Failed to create a process module by wrong value of a parameter(=topic_id)</message>\r\n\t\t *\t</error>\r\n\t\t *\r\n\t\t *\t<error>\r\n\t\t *\t\t<code>TEAL_4410</code>\r\n\t\t *\t\t<message>Topic ID <1000> does not exist.</message>\r\n\t\t *\t</error> \r\n\t\t*/\r\n if (\"TEAL_8453\".equals(recentServerErrorCode)) {\r\n recentErrorCode = \"APIL_0155\";\r\n recentErrorMessage = message + \": argument's not valid (server-side): \" + recentServerErrorMessage;\r\n } else if (\"TEAL_4410\".equals(recentServerErrorCode)) {\r\n recentErrorCode = \"APIL_0161\";\r\n recentErrorMessage = message + \": topic ID's not exist\";\r\n } else {\r\n recentErrorMessage = message + \" DUE TO [\" + recentServerErrorCode + \": \" + recentServerErrorMessage + \"]\";\r\n }\r\n\r\n recentServerErrorMessage = \"\";\r\n\r\n if (consoleLog) {\r\n System.out.println(\"[E!:\" + recentErrorCode + \"] \" + recentErrorMessage);\r\n }\r\n }",
"public UnifiedFormat setErrorStatus(String message, Integer code) {\n setErrorStatus(message, code, null, null);\n return this;\n }",
"@Override\n\tpublic void showError(String message) {\n\t\t\n\t}",
"public String error();"
] | [
"0.7959343",
"0.6859465",
"0.6638096",
"0.6541474",
"0.6540722",
"0.6385972",
"0.6341001",
"0.6338466",
"0.6205774",
"0.61568063",
"0.6114149",
"0.61041284",
"0.60861546",
"0.6064783",
"0.6060847",
"0.60163945",
"0.59346116",
"0.5916161",
"0.5895293",
"0.5865164",
"0.5801609",
"0.5782574",
"0.5775623",
"0.577548",
"0.57569027",
"0.57569027",
"0.57484305",
"0.5743146",
"0.5736908",
"0.57323176",
"0.57258403",
"0.57231224",
"0.5722724",
"0.5720537",
"0.5715762",
"0.5710222",
"0.5710166",
"0.56963617",
"0.5690898",
"0.56846553",
"0.56756616",
"0.56721836",
"0.5658343",
"0.565784",
"0.56529",
"0.5650874",
"0.5649554",
"0.5648003",
"0.56458557",
"0.5635045",
"0.5634405",
"0.5631323",
"0.562748",
"0.5623674",
"0.5623043",
"0.56200504",
"0.56175905",
"0.561715",
"0.5613713",
"0.5607607",
"0.5604858",
"0.5601719",
"0.5598558",
"0.5586933",
"0.5586892",
"0.5585526",
"0.55773467",
"0.5556889",
"0.55564225",
"0.5555182",
"0.55549806",
"0.55519605",
"0.5547607",
"0.5541456",
"0.5536224",
"0.5533092",
"0.553289",
"0.552947",
"0.55281764",
"0.5513392",
"0.5510168",
"0.5508037",
"0.5508001",
"0.5507068",
"0.55037993",
"0.5503251",
"0.5501519",
"0.5501482",
"0.54943645",
"0.5493526",
"0.5479671",
"0.5475656",
"0.5475533",
"0.5473522",
"0.546612",
"0.54599905",
"0.5458496",
"0.54572177",
"0.54487234",
"0.54472977"
] | 0.6777315 | 2 |
/ Getter and Setters | public PHeader getHeader() {
return header;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void get() {\n\t\t\r\n\t}",
"@Override\n public void get() {}",
"protected abstract Set method_1559();",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"@Override\n String get();",
"public void get() {\n }",
"public String get();",
"public abstract String get();",
"@Override\n\tpublic void getData() {\n\t\t\n\t}",
"public int getAge() {return age;}",
"public Object get()\n {\n return m_internalValue;\n }",
"public String getName () { return this.name; }",
"String getName(){return this.name;}",
"String setValue();",
"@Override\n protected void getExras() {\n }",
"public String get()\n {\n return this.string;\n }",
"public T get() {\n return value;\n }",
"public String getValue() {\n/* 99 */ return this.value;\n/* */ }",
"@Override\n\tprotected void getExras() {\n\n\t}",
"public int\t\tget() { return value; }",
"public T get() {\n return value;\n }",
"public T get() {\n return value;\n }",
"public String getName(){return this.name;}",
"public Object getValue(){\n \treturn this.value;\n }",
"public void setdat()\n {\n }",
"@Override\n\n // <editor-fold defaultstate=\"collapsed\" desc=\" UML Marker \"> \n // #[regen=yes,id=DCE.E1700BD9-298C-DA86-4BFF-194B41A6CF5E]\n // </editor-fold> \n protected String getProperties() {\n\n return \"Size = \" + size + \", Index = \" + value;\n\n }",
"@Override\r\n\tpublic String get() {\n\t\treturn null;\r\n\t}",
"public Object getValue() { return _value; }",
"public int getAge(){\n return age;\n }",
"private Attributes getAttributes()\r\n\t{\r\n\t return attributes;\r\n\t}",
"public Student getStudent() { return student; }",
"public V get() {\n return value;\n }",
"public int getValue() {\n/* 450 */ return this.value;\n/* */ }",
"public String getName(){ return name; }",
"public Book getBook() \t\t{ return this.myBook; }",
"public int value() { \n return this.value; \n }",
"public String getName(){return name;}",
"public String getName(){return name;}",
"public String getName(){return name;}",
"public String getName(){return name;}",
"public Object getValue() { return this.value; }",
"public int getAge()\r\n {\r\n return age;\r\n }",
"public String getNombre()\r\n/* 17: */ {\r\n/* 18:41 */ return this.nombre;\r\n/* 19: */ }",
"public String getNombre()\r\n/* 113: */ {\r\n/* 114:204 */ return this.nombre;\r\n/* 115: */ }",
"public String getNombre()\r\n/* 60: */ {\r\n/* 61: 67 */ return this.nombre;\r\n/* 62: */ }",
"public int getSet() {\n return set;\n }",
"private ReadProperty()\r\n {\r\n\r\n }",
"public String get() {\n return value;\n\t}",
"public String getName ()\n {\n return name;\n }",
"public int get () { return rating; }",
"@Override\n\tpublic String get() {\n\t\treturn null;\n\t}",
"public int getlife(){\r\n return life;\r\n}",
"public String getName(){\n return name;\n}",
"public String getValor()\n/* 17: */ {\n/* 18:27 */ return this.valor;\n/* 19: */ }",
"public Object getValue()\n {\n\treturn value;\n }",
"public int getNumber(){return number;}",
"public String getID(){return ID;}",
"public String get_name(){\n return _name;\n }",
"@Override\n public Object getValue()\n {\n return value;\n }",
"public int getArmadura(){return armadura;}",
"public String getAuthor(){return author;}",
"public int getID(){\r\n return this.ID;\r\n }",
"private PropertyAccess() {\n\t\tsuper();\n\t}",
"@Override\n public int get()\n { \n return this.pr;\n }",
"public byte[] get(){\n return this.value;\n }",
"public Address getAddress() { return address; }",
"public String getName()\n {\n return name;\n}",
"public int getAge()\n {\n return age;\n }",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public Value getValue(){\n return this.value;\n }",
"public void setAge(int age) { this.age = age; }",
"@Override\r\n public Object getValue() {\r\n return value;\r\n }",
"protected String getName(){\r\n return this.name;\r\n }",
"private Get() {}",
"private Get() {}",
"@Override\n public String getName(){\n return Name; \n }",
"@Override\npublic void setAttributes() {\n\t\n}",
"@Override\n //Method for getting output from String declaration\n //First set of accessor/mutator that returns value as String\n public String toString(){\n return \"[\"+name+\",\"+type+\",\"+value+\"]\";\n }",
"public int getID() {return id;}",
"public int getID() {return id;}",
"public int getSpeed(){return this.speed;}",
"public String getName(){\n return name;\n }",
"public String getName(){\n return name;\n }",
"int getBlue(){\n\n return this.blue;\n }",
"public Empleado getEmpleado()\r\n/* 183: */ {\r\n/* 184:337 */ return this.empleado;\r\n/* 185: */ }",
"boolean get();",
"@Override\n\tprotected void GetDataFromNative() {\n\t\t\n\t}",
"@Override\n\tprotected void GetDataFromNative() {\n\t\t\n\t}",
"public String getName() { return _name; }",
"public String getter() {\n\t\treturn name;\n\t}",
"@Override\r\n\t\t\tpublic Object getValue() {\n\t\t\t\treturn null;\r\n\t\t\t}",
"Objet getObjetAlloue();",
"private Integer getId() { return this.id; }",
"public String get() {\n return this.value;\n }",
"String get();",
"String get();",
"public String getName(){\n return name;\r\n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"public Empresa getEmpresa()\r\n/* 84: */ {\r\n/* 85:131 */ return this.empresa;\r\n/* 86: */ }",
"@Override\n\tpublic Object getValue() {\n\t\treturn this ;\n\t}",
"@Override\n\tpublic Object getValue() {\n\t\treturn this ;\n\t}"
] | [
"0.68711215",
"0.6844532",
"0.664339",
"0.6552768",
"0.650287",
"0.64509743",
"0.6411258",
"0.6336067",
"0.6255635",
"0.6187035",
"0.61691475",
"0.61446226",
"0.6134795",
"0.612337",
"0.60946494",
"0.6091441",
"0.6091071",
"0.6086424",
"0.60800374",
"0.60700417",
"0.60657734",
"0.60657734",
"0.6059323",
"0.6039146",
"0.60291636",
"0.60249406",
"0.60048705",
"0.59863436",
"0.59717125",
"0.59685713",
"0.5960184",
"0.5953108",
"0.5949148",
"0.594884",
"0.5943715",
"0.5938664",
"0.59377134",
"0.59377134",
"0.59377134",
"0.59377134",
"0.5930724",
"0.59303516",
"0.59301025",
"0.5929369",
"0.5927318",
"0.5925957",
"0.5923718",
"0.5914353",
"0.5909855",
"0.5908364",
"0.5906993",
"0.5897108",
"0.5896229",
"0.58917403",
"0.5878198",
"0.5876524",
"0.58737636",
"0.5870632",
"0.58696854",
"0.58661604",
"0.5865068",
"0.586102",
"0.5860478",
"0.58571",
"0.58569425",
"0.5855702",
"0.5854715",
"0.5852352",
"0.58464974",
"0.5839776",
"0.58360285",
"0.58348566",
"0.5833338",
"0.5818407",
"0.5818407",
"0.5817541",
"0.5817247",
"0.58066225",
"0.5806324",
"0.5806324",
"0.58059555",
"0.58053327",
"0.58053327",
"0.5802172",
"0.5801473",
"0.5800805",
"0.5798277",
"0.5798277",
"0.5795694",
"0.5795127",
"0.57945305",
"0.57931614",
"0.5790539",
"0.5786217",
"0.5784375",
"0.5784375",
"0.5782793",
"0.57753897",
"0.5769438",
"0.57672375",
"0.57672375"
] | 0.0 | -1 |
Insere um novo Termo | public void insereTermo(Termo t) throws GrauJaExisteExc {
if(poli.containsKey(t.grau()))
throw new GrauJaExisteExc();
else
poli.put(t.grau(), t.coef());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void insertar(String dato){\r\n \r\n if(estaVacia()){\r\n \r\n primero = new NodoJugador(dato);\r\n }else{\r\n NodoJugador temporal = primero;\r\n while(temporal.getSiguiente()!=null){\r\n temporal = temporal.getSiguiente();\r\n }\r\n \r\n temporal.setSiguiente(new NodoJugador(dato));\r\n }\r\n }",
"public void inserir(Comentario c);",
"public void insertar(Trabajo t){\r\n\t\tif(!estaLlena()){\r\n\t\t\tultimo = siguiente(ultimo);\r\n\t\t\telementos[ultimo] = t;\r\n\t\t}\r\n\t}",
"public void insere (String nome)\n {\n //TODO\n }",
"private void insertaTS(String sToken, int sTipo) {\n tSimbolos[tabla_idx] = new TablaSimbolos(sToken, sTipo, 1);\n tabla_idx++;\n }",
"public void insertar(int rafaga, int tiempo) {\n\t\tif (rafaga <= 0 || tiempo < 0) {\n\t\t\treturn;\n\t\t}\n\t\tProceso nuevo = new Proceso();\n\t\tnuevo.id = String.valueOf((char) this.caracter);\n\t\tthis.caracter++;\n\t\tnuevo.rafaga = rafaga;\n\t\tnuevo.tllegada = tiempo;\n\t\tnuevo.IdCola = this.IdCola;\n\t\tnuevo.NombreCola = this.NombreCola;\n\t\tnuevo.ColaProviene = this.NombreCola;\n\t\tif (raiz.sig == raiz) {\n\t\t\traiz.sig = nuevo;\n\t\t\tcabeza = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\tnuevo.padre = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t} else {\n\t\t\tProceso aux = raiz.padre;\n\t\t\taux.sig = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t\tnuevo.padre = aux;\n\t\t}\n\t\tthis.numProcesos++;\n\t\tthis.rafagaTotal += rafaga;\n\t\tthis.Ordenamiento();\n\t}",
"@Override\n\tpublic MensajeBean inserta(Tramite_informesem nuevo) {\n\t\treturn tramite_informesemDao.inserta(nuevo);\n\t}",
"private void insertar() {\n try {\n cvo.setNombre_cliente(vista.txtNombre.getText());\n cvo.setApellido_cliente(vista.txtApellido.getText());\n cvo.setDireccion_cliente(vista.txtDireccion.getText());\n cvo.setCorreo_cliente(vista.txtCorreo.getText());\n cvo.setClave_cliente(vista.txtClave.getText());\n cdao.insertar(cvo);\n vista.txtNombre.setText(\"\");\n vista.txtApellido.setText(\"\");\n vista.txtDireccion.setText(\"\");\n vista.txtCorreo.setText(\"\");\n vista.txtClave.setText(\"\");\n JOptionPane.showMessageDialog(null, \"Registro Ingresado\");\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Debe ingresar Datos para guardar registro!\");\n }\n }",
"public void inserirContato() {\n\t\tSystem.out.println(\"Digite o nome do novo contato: \");\n\t\tString contato = scanner.nextLine();\n\t\tlistaDeContatos.add(contato);\n\t}",
"public void insereFim(TinfoTransicao item) {\t\t\n\t\tTnodoTransicao novo = new TnodoTransicao(item);\n\t\tnovo.proximo = this.ultimo.proximo;\n\t\tthis.ultimo.proximo = novo;\n\t\tthis.ultimo = novo;\t\n\t}",
"public void insere(Pessoa pessoa){\n\t\tdb.save(pessoa);\n\t}",
"public void insertar(Proceso p, int tiempo) {\n\t\tif (p == null || tiempo < 0) {\n\t\t\treturn;\n\t\t}\n\t\tProceso nuevo = new Proceso();\n\t\tnuevo.rafaga = p.rafaga;\n\t\tnuevo.id = p.id;\n\t\tnuevo.IdCola = this.IdCola;\n\t\tnuevo.NombreCola = this.NombreCola;\n\t\tnuevo.tllegada = tiempo;\n\t\tnuevo.ColaProviene = p.ColaProviene;\n\n\t\tif (raiz.sig == raiz) {\n\t\t\traiz.sig = nuevo;\n\t\t\tcabeza = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\tnuevo.padre = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t} else {\n\t\t\tProceso aux = raiz.padre;\n\t\t\taux.sig = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t\tnuevo.padre = aux;\n\t\t}\n\t\tthis.numProcesos++;\n\t\tthis.rafagaTotal += nuevo.rafaga;\n\t\tthis.Ordenamiento();\n\t}",
"public void crear(Tarea t) {\n t.saveIt();\n }",
"public void insert(Object objekt) throws SQLException {\r\n\t\t \r\n\t\tPomagaloVO ul = (PomagaloVO) objekt;\r\n\r\n\t\tif (ul == null)\r\n\t\t\tthrow new SQLException(\"Insert \" + tablica\r\n\t\t\t\t\t+ \", ulazna vrijednost je null!\");\r\n\t\t \r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement ps = null;\r\n\r\n\t\ttry {\r\n\t\t\tconn = conBroker.getConnection();\r\n\r\n\t\t\tps = conn.prepareStatement(insertUpit);\r\n\r\n\t\t\tps.setString(1, ul.getSifraArtikla());\r\n\t\t\tps.setString(2, ul.getNaziv());\r\n\t\t\tps.setInt(3, ul.getPoreznaSkupina().intValue());\r\n\r\n\t\t\tif (ul.getCijenaSPDVom() == null\r\n\t\t\t\t\t|| ul.getCijenaSPDVom().intValue() <= 0)\r\n\t\t\t\tps.setNull(4, Types.INTEGER);\r\n\t\t\telse\r\n\t\t\t\tps.setInt(4, ul.getCijenaSPDVom().intValue());\r\n\r\n\t\t\tString op = ul.getOptickoPomagalo() != null\r\n\t\t\t\t\t&& ul.getOptickoPomagalo().booleanValue() ? DA : NE;\r\n\r\n\t\t\tps.setString(5, op);\r\n\t\t\t\r\n\t\t\tps.setTimestamp(6, new Timestamp(System.currentTimeMillis()));\r\n\t\t\tps.setInt(7, NEPOSTOJECA_SIFRA);\r\n\t\t\tps.setTimestamp(8, null);\r\n\t\t\tps.setNull(9, Types.INTEGER);\r\n\r\n\t\t\tint kom = ps.executeUpdate();\r\n\r\n\t\t\tif (kom == 1) {\r\n\t\t\t\tul.setSifra(Integer.valueOf(0)); // po tome i pozivac zna da je\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// insert uspio...\r\n\t\t\t}// if kom==1\r\n\t\t\telse {\r\n\t\t\t\t//Logger.fatal(\"neuspio insert zapisa u tablicu \" + tablica, null);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// nema catch-anja SQL exceptiona... neka se pozivatelj iznad jebe ...\r\n\t\tfinally {\r\n\t\t\ttry {\r\n\t\t\t\tif (ps != null)\r\n\t\t\t\t\tps.close();\r\n\t\t\t} catch (SQLException e1) {\r\n\t\t\t}\r\n\t\t\tconBroker.freeConnection(conn);\r\n\t\t}// finally\r\n\r\n\t}",
"@Override\n\tpublic void insertar() {\n\t\t\n\t}",
"@Override\r\n\tpublic MensajeBean inserta(Tramite_presentan_info_impacto nuevo) {\n\t\treturn tramite.inserta(nuevo);\r\n\t}",
"private void insertar(String nombre, String Contra) {\n ini.Tabla.insertar(nombre, Contra);\n AVLTree arbol = new AVLTree();\n Nod nodo=null;\n ini.ListaGen.append(0,0,\"\\\\\",nombre,\"\\\\\",\"\\\\\",arbol,\"C\",nodo); \n \n }",
"@Override\n\t\tpublic void insertar() {\n\t\t\tutilitario.getTablaisFocus().insertar();\n\n\t\t}",
"public void inseriPessoa() throws IOException {\n\t\tString r;\n\t\tvetPessoas[nPessoas] = new Pessoa();\n\t\tSystem.out.println(\"Inseri o nome \");\n\t\tr = EntradaTeclado.leString();\n\t\tvetPessoas[nPessoas].setNome(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Cpf \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setCpf(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Endereco \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setEndereco(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Email \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setEmail(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Data de Nascimento fomanto (dd/mm/aaaa)\");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setDataNascimento(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Estado Civil \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setEstadoCivil(r);\n\t\t\n\t\tthis.nPessoas+=1;\n\t}",
"public void setTitolo(String titolo) {\n if (titolo == null) {\n System.out.println(\"Hai inserito un titolo errato!!\");\n } else {\n this.titolo = titolo;\n }\n }",
"public static void insertar (tcus_clientes info){\n \tNodoArbol nuevo = new NodoArbol (info);\n if (raiz == null) {\n raiz = nuevo;\n } else {\n \tNodoArbol anterior = null, reco;\n reco = raiz;\n while (reco != null) {\n anterior = reco;\n if (info.getNmid() < reco.getNodo().getNmid())\n reco = reco.getIzq();\n else\n reco = reco.getDer();\n }\n if (info.getNmid() < anterior.getNodo().getNmid())//50<100\n anterior.setIzq(nuevo); \n else\n anterior.setDer(nuevo);\n }\n }",
"public void inserisciValore()throws Exception {\n\n\t\tif (!valore.getInserito()) {\n\n\t\t\tif (!valore.getInserito()) {\n\t\t\t\tint inserimento = Utility.leggiIntero(0, 1, \"Vuoi inserire \" + nome + \"? Digita 1 per SI e 0 pre NO\");\n\t\t\t\tif (inserimento == 0) {\n\n\t\t\t\t} else {\n\t\t\t\t\tswitch (valore.getTipo()) {\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tvalore.setValore(Utility.leggiLinea(\"inserisci \" + nome));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tvalore.setValore(Utility.leggiIntero(0, 9999999, \"inserisci \" + nome));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tString data = Utility.leggiData(\"inserisci \" + nome + \"(gg/mm/aaaa)\");\n\t\t\t\t\t\t\tDate date = new SimpleDateFormat(\"dd/MM/yyyy\").parse(data);\n\t\t\t\t\t\t\tvalore.setValore(date);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tString ora = Utility.leggiOra(\"Inserisci \" + nome + \" (hh:mm)\");\n\t\t\t\t\t\t\tvalore.setValore(ora);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tArrayList<Integer> eta = Utility.leggiFasciaEta(\"Inserisci\" + nome);\n\t\t\t\t\t\t\tvalore.setEta(eta);\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}",
"@Override\n\tpublic void insert(Unidade obj) {\n\n\t}",
"public void insertarInicio(E dato) {\n\t\tprimero=new Nodo<E>(dato,primero);\n\t\tif (estaVacia()) {\n\t\t\tultimo=primero;\n\t\t}\n\t\tcantidad++;\n\t}",
"@Override\r\n\tpublic void insertPrestito(Prestito p) {\n\t\t\r\n\t}",
"@Override\n\tpublic void inserir(CLIENTE cliente) {\n\t\t\n\t\tString sql = \"INSERT INTO CLIENTE (NOME_CLIENTE) VALUES (?)\";\n\t\t\n\t\tConnection conexao;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tconexao = JdbcUtil.getConexao();\n\t\t\t\n\t\t\tPreparedStatement ps = conexao.prepareStatement(sql);\n\t\t\t\n\t\t\tps.setString(1, cliente.getNomeCliente());\n\t\t\t\n\t\t\tps.execute();\n\t\t\tps.close();\n\t\t\tconexao.close();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public void insereInicio(String elemento) {\n No novoNo = new No(elemento, ini);\n ini = novoNo;\n }",
"public void inserisci(NodoAlbero dove, String contenuto, String tipo){\n if (n_nodi == 0){\n root = new NodoAlbero(contenuto, null, tipo);\n n_nodi++;\n return;\n }\n //se il nodo padre non ha un figlio, lo creiamo\n if (dove.getFiglio() == null)\n dove.setFiglio(new NodoAlbero(contenuto, dove, tipo));\n //se ce ne ha già almeno uno, lo accodiamo agli altri figli\n else {\n NodoAlbero temp = dove.getFiglio();\n while (temp.getFratello() != null)\n temp = temp.getFratello();\n temp.setFratello(new NodoAlbero(contenuto, temp.getPadre(), tipo));\n }\n n_nodi++;\n }",
"private static void teste01 () {\n\t\tEstoque e = new Estoque();\n\t\n\t\te.setCodigo(1);\n\t\te.setPreco(new Float(10));\n\t\te.setQuantidade(1);\n\t\te.setFornecedor(\"provider\");\n\t\n\t\te.insert();\n\n\t\tlog.debug(\"Estoque inserido.\");\n\t}",
"public void inserir(Filme obj) throws Exception {\n System.out.println(\"Salvar o objeto filme\");\r\n }",
"public void InsertarNodo(int nodo) {\r\n Nodo nuevo_nodo = new Nodo(nodo);\r\n nuevo_nodo.siguiente = UltimoValorIngresado;\r\n UltimoValorIngresado = nuevo_nodo;\r\n tamaño++;\r\n }",
"@Override\r\n public Kiosque insertKiosque(Kiosque obj) {\r\n em.persist(obj);\r\n return obj;\r\n //To change body of generated methods, choose Tools | Templates.\r\n }",
"@Override\r\n\tpublic void insertar() {\n\t\ttab_nivel_funcion_programa.insertar();\r\n\t\t\t\r\n\t\t\r\n\t}",
"public Mascota insert(Mascota mascota){\n if(mascota != null)\n mascotaRepository.save(mascota);\n return mascota;\n }",
"public static Tarjeta insertTarjeta(int id,String numero,String banco,\n Date fencha_vencimiento,\n String tipo_tarjeta,int cod_seguridad,\n String cedula_titular,String marca){\n Tarjeta miTarjeta = null;\n try {\n miTarjeta = new Tarjeta(id,numero,banco,fencha_vencimiento,\n tipo_tarjeta,cod_seguridad,\n cedula_titular,marca);\n miTarjeta.RegistrarTarjeta();\n \n } catch (Exception e) {\n System.out.println(e.getMessage());\n } \n \n return miTarjeta;\n }",
"public void inserisciValore()throws Exception {\r\n\r\n\t\t\r\n\t\t\tif (!valore.getInserito()) {\r\n\t\t\t\tboolean inserimento = InputOutput.richiestaInserimento(nome);\r\n\t\t\t\tif (inserimento) {\r\n\t\t\t\t\tvalore.inserisciValore(nome);\r\n\t\t\t\t\tvalore.setInserito(true);\t\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}",
"int insert(Tipologia record);",
"public void insert(Service servico){\n Database.servico.add(servico);\n }",
"@Override\n\tpublic int insert(Utente input) throws Exception {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic void ajouter(Zone t) {\n\t\ttry {\n\t\t\t //preparation de la requete\n\t\t\tString sql=\"INSERT into zone (lieu,frequence,id_chaine) values(?, ?,?)\";\n\t\t\tPreparedStatement pst=Con.prepareStatement(sql);\n\t\t\t//transmission des valeurs aux parametres de la requete\n\t\t\tpst.setString(1,t.getLieu());\n\t\t\tpst.setString(2,t.getFrequence());\n\t\t\tpst.setInt(3, t.getChaine().getId_chaine());\n\t\t\t//execussion de la requete\n\t\t\tpst.executeUpdate();\n\t\t\tSystem.out.println(\"zone ajoutees \");\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\tSystem.out.println(\"Probleme de driver ou connection avec la BD\");\n\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}",
"public void inserir(Conserto conserto) throws SQLException{\r\n conecta = FabricaConexao.conexaoBanco();\r\n Date dataentradasql = new Date(conserto.getDataEntrada().getTime());\r\n //Date datasaidasql = new Date(conserto.getDataSaida().getTime());\r\n sql = \"insert into conserto (concodigo, condataentrada, condatasaida, concarchassi, conoficodigo) values (?, ?, ?, ?, ?)\";\r\n pstm = conecta.prepareStatement(sql);\r\n pstm.setInt(1, conserto.getCodigo());\r\n pstm.setDate(2, (Date) dataentradasql);\r\n pstm.setDate(3, null);\r\n pstm.setString(4, conserto.getCarro().getChassi());\r\n pstm.setInt(5, conserto.getOficina().getCodigo());\r\n pstm.execute();\r\n FabricaConexao.fecharConexao();\r\n \r\n }",
"@Override\n\tpublic Tutorial insert(Tutorial t) {\n\t\treturn cotizadorRepository.save(t);\n\n\t\t\n\t}",
"@Override\n\tpublic int insertOrderTrading(Order_TradingVO otvo) {\n\t\treturn sql.insert(\"insertOrderTrading\", otvo);\n\t}",
"public void insertar(int x, String nombre) {\n \tNodo nuevo;\n nuevo = new Nodo();\n nuevo.edad = x;\n nuevo.nombre = nombre;\n //Validar si la lista esta vacia\n if (raiz==null)\n {\n nuevo.sig = null;\n raiz = nuevo;\n }\n else\n {\n nuevo.sig = raiz;\n raiz = nuevo;\n }\n }",
"public void insertarAlimento (int id_alimento, String nombre, String estado, float caloria, float proteinas,float grasas, float hidratos_de_carbono, float H20, float NE, float vitamina_a, float vitamina_B1, float vitamina_B2, float vitamina_C, float Niac, float sodio, float potasio, float calcio, float magnesio, float cobre, float hierro, float fosforo, float azufre, float cloro, float Fen, float Ileu, float Leu, float Lis, float Met, float Tre, float Tri, float Val, float Acid, float AlCAL);",
"@Override\n\tpublic int insertTrading(TradingVO tvo) {\n\t\treturn sql.insert(\"insertTrading\", tvo);\n\t}",
"public void insertarcola(){\n Cola_banco nuevo=new Cola_banco();// se declara nuestro metodo que contendra la cola\r\n System.out.println(\"ingrese el nombre que contendra la cola: \");// se pide el mensaje desde el teclado\r\n nuevo.nombre=teclado.next();// se ingresa nuestro datos por consola yse almacena en la variable nombre\r\n if (primero==null){// se usa una condicional para indicar si primer dato ingresado es igual al null\r\n primero=nuevo;// se indica que el primer dato ingresado pasa a ser nuestro dato\r\n primero.siguiente=null;// se indica que el el dato ingresado vaya al apuntador siguente y que guarde al null\r\n ultimo=nuevo;// se indica que el ultimo dato ingresado pase como nuevo en la cabeza de nuestro cola\r\n }else{// se usa la condicon sino se cumple la primera\r\n ultimo.siguiente=nuevo;//se indica que ultimo dato ingresado apunte hacia siguente si es que hay un nuevo dato ingresado y que vaya aser el nuevo dato de la cola\r\n nuevo.siguiente=null;// se indica que el nuevo dato ingresado vaya y apunete hacia siguente y quees igual al null\r\n ultimo=nuevo;// se indica que el ultimo dato ingresado pase como nuevo dato\r\n }\r\n System.out.println(\"\\n dato ingresado correctamente\");// se imprime enl mensaje que el dato ha sido ingresado correctamente\r\n}",
"public void inseriEmpresa() throws IOException {\n\t\tString r;\n\t\tthis.vetEmpreas[this.nEmpresas] = new Empresa();\n\t\t\n\t\tSystem.out.println(\"Inseri o nome \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setNome(r);\n\n\t\tSystem.out.println(\"Inseri o CNPJ \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setCnpj(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o endereco \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setEndereco(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o email \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setEmail(r);\n\t\t\n\t\tSystem.out.println(\"Inseri InscricaoEstadual \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setInscricaoEstadual(r);\n\t\t\n\t\tSystem.out.println(\"Inseri Razao Social \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setRazaoSocial(r);\n\t\t\n\t\tthis.nEmpresas +=1;\n\t}",
"public static void inserir(String nome, int id){\n System.out.println(\"Dados inseridos!\");\n }",
"@Override\n\tpublic void entradaestoque(EntidadeDominio entidade) throws SQLException {\n\t\topenConnection();\n\t\tPreparedStatement pst=null;\n\t\tLivro livro = (Livro)entidade;\t\t\n\t\t\n\t\ttry {\n\t\t\tconnection.setAutoCommit(false);\t\t\t\n\t\t\t\t\t\n\t\t\tStringBuilder sql = new StringBuilder();\t\t\t\n\t\t\tsql.append(\"INSERT INTO estoque (id_livro, quantidade,id_precificacao, custo) VALUES (?,?,?,?)\");\n\t\t\t\t\t\n\t\t\tpst = connection.prepareStatement(sql.toString());\n\t\t\tpst.setInt(1, livro.getId());\n\t\t\tpst.setInt(2, livro.getEstoque().getQuantidade());\n\t\t\tpst.setInt(3, livro.getPrecificacao().getTipo());\n\t\t\tpst.setDouble(4, livro.getEstoque().getCusto());\n\t\t\tpst.executeUpdate();\t\t\t\n\t\t\tconnection.commit();\t\t\n\t\t} catch (SQLException e) {\n\t\t\ttry {\n\t\t\t\tconnection.rollback();\n\t\t\t} catch (SQLException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\te.printStackTrace();\t\t\t\n\t\t}finally{\n\t\t\ttry {\n\t\t\t\tpst.close();\n\t\t\t\tconnection.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t}",
"@Override\r\n\tpublic void inserir(Evento evento) {\n\t\trepository.save(evento);\r\n\t}",
"public void insertarTratamiento(String fecha, String tratamiento)\n {\n ContentValues valores = new ContentValues();\n valores.put(\"fecha\",fecha);\n valores.put(\"tipoTratamiento\",tratamiento);\n db.insert(\"tratamiento\",null,valores);\n\n }",
"public void insertar() {\r\n if (vista.jTNombreempresa.getText().equals(\"\") || vista.jTTelefono.getText().equals(\"\") || vista.jTRFC.getText().equals(\"\") || vista.jTDireccion.getText().equals(\"\")) {\r\n JOptionPane.showMessageDialog(null, \"Faltan Datos: No puedes dejar cuadros en blanco\");//C.P.M Verificamos si las casillas esta vacia si es asi lo notificamos\r\n } else {//C.P.M de lo contrario prosegimos\r\n modelo.setNombre(vista.jTNombreempresa.getText());//C.P.M mandamos las variabes al modelo \r\n modelo.setDireccion(vista.jTDireccion.getText());\r\n modelo.setRfc(vista.jTRFC.getText());\r\n modelo.setTelefono(vista.jTTelefono.getText());\r\n \r\n Error = modelo.insertar();//C.P.M Ejecutamos el metodo del modelo \r\n if (Error.equals(\"\")) {//C.P.M Si el modelo no regresa un error es que todo salio bien\r\n JOptionPane.showMessageDialog(null, \"Se guardo exitosamente la configuracion\");//C.P.M notificamos a el usuario\r\n vista.dispose();//C.P.M y cerramos la vista\r\n } else {//C.P.M de lo contrario \r\n JOptionPane.showMessageDialog(null, Error);//C.P.M notificamos a el usuario el error\r\n }\r\n }\r\n }",
"@Override\r\n\tpublic void insert(Object obj) throws DAOException {\n\t\tOfferta offerta;\r\n\t\ttry {\r\n\t\t\tofferta = (Offerta) obj;\r\n\r\n\t\t\tconn = getConnection(usr, pass);\r\n\r\n\t\t\tps = conn.prepareStatement(insertQuery);\r\n\r\n\t\t\tSystem.out.println(\"Inserimento dell'offerta nel db.\");\r\n\t\t\tofferta.print();\r\n\r\n\t\t\tps.setInt(1, offerta.getIdOfferta());\r\n\t\t\tps.setInt(2, offerta.getIdTratta());\r\n\t\t\tps.setInt(3, offerta.getData().getGiorno());\r\n\t\t\tps.setInt(4, offerta.getData().getMese());\r\n\t\t\tps.setInt(5, offerta.getData().getAnno());\r\n\t\t\tps.setInt(6, offerta.getOraPartenza().getOra());\r\n\t\t\tps.setInt(7, offerta.getOraPartenza().getMinuti());\r\n\t\t\tps.setInt(8, offerta.getOraArrivo().getOra());\r\n\t\t\tps.setInt(9, offerta.getOraArrivo().getMinuti());\r\n\t\t\tps.setInt(10, offerta.getPosti());\r\n\t\t\tps.setInt(11, offerta.getDataInserimento().getGiorno());\r\n\t\t\tps.setInt(12, offerta.getDataInserimento().getMese());\r\n\t\t\tps.setInt(13, offerta.getDataInserimento().getAnno());\r\n\r\n\t\t\tps.executeUpdate();\r\n\r\n\t\t} catch (ClassCastException e) {\r\n\t\t\tthrow new DAOException(\"Errore in insert ClassCastException.\");\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new DAOException(\"Errore in insert SQLException.\");\r\n\t\t}\r\n\r\n\t}",
"@Override\r\n\tpublic void insertar() {\n\t\ttab_cuenta.eliminar();\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n public void insert(J34SiscomexOrigemDi j34SiscomexOrigemDi) {\n super.doInsert(j34SiscomexOrigemDi);\n }",
"@Override\n\tpublic void insert(RaceZipTbVo vo) throws SQLException {\n\t\t\n\t}",
"public void insereFinal(String elemento) {\n No novoNo = new No(elemento, null);\n No temp = ini;\n \n //Caso a lista esteja vazia\n if (temp == null){\n ini = novoNo;\n } else {\n //Caminha ate o ultimo No, dentre todos os nos dessa listaa\n while (temp.getProx() != null) {\n temp = temp.getProx();\n }\n\n //Se chegou ate o ultimo no, adicionar o elemento desejado\n temp.setProx(novoNo);\n }\n }",
"private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n VueltasConDemoraEnOficinaEntity entity = factory.manufacturePojo(VueltasConDemoraEnOficinaEntity.class);\n \n em.persist(entity);\n data.add(entity);\n }\n }",
"public void insertar(Proceso p) {\n\t\tif (p == null) {\n\t\t\treturn;\n\t\t}\n\t\tProceso nuevo = new Proceso();\n\t\tnuevo.rafaga = p.rafaga;\n\t\tnuevo.tllegada = p.tllegada;\n\t\tnuevo.IdCola = this.IdCola;\n\t\tnuevo.NombreCola = this.NombreCola;\n\t\tnuevo.rrejecutada = p.rrejecutada;\n\t\tnuevo.ColaProviene = p.ColaProviene;\n\t\tint tamaņo = p.id.length();\n\t\tif (tamaņo == 1) {\n\t\t\tnuevo.id = p.id + \"1\";\n\t\t} else {\n\t\t\tchar id = p.id.charAt(0);\n\t\t\tint numeroId = Integer.parseInt(String.valueOf(p.id.charAt(1))) + 1;\n\t\t\tnuevo.id = String.valueOf(id) + String.valueOf(numeroId);\n\t\t}\n\t\tif (raiz.sig == raiz) {\n\t\t\traiz.sig = nuevo;\n\t\t\tcabeza = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\tnuevo.padre = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t} else {\n\t\t\tProceso aux = raiz.padre;\n\t\t\taux.sig = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t\tnuevo.padre = aux;\n\t\t}\n\t\tthis.numProcesos++;\n\t\tthis.rafagaTotal += nuevo.rafaga;\n\t\tthis.Ordenamiento();\n\t}",
"@Override\n\tpublic void set(Medicamento novo) {\n\t\t\n\n\t\t\tcon = ConexaoSingleton.getInstance();\n\t\t\ttry {\n\t\t\t\tpst = con.prepareStatement(\"INSERT INTO Medicamento (nome,mg) VALUES (?,?)\");\n\t\t\t\tpst.setString(1, novo.getDesc());\n\t\t\t\tpst.setDouble(2, novo.getmg());\n\t\t\t\tpst.execute();\n\t\t\t}catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t}",
"public void insert(Curso curso) throws SQLException {\n String query = \"\";\n Conexion db = new Conexion();\n\n query = \"INSERT INTO curso VALUES (NULL,?,?,?);\";\n \n PreparedStatement ps = db.conectar().prepareStatement(query);\n //Aquí se asignaran a los interrogantes(?) anteriores el valor oportuno en el orden adecuado\n ps.setString(1, curso.getNombre()); \n ps.setInt(2, curso.getFamilia());\n ps.setString(3, curso.getProfesor());\n \n\n if (ps.executeUpdate() > 0) {\n System.out.println(\"El registro se insertó exitosamente.\");\n } else {\n System.out.println(\"No se pudo insertar el registro.\");\n }\n\n ps.close();\n db.conexion.close();\n }",
"public void insercionMasiva() {\r\n\t\tif (!precondInsert())\r\n\t\t\treturn;\r\n\t\tUploadItem fileItem = seleccionUtilFormController.crearUploadItem(\r\n\t\t\t\tfName, uFile.length, cType, uFile);\r\n\t\ttry {\r\n\t\t\tlLineasArch = FileUtils.readLines(fileItem.getFile(), \"ISO-8859-1\");\r\n\t\t} catch (IOException e) {\r\n\t\t\tstatusMessages.add(Severity.INFO, \"Error al subir el archivo\");\r\n\t\t}\r\n\r\n\t\tStringBuilder cadenaSalida = new StringBuilder();\r\n\t\tString estado = \"EXITO\";\r\n\t\tcantidadLineas = 0;\r\n\t\t//Ciclo para contar la cantdad de adjudicados o seleccionados que se reciben\r\n\t\tfor (String linea : lLineasArch) {\r\n\t\t\tcantidadLineas++;\r\n\t\t\tif(cantidadLineas > 1){\r\n\t\t\t\tseleccionados++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Condicion para verificar si la cantidad de seleccionados es mayor a la cantidad de vacancias (en cuyo caso se procede a abortar el proceso e imprimir\r\n\t\t//un mensaje de error) o verificar si esta es menor (se imprime el mensaje pero se continua)\r\n\t\t\r\n\t\tif(seleccionados > concursoPuestoAgrNuevo.getCantidadPuestos()){\r\n\t\t\testado = \"FRACASO\";\r\n\t\t\tcadenaSalida.append(estado + \" - CANTIDAD DE AJUDICADOS ES SUPERIOR A LA CANTIDAD DE PUESTOS VACANTES PARA EL GRUPO\");\r\n\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t}\r\n\t\telse if(seleccionados < concursoPuestoAgrNuevo.getCantidadPuestos()){\r\n\t\t\tcadenaSalida.append(\"ADVERTENCIA - CANTIDAD DE ADJUDICADOS ES INFERIOR A LA CANTIDAD DE PUESTOS VACANTES PARA EL GRUPO\");\r\n\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t}\r\n\t\tseleccionados = 0;\r\n\t\t\r\n\t\tif(!estado.equals(\"FRACASO\")){\r\n\r\n\t\tcantidadLineas = 0;\r\n\t\tfor (String linea : lLineasArch) {\r\n\r\n\t\t\tcantidadLineas++;\r\n\t\t\testado = \"EXITO\";\r\n\t\t\tString observacion = \"\";\r\n\t\t\tFilaPostulante fp = new FilaPostulante(linea);\r\n\t\t\tList<Persona> lista = null;\r\n\t\t\tif (cantidadLineas > 1 && fp != null && fp.valido) {\r\n\t\t\t\t//Verifica si la persona leida en el registro del archivo CSV existe en la Tabla Persona\r\n\t\t\t\tString sqlPersona = \"select * from general.persona where persona.documento_identidad = '\"+fp.getDocumento()+ \"'\";\r\n\t\t\t\tQuery q1 = em.createNativeQuery(sqlPersona, Persona.class);\r\n\t\t\t\tPersona personaLocal = new Persona();\r\n\t\t\t\tint banderaEncontroPersonas = 0;\r\n\t\t\t\t//Si existe, se almacena el registro de la tabla\r\n\t\t\t\tif(!q1.getResultList().isEmpty()){\r\n\t\t\t\t\tlista = q1.getResultList();\r\n\t\t\t\t\tif (compararNomApe(lista.get(0).getNombres(), removeCadenasEspeciales(fp.getNombres()))\r\n\t\t\t\t\t\t\t&& compararNomApe(lista.get(0).getApellidos(), removeCadenasEspeciales(fp.getApellidos())) ) {\r\n\t\t\t\t\t\t\tbanderaEncontroPersonas = 1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\t\t\tobservacion += \" PERSONA NO REGISTRADA EN LA BASE DE DATOS LOCAL\";\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\tobservacion += \" PERSONA NO REGITRADA EN LA BASE DE DATOS LOCAL\";\r\n\t\t\t\t}\r\n\t\t\t\t//Verificamos que la persona figure en la lista corta como seleccionado\r\n\t\t\t\tif(!estado.equals(\"FRACASO\")){\r\n\t\t\t\t\tint banderaExisteEnListaCorta = 0;\t\t\t\t\t\r\n\t\t\t\t\tint i=0;\r\n\t\t\t\t\tif (banderaEncontroPersonas == 1) {\r\n\t\t\t\t\t\twhile(i<lista.size()){\r\n\t\t\t\t\t\t\tpersonaLocal = (Persona) lista.get(i);\r\n\t\t\t\t\t\t\tQuery p = em.createQuery(\"select E from EvalReferencialPostulante E \"\r\n\t\t\t\t\t\t\t\t\t+ \"where E.postulacion.personaPostulante.persona.idPersona =:id_persona and E.concursoPuestoAgr.idConcursoPuestoAgr =:id_concurso_puesto_agr and E.listaCorta=:esta_en_lista_corta\");\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"id_persona\", personaLocal.getIdPersona());\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"id_concurso_puesto_agr\", this.idConcursoPuestoAgr);\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"esta_en_lista_corta\", true);\r\n\t\t\t\t\t\t\tList<EvalReferencialPostulante> listaEvalRefPost = p.getResultList();\r\n\t\t\t\t\t\t\tif (!listaEvalRefPost.isEmpty()) {\r\n\t\t\t\t\t\t\t\tbanderaExisteEnListaCorta = 1;\r\n\t\t\t\t\t\t\t\ti = lista.size();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ti++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (banderaExisteEnListaCorta == 0) {\r\n\t\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\t\tobservacion += \" NO SELECCIONADO/ELEGIBLE EN LISTA CORTA\";\r\n\t\t\t\t\t} else if (banderaExisteEnListaCorta == 1){\r\n\t\t\t\t\t\tobservacion += \" SELECCIONADO/ELEGIBLE EN LISTA CORTA\";\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tQuery p = em.createQuery(\"select E from EvalReferencialPostulante E \"\r\n\t\t\t\t\t\t\t\t+ \"where E.postulacion.personaPostulante.persona.idPersona =:id_persona and E.concursoPuestoAgr.idConcursoPuestoAgr =:id_concurso_puesto_agr and E.listaCorta=:esta_en_lista_corta\");\r\n\t\t\t\t\t\t\t\tp.setParameter(\"id_persona\", personaLocal.getIdPersona());\r\n\t\t\t\t\t\t\t\tp.setParameter(\"id_concurso_puesto_agr\", this.idConcursoPuestoAgr);\r\n\t\t\t\t\t\t\t\tp.setParameter(\"esta_en_lista_corta\", true);\r\n\t\t\t\t\t\tEvalReferencialPostulante auxEvalReferencialPostulante = (EvalReferencialPostulante) p.getResultList().get(0);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Validaciones para actualizaciones\r\n\t\t\t\t\t\t//Bandera indicadora de actualizaciones hechas\r\n\t\t\t\t\t\tint bandera = 0;\r\n\t\t\t\t\t\tif(auxEvalReferencialPostulante.getSelAdjudicado() == null){\r\n\t\t\t\t\t\t\testado = \"EXITO\";\r\n\t\t\t\t\t\t\tauxEvalReferencialPostulante.setSelAdjudicado(true);;\r\n\t\t\t\t\t\t\tbandera = 1;\r\n\t\t\t\t\t\t\tem.merge(auxEvalReferencialPostulante);\r\n\t\t\t\t\t\t\tem.flush();\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\tagregarEstadoMotivo(linea, estado, observacion, cadenaSalida);\r\n\t\t\t}\r\n\t\t\tif (cantidadLineas > 1 && !fp.valido) {\r\n\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\tcadenaSalida\r\n\t\t\t\t\t\t.append(estado\r\n\t\t\t\t\t\t\t\t+ \" - ARCHIVO INGRESADO CON MENOS CAMPOS DE LOS NECESARIOS. DATOS INCORRECTOS EN ALGUNA COLUMNA.\");\r\n\t\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t\t}\r\n\r\n\t\t\t// FIN FOR\r\n\t\t}\r\n\t\t//FIN IF\r\n\t\t}\r\n\t\tif (lLineasArch.isEmpty()) {\r\n\t\t\tstatusMessages.add(Severity.INFO, \"Archivo inválido\");\r\n\t\t\treturn;\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tSimpleDateFormat sdf2 = new SimpleDateFormat(\"dd_MM_yyyy_HH_mm_ss\");\r\n\t\t\tString nArchivo = sdf2.format(new Date()) + \"_\" + fName;\r\n\t\t\tString direccion = System.getProperty(\"jboss.home.dir\") + System.getProperty(\"file.separator\") + \"temp\" + System.getProperty(\"file.separator\");\r\n\t\t\tFile archSalida = new File(direccion + nArchivo);\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tFileUtils\r\n\t\t\t\t\t\t.writeStringToFile(archSalida, cadenaSalida.toString());\r\n\t\t\t\tif (archSalida.length() > 0) {\r\n\t\t\t\t\tstatusMessages.add(Severity.INFO, \"Insercion Exitosa\");\r\n\t\t\t\t}\r\n\t\t\t\tJasperReportUtils.respondFile(archSalida, nArchivo, false,\r\n\t\t\t\t\t\t\"application/vnd.ms-excel\");\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tstatusMessages.add(Severity.ERROR, \"IOException\");\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void insertarRubro2(RubrosObject rubro) throws SQLException \r\n { \r\n PreparedStatement prepStmt = null;\r\n\r\n String insertStatement = \"INSERT INTO RUBROS (IDRUBRO, NOMBRE, MONTO, IDPRESUPUESTO,SALDO,TIPO_PAGO) VALUES (?,?,?,?,?,?)\";\r\n \r\n prepStmt = con.prepareStatement(insertStatement);\r\n \r\n prepStmt.setInt(1, Integer.parseInt(rubro.getIdentificador()));\r\n prepStmt.setString(2, rubro.getNombre());\r\n prepStmt.setDouble(3, Double.parseDouble(rubro.getMonto()));\r\n prepStmt.setInt(4, Integer.parseInt(rubro.getIdpresupuesto()));\r\n prepStmt.setDouble(5, Double.parseDouble(rubro.getMonto()));//EL SALDO SE INICIA IGUAL AL MONTO\r\n prepStmt.setString(6, rubro.getTipo_pago().trim());\r\n \r\n prepStmt.executeUpdate();\r\n \r\n \r\n if (prepStmt != null) {\r\n prepStmt.close();\r\n }\r\n\r\n }",
"@Insert(onConflict = OnConflictStrategy.IGNORE)\n void insert(DataTugas dataTugas);",
"@Override\n public void add(Curso entity) {\n Connection c = null;\n PreparedStatement pstmt = null;\n\n try {\n c = DBUtils.getConnection();\n pstmt = c.prepareStatement(\"INSERT INTO curso (nombrecurso, idprofesor, claveprofesor, clavealumno) values (?, ?, ?, ?)\");\n\n pstmt.setString(1, entity.getNombre());\n pstmt.setInt(2, (entity.getIdProfesor() == 0)?4:entity.getIdProfesor() ); //creo que es sin profesor confirmado o algo por el estilo\n pstmt.setString(3, entity.getClaveProfesor());\n pstmt.setString(4, entity.getClaveAlumno());\n \n pstmt.execute();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n if (pstmt != null) {\n pstmt.close();\n }\n DBUtils.closeConnection(c);\n } catch (SQLException ex) {\n Logger.getLogger(JdbcCursoRepository.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }",
"public void inserer(T val) {\r\n\r\n\t\tif (this.estVide() == true) {\r\n\r\n\t\t\tCellule<T> cel = new Cellule<T>(val);\r\n\t\t\tthis.tete = cel;\r\n\t\t\tthis.queue = cel;\r\n\t\t}\r\n\r\n\t\telse {\r\n\r\n\t\t\t// attention on insere a gauche\r\n\r\n\t\t\tCellule<T> anciennequeue = this.queue;\r\n\t\t\tCellule<T> nouvellequeue = new Cellule<T>(val);\r\n\t\t\tanciennequeue.setSuivant(nouvellequeue);\r\n\t\t\tthis.queue = nouvellequeue;\r\n\t\t}\r\n\t}",
"@Override\r\n public void inserirQuestaoDiscursiva(QuestaoDiscursiva questaoDiscursiva)\r\n throws Exception {\n rnQuestaoDiscursiva.inserir(questaoDiscursiva);\r\n\r\n }",
"@Override\r\n\tpublic Usuario insert(Usuario t) {\n\t\treturn null;\r\n\t}",
"public Etudiant insert(Etudiant obj) {\n\t\treturn null;\n\t}",
"int insertSelective(Tipologia record);",
"private void insertData() {\r\n \r\n TeatroEntity teatro = factory.manufacturePojo(TeatroEntity.class);\r\n em.persist(teatro);\r\n FuncionEntity funcion = factory.manufacturePojo(FuncionEntity.class);\r\n List<FuncionEntity> lista = new ArrayList();\r\n lista.add(funcion);\r\n em.persist(funcion);\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n sala.setFuncion(lista);\r\n em.persist(sala);\r\n data.add(sala);\r\n }\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n em.persist(sala);\r\n sfdata.add(sala);\r\n }\r\n \r\n }",
"@Transactional\r\n\r\n\t@Override\r\n\tpublic void insertar(Distrito distrito) {\n\t\tem.persist(distrito);\t\r\n\t}",
"public void insertProblema() {\n \n \n java.util.Date d = new java.util.Date();\n java.sql.Date fecha = new java.sql.Date(d.getTime());\n \n this.equipo.setEstado(true);\n this.prob = new ReporteProblema(equipo, this.problema, true,fecha);\n f.registrarReporte(this.prob);\n \n }",
"int insert(Movimiento record);",
"private void insertData() {\n compra = factory.manufacturePojo(CompraVentaEntity.class);\n compra.setId(1L);\n compra.setQuejasReclamos(new ArrayList<>());\n em.persist(compra);\n\n for (int i = 0; i < 3; i++) {\n QuejasReclamosEntity entity = factory.manufacturePojo(QuejasReclamosEntity.class);\n entity.setCompraVenta(compra);\n em.persist(entity);\n data.add(entity);\n compra.getQuejasReclamos().add(entity);\n }\n }",
"public void adiciona(Servidor novo) {\n String sql = \"insert into servidor \"\n + \"(nome, email, codcampus, cargo, papel, login, senha, adm, logado, definitivo)\"\n + \" values (?,?,?,?,?,?,?,?,?,?)\";\n\n try (Connection con = new ConnectionFactory().Conn()) {\n PreparedStatement stmt;\n stmt = con.prepareStatement(sql);\n\n stmt.setString(1, novo.getNome());\n stmt.setString(2, novo.getEmail());\n stmt.setInt(3, novo.getCampus());\n stmt.setString(4, novo.getCargo());\n stmt.setString(5, novo.getPapel());\n stmt.setString(6, novo.getLogin());\n stmt.setString(7, novo.getSenha());\n stmt.setInt(8, novo.isAdm());\n stmt.setInt(9, novo.isLogado());\n stmt.setInt(10, novo.isSystem());\n\n stmt.execute();\n stmt.close();\n\n JOptionPane.showMessageDialog(null, \"Servidor adicionado\", \"\", JOptionPane.INFORMATION_MESSAGE);\n\n } catch (SQLException e) {\n JOptionPane.showMessageDialog(null, \"Erro ao Adicionar\", \"\", JOptionPane.ERROR_MESSAGE);\n throw new RuntimeException(e);\n }\n }",
"void insert(CTipoComprobante record) throws SQLException;",
"public UtentePk insert(Utente dto) throws UtenteDaoException\n\t{\n\t\tlong t1 = System.currentTimeMillis();\n\t\t// declare variables\n\t\tfinal boolean isConnSupplied = (userConn != null);\n\t\tConnection conn = null;\n\t\tPreparedStatement stmt = null;\n\t\tResultSet rs = null;\n\t\t\n\t\ttry {\n\t\t\t// get the user-specified connection or get a connection from the ResourceManager\n\t\t\tconn = isConnSupplied ? userConn : ResourceManager.getConnection();\n\t\t\n\t\t\tstmt = conn.prepareStatement( \"SELECT nextval('seq_utenti')\" );\n\t\t\trs = stmt.executeQuery();\n\t\t\tif (rs.next()) {\n\t\t\t\tdto.setUteId( rs.getLong( 1 ) );\n\t\t\t\trs.close();\n\t\t\t\tstmt.close();\n\t\t\t}\n\t\t\n\t\t\tstmt = conn.prepareStatement( SQL_INSERT );\n\t\t\tint index = 1;\n\t\t\tstmt.setLong( index++, dto.getUteId() );\n\t\t\tstmt.setString( index++, dto.getUteCognome() );\n\t\t\tstmt.setString( index++, dto.getUteNome() );\n\t\t\tstmt.setString( index++, dto.getUteEmail() );\n\t\t\tstmt.setString( index++, dto.getUtePassword() );\n\t\t\tstmt.setDate(index++, dto.getUteLastLogin()==null ? null : new java.sql.Date( dto.getUteLastLogin().getTime() ) );\n\t\t\tstmt.setString( index++, dto.getUteCellulare() );\n\t\t\tstmt.setString( index++, dto.getUteSesso() );\n\t\t\tstmt.setDate(index++, dto.getUteDataNascita()==null ? null : new java.sql.Date( dto.getUteDataNascita().getTime() ) );\n\t\t\tstmt.setLong( index++, dto.getUteTitolo() );\n\t\t\tstmt.setLong( index++, dto.getFkPaesi() );\n\t\t\tstmt.setString( index++, dto.getUteCartaNumero() );\n\t\t\tstmt.setString( index++, dto.getUteCartaTitolare() );\n\t\t\tstmt.setString( index++, dto.getUteCartaScadMese() );\n\t\t\tstmt.setString( index++, dto.getUteCartaScadAnno() );\n\t\t\tstmt.setString( index++, dto.getUteCartaUsaPerLav() );\n\t\t\tstmt.setString( index++, dto.getUteCartaUsaPerPremio() );\n\t\t\tif (dto.isUteTipologiaNull()) {\n\t\t\t\tstmt.setNull( index++, java.sql.Types.INTEGER );\n\t\t\t} else {\n\t\t\t\tstmt.setLong( index++, dto.getUteTipologia() );\n\t\t\t}\n\t\t\n\t\t\tstmt.setString( index++, dto.getUteIndirizzo() );\n\t\t\tif (dto.isFkComuneNull()) {\n\t\t\t\tstmt.setNull( index++, java.sql.Types.INTEGER );\n\t\t\t} else {\n\t\t\t\tstmt.setLong( index++, dto.getFkComune() );\n\t\t\t}\n\t\t\n\t\t\tstmt.setString( index++, dto.getUteAzienda() );\n\t\t\tif (dto.isFkComuneAziendaNull()) {\n\t\t\t\tstmt.setNull( index++, java.sql.Types.INTEGER );\n\t\t\t} else {\n\t\t\t\tstmt.setLong( index++, dto.getFkComuneAzienda() );\n\t\t\t}\n\t\t\n\t\t\tstmt.setString( index++, dto.getUteTelefonoAzienda() );\n\t\t\tstmt.setString( index++, dto.getUtePivaAzienda() );\n\t\t\tstmt.setString( index++, dto.getUteFotoProfiloPath() );\n\t\t\tstmt.setString( index++, dto.getUtePagamentiOnline() );\n\t\t\tstmt.setString( index++, dto.getUteQuandoPagare() );\n\t\t\tstmt.setString( index++, dto.getUteFumatore() );\n\t\t\tstmt.setString( index++, dto.getUtenteStelle() );\n\t\t\tstmt.setString( index++, dto.getUteCamereOspitiDisabili() );\n\t\t\tstmt.setString( index++, dto.getUteRistorante() );\n\t\t\tstmt.setString( index++, dto.getUteConnessioneInternet() );\n\t\t\tstmt.setString( index++, dto.getUteCameraNonfumatori() );\n\t\t\tstmt.setString( index++, dto.getUtePalestra() );\n\t\t\tstmt.setString( index++, dto.getUteCamereFamiliari() );\n\t\t\tstmt.setString( index++, dto.getUteAnimali() );\n\t\t\tstmt.setString( index++, dto.getUteParcheggio() );\n\t\t\tstmt.setString( index++, dto.getUteSpaBenessere() );\n\t\t\tstmt.setString( index++, dto.getUteWifi() );\n\t\t\tstmt.setString( index++, dto.getUtePiscinaCoperta() );\n\t\t\tstmt.setString( index++, dto.getUteNavettaAeroportuale() );\n\t\t\tstmt.setString( index++, dto.getUteConnessioneWifiGratuita() );\n\t\t\tstmt.setString( index++, dto.getUteBar() );\n\t\t\tstmt.setString( index++, dto.getUteDepositoBagagli() );\n\t\t\tstmt.setString( index++, dto.getUteReception24ore() );\n\t\t\tstmt.setString( index++, dto.getUtePerChiPrenoti() );\n\t\t\tif (dto.isFkPreferenzaValutaNull()) {\n\t\t\t\tstmt.setNull( index++, java.sql.Types.INTEGER );\n\t\t\t} else {\n\t\t\t\tstmt.setLong( index++, dto.getFkPreferenzaValuta() );\n\t\t\t}\n\t\t\n\t\t\tif (dto.isUteCartaTipoNull()) {\n\t\t\t\tstmt.setNull( index++, java.sql.Types.INTEGER );\n\t\t\t} else {\n\t\t\t\tstmt.setInt( index++, dto.getUteCartaTipo() );\n\t\t\t}\n\t\t\n\t\t\tstmt.setString( index++, dto.getUteCap() );\n\t\t\tstmt.setString( index++, dto.getUteCapAzienda() );\n\t\t\tSystem.out.println( \"Executing \" + SQL_INSERT + \" with DTO: \" + dto );\n\t\t\tint rows = stmt.executeUpdate();\n\t\t\tlong t2 = System.currentTimeMillis();\n\t\t\tSystem.out.println( rows + \" rows affected (\" + (t2-t1) + \" ms)\" );\n\t\t\treset(dto);\n\t\t\treturn dto.createPk();\n\t\t}\n\t\tcatch (Exception _e) {\n\t\t\t_e.printStackTrace();\n\t\t\tthrow new UtenteDaoException( \"Exception: \" + _e.getMessage(), _e );\n\t\t}\n\t\tfinally {\n\t\t\tResourceManager.close(stmt);\n\t\t\tif (!isConnSupplied) {\n\t\t\t\tResourceManager.close(conn);\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t}",
"@FXML\n private void guardarNuevaTarea(ActionEvent event) {\n String asignadoA = usuario.getUsuario();\n if (asignarComboBox.getSelectionModel().getSelectedItem().equals(\"otro usuario\")) {\n asignadoA = asignadoFX.getText();\n }\n String porcentaje = labelPorcentaje.getText().replace(\" %\", \"\");\n\n Tarea nuevaTarea = new Tarea(tituloFX.getText(), descripcionFX.getText(), prioridadFX.getValue(),\n estadoFX.getValue(), usuario.getUsuario(), asignadoA, Integer.parseInt(porcentaje));\n\n Connection con = Conexion.conectar(\"gestortareas\", \"proyecto\", \"proyecto\");\n try {\n PreparedStatement consulta = con.prepareStatement(\"INSERT INTO Tareas(Titulo, Descripcion, Prioridad, Estado, Creador, Asignacion, Progreso) \"\n + \"VALUES(?, ?, ?, ?, ?, ?, ?);\", Statement.RETURN_GENERATED_KEYS);\n consulta.setString(1, nuevaTarea.getTitulo());\n consulta.setString(2, nuevaTarea.getDescripcion());\n consulta.setString(3, nuevaTarea.getPrioridad());\n consulta.setString(4, nuevaTarea.getEstado());\n consulta.setString(5, nuevaTarea.getCreador());\n consulta.setString(6, nuevaTarea.getAsignacion());\n consulta.setInt(7, nuevaTarea.getProgreso());\n consulta.executeUpdate();\n // Se obtiene la clave generada por la base de datos\n ResultSet rs = consulta.getGeneratedKeys();\n rs.next();\n int codigo = rs.getInt(1);\n\n // Se envía la nueva tarea a la ventana de tareas para actualizar la tabla\n ventana.anyadirTareaTabla(nuevaTarea);\n\n Stage stage = (Stage) buttonGuardar.getScene().getWindow();\n stage.close();\n } catch (SQLException e) {\n Dialogo.error(\"Error\", null, \"Error al insertar en la base de datos.\");\n }\n Conexion.desconectar(con);\n }",
"@Override\n public void insert(J34SiscomexMercadoriaAdi j34SiscomexMercadoriaAdi) {\n super.doInsert(j34SiscomexMercadoriaAdi);\n }",
"@Override\n public void applyTextEspecie(String especieMascota) {\n if(!especieMascota.isEmpty())\n {\n especie = especieMascota;\n //Guarda la especie\n instanciaDB.getSpeciesDAO().insertSpecies(new Especie(especieMascota));\n }\n }",
"static void pontipo(String t){\r\n\t\tStruct s=new Struct(t,0);\r\n\t\tStruct auxt=buscaT(s);\r\n\t\t/*He encontrado el tipo q tengo q insertar*/\r\n\t\tif(aux==null){\r\n\t\t\t//Parse.SemError(1);\r\n\t\t\tSystem.out.println(\"ERROR TIPO NO ENCONTRADO!!\");\r\n\t\t}else{\r\n\t\t\tObj aux2=aux;\r\n\t\t\twhile (aux2 != null){\r\n\t\t\t\taux2.type=auxt;\r\n\t\t\t\taux2=aux2.next;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void insertEstudio(){\n //Creamos el conector de bases de datos\n AdmiSQLiteOpenHelper admin = new AdmiSQLiteOpenHelper(this, \"administracion\", null, 1 );\n // Abre la base de datos en modo lectura y escritura\n SQLiteDatabase BasesDeDatos = admin.getWritableDatabase();\n\n //Metodo apra almacenar fecha en SQLite\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n String date = sdf.format(new Date());\n\n ContentValues registro = new ContentValues(); // Instanciamos el objeto contenedor de valores.\n registro.put(\"fecha\", date); // Aqui asociamos los atributos de la tabla con los valores de los campos (Recuerda el campo de la tabla debe ser igual aqui)\n registro.put(\"co_actividad\", \"1\"); // Aqui asociamos los atributos de la tabla con los valores de los campos (Recuerda el campo de la tabla debe ser igual aqui)\n\n //Conectamos con la base datos insertamos.\n BasesDeDatos.insert(\"t_estudios\", null, registro);\n BasesDeDatos.close();\n\n }",
"private void insertTupel(Connection c) {\n try {\n String query = \"INSERT INTO \" + getEntityName() + \" VALUES (null,?,?,?,?,?);\";\n PreparedStatement ps = c.prepareStatement(query, Statement.RETURN_GENERATED_KEYS);\n ps.setString(1, getAnlagedatum());\n ps.setString(2, getText());\n ps.setString(3, getBild());\n ps.setString(4, getPolizist());\n ps.setString(5, getFall());\n ps.executeUpdate();\n ResultSet rs = ps.getGeneratedKeys();\n rs.next();\n setID(rs.getString(1));\n getPk().setValue(getID());\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }",
"public static void inserir(Venda venda)\r\n throws Exception {\r\n venda.setId(totalVenda++);\r\n listaVenda.add(venda);\r\n }",
"public void insertarHematologia(Examen.Hematologia hematologia)\n {\n ContentValues valores = new ContentValues();\n valores.put(\"fecha\",formatter.format(hematologia.getFechaExamen()));\n valores.put(\"fibrinogeno\",hematologia.getFibrinogeno());\n valores.put(\"leucocitos\",hematologia.getFibrinogeno());\n valores.put(\"hemoglobina\",hematologia.getHemoglobina());\n valores.put(\"hematocrito\",hematologia.getHematocrito());\n valores.put(\"plaqueta\",hematologia.getPlaquetas());\n valores.put(\"vsg\",hematologia.getVsg());\n valores.put(\"hcm\",hematologia.getVsg());\n\n db.insert(\"hematologia\",null,valores);\n\n }",
"private void populaFaixaEtariaCat()\n {\n faixaEtariaCatDAO.insert(new FaixaEtariaCat(\"Até 15 anos\"));\n faixaEtariaCatDAO.insert(new FaixaEtariaCat(\"De 16 a 19 anos\"));\n faixaEtariaCatDAO.insert(new FaixaEtariaCat(\"De 20 a 30 anos\"));\n faixaEtariaCatDAO.insert(new FaixaEtariaCat(\"De 31 a 45 anos\"));\n faixaEtariaCatDAO.insert(new FaixaEtariaCat(\"De 46 a 60 anos\"));\n faixaEtariaCatDAO.insert(new FaixaEtariaCat(\"Mais de 60 anos\"));\n faixaEtariaCatDAO.insert(new FaixaEtariaCat(\"Todas as idades\"));\n\n }",
"@Override\n\tpublic void insertarServicio(Servicio nuevoServicio) {\n\t\tservicioDao= new ServicioDaoImpl();\n\t\tservicioDao.insertarServicio(nuevoServicio);\n\t\t\n\t\t\n\t}",
"int insertSelective(Movimiento record);",
"public void salvar() throws Exception {\n if(stb == null)\n throw new Exception(Main.recursos.getString(\"bd.objeto.nulo\"));\n\n // Restrição provisória para aumentar a performance do programa\n if(stb.getIdSubTipoBanca() != -1)\n return;\n\n // Primeiro verifica se existe o subtipo de banca\n Transacao.consultar(\"SELECT idSubTipoBanca FROM subTipoBanca WHERE nome LIKE '\"+ stb.getNome() +\"'\");\n if(Transacao.getRs().first())\n stb.setIdSubTipoBanca(Transacao.getRs().getInt(\"idSubTipoBanca\"));\n\n String sql = \"\";\n\n if(stb.getIdSubTipoBanca() == -1)\n sql = \"INSERT INTO subTipoBanca VALUES(null, '\"+ stb.getNome() +\"')\";\n else\n sql = \"UPDATE subTipoBanca SET nome = '\"+ stb.getNome() +\"' WHERE idSubTipoBanca = \" + stb.getIdSubTipoBanca();\n\n \n Transacao.executar(sql);\n \n // Se foi uma inserção, deve trazer o id do subtipo para o objeto\n if(stb.getIdSubTipoBanca() == -1){\n Transacao.consultar(\"SELECT LAST_INSERT_ID() AS ultimo_id\");\n if(Transacao.getRs().first())\n stb.setIdSubTipoBanca(Transacao.getRs().getInt(\"ultimo_id\"));\n }\n }",
"private void insertar() {\n String nombre = edtNombre.getText().toString();\n String telefono = edtTelefono.getText().toString();\n String correo = edtCorreo.getText().toString();\n // Validaciones\n if (!esNombreValido(nombre)) {\n TextInputLayout mascaraCampoNombre = (TextInputLayout) findViewById(R.id.mcr_edt_nombre_empresa);\n mascaraCampoNombre.setError(\"Este campo no puede quedar vacío\");\n } else {\n mostrarProgreso(true);\n String[] columnasFiltro = {Configuracion.COLUMNA_EMPRESA_NOMBRE, Configuracion.COLUMNA_EMPRESA_TELEFONO\n , Configuracion.COLUMNA_EMPRESA_CORREO, Configuracion.COLUMNA_EMPRESA_STATUS};\n String[] valorFiltro = {nombre, telefono, correo, estado};\n Log.v(\"AGET-ESTADO\", \"ENVIADO: \" + estado);\n resultado = new ObtencionDeResultadoBcst(this, Configuracion.INTENT_EMPRESA_CLIENTE, columnasFiltro, valorFiltro, tabla, null, false);\n if (ID.isEmpty()) {\n resultado.execute(Configuracion.PETICION_EMPRESA_REGISTRO, tipoPeticion);\n } else {\n resultado.execute(Configuracion.PETICION_EMPRESA_MODIFICAR_ELIMINAR + ID, tipoPeticion);\n }\n }\n }",
"@Override\r\n\t@Transactional\r\n\tpublic FmtEstado insert(FmtEstado fmtestado){\r\n\t\tgetSession().save(fmtestado);\t\r\n\t\treturn fmtestado;\r\n\t}",
"public void InsertarProceso(Proceso nuevo) {\n\t\tif (raiz.sig == raiz) {\n\t\t\traiz.sig = nuevo;\n\t\t\tthis.cabeza = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\tnuevo.padre = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t} else {\n\t\t\tProceso aux = raiz.padre;\n\t\t\taux.sig = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t\tnuevo.padre = aux;\n\t\t}\n\t\tthis.numProcesos++;\n\t}",
"public void insertarOrden(Object dato) {\n Nodo nuevo = new Nodo(dato);\n int res = 0;\n // System.out.println(\"esxa\"+res);\n if (primero == null) {\n nuevo.setReferencia(primero);\n primero = nuevo;\n // System.out.println(\"Es nulo\");\n// System.out.println(\"sss\"+primero.getDato());\n } else {\n res = comp.evaluar(dato, primero.getDato());\n // System.out.println(\"\"+res);\n if (res == -1) {\n nuevo.setReferencia(primero);\n primero = nuevo;\n } else {\n int auxres = 0;\n Nodo anterior, actual;\n anterior = actual = primero;\n auxres = comp.evaluar(dato, actual.getDato());\n while ((actual.getReferencia() != null) && (auxres == 1)) {\n anterior = actual;\n actual = actual.getReferencia();\n auxres = comp.evaluar(dato, actual.getDato());\n }\n if (auxres == 1) {\n anterior = actual;\n }\n nuevo.setReferencia(anterior.getReferencia());\n anterior.setReferencia(nuevo);\n\n }\n }\n\n }",
"@Override\r\n\tpublic void inserir(Funcionario funcionario) throws SQLException {\n\t\topen();\r\n\t\t\r\n\t\tclose();\r\n\t\t\r\n\t}",
"public void insertaMensaje(InfoMensaje m) throws Exception;",
"public OrdemDeServico inserir (OrdemDeServico servico) {\n\t\tservico.setId((Long) null);\n\t\treturn repoOrdem.save(servico);\n\t}",
"private void insertData() {\n\n cliente = factory.manufacturePojo(ClienteEntity.class);\n em.persist(cliente);\n for (int i = 0; i < 3; i++) {\n FormaPagoEntity formaPagoEntity = factory.manufacturePojo(FormaPagoEntity.class);\n formaPagoEntity.setCliente(cliente);\n em.persist(formaPagoEntity);\n data.add(formaPagoEntity);\n }\n }",
"public void inserisci(String dove, String contenuto){\n if (n_nodi == 0){\n root = new NodoAlbero(contenuto, null, \"directory\");\n n_nodi++;\n return;\n }\n //troviamo il nodo che sarà il padre del nodo che dobbiamo aggiungere\n NodoAlbero cercato = ricerca(dove);\n \n //se il nodo padre non esiste, non aggiungiamo il nuovo nodo\n if (cercato == null)\n return;\n //se il nodo padre non ha un figlio, lo creiamo\n if (cercato.getFiglio() == null)\n cercato.setFiglio(new NodoAlbero(contenuto, cercato, \"directory\"));\n //se ce ne ha già almeno uno, lo accodiamo agli altri figli\n else {\n NodoAlbero temp = cercato.getFiglio();\n while (temp.getFratello() != null)\n temp = temp.getFratello();\n temp.setFratello(new NodoAlbero(contenuto, temp.getPadre(), \"directory\"));\n }\n n_nodi++;\n }"
] | [
"0.68786603",
"0.67889816",
"0.6765095",
"0.66976726",
"0.664651",
"0.66332775",
"0.6469024",
"0.646737",
"0.64369935",
"0.64294946",
"0.6396375",
"0.63876504",
"0.6380491",
"0.63578385",
"0.6351507",
"0.633266",
"0.63222826",
"0.6262067",
"0.62615",
"0.6256893",
"0.6235804",
"0.6235539",
"0.6214469",
"0.6178665",
"0.61666614",
"0.61627406",
"0.6158428",
"0.6123895",
"0.6123807",
"0.60852",
"0.60505944",
"0.6045759",
"0.6040696",
"0.6037417",
"0.60360974",
"0.6036035",
"0.60297185",
"0.6028798",
"0.6018013",
"0.6004848",
"0.5998894",
"0.5990506",
"0.5972535",
"0.5955607",
"0.59555906",
"0.59547204",
"0.5948107",
"0.5926224",
"0.5922003",
"0.59199786",
"0.59191513",
"0.58979595",
"0.5894821",
"0.5878582",
"0.5871988",
"0.58700955",
"0.58636093",
"0.58484656",
"0.5841533",
"0.58414614",
"0.583216",
"0.5831777",
"0.5828986",
"0.5824841",
"0.5823143",
"0.58206725",
"0.5811048",
"0.58040833",
"0.58034563",
"0.5798931",
"0.5789634",
"0.57822746",
"0.5771593",
"0.57621735",
"0.57591516",
"0.57520765",
"0.5749225",
"0.57477313",
"0.57460773",
"0.57455295",
"0.57451904",
"0.5742039",
"0.5740175",
"0.573985",
"0.5739488",
"0.5737851",
"0.5736848",
"0.5730023",
"0.5722323",
"0.57107335",
"0.5707914",
"0.5706089",
"0.5700031",
"0.5694709",
"0.56905115",
"0.56880397",
"0.56844956",
"0.5683363",
"0.567876",
"0.5670984"
] | 0.69085723 | 0 |
Grau do Termo de maior grau | public int maiorGrau() {
return poli.lastKey();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String accionemergencia(){\n\t\tString resp=\"\";\n\t\tif(puntosvida<=5 && acc!=1){\n\t\t\tpuntosvida=puntosvida+15;\n\t\t\tresp=\"\\nAccion de emergencia \"+ tipo +\"activada vida +15\";\n\t\t\tacc=1;\n\t\t}\n\t\treturn resp;\n\t}",
"@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di friggere un uovo\";\r\n }",
"@Override public String getMasa(){\n return \"gruesa \";\n }",
"public String comunica() {\r\n// ritorna una stringa\r\n// posso usare il metodo astratto \r\n return msg + AggiungiQualcosa();\r\n }",
"@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di cuocere il pollo\";\r\n }",
"public void estiloAcierto() {\r\n\t\t /**Bea y Jose**/\t\t\r\n \r\n\t}",
"@Override\n public void cantidad_Ataque(){\n ataque=5+2*nivel+aumentoT;\n }",
"public String validaAgressividade() {\n if (this.agressividade>10 || this.agressividade<1) {// ALTA.\n return \"Agressividade deve variar de 1 a 10\";\n }\n return \"\";\n }",
"@Override\r\n public String receita() {\n return \"Misturar os ingredientes; bater no liquidificador; colocar na máquina de waffle por 10m\";\r\n }",
"public String validaPeso() {\n if (this.peso>20) {\n return \"Cachorro acima do peso.\";\n }\n return \"\";\n }",
"@Override\r\n\tpublic float chekearDatos(){\r\n\t\t\r\n\t\tfloat monto = 0f;\r\n\t\tfloat montoPorMes = creditoSolicitado/plazoEnMeses;\r\n\t\tdouble porcentajeDeSusIngesosMensuales = (cliente.getIngresosMensuales()*0.7);\r\n\t\t\r\n\t\tif(cliente.getIngresoAnual()>=15000f && montoPorMes<=porcentajeDeSusIngesosMensuales){\r\n\t\t\t\r\n\t\t\tmonto = this.creditoSolicitado;\r\n\t\t\tsetEstadoDeSolicitud(true);\r\n\t\t}\t\r\n\t\t\r\n\t\t\r\n\t\treturn monto;\r\n\t}",
"public void sacarPaseo(){\r\n\t\t\tSystem.out.println(\"Por las tardes me saca de paseo mi dueño\");\r\n\t\t\t\r\n\t\t}",
"public Personnage attaqueSurPersonnage() {\n\t\tdouble rand = Math.random();\n\t\t\tif (rand >= 0.85){\n\t\t\t\tfrappeMonstre = monstre.getCaracter().getForce() * 2;\n\t\t\t\tjoueur.setDiminutionPV(frappeMonstre);\n\t\t\t\tsetVictimeKO(joueur);\n\t\t\t\tetatAttaque = 'C';\n\t\t\t\treturn joueur;\n\t\t\t}\n\t\t\telse if ((rand < 0.85) && (rand >= 0.15)){\n\t\t\t\tfrappeMonstre = monstre.getCaracter().getForce();\n\t\t\t\tjoueur.setDiminutionPV(frappeMonstre);\n\t\t\t\tsetVictimeKO(joueur);\n\t\t\t\tetatAttaque = 'N';\n\t\t\t\treturn joueur;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tetatAttaque = 'F';\n\t\t\t\tfrappeMonstre = 0;\n\t\t\t\treturn joueur;\n\t\t\t}\n\t\t}",
"protected String getTitoloPaginaMadre() {\n return VUOTA;\n }",
"private String elaboraIncipit() {\n String testo = VUOTA;\n\n if (usaHeadIncipit) {\n testo += elaboraIncipitSpecifico();\n testo += A_CAPO;\n }// fine del blocco if\n\n return testo;\n }",
"public String annulerRv(){\n\t\t// Traitement ici ... \n\t\treturn AFFICHER;\n\t}",
"public int jogadorAtual() {\n return vez;\n }",
"private String elaboraAvvisoScrittura() {\n String testo = VUOTA;\n\n if (usaHeadNonScrivere) {\n testo += TAG_NON_SCRIVERE;\n testo += A_CAPO;\n }// end of if cycle\n\n return testo;\n }",
"Groepen maakGroepsindeling(Groepen aanwezigheidsGroepen);",
"public boolean tieneRepresentacionGrafica();",
"private void carregaAvisosGerais() {\r\n\t\tif (codWcagEmag == WCAG) {\r\n\t\t\t/*\r\n\t\t\t * Mudan�as de idioma\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"4.1\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Ignorar arte ascii\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.10\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Utilizar a linguagem mais clara e simples poss�vel\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"14.1\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * navega��o de maneira coerente\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.4\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"14.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"11.4\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"14.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"12.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer mapa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Abreviaturas\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"4.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer atalho\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"9.5\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Prefer�ncias (por ex., por idioma ou por tipo de conte�do).\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"11.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * BreadCrumb\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.5\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * fun��es de pesquisa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.7\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * front-loading\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.8\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Documentos compostos por mais de uma p�gina\r\n\t\t\t */\r\n\t\t\t// comentado por n�o ter achado equi\r\n\t\t\t// erroOuAviso.add(new ArmazenaErroOuAviso(\"3.10\", AVISO,\r\n\t\t\t// codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Complementar o texto com imagens, etc.\r\n\t\t\t */\r\n\t\t\t// erroOuAviso.add(new ArmazenaErroOuAviso(\"3.11\", AVISO,\r\n\t\t\t// codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Forne�a metadados.\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t} else if (codWcagEmag == EMAG) {\r\n\t\t\t/*\r\n\t\t\t * Mudan�as de idioma\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Ignorar arte ascii\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Utilizar a linguagem mais clara e simples poss�vel\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.9\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * navega��o de maneira coerente\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.10\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.21\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.24\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"2.9\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"2.11\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer mapa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"2.17\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Abreviaturas\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer atalho\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Prefer�ncias (por ex., por idioma ou por tipo de conte�do).\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.5\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * BreadCrumb\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.6\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * fun��es de pesquisa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.8\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * front-loading\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.9\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Documentos compostos por mais de uma p�gina\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.10\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Complementar o texto com imagens, etc.\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.11\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Forne�a metadados.\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.14\", AVISO, codWcagEmag, \"\"));\r\n\t\t}\r\n\r\n\t}",
"private String elaboraRitorno() {\n String testo = VUOTA;\n String titoloPaginaMadre = getTitoloPaginaMadre();\n\n if (usaHeadRitorno) {\n if (text.isValid(titoloPaginaMadre)) {\n testo += \"Torna a|\" + titoloPaginaMadre;\n testo = LibWiki.setGraffe(testo);\n }// fine del blocco if\n }// fine del blocco if\n\n return testo;\n }",
"@Override\n public String toString() {\n return \"Ultima Manutencao em: \"+this.ultimaManun+\" km's.\";\n }",
"public String getPuntoEmision()\r\n/* 124: */ {\r\n/* 125:207 */ return this.puntoEmision;\r\n/* 126: */ }",
"private int cantFantasmasRestantes() {\n // TODO implement here\n return 0;\n }",
"public String estadoAlum() {\n String informacion = \"\";\n if (getProm() >= 60) {\n setCad(\"USTED APRUEBA CON TOTAL EXITO\");\n } else {\n if (getProm() <= 59) {\n setCad(\"REPROBADO\");\n }\n }\n return getCad();\n }",
"public void carroNoAgregado(){\n System.out.println(\"No hay un parqueo para su automovil\");\n }",
"private static String formatFamilyMember (FamilyMemberGuest fmg, Date arrivo, int permanenza) {\n\t\tString res = \"\";\n\n\t\tres += FamilyMemberGuest.CODICE;\n\t\tres += DateUtils.format(arrivo);\n\t\tres += String.format(\"%02d\", permanenza);\n\t\tres += padRight(fmg.getSurname().trim().toUpperCase(),50);\n\t\tres += padRight(fmg.getName().trim().toUpperCase(),30);\n\t\tres += fmg.getSex().equals(\"M\") ? 1 : 2;\n\t\tres += DateUtils.format(fmg.getBirthDate());\n\n\t\t//Setting luogo et other balles is a bit more 'na rottura\n\t\tres += formatPlaceOfBirth(fmg.getPlaceOfBirth());\n\n\t\tPlace cita = fmg.getCittadinanza(); //banana, box\n\t\tres += cita.getId();\n\t\t//Assert.assertEquals(168,res.length()); //if string lenght is 168 we are ok\n\t\tres += padRight(\"\", 34);\n\t\tres += \"\\r\\n\";\n\n\t\treturn res;\n\t}",
"public String imprime() {\r\n\t\tstatus = \"=== Central P2-CG ===\" + quebraLinha;\r\n\t\tfor (Usuario usuario : loja.getUsuarios()) {\r\n\t\t\tstatus+= usuario.getLogin()+ quebraLinha;\r\n\t\t\tstatus+= usuario.getNome() + quebraLinha;\r\n\t\t\tstatus+= \"Jogador \" + usuario.tipoJogador()\r\n\t\t\t\t\t+ \": \" + usuario.getPontos() + \" x2p\" + quebraLinha;\r\n\t\t\t\r\n\t\t\tstatus+= \"Lista de Jogos:\"+ quebraLinha;\r\n\t\t\tfor (Jogo jogo : usuario.getJogos()) {\r\n\t\t\t\tstatus+= \"+\" + jogo.getNome() + \" - \"\r\n\t\t\t\t\t\t+ jogo.getClass().getSimpleName() + \":\" + quebraLinha;\r\n\t\t\t\tstatus+= \"===> Jogou \" + jogo.getVezesjogadas()\r\n\t\t\t\t\t\t+ \" vez(es)\"+ quebraLinha;\r\n\t\t\t\tstatus+= \"===> Zerou \" + jogo.getZerajogo()\r\n\t\t\t\t\t\t+ \" vez(es)\"+ quebraLinha;\r\n\t\t\t\tstatus+= \"===> Maior Score \" + jogo.getScore()+ quebraLinha;\r\n\t\t\t\tstatus+= quebraLinha;\r\n\r\n\t\t\t}\r\n\t\t\tdesconto += usuario.getDesconto();\r\n\r\n\t\t\t\r\n\t\t}\r\n\t\tstatus+= \"Total de preco dos jogos: R$ \" + valorTotal + quebraLinha;\r\n\t\tstatus+= \"---------------------------------------------\"+quebraLinha;\r\n\t\tstatus+= \"Total arrecadado com vendas de jogos:\" + desconto + quebraLinha;\r\n\t\tstatus+= quebraLinha;\r\n\t\tdesconto = 0;\r\n\t\treturn status;\r\n\t}",
"@Override\n protected String elaboraBody() {\n String text = CostBio.VUOTO;\n int numCognomi = mappaCognomi.size();\n int numVoci = Bio.count();\n int taglioVoci = Pref.getInt(CostBio.TAGLIO_NOMI_ELENCO);\n\n text += A_CAPO;\n text += \"==Cognomi==\";\n text += A_CAPO;\n text += \"Elenco dei \";\n text += LibWiki.setBold(LibNum.format(numCognomi));\n text += \" cognomi '''differenti''' utilizzati nelle \";\n text += LibWiki.setBold(LibNum.format(numVoci));\n text += \" voci biografiche con occorrenze maggiori di \";\n text += LibWiki.setBold(taglioVoci);\n text += A_CAPO;\n text += creaElenco();\n text += A_CAPO;\n\n return text;\n }",
"public static void dormir(){\n System.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n System.out.flush();\n int restoDeMana; //variables locales a utilizar\n int restoDeVida;\n if(oro>=30){ //condicion de oro para recuperar vida y mana\n restoDeMana=10-puntosDeMana;\n puntosDeMana=puntosDeMana+restoDeMana;\n restoDeVida=150-puntosDeVida;\n puntosDeVida=puntosDeVida+restoDeVida;\n //descotando oro al jugador\n oro=oro-30;\n System.out.println(\"\\nrecuperacion satisfactoria\");\n }\n else{\n System.out.println(\"no cuentas con 'Oro' para recuperarte\");\n }\n }",
"@Override\n\tpublic String dettaglioAggiornaQuota(){\n\t return super.dettaglioAggiornaQuota();\n\t}",
"@Override\n\tpublic String getInformeVendedor() {\n\t\treturn \"Informe trimestre 3\";\n\t}",
"public void PagarConsulta() {\n\t\tSystem.out.println(\"el patronato es gratiuto y no necesita pagar \");\r\n\t}",
"public void calculoPersonal(){\n ayudantes = getAyudantesNecesarios();\n responsables = getResponsablesNecesarios();\n \n //Calculo atencion al cliente (30% total trabajadores) y RRPP (10% total trabajadores):\n \n int total = ayudantes + responsables;\n \n atencion_al_cliente = (total * 30) / 100;\n \n RRPP = (total * 10) / 100;\n \n //Creamos los trabajadores\n \n gestor_trabajadores.crearTrabajadores(RRPP, ayudantes,responsables,atencion_al_cliente);\n \n }",
"@Override\r\n\tpublic double recargoImpuesto() {\n\t\treturn 0.03;\r\n\t}",
"public static float mostrarCredito(){\n JOptionPane.showMessageDialog(null,\"Actualmente hay \"+Monedero.getCredito());\n return Monedero.getCredito();\n }",
"float getMonatl_kosten();",
"@Override // prekrytie danej metody predka\r\n public String toString() {\r\n return super.toString()\r\n + \" vaha: \" + String.format(\"%.1f kg,\", dajVahu())\r\n + \" farba: \" + dajFarbu() + \".\";\r\n }",
"public void aapne() {\n trykketPaa = true;\n setBackground(new Background(new BackgroundFill(Color.LIGHTGRAY, CornerRadii.EMPTY, Insets.EMPTY)));\n if (bombe) {\n setText(\"x\");\n Color moerkeregroenn = Color.rgb(86, 130, 3, 0.5);\n setBackground(new Background(new BackgroundFill(moerkeregroenn, CornerRadii.EMPTY, Insets.EMPTY)));\n } else if (bombeNaboer == 0) {\n setText(\" \");\n } else {\n setText(bombeNaboer + \"\");\n if (bombeNaboer == 1) {\n setTextFill(Color.BLUE);\n } else if (bombeNaboer == 2) {\n setTextFill(Color.GREEN);\n } else if (bombeNaboer == 3) {\n setTextFill(Color.RED);\n } else if (bombeNaboer == 4) {\n setTextFill(Color.DARKBLUE);\n } else if (bombeNaboer == 5) {\n setTextFill(Color.BROWN);\n } else if (bombeNaboer == 6) {\n setTextFill(Color.DARKCYAN);\n }\n }\n }",
"public String estado(){\r\n if(promedio > 27){\r\n estado = \"Aprobado\";\r\n }else{\r\n estado = \"Supletorios\";\r\n }\r\n return estado;\r\n }",
"@Override public int conocerMonto(){\n\treturn 120;\n }",
"@Override\n public void cantidad_Punteria(){\n punteria=69.5+05*nivel+aumentoP;\n }",
"private void checkAnnoRateo() {\n\t\tif(req.getRateo().getAnno()>=primaNota.getBilancio().getAnno()){\n\t\t\tthrow new BusinessException(ErroreCore.OPERAZIONE_NON_CONSENTITA.getErrore(\"L'anno del Rateo deve essere minore dell'anno della prima nota di partenza.\"));\n\t\t}\n\t}",
"public int extraer ()\n {\n if (raiz!=null)\n {\n int informacion = raiz.edad;\n raiz = raiz.sig;\n return informacion;\n }\n else\n {\n System.out.println(\"La lista se encuentra vacia\");\n return 0;\n }\n }",
"protected String elaboraIncipitSpecifico() {\n return VUOTA;\n }",
"public void calcular() {\n int validar, c, d, u;\n int contrasena = 246;\n c = Integer.parseInt(spiCentenas.getValue().toString());\n d = Integer.parseInt(spiDecenas.getValue().toString());\n u = Integer.parseInt(spiUnidades.getValue().toString());\n validar = c * 100 + d * 10 + u * 1;\n //Si es igual se abre.\n if (contrasena == validar) {\n etiResultado.setText(\"Caja Abierta\");\n }\n //Si es menor nos indica que es mas grande\n if (validar < contrasena) {\n etiResultado.setText(\"El número secreto es mayor\");\n }\n //Si es mayot nos indica que es mas pequeño.\n if (validar > contrasena) {\n etiResultado.setText(\"El número secreto es menor\");\n }\n }",
"public String toString(){\n return \"+-----------------------+\\n\" +\n \"| Boleto para el metro |\\n\" +\n \"|derjere0ranfeore |\\n\" +\n \"+-----------------------+\\n\" ;\n }",
"public int getDineroRecaudadoPorMaquina1()\n {\n return maquina1.getTotal();\n }",
"private static void mostrarEmpateRonda() {\r\n\t\tSystem.out.println(\"¡RONDA \" + juego.getNRonda()\r\n\t\t\t\t+ \" EMPATADA!\\n Se repite la ronda \" + juego.getNRonda());\r\n\t}",
"@Override\r\n\tpublic String getOstatu_mota() {\n\t\treturn super.getOstatu_mota();\r\n\t}",
"private void comerFantasma(Fantasma fantasma) {\n // TODO implement here\n }",
"@Override\n\tpublic double mencariGajiKotor() {\n\t\treturn super.mencariGajiKotor()+mencariBonus();\n\t}",
"public void aumentarMinas(){\n\r\n if(espM==false){\r\n minascerca++;\r\n }\r\n }",
"public static void miedo(){\n int aleatorio; //variables locales a utilizar\n Random numeroAleatorio = new Random(); //declarando variables tipo random para aleatoriedad\n aleatorio = (numeroAleatorio.nextInt(10-5+1)+5);\n \n if(oro>aleatorio){//condicion de finalizar battalla y sus acciones\n oroPerdido= (nivel*2)+aleatorio;\n oro= oro-oroPerdido;\n System.out.println(\"Huiste de la batalla!!!\");\n\t\t System.out.println(\"oro perdido:\"+oroPerdido);\n opcionMiedo=1; //finalizando battalla por huida del jugador \n }\n else{\n System.out.println(\"No pudes huir de la batalla\");\n } \n }",
"public String getFrecuencia() {\r\n return frecuencia;\r\n }",
"@Override\r\n\tpublic double getTMB() {\r\n\t\tif (isAdultoJovem()) {\r\n\t\t\treturn 15.3 * anamnese.getPesoUsual() + 679;\r\n\t\t}\r\n\t\tif (isAdulto()) {\r\n\t\t\treturn 11.6 * anamnese.getPesoUsual() + 879;\r\n\t\t}\r\n\t\tif (isIdoso()) {\r\n\t\t\treturn 13.5 * anamnese.getPesoUsual() + 487;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}",
"@Override\n\tpublic String maju() {\n\t\tif (gigiMasuk) {\n\t\t\treturn super.maju();\n\t\t}else {\n\t\t\treturn \"..............\";\n\t\t}\n\t}",
"public abstract java.lang.String getAcma_cierre();",
"protected String decrisToi(){\r\n return \"\\t\"+this.nomVille+\" est une ville de \"+this.nomPays+ \", elle comporte : \"+this.nbreHabitants+\" habitant(s) => elle est donc de catégorie : \"+this.categorie;\r\n }",
"@Override\n\tpublic String dettaglioConsultaQuota(){\n\t return super.dettaglioConsultaQuota();\n\t}",
"private String geraMensagem(Mensagem msg) {\n\t\treturn new StringBuilder()\n\t\t\t.append(msg.remetente.nome)\n\t\t\t.append(\" enviou para \")\n\t\t\t.append(msg.destinatario.nome)\n\t\t\t.append(\" uma mensagem suspeita.\")\n\t\t\t.toString();\n\t}",
"public String getPesan()\n {\n return super.getMessage() + hotel_error + (\"tidak ditemukan.\");\n }",
"public void cambioEstadAvaluo() {\r\n try {\r\n if (\"\".equals(mBRadicacion.Radi.getObservacionAvaluo()) || \"\".equals(mBRadicacion.Radi.getEstadoAvaluo())) {\r\n mbTodero.setMens(\"Falta informacion por Llenar\");\r\n mbTodero.warn();\r\n } else {\r\n mBRadicacion.Radi.CambioEstRad(mBsesion.codigoMiSesion());\r\n mbTodero.setMens(\"La informacion ha sido guardada correctamente\");\r\n mbTodero.info();\r\n mbTodero.resetTable(\"FRMSeguimiento:SeguimientoTable\");\r\n RequestContext.getCurrentInstance().execute(\"PF('DlgEstAvaluo').hide()\");\r\n ListSeguimiento = Seg.ConsulSeguimAvaluos(mBsesion.codigoMiSesion());//VARIABLES DE SESION\r\n }\r\n } catch (Exception e) {\r\n mbTodero.setMens(\"Error en el metodo '\" + this.getClass() + \".cambioEstadAvaluo()' causado por: \" + e.getMessage());\r\n mbTodero.error();\r\n }\r\n }",
"public void erzaehlWas() {\n // Das Gleiche was jedes Tier sagt.\n super.erzaehlWas();\n\n // Zusaetzliche Aussage des Affen\n System.out.println(\"Affen sind einfach die besten Tiere.\");\n }",
"public boolean erreurStandard1() {\r\n\t\t\t\r\n\t\t\t//Initialisation du booléen, identification des champs à vérifer \r\n\t\t\tboolean verif = false;\r\n\t\t\tWebElement messageErreur = wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(\"//div[.='Out of range (>= 0).']\")));\r\n\t\t\t\r\n\t\t\t//Vérification\r\n\t\t\tif (messageErreur.isDisplayed()) {\r\n\t\t\t\tverif = true;\r\n\t\t\t}\r\n\t\t\treturn verif;\r\n\t\t}",
"public String getGeslacht(){\n if(geslacht == \"man\" || geslacht == \"vrouw\"){\n return geslacht;\n }\n else {\n return \"onbekent\";\n }\n }",
"@Override\r\n public String toString() {\r\n return pontosTimeMandante + \" x \" + pontosTimeVisitante + \" - \" + (isFinalizado() ? \"Finalizado\" : \"Em andamento\");\r\n }",
"void entrerAuGarage();",
"public String toString(){\n\t\tString s = \"\";\n\t\ts += \"El deposito de la moneda \"+nombreMoneda+\" (\" +valor+ \" centimos) contiene \"+cantidad+\" monedas\\n\";\n\t\treturn s;\n\t}",
"@Override\n public String getMessage() {\n String chuoi=\"\";\n if (maCD.length()!=5)\n chuoi=\"MaCD bao gom 5 ki tu\";\n else if (soBaiHat<10)\n chuoi=\"So bai hat phai lon hon 10 bai\";\n return\n chuoi;\n }",
"public void aapneBomberOgFlagg() {\n brettTapt = true;\n if (trykketPaa) {\n return;\n }\n // Viser alle bomber som ikke er flagget\n if (bombe && !flagget) {\n setText(\"x\");\n setBackground(new Background(new BackgroundFill(Color.GREY, CornerRadii.EMPTY, Insets.EMPTY)));\n }\n // Fargekoder om flaggingen var korrekt eller ikke\n if (flagget) {\n if (!bombe) {\n setBackground(new Background(new BackgroundFill(Color.PINK, CornerRadii.EMPTY, Insets.EMPTY)));\n } else {\n Color lysegroenn = Color.rgb(86, 130, 3, 0.3);\n setBackground(new Background(new BackgroundFill(lysegroenn, CornerRadii.EMPTY, Insets.EMPTY)));\n }\n }\n }",
"private boolean temMunicao() {\n\t\t\n\t\tif (round<1) {\n\t\t\tsetSemMunicao(true);\n\t\t\treturn false;\n\t\t\t\n\t\t}else \n\t\t\tsetSemMunicao(false);\n\t\t\n\t\t\n\t\treturn true;\n\t}",
"@Override\n public void disegna(Graphics g){\n \n //Disegna solo se l'oggetto è attivo\n if(attivo){\n \n //Scelgo il font\n g.setFont(new Font(\"German\", Font.BOLD, 50));\n //Disegno una cornice con triplo rettangolo\n g.setColor(Color.white);\n g.drawRect(this.punto.x - 10, this.punto.y - 44, larghezza_countdown, altezza_countdown);\n g.setColor(Color.black);\n g.drawRect(this.punto.x - 11, this.punto.y - 45, larghezza_countdown+2, altezza_countdown+2);\n g.setColor(Color.white);\n g.drawRect(this.punto.x - 12, this.punto.y - 46, larghezza_countdown+4, altezza_countdown+4);\n \n //Setto il testo nel formato \"timer\"\n setTesto();\n \n //Disegno il testo\n g.drawString(this.testo, this.punto.x, this.punto.y);\n \n //Scelgo il font\n g.setFont(new Font(\"German\", Font.BOLD, 50));\n //Disegno una cornice con triplo rettangolo\n g.setColor(Color.white);\n g.drawRect(this.punto.x - 10 + 450, this.punto.y - 44, larghezza_countdown + 98, altezza_countdown);\n g.setColor(Color.black);\n g.drawRect(this.punto.x - 11 + 450, this.punto.y - 45, larghezza_countdown+2 + 98, altezza_countdown+2);\n g.setColor(Color.white);\n g.drawRect(this.punto.x - 12 + 450, this.punto.y - 46, larghezza_countdown+4 + 98, altezza_countdown+4);\n \n //Disegno il testo\n g.drawString(this.livello, this.punto.x + 450, this.punto.y);\n \n }\n \n }",
"private String tallenna() {\n Dialogs.showMessageDialog(\"Tallennetaan!\");\n try {\n paivakirja.tallenna();\n return null;\n } catch (SailoException ex) {\n Dialogs.showMessageDialog(\"Tallennuksessa ongelmia!\" + ex.getMessage());\n return ex.getMessage();\n }\n }",
"@Override\r\n\tprotected boolean puedeExtraer(double monto) {\n\t\treturn ((super.getSaldo() - monto) >= 0) ? true : false;\r\n\t}",
"public void ventaBilleteMaquina2()\n {\n maquina2.insertMoney(600);\n maquina1.printTicket();\n }",
"@Override\n public void affiche(){\n System.out.println(\"Loup : \\n points de vie : \"+this.ptVie+\"\\n pourcentage d'attaque : \"+this.pourcentageAtt+\n \"\\n dégâts d'attaque : \"+this.degAtt+\"\\n pourcentage de parade :\"+this.pourcentagePar+\n \"\\n position : \"+this.pos.toString());\n\n }",
"public String toString(){\n\r\n String res=\"*\";\r\n if(revelado==true){\r\n res=\"\"+minascerca;\r\n }\r\n if(espM==true&&revelado==true)\r\n res=\"X\";\r\n return res;\r\n }",
"public void azzera() { setEnergia(0.0); }",
"private void setStatusTelaExibir () {\n setStatusTelaExibir(-1);\n }",
"public static int AnaEkranGoruntusu(){\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"****************************************\");\n\t\tSystem.out.println(\"* NE YAPMAK İSTERSİNİZ?\t\t\t*\");\n\t\tSystem.out.println(\"* 0)Alisveris Sepetini Goster\t\t*\");\n\t\tSystem.out.println(\"* 1)Sepetine Yeni Urun Ekle\t\t*\");\n\t\tSystem.out.println(\"* 2)Toplam Harcamami Goster\t\t*\");\n\t\tSystem.out.println(\"* 3)Cikis\t\t\t\t*\");\n\t\tSystem.out.println(\"****************************************\");\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Lutfen Secimini Giriniz: \");\n\t\tint anamenu_secim = scan.nextInt();\n\t\treturn anamenu_secim;\n\t}",
"public boolean verMina(){\n\r\n return espM;\r\n }",
"private void asignaNombre() {\r\n\r\n\t\tswitch (this.getNumero()) {\r\n\r\n\t\tcase 1:\r\n\t\t\tthis.setNombre(\"As de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tthis.setNombre(\"Dos de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tthis.setNombre(\"Tres de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tthis.setNombre(\"Cuatro de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 5:\r\n\t\t\tthis.setNombre(\"Cinco de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 6:\r\n\t\t\tthis.setNombre(\"Seis de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 7:\r\n\t\t\tthis.setNombre(\"Siete de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 10:\r\n\t\t\tthis.setNombre(\"Diez de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 11:\r\n\t\t\tthis.setNombre(\"Once de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 12:\r\n\t\t\tthis.setNombre(\"Doce de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}",
"private static String formatGroupMember(GroupMemberGuest gmg, Date arrivo, int permanenza) {\n\t\tString res = \"\";\n\n\t\tres += GroupMemberGuest.CODICE;\n\t\tres += DateUtils.format(arrivo);\n\t\tres += String.format(\"%02d\", permanenza);\n\t\tres += padRight(gmg.getSurname().trim().toUpperCase(),50);\n\t\tres += padRight(gmg.getName().trim().toUpperCase(),30);\n\t\tres += gmg.getSex().equals(\"M\") ? 1 : 2;\n\t\tres += DateUtils.format(gmg.getBirthDate());\n\n\t\t//Setting luogo et other balles is a bit more 'na rottura\n\t\tres += formatPlaceOfBirth(gmg.getPlaceOfBirth());\n\n\t\tPlace cita = gmg.getCittadinanza(); //banana, box\n\t\tres += cita.getId();\n\t\tres += padRight(\"\", 34);\n\t\t//Assert.assertEquals(168,res.length()); //if string lenght is 168 we are ok\n\t\tres += \"\\r\\n\";\n\n\t\treturn res;\n\t}",
"public static void pocetniMeni() {\r\n\t\tSystem.out\r\n\t\t\t\t.println(\"***********************************************\\n\"\r\n\t\t\t\t\t\t+ \"Unesite 1 ako zelite vidjeti kalendar(za dati mjesec i godinu)\\n\"\r\n\t\t\t\t\t\t+ \"Unesite 2 za pregled podsjetnika za dati mjesec i godinu\\n\"\r\n\t\t\t\t\t\t+ \"Unesite 3 da pregledate podsjetnik za datu godinu\\n\"\r\n\t\t\t\t\t\t+ \"Unesite 4 ako zelite da pogledate sve podsjetnike!\\n\"\r\n\t\t\t\t\t\t+ \"Unesite 5 ako zelite da upisete neki podsjetnik!\\n\"\r\n\t\t\t\t\t\t+ \":::::::::::::::::::::::::::::::::::::::::::::::\");\r\n\t}",
"public void precio4e(){\n precioHabitaciones = precioHabitaciones + (cantidadHabitaciones * numeroCamas);\n\n //Restaurante\n if(capacidadRestaurant < 30){\n precioHabitaciones = precioHabitaciones + 10;\n } else if (capacidadRestaurant > 29 && capacidadRestaurant < 51){\n precioHabitaciones = precioHabitaciones + 30;\n } else if (capacidadRestaurant > 50){\n precioHabitaciones = precioHabitaciones + 50;\n }\n\n //Gimnasio\n switch (gimnasio){\n case \"A\":\n precioHabitaciones = precioHabitaciones + 50;\n break;\n case \"B\":\n precioHabitaciones = precioHabitaciones + 30;\n break;\n }\n\n }",
"public String toString (){\r\n \r\n String mensaje=\"El rey color \"+color_rey+\" esta en la fila \"+posicion_rey.fila+\" y columna \"+posicion_rey.columna+\".\";\r\n \r\n return mensaje;\r\n \r\n }",
"public boolean erreurStandard2() {\r\n\t\t\t\r\n\t\t\t//Initialisation du booléen, identification des champs à vérifer \r\n\t\t\tboolean verif = false;\r\n\t\t\tWebElement messageErreur = wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(\"//div[.='Out of range (0 ~ 59).']\")));\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//Vérification\r\n\t\t\tif (messageErreur.isDisplayed()) {\r\n\t\t\t\tverif = true;\r\n\t\t\t}\r\n\t\t\treturn verif;\r\n\t\t}",
"public int precioFinal(){\r\n int monto=super.PrecioFinal();\r\n\t \t \r\n\t if (pulgadas>40){\r\n\t monto+=precioBase*0.3;\r\n\t }\r\n\t if (sintonizador){\r\n\t monto+=50;\r\n\t }\r\n\t \r\n\t return monto;\r\n\t }",
"public String messageRenvoyeeUI (int num){\r\n\t\t\r\n\t\tswitch(num){\r\n\t\t\tcase 5 : return \"-\\n\";\r\n\t\t\t\t\r\n\t\t\tcase 4 : return \"-\\n\";\r\n\t\t\t\r\n\t\t\tcase 3 : return \"-Echec de l'enregistrement des RDV\\n\";\r\n\t\t\t\r\n\t\t\tcase 2 : return \"-Enregistrement des RDV terminé\\n\";\r\n\t\t\t\r\n\t\t\tcase -1 : return \"-Un moniteur doit être selectionné pour le RDV surligné.\\n\";\r\n\t\t\t\r\n\t\t\tcase -2 : return \"-La durée du RDV surligné présente un format invalide pour son enregistrement.\\n\";\r\n\t\t\t\r\n\t\t\tcase -3 : return \"-L'horaire du RDV surligné présente un format invalide pour son enregistrement.\\n\";\r\n\t\t\t\r\n\t\t\tcase -4 : return \"-La date de RDV surligné ne peut pas être antérieur à la date actuelle\\n\";\r\n\t\t\t\r\n\t\t\tcase -5 : return \"-La date de RDV surligné présente un format invalide pour son enregistrement.\";\r\n\t\t\t\r\n\t\t\tcase -6 : return \"-L'horaire du RDV surligné est invalide : les heures sont compris entre \"+AUTO_ECOLE_OUVERTURE+\"h et \"+AUTO_ECOLE_FERMETURE+\"h\\n\";\r\n\t\t\t\r\n\t\t\tcase -7 : return \"-L'horaire du RDV surligné est invalide : les minutes sont compris entre 0 et 59.\\n\";\r\n\t\t\t\r\n\t\t\tcase -8 : return \"-Le RDV surligné est chevauché par un autre RDV.\\n\";\r\n\t\t\t\r\n\t\t\tcase -9 : return \"-\"+msgIntegriteMoniteur+\"\\n\";\r\n\t\t}\r\n\t\t\r\n\t\treturn \"\";\r\n\t\t\r\n\t}",
"@Override\n\tpublic void effetto(Giocatore giocatoreAttuale) {\n\t\tgiocatoreAttuale.vaiInPrigione();\n\t\tSystem.out.println(MESSAGGIO_IN_PRIGIONE);\n\t\t\n\t}",
"void establecerPuntoAM(int pos){\n this.emisoraAMActual = pos;\n }",
"public void trykkPaa() throws TrykketPaaBombe {\n // Ingenting skal skje dersom en av disse er true;\n if (brettTapt || trykketPaa || flagget) {\n return;\n }\n\n // Om ruten er en bombe taper man brettet\n if (bombe) {\n trykketPaa = true;\n setText(\"x\");\n setBackground(new Background(new BackgroundFill(Color.RED, CornerRadii.EMPTY, Insets.EMPTY)));\n throw new TrykketPaaBombe();\n }\n // Om ruten har null naboer skal et stoerre omraade aapnes\n else if (bombeNaboer == 0) {\n Lenkeliste<Rute> besokt = new Lenkeliste<Rute>();\n Lenkeliste<Rute> aapneDisse = new Lenkeliste<Rute>();\n aapneDisse.leggTil(this);\n // Rekursiv metode som fyller aapneDisse med riktige ruter\n finnAapentOmraade(besokt, aapneDisse);\n for (Rute r : aapneDisse) {\n r.aapne();\n }\n } else {\n aapne();\n }\n }",
"public void coMina(){\n espM=true;\r\n }",
"public String getMarca()\n {\n return \"\\nDispositivo Marca \" + Marca; \n }",
"protected int getTreinAantal(){\r\n return treinaantal;\r\n }",
"private String getMessageDaide(){\n\t\tString message;\n\t\tmessage = \"Bonjour et bienvenue dans votre application de Gestion de l'amortissement.\\n\\n\" +\n\t\t\"Pour pouvoir generer un tableau d'amortissement il vous faudra connaitre au\\nminimum \" +\n\t\t\"3 valeurs coherentes les unes avec les autres parmis : \\n\" +\n\t\t\" - le montant emprunte\\n\" +\n\t\t\" - le taux d'emprunt\\n\" +\n\t\t\" - la duree du remboursement\\n\" +\n\t\t\" - l'annuitee maximale\\n\\n\" +\n\t\t\"Cependant, si vous souhaitez generer un tableau a partir de 4 valeurs, \\ncelles-ci devront\" +\n\t\t\" etre strictement exactes, au risque de produire une erreur.\\n\\n\" +\n\t\t\"Veuillez ensuite saisir vos valeurs ainsi que le type de remboursement \\nqui vous \" +\n\t\t\"convient puis cliquez sur valider pour generer le tableau \\nd'amortissement, ainsi que la \" +\n\t\t\"valeur inconnue si vous n'en aviez saisi que 3.\\n\\n\" +\n\t\t\"Vous avez de plus la possibilite d'exporter votre tableau d'amortissement au \\nformat Excel (.xls)\" +\n\t\t\"grace au bouton Export.\";\n\t\treturn message;\n\t}",
"public Boolean gorbiernoConPrestamos() {\n if (super.getMundo().getGobierno().getPrestamos().size() > 0)\n return true;\n return false;\n }",
"public void primerPunto() {\n\t\tp = new PuntoAltaPrecision(this.xCoord, this.yCoord);\n\t\t// Indicamos la trayectoria por la que va la pelota\n\t\tt = new TrayectoriaRecta(1.7f, p, false);\n\t}"
] | [
"0.65371495",
"0.6475377",
"0.6457848",
"0.64351183",
"0.626562",
"0.6184583",
"0.61276275",
"0.61092573",
"0.6080726",
"0.60732496",
"0.6070444",
"0.60675734",
"0.6039763",
"0.60133",
"0.5992836",
"0.59838974",
"0.5972368",
"0.5935238",
"0.593085",
"0.5924399",
"0.591104",
"0.58934045",
"0.587985",
"0.5875813",
"0.5871227",
"0.5862212",
"0.5852412",
"0.5852039",
"0.58507127",
"0.5840129",
"0.5833816",
"0.58215576",
"0.5815792",
"0.5812164",
"0.5808853",
"0.58081794",
"0.5806351",
"0.5803809",
"0.5798871",
"0.5794989",
"0.5785196",
"0.57796085",
"0.57675517",
"0.57643306",
"0.57562655",
"0.57556343",
"0.57521486",
"0.57494295",
"0.5743082",
"0.57277215",
"0.57220703",
"0.57157946",
"0.57081306",
"0.57054234",
"0.570313",
"0.56890446",
"0.5687335",
"0.56839484",
"0.5681118",
"0.56794417",
"0.5678435",
"0.5673255",
"0.56711817",
"0.5666942",
"0.5666059",
"0.5665192",
"0.5663759",
"0.5661977",
"0.56585824",
"0.5657698",
"0.56549096",
"0.56488156",
"0.5648443",
"0.56483394",
"0.56472564",
"0.5646686",
"0.5639725",
"0.56395525",
"0.56372213",
"0.56367475",
"0.5634469",
"0.56341434",
"0.5633886",
"0.5633225",
"0.5632394",
"0.5632333",
"0.5629393",
"0.56259066",
"0.5624626",
"0.5623458",
"0.5619556",
"0.5615432",
"0.56148666",
"0.56116384",
"0.56106204",
"0.56065774",
"0.5604085",
"0.560196",
"0.5600201",
"0.5600084"
] | 0.6459218 | 2 |
Termo de maior Coeficiente | public Termo maiorCoef() {
Termo t = null;
int grauMaxCoef = Integer.MIN_VALUE;
for(int grau : poli.keySet()) {
if( poli.get(grau) > grauMaxCoef ) grauMaxCoef = grau; // clone() no fim
}
return new Termo(grauMaxCoef, poli.get(grauMaxCoef));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getCoeficienteBernua()\n {\n return potenciaCV;\n }",
"@Override\r\n\tpublic float chekearDatos(){\r\n\t\t\r\n\t\tfloat monto = 0f;\r\n\t\tfloat montoPorMes = creditoSolicitado/plazoEnMeses;\r\n\t\tdouble porcentajeDeSusIngesosMensuales = (cliente.getIngresosMensuales()*0.7);\r\n\t\t\r\n\t\tif(cliente.getIngresoAnual()>=15000f && montoPorMes<=porcentajeDeSusIngesosMensuales){\r\n\t\t\t\r\n\t\t\tmonto = this.creditoSolicitado;\r\n\t\t\tsetEstadoDeSolicitud(true);\r\n\t\t}\t\r\n\t\t\r\n\t\t\r\n\t\treturn monto;\r\n\t}",
"@Override\r\n\tpublic double recargoImpuesto() {\n\t\treturn 0.03;\r\n\t}",
"@Override public double getCosto(){\n double d = 190.00;\n return d;\n }",
"public String accionemergencia(){\n\t\tString resp=\"\";\n\t\tif(puntosvida<=5 && acc!=1){\n\t\t\tpuntosvida=puntosvida+15;\n\t\t\tresp=\"\\nAccion de emergencia \"+ tipo +\"activada vida +15\";\n\t\t\tacc=1;\n\t\t}\n\t\treturn resp;\n\t}",
"@Override\n\tpublic double calculaDesconto() {\n\t\treturn this.gastosEmCongressos;\n\t}",
"public float Superficie() {\n\t\t\n\t\tfloat cuadradob = (float) (Math.pow(puntos[3].getX() - puntos[0].getX(), 2) + Math.pow(puntos[3].getY() - puntos[0].getY(), 2));\n\t\tfloat cuadradoa = (float) (Math.pow(puntos[1].getX() - puntos[0].getX(), 2) + Math.pow(puntos[1].getY() - puntos[0].getY(), 2));\n\t\tfloat raizb = (float) Math.sqrt(cuadradob);\n\t\tfloat raiza = (float) Math.sqrt(cuadradoa);\n\t\treturn raiza * raizb;\n\t\t\n\t\t//return (puntos[3].getX() - puntos[0].getX())*(puntos[1].getY() - puntos[0].getY());\n\t}",
"public int getProteksi(){\n\t\treturn (getTotal() - getPromo()) * protectionCost / 100;\n\t}",
"@Override\n\tpublic double CalcularFuel() {\n\t\tdouble consumo=this.getCargaActual()*30+2*numEje;\n\t\treturn consumo;\n\t}",
"public float impuestoAplicado();",
"public void llenarCafetera() {\n\t\tthis.setCantidadActual(this.get_capacidadMaxima());\n\t}",
"@Override\n\t\tpublic void afectarPorSuperficieRocosa(float coeficiente) {\n\t\t}",
"public double calcular_costo() {\n\t\t return 1.3*peso+30 ;\n\t}",
"@Override\r\n\tpublic double porcentajeDelComercio() {\n\t\treturn 0.25;\r\n\t}",
"@Override\n\t\tpublic void afectarPorPantano(double coeficiente) {\n\t\t}",
"public double getCustoAluguel(){\n return 2 * cilindradas;\n }",
"public int precioFinal(){\r\n int monto=super.PrecioFinal();\r\n\t \t \r\n\t if (pulgadas>40){\r\n\t monto+=precioBase*0.3;\r\n\t }\r\n\t if (sintonizador){\r\n\t monto+=50;\r\n\t }\r\n\t \r\n\t return monto;\r\n\t }",
"public void calcular()\r\n/* 530: */ {\r\n/* 531:556 */ this.facturaProveedorSRI.setMontoIva(this.facturaProveedorSRI.getBaseImponibleDiferenteCero().multiply(\r\n/* 532:557 */ ParametrosSistema.getPorcentajeIva().divide(BigDecimal.valueOf(100L))));\r\n/* 533: */ }",
"double objetosc() {\n return dlugosc * wysokosc * szerokosc; //zwraca obliczenie poza metode\r\n }",
"@Override\n\t\tpublic void afectarPorTormentaPsionica(double coeficiente) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void afectarPorTormentaPsionica(double coeficiente) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void afectarPorTormentaPsionica(double coeficiente) {\n\t\t\t\n\t\t}",
"public static float mostrarCredito(){\n JOptionPane.showMessageDialog(null,\"Actualmente hay \"+Monedero.getCredito());\n return Monedero.getCredito();\n }",
"private int cantFantasmasRestantes() {\n // TODO implement here\n return 0;\n }",
"@Override\n\tpublic BigDecimal getCosteEjecucion() {\n\t\treturn model.getCosteEjecucion();\n\t}",
"@Override\n public void subida(){\n // si es mayor a la eperiencia maxima sube de lo contrario no\n if (experiencia>(100*nivel)){\n System.out.println(\"Acabas de subir de nivel\");\n nivel++;\n System.out.println(\"Nievel: \"+nivel);\n }else {\n\n }\n }",
"@Override\r\n\tdouble getBonificacao() {\n\t\treturn 0;\r\n\t}",
"@Override\n public abstract float calculaPreuExcursio(float preuExcursioBase) throws ExcepcioClub;",
"@Override\n\tprotected double calcularImpuestoVehiculo() {\n\t\treturn this.getValor() * 0.003;\n\t}",
"public void faiBagnetto() {\n System.out.println(\"Scrivere 1 per Bagno lungo, al costo di 150 Tam\\nSeleziona 2 per Bagno corto, al costo di 70 Tam\\nSeleziona 3 per Bide', al costo di 40 Tam\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n puntiVita += 50;\n puntiFelicita -= 30;\n soldiTam -= 150;\n }\n case 2 -> {\n puntiVita += 30;\n puntiFelicita -= 15;\n soldiTam -= 70;\n }\n case 3 -> {\n puntiVita += 10;\n puntiFelicita -= 5;\n soldiTam -= 40;\n }\n }\n checkStato();\n }",
"@Override\n\t\tpublic void afectarPorSuperficieNubosa(float coeficiente) {\n\t\t}",
"@Override\n\t\tpublic void afectarPorSuperficieNubosa(float coeficiente) {\n\t\t}",
"@Override\n\t\tpublic void afectarPorSuperficieNubosa(float coeficiente) {\n\t\t}",
"public abstract int calcularOferta();",
"public double promedioAlum(){\n setProm((getC1() + getC2() + getC3() + getC4()) / 4);\n return getProm();\n }",
"public double getFxUfTasaSuciaCosto() {\r\n return fxUfTasaSuciaCosto;\r\n }",
"@Override\r\n public void ingresarCapacidad(){\r\n double capacidad = Math.pow(alto, 3);\r\n int capacidadInt = Double.valueOf(capacidad).intValue();\r\n super.capacidad = capacidadInt;\r\n super.cantidadRestante = capacidadInt;\r\n System.out.println(capacidadInt);\r\n }",
"@Override\r\n\tpublic double getPesoTeorico() {\r\n\r\n\t\treturn anamnese.getAltura() * anamnese.getAltura() * 22.0;\r\n\t}",
"protected Double getCAProfessionnel() {\n List<Facture> facturesProfessionnel = this.factureProfessionnelList;\n Double ca = 0.0; \n for(Facture f : facturesProfessionnel )\n ca = ca + f.getTotalHT();\n \n return ca ; \n \n }",
"public void daiGioco() {\n System.out.println(\"Scrivere 1 per giocare al PC, al costo di 200 Tam\\nSeleziona 2 per a Calcio, al costo di 100 Tam\\nSeleziona 3 per Disegnare, al costo di 50 Tam\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n puntiFelicita += 60;\n puntiVita -= 30;\n soldiTam -= 200;\n }\n case 2 -> {\n puntiFelicita += 40;\n puntiVita -= 20;\n soldiTam -= 100;\n }\n case 3 -> {\n puntiFelicita += 30;\n puntiVita -= 10;\n soldiTam -= 50;\n }\n }\n checkStato();\n }",
"public double getFxUfTasaCosto() {\r\n return fxUfTasaCosto;\r\n }",
"public float getCohesion() {\n\treturn 0;\n }",
"@Override\r\n\tpublic double getTMB() {\r\n\t\tif (isAdultoJovem()) {\r\n\t\t\treturn 15.3 * anamnese.getPesoUsual() + 679;\r\n\t\t}\r\n\t\tif (isAdulto()) {\r\n\t\t\treturn 11.6 * anamnese.getPesoUsual() + 879;\r\n\t\t}\r\n\t\tif (isIdoso()) {\r\n\t\t\treturn 13.5 * anamnese.getPesoUsual() + 487;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}",
"public static void calcularPromedioSemanal() {\n }",
"@Override\n public String getMessage() {\n return super.getMessage() + \" Be Accurate\";\n }",
"@Override\n public void llenardeposito(){\n this.setCombustible(getTankfuel());\n }",
"public double calculoCuotaEspecialOrdinario() {\n\tdouble resultado =0;\n\tresultado = (getMontoCredito()+(getMontoCredito()*getInteres()/100))/getPlazo(); \n\treturn resultado;\n}",
"private double getConcessionFactor() {\n\t\treturn CONCESSIONFACTOR;\n\t}",
"public void distribuirAportes1(){\n\n if(null == comprobanteSeleccionado.getAporteuniversidad()){\n System.out.println(\"comprobanteSeleccionado.getAporteuniversidad() >> NULO\");\n }\n\n if(null == comprobanteSeleccionado.getAporteorganismo()){\n System.out.println(\"comprobanteSeleccionado.getAporteorganismo() >> NULO\");\n }\n\n if(null == comprobanteSeleccionado.getMontoaprobado()){\n System.out.println(\"comprobanteSeleccionado.getMontoaprobado() >> NULO\");\n }\n\n try{\n if(comprobanteSeleccionado.getAporteuniversidad().floatValue() > 0f){\n comprobanteSeleccionado.setAporteorganismo(comprobanteSeleccionado.getMontoaprobado().subtract(comprobanteSeleccionado.getAporteuniversidad()));\n comprobanteSeleccionado.setAportecomitente(BigDecimal.ZERO);\n }\n } catch(NullPointerException npe){\n System.out.println(\"Error de NullPointerException\");\n npe.printStackTrace();\n }\n\n }",
"public float carga(){\n return (this.capacidade/this.tamanho);\n }",
"@Override\n public void cantidad_Ataque(){\n ataque=5+2*nivel+aumentoT;\n }",
"@Override\n public double salario() {\n return 2600 * 1.10;\n }",
"public void CobrarImpuestosReducidos(){\n\t\tif(sueldoBruto>=BASE_MINIMA_IMPUESTOS && sueldoBruto<IMPUESTO_SUP){\n\t\t\tsueldoNeto=sueldoBruto-(sueldoBruto*PAGA_IMPUESTOS_MIN);\n\t\t\ttipoImpuesto=\"Ha pagado el 20% de impuestos\";\n\t\t}\n\t}",
"@Override\r\n\tpublic double getIMC() throws Exception{\r\n\t\tdouble imc = getAnamnese().getPesoUsual()\r\n\t\t/ (anamnese.getAltura() * anamnese.getAltura());\r\n\t\tif(imc <=0 ){\r\n\t\t\tthrow new Exception(\"valor invalido\");\r\n\t\t}\r\n\t\r\n\t\treturn imc;\r\n\t}",
"@Override\n\tpublic double neto() {\n\t\treturn 2000;\n\t}",
"@Override public int conocerMonto(){\n\treturn 120;\n }",
"public double darCosto(){\n return costo;\n }",
"public CouleurFeu suivant() {\r\n // on choisit ici un algo très basique (je l'avais d'abord fait\r\n // en utisant la liste des valeurs, mais ça n'est pas très lisible.\r\n switch (this) {\r\n case VERT:\r\n return ORANGE;\r\n case ORANGE:\r\n return ROUGE;\r\n case ROUGE:\r\n return VERT;\r\n default:\r\n throw new RuntimeException(\"couleur inconnue ?? (impossible normalement)\");\r\n }\r\n }",
"@Override\n\tpublic int getProfit() {\n\t\treturn 0;\n\t}",
"EDataType getSusceptance();",
"public static double calcularCosto(String tipoLicencia, int vigencia) {\n float monto = 0;\n switch(tipoLicencia){\n case \"Clase A\": \n switch(vigencia){\n case 1: monto = 20;\n break;\n case 3: monto = 25;\n break;\n case 4: monto = 30;\n break;\n case 5: monto = 40;\n break;\n }\n break;\n case \"Clase B\": switch(vigencia){\n case 1: monto = 20;\n break;\n case 3: monto = 25;\n break;\n case 4: monto = 30;\n break;\n case 5: monto = 40;\n break;\n }\n break;\n case \"Clase C\": switch(vigencia){\n case 1: monto = 23;\n break;\n case 3: monto = 30;\n break;\n case 4: monto = 35;\n break;\n case 5: monto = 47;\n break;\n }\n break;\n case \"Clase D\": switch(vigencia){\n case 1: monto = 20;\n break;\n case 3: monto = 25;\n break;\n case 4: monto = 30;\n break;\n case 5: monto = 40;\n break;\n }\n break;\n case \"Clase E\": switch(vigencia){\n case 1: monto = 29;\n break;\n case 3: monto = 39;\n break;\n case 4: monto = 44;\n break;\n case 5: monto = 59;\n break;\n }\n break;\n case \"Clase F\": switch(vigencia){\n case 1: monto = 20;\n break;\n case 3: monto = 25;\n break;\n case 4: monto = 30;\n break;\n case 5: monto = 40;\n break;\n }\n break;\n case \"Clase G\": switch(vigencia){\n case 1: monto = 20;\n break;\n case 3: monto = 25;\n break;\n case 4: monto = 30;\n break;\n case 5: monto = 40;\n break;\n }\n break;\n } \n return monto;\n }",
"public void hallarPerimetroEscaleno() {\r\n this.perimetro = this.ladoA+this.ladoB+this.ladoC;\r\n }",
"@Override\n\tpublic double perimetro() {\n\t\treturn 0;\n\t}",
"public void calculateCommission(){\r\n commission = (sales) * 0.15;\r\n //A sales Person makes 15% commission on sales\r\n }",
"@Override\n public double tuition(){\n return 2500;\n }",
"public int promedio() {\r\n // calculo y redondeo del promedio\r\n promedio = Math.round(nota1B+nota2B);\r\n // paso de Double a Int\r\n return (int) promedio;\r\n }",
"public double getPromedio() {\r\n return promedio;\r\n }",
"@Override\n public int getCost() {\n\treturn 0;\n }",
"private void afficheSuiv(){\n\t\ttry{ // Essayer ceci\n\t\t\tif(numCourant <= rep.taille()){\n\t\t\t\tnumCourant ++;\n\t\t\t\tPersonne e = rep.recherchePersonne(numCourant); // Rechercher la personne en fonction du numCourant\n\t\t\t\tafficherPersonne(e);\n\t\t\t}else{\n\t\t\t\tafficherMessageErreur();\n\t\t\t}\n\t\t}catch(Exception e){ // Permet de voir s'il y a cette exception\n\t\t\tafficherMessageErreur();\n\t\t\tnumCourant --;\n\t\t}\n\t}",
"public double dlugoscOkregu() {\n\t\treturn 2 * Math.PI * promien;\n\t}",
"public double getTcCosto() {\r\n return tcCosto;\r\n }",
"public TemperaturaErradaExcepcion(){\r\n super(\"mensaxe por defecto:temperatura ten que ser naior que 80ºC\");//mensaxe por defecto\r\n }",
"@Override\n\tpublic double getBonificacao() {\n\t\treturn 0;\n\t}",
"public void precioFinal(){\r\n if(getConsumoEnergetico() == Letra.A){\r\n precioBase = 100+precioBase;\r\n }\r\n else if((getConsumoEnergetico() == Letra.B)){\r\n precioBase = 80+precioBase;\r\n }\r\n else if(getConsumoEnergetico() == Letra.C){\r\n precioBase = 60+precioBase;\r\n }\r\n else if((getConsumoEnergetico() == Letra.D)){\r\n precioBase = 50+precioBase;\r\n }\r\n else if(getConsumoEnergetico() == Letra.E){\r\n precioBase = 30+precioBase;\r\n }\r\n else if((getConsumoEnergetico() == Letra.F)){\r\n precioBase = 10+precioBase;\r\n }\r\n else{\r\n aux=1;\r\n System.out.println(\"...No existe...\");\r\n }\r\n if (aux==0){\r\n peso();\r\n }\r\n \r\n }",
"float getVacationAccrued();",
"private int obstaculos() {\n\t\treturn this.quadricula.length * this.quadricula[0].length - \n\t\t\t\tthis.ardiveis();\n\t}",
"double getPerimetro(){\n return 2 * 3.14 * raggio;\n }",
"public Coup coupIA() {\n\n int propriete = TypeCoup.CONT.getValue();\n int bloque = Bloque.NONBLOQUE.getValue();\n Term A = intArrayToList(plateau1);\n Term B = intArrayToList(plateau2);\n Term C = intArrayToList(piecesDispos);\n Variable D = new Variable(\"D\");\n Variable E = new Variable(\"E\");\n Variable F = new Variable(\"F\");\n Variable G = new Variable(\"G\");\n Variable H = new Variable(\"H\");\n org.jpl7.Integer I = new org.jpl7.Integer(co.getValue());\n q1 = new Query(\"choixCoupEtJoue\", new Term[] {A, B, C, D, E, F, G, H, I});\n\n\n if (q1.hasSolution()) {\n Map<String, Term> solution = q1.oneSolution();\n int caseJ = solution.get(\"D\").intValue();\n int pion = solution.get(\"E\").intValue();\n Term[] plateau1 = listToTermArray(solution.get(\"F\"));\n Term[] plateau2 = listToTermArray(solution.get(\"G\"));\n Term[] piecesDispos = listToTermArray(solution.get(\"H\"));\n for (int i = 0; i < 16; i++) {\n if (i < 8) {\n this.piecesDispos[i] = piecesDispos[i].intValue();\n }\n this.plateau1[i] = plateau1[i].intValue();\n this.plateau2[i] = plateau2[i].intValue();\n }\n\n int ligne = caseJ / 4;\n int colonne = caseJ % 4;\n\n if (pion == 1 || pion == 5) {\n pion = 1;\n }\n if (pion == 2 || pion == 6) {\n pion = 0;\n }\n if (pion == 3 || pion == 7) {\n pion = 2;\n }\n if (pion == 4 || pion == 8) {\n pion = 3;\n }\n\n\n Term J = intArrayToList(this.plateau1);\n q1 = new Query(\"gagne\", new Term[] {J});\n System.out.println(q1.hasSolution() ? \"Gagné\" : \"\");\n if (q1.hasSolution()) {\n propriete = 1;\n }\n return new Coup(bloque,ligne, colonne, pion, propriete);\n }\n System.out.println(\"Bloqué\");\n return new Coup(1,0, 0, 0, 3);\n }",
"public long getCosto() {\n return costo;\n }",
"public void calcularSalario(){\n // 1% do lucro mensal\n double percentagemLucro = 0.01 * lucroMensal;\n // valor fixo igual ao dobro do dos empregados sem especialização, acrescido\n //de um prémio que corresponde a 1% do lucro mensal nas lojas da região.\n setSalario(1600 + percentagemLucro);\n\n }",
"public void coupCritique(Personnage ennemi, double valeur) throws InterruptedException { // Allows a critical strike\n\t\tint x;\n\t\tx = (int) (Math.random() * 10);\n\t\tif (x <= valeur) { // Proba valeur+1/10\n\t\t\tennemi.setHp(ennemi.getHp() - (this.getStrength()));\n\t\t\tUtilitaire.lettreParLettre(\"Coup critique !!!\");\n\t\t}\n\n\t}",
"public void precio4e(){\n precioHabitaciones = precioHabitaciones + (cantidadHabitaciones * numeroCamas);\n\n //Restaurante\n if(capacidadRestaurant < 30){\n precioHabitaciones = precioHabitaciones + 10;\n } else if (capacidadRestaurant > 29 && capacidadRestaurant < 51){\n precioHabitaciones = precioHabitaciones + 30;\n } else if (capacidadRestaurant > 50){\n precioHabitaciones = precioHabitaciones + 50;\n }\n\n //Gimnasio\n switch (gimnasio){\n case \"A\":\n precioHabitaciones = precioHabitaciones + 50;\n break;\n case \"B\":\n precioHabitaciones = precioHabitaciones + 30;\n break;\n }\n\n }",
"@Override\n public double getHonorario() {\n return super.getHonorario() * 1.05;\n }",
"public Coup coupAJouer();",
"@Override\n\tpublic void acelerar() {\n\t\t// TODO Auto-generated method stub\n\t\t\t\tvelocidadActual += 40;\n\t\t\t\tif(velocidadActual>250) {\n\t\t\t\t\tvelocidadActual = 250;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdepositoActual -= 10;\n\t\t\t\tSystem.out.println(\"Velocidad del ferrari: \"+velocidadActual);\n\t}",
"@Override\n\tpublic void effetto(Giocatore giocatoreAttuale) {\n\t\tgiocatoreAttuale.vaiInPrigione();\n\t\tSystem.out.println(MESSAGGIO_IN_PRIGIONE);\n\t\t\n\t}",
"int getCoorX();",
"public abstract double getComplianceFee();",
"@Override\n public double getCost() {\n\t return 13;\n }",
"public void calculoPersonal(){\n ayudantes = getAyudantesNecesarios();\n responsables = getResponsablesNecesarios();\n \n //Calculo atencion al cliente (30% total trabajadores) y RRPP (10% total trabajadores):\n \n int total = ayudantes + responsables;\n \n atencion_al_cliente = (total * 30) / 100;\n \n RRPP = (total * 10) / 100;\n \n //Creamos los trabajadores\n \n gestor_trabajadores.crearTrabajadores(RRPP, ayudantes,responsables,atencion_al_cliente);\n \n }",
"@Override\n protected String elaboraBody() {\n String text = CostBio.VUOTO;\n int numCognomi = mappaCognomi.size();\n int numVoci = Bio.count();\n int taglioVoci = Pref.getInt(CostBio.TAGLIO_NOMI_ELENCO);\n\n text += A_CAPO;\n text += \"==Cognomi==\";\n text += A_CAPO;\n text += \"Elenco dei \";\n text += LibWiki.setBold(LibNum.format(numCognomi));\n text += \" cognomi '''differenti''' utilizzati nelle \";\n text += LibWiki.setBold(LibNum.format(numVoci));\n text += \" voci biografiche con occorrenze maggiori di \";\n text += LibWiki.setBold(taglioVoci);\n text += A_CAPO;\n text += creaElenco();\n text += A_CAPO;\n\n return text;\n }",
"public java.math.BigInteger getCantidadCUVErrado(){\n return localCantidadCUVErrado;\n }",
"@Override\r\n\tpublic double aumentarSueldo() {\n\t\treturn 0;\r\n\t}",
"public void azzera() { setEnergia(0.0); }",
"@Override\n\tpublic double mencariGajiKotor() {\n\t\treturn super.mencariGajiKotor()+mencariBonus();\n\t}",
"public double getFrecuencia() {\r\n return frecuencia;\r\n }",
"@Override\n\tpublic void concentrarse() {\n\t\tSystem.out.println(\"Se centra en sacar lo mejor del Equipo\");\n\t\t\n\t}",
"private int getQuantiCoperti(int codMenu) {\n /* variabili e costanti locali di lavoro */\n int totCoperti = 0;\n Number numero;\n Modulo modRMT = RMTModulo.get();\n Filtro filtro;\n\n try { // prova ad eseguire il codice\n filtro = FiltroFactory.crea(modRMT.getCampo(RMT.Cam.menu), codMenu);\n numero = modRMT.query().somma(modRMT.getCampo(RMT.Cam.coperti), filtro);\n totCoperti = Libreria.getInt(numero);\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n /* valore di ritorno */\n return totCoperti;\n }",
"public ComponenteCosto getComponenteCosto()\r\n/* 68: */ {\r\n/* 69: 91 */ return this.componenteCosto;\r\n/* 70: */ }",
"public double getClassificacao()\n {\n return this.classificacao;\n }"
] | [
"0.6947841",
"0.6453553",
"0.6427433",
"0.64065456",
"0.63985604",
"0.63787574",
"0.634673",
"0.6328213",
"0.63265437",
"0.6309395",
"0.6246551",
"0.6231024",
"0.6207407",
"0.6204338",
"0.6188178",
"0.6133983",
"0.6119541",
"0.61147654",
"0.6088796",
"0.6088657",
"0.6088657",
"0.6088657",
"0.6064969",
"0.6063767",
"0.60357773",
"0.60317075",
"0.6030637",
"0.6028064",
"0.6021873",
"0.6015462",
"0.6013178",
"0.6013178",
"0.6013178",
"0.60064584",
"0.600526",
"0.6003283",
"0.60017455",
"0.6001051",
"0.5995254",
"0.59858793",
"0.59815437",
"0.5978783",
"0.59745",
"0.5972264",
"0.5971995",
"0.59717524",
"0.59710175",
"0.5966098",
"0.59523237",
"0.5946212",
"0.5939611",
"0.5936611",
"0.5929148",
"0.59278315",
"0.59201837",
"0.5917299",
"0.5913957",
"0.59022105",
"0.58991885",
"0.5895945",
"0.5890976",
"0.5888596",
"0.5883623",
"0.58761173",
"0.5861998",
"0.58611745",
"0.5859656",
"0.5855055",
"0.5844799",
"0.58422536",
"0.5838527",
"0.5837046",
"0.5831918",
"0.5831152",
"0.58290195",
"0.5827675",
"0.58260506",
"0.5824963",
"0.58165324",
"0.58162206",
"0.5815744",
"0.5811636",
"0.580188",
"0.5799569",
"0.57985216",
"0.5798419",
"0.57974786",
"0.5789952",
"0.57857287",
"0.57822454",
"0.57808286",
"0.5776632",
"0.5773367",
"0.5772835",
"0.57717705",
"0.57680607",
"0.5761375",
"0.5756213",
"0.5752436",
"0.5748604"
] | 0.6313358 | 9 |
Elimina Termo de dado grau, caso exista. | public void eliminaTermo(int grau) throws GrauInexistenteExc {
if( !poli.containsKey(grau) )
throw new GrauInexistenteExc();
else
poli.remove(grau);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void eliminarGrado() {\n \tGrado grado = new Grado();\n \tgrado.setIdGrado(17);\n \tString respuesta = negocio.eliminarGrado(\"\", grado);\n \tSystem.out.println(respuesta);\n }",
"public void removerCarro() {\n\n if (carrosCadastrados.size() > 0) {//verifica se existem carros cadastrados\n listarCarros();\n System.out.println(\"Digite o id do carro que deseja excluir\");\n int idCarro = verifica();\n for (int i = 0; i < carrosCadastrados.size(); i++) {\n if (carrosCadastrados.get(i).getId() == idCarro) {\n if (carrosCadastrados.get(i).getEstado()) {//para verificar se o querto está sendo ocupado\n System.err.println(\"O carrp está sendo utilizado por um hospede nesse momento\");\n } else {\n carrosCadastrados.remove(i);\n System.err.println(\"cadastro removido\");\n }\n }\n\n }\n } else {\n System.err.println(\"Não existem carros cadastrados\");\n }\n }",
"public void eliminar(){\n inicio = null;\r\n // Reinicia el contador de tamaño de la lista a 0.\r\n tamanio = 0;\r\n }",
"public void eliminar(DetalleArmado detallearmado);",
"public void elimina(DTOAcreditacionGafetes acreGafete) throws Exception;",
"public void domicilioElimina(){\r\n\t\tlog.info(\"DomicilioElimina()\");\r\n\t\tfor (int i = 0; i < DomicilioPersonaList.size(); i++) { \t\t\r\n\t \tlog.info(\"\"+DomicilioPersonaList.get(i).getItem()+\" ,idd \"+getIdd() +\" \"+DomicilioPersonaList.get(i).getDomicilio());\r\n\r\n\t\tif((DomicilioPersonaList.get(i).getIddomiciliopersona()== 0 || DomicilioPersonaList.get(i).getIddomiciliopersona()== null) && DomicilioPersonaList.get(i).getItem()==\"Por Agregar\"){\r\n\t\t\tlog.info(\"N2----> DomicilioPersonaList.get(i).getIddomiciliopersona()\" +\" \" +DomicilioPersonaList.get(i).getIddomiciliopersona());\r\n\t\t\tDomicilioPersonaSie domtemp = new DomicilioPersonaSie();\r\n\t\t\tdomtemp.setIddomiciliopersona(idd);\r\n\t\t\tDomicilioPersonaList.remove(domtemp);\r\n\t\tfor (int j = i; j < DomicilioPersonaList.size(); j++) {\r\n\t\t\tlog.info(\" i \" +i+\" j \"+ j);\r\n\t\t\ti=i+1;\r\n\t\t\tDomicilioPersonaList.set(j, DomicilioPersonaList.get(j));\r\n\t\t}break;\r\n\t\t}\r\n\t\telse if(DomicilioPersonaList.get(i).getIddomiciliopersona() ==(getIdd()) && DomicilioPersonaList.get(i).getItem()==\"Agregado\"){\r\n\t\t\tlog.info(\"ALERTA WDFFFF\");\r\n\t\t\tDomicilioPersonaSie obj = new DomicilioPersonaSie();\r\n\t\t\tobj.setIddomiciliopersona(idd);\r\n\t\t\tlog.info(\"DENTRO LISTA DESHABILITADO\");\r\n\t\t\tDomicilioPersonaDeshabilitado.add(obj);\t\r\n\t\t\tFaceMessage.FaceMessageError(\"ALERTA\", \"Los Cambios se realizaran despues de hacer clic en el boton Guardar\");\t\t\t\r\n//\t\t\tmsg = new FacesMessage(FacesMessage.SEVERITY_WARN,\r\n//\t\t\tConstants.MESSAGE_ERROR_TELEFONO_CLIENTE,mensaje);\r\n//\t\t\tFacesContext.getCurrentInstance().addMessage(null, msg);\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\r\n\tpublic void eliminar() {\n\t\tLOG.info(\"Se elimino los datos del equipo\");\r\n\t}",
"private static void eliminarJugador() {\n\t\ttry {\n\t\t\tSystem.out.println(jugadores.toString());\n\t\t\tjugadores.borrar(Teclado.leerCadena(\"Nombre:\"));//indica el nombre del jugador que se desea borrar\n\t\t} catch (JugadorNoExisteException | NombreNoValidoException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\n\t}",
"public void eliminar() {\n try {\n Dr_siseg_usuarioBean usuario = new Dr_siseg_usuarioBean();\n FacesContext facesContext = FacesContext.getCurrentInstance();\n usuario = (Dr_siseg_usuarioBean) facesContext.getExternalContext().getSessionMap().get(\"usuario\");\n\n ApelacionesDao apelacionesDao = new ApelacionesDao();\n apelacionesDao.IME_APELACIONES(3, this.Selected);\n\n BitacoraSolicitudDao bitacoraSolicitudDao = new BitacoraSolicitudDao();//INSERTA EL MOVIMIENTO EN LA BITACORA\n BitacoraSolicitudBean bitacoraSolicitudBean = new BitacoraSolicitudBean();\n bitacoraSolicitudBean.setBit_sol_id(this.Selected.getApel_sol_numero());\n bitacoraSolicitudBean.setUsuarioBean(usuario);\n bitacoraSolicitudBean.setBit_tipo_movimiento(\"2\");\n bitacoraSolicitudBean.setBit_detalle(\"Fue eliminada la apelacion\");\n bitacoraSolicitudDao.dmlDr_regt_bitacora_solicitud(bitacoraSolicitudBean);\n\n this.Listar();\n addMessage(\"Eliminado Exitosamente\", 1);\n } catch (ExceptionConnection ex) {\n Logger.getLogger(ApelacionController.class.getName()).log(Level.SEVERE, null, ex);\n addMessage(\"Se produjo un error al eliminar el registro, contacte al administrador del sistema\", 2);\n }\n }",
"public void eliminarcola(){\n Cola_banco actual=new Cola_banco();// se crea un metodo actual para indicar los datos ingresado\r\n actual=primero;//se indica que nuestro dato ingresado va a ser actual\r\n if(primero != null){// se usa una condiccion si nuestro es ingresado es diferente de null\r\n while(actual != null){//se usa el while que recorra la cola indicando que actual es diferente de null\r\n System.out.println(\"\"+actual.nombre);// se imprime un mensaje con los datos ingresado con los datos ingresado desde el teclado\r\n actual=actual.siguiente;// se indica que el dato actual pase a ser igual con el apuntador siguente\r\n }\r\n }else{// se usa la condicion sino se cumple la condicion\r\n System.out.println(\"\\n la cola se encuentra vacia\");// se indica al usuario que la cola esta vacia\r\n }\r\n }",
"@Override\r\n\tpublic void eliminar(Long idRegistro) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void eliminar() {\n\t\tLOG.info(\"Eliminar los datos del equipo\");\r\n\t}",
"private void btnRemoverActionPerformed(java.awt.event.ActionEvent evt) {\n\n if (tblSecoes.getSelectedRow() >= 0){\n\n if (JOptionPane.showConfirmDialog(RootPane, \"Deseja Remover esta Seção?\") == 0){\n Secao secaoselect = (Secao) tblSecoes.getValueAt(tblSecoes.getSelectedRow(), 0);\n\n if (secoes.contains(secaoselect)){\n secoes.remove(secaoselect);\n secoesapagar.add(secaoselect);\n }\n\n JOptionPane.showMessageDialog(RootPane, \"Seção Removida com Sucesso!\");\n adicionasecaotable();\n }\n } else {\n JOptionPane.showMessageDialog(RootPane, \"Selecione uma Seção Por Favor!\");\n }\n }",
"@Override\n public boolean eliminar(T dato) {\n if (esVacio())\n return (false); \n super.setRaiz(buscarAS(dato));\n int cmp = ((Comparable)dato).compareTo(super.getRaiz().getInfo()); \n //Si se encontro el elemento\n if (cmp==0){\n if (super.getRaiz().getIzq()==null){\n super.setRaiz(super.getRaiz().getDer());\n } \n else {\n NodoBin<T> x = super.getRaiz().getDer();\n super.setRaiz(super.getRaiz().getIzq());\n super.setRaiz(biselar(super.getRaiz(), dato));\n super.getRaiz().setDer(x);\n }\n return (true);\n }\n //El dato no fue encontrado\n return (false);\n }",
"@Override\r\n\tpublic void eliminar() {\n\t\ttab_cuenta.eliminar();\r\n\t}",
"public int eliminardelInicio(){\n int elemento = inicio.dato;\n if(inicio == fin){\n inicio=fin=null;\n }else{\n inicio = inicio.sig;\n inicio.ant = null;\n }\n return elemento;\n \n \n }",
"public void eliminarBodegaActual(){\n Nodo_bodega_actual.obtenerAnterior().definirSiguiente(Nodo_bodega_actual.obtenerSiguiente());\n if(Nodo_bodega_actual.obtenerSiguiente() != null){\n Nodo_bodega_actual.obtenerSiguiente().definirAnterior(Nodo_bodega_actual.obtenerAnterior());\n } \n }",
"@Override\n\tpublic boolean eliminaRisposta(Long id) {\n\t\tDB db = getDB();\n\t\tMap<Long, Risposta> risposte = db.getTreeMap(\"risposte\");\n\t\trisposte.remove(id);\n\t\tdb.commit();\n\t\t\n\t\tif(!risposte.containsKey(id))\n\t\t\treturn true;\n\t\telse \n\t\t\treturn false;\n\t}",
"public void eliminarManoObra(ActionEvent actionEvent) {\r\n manoobraDao manobraDao = new manoobraDaoImpl();\r\n String msg;\r\n if (manobraDao.eliminarManoObra(this.manoobra.getCodigoManob())) {\r\n msg = \"Mano de Obra eliminada correctamente\";\r\n FacesMessage message1 = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, null);\r\n FacesContext.getCurrentInstance().addMessage(null, message1);\r\n } else {\r\n msg = \"No se elimino la Mano de Obra\";\r\n FacesMessage message2 = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, null);\r\n FacesContext.getCurrentInstance().addMessage(null, message2);\r\n }\r\n \r\n }",
"public void eliminarMateria() {\n ejbFacade.remove(materia);\n items = ejbFacade.findAll();\n RequestContext requestContext = RequestContext.getCurrentInstance();\n requestContext.update(\"MateriaListForm:datalist\");\n requestContext.execute(\"PF('Confirmacion').hide()\");\n departamento = new Departamento();\n materia = new Materia();\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Información\", \"La materia se eliminó con éxito\");\n FacesContext.getCurrentInstance().addMessage(null, msg);\n\n requestContext.update(\"msg\");//Actualiza la etiqueta growl para que el mensaje pueda ser mostrado\n requestContext.update(\"MateriaListForm\");\n }",
"public void eliminarTipoPago(String codTipoPago) throws Exception {\n if (this.tiposPagos.containsKey(codTipoPago)) {\r\n this.generarAuditoria(\"BAJA\", \"TIPOPAGO\", codTipoPago, \"\", GuiIngresar.getUsuario());\r\n this.tiposPagos.remove(codTipoPago);\r\n setChanged();\r\n notifyObservers();\r\n //retorno = true;\r\n } else {\r\n throw new Exception(\"El tipo pago no Existe\");\r\n }\r\n //return retorno;\r\n }",
"public String eliminar()\r\n/* 121: */ {\r\n/* 122: */ try\r\n/* 123: */ {\r\n/* 124:149 */ this.servicioDimensionContable.eliminar(this.dimensionContable);\r\n/* 125:150 */ addInfoMessage(getLanguageController().getMensaje(\"msg_info_eliminar\"));\r\n/* 126:151 */ cargarDatos();\r\n/* 127: */ }\r\n/* 128: */ catch (Exception e)\r\n/* 129: */ {\r\n/* 130:153 */ addErrorMessage(getLanguageController().getMensaje(\"msg_error_eliminar\"));\r\n/* 131:154 */ LOG.error(\"ERROR AL ELIMINAR DATOS\", e);\r\n/* 132: */ }\r\n/* 133:156 */ return \"\";\r\n/* 134: */ }",
"@Override\n public boolean eliminar(T dato) {\n try {\n this.raiz = eliminar(this.raiz, dato);\n return true;\n } catch (Exception e) {\n return false;\n }\n }",
"private void btnDeleteActionPerformed(java.awt.event.ActionEvent evt) {\n String delete = TabelSiswa.getValueAt(baris, 1).toString();\n try{\n Statement stmt = koneksi.createStatement();\n String query = \"DELETE FROM pasien WHERE nis = '\" + delete + \"'\";\n int berhasil = stmt.executeUpdate(query);\n if(berhasil == 1){\n JOptionPane.showMessageDialog(null, \"Data berhasil dihapus\");\n dtm.getDataVector().removeAllElements();\n showData();\n showStok();\n }else{\n JOptionPane.showMessageDialog(null, \"Data gagal dihapus\");\n }\n }catch(SQLException ex){\n ex.printStackTrace();\n JOptionPane.showMessageDialog(null, \"Terjadi kesalahan\", \"ERROR\", JOptionPane.ERROR_MESSAGE);\n }\n }",
"@Override\n\tpublic MensajeBean elimina(Tramite_informesem nuevo) {\n\t\treturn tramite_informesemDao.elimina(nuevo);\n\t}",
"public void eliminarMarca(String nombreMarca) throws Exception {\n if (this.marcas.containsKey(nombreMarca)) {\r\n this.generarAuditoria(\"BAJA\", \"MARCA\", nombreMarca, \"\", GuiIngresar.getUsuario());\r\n this.marcas.remove(nombreMarca);\r\n setChanged();\r\n notifyObservers();\r\n //retorno = true;\r\n } else {\r\n throw new Exception(\"La marca no Existe\");\r\n }\r\n //return retorno;\r\n }",
"public void eliminarCocheTaller(String matricula) {\n\t\tif (mecanicoController.deleteCocheTaller(matricula)) {\n\t\t\tJOptionPane.showMessageDialog(contentPane, \"El coche ha salido del taller.\");\n\t\t\tlogger.info(\"El coche ha salido del taller.\");\n\t\t} else {\n\t\t\tlogger.error(\"Error al eliminar el CocheTaller\");\n\t\t}\n\t}",
"public void eliminar(Dia dia) {\n Session session = sessionFactory.openSession();\n //la transaccion a relizar\n Transaction tx = null;\n try {\n tx = session.beginTransaction();\n //eliminamos el Dia\n session.delete(dia);\n \n tx.commit();\n }\n catch (Exception e) {\n //Se regresa a un estado consistente \n if (tx!=null){ \n tx.rollback();\n }\n e.printStackTrace(); \n }\n finally {\n //cerramos siempre la sesion\n session.close();\n }\n }",
"public boolean delete (int val) throws DifferentOrderTrees {\r\n \tboolean supprime = false;\r\n \tMonceau monceauTemp = new Monceau();\r\n \t\r\n \t//recherche de la valeur a supprimer\r\n \tfor (int i = 0; i < arbres.size(); i++) {\r\n \t\tif (arbres.get(i).findValue(val) == null)\r\n \t\t\tcontinue;\r\n \t\telse {\r\n \t\t\tmonceauTemp.arbres = arbres.get(i).findValue(val).delete();\r\n \t\t\tarbres.remove(arbres.get(i)); //supprime noeud\r\n \t\t\tthis.fusion(monceauTemp); //fusionne les 2 monceaux\r\n \t\t\ti = (0-1); //on recommence (-1 car on fait i++ apres (boucle for))\r\n \t\t\tsupprime = true;\r\n \t\t}\r\n \t}\r\n \t\r\n return supprime;\r\n }",
"@Override\r\n\tpublic void eliminar() {\n\t\ttab_nivel_funcion_programa.eliminar();\r\n\t\t\r\n\t}",
"public void deleteIscrizione() throws SQLException {\r\n\r\n\t\tPreparedStatement pstmt = null;\r\n\r\n\t\ttry {\r\n\t\t\tpstmt = con.prepareStatement(STATEMENTDEL);\r\n\t\t\t\r\n\t\t\tpstmt.setString(1, i.getGiocatore());\r\n\t\t\tpstmt.setInt(2, i.getTorneo());\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\tpstmt.execute();\r\n\r\n\t\t} finally {\r\n\t\t\tif (pstmt != null) {\r\n\t\t\t\tpstmt.close();\r\n\t\t\t}\r\n\r\n\t\t\tcon.close();\r\n\t\t}\r\n\r\n\t}",
"public void eliminarArticulo(String codBarra) throws Exception {\n if (this.articulos.containsKey(codBarra)) {\r\n this.generarAuditoria(\"BAJA\", \"ARTICULO\", codBarra, \"\", GuiIngresar.getUsuario());\r\n Articulo unArticulo = (Articulo) articulos.get(codBarra);\r\n this.articulos.remove(unArticulo.getCodBarra());\r\n setChanged();\r\n notifyObservers();\r\n //retorno = true;\r\n } else {\r\n throw new Exception(\"El Articulo no Existe\");\r\n }\r\n //return retorno;\r\n }",
"public int eliminardelFinal(){\n int elemento = fin.dato;\n if(inicio == fin){\n inicio=fin=null;\n }else{\n fin = fin.ant;\n fin.sig = null;\n }\n return elemento;\n \n \n }",
"@Override\n\tpublic void eliminar() {\n\t\t\n\t}",
"@Override\n\tpublic void eliminar() {\n\n\t}",
"private void balancearElimina(Vertice<T> v){\n\t//Caso 1 RAIZ\n\tif(v.padre == null){\n\t this.raiz = v;\n\t v.color = Color.NEGRO;\n\t return;\n\t}\n\t//Vertice<T> hermano = getHermano(v);\n\t//Caso 2 HERMANO ROJO\n\tif(getHermano(v).color == Color.ROJO){\n\t v.padre.color = Color.ROJO;\n\t getHermano(v).color = Color.NEGRO;\n\t if(v.padre.izquierdo == v)\n\t\tsuper.giraIzquierda(v.padre);\n\t else\n\t\tsuper.giraDerecha(v.padre);\n\t //Actualizar V\n\t // hermano = getHermano(v);\n\t \n\t}\n\t//Caso 3 TODOS SON NEGROS\n\tif(v.padre.color == Color.NEGRO && existeNegro(getHermano(v)) && existeNegro(getHermano(v).izquierdo) && existeNegro(getHermano(v).derecho)){\n\t getHermano(v).color = Color.ROJO;\n\t //Checar color\n\t //v.color = Color.ROJO; //POR H DE HERMANO 20:00\n\t\tbalancearElimina(v.padre);\n\t\treturn;\n\t}\n\t//Caso 4 HERMANO Y SOBRINOS NEGROS Y PADRE ROJO\n\tif(existeNegro(getHermano(v)) && v.padre.color == Color.ROJO && existeNegro(getHermano(v).izquierdo)\n\t && existeNegro(getHermano(v).derecho)){\n\t v.padre.color = Color.NEGRO;\n\t getHermano(v).color = Color.ROJO;\n\t return;\n\t \n\t}\n\t//Caso 5 HERMANO NEGRO Y SOBRINOS BICOLORES\n\tif(getHermano(v).color == Color.NEGRO && (!(existeNegro(getHermano(v).izquierdo) && existeNegro(getHermano(v).derecho)))){\n\t if(v.padre.derecho == v){\n\t if(!existeNegro(getHermano(v).derecho)){\n\t\t getHermano(v).color = Color.ROJO;\n\t\t getHermano(v).derecho.color = Color.NEGRO;\n\t\t super.giraIzquierda(getHermano(v));\n\t }else{\n\t\t if(!existeNegro(getHermano(v).izquierdo)){\n\t\t getHermano(v).color = Color.ROJO;\n\t\t getHermano(v).izquierdo.color = Color.NEGRO;\t \n\t\t super.giraDerecha(getHermano(v));\n\t\t }\n\t }\n\t }\n\t}\n\t//Caso 6 SOBRINO INVERSO DE V ES ROJO\n\tif(v.padre.izquierdo == v){\n\t if(!existeNegro(getHermano(v).derecho)){\n\t\tgetHermano(v).color = v.padre.color;\n\t\t v.padre.color = Color.NEGRO;\n\t\t getHermano(v).derecho.color = Color.NEGRO;\n\t\t super.giraIzquierda(v.padre);\n\t }\n\t}else{\n\t if(!existeNegro(getHermano(v).izquierdo)){\n\t\tgetHermano(v).color = v.padre.color;\n\t\t v.padre.color = Color.NEGRO;\n\t\t getHermano(v).izquierdo.color = Color.NEGRO;\n\t\t super.giraDerecha(v.padre);\n\t }\n\t}\t\n }",
"@Override\n public boolean excluirRegistro() {\n this.produto.excluir();\n return true;\n }",
"public void excluir(){\n\t\tSystem.out.println(\"\\n*** Excluindo Registro\\n\");\n\t\ttry{\n\t\t\tpacienteService.excluir(getPaciente());\n\t\t\tatualizarTela();\n\t\t\tFacesContext facesContext = FacesContext.getCurrentInstance();\n\t\t\tfacesContext.addMessage(null, new FacesMessage(\"Registro Deletado com Sucesso!!\")); //Mensagem de validacao \n\t\t}catch(Exception e){\n\t\t\tSystem.err.println(\"** Erro ao deletar: \"+e.getMessage());\n\t\t\tatualizarTela();\n\t\t\tFacesContext facesContext = FacesContext.getCurrentInstance();\n\t\t\tfacesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, \"Erro ao deletar o paciente: \"+e.getMessage(), \"\")); //Mensagem de erro \n\t\t\t\n\t\t}\n\t}",
"public boolean eliminar(){\n\t\tString query = \"DELETE FROM Almacen WHERE Id_Producto = \"+this.getId();\n\t\tif(updateQuery(query)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"@Override\n\tpublic void eliminar(Object T) {\n\t\tSeccion seccionE= (Seccion)T;\n\t\tif(seccionE!=null){\n\t\t\ttry{\n\t\t\tString insertTableSQL = \"update seccion set estatus=?\" +\"where codigo=? and estatus='A'\";\n\t\t\tPreparedStatement preparedStatement = conexion.prepareStatement(insertTableSQL);\n\t\t\tpreparedStatement.setString(1, \"I\");\n\t\t\tpreparedStatement.setString(2, seccionE.getCodigo());\n\t\t\tpreparedStatement.executeUpdate();\n\t\t}catch(SQLException e){\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"No se elimino el registro\");\n\t\t}\n\t\tSystem.out.println(\"Eliminacion exitosa\");\n\t}\n\n\t}",
"public String deleteGame(){\t\t\n\t\ttry{\n\t\t\tnew GiocoDao().deleteGame(gioco);\n\t\t\treturn \"Gioco eliminato con successo!\";\n\t\t}\n\t\tcatch(SQLException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"private void eliminar() {\n\n int row = vista.tblClientes.getSelectedRow();\n cvo.setId_cliente(Integer.parseInt(vista.tblClientes.getValueAt(row, 0).toString()));\n int men = JOptionPane.showConfirmDialog(null, \"Estas seguro que deceas eliminar el registro?\", \"pregunta\", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);\n\n if (men == JOptionPane.YES_OPTION) {\n try {\n cdao.eliminar(cvo);\n cvo.setId_cliente(row);\n } catch (Exception e) {\n System.out.println(\"Mensaje eliminar\" + e.getMessage());\n }\n }\n }",
"@Test\n\tpublic void eliminar() {\n\t\tGestionarComicPOJO gestionarComicPOJO = new GestionarComicPOJO();\n\t\tgestionarComicPOJO.agregarComicDTOLista(gestionarComicPOJO.crearComicDTO(\"1\", \"Dragon Ball Yamcha\",\n\t\t\t\t\"Planeta Comic\", TematicaEnum.AVENTURAS.name(), \"Manga Shonen\", 144, new BigDecimal(2100),\n\t\t\t\t\"Dragon Garow Lee\", Boolean.FALSE, LocalDate.now(), EstadoEnum.ACTIVO.name(), 20l));\n\t\tgestionarComicPOJO.agregarComicDTOLista(gestionarComicPOJO.crearComicDTO(\"2\", \"Captain America Corps 1-5 USA\",\n\t\t\t\t\"Panini Comics\", TematicaEnum.FANTASTICO.name(), \"BIBLIOTECA MARVEL\", 128, new BigDecimal(5000),\n\t\t\t\t\"Phillippe Briones, Roger Stern\", Boolean.FALSE, LocalDate.now(), EstadoEnum.ACTIVO.name(), 5l));\n\t\tgestionarComicPOJO.agregarComicDTOLista(gestionarComicPOJO.crearComicDTO(\"3\",\n\t\t\t\t\"The Spectacular Spider-Man v2 USA\", \"Panini Comics\", TematicaEnum.FANTASTICO.name(), \"MARVEL COMICS\",\n\t\t\t\t208, new BigDecimal(6225), \"Straczynski,Deodato Jr.,Barnes,Eaton\", Boolean.TRUE, LocalDate.now(),\n\t\t\t\tEstadoEnum.INACTIVO.name(), 0l));\n\n\t\tint tamañoAnterior = gestionarComicPOJO.getListaComics().size();\n\t\tgestionarComicPOJO.eliminarComicDTO(\"1\");\n\t\tAssert.assertEquals(gestionarComicPOJO.getListaComics().size(), tamañoAnterior - 1);\n\t}",
"@FXML\n\tpublic void handleExcluir(MouseEvent event) {\n\t\tif(colNome.getCellData(jtvIngredienteTable.getSelectionModel().getSelectedIndex()) != null){\n\t\t\tingredienteService = new IngredienteService();\n\t\t\tIngrediente ingrediente = jtvIngredienteTable.getSelectionModel().getSelectedItem();\n\t\t\tingredienteService.delete(ingrediente.getId());\n\t\t\tatualizarTable();\n\t\t}else{\n\t\t\tScreenUtils.janelaInformação(spDialog, Internationalization.getMessage(\"header_erro3\"), Internationalization.getMessage(\"item_nao_selecionado\"), Internationalization.getMessage(\"erro_button2\"));\n//\t\t\tScreenUtils.janelaInformação(spDialog, \"Ops\", \"Por favor, selecione um item.\", \"Sem problemas\");\n\t\t}\n\t}",
"public void carroNoEncontrado(){\n System.out.println(\"Su carro no fue removido porque no fue encontrado en el registro\");\n }",
"public void deleteTbagendamento() {\n\n if (agendamentoLogic.removeTbagendamento(tbagendamentoSelected)) {\n AbstractFacesContextUtils.addMessageInfo(\"Agendamento removido com sucesso.\");\n listTbagendamentos = agendamentoLogic.findAllTbagendamentoFromCurrentDay();\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"Falha ao remover agendamento.\");\n }\n\n }",
"public RespuestaBD eliminarRegistro(int codigoFlujo, int secuencia) {\n/* 296 */ RespuestaBD rta = new RespuestaBD();\n/* */ \n/* */ try {\n/* 299 */ String s = \"delete from wkf_detalle where codigo_flujo=\" + codigoFlujo + \" and secuencia=\" + secuencia + \"\";\n/* */ \n/* */ \n/* */ \n/* */ \n/* 304 */ rta = this.dat.executeUpdate2(s);\n/* */ }\n/* 306 */ catch (Exception e) {\n/* 307 */ e.printStackTrace();\n/* 308 */ Utilidades.writeError(\"FlujoDetalleDAO:eliminarRegistro \", e);\n/* 309 */ rta.setMensaje(e.getMessage());\n/* */ } \n/* 311 */ return rta;\n/* */ }",
"@Override\n\tpublic void eliminar(Seccion seccion) {\n\t\tentity.getTransaction().begin();\n\t\tentity.remove(seccion);\n\t\tentity.getTransaction().commit();\n\t}",
"public void localizarEremoverProdutoCodigo(Prateleira prat){\r\n //instacia um auxiliar para procura\r\n Produto mockup = new Produto();\r\n int Codigo = Integer.parseInt(JOptionPane.showInputDialog(null,\"Forneca o codigo do produto a ser removido\" ));\r\n mockup.setCodigo(Codigo); \r\n \r\n //informa que caso encontre o produto remova o da arraylist\r\n boolean resultado = prat.getPrateleira().remove(mockup);\r\n if(resultado){\r\n JOptionPane.showMessageDialog(null, \"Produto de codigo :\" +Codigo+ \" Removido\");\r\n }\r\n else {\r\n JOptionPane.showMessageDialog(null, \"Produto de codigo :\" +Codigo+ \" não encontrado\");\r\n }\r\n }",
"public void sepulsaeliminar(View view) {\n\t\tif(posicionArrayList !=-1) {\n\t\t\tarrayList.get(posicionArrayList);\n\n\t\t\tfinal DatabaseReference referenciaUseraBorrar=FirebaseDatabase.getInstance().getReference(\"users\").child(arrayList.get(posicionArrayList));\n\n\t\t\treferenciaUseraBorrar.removeValue(); //Elimina el campo del User de la BD\n\t\t\tarrayList.remove(posicionArrayList); //Elimina la posición correspondiente del ArrayList\n\t\t\tarrayAdapter.notifyDataSetChanged(); //Función que actualiza el arrayAdapter y lo dibuja de nuevo.\n\t\t\tToast.makeText(getApplicationContext(),\"Usuario Cuidador eliminado\",Toast.LENGTH_LONG).show();\n\n\t\t}else{\n\t\t\tToast.makeText(getApplicationContext(),\"No se ha seleccionado ningún elemento\",Toast.LENGTH_LONG).show();\n\t\t}\n\t}",
"@Override\r\n\t\t\tpublic void eliminar() {\n\r\n\t\t\t}",
"private void removerFaltas(final String matricula) {\n firebase.child(\"Alunos/\" + matricula + \"/faltas\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n long qtdAtual = (long) dataSnapshot.getValue();\n if (qtdAtual > 0) {\n firebase.child(\"Alunos/\" + matricula + \"/faltas\").setValue(qtdAtual - 1);\n\n if (alunoEncontrado == null) {\n Log log = new Log(matricula, 0);\n log.faltas(\"Remover\");\n } else {\n Log log = new Log(alunoEncontrado, 0);\n log.faltas(\"Remover\");\n }\n Toast.makeText(getContext(), \"Falta removida com sucesso.\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(getContext(), \"Aluno possui 0 faltas.\", Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n }",
"public void borrarTodo(){\n diccionario.clear();\n }",
"public void remove() {\n\n\t\t\tsuprimirNodo(anterior);\n\n\t\t}",
"public void EliminarPrestamo(Integer idPrestamo) {\n this.conexion.ConectarBD();\n String consulta = \"delete from prestamos where IdPrestamo = ?\";\n try {\n this.pstm = this.conexion.getConexion().prepareStatement(consulta);\n //Indicamos los parametros del delete\n this.pstm.setInt(1, idPrestamo);\n //Ejecutamos la consulta\n int res = pstm.executeUpdate();\n } catch (SQLException e) { \n throw new MisException(\"Error al eliminar un Prestamo.\\n\"+e.toString());\n //System.out.println(\"Error al eliminar un Libro.\");\n } catch (Exception e) {\n throw new MisException(\"Error.\\n\"+e.toString());\n //e.printStackTrace();\n }\n \n //Desconectamos de la BD\n this.conexion.DesconectarBD();\n }",
"@Override\r\n\tpublic MensajeBean elimina(Tramite_presentan_info_impacto nuevo) {\n\t\treturn tramite.elimina(nuevo);\r\n\t}",
"@Override\n\t\tpublic void eliminar() {\n\t\t\tutilitario.getTablaisFocus().eliminar();\n\t\t}",
"public void eliminar(ListaConArreglo nodosMaquina){\n\t\tmodAdmin.eliminar( nodosMaquina);\n\t\tif(!ModAdmin.existe){\n\t\t\tSystem.err.println(\"El dominio indicado no existe en la base\");\n\t\t}\n\t\tModAdmin.existe=false;\n\t}",
"public void eliminarVenta(int codVenta) throws Exception {\n if (this.ventas.containsKey(codVenta)) {\r\n this.ventas.remove(codVenta);\r\n setChanged();\r\n notifyObservers();\r\n //retorno = true;\r\n } else {\r\n throw new Exception(\"La Venta no Existe\");\r\n }\r\n //return retorno;\r\n }",
"public void eliminar(TipoDocumento tpDocu) {\n try {\n boolean verificarReLaboraldEnTpDocu = servReLaboral.buscarRegistroPorTpDocumento(tpDocu);\n if (verificarReLaboraldEnTpDocu) {\n MensajesFaces.informacion(\"No se puede eliminar\", \"Existen Datos Relacionados\");\n } else {\n servtpDocumento.eliminarTipoDocumento(tpDocu);\n tipoDocumento = new TipoDocumento();\n MensajesFaces.informacion(\"Eliminado\", \"Exitoso\");\n }\n } catch (Exception e) {\n MensajesFaces.advertencia(\"Error al eliminar\", \"detalle\" + e);\n }\n }",
"@Override\n\tpublic boolean eliminar(Long id) {\n\t\treturn false;\n\t}",
"public String eliminarDetalle()\r\n/* 340: */ {\r\n/* 341:400 */ this.cuentaContableDimensionContable = ((CuentaContableDimensionContable)this.dtCuentaContable.getRowData());\r\n/* 342:401 */ this.cuentaContableDimensionContable.setEliminado(true);\r\n/* 343:402 */ return \"\";\r\n/* 344: */ }",
"public void eliminar() {\n try {\n userFound = clientefacadelocal.find(this.idcliente);\n if (userFound != null) {\n clientefacadelocal.remove(userFound);\n FacesContext fc = FacesContext.getCurrentInstance();\n fc.getExternalContext().redirect(\"../index.xhtml\");\n System.out.println(\"Usuario Eliminado\");\n } else {\n System.out.println(\"Usuario No Encontrado\");\n }\n } catch (Exception e) {\n System.out.println(\"Error al eliminar el cliente \" + e);\n }\n }",
"public void eliminar(Provincia provincia) throws BusinessErrorHelper;",
"public static void delete(String titulo) {\n\t\tif (pelisList.containsKey(titulo)) {\n\t\t\tSystem.out.println(\"Haz borrado \" + pelisList.remove(titulo) + \" de la cartelera\");\n\t\t} else {\n\t\t\tSystem.out.println(\"El título de esa película no está registrado\\nNo se ha realizado ninguna modificación\");\n\t\t}\n\t\twriteTxt(\"peliculas.txt\", pelisList);\n\t}",
"private void excluirAction() {\r\n Integer i = daoPedido.excluir(this.pedidoVO);\r\n\r\n if (i != null && i > 0) {\r\n msg = activity.getString(R.string.SUCCESS_excluido, pedidoVO.toString());\r\n Toast.makeText(activity, msg + \"(\" + i + \")\", Toast.LENGTH_SHORT).show();\r\n Log.i(\"DB_INFO\", \"Sucesso ao Alterar: \" + this.pedidoVO.toString());\r\n\r\n// this.adapter.remove(this.pedidoVO);\r\n this.refreshData(2);\r\n } else {\r\n msg = activity.getString(R.string.ERROR_excluir, pedidoVO.toString());\r\n Toast.makeText(activity, msg, Toast.LENGTH_SHORT).show();\r\n Log.e(\"DB_INFO\", \"Erro ao Excluir: \" + this.pedidoVO.toString());\r\n }\r\n }",
"public boolean excluir(GrauParentesco grauParentesco) throws Exception;",
"public void processEliminar() {\n }",
"public void eliminar(){\n conexion = base.GetConnection();\n try{\n PreparedStatement borrar = conexion.prepareStatement(\"DELETE from usuarios where Cedula='\"+this.Cedula+\"'\" );\n \n borrar.executeUpdate();\n // JOptionPane.showMessageDialog(null,\"borrado\");\n }catch(SQLException ex){\n System.err.println(\"Ocurrió un error al borrar: \"+ex.getMessage());\n \n }\n }",
"@Override\n\tpublic void checkBotonEliminar() {\n\n\t}",
"@Override\n\tpublic void delete(CorsoDiLaurea corso) {\n\t\t\n\t}",
"void remover(Professor p)throws ProfessorNExisteException;",
"public boolean deletePalvelupisteet();",
"@Override\n public void elimina(int id_alumno) {\n\n try {\n Alumno a = admin.alumnosTotales.get(id_alumno);\n int area = a.area;\n char grupo = a.grupo;\n\n admin.fisicoMatematicas.remove(a);\n admin.biologicasYsalud.remove(a);\n admin.cienciasSociales.remove(a);\n admin.humanidadesYartes.remove(a);\n admin.fotoLabPrensa.remove(a);\n admin.viajesyhoteleria.remove(a);\n admin.nutriologo.remove(a);\n admin.labQuimico.remove(a);\n\n Iterador<Profesor> ite = new Iterador<>(admin.profesores);\n\n while (ite.hasNext()) {\n Profesor profeActual = ite.next();\n if (profeActual.area == area & profeActual.grupo == grupo) {\n profeActual.eliminaAlumnoLista(a);\n }\n }\n \n admin.alumnosTotales.remove(id_alumno);\n \n } catch (NullPointerException e) {\n System.out.println(\"No existe el Alumno\");\n }\n \n \n\n }",
"private void eliminarDeMisPropiedades(Casilla casilla){\n if(esDeMipropiedad(casilla)){\n propiedades.remove(casilla.getTituloPropiedad());\n }\n \n }",
"public void removeEmpleado(){\n //preguntar al empleado si realmente eliminar o no al objeto empleado\n this.mFrmMantenerEmpleado.messageBox(Constant.APP_NAME, \"<html>\"\n + \"¿Deseas remover el empleado del sistema?<br> \"\n + \"<b>OJO: EL EMPLEADO SERÁ ELIMINADO PERMANENTEMENTE.</b> \"\n + \"</html>\",\n new Callback<Boolean>(){\n @Override\n public void execute(Boolean[] answer) {\n //si la respuesta fue YES=true, remover al empleado y limpiar el formulario\n if(answer[0]){\n mEmpleado.remove();\n clear();\n }\n //si la respuesta es NO=false, no hacer nada\n }\n }\n );\n \n }",
"public boolean remove(int idVoto ) { \n\t\ttry {\n\t\t\t//Voto voto = find(idVoto);\n\t\t\t//System.out.println(\"voto encontrado\"+voto);\n\t\treturn em.createNativeQuery(\"DELETE FROM tie_voto where car_numero = \"+idVoto).executeUpdate() != 0;\n\t\t\t \n\t\t \n\t\t}catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}",
"@Override\n\tpublic void quitar(Alumno alumno) {\n\t\tcomision.remove(alumno);\n\t}",
"@Override\n\tpublic void eliminar(Integer id) {\n\t\t\n\t}",
"@Override\n\tpublic void eliminar(Integer id) {\n\t\t\n\t}",
"public int eliminarJugador(String nombreJugador) {\n\n Log.d(\"DATABASE\", \"Eliminando Partida\");\n\n return getWritableDatabase().delete(\n JugadorEntry.TABLE_NAME,\n JugadorEntry.NOMBRE + \" LIKE ?\",\n new String[]{nombreJugador});\n }",
"private void borrarPieza(PosicionAjedrez pos){\n\t\tint fila= transformar(pos).getFila();\n\t\tint col= transformar(pos).getColumna();\n\n\t\tthis.getChildren().remove(tablero[col][fila]);\n\t\ttablero[col][fila]=new Canvas(CASILLERO_ANCHO,CASILLERO_ALTO);\n\t\ttablero[col][fila].setTranslateX(CASILLERO_ANCHO*col);\n\t\ttablero[col][fila].setTranslateY(CASILLERO_ALTO*fila);\n\n\t\tthis.getChildren().add(tablero[col][fila]);\n\t}",
"private static void removerProduto() throws Exception {\r\n int id;\r\n boolean erro, result;\r\n System.out.println(\"\\t** Remover produto **\\n\");\r\n System.out.print(\"ID do produto a ser removido: \");\r\n id = read.nextInt();\r\n if (indice_Produto_Cliente.lista(id).length != 0) {\r\n System.out.println(\"Esse produto não pode ser removido pois foi comprado por algum Cliente!\");\r\n } else {\r\n do {\r\n erro = false;\r\n System.out.println(\"\\nRemover produto?\");\r\n System.out.print(\"1 - SIM\\n2 - NÂO\\nR: \");\r\n switch (read.nextByte()) {\r\n case 1:\r\n result = arqProdutos.remover(id - 1);\r\n if (result) {\r\n System.out.println(\"Removido com sucesso!\");\r\n } else {\r\n System.out.println(\"Produto não encontrado!\");\r\n }\r\n break;\r\n case 2:\r\n System.out.println(\"\\nOperação Cancelada!\");\r\n break;\r\n default:\r\n System.out.println(\"\\nOpção Inválida!\\n\");\r\n erro = true;\r\n break;\r\n }\r\n } while (erro);\r\n }\r\n }",
"public void eliminaEdificio() {\n this.edificio = null;\n // Fijo el tipo después de eliminar el personaje\n this.setTipo();\n }",
"public void eliminarDatos(EstructuraContratosDatDTO estructuraNominaSelect) {\n\t\t\n\t}",
"public void eliminar() throws RollbackException, SystemException, HeuristicRollbackException, HeuristicMixedException {\n Session session = HibernateUtil.getSessionFactory().openSession();\n Transaction tx = null;\n String id = FacesUtil.getRequestParameter(\"idObj\");\n Tblobjeto o = (Tblobjeto) session.load(Tblobjeto.class, Short.parseShort(id));\n try {\n tx = (Transaction) session.beginTransaction();\n session.delete(o);\n tx.commit();\n FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, \"Informacion:\", \"Registro eliminado satisfactoriamente\"));\n } catch (HibernateException e) {\n tx.rollback();\n\n FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, \"Un error ha ocurrido:\", e.getCause().getMessage()));\n } finally {\n session.close();\n populateTreeTable();\n UsuarioBean u = (UsuarioBean) FacesUtil.getBean(\"usuarioBean\");\n u.populateSubMenu();\n }\n }",
"@Override\n\tpublic boolean delete(Eleve o) {\n\t\tmap.remove(o.getId(), o);\n\t\treturn true;\n\t}",
"public void deleteAnio()\r\n {\r\n this._has_anio= false;\r\n }",
"private void removerPontos(final String matricula, final int pontos) {\n firebase.child(\"Alunos/\" + matricula + \"/pontuacao\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n long qtdAtual = (long) dataSnapshot.getValue();\n if (qtdAtual >= pontos) {\n firebase.child(\"Alunos/\" + matricula + \"/pontuacao\").setValue(qtdAtual - pontos);\n Toast.makeText(getContext(), \"Pontuação removida com sucesso.\", Toast.LENGTH_SHORT).show();\n quantidade.setText(\"\");\n\n if (alunoEncontrado == null) {\n Log log = new Log(matricula, pontos);\n log.pontos(\"Remover\");\n } else {\n Log log = new Log(alunoEncontrado, pontos);\n log.pontos(\"Remover\");\n }\n } else {\n Toast.makeText(getContext(), \"Aluno com menor quantidade de pontos que o solicitado.\", Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n }",
"public String eliminar()\r\n/* 88: */ {\r\n/* 89: */ try\r\n/* 90: */ {\r\n/* 91:101 */ this.servicioMotivoLlamadoAtencion.eliminar(this.motivoLlamadoAtencion);\r\n/* 92:102 */ addInfoMessage(getLanguageController().getMensaje(\"msg_info_eliminar\"));\r\n/* 93: */ }\r\n/* 94: */ catch (Exception e)\r\n/* 95: */ {\r\n/* 96:104 */ addErrorMessage(getLanguageController().getMensaje(\"msg_error_eliminar\"));\r\n/* 97:105 */ LOG.error(\"ERROR AL ELIMINAR DATOS\", e);\r\n/* 98: */ }\r\n/* 99:107 */ return \"\";\r\n/* 100: */ }",
"@Override\r\n\tpublic void deleteSoruDogruYanlis(int soruBankasiNo, String soruMetni) {\n\t\tSoruBankasi sb = soruBankasiList.get(soruBankasiNo - 1);\r\n\t\tList<SoruTipiDogruYanlis> addNewList = sb.getDogruYanlislist1();\r\n\t\tboolean isFound = false;\r\n\t\tint soruNo = -1;\r\n\t\tfor (SoruTipiDogruYanlis d : addNewList) {\r\n\t\t\tisFound = d.getSoruMetni().toString().contains(soruMetni);\r\n\t\t\tif (isFound) {\r\n\t\t\t\tsoruNo = d.getSoruNo();\r\n\t\t\t}\r\n\t\t}\r\n\t\taddNewList.remove(soruNo - 1);\r\n\t\tsb.setDogruYanlislist1(addNewList);\r\n\r\n\t}",
"public void vaciarCarrito() {\r\n String sentSQL = \"DELETE from carrito\";\r\n try {\r\n Statement st = conexion.createStatement();\r\n st.executeUpdate(sentSQL);\r\n st.close();\r\n LOG.log(Level.INFO,\"Carrito vaciado\");\r\n } catch (SQLException e) {\r\n // TODO Auto-generated catch block\r\n \tLOG.log(Level.WARNING,e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }",
"@Override\r\n\tpublic boolean delete(Pilote obj) {\r\n\t\tboolean succes=true;\r\n\t\tString req = \"delete from \" + TABLE + \" where numPil= ?\" + \";\";\r\n\t\tPreparedStatement pst;\r\n\t\ttry {\r\n\t\t\tpst = Connexion.getInstance().prepareStatement(req);\r\n\t\t\tpst.setInt(1, obj.getNumPil());\r\n\t\t\tpst.executeUpdate();\r\n\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\tsucces=false;\r\n\t\t\tSystem.out.println(\"Echec de la tentative delete pilote : \" + e.getMessage()) ;\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn succes;\r\n\t}",
"public void EliminarElmento(int el) throws Exception{\n if (!estVacia()) {\n if (inicio == fin && el == inicio.GetDato()) {\n inicio = fin = null;\n } else if (el == inicio.GetDato()) {\n inicio = inicio.GetSiguiente();\n } else {\n NodoDoble ante, temporal;\n ante = inicio;\n temporal = inicio.GetSiguiente();\n while (temporal != null && temporal.GetDato() != el) {\n ante = ante.GetSiguiente();\n temporal = temporal.GetSiguiente();\n }\n if (temporal != null) {\n ante.SetSiguiente(temporal.GetSiguiente());\n if (temporal == fin) {\n fin = ante;\n }\n }\n }\n }else{\n throw new Exception(\"No existen datos por borrar!!!\");\n }\n }",
"public boolean eliminarRegistro(int codigoCiclo, int codigoPlan, int codigoMeta) {\n/* */ try {\n/* 484 */ String s = \"delete from cal_plan_metas\";\n/* 485 */ s = s + \" where codigo_ciclo=\" + codigoCiclo;\n/* 486 */ s = s + \" and codigo_plan=\" + codigoPlan;\n/* 487 */ s = s + \" codigo_meta=\" + codigoMeta;\n/* 488 */ return this.dat.executeUpdate(s);\n/* */ \n/* */ }\n/* 491 */ catch (Exception e) {\n/* 492 */ e.printStackTrace();\n/* 493 */ Utilidades.writeError(\"CalPlanMetasFactory:eliminarRegistro\", e);\n/* */ \n/* 495 */ return false;\n/* */ } \n/* */ }",
"@Override\n public int delete( J34SiscomexMercadoriaAdi j34SiscomexMercadoriaAdi ) {\n return super.doDelete(j34SiscomexMercadoriaAdi);\n }",
"public void eliminarMensaje(InfoMensaje m) throws Exception;",
"void eliminar(Long id);",
"public void eliminar(Long id) throws AppException;",
"public boolean MasaSil(int masa_no) throws SQLException {\n baglanti vb = new baglanti();\r\n\r\n try {\r\n vb.baglan();\r\n } catch (Exception e) {\r\n System.out.println(\"Bağlantı sağlanamadı\" + e);\r\n }\r\n try {\r\n String sorgu3 = \"DELETE m,i FROM masalar m LEFT JOIN ilisk_masa i ON m.masa_no=i.masa_no WHERE m.masa_no=\" + masa_no + \"\";\r\n\r\n ps = vb.con.prepareStatement(sorgu3);\r\n ps.executeUpdate();\r\n\r\n return true;\r\n } catch (Exception e) {\r\n System.out.println(e);\r\n return false;\r\n }\r\n finally{\r\n vb.con.close();\r\n }\r\n }"
] | [
"0.70894843",
"0.7045725",
"0.68565995",
"0.67607033",
"0.67378056",
"0.6719651",
"0.67149955",
"0.6686477",
"0.6630952",
"0.6629251",
"0.6604856",
"0.6543361",
"0.65427524",
"0.65229255",
"0.65166605",
"0.6506964",
"0.6506682",
"0.64999425",
"0.64883536",
"0.64704406",
"0.64676505",
"0.64277875",
"0.6425378",
"0.6411919",
"0.6400185",
"0.63906646",
"0.63902146",
"0.63818794",
"0.63647056",
"0.6363234",
"0.63624597",
"0.63471544",
"0.63354456",
"0.6330026",
"0.6310006",
"0.6307237",
"0.6292268",
"0.6281597",
"0.6281517",
"0.6274507",
"0.627336",
"0.625785",
"0.62515277",
"0.6246871",
"0.624637",
"0.62339306",
"0.62317634",
"0.62297434",
"0.62249297",
"0.62231505",
"0.6219394",
"0.6217896",
"0.62126505",
"0.62030345",
"0.6201163",
"0.61898065",
"0.61841935",
"0.61790735",
"0.6166527",
"0.6161377",
"0.61543155",
"0.61539227",
"0.6153124",
"0.6145767",
"0.6136339",
"0.6135003",
"0.61293465",
"0.61284775",
"0.612696",
"0.6121926",
"0.61208844",
"0.61205333",
"0.6109279",
"0.6107311",
"0.6106685",
"0.6094987",
"0.60891736",
"0.60870755",
"0.6085997",
"0.6085997",
"0.6067663",
"0.6053616",
"0.60509443",
"0.60452086",
"0.6042798",
"0.6037938",
"0.6034676",
"0.6034454",
"0.60332775",
"0.60328066",
"0.60288906",
"0.60269094",
"0.60227495",
"0.60201854",
"0.6019946",
"0.6016816",
"0.6015601",
"0.6007802",
"0.60064703",
"0.6004749"
] | 0.72101045 | 0 |
Removes town from the map. | public void removeTownFromWorldMap(String town) {
map.get(town).forEach((direction, townInDirection) -> {
map.get(townInDirection).remove(directionsInverter.get(direction));
});
map.remove(town);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeTile(){\n\t\toccupied = false;\n\t\tcurrentTile = null;\n\t}",
"public void remove(){\n Api.worldRemover(getWorld().getWorldFolder());\n }",
"public void removeFromWorld(World world);",
"public void removeWorld(String name){\n worlds.remove(getWorld(name));\n }",
"public void removePlace(String key)\n {\n if(placesMarkers.containsKey(key))\n {\n placesMarkers.get(key).remove();\n placesMarkers.remove(key);\n\n }\n }",
"void unsetRoadTerrain();",
"public void removePlace(Place place){\n places.remove(place);\n }",
"@Override\r\n\tpublic void perform() {\n\t\tview.removeMapMonster(toremove);\r\n\t}",
"public static void removeTower(Tower t)\n\t{\n\t\ttowers.remove(t);\n\t}",
"public abstract void removeFromMap();",
"public void removeTile(Tile tile) {\n ownedTiles.remove(tile);\n }",
"public void clear() {\n map.clear();\n }",
"public void unsetBirthplace()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(BIRTHPLACE$24, 0);\n }\n }",
"public void\tclear() {\n\t\tmap.clear();\n\t}",
"public void clear() {\n map.clear();\n }",
"public void removeAllAgents(String layer)\n/* 180: */ {\n/* 181:254 */ this.mapPanel.removeAllAgents(layer);\n/* 182: */ }",
"public final void clear() { _map.clear(); }",
"public void removeMaps(GridMap map){\n mapsList.remove(map);\n //Observer pattern\n setChanged();\n notifyObservers(this);\n }",
"void removeTiles(Map<Location, SurfaceEntity> map, int x, int y, int width, int height) {\r\n\t\tfor (int i = x; i < x + width; i++) {\r\n\t\t\tfor (int j = y; j > y - height; j--) {\r\n\t\t\t\tmap.remove(Location.of(x, y));\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void clear() {\r\n this.map.clear();\r\n }",
"public void clearMap() {\n\t\tfor (int i = 0; i < parkingsArray.size(); i++)\n\t\t\tparkingsArray.valueAt(i).removeMarker();\n\t\tparkingsArray.clear();\n\t\tmap.clear();\n\t}",
"public void clear() { \r\n\t\tmap.clear();\r\n\t}",
"public void remove(Station station)\n {\n world.removeActor(station.getId());\n\n for (int i = 0; i < stations.length; ++i)\n {\n if (station == stations[i])\n {\n stations[i] = null;\n break;\n }\n }\n }",
"public static void clearWorld() {\n\t\tpopulation.clear();\n\t}",
"public void clear() {\n\t\tmap.clear();\n\t}",
"private void removeAt(Coord c) {\n\t\tElement e = getAt(c);\n\t\tif(e != null) {\n\t\t\tlistLiving.remove(e);\n\t\t}\n\t\tmapContains.put(c, null);\n\t}",
"public void removePlaces(){\n List<Place> copies = new ArrayList<>(places);\n for(Place p : copies){\n p.reset();\n }\n }",
"public void clear()\n {\n getMap().clear();\n }",
"private void removeTerritoriesOfPlayerFromSpecificTime(Player player,RoundHistory roundHistory) {\n List<Integer> mapsToClear = player.getTerritoriesID();\n while(!mapsToClear.isEmpty()){\n Integer territoryID = mapsToClear.get(0);\n getTerritoryFromSpecificTime(roundHistory,territoryID).eliminateThisWeakArmy();\n mapsToClear.remove(0);\n }\n }",
"private void discardPlayer(Player p)\n {\n locations.remove(p);\n plugin.getAM().arenaMap.remove(p);\n clearPlayer(p);\n }",
"public static void clearWorld() {\n\t\t// Complete this method.\n\t\tfor(Critter i: population){\n\t\t\tpopulation.remove(i);\n\t\t}\n\t\tfor(Critter j: babies){\n\t\t\tbabies.remove(j);\n\t\t}\n\t\tpopulation.clear();\n\t\tbabies.clear();\n\n\n\t}",
"static void wipeLocations(){\n\t \tfor (int i= 0; i < places.length; i++){\n\t\t\t\tfor (int j = 0; j < places[i].items.size(); j++)\n\t\t\t\t\tplaces[i].items.clear();\n\t\t\t\tfor (int k = 0; k < places[i].receptacle.size(); k++)\n\t\t\t\t\tplaces[i].receptacle.clear();\n\t \t}\n\t \tContainer.emptyContainer();\n\t }",
"@Override\r\n public void clear() {\r\n map.clear();\r\n }",
"public void deleteMap(String s){\n GridMap target=null;\n for(GridMap gm:mapsList){\n if(gm.getMapName().equals(s))\n target=gm;\n }\n removeMaps(target);\n }",
"public void removeAllAgents()\n/* 76: */ {\n/* 77:125 */ this.mapPanel.removeAllAgents();\n/* 78: */ }",
"private void removeCityFromTableEdges(ArrayList<HashMap<Integer,Integer>> table, int index){\n for(int i = 0; i < table.size(); i++){\n if(table.get(i).containsKey(index)){\n table.get(i).remove(index);\n }\n }\n\n return;\n }",
"public void removeAgent(String layer, Agent a)\n/* 175: */ {\n/* 176:247 */ this.mapPanel.removeAgent(layer, a);\n/* 177: */ }",
"public void removeTile(Tile tile) {\r\n frame.remove(tile);\r\n }",
"public static void clearWorld() {\r\n \tbabies.clear();\r\n \tpopulation.clear();\r\n }",
"private void removeArea() {\n \t\tthis.set.remove( this.area );\n \t\tthis.finish();\n \t}",
"void removeRegion(Region region);",
"public final void removeUnit(final Unit unit) {\n\t for (Vector<Tile> row : mLayout) {\n\t for (Tile tile : row) {\n\t if (tile.hasOccupant() && (tile.getOccupant() == unit)) {\n\t tile.setOccupant(null);\n\t }\n\t }\n\t }\n\t}",
"public void clearTerrain(){\n for (Terrain[] terrains : getTerrains()) {\n for (Terrain terrain : terrains) {\n terrain.setCharacter(null); //Clear terrain of fake characters\n }\n }\n }",
"private void removeLocation() {\n try {\n this.location_view.setVisibility(View.GONE);\n this.current_location.setVisibility(View.GONE);\n this.drop_location.setVisibility(View.GONE);\n this.mPostModel.setLocationPost(\"\");\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }",
"@Override\n\tpublic synchronized Place removePlace(Place place) {\n\t\tthis.removeSurroundingEdges(place);\n\t\treturn this.removeNodeFromCollection(this.places, place);\n\t}",
"public abstract void removeLocation(Location location);",
"void unsetRegisteredOfficeCity();",
"public void removeUnvisitedPOI(PlaceOfInterest placeOfInterest) {\n unvisitedPOIs.remove(placeOfInterest);\n }",
"public void removeMarkerFromMap(Marker marker){\n marker.remove();\n removeMarkerFromPref(marker);\n }",
"public void removeState(State state) {\n states.remove(state);\n state.setCountry(null);\n }",
"public void removePlayer(int place) {\r\n\t\tplayers.remove(place);\r\n\t}",
"public void remove(Object key){\n map.remove(key);\n }",
"public static void worldLocsRemove(UUID uuid) {\n\n\t\ttry {\n\n\t\t\tStatement st = conn.createStatement();\n\n\t\t\tst.executeUpdate(\"DELETE FROM worldlocs WHERE uuid='\" + uuid + \"';\");\n\n\t\t} catch (Exception e) {\n\t\t\tPvPTeleport.instance.getLogger().info(e.getMessage());\n\t\t}\n\n\t}",
"public boolean removeBoardTile(Tile t) {\n\t\tSet<Entry<Point, Tile>> entrySet = boardTiles.entrySet();\n\t\tfor (Iterator<Entry<Point, Tile>> iterator = entrySet.iterator(); iterator.hasNext();) {\n\t\t\tEntry<Point, Tile> entry = iterator.next();\n\t\t\tif (entry.getValue() != null) {\n\t\t\t\tif (entry.getValue().equals(t)) {\n\t\t\t\t\tentry.setValue(null);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n }",
"@Test\n public void mapRemove() {\n check(MAPREM);\n query(MAPSIZE.args(MAPREM.args(MAPENTRY.args(1, 2), 1)), 0);\n }",
"public void removeNode(N node)\r\n/* 71: */ {\r\n/* 72:135 */ assert (checkRep());\r\n/* 73:137 */ for (N endNode : getSuccessors(node)) {\r\n/* 74:138 */ ((Map)this.map.get(endNode)).remove(node);\r\n/* 75: */ }\r\n/* 76:140 */ this.map.remove(node);\r\n/* 77: */ }",
"public void removeTomb(String player) {\r\n\t\ttombs.remove(player);\r\n\t}",
"private void cleanUpAfterMove(Unit unit){\n\t\t\t//add current location\n\t\t\tpastLocations.add(unit.location().mapLocation());\n\t\t\t//get rid of oldest to maintain recent locations\n\t\t\tif (pastLocations.size()>9)\n\t\t\t\tpastLocations.remove(0);\t\n\t}",
"public void removeLocation(int index)\n {\n this.locationLst.remove(index);\n }",
"public Object remove(Map<Prop, Object> map) {\n return map.remove(this);\n }",
"public void removeEditedTile(GroundTile tile) {\n this.editedTiles.remove(tile);\n }",
"public void removeObstacle(Coord obstacleCoord);",
"public static void clearWorld() {\n // TODO: Complete this method\n population.clear();\n babies.clear();\n }",
"public void removeAgentServiceLocationMapping(long id);",
"protected void removeLane()\n {\n if (lane == 1)\n {\n\n MyWorld.Lane1Monsters.remove(this);\n getWorld().removeObject(this);\n\n }\n\n else if (lane == 2)\n {\n MyWorld.Lane2Monsters.remove(this);\n getWorld().removeObject(this);\n\n }\n\n else if (lane == 3)\n {\n MyWorld.Lane3Monsters.remove(this);\n getWorld().removeObject(this);\n\n }\n\n else if (lane == 4)\n {\n MyWorld.Lane4Monsters.remove(this);\n getWorld().removeObject(this);\n\n }\n\n else if (lane == 5)\n {\n MyWorld.Lane5Monsters.remove(this);\n getWorld().removeObject(this);\n\n }\n MyWorld.monsterAdded();\n }",
"public void unsetFromAddress()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(FROMADDRESS$6, 0);\n }\n }",
"public void removeTeam(Team t) {\r\n Iterator<Match> itr = this.resultsTree.iterator();\r\n while (itr.hasNext()) {\r\n //Match to be removed\r\n if (itr.next().containsTeam(t)) {\r\n itr.remove();\r\n }\r\n }\r\n \r\n //Decremente the number of teams left\r\n Team.nbTeam--;\r\n }",
"public void clearLocusTairObjectId() {\n // Override in proxy if lazily loaded; otherwise does nothing\n }",
"public void clearLociLocus() {\n // Override in proxy if lazily loaded; otherwise does nothing\n }",
"public void removeMapObject(MapObject obj) {\n markers.remove(obj);\n if(internalNative != null) {\n internalNative.removeMapElement(obj.mapKey);\n } else {\n if(obj.lines != null) {\n if(internalLightweightCmp != null) {\n internalLightweightCmp.removeLayer(obj.lines);\n } else {\n // TODO: Browser component\n }\n } else {\n points.removePoint(obj.point);\n }\n }\n }",
"void removeHasLatitude(Object oldHasLatitude);",
"public void removeByCN(java.lang.String cityNo)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;",
"public void clearDetourStreet()\r\n {\r\n detour_streets = null;\r\n }",
"public void removeScenery(){\n\t\tfor(int i=0;i<grid.length;i++){\n\t\t\tfor(int j=0;j<grid[0].length;j++){\n\t\t\t\tif(grid[i][j].isScenery())\n\t\t\t\t\tgrid[i][j]=null;\n\t\t\t}\n\t\t}\n\t}",
"public void deleteUnitFromMinimap(Unit unit) {\n for (int k = 0; k < minimapUnits.size(); ++k) {\n if (minimapUnits.get(k).getMyUnit().equals(unit)) {\n drawPane.getChildren().remove(minimapUnits.get(k));\n minimapUnits.remove(minimapUnits.get(k));\n break;\n }\n }\n }",
"public void clearTombstones(Player p) {\n\t\tSet<Tile> tombstoneTiles = getTombstoneTiles(p);\n\t\tfor (Tile t : tombstoneTiles) {\n\t\t\t//Destroy tombstone and update land type to grass\n\t\t\tt.destroyStructure();\n\t\t\tt.updateLandType(LandType.Tree);\n\t\t}\n\t}",
"void clearShapeMap();",
"public void unbanFromWorld(String player, String world) {\n Set<String> worldsTMP = bannedWorlds.get(player);\n \n if (worldsTMP == null) {\n return;\n }\n \n worldsTMP.remove(world);\n if (worldsTMP.isEmpty()) {\n bannedWorlds.remove(player);\n return;\n }\n bannedWorlds.put(player, (HashSet<String>) worldsTMP);\n }",
"private void removeALakeTile(Game game) {\n\t\tLakeTile[][] board = game.getPlayArea().getLakeTilesOnBoard();\n\t\tArrayList<Position> positions = new ArrayList<Position>();\n\t\tfor (int y = 0; y < board.length; y++) {\n\t\t\tfor (int x = 0; x < board[y].length; x++) {\n\t\t\t\tLakeTile laketile = board[x][y];\n\t\t\t\tif (laketile != null) {\n\t\t\t\t\tint connect_laketile = 4;\n\t\t\t\t\tif (x + 1 < board.length && board[x + 1][y] == null)\n\t\t\t\t\t\tconnect_laketile -= 1;\n\t\t\t\t\tif (y + 1 < board.length && board[x][y + 1] == null)\n\t\t\t\t\t\tconnect_laketile -= 1;\n\t\t\t\t\tif (x - 1 >= 0 && board[x - 1][y] == null)\n\t\t\t\t\t\tconnect_laketile -= 1;\n\t\t\t\t\tif (y - 1 >= 0 && board[x][y - 1] == null)\n\t\t\t\t\t\tconnect_laketile -= 1;\n\t\t\t\t\tif (connect_laketile == 1) {\n\t\t\t\t\t\tPosition p = new Position(x, y);\n\t\t\t\t\t\tpositions.add(p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (countLakeTileOnBoard(board) != 0 && positions.size() == 0) {\n\t\t\tpositions = getAllLakeTilePositionOnBoard(board);\n\t\t}\n\t\tCollections.shuffle(positions);\n\t\tPosition pos = positions.get(0);\n\t\tint x = pos.getX();\n\t\tint y = pos.getY();\n\t\tremoved_laketile.add(board[x][y]);\n\t\tremoved_position.add(pos);\n\t\tboard[x][y] = null;\n\t}",
"public void removeAgent(Agent a)\n/* 81: */ {\n/* 82:132 */ this.mapPanel.removeAgent(a);\n/* 83: */ }",
"public void unsetLocalTimeZoneRestriction()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(LOCALTIMEZONERESTRICTION$4, 0);\n }\n }",
"public void removeUnit(){\r\n tacUnit = null;\r\n }",
"public void shutdown() {\n map.shutdown();\n }",
"public void removeHome(UUID uuid, String name){\r\n\t\t//Load Map (Update)\r\n\t\tloadMap();\r\n\r\n\t\t//Combovar of Homename & UUID of Player\r\n\t\tString uniqhome = uuid.toString() + name;\r\n\r\n\t\t//Remove HomePoint from Map\r\n\t\tmap.remove(uniqhome);\r\n\r\n\t\t//Save Map\r\n\t\ttry {\r\n\t\t\tObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(homeFileLocation));\r\n\t\t\toos.writeObject(map);\r\n\t\t\toos.flush();\r\n\t\t\toos.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public void clearLocusLocus() {\n // Override in proxy if lazily loaded; otherwise does nothing\n }",
"public void remove(){\n\t\tsetBounds(800, 600, WIDTH, HEIGHT);\n\t}",
"public void unsetNwCell()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(NWCELL$26, 0);\n }\n }",
"public void removeFromPlanet() {\n this.currentPlanet = null;\n }",
"void removeHasCity(String oldHasCity);",
"public void clearMap() {\n if (mMap != null) {\n mMap.clear();\n }\n }",
"public void remove(AddressEntry entry) {\n addressEntryList.remove(entry);\n }",
"public void remove(\n\t\t\tMapNode\tmapNode)\n\t\t{\n\t\t\tindices.remove(mapNode);\n\t\t}",
"public void removePawn() {\n lives = 0;\n }",
"public void remove(MapView mapView){\n\t\tmapView.getOverlays().remove(this);\n\t}",
"public void removeSword() {\n \tthis.sword =null;\n \tthis.UIsword().set(false);\n \tdungeon.swordLeft().set(\"Sword Hits Left: 0\\n\");\n }",
"public void deleteMapName(String name){\n\t\tLinkedList<String> names=new LinkedList<String>();\n\t\t\n\t\tboolean present = false;\n\t\tFileReader r;\n\t\ttry {\n\t\t\tr = new FileReader (\"mapRecords.txt\");\n\t\t\tBufferedReader b = new BufferedReader (r);\n\t\t\tString s=b.readLine();\n\t\t\t\n\t\t\twhile(s!=null){\n\t\t\t\tif(s.equals(name))\n\t\t\t\t\tpresent =true; \n\t\t\t\t\n\t\t\t\tnames.add(s);\n\t\t\t\ts=b.readLine();\n\t\t\t\t\n\t\t\t}\n\n\t\t\tr.close();\n\t\t\tb.close();\n\t\t\t\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"File not found\");\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.out.println(\"Can't read file\");\n\t\t}\n\t\t\n\n\t\tif (present){\n\t\t\tnames.remove(name);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tFileWriter w= new FileWriter(new File(\"mapRecords.txt\"));\n\t\t\t\tfor (String n: names){\n\t\t\t\t\tw.write(n+\"\\n\");\n\t\t\t\t\tw.write(System.lineSeparator())\t;\n\t\t\t\t}\t\n\t\t\t\tw.flush();\n\t\t\t\tw.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t//e.printStackTrace();\n\t\t\t\tSystem.out.println(\"Can't write to the file\");\n\t\t\t}\n\t\t}\n\t\telse //there is nothing to remove the file is not present \n\t\t\treturn;\n\t\t\n\t}",
"void remove(ThreadLocal<?> key) {\n cleanUp();\n\n for (int index = key.hash & mask;; index = next(index)) {\n Object reference = table[index];\n\n if (reference == key.reference) {\n // Success!\n table[index] = TOMBSTONE;\n table[index + 1] = null;\n tombstones++;\n size--;\n return;\n }\n\n if (reference == null) {\n // No entry found.\n return;\n }\n }\n }",
"@Override\n\tpublic void redo() {\n\t\tfor (TAPNQuery q : queriesInclusion) {\n\t\t\tq.inclusionPlaces().removePlace(timedPlace);\n\t\t}\n\n\t\ttapn.remove(timedPlace);\n\t\tguiModel.removePetriNetObject(timedPlaceComponent);\n\t}",
"public void clearStateToPureMapState() {\n for (int i = 0; i < cells.size(); i++) {\n if (cells.get(i) == CellState.Chosen || cells.get(i) == CellState.ToPlaceTower || cells.get(i) == CellState.Tower) {\n cells.set(i, CellState.Grass);\n }\n }\n }",
"public void removePowerUp(PowerUp p) {\n for (Location loc : p.getLocations()) {\n Location replacement = new Location(loc.getX(), loc.getY());\n gridCache.add(replacement);\n }\n\n powerUps.remove(p);\n render();\n}"
] | [
"0.63181293",
"0.6271805",
"0.61641276",
"0.6078989",
"0.60679346",
"0.60675377",
"0.6061107",
"0.60293925",
"0.6029062",
"0.5992073",
"0.5953959",
"0.58709496",
"0.58610517",
"0.5826287",
"0.5818149",
"0.58166337",
"0.5779829",
"0.5726749",
"0.57164794",
"0.5680561",
"0.56778604",
"0.56662905",
"0.56440747",
"0.5642353",
"0.56323606",
"0.5618314",
"0.56093293",
"0.5580557",
"0.5579519",
"0.55603075",
"0.5554097",
"0.55409175",
"0.55398256",
"0.55382806",
"0.553762",
"0.5528649",
"0.55167216",
"0.5486793",
"0.5485096",
"0.54822814",
"0.54644185",
"0.54494476",
"0.5442534",
"0.5430159",
"0.54234654",
"0.54166144",
"0.5411179",
"0.53856945",
"0.5380981",
"0.5376655",
"0.5365544",
"0.53552616",
"0.5354466",
"0.53477806",
"0.5342048",
"0.5341634",
"0.5339426",
"0.5338795",
"0.53307366",
"0.53189117",
"0.53183705",
"0.5318294",
"0.53021216",
"0.5287778",
"0.52788657",
"0.52775496",
"0.5248652",
"0.5248548",
"0.5244895",
"0.5244358",
"0.52374107",
"0.5232181",
"0.5231029",
"0.52265126",
"0.52207077",
"0.5213833",
"0.52101606",
"0.52028114",
"0.5201666",
"0.52008617",
"0.51972747",
"0.51958936",
"0.5176695",
"0.5176096",
"0.5165994",
"0.5164481",
"0.51640475",
"0.51622677",
"0.51481205",
"0.5135202",
"0.5127155",
"0.51264",
"0.5115093",
"0.5110115",
"0.5101796",
"0.50996095",
"0.5094447",
"0.50903064",
"0.5089348",
"0.508255"
] | 0.8134488 | 0 |
Finish the registration screen and return to the Login activity | @Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
startActivity(intent);
finish();
overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void Register()\n {\n Intent registerIntent = new Intent (LoginActivity.this, RegisterActivity.class);\n startActivity(registerIntent);\n finish();\n }",
"private void goRegisterActivity() {\n Intent i = new Intent(this, RegisterActivity.class);\n startActivity(i);\n finish();\n }",
"@Override\n public void onClick(View view) {\n finish();\n startActivity(new Intent(RegisterActivity.this, LoginActivity.class));\n }",
"@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)\n @Override\n public void finish() {\n loginPresenter.toFinish();\n }",
"private void onSignupSuccess() {\n startActivity(currentActivity, UserLoginActivity.class);\n finish();\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_CODE_REGISTER) {\n if (resultCode == RESULT_OK) {\n\n // TODO: Implement successful register logic here\n // If register is successfully, automatically doLogin and go to MainActivity\n this.finish();\n }\n }\n }",
"private void goToRegisterActivity() {\n Intent intent = new Intent(LoginActivity.this, RegisterAccountActivity.class);\n startActivityForResult(intent, 0);\n }",
"@Override\n public void done(User returnedUser) {\n startActivity(new Intent(Register.this, Login.class));\n }",
"@Override\n public void onClick(View v) {\n Intent i = new Intent(Login_page.this,registration_page.class);\n startActivity(i);\n finish();\n }",
"private void returnToLoginActivity() {\n Intent returnToLogin = new Intent(this, Login.class);\n startActivity(returnToLogin);\n finish();\n }",
"public void onComplete(@NonNull Task<Void> task) {\n startActivity(new Intent(MainActivity.this, Login.class));\n finish();\n }",
"@Override\n public void onClick(View view) {\n finish();\n startActivity(new Intent(getApplicationContext(), RegisterActivity.class));\n }",
"public void returnToLogin(View view){\r\n startActivity(new Intent(SignUpActivity.this, LoginActivity.class));\r\n finish();\r\n }",
"@Override\r\n public void onLogout() {\n Intent loginIntent = new Intent(CreateAccount.this, MainActivity.class);\r\n startActivity(loginIntent);\r\n finish();\r\n }",
"public void Login_screen_to_Registration() {\n register_ = findViewById(R.id.register_);\n register_.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Intent intent = new Intent(Login_screen.this, Registration.class);\n startActivity(intent);\n }\n });\n }",
"@Override\n public void navigateToLogin() {\n startActivity(new Intent(this, LoginActivity.class));\n finish();\n }",
"public void voltarLogin(View view){\n finish();\n }",
"private void redirectLoginScreen() {\n Log.d(TAG, \"redirectLoginScreen: redirecting to login screen.\");\n Intent intent = new Intent(Register.this, LogIn.class);\n startActivity(intent);\n finish();\n }",
"private void register() {\n Intent intent = new Intent(LoginActivity.this, RegisterActivity.class);\n startActivity(intent);\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQ_SIGNUP && resultCode == RESULT_OK) {\n finishLogin(data);\n } else\n super.onActivityResult(requestCode, resultCode, data);\n }",
"@Override\n public void run() {\n Intent mainIntent = new Intent(SplashActivity.this, RegisterActivity.class);\n startActivity(mainIntent);\n //finish zamyka nasza aplikace, jesli tego nie zrobimy dowktywnosci bedziemy mogli\n //wrocic\n finish();\n }",
"@Override\n public void onRegistrationAccomplished() {\n Prefs.setSignedIn(true);\n // Proceed to Main\n proceedToMainActivityAndFinish();\n }",
"@Override\n public void onClick(View v) {\n finishWithNextActivity(LoginActivity.class);\n\n }",
"private void returnLogin(){\n Intent intent = new Intent(getContext(), MainActivity.class);\n startActivity(intent);\n getFragmentManager().beginTransaction().remove(this).commit();\n }",
"private void goToLoginPage() {\n\n startActivity(new Intent(this,LoginActivity.class));\n finish();\n }",
"@Override\n public void onClick(View v) {\n etSignUpUsername.setText(\"\");\n etSignUpEmail.setText(\"\");\n etSignUpPassword.setText(\"\");\n etContactNumber.setText(\"\");\n //Initialize and launch intent.\n Intent intent = new Intent(RegistrationActivity.this, com.example.annadata.LoginActivity.class);\n startActivity(intent);\n RegistrationActivity.this.finish();\n }",
"@Override\r\n public void onClick(View v) {\n Intent i = new Intent(LoginActivty.this, SignupActivity.class);\r\n startActivity(i);\r\n finish();\r\n\r\n\r\n }",
"private void registerSuccess(){\n Intent intent = new Intent(getApplicationContext(), MainActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\n getApplicationContext().startActivity(intent);\n finish();\n }",
"private void SignIn() {\n startActivity(new Intent(MainActivity.this, HomeScreenActivityFragments.class));\n finish();\n }",
"public void onSignUpClicked() {\n loginView.startSignUpActivity();\n loginView.finishActivity();\n }",
"public void registerSuccessful() {\n\t\tnavigateTo(new LoginFragment(), true, null);\n\t}",
"public void returnToLogin() {\n // Ako smo kliknuli na Login, kreiramo Intent za\n // prijelaz na Login aktivnost\n Intent i = new Intent(this, LoginActivity.class);\n // U slucaju povratka na Login zelimo izbrisati \"povijest\" navigiranja,\n // tako da nas \"Back\" gumb ne vrati prethodnu aktivnost\n i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // Prelazimo na Login aktivnost\n startActivity(i);\n // Zavrsavamo trenutnu aktivnost i oslobadjamo resurse\n finish();\n }",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent result = new Intent(RegistActivity.this, LoginActivity.class);\n\t\t\t\tstartActivity(result);\n\t\t\t\tfinish();\n\t\t\t}",
"@Override\n public void onClick(View v) {\n LoginActivity.this.finish();\n }",
"private void takeUserToLoginScreenOnUnAuth() {\n Intent intent = new Intent(BaseActivity.this, LoginActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n finish();\n }",
"@Override\t\n\t public void onClick(View v) {\n\t Intent i = new Intent(getApplicationContext(), RegisterActivity.class);\n\t startActivity(i);\n\t finish();\n\t }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n AtyMain.actionStart(AtyLoginOrRegister.this, \"\");\n //Intent intent = new Intent(this, AtyMain.class);\n //startActivity(intent);\n finish();\n }",
"@Override\n\t\t\t\t\tpublic void onSuccess() {\n\t\t\t\t\t\tToast.makeText(RegisterActivity.this,\"Sign up successfully!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tstartActivity(new Intent(RegisterActivity.this, LoginActivity.class));\n\t\t\t\t\t}",
"@Override\n public void onClick(View v) {\n finish();\n Intent intent = new Intent(getApplicationContext(), LoginActivity.class);\n startActivity(intent);\n }",
"private void goToAuthScreen(){\n this.finish();\n\n Intent intent = new Intent(this, AuthStartActivity.class);\n startActivity(intent);\n }",
"public void onSignupSuccess(){\n Toast.makeText(this, \"YEPP\", Toast.LENGTH_SHORT).show();\r\n Intent changetomain = new Intent(RegisterActivity.this, MainAccount.class) ;\r\n startActivity(changetomain);\r\n }",
"private void onForgetPwd() {\n Intent intent = new Intent(this, ForgotPasswordActivity.class);\n startActivity(intent);\n finish();\n }",
"private void goLoginSignupActivity() {\n Intent intent = new Intent(this, LoginSignupActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(intent);\n }",
"@Override\r\n public void run()\r\n {\r\n Intent mainIntent = new Intent(RegistrationSuccessful.this, MainActivity.class);\r\n RegistrationSuccessful.this.startActivity(mainIntent);\r\n RegistrationSuccessful.this.finish();\r\n }",
"@Override\n public void run(){\n Intent homeIntent = new Intent(MainActivity.this,login_page.class);//splashes to the login page.\n startActivity(homeIntent);\n finish();\n }",
"public void registerNewUser(View v) {\n Intent intent = new Intent(this, com.mms.memorizationgame.RegisterActivity.class);\n\n finish();\n startActivity(intent);\n }",
"private void goToRegistrationPage() {\n mAppModel.getErrorBus().removePropertyChangeListener(this);\n mAppModel.removePropertyChangeListener(this);\n mNavigationHandler.goToRegistrationPage();\n }",
"@Override\n public void onClick(View v) {\n // Finish the registration screen and return to the Login activity\n Intent intent = new Intent(getApplicationContext(),LoginActivity.class);\n\n// intent.putExtra(\"firstname\", firstname);\n// intent.putExtra(\"lastname\", lastname);\n// intent.putExtra(\"id\", id);\n\n\n\n startActivity(intent);\n finish();\n overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out);\n }",
"@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\r\n\t\t\t\tIntent i=new Intent(getApplicationContext(),REGISTER.class);\r\n\t\t\t\tstartActivity(i);\r\n\t\t\t\tPregistermenu.this.finish();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}",
"@Override\n public void run() {\n Intent i = new Intent(activity_splash.this, login_activity.class);\n startActivity(i);\n finish();\n }",
"private void goUpdatePasswordSucess() {\n\n AppManager.getAppManager().finishActivity(ForgetpasswordActivity.class);\n finish();\n }",
"public void register_func(View v) {\n Intent ii = new Intent(Main.this, Register.class);\n startActivity(ii);\n finish();\n }",
"@Override\n public void onClick(View view) {\n Intent intent = new Intent(MainActivity.this, RegisterUserActivity.class);\n startActivityForResult(intent, 2);\n\n }",
"@Override\n public void onClick(View v) {\n Toast.makeText(v.getContext(), \"Registration success\", Toast.LENGTH_LONG).show();\n finish();\n }",
"private void call_register_details_activity_page()\n {\n\n\n Intent intent = new Intent(getApplicationContext(), b_register_details_activity.class);\n\n startActivity(intent);\n finish();\n\n }",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tRegisterActivity.this.finish();\r\n\t\t\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tRegisterActivity.this.finish();\n\t\t\t}",
"private void goToRegisterScreen()\n {\n Intent intent = new Intent(this, Register.class);\n startActivity(intent);\n }",
"@Override\n public void run() {\n Intent mainIntent = new Intent(SplashActivity.this, LoginActivity.class);\n startActivity(mainIntent);\n finish();\n\n }",
"@Override\n public void onBackPressed()\n {\t\n \t//Return tu login activity\n \tif(mlv.getUsersView())\n \t\tthis.finish();\n \telse\n \t{\n \t\t//Return to users view\n \t\tmlv.activateUsersView(); \t\t\n \t}\n }",
"@Override\n public void run() {\n\n Intent intent = new Intent(Launcher.this, Login.class);\n startActivity(intent);\n finish();\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_login_screen);\n loginbtn = (Button)findViewById(R.id.loginAccount);\n registerbtn = (Button) findViewById(R.id.registerAccount);\n loginbtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n startActivity(new Intent(LoginScreen.this, Main.class));\n finish();\n }\n });\n\n registerbtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n startActivity(new Intent(LoginScreen.this, RegisterScreen.class));\n }\n });\n }",
"private void signUpActivity() {\n mSignUpButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Intent registerActivity = new Intent(LoginActivity.this, RegisterActivity.class);\n startActivity(registerActivity);\n }\n });\n }",
"private void Login()\n {\n Intent loginIntent = new Intent (LoginActivity.this, VVPActivity.class);\n startActivity(loginIntent);\n finish();\n }",
"@Override\n\tpublic void MyBack() {\n\t\tFindPasswordActivity.this.finish();\n\t}",
"private void redirectLoginScreen(Bundle bundle){\n Intent loginIntent = new Intent(PrivateUserRegActivity.this, LoginActivity.class);\n loginIntent.putExtras(bundle);\n startActivity(loginIntent);\n finish();\n }",
"public void onSignInPressed(View view) {\n Intent intent = new Intent(CreateAccountActivity.this, LoginActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n finish();\n }",
"public void onSignInPressed(View view) {\n Intent intent = new Intent(CreateAccountActivity.this, LoginActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n finish();\n }",
"public void login(View view) {\n\n validateLogin(email.getText().toString(), pw.getText().toString());\n\n/*\n Intent i = new Intent(LoginActivity.this, MainActivity.class);\n startActivity(i);\n finish();\n\n */\n\n }",
"@Override\r\n public void run() {\r\n Intent i = new Intent(SplashScreen.this, TelaLogin.class);\r\n startActivity(i);\r\n finish();\r\n }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n Toast.makeText(getApplicationContext(), \"You have successfully logout\",\n Toast.LENGTH_LONG).show();\n SplashActivity.editor.remove(\"loginTest\");\n SplashActivity.editor.commit();\n Intent sendToLoginandRegistration = new Intent(getApplicationContext(), LoginActivity.class);\n startActivity(sendToLoginandRegistration);\n }",
"public void gotoSignupActivity() {\n Intent intent = new Intent();\n intent.setClass(mContext, SignupActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivityForResult(intent, SIGNUP_ACTIVITY_CODE);\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent();\n\t\t\t\tintent.setClass(Login_Register.this, Register.class);\n\t\t\t\tstartActivity(intent);\n\t\t\t\tLogin_Register.this.finish();\n\t\t\t}",
"@Override\r\n public void onClick(View v) {\n Intent nxt = new Intent(Login.this,Register.class);\r\n startActivity(nxt);\r\n }",
"public void run() {\n Intent intent = new Intent(IndexActivity.this, LoginActivity.class);\n startActivity(intent);\n finish();\n }",
"public void onLoginSuccess() {\n loginButton.setEnabled(true);\n Intent intent = new Intent(getApplicationContext(), MainActivity.class);\n intent.putExtra(\"email\", emailText.getText().toString());\n intent.putExtra(\"name\", loginDataBaseAdapter.getName(emailText.getText().toString()));\n startActivity(intent);\n //finish();\n }",
"public void run() {\n Intent mInHome = new Intent(MainActivity.this,GoogleLoginActivity.class);\n MainActivity.this.startActivity(mInHome);\n MainActivity.this.finish();\n }",
"private void m3179g() {\n finish();\n startActivity(new Intent(this, WelcomeActivity.class));\n }",
"@Override\n public void run() {\n if (session.isLoggedIn()) {\n Intent i = new Intent(Splash.this, MainActivity.class);\n startActivity(i);\n finish();\n }\n else if(!session.isLoggedIn()){\n Intent i = new Intent(Splash.this, RepRegistration.class);\n startActivity(i);\n finish();\n }\n }",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(SignUpActivity.this, LoginActivity.class);\r\n\t\t\t\tstartActivity(intent);\r\n\t\t\t\tfinish();\r\n\t\t\t}",
"@Override\n public void onClick(View v) {\n try {\n Login login = new Login();\n login.setSalt(new Date());\n login.setUsername(mUsernameInput.getText().toString());\n login.setPassword(login.hashedPassword(mPasswordInput.getText().toString()));\n\n if (mLoginDb.getLogin(login.getUsername()) == null && mPasswordInput.getText().toString().length() != 0) {\n mLoginDb.addLogin(login);\n mUserId = login.getId().toString();\n //Log.d(TAG, \"register \" + mUserId);\n Bundle bundle = new Bundle();\n Intent intent = PasswordListActivity.newIntent(getActivity());\n setBundles(bundle, intent);\n\n startActivity(intent, bundle);\n\n Toast.makeText(getActivity(),\n R.string.register_successful,\n Toast.LENGTH_SHORT).show();\n } else if (mUsernameInput.getText().toString().length() == 0) {\n Toast.makeText(getActivity(),\n R.string.register_username_length,\n Toast.LENGTH_SHORT).show();\n }\n else if (mPasswordInput.getText().toString().length() == 0) {\n Toast.makeText(getActivity(),\n R.string.register_password_length,\n Toast.LENGTH_SHORT).show();\n } else if (mLoginDb.getLogin(login.getUsername()).getUsername() != null) {\n Toast.makeText(getActivity(),\n R.string.register_exists,\n Toast.LENGTH_SHORT).show();\n } else {\n throw new Exception();\n }\n } catch (Exception e) {\n e.printStackTrace();\n Toast.makeText(getActivity(),\n R.string.register_error,\n Toast.LENGTH_SHORT).show();\n }\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Toast.makeText(LogInActivity.this, \"Login success\", Toast.LENGTH_SHORT).show();\n startActivity(new Intent(getApplicationContext(), SelectionActivity.class));\n finish();\n loginButton.setEnabled(true);\n progressBar.setVisibility(View.GONE);\n } else {\n Toast.makeText(LogInActivity.this, \"Your email or password is incorrect \"+task.getException(), Toast.LENGTH_SHORT).show();\n loginButton.setEnabled(true);\n progressBar.setVisibility(View.GONE);\n }\n }",
"@Override\r\n\t\tprotected void onPostExecute(String result) {\r\n\t\t\t super.onPostExecute(result);\r\n\t\t\t Intent i = new Intent(ImageTag.this,Login.class);\r\n\t\t\t startActivity(i);\r\nfinish();\r\n\t\t}",
"public void onClick(DialogInterface dialog, int which) {\n\n Intent nextScreen2 = new Intent(getApplicationContext(), CreateAccount.class);\n System.out.println(\"IN ALRT\");\n System.out.println(login);\n nextScreen2.putExtra(\"login\", login);\n nextScreen2.putExtra(\"password1\", password);\n nextScreen2.putExtra(\"password2\", password2);\n nextScreen2.putExtra(\"email\", email);\n nextScreen2.putExtra(\"birth_date\", dob);\n\n\n startActivityForResult(nextScreen2, 0);\n\n }",
"@Override\n public void onClick(DialogInterface dialogInterface, int i) {\n FirebaseAuth.getInstance().signOut();\n startActivity(new Intent(MainActivity.this, Login.class));\n finish();\n }",
"@Override\n public void onSuccess(LoginResult loginResult) {\n startActivity(new Intent(LoginActivity.this, HomeActivity.class));\n }",
"public void run() {\n Intent intent = new Intent(SignupActivity.this, HomeActivity.class);\n SignupActivity.this.startActivity(intent);\n\n Context context = getApplicationContext();\n CharSequence text = \"welcome \" + email;\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n finish();\n\n // onLoginFailed();\n progressDialog.dismiss();\n }",
"@Override\n public void onClick(View v) {\n Intent intent = new Intent(ResetPassword.this, ForgetPassword.class);\n startActivity(intent);\n finish();\n }",
"@Override\n public void run() {\n Intent mainIntent = new Intent(getApplicationContext(), Login_state_checker.class);\n startActivity(mainIntent);\n finish();\n }",
"private void userSignIn() {\n GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);\n if (GoogleSignIn.hasPermissions(account, new Scope(SCOPES))) {\n updateUI(account);\n mAccount = account.getAccount();\n Intent intent = new Intent(this, HomeActivity.class);\n intent.putExtra(ACCOUNT, mAccount);\n startActivity(intent);\n System.out.println(\"Exit Intent !!!!!!!!!!!!!!!!\");\n\n findViewById(R.id.disconnect_button).setVisibility(View.VISIBLE);\n\n } else {\n updateUI(null);\n }\n }",
"@Override\n public void onComplete(@NonNull Task<Void> task2) {\n if(task2.isSuccessful()){\n startActivity(new Intent(DatosIniciales.this, MainActivity.class));\n //evitamos que vuelva a la pantalla con finsh cuando ya se ha registrado\n finish();\n }else{\n Toast.makeText(DatosIniciales.this, \"Algo fallo ups!!\", Toast.LENGTH_SHORT).show();\n }\n }",
"@Override\n public void onComplete(@NonNull Task<Void> task) {\n\n if(task.isSuccessful()){\n Toast.makeText(RegistrationActivity.this, \"User has been registered successfully!\", Toast.LENGTH_LONG).show();\n progressBar.setVisibility(View.GONE);\n\n //Then redirect to login layout\n } else {\n Toast.makeText(RegistrationActivity.this,\"Failed to register. Try again.\", Toast.LENGTH_LONG).show();\n progressBar.setVisibility(View.GONE);\n }\n\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tAccountManage.this.finish();\n\t\t\t}",
"public void loggedInSuccessful() {\n\t\tIntent intent = new Intent(this, MainActivity.class);\n\t\tstartActivity(intent);\n\t\tthis.finish();\n\t}",
"@Override\r\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\r\n if (resultCode == Activity.RESULT_OK) {\r\n switch (requestCode) {\r\n\r\n case GO_LOGIN:\r\n initPersonalInfo();\r\n logout.setText(\"退出登录\");\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n }",
"@Override\n public void onClick(View v) {\n FirebaseAuth.getInstance().signOut();\n Intent signOutIntent = new Intent(ResultActivity.this,LoginActivity.class);\n startActivity(signOutIntent);\n finish();\n }",
"public void logout() {\n updateToken(\"\");\n startActivity(new Intent(GarageListActivity.this, LoginScreenActivity.class));\n updateToken(\"\");\n finish();\n }",
"@Override\n public void onClick(View v) {\n Intent intent = new Intent(getApplicationContext(), RegisterActivity.class);\n startActivityForResult(intent, REQUEST_CODE_REGISTER);\n }",
"private void checkToLogin() {\n Intent intent = new Intent(this, LoginActivity.class);\n startActivityForResult(intent, ConstantValue.LOG_IN_CODE);\n }",
"@Override\n public void onBackPressed()\n {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"Continuing with the action will log you out and send you to login screen\");\n builder.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog,\n int which) {\n MainActivity act=new MainActivity();\n act.log_out(email);\n finish();\n setContentView(R.layout.activity_main);\n\n }\n });\n builder.setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog,\n int which) {\n dialog.dismiss();\n\n }\n });\n builder.show();\n }",
"public void onFinish(){\n Intent clicky = new Intent(AlertActivity.this,NurseActivity.class);\n startActivity(clicky);\n }"
] | [
"0.8086164",
"0.77731264",
"0.77242446",
"0.7697819",
"0.7574784",
"0.75733644",
"0.7532319",
"0.7504397",
"0.747711",
"0.74729526",
"0.7456112",
"0.7364659",
"0.7346382",
"0.73346394",
"0.727328",
"0.7270509",
"0.72429967",
"0.72218686",
"0.7218744",
"0.7214109",
"0.71954346",
"0.71954274",
"0.71811473",
"0.71780056",
"0.7155381",
"0.71436435",
"0.7124185",
"0.7117626",
"0.7096802",
"0.7070256",
"0.7063187",
"0.7051613",
"0.7025365",
"0.69696164",
"0.69612145",
"0.695912",
"0.69504136",
"0.69441646",
"0.6933416",
"0.6930275",
"0.690934",
"0.6878309",
"0.6857425",
"0.6845597",
"0.68216926",
"0.6818425",
"0.6814573",
"0.6803387",
"0.6802779",
"0.67849094",
"0.67798656",
"0.6771863",
"0.676197",
"0.67537314",
"0.67513",
"0.67346245",
"0.6723861",
"0.67095363",
"0.670084",
"0.6686017",
"0.66822886",
"0.66774386",
"0.66440624",
"0.66210234",
"0.6612048",
"0.66105634",
"0.6607315",
"0.6607315",
"0.65919846",
"0.65913695",
"0.6581808",
"0.6569019",
"0.65669006",
"0.6563312",
"0.6561148",
"0.6548959",
"0.6535595",
"0.65288544",
"0.65148103",
"0.65033686",
"0.6501361",
"0.64952105",
"0.6486863",
"0.64850736",
"0.64813167",
"0.64767563",
"0.64742804",
"0.64673203",
"0.64651686",
"0.64642453",
"0.6449332",
"0.6446296",
"0.64246213",
"0.6416926",
"0.6416053",
"0.641524",
"0.6411068",
"0.64068407",
"0.64052695",
"0.6405136",
"0.64004457"
] | 0.0 | -1 |
On complete call either onSignupSuccess or onSignupFailed depending on success | public void run() {
onSignupSuccess();
// onSignupFailed();
progressDialog.dismiss();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void signup() {\n Log.d(TAG, \"Signup\");\n\n if (!validate()) {\n onSignupFailed();\n return;\n }\n\n createProgressDialog(R.string.creating_account);\n\n final String name = _nameText.getText().toString();\n final String email = _emailText.getText().toString();\n final String password = _passwordText.getText().toString();\n\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n if (!task.isSuccessful()) {\n createToast(R.string.authentication_failed, Toast.LENGTH_SHORT);\n } else {\n progressDialog.dismiss();\n final FirebaseUser user = mAuth.getCurrentUser();\n mDatabase.child(\"users\").child(user.getUid()).addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.getValue() == null) {\n createUserInFirebase(name, email, user.getUid());\n }\n }\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n sendToTrivia();\n }\n\n }\n });\n\n\n new android.os.Handler().postDelayed(\n new Runnable() {\n public void run() {\n // On complete call either onSignupSuccess or onSignupFailed\n // depending on success\n progressDialog.dismiss();\n }\n }, 3000);\n }",
"@Override\n public void onValidationSucceeded() {\n String email = mEmailField.getText().toString();\n String firstName = mFirstNameField.getText().toString();\n String lastName = mLastNameField.getText().toString();\n String password = mPasswordField.getText().toString();\n\n mSignUpInterface.onSignup(email, firstName, lastName, password);\n }",
"private void onSignupSuccess() {\n startActivity(currentActivity, UserLoginActivity.class);\n finish();\n }",
"public void run() {\n onSignupSuccess();\n // onSignupFailed();\n progressDialog.dismiss();\n }",
"public void SignUp2(View view){\n\n mFirebaseAuth.createUserWithEmailAndPassword(EditEmail.getText().toString(),EditPass.getText().toString())\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n saveUser(EditFirstName.getText().toString(),EditLastName.getText().toString(),EditEmail.getText().toString(),SelectSpinner.getSelectedItem().toString());\n mUserDatabaseReference.push().setValue(mClassUser);\n EditFirstName.setText(\"\");\n EditLastName.setText(\"\");\n EditEmail.setText(\"\");\n EditPass.setText(\"\");\n\n if (!task.isSuccessful()) {\n// Toast.makeText(ActivitySignup.this, \"failed to sign up\",\n// Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n\n }",
"public void onClick_AGSU_signUp(View view) {\n AnimationTools.startLoadingAnimation(Constants.ANIMATION_CODE_AGSU_LOADING, this, signUpButton_rootLayout, R.style.AGSU_loading_progress_bar);\n\n FirestoreManager.saveUserData(SecondarySignUpManager.getDatabaseUser());\n\n //add a password-email auth method\n AuthCredential credential = EmailAuthProvider.getCredential(SecondarySignUpManager.getDatabaseUser().getEmail(), SecondarySignUpManager.getDatabaseUser().getPassword());\n AuthenticationManager.getCurrentUser().linkWithCredential(credential).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()) {\n System.out.println(\"[Neuron.SecondarySignUpActivity.onClick_AGSU_signUp]: link with email credential SUCCESSFUL! User uid = \" + task.getResult().getUser().getDisplayName());\n Constants.isSignUpInProcess = false; //sign up is now finished\n\n //in AGSU user is always new --> send verification email\n EmailVerification.sendVerificationEmail();\n\n Constants.isSecondarySignUpInProcess = false; //end of secondary sign up process\n\n ActivityTools.startNewActivity(activityContext, MainActivity.class);\n } else {\n System.err.println(\"[Neuron.SecondarySignUpActivity.onClick_AGSU_signUp]: ERROR: link with email credential FAILED! \" + task.getException().getMessage());\n }\n\n AnimationTools.stopLoadingAnimation(Constants.ANIMATION_CODE_AGSU_LOADING);\n }\n });\n\n }",
"@Override\n\t\t\t\t\tpublic void onSuccess() {\n\t\t\t\t\t\tToast.makeText(RegisterActivity.this,\"Sign up successfully!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tstartActivity(new Intent(RegisterActivity.this, LoginActivity.class));\n\t\t\t\t\t}",
"private void signUp() {\n final String email = ((EditText) findViewById(R.id.etSignUpEmail))\n .getText().toString();\n final String password = ((EditText) findViewById(R.id.etSignUpPassword))\n .getText().toString();\n\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Log.d(\"SIGN_UP_USER\", \"createUserWithEmail:success\");\n sendVerificationEmail(mAuth.getCurrentUser());\n updateUI();\n } else {\n Log.d(\"SIGN_UP_USER\", \"createUserWithEmail:failure\");\n Toast.makeText(LoginActivity.this,\n \"Failed to create a new user.\",\n Toast.LENGTH_LONG).show();\n }\n }\n });\n }",
"private void attemptSignup()\n\t{\n\t\t// Reset errors.\n\t\tmEmailView.setError(null);\n\t\tmPasswordView.setError(null);\n\n\t\t_signupButton.setEnabled(false);\n\n\t\t// Store values at the time of the login attempt.\n\t\tfinal String displayName = mNameView.getText().toString();\n\t\tString email = mEmailView.getText().toString();\n\t\tString password = mPasswordView.getText().toString();\n\n\t\tboolean cancel = false;\n\t\tView focusView = null;\n\n\t\t// Check for a valid password, if the user entered one.\n\t\tif (TextUtils.isEmpty(password))\n\t\t{\n\t\t\tmPasswordView.setError(getString(R.string.error_field_required));\n\t\t\tfocusView = mPasswordView;\n\t\t\tcancel = true;\n\t\t}\n\t\telse if (!isPasswordValid(password))\n\t\t{\n\t\t\tmPasswordView.setError(getString(R.string.error_invalid_password));\n\t\t\tfocusView = mPasswordView;\n\t\t\tcancel = true;\n\t\t}\n\n\t\t// Check for a valid email address.\n\t\tif (TextUtils.isEmpty(email))\n\t\t{\n\t\t\tmEmailView.setError(getString(R.string.error_field_required));\n\t\t\tfocusView = mEmailView;\n\t\t\tcancel = true;\n\t\t}\n\t\telse if (!isEmailFormatValid(email))\n\t\t{\n\t\t\tmEmailView.setError(getString(R.string.error_invalid_email));\n\t\t\tfocusView = mEmailView;\n\t\t\tcancel = true;\n\t\t}\n\n\t\t//Check for a valid display name\n\t\tif (displayName.isEmpty())\n\t\t{\n\t\t\tmNameView.setError(getString(R.string.error_field_required));\n\t\t\tfocusView = mNameView;\n\t\t\tcancel = true;\n\t\t}\n\n\t\tif (cancel)\n\t\t{\n\t\t\t// There was an error; don't attempt login and focus the first\n\t\t\t// form field with an error.\n\t\t\tfocusView.requestFocus();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//[START init_progress_dialog]\n\t\t\tfinal ProgressDialog progressDialog = new ProgressDialog(SignupPersonalActivity.this,\n\t\t\t\t\tR.style.AppTheme_Dark_Dialog);\n\t\t\tprogressDialog.setIndeterminate(true);\n\t\t\tprogressDialog.setMessage(\"Creating Account...\");\n\t\t\tprogressDialog.show();\n\t\t\t//[END init_progress_dialog]\n\t\t\tmAuth.createUserWithEmailAndPassword(email, password)\n\t\t\t\t\t.addOnCompleteListener(this, new OnCompleteListener<AuthResult>()\n\t\t\t\t\t{\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onComplete(@NonNull Task<AuthResult> task)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (task.isSuccessful())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tonSignUpSuccess(displayName);\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\tonSignUpFailed();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// [START_EXCLUDE]\n\t\t\t\t\t\t\tprogressDialog.dismiss();\n\t\t\t\t\t\t\t// [END_EXCLUDE]\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t}\n\t}",
"public F.Promise<Result> handleSignUp() {\n final Form<SignUp> filledForm = signUpForm.bindFromRequest();\n if(customerService().isLoggedIn()) {\n return asPromise(redirectToReturnUrl());\n } else if (filledForm.hasErrors()) {\n return asPromise(badRequest(signupView.render(data().build(), filledForm)));\n } else {\n return handleSignUpWithValidForm(filledForm);\n }\n }",
"public void onSignupSuccess(){\n Toast.makeText(this, \"YEPP\", Toast.LENGTH_SHORT).show();\r\n Intent changetomain = new Intent(RegisterActivity.this, MainAccount.class) ;\r\n startActivity(changetomain);\r\n }",
"@Test(priority=2)\n\tpublic void completeSignUpProcess(){\n\t\tsignup.clearAllFields();\n\t\tsignup.enterId(\"[email protected]\");\n\t\tsignup.enterFirstName(\"Manish Kumar\");\n\t\tsignup.enterLastName(\"Vuttunoori\");\n\t\tsignup.enterPassword(\"qwerty126\");\n\t\tsignup.reenterPassword(\"qwerty126\");\n\t\tsignup.clickSubmit();\n\t\t// must go to home page but wont as the mail id used here is already registered for an account, \n\t\t//so just checking for single error i.e. Email is already registered.\n\t\tAssert.assertEquals(1, signup.getErrors().size());\n\t}",
"private void attemptSignUp() {\n // Reset errors.\n mEmailView.setError(null);\n mPasswordViewOne.setError(null);\n mPasswordViewTwo.setError(null);\n\n // Store values at the time of the login attempt.\n final String email = mEmailView.getText().toString();\n final String password = mPasswordViewOne.getText().toString();\n final String passwordTwo = mPasswordViewTwo.getText().toString();\n\n boolean cancel = false;\n View focusView = null;\n\n // Check for a valid password, if the user entered one.\n if (TextUtils.isEmpty(password)) {\n mPasswordViewOne.setError(getString(R.string.error_field_required));\n focusView = mPasswordViewOne;\n cancel = true;\n } else if (!isPasswordValid(password)) {\n mPasswordViewOne.setError(getString(R.string.error_invalid_password));\n focusView = mPasswordViewOne;\n cancel = true;\n }\n\n // Check for matching password\n if (!password.equals(passwordTwo)) {\n mPasswordViewOne.setError(\"Passwords do not match\");\n mPasswordViewTwo.setError(\"Passwords do not match\");\n focusView = mPasswordViewOne;\n cancel = true;\n }\n\n // Check for a valid email address.\n if (TextUtils.isEmpty(email)) {\n mEmailView.setError(getString(R.string.error_field_required));\n focusView = mEmailView;\n cancel = true;\n } else if (!isEmailValid(email)) {\n mEmailView.setError(getString(R.string.error_invalid_email));\n focusView = mEmailView;\n cancel = true;\n }\n\n if (cancel) {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n focusView.requestFocus();\n } else {\n // Show a progress spinner, and kick off a background task to\n // perform the user login attempt.\n showProgress(true);\n\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Log.d(\"FirebaseSignUp\", \"createUserWithEmail:Success\");\n FirebaseUser user = mAuth.getCurrentUser();\n String uid = user == null ? \"null\" : user.getUid();\n\n // TODO: if successful, check if User should be an admin and add\n // them to list of admins in Firebase database\n if (mSpinner.getSelectedItem().equals(AccountType.ADMIN)) {\n mDatabase.child(\"admins\").child(uid)\n .setValue(email.split(\"@\")[0]);\n }\n\n Intent i = new Intent(getApplicationContext(), App.class);\n finish();\n startActivity(i);\n } else {\n // Probably means the email was taken\n mEmailView.setError(getString(R.string.error_email_already_registered));\n mEmailView.requestFocus();\n showProgress(false);\n }\n }\n });\n }\n }",
"@Override\n public void onSuccess(AuthResult authResult) {\n userWAPFirebase.create(newUser, firebaseAuth.getCurrentUser().getUid()).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Log.d(TAG, \"User \" + newUser.getUsername() + \" has been successfully created\");\n Toast.makeText(SignUpActivity.this, \"Sign up successful!\", Toast.LENGTH_SHORT).show();\n\n //Go back to Login Activity\n Intent loginIntent = new Intent(SignUpActivity.this, LoginActivity.class);\n loginIntent.putExtra(PASSWORD_KEY, etPasswordSignup.getText().toString());\n loginIntent.putExtra(EMAIL_KEY, newUser.getEmail());\n startActivity(loginIntent);\n }\n });\n }",
"public void run() {\n if(signedUp == 1) {\n onSignupSuccess();\n } else{\n onSignupFailed();\n }\n //\n progressDialog.dismiss();\n }",
"public void run() {\n if (resultType == 1) {\n onSignupSuccess();\n } else if(resultType==2){\n onSignupFailed(\"Cannot create user.\");\n }else{\n onSignupFailed(\"Network unavailable.\");\n }\n progressDialog.dismiss();\n }",
"@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast.makeText(Signup.this,\"Signup Succcessful\",Toast.LENGTH_SHORT).show();\n\n }",
"@Override\n public void onSuccess() {\n Handler.Callback bayunAuthSuccess = msg -> {\n confirmHandler.onSuccess();\n return false;\n };\n\n\n // Bayun Registration failure Callback\n Handler.Callback bayunAuthFailure = msg -> {\n Exception exception = new Exception(msg.getData().getString(Constants.ERROR));\n confirmHandler.onFailure(exception);\n return false;\n };\n\n // Bayun Registration authorizeEmployeeCallback Callback\n Handler.Callback authorizeEmployeeCallback = msg -> {\n String employeePublicKey = msg.getData().getString(Constants.EMPLOYEE_PUBLICKEY);\n Exception exception = new Exception(\"Employee Authorization is Pending\");\n confirmHandler.onFailure(exception);\n return false;\n };\n\n // Registration with Bayun\n BasicBayunCredentials basicBayunCredentials = new BasicBayunCredentials\n (appId, companyName, user.getUserId(), signUpPassword.toCharArray(),\n appSecret, applicationKeySalt);\n\n\n if(signUpIsRegisterWithPwd){\n BayunApplication.bayunCore.registerEmployeeWithPassword\n (activity,companyName,user.getUserId(),signUpPassword, authorizeEmployeeCallback, bayunAuthSuccess, bayunAuthFailure);\n }else {\n BayunApplication.bayunCore.registerEmployeeWithoutPassword(activity,companyName,user.getUserId()\n ,signUpEmail,false, authorizeEmployeeCallback,\n null,null,null, bayunAuthSuccess, bayunAuthFailure);\n\n }\n// BayunApplication.bayunCore.registerEmployeeWithPassword\n// (activity,companyName,user.getUserId(),signUpPassword, authorizeEmployeeCallback, bayunAuthSuccess, bayunAuthFailure);\n\n\n }",
"public void signUp(View v) {\n attemptRegistration();\n }",
"private void signUp() {\n if (mAuthTask != null) {\n return;\n }\n\n // Reset errors.\n mEmailView.setError(null);\n mPasswordView.setError(null);\n\n // Store values at the time of the login attempt.\n String email = mEmailView.getText().toString();\n String password = mPasswordView.getText().toString();\n\n boolean cancel = false;\n View focusView = null;\n\n // Check for a valid password, if the user entered one.\n if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) {\n mPasswordView.setError(getString(R.string.error_invalid_password));\n focusView = mPasswordView;\n cancel = true;\n }\n\n // Check for a valid email address.\n if (TextUtils.isEmpty(email)) {\n mEmailView.setError(getString(R.string.error_field_required));\n focusView = mEmailView;\n cancel = true;\n } else if (!isEmailValid(email)) {\n mEmailView.setError(getString(R.string.error_invalid_email));\n focusView = mEmailView;\n cancel = true;\n }\n\n if (cancel) {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n focusView.requestFocus();\n } else {\n // Show a progress spinner, and kick off a background task to\n // perform the user login attempt.\n showProgress(true);\n mAuthTask = new UserLoginTask(email, password, true);\n mAuthTask.execute((Void) null);\n }\n }",
"void signInComplete();",
"public void attemptSighup(View view) {\n //Start AsyncTask for signup\n new SignUpCreatorTask().execute(\"\");\n }",
"public void confirmSignUp(Activity activity, CognitoUser user, String confirmCode,\n boolean forcedAliasCreation, GenericHandler confirmHandler) {\n // Callback for Cognito sign up confirmation\n GenericHandler wrapperConfirmHandler = new GenericHandler() {\n @Override\n public void onSuccess() {\n // Bayun Registration success Callback\n Handler.Callback bayunAuthSuccess = msg -> {\n confirmHandler.onSuccess();\n return false;\n };\n\n\n // Bayun Registration failure Callback\n Handler.Callback bayunAuthFailure = msg -> {\n Exception exception = new Exception(msg.getData().getString(Constants.ERROR));\n confirmHandler.onFailure(exception);\n return false;\n };\n\n // Bayun Registration authorizeEmployeeCallback Callback\n Handler.Callback authorizeEmployeeCallback = msg -> {\n String employeePublicKey = msg.getData().getString(Constants.EMPLOYEE_PUBLICKEY);\n Exception exception = new Exception(\"Employee Authorization is Pending\");\n confirmHandler.onFailure(exception);\n return false;\n };\n\n // Registration with Bayun\n BasicBayunCredentials basicBayunCredentials = new BasicBayunCredentials\n (appId, companyName, user.getUserId(), signUpPassword.toCharArray(),\n appSecret, applicationKeySalt);\n\n\n if(signUpIsRegisterWithPwd){\n BayunApplication.bayunCore.registerEmployeeWithPassword\n (activity,companyName,user.getUserId(),signUpPassword, authorizeEmployeeCallback, bayunAuthSuccess, bayunAuthFailure);\n }else {\n BayunApplication.bayunCore.registerEmployeeWithoutPassword(activity,companyName,user.getUserId()\n ,signUpEmail,false, authorizeEmployeeCallback,\n null,null,null, bayunAuthSuccess, bayunAuthFailure);\n\n }\n// BayunApplication.bayunCore.registerEmployeeWithPassword\n// (activity,companyName,user.getUserId(),signUpPassword, authorizeEmployeeCallback, bayunAuthSuccess, bayunAuthFailure);\n\n\n }\n\n @Override\n public void onFailure(Exception exception) {\n confirmHandler.onFailure(exception);\n }\n };\n\n // Confirmation call with Cognito\n user.confirmSignUpInBackground(confirmCode, forcedAliasCreation, wrapperConfirmHandler);\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task)\n {\n String TAG = \"LoginActivity.userRegister\";\n if (task.isSuccessful())\n {\n Log.d(TAG, \"createUserWithEmailAndPassword:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n\n user.sendEmailVerification()\n .addOnCompleteListener(new OnCompleteListener<Void>()\n {\n @Override\n public void onComplete(@NonNull Task<Void> task)\n {\n String TAG = \"LoginActivity.userRegister.EmailVerify\";\n if (task.isSuccessful())\n {\n Log.d(TAG, \"sendEmailVerification:success\");\n Toast.makeText(getActivity(),\n \"Please check Email for Verification\",Toast.LENGTH_SHORT).show();\n }\n else\n {\n Log.w(TAG, \"sendEmailVerification:failure\", task.getException());\n Toast.makeText(getActivity(),\"Unable to Verify: \"\n + task.getException().getMessage(),Toast.LENGTH_SHORT).show();\n\n }\n }\n });\n }\n else\n {\n Log.w(TAG, \"createUserWithEmailAndPassword:failure\", task.getException());\n Toast.makeText(getActivity(), \"Unable to Register: \"\n + task.getException().getMessage(), Toast.LENGTH_SHORT).show();\n }\n }",
"public void onSignupFailed() {\n\n _signupButton.setEnabled(true);\n }",
"@Override\n public void onRegistrationAccomplished() {\n Prefs.setSignedIn(true);\n // Proceed to Main\n proceedToMainActivityAndFinish();\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful())\n {\n addNewUserData(auth.getUid(), email, username);\n if (onCompleteListener != null) {\n onCompleteListener.onComplete(task);\n }\n }\n else\n {\n Toast.makeText(activity, \"faile to register ,Invalid email address Or the email is already registered\", Toast.LENGTH_SHORT).show();\n }\n }",
"public void run() {\n onSignupFailed();\n progressDialog.dismiss();\n }",
"public void registerUser(String email, String password){\n fbAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(TAG, \"createUserWithEmail:success\");\n FirebaseUser user = fbAuth.getCurrentUser();\n updateUI(user);\n Toast.makeText(Signup.this, \"Registration success.\",\n Toast.LENGTH_SHORT).show();\n } else {\n // If sign in fails, display a message to the user.\n Log.w(TAG, \"createUserWithEmail:failure\", task.getException());\n Toast.makeText(Signup.this, \"Registration failed.\",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n progressBar.setVisibility(View.GONE);\n if (!task.isSuccessful()) {\n // there was an error\n if (password.length() < 6) {\n passwordW.setError(getString(R.string.minimum_password));\n } else {\n Toast.makeText(SignUpActivity.this, getString(R.string.auth_failed), Toast.LENGTH_LONG).show();\n }\n } else {\n\n FirebaseUser user = auth.getCurrentUser();\n UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()\n .setDisplayName(dpName)\n .build();\n\n user.updateProfile(profileUpdates)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Toast.makeText(SignUpActivity.this, \"User Created! Welcome to Udghosh.\", Toast.LENGTH_LONG).show();\n }\n else {\n Toast.makeText(SignUpActivity.this, \"Cannot connect to servers right now.\", Toast.LENGTH_LONG).show();\n }\n }\n });\n mDatabase.child(\"app\").child(\"users\").child(user.getUid()).setValue(phoneNumber);\n\n Intent intent = new Intent(SignUpActivity.this, HomeActivity.class);\n startActivity(intent);\n finish();\n }\n }",
"void onSignUpEmailRegistered();",
"public void signUp() {\n presenter.signup(username.getText().toString(), password.getText().toString());\n }",
"@Override\r\n\t\t\t\t\t\tpublic void done(ParseException e) {\n\t\t\t\t\t\t\tif(e == null) {\r\n\t\t\t\t\t\t\t\tToast.makeText(SignUpActivity.this, \"Signup Successfull\", Toast.LENGTH_LONG).show();\r\n\t\t\t\t\t\t\t\tParseInstallation currentInstallation = ParseInstallation.getCurrentInstallation();\r\n\t\t\t\t\t\t\t\tcurrentInstallation.put(\"username\", ParseUser.getCurrentUser().getObjectId());\r\n\t\t\t\t\t\t\t\tcurrentInstallation.put(\"useremail\", ParseUser.getCurrentUser().getEmail());\r\n\t\t\t\t\t\t\t\tcurrentInstallation.saveInBackground();\r\n\t\t\t\t\t\t\t\tIntent intent = new Intent(SignUpActivity.this, MainActivity.class);\r\n\t\t\t\t\t\t\t\tstartActivity(intent);\r\n\t\t\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tToast.makeText(SignUpActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}",
"@Override\n public void onRegistrationSuccess() {\n listener.onUsernameAvailabilityChecked(false);\n }",
"public void signUp(View view){\n\n\n\n if(signUpCheck) {\n\n\n if (TextUtils.isEmpty(userName.getText().toString()) || TextUtils.isEmpty(password.getText().toString()) || TextUtils.isEmpty(email.getText().toString())) {\n Toast.makeText(this, \"A Username, a Password, and an Email are required.\", Toast.LENGTH_SHORT).show();\n } else {\n\n ParseUser user = new ParseUser();\n\n user.setUsername(userName.getText().toString());\n user.setEmail(email.getText().toString());\n user.setPassword(password.getText().toString());\n\n user.signUpInBackground(new SignUpCallback() {\n @Override\n public void done(ParseException e) {\n if (e == null) {\n //Log.i(\"Signup\", \"Successful\");\n showEventListActivity();\n } else {\n Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n }\n });\n }\n }\n else{\n\n\n ParseUser.logInInBackground(userName.getText().toString(), password.getText().toString(), new LogInCallback() {\n @Override\n public void done(ParseUser user, ParseException e) {\n\n if(user != null){\n //Log.i(\"Signup\", \"Login Successful\");\n showEventListActivity();\n }\n else{\n Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n }\n });\n\n }\n\n\n\n }",
"private void signUpNewUserToDB(){\n dbAuthentication.createUserWithEmailAndPassword(this.newUser.getEmail(), this.newUser.getPassword())\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n /**signUp success, will update realTime DB ant firebase Authentication*/\n FirebaseUser currentUser = dbAuthentication.getCurrentUser();\n addToRealDB(currentUser.getUid());\n /**will send verification email to the user from Firebase Authentication*/\n currentUser.sendEmailVerification().addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n }\n });\n }else{isBadEmail = true;}\n }\n });\n }",
"private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }",
"public void signupPressed(View view) {\n // fetch the values\n usernameSignup = (EditText) findViewById(R.id.usernameSignupFragment);\n emailSignup = (EditText) findViewById(R.id.emailSignupFragment);\n passwordSignup = (EditText) findViewById(R.id.passwordSignupFragment);\n reenterPasswordSignup = (EditText) findViewById(R.id.reenterPasswordSignupFragment);\n\n String username = usernameSignup.getText().toString();\n String email = emailSignup.getText().toString();\n String password1 = passwordSignup.getText().toString();\n String password2 = reenterPasswordSignup.getText().toString();\n\n // input validation\n if (username.length() == 0) {\n Toast.makeText(getApplicationContext(), \"Please enter a username.\", Toast.LENGTH_SHORT).show();\n } else if (password1.length() == 0) {\n Toast.makeText(getApplicationContext(), \"Please enter a password.\", Toast.LENGTH_SHORT).show();\n } else if (!validatePassword(password1, password2)) {\n Toast.makeText(getApplicationContext(), \"Passwords do not match, try again.\", Toast.LENGTH_SHORT).show();\n } else if (!passwordLongEnough(password1)) {\n Toast.makeText(getApplicationContext(), \"Password too short - must be minimum 8 characters.\", Toast.LENGTH_SHORT).show();\n } else try {\n if (emailAlreadyExists(email)) {\n Toast.makeText(getApplicationContext(), \"Account already exists with this email.\", Toast.LENGTH_SHORT).show();\n } else if (!validateEmail(email)) {\n Toast.makeText(getApplicationContext(), \"Please enter a valid email.\", Toast.LENGTH_SHORT).show();\n } else try {\n if (!usernameAvailable(username)) {\n Toast.makeText(getApplicationContext(), \"Sorry, username already taken.\", Toast.LENGTH_SHORT).show();\n } else {\n // setup a user object with the given attributes, save and enter the app\n final TipperUser user = new TipperUser();\n user.setUsername(username);\n\n // hash password with salt\n String hashed = BCrypt.hashpw(password1, BCrypt.gensalt());\n user.setPassword(hashed);\n\n user.setEmail(email);\n user.setGoogleUser(false);\n user.setFacebookUser(false);\n user.setUuidString();\n\n user.save();\n app.setCurrentUser(user);\n user.pinInBackground();\n Intent intent = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(intent);\n }\n } catch (ParseException e) {\n e.printStackTrace();\n }\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n\n\n saveUser save = new saveUser(registerEmailString, registerPassword);\n FirebaseDatabase.getInstance().getReference(\"Register\").child(FirebaseAuth.\n getInstance().getCurrentUser().getUid()).setValue(save).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n\n if (task.isSuccessful()) {\n progressDialog.dismiss();\n Toast.makeText(Sign_Up.this, \"Sign up successful\", Toast.LENGTH_SHORT).show();\n\n pleaseWait.setVisibility(View.GONE);//\n Intent bac = new Intent(Sign_Up.this, Sign_In.class);\n startActivity(bac);\n\n } else {\n progressDialog.dismiss();\n Toast.makeText(Sign_Up.this, \"Email already exist error\", Toast.LENGTH_SHORT).show();\n pleaseWait.setVisibility(View.GONE);\n\n }\n }\n });\n } else {\n progressDialog.dismiss();\n Toast.makeText(Sign_Up.this, \"Error try again\", Toast.LENGTH_SHORT).show();\n pleaseWait.setVisibility(View.GONE);\n }\n }",
"public void onSignUpClick() {\n\t\tString uid = regview.getUsername();\n\t\tString pw = regview.getPassword();\n\t\tString na = regview.getName();\n\t\tString em = regview.getEmail();\n\t\tString text = \"\";\n\t\tif(uid.equals(\"\") || pw.equals(\"\") || na.equals(\"\")|| em.equals(\"\")){\n\t\t\ttext = \"Please fill out all fields!\";\n\t\t} else if(regview.findUser(uid)!=User.NULL_USER){\n\t\t\ttext = \"The username already exsit, please try another one!\";\n\t\t} else {\n\t\t\tregview.addUser(new User(uid,pw,na,em));\n\t\t\tregview.goLoginPage();\n\t\t}\n\t\tregview.setRegisterText(text);\n\t}",
"public void createAccount (String email, String password) {\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n if (!task.isSuccessful()) {\n Toast.makeText(Login.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(Login.this, \"Registration Successful\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n //Sign in existing users\n mAuth.signInWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n //Log.d(TAG, \"signInWithEmail:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n if (!task.isSuccessful()) {\n //Log.w(TAG, \"signInWithEmail\", task.getException());\n Toast.makeText(Login.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n }",
"public void signUp(UserSignUpRequest userSignUpRequest) {\n apiInterface.signUp(\n userSignUpRequest\n )\n .subscribeOn(Schedulers.io())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(\n new Observer<Response<ResponseBody>>() {\n @Override\n public void onSubscribe(Disposable d) {\n\n }\n\n @Override\n public void onNext(Response<ResponseBody> responseBodyResponse) {\n if (responseBodyResponse.code() == 201) {\n try {\n //noinspection ConstantConditions\n saveUserData(\n new Gson().fromJson(\n responseBodyResponse.body().string(),\n UserData.class\n )\n );\n } catch (IOException e) {\n e.printStackTrace();\n }\n mutableLiveDataSignUpResult.postValue(\n new Event<>(\n new Result(\n Enums.Result.SUCCESS, \"\"\n )\n )\n );\n } else {\n mutableLiveDataSignUpResult.postValue(\n new Event<>(\n new Result(\n Enums.Result.FAIL,\n getErrorMessage(responseBodyResponse.errorBody())\n )\n )\n );\n }\n }\n\n @Override\n public void onError(Throwable e) {\n mutableLiveDataSignUpResult.postValue(\n new Event<>(\n new Result(\n Enums.Result.FAIL,\n getErrorMessage(e)\n )\n )\n );\n }\n\n @Override\n public void onComplete() {\n\n }\n }\n );\n }",
"private void signUpEvt() {\n String emailRegex = \"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\n // Get User Details\n String fullname = this.view.getWelcomePanel().getSignUpPanel().getFullnameText().getText().trim();\n String email = this.view.getWelcomePanel().getSignUpPanel().getEmailText().getText().trim();\n String password = new String(this.view.getWelcomePanel().getSignUpPanel().getPasswordText().getPassword()).trim();\n\n if (!fullname.equals(\"\") && !email.equals(\"\") && !password.equals(\"\")) {\n if (email.matches(emailRegex)) {\n if (model.getSudokuDB().registerUser(fullname, email, password)) {\n view.getWelcomePanel().getCardLayoutManager().next(view.getWelcomePanel().getSlider());\n // Clear Fields\n view.getWelcomePanel().getSignUpPanel().clear();\n Object[] options = {\"OK\"};\n JOptionPane.showOptionDialog(this, \"Your registration was successful!\\n You can now sign in to your account.\", \"Successful Registration\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n } else {\n Object[] options = {\"Let me try again\"};\n JOptionPane.showOptionDialog(this, \"Your registration was unsuccessful!\\nBe sure not to create a duplicate account.\", \"Unsuccessful Registration\", JOptionPane.OK_OPTION, JOptionPane.ERROR_MESSAGE, null, options, null);\n }\n } else {\n // Email doesn't meet requirement\n Object[] options = {\"I will correct that\"};\n JOptionPane.showOptionDialog(this, \"You must provide a valid email address.\", \"Invalid Email Address\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n }\n } else {\n // Empty Fields\n Object[] options = {\"Alright\"};\n JOptionPane.showOptionDialog(this, \"In order to register, all fields must be filled out.\", \"Empty Fields\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n }\n }",
"private void onSignUpFailed()\n\t{\n\t\tToast.makeText(SignupPersonalActivity.this, \"Signup failed.\",\n\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t_signupButton.setEnabled(true);\n\t}",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n progressBar.setVisibility(View.GONE);\n\n if (!task.isSuccessful()) {\n Toast.makeText(RegisterActivity.this, \"Registration failed, Check your Network Connection!\", Toast.LENGTH_SHORT).show();\n } else {\n onAuthSuccess(task.getResult().getUser());\n //Toast.makeText(RegisterActivity.this, \"we will make pass of login here\", Toast.LENGTH_SHORT).show();\n //finish();\n }\n }",
"public void register(View view) {\n if(radioGroup.getCheckedRadioButtonId() == -1){\n Snackbar.make(getCurrentFocus(),\"Please select one of the Options: Student or Professor\",Snackbar.LENGTH_LONG).show();\n return;\n }\n if (usn.getText().toString().trim().equals(\"\")){\n usn.setError(\"This field cannot be empty\");\n return;\n } else if (password.getText().toString().trim().equals(\"\")){\n password.setError(\"This field cannot be empty\");\n return;\n } else if(password.getText().toString().trim().length() < 8){\n password.setError(\"Password too short.\");\n return;\n } else if(confirmPassword.getText().toString().trim().equals(\"\")){\n confirmPassword.setError(\"This field cannot be empty\");\n return;\n } else if(!(password.getText().toString().trim()\n .equals(confirmPassword.getText().toString().trim()))){\n password.setError(\"Passwords do not match\");\n confirmPassword.setError(\"Passwords do not match\");\n return;\n }\n progressBar.setVisibility(View.VISIBLE);\n mAuth.signInAnonymously().addOnSuccessListener(authResult -> myRef.child(usn.getText().toString().trim()).addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n try {\n String username = dataSnapshot.child(\"emailId\").getValue().toString();\n String password = confirmPassword.getText().toString().trim();\n System.out.println(username);\n mAuth.createUserWithEmailAndPassword(username,password)\n .addOnCompleteListener(RegisterActivity.this,task -> {\n Log.d(\"TAG\",\"Created User:\"+task.isSuccessful());\n if(!task.isSuccessful()){\n Toast.makeText(RegisterActivity.this, \"Error occurred.\" +\n \" Could not create user. Please \" +\n \"check your internet connection\", Toast.LENGTH_LONG).show();\n return;\n }\n else {\n startActivity(new Intent(RegisterActivity.this,LoginActivity.class));\n finish();\n }\n });\n\n }catch (NullPointerException e){\n usn.setError(\"Invalid USN. Please check your input or contact\" +\n \" your department for help\");\n progressBar.setVisibility(View.INVISIBLE);\n }\n }\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n }))\n .addOnFailureListener(e -> {\n progressBar.setVisibility(View.INVISIBLE);\n Snackbar.make(view,\"Something went wrong.Please check if you have an internet connection or that the details\" +\n \"entered are valid\",Snackbar.LENGTH_LONG).show();\n });\n }",
"public void UserSignUp(View view)\n {\n // get the data from text fields\n inputName = ((EditText) findViewById(R.id.signUpEditTextName)).getText().toString();\n inputEmail = ((EditText) findViewById(R.id.signUpEditTextEmail)).getText().toString();\n inputPhoneNumber = ((EditText) findViewById(R.id.signUpEditTextPhoneNumber)).getText().toString();\n inputPassword = ((EditText) findViewById(R.id.signUpEditTextPassword)).getText().toString();\n inputRepeatPassword = ((EditText) (findViewById(R.id.signUpEditTextRepeatPassword))).getText().toString();\n\n // If some text fields are empty\n if(inputName.equals(\"\") || inputEmail.equals(\"\") || inputPhoneNumber.equals(\"\")\n || inputPassword.equals(\"\") || inputRepeatPassword.equals(\"\")) {\n Toast.makeText(SignUpActivity.this, \"All fields are required!\", Toast.LENGTH_LONG).show();\n finish();\n startActivity(getIntent());\n }\n // if password and repeat password are matched\n else if(inputPassword.compareTo(inputRepeatPassword) == 0) {\n // if there is internet connection\n if (CheckNetworkConnection.checknetwork(getApplicationContext()))\n new CreateNewUser().execute();\n else\n Toast.makeText(SignUpActivity.this, \"No Internet Connection!\", Toast.LENGTH_LONG).show();\n }\n // if password and repeat password do not matched\n else {\n Toast.makeText(SignUpActivity.this, \"Passwords do not match!\", Toast.LENGTH_LONG).show();\n finish();\n startActivity(getIntent());\n }\n\n }",
"public void onClickSignUp(View view) {\r\n\t\tcheckRegistationValidation();\r\n\t}",
"@Override\n\tpublic void onDidFinished(SYLSignupResponseModel msylsignupresponsemodel) {\n\t\tif (msylProgressDialog != null && msylProgressDialog.isShowing()) {\n\t\t\tmsylProgressDialog.dismiss();\n\t\t}\n\t\ttry {\n\t\tif(msylsignupresponsemodel!=null)\n\t\t{\n\t\t\tif(msylsignupresponsemodel.isSuccess())\n\t\t\t\n\t\t\t{\n\t\t\t\tSYLSaveValues.setSYLusername(\"\", getActivity());\n\t\t\t\tSYLSaveValues.setProfileImageurl(\"\", getActivity());\n\t\t\t\tSYLSaveValues.setSYLusername(msylsignupresponsemodel.getSignupResponse().getName(), getActivity());\n\t\t\t\tSYLSaveValues.setProfileImageurl(msylsignupresponsemodel.getSignupResponse().getProfileImage(), getActivity());\nSYLSaveValues.setSYLEmailAddress(msylsignupresponsemodel.getSignupResponse().getEmail(),getActivity());\n\n\t\t\t getActivity().\t\tgetSupportFragmentManager().beginTransaction()\n\t\t\t\t.replace(R.id.menu_frame, new SYLMenuFragment())\n\t\t\t\t.commit();\n\t\t\t\tif(msylsignupresponsemodel.getSignupResponse().isVerified())\n\t\t\t\t{\n\t\t\t\t\tSYLUtil.buildAlertMessage(getActivity(),\"Profile updated successfully\");\n\t\t\t\t}\n\t\t\telse{\n\t\t\t\t\tbuildAlertMessage(getActivity(), \"Your profile Updated with your changed email.Please enter the verification code which we have send to your\" + msylsignupresponsemodel.getSignupResponse().getEmail()+\"to complete the validation process\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSYLUtil.buildAlertMessage(getActivity(),msylsignupresponsemodel.getError().getErrorDetail());\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tSYLUtil.buildAlertMessage(getActivity(),\"Unexpected server error happened\");\n\t\t}\n\t\t}\n\tcatch(Exception e)\t\n\t{\n\t\tSYLUtil.buildAlertMessage(getActivity(),\"Unexpected server error happened\");\n\t}\n\t}",
"public void signup(View view){\r\n if(editText1.getText().toString().isEmpty()||editText2.getText().toString().isEmpty()||editText3.getText().toString().isEmpty()\r\n ||editText4.getText().toString().isEmpty()||editText5.getText().toString().isEmpty()){\r\n Toast.makeText(this, \"Παρακαλώ εισάγετε όλα τα απαραίτητα πεδία προκειμένου να εγγραφείτε.\", Toast.LENGTH_SHORT).show();\r\n }\r\n else{\r\n mAuth.createUserWithEmailAndPassword(editText1.getText().toString(), editText2.getText().toString())\r\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\r\n\r\n if (task.isSuccessful()) {\r\n new_user = mAuth.getCurrentUser();\r\n create_users_list(new_user.getUid());\r\n String userid=new_user.getUid();\r\n String firstname=editText3.getText().toString();\r\n String lastname=editText4.getText().toString();\r\n String address=editText5.getText().toString();\r\n SharedPreferences.Editor editor=pref.edit();\r\n editor.putString(userid+\"firstname\",firstname);\r\n editor.putString(userid+\"lastname\",lastname);\r\n editor.putString(userid+\"address\",address);\r\n editor.apply();\r\n Intent intent = new Intent(getApplicationContext(), MainActivity3.class);\r\n intent.putExtra(\"userid\", new_user.getUid());\r\n\r\n startActivity(intent);\r\n\r\n\r\n } else {\r\n Toast.makeText(getApplicationContext(), task.getException().getMessage(),\r\n Toast.LENGTH_SHORT).show();\r\n\r\n }\r\n }\r\n }\r\n );}}",
"public void signUpUser(final AuthActivity fromAuthActivity, String email, String password, final String displayName) {\n try {\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(fromAuthActivity, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n\n // sign in user\n FirebaseUser firebaseUser = mAuth.getCurrentUser();\n User user = new User(firebaseUser);\n loggedInUser = user;\n setUserDisplayName(displayName);\n GameManager.statisticsManager.initUserInDatabase();\n fromAuthActivity.onSignUpSuccess();\n\n } else {\n // If sign in fails, call \"callback\"\n fromAuthActivity.onSignUpError(task.getException());\n }\n }\n });\n } catch (Exception e) {\n fromAuthActivity.onSignUpError(new Exception(\"Something didn't work here :/\"));\n e.printStackTrace();\n }\n }",
"boolean hasSignupRequest();",
"void signUp(SignUpRequest signupRequest);",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n userProfileChangeRequest = new UserProfileChangeRequest.Builder().setDisplayName(name).build();\n firebaseUser = FirebaseAuth.getInstance().getCurrentUser();\n firebaseUser.updateProfile(userProfileChangeRequest);\n UsersInfo user = new UsersInfo(name, phone, mail, \"\");\n database.child(userAuth.getCurrentUser().getUid()).setValue(user);\n userRegister.onRegisterSuccess();\n } else {\n if (task.getException().getMessage().equals(\"The email address is already in use by another account.\")) {\n userRegister.onMailExistedError();\n }\n if (task.getException().getMessage().equals(\"The email address is badly formatted.\")) {\n userRegister.onMailFormatError();\n }\n }\n }",
"@Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(!task.isSuccessful())\r\n {\r\n Toast.makeText(MainActivity.this,\"Some Error Occured,Please try again later\",Toast.LENGTH_LONG).show();\r\n }\r\n if(task.isSuccessful())\r\n {\r\n Toast.makeText(MainActivity.this,\"Regristration Successful\",Toast.LENGTH_LONG).show();\r\n }\r\n }",
"@OnClick(R.id.fragment_register_sign_up_button)\n public void validateSignupInformation() {\n mValidator.validate();\n }",
"private void attemptRegister() {\n progressGenerator = new ProgressGenerator();\n\n // Reset errors.\n inputEmail.setError(null);\n inputPasswd.setError(null);\n\n // Store values at the time of the login attempt.\n String email = inputEmail.getText().toString();\n String password = inputPasswd.getText().toString();\n String confirmPassword = inputConfirmPasswd.getText().toString();\n\n // Check for a valid email address.\n if (TextUtils.isEmpty(email)) {\n inputEmail.setError(getString(R.string.error_field_required));\n inputEmail.requestFocus();\n shake();\n return;\n } else if (!isEmailValid(email)) {\n inputEmail.setError(getString(R.string.error_invalid_email));\n inputEmail.requestFocus();\n shake();\n return;\n }\n\n // Check for a valid password, if the user entered one.\n if (TextUtils.isEmpty(password) || !isPasswordValid(password)) {\n inputPasswd.setError(getString(R.string.error_invalid_password));\n inputPasswd.requestFocus();\n shake();\n return;\n }\n\n // Check if passwords match\n if (!confirmPassword.equals(password)) {\n inputConfirmPasswd.setError(getString(R.string.error_password_does_not_match));\n inputConfirmPasswd.requestFocus();\n shake();\n return;\n }\n\n // Show a progress spinner, and kick off a background task to\n // perform the user login attempt.\n isRegistering = true;\n btnRegister.requestFocus();\n\n progressGenerator.start(btnRegister);\n btnRegister.setEnabled(false);\n inputEmail.setEnabled(false);\n inputPasswd.setEnabled(false);\n inputConfirmPasswd.setEnabled(false);\n\n LoginAgent.getInstance().registerInBackground(email, password);\n }",
"public void attemptSignUp() {\n\tif (mAuthTask != null) {\n\t return;\n\t}\n\n\t// Reset errors.\n\tmUsernameView.setError(null);\n\tmNameView.setError(null);\n\tmEmailView.setError(null);\n\tmPasswordView.setError(null);\n\n\t// Store values at the time of the login attempt.\n\tmUsername = mUsernameView.getText().toString().trim();\n\tmName = mNameView.getText().toString();\n\tmEmail = mEmailView.getText().toString();\n\tmPassword = mPasswordView.getText().toString();\n\n\tboolean cancel = false;\n\tView focusView = null;\n\n\t// Check for a valid username\n\tif (TextUtils.isEmpty(mUsername)) {\n\t mUsernameView.setError(getString(R.string.error_field_required));\n\t focusView = mUsernameView;\n\t cancel = true;\n\t} else if (TextUtils.split(mUsername, \" \").length > 1) {\n\t mUsernameView.setError(\"Username can not have spaces\");\n\t}\n\n\t// Check for a valid name\n\tif (TextUtils.isEmpty(mName)) {\n\t mNameView.setError(getString(R.string.error_field_required));\n\t focusView = mNameView;\n\t cancel = true;\n\t}\n\n\t// Check for a valid password.\n\tif (TextUtils.isEmpty(mPassword)) {\n\t mPasswordView.setError(getString(R.string.error_field_required));\n\t focusView = mPasswordView;\n\t cancel = true;\n\t} else if (mPassword.length() != 4 || !TextUtils.isDigitsOnly(mPassword)) {\n\t mPasswordView.setError(getString(R.string.error_invalid_password));\n\t focusView = mPasswordView;\n\t cancel = true;\n\t}\n\n\t// Check for a valid email address.\n\tif (TextUtils.isEmpty(mEmail)) {\n\t mEmailView.setError(getString(R.string.error_field_required));\n\t focusView = mEmailView;\n\t cancel = true;\n\t} else if (!mEmail.contains(\"@\")) {\n\t mEmailView.setError(getString(R.string.error_invalid_email));\n\t focusView = mEmailView;\n\t cancel = true;\n\t}\n\n\tif (cancel) {\n\t // There was an error; don't attempt login and focus the first\n\t // form field with an error.\n\t focusView.requestFocus();\n\t} else {\n\t // Show a progress spinner, and kick off a background task to\n\t // perform the user login attempt.\n\t mLoginStatusMessageView.setText(R.string.login_progress_signing_in);\n\t showProgress(true);\n\t mAuthTask = new UserSignUpTask();\n\t mAuthTask.execute((Void) null);\n\t}\n }",
"@Override\n public void onClick(View view) {\n if (validate()) {\n String user_email = create_email.getText().toString().trim();\n String user_password = create_password.getText().toString().trim();\n firebaseAuth.createUserWithEmailAndPassword(user_email, user_password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n if (task.isSuccessful()) {\n //sendEmailVerification();\n //sendUserData();\n firebaseAuth.signOut();\n Toast.makeText(CreateNewSurvey.this, \"Successfully Registered, Upload complete!\", Toast.LENGTH_SHORT).show();\n finish();\n startActivity(new Intent(CreateNewSurvey.this, Main2Activity.class));\n } else {\n Toast.makeText(CreateNewSurvey.this, \"Registration Failed\", Toast.LENGTH_SHORT).show();\n }\n\n }\n\n });\n }\n }",
"@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n storageReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n userModel.setIdUrl(uri.toString());\n FirebaseAuth.getInstance().createUserWithEmailAndPassword(userModel.getEmail(), userModel.getPassword())\n .addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n FirebaseFirestore.getInstance().collection(\"USERS\").add(userModel)\n .addOnCompleteListener(task1 -> {\n if (task1.isSuccessful()) {\n Toast.makeText(RegisterActivity.this, \"Registered Successfully\", Toast.LENGTH_SHORT).show();\n\n Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);\n startActivity(intent);\n } else\n Toast.makeText(RegisterActivity.this, \"\" + task1.getException(), Toast.LENGTH_SHORT).show();\n\n });\n\n } else\n Toast.makeText(RegisterActivity.this, \"\" + task.getException(), Toast.LENGTH_SHORT).show();\n }\n });\n }\n });\n }",
"public void onSignUpFailed() {\n Toast.makeText(this, getString(R.string.account_creation_failed), Toast.LENGTH_LONG).show();\n mSignUpButton.setEnabled(true);\n }",
"@Override\n protected void onPostExecute(Response<Result> resultResponse) {\n if (resultResponse.body().getCodigo()==400) {\n dialog.dismiss();\n activity.onSignupSuccess();\n } else {\n if ((dialog != null) && dialog.isShowing()) {\n dialog.dismiss();\n dialog = null;\n }\n activity.onSignupFailed();\n }\n }",
"private void userRegister(String email, String password)\n {\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(getActivity(), new OnCompleteListener<AuthResult>()\n {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task)\n {\n // if successful, send email verification\n String TAG = \"LoginActivity.userRegister\";\n if (task.isSuccessful())\n {\n Log.d(TAG, \"createUserWithEmailAndPassword:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n\n user.sendEmailVerification()\n .addOnCompleteListener(new OnCompleteListener<Void>()\n {\n @Override\n public void onComplete(@NonNull Task<Void> task)\n {\n String TAG = \"LoginActivity.userRegister.EmailVerify\";\n if (task.isSuccessful())\n {\n Log.d(TAG, \"sendEmailVerification:success\");\n Toast.makeText(getActivity(),\n \"Please check Email for Verification\",Toast.LENGTH_SHORT).show();\n }\n else\n {\n Log.w(TAG, \"sendEmailVerification:failure\", task.getException());\n Toast.makeText(getActivity(),\"Unable to Verify: \"\n + task.getException().getMessage(),Toast.LENGTH_SHORT).show();\n\n }\n }\n });\n }\n else\n {\n Log.w(TAG, \"createUserWithEmailAndPassword:failure\", task.getException());\n Toast.makeText(getActivity(), \"Unable to Register: \"\n + task.getException().getMessage(), Toast.LENGTH_SHORT).show();\n }\n }\n });\n }",
"boolean signUp(User user);",
"@Override\n\tpublic void onSignInSucceeded() {\n\n\t}",
"@FXML protected void handleSignUpButtonAction() {\n \tboolean bexit = false;\n \tif(passwordField.getText().equals(passwordField2.getText()))\n \t{\n \t\t\n \t\tString signUpUsername = username.getText();\n \t\tString signUpPassword = passwordField.getText();\n \t\t\n if(username.getText().toString().length() >= 6 && passwordField.getText().toString().length() >= 6)\n {\n\t \t\tUser user = new User(signUpUsername, \"Unknown\", null, \"Unknown\", signUpPassword);\n\t \t\t\n\t \t\ttry {\n\t\t\t\t\tuser = client.createUser(user);\n\t \t\t\n\t \t\t} catch (WebApplicationException e) {\n\t \t\t\tLOGGER.log(Level.SEVERE, e.toString(), e);\n\t \t\t\tif (e.getResponse().getStatus() == 409) {\n\t \t\t\t\tactiontarget.setText(\"Sign up error: Username already exists\");\n\t \t\t\t} else {\n\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t} catch (JsonProcessingException e) {\n\t \t\t\tLOGGER.log(Level.SEVERE, e.toString(), e);\n\t\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLOGGER.log(Level.SEVERE, e.toString(), e);\n\t\t\t\t}\n\t \t\t\n\t \t\t// Go back to Login view\n\t \t\t\n\t \t\tLoginVistaNavigator.loadVista(LoginVistaNavigator.LOGIN);\n }\n else\n {\n \tactiontarget.setText(\"username/password \\nlength must be 6 number\");\n }\n \t}\n \telse\n \t{\n \t\tactiontarget.setText(\"password not consistent.\");\n \t}\n }",
"public void onCreateAccountPressed(View view) {\n\n\n mUserName = mEditTextUsernameCreate.getText().toString();\n mUserEmail = mEditTextEmailCreate.getText().toString().toLowerCase();\n mPassword = mEditTextPasswordCreate.getText().toString();\n\n /**\n * Check that email and user name are okay\n */\n boolean validEmail = isEmailValid(mUserEmail);\n boolean validUserName = isUserNameValid(mUserName);\n boolean validPassword = isPasswordValid(mPassword);\n if (!validEmail || !validUserName || !validPassword) return;\n /**\n * If everything was valid show the progress dialog to indicate that\n * account creation has started\n */\n mAuthProgressDialog.show();\n\n\n // [START create_user_with_email]\n mAuth.createUserWithEmailAndPassword(mUserEmail, mPassword)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(LOG_TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n if (!task.isSuccessful()) {\n Toast.makeText(CreateAccountActivity.this, R.string.auth_failed,\n Toast.LENGTH_SHORT).show();//error message\n //showErrorToast(\"createUserWithEmail : \"+task.isSuccessful());\n }\n\n // [START_EXCLUDE]\n mAuthProgressDialog.dismiss();\n Intent intent = new Intent(CreateAccountActivity.this, LoginActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n finish();\n // [END_EXCLUDE]\n //end\n }\n });\n // [END create_user_with_email]\n\n\n\n /**\n * Create new user with specified email and password\n */\n /*mFirebaseRef.createUser(mUserEmail, mPassword, new Firebase.ValueResultHandler<Map<String, Object>>() {\n @Override\n public void onSuccess(Map<String, Object> result) {\n Dismiss the progress dialog\n mAuthProgressDialog.dismiss();\n Log.i(LOG_TAG, getString(R.string.log_message_auth_successful));\n }\n\n @Override\n public void onError(FirebaseError firebaseError) {\n *//* Error occurred, log the error and dismiss the progress dialog *//*\n Log.d(LOG_TAG, getString(R.string.log_error_occurred) +\n firebaseError);\n mAuthProgressDialog.dismiss();\n *//* Display the appropriate error message *//*\n if (firebaseError.getCode() == FirebaseError.EMAIL_TAKEN) {\n mEditTextEmailCreate.setError(getString(R.string.error_email_taken));\n } else {\n showErrorToast(firebaseError.getMessage());\n }\n\n }\n });*/\n }",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (!(API.isInternetOn(Register.this))) {\r\n\t\t\t\t\tshowAlert(\"Internet not avialble.\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprogressdialog.setMessage(\"Please wait...\");\r\n\t\t\t\t\tprogressdialog.show();\r\n\t\t\t\t\t// Force user to fill up the form\r\n\t\t\t\t\tif (username.getText().toString().equals(\"\")\r\n\t\t\t\t\t\t\t|| email.getText().toString().equals(\"\")\r\n\t\t\t\t\t\t\t|| password.getText().toString().equals(\"\")\r\n\t\t\t\t\t\t\t|| verifyPassword.getText().toString().equals(\"\")) {\r\n\t\t\t\t\t\tprogressdialog.dismiss();\r\n\t\t\t\t\t\tshowAlert(\"Please complete the sign up form.\");\r\n\t\t\t\t\t} else if (!(isValidEmail(email.getText().toString()))) {\r\n\t\t\t\t\t\tprogressdialog.dismiss();\r\n\t\t\t\t\t\tshowAlert(\"Please enter valid email id.\");\r\n\t\t\t\t\t} else if (!(password.getText().toString()\r\n\t\t\t\t\t\t\t.equals(verifyPassword.getText().toString()))) {\r\n\t\t\t\t\t\tprogressdialog.dismiss();\r\n\t\t\t\t\t\tshowAlert(\"Password did not matched\");\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// Save new user data into Parse.com Data Storage\r\n\t\t\t\t\t\tParseUser user = new ParseUser();\r\n\t\t\t\t\t\tuser.setUsername(username.getText().toString());\r\n\t\t\t\t\t\tuser.setPassword(password.getText().toString());\r\n\t\t\t\t\t\tuser.setEmail(email.getText().toString());\r\n\t\t\t\t\t\tuser.signUpInBackground(new SignUpCallback() {\r\n\t\t\t\t\t\t\tpublic void done(ParseException e) {\r\n\t\t\t\t\t\t\t\tif (e == null) {\r\n\t\t\t\t\t\t\t\t\tAllowUserToLogin(username.getText()\r\n\t\t\t\t\t\t\t\t\t\t\t.toString(), password.getText()\r\n\t\t\t\t\t\t\t\t\t\t\t.toString());\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tprogressdialog.dismiss();\r\n\t\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\r\n\t\t\t\t\t\t\t\t\t\t\t\"Sign up Error\", Toast.LENGTH_LONG)\r\n\t\t\t\t\t\t\t\t\t\t\t.show();\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}\r\n\t\t\t\t}\r\n\t\t\t}",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\n //delete user just created\n user.delete();\n //prompt user to create account\n Toast.makeText(MainActivity.this, \"No Email Exist \", Toast.LENGTH_SHORT).show();\n Toast.makeText(MainActivity.this, \"Create New Account \", Toast.LENGTH_SHORT).show();\n } else {\n // if failed, email already exist and move on to verify passoword\n //Toast.makeText(MainActivity.this, \"Loggin In\", Toast.LENGTH_SHORT).show();\n sentReset(finalInputUsername);\n }\n }",
"@Override\n public void onComplete(@NonNull Task<Void> task) {\n\n if(task.isSuccessful()){\n Toast.makeText(RegistrationActivity.this, \"User has been registered successfully!\", Toast.LENGTH_LONG).show();\n progressBar.setVisibility(View.GONE);\n\n //Then redirect to login layout\n } else {\n Toast.makeText(RegistrationActivity.this,\"Failed to register. Try again.\", Toast.LENGTH_LONG).show();\n progressBar.setVisibility(View.GONE);\n }\n\n }",
"public void signup(){\n\t\tboolean result = SignUpForm.display(\"Chocolate Chiptunes - Sign Up\", \"Sign-Up Form\");\n\t\tSystem.out.println(result);\n\t}",
"public interface OnSignUpFinishedListener {\n void userNameError();\n void passwordError();\n void mailError();\n void exitoOperacion(String preferencia, String sesion);\n}",
"private void sign_up() {\n final String name = nameET.getText().toString().trim();\n final String cell = cellET.getText().toString().trim();\n final String division = divisionET.getText().toString().trim();\n final String address = addressEt.getText().toString().trim();\n final String password = passwordET.getText().toString().trim();\n final String account_type = accouttypeET.getText().toString().trim();\n final String status=\"Pending\";\n\n\n //Checking field/validation\n if (name.isEmpty()) {\n nameET.setError(\"Please enter name !\");\n requestFocus(nameET);\n }\n else if (cell.length()!=11) {\n\n cellET.setError(\"Please enter valid phone number !\");\n requestFocus(cellET);\n\n }\n\n else if (division.isEmpty()) {\n\n divisionET.setError(\"Please select division !\");\n requestFocus(divisionET);\n Toasty.error(this, \"Please select division !\", Toast.LENGTH_SHORT).show();\n }\n else if (address.isEmpty()) {\n\n addressEt.setError(\"Please enter full address !\");\n requestFocus(addressEt);\n }\n else if (account_type.isEmpty()) {\n\n accouttypeET.setError(\"Please select account type !\");\n requestFocus(accouttypeET);\n Toasty.error(this, \"Please select account type !\", Toast.LENGTH_SHORT).show();\n }\n else if (password.isEmpty()) {\n\n passwordET.setError(\"Please enter password !\");\n requestFocus(passwordET);\n }\n else if (password.length() < 4) {\n\n passwordET.setError(\"Password should be more than 3 characters!\");\n requestFocus(passwordET);\n }\n\n else\n {\n loading = new ProgressDialog(this);\n loading.setIcon(R.drawable.wait_icon);\n loading.setTitle(\"Sign up\");\n loading.setMessage(\"Please wait....\");\n loading.show();\n\n\n StringRequest stringRequest=new StringRequest(Request.Method.POST, Constant.SIGNUP_URL, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n\n //for track response in logcat\n Log.d(\"RESPONSE\", response);\n\n if (response.equals(\"success\")) {\n loading.dismiss();\n Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);\n Toasty.success(RegisterActivity.this, \"Registration successful\", Toast.LENGTH_SHORT).show();\n startActivity(intent);\n } else if (response.equals(\"exists\")) {\n\n Toasty.warning(RegisterActivity.this, \"User already exists!\", Toast.LENGTH_SHORT).show();\n loading.dismiss();\n\n }\n\n else if (response.equals(\"failure\")) {\n\n Toasty.error(RegisterActivity.this, \"Registration Failed!\", Toast.LENGTH_SHORT).show();\n loading.dismiss();\n\n }\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n\n Toasty.error(RegisterActivity.this, \"No Internet Connection or \\nThere is an error !!!\", Toast.LENGTH_SHORT).show();\n loading.dismiss();\n }\n }\n\n ){\n @Override\n protected Map<String, String> getParams() throws AuthFailureError {\n Map<String, String> params = new HashMap<>();\n //Adding parameters to request\n\n params.put(Constant.KEY_NAME, name);\n params.put(Constant.KEY_CELL, cell);\n params.put(Constant.KEY_DIV, division);\n params.put(Constant.KEY_ADDRESS, address);\n params.put(Constant.KEY_AC_TYPE, account_type);\n params.put(Constant.KEY_PASSWORD, password);\n params.put(Constant.KEY_STATUS, status);\n\n Log.d(\"url_info\",Constant.SIGNUP_URL);\n\n //returning parameter\n return params;\n }\n };\n\n //Adding the string request to the queue\n RequestQueue requestQueue = Volley.newRequestQueue(this);\n requestQueue.add(stringRequest);\n }\n }",
"private void RegisterGoogleSignup() {\n\n\t\ttry {\n\t\t\tLocalData data = new LocalData(SplashActivity.this);\n\n\t\t\tArrayList<String> asName = new ArrayList<String>();\n\t\t\tArrayList<String> asValue = new ArrayList<String>();\n\n\t\t\tasName.add(\"email\");\n\t\t\tasName.add(\"firstname\");\n\t\t\tasName.add(\"gender\");\n\t\t\tasName.add(\"id\");\n\t\t\tasName.add(\"lastname\");\n\t\t\tasName.add(\"name\");\n\t\t\t// asName.add(\"link\");\n\n\t\t\tasName.add(\"device_type\");\n\t\t\tasName.add(\"device_id\");\n\t\t\tasName.add(\"gcm_id\");\n\t\t\tasName.add(\"timezone\");\n\n\t\t\tasValue.add(data.GetS(LocalData.EMAIL));\n\t\t\tasValue.add(data.GetS(LocalData.FIRST_NAME));\n\t\t\tasValue.add(data.GetS(LocalData.GENDER));\n\t\t\tasValue.add(data.GetS(LocalData.ID));\n\t\t\tasValue.add(data.GetS(LocalData.LAST_NAME));\n\t\t\tasValue.add(data.GetS(LocalData.NAME));\n\t\t\t// asValue.add(data.GetS(LocalData.LINK));\n\n\t\t\tasValue.add(\"A\");\n\n\t\t\tString android_id = Secure\n\t\t\t\t\t.getString(SplashActivity.this.getContentResolver(),\n\t\t\t\t\t\t\tSecure.ANDROID_ID);\n\n\t\t\tasValue.add(android_id);\n\n\t\t\tLocalData data1 = new LocalData(SplashActivity.this);\n\t\t\tasValue.add(data1.GetS(\"gcmId\"));\n\t\t\tasValue.add(Main.GetTimeZone());\n\t\t\tString sURL = StringURLs.getQuery(StringURLs.GOOGLE_LOGIN, asName,\n\t\t\t\t\tasValue);\n\n\t\t\tConnectServer connectServer = new ConnectServer();\n\t\t\tconnectServer.setMode(ConnectServer.MODE_POST);\n\t\t\tconnectServer.setContext(SplashActivity.this);\n\t\t\tconnectServer.setListener(new ConnectServerListener() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onServerResponse(String sJSON, JSONObject jsonObject) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t\t\tLog.d(\"JSON DATA\", sJSON);\n\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\tif (sJSON.length() != 0) {\n\t\t\t\t\t\t\tJSONObject object = new JSONObject(sJSON);\n\t\t\t\t\t\t\tJSONObject response = object\n\t\t\t\t\t\t\t\t\t.getJSONObject(JSONStrings.JSON_RESPONSE);\n\t\t\t\t\t\t\tString sResult = response\n\t\t\t\t\t\t\t\t\t.getString(JSONStrings.JSON_SUCCESS);\n\n\t\t\t\t\t\t\tif (sResult.equalsIgnoreCase(\"1\") == true) {\n\n\t\t\t\t\t\t\t\tString user_id = response.getString(\"userid\");\n\n\t\t\t\t\t\t\t\tLocalData data = new LocalData(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this);\n\t\t\t\t\t\t\t\tdata.Update(\"userid\", user_id);\n\t\t\t\t\t\t\t\tdata.Update(\"name\", response.getString(\"name\"));\n\n\t\t\t\t\t\t\t\tGetNotificationCount();\n\n\t\t\t\t\t\t\t} else if (sResult.equalsIgnoreCase(\"0\") == true) {\n\n\t\t\t\t\t\t\t\tString msgcode = jsonObject.getJSONObject(\n\t\t\t\t\t\t\t\t\t\t\"response\").getString(\"msgcode\");\n\n\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\t\t\tSplashActivity.this, msgcode),\n\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\t\tSplashActivity.this, \"c100\"),\n\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} catch (Exception exp) {\n\n\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this, \"c100\"),\n\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconnectServer.execute(sURL);\n\n\t\t} catch (Exception exp) {\n\n\t\t\tToast.makeText(SplashActivity.this,\n\t\t\t\t\tMain.getStringResourceByName(SplashActivity.this, \"c100\"),\n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t}\n\t}",
"private void doSignup(RoutingContext ctx){\n // Get Data from view\n JsonObject req = ctx.getBodyAsJson();\n String username = req.getString(\"username\");\n String password = req.getString(\"password\");\n\n GoogleAuthenticator authenticator = new GoogleAuthenticator();\n\n //Get Generate Key\n System.out.println(\" Calling Google Authenticator to generate AuthKey\");\n GoogleAuthenticatorKey authKey = authenticator.createCredentials();\n String key = authKey.getKey();\n System.out.println(\" Google Authenticator generated AuthKey\");\n\n //Store Data from Repository\n User user = new User(username,password,key);\n\n //send response to the user\n JsonObject res = new JsonObject().put(\"key\",key);\n ctx.response().setStatusCode(200).end(res.encode());\n }",
"private void attemptRegistration() {\n emailView.setError(null);\n passwordView.setError(null);\n\n // Store values at the time of the login attempt.\n String email = emailView.getText().toString();\n String password = passwordView.getText().toString();\n\n boolean cancel = false;\n View focusView = null;\n\n // Check for a valid password, if the user entered one.\n if (TextUtils.isEmpty(password) || !isPasswordValid(password)) {\n passwordView.setError(getString(R.string.error_invalid_password));\n focusView = passwordView;\n cancel = true;\n }\n\n // Check for a valid email address.\n if (TextUtils.isEmpty(email)) {\n emailView.setError(getString(R.string.error_field_required));\n focusView = emailView;\n cancel = true;\n } else if (!isEmailValid(email)) {\n emailView.setError(getString(R.string.error_invalid_email));\n focusView = emailView;\n cancel = true;\n }\n\n if (cancel) {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n focusView.requestFocus();\n } else {\n createFirebaseUser();\n\n }\n }",
"@Override\n public void onSuccess(AuthResult authResult) {\n Users user = new Users();\n user.setEmail(inputEmail.getText().toString());\n user.setName(inputName.getText().toString());\n user.setPhone(inputPhoneNumber.getText().toString());\n user.setPassword(inputPassword.getText().toString());\n\n users.child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .setValue(user)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Snackbar.make(relativeLayoutsignup,\"SignUp Successfully\",Snackbar.LENGTH_SHORT)\n .show();\n\n startActivity(new Intent(SignUpActivity.this,SignInActivity.class));\n finish();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Snackbar.make(relativeLayoutsignup,\"Failed\"+e.getMessage(),Snackbar.LENGTH_SHORT)\n .show();\n }\n });\n }",
"@Override\n public void onSignInSucceeded() {\n\n if (ACCESS_ACHIEVEMENT) {\n\n //if we just came from achievements button and are now signed in, display ui\n displayAchievementUI();\n\n //flag back false\n ACCESS_ACHIEVEMENT = false;\n }\n\n //don't bypass auto login\n BYPASS_LOGIN = false;\n }",
"@OnClick(R.id.register_email_register_button)\n void onClickRegister(){\n if(isInfoValidate()){\n //Call Register Http, first put the information into bundle\n// Bundle bundle = new Bundle();\n// bundle.putString(Constant.REGISTER_PHONE_NUM, mEmailAddress.getText().toString());\n// bundle.putString(Constant.REGISTER_PASSWORD, mPassword.getText().toString());\n// bundle.putInt(Constant.REGISTER_REGION, mRegionSpinner.getSelectedItemPosition());\n//\n// callRegisterHttp(mEmailAddress.getText().toString(),\n// mRegionSpinner.getSelectedItemPosition(),\n// bundle);\n\n //\n\n\n JSONObject jsonParams = new JSONObject();\n JSONObject outerJsonParams = new JSONObject();\n try {\n// jsonParams.put(\"username\", \"michael_firebasechat_1\");\n // String userNameString = mEmailAddress.getText().toString().split(\"@\")[0];\n jsonParams.put(\"username\", mUsername.getText().toString());\n jsonParams.put(\"email\", mEmailAddress.getText().toString());\n jsonParams.put(\"password\", mPassword.getText().toString());\n outerJsonParams.put(\"user\",jsonParams);\n StringEntity entity = new StringEntity(outerJsonParams.toString());\n callRegisterByEmailHttp(entity);\n } catch (JSONException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n\n }\n else {\n //Show the warning text\n new SweetAlertDialog(getContext(), SweetAlertDialog.WARNING_TYPE)\n .setTitleText(getString(R.string.warning_title))\n .setContentText(errorText)\n .setConfirmText(getString(R.string.warning_confirm))\n .show();\n }\n }",
"private void attemptSignUp() {\n // Reset errors.\n mName.setError(null);\n\n boolean cancel = false;\n View focusView = null;\n\n // Check for a valid password, if the user entered one.\n if (TextUtils.isEmpty(mName.getText().toString())) {\n mName.setError(getString(R.string.error_field_required));\n focusView = mName;\n cancel = true;\n }\n\n if (cancel) {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n focusView.requestFocus();\n } else {\n // Show a progress spinner, and kick off a background task to\n // perform the user login attempt.\n SQLiteDatabase database = DBHelper.getInstance(this).getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(DBHelper.U_NAME, mName.getText().toString());\n values.put(DBHelper.U_EMAIL, email);\n values.put(DBHelper.U_IMAGE, profileImage);\n values.put(DBHelper.U_PASSWORD, password);\n database.insert(DBHelper.TUSER, null, values);\n database.close();\n\n UserModel userData = new UserModel();\n userData.setId(0);\n userData.setName(mName.getText().toString());\n userData.setImage(profileImage);\n userData.setEmail(email);\n userData.setPassword(password);\n userData.setRememberMe(rememberMe);\n String userDataStr = new Gson().toJson(userData);\n Common.saveStrPref(this, Common.PREF_USER, userDataStr);\n\n startActivity(new Intent(this, HomeActivity.class));\n }\n }",
"public void onCreateAccountPressed(final View view) throws FirebaseAuthUserCollisionException{\n username=mEditTextUsernameCreate.getText().toString();\n email=mEditTextEmailCreate.getText().toString();\n password=mEditTextPasswordCreate.getText().toString();\n\n if(!isEmailValid(email) || !isUserNameValid(username) || !isPasswordValid(password)){\n return;\n }\n mAuthProgressDialog.show();\n final FirebaseAuth auth=FirebaseAuth.getInstance();\n final DatabaseReference ref=mReference.child(Constants.FIREBASE_LOCATION_USER_ACCOUNTS).child(Utils.encodeEmail(email));\n auth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n if (task.isSuccessful()){\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n mAuthProgressDialog.dismiss();\n ref.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.getValue()==null){\n User user=new User(username, email);\n ref.setValue(user);\n }\n else {\n showErrorToast(getResources().getString(R.string.error_email_taken));\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n Log.e(LOG_TAG, databaseError.getMessage());\n }\n });\n onSignInPressed(view);\n\n }\n else {\n mAuthProgressDialog.dismiss();\n Log.d(TAG, \"createUserWithEmail:onFailure:\" + task.getException());\n showErrorToast(task.getException().getMessage());\n\n }\n }\n\n\n });\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n\n Toast.makeText(RegistroActivity.this,\"Se ha registrado el usuario con el email: \"+ TextEmail.getText(),Toast.LENGTH_LONG).show();\n Intent intent = new Intent(RegistroActivity.this, LoginActivity.class);\n startActivity(intent);\n }\n else{\n if (task.getException() instanceof FirebaseAuthUserCollisionException) {//si se presenta una colisión\n Toast.makeText(RegistroActivity.this, \"Ese usuario ya existe \", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(RegistroActivity.this, \"No se pudo registrar el usuario \", Toast.LENGTH_LONG).show();\n }\n }\n progressDialog.dismiss();\n }",
"public void signUp() throws ExecutionException, InterruptedException {\n if (mAuthTask != null) {\n return;\n }\n\n // Reset errors.\n mPasswordView.setError(null);\n usernameView.setError(null);\n lname.setError(null);\n mEmailView.setError(null);\n cPassword.setError(null);\n age.setError(null);\n fname.setError(null);\n\n // Store values at the time of the login attempt.\n String username = usernameView.getText().toString();\n String password = mPasswordView.getText().toString();\n String email = mEmailView.getText().toString();\n String lnameS = lname.getText().toString();\n String fnameS = fname.getText().toString();\n String conPass = cPassword.getText().toString();\n String ageS = age.getText().toString();\n String gender = spinner.getSelectedItem().toString();\n\n boolean cancel = false;\n View focusView = null;\n\n if (cancel) {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n focusView.requestFocus();\n } else {\n // Show a progress spinner, and kick off a background task to\n // perform the user login attempt.\n //showProgress(true);\n HashMap<String, String> map = new HashMap<>();\n map.put(\"userName\", username);\n map.put(\"pass\", password);\n map.put(\"age\", ageS);\n map.put(\"email\", email);\n map.put(\"fName\", fnameS);\n map.put(\"lName\", lnameS);\n map.put(\"sex\", gender);\n map.put(\"cPass\", conPass);\n\n mAuthTask = new httpUrlConn(map, \"http://hive.sewanee.edu/evansdb0/android1/scripts/hotPartySignUp.php\");\n\n mAuthTask.execute();\n // if php inserted credentials into the database\n Log.i(\"mAuthTask.get is:\", mAuthTask.get());\n try {\n // if the user succesfully logged in\n if(mAuthTask.get().contains(\"true\")) {\n String r = mAuthTask.get().replace(\"true // \",\"\");\n // tell them they are registered\n Toast.makeText(getApplicationContext(),r,Toast.LENGTH_SHORT).show();\n Intent i = new Intent(this,loginActivity2.class);\n // take them back to log in part of this activity\n startActivity(i);\n\n }\n else {\n String[] resp = response.split(\",\");\n for(String i: resp)\n Toast.makeText(getApplicationContext(),i,Toast.LENGTH_SHORT).show();\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n if(mAuthTask == null || mAuthTask.getStatus().equals(AsyncTask.Status.FINISHED))\n mAuthTask = null;\n }\n }",
"Task<Void> signUp(String email, String password);",
"public void onSignUpClicked() {\n loginView.startSignUpActivity();\n loginView.finishActivity();\n }",
"private void SignUp(String email, String password) {\n if (TextUtils.isEmpty(email) || TextUtils.isEmpty(password) ) {\n\n }else {\n msignInDialog.setTitle(\"Creating New User\");\n msignInDialog.setMessage(\"Please wait while DevChat creates your new Account...\");\n msignInDialog.setCanceledOnTouchOutside(false);\n msignInDialog.show();\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Toast.makeText(ActivityRegister.this, \"User Account Created!\", Toast.LENGTH_SHORT).show();\n createUser(et_username.getText().toString());\n msignInDialog.dismiss();\n Intent chatBoxIntent = new Intent(ActivityRegister.this, Chatbox_Activity.class);\n Bundle bundle = new Bundle();\n bundle.putStringArray(\"values\", values);\n chatBoxIntent.putExtras(bundle);\n startActivity(chatBoxIntent);\n } else {\n msignInDialog.dismiss();\n Toast.makeText(ActivityRegister.this, \"Error Creating New User Account!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }\n }",
"void signUpAttempt(String email, String password, String firstName, String lastName);",
"@SuppressLint(\"StaticFieldLeak\")\n @Override\n public void onClick(final View view) {\n String userName = txtUsername.getText().toString();\n String password = txtPassword.getText().toString();\n String firstName = txtFirstName.getText().toString();\n String lastName = txtLastName.getText().toString();\n String phoneNumber = txtPhoneNumber.getText().toString();\n\n // Check that all fields aren't empty.\n if(isParamsEmpty(userName, password, firstName, lastName, phoneNumber)){\n Toast.makeText(getContext(), \"All fields are required!\", Toast.LENGTH_SHORT).show();\n return;\n }\n if(listener != null) {\n // Lock the button.\n btnSignUp.setEnabled(false);\n btnSignUp.setText(R.string.wait_message);\n\n // Check if username not taken.\n new AsyncTask<User, Void, Boolean>(){\n User user;\n\n @Override\n protected Boolean doInBackground(User... users) {\n // Save the user.\n user = users[0];\n\n // Connect to server to check if username exist.\n int result = (int) HttpConnection.connection(SIGN_UP, user);\n\n // If exist - return false\n if (result == EXIST)\n return false;\n // If not - return true\n else if (result == SUCCESS)\n return true;\n else\n return null;\n }\n\n @Override\n protected void onPostExecute(Boolean success) {\n // Enable the button.\n btnSignUp.setEnabled(true);\n btnSignUp.setText(R.string.sign_up);\n\n // New username - Log in the user.\n if (success == null){\n listener.onSignUp(null);\n }\n else if (success){\n // Send back user details.\n listener.onSignUp(user);\n dismiss();\n }else{\n Vibrator vibrator = (Vibrator) getContext().getSystemService(Context.VIBRATOR_SERVICE);\n vibrator.vibrate(500);\n Toast.makeText(getContext(), \"Username already exist!\", Toast.LENGTH_SHORT).show();\n }\n }\n }.execute(new User(userName, password, firstName, lastName, phoneNumber));\n }\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\n //delete user just created\n user.delete();\n //prompt user to create account\n Toast.makeText(MainActivity.this, \"No Email Exist \", Toast.LENGTH_SHORT).show();\n Toast.makeText(MainActivity.this, \"Create New Account \", Toast.LENGTH_SHORT).show();\n } else {\n // if failed, email already exist and move on to verify passoword\n //Toast.makeText(MainActivity.this, \"Loggin In\", Toast.LENGTH_SHORT).show();\n signUserIn(emailX);\n }\n\n }",
"@Override\n\t\t\tpublic void onCompleted(final GraphUser user, Response response) {\n\t\t\t\tif (session == Session.getActiveSession()) {\n\t\t\t\t\tif (user != null) {\n\t\t\t\t\t\tToast.makeText(getBaseContext(), \"Hello \"+user.getName()+\"!\", Toast.LENGTH_LONG).show();\n\t\t\t\t\t\tParseClass p = new ParseClass(getBaseContext());\n\t\t\t\t\t\tp.Signup(user,user.getProperty(\"email\").toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (response.getError() != null) {\n\n\t\t\t\t\tToast.makeText(getBaseContext(), \"Error with connection\", Toast.LENGTH_LONG).show();\n\t\t\t\t}\n\t\t\t}",
"@Override\r\n\t\t\t\t\tpublic void onSuccess(UserProfile result) {\n\t\t\t\t\t\tuserAuthenticated();\r\n\t\t\t\t\t}",
"void complete(Messages.AuthResult authResult);",
"private void userSignUp(final int id, String agentNm, String fName, String sta, String localG, String tow, String phoneNm, String fmMr, String cbRg, String memSiz, String cggNam, String cFarmZz, String fcRg, String inFarm, String riceVarr, String qttyHarr, String afRg,\n String fertTldd, String noRzz, String qtyApll, String alRg, String szLoaa, String srcRicc, String qtyPdyRicc, String majByrss, String comSolcc, String qttyByy, String howMcc, String prcBb, String incDs,\n String reasnn, String hwSpyy, String stRg, String ysSptrr, String fm1, String t11, String cstCs11, String fm2, String t22, String cstCs22, String fm3, String t33, String cstCs33, String infPrcc, String salesDmm,\n String avgQtFcc, String whnCp, String whyCp, String whnEx, String whyExx, String mjCh, String adCh, String timSe, String othSe, String adInn) {\n Call<ResponseBody> call = RetrofitClient2\n .getInstance()\n .getNaSurvey()\n .submitResponse(agentNm, fName, sta, localG, tow, phoneNm, fmMr, cbRg, memSiz, cggNam, cFarmZz, fcRg, inFarm, riceVarr, qttyHarr, afRg, fertTldd, noRzz, qtyApll, alRg, szLoaa, srcRicc, qtyPdyRicc, majByrss, comSolcc, qttyByy, howMcc, prcBb, incDs, reasnn, hwSpyy, stRg, ysSptrr, fm1, t11, cstCs11,\n fm2, t22, cstCs22, fm3, t33, cstCs33, infPrcc, salesDmm, avgQtFcc, whnCp, whyCp, whnEx, whyExx, mjCh, adCh, timSe, othSe, adInn);\n\n call.enqueue(new Callback<ResponseBody>() {\n @Override\n public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {\n\n try {\n JSONObject obj = new JSONObject(String.valueOf(response));\n if (!obj.getBoolean(\"error\")) {\n //updating the status in sqlite\n db.updateNameStatus(id, SurveyActivity.SYNC_STATUS_OK);\n\n //sending the broadcast to refresh the list\n context.sendBroadcast(new Intent(SurveyActivity.DATA_SAVED_BROADCAST));\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n\n @Override\n public void onFailure(Call<ResponseBody> call, Throwable t) {\n Map<String, String> params = new HashMap<>();\n params.put(\"agentNm\", agentNm);\n params.put(\"fname\", fName);\n params.put(\"state\", sta);\n params.put(\"lga\", localG);\n params.put(\"town\", tow);\n params.put(\"phoneNm\", phoneNm);\n params.put(\"farmer\", fmMr);\n params.put(\"cogp\", cbRg);\n params.put(\"memsz\", memSiz);\n params.put(\"cgnam\", cggNam);\n params.put(\"cofmsz\", cFarmZz);\n params.put(\"frmcol\", fcRg);\n params.put(\"invfz\", inFarm);\n params.put(\"ricev\", riceVarr);\n params.put(\"qtyhv\", qttyHarr);\n params.put(\"apfert\", afRg);\n params.put(\"ysyld\", fertTldd);\n params.put(\"norz\", noRzz);\n params.put(\"qtyap\", qtyApll);\n params.put(\"aploa\", alRg);\n params.put(\"szloa\", szLoaa);\n params.put(\"srcric\", srcRicc);\n params.put(\"qtypdrc\", qtyPdyRicc);\n params.put(\"majby\", majByrss);\n params.put(\"comso\", comSolcc);\n params.put(\"qtby\", qttyByy);\n params.put(\"hwmch\", howMcc);\n params.put(\"pricbf\", prcBb);\n params.put(\"indcr\", incDs);\n params.put(\"rsn\", reasnn);\n params.put(\"hwspl\", hwSpyy);\n params.put(\"chsp\", stRg);\n params.put(\"yssptr\", ysSptrr);\n params.put(\"frm1\", fm1);\n params.put(\"to1\", t11);\n params.put(\"costc1\", cstCs11);\n params.put(\"frm2\", fm2);\n params.put(\"to2\", t22);\n params.put(\"costcs2\", cstCs22);\n params.put(\"frm3\", fm3);\n params.put(\"to3\", t33);\n params.put(\"costcs3\", cstCs33);\n params.put(\"infpr\", infPrcc);\n params.put(\"salsdm\", salesDmm);\n params.put(\"avqtf\", avgQtFcc);\n params.put(\"wncp\", whnCp);\n params.put(\"wycp\", whyCp);\n params.put(\"wnex\", whnEx);\n params.put(\"wyex\", whyExx);\n params.put(\"majch\", mjCh);\n params.put(\"addch\", adCh);\n params.put(\"timsl\",timSe);\n params.put(\"othsl\",othSe);\n params.put(\"adin\",adInn);\n\n return;\n }\n });\n\n }",
"@Override\n public void onSuccess(AuthResult authResult) {\n if(!mAuth.getCurrentUser().isEmailVerified()){\n PopupEmailVerification popupEmailVerification = new PopupEmailVerification(StartPage.this);\n popupEmailVerification.show();\n }\n else{\n //User found & ready for next page\n Toast.makeText(StartPage.this, \"Sign in successful\", Toast.LENGTH_LONG).show();\n startActivity(new Intent(StartPage.this, CenterPage.class));\n finish();\n }\n\n }"
] | [
"0.7497708",
"0.74489176",
"0.722362",
"0.71101546",
"0.70998985",
"0.70149046",
"0.6957749",
"0.69231665",
"0.68191594",
"0.6819136",
"0.67941475",
"0.678789",
"0.67707694",
"0.67592144",
"0.67497087",
"0.6739724",
"0.6723576",
"0.6701651",
"0.6687493",
"0.6621188",
"0.660071",
"0.659293",
"0.659291",
"0.65693897",
"0.6568988",
"0.65449315",
"0.6519249",
"0.64951277",
"0.64905536",
"0.6475432",
"0.64582586",
"0.64440864",
"0.6422067",
"0.6416751",
"0.6408069",
"0.6406576",
"0.63990825",
"0.63974774",
"0.6377404",
"0.63611627",
"0.6349602",
"0.6348836",
"0.63420254",
"0.6335134",
"0.63335395",
"0.63224655",
"0.62993187",
"0.6296961",
"0.62754995",
"0.62691295",
"0.6268509",
"0.6265584",
"0.62560946",
"0.6255311",
"0.62504125",
"0.6236476",
"0.6228548",
"0.62243074",
"0.6208408",
"0.61883086",
"0.61837256",
"0.61816823",
"0.6181056",
"0.6165846",
"0.61652625",
"0.6130101",
"0.6122126",
"0.61192816",
"0.60965973",
"0.6094419",
"0.6078538",
"0.6071372",
"0.6063792",
"0.60621107",
"0.60195273",
"0.6012964",
"0.60027355",
"0.6001164",
"0.60006994",
"0.59954405",
"0.5990541",
"0.59902436",
"0.59846735",
"0.5982865",
"0.5978978",
"0.5970167",
"0.5966734",
"0.5966177",
"0.59484583",
"0.5945348",
"0.59425277",
"0.5936942",
"0.5936735",
"0.59365314"
] | 0.69215894 | 14 |
open TDB dataset create the tdb | public Dataset openTDB(String directory){
Dataset dataset = TDBFactory.createDataset(directory);
return dataset;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void open()\n\t\t{\n\t\t\tconfig=Db4oEmbedded.newConfiguration();\n\t\t\tconfig.common().objectClass(Census.class).cascadeOnUpdate(true);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\tDB=Db4oEmbedded.openFile(config, PATH);\n\t\t\t\tSystem.out.println(\"[DB4O]Database was open\");\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"[DB4O]ERROR:Database could not be open\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}",
"public abstract ODatabaseInternal<?> openDatabase();",
"public DataBase(String file) throws IOException {\n\t\tdataBase = new RandomAccessFile(file, \"rw\");\n\t\tdataBase.writeBytes(\"FEATURE_ID|FEATURE_NAME|FEATURE_CLASS|STATE_ALPHA|\"\n\t\t\t\t+ \"STATE_NUMERIC|COUNTY_NAME|COUNTY_NUMERIC|PRIMARY_LAT_DMS|PRIM_LONG_DMS|\"\n\t\t\t\t+ \"PRIM_LAT_DEC|PRIM_LONG_DEC|SOURCE_LAT_DMS|SOURCE_LONG_DMS|SOURCE_LAT_DEC|\"\n\t\t\t\t+ \"SOURCE_LONG_DEC|ELEV_IN_M|ELEV_IN_FT|MAP_NAME|DATE_CREATED|DATE_EDITED\\n\");\n\t}",
"public DataManager() {\n\t\tthis(PUnit == null ? \"eElectionsDB\" : PUnit);\n\t}",
"long createDatabase(long actor, String nameToDisplay, long proteinDBType, long sizeInBytes, boolean bPublic, boolean bReversed, ExperimentCategory category);",
"private void setupDb(){\n try {\n openConnection();\n s.executeUpdate(\"CREATE TABLE IF NOT EXISTS LIB (NAME text UNIQUE , TYPE text, LANGUAGE text, INTRUSIVE text, OPENSOURCE text)\");\n }catch (SQLException e) {\n System.err.println(e.getMessage());\n }finally {\n if (c != null){\n close(c);\n }\n }\n }",
"public void open(){\n\t\tbdd = maBaseSQLite.getWritableDatabase();\n\t}",
"protected abstract DatasetGraphTDB getBaseDatasetGraphTDB() ;",
"public TTDB getTTDB();",
"public void createDB(){\r\n\t\t\r\n\t\t Connection connection = null;\r\n\t try\r\n\t {\r\n\t // create a database connection\r\n\t connection = DriverManager.getConnection(\"jdbc:sqlite:project.sqlite\");\r\n\t Statement statement = connection.createStatement();\r\n\t statement.setQueryTimeout(30); // set timeout to 30 sec.\r\n\r\n\t statement.executeUpdate(\"drop table if exists task\");\r\n\t statement.executeUpdate(\"create table task (taskId integer primary key asc, description string, status string, createDate datetime default current_timestamp)\");\r\n\t statement.executeUpdate(\"insert into task values(1, 'leo', 'Active', null)\");\r\n\t statement.executeUpdate(\"insert into task values(2, 'yui', 'Complete', null)\");\r\n\t }\r\n\t catch(SQLException ex){\r\n\t \tthrow new RuntimeException(ex);\r\n\t }\r\n\t\t\r\n\t}",
"private createSingletonDatabase()\n\t{\n\t\tConnection conn = createDatabase();\n\t\tcreateTable();\n\t\tString filename = \"Summer expereince survey 2016 for oliver.csv\"; \n\t\timportData(conn, filename);\n\t}",
"public void database() throws IOException\n {\n \tFile file =new File(\"data.txt\");\n\t if(!file.exists())\n\t {\n\t \tSystem.out.println(\"File 'data.txt' does not exit\");\n\t System.out.println(file.createNewFile());\n\t file.createNewFile();\n\t databaseFileWrite(file);//call the databaseFileRead() method, to initialize data from ArrayList and write data into data.txt\n\t }\n\t else\n\t {\n\t \tdatabaseFileRead();//call the databaseFileRead() method, to load data directly from data.txt\n\t }\n }",
"public ODatabaseDocumentTx getOrCreateDB();",
"private void openStore()\n throws Exception {\n\n dbStore = Utils.openStore(master, Utils.DB_NAME);\n primaryIndex = \n dbStore.getPrimaryIndex(Integer.class, RepTestData.class);\n }",
"public AzureDataLakeStoreDataset() {\n }",
"private static void writeDataBase() throws IOException{\n \t\n \t// Write variables and class labels\n \tFileSystem fs = FileSystem.get(Mediator.getConfiguration());\n\t ObjectOutputStream objectOutputStream = new ObjectOutputStream(fs.create(new Path(Mediator.getHDFSLocation()+\"/\"+Mediator.getLearnerDatabasePath())));\n\t objectOutputStream.writeObject(Mediator.getVariables());\n\t objectOutputStream.writeObject(Mediator.getClassLabels());\n\t objectOutputStream.close();\n\t fs.close();\n \t\n }",
"public void createDataStore (){\n\t\tcloseActiveStoreData ();\n\t\tif (_usablePersistenceManager){\n\t\t\tclosePersistence ();\n\t\t}\n\t\tsetDatastoreProperties ();\n\t\tthis.pm = DataStoreUtil.createDataStore (getDataStoreEnvironment (), true);\n\t\t_usablePersistenceManager = true;\n\t}",
"public Database createTableFromArray(int [][] dataDbn){\r\n \tDatabase db = new Database();\r\n \tTable table = null;\r\n \tToken t = null, t2 = null;\r\n \tAttribute attr = null;\r\n \tList ll;\r\n \tLinkedList attributeValues = new LinkedList();\r\n \tLinkedList sampleValueList;\r\n \tint numGenesTotal;\r\n \tint samples;\r\n \tString atrNode = \"node\";\r\n \t\r\n \ttry {\r\n \t\ttable = new Table(); \r\n \t\ttable.setName(\"name\");\r\n \t}catch(Exception e){\r\n \t\t\r\n\t\t\te.printStackTrace();\r\n \t}\r\n \t\r\n \t\r\n \tnumGenesTotal = dataDbn[0].length;\r\n \tsamples = dataDbn.length;\r\n \t\r\n \t// each gene has 3 levels (3 attributes). they are represent by 0,1,2\r\n \tattributeValues.add(new Integer(0));\r\n \tattributeValues.add(new Integer(1));\r\n \tattributeValues.add(new Integer(2));\r\n \t\r\n \t// set attributes for each gene\r\n \tfor(int k=0;k<numGenesTotal;k++){\r\n \t\tString name = atrNode + k;\r\n \t\tattr = new Attribute(name);\r\n \t\tattr.setValues(attributeValues);\r\n \t\ttable.addAttribute(attr);\r\n \t}\r\n \t\r\n \t// read dbnData and load gene's value of each sample in to List and then add this List in to the table\r\n \tfor(int i =0;i<samples;i++){\r\n \t\tsampleValueList = new LinkedList();\r\n \t\tfor(int j=0; j<numGenesTotal;j++){\r\n \t\t\tInteger val = new Integer(dataDbn[i][j]);\r\n \t\t\tsampleValueList.add(val);\r\n \t\t}\r\n \t\ttable.addTuple(new Tuple(sampleValueList));\r\n \t}\r\n \t\r\n \tdb.addTable(table);\r\n \t/*\r\n \tString filePath = \"C:\\\\Users\\\\devamuni\\\\Documents\\\\D_Result\\\\Input.out\";\r\n File f1 = new File(filePath);\r\n try {\r\n\t\t\tOutputStream os = new FileOutputStream(f1);\r\n\t\t\tsave(os, db);\r\n } catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\t\r\n\t\t\te.printStackTrace();\r\n } */\r\n \treturn db;\r\n }",
"public void setUp() throws IOException\r\n\t{\r\n\r\n\t\tgraphDb = new GraphDatabaseFactory().newEmbeddedDatabase( dbPath );\r\n\t\tSystem.out.println(\"Connecting to the database...\"); \r\n\t\tSystem.out.println(\"Done!\");\r\n\r\n\t}",
"public void openRWDB() throws SQLException {\r\n\t\tString mPath = DATABASE_PATH + DATABASE_NAME;\r\n\t\tmDataBase = SQLiteDatabase.openDatabase(mPath, null,\r\n\t\t\t\tSQLiteDatabase.OPEN_READWRITE);\r\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tif (args.length <= 1) { // quit if not enough args provided\n\t\t\tSystem.out.println(\"Usage: CreateTable {tall | flat} <path to table> [<input file>]\");\n\t\t\tSystem.out.println(\"Example: CreateTable tall /user/mapr/mytable input.txt\");\n\t\t\tSystem.out.println(\"Each line in input CSV file must have the format: TICKER, PRICE, VOLUME, TIMESTAMP\");\n\t\t\tSystem.out.println(\"Example: AMZN, 304.82, 3000, 1381398365000\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (!(args[0].equals(\"tall\") || args[0].equals(\"flat\"))) { // quit if schema type not specified\n\t\t\tSystem.out.println(\"Specify a schema type of 'tall' or 'flat'.\");\n\t\t\treturn;\n\t\t} \n\n\t\t// 2. Generate a test data set \n\t\tList<Trade> testTradeSet;\n\t\tif (args.length == 2) {\t// If no input file specified, use a predefined data set specified in generateDataSet()\n\t\t\tSystem.out.println(\"No input data provided. Creating a small, pre-defined data set.\");\n\t\t\ttestTradeSet = CreateTableUtils.generateDataSet();\n\t\t} else { // Read the specified input file.\n\t\t\tinputFilePath = args[2];\n\t\t\ttestTradeSet = CreateTableUtils.getDataFromFile(inputFilePath); \n\t\t}\n\t\t\n\t\t// 3. Create a table and store the data set to the table via the DAO\n\t\tConfiguration conf = HBaseConfiguration.create();\n\t\tTradeDAO tradeDao;\n\t\ttablePath = args[1]; \n\n\t\tif (args[0].equals(\"tall\")) {\n\t\t\tCreateTableUtils.createTable(conf, tablePath, new byte[][] {baseCF});\n\t\t\ttradeDao = new TradeDAOTall(conf, tablePath);\n\t\t} else if (args[0].equals(\"flat\")) {\n\t\t\tCreateTableUtils.createTable(conf, tablePath, new byte[][] {priceCF, volumeCF, statsCF});\n\t\t\ttradeDao = new TradeDAOFlat(conf, tablePath);\n\t\t} else {\n\t\t\ttradeDao = null;\n\t\t}\n\n\t\tSystem.out.println(\"Using DAO: \" + tradeDao.getClass());\n\t\tSystem.out.println(\"Storing the test data set...\");\n\t\tfor (Trade trade : testTradeSet){\n\t\t\ttradeDao.store(trade);\n\t\t}\n\n\t\treturn;\n\t}",
"private void createTestDataSet() throws Exception {\n LOG.info(\"creating test data set...\"); \n Database db = null;\n try {\n db = this._category.getDatabase();\n db.begin();\n\n LazyEmployee person = new LazyEmployee();\n person.setFirstName(\"First\");\n person.setLastName(\"Person\");\n person.setBirthday(JDO_ORIGINAL_DATE);\n person.setStartDate(JDO_ORIGINAL_DATE);\n\n LazyAddress address1 = new LazyAddress();\n address1.setId(1);\n address1.setStreet(Integer.toString(1) + JDO_ORIGINAL_STRING);\n address1.setCity(\"First City\");\n address1.setState(\"AB\");\n address1.setZip(\"10000\");\n address1.setPerson(person);\n\n LazyAddress address2 = new LazyAddress();\n address2.setId(2);\n address2.setStreet(Integer.toString(2) + JDO_ORIGINAL_STRING);\n address2.setCity(\"Second City\");\n address2.setState(\"BC\");\n address2.setZip(\"22222\");\n address2.setPerson(person);\n\n LazyAddress address3 = new LazyAddress();\n address3.setId(3);\n address3.setStreet(Integer.toString(3) + JDO_ORIGINAL_STRING);\n address3.setCity(\"Third Ave\");\n address3.setState(\"AB\");\n address3.setZip(\"30003\");\n address3.setPerson(person);\n\n ArrayList addresslist = new ArrayList();\n addresslist.add(address1);\n addresslist.add(address2);\n addresslist.add(address3);\n\n person.setAddress(addresslist);\n\n LazyPayRoll pr1 = new LazyPayRoll();\n pr1.setId(1);\n pr1.setHoliday(15);\n pr1.setHourlyRate(25);\n pr1.setEmployee(person);\n person.setPayRoll(pr1);\n\n LazyContractCategory cc = new LazyContractCategory();\n cc.setId(101);\n cc.setName(\"Full-time slave\");\n db.create(cc);\n\n LazyContractCategory cc2 = new LazyContractCategory();\n cc2.setId(102);\n cc2.setName(\"Full-time employee\");\n db.create(cc2);\n \n ArrayList category = new ArrayList();\n category.add(cc);\n category.add(cc2);\n\n LazyContract con = new LazyContract();\n con.setPolicyNo(1001);\n con.setComment(\"80 hours a week, no pay hoilday, \"\n + \"no sick leave, arrive office at 7:30am everyday\");\n con.setContractNo(78);\n con.setEmployee(person);\n con.setCategory(category);\n person.setContract(con);\n \n db.create(person);\n \n db.commit();\n db.close();\n } catch (Exception e) {\n LOG.error(\"createTestDataSet: exception caught\", e);\n throw e;\n }\n }",
"public void createDB(String filename) throws SQLException {\n //System.out.printf(\"Connecting to the database %s.%n\", filename);\n /* \n * Connect to the database (file). If the file does not exist, create it.\n */\n Connection db_connection = DriverManager.getConnection(SQLITEDBPATH + filename);\n this.createTables(db_connection);\n this.initTableCities(db_connection);\n this.initTableTeams(db_connection);\n //System.out.printf(\"Connection to the database has been established.%n\");\n db_connection.close();\n //System.out.printf(\"Connection to the database has been closed.%n\");\n }",
"public static void main(String[] args) throws IOException {\n System.setProperty(\"entityExpansionLimit\", \"10000000\");\n\n String dblpXmlFilename = \"data/dblp.xml\";\n String dblpDtdFilename = \"data/dblp.dtd\";\n\n System.out.println(\"building the dblp main memory DB ...\");\n RecordDbInterface dblp;\n try {\n dblp = new RecordDb(dblpXmlFilename, dblpDtdFilename, false);\n } catch (final IOException ex) {\n System.err.println(\"cannot read dblp XML: \" + ex.getMessage());\n return;\n } catch (final SAXException ex) {\n System.err.println(\"cannot parse XML: \" + ex.getMessage());\n return;\n }\n System.out.format(\"MMDB ready: %d publs, %d pers\\n\\n\", dblp.numberOfPublications(), dblp.numberOfPersons());\n\n PrintWriter publicationsWriter = new PrintWriter(\"data/publications.json\", StandardCharsets.UTF_8);\n for (Publication publication1 : ProgressBar.wrap(dblp.getPublications(), \"publications\")) {\n JSONObject jo = new JSONObject();\n jo.put(\"key\", publication1.getKey());\n if (publication1.getPublicationStream() != null) {\n jo.put(\"title\", publication1.getPublicationStream().getTitle());\n }\n jo.put(\"year\", publication1.getYear());\n if (publication1.getJournal() != null) {\n jo.put(\"journal_title\", publication1.getJournal().getTitle());\n }\n if (publication1.getBooktitle() != null) {\n jo.put(\"book_title\", publication1.getBooktitle().getTitle());\n }\n if (publication1.getToc() != null) {\n jo.put(\"toc_key\", publication1.getToc().getKey());\n }\n jo.put(\"mdate\", publication1.getMdate());\n\n Map<String, JSONArray> publicationIds = new HashMap<>();\n for (PublicationIDType publicationIDType : publication1.getIdTypes()) {\n publicationIds.put(publicationIDType.label(), new JSONArray(publication1.getIds(publicationIDType)));\n }\n\n jo.put(\"ids\", new JSONObject(publicationIds));\n\n publicationsWriter.println(jo);\n }\n\n PrintWriter tocWriter = new PrintWriter(\"data/tocs.json\", StandardCharsets.UTF_8);\n for (TableOfContents toc : ProgressBar.wrap(dblp.getTocs(), \"TOCs\")) {\n JSONObject jo = new JSONObject();\n jo.put(\"key\", toc.getKey());\n jo.put(\"page_url\", toc.getPageUrl());\n\n tocWriter.println(jo);\n }\n\n PrintWriter personsWriter = new PrintWriter(\"data/persons.json\", StandardCharsets.UTF_8);\n for (Person person : ProgressBar.wrap(dblp.getPersons(), \"persons\")) {\n JSONObject jo = new JSONObject();\n jo.put(\"key\", person.getKey());\n jo.put(\"primary_name\", person.getPrimaryName());\n jo.put(\"pid\", person.getPid());\n jo.put(\"most_recent_mdate\", person.getAggregatedMdate());\n jo.put(\"mdate\", person.getMdate());\n jo.put(\"number_of_publications\", person.numberOfPublications());\n jo.put(\"publication_ids\", new JSONArray(person.getPublications().stream().map(Publication::getKey).collect(Collectors.toUnmodifiableList())));\n jo.put(\"number_of_coauthors\", dblp.numberOfCoauthors(person));\n\n Map<String, JSONArray> personIds = new HashMap<>();\n for (PersonIDType personIDType : person.getIdTypes()) {\n personIds.put(personIDType.label(), new JSONArray(person.getIds(personIDType)));\n }\n\n jo.put(\"ids\", new JSONObject(personIds));\n\n personsWriter.println(jo);\n }\n }",
"public SetupDatabase(String dataset, Collection<Subject> values) {\n this.dataset = dataset;\n this.splist = values;\n connect();\n }",
"public static void openDatabase() {\n\t\ttry {\n\t\t\tClass.forName(\"org.postgresql.Driver\");\n\n\t\t\t/* change the name and password here */\n\t\t\tc = DriverManager.getConnection(\n\t\t\t\t\t\"jdbc:postgresql://localhost:5432/testdata\", \"postgres\",\n\t\t\t\t\t\" \");\n\n\t\t\tlogger.info(\"Opened database successfully\");\n\t\t\tc.setAutoCommit(false);\n\t\t\tstatus = OPEN_SUCCESS;\n\n\t\t} catch (Exception e) {\n\t\t\tstatus = OPEN_FAILED;\n\t\t\tlogger.warn(e.getClass().getName() + \": \" + e.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"protected abstract ODatabaseInternal<?> newDatabase();",
"protected abstract void createDatabaseData(EntityManager entityManager);",
"public static void main(String[] args) throws Exception {\n TDB.setOptimizerWarningFlag(false);\n\n final String DATASET_DIR_NAME = \"data0\";\n final Dataset data0 = TDBFactory.createDataset( DATASET_DIR_NAME );\n\n // show the currently registered names\n for (Iterator<String> it = data0.listNames(); it.hasNext(); ) {\n out.println(\"NAME=\"+it.next());\n }\n\n out.println(\"getting named model...\");\n /// this is the OWL portion\n final Model model = data0.getNamedModel( MY_NS );\n out.println(\"Model := \"+model);\n\n out.println(\"getting graph...\");\n /// this is the DATA in that MODEL\n final Graph graph = model.getGraph();\n out.println(\"Graph := \"+graph);\n\n if (graph.isEmpty()) {\n final Resource product1 = model.createResource( MY_NS +\"product/1\");\n final Property hasName = model.createProperty( MY_NS, \"#hasName\");\n final Statement stmt = model.createStatement(\n product1, hasName, model.createLiteral(\"Beach Ball\",\"en\") );\n out.println(\"Statement = \" + stmt);\n\n model.add(stmt);\n\n // just for fun\n out.println(\"Triple := \" + stmt.asTriple().toString());\n } else {\n out.println(\"Graph is not Empty; it has \"+graph.size()+\" Statements\");\n long t0, t1;\n t0 = System.currentTimeMillis();\n final Query q = QueryFactory.create(\n \"PREFIX exns: <\"+MY_NS+\"#>\\n\"+\n \"PREFIX exprod: <\"+MY_NS+\"product/>\\n\"+\n \" SELECT * \"\n // if you don't provide the Model to the\n // QueryExecutionFactory below, then you'll need\n // to specify the FROM;\n // you *can* always specify it, if you want\n // +\" FROM <\"+MY_NS+\">\\n\"\n // +\" WHERE { ?node <\"+MY_NS+\"#hasName> ?name }\"\n // +\" WHERE { ?node exns:hasName ?name }\"\n // +\" WHERE { exprod:1 exns:hasName ?name }\"\n +\" WHERE { ?res ?pred ?obj }\"\n );\n out.println(\"Query := \"+q);\n t1 = System.currentTimeMillis();\n out.println(\"QueryFactory.TIME=\"+(t1 - t0));\n\n t0 = System.currentTimeMillis();\n try ( QueryExecution qExec = QueryExecutionFactory\n // if you query the whole DataSet,\n // you have to provide a FROM in the SparQL\n //.create(q, data0);\n .create(q, model) ) {\n t1 = System.currentTimeMillis();\n out.println(\"QueryExecutionFactory.TIME=\"+(t1 - t0));\n\n t0 = System.currentTimeMillis();\n ResultSet rs = qExec.execSelect();\n t1 = System.currentTimeMillis();\n out.println(\"executeSelect.TIME=\"+(t1 - t0));\n while (rs.hasNext()) {\n QuerySolution sol = rs.next();\n out.println(\"Solution := \"+sol);\n for (Iterator<String> names = sol.varNames(); names.hasNext(); ) {\n final String name = names.next();\n out.println(\"\\t\"+name+\" := \"+sol.get(name));\n }\n }\n }\n }\n out.println(\"closing graph\");\n graph.close();\n out.println(\"closing model\");\n model.close();\n //out.println(\"closing DataSetGraph\");\n //dsg.close();\n out.println(\"closing DataSet\");\n data0.close();\n }",
"public int maDBOpen(String path)\n \t{\n \t\ttry\n \t\t{\n \t\t\tMoDatabase database = MoDatabase.create(path);\n \t\t\t++mDatabaseCounter;\n \t\t\taddDatabase(mDatabaseCounter, database);\n \t\t\treturn mDatabaseCounter;\n \t\t}\n \t\tcatch (SQLiteException ex)\n \t\t{\n \t\t\tlogStackTrace(ex);\n \t\t\treturn MA_DB_ERROR;\n \t\t}\n \t}",
"public void create() {\n\t\t\tdb.execSQL(AGENCYDB_CREATE+\".separete,.import agency.txt agency\");\n\t\t\tdb.execSQL(STOPSDB_CREATE+\".separete,.import stop_times.txt stop_times\");\n\t\t\t\n\t\t\t// Add 2 agencies for testing\n\t\t\t\n\t\t\t\n\t\t\tdb.setVersion(DATABASE_VERSION);\n\t\t}",
"private static void createFile() throws Exception {\n\t\t // retrieve an instance of H4File\n\t\t FileFormat fileFormat = FileFormat.getFileFormat(FileFormat.FILE_TYPE_HDF4);\n\n\t\t if (fileFormat == null) {\n\t\t System.err.println(\"Cannot find HDF4 FileFormat.\");\n\t\t return;\n\t\t }\n\n\t\t // create a new file with a given file name.\n\t\t @SuppressWarnings(\"deprecation\")\n\t\t\t\tH4File testFile = (H4File) fileFormat.create(fname);\n\n\t\t if (testFile == null) {\n\t\t System.err.println(\"Failed to create file:\" + fname);\n\t\t return;\n\t\t }\n\n\t\t // open the file and retrieve the root group\n\t\t testFile.open();\n\t\t Group root = (Group) ((javax.swing.tree.DefaultMutableTreeNode) testFile.getRootNode()).getUserObject();\n\n\t\t // set the data values\n\t\t int[] dataIn = new int[20 * 10];\n\t\t for (int i = 0; i < 20; i++) {\n\t\t for (int j = 0; j < 10; j++) {\n\t\t dataIn[i * 10 + j] = 1000 + i * 100 + j;\n\t\t }\n\t\t }\n\n\t\t // create 2D 32-bit (4 bytes) integer dataset of 20 by 10\n\t\t Datatype dtype = testFile.createDatatype(Datatype.CLASS_INTEGER, 4, Datatype.NATIVE, Datatype.NATIVE);\n\t\t @SuppressWarnings(\"unused\")\n\t\t\t\tDataset dataset = testFile\n\t\t .createScalarDS(\"2D 32-bit integer 20x10\", root, dtype, dims2D, null, null, 0, dataIn);\n\n\t\t // close file resource\n\t\t //testFile.close();\n\t\t }",
"public Connection openConnection() throws DataAccessException {\n try {\n //The Structure for this Connection is driver:language:path\n //The path assumes you start in the root of your project unless given a non-relative path\n final String CONNECTION_URL = \"jdbc:sqlite:myfamilymap.sqlite\";\n\n // Open a database connection to the file given in the path\n conn = DriverManager.getConnection(CONNECTION_URL);\n\n // Start a transaction\n conn.setAutoCommit(false);\n } catch (SQLException e) {\n e.printStackTrace();\n throw new DataAccessException(\"Unable to open connection to database\");\n }\n\n return conn;\n }",
"public GosplPopulationInDatabase() {\n\t\ttry {\n\t\t\tthis.connection = DriverManager.getConnection(\n\t\t\t\t\t\"jdbc:hsqldb:mem:\"+mySqlDBname+\";shutdown=true\", \"SA\", \"\");\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"error while trying to initialize the HDSQL database engine in memory: \"+e.getMessage(), e);\n\t\t}\n\t}",
"public void open(String consumerArg, Properties props)\n\t\tthrows DataConsumerException\n\t{\n\t\t// Get username & password from Auth file\n\t\tProperties credentials = null;\n\t\tString authFileName = DecodesSettings.instance().DbAuthFile;\t\t\n\t\ttry \n\t\t{\n\t\t\tcredentials = AuthSourceService.getFromString(authFileName)\n\t\t\t\t\t\t\t\t\t\t\t .getCredentials();\n\t\t}\n\t\tcatch(AuthException ex)\n\t\t{\n\t\t\tString msg = \"Cannot read DB auth from settings '\" \n\t\t\t\t+ authFileName+ \"': \";\n\t\t\tthrow new DataConsumerException(msg,ex);\n\t\t}\n\t\t\n\t\t// Get the Oracle Data Source & open a connection.\n\t\ttry\n\t\t{\n\t\t\thdbTsDb = new HdbTimeSeriesDb();\n\t\t\thdbTsDb.connect(\"decodes\", credentials);\n\t\t\tinfo(\"Connected to HDB Time Series Database as user \" \n\t\t\t\t+ credentials.getProperty(\"username\"));\n\t\t\tautoCreateTs = TextUtil.str2boolean(hdbTsDb.getProperty(\"autoCreateTs\"));\n\t\t\ttimeSeriesDAO = hdbTsDb.makeTimeSeriesDAO();\n\t\t}\n\t\tcatch (BadConnectException ex)\n\t\t{\n\t\t\tString msg = \"Cannot connect to HDB Time Series DB: \" + ex;\n\t\t\tfailure(msg);\n\t\t\tthrow new DataConsumerException(msg);\n\t\t}\n\t}",
"public void createNewDataBase() {\n try (Connection conn = DriverManager.getConnection(url)) {\n if (conn != null) {\n DatabaseMetaData meta = conn.getMetaData();\n createNewTable();\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"private void connectDB() throws IOException, HashtableFullException {\n\t\tFile directory = new File(Main.hashDBStore + File.separator);\n\t\tif (!directory.exists())\n\t\t\tdirectory.mkdirs();\n\t\tFile dbf = new File(directory.getPath() + File.separator + \"hashstore-\"\n\t\t\t\t+ this.getName());\n\t\tlong entries = ((Main.chunkStoreAllocationSize / Main.chunkStorePageSize)) + 8000;\n\t\tif (HashFunctionPool.max_hash_cluster > 1)\n\t\t\tentries = (Main.chunkStoreAllocationSize / HashFunctionPool.avg_page_size) + 8000;\n\t\ttry {\n\t\t\tSDFSLogger.getLog().info(\n\t\t\t\t\t\"Loading hashdb class \" + Main.hashesDBClass);\n\t\t\tSDFSLogger.getLog().info(\"Maximum Number of Entries is \" + entries);\n\t\t\tbdb = (AbstractHashesMap) Class.forName(Main.hashesDBClass)\n\t\t\t\t\t.newInstance();\n\t\t\tbdb.init(entries, dbf.getPath());\n\t\t} catch (InstantiationException e) {\n\t\t\tSDFSLogger.getLog().fatal(\"Unable to initiate ChunkStore\", e);\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\t} catch (IllegalAccessException e) {\n\t\t\tSDFSLogger.getLog().fatal(\"Unable to initiate ChunkStore\", e);\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tSDFSLogger.getLog().fatal(\"Unable to initiate ChunkStore\", e);\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\t} catch (IOException e) {\n\t\t\tSDFSLogger.getLog().fatal(\"Unable to initiate ChunkStore\", e);\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\t}\n\n\t}",
"@Override\r\n protected void openInternal(\r\n final Map<String, CassandraEmbDatabase> theDatabase) {\r\n // empty the table and query complete list of keyspaces from DB.\r\n theDatabase.clear();\r\n final List<KsDef> ksDefs;\r\n try {\r\n ksDefs = server.describe_keyspaces();\r\n for (final KsDef keyspaceDefinition : ksDefs) {\r\n final CassandraEmbDatabase db = new CassandraEmbDatabase(this,\r\n keyspaceDefinition);\r\n theDatabase.put(keyspaceDefinition.getName(), db);\r\n }\r\n } catch (final Exception e) {\r\n throw new DBException(\"Error Opening Database.\", e);\r\n }\r\n }",
"public DataManager(String PUnit) throws PersistenceException {\n\t\tDataManager.PUnit = PUnit;\n\t\tif (emf == null || !emf.isOpen())\n\t\t\temf = Persistence.createEntityManagerFactory(PUnit);\n\t}",
"protected void open() throws TzException {\n synchronized (dbLock) {\n if (!isOpen()) {\n getDb();\n open = true;\n return;\n }\n }\n }",
"public void openRODB() throws SQLException {\r\n\t\tString mPath = DATABASE_PATH + DATABASE_NAME;\r\n\t\tmDataBase = SQLiteDatabase.openDatabase(mPath, null,\r\n\t\t\t\tSQLiteDatabase.OPEN_READONLY);\r\n\t}",
"DatabaseClient newTraceDbClient();",
"void create(DataTableDef def) throws IOException;",
"@Override\n\tpublic void setDatabase(String tid, String fid) {\n\t\t\n\t}",
"public abstract void createTables() throws DataServiceException;",
"@Test\n public void reading()\n throws FileNotFoundException, IOException, CorruptedTableException\n {\n final Database database =\n new Database(new File(\"src/test/resources/\" + versionDirectory + \"/rndtrip\"), version);\n final Set<String> tableNames = database.getTableNames();\n\n assertEquals(2,\n tableNames.size());\n assertTrue(\"TABLE1 not found in 'short roundtrip' database\",\n tableNames.contains(\"TABLE1.DBF\"));\n assertTrue(\"TABLE2 not found in 'short roundtrip' database\",\n tableNames.contains(\"TABLE2.DBF\"));\n\n final Table t1 = database.getTable(\"TABLE1.DBF\");\n\n try\n {\n t1.open(IfNonExistent.ERROR);\n\n assertEquals(\"Table name incorrect\",\n \"TABLE1.DBF\",\n t1.getName());\n assertEquals(\"Last modified date incorrect\",\n Util.createDate(2009, Calendar.APRIL, 1),\n t1.getLastModifiedDate());\n\n final List<Field> fields = t1.getFields();\n\n Iterator<Field> fieldIterator = fields.iterator();\n Map<String, Field> nameFieldMap = new HashMap<String, Field>();\n\n while (fieldIterator.hasNext())\n {\n Field f = fieldIterator.next();\n nameFieldMap.put(f.getName(),\n f);\n }\n\n final Field idField = nameFieldMap.get(\"ID\");\n assertEquals(Type.NUMBER,\n idField.getType());\n assertEquals(idField.getLength(),\n 3);\n\n final Field stringField = nameFieldMap.get(\"STRFIELD\");\n assertEquals(Type.CHARACTER,\n stringField.getType());\n assertEquals(stringField.getLength(),\n 50);\n\n final Field logicField = nameFieldMap.get(\"LOGICFIELD\");\n assertEquals(Type.LOGICAL,\n logicField.getType());\n assertEquals(logicField.getLength(),\n 1);\n\n final Field dateField = nameFieldMap.get(\"DATEFIELD\");\n assertEquals(Type.DATE,\n dateField.getType());\n assertEquals(8,\n dateField.getLength());\n\n final Field floatField = nameFieldMap.get(\"FLOATFIELD\");\n assertEquals(Type.NUMBER,\n floatField.getType());\n assertEquals(10,\n floatField.getLength());\n\n final List<Record> records = UnitTestUtil.createSortedRecordList(t1.recordIterator(),\n \"ID\");\n final Record r0 = records.get(0);\n\n assertEquals(1,\n r0.getNumberValue(\"ID\"));\n assertEquals(\"String data 01\",\n r0.getStringValue(\"STRFIELD\").trim());\n assertEquals(true,\n r0.getBooleanValue(\"LOGICFIELD\"));\n assertEquals(Util.createDate(1909, Calendar.MARCH, 18),\n r0.getDateValue(\"DATEFIELD\"));\n assertEquals(1234.56,\n r0.getNumberValue(\"FLOATFIELD\"));\n\n final Record r1 = records.get(1);\n\n assertEquals(2,\n r1.getNumberValue(\"ID\"));\n assertEquals(\"String data 02\",\n r1.getStringValue(\"STRFIELD\").trim());\n\n /*\n * in Clipper 'false' value can be given as an empty field, and the method called here\n * returns then 'null' as the return value\n */\n if (version == Version.CLIPPER_5)\n {\n assertEquals(null,\n r1.getBooleanValue(\"LOGICFIELD\"));\n }\n else\n {\n assertEquals(false,\n r1.getBooleanValue(\"LOGICFIELD\"));\n }\n\n assertEquals(Util.createDate(1909, Calendar.MARCH, 20),\n r1.getDateValue(\"DATEFIELD\"));\n assertEquals(-23.45,\n r1.getNumberValue(\"FLOATFIELD\"));\n\n final Record r2 = records.get(2);\n\n assertEquals(3,\n r2.getNumberValue(\"ID\"));\n assertEquals(\"\",\n r2.getStringValue(\"STRFIELD\").trim());\n assertEquals(null,\n r2.getBooleanValue(\"LOGICFIELD\"));\n assertEquals(null,\n r2.getDateValue(\"DATEFIELD\"));\n assertEquals(null,\n r2.getNumberValue(\"FLOATFIELD\"));\n\n final Record r3 = records.get(3);\n\n assertEquals(4,\n r3.getNumberValue(\"ID\"));\n assertEquals(\"Full5678901234567890123456789012345678901234567890\",\n r3.getStringValue(\"STRFIELD\").trim());\n\n /*\n * in Clipper 'false' value can be given as an empty field, and the method called here\n * returns then 'null' as the return value\n */\n if (version == Version.CLIPPER_5)\n {\n assertEquals(null,\n r3.getBooleanValue(\"LOGICFIELD\"));\n }\n else\n {\n assertEquals(false,\n r3.getBooleanValue(\"LOGICFIELD\"));\n }\n\n assertEquals(Util.createDate(1909, Calendar.MARCH, 20),\n r3.getDateValue(\"DATEFIELD\"));\n assertEquals(-0.30,\n r3.getNumberValue(\"FLOATFIELD\"));\n }\n finally\n {\n t1.close();\n }\n\n final Table t2 = database.getTable(\"TABLE2.DBF\");\n\n try\n {\n t2.open(IfNonExistent.ERROR);\n\n final List<Field> fields = t2.getFields();\n\n Iterator<Field> fieldIterator = fields.iterator();\n Map<String, Field> nameFieldMap = new HashMap<String, Field>();\n\n while (fieldIterator.hasNext())\n {\n Field f = fieldIterator.next();\n nameFieldMap.put(f.getName(),\n f);\n }\n\n final Field idField = nameFieldMap.get(\"ID2\");\n assertEquals(Type.NUMBER,\n idField.getType());\n assertEquals(idField.getLength(),\n 4);\n\n final Field stringField = nameFieldMap.get(\"MEMOFIELD\");\n assertEquals(Type.MEMO,\n stringField.getType());\n assertEquals(10,\n stringField.getLength());\n\n final Iterator<Record> recordIterator = t2.recordIterator();\n final Record r = recordIterator.next();\n\n String declarationOfIndependence = \"\";\n\n declarationOfIndependence += \"When in the Course of human events it becomes necessary for one people \";\n declarationOfIndependence += \"to dissolve the political bands which have connected them with another and \";\n declarationOfIndependence += \"to assume among the powers of the earth, the separate and equal station to \";\n declarationOfIndependence += \"which the Laws of Nature and of Nature's God entitle them, a decent respect \";\n declarationOfIndependence += \"to the opinions of mankind requires that they should declare the causes which \";\n declarationOfIndependence += \"impel them to the separation.\";\n declarationOfIndependence += \"\\r\\n\\r\\n\";\n declarationOfIndependence += \"We hold these truths to be self-evident, that all men are created equal, \";\n declarationOfIndependence += \"that they are endowed by their Creator with certain unalienable Rights, \";\n declarationOfIndependence += \"that among these are Life, Liberty and the persuit of Happiness.\";\n\n assertEquals(1,\n r.getNumberValue(\"ID2\"));\n assertEquals(declarationOfIndependence,\n r.getStringValue(\"MEMOFIELD\"));\n }\n finally\n {\n t2.close();\n }\n }",
"@Override\r\n\tprotected void doOpen() throws Exception {\n\t\tAssert.notNull(rootdir, \"rootdir must be specified\");\r\n\t\tAssert.notNull(master, \"master AND database must be set\");\r\n\t\tAssert.notNull(quorum, \"quorum must be set\");\r\n\t\tAssert.notNull(converter, \"converter must be set\");\r\n\t\tconfiguration = HBaseConfiguration.create();\r\n\t\tconfiguration.set(\"hbase.rootdir\", rootdir);\r\n\t\tconfiguration.set(\"hbase.cluster.distributed\", \"true\");\r\n\t\tconfiguration.set(\"hbase.master\", master);\r\n\t\tconfiguration.set(\"hbase.zookeeper.quorum\", quorum);\r\n\t\tconnection = HConnectionManager\r\n\t\t\t\t.createConnection(configuration);\r\n\t}",
"public void testCreateTable3() throws Exception {\n Properties props = new Properties();\n props.setProperty(LockssRepositoryImpl.PARAM_CACHE_LOCATION, tempDirPath);\n props\n\t.setProperty(ConfigManager.PARAM_PLATFORM_DISK_SPACE_LIST, tempDirPath);\n props.setProperty(SqlDbManager.PARAM_DATASOURCE_CLASSNAME,\n\t\t \"org.apache.derby.jdbc.ClientDataSource\");\n ConfigurationUtil.setCurrentConfigFromProps(props);\n\n createTable();\n }",
"TD createTD();",
"private void m14053d() {\n try {\n File file = new File(f18051l);\n File file2 = new File(f18052m);\n if (!file.exists()) {\n file.mkdirs();\n }\n if (!file2.exists()) {\n file2.createNewFile();\n }\n if (file2.exists()) {\n SQLiteDatabase openOrCreateDatabase = SQLiteDatabase.openOrCreateDatabase(file2, null);\n openOrCreateDatabase.execSQL(\"CREATE TABLE IF NOT EXISTS bdcltb09(id CHAR(40) PRIMARY KEY,time DOUBLE,tag DOUBLE, type DOUBLE , ac INT);\");\n openOrCreateDatabase.execSQL(\"CREATE TABLE IF NOT EXISTS wof(id CHAR(15) PRIMARY KEY,mktime DOUBLE,time DOUBLE, ac INT, bc INT, cc INT);\");\n openOrCreateDatabase.setVersion(1);\n openOrCreateDatabase.close();\n }\n this.f18053a = true;\n } catch (Exception e) {\n }\n }",
"public void setUp(final String database) throws IOException {\n\n\t\t// create the database\n\t\ttmpDir = new File(System.getProperty(\"java.io.tmpdir\"), UUID\n\t\t\t\t.randomUUID().toString());\n\t\tdb = new Db();\n\t\tif (database == null) {\n\t\t\tdb.openNewDb(\"testMetaDataDb\", tmpDir, false);\n\t\t} else {\n\t\t\tdb.addDb(\"testMetaDataDb\", database);\n\t\t}\n\t\tdb.setUpDb();\n\t}",
"private Database openTestDb(ReplicatedEnvironment master)\n throws DatabaseException {\n\n Environment env = master;\n DatabaseConfig config = new DatabaseConfig();\n config.setAllowCreate(true);\n config.setTransactional(true);\n config.setSortedDuplicates(true);\n Database testDb = env.openDatabase(null, TEST_DB, config);\n return testDb;\n }",
"public UfficioTecnicoDB() {\n this(ConnectionManager.getInstance());\n }",
"private void openDatabase() {\r\n if ( connect != null )\r\n return;\r\n\r\n try {\r\n // Setup the connection with the DB\r\n String host = System.getenv(\"DTF_TEST_DB_HOST\");\r\n String user = System.getenv(\"DTF_TEST_DB_USER\");\r\n String password = System.getenv(\"DTF_TEST_DB_PASSWORD\");\r\n read_only = true;\r\n if (user != null && password != null) {\r\n read_only = false;\r\n }\r\n if ( user == null || password == null ) {\r\n user = \"guest\";\r\n password = \"\";\r\n }\r\n Class.forName(\"com.mysql.jdbc.Driver\"); // required at run time only for .getConnection(): mysql-connector-java-5.1.35.jar\r\n connect = DriverManager.getConnection(\"jdbc:mysql://\"+host+\"/qa_portal?user=\"+user+\"&password=\"+password);\r\n } catch ( Exception e ) {\r\n System.err.println( \"ERROR: DescribedTemplateCore.openDatabase() could not open database connection, \" + e.getMessage() );\r\n }\r\n }",
"Database createDatabase();",
"DataBase createDataBase();",
"DatabaseTable_DataSource(SQLiteDatabase db) {\n createIfNotExists(db);\n }",
"public PersistentDataStore() {\n datastore = DatastoreServiceFactory.getDatastoreService();\n }",
"@Before\n public void setUp() throws Exception {\n HashMap<String, String> prop = PropertyReader.getProperties(ORACLEPROP);\n if (prop.get(\"schema\") != null && !prop.get(\"schema\").isEmpty())\n databaseTester = new JdbcDatabaseTester(prop.get(\"dbClass\"), prop.get(\"dbURL\"), prop.get(\"user\"), prop.get(\"pass\"), prop.get(\"schema\"));\n else\n databaseTester = new JdbcDatabaseTester(prop.get(\"dbClass\"), prop.get(\"dbURL\"), prop.get(\"user\"), prop.get(\"pass\"));\n\n // initialize your dataset here\n IDataSet dataSet = getDataSet();\n\n databaseTester.setDataSet(dataSet);\n // will call default setUpOperation\n databaseTester.onSetup();\n }",
"public void open(){\n this.db = this.typeDatabase.getWritableDatabase();\n }",
"public void openDataBase() throws SQLException {\n try {\n this.createDataBase();\n }\n catch (IOException var1_1) {\n throw new Error(\"Ha sido imposible crear la Base de Datos\");\n }\n this.myDataBase = SQLiteDatabase.openDatabase((String)(DB_PATH + DB_NAME), (SQLiteDatabase.CursorFactory)null, (int)0);\n }",
"public static void main(String[] args) throws IOException {\n\t\t\tSystem.out.println(\"Creating tables...\");\n\t\t\tDerbyDatabase db = new DerbyDatabase();\n\t\t\tdb.createTables();\n\t\t\t\n\t\t\tSystem.out.println(\"Loading initial data...\");\n\t\t\tdb.loadInitialData();\n\t\t\t\n\t\t\tSystem.out.println(\"Library DB successfully initialized!\");\n\t\t}",
"public DataWriter(String dbPath) {\n databasePath = dbPath;\n }",
"public FileDatabase(String filename) throws IOException {\n\t\tdatabase = new File(filename);\n\t\tread();\n\t}",
"private void FetchingData() {\n\t\t try { \n\t\t\t \n\t \tmyDbhelper.onCreateDataBase();\n\t \t \t\n\t \t\n\t \t} catch (IOException ioe) {\n\t \n\t \t\tthrow new Error(\"Unable to create database\");\n\t \n\t \t} \n\t \ttry {\n\t \n\t \t\tmyDbhelper.openDataBase();\n\t \t\tmydb = myDbhelper.getWritableDatabase();\n\t\t\tSystem.out.println(\"executed\");\n\t \t\n\t \t}catch(SQLException sqle){\n\t \n\t \t\tthrow sqle;\n\t \n\t \t}\n\t}",
"private void openConnection() throws IOException {\n String path = \"D:/MSSQL-DB.txt\";\n file = new File(path);\n bufferedWriter = new BufferedWriter(new FileWriter(file, true));\n }",
"public void createTables(){\n Map<String, String> name_type_map = new HashMap<>();\n List<String> primaryKey = new ArrayList<>();\n try {\n name_type_map.put(KEY_SINK_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_DETAIL, MyDatabase.TYPE_VARCHAR);\n primaryKey.add(KEY_SINK_ADDRESS);\n myDatabase.createTable(TABLE_SINK, name_type_map, primaryKey, null);\n }catch (MySQLException e){ //数据表已存在\n e.print();\n }\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_DETAIL, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_ADDRESS,MyDatabase.TYPE_VARCHAR);\n primaryKey.clear();\n primaryKey.add(KEY_NODE_PARENT);\n primaryKey.add(KEY_NODE_ADDRESS);\n myDatabase.createTable(TABLE_NODE, name_type_map, primaryKey, null);\n }catch (MySQLException e){\n e.print();\n }\n\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_DATA_TIME, MyDatabase.TYPE_TIMESTAMP);\n name_type_map.put(KEY_DATA_VAL, MyDatabase.TYPE_FLOAT);\n primaryKey.clear();\n primaryKey.add(KEY_DATA_TIME);\n primaryKey.add(KEY_NODE_ADDRESS);\n primaryKey.add(KEY_NODE_PARENT);\n myDatabase.createTable(TABLE_DATA, name_type_map, primaryKey, null);\n }catch (MySQLException e) {\n e.print();\n }\n }",
"private static void initializeDatabase() {\n\t\tArrayList<String> data = DatabaseHandler.readDatabase(DATABASE_NAME);\n\t\tAbstractSerializer serializer = new CineplexSerializer();\n\t\trecords = serializer.deserialize(data);\n\t}",
"private DBManager() throws Exception {\n file = new File(\"pdfLibraryDB.mv.db\");\n if (!file.exists()) {\n conn = connect();\n stmt = conn.createStatement();\n query = \"CREATE TABLE user(username VARCHAR(30) PRIMARY KEY, password VARCHAR(32));\" +\n \"CREATE TABLE category(id VARCHAR(30) PRIMARY KEY, name VARCHAR(30), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\"+\n \"CREATE TABLE favorite(id VARCHAR(30) PRIMARY KEY, path VARCHAR(500), keyword VARCHAR(200), searchType VARCHAR(10), category VARCHAR(30),username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY(category) REFERENCES category(id) ON UPDATE CASCADE ON DELETE CASCADE);\" +\n \"CREATE TABLE history(id VARCHAR(30) PRIMARY KEY, keyword VARCHAR(200), type VARCHAR(10), directory VARCHAR(500), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\";\n stmt.executeUpdate(query);\n stmt.close();\n conn.close();\n System.out.println(\"DB created!\");\n }\n }",
"private void loadDatabase()\n\t{\n\t\ttry\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Check to make sure the Bmod Database is there, if not, try \n\t\t\t\t// downloading from the website.\n\t\t\t\tif(!Files.exists(m_databaseFile))\n\t\t\t\t{\n\t\t\t\t\tFiles.createDirectories(m_databaseFile.getParent());\n\t\t\t\t\n\t\t\t\t\tbyte[] file = ExtensionPoints.readURLAsBytes(\"http://\" + Constants.API_HOST + HSQL_DATABASE_PATH);\n\t\t\t\t\tif(file.length != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tFiles.deleteIfExists(m_databaseFile);\n\t\t\t\t\t\tFiles.write(m_databaseFile, file, StandardOpenOption.CREATE, StandardOpenOption.WRITE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// make sure we have the proper scriptformat.\n\t\t\t\tsetScriptFormatCorrectly();\n\t\t\t}catch(NullPointerException|IOException ex)\n\t\t\t{\n\t\t\t\tm_logger.error(\"Could not fetch database from web.\", ex);\n\t\t\t}\n\t\t\t\n\t\n\t\t\t\n\t\t\tClass.forName(\"org.hsqldb.jdbcDriver\");\n\t\t\n\t\t\t\n\t\t\tString db = ExtensionPoints.getBmodDirectory(\"database\").toUri().getPath();\n\t\t\tconnection = DriverManager.getConnection(\"jdbc:hsqldb:file:\" + db, \"sa\", \"\");\n\t\t\t\n\t\t\t// Setup Connection\n\t\t\tCSVRecordLoader ldr = new CSVRecordLoader();\n\t\t\n\t\t\t// Load all of the building independent plugins\n\t\t\tfor(Record<?> cp : ldr.getRecordPluginManagers())\n\t\t\t{\n\t\t\t\tm_logger.debug(\"Creating table: \" + cp.getTableName());\n\t\t\t\t// Create a new table\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tgetPreparedStatement(cp.getSQLTableDefn()).execute();\n\t\t\t\t} catch(SQLException ex)\n\t\t\t\t{\n\t\t\t\t\t// Table exists\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\tm_logger.debug(\"Doing index:\" + cp.getIndexDefn());\n\t\t\t\t\tif(cp.getIndexDefn() != null)\n\t\t\t\t\t\tgetPreparedStatement(cp.getIndexDefn()).execute();\n\t\t\t\t}catch(SQLException ex)\n\t\t\t\t{\t// index exists\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t} catch (Exception ex)\n\t\t{\n\t\t\tex.printStackTrace();\n\t\t\tif(ex instanceof DatabaseIntegrityException)\n\t\t\t\tDatabase.handleCriticalError((DatabaseIntegrityException)ex);\n\t\t\telse\n\t\t\t\tDatabase.handleCriticalError(new DatabaseIntegrityException(ex));\n\t\t}\n\t\t\n\t}",
"public void fillLocalDatabase(String artist, String track)\n\t{\n\t\topenConnection();\n\t\tif(artist != null && track !=null)\n\t\t{\n\t\t\tTrack t = external.getTrack(artist, track);\n\t\t\tif (t!=null)\n\t\t\t{\n\t\t\t\tCollection<User> users = external.getListeners(t);\n\t\t\t\tinsertDataIntoPersons(users);\n\t\t\t\tfor(User u : users)\n\t\t\t\t{\n\t\t\t\t\tif(u!=null)\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\tCollection<Track> tracks = User.getTopTracks(u.getName(), key);\n\t\t\t\t\t\t\tinsertDataIntoListenings(u, tracks);\n\t\t\t\t\t\t\tSystem.out.println(u.getName()+\" added to listenings\");\n\t\t\t\t\t\t\tinsertDataIntoRecordings(tracks);\n\t\t\t\t\t\t\tSystem.out.println(u.getName()+\"s' tracks added to recordings\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(Exception e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"Invalid Used data while adding to listeners\");\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\tcloseConnection();\n\t}",
"private void createDB() {\n try {\n Statement stat = conn.createStatement();\n stat.execute(\"CREATE TABLE settings (name TEXT, state);\");\n stat.execute(\"CREATE TABLE expressions (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n stat.execute(\"CREATE TABLE summaries (id INTEGER PRIMARY KEY ASC, expression_id INTEGER, title TEXT, abstract TEXT);\");\n stat.execute(\"CREATE TABLE history (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n }\n }",
"DataStore getDataStore ();",
"void init(Dataset ds, Session sess);",
"public void writeDatabase();",
"public void OpenDB() {\n\t\tString JDriver = \"com.microsoft.sqlserver.jdbc.SQLServerDriver\";// 数据库驱动\n\t\tSystem.out.println(\"数据库驱动成功\");\n\t\tString connectDB = \"jdbc:sqlserver://localhost:1433;DatabaseName=bookstoreDB\";// 数据库连接\n\t\ttry {\n\t\t\tClass.forName(JDriver);// 加载数据库引擎,返回给定字符串名的类\n\t\t} catch (ClassNotFoundException e) {// e.printStackTrace();\n\t\t\tSystem.out.println(\"加载数据库引擎失败\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\ttry {\n\t\t\tconDB = DriverManager.getConnection(connectDB, \"sa\", \"123456\");// 连接数据库对象\n\t\t\tSystem.out.println(\"连接数据库成功\");\n\t\t\tstaDB = conDB.createStatement();\n\t\t} // 创建SQL命令对象\n\t\tcatch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"数据库连接错误\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"public Database(String url) {\n this.url = url;\n\n File f = new File(url);\n\n if (f.exists()) {\n try {\n f.mkdirs();\n f.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //create table relationship\n LinkedList<String> relationship_attributes = new LinkedList<>();\n relationship_attributes.add(\"id_entity1\");\n relationship_attributes.add(\"id_entity2\");\n relationship_attributes.add(\"description\");\n this.create_table(\"relationship\", relationship_attributes);\n }",
"public static void createNewTable(int i) {\n // SQLite connection string\n// String url = \"jdbc:sqlite:C://sqlite/db/file\" + i +\".db\";\n String url = \"jdbc:sqlite:F:\\\\splitespace\\\\fileinfo\" + i + \".db\";\n // SQL statement for creating a new table\n String sql = \"CREATE TABLE IF NOT EXISTS FileInfo (\\n\"\n + \"\tid integer PRIMARY KEY,\\n\"\n + \"\tpath VARCHAR(255) NOT NULL,\\n\"\n + \"\tscantime BIGINT\\n\"\n + \");\";\n\n String sql2 = \"CREATE TABLE IF NOT EXISTS FileInfo (\\n\"\n + \"\tid integer PRIMARY KEY,\\n\"\n + \"\tpid integer,\\n\"\n + \"\tpath VARCHAR(255) NOT NULL,\\n\"\n + \" isParent VARCHAR(11),\\n\"\n + \" abpath VARCHAR(255),\\n\"\n + \" abppath VARCHAR(255)\\n\"\n + \");\";\n\n try (Connection conn = DriverManager.getConnection(url);\n Statement stmt = conn.createStatement()) {\n // create a new table\n stmt.execute(sql2);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public int initDb(KeywordFactory kwf, Reader csv) \n throws InterruptedException, IOException\n {\n int ex = 0;\n ex = createTable(kwf);\n if (ex > 0) return ex;\n\n ex = loadData(csv, kwf);\n return ex;\n }",
"public void loadGraph_Database(double lon1, double lon2, double lat1, double lat2, String name) {\n double time_graph = System.currentTimeMillis();\n System.out.println(\"============================================================\");\n geoDatabaseConnection connection = new geoDatabaseConnection(dbhost, dbport, dbuser, dbpasswd, dbname);\n \n // Graph generieren\n File file = new File(name + \".DAT\");\n // Graph von DB laden\n System.out.println(\"Fetching Data from DB and building graph\");\n try {\n connection.connect();\n graph = connection.getGraph(new Position(lon1, lat1), new Position(lon2, lat2), name);\n FileOutputStream fos = new FileOutputStream(file.getName());\n ObjectOutputStream out2 = new ObjectOutputStream(fos);\n out2.writeObject(graph);\n out2.close();\n fos.close();\n time_graph = (System.currentTimeMillis() - time_graph) / 1000;\n System.out.println(\"Fetching Data and building graph took: \" + time_graph + \"sec\");\n System.out.println(\"============================================================\");\n } catch (Exception e) {\n System.out.println(\"Error: \" + e.toString());\n e.printStackTrace();\n System.exit(1);\n }\n }",
"public DataBase open(){\n myDB = new MyHelper(ourContext);\n myDataBase = myDB.getWritableDatabase();\n return this;\n }",
"public DatabaseAccess(Context context) {\n this.openHelper = new OlpbhtbDatabase(context);\n }",
"public Database(Context context)\n\t{\n\t\t/* Instanciation de l'openHelper */\n\t\tDBOpenHelper helper = new DBOpenHelper(context);\n\t\t\n\t\t/* Load de la database */\n\t\t//TODO passer en asynchrone pour les perfs\n\t\tmainDatabase = helper.getWritableDatabase();\n\t\t\n\t\t/* DEBUG PRINT */\n\t\tLog.i(\"info\", \"Database Loading Suceeded\");\n\t}",
"@Override\n\tpublic Database createDatabase(Type type) throws FSException {\n\t\treturn new DummyDatabase();\n\t}",
"public void close() {\n/* */ try {\n/* 50 */ this.dat.close();\n/* */ }\n/* 52 */ catch (Exception e) {\n/* 53 */ Utilidades.writeError(\"FlujoDetalleDAO:close \", e);\n/* */ } \n/* */ }",
"void setup( File storeDir, Consumer<GraphDatabaseService> create );",
"public File getInputDb();",
"public DataPersistence() {\n storage = new HashMap<>();\n idCounter = 0;\n }",
"public NameSurferDataBase(String filename) {\t\n\t\tnameData(filename);\n\t}",
"private void createDbRecords() throws IOException, JAXBException {\n }",
"private TexeraDb() {\n super(\"texera_db\", null);\n }",
"public void open() {\n db = dbHelper.getWritableDatabase();\n articleDAO.open(db);\n categoryDAO.open(db);\n sourceDAO.open(db);\n }",
"public void creatDataBase(String dbName);",
"protected JDBCDataStore createDataStoreInternal(JDBCDataStore dataStore, Map params)\n throws IOException {\n return dataStore;\n }",
"public DALTieBreakDBManager() throws Exception\r\n {\r\n Properties props = new Properties();\r\n props.load(new FileReader(\"TieBreak.cfg\"));\r\n\r\n ds = new SQLServerDataSource();\r\n\r\n ds.setServerName(props.getProperty(\"SERVER\"));\r\n ds.setPortNumber(Integer.parseInt(props.getProperty(\"PORT\")));\r\n ds.setDatabaseName(props.getProperty(\"DATABASE\"));\r\n ds.setUser(props.getProperty(\"USER\"));\r\n ds.setPassword(props.getProperty(\"PASSWORD\"));\r\n }",
"private void openDatabase() {\n database = new DatabaseExpenses(this);\n database.open();\n }",
"void acquireDatasetCreateIndexLock(LockList locks, DataverseName dataverseName, String datasetName)\n throws AlgebricksException;",
"public DBAdapter open() {\n\n dataMap = new ArrayList<>();\n dataMap.add(new DBColumn(KEY_ROWID, \"99999\"));\n dataMap.add(new DBColumn(KEY_UNIQUEID, \"xxxxxxxxxxxx\"));\n\n dataMap.add(new DBColumn(KEY_EXTRACTIONPERIOD, \"xxxxxx\"));\n //dataMap.add(new DBColumn(KEY_SUBJECTID, \"\"));\n dataMap.add(new DBColumn(KEY_MEDICALRECORDNUMBER, \"999999999999\"));\n dataMap.add(new DBColumn(KEY_SITE, \"xxx\"));\n dataMap.add(new DBColumn(KEY_COMPLETED_BY, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ARRIVALDATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ARRIVALTIME, \"12:45\"));\n\n dataMap.add(new DBColumn(KEY_DATEOFBIRTH, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_SEX, \"Female\"));\n\n dataMap.add(new DBColumn(KEY_FRACTURESITE_FOOT, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_ANKLE, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_TIBIA, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_FEMUR, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_HIP, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_PELVIS, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_VERTEBRA, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_RIB, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_HUMERUS, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_FOREARM, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_WRIST, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_HEAD, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_TOES, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_FINGERS, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_HAND, \"xxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FRACTURESITE_OTHER, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n\n dataMap.add(new DBColumn(KEY_INJURY_MECHANISM, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_INJURY_TRAUMA, \"xxx\"));\n\n dataMap.add(new DBColumn(KEY_TRIAGE_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_TRIAGE_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_CTAS, \"xxxx\"));\n dataMap.add(new DBColumn(KEY_GLASGOW, \"xxxx\"));\n dataMap.add(new DBColumn(KEY_PAINSCALE, \"xxxx\"));\n dataMap.add(new DBColumn(KEY_COLLECTIVEORDER, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_HISTORYOFALTEREDCOGNITION, \"xxx\"));\n dataMap.add(new DBColumn(KEY_HISTORYOFALTEREDCOGNITIONSPECIFY, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTEREDCOGNITION, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n\n dataMap.add(new DBColumn(KEY_PHYSICIAN_EXAMINATION_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_PHYSICIAN_EXAMINATION_TIME, \"13:45\"));\n\n dataMap.add(new DBColumn(KEY_EVENTS_BOOL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_EVENTS_NUM, \"99\"));\n dataMap.add(new DBColumn(KEY_EVENTS_ORDER, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_FIRST_EVENT, \"999.99\"));\n\n //dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENTS_BOOL, \"\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_NUM, \"9\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_1_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_1_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_1_SCORE, \"xxxx\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_2_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_2_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_2_SCORE, \"xxxx\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_3_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_3_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_3_SCORE, \"xxxx\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_4_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_4_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_4_SCORE, \"xxxx\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_5_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_5_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_5_SCORE, \"xxxx\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_6_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_6_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_6_SCORE, \"xxxx\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_7_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_7_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_7_SCORE, \"xxxx\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_8_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_8_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_PAIN_ASSESSMENT_8_SCORE, \"xxxx\"));\n\n //dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_BOOL, \"\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_NUM, \"9\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_MODE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_1_STATUS, \"xxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_MODE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_2_STATUS, \"xxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_MODE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_3_STATUS, \"xxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_MODE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_4_STATUS, \"xxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_MODE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_5_STATUS, \"xxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_MODE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_6_STATUS, \"xxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_MODE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_7_STATUS, \"xxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_MODE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_PRES_8_STATUS, \"xxxxxxxx\"));\n\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_NUM, \"9\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_1_REFUSAL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_2_REFUSAL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_3_REFUSAL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_4_REFUSAL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_5_REFUSAL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_6_REFUSAL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_7_REFUSAL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_8_REFUSAL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_9_REFUSAL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_10_REFUSAL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_11_REFUSAL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_12_REFUSAL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_13_REFUSAL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_14_REFUSAL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_PRES_ID, \"xxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_PRES_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_PRES_ACETAMINOPHEN_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_PRES_ACETAMINOPHEN_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_PRES_ACETAMINOPHEN_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_PRES_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_PRES_NSAIDS_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_PRES_NSAIDS_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_PRES_NSAIDS_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_PRES_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_PRES_OPIOID_DOSE, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_PRES_OPIOID_ROUTE, \"xx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_PRES_OPIOID_FREQ, \"xxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_ACETAMINOPHEN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_NSAIDS, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_OPIOID, \"xxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ANALGESIC_ADMIN_15_REFUSAL, \"xxx\"));\n\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_NUM, \"9\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_1_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_1_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_1_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_1_TYPE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_2_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_2_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_2_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_2_TYPE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_3_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_3_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_3_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_3_TYPE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_4_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_4_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_4_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_4_TYPE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_5_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_5_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_5_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_5_TYPE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_6_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_6_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_6_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_6_TYPE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_7_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_7_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_7_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_7_TYPE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_8_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_8_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_8_ORDER, \"xxxxxxx\"));\n dataMap.add(new DBColumn(KEY_NERVE_BLOCK_8_TYPE, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_NUM, \"9\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_1_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_1_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_1, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_1_OTHER, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_2_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_2_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_2, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_2_OTHER, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_3_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_3_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_3, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_3_OTHER, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_4_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_4_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_4, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_4_OTHER, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_5_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_5_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_5, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_5_OTHER, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_6_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_6_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_6, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_6_OTHER, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_7_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_7_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_7, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_7_OTHER, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_8_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_8_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_8, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_ALTERNATIVE_PAIN_RELIEF_8_OTHER, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n\n dataMap.add(new DBColumn(KEY_EVIDENCE_ALTERED_COGNITION, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_SHORT_CAM_SCORE, \"xxxx\"));\n dataMap.add(new DBColumn(KEY_MENTAL_WORSENING, \"xxxxxxxxxxxxxx\"));\n\n dataMap.add(new DBColumn(KEY_DISCHARGE_DATE, \"2016-12-31\"));\n dataMap.add(new DBColumn(KEY_DISCHARGE_TIME, \"13:45\"));\n dataMap.add(new DBColumn(KEY_DISCHARGE_DESTINATION, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n dataMap.add(new DBColumn(KEY_DISCHARGE_PRESCRIPTION, \"xxx\"));\n dataMap.add(new DBColumn(KEY_DISCHARGE_TOOL, \"xxx\"));\n dataMap.add(new DBColumn(KEY_RETURN_ED, \"xxx\"));\n dataMap.add(new DBColumn(KEY_RETURN_ED_UNCONTROLLED_PAIN, \"xxx\"));\n dataMap.add(new DBColumn(KEY_RETURN_ED_REASON, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n\n dataMap.add(new DBColumn(KEY_NOTES, \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"));\n\n generateCreateDataString();\n\n db = myDBHelper.getWritableDatabase();\n\n return this;\n }",
"public void open() {\n\n\t\t_database = _dbHelper.getWritableDatabase();\n\t}",
"private void openDB() {\n\t\tmyDb = new DBAdapter(this);\n\t\t// open the DB\n\t\tmyDb.open();\n\t\t\n\t\t//populate the list from the database\n\t\tpopulateListViewFromDB();\n\t}"
] | [
"0.5775752",
"0.56815505",
"0.5634357",
"0.5549178",
"0.5543773",
"0.5501105",
"0.5453387",
"0.5431364",
"0.5398397",
"0.5390266",
"0.5372141",
"0.5294034",
"0.5290459",
"0.52645713",
"0.5254556",
"0.5252462",
"0.5236095",
"0.52004385",
"0.5166338",
"0.5155015",
"0.5152464",
"0.51411074",
"0.51336235",
"0.51310825",
"0.51292473",
"0.5119898",
"0.51082677",
"0.5091034",
"0.50849336",
"0.508351",
"0.50796527",
"0.5074518",
"0.50682294",
"0.5067791",
"0.50615174",
"0.50423616",
"0.50335425",
"0.5027651",
"0.50225186",
"0.5019362",
"0.501729",
"0.5009014",
"0.5004592",
"0.500395",
"0.5001187",
"0.5001174",
"0.49988356",
"0.4996151",
"0.4975383",
"0.49747983",
"0.4963228",
"0.49622428",
"0.49570152",
"0.49528396",
"0.49521756",
"0.49433318",
"0.49383965",
"0.4924698",
"0.49229848",
"0.4918246",
"0.4911726",
"0.4904912",
"0.4901444",
"0.48980394",
"0.48976848",
"0.48901844",
"0.48858625",
"0.48787814",
"0.4876828",
"0.48750368",
"0.48713267",
"0.48706138",
"0.4864647",
"0.48638204",
"0.48529455",
"0.485221",
"0.48432216",
"0.48399428",
"0.48339906",
"0.48339283",
"0.48320132",
"0.48304313",
"0.48302498",
"0.48297653",
"0.4822574",
"0.48177034",
"0.48133653",
"0.4811558",
"0.48080584",
"0.4807056",
"0.48057398",
"0.48053753",
"0.48037523",
"0.4800444",
"0.47973248",
"0.4790403",
"0.4782683",
"0.4782503",
"0.47812274",
"0.47793475"
] | 0.80544996 | 0 |
Inflate the layout for this fragment | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_about, container, false);
TextView appVersion = (TextView) view.findViewById(R.id.app_version);
String versionName = BuildConfig.VERSION_NAME;
Resources res = getResources();
String versionText = String.format(res.getString(R.string.app_version), versionName);
appVersion.setText(versionText);
getActivity().findViewById(R.id.fab).setVisibility(View.INVISIBLE);
return view;
} | {
"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 |
end of insert function | public void InOrder() {
InOrder(root);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void insert() {\n\t\t\n\t}",
"public void insert()\n\t{\n\t}",
"@Override\n\tpublic void preInsert() {\n\n\t}",
"@Override\n\tpublic void insertar() {\n\t\t\n\t}",
"@Override\n\tpublic void insertProcess() {\n\t\t\n\t}",
"public void insert(Conge conge) ;",
"int insert(Position record);",
"int insert(TDwBzzxBzflb record);",
"public abstract String insert(Object obj) ;",
"int insert(Goodexistsingle record);",
"int insert(TagData record);",
"int insert(Commet record);",
"public long insert();",
"void insert(Mi004 record);",
"void insert(T t);",
"int insert(Abum record);",
"int insert(Dormitory record);",
"int insert(ToolsOutIn record);",
"int insert(RepStuLearning record);",
"@Override\r\n\tpublic String insert() {\n\t\treturn \"insert\";\r\n\t}",
"int insert(Lbt72TesuryoSumDPkey record);",
"int insertSelective(Commet record);",
"int insert(FunctionInfo record);",
"int insertSelective(TDwBzzxBzflb record);",
"void insert(VRpMnBscHoIbc record);",
"void insert(int insertSize);",
"int insert(Massage record);",
"void insert(VRpDyCellBh record);",
"int insertSelective(Goodexistsingle record);",
"int insert(DictDoseUnit record);",
"int insert(TbFreightTemplate record);",
"int insert(Ltsprojectpo record);",
"int insert(Tourst record);",
"int insertSelective(Dress record);",
"int insert(TBBearPer record);",
"public void insert(T x);",
"int insertSelective(Tourst record);",
"int insert(StatementsWithSorting record);",
"int insert(CaseLinkman record);",
"int insert(Mallscroerule record);",
"int insert(SpecialCircumstance record);",
"int insert(Assist_table record);",
"int insert(AccuseInfo record);",
"void insert(VRpMnCellHoBhIbc record);",
"@Override\n\tpublic int insert(Cell record) {\n\t\treturn 0;\n\t}",
"int insertSelective(Lbt72TesuryoSumDPkey record);",
"int insertSelective(Assist_table record);",
"int insert(Basicinfo record);",
"int insertSelective(Massage record);",
"@Override\n\tpublic int insert(Object ob) {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic void insert(String... args) throws SQLException {\n\t\t\n\t}",
"int insert(VoteList record);",
"int insert(TerminalInfo record);",
"int insert(TLinkman record);",
"int insert(Terms record);",
"int insert(PrhFree record);",
"int insertSelective(DictDoseUnit record);",
"int insert(BaseCountract record);",
"int insert(Enfermedad record);",
"public void insert(T o);",
"int insertSelective(IntegralBook record);",
"int insert(Ttoken record);",
"int insertSelective(TerminalInfo record);",
"int insertSelective(TCar record);",
"int insert(TCar record);",
"int insert(IntegralBook record);",
"@Override\n\tpublic boolean insert(String sql) {\n\t\treturn false;\n\t}",
"@Override\r\n\tpublic void insertPrestito(Prestito p) {\n\t\t\r\n\t}",
"public void insert(E e);",
"int insert(SPerms record);",
"int insertSelective(Abum record);",
"int insertSelective(Enfermedad record);",
"int insert(VarRatio record);",
"int insertSelective(BaseCountract record);",
"@Override\n\tpublic void insert(Unidade obj) {\n\n\t}",
"int insert(R_order record);",
"int insert(Disease record);",
"int insert(YzStiveExplosion record);",
"int insert(ArticleTag record);",
"int insert(TCpySpouse record);",
"int insert(Forumpost record);",
"int insert(TDictAreas record);",
"int insertSelective(Forumpost record);",
"int insertSelective(Prueba record);",
"int insert(Clazz record);",
"@Override\r\n\tpublic Integer insert(Wt_collection record) {\n\t\treturn 0;\r\n\t}",
"int insertSelective(PrhFree record);",
"void insert(Registerdeductmarks registerdeductmarks);",
"void insert(T value, int position);",
"int insert(Body record);",
"int insertSelective(TagData record);",
"int insertSelective(SpecialCircumstance record);",
"int insert(GrpTagKey record);",
"int insert(Dress record);",
"int insertSelective(Ltsprojectpo record);",
"int insert(RecordLike record);",
"@Override\n\tpublic int insert2(Object ob) {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic int insert2(Object ob) {\n\t\treturn 0;\n\t}",
"int insert(TblMotherSon record);",
"int insertSelective(Tour record);",
"int insert(Comments record);"
] | [
"0.8180608",
"0.7998946",
"0.75891286",
"0.7564482",
"0.74837184",
"0.7205812",
"0.7154205",
"0.71083236",
"0.70854414",
"0.7074691",
"0.7071893",
"0.7051059",
"0.7026868",
"0.7011461",
"0.7011392",
"0.7007048",
"0.699582",
"0.6988056",
"0.6986743",
"0.6984884",
"0.6981573",
"0.69765675",
"0.6973267",
"0.6965636",
"0.69626683",
"0.69436467",
"0.69356257",
"0.69151145",
"0.6910527",
"0.69049937",
"0.6897804",
"0.6895872",
"0.689128",
"0.6889432",
"0.6889123",
"0.68884045",
"0.6886971",
"0.6885449",
"0.6883168",
"0.68808913",
"0.68807775",
"0.68773425",
"0.6876647",
"0.6876116",
"0.6875304",
"0.68746865",
"0.68553215",
"0.68523544",
"0.68509924",
"0.6847135",
"0.68446404",
"0.6841781",
"0.6837878",
"0.68368435",
"0.68167895",
"0.6816099",
"0.68153346",
"0.68117297",
"0.6809827",
"0.68083924",
"0.6802374",
"0.680229",
"0.67992854",
"0.67908585",
"0.6787716",
"0.6781455",
"0.67811024",
"0.677876",
"0.6771996",
"0.6771048",
"0.6768353",
"0.676007",
"0.67598325",
"0.6759232",
"0.6757355",
"0.6756534",
"0.675589",
"0.67540604",
"0.67465436",
"0.6744951",
"0.6740814",
"0.6740391",
"0.67304194",
"0.6726911",
"0.6722384",
"0.6720749",
"0.6720364",
"0.6719669",
"0.67166483",
"0.6711259",
"0.67109704",
"0.6709209",
"0.67049235",
"0.67022234",
"0.6700642",
"0.66993773",
"0.6696795",
"0.6696795",
"0.66966933",
"0.66932625",
"0.66923547"
] | 0.0 | -1 |
end of InOrder function | public void PreOrder() {
PreOrder(root);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void inorder() {\n\n\t}",
"public void inOrder() {\r\n \r\n // call the private inOrder method with the root\r\n inOrder(root);\r\n }",
"public void inOrder(){\n inOrder(root);\n }",
"int order();",
"public void inOrder() {\n inOrder(root);\n }",
"private void inorder() {\r\n\t\t\tinorder(root);\r\n\t\t}",
"private void inorder() {\n inorder(root);\n }",
"private void inOrder() {\n inOrderTraversal(0);\n System.out.println(); // jump to next line\n }",
"public void insertInorderBarrier() {\n\t\t\n\t}",
"public void inOrderTraverseRecursive();",
"public void inorder()\n {\n inorderRec(root);\n }",
"public void inOrder(){\n inOrder(root);\n System.out.println();\n }",
"public void inOrder() {\r\n\t\tSystem.out.print(\"IN: \");\r\n\t\tinOrder(root);\r\n\t\tSystem.out.println();\r\n\t}",
"public void inorder()\n {\n inorder(root);\n }",
"public void inorder()\n {\n inorder(root);\n }",
"public void inorder()\r\n {\r\n inorder(root);\r\n }",
"public void inOrderTraverseIterative();",
"public void inorder(Node source) {\n inorderRec(source);\n }",
"private List<T> inOrder(Node<T> curr, List<T> list) { //Time Complexity: O(n)\n if (curr == null) {\n return list;\n }\n inOrder(curr.left, list);\n list.add(curr.data);\n inOrder(curr.right, list);\n return list;\n }",
"int[] inOrderTraversal() {\n \tinOrderTraversalRecursive(this.root);\n \tInteger[] result = (Integer[])inorder.toArray(new Integer[0]);\n \tint[] r = new int[result.length];\n \tfor(int i = 0 ; i < result.length; i++)\n \t{\n \t\tr[i] = result[i];\n \t}\n \treturn r;\n }",
"boolean isIsOrdered();",
"protected void processOrder( Game game )\n {\n }",
"boolean isOrdered();",
"boolean isOrdered();",
"public void inorderTraversal() \n { \n inorderTraversal(header.rightChild); \n }",
"public void InOrder() {\n\t\tInOrder(root);\n\t}",
"boolean isOrderCertain();",
"public int getOrder();",
"public void incrementOrder() {\n mOrder++;\n }",
"public void postOrderTraversal(){\n System.out.println(\"postOrderTraversal\");\n //TODO: incomplete\n\n }",
"private void inOrder(Node x) {\n if (x == null) {\n return;\n }\n inOrder(x.left);\n System.out.println(x.key);\n inOrder(x.right);\n }",
"private List<Integer> inOrderTraversal(Tree tree, List<Integer> arr){\n if(tree==null){\n return null;\n }\n\n if(tree.left!=null){\n inOrderTraversal(tree.left, arr);\n }\n arr.add(tree.data);\n\n if(tree.right!=null){\n inOrderTraversal(tree.right,arr);\n }\n return arr;\n\n}",
"public myList<T> my_inorder();",
"@Override\n\tpublic void placeOrder() {\n\t\t\n\t}",
"private void inorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n inorder(root.left);\n list.add(root.element);\n inorder(root.right);\n }",
"public void printInorder() {\r\n System.out.print(\"inorder:\");\r\n printInorder(overallRoot);\r\n System.out.println();\r\n }",
"private void inOrder(BSTNode node) {\r\n \r\n // if the node is NOT null, execute the if statement\r\n if (node != null) {\r\n \r\n // go to the left node\r\n inOrder(node.getLeft());\r\n \r\n // visit the node (increment the less than or equal counter)\r\n node.incrementLessThan();\r\n \r\n // go to the right node\r\n inOrder(node.getRight());\r\n }\r\n }",
"@Override\n public Iterator<E> getInorderIterator() {\n return new InorderIterator();\n }",
"public void traversePreOrder() {\n\t\tpreOrder(this);\n\t}",
"public void printInorder() {\n System.out.print(\"inorder:\");\n printInorder(overallRoot);\n System.out.println();\n }",
"public void Inorder(Node p, List<Node> order_pointer){\n if(p == null){\n return;\n }\n Inorder(p.left, order_pointer);\n order_pointer.add(p);\n Inorder(p.right, order_pointer);\n }",
"private List<T> inOrderHelper(Node<T> current, List<T> result) {\n\t\tif (current != null) {\n\t\t\tresult = inOrderHelper(current.getLeft(), result);\n\t\t\tresult.add(current.getData());\n\t\t\tresult = inOrderHelper(current.getRight(), result);\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"@Override\n public int getOrder() {\n return 0;\n }",
"private void inorder(TreeNode<E> root) {\r\n\t\t\tif (root == null)\r\n\t\t\t\treturn;\r\n\t\t\tinorder(root.left);\r\n\t\t\tlist.add(root.element);\r\n\t\t\tinorder(root.right);\r\n\t\t}",
"List<Integer> traverseInOrder(List<Integer> oList) \n\t{\n\t\tif(this.left != null)\n\t\t{\n\t\t\tthis.left.traverseInOrder(oList);\n\t\t}\n\t\n\t\toList.add(this.key);\n\t\n\t\tif(this.right != null)\n\t\t{\n\t\t\tthis.right.traverseInOrder(oList);\n\t\t}\n\t\t\n\t\treturn oList;\n\t}",
"@Override\n\tpublic void preorder() {\n\n\t}",
"private void inOrder(Node root) {\r\n\t\t// inOrderCount++;\r\n\t\t// System.out.println(\" Count: \" + inOrderCount);\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// System.out.println(\" Count: \" + inOrderCount);\r\n\t\tinOrder(root.getlChild());\r\n\t\tif (inOrderCount < 20) {\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\tinOrderCount++;\r\n\t\t\t//System.out.println(\" Count: \" + inOrderCount);\r\n\t\t}\r\n\t\tinOrder(root.getrChild());\r\n\r\n\t}",
"public void inorderTraversal() {\n inorderThroughRoot(root);\n System.out.println();\n }",
"public void inOrderTraversal(Node node)\n\t{\n\t\tif(node!=null){\n\t\t\t\n\t\t\tinOrderTraversal(node.leftChild);\n\t\t\tarr.add(node.data);\n\t\t\tinOrderTraversal(node.rightChild);\n\t\t}\n\t}",
"int getPriorityOrder();",
"public List<T> inOrder() { //Time Complexity: O(1)\n List<T> list = new ArrayList<>();\n return inOrder(root, list);\n }",
"default int getOrder() {\n\treturn 0;\n }",
"@Override\n\tpublic int getOrder() {\n\t\treturn 1;\n\t}",
"public void inOrderTraversal() {\n beginAnimation();\n treeInOrderTraversal(root);\n stopAnimation();\n\n }",
"public void inorder()\r\n\t{\r\n\t\tif(root==null)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"tree is empty\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// find the leftmost node of the tree\r\n\t\tNode p =root;\r\n\t\twhile(p.leftThread==false)\r\n\t\t\tp=p.left;\r\n\t\twhile(p!=null)//loop until we reach the right most node whose right link(rightThread) is null\r\n\t\t{\r\n\t\t\tSystem.out.print(p.info + \" \");\r\n\t\t\tif(p.rightThread==true) // if 'right' is pointing to the inorder successor\r\n\t\t\t\tp = p.right;\r\n\t\t\telse // find the inorder successor i.e the left most node in the right sub tree\r\n\t\t\t{\r\n\t\t\t\tp = p.right;\r\n\t\t\t\twhile(p.leftThread==false)\r\n\t\t\t\t\tp = p.left;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}",
"private static boolean inOrderTraversal(Node current) {\n //Break if the node is null\n if(current == null) {\n return false;\n }\n //Recursively check the left child, then the current node, then finally the right child\n else {\n inOrderTraversal(current.getLeftChild());\n inorder.add(current);\n inOrderTraversal(current.getRightChild());\n }\n return true;\n }",
"public void listOrder()\r\n {o.listOrder();}",
"public void inorderTraverse(){\n\t\tinorderHelper(root);\n\t\tSystem.out.println();\n\t}",
"@Override\r\n\tpublic int getOrder() {\n\t\treturn 0;\r\n\t}",
"public void inOrderTraversal(){\n System.out.println(\"inOrderTraversal\");\n\n Stack<Node> stack = new ArrayStack<Node>();\n\n for(Node node = root; node!= null; node=node.getLeft()){\n stack.push(node);\n }\n while(!stack.isEmpty()){\n Node node = stack.pop();\n System.out.print(node.getData() + \" \");\n\n for(node=node.getRight(); node!= null; node = node.getLeft()){\n stack.push(node);\n }\n }\n\n System.out.println();\n }",
"@Override\r\n\tpublic List<Node<T>> getInOrderTraversal() {\r\n\t\tList<Node<T>> lista = new LinkedList<Node<T>>();// Lista para el\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// recursivo\r\n\t\tlista = auxiliarRecorridoIn(raiz, lista, raiz);\r\n\t\treturn lista;\r\n\t}",
"@Override\n\tpublic int getOrder() {\n\t\treturn Ordered.HIGHEST_PRECEDENCE + 10000;\n\t}",
"public static void main(String[] args) {\n\n\t\tint[] postOrder={110,121,135,71,101,116,40,22,32,100,82,142,6,143,25,49,123,87,77,31,120,12,48,41,66,17,109,63,28,35,140,113,70,79,122,92,53,96,90,75,8,114,21,36,91,9,115,43,128,37,93,107,86,1,104,138,16,65,14,2,102,111,98,83,10,119,52,68,19,85,84,80,118,13,130,94,18,50,112,11,44,124,51,134,55,99,62,56,33,57,30,137,81,39,105,108,89,42,5,126,64,23,60,141,136,127,103,3,78,139,4,74,26,129,88,20,7,59,69,133,73,97,61,131,45,38,125,54,76,46,95,106,47,67,24,72,15,34,27,29,58,117,132,0};\n\t\tint[] inOrder={117,58,67,95,46,54,125,73,69,59,7,88,26,139,78,103,136,60,23,126,42,89,105,81,137,30,33,56,99,51,44,112,50,18,13,118,80,84,85,68,52,10,83,98,111,102,2,16,86,36,21,114,8,75,90,53,92,122,70,66,41,120,31,77,87,123,25,143,6,82,100,22,116,101,135,110,121,71,40,32,142,49,12,48,17,109,63,28,35,140,113,79,96,91,9,115,43,128,37,93,107,1,104,138,65,14,119,19,130,94,11,124,134,55,62,57,39,108,5,64,141,127,3,4,74,129,20,133,97,61,131,45,38,76,106,47,24,72,15,34,27,29,132,0};\n\t\tTreeNode root=null;\n\t\tSystem.out.println(\"Size \"+postOrder.length);\n\t\t\n\t\ttry {\n\t\t\troot = new CreateTreeGivenPostAndInOrder().createBinaryTree(postOrder, 0, postOrder.length-1, inOrder, 0, inOrder.length-1);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Invalid Input\");\n\t\t}\n\t\t\n\t\troot.inOrderTraversal(root);\n\t\tnew DeepestNodeInBinaryTree().findDeepestNode(root, 0);\n\t\tSystem.out.println(\"\\nNode Data \"+deepestNode.node.data+\" Depth \"+deepestNode.depth);\n\t\t\n\t}",
"private void inorder(Node x, MyQueue<Key> q) {\n if (x == null) return;\n inorder(x.left, q);\n q.add(x.key);\n inorder(x.right, q);\n }",
"public Integer getOrder();",
"void inOrderTraversal(Node node){\r\n\t\tif( node == null ) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tinOrderTraversal( node.left );\r\n\t\tSystem.out.print( node.value + \" \");\r\n\t\tinOrderTraversal( node.right );\r\n\t}",
"private void inOrderTraversal(StringBuilder sb) {\n if (left != null) {\n left.inOrderTraversal(sb);\n }\n\n sb.append(data + \" \");\n\n\n if (right != null) {\n right.inOrderTraversal(sb);\n }\n }",
"private void inOrder(HomogeneusNode root) {\n if (root != null) {\n inOrder(root.getLeft());\n System.out.printf(\"%d\", root.getData());\n inOrder(root.getRight());\n }\n }",
"@Override\n\tpublic void accept_order() {\n\t\t\n\t}",
"int[] getGivenByOrder();",
"private void inOrderTraversal(int index) {\n // go through the graph as long as has values\n if (array[index] == null) {\n return;\n }\n //call recursively the method on left child\n inOrderTraversal(2 * index + 1);\n // print the node\n System.out.print(array[index] + \", \");\n //call recursively the method on right child\n inOrderTraversal(2 * index + 2);\n }",
"public void insertReorderBarrier() {\n\t\t\n\t}",
"void inOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tinOrderTraversal(node.getLeftNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t\tinOrderTraversal(node.getRightNode());\n\t}",
"void printpopulateInorderSucc(Node t){\n\t\n\n}",
"public void inOrder(Node myNode){\n \n if (myNode != null){ //If my node is not null, excute the following\n \n inOrder(myNode.left); //Recurse with left nodes\n System.out.println(myNode.name); //Print node name \n inOrder(myNode.right); //Recurse with right nodes\n \n }\n }",
"public void traverseInOrder() {\n\t System.out.println(\"============= BTREE NODES ===============\");\n\t\tinOrder(root);\n System.out.println(\"=========================================\");\n\t}",
"@objid (\"fcf73d01-d406-41e9-9490-067237966153\")\n boolean isIsOrdered();",
"Order getOrder();",
"public void inOrder(MyBinNode<Type> r){\n if(r != null){\n this.inOrder(r.left);\n System.out.print(r.value.toString() + \" \");\n this.inOrder(r.right);\n }\n }",
"boolean isOrderable();",
"public int[] inOrder(Integer currentLine){\r\n\t \t\t\r\n\t\t//Case for exit recursive function. CurrentLine is a leaf of the tree\r\n\t\tif (currentLine == -1){\r\n\t \t return orderedArray; \r\n\t }\r\n\t\t//Search left subtree\r\n\t\tinOrder(getLeft(currentLine));\r\n\t //Add to array the info of current Node\r\n\t orderedArray[oArrayAvail]=getKey(currentLine);\r\n\t oArrayAvail++;\r\n\t //Search right subtree\r\n\t inOrder(getRight(currentLine));\r\n\t return orderedArray;\r\n\t\t\r\n\t}",
"@Override\r\n\tprotected void processInMerChantOrderEvent(InMerChantOrderEvent arg0) {\n\t\t\r\n\t}",
"@Override\n\tpublic boolean PlaceOrder(Order order) {\n\t\treturn false;\n\t}",
"public void visitInorder(Visitor<T> visitor) { if (root != null) root.visitInorder(visitor); }",
"private void Inorder(Node p, Set<K> keyset){\n if(p == null){\n return;\n }\n Inorder(p.left, keyset);\n keyset.add(p.key);\n Inorder(p.right, keyset);\n }",
"private void inOrder(Node<T> node){\n if(node != null){\n inOrder(node.left);\n System.out.print(node.data + \" ,\");\n inOrder(node.right);\n }\n }",
"public myList<T> my_preorder();",
"private void traverseInOrder(BinaryNode<AnyType> curr) {\n\t\tif (curr.left != null) {\n\t\t\ttraverseInOrder(curr.left);\n\t\t}\n\t\tSystem.out.println(curr.element);\n\n\t\t// checking for duplicates\n\n\t\tfor (int i = 0; i < curr.duplicate.size(); i++) {\n\t\t\tSystem.out.println(curr.duplicate.get(i).element);\n\t\t}\n\n\t\tif (curr.right != null) {\n\t\t\ttraverseInOrder(curr.right);\n\t\t}\n\t}",
"@Override\n\tpublic void postorder() {\n\n\t}",
"public void testGetOrder() {\n }",
"void inorderTraversal(Node node) {\n\t\tif (node != null) {\n\t\t\tinorderTraversal(node.left);\n\t\t\tSystem.out.print(node.data + \" \");\n\t\t\tinorderTraversal(node.right);\n\t\t}\n\t}",
"private void inorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tinorderHelper(root.left);\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t\tinorderHelper(root.right);\n\t\t}\n\t}",
"private <E> void inOrder(Node root, Action<Integer,E> action) {\n\t\tif(root==null)\n\t\t\treturn;\n\t\t\n\t\tinOrder(root.left,action);\n\t\t//System.out.println(root.value);\n\t\taction.execute(root.value);\n\t\t\n\t\tinOrder(root.right,action);\n\t\t\n\t}",
"public void inOrderTraversalRecursive(ArrayList<Integer> o, RBNode x){\r\n\t\tif(x.left != nil) inOrderTraversalRecursive(o,x.left);\r\n\t\to.add(x.key);\r\n\t\tif(x.right != nil) inOrderTraversalRecursive(o,x.right);\r\n\t}",
"void inOrder(TreeNode node) \n { \n if (node == null) \n return; \n \n inOrder(node.left); \n System.out.print(node.val + \" \"); \n \n inOrder(node.right); \n }",
"public static void main(String[] args) {\n\n\n TreeNode root = new TreeNode(1);\n TreeNode left1 = new TreeNode(2);\n TreeNode left2 = new TreeNode(3);\n TreeNode left3 = new TreeNode(4);\n TreeNode left4 = new TreeNode(5);\n TreeNode right1 = new TreeNode(6);\n TreeNode right2 = new TreeNode(7);\n TreeNode right3 = new TreeNode(8);\n TreeNode right4 = new TreeNode(9);\n TreeNode right5 = new TreeNode(10);\n root.left = left1;\n root.right = right1;\n left1.left = left2;\n left1.right = left3;\n left3.right = left4;\n right1.left = right2;\n right1.right = right3;\n right2.right = right4;\n right3.left = right5;\n //[3, 2, 4, 5, 1, 7, 9, 6, 10, 8]\n List<Integer> list = inorderTraversalN(root);\n System.err.println(list);\n }",
"List<Integer> traversePreOrder(List<Integer> oList) \n\t{\t\t\n\t\toList.add(this.key);\n\t\t\n\t\tif(this.left != null)\n\t\t{\n\t\t\tthis.left.traversePreOrder(oList);\n\t\t}\n\t\t\n\t\tif(this.right != null)\n\t\t{\n\t\t\tthis.right.traversePreOrder(oList);\n\t\t}\n\t\t\n\t\treturn oList;\t\t\n\t}",
"void findSearchOrder() {\n boolean filled = false;\n for(int node: queryGraphNodes.keySet()) {\n\n vertexClass vc = queryGraphNodes.get(node);\n searchOrderSeq.add(node);\n for(int edge: queryGraphNodes.get(node).edges.keySet()) {\n filled = calcOrdering(edge);\n if (filled)\n break;\n }\n if(searchOrderSeq.size() == queryGraphNodes.size())\n break;\n\n }\n\n }",
"static void inorder(TreeNode root, List<Integer> output) {\n if (root == null) {\n return;\n }\n inorder(root.left, output);\n output.add(root.val);\n inorder(root.right, output);\n }",
"@Test\r\n\tpublic void testOrderPerform() {\n\t}",
"private void goZhuSuOrder(int position){\n\t}"
] | [
"0.7537968",
"0.7155268",
"0.69415075",
"0.6826323",
"0.68081516",
"0.6711279",
"0.66901606",
"0.66634685",
"0.65341574",
"0.6488685",
"0.64538485",
"0.6443115",
"0.64265394",
"0.64101994",
"0.64101994",
"0.63909477",
"0.6378961",
"0.63758504",
"0.6339521",
"0.62996596",
"0.6293242",
"0.6276963",
"0.62690675",
"0.62690675",
"0.62585384",
"0.6235245",
"0.6217118",
"0.6166657",
"0.61582714",
"0.6153568",
"0.6151497",
"0.6129256",
"0.61168885",
"0.6111618",
"0.60678154",
"0.6058216",
"0.6046097",
"0.603783",
"0.602953",
"0.6026078",
"0.60204744",
"0.60129434",
"0.600883",
"0.6008629",
"0.60049564",
"0.59962314",
"0.5984215",
"0.5959035",
"0.59551394",
"0.59425867",
"0.5940646",
"0.5937392",
"0.5934669",
"0.59331286",
"0.59281415",
"0.592805",
"0.59272116",
"0.59262866",
"0.59177446",
"0.5916888",
"0.58885044",
"0.5883067",
"0.58673686",
"0.5853682",
"0.58498055",
"0.5848487",
"0.58396053",
"0.58135104",
"0.5810189",
"0.5808759",
"0.5806491",
"0.58044666",
"0.5800662",
"0.5771243",
"0.57710123",
"0.576742",
"0.5745479",
"0.57431436",
"0.5728023",
"0.5726858",
"0.5722045",
"0.57151663",
"0.5709985",
"0.5709109",
"0.5708078",
"0.57037354",
"0.57017225",
"0.5701605",
"0.56974006",
"0.5686083",
"0.5677674",
"0.5675565",
"0.567118",
"0.5665489",
"0.56616163",
"0.5655077",
"0.5653592",
"0.56447506",
"0.5637871",
"0.5635801",
"0.5635264"
] | 0.0 | -1 |
end of PreOrder function | public void PostOrder() {
PostOrder(root);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void preorder() {\n\n\t}",
"public void traversePreOrder() {\n\t\tpreOrder(this);\n\t}",
"public void PreOrder() {\n\t\tPreOrder(root);\n\t}",
"public void preOrder() {\n preOrder(root);\n }",
"public void preOrder() {\r\n\t\tSystem.out.print(\"PRE: \");\r\n\r\n\t\tpreOrder(root);\r\n\t\tSystem.out.println();\r\n\r\n\t}",
"public void preorder()\n {\n preorder(root);\n }",
"public void preorder()\n {\n preorder(root);\n }",
"@Override\n\tpublic void inorder() {\n\n\t}",
"public void preorder()\r\n {\r\n preorder(root);\r\n }",
"public void preorder() {\n\t\tpreorder(root);\n\t}",
"private E[] getPreOrderLeftSubTree(E[] inOrderTraversal,E[] preOrderTraversal) {\n\t\treturn null;\n\t}",
"@Test\n\tvoid tesPreorder() {\n\t\tHeap<Integer, Integer> treap = createTreeHeap();\n\t\t//root, left, right\n\t\tassertEquals(\"[5, 4, 2, 1, 3]\", treap.preOrder());\n\t}",
"public void preOrder(){\n preOrder(root);\n System.out.println();\n }",
"void preProcess();",
"private void preOrder(HomogeneusNode root) {\n\n if (root != null) {\n System.out.printf(\"%d\", root.getData());\n preOrder(root.getLeft());\n preOrder(root.getRight());\n }\n }",
"void preOrderOperation(PortfolioNode portfolioNode);",
"private void preOrder(Node root) {\r\n\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (preOrderCount < 20) {\r\n\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\t//System.out.println(\" Count: \" + preOrderCount);\r\n\t\t\tpreOrderCount++;\r\n\t\t\tpreOrder(root.getlChild());\r\n\t\t\tpreOrder(root.getrChild());\r\n\t\t}\r\n\r\n\t}",
"public void preOrder (Node root)\n\t{\n\t \n\t if(root == null)\n\t {\n\t\t return;\n\t }\n\t \n\t addValToPreorder(root);\n\t \n\t //get all of the left nodes\n\t preOrder(root.leftNode());\n\t //get all of the right nodes\n\t preOrder(root.rightNode()); \n\t \n\t}",
"public void preorder() {\n root.preorder();\n System.out.println(\"\");\n }",
"@Override\r\n\tpublic List<Node<T>> getPreOrderTraversal() {\r\n\t\tList<Node<T>> lista = new LinkedList<Node<T>>();// La lista para el\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// recursivo\r\n\t\treturn auxiliarRecorridoPre(raiz, lista);\r\n\t}",
"void preOrderOperation(PortfolioNode parentNode, Position position);",
"@Override\n\tpublic void postorder() {\n\n\t}",
"public void insertReorderBarrier() {\n\t\t\n\t}",
"List<Integer> traversePreOrder(List<Integer> oList) \n\t{\t\t\n\t\toList.add(this.key);\n\t\t\n\t\tif(this.left != null)\n\t\t{\n\t\t\tthis.left.traversePreOrder(oList);\n\t\t}\n\t\t\n\t\tif(this.right != null)\n\t\t{\n\t\t\tthis.right.traversePreOrder(oList);\n\t\t}\n\t\t\n\t\treturn oList;\t\t\n\t}",
"private List<T> preOrderHelper(Node<T> current, List<T> result) {\n\t\tif (current != null) {\n\t\t\tresult.add(current.getData());\n\t\t\tresult = preOrderHelper(current.getLeft(), result);\n\t\t\tresult = preOrderHelper(current.getRight(), result);\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"public void preOrderTraversal(){\n System.out.println(\"preOrderTraversal\");\n\n Stack<Node> stack = new ArrayStack();\n\n if(root!=null){\n stack.push(root);\n }\n while(!stack.isEmpty()) {\n Node node = stack.pop();\n System.out.print(node.getData() + \" \");\n\n if (node.getRight() != null) {\n stack.push(node.getRight());\n }\n if (node.getLeft() != null) {\n stack.push(node.getLeft());\n }\n }\n System.out.println();\n }",
"public void preorderTraversal() \n { \n preorderTraversal(header.rightChild); \n }",
"private void preOrderTraversal(StringBuilder sb) {\n sb.append(data + \" \");\n\n if (left != null) {\n left.preOrderTraversal(sb);\n }\n\n if (right != null) {\n right.preOrderTraversal(sb);\n }\n }",
"void preOrder(Node node) \n { \n if (node != null) \n { \n System.out.print(node.key + \" \"); \n preOrder(node.left); \n preOrder(node.right); \n } \n }",
"public myList<T> my_preorder();",
"public void preOrder(BinarySearchTreeNode<T> node)\r\n {\r\n if(node==null)\r\n {\r\n return;\r\n }\r\n System.out.println(node.getElement());\r\n preOrder(node.getLeft());\r\n preOrder(node.getRight());\r\n }",
"@Override\r\n\tprotected void doPre() {\n\t\t\r\n\t}",
"private E[] getInOrderLeftSubTree(E[] inOrderTraversal,\n\t\t\tE[] preOrderTraversal) {\n\t\treturn null;\n\t}",
"void preOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tSystem.out.print(node.getValue() + \" \");\n\t\tpreOrderTraversal(node.getLeftNode());\n\t\tpreOrderTraversal(node.getRightNode());\n\t}",
"public void preOrderTraversal() {\n beginAnimation();\n treePreOrderTraversal(root);\n stopAnimation();\n\n }",
"private String traversePreOrder(BinaryNode<T> root) {\n preOrderTrav += root.getData() + \" -> \";\n if (root.getLeftNode() != null) { // traverse left\n traversePreOrder(root.getLeftNode());\n }\n if (root.getRightNode() != null) { // traverse right\n traversePreOrder(root.getRightNode());\n }\n return preOrderTrav;\n }",
"public void preOrderTraversal() {\n preOrderThroughRoot(root);\n System.out.println();\n }",
"public static void preorderBinaryTree(BinaryTreeNode t) {\n p = t;\r\n top = -1;\r\n i = 0;\r\n\r\n while (p != null || top != -1) {\r\n if (p != null) {\r\n visitBinTreeNode(p);\r\n\r\n s[++top] = p; //push(p,s)\r\n if (p.getLeftTree() != null) {\r\n p = p.getLeftTree();\r\n } else {\r\n System.out.print(\")\");\r\n i++;\r\n p = p.getRightTree();\r\n }\r\n } else {\r\n do {\r\n q = s[top];\r\n top--;\r\n if (top != -1) {//is s is not empty\r\n BinaryTreeNode newTop = s[top];\r\n rtptr = newTop.getRightTree();\r\n } else {\r\n rtptr = null;\r\n }\r\n } while (top != -1 && q == rtptr);\r\n\r\n p = rtptr;\r\n\r\n if (i < n) {\r\n i++;\r\n System.out.print(\")\");\r\n }\r\n }\r\n }\r\n }",
"private <E> void preOrder(Node root,Action<Integer,E> action) {\n\t\tif(root==null)\n\t\t\treturn;\n\t\t\n\t\t//System.out.println(root.value);\n\t\taction.execute(root.value);\n\n\t\tpreOrder(root.left,action);\n\t\t\n\t\tpreOrder(root.right,action);\n\t\t\n\t}",
"int order();",
"public void postOrderTraversal(){\n System.out.println(\"postOrderTraversal\");\n //TODO: incomplete\n\n }",
"public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}",
"public void insertInorderBarrier() {\n\t\t\n\t}",
"private static void preOrder(Node root) {\n\t\tif (root == null)\n\t\t\treturn;\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrder(root.left);\n\t\tpreOrder(root.right);\n\t}",
"@Override\n public Object preProcess() {\n return null;\n }",
"@Override\n\tpublic void pre()\n\t{\n\n\t}",
"public void printPreorder() {\n System.out.print(\"preorder:\");\n printPreorder(overallRoot);\n System.out.println();\n }",
"private void preorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t\tpreorderHelper(root.left);\n\t\t\tpreorderHelper(root.right);\n\t\t}\n\t}",
"@Override\n public Iterator<E> getPreorderIterator() {\n return new PreorderIterator();\n }",
"public static void main(String[] args) {\n\n\t\tint[] postOrder={110,121,135,71,101,116,40,22,32,100,82,142,6,143,25,49,123,87,77,31,120,12,48,41,66,17,109,63,28,35,140,113,70,79,122,92,53,96,90,75,8,114,21,36,91,9,115,43,128,37,93,107,86,1,104,138,16,65,14,2,102,111,98,83,10,119,52,68,19,85,84,80,118,13,130,94,18,50,112,11,44,124,51,134,55,99,62,56,33,57,30,137,81,39,105,108,89,42,5,126,64,23,60,141,136,127,103,3,78,139,4,74,26,129,88,20,7,59,69,133,73,97,61,131,45,38,125,54,76,46,95,106,47,67,24,72,15,34,27,29,58,117,132,0};\n\t\tint[] inOrder={117,58,67,95,46,54,125,73,69,59,7,88,26,139,78,103,136,60,23,126,42,89,105,81,137,30,33,56,99,51,44,112,50,18,13,118,80,84,85,68,52,10,83,98,111,102,2,16,86,36,21,114,8,75,90,53,92,122,70,66,41,120,31,77,87,123,25,143,6,82,100,22,116,101,135,110,121,71,40,32,142,49,12,48,17,109,63,28,35,140,113,79,96,91,9,115,43,128,37,93,107,1,104,138,65,14,119,19,130,94,11,124,134,55,62,57,39,108,5,64,141,127,3,4,74,129,20,133,97,61,131,45,38,76,106,47,24,72,15,34,27,29,132,0};\n\t\tTreeNode root=null;\n\t\tSystem.out.println(\"Size \"+postOrder.length);\n\t\t\n\t\ttry {\n\t\t\troot = new CreateTreeGivenPostAndInOrder().createBinaryTree(postOrder, 0, postOrder.length-1, inOrder, 0, inOrder.length-1);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Invalid Input\");\n\t\t}\n\t\t\n\t\troot.inOrderTraversal(root);\n\t\tnew DeepestNodeInBinaryTree().findDeepestNode(root, 0);\n\t\tSystem.out.println(\"\\nNode Data \"+deepestNode.node.data+\" Depth \"+deepestNode.depth);\n\t\t\n\t}",
"public void visitPreorder(Visitor<T> visitor) { if (root != null) root.visitPreorder(visitor); }",
"public String preorderTraverse(){\r\n\t\t\r\n\t\t//the recursive call to the private method\r\n\t\t//StringBuffer is used because it is passed by reference\r\n\t\t//StringBuffer can be changed in recursive calls\r\n\t\treturn preorderTraverse(this, new StringBuffer(\"\"));\r\n\t}",
"private void validOrderResult() {\n TreeNode currentTreeNode = treeLeaf;\n TreeNode orderTreeNode = null;\n while (!(currentTreeNode instanceof SourceTreeNode)) {\n if (currentTreeNode instanceof OrderGlobalTreeNode) {\n orderTreeNode = currentTreeNode;\n break;\n } else {\n currentTreeNode = UnaryTreeNode.class.cast(currentTreeNode).getInputNode();\n }\n }\n if (null != orderTreeNode) {\n OrderGlobalTreeNode orderGlobalTreeNode = OrderGlobalTreeNode.class.cast(orderTreeNode);\n TreeNode aggTreeNode = orderTreeNode.getOutputNode();\n while (aggTreeNode != null && aggTreeNode.getNodeType() != NodeType.AGGREGATE) {\n aggTreeNode = aggTreeNode.getOutputNode();\n }\n if (null != aggTreeNode) {\n if (aggTreeNode instanceof FoldTreeNode) {\n TreeNode inputTreeNode = UnaryTreeNode.class.cast(aggTreeNode).getInputNode();\n if (inputTreeNode == orderTreeNode) {\n return;\n }\n UnaryTreeNode inputUnaryTreeNode = UnaryTreeNode.class.cast(inputTreeNode);\n if (inputUnaryTreeNode.getInputNode() == orderTreeNode &&\n (inputUnaryTreeNode instanceof EdgeVertexTreeNode &&\n EdgeVertexTreeNode.class.cast(inputUnaryTreeNode).getDirection() != Direction.BOTH)) {\n return;\n }\n String orderLabel = orderGlobalTreeNode.enableOrderFlag(labelManager);\n SelectOneTreeNode selectOneTreeNode = new SelectOneTreeNode(new SourceDelegateNode(inputUnaryTreeNode, schema), orderLabel, Pop.last, Lists.newArrayList(), schema);\n selectOneTreeNode.setConstantValueType(new ValueValueType(Message.VariantType.VT_INTEGER));\n OrderGlobalTreeNode addOrderTreeNode = new OrderGlobalTreeNode(inputUnaryTreeNode, schema,\n Lists.newArrayList(Pair.of(selectOneTreeNode, Order.incr)));\n UnaryTreeNode.class.cast(aggTreeNode).setInputNode(addOrderTreeNode);\n }\n } else {\n if (treeLeaf instanceof OrderGlobalTreeNode) {\n return;\n }\n TreeNode currTreeNode = orderTreeNode.getOutputNode();\n boolean hasSimpleShuffle = false;\n while (currTreeNode != null) {\n if (currTreeNode.getNodeType() == NodeType.FLATMAP\n || (currTreeNode instanceof PropertyNode &&\n !(UnaryTreeNode.class.cast(currTreeNode).getInputNode().getOutputValueType() instanceof EdgeValueType))) {\n hasSimpleShuffle = true;\n break;\n }\n currTreeNode = currTreeNode.getOutputNode();\n }\n if (!hasSimpleShuffle) {\n return;\n }\n\n UnaryTreeNode outputTreeNode = UnaryTreeNode.class.cast(treeLeaf);\n if (outputTreeNode.getInputNode() == orderTreeNode) {\n if (outputTreeNode instanceof EdgeVertexTreeNode &&\n EdgeVertexTreeNode.class.cast(outputTreeNode).getDirection() != Direction.BOTH) {\n return;\n }\n if (orderTreeNode.getOutputValueType() instanceof EdgeValueType && outputTreeNode instanceof PropertyNode) {\n return;\n }\n }\n String orderLabel = orderGlobalTreeNode.enableOrderFlag(labelManager);\n SelectOneTreeNode selectOneTreeNode = new SelectOneTreeNode(new SourceDelegateNode(treeLeaf, schema), orderLabel, Pop.last, Lists.newArrayList(), schema);\n selectOneTreeNode.setConstantValueType(new ValueValueType(Message.VariantType.VT_INTEGER));\n treeLeaf = new OrderGlobalTreeNode(treeLeaf, schema,\n Lists.newArrayList(Pair.of(selectOneTreeNode, Order.incr)));\n }\n }\n }",
"private void traversePreOrder(BinaryNode<AnyType> curr, int indent) {\n\t\tfor(int i = 0; i < indent; i++) {\n\t\t\tSystem.out.print(\"\\t\");\n\t\t}\n\t\tSystem.out.println(curr.element);\n\t\tfor (int i = 0; i < curr.duplicate.size(); i++) {\n\t\t\tSystem.out.println(curr.duplicate.get(i).element);\n\t\t}\n\t\tif (curr.left != null) {\n\t\t\ttraversePreOrder(curr.left, indent + 1);\n\t\t}\n\n\t\tif (curr.right != null) {\n\t\t\ttraversePreOrder(curr.right, indent + 1);\n\t\t}\n\t}",
"private void preOrderTraversal(int index) {\n if (array[index] == null) {\n return;\n }\n // print the node\n System.out.print(array[index] + \", \");\n //call recursively the method on left child\n preOrderTraversal(2 * index + 1);\n //call recursively the method on right child\n preOrderTraversal(2 * index + 2);\n }",
"private void preOrder(Node node) {\n\t\tif(null == node) return;\n\t\t\n\t\t//Print node\n\t\tSystem.out.println(node.data);\n\t\t\n\t\t//Go to left child node\n\t\tpreOrder(node.left);\n\t\t\n\t\t//Go to right child node\n\t\tpreOrder(node.right);\n\t}",
"@Override\n public int getOrder() {\n return 0;\n }",
"void preOrder(Node Node) {\n if (Node != null) {\n System.out.print(Node.key + \" \");\n preOrder(Node.left);\n preOrder(Node.right);\n }\n }",
"public void preOrder(TreeNode root){\n\t\t//Change place of temp\n\t\tSystem.out.println(root.toString());\n\t\tif(root.getLeft()!= null){\n\t\t\tpreOrder(root.getLeft());\n\t\t}\n\t\tif(root.getMiddle()!=null){\n\t\t\tpreOrder(root.getMiddle());\n\t\t}\n\t\tif(root.getRight()!= null){\n\t\t\tpreOrder(root.getRight());\n\t\t}\n\t}",
"public static void preOrder(Node n) {\n\t\tif (n == null)\n\t\t\treturn;\n\t\tSystem.out.println(n.getData());\n\t\tpreOrder(n.getLeft());\n\t\tpreOrder(n.getRight());\n\t}",
"@Override\n public void preprocess() {\n }",
"private void preorderHelper(ArrayList<T> list, BSTNode<T> current) {\n // look at data, left, right\n if (current.getLeft() != null) {\n list.add(current.getLeft().getData());\n preorderHelper(list, current.getLeft());\n }\n if (current.getRight() != null) {\n list.add(current.getRight().getData());\n preorderHelper(list, current.getRight());\n }\n }",
"@Override\n\tpublic void placeOrder() {\n\t\t\n\t}",
"private void testPreorderTemplate(OrderTraversal orderTraversal) {\n System.out.println(\"Testing against \" + orderTraversal.getClass().getSimpleName());\n testOne(\"1,2,3,4,5\", Lists.newArrayList(1, 2, 4, 5, 3), orderTraversal);\n testOne(\"1\", Lists.newArrayList(1), orderTraversal);\n testOne(\"4,2,7,1,3,6,9\", Lists.newArrayList(4, 2, 1, 3, 7, 6, 9), orderTraversal);\n testOne(\"4,2,7,1,#,6,9,8,10,#,5\", Lists.newArrayList(4, 2, 1, 8, 10, 7, 6, 5, 9), orderTraversal);\n System.out.println(StringUtils.repeat(\"-\", 30));\n }",
"@Override\r\n\tpublic int getOrder() {\n\t\treturn 0;\r\n\t}",
"private void preOrdertraverse(Node root){\n System.out.println(root.value);\n for(var child : root.getChildren())\n preOrdertraverse(child); //recursively travels other childrens in current child\n }",
"default int getOrder() {\n\treturn 0;\n }",
"private void preOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n System.out.print(root.getData() + \" \");\n preOrderTraversalRec(root.getLeft());\n preOrderTraversalRec(root.getRight());\n }",
"protected void preorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n System.out.print(root.element + \" \");\n preorder(root.left);\n preorder(root.right);\n }",
"public void preOrder(Node localRoot)\r\n\t{\r\n\t\tif(localRoot != null)\r\n\t\t{\r\n\t\t\tSystem.out.print(localRoot.data+\" \");\r\n\t\t\tpreOrder(localRoot.leftChild);\r\n\t\t\tpreOrder(localRoot.rightChild);\r\n\t\t}\r\n\t}",
"protected void preorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t\tpreorder(root.left);\r\n\t\tpreorder(root.right);\r\n\t}",
"private void preOrder(BSTNode<K,V> node, List<Entry<K,V>> list) throws NullPointerException {\n\t\tif (root == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tif (root != null) {\n\t\t\tlist.add(new Entry<K,V>(node.key, node.value));\n\t\t\t\n\t\t\tif (node.left != null) {\n\t\t\t\tpreOrder(node.left, list);\n\t\t\t}\n\t\t\t\n\t\t\tif (node.right != null) {\n\t\t\t\tpreOrder(node.right, list);\n\t\t\t}\n\t\t}\n\t}",
"public void preprocess() {\n }",
"public void preprocess() {\n }",
"public void preprocess() {\n }",
"public void preprocess() {\n }",
"public void preOrder(Visitor v) {\r\n\t\tpreOrder(root, v);\r\n\t}",
"public void preOrder(Node root) {\n if (root != null) {\n System.out.print(root.getData() + \" \");\n preOrder(root.getLeftChild());\n preOrder(root.getRightChild());\n }\n }",
"static void preOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n System.out.print(root.data + \" \");\n preOrderTraversal(root.left);\n preOrderTraversal(root.right);\n }",
"private void preOrder(int node, int[] parents) {\n currTour.add(node + 1);\n Queue<Integer> children = findChildren(node, parents);\n while(!children.isEmpty()) {\n preOrder(children.remove(), parents);\n }\n }",
"@Override\n public void preprocess() {\n }",
"public void buildTreeTraversals(E[] inOrder, E[] preOrder) {\n\n if (inOrder.length <= 0 || preOrder.length <= 0) System.out.println(\"Empty In-order or pre-order list given, silly goose!\");\n else {\n\n List<E> preorder = new ArrayList<>();\n List<E> inorder = new ArrayList<>();\n for (int i = 0; i < preOrder.length; i++) {\n preorder.add(preOrder[i]);\n inorder.add(inOrder[i]);\n }\n buildTreeTraversals(null, inorder, preorder, true);\n }\n }",
"public static void main(String[] args)\r\n {\r\n \r\n int[] preorder = { 1, 2, 4, 5, 3, 6, 8, 9, 7 };\r\n int[] isLeaf = { 0, 0, 1, 1, 0, 0, 1, 1, 1 };\r\n \r\n // construct the tree\r\n Node root = constructTree(preorder, isLeaf);\r\n \r\n // print the tree in preorder fashion\r\n System.out.print(\"Preorder Traversal of the constructed tree is: \");\r\n preorderTraversal(root);\r\n }",
"private void preorderSubtree(Position<E> p, List<Position<E>> snapshot) {\n snapshot.add(p);\n for (Position<E> c : children(p)) {\n preorderSubtree(c, snapshot); \n \n }\n }",
"public String getPreorder(Node root)\n\t{\n\t\tpreOrder(root);\n\t\t//return the string\n\t\treturn preorder;\n\t}",
"int getPriorityOrder();",
"public void inOrder() {\r\n \r\n // call the private inOrder method with the root\r\n inOrder(root);\r\n }",
"public ApplyOrder() {\n super();\n }",
"@Override\n\tpublic int getOrder() {\n\t\treturn 1;\n\t}",
"private void preorderH(BSTNode<T> p, List<T> list) {\n list.add(p.getData());\n if (p.getLeft() != null) {\n preorderH(p.getLeft(), list);\n }\n\n if (p.getRight() != null) {\n preorderH(p.getRight(), list);\n }\n }",
"public void preOrder(MyBinNode<Type> r){\n if(r != null){\n System.out.print(r.value.toString() + \" \");\n this.preOrder(r.left);\n this.preOrder(r.right);\n }\n }",
"ArrayList<Integer> preOrder(Node root)\n {\n // Code\n ArrayList<Integer> result = new ArrayList<Integer>();\n\n if (root == null) {\n return null;\n }\n Stack<Node> stack = new Stack<Node>();\n stack.push(root);\n // Node newNode = root;\n\n while (stack.empty() == false) {\n Node mynode = stack.peek();\n result.add(mynode.data);\n //System.out.print(mynode.data + \" \");\n stack.pop();\n\n if (mynode.right != null) {\n stack.push(mynode.right);\n }\n if(mynode.left != null){\n stack.push(mynode.left);\n }\n\n }\n return result;\n }",
"public void preOrder(Node root) {\n if(root!=null) {\n System.out.print(root.data + \" \");\n preOrder(root.left);\n preOrder(root.right);\n }\n }",
"private E[] getPreOrderRightSubTree(E[] inOrderTraversal,\n\t\t\tE[] preOrderTraversal) {\n\t\treturn null;\n\t}",
"public ArrayList<Integer> preOrderPrint () {\n\t\tArrayList<Integer> preOrder = new ArrayList<Integer>();\n\t\tpreOrderPrint(root, preOrder);\n\t\treturn preOrder;\n\t}",
"protected void processOrder( Game game )\n {\n }",
"public void preorder(Node node){\n\t\tif(node == nil){\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(\" ID: \" + node.id + \" Colour: \" + node.colour + \" Count: \" + node.count);\n\t\tpreorder(node.left);\n\t\tpreorder(node.right);\n\t}",
"@Override\n\tpublic void preBacktrack() {\n\t\t\n\t}",
"void preorder(Node root){\n if(root!=null){\n System.out.print(root.data+\" \");\n preorder(root.left);\n preorder(root.right);\n }\n\n }",
"protected void preorder(node root){\n if(root == null)\n return;\n\n System.out.print(root.data + \" \");\n preorder(root.left);\n preorder(root.right);\n }",
"private void sortRequiredVertices() {\n\t\tIterator<Integer> it = instance.getGraph().getVerticesIterator();\n\t\twhile (it.hasNext())\n\t\t\tsortRequiredVertices(it.next());\n\t}"
] | [
"0.7716203",
"0.75111914",
"0.69798017",
"0.69193536",
"0.6791229",
"0.6757612",
"0.6757612",
"0.67429894",
"0.66927487",
"0.66881824",
"0.66710705",
"0.6651073",
"0.65261906",
"0.64674014",
"0.6439434",
"0.6435962",
"0.6415022",
"0.6408675",
"0.6385902",
"0.6336576",
"0.6336531",
"0.63216335",
"0.6302049",
"0.62839705",
"0.6279692",
"0.6242478",
"0.6191175",
"0.61373156",
"0.6133219",
"0.6129616",
"0.61239535",
"0.6103096",
"0.60967493",
"0.6078114",
"0.6074502",
"0.6072038",
"0.60704845",
"0.60600305",
"0.6059336",
"0.60509574",
"0.604894",
"0.60458213",
"0.6013587",
"0.60086006",
"0.60053957",
"0.6005035",
"0.6002223",
"0.6001634",
"0.5988289",
"0.598583",
"0.5980934",
"0.59644186",
"0.5955177",
"0.5947739",
"0.59463364",
"0.594617",
"0.59302944",
"0.59196347",
"0.59175557",
"0.5913867",
"0.591133",
"0.5911325",
"0.5903063",
"0.58891666",
"0.5884231",
"0.58838475",
"0.5872704",
"0.58710366",
"0.5869956",
"0.58654517",
"0.5862759",
"0.5857312",
"0.58383405",
"0.58383405",
"0.58383405",
"0.58383405",
"0.5826504",
"0.5821825",
"0.5819278",
"0.58165747",
"0.58108425",
"0.58101684",
"0.57899904",
"0.5787219",
"0.5784944",
"0.5774987",
"0.57735956",
"0.57734317",
"0.5773149",
"0.57690376",
"0.57576066",
"0.5755171",
"0.57531184",
"0.5752184",
"0.57429683",
"0.574228",
"0.57359904",
"0.57291937",
"0.57283276",
"0.5723373",
"0.5722764"
] | 0.0 | -1 |
end of InOrder function | public void delete(int val) {
root=delete(root,val);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void inorder() {\n\n\t}",
"public void inOrder() {\r\n \r\n // call the private inOrder method with the root\r\n inOrder(root);\r\n }",
"public void inOrder(){\n inOrder(root);\n }",
"int order();",
"public void inOrder() {\n inOrder(root);\n }",
"private void inorder() {\r\n\t\t\tinorder(root);\r\n\t\t}",
"private void inorder() {\n inorder(root);\n }",
"private void inOrder() {\n inOrderTraversal(0);\n System.out.println(); // jump to next line\n }",
"public void insertInorderBarrier() {\n\t\t\n\t}",
"public void inOrderTraverseRecursive();",
"public void inorder()\n {\n inorderRec(root);\n }",
"public void inOrder(){\n inOrder(root);\n System.out.println();\n }",
"public void inOrder() {\r\n\t\tSystem.out.print(\"IN: \");\r\n\t\tinOrder(root);\r\n\t\tSystem.out.println();\r\n\t}",
"public void inorder()\n {\n inorder(root);\n }",
"public void inorder()\n {\n inorder(root);\n }",
"public void inorder()\r\n {\r\n inorder(root);\r\n }",
"public void inOrderTraverseIterative();",
"public void inorder(Node source) {\n inorderRec(source);\n }",
"private List<T> inOrder(Node<T> curr, List<T> list) { //Time Complexity: O(n)\n if (curr == null) {\n return list;\n }\n inOrder(curr.left, list);\n list.add(curr.data);\n inOrder(curr.right, list);\n return list;\n }",
"int[] inOrderTraversal() {\n \tinOrderTraversalRecursive(this.root);\n \tInteger[] result = (Integer[])inorder.toArray(new Integer[0]);\n \tint[] r = new int[result.length];\n \tfor(int i = 0 ; i < result.length; i++)\n \t{\n \t\tr[i] = result[i];\n \t}\n \treturn r;\n }",
"boolean isIsOrdered();",
"protected void processOrder( Game game )\n {\n }",
"boolean isOrdered();",
"boolean isOrdered();",
"public void inorderTraversal() \n { \n inorderTraversal(header.rightChild); \n }",
"public void InOrder() {\n\t\tInOrder(root);\n\t}",
"boolean isOrderCertain();",
"public int getOrder();",
"public void incrementOrder() {\n mOrder++;\n }",
"public void postOrderTraversal(){\n System.out.println(\"postOrderTraversal\");\n //TODO: incomplete\n\n }",
"private void inOrder(Node x) {\n if (x == null) {\n return;\n }\n inOrder(x.left);\n System.out.println(x.key);\n inOrder(x.right);\n }",
"private List<Integer> inOrderTraversal(Tree tree, List<Integer> arr){\n if(tree==null){\n return null;\n }\n\n if(tree.left!=null){\n inOrderTraversal(tree.left, arr);\n }\n arr.add(tree.data);\n\n if(tree.right!=null){\n inOrderTraversal(tree.right,arr);\n }\n return arr;\n\n}",
"public myList<T> my_inorder();",
"@Override\n\tpublic void placeOrder() {\n\t\t\n\t}",
"private void inorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n inorder(root.left);\n list.add(root.element);\n inorder(root.right);\n }",
"public void printInorder() {\r\n System.out.print(\"inorder:\");\r\n printInorder(overallRoot);\r\n System.out.println();\r\n }",
"private void inOrder(BSTNode node) {\r\n \r\n // if the node is NOT null, execute the if statement\r\n if (node != null) {\r\n \r\n // go to the left node\r\n inOrder(node.getLeft());\r\n \r\n // visit the node (increment the less than or equal counter)\r\n node.incrementLessThan();\r\n \r\n // go to the right node\r\n inOrder(node.getRight());\r\n }\r\n }",
"@Override\n public Iterator<E> getInorderIterator() {\n return new InorderIterator();\n }",
"public void traversePreOrder() {\n\t\tpreOrder(this);\n\t}",
"public void printInorder() {\n System.out.print(\"inorder:\");\n printInorder(overallRoot);\n System.out.println();\n }",
"public void Inorder(Node p, List<Node> order_pointer){\n if(p == null){\n return;\n }\n Inorder(p.left, order_pointer);\n order_pointer.add(p);\n Inorder(p.right, order_pointer);\n }",
"private List<T> inOrderHelper(Node<T> current, List<T> result) {\n\t\tif (current != null) {\n\t\t\tresult = inOrderHelper(current.getLeft(), result);\n\t\t\tresult.add(current.getData());\n\t\t\tresult = inOrderHelper(current.getRight(), result);\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"@Override\n public int getOrder() {\n return 0;\n }",
"private void inorder(TreeNode<E> root) {\r\n\t\t\tif (root == null)\r\n\t\t\t\treturn;\r\n\t\t\tinorder(root.left);\r\n\t\t\tlist.add(root.element);\r\n\t\t\tinorder(root.right);\r\n\t\t}",
"List<Integer> traverseInOrder(List<Integer> oList) \n\t{\n\t\tif(this.left != null)\n\t\t{\n\t\t\tthis.left.traverseInOrder(oList);\n\t\t}\n\t\n\t\toList.add(this.key);\n\t\n\t\tif(this.right != null)\n\t\t{\n\t\t\tthis.right.traverseInOrder(oList);\n\t\t}\n\t\t\n\t\treturn oList;\n\t}",
"@Override\n\tpublic void preorder() {\n\n\t}",
"private void inOrder(Node root) {\r\n\t\t// inOrderCount++;\r\n\t\t// System.out.println(\" Count: \" + inOrderCount);\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// System.out.println(\" Count: \" + inOrderCount);\r\n\t\tinOrder(root.getlChild());\r\n\t\tif (inOrderCount < 20) {\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\tinOrderCount++;\r\n\t\t\t//System.out.println(\" Count: \" + inOrderCount);\r\n\t\t}\r\n\t\tinOrder(root.getrChild());\r\n\r\n\t}",
"public void inorderTraversal() {\n inorderThroughRoot(root);\n System.out.println();\n }",
"public void inOrderTraversal(Node node)\n\t{\n\t\tif(node!=null){\n\t\t\t\n\t\t\tinOrderTraversal(node.leftChild);\n\t\t\tarr.add(node.data);\n\t\t\tinOrderTraversal(node.rightChild);\n\t\t}\n\t}",
"int getPriorityOrder();",
"public List<T> inOrder() { //Time Complexity: O(1)\n List<T> list = new ArrayList<>();\n return inOrder(root, list);\n }",
"default int getOrder() {\n\treturn 0;\n }",
"@Override\n\tpublic int getOrder() {\n\t\treturn 1;\n\t}",
"public void inOrderTraversal() {\n beginAnimation();\n treeInOrderTraversal(root);\n stopAnimation();\n\n }",
"public void inorder()\r\n\t{\r\n\t\tif(root==null)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"tree is empty\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// find the leftmost node of the tree\r\n\t\tNode p =root;\r\n\t\twhile(p.leftThread==false)\r\n\t\t\tp=p.left;\r\n\t\twhile(p!=null)//loop until we reach the right most node whose right link(rightThread) is null\r\n\t\t{\r\n\t\t\tSystem.out.print(p.info + \" \");\r\n\t\t\tif(p.rightThread==true) // if 'right' is pointing to the inorder successor\r\n\t\t\t\tp = p.right;\r\n\t\t\telse // find the inorder successor i.e the left most node in the right sub tree\r\n\t\t\t{\r\n\t\t\t\tp = p.right;\r\n\t\t\t\twhile(p.leftThread==false)\r\n\t\t\t\t\tp = p.left;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}",
"private static boolean inOrderTraversal(Node current) {\n //Break if the node is null\n if(current == null) {\n return false;\n }\n //Recursively check the left child, then the current node, then finally the right child\n else {\n inOrderTraversal(current.getLeftChild());\n inorder.add(current);\n inOrderTraversal(current.getRightChild());\n }\n return true;\n }",
"public void listOrder()\r\n {o.listOrder();}",
"public void inorderTraverse(){\n\t\tinorderHelper(root);\n\t\tSystem.out.println();\n\t}",
"@Override\r\n\tpublic int getOrder() {\n\t\treturn 0;\r\n\t}",
"public void inOrderTraversal(){\n System.out.println(\"inOrderTraversal\");\n\n Stack<Node> stack = new ArrayStack<Node>();\n\n for(Node node = root; node!= null; node=node.getLeft()){\n stack.push(node);\n }\n while(!stack.isEmpty()){\n Node node = stack.pop();\n System.out.print(node.getData() + \" \");\n\n for(node=node.getRight(); node!= null; node = node.getLeft()){\n stack.push(node);\n }\n }\n\n System.out.println();\n }",
"@Override\r\n\tpublic List<Node<T>> getInOrderTraversal() {\r\n\t\tList<Node<T>> lista = new LinkedList<Node<T>>();// Lista para el\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// recursivo\r\n\t\tlista = auxiliarRecorridoIn(raiz, lista, raiz);\r\n\t\treturn lista;\r\n\t}",
"@Override\n\tpublic int getOrder() {\n\t\treturn Ordered.HIGHEST_PRECEDENCE + 10000;\n\t}",
"public static void main(String[] args) {\n\n\t\tint[] postOrder={110,121,135,71,101,116,40,22,32,100,82,142,6,143,25,49,123,87,77,31,120,12,48,41,66,17,109,63,28,35,140,113,70,79,122,92,53,96,90,75,8,114,21,36,91,9,115,43,128,37,93,107,86,1,104,138,16,65,14,2,102,111,98,83,10,119,52,68,19,85,84,80,118,13,130,94,18,50,112,11,44,124,51,134,55,99,62,56,33,57,30,137,81,39,105,108,89,42,5,126,64,23,60,141,136,127,103,3,78,139,4,74,26,129,88,20,7,59,69,133,73,97,61,131,45,38,125,54,76,46,95,106,47,67,24,72,15,34,27,29,58,117,132,0};\n\t\tint[] inOrder={117,58,67,95,46,54,125,73,69,59,7,88,26,139,78,103,136,60,23,126,42,89,105,81,137,30,33,56,99,51,44,112,50,18,13,118,80,84,85,68,52,10,83,98,111,102,2,16,86,36,21,114,8,75,90,53,92,122,70,66,41,120,31,77,87,123,25,143,6,82,100,22,116,101,135,110,121,71,40,32,142,49,12,48,17,109,63,28,35,140,113,79,96,91,9,115,43,128,37,93,107,1,104,138,65,14,119,19,130,94,11,124,134,55,62,57,39,108,5,64,141,127,3,4,74,129,20,133,97,61,131,45,38,76,106,47,24,72,15,34,27,29,132,0};\n\t\tTreeNode root=null;\n\t\tSystem.out.println(\"Size \"+postOrder.length);\n\t\t\n\t\ttry {\n\t\t\troot = new CreateTreeGivenPostAndInOrder().createBinaryTree(postOrder, 0, postOrder.length-1, inOrder, 0, inOrder.length-1);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Invalid Input\");\n\t\t}\n\t\t\n\t\troot.inOrderTraversal(root);\n\t\tnew DeepestNodeInBinaryTree().findDeepestNode(root, 0);\n\t\tSystem.out.println(\"\\nNode Data \"+deepestNode.node.data+\" Depth \"+deepestNode.depth);\n\t\t\n\t}",
"private void inorder(Node x, MyQueue<Key> q) {\n if (x == null) return;\n inorder(x.left, q);\n q.add(x.key);\n inorder(x.right, q);\n }",
"public Integer getOrder();",
"void inOrderTraversal(Node node){\r\n\t\tif( node == null ) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tinOrderTraversal( node.left );\r\n\t\tSystem.out.print( node.value + \" \");\r\n\t\tinOrderTraversal( node.right );\r\n\t}",
"private void inOrderTraversal(StringBuilder sb) {\n if (left != null) {\n left.inOrderTraversal(sb);\n }\n\n sb.append(data + \" \");\n\n\n if (right != null) {\n right.inOrderTraversal(sb);\n }\n }",
"private void inOrder(HomogeneusNode root) {\n if (root != null) {\n inOrder(root.getLeft());\n System.out.printf(\"%d\", root.getData());\n inOrder(root.getRight());\n }\n }",
"@Override\n\tpublic void accept_order() {\n\t\t\n\t}",
"int[] getGivenByOrder();",
"private void inOrderTraversal(int index) {\n // go through the graph as long as has values\n if (array[index] == null) {\n return;\n }\n //call recursively the method on left child\n inOrderTraversal(2 * index + 1);\n // print the node\n System.out.print(array[index] + \", \");\n //call recursively the method on right child\n inOrderTraversal(2 * index + 2);\n }",
"public void insertReorderBarrier() {\n\t\t\n\t}",
"void inOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tinOrderTraversal(node.getLeftNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t\tinOrderTraversal(node.getRightNode());\n\t}",
"void printpopulateInorderSucc(Node t){\n\t\n\n}",
"public void inOrder(Node myNode){\n \n if (myNode != null){ //If my node is not null, excute the following\n \n inOrder(myNode.left); //Recurse with left nodes\n System.out.println(myNode.name); //Print node name \n inOrder(myNode.right); //Recurse with right nodes\n \n }\n }",
"public void traverseInOrder() {\n\t System.out.println(\"============= BTREE NODES ===============\");\n\t\tinOrder(root);\n System.out.println(\"=========================================\");\n\t}",
"@objid (\"fcf73d01-d406-41e9-9490-067237966153\")\n boolean isIsOrdered();",
"Order getOrder();",
"public void inOrder(MyBinNode<Type> r){\n if(r != null){\n this.inOrder(r.left);\n System.out.print(r.value.toString() + \" \");\n this.inOrder(r.right);\n }\n }",
"boolean isOrderable();",
"public int[] inOrder(Integer currentLine){\r\n\t \t\t\r\n\t\t//Case for exit recursive function. CurrentLine is a leaf of the tree\r\n\t\tif (currentLine == -1){\r\n\t \t return orderedArray; \r\n\t }\r\n\t\t//Search left subtree\r\n\t\tinOrder(getLeft(currentLine));\r\n\t //Add to array the info of current Node\r\n\t orderedArray[oArrayAvail]=getKey(currentLine);\r\n\t oArrayAvail++;\r\n\t //Search right subtree\r\n\t inOrder(getRight(currentLine));\r\n\t return orderedArray;\r\n\t\t\r\n\t}",
"@Override\r\n\tprotected void processInMerChantOrderEvent(InMerChantOrderEvent arg0) {\n\t\t\r\n\t}",
"@Override\n\tpublic boolean PlaceOrder(Order order) {\n\t\treturn false;\n\t}",
"public void visitInorder(Visitor<T> visitor) { if (root != null) root.visitInorder(visitor); }",
"private void Inorder(Node p, Set<K> keyset){\n if(p == null){\n return;\n }\n Inorder(p.left, keyset);\n keyset.add(p.key);\n Inorder(p.right, keyset);\n }",
"private void inOrder(Node<T> node){\n if(node != null){\n inOrder(node.left);\n System.out.print(node.data + \" ,\");\n inOrder(node.right);\n }\n }",
"public myList<T> my_preorder();",
"private void traverseInOrder(BinaryNode<AnyType> curr) {\n\t\tif (curr.left != null) {\n\t\t\ttraverseInOrder(curr.left);\n\t\t}\n\t\tSystem.out.println(curr.element);\n\n\t\t// checking for duplicates\n\n\t\tfor (int i = 0; i < curr.duplicate.size(); i++) {\n\t\t\tSystem.out.println(curr.duplicate.get(i).element);\n\t\t}\n\n\t\tif (curr.right != null) {\n\t\t\ttraverseInOrder(curr.right);\n\t\t}\n\t}",
"@Override\n\tpublic void postorder() {\n\n\t}",
"public void testGetOrder() {\n }",
"void inorderTraversal(Node node) {\n\t\tif (node != null) {\n\t\t\tinorderTraversal(node.left);\n\t\t\tSystem.out.print(node.data + \" \");\n\t\t\tinorderTraversal(node.right);\n\t\t}\n\t}",
"private void inorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tinorderHelper(root.left);\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t\tinorderHelper(root.right);\n\t\t}\n\t}",
"private <E> void inOrder(Node root, Action<Integer,E> action) {\n\t\tif(root==null)\n\t\t\treturn;\n\t\t\n\t\tinOrder(root.left,action);\n\t\t//System.out.println(root.value);\n\t\taction.execute(root.value);\n\t\t\n\t\tinOrder(root.right,action);\n\t\t\n\t}",
"public void inOrderTraversalRecursive(ArrayList<Integer> o, RBNode x){\r\n\t\tif(x.left != nil) inOrderTraversalRecursive(o,x.left);\r\n\t\to.add(x.key);\r\n\t\tif(x.right != nil) inOrderTraversalRecursive(o,x.right);\r\n\t}",
"void inOrder(TreeNode node) \n { \n if (node == null) \n return; \n \n inOrder(node.left); \n System.out.print(node.val + \" \"); \n \n inOrder(node.right); \n }",
"public static void main(String[] args) {\n\n\n TreeNode root = new TreeNode(1);\n TreeNode left1 = new TreeNode(2);\n TreeNode left2 = new TreeNode(3);\n TreeNode left3 = new TreeNode(4);\n TreeNode left4 = new TreeNode(5);\n TreeNode right1 = new TreeNode(6);\n TreeNode right2 = new TreeNode(7);\n TreeNode right3 = new TreeNode(8);\n TreeNode right4 = new TreeNode(9);\n TreeNode right5 = new TreeNode(10);\n root.left = left1;\n root.right = right1;\n left1.left = left2;\n left1.right = left3;\n left3.right = left4;\n right1.left = right2;\n right1.right = right3;\n right2.right = right4;\n right3.left = right5;\n //[3, 2, 4, 5, 1, 7, 9, 6, 10, 8]\n List<Integer> list = inorderTraversalN(root);\n System.err.println(list);\n }",
"List<Integer> traversePreOrder(List<Integer> oList) \n\t{\t\t\n\t\toList.add(this.key);\n\t\t\n\t\tif(this.left != null)\n\t\t{\n\t\t\tthis.left.traversePreOrder(oList);\n\t\t}\n\t\t\n\t\tif(this.right != null)\n\t\t{\n\t\t\tthis.right.traversePreOrder(oList);\n\t\t}\n\t\t\n\t\treturn oList;\t\t\n\t}",
"void findSearchOrder() {\n boolean filled = false;\n for(int node: queryGraphNodes.keySet()) {\n\n vertexClass vc = queryGraphNodes.get(node);\n searchOrderSeq.add(node);\n for(int edge: queryGraphNodes.get(node).edges.keySet()) {\n filled = calcOrdering(edge);\n if (filled)\n break;\n }\n if(searchOrderSeq.size() == queryGraphNodes.size())\n break;\n\n }\n\n }",
"static void inorder(TreeNode root, List<Integer> output) {\n if (root == null) {\n return;\n }\n inorder(root.left, output);\n output.add(root.val);\n inorder(root.right, output);\n }",
"@Test\r\n\tpublic void testOrderPerform() {\n\t}",
"private void goZhuSuOrder(int position){\n\t}"
] | [
"0.7537968",
"0.7155268",
"0.69415075",
"0.6826323",
"0.68081516",
"0.6711279",
"0.66901606",
"0.66634685",
"0.65341574",
"0.6488685",
"0.64538485",
"0.6443115",
"0.64265394",
"0.64101994",
"0.64101994",
"0.63909477",
"0.6378961",
"0.63758504",
"0.6339521",
"0.62996596",
"0.6293242",
"0.6276963",
"0.62690675",
"0.62690675",
"0.62585384",
"0.6235245",
"0.6217118",
"0.6166657",
"0.61582714",
"0.6153568",
"0.6151497",
"0.6129256",
"0.61168885",
"0.6111618",
"0.60678154",
"0.6058216",
"0.6046097",
"0.603783",
"0.602953",
"0.6026078",
"0.60204744",
"0.60129434",
"0.600883",
"0.6008629",
"0.60049564",
"0.59962314",
"0.5984215",
"0.5959035",
"0.59551394",
"0.59425867",
"0.5940646",
"0.5937392",
"0.5934669",
"0.59331286",
"0.59281415",
"0.592805",
"0.59272116",
"0.59262866",
"0.59177446",
"0.5916888",
"0.58885044",
"0.5883067",
"0.58673686",
"0.5853682",
"0.58498055",
"0.5848487",
"0.58396053",
"0.58135104",
"0.5810189",
"0.5808759",
"0.5806491",
"0.58044666",
"0.5800662",
"0.5771243",
"0.57710123",
"0.576742",
"0.5745479",
"0.57431436",
"0.5728023",
"0.5726858",
"0.5722045",
"0.57151663",
"0.5709985",
"0.5709109",
"0.5708078",
"0.57037354",
"0.57017225",
"0.5701605",
"0.56974006",
"0.5686083",
"0.5677674",
"0.5675565",
"0.567118",
"0.5665489",
"0.56616163",
"0.5655077",
"0.5653592",
"0.56447506",
"0.5637871",
"0.5635801",
"0.5635264"
] | 0.0 | -1 |
end of delete function | public static Node maxleft(Node ROOT) {
Node temp=ROOT.left;
while(temp.right!=null) {
temp=temp.right;
}//end of while
return temp;//reference of maxleft
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void delete() {\n\n\t}",
"@Override\n\t\tpublic void delete() {\n\n\t\t}",
"@Override\n\tpublic void delete() {\n\t\t\n\t}",
"@Override\n\tpublic void delete() {\n\t\t\n\t}",
"@Override\n\tpublic void delete() {\n\n\t}",
"@Override\r\n\tpublic void delete() {\n\r\n\t}",
"@Override\n public void delete()\n {\n }",
"public void delete() {\n\n\t}",
"private Delete() {}",
"private Delete() {}",
"@Override\n public void delete() {\n }",
"@Override\n\tpublic void delete() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}",
"@Override\n public void delete() {\n\n\n }",
"public void delete(){\r\n\r\n }",
"@Override\n\tpublic void delete() {\n\t\tSystem.out.println(\"no goin\");\n\t\t\n\t}",
"void delete(){\r\n\t\t\r\n\t}",
"public void delete();",
"public void delete();",
"public void delete();",
"public void delete();",
"public void delete();",
"public void delete();",
"@Override\n\tpublic int delete() {\n\t\treturn 0;\n\t}",
"@Override\r\n\tpublic void delete(int eno) {\n\r\n\t}",
"public void delete() {\n\n }",
"@Override\n\tpublic void delRec() {\n\t\t\n\t}",
"@Override\n\tpublic void delete(Facture y) {\n\t\t\n\t}",
"@Override\r\n\tpublic void delete(int r_idx) throws Exception {\n\r\n\t}",
"public abstract void delete();",
"public abstract void delete();",
"@Override\n\tpublic void delete(Integer arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(String arg0) {\n\t\t\n\t}",
"void delData();",
"@Override\n\t\tpublic void delete() {\n\t\t\tSystem.out.println(\"새로운 삭제\");\n\t\t}",
"public int delete( Conge conge ) ;",
"@Override\n\tpublic void delete(Long arg0) {\n\t\t\n\t}",
"protected abstract void doDelete();",
"public void delete() {\n\t\tdeleted = true;\n\t}",
"@Override\n\tpublic int delete(int t) {\n\t\treturn 0;\n\t}",
"boolean delete();",
"@Override\r\n\tpublic void delete(Integer arg0) {\n\t\t\r\n\t}",
"@Override\n\tpublic void posDelete() {\n\t\t\n\t}",
"@Override\n\tpublic void posDelete() {\n\t\t\n\t}",
"@Override\n\tpublic void posDelete() {\n\t\t\n\t}",
"@Override\n\tpublic void delete(int id) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(int id) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(int id) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(int id) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(long id) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(long id) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(Long arg0) {\n\n\t}",
"@Override\n\tpublic void delete(Long arg0) {\n\n\t}",
"@Override\n\tpublic Integer delete() {\n\t\treturn null;\n\t}",
"@Override\r\n\tpublic void delete(Long arg0) {\n\t\t\r\n\t}",
"public DataPair delete(DataPair key) {\n throw new NotImplementedException();\n }",
"@Override\r\n\tpublic int delete() throws Exception {\n\t\treturn 0;\r\n\t}",
"@Override\n public void delete(int id) {\n }",
"@Override\n\tpublic int delete(Object ob) {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic int delete(Object ob) {\n\t\treturn 0;\n\t}",
"public void deleteObject() {\n\n\t}",
"@Override\n public boolean delete()\n {\n return false;\n }",
"@Override\n\tpublic void delete(CorsoDiLaurea corso) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(int id) {\n\t}",
"public abstract void delete() throws ArchEException;",
"@Override\r\n\tpublic void k_delete(String MF_NO) {\n\t\t\r\n\t}",
"@Override\n\tpublic boolean delete(Etape obj) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic void delete(Object o) {\n\t}",
"@Override\r\n\tpublic void delete(int id) {\n\t\t\r\n\t}",
"@Override\n\tpublic void delete(Pessoa arg0) {\n\t\t\n\t}",
"public boolean delete();",
"private void deleteResource() {\n }",
"public int delete(int k)\r\n\t {\r\n\t\t return 42; // to be replaced by student code\r\n\t }",
"@Override\r\n\tpublic boolean delete(Moteur obj) {\n\t\treturn false;\r\n\t}",
"@Override\n\tpublic void delete(ComplitedOrderInfo arg0) {\n\t\t\n\t}",
"@Override\r\n\tpublic void delete(Estates arg0) {\n\t\t\r\n\t}",
"@Override\n public boolean delete(Revue objet) {\n return false;\n }",
"@Override\n\tpublic void delete(Object entidade) {\n\t\t\n\t}",
"void delete();",
"void delete();",
"void delete();",
"void delete();",
"@Override\n public int delete(String arg0) {\n return 0;\n }",
"@Override\r\n\tpublic void delete(TQssql sql) {\n\r\n\t}",
"@Override\n public int delete( J34SiscomexOrigemDi j34SiscomexOrigemDi ) {\n return super.doDelete(j34SiscomexOrigemDi);\n }",
"void deleteSub();",
"@Override\r\n\tpublic void delete(Object object) {\n\t\t\r\n\t}",
"@Override\n\tpublic void delete(BatimentoCardiaco t) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(Serializable id) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(Note e) {\n\t\t\n\t}",
"void delete(int id);",
"void delete(int id);",
"@DELETE\n public void delete() {\n }",
"@DELETE\n public void delete() {\n }",
"protected boolean afterDelete() throws DBSIOException{return true;}",
"void delete (int index);",
"@Override\n\tpublic boolean delete() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean delete() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean delete() {\n\t\treturn false;\n\t}",
"public void delete(Conseiller c) {\n\t\t\r\n\t}",
"public void DeleteEnd(){\n\t\tsuper.cut();\n\t}",
"@Override\n\tpublic void delete(String code) {\n\n\t}"
] | [
"0.85273695",
"0.80794305",
"0.8022285",
"0.8022285",
"0.7926825",
"0.7889706",
"0.78429806",
"0.78379637",
"0.7736196",
"0.7736196",
"0.7729852",
"0.76908404",
"0.7658859",
"0.7623479",
"0.7551571",
"0.75080794",
"0.74789476",
"0.74789476",
"0.74789476",
"0.74789476",
"0.74789476",
"0.74789476",
"0.7478936",
"0.7417788",
"0.74037623",
"0.73489016",
"0.7347417",
"0.73461044",
"0.7332493",
"0.7332493",
"0.72501874",
"0.7219657",
"0.7207424",
"0.72071815",
"0.7188876",
"0.7177673",
"0.71713215",
"0.71687394",
"0.7165644",
"0.71628815",
"0.7156356",
"0.71406645",
"0.71406645",
"0.71406645",
"0.7088423",
"0.7088423",
"0.7088423",
"0.7088423",
"0.7080772",
"0.7080772",
"0.7075287",
"0.7075287",
"0.70750076",
"0.7068292",
"0.70594245",
"0.7054293",
"0.7040471",
"0.703757",
"0.703757",
"0.70209324",
"0.7009409",
"0.700519",
"0.6999996",
"0.6974939",
"0.6973418",
"0.6960014",
"0.69575834",
"0.69558823",
"0.69497985",
"0.69471514",
"0.69443375",
"0.6932839",
"0.692935",
"0.692528",
"0.6900176",
"0.68990463",
"0.68935496",
"0.68859786",
"0.68859786",
"0.68859786",
"0.68859786",
"0.68731743",
"0.68620974",
"0.685678",
"0.6850122",
"0.6838865",
"0.6835043",
"0.6825001",
"0.68065673",
"0.6787685",
"0.6787685",
"0.6787493",
"0.6787493",
"0.6786354",
"0.67847705",
"0.6780956",
"0.6780956",
"0.6780956",
"0.67695105",
"0.67654264",
"0.67633325"
] | 0.0 | -1 |
Spiel mit Anzahl der Runden wird erstellt. | @Before
public void erstelleSUT() {
Spiel spiel = new Spiel();
// Für jeden Spieler eine Unternehmenskette, damit eine
// Konkurrenzsituation entsteht
ukette = new Unternehmenskette("KetteNummer1");
ukette1 = new Unternehmenskette("KetteNummer2");
// Es werden für Unternehmenskette ein Report erstellt. Pro Runde
// brauchen wir eigentlich ein Report für jede Kette.
Report report = new Report(1, ukette);
Report report1 = new Report(1, ukette1);
ukette.hinzufuegenReport(report);
ukette1.hinzufuegenReport(report1);
// Dem Spiel werden die Unternehmensketten zugeordnet
spiel.hinzufuegenUnternehmenskette(ukette);
spiel.hinzufuegenUnternehmenskette(ukette1);
// Ein Standort, an dem die Ketten konkurrieren sollen, wird angelegt
// für den Kunden:
// Praeferenz für ALLE ist Qualität
Zufall.setzeTestmodus(true);
Zufall.setzeTestZufallszahl(2);
Zufall.setzeTestQualitaet(0.4);
standort = new Standort(Standorttyp.Standort1);
fil1 = new Filiale(standort, ukette);
fil1.setzeMitarbeiter(1);
fil1.initialisierenKapazitaet();
fil2 = new Filiale(standort, ukette1);
fil2.setzeMitarbeiter(1);
fil2.initialisierenKapazitaet();
Zufall.setzeTestmodus(false);
standort.beeinflussenKunden(ukette, 1);
standort.beeinflussenKunden(ukette1, 1);
Zufall.setzeTestmodus(true);
Zufall.setzeTestZufallszahl(2);
Zufall.setzeTestQualitaet(0.4);
Produkt p1 = new Produkt(Produkttyp.TEE, 20);
Produkt p2 = new Produkt(Produkttyp.KUCHEN, 10);
p1.setzePreis(1);
p1.setzeQualitaet(0.56);
p2.setzePreis(1.2);
p2.setzeQualitaet(0.6);
ukette.holeLager().einlagern(p1);
ukette.holeLager().einlagern(p2);
p1.setzePreis(0.8);
p1.setzeQualitaet(0.5);
ukette1.holeLager().einlagern(p1);
// Kette1 bietet Kaffee (P:1; Q:0.56) und Kuchen (P:1.2; Q:0.6) an
// Kette2 bietet Kaffe (P:0.8, Q:0.5) an.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int anzahlRundenziel() {\n // TODO: eine Seite aufsetzen mit Informationen zur Datenbank\n // TODO: Anzahl der Einträge pro Tabelle\n int nReturn = 0;\n final Cursor c = mDb.getReadableDatabase().rawQuery(\n \"select count(*) from \" + RundenZielTbl.TABLE_NAME,\n null);\n if (!c.moveToFirst()) {\n Log.d(TAG, \"anzahlRundenziel(): Kein Rundenziel gespeichert\");\n nReturn = 0;\n } else {\n nReturn = c.getInt(0);\n }\n c.close();\n return nReturn;\n }",
"public int getTotRuptures();",
"public Feld erzeugeFeld() {\n\t\tArrayList<Schiff> schiffe = new ArrayList<Schiff>();\n\t\t\n\t\t// 1 Schlachtschiff = 5\n\t\tschiffe.add(new Schiff(5));\n\t\t// 2 Kreuzer = 4\n\t\tschiffe.add(new Schiff(4));\n\t\tschiffe.add(new Schiff(4));\n\t\t// 3 Zerstoerer = 3\n\t\tschiffe.add(new Schiff(3));\n\t\tschiffe.add(new Schiff(3));\n\t\tschiffe.add(new Schiff(3));\n\t\t// 4 Uboote = 2\n\t\tschiffe.add(new Schiff(2));\n\t\tschiffe.add(new Schiff(2));\n\t\tschiffe.add(new Schiff(2));\n\t\tschiffe.add(new Schiff(2));\n\t\t\n\t\tFeld neuesFeld = new Feld(getSpiel().getFeldGroesse());\n\t\t\n\t\tfor(int s = 0; s<schiffe.size(); s++) {\n\t\t\tSchiff schiff = schiffe.get(s);\n\t\t\t// Jeweils maximal 2*n^2 Versuche das Schiff zu positionieren\n\t\t\tfor(int i = 0; i < getSpiel().getFeldGroesse() * getSpiel().getFeldGroesse() * 2; i++) {\n\t\t\t\t// Zufallsorientierung\n\t\t\t\tOrientierung orientierung = Orientierung.HORIZONTAL;\n\t\t\t\tif(Math.random() * 2 > 1) {\n\t\t\t\t\torientierung = Orientierung.VERTIKAL;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Zufallskoordinate\n\t\t\t\tKoordinate koordinate = new Koordinate(\n\t\t\t\t\t(int) (Helfer.zufallszahl(0, getSpiel().getFeldGroesse() - 1)), \n\t\t\t\t\t(int) (Helfer.zufallszahl(0, getSpiel().getFeldGroesse() - 1)));\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tneuesFeld.setzeSchiff(schiff, koordinate, orientierung);\n\t\t\t\t\tbreak;\n\t\t\t\t} catch(Exception e) { }\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(neuesFeld.getSchiffe().size() != 10) throw new RuntimeException(\"Schiffe konnten nicht gesetzt werden!\");\n\t\t\t\n\t\treturn neuesFeld;\n\t}",
"public int calculerKgsNourritureParJour(){\r\n\t\treturn noms.size() * 10;\r\n\t}",
"public SpielfeldZeile()\n\t{\n\t _spalte0 = 0;\n\t _spalte1 = 0;\n\t _spalte2 = 0;\n\t}",
"public int rent() {\n\t\treturn 0;\n\t}",
"public int AmbosHijosR() { //Hecho por mi\n return AmbosHijosR(raiz);\n }",
"public void starteSpiel(int pAnzahl){\n\n this.anzahl = pAnzahl;\n\n spielerRing = new Ring<>();\n for (int i = 0; i < pAnzahl; i++) {\n spielerRing.insert(new Spieler(i));\n }\n\n Spieler startSpieler = null;\n while (startSpieler==null) {\n\n //verteile Steine\n int count = 0;\n while (count < pAnzahl) {\n Spieler spieler = this.spielerRing.getContent();\n spieler.loescheAlleSteine();\n for (int i = 0; i < 6; i++) {\n spieler.addStein(beutel.gibStein());\n }\n this.spielerRing.next();\n count++;\n }\n\n //bestimme Startspieler\n int startWert = 0;\n count=0;\n while (count < pAnzahl) {\n Spieler spieler = this.spielerRing.getContent();\n int wert = spieler.gibStartWert();\n if (wert>startWert){\n startWert = wert;\n if (wert>2)\n startSpieler = spieler;\n }\n this.spielerRing.next();\n count++;\n }\n\n if (startSpieler!=null)\n startSpieler.setzeAktiv(true);\n }\n }",
"public double berechnePreis(){\r\n\t\tdouble gesamtpreis = 0;\r\n\t\tfor (Titel tmp : this){\r\n\t\t\tgesamtpreis = gesamtpreis + tmp.getPreis();\r\n\t\t}\r\n\t\treturn gesamtpreis;\r\n\t}",
"protected ElementDoppeltVerkettet gehe(int anzahlSchritte) {\n\t\tElementDoppeltVerkettet aktuell = this;\n\t\tint aS = anzahlSchritte;\n\t\tif (aS < 0) {\n\t\t\twhile (aS < 0 && aktuell.zurück != null) {\n\t\t\t\taktuell = aktuell.zurück;\n\t\t\t\taS++;\n\t\t\t}\n\t\t} else {\n\t\t\twhile (aS > 0 && aktuell.vor != null) { aktuell = (ElementDoppeltVerkettet) aktuell.vor; aS--; }\n\t\t}\n\t\tif (aS == 0) {\n\t\t\treturn aktuell;\n\t\t} else {\n\t\t\tthrow new IndexOutOfBoundsException(\"Die Grenzen der Liste sollten überschritten werden\");\n\t\t}\n\t}",
"public int puntosRestantes() {\n // TODO implement here\n return 0;\n }",
"int nbLignes();",
"int getMindestvertragslaufzeit();",
"private double werteRekursivAus(int n) {\n double zwischenwert = 0;\n\n // Basisfall\n if (n <= 0) {\n return 0;\n }\n\n // Fall I\n if (n > 0) {\n zwischenwert = 1 / (werteRekursivAus(n - 1)) + werte[werte.length - n];\n }\n\n // Fall II\n if (n == 1) {\n zwischenwert = 1 / zwischenwert + werte[werte.length - 1];\n }\n return zwischenwert;\n }",
"public abstract int getCntRod();",
"@Override\n\tpublic int sount() {\n\t\treturn 0;\n\t}",
"public void spillTrekk(List<Terning> terninger) {\n Integer sum = 0;\n for (Terning terning : terninger) {\n terning.trill();\n sum += terning.getVerdi();\n }\n Rute plass = brikke.getPlass();\n plass = brett.finnRute(plass, sum);\n brikke.setPlass(plass);\n }",
"public void loescheEintrag() {\n\t\tzahl = 0;\n\t\tistEbenenStart = false;\n\t}",
"public Long numeroRegistrosFactura();",
"public int getCyclomaticNumber() {\n\t\treturn (this.getKrawedzie().size() - this.getWierzcholki().size() + this.iloscSpojnychSkladowych());\n\t}",
"int getReaultCount();",
"public int RollCount() {\n\t\treturn 0;\r\n\t}",
"@Override\n\tpublic double calculaTributos() {\n\t\treturn numeroDePacientes * 10;\n\t}",
"public int rekisteroi() {\n this.tunnusNro = seuraavaNro;\n Tuote.seuraavaNro++;\n return tunnusNro;\n }",
"public double getRoll() { return _rss==null? 0 : _rss.roll; }",
"public int bewerten(String spieler){\n\t\treihenPruefen pruefen = new reihenPruefen();\n\t\tString gegner;\n\t\t\n\t\tif(spieler.equals(\"o\")){\n\t\t\tgegner = \"x\";\n\t\t}else{\n\t\t\tgegner = \"o\";\n\t\t}\n\t\t\n\t\tif (pruefen.viererReihe(spielfeld, spieler)){\n\t\t\treturn 4;\n\t\t}\n\t\t\n\t\tif (pruefen.viererReihe(spielfeld, gegner)){\n\t\t\treturn -4;\n\t\t}\n\t\t\n\t\tif (pruefen.dreierReihe(spielfeld, spieler)){\n\t\t\treturn 3;\n\t\t}\n\t\t\n\t\tif (pruefen.dreierReihe(spielfeld, gegner)){\n\t\t\treturn -3;\n\t\t}\n\t\t\n\t\tif (pruefen.zweierReihe(spielfeld, spieler)){\n\t\t\treturn 2;\n\t\t}\n\t\t\t\n\t\tif (pruefen.zweierReihe(spielfeld, gegner)){\n\t\t\treturn -2;\n\t\t}\n\t\t\n\t\treturn 0;\n\t}",
"public int numberOfRounds() {\r\n\t\treturn offsets.size() - 1;\r\n\t}",
"public int totalNum(){\n return wp.size();\n }",
"public String gibZustand(){\n String out = anzahl+QwirkleServer.SEP;\n String aktiv = \"\";\n int[] punkte = new int[anzahl];\n String[] spielerSteine = new String[anzahl];\n String spielfeldString = \"\";\n\n //sammle Daten\n int count = 0;\n while (count<anzahl){\n Spieler spieler = this.spielerRing.getContent();\n if (spieler.istAktiv()) aktiv = spieler.gibIndex()+\"\";\n punkte[spieler.gibIndex()] = spieler.gibPunkteStand();\n spielerSteine[spieler.gibIndex()]=spieler.gibSteineString();\n this.spielerRing.next();\n count++;\n }\n\n if (spielEnde) aktiv = \"-1\";\n\n out += beutel.gibAnzahl()+QwirkleServer.SEP;\n out += aktiv;\n for (int i = 0; i < anzahl; i++)\n out+=QwirkleServer.SEP+punkte[i];\n\n for (int i = 0; i < anzahl; i++)\n out+=QwirkleServer.SEP+spielerSteine[i];\n\n\n spielfeld.toFirst();\n while(spielfeld.hasAccess()) {\n Stein stein = spielfeld.getContent();\n out += QwirkleServer.SEP + stein.toString();\n spielfeld.next();\n }\n\n return out;\n }",
"@Override\n public void print() {\n for (int i = 1; i <= itertion; i++) {\n if(n <0){\n this.result = String.format(\"%-3d %-3s (%-3d) %-3s %d \", i, \"*\", n, \"=\", (n * i));\n System.out.println(this.result);\n }else {\n this.result = String.format(\"%-3d %-3s %-3d %-3s %d \", i, \"*\", n, \"=\", (n * i));\n System.out.println(this.result);\n }\n }\n }",
"public int getCurrRuptures();",
"private void wechsleRaum(Befehl befehl)\n {\n if(!befehl.hatZweitesWort()) {\n \t// Gibt es kein zweites Wort, wissen wir nicht, wohin...\n System.out.println(\"Wohin m�chten Sie gehen?\");\n return;\n }else if(spieler.getAktuellerZustand().toString().equals(\"Bewegungsunf�hig\")) {\n \tSystem.out.println(\"Sie sind bewegungsunf�hig und m�ssen sich heilen bevor sie weiter k�nnen\");\n \treturn;\n }\n\n String richtung = befehl.gibZweitesWort();\n\n // Wir versuchen den Raum zu verlassen.\n Raum naechsterRaum = spieler.getAktuellerRaum().getAusgang(richtung);\n\n if (naechsterRaum == null) {\n System.out.println(\"Dort ist keine T�r!\");\n }\n else {\n \tif(naechsterRaum.getClass().getName().equals(\"Level.Teleporter\")) {\n \t\tspieler.setAktuellerRaum(landkarte.getZufaelligenRaum());\n \t\tSystem.out.println(\"Du wurdest Teleportiert\");\n \t}else {\n \t\t spieler.setAktuellerRaum(naechsterRaum);\n \t}\n\n \trauminfoAusgeben();\n }\n }",
"private int aleatorizarNaipe() {\n\t\tint aux;\n\t\taux = r.getIntRand(4);\n\t\treturn aux;\n\t}",
"public String roundUp(){\n return \"Numero original: \" + this._X + \" numero redondeado hacia arriba \" + (int)Math.ceil(this._X);\n }",
"public int wuerfeln() {\n\t\tletzterWurf = Wuerfel.werfen();\n\t\thatBereitsGewuerfelt = true;\n\t\treturn (letzterWurf);\n\t}",
"public long bilanz() {\n long biilanz = -gesamtKosten();\n\n for (int i = 0; i < neueLinien; i++) {\n biilanz += linien[i].getGewinn();\n }\n bilanz = biilanz;\n return bilanz;\n }",
"private int rankMethod()\r\n {\r\n\treturn spinTheWheel();\r\n }",
"public int getReaultCount() {\n return reault_.size();\n }",
"public void sumaPuntos() {\r\n int rojo = 0;\r\n int azul = 0;\r\n for (int i = 1; i < 10; i++) {\r\n\r\n if (tablero[1][i].getTipo().equals(\"Rojo\")) {\r\n rojo += tablero[1][i].getValor();\r\n }\r\n\r\n if (tablero[8][i].getTipo().equals(\"Azul\")) {\r\n azul += tablero[8][i].getValor();\r\n }\r\n\r\n }\r\n if (rojo > azul) {\r\n this.setResultado(\"Rojo\");\r\n this.agregarVictoria(jugadorRojo);\r\n }\r\n if (azul > rojo) {\r\n this.setResultado(\"Azul\");\r\n this.agregarVictoria(jugadorAzul);\r\n }\r\n \r\n this.setReplay(true);\r\n }",
"public int getZahl()//Der Wert von Zahl wird zurueckgegeben\n {\n return zahl;\n }",
"public void schritt() {\r\n\t\tfor (int i = 0; i < anzahlRennautos; i++) {\r\n\t\t\tlisteRennautos[i].fahren(streckenlaenge);\r\n\t\t}\r\n\t}",
"public int cantHijosIzquierdosR() {\n return this.cantHijosIzquierdosR(this.raiz);\n }",
"private void nourrireLePeuple() {\n\t\t\tint totalDepense = (int)((population * 1) + (populationColoniale * 0.8) + ((armee + armeeDeployee()) * nourritureParArmee));\r\n\t\t\tnourriture -= totalDepense;\r\n\t\t\tenFamine = (nourriture > 0) ? false : true;\r\n\t\t}",
"public int miete(Spieler spieler){\n\t\treturn logik.miete(spieler);\n\t}",
"public int getCount() {\n\t\treturn this.countRound;\n\t}",
"public abstract int preN();",
"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}",
"public int AnzahlWerkstoffe()\n {\n if (liste.size() == 1)\n {\n System.out.println(\"Die Datenbank enthält \" + liste.size() + \" Werkstoff.\"); \n }\n else \n {\n System.out.println(\"Die Datenbank enthält \" + liste.size() + \" Werkstoffe.\");\n }\n return (int)liste.size();\n }",
"@Override\n public double calculaTributos() {\n // TODO Auto-generated method stub\n return 10;\n }",
"@Override\n\tpublic int size() {\n\t\tint nr = 0;\n\t\tfor (int i = 0; i < nrb; i++) {\n\t\t\t// pentru fiecare bucket numar in lista asociata acestuia numarul de\n\t\t\t// elemente pe care le detine si le insumez\n\t\t\tfor (int j = 0; j < b.get(i).getEntries().size(); j++) {\n\t\t\t\tnr++;\n\t\t\t}\n\t\t}\n\t\treturn nr;// numaru total de elemente\n\t}",
"public void wuerfeln() {\n if (istGefängnis) {\n setIstGefängnis(false);\n if (aktuellesFeldName instanceof GefängnisFeld && !(aktuellesFeldName instanceof NurZuBesuchFeld)) {\n GefängnisFeld g = (GefängnisFeld) aktuellesFeldName;\n g.gefaengnisAktion(this);\n \n return;\n }\n\n } else {\n String[] worte = {\"Eins\", \"Zwei\", \"Drei\", \"Vier\", \"Fünf\", \"Sechs\", \"Sieben\", \"Acht\", \"Neun\", \"Zehn\", \"Elf\", \"Zwölf\"};\n\n wuerfelZahl = getRandomInteger(12, 1);\n\n this.aktuellesFeld = this.aktuellesFeld + wuerfelZahl + 1;\n if (this.aktuellesFeld >= 40) {\n setAktuellesFeld(0);\n\n }\n\n System.out.println(worte[wuerfelZahl] + \" gewürfelt\");\n\n aktuellesFeldName = spielfigurSetzen(this.aktuellesFeld);\n System.out.println(\"Du befindest dich auf Feld-Nr: \" + (this.aktuellesFeld));\n boolean check = false;\n for (Spielfelder s : felderInBesitz) {\n if (aktuellesFeldName.equals(s)) {\n check = true;\n }\n }\n\n if (!check) {\n aktuellesFeldName.spielfeldAktion(this, aktuellesFeldName);\n } else {\n System.out.println(\"Das Feld: \" + aktuellesFeldName.getFeldname() + \"(Nr: \" + aktuellesFeldName.getFeldnummer() + \")gehört dir!\");\n if (aktuellesFeldName instanceof Straße) {\n Straße strasse = (Straße) aktuellesFeldName;\n System.out.println(\"Farbe: \" + strasse.getFarbe());\n try {\n strasse.hausBauen(this, strasse);\n } catch (IOException ex) {\n Logger.getLogger(Spieler.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n\n }\n }\n }",
"@Override\n public Integer reduceInit() { return 0; }",
"public int getAnzahl() {\r\n\t\treturn anzahl;\r\n\t}",
"public int getNunFigli() {\n\t\tint numFigli = 0;\n\t\tfor (Nodo_m_ario figlio : figli) {\n\t\t\tif (figlio != null) {\n\t\t\t\tnumFigli += 1;\n\t\t\t}\n\t\t}\n\t\treturn numFigli;\n\t}",
"public void generaNumeros() {\n\n\n int number =0;\n int numeroSeleccionado=gameMemoriaUno.getNumberaleatorio();\n //se agrega numero a las lista de numeros\n\n if(numeroSeleccionado == -1){\n llamaResultado(super.getActividad(), tFinal, tInicio, Num3_5_1Activity.class,gameMemoriaUno.getNumeros(),gameMemoriaUno.getAciertosTotales(),gameMemoriaUno.getFallosTotales(),gameMemoriaUno.getNumEcxluidosList(),gameMemoriaUno.getNumeroPregunta());\n\n }else {\n\n\n gameMemoriaUno.addNumerosSet(numeroSeleccionado);\n for (int i = 1; i < 6; i++) {\n //obtiene numeros del costalito menos el numero seleccionado\n number = gameMemoriaUno.getNumeroArreglo();\n //agrego numeros\n gameMemoriaUno.addNumerosSet(number);\n }\n\n Iterator<Integer> iter = gameMemoriaUno.getNumerosSet().iterator();\n\n int contadorNumeros=0;\n while (iter.hasNext()) {\n int valor=iter.next().intValue();\n lista.add(valor);\n if(gameMemoriaUno.getDificultad()==contadorNumeros){\n gameMemoriaUno.setNumerosElejidos(new int[valor]);\n }\n\n contadorNumeros+=1;\n }\n Collections.shuffle(lista, new Random());\n Collections.shuffle(lista, new Random());\n\n\n\n }\n\n\n }",
"protected final int calculateInterst1(int pr){\n\t\t return pr*10*1/100;\n\t }",
"public int getNumberOfRestraunts(){\n \n return numberOfRestraunts; \n }",
"int getNombreLignesPlateau();",
"public SqrtX() {\n\t\t// Initialization here. \n\t\t//this.count = 0;\n\n\t}",
"int getNumberOfInfantry();",
"public void redoZug(int anzahlZuege) {\n\r\n\t}",
"public int liczbaelnastosie() {\n\t\treturn 0;\n\t}",
"public int numberOfTires() {\n int tires = 4;\n return tires;\n }",
"public void zugInWerkstatt() {\n werkstatt++;\n }",
"public int restarCantidadPastillas(){\n\t\treturn cantidadPastillas--;\n\t}",
"int fillCount();",
"public void rellenarTerreno() {\n Random rnd = new Random();\r\n int restante = V;\r\n int[][] aux = terreno;\r\n do {\r\n for (int i = 0; i < Filas; i++) {\r\n for (int j = 0; j < Columnas; j++) {\r\n if (restante > max) {\r\n int peso = rnd.nextInt(max);\r\n if (aux[i][j] + peso <= max) {\r\n aux[i][j] += peso;\r\n restante -= peso;\r\n }\r\n } else {\r\n if (aux[i][j] + restante <= max) {\r\n aux[i][j] += restante;\r\n restante = 0;\r\n }\r\n }\r\n }\r\n }\r\n } while (restante != 0);\r\n }",
"public short getRank(){\n\t\treturn srtRank;\r\n\t\t\r\n\t}",
"public void setNumberOfRestraunts(int _numberOfRestraunts){\n \n numberOfRestraunts = _numberOfRestraunts;\n }",
"public Spielfeld() {\n\t\tmulden = new int[14];\n\t\tsetSteine();\n\t}",
"public int getLanseringsår() {\n\t\treturn lanseringsår;\n\t}",
"int getN();",
"Integer getNLNDreu();",
"public void reduct() {\n\t\tint divider = bunmo;\n\t\tif(bunja < bunmo){\n\t\t\tdivider = bunja;\n\t\t}\n\t\twhile(divider > 1){\n//\t\twhile(!util.Uitl.isPrime(bunmo)||!util.Uitl.isPrime(bunja)){\n\t\t\tboolean canDivide = (bunmo%divider==0)&&(bunja%divider==0);\n\t\t\tif(canDivide){\n\t\t\t\tbunja/=divider;\n\t\t\t\tbunmo/=divider;\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tdivider--;\n\t\t\t}\n\t\t}\n\t}",
"public int rekisteroi() {\r\n alId = seuraavaNro;\r\n seuraavaNro++;\r\n\r\n return seuraavaNro;\r\n }",
"private void umstellenAuf(Modul m) {\r\n\t\tModul mTemp;\r\n\t\tint last = 0;\r\n\t\tfor (Himmelskoerper hTemp : ladung.keySet()) {\r\n\t\t\tmTemp = ladung.get(hTemp);\r\n\t\t\tif (hTemp.passtModul(m)) {\r\n\t\t\t\tlast += m.getGewicht();\r\n\t\t\t} else {\r\n\t\t\t\tlast += mTemp.getGewicht();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (last > this.raumsonde.getMaxNutzlast()) {\r\n\t\t\treturn; //Nichts wurde veraendert.\r\n\t\t}\r\n\r\n\t\tfor (Himmelskoerper hTemp : ladung.keySet()) {\r\n\t\t\tmTemp = ladung.get(hTemp);\r\n\t\t\tif (hTemp.passtModul(m)) {\r\n\t\t\t\tthis.aktuelleLast -= mTemp.getGewicht();\r\n\t\t\t\tthis.aktuelleLast += m.getGewicht();\r\n\t\t\t\tladung.put(hTemp, m.klonen());\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Transient\n\tpublic String getNumerosREcibos(){\n\t\tString numerosrecibos=\" \";\n\t\n\t\tfor (ReciboDocumentoFiscal recibo : documento.getRecibos()) {\n\t numerosrecibos= numerosrecibos+recibo.getRecibo().getControl()+\" / \";\t\t\n\t\t}\n\t\treturn numerosrecibos;\n\t}",
"public void setzePunkteanzeigeRechts( int neuerPunktestand ) \n {\n anzeige.punkteRechtsSetzen( neuerPunktestand );\n }",
"public int storrelse(){\n return elementer;\n }",
"@Override\n public void cantidad_Punteria(){\n punteria=69.5+05*nivel+aumentoP;\n }",
"public int getSubstanceLotNumberReps() {\r\n \treturn this.getReps(15);\r\n }",
"public RadixSorting()\n\t{\n\t\tbuckets.add(zero);\n\t\tbuckets.add(one);\n\t\tbuckets.add(two);\n\t\tbuckets.add(three);\n\t\tbuckets.add(four);\n\t\tbuckets.add(five);\n\t\tbuckets.add(six);\n\t\tbuckets.add(seven);\n\t\tbuckets.add(eight);\n\t\tbuckets.add(nine);\n\t\tbuckets.add(ten);\n\t\tbuckets.add(eleven);\n\t\tbuckets.add(twelve);\n\t\tbuckets.add(thirteen);\n\t\tbuckets.add(fourteen);\n\t\tbuckets.add(fifteen);\n\t\tbuckets.add(sixteen);\n\t\tbuckets.add(seventeen);\n\t\tbuckets.add(eighteen);\n\t\tbuckets.add(nineteen);\n\t}",
"@Override\n public int retroceder() {\n return 0;\n }",
"private void recolteNourriture() {\r\n\t\t\t//1pop recolte toute la case\r\n\t\t\tint tempNourr = 0;\r\n\t\t\tint totalPop = population + populationColoniale;\r\n\t\t\tint limite = (totalPop < caseOwned.size()) ? totalPop : caseOwned.size();\r\n\t\t\tfor(int id = 0; id < limite; id++) {\r\n\t\t\t\ttempNourr += caseOwned.get(id).getFood();\r\n\t\t\t}\r\n\t\t\t//animaux\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Bétail) * 10; //Ca mange de l'herbe, ça se tente.\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Cervidés) * 7.5; //CARIBOUUUUUUUUU !!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Crabe) * 2; //ca pique les pied, a mort!!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Elephants) * 30; //polution sonore\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Moutons) * 5; //kébab landais\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Poissons) * 5; //croustibat\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Chevaux) * 7; //lasagnes\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Baleines) * 50; //*bruit de baleine virile*\r\n\t\t\t//aplication des bonus\r\n\t\t\ttempNourr *= (1 + (0.15 * scienceLvl) + (0.05 * (bonheur - baseBonheur))); // +15% par scienceLvl +5% par bonheur excedentaire, -5% par bonheur négatif\r\n\t\t\t\r\n\t\t\tnourriture += tempNourr;\r\n\t\t\t//bonus de conservation grâce au sel\r\n\t\t\tif(howManyRessource(StrategicRessource.Sel) > 0 && nourriture > 0) nourriture *= 1.10;\r\n\t\t\t//limitation de stockage\r\n\t\t\tint stockageMax = caseOwned.size() * 100 * scienceLvl;\r\n\t\t\tif(nourriture > stockageMax) nourriture = stockageMax;\r\n\t\t}",
"public int getNumGruppoPacchetti();",
"@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 String roundDown(){\n return \"Numero original: \" + this._X + \" numero redondeado hacia abajo \" + (int)Math.floor(this._X);\n }",
"private int getNextResNum() {\r\n // Loop through every object in the \"stockList\" object array list.\r\n for (int i = 0; i < stockList.size(); i++) {\r\n // If the \"reservationNumber\" of the beanBag in the \"stockList\"\r\n // is greater than the \"nextReservationNum\" global integer.\r\n if (((BeanBag) stockList.get(i)).getReservationNumber() > nextReservationNum) {\r\n // Set the global integer \"nextReservationNum\" to the value of the current\r\n // Reservation number of the beanBag in the \"stockList\".\r\n nextReservationNum = ((BeanBag) stockList.get(i)).getReservationNumber();\r\n }\r\n }\r\n // Increment the \"nextReservationNum\" integer by 1.\r\n nextReservationNum = nextReservationNum + 1;\r\n // Return the value of the \"nextReservationNum\" integer variable.\r\n return nextReservationNum;\r\n }",
"public int Suma(){\r\n for (int i = 0; i < 9; i++) {\r\n mult = convert()[i] * arregloCo[i];\r\n // Si la suma e mayor o igual a 10 se le resta 9\r\n if (mult >= 10){\r\n mult = mult - 9;\r\n }\r\n suma = suma + mult;\r\n }\r\n return suma;\r\n }",
"@Override\n\tpublic String StatistiqueNbrRisuqe(){\n float m= accountRepository.NbrStatus(\"a risque\");\n float s=accountRepository.NbrStatus(\"Stable\");\n float res =( m / s)*100;\n return res+\"%\";\n\n\t}",
"@Override\n\tpublic VisualizarR listarRanking() throws RemoteException {\n\t\treturn null;\n\t}",
"private String calculateRefillSize() { // ORDER [k - s - f - n]\n\t\tArrayList<Integer> items_stock = new ArrayList<>();\n\t\tint k, s, f, n;\n\t\tk = getSetUpMachine().getKnife_stock() > 0 ? 20 - getSetUpMachine().getKnife_stock() : 0;\n\t\ts = getSetUpMachine().getSpoon_stock() > 0 ? 20 - getSetUpMachine().getSpoon_stock() : 0;\n\t\tf = getSetUpMachine().getFork_stock() > 0 ? 20 - getSetUpMachine().getFork_stock() : 0;\n\t\tn = getSetUpMachine().getNapkin_stock() > 0 ? 20 - getSetUpMachine().getNapkin_stock() : 0;\n\t\titems_stock.add(k);\n\t\titems_stock.add(s);\n\t\titems_stock.add(f);\n\t\titems_stock.add(n);\n\n\t\tSystem.out.format(\"\\n[ %d: K %d: S %d: F %d: N ]\\n\", k, s, f, n);\n\t\treturn String.format(\"\\n[ %d: K %d: S %d: F %d: N ]\\n\", k, s, f, n);\n\n\t}",
"public Integer getResnr() {\n\t\treturn this.resnr;\n\t}",
"public int getSteineAufSpielfeld() {\n\t\tint steineAufDemSpielfeld = 0;\n\t\tfor (int i = 0; i<mulden.length;i++) {\n\t\t\tsteineAufDemSpielfeld += mulden[i];\n\t\t}\n\t\t\n\t\treturn steineAufDemSpielfeld;\n\t}",
"public int getNrDuengerVorhanden(){\r\n\t\treturn this.modelData.getPresentFertiliser().size();\r\n\t}",
"@Override\n\tpublic void aktualisiern(int drehzahl) {\n\t\tif(drehzahl >6321)\n\t\t{\n\t\t\tSystem.out.println(\"Drehzahl zu groß!! Drehzahl:\"+drehzahl);\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"Drehzahl im richtigen Bereich. Drehzahl:\"+drehzahl);\n\t\t}\n\t\t\n\t}",
"public int rank() { return this.rank; }",
"public void kast() {\n\t\t// vaelg en tilfaeldig side\n\t\tdouble tilfaeldigtTal = Math.random();\n\t\tvaerdi = (int) (tilfaeldigtTal * 6 + 1);\n\t}",
"public String getPremierNumeroLibre() {\n\t\tString requete_s = \"SELECT id from LIVRES\";\n\t\tint i = 0;\n\t\tboolean egalite = true;\n\t\t\n\t\ttry{\n\t\t\trequete.execute(requete_s);\n\t\t\t\n\t\t\tResultSet rs = requete.getResultSet();\n\t\t\t\n\t\t\tdo{\n\t\t\t\ti++;\n\t\t\t\trs.next();\n\t\t\t\tegalite = (i ==((Integer) rs.getObject(1)));\n\t\t\t}while(egalite);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString s = \"\" + i;\n\t\t\n\t\treturn s;\n\t}",
"public synchronized void bestandVeraendern(int artikelnummer, int anzahl) throws ArtikelExistiertNichtException, ArtikelBestandIstKeineVielfacheDerPackungsgroesseException {\n\t\tint index = -1;\n\n\t\tIterator<Artikel> iter = artikelBestand.iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tArtikel artikel = iter.next();\n\t\t\tif (artikel.getArtikelnummer() == artikelnummer)\n\t\t\t\tindex = artikelBestand.indexOf(artikel);\n\t\t}\n\t\t\n\t\tif (index != -1) {\n\t\t\tartikelBestand.get(index).setBestand(artikelBestand.get(index).getBestand() + anzahl);\n\t\t} else \n\t\t\tthrow new ArtikelExistiertNichtException(artikelnummer, \" - in 'bestandErhoehen()'\");\n\t}",
"public int getSum() {\n\t\t\treturn 0;\r\n\t\t}"
] | [
"0.6516409",
"0.60848683",
"0.5882774",
"0.5868406",
"0.5818903",
"0.5769379",
"0.57454145",
"0.5715526",
"0.5691638",
"0.56831217",
"0.56416315",
"0.55812144",
"0.5580658",
"0.5566053",
"0.55420536",
"0.5523211",
"0.5522815",
"0.54738057",
"0.546333",
"0.54406863",
"0.54139733",
"0.5399832",
"0.53715515",
"0.536153",
"0.5347472",
"0.53446966",
"0.5332968",
"0.53168386",
"0.52937716",
"0.52912426",
"0.52848315",
"0.5274342",
"0.5266692",
"0.5263759",
"0.5262977",
"0.52536756",
"0.5251576",
"0.5251328",
"0.5224572",
"0.5223531",
"0.51901746",
"0.51874524",
"0.5184188",
"0.5180362",
"0.5175901",
"0.51630145",
"0.5160125",
"0.51576394",
"0.5148904",
"0.51347536",
"0.5130763",
"0.512992",
"0.51282734",
"0.5127278",
"0.51197696",
"0.5119267",
"0.51158106",
"0.51153845",
"0.5110547",
"0.5107726",
"0.50927436",
"0.5092299",
"0.50898135",
"0.5079013",
"0.5078357",
"0.507466",
"0.50642735",
"0.5057779",
"0.50542825",
"0.505283",
"0.50454223",
"0.5039443",
"0.5039294",
"0.50357723",
"0.5032713",
"0.50189734",
"0.5016715",
"0.50150156",
"0.5011147",
"0.5008857",
"0.5006528",
"0.50030345",
"0.50002664",
"0.4999355",
"0.4996636",
"0.4996208",
"0.49934968",
"0.49917206",
"0.49909604",
"0.49888209",
"0.49880564",
"0.4984977",
"0.49839905",
"0.49832365",
"0.49782622",
"0.49761766",
"0.49720776",
"0.4969982",
"0.49661773",
"0.49660736",
"0.4963273"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onApplicationEvent(ContextStartedEvent event) {
System.out.println("start event " + event);
} | {
"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 |
Constructs a new item Requires that none of the inputs are null and p > 0 | Item(int i, String n, String c, double p) {
this.id = i;
this.name = n;
this.category = c;
this.price = p;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"P createP();",
"public Item( Item p ) {\n\t\tif( p != null ) {\n\t\t\tvalue = p.value;\n\t\t\tname = p.name;\n\t\t}\n\t}",
"private void makePrioQ()\n\t{\n\t\tprioQ = new PrioQ();\n\t\t\n\t\tfor(int i = 0; i < canonLengths.length; i++)\n\t\t{\n\t\t\tif(canonLengths[i] == 0)\n\t\t\t\tcontinue;\n\t\t\tNode node = new Node(i, canonLengths[i]);\n\t\t\tprioQ.insert(node);\n\t\t}\n\t}",
"public void buildProjector(int quantity){\r\n if (quantity != 0){\r\n eventRoomItems.addItem(itemFactory.constructProjector());\r\n }\r\n else{\r\n eventRoomItems.addItem(null);\r\n }\r\n }",
"public @NotNull Item newItem();",
"private Item checkItemNotNull(Item item) throws NullPointerException {\n if (item == null) {\n throw new NullPointerException(\"The item must not be null\");\n }\n return item;\n }",
"public PQueue() {\n this(0,null);\n }",
"public Vector(Point3D p) {\n if (p.equals(Point3D.ZERO))\n throw new IllegalArgumentException(\"no meaning to the vector\");\n head = new Point3D(p);\n }",
"IEquipableItem create(int power, int min, int max);",
"private Item initItem() {\n String name = inputName.getText().toString();\n int quantityToBuy = -1;\n if (!inputQuantityToBuy.getText().toString().equals(\"\"))\n quantityToBuy = Integer.parseInt(inputQuantityToBuy.getText().toString());\n String units = inputUnits.getText().toString();\n double price = 0;\n if (!inputPrice.getText().toString().equals(\"\"))\n price = Double.parseDouble(inputPrice.getText().toString());\n int calories = 0;\n if (!inputCalories.getText().toString().equals(\"\"))\n calories = Integer.parseInt(inputCalories.getText().toString());\n ArrayList<String> allergies = allergyActions.getAllergies();\n return new Item(name, 0, units, quantityToBuy, 0, allergies, calories, price);\n }",
"public View create(Element elem, int p0, int p1) {\n return null;\n }",
"Item(){\r\n\t\tthis(0, new Weight(5), new DukatAmount(0));\r\n\t}",
"public SkipList(double p)\n {\n\tthis.p = p;\n\tthis.size = 0;\n\t// create a dummy header node (intially: height 1)\n\tthis.head = new SkipListNode<K>();\n }",
"public Item() {}",
"@Test\n public void testCreateNegativeItemIsNull() throws Exception{\n Item item = null;\n itemDao.create(item);\n }",
"public PulverizacionItem(SimpleFeature pulvFeature) {\r\n\t\tsuper(pulvFeature);\t\t\t\t\r\n\t}",
"public Property(Property p) {\r\n\t\tpositive = Arrays.copyOf(p.positive, p.positive.length);\r\n\t\tnegative = Arrays.copyOf(p.negative, p.negative.length);\r\n\t\tstop = Arrays.copyOf(p.stop, p.stop.length);\r\n\t\tscoringmethod = p.scoringmethod;\r\n\t\tmindistance = p.mindistance;\r\n\t}",
"@SuppressWarnings(\"unused\")\n public Item() {\n }",
"IEquipableItem createDefault();",
"public Builder setProportion(int proportionOfNull, int proportionOfEmpty, int proportionOfNotEmpty){\n if(proportionOfNull < 0 || proportionOfEmpty < 0 || proportionOfNotEmpty < 0 || proportionOfNull + proportionOfEmpty + proportionOfNotEmpty <= 0){\n throw new IllegalArgumentException(\"Proportion not in bound\");\n }\n mProportionOfNull = proportionOfNull;\n mProportionOfEmpty = proportionOfEmpty;\n mProportionOfNotEmpty = proportionOfNotEmpty;\n return this;\n }",
"private void validate(int p) {\n\t\tint n = parent.length;\n\t if (p < 0 || p >= n) {\n\t \tthrow new IllegalArgumentException(\"index \" + p + \" is not between 0 and \" + (n-1));\n\t }\n\t}",
"public Item(){}",
"public Item(){\n description = \"No description avaible for this item\";\n weight = 0;\n }",
"public Item()\r\n\t{\r\n\t\tserialNum = 00000;\r\n\t\tweight = 0.0;\r\n\t}",
"private Node<E> validate(Position<E> p) throws IllegalArgumentException {\n\t\tif (!(p instanceof Node)) throw new IllegalArgumentException(\"Invalid p\");\n\t\tNode<E> node = (Node<E>) p;\n\t\tif (node.getNext() == null)\n\t\t\tthrow new IllegalArgumentException(\"p is no longer in the list\");\n\t\treturn node;\n\t}",
"public PaymentRequestItem(PurchaseOrderItem poi, PaymentRequestDocument preq, HashMap<String, ExpiredOrClosedAccountEntry> expiredOrClosedAccountList) {\r\n\r\n // copy base attributes w/ extra array of fields not to be copied\r\n PurApObjectUtils.populateFromBaseClass(PurApItemBase.class, poi, this, PurapConstants.PREQ_ITEM_UNCOPYABLE_FIELDS);\r\n\r\n setItemDescription(poi.getItemDescription());\r\n\r\n //New Source Line should be set for PaymentRequestItem\r\n resetAccount();\r\n\r\n // set up accounts\r\n List accounts = new ArrayList();\r\n for (PurApAccountingLine account : poi.getSourceAccountingLines()) {\r\n PurchaseOrderAccount poa = (PurchaseOrderAccount) account;\r\n\r\n // check if this account is expired/closed and replace as needed\r\n SpringContext.getBean(AccountsPayableService.class).processExpiredOrClosedAccount(poa, expiredOrClosedAccountList);\r\n\r\n //KFSMI-4522 copy an accounting line with zero dollar amount if system parameter allows\r\n if (poa.getAmount().isZero()) {\r\n if (SpringContext.getBean(AccountsPayableService.class).canCopyAccountingLinesWithZeroAmount()) {\r\n accounts.add(new PaymentRequestAccount(this, poa));\r\n }\r\n } else {\r\n accounts.add(new PaymentRequestAccount(this, poa));\r\n }\r\n }\r\n\r\n this.setSourceAccountingLines(accounts);\r\n this.getUseTaxItems().clear();\r\n //List<PurApItemUseTax> newUseTaxItems = new ArrayList<PurApItemUseTax>();\r\n /// this.setUseTaxItems(newUseTaxItems);\r\n //copy use tax items over, and blank out keys (useTaxId and itemIdentifier)\r\n /*\r\n this.getUseTaxItems().clear();\r\n for (PurApItemUseTax useTaxItem : poi.getUseTaxItems()) {\r\n PaymentRequestItemUseTax newItemUseTax = new PaymentRequestItemUseTax(useTaxItem);\r\n this.getUseTaxItems().add(newItemUseTax);\r\n\r\n }\r\n */\r\n\r\n // clear amount and desc on below the line - we probably don't need that null\r\n // itemType check but it's there just in case remove if it causes problems\r\n // also do this if of type service\r\n if ((ObjectUtils.isNotNull(this.getItemType()) && this.getItemType().isAmountBasedGeneralLedgerIndicator())) {\r\n // setting unit price to be null to be more consistent with other below the line\r\n this.setItemUnitPrice(null);\r\n }\r\n\r\n // copy custom\r\n this.purchaseOrderItemUnitPrice = poi.getItemUnitPrice();\r\n// this.purchaseOrderCommodityCode = poi.getPurchaseOrderCommodityCd();\r\n\r\n // set doc fields\r\n this.setPurapDocumentIdentifier(preq.getPurapDocumentIdentifier());\r\n this.setPurapDocument(preq);\r\n }",
"public WaitablePQueue() {\n\t\tthis(DEFAULT_INITIAL_CAPACITY, null);\n\t}",
"public Node(Point p) //is this needed\n\t{\n\t\tpoint = p;\n\t\tnext = null;\n\t}",
"public Item() {\r\n this.name = \"\";\r\n this.description = \"\";\r\n this.price = 0F;\r\n this.type = \"\";\r\n this.available = 0;\r\n this.wholesaler = new Wholesaler();\r\n this.wholesalerId = 0;\r\n this.category = new Category();\r\n this.categoryId = 0; \r\n }",
"public Item createItem(int i, int x, int y) {\n\t\tswitch (i) {\n\t\tcase 51:\n\t\t\treturn new DoubleJumpItem(i, x, y);\n\t\tcase 102:\n\t\t\treturn new StopTimeItem(i, 5, x, y);\n\t\tcase 53:\n\t\t\treturn new ImmortalItem(i, x, y);\n\t\tdefault:\n\t\t\treturn null;\n\t\t}\n\t}",
"public PQueue(int length) {\n this(length,null);\n }",
"@Override\r\n\tpublic Item constructItem() {\r\n try {\r\n @SuppressWarnings(\"unchecked\")\r\n T entity = (T) entityClass.newInstance();\r\n BeanInfo info = Introspector.getBeanInfo(entityClass);\r\n for (PropertyDescriptor pd : info.getPropertyDescriptors()) {\r\n for (Object propertyId : queryDefinition.getPropertyIds()) {\r\n if (pd.getName().equals(propertyId)) {\r\n Method writeMethod = pd.getWriteMethod();\r\n Object propertyDefaultValue = queryDefinition.getPropertyDefaultValue(propertyId);\r\n writeMethod.invoke(entity, propertyDefaultValue);\r\n }\r\n }\r\n }\r\n return toItem(entity);\r\n } catch (Exception e) {\r\n throw new RuntimeException(\"Error in bean construction or property population with default values.\", e);\r\n }\r\n }",
"Item(Weight weight){\r\n\t\tthis(0, weight, new DukatAmount(0));\r\n\t}",
"public abstract void createAssignment(int p);",
"public abstract P getNew() throws DataFault;",
"public PotionEffect(PotionEffect paramwq)\r\n/* 35: */ {\r\n/* 36: 44 */ this.id = paramwq.id;\r\n/* 37: 45 */ this.duration = paramwq.duration;\r\n/* 38: 46 */ this.amplifier = paramwq.amplifier;\r\n/* 39: 47 */ this.ambient = paramwq.ambient;\r\n/* 40: 48 */ this.showParticles = paramwq.showParticles;\r\n/* 41: */ }",
"public Item() {\n\t}",
"public Item() {\n\t}",
"public void addNoCollisionElement(Particle p)\n {\n noCollisionElements.add(p);\n p.addNoCollisionElementFree(this);\n }",
"public PerishableItem(){\n super();\n //perishable = false;\n }",
"private Item(){}",
"protected abstract Item createTestItem3();",
"public Item()\n {\n super();\n }",
"public UnitP(UnitInfo unitInfo, UnitP unitP)\n {\n \tthis(unitInfo, unitP, \"\"); \t\n }",
"public Item newItem() {\n\t\tItem page = new Item();\r\n\t\tpage.setWpPublished(DateUtils.now());\r\n\t\tpage.setWpWeight(0);\r\n\t\treturn page;\r\n\t}",
"public Item() {\n }",
"public Item() {\n }",
"protected Item(Point pos)\n\t{\n\t\tthis.pos = pos;\n\t}",
"@Test(expected = IllegalArgumentException.class)\n public void testConstructorProcedureNull() {\n PlannedActivity plannedActivity = new PlannedActivity(0,\n new Site(\"factory\", \"area\"), new Typology(\"typology\"),\n \"desctiption\", 0, true, 1, null, \"workspaceNotes\");\n\n }",
"public Producto(Producto p) {\r\n\t\tsuper();\r\n\t\tID = getIDnuevoProducto();\r\n\t\tsetNombre(p.getNombre());\r\n\t\tsetCantidad(p.getCantidad());\r\n\t\tsetEnVenta(p.isEnVenta());\r\n\t\tsetCaracteristicas(p.getCaracteristicas());\r\n\t\tsetCategoria(p.getCategoria());\r\n\t\tsetDescripcion(p.getDescripcion());\r\n\t\tsetPrecio(p.getPrecio());\r\n\t\tsetVendedor(p.getVendedor());\r\n\t}",
"public Perishable(String name, String Type, int time, double p)\n\t{\n\t\tsuper(name, Type, time);\n\t\tisSpoilt = false;\n\t\tprob = p;\n\t}",
"@Override\r\n\t\tpublic boolean createItem() {\n\t\t\treturn false;\r\n\t\t}",
"public Vending_Machine(ArrayList<Products> p) {\n\t\tproducts = p;\n\t\tcurrentCoin = new CoinSet();\n\t\tcoin = new CoinSet();\n\t}",
"public ProductoCreable newInstance(int codigo, String nombre){\r\n \r\n }",
"public ItemInfo () {}",
"public PurchaseOrderItem () {\n\t\tsuper();\n\t}",
"@Test\r\n\tvoid testPolynomConstructor() {\r\n\t\tIterator<Monom>it=polynomEx.iteretor();\r\n\t\tassertFalse(\"Checks that the polynom's arrayList is null:\",it.hasNext());\r\n\t}",
"public Item createNew(int count) {\r\n Item i = new Item(name, id);\r\n i.setPickedUp(true);\r\n i.setCount(count);\r\n return i;\r\n }",
"public Item()\r\n {\r\n // Initialize instance variables\r\n \r\n }",
"public Item createItem() {\n if(pickUpImplementation == null)\n {\n pickUpImplementation = new DefaultPickUp();\n }\n\n if(lookImplementation == null)\n {\n lookImplementation = new DefaultLook(R.string.default_look);\n }\n\n if(defaultItemInteraction == null)\n {\n throw new IllegalArgumentException(\"No default interaction specified!\");\n }\n\n\n return new Item(\n id,\n name,\n pickUpImplementation,\n lookImplementation,\n useImplementation,\n defaultItemInteraction\n );\n }",
"private void addItems(RegularItem...pItems)\r\n\t{\r\n\t\tfor (RegularItem item : pItems) {\r\n\t\t\tassert item != null;\r\n\t\t\taItems.add(item);\r\n\t\t};\r\n\t}",
"public PaymentRequestItem(OleInvoiceItem poi, OlePaymentRequestDocument preq, HashMap<String, ExpiredOrClosedAccountEntry> expiredOrClosedAccountList) {\r\n\r\n // copy base attributes w/ extra array of fields not to be copied\r\n PurApObjectUtils.populateFromBaseClass(PurApItemBase.class, poi, this, PurapConstants.PREQ_ITEM_UNCOPYABLE_FIELDS);\r\n\r\n setItemDescription(poi.getItemDescription());\r\n\r\n //New Source Line should be set for PaymentRequestItem\r\n resetAccount();\r\n\r\n // set up accounts\r\n List accounts = new ArrayList();\r\n\r\n for (PurApAccountingLine account : poi.getSourceAccountingLines()) {\r\n InvoiceAccount poa = (InvoiceAccount) account;\r\n\r\n // check if this account is expired/closed and replace as needed\r\n SpringContext.getBean(AccountsPayableService.class).processExpiredOrClosedAccount(poa, expiredOrClosedAccountList);\r\n\r\n //KFSMI-4522 copy an accounting line with zero dollar amount if system parameter allows\r\n if (poa.getAmount().isZero()) {\r\n if (SpringContext.getBean(AccountsPayableService.class).canCopyAccountingLinesWithZeroAmount()) {\r\n accounts.add(new PaymentRequestAccount(this, poa));\r\n }\r\n } else {\r\n accounts.add(new PaymentRequestAccount(this, poa));\r\n }\r\n }\r\n\r\n this.setSourceAccountingLines(accounts);\r\n this.getUseTaxItems().clear();\r\n //List<PurApItemUseTax> newUseTaxItems = new ArrayList<PurApItemUseTax>();\r\n /// this.setUseTaxItems(newUseTaxItems);\r\n //copy use tax items over, and blank out keys (useTaxId and itemIdentifier)\r\n /*\r\n this.getUseTaxItems().clear();\r\n for (PurApItemUseTax useTaxItem : poi.getUseTaxItems()) {\r\n PaymentRequestItemUseTax newItemUseTax = new PaymentRequestItemUseTax(useTaxItem);\r\n this.getUseTaxItems().add(newItemUseTax);\r\n\r\n }\r\n */\r\n\r\n // clear amount and desc on below the line - we probably don't need that null\r\n // itemType check but it's there just in case remove if it causes problems\r\n // also do this if of type service\r\n if ((ObjectUtils.isNotNull(this.getItemType()) && this.getItemType().isAmountBasedGeneralLedgerIndicator())) {\r\n // setting unit price to be null to be more consistent with other below the line\r\n // this.setItemUnitPrice(null);\r\n }\r\n\r\n // copy custom\r\n /*Modified for the jira -5458*/\r\n this.purchaseOrderItemUnitPrice = poi.getPurchaseOrderItem()!=null ? poi.getPurchaseOrderItem().getItemUnitPrice() : null;\r\n// this.purchaseOrderCommodityCode = poi.getPurchaseOrderCommodityCd();\r\n\r\n // set doc fields\r\n this.setPurapDocumentIdentifier(preq.getPurapDocumentIdentifier());\r\n this.setPurapDocument(preq);\r\n }",
"public void create(Person p) {\n\t\t\n\t}",
"@Test\n\tpublic void constructor1Test() {\n\t\tOrderItem orderItem = new OrderItem(1L, 2L, 3L, 2, 22.5);\n\t\tassertTrue(orderItem instanceof OrderItem);\n\t}",
"public DessertItem() {\n this(\"\");\n }",
"public OrderItem() {}",
"Items(double cost){\n\tthis.cost=cost;\n\titemId++;\n\tcurrentID=itemId;\n}",
"protected abstract Item createTestItem1();",
"Item(DukatAmount price){\r\n\t\tthis(0, new Weight(5), price);\r\n\t}",
"void spawnItem(@NotNull Point point) {\n int anInt = r.nextInt(100) + 1;\n if (anInt <= 10)\n objectsInMap.add(new AmmoItem(point));\n else if (anInt <= 20)\n objectsInMap.add(new HealthItem(point));\n else if (anInt <= 30)\n objectsInMap.add(new ShieldItem(point));\n else if (anInt <= 40)\n objectsInMap.add(new StarItem(point));\n else if (anInt <= 45)\n objectsInMap.add(new LivesItem(point));\n }",
"public abstract MapItem createMapItem(Object[] parameters) throws Exception;",
"public InternalNode(int d, Node p0, int k1, Node p1, Node n, Node p) {\n\t\tsuper (d, n, p);\n\t\tptrs[0] = p0;\n\t\tkeys[1] = k1;\n\t\tptrs[1] = p1;\n\t\tlastindex = 1;\n\t\tif (p0 != null) {\n\t\t\tp0.setParent(new Reference (this, 0, false));\n\t\t}\n\t\tif (p1 != null) {\n\t\t\tp1.setParent(new Reference (this, 1, false));\n\t\t}\n\t}",
"public M create(P model);",
"public InternalNode (int d, Node p0, String k1, Node p1, Node n, Node p){\n\n super (d, n, p);\n ptrs [0] = p0;\n keys [1] = k1;\n ptrs [1] = p1;\n lastindex = 1;\n\n if (p0 != null) p0.setParent (new Reference (this, 0, false));\n if (p1 != null) p1.setParent (new Reference (this, 1, false));\n }",
"public a(RdsInputItemPresenterImpl rdsInputItemPresenterImpl, RdsInputItemView rdsInputItemView, ParameterElement.Input input) {\n super(1);\n this.a = rdsInputItemPresenterImpl;\n this.b = rdsInputItemView;\n this.c = input;\n }",
"void createInP(ArcIn[] arcs) throws ExceptionInvalidNetStructure {\n inPwithInf.clear();\n quantInwithInf.clear();\n inP.clear();\n quantIn.clear();\n for (ArcIn arc : arcs) {\n if (arc.getNumT() == this.getNumber()) {\n if (arc.getIsInf()) {\n inPwithInf.add(arc.getNumP());\n quantInwithInf.add(arc.getQuantity());\n } else {\n inP.add(arc.getNumP());\n quantIn.add(arc.getQuantity());\n // }\n }\n }\n }\n if (inP.isEmpty()) {\n throw new ExceptionInvalidNetStructure(\"Transition \" + this.getName() + \" hasn't input positions!\");\n }\n\n }",
"public Purp() {\n }",
"public abstract Optional<Item[]> itemsRequired(Player player);",
"@Override\r\n\tpublic void insertItem(int p, char c) {\n\t\tif (isEmpty()) {\r\n\t\t\tthis.aPList.changeHead(c);\r\n\t\t\tthis.aPList.changePriority(p);\r\n\t\t\tthis.aPList.changeTail(null);\r\n\t\t\treturn; // end here\r\n\t\t}\r\n\t\tthis.aPList = subInsert (this.aPList, p, c);\r\n\t}",
"public Item a(Block parambec, Random paramRandom, int paramInt)\r\n/* 76: */ {\r\n/* 77: 99 */ return null;\r\n/* 78: */ }",
"public p7p2() {\n }",
"public Position(Position p_p)\n {\n this.x = p_p.x;\n this.y = p_p.y;\n }",
"public ProgramItemDTO(PersonalProgramDTO pp) {\n this((TotaraProgramDTO) pp);\n this.shared = true;\n }",
"public Receipt(Purchase p) {\r\n this.purch=p;\r\n totalPurch=0;\r\n totalDisc=0;\r\n \r\n db= new FakeDataBase();\r\n c= new Customer(db.getCustomerDbItem(purch.getCustIdx()));\r\n //System.out.println(c.toString());\r\n lineItem = new LineItem[0];\r\n generateLineItems();\r\n }",
"@Test(expected = IllegalArgumentException.class)\n public void testConstructorTypologyNull() {\n PlannedActivity plannedActivity = new PlannedActivity(0,\n new Site(\"factory\", \"area\"), null, \"descriton\", 0, true, 1,\n new Procedure(\"name\", \"smp\"), \"workspaceNotes\");\n\n }",
"public void add(E e, P p) throws IllegalArgumentException;",
"public void addPoolableElement(P poolable) throws MalformedDilutionException;",
"public Pit initializePit(int pitId) {\n Pit pit = new Pit();\n pit.setPitId(pitId);\n if (pitId <= P1_STORE_PIT) {\n pit.setOwner(new Player(Player.PlayerId.PLAYER_ONE, P1_STORE_PIT));\n if (pitId < P1_STORE_PIT) {\n pit.setNumberOfStones(BEGINNING_STONE_AMOUNT);\n pit.setPitType(PitType.NORMAL);\n } else {\n pit.setNumberOfStones(0);\n pit.setPitType(PitType.STORE);\n }\n } else {\n pit.setOwner(new Player(Player.PlayerId.PLAYER_TWO, P2_STORE_PIT));\n if (pitId < P2_STORE_PIT) {\n pit.setNumberOfStones(BEGINNING_STONE_AMOUNT);\n pit.setPitType(PitType.NORMAL);\n } else {\n pit.setNumberOfStones(0);\n pit.setPitType(PitType.STORE);\n }\n }\n return pit;\n }",
"void createItem (String name, String description, double price);",
"public PaymentRequestItem(PurchaseOrderItem poi, PaymentRequestDocument preq) {\r\n this(poi, preq, new HashMap<String, ExpiredOrClosedAccountEntry>());\r\n }",
"@Test\n public void constructorInitializesAllItemsInUnknownState() {\n FirstAidItem firstAidItem = Tests.buildFirstAidItem(Point.pt(2.5, 3.5));\n WeaponItem weaponItem = Tests.buildWeaponItem(Point.pt(1.5, 0.5), Weapon.WeaponType.HANDGUN);\n\n Bot bot = Tests.mockBot();\n ItemMemory itemMemory = new ItemMemory(bot, asList(firstAidItem, weaponItem));\n\n assertThat(itemMemory.get(firstAidItem).getState(), is(ItemMemoryRecord.State.UNKNOWN));\n assertThat(itemMemory.get(weaponItem).getState(), is(ItemMemoryRecord.State.UNKNOWN));\n }",
"public SPT(int r, int[] p, List<Integer> so, double[] costs) {\n super(r, p, so);\n this.costs = costs;\n }",
"@Override\n public int init(int n, int p) {\n if (p != BLUE && p != RED) {\n return INVALID;\n }\n\n this.player = p;\n this.boardDimension = n;\n this.board = new Board(this.boardDimension);\n\n return 0;\n }",
"public Process() {\t// constructor with empty parameter\r\n\t\tthis.priority = -1;\t// int value will be -1\r\n \tthis.type = null;\t// String object initialized to null\r\n\t}",
"public PrecisePoint() {\n }",
"public Polynomial add(Polynomial p){\n\t\t Polynomial sum = new Polynomial();\n\t\t \n\t\t for( int i=0; i < p.maxindex; i++) {\n\t\t // if (p.data[i] != 0)\n\t\t sum.setCoefficient(i, this.data[i]+p.data[i]);\n\t\t \n\t\t }\n\t\t if(this.maxindex>p.maxindex)\n\t\t {\n\t\t\t for(int i=p.maxindex-1;i<this.maxindex;i++)\n\t\t\t\t sum.setCoefficient(i, this.data[i]);\n\t\t\t \n\t\t }\n\t\t \n\t\t return sum;\n\t\t\n\t}",
"public Property(Property p) {\n\t\tcity=p.getCity();\n\t\towner=p.getOwner();\n\t\tpropertyName=p.getPropertyName();\n\t\trentAmount=p.getRentAmount();\n\t\tplot= new Plot(p.plot);\n\t}",
"public Data(int n, double p) {\n try {\n if (n <= 0) throw new Exception(\"Specified size for random Data object is zero or even negative\");\n if (p < 0.0 || p > 1.0)\n throw new Exception(\"Specified probability of 1 bits in random Data object should be contained in [0,1]\");\n\n Random r = new Random();\n this.data = new ArrayList<Byte>(n);\n for (int i = 0; i < n; i++) {\n int bi = 0;\n for (int j = 0; j < 8; j++) {\n if (r.nextDouble() < p) bi = bi + 1;\n bi = bi << 1;\n }\n byte b = (byte) bi;\n this.data.add(b);\n }\n } catch (Exception e) {\n e.printStackTrace();\n System.exit(1);\n }\n }",
"@Test\n\tpublic void testCreateIncorrectParam() {\n\t\tStickyPolicy sPolicy = PolicyGenerator.buildStickyPolicy();\n\t\tfinal String owner = \"\"+1;\n\t\t\n\t\tResponse response = piiController.createPii(null, null, sPolicy, owner);\n\t\t\n\t\tverifyZeroInteractions(mPiiService);\n\t\tverifyZeroInteractions(mPuidDao);\n\t\tassertEquals(400, response.getStatus());\n\t\t\n\t\tObject entity = response.getEntity();\n\t\tassertNull(entity);\n\t}",
"public Item(final String pN,final String pD, final int pW, final boolean pE)\n {\n this.aDescription = pD;\n this.aWeight = pW; \n this.aName = pN;\n this.aEdible = pE;\n }"
] | [
"0.5704168",
"0.5649795",
"0.5552406",
"0.5550814",
"0.55089396",
"0.5499222",
"0.5425714",
"0.539696",
"0.53710026",
"0.53523785",
"0.5347332",
"0.5328302",
"0.5292616",
"0.52599216",
"0.5237457",
"0.52115476",
"0.51846653",
"0.51824546",
"0.5179922",
"0.51496947",
"0.5132933",
"0.5121864",
"0.51133966",
"0.50734335",
"0.50462466",
"0.50446695",
"0.5034429",
"0.50317854",
"0.50153327",
"0.5013845",
"0.5010418",
"0.5009928",
"0.49965274",
"0.49950412",
"0.49882105",
"0.4981977",
"0.49707788",
"0.49707788",
"0.49697322",
"0.49689537",
"0.4945646",
"0.49448243",
"0.4939356",
"0.49392483",
"0.49344414",
"0.49277723",
"0.49277723",
"0.49272934",
"0.49272054",
"0.49244127",
"0.4893787",
"0.4891356",
"0.4881231",
"0.48755577",
"0.48752883",
"0.4873154",
"0.48624754",
"0.48623744",
"0.486147",
"0.4859058",
"0.484923",
"0.48312342",
"0.4827467",
"0.48263982",
"0.48187163",
"0.48162526",
"0.48142174",
"0.48136395",
"0.48128968",
"0.4811798",
"0.48009598",
"0.47996548",
"0.4790382",
"0.47871816",
"0.4786178",
"0.47813198",
"0.47798392",
"0.47782153",
"0.47763738",
"0.47758266",
"0.47743952",
"0.47739416",
"0.47718382",
"0.4764755",
"0.47636327",
"0.47447595",
"0.47435415",
"0.47420806",
"0.47400498",
"0.473788",
"0.47371253",
"0.4734761",
"0.4734616",
"0.4734468",
"0.47335988",
"0.47330812",
"0.47274745",
"0.47249052",
"0.47230974",
"0.47215348"
] | 0.53331834 | 11 |
/ INFO: This method Get the required method from tobeapprove method list and Approves it. if App not found in the list it return false and returns true for happy condition. INPUT: String containing desired App name RETURN: Boolean | public boolean approveApp(String myAppName) {
Log.info("Checking if App:" + myAppName + "came for approval");
WebElement myElement = getAppFromList(myAppName);
if (myElement != null) {
Log.info(myAppName + "came for approval. Approving it now..");
WebElement approveButton = myElement.findElement(By.id("appsEditApprove"));
approveButton.click();
app_confrim.click();
if (getAccontDetails(myAppName) != null) {
Log.info(myAppName + "is approved now");
return true;
} else {
Log.info("failed to approve" + myAppName);
return false;
}
} else {
Log.info(myAppName + "did not showed up in approval list");
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean checkAppApproveStatus(String myAppName) {\n\t\tSystem.out.println(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='approve_notify']//span]\"));\n\t\tSystem.out.println(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Approve\") && myAccountField.getText().contains(strDate)) {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is approved\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is pending\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public boolean approveAppointment() {\n\t\tSet <String> set=(HealthCareDAO.map).keySet();\r\n\t\tint count=1;\r\n\t\tfor(String s:set)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"You have a center \"+map.get(s).getCenterName() +\"--\"+\"Center and id is \"+s);\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tSystem.out.println(\"Enter Center id :\");\r\n\t\tString str=scan.next();\r\n\t\tDiagnoisticCenter center=HealthCareDAO.map.get(str); //get Diagonistic object of given key \r\n\t\tList<Appointment> l=center.getAppointmentList();\r\n\t\t//System.out.println(l);\r\n\t\tint y=1;\r\n\t\tfor(Appointment a:l)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Enter Approval or disapproval\");\r\n\t\tboolean decision=scan.nextBoolean()\t;\r\n\t\t\ta.setApproved(decision);\r\n\t\t\tif(a.isApproved()==true)\r\n\t\t\t{\tSystem.out.println(\"Appointment id number \"+a.getAppointmentid()+\"---is Approved\");}\r\n\t\t\telse {System.out.println(\"Appointment id number \"+a.getAppointmentid()+\"---is not Approved\");}\r\n\t\t\ty++;\r\n\t\t\tif(y>3)\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t}\r\n\t\tcenter.setAppointmentList(l);\r\n\t\tSystem.out.println(\"Appointment List count :\"+l.size());\r\n\t\t\r\n\t\treturn false;\r\n\t}",
"void checkForApps();",
"public boolean isApproved();",
"public boolean isApproved();",
"boolean hasPlainApprove();",
"public String prepareToAddApplication() {\r\n\t\tSystem.out.println(\"aaa\");\r\n\t\t// TODO Auto-generated method stub\r\n\t\ttry {\r\n\t\t\tuserRole = (Employee) request.getSession().getAttribute(\"user\");\r\n\t\t\tif(userRole.isApprover()){\r\n\t\t\t\tallapprover = ied.getApproversForApproveer(userRole.getEmpName());\r\n\t\t\t\talladmin = ied.getAllAdmins();\r\n\t\t\t\treturn \"prepare_approver_success\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tallapprover = ied.getAllApprovers();\r\n\t\t\talladmin = ied.getAllAdmins();\r\n\t\t return \"success\";\r\n\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn \"error\";\r\n\t }\r\n\t}",
"public boolean approveAppointment() {\n\t\tIHealthCareDAO dao = new HealthCareDAO();\r\n\t\treturn dao.approveAppointment();\r\n\t}",
"protected String getAppForMethod(Integer method){\n for (Integer app : apps.keySet()) {\n for (Integer profile : profiles.keySet()) {\n if(profiles.get(profile).containsKey(app))\n for (Integer object : profiles.get(profile).get(app).keySet()) {\n if(profiles.get(profile).get(app).get(object).contains(method)) return apps.get(app);\n }\n }\n }\n return \"\";\n }",
"@SystemAPI\n\tboolean needsApproval();",
"private boolean doGetApproval() {\n\t\tcurrentStep = OPERATION_NAME+\": getting approval from BAMS\";\n\t\tif (!_atmssHandler.doDisDisplayUpper(SHOW_PLEASE_WAIT)) {\n\t\t\trecord(\"Dis\");\n\t\t\treturn false;\n\t\t}\n\t\tresult = _atmssHandler.doBAMSUpdatePasswd(newPassword, _session);\n\t\tif (result) {\n\t\t\trecord(\"password changed\");\n\t\t\treturn true;\n\t\t} else {\n\t\t\trecord(\"BAMS\");\n\t\t\tif (!_atmssHandler.doDisDisplayUpper(FAILED_FROM_BAMS_UPDATING_PW)) {\n\t\t\t\trecord(\"Dis\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tpause(3);\n\t\t\treturn false;\n\t\t}\n\t}",
"public boolean isApproved()\n\t{\n\t\tif(response.containsKey(\"Result\")) {\n\t\t\tif(response.get(\"Result\").equals(\"APPROVED\")) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public String approve() throws Exception\r\n {\r\n try\r\n {\r\n PoInvGrnDnMatchingHolder holder = poInvGrnDnMatchingService.selectByKey(param.getMatchingOid());\r\n \r\n if (\"yes\".equals(this.getSession().get(SESSION_SUPPLIER_DISPUTE)))\r\n {\r\n if (PoInvGrnDnMatchingStatus.PENDING.equals(holder.getMatchingStatus()))\r\n {\r\n this.result = \"pending\";\r\n return SUCCESS;\r\n }\r\n if (PoInvGrnDnMatchingStatus.MATCHED.equals(holder.getMatchingStatus()))\r\n {\r\n this.result = \"matched\";\r\n return SUCCESS;\r\n }\r\n if (PoInvGrnDnMatchingStatus.INSUFFICIENT_INV.equals(holder.getMatchingStatus()))\r\n {\r\n this.result = \"insufficientInv\";\r\n return SUCCESS;\r\n }\r\n if (PoInvGrnDnMatchingStatus.OUTDATED.equals(holder.getMatchingStatus()))\r\n {\r\n this.result = \"outdated\";\r\n return SUCCESS;\r\n }\r\n if (PoInvGrnDnMatchingInvStatus.APPROVED.equals(holder.getInvStatus()) || PoInvGrnDnMatchingInvStatus.SYS_APPROVED.equals(holder.getInvStatus()))\r\n {\r\n this.result = \"approved\";\r\n return SUCCESS;\r\n }\r\n if (!holder.getRevised())\r\n {\r\n if (PoInvGrnDnMatchingSupplierStatus.PENDING.equals(holder.getSupplierStatus()))\r\n {\r\n this.result = \"supplierpending\";\r\n return SUCCESS;\r\n }\r\n if (PoInvGrnDnMatchingBuyerStatus.PENDING.equals(holder.getBuyerStatus()) && PoInvGrnDnMatchingSupplierStatus.ACCEPTED.equals(holder.getSupplierStatus()))\r\n {\r\n this.result = \"supplieraccept\";\r\n return SUCCESS;\r\n }\r\n if (PoInvGrnDnMatchingBuyerStatus.PENDING.equals(holder.getBuyerStatus()) && PoInvGrnDnMatchingSupplierStatus.REJECTED.equals(holder.getSupplierStatus()))\r\n {\r\n this.result = \"buyerpending\";\r\n return SUCCESS;\r\n }\r\n if (PoInvGrnDnMatchingBuyerStatus.REJECTED.equals(holder.getBuyerStatus()))\r\n {\r\n this.result = \"rejected\";\r\n return SUCCESS;\r\n }\r\n }\r\n }\r\n if (null == param.getInvStatusActionRemarks() || param.getInvStatusActionRemarks().length() == 0 || param.getInvStatusActionRemarks().length() > 255)\r\n {\r\n this.result = \"remarks\";\r\n return SUCCESS;\r\n }\r\n this.checkInvFileExist(holder);\r\n poInvGrnDnMatchingService.changeInvDateToFirstGrnDate(holder);\r\n PoInvGrnDnMatchingHolder newHolder = new PoInvGrnDnMatchingHolder();\r\n BeanUtils.copyProperties(holder, newHolder);\r\n newHolder.setInvStatus(PoInvGrnDnMatchingInvStatus.APPROVED);\r\n newHolder.setInvStatusActionDate(new Date());\r\n newHolder.setInvStatusActionRemarks(param.getInvStatusActionRemarks());\r\n newHolder.setInvStatusActionBy(getProfileOfCurrentUser().getLoginId());\r\n poInvGrnDnMatchingService.auditUpdateByPrimaryKeySelective(this.getCommonParameter(), holder, newHolder);\r\n poInvGrnDnMatchingService.moveFile(holder);\r\n this.result = \"1\";\r\n }\r\n catch (Exception e)\r\n {\r\n ErrorHelper.getInstance().logError(log, this, e);\r\n this.result = \"0\";\r\n }\r\n return SUCCESS;\r\n }",
"@Override\n\tpublic boolean isAutoApprove(String arg0) {\n\t\treturn false;\n\t}",
"public boolean checkCurrentOfferStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountOfferStatus = myAccount.findElement(By.className(\"adminTable4 \"));\n\t\tString elementPageSource = myAccountOfferStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" offer is enabled Which is a deactivated app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"@Override\n\tpublic boolean isApproved();",
"public void syncApprovedApplicantsFromErp() {\n\t\tList<String> allErpCodes = applicationDao.getAllProcessedApplicationFileNos();\r\n\t\t// List<String> allErpCodes = Arrays.asList(\"C/20293\", \"C/20292\",\r\n\t\t// \"C/20390\");\r\n\t\tList<ApplicationSyncPayLoad> syncedApplicants = new ArrayList<>();\r\n\t\tint successCounter = 0;\r\n\t\tint totalToBeSynced = 0;\r\n\t\tif (!allErpCodes.isEmpty()) {\r\n\t\t\ttotalToBeSynced = allErpCodes.size();\r\n\t\t\tJSONArray mJSONArray = new JSONArray(allErpCodes);\r\n\r\n\t\t\t// Send this to ERP\r\n\t\t\ttry {\r\n\t\t\t\tString results = postErpCodesToERP(mJSONArray);\r\n\t\t\t\tif (results.equals(\"null\")) {\r\n\t\t\t\t\tlogger.error(\" ===>>><<<< === NO REPLY FROM ERP ===>><<<>>== \");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tJSONArray jo = null;\r\n\t\t\t\t\tjo = new JSONArray(results);\r\n\t\t\t\t\tfor (int i = 0; i < jo.length(); i++) {\r\n\t\t\t\t\t\tJSONObject jObject = null;\r\n\t\t\t\t\t\tjObject = jo.getJSONObject(i);\r\n\t\t\t\t\t\tApplicationSyncPayLoad syncPayLoad = new ApplicationSyncPayLoad();\r\n\t\t\t\t\t\tsyncPayLoad.setApplicationNo_(jObject.getString(\"Application No_\"));\r\n\t\t\t\t\t\tsyncPayLoad.setEmail(jObject.getString(\"email\"));\r\n\t\t\t\t\t\tsyncPayLoad.setReg_no(jObject.getString(\"reg_no\"));\r\n\t\t\t\t\t\tsyncedApplicants.add(syncPayLoad);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfor (ApplicationSyncPayLoad appSync : syncedApplicants) {\r\n\t\t\t\t\t\t// Update this Applications\r\n\t\t\t\t\t\tlogger.info(\"Finding application:\" + appSync.getApplicationNo_());\r\n\t\t\t\t\t\tList<ApplicationFormHeader> applications = applicationDao\r\n\t\t\t\t\t\t\t\t.findByErpCode(appSync.getApplicationNo_());\r\n\r\n\t\t\t\t\t\tApplicationFormHeader application = null;\r\n\t\t\t\t\t\tif (applications.size() > 0) {\r\n\t\t\t\t\t\t\tapplication = applications.get(0);\r\n\t\t\t\t\t\t\tif (application != null) {\r\n\t\t\t\t\t\t\t\t// Find the User and Member Object and User\r\n\t\t\t\t\t\t\t\tif (application.getUserRefId() != null) {\r\n\t\t\t\t\t\t\t\t\tlogger.info(\"marking this application as approved:\" + application.getRefId());\r\n\t\t\t\t\t\t\t\t\tapplication.setApplicationStatus(ApplicationStatus.APPROVED);\r\n\t\t\t\t\t\t\t\t\tUser user = userDao.findByUserId(application.getUserRefId(), false);\r\n\t\t\t\t\t\t\t\t\tMember m = null;\r\n\t\t\t\t\t\t\t\t\tif (user != null) {\r\n\t\t\t\t\t\t\t\t\t\tuser.setMemberNo(appSync.getReg_no());\r\n\t\t\t\t\t\t\t\t\t\tuserDao.deleteAllRolesForCurrentUser(user.getId());\r\n\t\t\t\t\t\t\t\t\t\tRole role = roleDao.getByName(\"MEMBER\");\r\n\t\t\t\t\t\t\t\t\t\tif (role != null) {\r\n\t\t\t\t\t\t\t\t\t\t\tuser.addRole(role);\r\n\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"Changing the user role from basic_member to member.\");\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif (user.getMember() != null) {\r\n\t\t\t\t\t\t\t\t\t\t\tm = user.getMember();\r\n\t\t\t\t\t\t\t\t\t\t\tm.setMemberNo(appSync.getReg_no());\r\n\t\t\t\t\t\t\t\t\t\t\tm.setRegistrationDate(application.getCreated());\r\n\t\t\t\t\t\t\t\t\t\t\tm.setUserRefId(user.getRefId());\r\n\t\t\t\t\t\t\t\t\t\t\tm.setMemberShipStatus(MembershipStatus.ACTIVE);\r\n\t\t\t\t\t\t\t\t\t\t\tm.setMemberQrCode(m.getRefId());\r\n\t\t\t\t\t\t\t\t\t\t\tuserDao.save(m);\r\n\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"Updating member record.\");\r\n\t\t\t\t\t\t\t\t\t\t\t// Save all this parameters\r\n\t\t\t\t\t\t\t\t\t\t\t// Applicant, Member, User\r\n\t\t\t\t\t\t\t\t\t\t\tapplicationDao.save(application);\r\n\t\t\t\t\t\t\t\t\t\t\tuserDao.save(user);\r\n\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"Updating user record.\");\r\n\t\t\t\t\t\t\t\t\t\t\tsuccessCounter = successCounter + 1;\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\tlogger.info(\"Member Record is Null for user with memberNo:\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ user.getMemberNo()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \". Checking if the member record exist or create a new record.\");\r\n\t\t\t\t\t\t\t\t\t\t\t// Check if there was a previous\r\n\t\t\t\t\t\t\t\t\t\t\t// member\r\n\t\t\t\t\t\t\t\t\t\t\t// Record created\r\n\t\t\t\t\t\t\t\t\t\t\tMember member = null;\r\n\t\t\t\t\t\t\t\t\t\t\tmember = memberDao.findByMemberNo(appSync.getReg_no());\r\n\t\t\t\t\t\t\t\t\t\t\tif (member == null) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tmember = new Member();\r\n\t\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"Member doesn't exist. Creating new MemberRecord\");\r\n\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\tlogger.info(\"Member already exist. Just ammending it.\");\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\tmember.setMemberNo(appSync.getReg_no());\r\n\t\t\t\t\t\t\t\t\t\t\tmember.setRegistrationDate(application.getCreated());\r\n\t\t\t\t\t\t\t\t\t\t\tmember.setUserRefId(user.getRefId());\r\n\t\t\t\t\t\t\t\t\t\t\tmember.setMemberShipStatus(MembershipStatus.ACTIVE);\r\n\t\t\t\t\t\t\t\t\t\t\tmember.setMemberQrCode(member.getRefId());\r\n\t\t\t\t\t\t\t\t\t\t\tuserDao.save(member);\r\n\t\t\t\t\t\t\t\t\t\t\tuser.setMember(member);\r\n\t\t\t\t\t\t\t\t\t\t\t// Save all this parameters\r\n\t\t\t\t\t\t\t\t\t\t\t// Applicant, Member, User\r\n\t\t\t\t\t\t\t\t\t\t\tapplicationDao.save(application);\r\n\t\t\t\t\t\t\t\t\t\t\tuserDao.save(user);\r\n\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"Updating user record.\");\r\n\t\t\t\t\t\t\t\t\t\t\tsuccessCounter = successCounter + 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}\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\r\n\t\t\t\t\tSystem.err.println(\"Total To Be Synced:\" + totalToBeSynced + \"\\n\");\r\n\t\t\t\t\tSystem.err.println(\"Total Success:\" + successCounter + \"\\n\");\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (URISyntaxException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (JSONException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n\tpublic boolean isApproved() {\n\t\treturn _scienceApp.isApproved();\n\t}",
"@Test\n public void canGetApprovalsWithAutoApproveTrue() {\n addApproval(marissa.getId(), \"c1\", \"uaa.user\", 6000, APPROVED);\n addApproval(marissa.getId(), \"c1\", \"uaa.admin\", 12000, DENIED);\n addApproval(marissa.getId(), \"c1\", \"openid\", 6000, APPROVED);\n\n assertEquals(3, endpoints.getApprovals(\"user_id eq \\\"\"+marissa.getId()+\"\\\"\", 1, 100).size());\n\n addApproval(marissa.getId(), \"c1\", \"read\", 12000, DENIED);\n addApproval(marissa.getId(), \"c1\", \"write\", 6000, APPROVED);\n\n assertEquals(3, endpoints.getApprovals(\"user_id eq \\\"\"+marissa.getId()+\"\\\"\", 1, 100).size());\n }",
"public void allow_Me_To_App(){\n\ttry{\n\tdriver.findElement(clickonOkButton).click();\n\tdriver.findElement(clickOn1stAllowButton).click();\n\tdriver.findElement(clickon2ndAllowButton).click();\n\tdriver.findElement(clickon3rdAllowButton).click();\n\tReusableMethod.waitForPageToLoad(MobileBy.AndroidUIAutomator(\"text(\\\"Let me explore\\\")\"));\n\tdriver.findElement(clickOnLetmeExploreButton).click();\n\tdriver.findElement(clickonOkbutton).click();\n\tlogger.info(\"=====================App Launch sucessfully=====================\");\n\tReusableMethod.implicitWait(10);\n\t\n\t}catch(Exception e){\n\tlogger.error(\"Element Not found Exception ...\",e);\n\t}\n\t\t}",
"public boolean is_appiered(String a){\n return this.appariement.equals(a);\n }",
"public boolean approvePotentialDeliveryMan(final Parcel parcel, final String email);",
"@RequestMapping(value = \"/approveDenyAppointment\", method = RequestMethod.GET)\n public String approveDenyAppointment()\n {\n return \"approveDenyAppointment\";\n }",
"@Override\r\n\t\t\tpublic boolean isApplicationToBePerformed(Expression lambdaExpression, RewritingProcess process) {\n\t\t\t\treturn true;\r\n\t\t\t}",
"private String verifyPolicy(String webMethodName, String opName)\r\n\t{\r\n\t NAASIntegration naas = new NAASIntegration(Phrase.AdministrationLoggerName);\r\n\t String ret = naas.verifyPolicy(null,webMethodName, opName);\r\n\t return ret;\r\n\t}",
"protected boolean applyImpl() throws Exception\n {\n MBeanServer mbeanServer = (MBeanServer) getCorrectiveActionContext()\n .getContextObject(CorrectiveActionContextConstants.Agent_MBeanServer);\n ObjectName objectName = (ObjectName) getCorrectiveActionContext()\n .getContextObject(CorrectiveActionContextConstants.MBean_ObjectName);\n\n Object result = mbeanServer.invoke(objectName, m_methodName, m_parameters, m_signature);\n\n return matchesDesiredResult(result);\n }",
"public boolean updateAppintment(Appointment appointment) {\n\t\treturn false;\r\n\t}",
"boolean hasUserAppId();",
"boolean hasUserAppId();",
"private boolean arEngineAbilityCheck() {\n boolean isInstallArEngineApk = AREnginesApk.isAREngineApkReady(this);\n if (!isInstallArEngineApk && isRemindInstall) {\n Toast.makeText(this, \"Please agree to install.\", Toast.LENGTH_LONG).show();\n finish();\n }\n Log.d(TAG, \"Is Install AR Engine Apk: \" + isInstallArEngineApk);\n if (!isInstallArEngineApk) {\n startActivity(new Intent(this, ConnectAppMarketActivity.class));\n isRemindInstall = true;\n }\n return AREnginesApk.isAREngineApkReady(this);\n }",
"@Override\n\tpublic boolean approveIt() {\n\t\treturn false;\n\t}",
"boolean hasRemarketingAction();",
"@Override\n\t\tprotected Version doInBackground(Void... params) {\n\t\t\treturn new UpdateApk(getApplicationContext()).hasNewVersion();\n\t\t}",
"public boolean updateAppointment(Appointment app);",
"@Override\n public void onClick(View view) {\n List<AndroidAppProcess> runningAppProcessInfo = AndroidProcesses.getRunningAppProcesses();\n\n for (int i = 0; i < runningAppProcessInfo.size(); i++) {\n Log.i(\"MainActivity\", runningAppProcessInfo.get(i).getPackageName());\n // Check for AnkuLua\n if(runningAppProcessInfo.get(i).getPackageName().equals(\"com.appautomatic.ankulua.pro2\") ||\n runningAppProcessInfo.get(i).getPackageName().equals(\"com.appautomatic.ankulua.pro\") ||\n runningAppProcessInfo.get(i).getPackageName().equals(\"com.appautomatic.ankulua.trial\")){\n\n // AnkuLua package process has been detected! Perma ban account for abusing Terms & Conditions\n alert();\n return;\n }\n }\n Toast.makeText(MainActivity.this,\"Not Found\",Toast.LENGTH_SHORT).show();\n }",
"public abstract boolean isAppropriateRequest(Request request);",
"public List<String> getEligibleForAutoApproval(Date todayAtMidnight);",
"@Override\n public boolean isLockTaskPermitted(String pkg) {\n if (listPolicyExemptAppsUnchecked().contains(pkg)) {\n if (VERBOSE_LOG) {\n Slogf.v(LOG_TAG, \"isLockTaskPermitted(%s): returning true for policy-exempt app\",\n pkg);\n }\n return true;\n }\n\n final int userId = mInjector.userHandleGetCallingUserId();\n synchronized (getLockObject()) {\n return getUserData(userId).mLockTaskPackages.contains(pkg);\n }\n }",
"public void checkIfProgramsAccesible(List<String> programList);",
"private final boolean m878a() {\n try {\n ApplicationInfo applicationInfo = this.f1350b.getPackageManager().getApplicationInfo(this.f1350b.getPackageName(), 128);\n return (applicationInfo == null || applicationInfo.metaData == null || !Boolean.TRUE.equals(applicationInfo.metaData.get(\"com.android.vending.splits.required\"))) ? false : true;\n } catch (PackageManager.NameNotFoundException e) {\n f1349a.mo44091d(\"App '%s' is not found in the PackageManager\", this.f1350b.getPackageName());\n return false;\n }\n }",
"private boolean setAllPolicy(String webMethodName, String opName, String toPermit) \r\n\t{\r\n\t NAASIntegration naas = new NAASIntegration(Phrase.AdministrationLoggerName);\r\n\t boolean ret = true;\r\n\t if(toPermit.equalsIgnoreCase(\"Y\")){\r\n\t \tret = naas.setAllPolicy(webMethodName, opName, NAASRequestor.ACTION_DENY);\r\n\t }else{\r\n\t \tString isExit = verifyPolicy(webMethodName, opName);\r\n\t \tif(isExit!= null && isExit.equalsIgnoreCase(\"deny\")){\r\n\t\t \tret = naas.setAllPolicy(webMethodName, opName, \"\");\t \t\t \t\t\r\n\t \t}\r\n\t }\r\n\t return ret;\r\n\t}",
"public boolean checkCurrentCampaianStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountCampaianStatus = myAccount.findElement(By.className(\"adminTable3\"));\n\t\tString elementPageSource = myAccountCampaianStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" compaign is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" compaign is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" compaign is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" compaign is enabled Which is a deactivatd app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"public void processAppointmentRequest(int appointmentId)\n {\n AppointmentListSingleton appointments = AppointmentListSingleton.getInstance();\n appointments.approveRequest(appointmentId);\n }",
"private boolean scanInstallApk(String packageName, String apkFile, int userId) {\n if (!checkScanInstallCaller()) {\n Slog.w(TAG, \"Scan install ,check caller failed!\");\n return false;\n } else if (apkFile == null || (isPreRemovableApp(apkFile) ^ 1) != 0) {\n Slog.d(TAG, \"Illegal install apk file:\" + apkFile);\n return false;\n } else {\n String pkgName = packageName;\n if (TextUtils.isEmpty(packageName)) {\n Package pkg = null;\n try {\n pkg = new PackageParser().parsePackage(new File(apkFile), 0, true, 0);\n } catch (PackageParserException e) {\n Slog.w(TAG, \"Scan install ,parse \" + apkFile + \" to get package name failed!\" + e.getMessage());\n }\n if (pkg == null) {\n Slog.w(TAG, \"Scan install ,get package name failed, pkg is null!\");\n return false;\n }\n pkgName = pkg.packageName;\n }\n synchronized (this.mScanInstallApkList) {\n if (assertScanInstallApkLocked(pkgName, apkFile, userId)) {\n this.mScanInstallApkList.add(apkFile);\n Slog.i(TAG, \"Scan install , add to list:\" + apkFile);\n } else {\n return false;\n }\n }\n }\n ArrayList arrayList = this.mScanInstallApkList;\n synchronized (arrayList) {\n if (this.mScanInstallApkList.remove(apkFile)) {\n Slog.i(TAG, \"Scan install , remove from list:\" + apkFile);\n }\n return success;\n }\n }",
"boolean approveDeny(String choice, int id, int resolverId);",
"public GroupPendingPermissionResults invoke()\n\t\t{\n\t\t\tfor (final Iterator<B2BCustomerModel> outerInter = pendingPermissions.keySet().iterator(); outerInter.hasNext();)\n\t\t\t{\n\t\t\t\tfinal B2BCustomerModel empl = outerInter.next();\n\t\t\t\tapproverPermissions = new HashSet<B2BPermissionResultModel>(pendingPermissions.get(empl));\n\t\t\t\tfor (final Iterator<B2BCustomerModel> innerInter = pendingPermissions.keySet().iterator(); innerInter.hasNext();)\n\t\t\t\t{\n\t\t\t\t\tfinal B2BCustomerModel innerEmpl = innerInter.next();\n\t\t\t\t\tif (empl.equals(innerEmpl))\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tapproverPermissions.addAll(pendingPermissions.get(innerEmpl));\n\t\t\t\t\t\tif (getPermissionResultHelper().extractPermissionTypes(approverPermissions)\n\t\t\t\t\t\t\t\t.containsAll(permissionsThatNeedApproval)) // NOSONAR\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmyResult = true;\n\t\t\t\t\t\t\treturn this;\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\tmyResult = false;\n\t\t\treturn this;\n\t\t}",
"private boolean isApproved() {\r\n if (rnd.nextInt(10) < 5) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n }",
"public boolean approveCheckIn(SoftwareEngineer e){\n int i;\n\n for(i=0;i<this.curHeadCount;i++){\n if(employee[i].equals(e)) break;\n }\n\n return (i<this.curHeadCount && e.access);\n }",
"public boolean isASAP()\n {\n return equiv(ASAP);\n }",
"public boolean runApplication(String applicationName) throws LedgerException { \n ApduExchange.ApduResponse response = ApduExchange.exchangeApdu(device, CLA_BOLOS, INS_RUN_APP, 0, 0, \n SerializeHelper.stringToByteArray(applicationName));\n return (response.getSW() == SW.SW_OK);\n }",
"public void compare(Application app, String userDecision){\n int intDecision = -1;\n String decision = userDecision.toLowerCase();\n\n if (decision.contains(\"harvard\")){ // decision making will be replaced by BUTTONS in processing\n intDecision = 1;\n }\n if (decision.contains(\"greendale\")){\n intDecision = 0;\n }\n if (decision.contains(\"mit\")){\n intDecision = 2;\n }\n\n //catches bad user input in which they try to submit multiple colleges to cheat the system... nice try.\n if ((decision.contains(\"harvard\") && decision.contains(\"mit\")) ||\n (decision.contains(\"harvard\") && decision.contains(\"greendale\")) ||\n (decision.contains(\"mit\") && decision.contains(\"greendale\")))\n {\n intDecision = -1;\n }\n\n if (intDecision == -1){ // catches bad user input, technically unnecessary but i like dissing people\n System.out.println(\"How can you call yourself an admissions officer when you can't even choose correctly?\");\n errorMade(); // runs failure\n }else if (intDecision == app.getCollege()){\n System.out.println(printAcceptance(intDecision));\n }\n else{\n errorMade();\n }\n }",
"@Override\n\tpublic Boolean approveRejectLista(int statoApprovazione, String nomeLista) {\n\t\t\n\t\tLista listaElettorale = listaElettoraleDaNome(nomeLista);\n\t\t\n\t\tlistaElettorale.setStatoApprovazione(statoApprovazione);\n\t\t\n\t\t//modifica la lista elettorale dato lo stato di approvazione\n\t\tmodificaListaElettorale(listaElettorale);\n\n\t\treturn true;\n\t}",
"public boolean checkAccountAction(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue = false;\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement Tab = myAccount.findElement(By.className(\"adminTable5\"));\n\t\tString elementPageSource = Tab.getAttribute(\"outerHTML\");\n\t\tif (elementPageSource.contains(\"deactivate.png\")) {\n\t\t\tLog.info(myAppName + \" account is activated\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(myAppName + \" account is deactivated\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"private boolean canExecuteTask( String userId, ProposalDevelopmentDocument doc, String taskName ) {\n\t\treturn canExecuteProposalTask( userId, doc, taskName );\n\t}",
"private boolean checkPackageExist(Context context, String pkg) {\n final PackageManager packageManager = context.getPackageManager();\n try {\n ApplicationInfo applicationInfo = packageManager.getApplicationInfo(pkg, 0);\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n }",
"public boolean approveCheckIn(SoftwareEngineer e) {\n for(SoftwareEngineer se : this.directReports) {\n if(se.getEmployeeID() == e.getEmployeeID() && e.codeAccess) {\n // found!\n return true;\n }\n }\n return false;\n }",
"public boolean isMethodExists(String className, String compairMethod) {\n boolean isExists = false;\n try {\n Class<?> telephonyClass = Class.forName(className);\n Class<?>[] parameter = new Class[1];\n parameter[0] = int.class;\n StringBuffer sbf = new StringBuffer();\n Method[] methodList = telephonyClass.getDeclaredMethods();\n for (int index = methodList.length - 1; index >= 0; index--) {\n sbf.append(\"\\n\\n\" + methodList[index].getName());\n if (methodList[index].getReturnType().equals(String.class)) {\n String methodName = methodList[index].getName();\n if (methodName.contains(compairMethod)) {\n Class<?>[] param = methodList[index]\n .getParameterTypes();\n if (param.length > 0) {\n if (param[0].equals(int.class)) {\n try {\n simVariant = methodName.substring(compairMethod.length(), methodName.length());\n telephonyClassName = className;\n isExists = true;\n break;\n } catch (Exception e) {\n LOGE(TAG, \"[isMethodExists] Unable to get check method\", e);\n }\n } else {\n telephonyClassName = className;\n isExists = true;\n }\n }\n }\n }\n }\n } catch (Exception e) {\n LOGE(TAG, \"[isMethodExists] Unable to get check method\", e);\n }\n return isExists;\n }",
"public static boolean matchTargetAPI(IMethod m){\r\n for(ExpensiveAPI api : Resource.targetAPIs){\r\n if(api.signature.equals(m.getName().toString()) && m.getSignature().contains(api.clsName)){\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"public interface AppManager {\n public AppInfoDTO getAppInfoByDomain(String domainName) throws ServiceException;\n\n public AppInfoDTO getAppInfoByType(String bizCode, AppTypeEnum appTypeEnum) throws ServiceException;\n\n public String getAppDomain(String bizCode, AppTypeEnum appTypeEnum) throws ServiceException;\n\n public BizInfoDTO getBizInfo(String bizCode) throws ServiceException;\n\n public BizInfoDTO getBizInfoByppKey(String appKey) throws ServiceException;\n\n void addAppProperty(AppPropertyDTO appPropertyDTO) throws ServiceException;\n\n void addBizProperty(BizPropertyDTO bizPropertyDTO) throws ServiceException;\n\n public Boolean checkNameEN(String name) throws ServiceException;\n\n BizInfoDTO addBizInfo(BizInfoDTO bizInfoDTO) throws ServiceException;\n\n AppInfoDTO addAppInfo(AppInfoDTO appInfoDTO) throws ServiceException;\n\n void updateBizProperty(String bizCode, String pKey, String value, ValueTypeEnum valueType) throws ServiceException;\n \n String getAppKeyByBizCode(String bizCode,AppTypeEnum appTypeEnum);\n}",
"public appaporve(String id,String approve) {\n this.id = id;\n this.approve = approve;\n }",
"@Override\n\t\tprotected void onPostExecute(String result) {\n\t\t\tsuper.onPostExecute(result);\n\t\t\t\n\t\t\tif(response2.contains(\"success\"))\n\t\t\t{\n\t\t\t\tapr_parsingmethod();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tToast.makeText(getApplicationContext(), \"No users approved yet.\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t}",
"protected boolean isApplicable(SPRequest req) {\n\n Log.debug(\"isApplicable ? \" + req.getPath() + \" vs \" + getRoute());\n\n if (!req.getMethod().equals(getHttpMethod()))\n return false;\n\n String[] uri = req.getSplitUri();\n String[] tok = splitPath;\n if (uri.length != tok.length && splatIndex == -1)\n return false;\n\n if (uri.length <= splatIndex)\n return false;\n\n for (int i = 0; i < tok.length; i++) {\n if (tok[i].charAt(0) != ':' && tok[i].charAt(0) != '*' && !tok[i].equals(uri[i]))\n return false;\n }\n\n return true;\n }",
"protected Set<B2BPermissionResultModel> checkPermissionsOfApprovers(final AbstractOrderModel order,\n\t\t\tfinal List<Class<? extends B2BPermissionModel>> permissionsThatNeedApproval, final List<B2BCustomerModel> allApprovers,\n\t\t\tfinal Boolean fastReturn) // NOSONAR\n\t{\n\t\tfinal Map<B2BCustomerModel, Collection<B2BPermissionResultModel>> pendingPermissions = new HashMap<B2BCustomerModel, Collection<B2BPermissionResultModel>>();\n\t\tfinal Set<B2BPermissionResultModel> permissionResultModels = new HashSet<B2BPermissionResultModel>();\n\n\t\tif (CollectionUtils.isNotEmpty(allApprovers))\n\t\t{\n\t\t\tfor (final B2BCustomerModel approver : allApprovers)\n\t\t\t{\n\t\t\t\tif (LOG.isDebugEnabled())\n\t\t\t\t{\n\t\t\t\t\tLOG.debug(String.format(\"Evaluating permissions %s for user %s\",\n\t\t\t\t\t\t\tArrays.toString(permissionsThatNeedApproval.toArray()), approver.getUid()));\n\t\t\t\t}\n\t\t\t\tfinal Set<B2BPermissionResultModel> permissionsOfApprover = this.evaluatePermissions(order, approver,\n\t\t\t\t\t\tpermissionsThatNeedApproval);\n\n\t\t\t\t// if none of the permission results have open status the approver's permission result can be returned.\n\t\t\t\tif (!getPermissionResultHelper().hasOpenPermissionResult(permissionsOfApprover))\n\t\t\t\t{\n\t\t\t\t\tif (LOG.isDebugEnabled()) // NOSONAR\n\t\t\t\t\t{\n\t\t\t\t\t\tLOG.debug(String.format(\"%s has the correct permissions %s\", approver.getUid(), permissionsThatNeedApproval));\n\t\t\t\t\t}\n\t\t\t\t\tpermissionResultModels.addAll(permissionsOfApprover);\n\n\t\t\t\t\t// we have located an approver that can approve the order.\n\t\t\t\t\tif (BooleanUtils.isTrue(fastReturn)) // NOSONAR\n\t\t\t\t\t{\n\t\t\t\t\t\treturn permissionResultModels;\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\tif (LOG.isDebugEnabled()) // NOSONAR\n\t\t\t\t\t{\n\t\t\t\t\t\tLOG.debug(permissionResultListToString(approver, permissionsOfApprover));\n\t\t\t\t\t}\n\n\t\t\t\t\tpendingPermissions.put(approver, getPermissionResultHelper().filterResultByPermissionStatus(permissionsOfApprover,\n\t\t\t\t\t\t\tPermissionStatus.PENDING_APPROVAL));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (CollectionUtils.isNotEmpty(permissionResultModels))\n\t\t\t{\n\t\t\t\treturn permissionResultModels;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//FIXME: this may need to be refactored out... since this method is expected to return a result for approver that can approve the whole order. // NOSONAR\n\t\t\t\tfinal GroupPendingPermissionResults groupPendingPermissionResults = new GroupPendingPermissionResults(\n\t\t\t\t\t\tpermissionsThatNeedApproval, pendingPermissions).invoke();\n\t\t\t\tif (groupPendingPermissionResults.is())\n\t\t\t\t{\n\t\t\t\t\treturn groupPendingPermissionResults.getApproverPermissions();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\thandleError(order);\n\t\treturn Collections.emptySet();\n\t}",
"public boolean isUserApproval() {\n\n if (!ACTION_UserChoice.equals(getAction())) {\n return false;\n }\n\n return (getColumn() != null) && \"IsApproved\".equals(getColumn().getColumnName());\n\n }",
"abstract protected boolean checkMethod();",
"public OSPApplication getOSPApp();",
"public boolean _paymentpage_overrideurl(String _url) throws Exception{\n__c.LogImpl(\"21114113\",_url,0);\n //BA.debugLineNum = 172;BA.debugLine=\"If Url.Contains(\\\"api.com\\\") Then\";\nif (_url.contains(\"api.com\")) { \n };\n //BA.debugLineNum = 175;BA.debugLine=\"Return True\";\nif (true) return __c.True;\n //BA.debugLineNum = 176;BA.debugLine=\"End Sub\";\nreturn false;\n}",
"@Override\n\tpublic Boolean isValidApplication(ApplicationBean applicationBean) {\n\t\tPattern namePattern=Pattern.compile(\"^[A-Za-z\\\\s]{3,}$\");\n\t\tMatcher nameMatcher=namePattern.matcher(applicationBean.getName());\n\t\tPattern dobPattern=Pattern.compile(\"^[0-3]?[0-9].[0-3]?[0-9].(?:[0-9]{2})?[0-9]{2}$\");\n\t\tMatcher dobMatcher=dobPattern.matcher(applicationBean.getDateOfBirth());\n\t\tPattern goalPattern=Pattern.compile(\"^[A-Za-z\\\\s]{1,}$\");\n\t\tMatcher goalMatcher=goalPattern.matcher(applicationBean.getGoals());\n\t\tPattern marksPattern=Pattern.compile(\"^[1-9][0-9]?$|^100$\");\n\t\tMatcher marksMatcher=marksPattern.matcher(applicationBean.getMarksObtained());\n\t\tPattern scheduleIdPattern=Pattern.compile(\"^[0-9]{1,2}$\");\n\t\tMatcher scheduleIdMatcher=scheduleIdPattern.matcher(applicationBean.getScheduledProgramID());\n\t\tPattern emailPattern=Pattern.compile(\"^[A-Za-z0-9+_.-]+@(.+)$\");\n\t\tMatcher emailMatcher=emailPattern.matcher(applicationBean.getEmailID());\n\t\t\n\t\t\n\t\tif(!(nameMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nApplicant Name Should Be In Alphabets and minimum 1 characters long.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(dobMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nDate of birth should be in DD/MM/YYYY format.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(goalMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\n Goal should be alphabetical and having minimum one letter\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(marksMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nMarks should be less than 100\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(scheduleIdMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nSchedule Id should be of one or two digit\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(emailMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nEnter valid email address\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"List<String> viewPendingApprovals();",
"private boolean checkAppInstanceOwnership(){\n\n\t\ttry {\n\t\t\t\n\t\t\t\n\t \tif(getUser() != null){\n\t \t\t\n\t \t\tif(getUser().getRole().equalsIgnoreCase(UserRoles.admin.toString()))\n\t \t\t\treturn true;\n\t \t\telse{\n\t \t\t\t\n\t\t\t\t\tAppInstance app = AHEEngine.getAppInstanceEntity(Long.valueOf(appinst));\n\t \t\t\t\t\t\t\t\t\n\t \t\t\tif(app != null){\n\t \t\t\t\t\n\t \t\t\t\tif(app.getOwner().getId() == getUser().getId())\n\t \t\t\t\t\treturn true;\n\t \t\t\t\telse{\n\t \t\t\t\t\tsetStatus(Status.CLIENT_ERROR_FORBIDDEN);\n\t \t\t\t\t\treturn false;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\t\t\n\t \t\t\t\n\t \t\t}\n\t \t\t\n\t \t}\n\t\t\t\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (AHEException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tsetStatus(Status.CLIENT_ERROR_FORBIDDEN);\n \treturn false;\n }",
"private FamixMethod findInvokedMethodOnName(String fromClass, String fromMethod, String invokedClassName, String invokedMethodName) {\n \tFamixMethod result = null;\n\t\t/* Test Helper\n\t\tif (fromClass.equals(\"domain.direct.violating.AccessLocalVariable_SetArgumentValue\")){\n\t\t\tboolean breakpoint = true;\n\t\t} */\n\n \t// 1) If methodNameAsInInvocation matches with a method unique name, return that method. \n \tString searchKey = invokedClassName + \".\" + invokedMethodName;\n \tif (theModel.behaviouralEntities.containsKey(searchKey)) {\n \t\treturn (FamixMethod) theModel.behaviouralEntities.get(searchKey);\n \t}\n \t// 2) Find out if there are more methods with the same name of the invoked class. If only one method is found, then return this method. \n \tString methodName = invokedMethodName.substring(0, invokedMethodName.indexOf(\"(\")); // Methodname without signature\n \t searchKey = invokedClassName + \".\" + methodName;\n \tif (sequencesPerMethod.containsKey(searchKey)){\n \t\tArrayList<FamixMethod> methodsList = sequencesPerMethod.get(searchKey);\n \t\tif (methodsList.size() == 0) {\n \t\t\treturn result;\n \t\t} else if (methodsList.size() == 1) {\n \t\t\t// FamixMethod result1 = methodsList.get(0);\n \t\t\treturn methodsList.get(0);\n \t\t} else { // 3) if there are more methods with the same name, then compare the invocation arguments with the method parameters.\n \t\t\tString invocationSignature = invokedMethodName.substring(invokedMethodName.indexOf(\"(\"));;\n \t\t\tString contentsInvocationSignature = invocationSignature.substring(invocationSignature.indexOf(\"(\") + 1, invocationSignature.indexOf(\")\")); \n \t\t\tString[] invocationArguments = contentsInvocationSignature.split(\",\");\n \t\t\tint numberOfArguments = invocationArguments.length;\n \t\t\t// 3a) If there is only one method with the same number of parameters as invocationArguments, then return this method\n \t\t\tList<FamixMethod> matchingMethods1 = new ArrayList<FamixMethod>();\n\t \t\tfor (FamixMethod method : methodsList){\n\t \t\t\tif ((method.signature != null) && (!method.signature.equals(\"\"))) {\n\t\t \t\t\tString contentsmethodParameter = method.signature.substring(method.signature.indexOf(\"(\") + 1, method.signature.indexOf(\")\")); \n\t\t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n\t\t \t\t\tif (methodParameters.length == numberOfArguments) {\n\t\t \t\t\t\tmatchingMethods1.add(method);\n\t\t \t\t\t}\n\t \t\t\t}\n\t \t\t} \n\t \t\tif (matchingMethods1.size() == 0)\n\t \t\t\treturn result;\n\t \t\tif (matchingMethods1.size() == 1)\n\t \t\t\treturn matchingMethods1.get(0);\n \t\t\t\n \t\t\t// 3b) If there is only one method where the first parameter type == the first argument type, then return this method \n \t\t\tList<FamixMethod> matchingMethods2 = new ArrayList<FamixMethod>();\n \t\t\tif (numberOfArguments >= 1) {\n \t\t\t\t// Replace the argument string by a type, in case of an attribute\n \t\t\t\tinvocationArguments[0] = getTypeOfAttribute(fromClass, fromMethod, invocationArguments[0]);\n \t \t\tfor (FamixMethod matchingMethod1 : matchingMethods1){\n \t \t\t\tString contentsmethodParameter = matchingMethod1.signature.substring(matchingMethod1.signature.indexOf(\"(\") + 1, matchingMethod1.signature.indexOf(\")\")); \n \t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n \t \t\t\tif (methodParameters.length >= 1) {\n \t \t\t\tmethodParameters[0] = getfullPathOfDeclaredType(fromClass, methodParameters[0]);\n \t \t\t\t\tif (methodParameters[0].equals(invocationArguments[0])) {\n \t \t\t\t\t\tmatchingMethods2.add(matchingMethod1);\n \t \t\t\t\t}\n \t \t\t\t}\n \t \t\t\t\n \t \t\t} \n \t \t\tif (matchingMethods2.size() == 0)\n \t \t\t\treturn result;\n \t \t\tif (matchingMethods2.size() == 1)\n \t \t\t\treturn matchingMethods2.get(0);\n \t\t\t}\n \t\t\t// If there is only one method where the second parameter type == the first argument type, then return this method \n \t\t\tif (numberOfArguments >= 2) {\n \t\t\t\tmatchingMethods1.clear();\n \t\t\t\t// Replace the argument string by a type, in case of an attribute\n \t\t\t\tinvocationArguments[1] = getTypeOfAttribute(fromClass, fromMethod, invocationArguments[1]);\n \t \t\tfor (FamixMethod matchingMethod2 : matchingMethods2){\n \t \t\t\tString contentsmethodParameter = matchingMethod2.signature.substring(matchingMethod2.signature.indexOf(\"(\") + 1, matchingMethod2.signature.indexOf(\")\")); \n \t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n \t \t\t\tif (methodParameters.length >= 2) {\n \t \t\t\tmethodParameters[1] = getfullPathOfDeclaredType(fromClass, methodParameters[1]);\n \t \t\t\t\tif (methodParameters[1].equals(invocationArguments[1])) {\n \t \t\t\t\t\tmatchingMethods1.add(matchingMethod2);\n \t \t\t\t\t}\n \t \t\t\t}\n \t \t\t\t\n \t \t\t} \n \t \t\tif (matchingMethods1.size() == 0)\n \t \t\t\treturn result;\n \t \t\tif (matchingMethods1.size() == 1)\n \t \t\t\treturn matchingMethods1.get(0);\n \t\t\t}\n \t\t}\n\t\t}\n \treturn result; \n }",
"boolean hasRoutingAppID();",
"public interface Appstore {\n\n /**\n * If Appstore cannot determine version of published app on it's server\n */\n public static final int PACKAGE_VERSION_UNDEFINED = -1;\n\n /**\n * Returns true only if actual installer for specified app\n */\n boolean isPackageInstaller(String packageName);\n \n /**\n * Tells whether in-app billing is ready to work with specified app\n * For OpenStore app: if any in-app item for this app published in store\n */\n boolean isBillingAvailable(String packageName);\n\n /**\n * Returns <code>android:versionCode</code> package. If there are several builds for one package\n * versionCode of the most approptiate to be used \n */\n int getPackageVersion(String packageName);\n \n String getAppstoreName();\n\n Intent getProductPageIntent(String packageName);\n\n Intent getRateItPageIntent(String packageName);\n\n Intent getSameDeveloperPageIntent(String packageName);\n\n boolean areOutsideLinksAllowed();\n\n /**\n * @return helper to interact with store billing service and perform purchases\n */\n AppstoreInAppBillingService getInAppBillingService();\n\n\n}",
"@Test\n public void creditApproved() throws Exception {\n Application app = new Application();\n app.setName(\"phil garfield\");\n app.setCreditScore(600);\n Offer offer = new Offer();\n offer.setApplication(app);\n\n Application result = service.operation(\"checkCredit\").sendInOut(offer).getContent(Application.class);\n\n // validate the results\n Assert.assertTrue(result.isApproved());\n }",
"public boolean check(String... activator){\n for (int i = 0; i < activator.length; i++) {\n for (int j = 0; j < this.activations.length; j++) {\n if(activator[i].equalsIgnoreCase(activations[j])){\n onClick();\n return true;\n }\n }\n }\n return false;\n }",
"protected boolean isActive(String appName) {\n return appFile(appName, \"active\").exists();\n }",
"@ReactMethod\n public void AlertIfWhitelist(String title, String message, String dontShowAgainText, String positiveText, String negativeText) {\n final SharedPreferences settings = this.getCurrentActivity().getSharedPreferences(\"Whitelist\",Context.MODE_PRIVATE);\n final String saveIfSkip = \"skipWhitelistMessage\";\n boolean skipMessage = settings.getBoolean(saveIfSkip, false);\n // Show dialog only when \"do not show again\" hasn't been enabled yet\n if (!skipMessage) {\n final SharedPreferences.Editor editor = settings.edit();\n // Check if intent of the android whitelist apps activity is callable\n for (Intent intent : AUTO_START_INTENTS){\n if (isCallable(intent)) {\n // Prepare dialog\n final AppCompatCheckBox dontShowAgain = new AppCompatCheckBox(this.getCurrentActivity());\n dontShowAgain.setText(dontShowAgainText);\n dontShowAgain.setLeft(20);\n dontShowAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n editor.putBoolean(saveIfSkip, isChecked);\n editor.apply();\n }\n });\n\n final RelativeLayout layout = new RelativeLayout(this.getCurrentActivity());\n layout.setPadding(50,50,0,0);\n layout.addView(dontShowAgain);\n\n new AlertDialog.Builder(this.getCurrentActivity())\n .setTitle(title)\n .setMessage(message)\n .setView(layout)\n .setPositiveButton(positiveText, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n try {\n for (Intent intent : AUTO_START_INTENTS)\n if (isCallable(intent)) {\n editor.putBoolean(saveIfSkip, true);\n editor.apply();\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);\n reactContext.startActivity(intent);\n break;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n })\n .setNegativeButton(negativeText, null)\n .show();\n break;\n }\n }\n }\n }",
"public boolean checkSearchForServiceRequestsForContractsTable(String sMethod) throws ParseException\n\t{\n\t\t// Checking if the table is present or not and validating if it is already openened \n\t\tif(utils.isProxyWebelement(this.tableMbrCompositesearchforServiceRequestContracts))\n\t\t{\n\t\t\tutils.clickAnelemnt(this.lnkMbrCompositeIntSearchForServiceRequest,\"Member Composite \",\" Search for Service Request for Contract\");\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"Open Service Request link is already clicked\\n\\n\");\n\t\t}\n\t\t//Checking if dates are equal \n\n\t\t// array list top storwe all the values and the dates in the Table \n\t\tArrayList<String> Dates = new ArrayList<String>();\n\t\t// wil save the values in an array list \n\t\tDates=utils.getcolumnStringFromTableByName(this.tableMbrCompositesearchforServiceRequestContracts, \"Open Date\");\n\t\tint i=2;\n\t\tSystem.out.println(Dates.size());\n\t\tif(Dates.size()>7)\n\t\t{\n\t\t\tSystem.out.println(\"There are more than 5 rows in Open Service request Table.\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// Iterating the dates from the stored values \n\t\tfor(String iterator:Dates)\t\n\t\t{\n\n\t\t\tDateFormat formatter ; \n\t\t\tDate date1,date2;\n\t\t\tDate date3 = null;\n\t\t\tString date_1=Dates.get(i);\n\t\t\tif(i+1==Dates.size())\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tString date_2=Dates.get(i+1);\n\t\t\tformatter = new SimpleDateFormat(\"MMMM dd,yyyy\");\n\n\t\t\tdate1=formatter.parse(date_1);\n\t\t\tdate2=formatter.parse(date_2);\n\t\t\tif(date1.equals(date2))\n\t\t\t{\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(sMethod==\"Last 7 Days\"||sMethod==\"Last 30 Days\"||sMethod==\"Last 90 Days\")\n\t\t\t\tif(date1.after(date2))\n\t\t\t\t{\n\t\t\t\t\ti++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tSystem.out.println(\"THE DATES ARE NOT IN DESCENDING ORDER\");\n\t\t\treturn false;\n\t\t}\n\n\t\tblogger.logMessage(\"Member Composite \", \" Open service request validation \");\n\t\treturn true;\n\t}",
"public void autoApprove(int reimburseID, String autoReason, int status);",
"public Action<PaymentState, PaymentEvent> getOverrideCode(){\n\n return ctx -> {\n log.info(\"<<< Override Code service has been called >>>\");\n if(new Random().nextInt(10) < 8){\n log.info(\"Override auth request Approved\");\n log.info(\"<<< Setting event to BAL_OK which should move the state to MAKE_PAYMENT>>>\");\n ctx.getStateMachine().sendEvent(MessageBuilder.withPayload(PaymentEvent.OVERDRAFT_OK).setHeader(PaymentServiceImpl.PAYMENT_ID_HEADER, ctx.getMessageHeader(PaymentServiceImpl.PAYMENT_ID_HEADER)).build());\n } else {\n log.info(\"Override auth request Rejected\");\n log.info(\"<<< Setting event to BAL_KO which should move the state to DENY_PAYMENT>>>\");\n ctx.getStateMachine().sendEvent(MessageBuilder.withPayload(PaymentEvent.OVERDRAFT_KO).setHeader(PaymentServiceImpl.PAYMENT_ID_HEADER, ctx.getMessageHeader(PaymentServiceImpl.PAYMENT_ID_HEADER)).build());\n }\n\n };\n }",
"@Override\n\tpublic boolean isApproved() {\n\t\treturn model.isApproved();\n\t}",
"@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkAp() {\n\t\tboolean flag = oTest.checkAp();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}",
"public boolean requiresPostApproval() {\n return true;\n }",
"boolean transactTo_hasHwPolicy(int code, String transactName, int userId) {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n boolean bDisabled = false;\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \" to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n bDisabled = _reply.readInt() == 1;\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n return bDisabled;\n }",
"boolean hasRecommendation();",
"public static boolean backToApp(String paramString1, String paramString2, boolean paramBoolean) {\n }",
"public boolean getInformPolicy(String appName, String apiName, Object... parameterType) {\n\n int level = defaultInformLevel;\n\n /** global rules */\n\n if (currentPolicy.containsKey(\"* \" + apiName)) {\n level = currentPolicy.get(\"* \" + apiName).informLevel;\n }\n\n /** specific rules overwrites global ones */\n\n if (currentPolicy.containsKey(appName + \" \" + apiName)) {\n level = currentPolicy.get(appName + \" \" + apiName).informLevel;\n }\n\n /** if no rules are defined, adopt default ones */\n\n if (level >= currentInformLevel) return true;\n else return false;\n }",
"boolean hasIntent();",
"@Override\n\tpublic void applyObject(AppDeploymentRequest request, String appId) {\n\t\tif (client.builds().withLabels(labels).list().getItems().stream()\n\t\t\t\t.noneMatch(build -> {\n\t\t\t\t\tString phase = build.getStatus().getPhase();\n\t\t\t\t\treturn phase.equals(\"New\") || phase.equals(\"Pending\")\n\t\t\t\t\t\t\t|| phase.equals(\"Running\") || phase.equals(\"Failed\");\n\t\t\t\t})) {\n\t\t\t//@formatter:off\n client.deploymentConfigs()\n .withName(appId)\n .edit()\n .editMetadata()\n .addToAnnotations(SPRING_DEPLOYMENT_TIMESTAMP,\n\t\t\t\t\t\t\t\tString.valueOf(System.currentTimeMillis()))\n .endMetadata()\n .done();\n //@formatter:on\n\t\t}\n\t}",
"public static String RandomSelectMethod(Random random){\n String[] methodArray = new String[] {\"isValid\",\"setDescription\"};// The list of the of methods to be tested in the Appt class\n\n int n = random.nextInt(methodArray.length);// get a random number between 0 (inclusive) and methodArray.length (exclusive)\n\n return methodArray[n] ; // return the method name \n }",
"@Override\n\tpublic boolean Authority(String verb) {\n\t\tif(list.contains(verb))\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"public boolean accepts( Application application)\n\t{\n\t\treturn false;\n\t\t//TODO implement accepts\n\t}",
"public boolean notifyXAITUpdate(OcapAppAttributes[] newApps);",
"private static boolean checkForUpdateElement(MethodDeclaration user, MethodDeclaration recursive, NodeList<Expression> userList, NodeList<Expression> recursiveList) {\n return iterativeListsFlow(userList.stream(), recursiveList.stream())\n .filter(pair -> !checkDifferentMetaModel(retrieveParseExpression(pair.getKey().toString()), retrieveParseExpression(pair.getValue().toString())))\n .anyMatch(pair -> Boolean.TRUE == !verifyCaseManagementForUpdate(user, recursive,\n retrieveParseExpression(pair.getKey().toString()), retrieveParseExpression(pair.getValue().toString())));\n }",
"public void clickbtnApprove() {\n\t\twaitForElementClickable(10,btnApprove);\n\t\tclickByJavaScript(btnApprove);\n\t\tsleep(1);\n\t}",
"boolean isApplicable( Set<String> policyIds , J2eePlatform platform , \n FileObject wsdl );",
"public String getApp();",
"public boolean isValidMethod(String className) {\n boolean isValidMail = false;\n try {\n if (isMethodExists(className, \"getDeviceId\")) {\n isValidMail = true;\n } else if (isMethodExists(className, \"getNetworkOperatorName\")) {\n isValidMail = true;\n } else if (isMethodExists(className, \"getSimOperatorName\")) {\n isValidMail = true;\n }\n } catch (Exception e) {\n LOGE(TAG, \"[fetchClassInfo] Unable to validate method\", e);\n }\n return isValidMail;\n }",
"public IDfId DEPRECATEDdoCheckin(boolean fRetainLock, String versionLabels, String oldCompoundArchValue, String oldSpecialAppValue, String newCompoundArchValue, String newSpecialAppValue, Object[] extendedArgs) throws DfException \r\n {\r\n ///*-INFO-*/Lg.logMethodEntry(null, versionLabels);\r\n /*-dbg-*/Lg.dbg(\"check if SU\");\r\n if (isSuperuser()) {\r\n // allowed/do nothing.\r\n /*-dbg-*/Lg.dbg(\"is SU, do not interfere\");\r\n return super.doCheckin(fRetainLock, versionLabels, oldCompoundArchValue, oldSpecialAppValue, newCompoundArchValue, newSpecialAppValue, extendedArgs);\r\n } else {\r\n /*-dbg-*/Lg.dbg(\"version labels: %s\",versionLabels); \r\n // get acceptable checkin modes\r\n /*-dbg-*/Lg.dbg(\"not su, get allowable modes\");\r\n List modes = getAllowableCheckinModes();\r\n if(modes != null) {\r\n if (versionLabels == null || \"\".equals(versionLabels.trim())) {\r\n /*-dbg-*/Lg.dbg(\"controlled checkin modes, labels must be defined...\");\r\n throw EEx.create(\"QADocTBO-Checkin-nolabels\",\"Invalid Checkin - controlled checkin could not determine checkin type\");\r\n }\r\n /*-dbg-*/Lg.dbg(\"modes defined, scanning\");\r\n for (int i=0; i < modes.size(); i++)\r\n {\r\n if (versionLabels.contains((String)modes.get(i))) {\r\n /*-dbg-*/Lg.dbg(\"versionlabels %s matched mode %s\",versionLabels,modes.get(i));\r\n return super.doCheckin(fRetainLock, versionLabels, oldCompoundArchValue, oldSpecialAppValue, newCompoundArchValue, newSpecialAppValue, extendedArgs); \r\n }\r\n }\r\n // we've gotten here, which isn't good, no mode match. Throw Exception!\r\n /*-dbg-*/Lg.dbg(\"controlled checkin mode not matched with versionlabels\");\r\n throw EEx.create(\"QADocTBO-Checkin-nolabels\",\"Invalid Checkin - controlled checkin could not determine checkin type\");\r\n } else {\r\n /*-dbg-*/Lg.dbg(\"no acceptable modes defined, proceed without interference\");\r\n return super.doCheckin(fRetainLock, versionLabels, oldCompoundArchValue, oldSpecialAppValue, newCompoundArchValue, newSpecialAppValue, extendedArgs);\r\n }\r\n }\r\n }",
"private boolean sendUpdatedConfigsIfPossible(Long appId, Map<String, String> configItems, HttpServletResponse resp) {\n\n Response<Set<String>> findResp = localService.checkUpdatedConfigs(appId, configItems);\n if (!findResp.isSuccess()){\n Logs.error(\"failed to check updated configs: {}\", findResp.getErr());\n return false;\n }\n\n // send updated config item names\n return sendUpdatedConfigs(resp, findResp.getData());\n }"
] | [
"0.6133121",
"0.58637744",
"0.58049905",
"0.56893873",
"0.56893873",
"0.56245726",
"0.5618126",
"0.5589072",
"0.55814934",
"0.5566246",
"0.5521872",
"0.5511616",
"0.5405678",
"0.53924537",
"0.53801525",
"0.5373889",
"0.53638655",
"0.5342499",
"0.53038114",
"0.528616",
"0.5264079",
"0.526364",
"0.5172723",
"0.51635116",
"0.51410997",
"0.50764465",
"0.5058561",
"0.50335187",
"0.50335187",
"0.50196207",
"0.5017095",
"0.50090045",
"0.50087816",
"0.5007355",
"0.49955952",
"0.49637067",
"0.4938915",
"0.49314278",
"0.49190992",
"0.49062532",
"0.49026594",
"0.4900064",
"0.48943418",
"0.48770475",
"0.48593098",
"0.48525527",
"0.48382396",
"0.48266178",
"0.48233855",
"0.48153105",
"0.48121452",
"0.48114192",
"0.48002976",
"0.4796231",
"0.47936887",
"0.47915116",
"0.47859594",
"0.47847363",
"0.4780375",
"0.47784272",
"0.47776282",
"0.47726652",
"0.4769312",
"0.4769216",
"0.47640175",
"0.4761138",
"0.47590128",
"0.4735575",
"0.47345605",
"0.47280207",
"0.4727249",
"0.4724957",
"0.4722457",
"0.47212613",
"0.47145128",
"0.47089913",
"0.47024965",
"0.46971083",
"0.46893862",
"0.4688016",
"0.468801",
"0.46850967",
"0.46849012",
"0.46757558",
"0.46712592",
"0.46710154",
"0.46700394",
"0.4667905",
"0.46635222",
"0.4659469",
"0.46533546",
"0.4650117",
"0.46497992",
"0.46350914",
"0.46312997",
"0.46276486",
"0.46269292",
"0.46251225",
"0.46232378",
"0.46221575"
] | 0.69104844 | 0 |
/ INFO: This method search for desired app in tobeapprove list INPUT: String containing desired App name RETURN: WebElement ( will contain 'null' if not found ) | public WebElement getAppFromList(String myAppName) {
WebElement myElement = null;
for (WebElement element : allApps) {
if (element.getText().contains(myAppName)) {
Log.info("App Found");
return element;
}
}
return myElement;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public WebElement getAccontDetails(String myAppName) {\n\t\tLog.info(\"Searching for account details for App: \" + myAppName);\n\t\taccountTab.click();\n\t\tWebElement element = null;\n\t\ttry {\n\t\t\tThread.sleep(2000);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfor (WebElement myelement : allAccounts) {\n\t\t\tif (myelement.getText().contains(myAppName)) {\n\t\t\t\tLog.info(\"Account details for App\" + myAppName + \"found\");\n\t\t\t\treturn myelement;\n\t\t\t}\n\t\t}\n\t\tLog.info(\"failed to get account details for App\" + myAppName);\n\t\treturn element;\n\t}",
"@Override\n\t\t\tpublic WebElement apply(WebDriver t) {\n\t\t\t\treturn t.findElement(By.xpath(\"//h3[contains(text(),'Oracle Cloud Applications')]//following::a[1]\"));\n\t\t\t}",
"private WebApp findWebAppForDep(final App.Dependency dep, final Set<WebApp> webApps) {\n\t\tfor (final WebApp webApp : webApps) {\n\t\t\tif (webApp.getFullName().equalsIgnoreCase(dep.getName())) {\n\t\t\t\treturn webApp;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"private static Elements getResultsFromAppPage(Document doc) {\n Elements results = null;\n try {\n results = doc.getElementsByClass(\"attribute-container\");\n }\n catch (NullPointerException e){\n logger.info(\"no applications tab for current item\");\n return results;\n }\n logger.debug(\"total results \" + results.size());\n\n return results;\n }",
"public Application findApplication(String appID) {\n\t\tfor (Application app: getApplications())\n\t\t\tif (app.getApplicationID().equalsIgnoreCase(appID))\n\t\t\t\treturn app;\n\t\treturn null; \n\t}",
"public boolean approveApp(String myAppName) {\n\t\tLog.info(\"Checking if App:\" + myAppName + \"came for approval\");\n\t\tWebElement myElement = getAppFromList(myAppName);\n\t\tif (myElement != null) {\n\t\t\tLog.info(myAppName + \"came for approval. Approving it now..\");\n\t\t\tWebElement approveButton = myElement.findElement(By.id(\"appsEditApprove\"));\n\t\t\tapproveButton.click();\n\t\t\tapp_confrim.click();\n\t\t\tif (getAccontDetails(myAppName) != null) {\n\t\t\t\tLog.info(myAppName + \"is approved now\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tLog.info(\"failed to approve\" + myAppName);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tLog.info(myAppName + \"did not showed up in approval list\");\n\t\t\treturn false;\n\t\t}\n\n\t}",
"@Step(\"Work Order ServiceActivity Search Lookup\")\n public boolean lookupWorkOrderServiceActivitySearch(String searchText) {\n boolean flag = false;\n try {\n pageActions.clickAt(assignToMeBtn, \"Clicking on Assign to me button\");\n pageActions.clickAt(itemizedCostsButton, \"Clicking on Itemized Cost Button\");\n new WebDriverWait(driver, 45)\n .until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(itemizedFrame));\n logger.info(\"Switched to ItemizedCost Frame successfully\");\n new WebDriverWait(driver, 30).until(ExpectedConditions.visibilityOf(itemizedSubmitButton));\n pageActions.selectDropDown(itemize_CostType, \"Local Job Code\");\n pageActions.clickAt(localJobCodeLookup, \"Clicking on Local Job Code Look Up Search\");\n\n SeleniumWait.hold(GlobalVariables.ShortSleep);\n functions.switchToWindow(driver, 1);\n pageActions.selectDropDown(wrkOrdLookupSearchBy, \"Short Description\");\n pageActions.typeAndPressEnterKey(wrkOrdLookupSearch, searchText,\n \"Searching in the lookUp Window\");\n pageActions.typeAndPressEnterKey(shortDescriptionSearch, searchText,\n \"Searching in the lookUp Window Grid\");\n new WebDriverWait(driver, 30).until(ExpectedConditions\n .elementToBeClickable(By.xpath(\"//td[contains(text(),'\" + searchText + \"')]\")));\n flag =\n driver.findElement(By.xpath(\"//td[contains(text(),'\" + searchText + \"')]\")).isDisplayed();\n } catch (Exception e) {\n e.printStackTrace();\n System.out.println(e.getMessage());\n }\n finally {\n functions.switchToWindow(driver, 0);\n }\n return flag;\n }",
"public static void main(String[] args) {\n\n WebDriver driver= WebDriverFactory.getDriver(\"chrome\");\n\n driver.get(\"https://amazon.com\");\n driver.get(\"https://ebay.com\");\n\n WebElement searchBox=driver.findElement(By.xpath(\"//input[@type='text']\"));\n searchBox.sendKeys(\"books\");\n\n WebElement search=driver.findElement(By.xpath(\"//input[@type='submit']\"));\n search.click();\n\n String actualWord=driver.getTitle();\n\n System.out.println(\"title is: \"+ actualWord);\n\n String expectedWord=\"books\";\n\n if(actualWord.contains(expectedWord)){\n System.out.println(\"Pass\");\n }else{\n System.out.println(\"Fail\");\n System.out.println(\"actualWord = \" + actualWord);\n System.out.println(\"expectedWord = \" + expectedWord);\n }\n\n }",
"public static void main(String[] args) {\n WebDriver driver = WebDriverFactory.getDriver(\"chrome\");\n driver.get(\"https://www.amazon.com/\");\n\n WebElement searchBox = driver.findElement(By.id(\"twotabsearchtextbox\"));\n searchBox.sendKeys(\"selenium cookbook\" + Keys.ENTER);\n\n WebElement searchedItem = driver.findElement(By.xpath(\"//span[.=\\\"Selenium Testing Tools Cookbook - Second Edition\\\"]\"));\n System.out.println(searchedItem.getText());\n if(searchedItem.isDisplayed()){\n System.out.println(\"pass\");\n }else{\n System.out.println(\"fail\");\n }\n\n\n\n }",
"public void allow_Me_To_App(){\n\ttry{\n\tdriver.findElement(clickonOkButton).click();\n\tdriver.findElement(clickOn1stAllowButton).click();\n\tdriver.findElement(clickon2ndAllowButton).click();\n\tdriver.findElement(clickon3rdAllowButton).click();\n\tReusableMethod.waitForPageToLoad(MobileBy.AndroidUIAutomator(\"text(\\\"Let me explore\\\")\"));\n\tdriver.findElement(clickOnLetmeExploreButton).click();\n\tdriver.findElement(clickonOkbutton).click();\n\tlogger.info(\"=====================App Launch sucessfully=====================\");\n\tReusableMethod.implicitWait(10);\n\t\n\t}catch(Exception e){\n\tlogger.error(\"Element Not found Exception ...\",e);\n\t}\n\t\t}",
"public static void main(String[] args) \n\t{\n\t\tWebDriver driver=null;\n\t\tString url =\"http://bing.com\";\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"F:\\\\Seleniumworkspace\\\\webdriverexamples\\\\driverFiles\\\\chromedriver.exe\");\n\t\tdriver=new ChromeDriver();\n\t\n\t\tdriver.get(url);\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\t\t/*\t<input class=\"b_searchbox\" id=\"sb_form_q\" name=\"q\" title=\"Enter your search term\" type=\"search\" value=\"\" maxlength=\"1000\"\n\t\t * autocapitalize=\"off\" autocorrect=\"off\" autocomplete=\"off\" spellcheck=\"false\" aria-controls=\"sw_as\" style=\"\" aria-autocomplete=\"both\" aria-owns=\"sw_as\">\n\t\t\n\t\t\n\t\t*/\n\t\t\n\t\tdriver.findElement(By.id(\"sb_form_q\")).sendKeys(\"Selenium\");\n\t\t//xpath pf bing list //*[@id=\"sa_ul\"]\n\t\t\n\t\tString Search_List_data = driver.findElement(By.xpath(\"//*[@id=\\\"sa_ul\\\"]\")).getText();\n\t\tSystem.out.println(\"the elements related to your search are \"+Search_List_data);\n\t\t\n\t\t\tString expected = \"Livetech\";\n\t\t\tString actual = Search_List_data;\n\t\t\tif(actual.contains(expected))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Element is found\");\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\tSystem.out.println(\"Element not found\");\n\t\t}\ndriver.quit();\t\t\n\t}",
"void checkForApps();",
"public Boolean enterAndSearchProductName(String productName,int expProduct)\n\t{ Boolean status=false;\n\tString vSearchBoxValue=searchTextBox.getAttribute(\"value\");\n\tif (!vSearchBoxValue.equals(\"\"))\n\t{\n\t\tsearchTextBox.clear();\n\t}\n\tsearchTextBox.sendKeys(productName);\n\ttry {\n\t\tThread.sleep(4000);\n\t} catch (InterruptedException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\tsearchTextBox.sendKeys(Keys.ENTER);\n\tList<WebElement> getProductIdlstWebElmnts=driver.findElements(By.xpath(\"//div[@class='s-main-slot s-result-list s-search-results sg-row']//div[starts-with(@data-component-type,'s-search-result')]\"));\n\tWebDriverWait wt2= new WebDriverWait(driver,30);\n\twt2.until(ExpectedConditions.visibilityOfAllElements(getProductIdlstWebElmnts));\n\tcollectnToStorePrdktIdLst.add(getProductIdlstWebElmnts.get(expProduct).getAttribute(\"data-asin\") );\n\ttry\n\t{ if (getProductIdlstWebElmnts.get(expProduct).getAttribute(\"data-asin\")!=\"\")\n\t{List<WebElement> getProductNamelstWebelement=driver.findElements(By.xpath(\"//div[@class='s-main-slot s-result-list s-search-results sg-row']//div[starts-with(@data-component-type,'s-search-result')]//h2//a\"));\n\tString getProductNameText=getProductNamelstWebelement.get(expProduct).getText();\n\tcollectnToStorePrdktNameLst.add(getProductNameText);\t\n\tgetProductNamelstWebelement.get(expProduct).click();\n\tstatus=true;\n\t}\n\t}catch(Exception e)\n\t{\n\t\tSystem.out.println(e);\n\t}\n\treturn status;\n\t}",
"public boolean search(String prodName)\n\t{\n\t WebDriverWait wait = new WebDriverWait(driver, 20);\n wait.until(ExpectedConditions.visibilityOf(driver.findElement(searchbox))).sendKeys(prodName);\n \n //Tap on search after entering prod name\n wait.until(ExpectedConditions.visibilityOf(driver.findElement(searchBTN))).click();\n\t\n // When the page is loaded, verify whether the loaded result contains the name of product or not \n String k = driver.findElement(By.xpath(\"//*[@id=\\\"LST1\\\"]/div/div[1]/div[2]\")).getText();\n boolean p = k.contains(prodName);\n return p;\n \n\t}",
"@Override\r\npublic List<ThirdPartyAppsList> findAll()\r\n{\nArrayList<ThirdPartyAppsList> appsList = new ArrayList<>();\r\n//adding providers to the List\r\nappsList.add(new ThirdPartyAppsList(\"15645367\",\"Aetna\",\"My Data My Health\" ,\"Naveen\",\"Regidtered since: Dec-2020\"));\r\nappsList.add(new ThirdPartyAppsList(\"15645367\",\"Aetna\",\"Virtual Viewer\",\"Snow bound\",\"Regidtered since: Mar-2017\"));\r\nappsList.add(new ThirdPartyAppsList(\"15645367\",\"Aetna\",\"hapi.fhir\",\"Apache\",\"Regidtered since: June-2017\"));\r\nappsList.add(new ThirdPartyAppsList(\"15645367\",\"Aetna\",\"Dummy Heading3\",\"Dummy Owner Name\",\"Regidtered since: Aug-2016\"));\r\nappsList.add(new ThirdPartyAppsList(\"15645367\",\"Aetna\",\"Dummy Heading4\",\"Dummy Owner Name\",\"Regidtered since: Sep-2018\"));\r\nappsList.add(new ThirdPartyAppsList(\"15645367\",\"Aetna\",\"Dummy Heading5\",\"Owner Name\",\"Regidtered since: Oct-2019\"));\r\nreturn appsList;\r\n}",
"public static void appDrawerApp(AndroidDriver<WebElement> driver,String appName)\t\t\t\n\t{\t\n\n\t\tWebElement app_Drawer = driver.findElement(By.xpath(\"//android.view.ViewGroup[@index='1']/android.widget.TextView[@index='3']\"));\n\t\tapp_Drawer.click();\n\n\t\tList<WebElement> applications = driver.findElements(By.xpath(\"//android.support.v7.widget.RecyclerView/android.widget.TextView\"));\n\t\tSystem.out.println(applications.size());\n\t\tString app_Name=appName;\n\n\t\tboolean status = false;\n\n\t\tfor(int i = 0;i<applications.size();i++)\n\t\t{\t\n\t\t\tWebDriverWait wait = new WebDriverWait(driver,3);\n\t\t\tWebElement app_element = applications.get(i);\n\t\t\tString app_name=app_element.getText();\n\t\t\tSystem.out.println(app_name);\n\t\t\tif(app_name.contentEquals(app_Name))\n\t\t\t{\n\t\t\t\tapp_element.click();\n\t\t\t\twait.until\n\t\t\t\t(ExpectedConditions.visibilityOfElementLocated\n\t\t\t\t\t\t(By.xpath(\"//android.view.ViewGroup\")));\n\t\t\t\t// handling very first time\n\n\t\t\t\ttry {\n\t\t\t\t\tmy_Zodiac_PO my_Zodiac_PO=new my_Zodiac_PO(driver);\n\t\t\t\t\tif(my_Zodiac_PO.firstTimeUser().isDisplayed())\n\t\t\t\t\t{\t\n\t\t\t\t\t\tchangeVeryFirstDob(driver, \"11\", \"08\", \"1906\");\n\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t}\n\n\t\t\t\t\t/*wait.until\n\t\t\t\t\t(ExpectedConditions.elementToBeClickable\n\t\t\t\t\t\t\t(By.xpath(\"//android.view.ViewGroup[@index='0']/android.widget.TextView[@text='ALL ZODIACS']\")));*/\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tstatus = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//System.out.println(status);\n\t\t}\n\t\tif(status==false)\n\t\t{\t\n\t\t\ttouchAction = new TouchAction((PerformsTouchActions) driver);\n\t\t\tWebDriverWait wait = new WebDriverWait(driver,3);\n\t\t\t//touchAction.longPress(10,1200).moveTo(10, 10).release().perform();\n\t\t\t//this has to be generalised\n\t\t\ttouchAction.longPress(10 ,600).moveTo(10, 10).release().perform();\n\t\t\tList<WebElement> applications_1 = driver.findElements(By.xpath(\"//android.support.v7.widget.RecyclerView/android.widget.TextView\"));\n\t\t\tSystem.out.println(applications_1.size());\n\n\t\t\tfor(int i = 0;i<applications_1.size();i++)\n\t\t\t{\t\n\t\t\t\tWebElement app_element = applications_1.get(i);\n\t\t\t\tString app_name=app_element.getText();\n\t\t\t\tSystem.out.println(app_name);\n\t\t\t\tif(app_name.contentEquals(app_Name))\n\t\t\t\t{\n\t\t\t\t\tapp_element.click();\n\t\t\t\t\twait.until\n\t\t\t\t\t(ExpectedConditions.visibilityOfElementLocated\n\t\t\t\t\t\t\t(By.xpath(\"//android.view.ViewGroup\")));\n\t\t\t\t\tstatus = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(status);\n\t\t\t}\n\t\t}\t\n\t}",
"public void searchProd(){\n\t\t\n\t\t// STEP 4:-\n\t\t// Enter 'mobile' in search bar.\n\t\tWebElement search = driver.findElement(By.name(\"q\"));\n\t\tsearch.sendKeys(\"mobiles\");\n\t\tsearch.sendKeys(Keys.ENTER);\n\t\tSystem.out.println(\"Enter name successfully\");\n\t\t\t\t\t\n\t\t// Click on search icon.\n\t\t//WebElement searchClick = driver.findElement(By.className(\"L0Z3Pu\"));\n\t\t//searchClick.click();\n\t\t//System.out.println(\"clicked search button successfully\");\n\t}",
"private appR getApp() throws JAXBException, IOException {\n synchronized (application) {\r\n appR App = (appR) application.getAttribute(\"App\");\r\n if (App == null) {\r\n App = new appR();\r\n App.setFilePath(application.getRealPath(\"WEB-INF/Listings.xml\"));\r\n application.setAttribute(\"App\", App);\r\n }\r\n return App;\r\n }\r\n }",
"public static WebElement chkbx_selectUpcomingTradeShow(String value) throws Exception{\r\n \ttry{\r\n \t\tList<WebElement> allChkbx = driver.findElements(By.xpath(\"//*[@id='tradeShow_overlay']/ul/li//input\"));\r\n \t\tList<String> list = new ArrayList <String> (Arrays.asList(value.split(\", \")));\r\n \t\t\r\n \t\tfor(String check : list){\r\n \t\t\tfor(WebElement chk : allChkbx){\r\n \t\t\t\tif(chk.getAttribute(\"value\").equalsIgnoreCase(check))\r\n \t\t\t\t\tchk.click();\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\tdriver.findElement(By.xpath(\"//*[@id='tradeShow_overlay']//a[contains(text(),'Confirm')]\")).click();\r\n \t\t\r\n \t}catch(Exception e){\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }",
"@Override\n protected List<ElementSearch> fw_findElementsBy(String PropType, String PropValue)\n {\n List<ElementSearch> temp_lst = new ArrayList<>();\n if (PropValue.contains(\"|\"))\n {\n String[] valueList = PropValue.split(\"\\\\|\");\n for (String eachValue : valueList) {\n if ((eachValue != null) && (eachValue.length() > 0))\n {\n temp_lst.addAll(((WebElement)element).findElements(Utilities.getIdentifier(PropType, eachValue)).stream().map(ElementObject::new).collect(Collectors.toList()));\n }\n }\n }\n else\n {\n temp_lst.addAll(((WebElement)element).findElements(Utilities.getIdentifier(PropType, PropValue)).stream().map(ElementObject::new).collect(Collectors.toList()));\n }\n //END HERE\n return temp_lst;\n }",
"void Search_for_item(String itemname) \n\t{ \n item it=new item();\n \n for(int i=0;i<it.itemfoundWithDescription.size();i++)\n {\n if(it.itemfoundWithDescription.get(i).equals(itemname))\n \t{\n System.out.println(\"item founded\");\n\t\t\texit(0);\n \t}\n \n }\n System.out.println(\"item not founded\");\n \n\t}",
"@Test public void shouldReturnTheToolIntTheListWhenSearchedByItsName() {\n\t\tgiven.imInTheMainPage();\n\t\twhen.searchByAToolName(TOOLS.ADPWEB.toolName());\n\t\tthen.mySearchWillReturnTheTools(TOOLS.ADPWEB);\n\t}",
"public void Case2(){\n System.out.println(\"Testing Case 2\");\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchName.sendKeys(prodName);\n// driver.hideKeyboard();\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Case 2 Done\");\n// //Condition where if prod is displayed or not\n// MobileElement snackBar = (MobileElement) driver.findElementByXPath(\"//android.widget.TextView[contains(@resource-id, 'snackbar_text') and @text = 'Text Note is Required']\");\n// boolean isDisplayed1 = snackBar.isDisplayed();\n// if (isDisplayed1) {\n// System.out.println(\"Snack bar text displayed: Text Note is Required\");\n// } else if (!isDisplayed1) {\n// System.out.println(\"Failed: Snack bar text does not displayed\");\n// }\n }",
"public void checkProductflipkart(WebDriver driver){\r\n\t\t\r\n\t\tdriver.get(\"flipkart.com\");\r\n\t\tif(driver.getTitle().toString().equalsIgnoreCase(\"Flipkart\")){\r\n\t\t\t\r\n\t\t\tWebElement search=driver.findElement(By.xpath(\"xpath for search bar/element\"));\r\n\t \tsearch.sendKeys(\"iphone7\");\r\n\t \tdriver.findElement(By.id(\"searchbutton\")).click();\r\n\t \r\n\t \t// check results found or not, if found we can see text like - showing 1 of 24 results else it will\r\n\t \t// show No results found etc;\r\n\t \tWebElement resultsText=driver.findElement(By.xpath(\"xpath for below string element\"); \t\r\n\t \t\r\n\t \tif(resultsText.toString().contains(\"Showing 1 – 24 of 93 results for iphone\")){\r\n\t \t\t//print in the console\r\n\t \t\tSystem.out.println(\"results found for iphone\");\r\n\t // or use testng asssert statement to validate\r\n\t \t\t\r\n\t \t}else{\r\n\t \t\tSystem.out.println(\"No results found \");\r\n\t \t}\r\n\t \t// copy paste same logic for any other website\r\n\t // using webtable to read the iphone price, write separately for filpkart and snapdeal\r\n\t \t//used later\r\n\t \tList<String> savepricelist= new ArrayList<String>();\r\n\t // target table\t\r\n\t \tWebElement table=driver.findElement(\"//*td[@id='iphone']/tbody\");\r\n\t \t//find no of rows\r\n\t \tList<WebElement>rows=table.findElements(By.tagName(\"tr\"));\r\n\t \t// iterate no.of rows\r\n\t \tfor (WebElement eachrow: rows){\r\n\t \t// find out how many cols available in the table\r\n\t \t\tList<WebElement>cols=eachrow.findElements(By.tagName(\"td\"));\r\n\t \t\t// iterate each col in each row\r\n\t \t\tfor (WebElement eachcell: cols){\r\n\t \t\t\t\r\n\t \t\t\t if(eachcell.getText().contains(\"iphone7\".trim()){\r\n\t \t\t\t\t// just tell them \r\n\t \t\t\t\tWebElement modelname=//xpath for modelname\r\n\t \t\t\t WebElement linktoproduct=//write xpath for share button link\r\n\t \t\t\t\t \t\t\t \r\n\t \t\t\t WebElement price=driver.findElement(\"price xpath\");\r\n\t \t\t\t savepricelist.add(price.getText().toString());\r\n\t \t\t\t // adding all elements into array list\r\n\t \t\t\t break;\r\n\t \t\t\t}\r\n\t \t\t}\r\n\t \t\t// by default sorts in asending order\r\n\t \t\tCollections.sort(savepricelist);\r\n\t \t\tSystem.out.println(savepricelit);\r\n\t \t\t// it prints the elements in ascending order \r\n\t // similarly we can write for 2nd site & print in ascending order\r\n\t \t\t\r\n\t \t\t\r\n\t \t}\r\n\t \t\r\n\t\t}\r\n\t\t\r\n\t}",
"T get(String installedAppId);",
"public boolean checkAppApproveStatus(String myAppName) {\n\t\tSystem.out.println(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='approve_notify']//span]\"));\n\t\tSystem.out.println(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Approve\") && myAccountField.getText().contains(strDate)) {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is approved\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is pending\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public OSPApplication getOSPApp();",
"public static void main(String[] args) throws InterruptedException {\n //1- Open a chrome browser\n WebDriver driver=WebDriverUtil.getDriver(\"chrome\");\n\n //2- Go to: https://google.com\n driver.get(\"https://www.google.com\");\n //3- Write \"apple\" in search box\n //driver.findElement(By.name(\"q\")).sendKeys(\"Apple\"); works\n\n //driver.findElement(By.className(\"gLFyf gsfi\")).sendKeys(\"Apple\");\n //having spaces in classname will make your code fail\n //you can remove one part see if it is unique you can locate\n driver.findElement(By.className(\"gLFyf\")).sendKeys(\"Apple\");\n Thread.sleep(1000);\n\n //click i am feeling lucky button\n driver.findElement(By.className(\"RNmpXc\")).click();\n\n //Verify title contains Apple\n\n String actualTitle=driver.getTitle();\n String expectedTitle=\"Apple\";\n\n if (actualTitle.contains(expectedTitle)){\n System.out.println(\"lucky button passed\");\n }else{\n System.out.println(\"lucky button failed\");\n System.out.println(\"actualTitle = \" + actualTitle);\n }\n\n driver.close();\n }",
"public void searchProduct(String product){\n driver.findElement(By.id(\"search_query_top\")).sendKeys(product);\n List<WebElement> options = driver.findElements(By.className(\"ac_results\"));\n for(WebElement option:options){\n if(option.getText().equalsIgnoreCase(\"printed dress\")){\n option.click();\n break;\n }\n }\n driver.findElement(By.name(\"submit_search\")).click();\n }",
"private FileObject findServiceArchiveForName(String appName) throws FileSystemException {\n List<FileObject> serviceArchives\n = Utils.findChildrenWithSuffix(deploymentDirectoryFile,\n com.stratuscom.harvester.Strings.JAR);\n //Then find the one that starts with the client name\n for (FileObject fo : serviceArchives) {\n if (fo.getName().getBaseName().startsWith(appName + com.stratuscom.harvester.Strings.DASH)) {\n return fo;\n }\n }\n return null;\n }",
"private WebElement getCheckBoxElementWithoutSearchbyText(String widgetID, String value) {\n/* 53 */ List<WebElement> elementsList = this.webdriver.findElements(By.xpath(\".//*[@id='attribute-tree-\" + widgetID + \"']//span[text() = '\" + value + \"']\"));\n/* 54 */ if (elementsList.size() > 0) {\n/* 55 */ return elementsList.get(0);\n/* */ }\n/* 57 */ return null;\n/* */ }",
"public ArrayList<String> store_present_element(ArrayList<String> oblist){\n\t\tArrayList<String> obj_list = new ArrayList<String>();\n\t\tint result = 0;\n\t\tint obj_index = 1;\n\t\tfor(int i=0; i<oblist.size(); i++){\n\t\t\tString xpathobj = oblist.get(i);\n\t\t\tList<WebElement> list = returnWebelements(xpathobj);\n\t\t\tif(list.size()>0){\n\t\t\t\tresult = 1;\n\t\t\t\tSystem.out.println(xpathobj+\" element is present!! \"+obj_index);\n\t\t\t\tobj_list.add(xpathobj);\n\t\t\t}\n\t\t\tobj_index++;\n\t\t}\n\t\tif(result!=1){\n\t\t\tprintlist(oblist);\n\t\t\tthrow new ObjectNotFoundException(\"none of the element is found from above pattern..\");\n\t\t}\n\t\tcheck_multiple_pattern(obj_list);\n\t\treturn obj_list;\n\t}",
"public boolean clickMatchingelementByText(By elementList, String itemName) {\n\t\tboolean res = false;\n\t\ttry {\n\t\t\tThread.sleep(implicitWaitTimeout*1000);\n\t\t\tList<WebElement> matchelements = getListOfMatchingElements(elementList);\n\t\t\tif (matchelements.size() > 0) {\n\t\t\t\tfor (int elecount = 0; elecount < matchelements.size(); elecount++) { // to get index of element\n\t\t\t\t\tSystem.out.println(matchelements.get(elecount).getText());\n\t\t\t\t\tif (matchelements.get(elecount).getText().equalsIgnoreCase(itemName)) {\n\t\t\t\t\t\t// reqindex = elecount;\n\t\t\t\t\t\tclickUsingJavaScript(matchelements.get(elecount));\n\t\t\t\t\t\tres = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (itemName.equalsIgnoreCase(\"anyitem\")) { // click first item\n\t\t\t\t\t\tclickUsingJavaScript(matchelements.get(elecount));\n\t\t\t\t\t\tres = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Exception Caught To click on Element Identifier :\" + elementList + \" With String name:\"\n\t\t\t\t\t+ itemName);\n\t\t}\n\n\t\treturn res;\n\n\t}",
"public String clickOnPackageDisplayedUnderOtherVacationPackages() throws Exception {\n\t\tWebElement wbEl;\n\t\tString Text;\n\t\tif (TestBase.flag_Mob) {\n\t\t\twbEl = driver.findElement(HomePageLocators.getpackageDisplayedUnderOtherVacationPackageOption()).findElement(By.xpath(\"./span[contains(@class,'Title')]\"));\n\t\t\tText = getText(wbEl);\n\t\t\tclickUsingJavaScript(HomePageLocators.getpackageDisplayedUnderOtherVacationPackageOption());\n\t\t} else {\n\t\t\tText = getText(HomePageLocators.getRomeFlorenceVeniceByTrainLnk());\n\t\t\tclickUsingJavaScript(HomePageLocators.getRomeFlorenceVeniceByTrainLnk());\n\t\t}\n\t\treturn Text;\n\t}",
"@Test\n public void prime(){\n\n WebElement input = driver.findElement(By.id(\"twotabsearchtextbox\"));\n input.sendKeys(\"wooden spoon\");\n WebElement searchButton = driver.findElement(By.className(\"nav-input\"));\n searchButton.click();\n\n String productName = \"COOKSMARK 5 Piece Bamboo Wood Nonstick Cooking Utensils - Wooden Spoons and Spatula Utensil Set with Multicolored Silicone Handles in Red Yellow Green Orange Blue\";\n\n WebElement primeButton = driver.findElement(By.xpath(\"(//i[@class='a-icon a-icon-checkbox'])[1]\"));\n primeButton.click();\n\n\n }",
"private Optional<V1Deployment> existingDeployment(AppsV1Api appsApi) {\n try {\n return Optional.of(appsApi.readNamespacedDeployment(config.getName(),config.getNamespace(),null,false,false));\n } catch (ApiException e) {\n return Optional.empty();\n }\n }",
"public void getPaPID(){\r\n DocumentBuilderFactory PAModuleFactory = DocumentBuilderFactory.newInstance();\r\n DocumentBuilder PAModuleBuilder = null;\r\n\r\n try { PAModuleBuilder = PAModuleFactory.newDocumentBuilder(); }\r\n catch (ParserConfigurationException e) { e.printStackTrace(); }\r\n\r\n Document mainExciterSWDocument = null;\r\n try { mainExciterSWDocument = PAModuleBuilder.parse(new File(\"pa_exciter_control.xml\")); }\r\n catch (SAXException e) { e.printStackTrace(); }\r\n catch (IOException e) { e.printStackTrace(); }\r\n\r\n NodeList SWNodeList = mainExciterSWDocument.getDocumentElement().getChildNodes();\r\n\r\n for (int j = 0; j < SWNodeList.getLength(); j++) {\r\n Node SWNode = SWNodeList.item(j);\r\n if (SWNode.getNodeType() == SWNode.ELEMENT_NODE) {\r\n Element swElement = (Element) SWNode;\r\n\r\n paModuleDescription = swElement.getElementsByTagName(\"PIDDESCRIPTION\").item(0).getChildNodes().item(0).getNodeValue();\r\n paModulePID = swElement.getElementsByTagName(\"PID\").item(0).getChildNodes().item(0).getNodeValue();\r\n if(paModuleDescription.equals(paModules.getValue()))\r\n break;\r\n\r\n }\r\n }\r\n}",
"public static WebElement tab_clickProductList() throws Exception{\r\n \ttry{\r\n \t\t// 03-Jan-2017 MR45284 New UI on KWS Listing page\r\n \t//\telement = driver.findElement(By.xpath(\"//a[contains(text(),'Product List')]\"));\r\n \t\telement = driver.findElement(By.xpath(\"//*[contains(text(),'Product List')]\"));\r\n \t\tAdd_Log.info(\"Product List view tab is click on the page.\");\r\n \t\t\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.error(\"Product List view tab is NOT found on the page.\");\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }",
"public WebElement apply(WebDriver fdriver) \n\t\t\t{\n\t\t\t\n\t\t\t\tSystem.out.println(\"Checking for the element!!\");\n\t\t\t\tWebElement element = fdriver.findElement(By.id(\"targetid\"));\n\t\t\t\tif(element != null)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Target element found\");\n\t\t\t\t}\n\t\t\t\treturn element;\n\t\t\t}",
"private List<String> listPolicyExemptAppsUnchecked() {\n String[] core = mContext.getResources().getStringArray(R.array.policy_exempt_apps);\n String[] vendor = mContext.getResources().getStringArray(R.array.vendor_policy_exempt_apps);\n\n int size = core.length + vendor.length;\n Set<String> apps = new ArraySet<>(size);\n for (String app : core) {\n apps.add(app);\n }\n for (String app : vendor) {\n apps.add(app);\n }\n\n return new ArrayList<>(apps);\n }",
"public static void main(String[] args) throws InterruptedException {\n\t\tWebDriver driver;\n\nSystem.setProperty(\"webdriver.gecko.driver\", \"C:\\\\Selenium_Class\\\\geckodriver-v0.18.0-win32\\\\geckodriver.exe\");\ndriver=new FirefoxDriver();\ndriver.get(\"https://www.ebay.in/\");\n\ndriver.findElement(By.id(\"gh-ac\")).sendKeys(\"Apple Watches\");\ndriver.findElement(By.id(\"gh-btn\")).click();\ndriver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);\n//get all the products--\n\nList<WebElement> list= driver.findElements(By.xpath(\"//*[@id='ListViewInner')/li/h3/a]\"));\n/*\n Iterator<WebElement> itr= list.iterator();\nwhile(itr.hasNext()){\n\tSystem.out.println(itr.next().getText());\n}\n\t*/\n\t\n\t}",
"public static void main(String[] args) throws InterruptedException {\nSystem.setProperty(\"webdriver.chrome.driver\", \"D:\\\\chromedriver.exe\");\nWebDriver driver=new ChromeDriver();\n\n\t//GET \t\n\t\t//driver.get(\"https://www.facebook.com/\");\n//driver.manage().window().maximize();\n//driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\t\t\n\t//NAVIGATE\n\t\tdriver.navigate().to(\"https://www.amazon.com/\");\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\t\tdriver.findElement(By.xpath(\"//input[@type='text']\")).sendKeys(\"womenshoes\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit']\")).click();\n\t\tdriver.findElement(By.xpath(\"//span[text()='PUMA']\")).click();\n\t\tList<WebElement> shoes=driver.findElements(By.xpath(\"//span[@class='a-size-base-plus a-color-base a-text-normal']\"));\n\t\tSystem.out.println(shoes.size());\n\t\tfor(int i=0;i<shoes.size();i++) {\n\t\t\tif(shoes.get(i).getText().equals(\"PUMA Women's Vikky Sneaker\")) {\n\t\t\t\tshoes.get(i).click();\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tThread.sleep(5000);\n\t\t\n\t\t\n\t\n//\t\tWebElement size=driver.findElement(By.xpath(\"//span[@class='a-dropdown-prompt']\"));\n//\t\tSelect sel=new Select(size);\n//\t\tsel.selectByIndex(1);\n//\t\tdriver.findElement(By.xpath(\"//input[@id='buy-now-button']\")).click();\n//\t\tdriver.findElement(By.xpath(\"//input[@id='ap_email']\")).sendKeys(\"[email protected]\");\n//\t\tdriver.findElement(By.xpath(\"//input[@id='continue']\")).click();\n\t\t\ndriver.quit();\n\t}",
"private void searchforResults() {\n\n List<String> queryList = new SavePreferences(this).getStringSetPref();\n if(queryList != null && queryList.size() > 0){\n Log.i(TAG, \"Searching for results \" + queryList.get(0));\n Intent searchIntent = new Intent(Intent.ACTION_WEB_SEARCH);\n searchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n searchIntent.putExtra(SearchManager.QUERY, queryList.get(0));\n this.startActivity(searchIntent);\n }\n }",
"public POSApplication getApplicationById(String appId) {\n String url = Configuration.getGS_URL() + APPLICATION_SERVICE + appId;\n Logger.get().info(\"Calling application service url: \" + url);\n\n try {\n POSApplication application = HttpClientApi.getGson(url, POSApplication.class);\n return application;\n } catch (Exception e) {\n Logger.get().info(\"Exception when invoking application service:\" + e);\n return null;\n }\n }",
"private void searchKeySkills(JSONArray skillistArray) {\n\n\n String skillSet = SharedPref.getInstance().getStringVlue(getActivity(), Api_skill_list);\n\n // Log.e(\"skillSet\",\":\"+skillSet);\n\n if (skillistArray != null) {\n\n try {\n if (skillistArray != null && skillistArray.length() > 0 && activity_list.size() <= 0) {\n\n activity_list.clear();\n\n for (int k = 0; k < skillistArray.length(); k++) {\n activity_list.add(skillistArray.optJSONObject(k).optString(\"activity\"));\n }\n\n activities = new String[activity_list.size()];\n activities = activity_list.toArray(activities);\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n if (activities != null && activities.length > 0) {\n\n for (int i = 0; i < activities.length; i++) {\n HashMap<String, String> pickUpMap = new HashMap<String, String>();\n pickUpMap.put(\"pickUpNames\", activities[i]);\n pickUpAutoList.add(pickUpMap);\n }\n String[] pickUpFrom = {\"pickUpNames\"};\n int[] pickUpTo = {R.id.txt};\n\n try {\n if (buddyUpSearchAuto != null) {\n SimpleAdapter pickUpSearchAdapter = new SimpleAdapter(getActivity(), pickUpAutoList, R.layout.autocomplete_layout, pickUpFrom, pickUpTo);\n buddyUpSearchAuto.setAdapter(pickUpSearchAdapter);\n }\n } catch (NullPointerException e) {\n //e.getMessage();\n }\n }\n }\n\n\n }",
"private Element traverse_search(Element element) {\n \ttry {\n\t \tString userid = profile.getAttributeValue(\"personal\", \"id\");\n\t \tString course = profile.getAttributeValue(\"personal\", \"course\");\n\t \tString context = WOWStatic.config.Get(\"CONTEXTPATH\");\n\n\t \tElement a = doc.createElement(\"a\");\n\t \ta.setAttribute(\"href\", context + \"/Get?wndName=Search\");\n\t \ta.setAttribute(\"target\", userid + \"$\" + course);\n\t \ta.appendChild(doc.createTextNode(\"Search\"));\n\t \treturn (Element)replaceNode(element, a);\n \t}\n \tcatch(Throwable e) {\n \t\te.printStackTrace();\n \t\treturn (Element)replaceNode(element, createErrorElement(\"Error!\"));\n \t}\n }",
"public Application findApplication(Long id)\n {\n for (Application app : _apps) {\n if (app.getId().equals(id)) {\n return app;\n }\n }\n\n return null;\n }",
"public void iterateAndClickParticularProgram(final String programeName);",
"protected String getAppForMethod(Integer method){\n for (Integer app : apps.keySet()) {\n for (Integer profile : profiles.keySet()) {\n if(profiles.get(profile).containsKey(app))\n for (Integer object : profiles.get(profile).get(app).keySet()) {\n if(profiles.get(profile).get(app).get(object).contains(method)) return apps.get(app);\n }\n }\n }\n return \"\";\n }",
"@And(\"^I searched for ([^\\\"]*) device$\") //Check do we need this\r\n\tpublic void i_searched_for_a_device(String container3) throws Throwable {\r\n\t\tenduser.fill_fields_from(\"OVActivationPage\",\"US43123-TC24975\",container3);\r\n\t\tenduser.get_container_from_xml(\"OVActivationPage\",\"US43123-TC24975\",container3);\r\n\t\tSystem.out.println(enduser.get_container_from_xml(\"OVActivationPage\",\"US43123-TC24975\",container3));\r\n\t\t//enduser.click_searchBtn();\r\n\t \r\n\t}",
"private String getXMLResultOfSearch(final List < ? > theList) {\r\n Boolean resultSearch = null;\r\n if (theList != null && theList.size() > 0) {\r\n resultSearch = Boolean.TRUE;\r\n } else {\r\n resultSearch = Boolean.FALSE;\r\n }\r\n\r\n XmlProducer producer = new XmlProducer();\r\n producer.setTarget(new Status(resultSearch));\r\n producer.setTypesOfTarget(Status.class);\r\n\r\n return this.xmlProducerWrapper.wrap(producer);\r\n }",
"@Test\n public void ebayTestSearchResults() throws Exception {\n driver.findElement(By.id(\"gh-ac\")).sendKeys(\"java book\");\n driver.findElement(By.id(\"gh-btn\")).click();\n\n Thread.sleep(4000);\n\n WebElement searchResults = driver.findElement(By.tagName(\"h1\"));\n //21,761 results for java book\n String resultActual = searchResults.getText();\n System.out.println(resultActual);\n }",
"private void search(String product) {\n // ..\n }",
"public WebElement element(String strElement) throws Exception {\n String locator = prop.getProperty(strElement); \n // extract the locator type and value from the object\n String locatorType = locator.split(\";\")[0];\n String locatorValue = locator.split(\";\")[1];\n // System.out.println(By.xpath(\"AppLogo\"));\n \n // for testing and debugging purposes\n System.out.println(\"Retrieving object of type '\" + locatorType + \"' and value '\" + locatorValue + \"' from the Object Repository\");\n \n // wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//input[@id='text3']\")));\n try {\n\n\n \tif(locatorType.equalsIgnoreCase(\"Id\"))\n \t\treturn driver.findElement(By.id(locatorValue)); \n \telse if(locatorType.equalsIgnoreCase(\"Xpath\")) \n \t\t\treturn driver.findElement(By.xpath(locatorValue)); \n// \t\t}catch(Exception e) {\n// \t\t\tdriver.navigate().refresh();\n//\n// \t\t\t@SuppressWarnings({ \"unchecked\", \"deprecation\", \"rawtypes\" })\n// \t\t\tWait<WebDriver> wait = new FluentWait(driver) \n// \t\t\t.withTimeout(8, TimeUnit.SECONDS) \n// \t\t\t.pollingEvery(1, TimeUnit.SECONDS) \n// \t\t\t.ignoring(NoSuchElementException.class);\n// \t\t\twait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath(locatorValue))));\n// \t\t\treturn driver.findElement(By.xpath(locatorValue)); \n// \t\t}\n \n \n \n else if(locatorType.equalsIgnoreCase(\"Name\"))\n \treturn driver.findElement(By.name(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Classname\")) \n \treturn driver.findElement(By.className(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Tagname\"))\n \treturn driver.findElement(By.className(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Linktext\"))\n \treturn driver.findElement(By.linkText(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Partiallinktext\"))\n \treturn driver.findElement(By.partialLinkText(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Cssselector\")) \n \treturn driver.findElement(By.cssSelector(locatorValue));\n\n \n } catch (NoSuchElementException | StaleElementReferenceException e) {\n \t\t\n if(locatorType.equalsIgnoreCase(\"Id\"))\n return driver.findElement(By.id(locatorValue)); \n else if(locatorType.equalsIgnoreCase(\"Xpath\")) \n return driver.findElement(By.xpath(locatorValue)); \n else if(locatorType.equalsIgnoreCase(\"Name\"))\n \treturn driver.findElement(By.name(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Classname\")) \n \treturn driver.findElement(By.className(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Tagname\"))\n \treturn driver.findElement(By.className(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Linktext\"))\n \treturn driver.findElement(By.linkText(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Partiallinktext\"))\n \treturn driver.findElement(By.partialLinkText(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Cssselector\")) \n \treturn driver.findElement(By.cssSelector(locatorValue));\n }\n throw new NoSuchElementException(\"Unknown locator type '\" + locatorType + \"'\"); \n \t}",
"public boolean checkCurrentOfferStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountOfferStatus = myAccount.findElement(By.className(\"adminTable4 \"));\n\t\tString elementPageSource = myAccountOfferStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" offer is enabled Which is a deactivated app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"public static WebElement btn_clickInqNowForUnvPdtAtPdtListing() throws Exception{\r\n \ttry{\r\n \t\telement = driver.findElement(\r\n \t\t\t\tBy.xpath(\"(//*[@id='unverifpparea']//a[contains(text(),'Inquire Now')])[position()=1]\"));\r\n \t\tAdd_Log.info(\"Inquire Now button for Unverified Product is click on the page.\");\r\n \t\t\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.error(\"Inquire Now button for Unverified Product is NOT found on the page.\");\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }",
"public static void main(String[] args) {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\eclipse\\\\chromedriver.exe\");\n\t\tWebDriver driver=new ChromeDriver();\n\t\tdriver.get(\"https://rahulshettyacademy.com/seleniumPractise/#/offers\");\n\t\tdriver.findElement(By.xpath(\"//input[@id='search-field']\")).sendKeys(\"Rice\");\n\t\tList<WebElement> items = driver.findElements(By.xpath(\"//tr/td[1]\"));\n\t\t\n\tList<WebElement> veggies=items.stream().filter(veggie->veggie.getText().contains(\"Rice\")).collect(Collectors.toList());\nAssert.assertEquals(items.size(), veggies.size());\n\t}",
"public WebElement apply(WebDriver driver ) {\n return driver.findElement(By.xpath(\"/html/body/div[1]/section/div[2]/div/div[1]/div/div[1]/div/div/div/div[2]/div[2]/div/div/div/div/div[1]/div/div/a/i\"));\n }",
"public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\n\t\t\t\t\n\t\t\t\t//device details\n\t\t\t\tcapabilities.setCapability(\"deviceName\", \"SM-G350E\");\n\t\t\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\t\t\tcapabilities.setCapability(\"platformVersion\", \"4.4.2\");\n\t\t\t\t\n\t\t\t\t//app details\n\t\t\t\tcapabilities.setCapability(CapabilityType.BROWSER_NAME, \"Chrome\");\n\t\t\t\t\n\t\t\t\t//appium server details\n\t\t\t\tAndroidDriver driver= new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\t\t\t\n\t\t\t\tThread.sleep(4000);\n\t\t\t\t\n\t\t\t\tdriver.get(\"http://books.rediff.com/\");\n\t\t\t\tThread.sleep(3000);\n\t\t\t\t\n\t\t\t\tdriver.findElementById(\"srchword\").sendKeys(\"Modi\");\n\t\t\t\tdriver.findElementByXPath(\"//input[@type='submit'][@class='srchbtn_n']\").click();\n\t\t\t\t\n\t\t\t\tThread.sleep(6000);\n\t\t\t\t\n\t\t\t\tList<WebElement> ele_book = driver.findElementsByTagName(\"a\");\n\t\t\t\t\n\t\t\t\tfor(WebElement element:ele_book)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(element.getText());\n\t\t\t\t\t\n\t\t\t\t\tif((element.getText()).contains(\"Gamechanger\"))\n\t\t\t\t\t{\n\t\t\t\t\t\telement.click();\n\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\t\n\t\t\t\tThread.sleep(5000);\n\t\t\t\t\n\t\t\t\tdriver.findElementByXPath(\"//input[@class='buynowbtn'][@type='button'][@value='Buy Now']\").click();\n\t\t\t\t\n\t\t\t\tThread.sleep(4000);\n\t\t\t\t\n\t\t\t\tString Actual_Result = driver.findElementByCssSelector(\"#currentcartdiv > div.cart_prd_row > div.prddetail > span:nth-child(1)\").getText();\n\t\t\t\tSystem.out.println(Actual_Result);\n\t\t\t\tThread.sleep(3000);\n\t\t\t\t\n\t\t\t\tif(Actual_Result.contains(\"Gamechanger\"))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Pass\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Fail\");\n\t\t\t\t}\n\t\t\t\t\n\n\t}",
"public void searchCriteria(WebDriver driver) throws InterruptedException\r\n\t {\r\n\t\t try\r\n\t\t {\r\n\t\t\t driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t \r\n\t\t\t driver.findElement(By.id(\"filter_purchaserEmail\")).clear();\r\n\t driver.findElement(By.id(\"filter_purchaserEmail\")).sendKeys(purchaserEmail);\r\n\t \r\n\t driver.findElement(By.id(\"filter_code\")).clear();\r\n\t driver.findElement(By.id(\"filter_code\")).sendKeys(code);\r\n\t \r\n\t driver.findElement(By.id(\"search\")).click();\r\n\t driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t \r\n\t redeemerEmail = driver.findElement(By.xpath(\"//tr[td[contains(text(),'\"+purchaserEmail+\"')]]/td[3]\")).getText();\r\n\t System.out.println(\"redeemerEmail:\"+redeemerEmail);\r\n\t \r\n\t creditsOnGifts = driver.findElement(By.xpath(\"//tr[td[contains(text(),'\"+purchaserEmail+\"')]]/td[6]\")).getText();\r\n\t System.out.println(\"creditsOnGifts:\"+creditsOnGifts);\r\n\t \r\n\t codeActive = driver.findElement(By.xpath(\"//tr[td[contains(text(),'\"+purchaserEmail+\"')]]/td[7]\")).getText();\r\n\t System.out.println(\"codeActive:\"+codeActive);\r\n\t \r\n\t Thread.sleep(10000);\r\n\t //driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t refunded = driver.findElement(By.xpath(\"//tr[td[contains(text(),'\"+purchaserEmail+\"')]]/td[8]/span\")).getText();\r\n\t System.out.println(\"refunded:\"+refunded);\r\n\t driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t \r\n\t //Condition to check view more details\r\n\t if(redeemerEmail.equalsIgnoreCase(TestConstants.NOT_REDEEMED) && codeActive.equalsIgnoreCase(TestConstants.STATUS_YES) && refunded.equalsIgnoreCase(TestConstants.STATUS_NO))\r\n\t {\r\n\t \t driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t \t System.out.println(\"Before View More Detail\");\r\n\t \t driver.findElement(By.xpath(\"//a[contains(text(),'View More Detail')]\")).click();\r\n\t \t System.out.println(\"After View More Detail\");\r\n\t \t driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t }\r\n\t \r\n\t System.out.println(\"Try block\");\r\n\t }catch(NoSuchElementException e)\r\n\t\t {\r\n\t \t e.printStackTrace();\r\n\t \t System.out.println(\"Catch block\");\r\n\t\t }\r\n\t}",
"protected IRubyElement findElementToSelect(IRubyElement je) {\r\n\t\tif (je == null)\r\n\t\t\treturn null;\r\n\r\n\t\tswitch (je.getElementType()) {\r\n\t\t\tcase IRubyElement.RUBY_MODEL :\r\n\t\t\t\treturn null;\r\n\t\t\tcase IRubyElement.RUBY_PROJECT:\r\n\t\t\t\treturn je;\r\n\t\t\tcase IRubyElement.SOURCE_FOLDER_ROOT:\r\n\t\t\t\tif (je.getElementName().equals(ISourceFolderRoot.DEFAULT_PACKAGEROOT_PATH))\r\n\t\t\t\t\treturn je.getParent();\r\n\t\t\t\telse\r\n\t\t\t\t\treturn je;\r\n\t\t\tdefault :\r\n\t\t\t\treturn findElementToSelect(je.getParent());\r\n\t\t}\r\n\t}",
"public String verifyAllAutoNameSearch(String object, String data) {\n\t\tlogger.debug(\"Verifying verifyAllAutoNameSearch\");\n\n\t\ttry {\n\t\t\tThread.sleep(3000);\n\t\t\tList<WebElement> l1 = explictWaitForElementList(object);\n\t\t\tlogger.debug(\"Number of elements found:- \" + l1.size());\n\t\t\tboolean flag = false;\n\t\t\tfor (int i = 0; i < l1.size(); i++) {\n\t\t\t\tWebElement ele = l1.get(i);\n\t\t\t\tString str = ele.getText();\n\t\t\t\tlogger.debug(\"actual string: \" + str);\n\t\t\t\tif (str.toLowerCase().contains(data.toLowerCase())) {\n\t\t\t\t\tflag = true;\n\t\t\t\t} else {\n\t\t\t\t\tlogger.debug(str + \" does not contain \" + data);\n\t\t\t\t\tflag = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (flag)\n\t\t\t\treturn Constants.KEYWORD_PASS + \"--elements in auto search contains the input\";\n\t\t\telse\n\t\t\t\treturn Constants.KEYWORD_FAIL + \"--elements in auto search do not contains the input\";\n\n\t\t} \ncatch(TimeoutException ex)\n\t\t\n\t\t{\n\t\t\treturn Constants.KEYWORD_FAIL +\"Cause: \"+ ex.getCause();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\n\t\t\treturn Constants.KEYWORD_FAIL + e.getLocalizedMessage();\n\n\t\t}\n\n\t}",
"java.lang.String getAppType();",
"public static WebElement btn_clickInqNowForVerPdtAtPdtListing() throws Exception{\r\n \ttry{\r\n \t// UI changed on Date 28-Sep-2015 \r\n \t//\telement = driver.findElement(By.xpath(\"(//*[contains(@class, 'wt_pinq')]\"\r\n \t//\t\t\t+ \"//a[contains(text(),'Inquire Now')])[position()=1]\"));\r\n \t\t\r\n \t\tWebDriverWait waits = new WebDriverWait(driver, 25);\r\n \t\twaits.until(ExpectedConditions.visibilityOfElementLocated(\r\n \t\t\t\tBy.xpath(\"//*[contains(@class, 'GS_globalNav clearfix')]\")));\r\n \t\t\r\n \t\twaits.until(ExpectedConditions.elementToBeClickable(\r\n \t\t\t\tBy.xpath(\"(//*[contains(@class, 'majorPP_inquire')]//a[contains(text(),'Inquire Now')])[position()=1]\")));\r\n \t\t\r\n \t\telement = driver.findElement(By.xpath(\"(//*[contains(@class, 'majorPP_inquire')]\"\r\n \t\t\t\t+ \"//a[contains(text(),'Inquire Now')])[position()=1]\"));\r\n \t//\telement.click();\r\n \t\tJavascriptExecutor executor = (JavascriptExecutor)driver;\r\n \t\texecutor.executeScript(\"arguments[0].click();\", element);\r\n \t\t\r\n \t\tAdd_Log.info(\"Inquire Now button for Verified Product is click on the page.\");\r\n \t\t\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.error(\"Inquire Now button for Verified Product is NOT found on the page.\");\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }",
"public static WebElement lnk_clickGSMagazinesApp() throws Exception{\r\n \ttry{\r\n \t\telement = driver.findElement(By.xpath(\"//*[text()='\\\"Global Sources Magazines\\\" app']\"));\r\n \t\tAdd_Log.info(\"Global Sources Magazines app hyperlink is click on the page.\");\r\n \t\t\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.error(\"GLobal Sources Magazines app hyperlink is NOT found on the page.\");\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }",
"public org.thethingsnetwork.management.proto.HandlerOuterClass.Application getApplication(org.thethingsnetwork.management.proto.HandlerOuterClass.ApplicationIdentifier request);",
"public void Case28(){\n System.out.println(\"Testing Case 25\");\n for(int z=1; z<=7; z++) {\n infoFilter();\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement cancelBtn = (MobileElement) driver.findElementById(\"android:id/button2\");\n String cancelBtnText = cancelBtn.getText();\n System.out.println(\"Clicked \"+cancelBtnText);\n cancelBtn.click();\n infoFilterWeeklyOfftake();\n if(z==1) {\n checkByName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchName.sendKeys(\"amoxil\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Name\");\n }\n else if(z==2){\n checkByShortName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchShortName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchShortName.sendKeys(\"Amoxil 500mg\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Short Name\");\n }\n else if(z==3){\n checkByItemCode();\n //Click Search bar and search certain product by Item Code\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchItemCode = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchItemCode.sendKeys(\"51232167\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Short Name\");\n }\n else if(z==4){\n checkByDescription();\n //Click Search bar and search certain product by Description\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchDescription = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchDescription.sendKeys(\"Capsule\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Description\");\n }\n else if(z==5){\n checkByBrand();\n //Click Search bar and search certain product by Brand\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchBrand = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchBrand.sendKeys(\"Amoxil\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Brand\");\n }\n else if(z==6){\n checkByKeyword();\n //Click Search bar and search certain product by Keywords\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchKeyword = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchKeyword.sendKeys(\"AmOxIl\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Keyword\");\n }\n else if(z==7){\n checkByPrincipal();\n //Click Search bar and search certain product by Principal\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchPrincipal = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchPrincipal.sendKeys(\"GlaxoSmithKline\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Principal\");\n }\n\n }\n System.out.println(\"Case 25 Done\");\n }",
"public void findTask() {\n System.out.println(LINEBAR);\n System.out.println(\"Below are a list of tasks matching your description\\n\");\n\n String targetDesc = userIn.substring(FIND_HEADER);\n\n int matching = 0;\n\n for (Task t : tasks.TaskList) {\n String currDesc = t.taskDescription;\n\n if (currDesc.contains(targetDesc)) {\n matching++;\n System.out.println(matching + \". \" + t);\n }\n }\n\n if (matching == 0) {\n System.out.println(\"No matches found\\n\");\n }\n System.out.println(LINEBAR);\n }",
"java.lang.String getAppName();",
"java.lang.String getAppName();",
"java.lang.String getAppName();",
"public static WebElement lnk_clickUnvPdtName(String dataUnvPdtName) throws Exception{\r\n \ttry{\r\n \t//\telement = driver.findElement(\r\n \t//\t\t\tBy.xpath(\"//*[@id='unverifpparea']//a[contains(text(),'\" + dataUnvPdtName + \"')]\"));\r\n \t\t// Wait for hyperlink to be clickable\r\n \t\tWebDriverWait wait = new WebDriverWait(driver, 15);\r\n \t//\twait.until(ExpectedConditions.elementToBeClickable(By.xpath(\"//*[@class='unverified_listing clearfix']//h3\")));\r\n \t\twait.until(ExpectedConditions.elementToBeClickable(\r\n \t\t\t\tBy.xpath(\"//*[@name='UVinquiry']//a[contains(text(),'\" + dataUnvPdtName + \"')]\")));\r\n \t\t\r\n \t\t// 03-Jan-2017 New UI\r\n \t\telement = driver.findElement(\r\n \t\t\t\tBy.xpath(\"//*[@name='UVinquiry']//a[contains(text(),'\" + dataUnvPdtName + \"')]\"));\r\n \t\t\r\n \t\tJavascriptExecutor executor = (JavascriptExecutor)driver;\r\n \t\texecutor.executeScript(\"arguments[0].click();\", element);\r\n \t\t\r\n \t\tAdd_Log.info(\"Unverified Product Name link is click on the page.\");\r\n \t\t\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.error(\"Unverified Product Name link is NOT found on the page.\");\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n \t\r\n }",
"public static void main_getApplicant(){\n System.out.println(\"Enter Applicant Name: \");\n String name = input.nextLine();\n try {\n Applicant temp = table.getApplicant(name);\n System.out.println(temp.toString());\n System.out.println();\n } catch (ApplicantNotFoundException ex){\n System.out.println(\"Applicant not found.\");\n main_menu();\n }\n }",
"public void Case25(){\n System.out.println(\"Testing Case 25\");\n for(int z=1; z<=7; z++) {\n infoFilter();\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement cancelBtn = (MobileElement) driver.findElementById(\"android:id/button2\");\n String cancelBtnText = cancelBtn.getText();\n System.out.println(\"Clicked \"+cancelBtnText);\n cancelBtn.click();\n infoFilterCurrentInvent();\n if(z==1) {\n checkByName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchName.sendKeys(\"amoxil\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Name\");\n }\n else if(z==2){\n checkByShortName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchShortName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchShortName.sendKeys(\"Amoxil 500mg\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Short Name\");\n }\n else if(z==3){\n checkByItemCode();\n //Click Search bar and search certain product by Item Code\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchItemCode = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchItemCode.sendKeys(\"51232167\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Short Name\");\n }\n else if(z==4){\n checkByDescription();\n //Click Search bar and search certain product by Description\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchDescription = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchDescription.sendKeys(\"Capsule\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Description\");\n }\n else if(z==5){\n checkByBrand();\n //Click Search bar and search certain product by Brand\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchBrand = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchBrand.sendKeys(\"Amoxil\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Brand\");\n }\n else if(z==6){\n checkByKeyword();\n //Click Search bar and search certain product by Keywords\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchKeyword = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchKeyword.sendKeys(\"AmOxIl\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Keyword\");\n }\n else if(z==7){\n checkByPrincipal();\n //Click Search bar and search certain product by Principal\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchPrincipal = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchPrincipal.sendKeys(\"GlaxoSmithKline\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Principal\");\n }\n\n }\n System.out.println(\"Case 25 Done\");\n }",
"public static void Own_Acc_FCY_To_Onepack() {\n try {\n\n\n waitToElement(\"//android.widget.Button[@text='S']\");\n clickHarmburgerMenuBTN();\n waitToElement(\"//android.widget.TextView[@text='Transfers']\");\n AppiumDriver<MobileElement> driver = getAppiumDriver();\n\n MobileElement Transfer = driver.findElementByXPath(\"//android.widget.TextView[@text='Transfers']\");\n Transfer.click();\n waitToElement(\"//android.widget.TextView[@text='Own Accounts']\");\n\n MobileElement OwnAccounts = driver.findElementByXPath(\"//android.widget.TextView[@text='Own Accounts']\");\n OwnAccounts.click();\n waitToElement(\"// android.widget.TextView[@text='V']\");\n MobileElement FromAcc = driver.findElementByXPath(\"// android.widget.TextView[@text='V']\");\n FromAcc.click();\n waitToElement(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\");\n String FromAccIBANNo = getData(\"FromACCIBANNo\");\n List<MobileElement> IBANNo = driver.findElements(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\"));\n System.out.println(IBANNo.size());\n int Namesize = IBANNo.size();\n boolean Flag;\n Flag = false;\n for (int i = 1; i < Namesize + 1; i++) {\n\n String Name = driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).getText();\n System.out.println(Name);\n\n\n if (Name.contains(FromAccIBANNo)) {\n\n driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).click();\n Flag = true;\n break;\n }\n\n }\n\n waitToElement(\"// android.widget.TextView[@text='V' and @index='1']\");\n MobileElement ToAcc = driver.findElementByXPath(\"// android.widget.TextView[@text='V' and @index='1']\");\n ToAcc.click();\n waitToElement(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\");\n String ToBenIBANNo = getData(\"ToACCIBANNo\");\n List<MobileElement> IBANNos = driver.findElements(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\"));\n System.out.println(IBANNos.size());\n int Namesize1 = IBANNos.size();\n boolean Flag1;\n Flag1 = false;\n for (int i = 1; i < Namesize1 + 1; i++) {\n\n String Name1 = driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).getText();\n System.out.println(Name1);\n\n\n if (Name1.contains(ToBenIBANNo)) {\n\n driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).click();\n Flag1 = true;\n break;\n }\n\n }\n\n\n if (Flag1 == true) {\n ReportHelper.logReportStatus(LogStatus.PASS, \"The beneficiary name has been Selected Successfuly']\");\n\n } else {\n ReportHelper.logReportStatus(LogStatus.PASS, \"Unable to Select the beneficary Name']\");\n\n }\n waitToElement(\"//android.widget.EditText[@index='0']\");\n String Bal = getData(\"Amount\");\n MobileElement Balance = driver.findElementByXPath(\"//android.widget.EditText[@index='0']\");\n Balance.sendKeys(Bal);\n waitToElement(\"//android.widget.Button[@text='Continue']\");\n MobileElement continuebtn = driver.findElementByXPath(\"//android.widget.Button[@text='Continue']\");\n continuebtn.click();\n waitToElement(\"//android.widget.Button[@text='Continue']\");\n\n MobileElement confirmtn = driver.findElementByXPath(\"//android.widget.Button[@text='Continue']\");\n confirmtn.click();\n waitToElement(\"//android.widget.TextView[contains(@text,'Ref No ')]\");\n\n String RefNo = driver.findElementByXPath(\"//android.widget.TextView[contains(@text,'Ref No ')]\").getText();\n saveTestDataToDb(\"RefNo\", RefNo);\n Thread.sleep(3000);\n System.out.println(RefNo);\n\n waitToElement(\"//android.widget.TextView[@text='Your transfer was successfully done']\");\n\n MobileElement SuccessMsg = driver.findElementByXPath(\"//android.widget.TextView[@text='Your transfer was successfully done']\");\n\n ReportHelper.logReportStatus(LogStatus.PASS, \"Your transfer was successfully done\");\n waitToElement(\"//android.widget.Button[@text='Go to home']\");\n MobileElement HomeBtn = driver.findElementByXPath(\"//android.widget.Button[@text='Go to home']\");\n HomeBtn.click();\n Thread.sleep(4000);\n\n\n } catch (Exception e) {\n System.out.println(e.getMessage());\n ReportHelper.logReportStatus(LogStatus.FAIL, \"Unable to Delete Beneficary name\");\n }\n }",
"public String getApp();",
"private Item getIncludedItem(Element itemElement, ArrayList<Item> items) {\n Item include = null;\n for (int i = 0; i <= items.size() - 1; i++) {\n if (items.get(i).getName()\n .equals(itemElement.getElementsByTagName(\"name\").item(0).getTextContent())) {\n include = items.get(i);\n }\n }\n return include;\n }",
"public void searchProduct(String url){\n Intent intent = new Intent(Intent.ACTION_VIEW);\n intent.setData(Uri.parse(url));\n\n if(intent.resolveActivity(getContext().getPackageManager()) != null) {\n getContext().startActivity(intent);\n }\n }",
"public static void Own_Acc_Onepack_To_FCY() {\n try {\n\n\n waitToElement(\"//android.widget.Button[@text='S']\");\n clickHarmburgerMenuBTN();\n waitToElement(\"//android.widget.TextView[@text='Transfers']\");\n AppiumDriver<MobileElement> driver = getAppiumDriver();\n\n MobileElement Transfer = driver.findElementByXPath(\"//android.widget.TextView[@text='Transfers']\");\n Transfer.click();\n waitToElement(\"//android.widget.TextView[@text='Own Accounts']\");\n\n MobileElement OwnAccounts = driver.findElementByXPath(\"//android.widget.TextView[@text='Own Accounts']\");\n OwnAccounts.click();\n waitToElement(\"// android.widget.TextView[@text='V']\");\n MobileElement FromAcc = driver.findElementByXPath(\"// android.widget.TextView[@text='V']\");\n FromAcc.click();\n waitToElement(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\");\n String FromAccIBANNo = getData(\"FromACCIBANNo\");\n List<MobileElement> IBANNo = driver.findElements(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\"));\n System.out.println(IBANNo.size());\n int Namesize = IBANNo.size();\n boolean Flag;\n Flag = false;\n for (int i = 1; i < Namesize + 1; i++) {\n\n String Name = driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).getText();\n System.out.println(Name);\n\n\n if (Name.contains(FromAccIBANNo)) {\n\n driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).click();\n Flag = true;\n break;\n }\n\n }\n\n waitToElement(\"// android.widget.TextView[@text='V' and @index='1']\");\n MobileElement ToAcc = driver.findElementByXPath(\"// android.widget.TextView[@text='V' and @index='1']\");\n ToAcc.click();\n waitToElement(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\");\n String ToBenIBANNo = getData(\"ToACCIBANNo\");\n List<MobileElement> IBANNos = driver.findElements(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\"));\n System.out.println(IBANNos.size());\n int Namesize1 = IBANNos.size();\n boolean Flag1;\n Flag1 = false;\n for (int i = 1; i < Namesize1 + 1; i++) {\n\n String Name1 = driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).getText();\n System.out.println(Name1);\n\n\n if (Name1.contains(ToBenIBANNo)) {\n\n driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).click();\n Flag1 = true;\n break;\n }\n\n }\n\n\n if (Flag1 == true) {\n ReportHelper.logReportStatus(LogStatus.PASS, \"The beneficiary name has been Selected Successfuly']\");\n\n } else {\n ReportHelper.logReportStatus(LogStatus.PASS, \"Unable to Select the beneficary Name']\");\n\n }\n waitToElement(\"//android.widget.EditText[@index='0']\");\n String Bal = getData(\"Amount\");\n MobileElement Balance = driver.findElementByXPath(\"//android.widget.EditText[@index='0']\");\n Balance.sendKeys(Bal);\n waitToElement(\"//android.widget.Button[@text='Continue']\");\n MobileElement continuebtn = driver.findElementByXPath(\"//android.widget.Button[@text='Continue']\");\n continuebtn.click();\n waitToElement(\"//android.widget.Button[@text='Continue']\");\n\n MobileElement confirmtn = driver.findElementByXPath(\"//android.widget.Button[@text='Continue']\");\n confirmtn.click();\n waitToElement(\"//android.widget.TextView[contains(@text,'Ref No ')]\");\n\n String RefNo = driver.findElementByXPath(\"//android.widget.TextView[contains(@text,'Ref No ')]\").getText();\n saveTestDataToDb(\"RefNo\", RefNo);\n Thread.sleep(3000);\n System.out.println(RefNo);\n\n waitToElement(\"//android.widget.TextView[@text='Your transfer was successfully done']\");\n\n MobileElement SuccessMsg = driver.findElementByXPath(\"//android.widget.TextView[@text='Your transfer was successfully done']\");\n\n ReportHelper.logReportStatus(LogStatus.PASS, \"Your transfer was successfully done\");\n waitToElement(\"//android.widget.Button[@text='Go to home']\");\n MobileElement HomeBtn = driver.findElementByXPath(\"//android.widget.Button[@text='Go to home']\");\n HomeBtn.click();\n Thread.sleep(4000);\n\n\n } catch (Exception e) {\n System.out.println(e.getMessage());\n ReportHelper.logReportStatus(LogStatus.FAIL, \"Unable to Delete Beneficary name\");\n }\n }",
"public void Case27(){\n System.out.println(\"Testing Case 27\");\n for(int z=1; z<=7; z++) {\n infoFilter();\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement cancelBtn = (MobileElement) driver.findElementById(\"android:id/button2\");\n String cancelBtnText = cancelBtn.getText();\n System.out.println(\"Clicked \"+cancelBtnText);\n cancelBtn.click();\n infoFilterDailyOfftake();\n if(z==1) {\n checkByName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchName.sendKeys(\"amoxil\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Name\");\n }\n else if(z==2){\n checkByShortName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchShortName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchShortName.sendKeys(\"Amoxil 500mg\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Short Name\");\n }\n else if(z==3){\n checkByItemCode();\n //Click Search bar and search certain product by Item Code\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchItemCode = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchItemCode.sendKeys(\"51232167\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Short Name\");\n }\n else if(z==4){\n checkByDescription();\n //Click Search bar and search certain product by Description\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchDescription = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchDescription.sendKeys(\"Capsule\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Description\");\n }\n else if(z==5){\n checkByBrand();\n //Click Search bar and search certain product by Brand\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchBrand = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchBrand.sendKeys(\"Amoxil\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Brand\");\n }\n else if(z==6){\n checkByKeyword();\n //Click Search bar and search certain product by Keywords\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchKeyword = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchKeyword.sendKeys(\"AmOxIl\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Keyword\");\n }\n else if(z==7){\n checkByPrincipal();\n //Click Search bar and search certain product by Principal\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchPrincipal = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchPrincipal.sendKeys(\"GlaxoSmithKline\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Principal\");\n }\n\n }\n System.out.println(\"Case 27 Done\");\n\n }",
"private static StockItem searchForProductOffered(Collection<StockItem> offeredStockItems, ProductAmountTO currentRequiredProduct) {\t\n\t\tIterator<StockItem> stockItemIterator = offeredStockItems.iterator();\n\t\tStockItem currentStockItem;\n\t\twhile(stockItemIterator.hasNext()) {\n\t\t\tcurrentStockItem = stockItemIterator.next();\n\t\t\tProductTO productTO = FillTransferObjects.fillProductTO(currentStockItem.getProduct());\n\t\t\tif(productTO.equals(currentRequiredProduct.getProduct())) {\n\t\t\t\treturn currentStockItem;\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\treturn null;\n\t}",
"public String ssoApple() throws InterruptedException {\n this.scrollBy(signupApple);\n helperMethods.waitForWebElementToBeInteractable(signupApple,30);\n signupApple.click();\n ssoSubscribeCheck.click();\n ssoTermsCheck.click();\n submitSSO.click();\n while (!helperMethods.waitForPageToLoad()) {\n helperMethods.waitForPageToLoad();\n }\n //Since we are navigating to third party adding thread.sleep\n Thread.sleep(7000);\n return webDriver.getTitle();\n }",
"public static void main(String[] args) {\n\t\t\tFind f=new Find();\n\t\t\tf.FindByHref(\"http://www.bestbuy.com/site/Global-Promotions/International+Orders/pcmcat176600050000.c?id=pcmcat176600050000\");\n\t}",
"public static void itemsearch(List<String> shoppingList) {\n\n\n\n if(shoppingList.contains(\"milk\")){\n System.out.println(\"The list contains milk\");\n }\n else{\n System.out.println(\"We dont have milk on our list\");\n }\n\n if(shoppingList.contains(\"bananas\")){\n System.out.println(\"the list contains bananas\");\n }\n else{\n System.out.println(\"We dont have bananas on our list\");\n }\n }",
"public static void main(String[] args) throws InterruptedException {\n\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"F:\\\\selenium driver\\\\chromedriver.exe\");\r\n\t\tWebDriver driver = new ChromeDriver();\r\n\t\t\r\n\t\tdriver.get(\"https://www.google.com/\");\r\nWebElement value =\tdriver.findElement(By.xpath(\"//input[@class='gLFyf gsfi']\"));\r\n\t\t\r\n value.sendKeys(\"testing\");\r\n Thread.sleep(2000);\r\n\t\t\t\r\nList<WebElement> list = driver.findElements(By.xpath(\"//ul[@class='erkvQe']//li/div/div/div[@class='sbl1']/span\"));\r\n\t\t\t\r\n//\"//ul[@class='erkvQe']//li/div/div/div[@class='sbl1']/span\")\r\n\r\n//\"//ul[@class='erkvQe']//li//div[@class='sbl1']/span\r\n\r\n\r\n\r\nint sizeoflist =list.size();\r\n\r\n\r\n//this will print the xpath of every webelement\r\nSystem.out.println(list);\r\n\r\nSystem.out.println(\"Size of list is : \" +sizeoflist );\r\n\r\nfor (WebElement webElement : list) \r\n\r\n{\r\n\t\r\nString nameofsuggestion =\twebElement.getText();\r\n\r\nSystem.out.println(nameofsuggestion);\r\n\t\r\n}\r\n\t}",
"public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\r\n\t\t\t\t\t\t\r\n\t\t\t\t//device details\r\n\t\t\t\tcapabilities.setCapability(\"deviceName\",\"GT-I9300I\");\r\n\t\t\t\tcapabilities.setCapability(\"platformName\",\"Android\");\r\n\t\t\t\tcapabilities.setCapability(\"platformVersion\",\"4.4.4\");\t\t\r\n\t\t\t\t\r\n\t\t\t\t//app details\r\n\t\t\t\tcapabilities.setCapability(\"appPackage\",\"com.emn8.mobilem8.nativeapp.bk\");\r\n\t\t\t\tcapabilities.setCapability(\"appActivity\",\"com.emn8.mobilem8.nativeapp.bk.BKNativeMobileApp\");\r\n\t\t\t\t\r\n\t\t\t\t//Appium Server details\r\n\t\t\t\tAndroidDriver driver= new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\r\n\t\t\t\t\r\n\t\t\t\t//wait\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\t\r\n\t\t\t\tSet<String> contextHandles = driver.getContextHandles();\r\n\t\t\t\tint size = contextHandles.size();\r\n\t\t\t\tSystem.out.println(size);\r\n\t\t\t\t\r\n\t\t\t\t//****************************************************\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"First Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"NATIVE\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\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\tWebDriverWait wait= new WebDriverWait(driver, 50);\r\n\t\t\t\tWebElement ele_voucher = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@index='9'][@content-desc='VOUCHERS'][@class='android.view.View']\")));\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Voucher is displayed \"+ele_voucher.isDisplayed());\r\n\t\t\t\t\r\n\t\t\t\tele_voucher.click();\r\n\t\t\t\t\r\n\t\t\t\t//**************************************************************\r\n\t\t\t\t//Second page\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Second Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"NATIVE\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\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\t\r\n\t\t\t\tWebDriverWait wait2= new WebDriverWait(driver, 50);\r\n\t\t\t\tWebElement ele_redeem = wait2.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@index='17'][@content-desc='REDEEM'][@class='android.view.View']\")));\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Redeem is displayed \"+ele_redeem.isDisplayed());\r\n\t\t\t\t\r\n\t\t\t\tele_redeem.click();\r\n\t\t\t\t//**************************************************************\r\n\t\t\t\t//Third page\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Third Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"WEBVIEW\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\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\t\r\n\t\t\t\tdriver.findElementByName(\"email\").sendKeys(\"[email protected]\");\r\n\t\t\t\tWebElement ele_pwd = driver.findElementByName(\"password\");\r\n\t\t\t\tele_pwd.click();\r\n\t\t\t\t\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\tele_pwd.sendKeys(\"1234\");\r\n\t\t\t\t\r\n\t\t\t\t//********************************************************\r\n\t\t\t\t\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\t\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Third Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"NATIVE\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\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\t\r\n\t\t\t\tWebDriverWait wait3= new WebDriverWait(driver, 50);\r\n\t\t\t\tWebElement ele_Signin = wait3.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@index='33'][@content-desc='SIGN IN'][@class='android.view.View']\")));\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Signin is displayed \"+ele_Signin.isDisplayed());\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\t\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\t\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\t\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\t\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\t\r\n\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\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}",
"public static WebElement btn_clickProductListTabViewInqNow() throws Exception{\r\n \ttry{\r\n \t\tWebDriverWait waits = new WebDriverWait(driver, 25);\r\n \t\twaits.until(ExpectedConditions.visibilityOfElementLocated(\r\n \t\t\t\tBy.xpath(\"//*[contains(@class, 'GS_globalNav clearfix')]\")));\r\n \t\t\r\n \t\twaits.until(ExpectedConditions.elementToBeClickable(\r\n \t\t\t\tBy.xpath(\"(//*[contains(@class, 'UItrigger_inquiryBox button')])[position()=1]\")));\r\n \t\t\r\n \t\telement = driver.findElement(By.xpath(\"(//*[contains(@class, 'UItrigger_inquiryBox button')])[position()=1]\"));\r\n \t\t\r\n \t\tJavascriptExecutor executor = (JavascriptExecutor)driver;\r\n \t\texecutor.executeScript(\"arguments[0].click();\", element);\r\n \t\t\r\n \t\tAdd_Log.info(\"Inquire Now button for Verified Product is click on the page.\");\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.error(\"Inquire Now button for Verified Product is NOT found on the page.\");\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }",
"WebElement getSearchButton();",
"public static void main(String[] args) {\n\t\tChromeOptions chromeOptions = new ChromeOptions();\r\n\t\tWebDriverManager.chromedriver().setup();\r\n\t\tWebDriver driver = new ChromeDriver(chromeOptions);\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);\r\n\t\tdriver.get(\"https://dev113545.service-now.com/\");\r\n\t\tdriver.switchTo().frame(\"gsft_main\");\r\n\t\tdriver.findElement(By.id(\"user_name\")).sendKeys(\"admin\");\r\n\t\tdriver.findElement(By.id(\"user_password\")).sendKeys(\"m3GkKEKU8atr\");\r\n\t\tdriver.findElement(By.id(\"sysverb_login\")).click();\r\n\r\n\t\tdriver.findElement(By.id(\"filter\")).sendKeys(\"Incident\");\r\n\t\tdriver.findElement(By.xpath(\"//div[@class='sn-widget-list-title' and ./text()='Open']\")).click();\r\n\t\tdriver.switchTo().frame(\"gsft_main\");\r\n\r\n\t\tWebElement search=driver.findElement(By.xpath(\"//input[@placeholder='Search']\"));\r\n\t\tsearch.sendKeys(\"INC0010799\",Keys.ENTER);\r\n\r\n\t\tdriver.findElement(By.xpath(\"//a[contains(@class,'formlink')]\")).click();\r\n\r\n\t\tdriver.findElement(By.id(\"lookup.incident.assignment_group\")).click();\r\n\r\n\t\tSet<String> handles1=driver.getWindowHandles();\r\n\t\t\r\n\t\tList<String> listHandle1=new ArrayList<String>(handles1);\r\n\t\tString parentWindow=listHandle1.get(0);\r\n\t\tString assignGroupWindow=listHandle1.get(1);\r\n\t\tdriver.switchTo().window(assignGroupWindow);\r\n\r\n\t\tdriver.findElement(By.xpath(\"//span[text()='Press Enter from within the input to submit the search.']/following::input\")).sendKeys(\"Software\",Keys.ENTER); \r\n\t\tdriver.findElement(By.xpath(\"//a[text()='Software']\")).click();\r\n\t\tdriver.switchTo().window(parentWindow);\r\n\t\tdriver.switchTo().frame(\"gsft_main\");\r\n\r\n\t\tdriver.findElement(By.id(\"lookup.incident.assigned_to\")).click();\r\n\r\n\t\tSet<String> handles2=driver.getWindowHandles();\r\n\t\t//System.out.println(handles2);\r\n\t\tList<String> listHandle2=new ArrayList<String>(handles2);\r\n\t\tString assignToWindow=listHandle2.get(1);\r\n\t\tdriver.switchTo().window(assignToWindow);\r\n\r\n\t\tdriver.findElement(By.xpath(\"//span[text()='Press Enter from within the input to submit the search.']/following::input\")).sendKeys(\"ITIL User\",Keys.ENTER);\r\n\r\n\r\n\t\t//driver.switchTo().window(newWindow);\r\n\t\tdriver.findElement(By.xpath(\"//a[text()='ITIL User']\")).click();\r\n\t\tdriver.switchTo().window(parentWindow);\r\n\t\tdriver.switchTo().frame(\"gsft_main\");\r\n\t\tString notes=\"Updating work notes\";\r\n\t\tdriver.findElement(By.id(\"activity-stream-textarea\")).sendKeys(notes);\r\n\t\tdriver.findElement(By.id(\"sysverb_update_bottom\")).click();\r\n\r\n\t\tWebElement search2=driver.findElement(By.xpath(\"//input[@placeholder='Search']\"));\r\n\t\tsearch2.sendKeys(\"INC0010799\",Keys.ENTER);\r\n\t\t//driver.findElement(By.xpath(\"//a[contains(@class,'formlink')]\")).click();\r\n\t\tString get=driver.findElement(By.xpath(\"//a[contains(text(),'Software')]\")).getText();\r\n\t\tif(get.equals(\"Software\"))\r\n\t\t\tSystem.out.println(\"Incident is assigned to Software group successfully\");\r\n\t\telse\r\n\t\t\tSystem.out.println(\"Incident is not assigned correctly\");\r\n\r\n\t}",
"protected TargetModuleID[] findApplication(String moduleID, ModuleType moduleType, Boolean running) \n throws Exception {\n TargetModuleID[] list = getApplications(moduleType, running);\n return filterTargetModuleIDsByModule(list, moduleID);\n }",
"public void findElementInListByText(String value, By locator) {\n waitForVisibilityOf(locator);\n List<WebElement> listOfElements = findListOfElements(locator);\n if (listOfElements != null && !listOfElements.isEmpty()) {\n for (WebElement element : listOfElements) {\n if (value.toLowerCase(Locale.ROOT).equals(element.getText().toLowerCase(Locale.ROOT))) {\n element.click();\n break;\n }\n }\n } else {\n log.info(\"List is null or empty! Elements not found by locator: [\" + locator + \"]\");\n }\n }",
"String getComponentAppId();",
"public IProgramElement findElementForType(String packageName, String typeName) {\n\n\t\tsynchronized (this) {\n\t\t\t// Build a cache key and check the cache\n\t\t\tStringBuilder keyb = (packageName == null) ? new StringBuilder() : new StringBuilder(packageName);\n\t\t\tkeyb.append(\".\").append(typeName);\n\t\t\tString key = keyb.toString();\n\t\t\tIProgramElement cachedValue = typeMap.get(key);\n\t\t\tif (cachedValue != null) {\n\t\t\t\treturn cachedValue;\n\t\t\t}\n\n\t\t\tList<IProgramElement> packageNodes = findMatchingPackages(packageName);\n\n\t\t\tfor (IProgramElement pkg : packageNodes) {\n\t\t\t\t// this searches each file for a class\n\t\t\t\tfor (IProgramElement fileNode : pkg.getChildren()) {\n\t\t\t\t\tIProgramElement cNode = findClassInNodes(fileNode.getChildren(), typeName, typeName);\n\t\t\t\t\tif (cNode != null) {\n\t\t\t\t\t\ttypeMap.put(key, cNode);\n\t\t\t\t\t\treturn cNode;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\n\t\t// IProgramElement packageNode = null;\n\t\t// if (packageName == null) {\n\t\t// packageNode = root;\n\t\t// } else {\n\t\t// if (root == null)\n\t\t// return null;\n\t\t// List kids = root.getChildren();\n\t\t// if (kids == null) {\n\t\t// return null;\n\t\t// }\n\t\t// for (Iterator it = kids.iterator(); it.hasNext() && packageNode == null;) {\n\t\t// IProgramElement node = (IProgramElement) it.next();\n\t\t// if (packageName.equals(node.getName())) {\n\t\t// packageNode = node;\n\t\t// }\n\t\t// }\n\t\t// if (packageNode == null) {\n\t\t// return null;\n\t\t// }\n\t\t// }\n\n\t\t// // this searches each file for a class\n\t\t// for (Iterator it = packageNode.getChildren().iterator(); it.hasNext();) {\n\t\t// IProgramElement fileNode = (IProgramElement) it.next();\n\t\t// IProgramElement cNode = findClassInNodes(fileNode.getChildren(), typeName, typeName);\n\t\t// if (cNode != null) {\n\t\t// typeMap.put(key, cNode);\n\t\t// return cNode;\n\t\t// }\n\t\t// }\n\t\t// return null;\n\t}",
"public void Case22(){\n System.out.println(\"Testing Case 22\");\n for(int z=1; z<=7; z++) {\n notCarriedProd();\n if(z==1) {\n //Insert search here\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementByXPath(\"//android.widget.ImageButton[contains(@resource-id,'search_button')]\");\n searchBtn.click();\n System.out.println(\"Not Carried Products done\");\n }\n else if(z==2){\n checkByShortName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchShortName = (MobileElement) driver.findElementByXPath(\"//android.widget.EditText[contains(@resource-id,'search_auto_complete_text_view')]\");\n searchShortName.sendKeys(\"Red hot\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementByXPath(\"//android.widget.ImageButton[contains(@resource-id,'search_button')]\");\n searchBtn.click();\n }\n else if(z==3){\n checkByItemCode();\n //Click Search bar and search certain product by Item Code\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchItemCode = (MobileElement) driver.findElementByXPath(\"//android.widget.EditText[contains(@resource-id,'search_auto_complete_text_view')]\");\n searchItemCode.sendKeys(\"CHZZY15436324\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementByXPath(\"//android.widget.ImageButton[contains(@resource-id,'search_button')]\");\n searchBtn.click();\n }\n else if(z==4){\n checkByDescription();\n //Click Search bar and search certain product by Description\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchDescription = (MobileElement) driver.findElementByXPath(\"//android.widget.EditText[contains(@resource-id,'search_auto_complete_text_view')]\");\n searchDescription.sendKeys(\"chEezy\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementByXPath(\"//android.widget.ImageButton[contains(@resource-id,'search_button')]\");\n searchBtn.click();\n }\n else if(z==5){\n checkByBrand();\n //Click Search bar and search certain product by Brand\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchBrand = (MobileElement) driver.findElementByXPath(\"//android.widget.EditText[contains(@resource-id,'search_auto_complete_text_view')]\");\n searchBrand.sendKeys(\"CHEEZY\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementByXPath(\"//android.widget.ImageButton[contains(@resource-id,'search_button')]\");\n searchBtn.click();\n }\n else if(z==6){\n checkByKeyword();\n //Click Search bar and search certain product by Keywords\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchKeyword = (MobileElement) driver.findElementByXPath(\"//android.widget.EditText[contains(@resource-id,'search_auto_complete_text_view')]\");\n searchKeyword.sendKeys(\"CHIPS\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementByXPath(\"//android.widget.ImageButton[contains(@resource-id,'search_button')]\");\n searchBtn.click();\n }\n else if(z==7){\n checkByPrincipal();\n //Click Search bar and search certain product by Principal\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchPrincipal = (MobileElement) driver.findElementByXPath(\"//android.widget.EditText[contains(@resource-id,'search_auto_complete_text_view')]\");\n searchPrincipal.sendKeys(\"Leslie\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementByXPath(\"//android.widget.ImageButton[contains(@resource-id,'search_button')]\");\n searchBtn.click();\n }\n clear();\n }\n System.out.println(\"Case 22 Done\");\n }",
"private void filterApps(int i) {\n Set<PackageInfoData> returnList = new HashSet<>();\n List<PackageInfoData> inputList = new ArrayList<>();\n List<PackageInfoData> allApps = Api.getApps(getApplicationContext(), null);\n if (i >= 0) {\n for (PackageInfoData infoData : allApps) {\n if (infoData != null) {\n if (infoData.appType == i) {\n returnList.add(infoData);\n }\n }\n }\n inputList = new ArrayList<>(returnList);\n } else {\n if (null != allApps) {\n inputList = allApps;\n }\n }\n\n try {\n Collections.sort(inputList, new PackageComparator());\n } catch (Exception e) {\n LogUtil.setTagI(Api.TAG, \"Exception in filter Sorting\");\n }\n\n ArrayAdapter appAdapter = new AppListArrayAdapter(this, getApplicationContext(), inputList);\n this.listview.setAdapter(appAdapter);\n appAdapter.notifyDataSetChanged();\n // restore\n this.listview.setSelectionFromTop(index, top);\n }",
"public static void searchInvalidProduct() throws InterruptedException {\n// 4- test case: search for in search box\n//********************************** step 1 open browser and navigate to url***************************\n // Open Browser and Navigate to URL\n browseSetUp(chromeDriver, chromeDriverPath, url);\n//****************************************<step 2- enter keyword in search box>**********************\n Thread.sleep(2000);\n driver.findElement(By.xpath(\"//*[@id=\\\"headerSearch\\\"]\")).sendKeys(\"milk \");\n Thread.sleep(3000);\n//*******************************************<step 3- click on the search button>**********************************\n driver.findElement(By.cssSelector(\".SearchBox__buttonIcon\")).click();\n//*******************************************<step 4- select the item>**********************************\n driver.findElement(By.cssSelector(\"#products > div > div.js-pod.js-pod-0.plp-pod.plp-pod--default.pod-item--0 > div > div.plp-pod__info > div.pod-plp__description.js-podclick-analytics > a\")).click();\n Thread.sleep(5000);\n//*******************************************<step 5- click to add the item to the cart>**********************************\n driver.findElement(By.xpath(\"//*[@id=\\\"atc_pickItUp\\\"]/span\")).click();\n Thread.sleep(6000);\n driver.close();\n\n\n }",
"public static void main(String[] args) throws InterruptedException{\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \".\\\\driver\\\\chromedriver.exe\");\n\t\t\n\t\t//launch the browser\n\t\tdriver = new ChromeDriver();\n\t\tdriver.manage().window().maximize();\n\n\t\t// implicitwait - different loading times of web elements, so instead of throwing an error immediately we will wait for 15 sec. \n\t\tdriver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);\n\t\t\n\t\t//open the web app\n\t\tdriver.navigate().to(\"https://amazon.in\");\n\t\tString title = driver.getTitle();\n\t\t\n\t\tif(title.equalsIgnoreCase(\"Amazon.in\"))\n\t\t\tSystem.out.println(\"Title matches\");\n\t\telse\n\t\t\tSystem.out.println(title); \n\t\t\n\t\t//locate a web element\n\t\tString tagname = \" \";\n\t\ttagname = driver.findElement(By.cssSelector(\"#nav-link-shopall > span.nav-line-1\")).getText();\n\t\tSystem.out.println(tagname);\n\t\t\n\t\tWebElement category = driver.findElement(By.cssSelector(\"#nav-link-shopall > span.nav-line-2 > span\"));\n\t\tActions action = new Actions(driver);\n\t\taction.moveToElement(category).perform();\n\t\tThread.sleep(1000); //pervent too quick process\n\n\t\t\n\t\tWebElement books = driver.findElement(By.cssSelector(\"#nav-flyout-shopAll > div.nav-template.nav-flyout-content.nav-tpl-itemList > span:nth-child(16) > span.nav-text\"));\n\t\taction.moveToElement(books);\n\t\taction.click();\n\t\taction.perform();\n\t\tThread.sleep(50);\n\t\t\n\t\tWebElement myElement = driver.findElement(By.id(\"twotabsearchtextbox\"));\n\t\tmyElement.sendKeys(\"John Grisham\");\n\t\tThread.sleep(50);\n\t\t\n\t\tdriver.findElement(By.className(\"nav-input\")).click();\n\t\tThread.sleep(1000);\n\t\t\n\t\t//Select the book\n\t\tdriver.findElement(By.partialLinkText(\"Firm\")).click();\n\t\tThread.sleep(1000);\n\t\t\n\t\t\n\t\t//shift the tab control\n\t\tjava.util.Set<String> handles = driver.getWindowHandles();\n\t\tString winHandle1 = driver.getWindowHandle();\n\t\thandles.remove(winHandle1);\n\t\t\n\t\tString winHandle = handles.iterator().next();\n\t\tString winHandle2 = \" \";\n\t\t\n\t\tif(winHandle != winHandle1)\n\t\t{\n\t\t\twinHandle2 = winHandle;\n\t\t\tdriver.switchTo().window(winHandle2);\n\t\t\tSystem.out.println(winHandle2);\n\t\t}\n\t\t\n\t\tThread.sleep(1000);\n\t\t\t\n\t\t\n\t driver.findElement(By.cssSelector(\"#add-to-cart-button\")).click();\n\t Thread.sleep(3000);\n\t \n\t //scroll down until (end\\web element etc.)\n\t JavascriptExecutor js = (JavascriptExecutor) driver;\n\t js.executeScript(\"window.scrollTo(0,document.body.scrollHeight)\");\n\t Thread.sleep(1000);\n\t \n\t driver.close();\n\t driver.quit();\n\t}",
"public List<WebElement> getProductHeaderInWishList()throws Exception{\r\n SearchPageFactory pageFactory = new SearchPageFactory(driver);\r\n List<WebElement> productList = pageFactory.wishListProductList;\r\n return productList;\r\n }",
"public static WebElement lnk_clickUnvSuppName() throws Exception{\r\n \ttry{\r\n \t\telement = driver.findElement(By.xpath(\"(//*[@id='unverifpparea']//p[1]/a)[position()=1]\"));\r\n \t\t\r\n \t\tWebDriverWait wait = new WebDriverWait(driver, 15);\r\n \t\twait.until(ExpectedConditions.elementToBeClickable(element));\r\n \t\t\r\n \t\tJavascriptExecutor executor = (JavascriptExecutor)driver;\r\n \t\texecutor.executeScript(\"argument[0].click()\", element);\r\n \t\tAdd_Log.info(\"Unverified Supplier Name link is NOT found on the page.\");\r\n \t\t\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.info(\"Unverified Supplier Name link is NOT found on the page.\");\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }",
"public List<Product> search(String searchString);"
] | [
"0.6105588",
"0.5755907",
"0.56335485",
"0.56048226",
"0.5417853",
"0.53652865",
"0.52967966",
"0.52389437",
"0.5196522",
"0.5165188",
"0.5090879",
"0.50657016",
"0.50536776",
"0.50391245",
"0.49986675",
"0.49921536",
"0.4984594",
"0.49738666",
"0.49485406",
"0.49409682",
"0.4937219",
"0.49339366",
"0.49262258",
"0.49185222",
"0.4887973",
"0.48292446",
"0.4813668",
"0.48109904",
"0.48032445",
"0.480221",
"0.48020285",
"0.47999153",
"0.4799175",
"0.47873726",
"0.4785055",
"0.47553894",
"0.4749781",
"0.4745861",
"0.47420067",
"0.47375906",
"0.47177848",
"0.47138053",
"0.47129402",
"0.47126612",
"0.47102773",
"0.47066447",
"0.46873757",
"0.46867132",
"0.46787867",
"0.46781605",
"0.46716878",
"0.46706805",
"0.4670115",
"0.46564645",
"0.46520317",
"0.46462375",
"0.464564",
"0.46409917",
"0.46370763",
"0.4634323",
"0.46302092",
"0.46234402",
"0.46127087",
"0.4601347",
"0.4595641",
"0.4590797",
"0.458519",
"0.45850372",
"0.45817986",
"0.45817986",
"0.45817986",
"0.45676562",
"0.45641556",
"0.45586202",
"0.45542884",
"0.45516458",
"0.45420834",
"0.4537793",
"0.453505",
"0.45346716",
"0.45291936",
"0.45252833",
"0.45182967",
"0.45150128",
"0.45138392",
"0.45110238",
"0.4510091",
"0.45063323",
"0.45023984",
"0.45017394",
"0.45005563",
"0.4498654",
"0.44967246",
"0.4496318",
"0.4495669",
"0.4494297",
"0.4493995",
"0.44904178",
"0.44883627",
"0.4485747"
] | 0.75777954 | 0 |
/ INFO: This method provides searching desired account based on App names INPUT: String containing desired App name RETURN: RETURN: WebElement ( will contain 'null' if not found ) | public WebElement getAccontDetails(String myAppName) {
Log.info("Searching for account details for App: " + myAppName);
accountTab.click();
WebElement element = null;
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
for (WebElement myelement : allAccounts) {
if (myelement.getText().contains(myAppName)) {
Log.info("Account details for App" + myAppName + "found");
return myelement;
}
}
Log.info("failed to get account details for App" + myAppName);
return element;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public WebElement getAppFromList(String myAppName) {\n\t\tWebElement myElement = null;\n\t\tfor (WebElement element : allApps) {\n\t\t\tif (element.getText().contains(myAppName)) {\n\t\t\t\tLog.info(\"App Found\");\n\t\t\t\treturn element;\n\t\t\t}\n\t\t}\n\t\treturn myElement;\n\t}",
"private static Elements getResultsFromAppPage(Document doc) {\n Elements results = null;\n try {\n results = doc.getElementsByClass(\"attribute-container\");\n }\n catch (NullPointerException e){\n logger.info(\"no applications tab for current item\");\n return results;\n }\n logger.debug(\"total results \" + results.size());\n\n return results;\n }",
"private WebApp findWebAppForDep(final App.Dependency dep, final Set<WebApp> webApps) {\n\t\tfor (final WebApp webApp : webApps) {\n\t\t\tif (webApp.getFullName().equalsIgnoreCase(dep.getName())) {\n\t\t\t\treturn webApp;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public Account searchAccounts(Account account) {\n\t\treturn null;\r\n\t}",
"@And(\"^I searched for ([^\\\"]*) device$\") //Check do we need this\r\n\tpublic void i_searched_for_a_device(String container3) throws Throwable {\r\n\t\tenduser.fill_fields_from(\"OVActivationPage\",\"US43123-TC24975\",container3);\r\n\t\tenduser.get_container_from_xml(\"OVActivationPage\",\"US43123-TC24975\",container3);\r\n\t\tSystem.out.println(enduser.get_container_from_xml(\"OVActivationPage\",\"US43123-TC24975\",container3));\r\n\t\t//enduser.click_searchBtn();\r\n\t \r\n\t}",
"private Element traverse_search(Element element) {\n \ttry {\n\t \tString userid = profile.getAttributeValue(\"personal\", \"id\");\n\t \tString course = profile.getAttributeValue(\"personal\", \"course\");\n\t \tString context = WOWStatic.config.Get(\"CONTEXTPATH\");\n\n\t \tElement a = doc.createElement(\"a\");\n\t \ta.setAttribute(\"href\", context + \"/Get?wndName=Search\");\n\t \ta.setAttribute(\"target\", userid + \"$\" + course);\n\t \ta.appendChild(doc.createTextNode(\"Search\"));\n\t \treturn (Element)replaceNode(element, a);\n \t}\n \tcatch(Throwable e) {\n \t\te.printStackTrace();\n \t\treturn (Element)replaceNode(element, createErrorElement(\"Error!\"));\n \t}\n }",
"public void searchProd(){\n\t\t\n\t\t// STEP 4:-\n\t\t// Enter 'mobile' in search bar.\n\t\tWebElement search = driver.findElement(By.name(\"q\"));\n\t\tsearch.sendKeys(\"mobiles\");\n\t\tsearch.sendKeys(Keys.ENTER);\n\t\tSystem.out.println(\"Enter name successfully\");\n\t\t\t\t\t\n\t\t// Click on search icon.\n\t\t//WebElement searchClick = driver.findElement(By.className(\"L0Z3Pu\"));\n\t\t//searchClick.click();\n\t\t//System.out.println(\"clicked search button successfully\");\n\t}",
"private Account findAccount(String name, String email) throws AccountNotFoundException {\n for (Account current: accounts) {\n if (name.equals(current.getName()) && email.equals(current.getEmail())) {\n return current;\n }\n }\n throw new AccountNotFoundException();\n }",
"public static WebElement usernamereq(WebDriver driver) {\n\t\telement = driver.findElement(By.xpath(\"//div[contains(text(),' Valid first name is required. ')]\"));\n\t\treturn element;\n\t}",
"public void Search()\r\n {\r\n WaitTime(2000);\r\n \r\n //Generating Alert Using Javascript Executor\r\n if (driver instanceof JavascriptExecutor) \r\n ((JavascriptExecutor) driver).executeScript(\"alert('Logged in account!');\");\r\n \r\n WaitTime(2000);\r\n driver.switchTo().alert().accept();\r\n driver.switchTo().defaultContent();\r\n \r\n driver.findElement(By.cssSelector(\"#searchData\")).sendKeys(\"samsung\");\r\n WaitTime(2000);\r\n driver.findElement(By.cssSelector(\"a.searchBtn\")).click(); \r\n \r\n \r\n //Generating Alert Using Javascript Executor\r\n if (driver instanceof JavascriptExecutor) \r\n ((JavascriptExecutor) driver).executeScript(\"alert('Loaded Search Page');\");\r\n \r\n WaitTime(2000);\r\n driver.switchTo().alert().accept();\r\n driver.switchTo().defaultContent();\r\n\r\n }",
"private static void lookupAccount(String email) {\n\t\t\n\t}",
"public static void main(String[] args) \n\t{\n\t\tWebDriver driver=null;\n\t\tString url =\"http://bing.com\";\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"F:\\\\Seleniumworkspace\\\\webdriverexamples\\\\driverFiles\\\\chromedriver.exe\");\n\t\tdriver=new ChromeDriver();\n\t\n\t\tdriver.get(url);\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\t\t/*\t<input class=\"b_searchbox\" id=\"sb_form_q\" name=\"q\" title=\"Enter your search term\" type=\"search\" value=\"\" maxlength=\"1000\"\n\t\t * autocapitalize=\"off\" autocorrect=\"off\" autocomplete=\"off\" spellcheck=\"false\" aria-controls=\"sw_as\" style=\"\" aria-autocomplete=\"both\" aria-owns=\"sw_as\">\n\t\t\n\t\t\n\t\t*/\n\t\t\n\t\tdriver.findElement(By.id(\"sb_form_q\")).sendKeys(\"Selenium\");\n\t\t//xpath pf bing list //*[@id=\"sa_ul\"]\n\t\t\n\t\tString Search_List_data = driver.findElement(By.xpath(\"//*[@id=\\\"sa_ul\\\"]\")).getText();\n\t\tSystem.out.println(\"the elements related to your search are \"+Search_List_data);\n\t\t\n\t\t\tString expected = \"Livetech\";\n\t\t\tString actual = Search_List_data;\n\t\t\tif(actual.contains(expected))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Element is found\");\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\tSystem.out.println(\"Element not found\");\n\t\t}\ndriver.quit();\t\t\n\t}",
"public static void main(String[] args) {\n\n WebDriver driver= WebDriverFactory.getDriver(\"chrome\");\n\n driver.get(\"https://amazon.com\");\n driver.get(\"https://ebay.com\");\n\n WebElement searchBox=driver.findElement(By.xpath(\"//input[@type='text']\"));\n searchBox.sendKeys(\"books\");\n\n WebElement search=driver.findElement(By.xpath(\"//input[@type='submit']\"));\n search.click();\n\n String actualWord=driver.getTitle();\n\n System.out.println(\"title is: \"+ actualWord);\n\n String expectedWord=\"books\";\n\n if(actualWord.contains(expectedWord)){\n System.out.println(\"Pass\");\n }else{\n System.out.println(\"Fail\");\n System.out.println(\"actualWord = \" + actualWord);\n System.out.println(\"expectedWord = \" + expectedWord);\n }\n\n }",
"private Employee searchEmployee(String empName)\n {\n empName = empName.toLowerCase();\n Employee found = null;\n // Find the employee in the array list\n Iterator<Employee> emp = employees.iterator();\n while(emp.hasNext() && found == null)\n {\n myEmployee = emp.next(); //get employee from array list\n String fullName = myEmployee.getName().toLowerCase();\n String[] FirstLast = fullName.split(\" \");\n \n if (\n matchString(fullName,empName) ||\n matchString(FirstLast[0],empName) ||\n matchString(FirstLast[1],empName)\n )\n found = myEmployee;\n } \n return found;\n }",
"private String searchForUser() {\n String userId = \"\";\n String response = given().\n get(\"/users\").then().extract().asString();\n List usernameId = from(response).getList(\"findAll { it.username.equals(\\\"Samantha\\\") }.id\");\n if (!usernameId.isEmpty()) {\n userId = usernameId.get(0).toString();\n }\n return userId;\n }",
"public String verifyAllAutoNameSearch(String object, String data) {\n\t\tlogger.debug(\"Verifying verifyAllAutoNameSearch\");\n\n\t\ttry {\n\t\t\tThread.sleep(3000);\n\t\t\tList<WebElement> l1 = explictWaitForElementList(object);\n\t\t\tlogger.debug(\"Number of elements found:- \" + l1.size());\n\t\t\tboolean flag = false;\n\t\t\tfor (int i = 0; i < l1.size(); i++) {\n\t\t\t\tWebElement ele = l1.get(i);\n\t\t\t\tString str = ele.getText();\n\t\t\t\tlogger.debug(\"actual string: \" + str);\n\t\t\t\tif (str.toLowerCase().contains(data.toLowerCase())) {\n\t\t\t\t\tflag = true;\n\t\t\t\t} else {\n\t\t\t\t\tlogger.debug(str + \" does not contain \" + data);\n\t\t\t\t\tflag = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (flag)\n\t\t\t\treturn Constants.KEYWORD_PASS + \"--elements in auto search contains the input\";\n\t\t\telse\n\t\t\t\treturn Constants.KEYWORD_FAIL + \"--elements in auto search do not contains the input\";\n\n\t\t} \ncatch(TimeoutException ex)\n\t\t\n\t\t{\n\t\t\treturn Constants.KEYWORD_FAIL +\"Cause: \"+ ex.getCause();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\n\t\t\treturn Constants.KEYWORD_FAIL + e.getLocalizedMessage();\n\n\t\t}\n\n\t}",
"public static void main(String[] args) throws InterruptedException {\n //1- Open a chrome browser\n WebDriver driver=WebDriverUtil.getDriver(\"chrome\");\n\n //2- Go to: https://google.com\n driver.get(\"https://www.google.com\");\n //3- Write \"apple\" in search box\n //driver.findElement(By.name(\"q\")).sendKeys(\"Apple\"); works\n\n //driver.findElement(By.className(\"gLFyf gsfi\")).sendKeys(\"Apple\");\n //having spaces in classname will make your code fail\n //you can remove one part see if it is unique you can locate\n driver.findElement(By.className(\"gLFyf\")).sendKeys(\"Apple\");\n Thread.sleep(1000);\n\n //click i am feeling lucky button\n driver.findElement(By.className(\"RNmpXc\")).click();\n\n //Verify title contains Apple\n\n String actualTitle=driver.getTitle();\n String expectedTitle=\"Apple\";\n\n if (actualTitle.contains(expectedTitle)){\n System.out.println(\"lucky button passed\");\n }else{\n System.out.println(\"lucky button failed\");\n System.out.println(\"actualTitle = \" + actualTitle);\n }\n\n driver.close();\n }",
"public CarerAccount getAccountWithUsername(String search){\n\t\tCarerAccount item = null;\n\n\t\tint count = 0;\n for (int i = 0; i < CarerAccounts.size(); ++i) {\n if (CarerAccounts.get(i).getUsername().equals(search)){\n\t\t\t\tcount++;\n item = CarerAccounts.get(i);\n\t\t\t}\n\t\t}\n\t\treturn item;\n\t}",
"public static void Own_Acc_FCY_To_FCY() {\n try {\n\n\n waitToElement(\"//android.widget.Button[@text='S']\");\n clickHarmburgerMenuBTN();\n waitToElement(\"//android.widget.TextView[@text='Transfers']\");\n AppiumDriver<MobileElement> driver = getAppiumDriver();\n\n MobileElement Transfer = driver.findElementByXPath(\"//android.widget.TextView[@text='Transfers']\");\n Transfer.click();\n waitToElement(\"//android.widget.TextView[@text='Own Accounts']\");\n\n MobileElement OwnAccounts = driver.findElementByXPath(\"//android.widget.TextView[@text='Own Accounts']\");\n OwnAccounts.click();\n waitToElement(\"// android.widget.TextView[@text='V']\");\n MobileElement FromAcc = driver.findElementByXPath(\"// android.widget.TextView[@text='V']\");\n FromAcc.click();\n waitToElement(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\");\n String FromAccIBANNo = getData(\"FromACCIBANNo\");\n List<MobileElement> IBANNo = driver.findElements(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\"));\n System.out.println(IBANNo.size());\n int Namesize = IBANNo.size();\n boolean Flag;\n Flag = false;\n for (int i = 1; i < Namesize + 1; i++) {\n\n String Name = driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).getText();\n System.out.println(Name);\n\n\n if (Name.contains(FromAccIBANNo)) {\n\n driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).click();\n Flag = true;\n break;\n }\n\n }\n\n waitToElement(\"// android.widget.TextView[@text='V' and @index='1']\");\n MobileElement ToAcc = driver.findElementByXPath(\"// android.widget.TextView[@text='V' and @index='1']\");\n ToAcc.click();\n waitToElement(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\");\n String ToBenIBANNo = getData(\"ToACCIBANNo\");\n List<MobileElement> IBANNos = driver.findElements(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\"));\n System.out.println(IBANNos.size());\n int Namesize1 = IBANNos.size();\n boolean Flag1;\n Flag1 = false;\n for (int i = 1; i < Namesize1 + 1; i++) {\n\n String Name1 = driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).getText();\n System.out.println(Name1);\n\n\n if (Name1.contains(ToBenIBANNo)) {\n\n driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).click();\n Flag1 = true;\n break;\n }\n\n }\n\n\n if (Flag1 == true) {\n ReportHelper.logReportStatus(LogStatus.PASS, \"The beneficiary name has been Selected Successfuly']\");\n\n } else {\n ReportHelper.logReportStatus(LogStatus.PASS, \"Unable to Select the beneficary Name']\");\n\n }\n waitToElement(\"//android.widget.EditText[@index='0']\");\n String Bal = getData(\"Amount\");\n MobileElement Balance = driver.findElementByXPath(\"//android.widget.EditText[@index='0']\");\n Balance.sendKeys(Bal);\n waitToElement(\"//android.widget.Button[@text='Continue']\");\n MobileElement continuebtn = driver.findElementByXPath(\"//android.widget.Button[@text='Continue']\");\n continuebtn.click();\n waitToElement(\"//android.widget.Button[@text='Continue']\");\n\n MobileElement confirmtn = driver.findElementByXPath(\"//android.widget.Button[@text='Continue']\");\n confirmtn.click();\n waitToElement(\"//android.widget.TextView[contains(@text,'Ref No ')]\");\n\n String RefNo = driver.findElementByXPath(\"//android.widget.TextView[contains(@text,'Ref No ')]\").getText();\n saveTestDataToDb(\"RefNo\", RefNo);\n Thread.sleep(3000);\n System.out.println(RefNo);\n\n waitToElement(\"//android.widget.TextView[@text='Your transfer was successfully done']\");\n\n MobileElement SuccessMsg = driver.findElementByXPath(\"//android.widget.TextView[@text='Your transfer was successfully done']\");\n\n ReportHelper.logReportStatus(LogStatus.PASS, \"Your transfer was successfully done\");\n waitToElement(\"//android.widget.Button[@text='Go to home']\");\n MobileElement HomeBtn = driver.findElementByXPath(\"//android.widget.Button[@text='Go to home']\");\n HomeBtn.click();\n Thread.sleep(4000);\n\n\n } catch (Exception e) {\n System.out.println(e.getMessage());\n ReportHelper.logReportStatus(LogStatus.FAIL, \"Unable to Delete Beneficary name\");\n }\n }",
"public SelenideElement searchByUser() {\n return formPageRoot().$(By.xpath(\"//input[@type='text']\"));\n }",
"public Application findApplication(String appID) {\n\t\tfor (Application app: getApplications())\n\t\t\tif (app.getApplicationID().equalsIgnoreCase(appID))\n\t\t\t\treturn app;\n\t\treturn null; \n\t}",
"public void allow_Me_To_App(){\n\ttry{\n\tdriver.findElement(clickonOkButton).click();\n\tdriver.findElement(clickOn1stAllowButton).click();\n\tdriver.findElement(clickon2ndAllowButton).click();\n\tdriver.findElement(clickon3rdAllowButton).click();\n\tReusableMethod.waitForPageToLoad(MobileBy.AndroidUIAutomator(\"text(\\\"Let me explore\\\")\"));\n\tdriver.findElement(clickOnLetmeExploreButton).click();\n\tdriver.findElement(clickonOkbutton).click();\n\tlogger.info(\"=====================App Launch sucessfully=====================\");\n\tReusableMethod.implicitWait(10);\n\t\n\t}catch(Exception e){\n\tlogger.error(\"Element Not found Exception ...\",e);\n\t}\n\t\t}",
"@Override\n\t\t\tpublic WebElement apply(WebDriver t) {\n\t\t\t\treturn t.findElement(By.xpath(\"//h3[contains(text(),'Oracle Cloud Applications')]//following::a[1]\"));\n\t\t\t}",
"@Test\r\n public void findShadowDOMWithSeleniumFindElement () {\n WebElement shadowHost = driver.findElement(By.tagName(\"book-app\"));\r\n\r\n // #2 Execute JavaScript To Return The Shadow Root\r\n JavascriptExecutor jsExecutor = (JavascriptExecutor) driver;\r\n WebElement shadowRoot = (WebElement) jsExecutor.executeScript(\r\n \"return arguments[0].shadowRoot\", shadowHost);\r\n\r\n // #3 Find The WebElement Then Perform An Action On The WebElement\r\n WebElement app_header = shadowRoot.findElement(By.tagName(\"app-header\"));\r\n WebElement app_toolbar\r\n = app_header.findElement(By.cssSelector(\".toolbar-bottom\"));\r\n WebElement book_input_decorator\r\n = app_toolbar.findElement(By.tagName(\"book-input-decorator\"));\r\n WebElement searchField = book_input_decorator.findElement(By.id(\"input\"));\r\n searchField.sendKeys(\"Shadow DOM With Find Element\");\r\n }",
"public boolean search(String prodName)\n\t{\n\t WebDriverWait wait = new WebDriverWait(driver, 20);\n wait.until(ExpectedConditions.visibilityOf(driver.findElement(searchbox))).sendKeys(prodName);\n \n //Tap on search after entering prod name\n wait.until(ExpectedConditions.visibilityOf(driver.findElement(searchBTN))).click();\n\t\n // When the page is loaded, verify whether the loaded result contains the name of product or not \n String k = driver.findElement(By.xpath(\"//*[@id=\\\"LST1\\\"]/div/div[1]/div[2]\")).getText();\n boolean p = k.contains(prodName);\n return p;\n \n\t}",
"public void addUserFromSearchResults2(String userName) {\r\n\t\t// may need a wait or method for waiting for list to load\r\n\t\telement(resultsListContainer).waitUntilVisible();\r\n\t\t\r\n\t\tList<WebElement> resultsList = resultsListContainer\r\n\t\t\t\t.findElements(By\r\n\t\t\t\t\t\t.cssSelector(\"tr[class*='yui-dt-even'] td[headers*='fullName'] div h3 a\"));\r\n\r\n\t\tSystem.out.println(\"TTT : \");\r\n\t\tfor (WebElement resultNow : resultsList) {\r\n\t\t\tif (resultNow.getText().contains(userName)) {\r\n\t\t\t\telementFocus(\"\" + resultNow.getCssValue(\"class\")\r\n\t\t\t\t\t\t+ \"span#alf-id2 button\");\r\n\t\t\t\twaitABit(Constants.WAIT_TIME_SHORT);\r\n\t\t\t\telementjQueryClick(\"\" + resultNow.getCssValue(\"class\")\r\n\t\t\t\t\t\t+ \"span#alf-id2 button\");\r\n\t\t\t\twaitABit(Constants.WAIT_TIME_SHORT);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\r\n\t}",
"public WebElement element(String strElement) throws Exception {\n String locator = prop.getProperty(strElement); \n // extract the locator type and value from the object\n String locatorType = locator.split(\";\")[0];\n String locatorValue = locator.split(\";\")[1];\n // System.out.println(By.xpath(\"AppLogo\"));\n \n // for testing and debugging purposes\n System.out.println(\"Retrieving object of type '\" + locatorType + \"' and value '\" + locatorValue + \"' from the Object Repository\");\n \n // wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//input[@id='text3']\")));\n try {\n\n\n \tif(locatorType.equalsIgnoreCase(\"Id\"))\n \t\treturn driver.findElement(By.id(locatorValue)); \n \telse if(locatorType.equalsIgnoreCase(\"Xpath\")) \n \t\t\treturn driver.findElement(By.xpath(locatorValue)); \n// \t\t}catch(Exception e) {\n// \t\t\tdriver.navigate().refresh();\n//\n// \t\t\t@SuppressWarnings({ \"unchecked\", \"deprecation\", \"rawtypes\" })\n// \t\t\tWait<WebDriver> wait = new FluentWait(driver) \n// \t\t\t.withTimeout(8, TimeUnit.SECONDS) \n// \t\t\t.pollingEvery(1, TimeUnit.SECONDS) \n// \t\t\t.ignoring(NoSuchElementException.class);\n// \t\t\twait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath(locatorValue))));\n// \t\t\treturn driver.findElement(By.xpath(locatorValue)); \n// \t\t}\n \n \n \n else if(locatorType.equalsIgnoreCase(\"Name\"))\n \treturn driver.findElement(By.name(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Classname\")) \n \treturn driver.findElement(By.className(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Tagname\"))\n \treturn driver.findElement(By.className(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Linktext\"))\n \treturn driver.findElement(By.linkText(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Partiallinktext\"))\n \treturn driver.findElement(By.partialLinkText(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Cssselector\")) \n \treturn driver.findElement(By.cssSelector(locatorValue));\n\n \n } catch (NoSuchElementException | StaleElementReferenceException e) {\n \t\t\n if(locatorType.equalsIgnoreCase(\"Id\"))\n return driver.findElement(By.id(locatorValue)); \n else if(locatorType.equalsIgnoreCase(\"Xpath\")) \n return driver.findElement(By.xpath(locatorValue)); \n else if(locatorType.equalsIgnoreCase(\"Name\"))\n \treturn driver.findElement(By.name(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Classname\")) \n \treturn driver.findElement(By.className(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Tagname\"))\n \treturn driver.findElement(By.className(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Linktext\"))\n \treturn driver.findElement(By.linkText(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Partiallinktext\"))\n \treturn driver.findElement(By.partialLinkText(locatorValue));\n else if(locatorType.equalsIgnoreCase(\"Cssselector\")) \n \treturn driver.findElement(By.cssSelector(locatorValue));\n }\n throw new NoSuchElementException(\"Unknown locator type '\" + locatorType + \"'\"); \n \t}",
"public static void Own_Acc_FCY_To_Onepack() {\n try {\n\n\n waitToElement(\"//android.widget.Button[@text='S']\");\n clickHarmburgerMenuBTN();\n waitToElement(\"//android.widget.TextView[@text='Transfers']\");\n AppiumDriver<MobileElement> driver = getAppiumDriver();\n\n MobileElement Transfer = driver.findElementByXPath(\"//android.widget.TextView[@text='Transfers']\");\n Transfer.click();\n waitToElement(\"//android.widget.TextView[@text='Own Accounts']\");\n\n MobileElement OwnAccounts = driver.findElementByXPath(\"//android.widget.TextView[@text='Own Accounts']\");\n OwnAccounts.click();\n waitToElement(\"// android.widget.TextView[@text='V']\");\n MobileElement FromAcc = driver.findElementByXPath(\"// android.widget.TextView[@text='V']\");\n FromAcc.click();\n waitToElement(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\");\n String FromAccIBANNo = getData(\"FromACCIBANNo\");\n List<MobileElement> IBANNo = driver.findElements(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\"));\n System.out.println(IBANNo.size());\n int Namesize = IBANNo.size();\n boolean Flag;\n Flag = false;\n for (int i = 1; i < Namesize + 1; i++) {\n\n String Name = driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).getText();\n System.out.println(Name);\n\n\n if (Name.contains(FromAccIBANNo)) {\n\n driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).click();\n Flag = true;\n break;\n }\n\n }\n\n waitToElement(\"// android.widget.TextView[@text='V' and @index='1']\");\n MobileElement ToAcc = driver.findElementByXPath(\"// android.widget.TextView[@text='V' and @index='1']\");\n ToAcc.click();\n waitToElement(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\");\n String ToBenIBANNo = getData(\"ToACCIBANNo\");\n List<MobileElement> IBANNos = driver.findElements(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\"));\n System.out.println(IBANNos.size());\n int Namesize1 = IBANNos.size();\n boolean Flag1;\n Flag1 = false;\n for (int i = 1; i < Namesize1 + 1; i++) {\n\n String Name1 = driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).getText();\n System.out.println(Name1);\n\n\n if (Name1.contains(ToBenIBANNo)) {\n\n driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).click();\n Flag1 = true;\n break;\n }\n\n }\n\n\n if (Flag1 == true) {\n ReportHelper.logReportStatus(LogStatus.PASS, \"The beneficiary name has been Selected Successfuly']\");\n\n } else {\n ReportHelper.logReportStatus(LogStatus.PASS, \"Unable to Select the beneficary Name']\");\n\n }\n waitToElement(\"//android.widget.EditText[@index='0']\");\n String Bal = getData(\"Amount\");\n MobileElement Balance = driver.findElementByXPath(\"//android.widget.EditText[@index='0']\");\n Balance.sendKeys(Bal);\n waitToElement(\"//android.widget.Button[@text='Continue']\");\n MobileElement continuebtn = driver.findElementByXPath(\"//android.widget.Button[@text='Continue']\");\n continuebtn.click();\n waitToElement(\"//android.widget.Button[@text='Continue']\");\n\n MobileElement confirmtn = driver.findElementByXPath(\"//android.widget.Button[@text='Continue']\");\n confirmtn.click();\n waitToElement(\"//android.widget.TextView[contains(@text,'Ref No ')]\");\n\n String RefNo = driver.findElementByXPath(\"//android.widget.TextView[contains(@text,'Ref No ')]\").getText();\n saveTestDataToDb(\"RefNo\", RefNo);\n Thread.sleep(3000);\n System.out.println(RefNo);\n\n waitToElement(\"//android.widget.TextView[@text='Your transfer was successfully done']\");\n\n MobileElement SuccessMsg = driver.findElementByXPath(\"//android.widget.TextView[@text='Your transfer was successfully done']\");\n\n ReportHelper.logReportStatus(LogStatus.PASS, \"Your transfer was successfully done\");\n waitToElement(\"//android.widget.Button[@text='Go to home']\");\n MobileElement HomeBtn = driver.findElementByXPath(\"//android.widget.Button[@text='Go to home']\");\n HomeBtn.click();\n Thread.sleep(4000);\n\n\n } catch (Exception e) {\n System.out.println(e.getMessage());\n ReportHelper.logReportStatus(LogStatus.FAIL, \"Unable to Delete Beneficary name\");\n }\n }",
"@Test public void shouldReturnTheToolIntTheListWhenSearchedByItsName() {\n\t\tgiven.imInTheMainPage();\n\t\twhen.searchByAToolName(TOOLS.ADPWEB.toolName());\n\t\tthen.mySearchWillReturnTheTools(TOOLS.ADPWEB);\n\t}",
"@Override\n\tpublic AccountBean[] findByName(String name) {\n\t\treturn null;\n\t}",
"@Override\n public Optional<Utilizador> search(String username, List<Utilizador> list) {\n for (Utilizador u : list) {\n if (u.getUsername().equals(username)) {\n return Optional.of(u);\n }\n }\n return Optional.empty();\n }",
"public static void Own_Acc_Onepack_To_FCY() {\n try {\n\n\n waitToElement(\"//android.widget.Button[@text='S']\");\n clickHarmburgerMenuBTN();\n waitToElement(\"//android.widget.TextView[@text='Transfers']\");\n AppiumDriver<MobileElement> driver = getAppiumDriver();\n\n MobileElement Transfer = driver.findElementByXPath(\"//android.widget.TextView[@text='Transfers']\");\n Transfer.click();\n waitToElement(\"//android.widget.TextView[@text='Own Accounts']\");\n\n MobileElement OwnAccounts = driver.findElementByXPath(\"//android.widget.TextView[@text='Own Accounts']\");\n OwnAccounts.click();\n waitToElement(\"// android.widget.TextView[@text='V']\");\n MobileElement FromAcc = driver.findElementByXPath(\"// android.widget.TextView[@text='V']\");\n FromAcc.click();\n waitToElement(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\");\n String FromAccIBANNo = getData(\"FromACCIBANNo\");\n List<MobileElement> IBANNo = driver.findElements(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\"));\n System.out.println(IBANNo.size());\n int Namesize = IBANNo.size();\n boolean Flag;\n Flag = false;\n for (int i = 1; i < Namesize + 1; i++) {\n\n String Name = driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).getText();\n System.out.println(Name);\n\n\n if (Name.contains(FromAccIBANNo)) {\n\n driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).click();\n Flag = true;\n break;\n }\n\n }\n\n waitToElement(\"// android.widget.TextView[@text='V' and @index='1']\");\n MobileElement ToAcc = driver.findElementByXPath(\"// android.widget.TextView[@text='V' and @index='1']\");\n ToAcc.click();\n waitToElement(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\");\n String ToBenIBANNo = getData(\"ToACCIBANNo\");\n List<MobileElement> IBANNos = driver.findElements(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup//android.widget.TextView[@index='1']\"));\n System.out.println(IBANNos.size());\n int Namesize1 = IBANNos.size();\n boolean Flag1;\n Flag1 = false;\n for (int i = 1; i < Namesize1 + 1; i++) {\n\n String Name1 = driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).getText();\n System.out.println(Name1);\n\n\n if (Name1.contains(ToBenIBANNo)) {\n\n driver.findElement(By.xpath(\"//android.support.v7.widget.RecyclerView//android.view.ViewGroup[\" + i + \"]//android.widget.TextView[@index='1']\")).click();\n Flag1 = true;\n break;\n }\n\n }\n\n\n if (Flag1 == true) {\n ReportHelper.logReportStatus(LogStatus.PASS, \"The beneficiary name has been Selected Successfuly']\");\n\n } else {\n ReportHelper.logReportStatus(LogStatus.PASS, \"Unable to Select the beneficary Name']\");\n\n }\n waitToElement(\"//android.widget.EditText[@index='0']\");\n String Bal = getData(\"Amount\");\n MobileElement Balance = driver.findElementByXPath(\"//android.widget.EditText[@index='0']\");\n Balance.sendKeys(Bal);\n waitToElement(\"//android.widget.Button[@text='Continue']\");\n MobileElement continuebtn = driver.findElementByXPath(\"//android.widget.Button[@text='Continue']\");\n continuebtn.click();\n waitToElement(\"//android.widget.Button[@text='Continue']\");\n\n MobileElement confirmtn = driver.findElementByXPath(\"//android.widget.Button[@text='Continue']\");\n confirmtn.click();\n waitToElement(\"//android.widget.TextView[contains(@text,'Ref No ')]\");\n\n String RefNo = driver.findElementByXPath(\"//android.widget.TextView[contains(@text,'Ref No ')]\").getText();\n saveTestDataToDb(\"RefNo\", RefNo);\n Thread.sleep(3000);\n System.out.println(RefNo);\n\n waitToElement(\"//android.widget.TextView[@text='Your transfer was successfully done']\");\n\n MobileElement SuccessMsg = driver.findElementByXPath(\"//android.widget.TextView[@text='Your transfer was successfully done']\");\n\n ReportHelper.logReportStatus(LogStatus.PASS, \"Your transfer was successfully done\");\n waitToElement(\"//android.widget.Button[@text='Go to home']\");\n MobileElement HomeBtn = driver.findElementByXPath(\"//android.widget.Button[@text='Go to home']\");\n HomeBtn.click();\n Thread.sleep(4000);\n\n\n } catch (Exception e) {\n System.out.println(e.getMessage());\n ReportHelper.logReportStatus(LogStatus.FAIL, \"Unable to Delete Beneficary name\");\n }\n }",
"@Override\n protected List<ElementSearch> fw_findElementsBy(String PropType, String PropValue)\n {\n List<ElementSearch> temp_lst = new ArrayList<>();\n if (PropValue.contains(\"|\"))\n {\n String[] valueList = PropValue.split(\"\\\\|\");\n for (String eachValue : valueList) {\n if ((eachValue != null) && (eachValue.length() > 0))\n {\n temp_lst.addAll(((WebElement)element).findElements(Utilities.getIdentifier(PropType, eachValue)).stream().map(ElementObject::new).collect(Collectors.toList()));\n }\n }\n }\n else\n {\n temp_lst.addAll(((WebElement)element).findElements(Utilities.getIdentifier(PropType, PropValue)).stream().map(ElementObject::new).collect(Collectors.toList()));\n }\n //END HERE\n return temp_lst;\n }",
"public Account findAccount(String login) {\r\n\t\tfor (Account account : listOfAccounts)\r\n\t\t\tif (account.getLogin().equals(login)) return account;\r\n\t\treturn null;\r\n\t}",
"public static void main(String[] args) {\n WebDriver driver = WebDriverFactory.getDriver(\"chrome\");\n driver.get(\"https://www.amazon.com/\");\n\n WebElement searchBox = driver.findElement(By.id(\"twotabsearchtextbox\"));\n searchBox.sendKeys(\"selenium cookbook\" + Keys.ENTER);\n\n WebElement searchedItem = driver.findElement(By.xpath(\"//span[.=\\\"Selenium Testing Tools Cookbook - Second Edition\\\"]\"));\n System.out.println(searchedItem.getText());\n if(searchedItem.isDisplayed()){\n System.out.println(\"pass\");\n }else{\n System.out.println(\"fail\");\n }\n\n\n\n }",
"public static Object findElement(List<Object> elements, QName elementName) {\n\t\tif (elements == null) {\n\t\t\treturn null;\n\t\t}\n\t\tfor (Object element : elements) {\n\t\t\tif (elementName.equals(getElementQName(element))) {\n\t\t\t\treturn element;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"private void searchforResults() {\n\n List<String> queryList = new SavePreferences(this).getStringSetPref();\n if(queryList != null && queryList.size() > 0){\n Log.i(TAG, \"Searching for results \" + queryList.get(0));\n Intent searchIntent = new Intent(Intent.ACTION_WEB_SEARCH);\n searchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n searchIntent.putExtra(SearchManager.QUERY, queryList.get(0));\n this.startActivity(searchIntent);\n }\n }",
"public String searchArrayList(int increment, String username) {\n if (registeredUsers.contains(username)) {\n for (int i = 0; i < registeredUsers.size(); i += 3) {\n if (registeredUsers.get(i).equals(username))\n return registeredUsers.get(i+increment);\n }\n }\n return null;\n }",
"public Boolean enterAndSearchProductName(String productName,int expProduct)\n\t{ Boolean status=false;\n\tString vSearchBoxValue=searchTextBox.getAttribute(\"value\");\n\tif (!vSearchBoxValue.equals(\"\"))\n\t{\n\t\tsearchTextBox.clear();\n\t}\n\tsearchTextBox.sendKeys(productName);\n\ttry {\n\t\tThread.sleep(4000);\n\t} catch (InterruptedException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\tsearchTextBox.sendKeys(Keys.ENTER);\n\tList<WebElement> getProductIdlstWebElmnts=driver.findElements(By.xpath(\"//div[@class='s-main-slot s-result-list s-search-results sg-row']//div[starts-with(@data-component-type,'s-search-result')]\"));\n\tWebDriverWait wt2= new WebDriverWait(driver,30);\n\twt2.until(ExpectedConditions.visibilityOfAllElements(getProductIdlstWebElmnts));\n\tcollectnToStorePrdktIdLst.add(getProductIdlstWebElmnts.get(expProduct).getAttribute(\"data-asin\") );\n\ttry\n\t{ if (getProductIdlstWebElmnts.get(expProduct).getAttribute(\"data-asin\")!=\"\")\n\t{List<WebElement> getProductNamelstWebelement=driver.findElements(By.xpath(\"//div[@class='s-main-slot s-result-list s-search-results sg-row']//div[starts-with(@data-component-type,'s-search-result')]//h2//a\"));\n\tString getProductNameText=getProductNamelstWebelement.get(expProduct).getText();\n\tcollectnToStorePrdktNameLst.add(getProductNameText);\t\n\tgetProductNamelstWebelement.get(expProduct).click();\n\tstatus=true;\n\t}\n\t}catch(Exception e)\n\t{\n\t\tSystem.out.println(e);\n\t}\n\treturn status;\n\t}",
"public void searchByAccount() {\n\t\t\n\t\tlog.log(Level.INFO, \"Please Enter the account number you want to search: \");\n\t\tint searchAccountNumber = scan.nextInt();\n\t\tbankop.search(searchAccountNumber);\n\n\t}",
"String getComponentAppId();",
"Customer search(String login);",
"@Override\r\n\tpublic List<User> search(String name) {\n\t\treturn null;\r\n\t}",
"public static void searchFriends(String name) {\n\t\tScanner reader = new Scanner(System.in);\t\n\t\tSystem.out.println(\"Please Enter the Profile Name of the Person you need to Search\");\n\t\tString profilename = reader.nextLine();\n\t\t\n\t\t\n\t\tif(profiles.get(index.indexOf(name)).searchFriends(profilename)) {\n\t\t\tSystem.out.println(\"Yes \" + name + \" is a friend of \"+ profilename);\t\n\t\t}else {\n\t\t\tSystem.out.println(\"No \" + name + \" is not a friend of \"+ profilename);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Click Enter to go back to Menu\");\n\t\t\n\t\tString input = reader.nextLine();\n\n\t\t\t\n\t\n\t}",
"public static WebElement individualreg(WebDriver driver)\n\t{\n\t\telement = driver.findElement(By.xpath(\"//h4[contains(text(),'Individual Account')]\"));\n\t\treturn element;\n\t}",
"public static void main(String[] args) throws SQLException {\n\n\tSystem.setProperty(\"webdriver.chrome.driver\", \"chromedriver\");\n\t\tWebDriver driver = new ChromeDriver();\n\t\tdriver.get(\"https://www.amazon.in/\");\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(50000, TimeUnit.MILLISECONDS);\n\t\t\n\t\t//Amezon database\n\t \n\t Connection con = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/Amazon\",\"root\",\"root\");\n\t Statement stmt = con.createStatement(); \n\t ResultSet rs = stmt.executeQuery(\"select * from elct\"); \n\t \n\t \n\t WebElement AllCategoryDropdown = driver.findElement(By.xpath(\"//select[@title ='Search in']\"));\n\t \tSelect category = new Select(AllCategoryDropdown) ;\n\t \t\n\t \tWebElement searchField = driver.findElement(By.xpath(\"//input[@name ='field-keywords']\"));\n\t \t\n\t \t\n\t \t \n\t \twhile(rs.next()) {\n String cat = rs.getNString(1);\n category.selectByVisibleText(cat);\n \n String searchValue = rs.getString(2);\n searchField.sendKeys(searchValue);\n \n\t \t } \n\t \n\t \tWebElement submitValue = driver.findElement(By.xpath(\"//input[@type ='submit']\"));\n submitValue.click();\n\t \t\n\t \tList<WebElement> resultList = driver.findElements(By.xpath(\"//*[@data-component-type='s-search-result']\"));\n\t \tSystem.out.println(\"Total search count : \" + resultList.size());\n\t \n\t \tWebElement resultMsg = driver.findElement(By.xpath(\"//*[contains(text(), '1-24')]\"));\n\t \tString assertionMsg = resultMsg.getText();\n\t \tString msg = \"1-24 of over 60,000 results for\";\n\t \t\n\t \tif(assertionMsg.equals(msg))\n\t \t{\n\t \t\tSystem.out.println(\"Assertion Pass\");\n\t \t}\n\t \t\n\t \telse {\n\t \t\t\n\t \t\tSystem.out.println(\"Assertion Failed\");\n\t \t}\n\t \t\n\t \tList<WebElement> resultName = driver.findElements(By.xpath(\"//span[@class='a-size-medium a-color-base a-text-normal']\"));\n\t \t\n\t \t\n\t \tfor(int i=0;i <resultList.size();i++) \t\n\t\t {\n\t \t\tString mobileName = resultName.get(i).getText();\n\t \t\tSystem.out.println(\"Mobile name : \" + mobileName);\n }\t\n\t \t\n\t \t\n\t \t\n\t\t \n\n \t\n\t\n\n }",
"public ArrayList<Guest> searchGuestList(String name) {\n \tString checkName = name.toUpperCase();\n \tArrayList<Guest> result = new ArrayList<>();\n \tfor(Guest guest : guestList){\n if(guest.getName().toUpperCase() != null && guest.getName().toUpperCase().contains(checkName)) {\n \tresult.add(guest);\n }\n }\n \treturn result;\n }",
"private void filter(String text) {\n List<UserModel> filterdNames = new ArrayList<>();\n\n //looping through existing elements\n for (UserModel item : userModels) {\n //if the existing elements contains the search input\n if (item.getFirstName().toLowerCase().contains(text.toLowerCase())||item.getId().toLowerCase().contains(text.toLowerCase())||item.getEmail().toLowerCase().contains(text.toLowerCase())){\n //adding the element to filtered list\n filterdNames.add(item);\n }\n }\n userAdapter.filterList(filterdNames);\n }",
"public WebElement findElementByName(String NameValue) {\n\t\ttry {\n\t\t\tElement = driver.findElement(By.name(NameValue));\n\n\t\t} catch (Exception e) {\n\n\t\t\te.printStackTrace();\n\n\t\t}\n\t\treturn Element;\n\n\t}",
"@Override\r\n\tpublic Account findByName(String name) {\n\t\treturn null;\r\n\t}",
"T get(String installedAppId);",
"public static WebElement getInspectionUsername(WebDriver driver) throws Exception\r\n\t{ \r\n\t\ttry{\r\n\t\t\telement = driver.findElement(By.xpath(project_elements.Inspection_Username));\r\n }catch (Exception e){\r\n\t\t\t \r\n\t\t\tLog.error(\"Inspection Username Element not found -->\" + project_elements.Inspection_Username);\r\n\t\t\t throw(e);\r\n \t\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t Log.info(\"Inspection Username Element found\");\r\n\t\t\t return element;\r\n\t}",
"public static void main(String[] args) {\n\r\n\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\Javed_1\\\\Automation_Of_Coding\\\\Automation\\\\Driver\\\\chromedriver.exe\");\t\r\n\t\r\n\tWebDriver driver = new ChromeDriver();\r\n\tdriver.get(\"http://www.facebook.com\");\r\n\tdriver.manage().window().maximize();\r\n\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\r\n\tWebElement username = driver.findElement(By.id(\"email\"));\r\n\t\r\n\tusername.sendKeys(\"[email protected]\");\r\n\t\r\n\tWebElement password= driver.findElement(By.id(\"pass\"));\r\n\tpassword.sendKeys(\"virginia786\");\r\n\tWebElement Button = driver.findElement(By.id(\"u_0_b\"));\r\n\tButton.click();\r\n\tWebElement account= driver.findElement(By.xpath(\"//i[@class='hu5pjgll lzf7d6o1 sp_0Y_EE8spOmD sx_3234a9']\"));\r\n\taccount.click();\r\n\t}",
"public String ssoApple() throws InterruptedException {\n this.scrollBy(signupApple);\n helperMethods.waitForWebElementToBeInteractable(signupApple,30);\n signupApple.click();\n ssoSubscribeCheck.click();\n ssoTermsCheck.click();\n submitSSO.click();\n while (!helperMethods.waitForPageToLoad()) {\n helperMethods.waitForPageToLoad();\n }\n //Since we are navigating to third party adding thread.sleep\n Thread.sleep(7000);\n return webDriver.getTitle();\n }",
"private static void searchStaffByName(){\n\t\tshowMessage(\"type the name you are looking for: \\n\");\n\t\tString name = getUserTextTyped();\n\t\tToScreen.listEmployee(EmployeeSearch.employee(employee.getAllEmployee(),name), true);\n\t\t\n\t\t//condition to do another search by name or go back to the main menu\n //if the user decide for doing another search the method is called again, otherwise it will go back to the main menu\n\t\tint tryAgain = askForGoMainMenu(\"Would you like to search for another name or go back to main menu?\\n Type 1 to search someone else \\n Type 0 to go to menu. \\n Choice: \");\n\t\tif(tryAgain == 1){\n\t\t\tsearchStaffByName();\n\t\t} else {\n\t\t\tmain();\n\t\t}\n\t}",
"public void Case25(){\n System.out.println(\"Testing Case 25\");\n for(int z=1; z<=7; z++) {\n infoFilter();\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement cancelBtn = (MobileElement) driver.findElementById(\"android:id/button2\");\n String cancelBtnText = cancelBtn.getText();\n System.out.println(\"Clicked \"+cancelBtnText);\n cancelBtn.click();\n infoFilterCurrentInvent();\n if(z==1) {\n checkByName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchName.sendKeys(\"amoxil\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Name\");\n }\n else if(z==2){\n checkByShortName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchShortName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchShortName.sendKeys(\"Amoxil 500mg\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Short Name\");\n }\n else if(z==3){\n checkByItemCode();\n //Click Search bar and search certain product by Item Code\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchItemCode = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchItemCode.sendKeys(\"51232167\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Short Name\");\n }\n else if(z==4){\n checkByDescription();\n //Click Search bar and search certain product by Description\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchDescription = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchDescription.sendKeys(\"Capsule\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Description\");\n }\n else if(z==5){\n checkByBrand();\n //Click Search bar and search certain product by Brand\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchBrand = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchBrand.sendKeys(\"Amoxil\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Brand\");\n }\n else if(z==6){\n checkByKeyword();\n //Click Search bar and search certain product by Keywords\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchKeyword = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchKeyword.sendKeys(\"AmOxIl\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Keyword\");\n }\n else if(z==7){\n checkByPrincipal();\n //Click Search bar and search certain product by Principal\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchPrincipal = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchPrincipal.sendKeys(\"GlaxoSmithKline\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Principal\");\n }\n\n }\n System.out.println(\"Case 25 Done\");\n }",
"@Step(\"Work Order ServiceActivity Search Lookup\")\n public boolean lookupWorkOrderServiceActivitySearch(String searchText) {\n boolean flag = false;\n try {\n pageActions.clickAt(assignToMeBtn, \"Clicking on Assign to me button\");\n pageActions.clickAt(itemizedCostsButton, \"Clicking on Itemized Cost Button\");\n new WebDriverWait(driver, 45)\n .until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(itemizedFrame));\n logger.info(\"Switched to ItemizedCost Frame successfully\");\n new WebDriverWait(driver, 30).until(ExpectedConditions.visibilityOf(itemizedSubmitButton));\n pageActions.selectDropDown(itemize_CostType, \"Local Job Code\");\n pageActions.clickAt(localJobCodeLookup, \"Clicking on Local Job Code Look Up Search\");\n\n SeleniumWait.hold(GlobalVariables.ShortSleep);\n functions.switchToWindow(driver, 1);\n pageActions.selectDropDown(wrkOrdLookupSearchBy, \"Short Description\");\n pageActions.typeAndPressEnterKey(wrkOrdLookupSearch, searchText,\n \"Searching in the lookUp Window\");\n pageActions.typeAndPressEnterKey(shortDescriptionSearch, searchText,\n \"Searching in the lookUp Window Grid\");\n new WebDriverWait(driver, 30).until(ExpectedConditions\n .elementToBeClickable(By.xpath(\"//td[contains(text(),'\" + searchText + \"')]\")));\n flag =\n driver.findElement(By.xpath(\"//td[contains(text(),'\" + searchText + \"')]\")).isDisplayed();\n } catch (Exception e) {\n e.printStackTrace();\n System.out.println(e.getMessage());\n }\n finally {\n functions.switchToWindow(driver, 0);\n }\n return flag;\n }",
"@Test\r\n public void findShadowDOMWithoutSeleniumFindElement () {\n JavascriptExecutor jsExecutor\r\n = (JavascriptExecutor) driver;\r\n\r\n // Execute JavaScript To Return A WebElement\r\n WebElement bookSearchField = (WebElement) jsExecutor.executeScript(\r\n \"return document.querySelector(\\\"body > book-app\\\").\" +\r\n \"shadowRoot.querySelector(\\\"#input\\\")\");\r\n\r\n // Perform An Action On The WebElement\r\n bookSearchField.sendKeys(\"Shadow DOM Without Find Element\");\r\n }",
"public abstract OneCampaignAbstract accessToElementSearched(final String key, final String element);",
"List<UserRepresentation> searchUserAccount(final String username);",
"public static void main(String[] args) {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\wnnar\\\\eclipse-workspace\\\\SeleniumS\\\\Drivers\\\\chromedriver.exe\");\n\t\tWebDriver driver = new ChromeDriver();\n\t\t\n\t\tdriver.get(\"https://www.amazon.com\");\n\t\tdriver.manage().window().maximize();\n\t\t\n\t\tWebElement Search = driver.findElement(By.id(\"twotabsearchtextbox\"));\n\t\tSearch.sendKeys(\"Phones\");\n\t\t\n\t\tWebElement SButton = driver.findElement(By.id(\"nav-search-submit-text\"));\n\t\tSButton.click();\n\t\t\n\t\t/* Absolute Path and Relative Xpath\n\t\t * 1) Open the facebook page\n\t\t * 2)Enter the email and password\n\t\t * 3) Click login\n\t\t * 4) Click forgot password\n\t\t * 5) come back to login page\n\t\t * 6) Clcik to create an account\n\t\t */\n\t}",
"public static WebSecurity getByName(String name) {\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\n\t\t\tWebSecurity result = VALUES_ARRAY[i];\n\t\t\tif (result.getName().equals(name)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public void Case28(){\n System.out.println(\"Testing Case 25\");\n for(int z=1; z<=7; z++) {\n infoFilter();\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement cancelBtn = (MobileElement) driver.findElementById(\"android:id/button2\");\n String cancelBtnText = cancelBtn.getText();\n System.out.println(\"Clicked \"+cancelBtnText);\n cancelBtn.click();\n infoFilterWeeklyOfftake();\n if(z==1) {\n checkByName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchName.sendKeys(\"amoxil\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Name\");\n }\n else if(z==2){\n checkByShortName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchShortName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchShortName.sendKeys(\"Amoxil 500mg\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Short Name\");\n }\n else if(z==3){\n checkByItemCode();\n //Click Search bar and search certain product by Item Code\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchItemCode = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchItemCode.sendKeys(\"51232167\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Short Name\");\n }\n else if(z==4){\n checkByDescription();\n //Click Search bar and search certain product by Description\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchDescription = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchDescription.sendKeys(\"Capsule\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Description\");\n }\n else if(z==5){\n checkByBrand();\n //Click Search bar and search certain product by Brand\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchBrand = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchBrand.sendKeys(\"Amoxil\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Brand\");\n }\n else if(z==6){\n checkByKeyword();\n //Click Search bar and search certain product by Keywords\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchKeyword = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchKeyword.sendKeys(\"AmOxIl\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Keyword\");\n }\n else if(z==7){\n checkByPrincipal();\n //Click Search bar and search certain product by Principal\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchPrincipal = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchPrincipal.sendKeys(\"GlaxoSmithKline\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Principal\");\n }\n\n }\n System.out.println(\"Case 25 Done\");\n }",
"@Override\r\npublic List<ThirdPartyAppsList> findAll()\r\n{\nArrayList<ThirdPartyAppsList> appsList = new ArrayList<>();\r\n//adding providers to the List\r\nappsList.add(new ThirdPartyAppsList(\"15645367\",\"Aetna\",\"My Data My Health\" ,\"Naveen\",\"Regidtered since: Dec-2020\"));\r\nappsList.add(new ThirdPartyAppsList(\"15645367\",\"Aetna\",\"Virtual Viewer\",\"Snow bound\",\"Regidtered since: Mar-2017\"));\r\nappsList.add(new ThirdPartyAppsList(\"15645367\",\"Aetna\",\"hapi.fhir\",\"Apache\",\"Regidtered since: June-2017\"));\r\nappsList.add(new ThirdPartyAppsList(\"15645367\",\"Aetna\",\"Dummy Heading3\",\"Dummy Owner Name\",\"Regidtered since: Aug-2016\"));\r\nappsList.add(new ThirdPartyAppsList(\"15645367\",\"Aetna\",\"Dummy Heading4\",\"Dummy Owner Name\",\"Regidtered since: Sep-2018\"));\r\nappsList.add(new ThirdPartyAppsList(\"15645367\",\"Aetna\",\"Dummy Heading5\",\"Owner Name\",\"Regidtered since: Oct-2019\"));\r\nreturn appsList;\r\n}",
"private List<IUser> userSearch(IChannel root, String str) {\n List<IUser> list = new LinkedList<IUser>();\n userSearch(root, str, list);\n return list;\n }",
"public boolean searchCertainItem(String itemname, String tableName)\n {\n String selectStr;\n ResultSet rs;\n try{\n\n selectStr=\"SELECT \"+itemname+\" FROM \"+tableName;\n rs = stmt.executeQuery(selectStr);\n\n while (rs.next())\n {\n return true;\n }\n }catch(Exception e){\n System.out.println(\"Error occurred in searchLogin\");\n }\n\n return false;\n\n }",
"public List<User> searchUser(String searchValue);",
"@Override\n\tpublic List<Account> getAccountsByName(String name) {\n\t\treturn jdbcTemplate.query(\"select * from account where locate(?, name)>0 \", new Object[]{name}, new BeanPropertyRowMapper(Account.class));\n\t}",
"public void Case27(){\n System.out.println(\"Testing Case 27\");\n for(int z=1; z<=7; z++) {\n infoFilter();\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement cancelBtn = (MobileElement) driver.findElementById(\"android:id/button2\");\n String cancelBtnText = cancelBtn.getText();\n System.out.println(\"Clicked \"+cancelBtnText);\n cancelBtn.click();\n infoFilterDailyOfftake();\n if(z==1) {\n checkByName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchName.sendKeys(\"amoxil\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Name\");\n }\n else if(z==2){\n checkByShortName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchShortName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchShortName.sendKeys(\"Amoxil 500mg\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Short Name\");\n }\n else if(z==3){\n checkByItemCode();\n //Click Search bar and search certain product by Item Code\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchItemCode = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchItemCode.sendKeys(\"51232167\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Short Name\");\n }\n else if(z==4){\n checkByDescription();\n //Click Search bar and search certain product by Description\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchDescription = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchDescription.sendKeys(\"Capsule\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Description\");\n }\n else if(z==5){\n checkByBrand();\n //Click Search bar and search certain product by Brand\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchBrand = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchBrand.sendKeys(\"Amoxil\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Brand\");\n }\n else if(z==6){\n checkByKeyword();\n //Click Search bar and search certain product by Keywords\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchKeyword = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchKeyword.sendKeys(\"AmOxIl\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Keyword\");\n }\n else if(z==7){\n checkByPrincipal();\n //Click Search bar and search certain product by Principal\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchPrincipal = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchPrincipal.sendKeys(\"GlaxoSmithKline\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Principal\");\n }\n\n }\n System.out.println(\"Case 27 Done\");\n\n }",
"private String findDisplayName(String emailText) {\n for (User user : userList) {\n //Log.i(TAG, \"findDisplayName() : for loop\");\n if (user.getEmail().equals(emailText)) {\n //Log.i(TAG, \"emailText: \" + emailText);\n //Log.i(TAG, \"user.getEmail(): \" + user.getEmail());\n //Log.i(TAG, \"user.getUserName(): \" + user.getUserName());\n if (user.getUserName() == null) {\n break;\n }\n return user.getUserName();\n }\n }\n return \"No UserName\";\n }",
"void checkForApps();",
"public interface AccountsPage extends Page {\n\n /**\n * Return the UI element of 'Login ID' field.\n *\n * @return the UI element of 'Login ID' field\n */\n WebElement getLoginIDField();\n\n /**\n * Return the UI element of 'Name' field.\n *\n * @return the UI element of 'Name' field\n */\n WebElement getNameField();\n\n /**\n * Return the UI element of 'Organization' field.\n *\n * @return the UI element of 'Organization' field\n */\n WebElement getOrganizationField();\n\n /**\n * Return the UI element of 'Status' select field.\n *\n * @return the UI element of 'Status' select field\n */\n WebElement getStatusSelectField();\n\n /**\n * Return the UI element of 'Search' button.\n *\n * @return the UI element of 'Search' button\n */\n WebElement getSearchButton();\n\n /**\n * Return the UI element of the table record at the given index, which starts from 1.\n *\n * @param idx The index of the table record.\n * @return the UI element of the table record at the given index\n */\n WebElement getTableRecordAtIndex(int idx);\n\n /**\n * Return the UI element of the column of the given table record with the column name.\n *\n * @param tableRecord the table record\n * @param columnName the column name\n * @return the UI element of the column\n */\n WebElement getColumnByName(WebElement tableRecord, String columnName);\n\n /**\n * Return the UI element of 'New Account' button.\n *\n * @return the UI element of 'New Account' button\n */\n WebElement getNewAccountButton();\n\n /**\n * Open the 'New Account' page.\n *\n * @return 'New Account' page object\n */\n NewAccountPage openNewAccountPage();\n\n /**\n * Open the 'Edit Account' page by the given Login ID text.\n *\n * @param loginID Login ID text\n * @return 'Edit Account' page object\n * @throws NoSuchElementException if the account being requested does not exist.\n */\n EditAccountPage openEditAccountPageByLoginID(String loginID) throws NoSuchElementException;\n\n}",
"public String getLogin(String vapp) throws ProductInstallatorException {\r\n String login = null;\r\n DocumentBuilder builder;\r\n Document doc;\r\n\r\n DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r\n\r\n try {\r\n builder = factory.newDocumentBuilder();\r\n doc = builder.parse(new InputSource(new StringReader(vapp)));\r\n\r\n NodeList nodes = doc.getElementsByTagName(VAPPPROPERTY_TAG);\r\n\r\n for (int i = 0; i < nodes.getLength(); i++) {\r\n Node property = nodes.item(i);\r\n\r\n if (property.getAttributes().getNamedItem(VAPP_KEYATTRIBUTE_TAG).getTextContent()\r\n .equals(USERNAMEATTRIBUTE_VALUE))\r\n login = property.getAttributes().getNamedItem(VAPP_VALUEATTRIBUTE_TAG).getTextContent();\r\n }\r\n\r\n } catch (ParserConfigurationException e) {\r\n String msg = \"Error parsing vapp . Desc: \" + e.getMessage();\r\n log.info(msg);\r\n throw new ProductInstallatorException(msg);\r\n } catch (SAXException e) {\r\n String msg = \"Error parsing vapp . Desc: \" + e.getMessage();\r\n log.info(msg);\r\n throw new ProductInstallatorException(msg);\r\n } catch (IOException e) {\r\n String msg = \"IOException . Desc: \" + e.getMessage();\r\n log.info(msg);\r\n throw new ProductInstallatorException(msg);\r\n }\r\n return login;\r\n }",
"public boolean checkAccountAction(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue = false;\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement Tab = myAccount.findElement(By.className(\"adminTable5\"));\n\t\tString elementPageSource = Tab.getAttribute(\"outerHTML\");\n\t\tif (elementPageSource.contains(\"deactivate.png\")) {\n\t\t\tLog.info(myAppName + \" account is activated\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(myAppName + \" account is deactivated\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public void Case2(){\n System.out.println(\"Testing Case 2\");\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchName.sendKeys(prodName);\n// driver.hideKeyboard();\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Case 2 Done\");\n// //Condition where if prod is displayed or not\n// MobileElement snackBar = (MobileElement) driver.findElementByXPath(\"//android.widget.TextView[contains(@resource-id, 'snackbar_text') and @text = 'Text Note is Required']\");\n// boolean isDisplayed1 = snackBar.isDisplayed();\n// if (isDisplayed1) {\n// System.out.println(\"Snack bar text displayed: Text Note is Required\");\n// } else if (!isDisplayed1) {\n// System.out.println(\"Failed: Snack bar text does not displayed\");\n// }\n }",
"java.lang.String getAppName();",
"java.lang.String getAppName();",
"java.lang.String getAppName();",
"public static void main(String[] args) {\n WebDriverManager.chromedriver().setup();\n WebDriver driver = new ChromeDriver();\n driver.manage().window().maximize();\n\n //go to google.com\n driver.get(\"https:/www.google.com\");\n\n // search in google apple\n driver.findElement(By.name(\"q\")).sendKeys(\"apple\"+ Keys.ENTER);\n //make sure name is matching with expected name\n String expectedInTitle= \"apple\";\n String actualInTitle= driver.getTitle();\n if (actualInTitle.startsWith(expectedInTitle)){\n System.out.println(\"Test case Passed\");\n }else{\n System.out.println(\"title verification Failed\");\n }\n }",
"public static void main(String[] args) {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Users\\\\My\\\\Downloads\\\\chromedriver_win32\\\\chromedriver.exe\");\n\t\tWebDriver driver = new ChromeDriver();\n\t\tdriver.get(\"https://www.amazon.com/\");\n\t\tWebElement search= driver.findElement(By.id(\"twotabsearchtextbox\"));\n\t\tsearch.sendKeys(\"books\");\n\t\tsearch.click();\n\t\tString searchattempt = driver.getTitle();\n\t\tString expectedtite = \"Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more\";\n\t\tif(expectedtite == searchattempt) {\n\t\t\tSystem.out.println(\"the execution is success\");\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"exection is failed\");\n\t\t\t\n\t\t}\n\t\t\t\t\n\t\tdriver.quit();\n\t\t \n\n\t}",
"public void checkProductflipkart(WebDriver driver){\r\n\t\t\r\n\t\tdriver.get(\"flipkart.com\");\r\n\t\tif(driver.getTitle().toString().equalsIgnoreCase(\"Flipkart\")){\r\n\t\t\t\r\n\t\t\tWebElement search=driver.findElement(By.xpath(\"xpath for search bar/element\"));\r\n\t \tsearch.sendKeys(\"iphone7\");\r\n\t \tdriver.findElement(By.id(\"searchbutton\")).click();\r\n\t \r\n\t \t// check results found or not, if found we can see text like - showing 1 of 24 results else it will\r\n\t \t// show No results found etc;\r\n\t \tWebElement resultsText=driver.findElement(By.xpath(\"xpath for below string element\"); \t\r\n\t \t\r\n\t \tif(resultsText.toString().contains(\"Showing 1 – 24 of 93 results for iphone\")){\r\n\t \t\t//print in the console\r\n\t \t\tSystem.out.println(\"results found for iphone\");\r\n\t // or use testng asssert statement to validate\r\n\t \t\t\r\n\t \t}else{\r\n\t \t\tSystem.out.println(\"No results found \");\r\n\t \t}\r\n\t \t// copy paste same logic for any other website\r\n\t // using webtable to read the iphone price, write separately for filpkart and snapdeal\r\n\t \t//used later\r\n\t \tList<String> savepricelist= new ArrayList<String>();\r\n\t // target table\t\r\n\t \tWebElement table=driver.findElement(\"//*td[@id='iphone']/tbody\");\r\n\t \t//find no of rows\r\n\t \tList<WebElement>rows=table.findElements(By.tagName(\"tr\"));\r\n\t \t// iterate no.of rows\r\n\t \tfor (WebElement eachrow: rows){\r\n\t \t// find out how many cols available in the table\r\n\t \t\tList<WebElement>cols=eachrow.findElements(By.tagName(\"td\"));\r\n\t \t\t// iterate each col in each row\r\n\t \t\tfor (WebElement eachcell: cols){\r\n\t \t\t\t\r\n\t \t\t\t if(eachcell.getText().contains(\"iphone7\".trim()){\r\n\t \t\t\t\t// just tell them \r\n\t \t\t\t\tWebElement modelname=//xpath for modelname\r\n\t \t\t\t WebElement linktoproduct=//write xpath for share button link\r\n\t \t\t\t\t \t\t\t \r\n\t \t\t\t WebElement price=driver.findElement(\"price xpath\");\r\n\t \t\t\t savepricelist.add(price.getText().toString());\r\n\t \t\t\t // adding all elements into array list\r\n\t \t\t\t break;\r\n\t \t\t\t}\r\n\t \t\t}\r\n\t \t\t// by default sorts in asending order\r\n\t \t\tCollections.sort(savepricelist);\r\n\t \t\tSystem.out.println(savepricelit);\r\n\t \t\t// it prints the elements in ascending order \r\n\t // similarly we can write for 2nd site & print in ascending order\r\n\t \t\t\r\n\t \t\t\r\n\t \t}\r\n\t \t\r\n\t\t}\r\n\t\t\r\n\t}",
"public void Case26(){\n System.out.println(\"Testing Case 26\");\n for(int z=1; z<=7; z++) {\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement cancelBtn = (MobileElement) driver.findElementById(\"android:id/button2\");\n String cancelBtnText = cancelBtn.getText();\n System.out.println(\"Clicked \"+cancelBtnText);\n cancelBtn.click();\n infoFilterEstimatedInventory();\n if(z==1) {\n checkByName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchName = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_auto_complete_text_view\");\n searchName.sendKeys(\"\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementById(\"com.engagia.android:id/search_button\");\n searchBtn.click();\n System.out.println(\"Search by Name\");\n }\n else if(z==2){\n byShortName();\n }\n else if(z==3){\n byItemCode();\n }\n else if(z==4){\n byDescription();\n }\n else if(z==5){\n byBrand();\n }\n else if(z==6){\n byKeyword();\n }\n else if(z==7){\n byPrincipal();\n }\n clear();\n }\n System.out.println(\"Case 26 Done\");\n }",
"public static void main(String[] args) throws InterruptedException {\nSystem.setProperty(\"webdriver.chrome.driver\", \"D:\\\\chromedriver.exe\");\nWebDriver driver=new ChromeDriver();\n\n\t//GET \t\n\t\t//driver.get(\"https://www.facebook.com/\");\n//driver.manage().window().maximize();\n//driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\t\t\n\t//NAVIGATE\n\t\tdriver.navigate().to(\"https://www.amazon.com/\");\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\t\tdriver.findElement(By.xpath(\"//input[@type='text']\")).sendKeys(\"womenshoes\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit']\")).click();\n\t\tdriver.findElement(By.xpath(\"//span[text()='PUMA']\")).click();\n\t\tList<WebElement> shoes=driver.findElements(By.xpath(\"//span[@class='a-size-base-plus a-color-base a-text-normal']\"));\n\t\tSystem.out.println(shoes.size());\n\t\tfor(int i=0;i<shoes.size();i++) {\n\t\t\tif(shoes.get(i).getText().equals(\"PUMA Women's Vikky Sneaker\")) {\n\t\t\t\tshoes.get(i).click();\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tThread.sleep(5000);\n\t\t\n\t\t\n\t\n//\t\tWebElement size=driver.findElement(By.xpath(\"//span[@class='a-dropdown-prompt']\"));\n//\t\tSelect sel=new Select(size);\n//\t\tsel.selectByIndex(1);\n//\t\tdriver.findElement(By.xpath(\"//input[@id='buy-now-button']\")).click();\n//\t\tdriver.findElement(By.xpath(\"//input[@id='ap_email']\")).sendKeys(\"[email protected]\");\n//\t\tdriver.findElement(By.xpath(\"//input[@id='continue']\")).click();\n\t\t\ndriver.quit();\n\t}",
"public static void Execute(AppiumDriver driver) throws Exception \r\n\t\r\n\t{\n\t\t\tString sUserName = ExcelUtils.getCellData(3, 1);\r\n\t\t\tLog.info(\"Username from Excel sheet is \"+sUserName);\r\n\t\t\tString sPassword = ExcelUtils.getCellData(3, 2);\r\n\t\t\tLog.info(\"Password from Excel sheet is \"+sPassword);\r\n\t\t\tString Searchvalue = ExcelUtils.getCellData(17, 1);\r\n\t\t\tLog.info(\"Search string fetched from Data sheet is \"+Searchvalue);\r\n\t\t\t\t\r\n\t\t\t//LOGIN TO THE APPLICATION\r\n\t\t\tLogin_Out.LoginMail(driver, sUserName, sPassword);\t\r\n\t\t\t\r\n\t\t\t//NAVIGATING TO THE SEARCH FIELD FOR SEARCHING\r\n\t\t\tSearch.search_Collection(driver, Searchvalue);\r\n\t\t\tExcelUtils.setCellData(\"Pass\", 17, 7);\r\n\t\t\tScreenshots.takeScreenshots(driver, \"17_Collections_Search_Result_Pass\");\r\n\t\t\tEventWrapper.back(driver);\r\n\t\t\t\r\n\t\t\t//LOGOUT\r\n\t\t\tLogin_Out.Logout(driver);\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"java.lang.String getLoginAccount();",
"java.lang.String getLoginAccount();",
"public boolean clickMatchingelementByText(By elementList, String itemName) {\n\t\tboolean res = false;\n\t\ttry {\n\t\t\tThread.sleep(implicitWaitTimeout*1000);\n\t\t\tList<WebElement> matchelements = getListOfMatchingElements(elementList);\n\t\t\tif (matchelements.size() > 0) {\n\t\t\t\tfor (int elecount = 0; elecount < matchelements.size(); elecount++) { // to get index of element\n\t\t\t\t\tSystem.out.println(matchelements.get(elecount).getText());\n\t\t\t\t\tif (matchelements.get(elecount).getText().equalsIgnoreCase(itemName)) {\n\t\t\t\t\t\t// reqindex = elecount;\n\t\t\t\t\t\tclickUsingJavaScript(matchelements.get(elecount));\n\t\t\t\t\t\tres = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (itemName.equalsIgnoreCase(\"anyitem\")) { // click first item\n\t\t\t\t\t\tclickUsingJavaScript(matchelements.get(elecount));\n\t\t\t\t\t\tres = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Exception Caught To click on Element Identifier :\" + elementList + \" With String name:\"\n\t\t\t\t\t+ itemName);\n\t\t}\n\n\t\treturn res;\n\n\t}",
"private WebElement getCheckBoxElementWithoutSearchbyText(String widgetID, String value) {\n/* 53 */ List<WebElement> elementsList = this.webdriver.findElements(By.xpath(\".//*[@id='attribute-tree-\" + widgetID + \"']//span[text() = '\" + value + \"']\"));\n/* 54 */ if (elementsList.size() > 0) {\n/* 55 */ return elementsList.get(0);\n/* */ }\n/* 57 */ return null;\n/* */ }",
"private FileObject findServiceArchiveForName(String appName) throws FileSystemException {\n List<FileObject> serviceArchives\n = Utils.findChildrenWithSuffix(deploymentDirectoryFile,\n com.stratuscom.harvester.Strings.JAR);\n //Then find the one that starts with the client name\n for (FileObject fo : serviceArchives) {\n if (fo.getName().getBaseName().startsWith(appName + com.stratuscom.harvester.Strings.DASH)) {\n return fo;\n }\n }\n return null;\n }",
"public static void main(String[] args) throws InterruptedException {\n\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"F:\\\\selenium driver\\\\chromedriver.exe\");\r\n\t\tWebDriver driver = new ChromeDriver();\r\n\t\t\r\n\t\tdriver.get(\"https://www.google.com/\");\r\nWebElement value =\tdriver.findElement(By.xpath(\"//input[@class='gLFyf gsfi']\"));\r\n\t\t\r\n value.sendKeys(\"testing\");\r\n Thread.sleep(2000);\r\n\t\t\t\r\nList<WebElement> list = driver.findElements(By.xpath(\"//ul[@class='erkvQe']//li/div/div/div[@class='sbl1']/span\"));\r\n\t\t\t\r\n//\"//ul[@class='erkvQe']//li/div/div/div[@class='sbl1']/span\")\r\n\r\n//\"//ul[@class='erkvQe']//li//div[@class='sbl1']/span\r\n\r\n\r\n\r\nint sizeoflist =list.size();\r\n\r\n\r\n//this will print the xpath of every webelement\r\nSystem.out.println(list);\r\n\r\nSystem.out.println(\"Size of list is : \" +sizeoflist );\r\n\r\nfor (WebElement webElement : list) \r\n\r\n{\r\n\t\r\nString nameofsuggestion =\twebElement.getText();\r\n\r\nSystem.out.println(nameofsuggestion);\r\n\t\r\n}\r\n\t}",
"public String searchByName(String name){\n for(Thing things: everything){\n if(things.getName().equalsIgnoreCase(name)){\n return things.toString();\n }\n }\n return \"Cannot Find given Name\";\n }",
"public Account getAccountByOwnerAndName(String user,String accountName);",
"public List<WebElement> locateElements(String type, String value) {\n\t\ttry {\r\n\t\t\tswitch(type.toLowerCase()) {\r\n\t\t\tcase \"id\": return getter().findElements(By.id(value));\r\n\t\t\tcase \"name\": return getter().findElements(By.name(value));\r\n\t\t\tcase \"class\": return getter().findElements(By.className(value));\r\n\t\t\tcase \"link\": return getter().findElements(By.linkText(value));\r\n\t\t\tcase \"xpath\": return getter().findElements(By.xpath(value));\r\n\t\t\t}\r\n\t\t} catch (NoSuchElementException e) {\r\n\t\t\tSystem.err.println(\"The Element locator:\"+type+\" value not found: \"+value);\r\n\t\t\tthrow new RuntimeException();\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public static void main(String[] args) {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\r\n\t\t\t\t\"C:\\\\Users\\\\SPH-Saravana\\\\Desktop\\\\SeleniumWebdriverwithJAVAcourse\\\\chromedriver_win32\\\\chromedriver.exe\");\r\n\t\tWebDriver driver;\r\n\t\tdriver = new ChromeDriver();\r\n\r\n\t\tString url = \"https://testhing.com/academy/demo/webelements/\";\r\n\t\t// To navigate to the URL\r\n\t\tdriver.get(url);\r\n\t\t// Maximize the page\r\n\t\tdriver.manage().window().maximize();\r\n\t\t// Wait\r\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\r\n\r\n\t\t// X-Path\r\n\t\t// Syntax - tag[@attribute='value'] - Alert button \r\n//\t\tdriver.findElement(By.xpath(\"//input[@onclick='displayAlert()']\")).click();\r\n\r\n\t\t// Absolute X Path and Relative X Path\r\n\t\t// Absolute XPath - / = Finds the immediate element below the parent element\r\n\r\n\t\t// Usage of Absolute and Relative XPath - Testhing logo\r\n//\t\tdriver.findElement(By.xpath(\"html/body/div/header//a[@rel='home']\")).click();\r\n\r\n\t\t// How to build an effective X-Path - Academy\r\n//\t\t driver.findElement(By.xpath(\"html/body/div/header/div/div/div//nav//ul/li[2]/a\")).click();\r\n\r\n\t\t// Using text to find the element - Contact Us\r\n\t\t//tagname[@attribute='value']//a[text()='value']\r\n//\t\t driver.findElement(By.xpath(\"//div[@class='main-navigation']//a[text()='Contact Us']\")).click();\r\n\r\n\t\t// Using contains to find the element\r\n\t\t// Syntax: //tag[contains(@attribute,'value')]\r\n\t\t// a[contains(href,'Contact Us')] - Example 1 - Open tab\r\n\t\t driver.findElement(By.xpath(\"//a[contains(@id,'open')]\")).click();\r\n\t\t\r\n\t\t// Using multiple contains\r\n\t\t// Example 2 - Alert button\r\n\t\t// Syntax: //tag[contains(@attribute,'value') and contains(@attribute,value)]\r\n//\t\t driver.findElement(By.xpath(\"//input[contains(@class,'btn-style') and contains(@onclick,'displayAlert()')]\")).click();\r\n\r\n//\t\tUsing starts with to find the element-Open Window\r\n//\t\tSyntax: //tagname[starts-with(@attribute,'value')]\r\n//\t\tdriver.findElement(By.xpath(\"//button[starts-with(@class,'btn-style')]\")).click();\r\n\r\n\t\t// How to find Parent and Sibling Nodes - Academy\r\n\t\t// Parent Node\r\n\t\t// xpath of element//parent::<tag>\r\n\t\t// Preceding Sibling\r\n\t\t// xpath of element//preceding-sibling::<tag>\r\n\t\t// Following sibling\r\n\t\t// xpath of element//following-sibling::<tag>\r\n//driver.findElement(By.xpath(\"//li[@id='menu-item-1124']//parent::ul//preceding-sibling::li//following-sibling::li\")).click();\r\n\r\n\t}",
"public void Case22(){\n System.out.println(\"Testing Case 22\");\n for(int z=1; z<=7; z++) {\n notCarriedProd();\n if(z==1) {\n //Insert search here\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementByXPath(\"//android.widget.ImageButton[contains(@resource-id,'search_button')]\");\n searchBtn.click();\n System.out.println(\"Not Carried Products done\");\n }\n else if(z==2){\n checkByShortName();\n //Click Search bar and search certain product by Name\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchShortName = (MobileElement) driver.findElementByXPath(\"//android.widget.EditText[contains(@resource-id,'search_auto_complete_text_view')]\");\n searchShortName.sendKeys(\"Red hot\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementByXPath(\"//android.widget.ImageButton[contains(@resource-id,'search_button')]\");\n searchBtn.click();\n }\n else if(z==3){\n checkByItemCode();\n //Click Search bar and search certain product by Item Code\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchItemCode = (MobileElement) driver.findElementByXPath(\"//android.widget.EditText[contains(@resource-id,'search_auto_complete_text_view')]\");\n searchItemCode.sendKeys(\"CHZZY15436324\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementByXPath(\"//android.widget.ImageButton[contains(@resource-id,'search_button')]\");\n searchBtn.click();\n }\n else if(z==4){\n checkByDescription();\n //Click Search bar and search certain product by Description\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchDescription = (MobileElement) driver.findElementByXPath(\"//android.widget.EditText[contains(@resource-id,'search_auto_complete_text_view')]\");\n searchDescription.sendKeys(\"chEezy\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementByXPath(\"//android.widget.ImageButton[contains(@resource-id,'search_button')]\");\n searchBtn.click();\n }\n else if(z==5){\n checkByBrand();\n //Click Search bar and search certain product by Brand\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchBrand = (MobileElement) driver.findElementByXPath(\"//android.widget.EditText[contains(@resource-id,'search_auto_complete_text_view')]\");\n searchBrand.sendKeys(\"CHEEZY\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementByXPath(\"//android.widget.ImageButton[contains(@resource-id,'search_button')]\");\n searchBtn.click();\n }\n else if(z==6){\n checkByKeyword();\n //Click Search bar and search certain product by Keywords\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchKeyword = (MobileElement) driver.findElementByXPath(\"//android.widget.EditText[contains(@resource-id,'search_auto_complete_text_view')]\");\n searchKeyword.sendKeys(\"CHIPS\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementByXPath(\"//android.widget.ImageButton[contains(@resource-id,'search_button')]\");\n searchBtn.click();\n }\n else if(z==7){\n checkByPrincipal();\n //Click Search bar and search certain product by Principal\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n MobileElement searchPrincipal = (MobileElement) driver.findElementByXPath(\"//android.widget.EditText[contains(@resource-id,'search_auto_complete_text_view')]\");\n searchPrincipal.sendKeys(\"Leslie\");\n //Click Magnifying Glass Icon\n MobileElement searchBtn = (MobileElement) driver.findElementByXPath(\"//android.widget.ImageButton[contains(@resource-id,'search_button')]\");\n searchBtn.click();\n }\n clear();\n }\n System.out.println(\"Case 22 Done\");\n }",
"public static void main(String[] args) {\n System.setProperty(\"webdriver.chrome.driver\",\"src/main/resources/chromedriver.exe\");\n //setting the chrome options before defining the driver\n ChromeOptions options = new ChromeOptions();\n //set the driver to be maximized\n options.addArguments(\"start-maximized\");\n //set the driver to be incognito\n options.addArguments(\"incognito\");\n //run the driver in headless mode\n //options.addArguments(\"headless\");\n\n\n //defining the web driver that you will be using\n WebDriver driver = new ChromeDriver(options); //options variable should be passed here\n//create array list\n ArrayList<String> firstname = new ArrayList<>();\n firstname.add(\"Johnny\");\n firstname.add(\"Tony\");\n firstname.add(\"Barry\");\n\n ArrayList<String> lastname = new ArrayList<>();\n lastname.add(\"Robbie\");\n lastname.add(\"Papi\");\n lastname.add(\"Mama\");\n\n\n ArrayList<String> month = new ArrayList<>();\n month.add(\"June\");\n month.add(\"May\");\n month.add(\"July\");\n\n ArrayList<String> day = new ArrayList<>();\n day.add(\"12\");\n day.add(\"11\");\n day.add(\"10\");\n\n ArrayList<String> year = new ArrayList<>();\n year.add(\"1966\");\n year.add(\"1969\");\n year.add(\"1976\");\n\n ArrayList<String> SSN = new ArrayList<>();\n SSN.add(\"111222\");\n SSN.add(\"111224\");\n SSN.add(\"111265\");\n\n\n ArrayList<String> zipcode = new ArrayList<>();\n zipcode.add(\"11223\");\n zipcode.add(\"11224\");\n zipcode.add(\"11225\");\n //for loop\n\n for(int i = 0; i < firstname.size(); i++) {\n\n //navigate to uhc.com\n driver.navigate().to(\"https://www.UHC.com\");\n //click on find a doctor link\n Reusable_Method.click(driver, \"//*[@aria-label='Find a Doctor']\", \"Find a Doctor\");\n //click on find a provider\n Reusable_Method.click(driver, \"//*[@id='btn-sign-in']\", \"Find a Provider\");\n\n //need to store get window handles command in as ArrayList to switch to different tab(S)\n ArrayList<String> tabs = new ArrayList<>(driver.getWindowHandles());\n //switch to second tab\n driver.switchTo().window(tabs.get(1));\n\n //click on register now\n Reusable_Method.click(driver, \"//*[@id='registerbutton']\", \"Register Button\");\n //id='piFirstName'\n\n //enter firstname\n Reusable_Method.sendKeys(driver,\"//*[@id='firstName']\",firstname.get(i),\"First Name Field\");\n\n //enter last name\n Reusable_Method.sendKeys(driver,\"//*[@id='lastName']\",lastname.get(i),\"First Name Field\");\n\n //click month\n Reusable_Method.click(driver, \"//*[@id='dob_month_input']\", \"month Field\");\n\n //select month\n Reusable_Method.DropDown(driver,\"//*[@id='dob_month_input']\",month.get(i),\"month Field\");\n //id='dob_month_input'\n\n //enter day\n Reusable_Method.sendKeys(driver,\"//*[@id='dob_day']\",day.get(i),\"Day Field\");\n\n //enter year\n Reusable_Method.sendKeys(driver,\"//*[@id='dob_year']\",year.get(i),\"Year Field\");\n\n //click no\n Reusable_Method.click(driver, \"//*[@id='ssn_container']\", \"SSN button Field\");\n\n //enter social\n Reusable_Method.sendKeys(driver,\"//*[@id='ssnLastSixDigits']\",SSN.get(i),\"SSN Field\");\n\n //enter zip\n Reusable_Method.sendKeys(driver,\"//*[@id='zipCode']\",zipcode.get(i),\"zipcode Field\");\n //click continue\n Reusable_Method.click(driver, \"//*[@id='submitBtn']\", \"Continue Field\");\n //capture error\n Reusable_Method.Capture(driver,\"//*[@class='ErrorContent--3ZzRv']\",\"Error Field\");\n //close window\n driver.close();\n //switch back to previous tab\n driver.switchTo().window(tabs.get(0));\n //renavigate back to UHC\n driver.navigate().to(\"https://www.UHC.com\");\n\n\n\n\n\n\n\n\n }// end of loop\n\n\n\n\n\n\n\n\n\n\n }",
"public Utente containUsername(String username) {\r\n \t\r\n \tfor(Utente ut: utenti) {\r\n \t\tString us=ut.getUsername();\r\n \t\tif(us.equals(username)) {\r\n \t\t\treturn ut;\r\n \t\t}\r\n \t}\r\n \t\r\n \treturn null;\r\n \t\r\n }",
"@Override\npublic void findElement(String by) {\n\t\n}",
"public Element findByName(String name) {\n for (Element element : this){\n if (element.getName().equals(name)) return element;\n }\n return null;\n }",
"public static void Android_meembah_Invalid_users() {\n try {\n\n AppiumDriver<MobileElement> driver = getAppiumDriver();\n Thread.sleep(2000);\n MobileElement el1 = driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.ViewFlipper/android.widget.RelativeLayout/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup/android.view.ViewGroup[1]/android.widget.EditText\");\n el1.click();\n\n String userName = getData(\"UserName\");\n el1.sendKeys(userName);\n driver.hideKeyboard();\n MobileElement el2 = driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.ViewFlipper/android.widget.RelativeLayout/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup/android.view.ViewGroup[3]/android.widget.EditText\");\n String password = getData(\"Password\");\n\n el2.sendKeys(password);\n Thread.sleep(3000);\n driver.hideKeyboard();\n ReportHelper.logReportStatus(LogStatus.PASS, \"UserName and Password Given Successfully\");\n\n MobileElement loginBtn = driver.findElementByXPath(\"//android.widget.Button[@text='Login']\");\n loginBtn.click();\n\n Thread.sleep(4000);\n MobileElement Errormsg = driver.findElementByXPath(\"//android.widget.TextView[@text='Please enter a valid username or password and try again']\");\n\n if (Errormsg.isDisplayed()) {\n Thread.sleep(2000);\n ReportHelper.logReportStatus(LogStatus.PASS, \"Please enter a valid username or password and try again\");\n MobileElement e2 = driver.findElementByXPath(\"//android.widget.Button[@text='Go To Home']\");\n e2.click();\n Thread.sleep(2000);\n }\n\n } catch (Exception e) {\n ReportHelper.logReportStatus(LogStatus.FAIL, \"Login into the application\");\n\n }\n }"
] | [
"0.7245342",
"0.56928384",
"0.54089975",
"0.5293681",
"0.5077739",
"0.50566155",
"0.5012349",
"0.4993455",
"0.4990637",
"0.49799663",
"0.49777573",
"0.49672598",
"0.49571142",
"0.49471804",
"0.49346182",
"0.4932054",
"0.4930501",
"0.49264959",
"0.49230915",
"0.49156383",
"0.49057162",
"0.4894487",
"0.4874349",
"0.48726752",
"0.48633873",
"0.48357922",
"0.4822614",
"0.481598",
"0.48155698",
"0.4814868",
"0.48067713",
"0.48045263",
"0.48021036",
"0.47923768",
"0.4791619",
"0.47744426",
"0.47707778",
"0.47650898",
"0.47564846",
"0.47553128",
"0.47490734",
"0.47436196",
"0.47409168",
"0.4737933",
"0.4721089",
"0.46923438",
"0.46918657",
"0.46904993",
"0.4681647",
"0.467521",
"0.46656507",
"0.46621305",
"0.46621135",
"0.46598288",
"0.46570438",
"0.46528572",
"0.46525642",
"0.46448466",
"0.46442172",
"0.46369785",
"0.4635985",
"0.4629708",
"0.46172196",
"0.4610326",
"0.4602877",
"0.46014044",
"0.46003535",
"0.45943728",
"0.45932943",
"0.45911795",
"0.45909336",
"0.45863476",
"0.4581419",
"0.45777303",
"0.45766068",
"0.45710832",
"0.45710832",
"0.45710832",
"0.45703664",
"0.45677218",
"0.45637196",
"0.45635825",
"0.45621225",
"0.45530814",
"0.45493722",
"0.45493722",
"0.45465526",
"0.45386675",
"0.45215166",
"0.45213193",
"0.45213023",
"0.45047727",
"0.4502846",
"0.44901353",
"0.44872034",
"0.44810665",
"0.447972",
"0.4478467",
"0.44781485",
"0.44779897"
] | 0.7196425 | 1 |
/ INFO: This method switches Campaign status based on user input i.e considering false = 'disable' and true = 'enable' if user passes true this method will enable the campaign for given app and vice versa INPUT: userValue => boolean, myAppName => String RETURN: VOID | public void switchCampaign(boolean userValue, String myAppName) {
Log.info("Trying to get current compaign status for app" + myAppName);
boolean currentValue = checkCurrentCampaianStatus(myAppName);
WebElement myAccount = getAccontDetails(myAppName);
if (userValue != currentValue) {
Log.info("Chaging the current compaign status for app" + myAppName);
WebElement tab = myAccount.findElement(By.className("adminTable3 "));
WebElement slider = tab.findElement(By.className("slider"));
slider.click();
} else {
Log.info(myAppName + "is already in desired state. No Action needed");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void switchAccountStatus(boolean userValue, String myAppName) {\n\t\tLog.info(\"Searching for current account status for app\" + myAppName);\n\t\tboolean currentValue = checkAccountAction(myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tif (userValue != currentValue) {\n\t\t\tLog.info(\"Chaging the current account status for app\" + myAppName);\n\t\t\tWebElement tab = myAccount.findElement(By.className(\"adminTable5\"));\n\t\t\tWebElement slider = tab.findElement(By.id(\"navButton\"));\n\t\t\tslider.click();\n\t\t\ttry {\n\t\t\t\tThread.sleep(10000);\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\tapp_confrim.click();\n\t\t} else {\n\t\t\tLog.info(myAppName + \"is already in desired state. No Action needed\");\n\t\t}\n\t}",
"public boolean checkCurrentCampaianStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountCampaianStatus = myAccount.findElement(By.className(\"adminTable3\"));\n\t\tString elementPageSource = myAccountCampaianStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" compaign is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" compaign is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" compaign is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" compaign is enabled Which is a deactivatd app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"@Override\n public void onClick(View v) {\n if(custActiveInactive.isChecked()){\n custHardwareReturned.setChecked(false);\n custHardwareReturned.setEnabled(false);\n custHardwareInstalled.setEnabled(true);\n cust.custActiveInActive = 1;\n }else{\n custHardwareInstalled.setChecked(false);\n custHardwareInstalled.setEnabled(false);\n custHardwareReturned.setEnabled(true);\n cust.custActiveInActive = 0;\n }\n }",
"public boolean checkCurrentOfferStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountOfferStatus = myAccount.findElement(By.className(\"adminTable4 \"));\n\t\tString elementPageSource = myAccountOfferStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" offer is enabled Which is a deactivated app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"public boolean checkAppApproveStatus(String myAppName) {\n\t\tSystem.out.println(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='approve_notify']//span]\"));\n\t\tSystem.out.println(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Approve\") && myAccountField.getText().contains(strDate)) {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is approved\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is pending\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"void updateUserActivateStatus(User user, int newStatus);",
"private void triggerPolicyComplianceCheckIfNeeded(int profileUserId, boolean suspended) {\n synchronized (getLockObject()) {\n final ActiveAdmin profileOwner = getProfileOwnerAdminLocked(profileUserId);\n if (profileOwner == null) {\n Slogf.wtf(LOG_TAG, \"Profile owner not found for compliance check\");\n return;\n }\n if (suspended) {\n // If suspended, DPC will need to show an activity.\n final Intent intent = new Intent(ACTION_CHECK_POLICY_COMPLIANCE);\n intent.setPackage(profileOwner.info.getPackageName());\n mContext.startActivityAsUser(intent, UserHandle.of(profileUserId));\n } else if (profileOwner.mProfileOffDeadline > 0) {\n // If not suspended, but deadline set, DPC needs to acknowledge compliance so that\n // the deadline can be reset.\n sendAdminCommandLocked(profileOwner, ACTION_COMPLIANCE_ACKNOWLEDGEMENT_REQUIRED,\n /* adminExtras= */ null, /* receiver= */ null, /* inForeground = */ true);\n }\n }\n }",
"@ReactMethod\n public void AlertIfWhitelist(String title, String message, String dontShowAgainText, String positiveText, String negativeText) {\n final SharedPreferences settings = this.getCurrentActivity().getSharedPreferences(\"Whitelist\",Context.MODE_PRIVATE);\n final String saveIfSkip = \"skipWhitelistMessage\";\n boolean skipMessage = settings.getBoolean(saveIfSkip, false);\n // Show dialog only when \"do not show again\" hasn't been enabled yet\n if (!skipMessage) {\n final SharedPreferences.Editor editor = settings.edit();\n // Check if intent of the android whitelist apps activity is callable\n for (Intent intent : AUTO_START_INTENTS){\n if (isCallable(intent)) {\n // Prepare dialog\n final AppCompatCheckBox dontShowAgain = new AppCompatCheckBox(this.getCurrentActivity());\n dontShowAgain.setText(dontShowAgainText);\n dontShowAgain.setLeft(20);\n dontShowAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n editor.putBoolean(saveIfSkip, isChecked);\n editor.apply();\n }\n });\n\n final RelativeLayout layout = new RelativeLayout(this.getCurrentActivity());\n layout.setPadding(50,50,0,0);\n layout.addView(dontShowAgain);\n\n new AlertDialog.Builder(this.getCurrentActivity())\n .setTitle(title)\n .setMessage(message)\n .setView(layout)\n .setPositiveButton(positiveText, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n try {\n for (Intent intent : AUTO_START_INTENTS)\n if (isCallable(intent)) {\n editor.putBoolean(saveIfSkip, true);\n editor.apply();\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);\n reactContext.startActivity(intent);\n break;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n })\n .setNegativeButton(negativeText, null)\n .show();\n break;\n }\n }\n }\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsiv_update.changeSwitchStatus();\n\t\t\t\tEditor editor = sharedPreferences.edit();\n\t\t\t\teditor.putBoolean(MobileGuard.APP_AUTO_UPDATE,\n\t\t\t\t\t\tsiv_update.getSwitchStatus());\n\t\t\t\teditor.commit();\n\t\t\t}",
"public boolean approveApp(String myAppName) {\n\t\tLog.info(\"Checking if App:\" + myAppName + \"came for approval\");\n\t\tWebElement myElement = getAppFromList(myAppName);\n\t\tif (myElement != null) {\n\t\t\tLog.info(myAppName + \"came for approval. Approving it now..\");\n\t\t\tWebElement approveButton = myElement.findElement(By.id(\"appsEditApprove\"));\n\t\t\tapproveButton.click();\n\t\t\tapp_confrim.click();\n\t\t\tif (getAccontDetails(myAppName) != null) {\n\t\t\t\tLog.info(myAppName + \"is approved now\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tLog.info(\"failed to approve\" + myAppName);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tLog.info(myAppName + \"did not showed up in approval list\");\n\t\t\treturn false;\n\t\t}\n\n\t}",
"public void setIsApproved (boolean IsApproved);",
"public void setIsApproved (boolean IsApproved);",
"public void setAA(boolean value) {\n this.AA = value;\n }",
"public void onClick(View v) {\n is_enabled=!is_enabled;\n if(!is_enabled){\n textView_current_Status.setText(R.string.switcher_is_being_enabled_please_wait);\n //sayHello();\n Set_Switch_On();\n }else{\n textView_current_Status.setText(R.string.switcher_is_currently_disabled);\n Set_Switch_Off();\n }\n }",
"public boolean invokeChangeDeductionModeWS(CustomerVO customerVO,\n\t\t\tUserDetails userDetails, String url) {\n\t\tlogger.entering(\"invokeChangeDeductionModeWS\", customerVO, userDetails,\n\t\t\t\turl);\n\t\tboolean result = false;\n\n\t\ttry {\n\t\t\tSwitchDeductionBPProxy proxy = new SwitchDeductionBPProxy(url);\n\t\t\tSwitchDeductionRequest wsrequest = new SwitchDeductionRequest();\n\n\t\t\twsrequest.setMSISDN(customerVO.getMsisdn());\n\t\t\twsrequest.setDeductionType(DeductionType.fromString(customerVO\n\t\t\t\t\t.getDeductionMode()));\n\t\t\twsrequest.setRegisteredBy(BigInteger.valueOf(userDetails\n\t\t\t\t\t.getUserId()));\n\t\t\twsrequest.setRegistrationChannel(ChannelType\n\t\t\t\t\t.fromString(\"Dashboard\"));\n\n\t\t\tSwitchDeductionResponse wsResponse = new SwitchDeductionResponse();\n\t\t\twsResponse = proxy.processSwitchDeductionBPRequest(wsrequest);\n\t\t\tresult = true;\n\t\t\tlogger.debug(\"Status Code: \", wsResponse.getStatus()\n\t\t\t\t\t.getStatusCode());\n\t\t\tlogger.debug(\"Status Message: \", wsResponse.getStatus()\n\t\t\t\t\t.getStatusMessage());\n\n\t\t} catch (FaultType e) {\n\t\t\tlogger.error(\"A FaultType error has occured \"\n\t\t\t\t\t+ \"while processing the web-service request.\");\n\t\t\tlogger.error(e.getFaultActor1());\n\t\t\tlogger.error(e.getFaultCode1());\n\t\t\tlogger.error(e.getFaultDetail());\n\t\t\tlogger.error(e.getFaultMessage());\n\t\t\tlogger.error(e.getFaultOriginator());\n\t\t\tresult = false;\n\t\t} catch (RemoteException e) {\n\t\t\tlogger.error(\"A remote exception has occured while processing the web-service request.\");\n\t\t\tlogger.error(e.getLocalizedMessage());\n\t\t\tresult = false;\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"A unknown exception has \"\n\t\t\t\t\t+ \"occured while processing the web-service request.\");\n\t\t\tlogger.error(e.getLocalizedMessage());\n\t\t\tresult = false;\n\t\t}\n\n\t\tlogger.exiting(\"invokeChangeDeductionModeWS\", result);\n\t\treturn result;\n\n\t}",
"boolean withAdvanceInCampaign();",
"public Builder setUserWebV2(boolean value) {\n \n userWebV2_ = value;\n onChanged();\n return this;\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsiv_intercep.changeSwitchStatus();\n\t\t\t\tboolean status = siv_intercep.getSwitchStatus();\n\t\t\t\tIntent intent = new Intent(SettingActivity.this,\n\t\t\t\t\t\tMgInCallStateService.class);\n\t\t\t\tif (status) {\n\t\t\t\t\tstartService(intent);\n\t\t\t\t} else {\n\t\t\t\t\tstopService(intent);\n\t\t\t\t}\n\t\t\t}",
"public static void setPrefBooleanData(Context context, String key, boolean value) {\n SharedPreferences appInstallInfoSharedPref = context.\n getSharedPreferences(APP_CONFIG_PREF, Context.MODE_PRIVATE);\n SharedPreferences.Editor appInstallInfoEditor = appInstallInfoSharedPref.edit();\n appInstallInfoEditor.putBoolean(key, value);\n appInstallInfoEditor.apply();\n }",
"public boolean checkAccountAction(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue = false;\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement Tab = myAccount.findElement(By.className(\"adminTable5\"));\n\t\tString elementPageSource = Tab.getAttribute(\"outerHTML\");\n\t\tif (elementPageSource.contains(\"deactivate.png\")) {\n\t\t\tLog.info(myAppName + \" account is activated\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(myAppName + \" account is deactivated\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"@Override\n public void onClick(View v) {\n if (mGlobalSwitch != null)\n mGlobalSwitch.setChecked(true);\n else {\n getSharedPreferences(getString(R.string.pref_global), Context.MODE_PRIVATE).edit().putBoolean(getString(R.string.key_enabled), true).commit();\n SendEnabledState(SettingsActivity.this, true);\n }\n mSnackBarAddService.dismiss();\n mSnackBarAddService = null;\n }",
"public boolean checkAccountStatus(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='adminTable2 ']\"));\n\t\tLog.info(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Inactive\") && myAccountField.getText().contains(strDate)) {\n\t\t\tLog.info(\"current account status for app\" + myAppName + \"is inactive\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(\"current account status for app\" + myAppName + \"is active\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public boolean setApplicationStatus(ApplicationBean application) throws UASException;",
"public void setIsOnRequest(int value) {\n this.isOnRequest = value;\n }",
"public void setStatus(boolean newstatus){activestatus = newstatus;}",
"public void assignUserMaintOK(final boolean val) {\n userMaintOK = val;\n }",
"public void setEnabled(Boolean value) { this.myEnabled = value.booleanValue(); }",
"public void setEnabled(UIEvent.Type aType, boolean aValue) { getEventAdapter(true).setEnabled(aType, aValue); }",
"public void changeDeliveredBoolean(final DriverDisplayInvoiceInteractor.onDisplayDataFinishedListener listener, final String userID, final String invoiceID, Context context){\n com.android.volley.RequestQueue ExampleRequestQueue = Volley.newRequestQueue(context);\n String url = \"https://us-central1-csc207-tli.cloudfunctions.net/set_invoice_status?userid=\" + userID + \"&invoiceid=\" + invoiceID + \"&statustype=\" + \"delivered\" + \"&newvalue=\" + true;\n StringRequest ExampleStringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n listener.onChangeDeliveredSuccess();\n }\n }, new Response.ErrorListener() { //Create an error listener to handle errors appropriately.\n @Override\n public void onErrorResponse(VolleyError error) {\n //This code is executed if there is an error.\n listener.onChangeDeliveredError();\n }\n });\n ExampleRequestQueue.add(ExampleStringRequest);\n }",
"void transactTo_setAccountDisabled(int code, String transactName, ComponentName who, String accountType, boolean disabled, int userId) {\n int i = 1;\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \" to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n _data.writeString(accountType);\n if (!disabled) {\n i = 0;\n }\n _data.writeInt(i);\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n }",
"int setCanStatus(int canRegno, int action);",
"public static void setBool(String aKey, boolean aValue) {\n getSharedPreferences().edit().putBoolean(aKey, aValue).apply();\n }",
"@Override\r\n\tpublic boolean updateAccountSw(String accId, String activeSw) {\r\n\t\tlogger.debug(\"*** updateAccountSw() method started\");\r\n\t\tString fileName = null, mailSub = null, mailBody = null, password = null;\r\n\t\ttry {\r\n\t\t\t// load existing record using accId\r\n\t\t\tAppAccountEntity entity = appAccRepository.findById(Integer.parseInt(accId)).get();\r\n\t\t\tif (entity != null) {\r\n\t\t\t\t// Setting Account Active Sw (Y|N)\r\n\t\t\t\tentity.setActiveSw(activeSw);\r\n\t\t\t\t// Updating Account\r\n\t\t\t\tappAccRepository.save(entity);\r\n\t\t\t\tlogger.debug(\"*** updateAccountSw() method ended\");\r\n\r\n\t\t\t\tAppAccount accModel = new AppAccount();\r\n\t\t\t\tBeanUtils.copyProperties(entity, accModel);\r\n\r\n\t\t\t\t// TODO:Need to complete email functionality\r\n\t\t\t\tif (activeSw.equals(\"Y\")) {\r\n\t\t\t\t\t// send Email saying account activated\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\t// get file name\r\n\t\t\t\t\t\tfileName = appProperties.getProperties().get(AppConstants.ACTIVATE_EMAIL_FILE);\r\n\t\t\t\t\t\t// get mail subject\r\n\t\t\t\t\t\tmailSub = appProperties.getProperties().get(AppConstants.ACTIVATE_EMAIL_SUB);\r\n\t\t\t\t\t\t// decrypt the password\r\n\t\t\t\t\t\tpassword = PasswordUtils.decrypt(accModel.getPassword());\r\n\t\t\t\t\t\t// set decrypted password to accModel object password field\r\n\t\t\t\t\t\taccModel.setPassword(password);\r\n\t\t\t\t\t\t// get email body\r\n\t\t\t\t\t\tmailBody = getEmailBodyContent(accModel, fileName);\r\n\t\t\t\t\t\t// send email to activate registered cw/admin\r\n\t\t\t\t\t\temailUtils.sendEmail(entity.getEmail(), mailSub, mailBody);\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\tlogger.error(\"Email Sending is failed : \" + e.getMessage());\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\t// send Email saying account de-activated\r\n\t\t\t\t\t\t// send account de-activation mail to registered case worker/admin\r\n\t\t\t\t\t\t// get file name\r\n\t\t\t\t\t\tfileName = appProperties.getProperties().get(AppConstants.DE_ACTIVATE_EMAIL_FILE);\r\n\t\t\t\t\t\t// get email subject\r\n\t\t\t\t\t\tmailSub = appProperties.getProperties().get(AppConstants.DE_ACTIVATE_EMAIL_SUB);\r\n\t\t\t\t\t\t// get email body content\r\n\t\t\t\t\t\tmailBody = getDeActivateAccountEmailBodyContent(fileName, accModel);\r\n\t\t\t\t\t\t// send email to registered cw/admin\r\n\t\t\t\t\t\temailUtils.sendEmail(entity.getEmail(), mailSub, mailBody);\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\tlogger.error(\"Email Sending is failed : \" + e.getMessage());\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} catch (Exception e) {\r\n\t\t\tlogger.error(\"Exception occured in updateAccountSw() method : \" + e.getMessage());\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"boolean condition(UserInterface userInterface, UserPreferences prefs);",
"boolean transactTo_setFunctionDisabled(int code, String transactName, ComponentName who, boolean disabled, int userId) {\n int i = 1;\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \"to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n if (!disabled) {\n i = 0;\n }\n _data.writeInt(i);\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n return false;\n }",
"public void onToggleClicked(View view) {\n boolean on = ((ToggleButton) view).isChecked();\n if (on) {\n if (!BA.isEnabled()) {\n Intent turnOn = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(turnOn, 0);\n Toast.makeText(getApplicationContext(), \"Turned on\", Toast.LENGTH_LONG).show();\n } else {\n Toast.makeText(getApplicationContext(), \"Already on\", Toast.LENGTH_LONG).show();\n }\n } else {\n BA.disable();\n Toast.makeText(getApplicationContext(), \"Turned off\", Toast.LENGTH_LONG).show();\n }\n }",
"public void setActiveflag(String value) {\n setAttributeInternal(ACTIVEFLAG, value);\n }",
"public void setForua(boolean newValue);",
"void setInvoiced(boolean invoiced);",
"boolean updateEnabling();",
"public void setActiveFlag(String value) {\n setAttributeInternal(ACTIVEFLAG, value);\n }",
"@Override\r\n\tprotected void onResume() {\r\n\t\tsuper.onResume();\r\n\t\tif (hasBeenSecurity) {\r\n\t\t\tif (KeyguardSetting.isAccessibilityEnable(this)) {\r\n\t\t\t\tUtil.putPreferenceBoolean(mContext, NOTIFICATION_CHECK, true);\r\n\t\t\t\tmCheckBoxToggle.setChecked(true);\r\n\t\t\t} else {\r\n\t\t\t\tmCheckBoxToggle.setChecked(false);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (KeyguardSetting.isAccessibilityEnable(this)\r\n\t\t\t\t\t&& Util.getPreferenceBoolean(mContext, NOTIFICATION_CHECK,\r\n\t\t\t\t\t\t\tfalse)) {\r\n\t\t\t\t// TODO 修改逻辑\r\n\t\t\t\tmCheckBoxToggle.setChecked(true);\r\n\t\t\t} else {\r\n\t\t\t\tmCheckBoxToggle.setChecked(false);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void setIsOnlineResult(boolean value) {\n this.isOnlineResult = value;\n }",
"@Override\n\tprotected void onResume() {\n\t\t\tif(SPHelper.getDetailMsg(SettingActivity.this, \"ischecked\", \"\").equals(\"\")){\n\t\t\t\tIntent intent = new Intent(SettingActivity.this, AppActivity.class);\n\t\t\t\tstartActivity(intent);\n\t\t\t}\n\t\t\tsuper.onResume();\n\t}",
"@Override\n public void onEnabled(Context context, Intent intent) {\n new EventBusUtils().send(1);\n// Toast.makeText(context, \"激活ok====\", Toast.LENGTH_SHORT).show();\n//\n }",
"public void setClaim(boolean a){\n isClaimed= a;\n \n}",
"public void active(boolean value) {\n\t\tactive = value;\n\t}",
"public void setUserLogStatus(boolean bValue){\n /*SharedPreferences sharedPreferences = _context.getSharedPreferences(APP_PREFERENCES, PRIVATE_MODE);\n SharedPreferences.Editor editor;\n editor = sharedPreferences.edit();*/\n editor.putBoolean(IS_LOGGED_IN, bValue);\n editor.apply();\n }",
"private void setEnabledComponentInner(ComponentName componentName, int newState, int userId) {\n if (componentName != null) {\n String packageName = componentName.getPackageName();\n String className = componentName.getClassName();\n if (packageName != null && className != null) {\n synchronized (this.mPackages) {\n PackageSetting pkgSetting = (PackageSetting) this.mSettings.mPackages.get(packageName);\n if (pkgSetting == null) {\n Slog.e(TAG, \"setEnabledSetting, can not find pkgSetting, packageName = \" + packageName);\n return;\n }\n Package pkg = pkgSetting.pkg;\n if (pkg == null || (pkg.hasComponentClassName(className) ^ 1) != 0) {\n Slog.w(TAG, \"Failed setComponentEnabledSetting: component class \" + className + \" does not exist in \" + packageName);\n return;\n }\n switch (newState) {\n case 0:\n if (!pkgSetting.restoreComponentLPw(className, userId)) {\n return;\n }\n break;\n case 2:\n if (!pkgSetting.disableComponentLPw(className, userId)) {\n return;\n }\n break;\n default:\n Slog.e(TAG, \"Invalid new component state: \" + newState);\n return;\n }\n }\n }\n }\n }",
"public void executeTruefaceFlow(ParseUser user) {\r\n if (user != null) {\r\n Cache.putData(CatchValue.USER_ACTIVE_FR, LoginUserActivity.this, false, Cache.CACHE_LOCATION_DISK);\r\n if (TextUtils.isEmpty(user.getString(\"status\"))) {\r\n dismissProgressDialog();\r\n showUserModeAlertDialog(text);\r\n mLoginEmailView.setText(\"\");\r\n mLoginPasswordView.setText(\"\");\r\n } else {\r\n activeUser = user.getString(\"status\");\r\n if (activeUser.equalsIgnoreCase(\"active\")) {\r\n session.createLoginSession(String.valueOf(user), user.getEmail());\r\n boolean face_value = user.getBoolean(\"hasFRenabled\");\r\n Log.e(\"face_value: \", \" ### \" + face_value);\r\n if (face_value == false) {\r\n dismissProgressDialog();\r\n Intent intent = new Intent(this, MainActivity.class);\r\n startActivity(intent);\r\n finish();\r\n } else {\r\n if (user.has(\"enforce_enroll\")) {\r\n enroll = user.getBoolean(\"enforce_enroll\");\r\n }\r\n Log.e(\"Enforc_false\", String.valueOf(enroll));\r\n if (enroll) {\r\n Intent mainIntent = new Intent(LoginUserActivity.this, MainActivity.class);\r\n startActivity(mainIntent);\r\n finish();\r\n } else {\r\n Intent i = new Intent(LoginUserActivity.this, EnrollActivity.class);\r\n i.putExtra(\"Intent\", \"Login\");\r\n startActivity(i);\r\n finish();\r\n }\r\n }\r\n } else {\r\n dismissProgressDialog();\r\n showUserModeAlertDialog(text);\r\n mLoginEmailView.setText(\"\");\r\n }\r\n }\r\n Log.e(\"active_user\", \"### \" + activeUser);\r\n }\r\n }",
"public Boolean companySettings(UserDetailsDTO userDetailsDTO, long userId) throws Exception;",
"boolean transactTo_hasHwPolicy(int code, String transactName, int userId) {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n boolean bDisabled = false;\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \" to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n bDisabled = _reply.readInt() == 1;\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n return bDisabled;\n }",
"public abstract void setEnabled(Context context, boolean enabled);",
"public com.example.DNSLog.Builder setAA(boolean value) {\n validate(fields()[17], value);\n this.AA = value;\n fieldSetFlags()[17] = true;\n return this;\n }",
"public void setCartridgeEnableStatus(String aPath, Boolean aValue) {\n\t\tif (this.getAllCartridgeClassPaths() != null) {\n\t\t\tif (this.cartridgeClassPaths.containsKey(aPath)) {\n\t\t\t\tCartridgeClasspathData data = this.cartridgeClassPaths.get(aPath);\n\t\t\t\tdata.setEnabled(aValue);\n\t\t\t}\n\t\t} else {\n\t\t\tLogHelper.error(\"cartridgeClassPaths is null while calling setCartridgeEnableStatus\");\n\t\t}\n\t}",
"public void onClick(View v) {\n\t if(toggle.isChecked())\n\t {\n\t Toast.makeText(getApplicationContext(), \"Email Confirmation Enabled\",\n\t \t\t Toast.LENGTH_SHORT).show();\n\t emailCheckedBool = true;\n\t\t \t\n\t }\n\t else\n\t {\n\t Toast.makeText(getApplicationContext(), \"Email Confirmation Disabled\",\n\t \t\t Toast.LENGTH_SHORT).show();\n\t emailCheckedBool = false;\n\t }\n\t }",
"public void sendResponse(Activity activity, boolean status, int calledFrom) {\n if (calledFrom == 1) {\n if (((OtpVerificationActivity) activity) != null) {\n ((OtpVerificationActivity) activity).setServerResponseForSettingsCall(status);\n }\n } else if (calledFrom == 2) {\n if (((SplashActivity) activity) != null) {\n ((SplashActivity) activity).setServerResponseForSettingsCall(status);\n }\n\n }\n }",
"public void setStatus( boolean avtive ){\r\n\t\tthis.activ = avtive;\r\n\t}",
"public Builder setSwstatus(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n swstatus_ = value;\n onChanged();\n return this;\n }",
"private void updateUserStatus(boolean online)\n {\n }",
"@Override\r\n public void turnOn(){\r\n isOn = true;\r\n Reporter.report(this, Reporter.Msg.SWITCHING_ON);\r\n if (isOn){\r\n engageLoads();\r\n }\r\n }",
"public void setActive(){\n paycheckController.setActive();\n }",
"@External\n\tpublic void set_game_status(String _status,Address _scoreAddress) {\n\t\tAddress sender = Context.getCaller();\n\t\tif ( !this.get_admin().contains(sender)) {\n\t\t\tContext.revert(\"Sender not an admin\");\n\t\t}\n\t\tif (!STATUS_TYPE.contains(_status)) {\n\t\t\tContext.revert(\"Invalid status\");\n\t\t}\n\t\tString statusScoreAddress = this.status_data.get(_scoreAddress);\n\t\tif(_status.equals(\"gameRejected\") && !statusScoreAddress.equals(\"gameReady\") ) {\n\t\t\tContext.revert(\"This game cannot be rejected from state \" +statusScoreAddress );\n\t\t}\n\t\tif(_status.equals(\"gameApproved\") && !(\n\t\t\t\tstatusScoreAddress.equals(\"gameReady\") || statusScoreAddress.equals(\"gameSuspended\")\n\t\t\t\t)) {\n\t\t\tContext.revert(\"This game cannot be approved from state \" +statusScoreAddress );\n\t\t}\n\t\tif(_status.equals(\"gameSuspended\") && !statusScoreAddress.equals(\"gameApproved\")) {\n\t\t\tContext.revert(\"Only approved games may be suspended.\");\n\t\t}\n\t\tif(_status.equals(\"gameDeleted\") && !statusScoreAddress.equals(\"gameSuspended\")) {\n\t\t\tContext.revert(\"Only suspended games may be deleted.\");\n\t\t}\n\t\t\n\t\tthis.status_data.set(_scoreAddress, statusScoreAddress); \t\n\t\t\n\t}",
"public abstract boolean setActive(boolean active);",
"void setManualCheck (boolean value);",
"public void compare(Application app, String userDecision){\n int intDecision = -1;\n String decision = userDecision.toLowerCase();\n\n if (decision.contains(\"harvard\")){ // decision making will be replaced by BUTTONS in processing\n intDecision = 1;\n }\n if (decision.contains(\"greendale\")){\n intDecision = 0;\n }\n if (decision.contains(\"mit\")){\n intDecision = 2;\n }\n\n //catches bad user input in which they try to submit multiple colleges to cheat the system... nice try.\n if ((decision.contains(\"harvard\") && decision.contains(\"mit\")) ||\n (decision.contains(\"harvard\") && decision.contains(\"greendale\")) ||\n (decision.contains(\"mit\") && decision.contains(\"greendale\")))\n {\n intDecision = -1;\n }\n\n if (intDecision == -1){ // catches bad user input, technically unnecessary but i like dissing people\n System.out.println(\"How can you call yourself an admissions officer when you can't even choose correctly?\");\n errorMade(); // runs failure\n }else if (intDecision == app.getCollege()){\n System.out.println(printAcceptance(intDecision));\n }\n else{\n errorMade();\n }\n }",
"void activate(ConditionContext context);",
"public final void setIsVoipAudioMode(java.lang.String r1, boolean r2) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.telecom.ConnectionServiceAdapterServant.2.setIsVoipAudioMode(java.lang.String, boolean):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telecom.ConnectionServiceAdapterServant.2.setIsVoipAudioMode(java.lang.String, boolean):void\");\n }",
"public void onChange(boolean selfChange, Uri uri) {\n if (Settings.Global.getUriFor(\"forced_app_standby_enabled\").equals(uri)) {\n boolean enabled = isForcedAppStandbyEnabled();\n synchronized (AppStateTracker.this.mLock) {\n if (AppStateTracker.this.mForcedAppStandbyEnabled != enabled) {\n AppStateTracker.this.mForcedAppStandbyEnabled = enabled;\n }\n }\n } else if (Settings.Global.getUriFor(\"forced_app_standby_for_small_battery_enabled\").equals(uri)) {\n boolean enabled2 = isForcedAppStandbyForSmallBatteryEnabled();\n synchronized (AppStateTracker.this.mLock) {\n if (AppStateTracker.this.mForceAllAppStandbyForSmallBattery != enabled2) {\n AppStateTracker.this.mForceAllAppStandbyForSmallBattery = enabled2;\n AppStateTracker.this.updateForceAllAppStandbyState();\n }\n }\n } else {\n Slog.w(AppStateTracker.TAG, \"Unexpected feature flag uri encountered: \" + uri);\n }\n }",
"public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n position = i;\n final TextView tvEnable;\n TextView tvUserId,tvUserName;\n tvUserId = view.findViewById(R.id.tvUserId);\n tvEnable = view.findViewById(R.id.tvEnable);\n tvUserName = view.findViewById(R.id.tvUserName);\n\n userDetailsData = (UserDetailsData) userDetailsAdapter.list.get(position);\n userId = userDetailsData.getUser_id();\n final String user = userDetailsData.getName();\n enable = userDetailsData.getEnable();\n Log.e(\"switch\",\"pos\"+position );\n Toast.makeText(UserDetailsActivity.this,user+\" is selected\",Toast.LENGTH_SHORT ).show();\n tvEnable.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n String message = null;\n if (enable.equals(\"Yes\")){\n enable = \"No\";\n message = \"deactivate\";\n Log.e(\"switch\",\"true\" );\n //tvEnable.setText(\"Deactivated\");\n final AlertDialog.Builder alertUser = new AlertDialog.Builder(UserDetailsActivity.this);\n alertUser.setTitle(\"Confirm Action!\");\n alertUser.setMessage(\"Do you want to \"+message+\" the user \"+user+\"?\");\n alertUser.setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n type = \"enableUser\";\n BackgroundWorkerJson backgroundWorker = new BackgroundWorkerJson();\n backgroundWorker.execute();\n }\n });\n alertUser.setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n alertUser.setCancelable(true);\n enable = \"Yes\";\n }\n });\n alertUser.show();\n }else if(enable.equals(\"No\")){\n enable = \"Yes\";\n message = \"activate\";\n Log.e(\"switch\",\"false\" );\n //tvEnable.setText(\"Activated\");\n final AlertDialog.Builder alertUser = new AlertDialog.Builder(UserDetailsActivity.this);\n alertUser.setTitle(\"Confirm Action!\");\n alertUser.setMessage(\"Do you want to \"+message+\" the user \"+user+\"?\");\n alertUser.setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n type = \"enableUser\";\n BackgroundWorkerJson backgroundWorker = new BackgroundWorkerJson();\n backgroundWorker.execute();\n }\n });\n alertUser.setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n alertUser.setCancelable(true);\n enable = \"No\";\n }\n });\n alertUser.show();\n }else {\n Toast.makeText(UserDetailsActivity.this,\"Some tasks are running. Try again later...\",Toast.LENGTH_SHORT ).show();\n }\n }\n });\n }",
"public void setClaim(boolean a,AbstAnt ant){\n isClaimed= a;\n claimer= ant;\n}",
"public void setApprovedFlag(String value) {\r\n setAttributeInternal(APPROVEDFLAG, value);\r\n }",
"public void setAchieved(Boolean newValue);",
"public void setActiveStatus(Boolean active){ this.status = active; }",
"public void toggleEnable();",
"public void sendUserSwitchBroadcasts(int oldUserId, int newUserId) {\n int i = oldUserId;\n int i2 = newUserId;\n long ident = Binder.clearCallingIdentity();\n if (i >= 0) {\n try {\n List<UserInfo> profiles = this.mInjector.getUserManager().getProfiles(i, false);\n int count = profiles.size();\n for (int i3 = 0; i3 < count; i3++) {\n int profileUserId = profiles.get(i3).id;\n Intent intent = new Intent(\"android.intent.action.USER_BACKGROUND\");\n intent.addFlags(1342177280);\n intent.putExtra(\"android.intent.extra.user_handle\", profileUserId);\n Intent intent2 = intent;\n this.mInjector.broadcastIntent(intent, null, null, 0, null, null, null, -1, null, false, false, ActivityManagerService.MY_PID, 1000, profileUserId);\n }\n } catch (Throwable th) {\n Binder.restoreCallingIdentity(ident);\n throw th;\n }\n }\n if (i2 >= 0) {\n List<UserInfo> profiles2 = this.mInjector.getUserManager().getProfiles(i2, false);\n int count2 = profiles2.size();\n for (int i4 = 0; i4 < count2; i4++) {\n int profileUserId2 = profiles2.get(i4).id;\n Intent intent3 = new Intent(\"android.intent.action.USER_FOREGROUND\");\n intent3.addFlags(1342177280);\n intent3.putExtra(\"android.intent.extra.user_handle\", profileUserId2);\n Intent intent4 = intent3;\n this.mInjector.broadcastIntent(intent3, null, null, 0, null, null, null, -1, null, false, false, ActivityManagerService.MY_PID, 1000, profileUserId2);\n }\n Intent intent5 = new Intent(\"android.intent.action.USER_SWITCHED\");\n intent5.addFlags(1342177280);\n intent5.putExtra(\"android.intent.extra.user_handle\", i2);\n this.mInjector.broadcastIntent(intent5, null, null, 0, null, null, new String[]{\"android.permission.MANAGE_USERS\"}, -1, null, false, false, ActivityManagerService.MY_PID, 1000, -1);\n }\n Binder.restoreCallingIdentity(ident);\n }",
"@Override\n\t\tpublic void onClick(View v) {\n\t\t\t\n\t\t\tif(v.getId() == R.id.setting_update)\t{\n\t\t\t\tEditor editor = sp.edit();\n\t\t\t\tif(update_setting.getCheckBox().isChecked())\t{\n\t\t\t\t\t\n\t\t\t\t\tupdate_setting.setCheckBox(false);\n\t\t\t\t\teditor.putBoolean(\"auto_update\", false);\n\t\t\t\t}else {\n\t\t\t\t\t\n\t\t\t\t\tupdate_setting.setCheckBox(true);\n\t\t\t\t\teditor.putBoolean(\"auto_update\", true);\n\t\t\t\t}\n\t\t\t\teditor.commit();\n\t\t\t}else if(v.getId() == R.id.setting_ring_attention)\t{\n\t\t\t\tif(ring_attention_setting.getCheckBox().isChecked())\t{\n\t\t\t\t\tring_attention_setting.setCheckBox(false);\n\t\t\t\t\tstopService(new Intent(SettingActivity.this, PhoneListernService.class));\n\t\t\t\t}else {\n\t\t\t\t\tring_attention_setting.setCheckBox(true);\n\t\t\t\t\tstartService(new Intent(SettingActivity.this, PhoneListernService.class));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public void flashlightSwitch()\n {\n usingFlashlight = !usingFlashlight;\n }",
"@SuppressWarnings(\"unused\")\n private void setTrafficEnabled(final JSONArray args, final CallbackContext callbackContext) throws JSONException {\n Boolean isEnabled = args.getBoolean(1);\n map.setTrafficEnabled(isEnabled);\n this.sendNoResult(callbackContext);\n }",
"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 }",
"public void changeStatus()\n {\n if(this.isActivate == false)\n {\n this.isActivate = true;\n switchSound.play();\n //this.dungeon.updateSwitches(true); \n }\n else{\n this.isActivate = false;\n switchSound.play(1.75, 0, 1.5, 0, 1);\n //this.dungeon.updateSwitches(false); \n }\n notifyObservers();\n\n }",
"@Override\n public void onCheckedChanged(CompoundButton compoundButton, boolean b) {\n if (b) {\n // Toast.makeText(getContext(), \"on\", Toast.LENGTH_LONG).show();\n\n context.startService(in);\n\n } else {\n //Toast.makeText(getContext(), \"of\", Toast.LENGTH_LONG).show();\n //in = new Intent(getContext(), HorizantelShake.class);\n context.stopService(in);\n }\n prefs = PreferenceManager.getDefaultSharedPreferences(getContext());\n SharedPreferences.Editor prefEditor = prefs.edit();\n prefEditor.putBoolean(\"service_status\", b);\n prefEditor.commit();\n }",
"public void active(View v){\n Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);\n\n ComponentName mDeviceAdminSample = new ComponentName(this,MyDeviceAdminReceiver.class);\n intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN,mDeviceAdminSample );\n intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION,\n \"hello,kitty\");\n startActivityForResult(intent, 100);\n\n }",
"public Builder setBoolValue(boolean value) {\n typeCase_ = 2;\n type_ = value;\n onChanged();\n return this;\n }",
"boolean transactTo_isAccountDisabled(int code, String transactName, ComponentName who, String accountType, int userId) {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n boolean bDisabled = false;\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \" to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n _data.writeString(accountType);\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n bDisabled = _reply.readInt() == 1;\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n return bDisabled;\n }",
"public abstract void wgb_onEnable();",
"@Override\n\tpublic void setStatusByUserName(String statusByUserName);",
"@Override\n\t\t\tpublic void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n\t\t\t\tif (isChecked)\n\t\t\t\t{\n\t\t\t\t\tsilent.setChecked(false);\n\t\t\t\t\tmPrefsEditor.putBoolean(\"silent\", false);\n\t\t\t\t\tmPrefsEditor.apply();\n\t\t\t\t\tmPrefsEditor.putBoolean(\"vibration\", true);\n\t\t\t\t\tmPrefsEditor.apply();\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"Vibration Mode\", Toast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsilent.setChecked(true);\n\t\t\t\t\tmPrefsEditor.putBoolean(\"silent\", true);\n\t\t\t\t\tmPrefsEditor.apply();\n\t\t\t\t\tmPrefsEditor.putBoolean(\"vibration\", false);\n\t\t\t\t\tmPrefsEditor.apply();\t\t\t\t\t\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"Silent Mode\", Toast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}",
"public void putBooleanValue(String key, boolean value){\n SharedPreferences sharedPreference = context.getSharedPreferences(LOGIN,Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=sharedPreference.edit();\n editor.putBoolean(key,value);\n editor.apply();\n }",
"public synchronized void setMyGameStatus(boolean status)\n {\n \tgameStatus=status;\n }",
"public CampaignEditPage isActive(boolean answer)\r\n\t{ \r\n\t\treadconfig();\r\n\t\t//no\r\n\t\tif(answer==false)\r\n\t\t{\r\n\t\t\tdriver.findElement(By.xpath(library.getProperty(\"camp_status_inactive\"))).click();\r\n\t\t}\t\r\n\t\t//yes\r\n\t\telse if(answer==true)\r\n\t\t{\r\n\t\t\tdriver.findElement(By.xpath(library.getProperty(\"camp_status_active\"))).click();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new InvalidParameterException\r\n\t\t\t(\"answer \"+answer +\" is not supported, ref automation doc workflow page.\");\r\n\t\t}\r\n\t\tAssert.assertEquals(driver.getTitle(),library.getProperty(\"camp_edit_page_title\"));\r\n\t\treturn new CampaignEditPage(driver);\r\n\t}",
"public void vCrtSWDsc(String applId, String comName, String loc,\r\n\t\t\tString loc1, String val, boolean flag, String browser) {\r\n\t\tcrtSWDscWitChek(applId, comName, loc, loc1, val, flag);\r\n\t\tvSWDscInTable(applId, comName, browser);\r\n\t}",
"public abstract void enableSubscribes(boolean paramBoolean);",
"public AppPreferences set(@NonNull String name, boolean value) {\n SharedPreferences prefs = context.getSharedPreferences(filename, Context.MODE_PRIVATE);\n SharedPreferences.Editor prefsEditor = prefs.edit();\n prefsEditor.putBoolean(name, value);\n prefsEditor.apply(); // or commit();\n return this;\n }",
"@Override\n public void reloadStatus(Context context) {\n Uri.Builder builder = Uri.parse(context.getString(R.string.donate_server_url)).buildUpon();\n Account[] accounts = AccountManager.get(context).getAccountsByType(\"com.google\");\n for (Account acct : accounts) {\n builder.appendQueryParameter(\"id\", cleanName(acct.name));\n }\n builder.appendQueryParameter(\"id\", phoneNumber);\n \n // Send it to the server and see what comes back\n HttpService.addHttpRequest(context, new HttpRequest(builder.build(), true){\n \n @Override\n public void processBody(String body) {\n for (String line : body.split(\"<br>\")) {\n \n String flds[] = line.split(\",\");\n if (flds.length < 2) continue;\n \n // Evaluate the status field. Value of LIFE translates to year 9999\n int year = -1;\n String stat = flds[1].trim();\n if (stat.equals(\"LIFE\")) {\n year = 9999;\n } else {\n try {\n year = Integer.parseInt(stat);\n } catch (NumberFormatException ex) {}\n if (year < 2011 && year > 2050) year = -1;\n }\n \n // get the current status year. If new status is better, update\n // the user status\n int paidYear = ManagePreferences.freeRider() ? 9999 : ManagePreferences.paidYear();\n if (year > paidYear) {\n if (year == 9999) {\n ManagePreferences.setFreeRider(true);\n } else {\n ManagePreferences.setPaidYear(year, true);\n }\n }\n \n // If status is less that current, ignore everything else\n if (year < paidYear) continue;\n \n // Otherwise evaluate and accept purchase date\n if (flds.length <= 2) continue;\n if (year >= paidYear) {\n Date purchaseDate = null;\n try {\n purchaseDate = DATE_FMT.parse(flds[2].trim());\n } catch (ParseException ex) {}\n if (purchaseDate != null) {\n ManagePreferences.setPurchaseDate(purchaseDate);\n }\n }\n \n // If sponsor code is \"FREE\", set the free subscriber flag\n String sponsor = null;\n boolean free = false;\n if (flds.length > 3) {\n sponsor = flds[3].trim();\n if (sponsor.equals(\"FREE\")) { \n free = true;\n sponsor = null;\n } else if (sponsor.length() == 0) sponsor = null;\n }\n ManagePreferences.setFreeSub(free);\n ManagePreferences.setSponsor(sponsor);\n }\n \n // Set the authorization last checked date\n ManagePreferences.setAuthLastCheckTime();\n }\n });\n }",
"public abstract void setInput(boolean value);",
"@Override\n\t\t\tpublic void onCheckedChanged(CompoundButton arg0, boolean arg1) {\n\t\t\t\tprefs.edit().putBoolean(\"silentOnCall\", silentToall.isChecked()).commit();\n\t\t\t}",
"default void toggle(boolean fromUser) {\n if (isPlaying()) {\n pause(fromUser);\n } else {\n play(fromUser);\n }\n }",
"public static boolean configApState(Context context, String apName) {\n WifiManager wifimanager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\n WifiConfiguration wificonfiguration = null;\n try {\n wificonfiguration = new WifiConfiguration();\n wificonfiguration.SSID = apName;\n\n if(isApEnabled(context)) {\n wifimanager.setWifiEnabled(false);\n disableAp(context);\n }\n\n Method method = wifimanager.getClass().getMethod(\"setWifiApEnabled\", WifiConfiguration.class, boolean.class);\n method.invoke(wifimanager, wificonfiguration, !isApEnabled(context));\n return true;\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n }",
"public void setEnable(String name,boolean value) {\n\t\tgetButtonPanel().getButton(name).setEnabled(value);\n\t\tgetGameMenuBar().getItem(name).setEnabled(value);\n\t}"
] | [
"0.70725375",
"0.5539794",
"0.54287124",
"0.5377295",
"0.5296427",
"0.5287219",
"0.5131914",
"0.51280254",
"0.51169485",
"0.5045678",
"0.50443006",
"0.50443006",
"0.4989079",
"0.49859798",
"0.49823847",
"0.4970135",
"0.49190098",
"0.49174723",
"0.49114048",
"0.4904377",
"0.4900983",
"0.4893136",
"0.48910618",
"0.48847628",
"0.48714828",
"0.48531362",
"0.48315603",
"0.4824131",
"0.48233902",
"0.48233208",
"0.48195738",
"0.48187536",
"0.48122928",
"0.47806498",
"0.47593296",
"0.47562018",
"0.4751643",
"0.4735066",
"0.4732346",
"0.47166646",
"0.4713037",
"0.4712083",
"0.46929574",
"0.4688331",
"0.46883026",
"0.46668598",
"0.46630824",
"0.46511084",
"0.46305454",
"0.4626165",
"0.46217033",
"0.46212232",
"0.46178228",
"0.46119303",
"0.46045506",
"0.46039805",
"0.46012568",
"0.4601044",
"0.4596889",
"0.45906967",
"0.4578098",
"0.45638612",
"0.45559645",
"0.4548514",
"0.45439222",
"0.4543708",
"0.4541929",
"0.45390528",
"0.4538044",
"0.4537586",
"0.453609",
"0.45292658",
"0.45279357",
"0.45233604",
"0.45178622",
"0.45111924",
"0.45074636",
"0.45056945",
"0.45055622",
"0.44958735",
"0.4491755",
"0.4490548",
"0.44683003",
"0.4463274",
"0.4462158",
"0.44593188",
"0.4458354",
"0.445785",
"0.4457456",
"0.44567886",
"0.44462037",
"0.44441894",
"0.44439554",
"0.44382682",
"0.44356626",
"0.44354495",
"0.44221455",
"0.44210708",
"0.44199878",
"0.44165048"
] | 0.8010035 | 0 |
/ INFO: This method will return current campaian status for given app INPUT: myAppName => String RETURN: boolean, true => 'enable', false => 'disable' | public boolean checkCurrentCampaianStatus(String myAppName) {
boolean currentValue;
Log.info("Searching for current compaign status for app" + myAppName);
WebElement myAccount = getAccontDetails(myAppName);
WebElement myAccountCampaianStatus = myAccount.findElement(By.className("adminTable3"));
String elementPageSource = myAccountCampaianStatus.getAttribute("outerHTML");
boolean ifactive = checkAccountAction(myAppName);
if (ifactive) {
if (elementPageSource.contains("checked=" + "\"checked\"")) {
Log.info(myAppName + " compaign is enabled");
currentValue = true;
} else {
Log.info(myAppName + " compaign is disabled");
currentValue = false;
}
return currentValue;
} else {
if (elementPageSource.contains("disabled=" + "\"disabled\"")) {
Log.info(myAppName + " compaign is disabled");
currentValue = false;
} else {
Log.error(myAppName + " compaign is enabled Which is a deactivatd app");
currentValue = true;
}
return currentValue;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean checkCurrentOfferStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountOfferStatus = myAccount.findElement(By.className(\"adminTable4 \"));\n\t\tString elementPageSource = myAccountOfferStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" offer is enabled Which is a deactivated app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"public boolean checkAccountStatus(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='adminTable2 ']\"));\n\t\tLog.info(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Inactive\") && myAccountField.getText().contains(strDate)) {\n\t\t\tLog.info(\"current account status for app\" + myAppName + \"is inactive\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(\"current account status for app\" + myAppName + \"is active\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public boolean checkAppApproveStatus(String myAppName) {\n\t\tSystem.out.println(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='approve_notify']//span]\"));\n\t\tSystem.out.println(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Approve\") && myAccountField.getText().contains(strDate)) {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is approved\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is pending\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public boolean getAtmStatus();",
"public String AccountStatus() {\n\t\tString Online = \"//android.widget.TextView[@text='ONLINE']\";\n\t\tString ProfileStatus;\n\t\tboolean ObjectStatus = ObjectFoundorNot(Online);\n\t\tif(ObjectStatus == true) {\n\t\t\tProfileStatus = keypad.SelectAccountStatusOnline.getText();\n\t\t}\n\t\telse {\n\t\t\tProfileStatus = keypad.SelectAccountStatusOffline.getText();\n\t\t}\n\t\treturn ProfileStatus;\n\t}",
"public String getStatus()\r\n {\n return (\"1\".equals(getField(\"ApprovalStatus\")) && \"100\".equals(getField(\"HostRespCode\")) ? \"Approved\" : \"Declined\");\r\n }",
"public boolean getStatus(){\n return activestatus;\n }",
"String getStatus();",
"String getStatus();",
"String getStatus();",
"String getStatus();",
"String getStatus();",
"boolean getStatus();",
"boolean getStatus();",
"boolean getStatus();",
"public abstract String currentStatus();",
"java.lang.String getStatus();",
"java.lang.String getStatus();",
"java.lang.String getStatus();",
"java.lang.String getStatus();",
"UserStatus getStatus();",
"public boolean returnStatus(){\n return status;\r\n }",
"public String showStatus();",
"public int getCBRStatus();",
"String status();",
"String status();",
"public String getStatus(){\n\n //returns the value of the status field\n return this.status;\n }",
"boolean isSetStatus();",
"public Boolean getStatus() {return status;}",
"public String getUserStatus() {\n return userStatus;\n }",
"public String getStatus() {\n return mBundle.getString(KEY_STATUS);\n }",
"public boolean getStatus()\n\t{\n\t\treturn getBooleanIOValue(\"Status\", false);\n\t}",
"public boolean checkAccountAction(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue = false;\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement Tab = myAccount.findElement(By.className(\"adminTable5\"));\n\t\tString elementPageSource = Tab.getAttribute(\"outerHTML\");\n\t\tif (elementPageSource.contains(\"deactivate.png\")) {\n\t\t\tLog.info(myAppName + \" account is activated\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(myAppName + \" account is deactivated\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"String getDataStatus();",
"@Override\n\tpublic int getStatus() {\n\t\treturn _scienceApp.getStatus();\n\t}",
"public CoreState getCurrentStatus() {\n return doStuffStrategy.determineCurrentStatus(this, 3000);\r\n }",
"public Boolean getStatus() {\n return status;\n }",
"public Boolean getStatus() {\n return status;\n }",
"public Boolean getStatus() {\n return status;\n }",
"@GET(\"system/status\")\n Call<InlineResponse200> getStatus();",
"public String getAstatus() {\n return astatus;\n }",
"public java.lang.String getUserStatus() {\r\n return userStatus;\r\n }",
"public java.lang.String getUserStatus() {\n return userStatus;\n }",
"public int getStatus();",
"public int getStatus();",
"public int getStatus();",
"public boolean getStatus(){\r\n\t\treturn status;\r\n\t}",
"public Status getStatus();",
"public String getStatus(){\r\n\t\treturn status;\r\n\t}",
"public boolean getStatus() {\n\treturn status;\n }",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"public String getStatus(){\n return this.registerStatus;\n }",
"public boolean checkLionStatus() {//opening checkLionStatus method\n return isCatRunning;\n }",
"public String getUiStatus() {\n\t\tif (switchInfo.getType().compareTo(\"thermostat\") == 0) {\r\n\t\t\ttry {\r\n\t\t\t\tDouble tmp = new Double((String) myISY.getCurrValue(myISY.getNodes().get(switchInfo.getSwitchAddress()),\r\n\t\t\t\t\t\tInsteonConstants.DEVICE_STATUS));\r\n\t\t\t\ttmp = tmp / 2;\r\n\t\t\t\treturn tmp.toString();\r\n\t\t\t} catch (NoDeviceException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (NullPointerException e) {\r\n\t\t\t}\r\n\t\t} else if ((switchInfo.getType().compareTo(\"light\") == 0)\r\n\t\t\t\t|| (switchInfo.getType().compareTo(\"circulator\") == 0)) {\r\n\t\t\ttry {\r\n\t\t\t\tDouble tmp = new Double((String) myISY.getCurrValue(myISY.getNodes().get(switchInfo.getSwitchAddress()),\r\n\t\t\t\t\t\tInsteonConstants.DEVICE_STATUS));\r\n\t\t\t\ttmp = tmp / 255 * 100;\r\n\t\t\t\tif (tmp == 0)\r\n\t\t\t\t\treturn \"OFF\";\r\n\t\t\t\telse if (tmp == 100)\r\n\t\t\t\t\treturn \"ON\";\r\n\t\t\t\treturn \"ON \" + tmp + \"%\";\r\n\t\t\t} catch (NoDeviceException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (NullPointerException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}",
"public String getStatus () {\r\n return status;\r\n }",
"public String getStatus(){\n\t\t\n\t\treturn this.status;\n\t}",
"public java.lang.String getUserAvaibility(int status) throws android.os.RemoteException;",
"public boolean getOnlineStatus(int status) throws android.os.RemoteException;",
"public String getToolcheckstatus() {\r\n return toolcheckstatus;\r\n }",
"public Boolean isActive(){return status;}",
"public java.lang.CharSequence getStatus() {\n return status;\n }",
"public String getStatus()\n {\n\n return status;\n }",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.AuditingCompanyStatus.Enum getHasAuditingCompany();",
"public java.lang.CharSequence getStatus() {\n return status;\n }",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"public String getStatus() { return status; }",
"public String status() {\n return statusEnum().toString();\n }",
"public String getProgramStatusAsString() {\n return getProgramStatus().name();\n }",
"@Override\r\n\tpublic String getPauliscoolStatus() {\n\t\treturn \"Paul Is Cool\";\r\n\t}"
] | [
"0.6850861",
"0.6638901",
"0.63945913",
"0.63635695",
"0.6309649",
"0.6278387",
"0.62695277",
"0.62452704",
"0.62452704",
"0.62452704",
"0.62452704",
"0.62452704",
"0.6083327",
"0.6083327",
"0.6083327",
"0.6072417",
"0.606262",
"0.606262",
"0.606262",
"0.606262",
"0.6026459",
"0.59755635",
"0.5868898",
"0.58422315",
"0.58388406",
"0.58388406",
"0.58034235",
"0.57949245",
"0.57934046",
"0.57794803",
"0.57780313",
"0.57403606",
"0.5728012",
"0.5722181",
"0.5700698",
"0.57003546",
"0.569933",
"0.569933",
"0.569933",
"0.5663392",
"0.5660967",
"0.5660758",
"0.56549704",
"0.565329",
"0.565329",
"0.565329",
"0.5643932",
"0.5635089",
"0.56243956",
"0.5621866",
"0.5619933",
"0.5619933",
"0.5619933",
"0.5619933",
"0.5619933",
"0.5619933",
"0.5619933",
"0.5619933",
"0.5619933",
"0.5619933",
"0.5619933",
"0.56158173",
"0.56152385",
"0.5611474",
"0.56028676",
"0.5595023",
"0.55908525",
"0.5589069",
"0.55866486",
"0.5583149",
"0.5566661",
"0.5565828",
"0.5565265",
"0.5563534",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55627525",
"0.55526656",
"0.55457956",
"0.55367976",
"0.5528949"
] | 0.7892197 | 0 |
/ INFO: This method will return current Offer status for given app INPUT: myAppName => String RETURN: boolean, true => 'enable', false => 'disable' | public boolean checkCurrentOfferStatus(String myAppName) {
boolean currentValue;
Log.info("Searching for current compaign status for app" + myAppName);
WebElement myAccount = getAccontDetails(myAppName);
WebElement myAccountOfferStatus = myAccount.findElement(By.className("adminTable4 "));
String elementPageSource = myAccountOfferStatus.getAttribute("outerHTML");
boolean ifactive = checkAccountAction(myAppName);
if (ifactive) {
if (elementPageSource.contains("checked=" + "\"checked\"")) {
Log.info(myAppName + " offer is enabled");
currentValue = true;
} else {
Log.info(myAppName + " offer is disabled");
currentValue = false;
}
return currentValue;
} else {
if (elementPageSource.contains("disabled=" + "\"disabled\"")) {
Log.info(myAppName + " offer is disabled");
currentValue = false;
} else {
Log.error(myAppName + " offer is enabled Which is a deactivated app");
currentValue = true;
}
return currentValue;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean checkAppApproveStatus(String myAppName) {\n\t\tSystem.out.println(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='approve_notify']//span]\"));\n\t\tSystem.out.println(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Approve\") && myAccountField.getText().contains(strDate)) {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is approved\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is pending\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public boolean checkCurrentCampaianStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountCampaianStatus = myAccount.findElement(By.className(\"adminTable3\"));\n\t\tString elementPageSource = myAccountCampaianStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" compaign is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" compaign is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" compaign is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" compaign is enabled Which is a deactivatd app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"public boolean checkAccountStatus(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='adminTable2 ']\"));\n\t\tLog.info(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Inactive\") && myAccountField.getText().contains(strDate)) {\n\t\t\tLog.info(\"current account status for app\" + myAppName + \"is inactive\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(\"current account status for app\" + myAppName + \"is active\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public String getBestofferenabled() {\r\n return bestofferenabled;\r\n }",
"public String AccountStatus() {\n\t\tString Online = \"//android.widget.TextView[@text='ONLINE']\";\n\t\tString ProfileStatus;\n\t\tboolean ObjectStatus = ObjectFoundorNot(Online);\n\t\tif(ObjectStatus == true) {\n\t\t\tProfileStatus = keypad.SelectAccountStatusOnline.getText();\n\t\t}\n\t\telse {\n\t\t\tProfileStatus = keypad.SelectAccountStatusOffline.getText();\n\t\t}\n\t\treturn ProfileStatus;\n\t}",
"public boolean checkAccountAction(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue = false;\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement Tab = myAccount.findElement(By.className(\"adminTable5\"));\n\t\tString elementPageSource = Tab.getAttribute(\"outerHTML\");\n\t\tif (elementPageSource.contains(\"deactivate.png\")) {\n\t\t\tLog.info(myAppName + \" account is activated\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(myAppName + \" account is deactivated\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"@Override\n\tpublic long getApprovedstatus() {\n\t\treturn _buySellProducts.getApprovedstatus();\n\t}",
"public String getEbaynoweligible() {\r\n return ebaynoweligible;\r\n }",
"public boolean approveApp(String myAppName) {\n\t\tLog.info(\"Checking if App:\" + myAppName + \"came for approval\");\n\t\tWebElement myElement = getAppFromList(myAppName);\n\t\tif (myElement != null) {\n\t\t\tLog.info(myAppName + \"came for approval. Approving it now..\");\n\t\t\tWebElement approveButton = myElement.findElement(By.id(\"appsEditApprove\"));\n\t\t\tapproveButton.click();\n\t\t\tapp_confrim.click();\n\t\t\tif (getAccontDetails(myAppName) != null) {\n\t\t\t\tLog.info(myAppName + \"is approved now\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tLog.info(\"failed to approve\" + myAppName);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tLog.info(myAppName + \"did not showed up in approval list\");\n\t\t\treturn false;\n\t\t}\n\n\t}",
"String getSwstatus();",
"public String getStatus()\r\n {\n return (\"1\".equals(getField(\"ApprovalStatus\")) && \"100\".equals(getField(\"HostRespCode\")) ? \"Approved\" : \"Declined\");\r\n }",
"public boolean getAtmStatus();",
"public boolean isApplianceOn() {\n\n return isOn;\n }",
"protected boolean isActive(String appName) {\n return appFile(appName, \"active\").exists();\n }",
"@Path(\"status/{avaliability}\")\r\n @GET\r\n @Produces(MediaType.APPLICATION_XML)\r\n public Listings getStatus(@PathParam(\"avaliability\") String avaliability) throws JAXBException, IOException {\r\n appR applicationR = getApp();\r\n Listings listings = applicationR.getListings();\r\n Listings ret = new Listings();\r\n Boolean s = false;\r\n if (avaliability.equals(\"avaliable\") || avaliability.equals(\"true\")) {\r\n s = true;\r\n }\r\n\r\n for (Listing listing : listings.getList()) {\r\n if (listing.isAvailable() == s) {\r\n ret.addListing(listing);\r\n }\r\n }\r\n return ret;\r\n }",
"public String marketplaceOffer() {\n return this.marketplaceOffer;\n }",
"public boolean getStatus(){\n return activestatus;\n }",
"Offer getOffer();",
"public boolean isBuyable();",
"public boolean getAvailability(){\n return availabile;\n }",
"@Override\n\tpublic long getStatus() {\n\t\treturn _buySellProducts.getStatus();\n\t}",
"public boolean getOnSell() {\n\t\treturn this.onSell;\n\t}",
"@Override\n\tpublic int getStatus() {\n\t\treturn _scienceApp.getStatus();\n\t}",
"private static int getAcceptDecision(Offer offer) {\n\t\treturn 0;\n\t}",
"boolean CanOfferTrade(Resources offer);",
"String getStatus();",
"String getStatus();",
"String getStatus();",
"String getStatus();",
"String getStatus();",
"public abstract String currentStatus();",
"@gw.internal.gosu.parser.ExtendedProperty\n public typekey.RateBookStatus getStatus();",
"boolean getOptOutOnlineStatus();",
"String getDisabledByPolicyTitleForFinancedDevice();",
"public MarketStatus getStatus(){\n return status;\n }",
"public boolean getOnlineStatus(int status) throws android.os.RemoteException;",
"public java.lang.String getUserAvaibility(int status) throws android.os.RemoteException;",
"boolean getStatus();",
"boolean getStatus();",
"boolean getStatus();",
"java.lang.String getStatus();",
"java.lang.String getStatus();",
"java.lang.String getStatus();",
"java.lang.String getStatus();",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.AuditingCompanyStatus.Enum getHasAuditingCompany();",
"String provisioningState();",
"public static boolean isAppInstalledAndEnabled(Context context, String appPackageName) {\n try {\n PackageManager pm = context.getPackageManager();\n PackageInfo info = pm.getPackageInfo(appPackageName, PackageManager.GET_ACTIVITIES);\n boolean installed = true;\n boolean enabled = info.applicationInfo.enabled;\n\n return installed && enabled;\n } catch (PackageManager.NameNotFoundException e) {\n return false;\n }\n }",
"public String getOptInStatus() {\n return optInStatus;\n }",
"public static boolean isAppEnabled(Context context)\n {\n return SystemServices.getSharedPreferences(context).getBoolean(context.getString(R.string.enable_pref), context.getString(R.string.enable_default) == \"true\");\n }",
"public String getHarvesterStatus() {\n\n\t\tif (harvesterStatus == null) {\n\n\t\t\tharvesterStatus = \"ENABLED\";\n\n\t\t}\n\n\t\treturn harvesterStatus;\n\n\t}",
"private boolean getConnectStatus(String bssid){\n\n ConnectivityManager connManager = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo networkInfo = connManager.getActiveNetworkInfo();\n if (networkInfo!=null){\n if (networkInfo.getType() == ConnectivityManager.TYPE_WIFI){\n\n if (networkInfo.isConnected()){\n\n WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);\n WifiInfo connectionInfo = wifiManager.getConnectionInfo();\n if (connectionInfo!=null && connectionInfo.getBSSID().equals(bssid)){\n return true;\n }\n }\n\n }\n\n }\n\n return false;\n\n }",
"public List<String> getPaymentRequestInReceivingStatus();",
"String getDataStatus();",
"cosmos.gov.v1beta1.ProposalStatus getStatus();",
"public String getUiStatus() {\n\t\tif (switchInfo.getType().compareTo(\"thermostat\") == 0) {\r\n\t\t\ttry {\r\n\t\t\t\tDouble tmp = new Double((String) myISY.getCurrValue(myISY.getNodes().get(switchInfo.getSwitchAddress()),\r\n\t\t\t\t\t\tInsteonConstants.DEVICE_STATUS));\r\n\t\t\t\ttmp = tmp / 2;\r\n\t\t\t\treturn tmp.toString();\r\n\t\t\t} catch (NoDeviceException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (NullPointerException e) {\r\n\t\t\t}\r\n\t\t} else if ((switchInfo.getType().compareTo(\"light\") == 0)\r\n\t\t\t\t|| (switchInfo.getType().compareTo(\"circulator\") == 0)) {\r\n\t\t\ttry {\r\n\t\t\t\tDouble tmp = new Double((String) myISY.getCurrValue(myISY.getNodes().get(switchInfo.getSwitchAddress()),\r\n\t\t\t\t\t\tInsteonConstants.DEVICE_STATUS));\r\n\t\t\t\ttmp = tmp / 255 * 100;\r\n\t\t\t\tif (tmp == 0)\r\n\t\t\t\t\treturn \"OFF\";\r\n\t\t\t\telse if (tmp == 100)\r\n\t\t\t\t\treturn \"ON\";\r\n\t\t\t\treturn \"ON \" + tmp + \"%\";\r\n\t\t\t} catch (NoDeviceException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (NullPointerException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}",
"public String getApp();",
"Boolean isAvailable();",
"@Override\n public int getStorageEncryptionStatus(@Nullable String callerPackage, int userHandle) {\n if (!mHasFeature) {\n // Ok to return current status.\n }\n Preconditions.checkArgumentNonnegative(userHandle, \"Invalid userId\");\n\n final CallerIdentity caller = getCallerIdentity(callerPackage);\n Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle));\n\n\n final ApplicationInfo ai;\n try {\n ai = mIPackageManager.getApplicationInfo(callerPackage, 0, userHandle);\n } catch (RemoteException e) {\n throw new SecurityException(e);\n }\n\n boolean legacyApp = false;\n if (ai.targetSdkVersion <= Build.VERSION_CODES.M) {\n legacyApp = true;\n }\n\n final int rawStatus = getEncryptionStatus();\n if ((rawStatus == DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE_PER_USER) && legacyApp) {\n return DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE;\n }\n return rawStatus;\n }",
"String getNeedsInventoryIssuance();",
"void checkForApps();",
"public static HashMap<String, String> getCountAllEligibilityAndApplianceStatus() {\n\t\tHashMap<String, String> map = new HashMap<>();\r\n\t\tConnection connection = Connect.getConnection();\r\n\t\ttry {\r\n\t\t\tResultSet resultSet = connection.prepareCall(\r\n\t\t\t\t\t\"{CALL count_all_eligibility_and_appliance_status}\")\r\n\t\t\t\t\t.executeQuery();\r\n\t\t\tint accepted = 0;\r\n\t\t\tint rejected = 0;\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\tString status = resultSet.getString(\"t.status\");\r\n\t\t\t\tif (status != null && !status.isEmpty()) {\r\n\t\t\t\t\tif (status.equals(\"appliance_status\")) {\r\n\r\n\t\t\t\t\t\tif (resultSet.getInt(\"status\") == 0) {\r\n\t\t\t\t\t\t\tmap.put(\"Inactive\", resultSet.getInt(1) + \"\");\r\n\t\t\t\t\t\t} else if (resultSet.getInt(\"status\") == 1) {\r\n\t\t\t\t\t\t\tmap.put(\"Active\", resultSet.getInt(1) + \"\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (status.equals(\"eligibility_status\")) {\r\n\t\t\t\t\t\tif (resultSet.getInt(\"status\") == 0) {\r\n\t\t\t\t\t\t\tmap.put(\"Applied\", resultSet.getInt(1) + \"\");\r\n\t\t\t\t\t\t} else if (resultSet.getInt(\"status\") == 1\r\n\t\t\t\t\t\t\t\t|| resultSet.getInt(\"status\") == 6) {\r\n\t\t\t\t\t\t\taccepted += resultSet.getInt(1);\r\n\t\t\t\t\t\t\t// System.out.println(\"Current Accepted\r\n\t\t\t\t\t\t\t// \"+resultSet.getInt(1));\r\n\t\t\t\t\t\t\tSystem.out.println(\"Accepted : \" + accepted);\r\n\t\t\t\t\t\t\tmap.put(\"Accepted\", accepted + \"\");\r\n\t\t\t\t\t\t} else if (resultSet.getInt(\"status\") == 2\r\n\t\t\t\t\t\t\t\t|| resultSet.getInt(\"status\") == 4) {\r\n\t\t\t\t\t\t\trejected += resultSet.getInt(1);\r\n\t\t\t\t\t\t\t// System.out.println(\"Rejected : \"+rejected);\r\n\t\t\t\t\t\t\tmap.put(\"Rejected\", rejected + \"\");\r\n\t\t\t\t\t\t} else if (resultSet.getInt(\"status\") == 3) {\r\n\t\t\t\t\t\t\tmap.put(\"NotInterested\", resultSet.getInt(1) + \"\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// maps.add(map);\r\n\r\n\t\t\t}\r\n\t\t\tconnection.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlogger.error(\"\", e);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn map;\r\n\t}",
"private static void checkStatus() {\n\r\n\t\tDate date = new Date();\r\n\t\tSystem.out.println(\"Checking at :\"+date.toString());\r\n\t\tString response = \"\";\r\n\t\ttry {\r\n\t\t\tresponse = sendGET(GET_URL_COVAXIN);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t//System.out.println(response.toString());\r\n\t\tArrayList<Map> res = formatResponse(response);\r\n\r\n\t\tres = checkAvailability(res);\r\n\t\tif(res.size()>0)\r\n\t\t\tnotifyUser(res);\r\n\t\t//System.out.println(emp.toString());\r\n\t}",
"boolean hasUserAppId();",
"boolean hasUserAppId();",
"public boolean getActive();",
"public boolean getActive();",
"java.lang.String getEnabled();",
"int getBuyCurrent();",
"public boolean isApproved();",
"public boolean isApproved();",
"public String getMarketingsStatusName() {\n return marketingsStatusName;\n }",
"com.polytech.spik.protocol.SpikMessages.Status getStatus();",
"com.polytech.spik.protocol.SpikMessages.Status getStatus();",
"public static URL getUrlForPostSetAppState()\r\n {\r\n String strUrl = getBaseURL() +\"account_services/api/1.0/application/app_status\";\r\n return str2url( strUrl );\r\n }",
"public abstract OnlineStatus getStatus();",
"public OnlineStatus getOnlineStatus() {\n return notifier.onlineStatusFromCarrierStatus(notifier.carrierHelper.getFriendOnlineStatus(carrierUserID));\n }",
"boolean isStatusSuspensao();",
"boolean isAvailable();",
"boolean isAvailable();",
"boolean isAvailable();",
"boolean isAvailable();",
"public int getCBRStatus();",
"@GET(\"system/status\")\n Call<InlineResponse200> getStatus();",
"public int getNonMarketAppsAllowed() {\n int type = -1;\n try {\n type = Settings.Secure.getInt(mContext.getContentResolver(),\n Settings.Secure.INSTALL_NON_MARKET_APPS);\n } catch (SettingNotFoundException e) {\n e.printStackTrace();\n }\n return type;\n }",
"public Byte getApproveStatus() {\n return approveStatus;\n }",
"public String getEligibleforpickupinstore() {\r\n return eligibleforpickupinstore;\r\n }",
"boolean hasAdvertisingPartner();",
"public String getBuy_mode() {\r\n\t\treturn buy_mode;\r\n\t}",
"public boolean isProgramActive(String programId);",
"boolean CanBuyDevCard();",
"boolean hasBuyDescribe();",
"public abstract boolean isAvailable();",
"public abstract boolean isAvailable();",
"boolean isInactive() {\n String value = configData.get(IS_ACTIVE_KEY, \"true\");\n return !Boolean.parseBoolean(value);\n }",
"public boolean acceptedTradeOffer()\n\t{\n\t\treturn m_isReadyToTrade;\n\t}",
"public String getApprove() {\r\n if (approve == null)\r\n approve = initApproveElement().findElement(By.cssSelector(\"[data-role*='approvalStatus']\")).getText();\r\n return approve;\r\n }",
"protected String getStatus()\n { return call_state; \n }",
"boolean getIsAmazon();",
"String status();",
"String status();"
] | [
"0.68721664",
"0.6630206",
"0.64709383",
"0.6332392",
"0.5881341",
"0.585483",
"0.57084656",
"0.5693968",
"0.5680749",
"0.5672589",
"0.5639944",
"0.5618745",
"0.5614241",
"0.55942863",
"0.5591193",
"0.5548944",
"0.55476934",
"0.55424243",
"0.55226326",
"0.5516412",
"0.550405",
"0.5479464",
"0.5425389",
"0.539523",
"0.5370113",
"0.5363249",
"0.5363249",
"0.5363249",
"0.5363249",
"0.5363249",
"0.5359539",
"0.5358972",
"0.53466576",
"0.5326495",
"0.531572",
"0.5310099",
"0.5305514",
"0.53014326",
"0.53014326",
"0.53014326",
"0.52869684",
"0.52869684",
"0.52869684",
"0.52869684",
"0.5260757",
"0.52372533",
"0.52259225",
"0.5219428",
"0.5206534",
"0.51942205",
"0.51800597",
"0.51790017",
"0.51732725",
"0.5167276",
"0.516634",
"0.51593935",
"0.5159347",
"0.5152507",
"0.5130783",
"0.5099877",
"0.5077046",
"0.5070698",
"0.50697273",
"0.50697273",
"0.50662935",
"0.50662935",
"0.5056375",
"0.50553536",
"0.5053237",
"0.5053237",
"0.5047282",
"0.5046949",
"0.5046949",
"0.5038276",
"0.50338715",
"0.50312155",
"0.5030842",
"0.5029869",
"0.5029869",
"0.5029869",
"0.5029869",
"0.50273013",
"0.5025479",
"0.50252944",
"0.50242436",
"0.5016769",
"0.5015973",
"0.5009596",
"0.50046146",
"0.50040954",
"0.50006765",
"0.4999295",
"0.4999295",
"0.49871963",
"0.4986521",
"0.4979587",
"0.49785462",
"0.49778575",
"0.4976487",
"0.4976487"
] | 0.82106894 | 0 |
/ INFO: This method switches Account status based on user input i.e considering false = 'disable' and true = 'enable' if user passes true this method will enable the campaign for given app and vice versa INPUT: myAppName => String RETURN: boolean, true => 'enable', false => 'disable' | public void switchAccountStatus(boolean userValue, String myAppName) {
Log.info("Searching for current account status for app" + myAppName);
boolean currentValue = checkAccountAction(myAppName);
WebElement myAccount = getAccontDetails(myAppName);
if (userValue != currentValue) {
Log.info("Chaging the current account status for app" + myAppName);
WebElement tab = myAccount.findElement(By.className("adminTable5"));
WebElement slider = tab.findElement(By.id("navButton"));
slider.click();
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
app_confrim.click();
} else {
Log.info(myAppName + "is already in desired state. No Action needed");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void switchCampaign(boolean userValue, String myAppName) {\n\t\tLog.info(\"Trying to get current compaign status for app\" + myAppName);\n\t\tboolean currentValue = checkCurrentCampaianStatus(myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tif (userValue != currentValue) {\n\t\t\tLog.info(\"Chaging the current compaign status for app\" + myAppName);\n\t\t\tWebElement tab = myAccount.findElement(By.className(\"adminTable3 \"));\n\t\t\tWebElement slider = tab.findElement(By.className(\"slider\"));\n\t\t\tslider.click();\n\t\t} else {\n\t\t\tLog.info(myAppName + \"is already in desired state. No Action needed\");\n\t\t}\n\t}",
"public boolean checkAccountAction(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue = false;\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement Tab = myAccount.findElement(By.className(\"adminTable5\"));\n\t\tString elementPageSource = Tab.getAttribute(\"outerHTML\");\n\t\tif (elementPageSource.contains(\"deactivate.png\")) {\n\t\t\tLog.info(myAppName + \" account is activated\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(myAppName + \" account is deactivated\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public boolean checkCurrentCampaianStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountCampaianStatus = myAccount.findElement(By.className(\"adminTable3\"));\n\t\tString elementPageSource = myAccountCampaianStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" compaign is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" compaign is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" compaign is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" compaign is enabled Which is a deactivatd app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"public boolean checkCurrentOfferStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountOfferStatus = myAccount.findElement(By.className(\"adminTable4 \"));\n\t\tString elementPageSource = myAccountOfferStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" offer is enabled Which is a deactivated app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"public boolean checkAccountStatus(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='adminTable2 ']\"));\n\t\tLog.info(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Inactive\") && myAccountField.getText().contains(strDate)) {\n\t\t\tLog.info(\"current account status for app\" + myAppName + \"is inactive\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(\"current account status for app\" + myAppName + \"is active\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public boolean checkAppApproveStatus(String myAppName) {\n\t\tSystem.out.println(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='approve_notify']//span]\"));\n\t\tSystem.out.println(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Approve\") && myAccountField.getText().contains(strDate)) {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is approved\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is pending\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"@Override\r\n\tpublic boolean updateAccountSw(String accId, String activeSw) {\r\n\t\tlogger.debug(\"*** updateAccountSw() method started\");\r\n\t\tString fileName = null, mailSub = null, mailBody = null, password = null;\r\n\t\ttry {\r\n\t\t\t// load existing record using accId\r\n\t\t\tAppAccountEntity entity = appAccRepository.findById(Integer.parseInt(accId)).get();\r\n\t\t\tif (entity != null) {\r\n\t\t\t\t// Setting Account Active Sw (Y|N)\r\n\t\t\t\tentity.setActiveSw(activeSw);\r\n\t\t\t\t// Updating Account\r\n\t\t\t\tappAccRepository.save(entity);\r\n\t\t\t\tlogger.debug(\"*** updateAccountSw() method ended\");\r\n\r\n\t\t\t\tAppAccount accModel = new AppAccount();\r\n\t\t\t\tBeanUtils.copyProperties(entity, accModel);\r\n\r\n\t\t\t\t// TODO:Need to complete email functionality\r\n\t\t\t\tif (activeSw.equals(\"Y\")) {\r\n\t\t\t\t\t// send Email saying account activated\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\t// get file name\r\n\t\t\t\t\t\tfileName = appProperties.getProperties().get(AppConstants.ACTIVATE_EMAIL_FILE);\r\n\t\t\t\t\t\t// get mail subject\r\n\t\t\t\t\t\tmailSub = appProperties.getProperties().get(AppConstants.ACTIVATE_EMAIL_SUB);\r\n\t\t\t\t\t\t// decrypt the password\r\n\t\t\t\t\t\tpassword = PasswordUtils.decrypt(accModel.getPassword());\r\n\t\t\t\t\t\t// set decrypted password to accModel object password field\r\n\t\t\t\t\t\taccModel.setPassword(password);\r\n\t\t\t\t\t\t// get email body\r\n\t\t\t\t\t\tmailBody = getEmailBodyContent(accModel, fileName);\r\n\t\t\t\t\t\t// send email to activate registered cw/admin\r\n\t\t\t\t\t\temailUtils.sendEmail(entity.getEmail(), mailSub, mailBody);\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\tlogger.error(\"Email Sending is failed : \" + e.getMessage());\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\t// send Email saying account de-activated\r\n\t\t\t\t\t\t// send account de-activation mail to registered case worker/admin\r\n\t\t\t\t\t\t// get file name\r\n\t\t\t\t\t\tfileName = appProperties.getProperties().get(AppConstants.DE_ACTIVATE_EMAIL_FILE);\r\n\t\t\t\t\t\t// get email subject\r\n\t\t\t\t\t\tmailSub = appProperties.getProperties().get(AppConstants.DE_ACTIVATE_EMAIL_SUB);\r\n\t\t\t\t\t\t// get email body content\r\n\t\t\t\t\t\tmailBody = getDeActivateAccountEmailBodyContent(fileName, accModel);\r\n\t\t\t\t\t\t// send email to registered cw/admin\r\n\t\t\t\t\t\temailUtils.sendEmail(entity.getEmail(), mailSub, mailBody);\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\tlogger.error(\"Email Sending is failed : \" + e.getMessage());\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} catch (Exception e) {\r\n\t\t\tlogger.error(\"Exception occured in updateAccountSw() method : \" + e.getMessage());\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"boolean transactTo_isAccountDisabled(int code, String transactName, ComponentName who, String accountType, int userId) {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n boolean bDisabled = false;\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \" to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n _data.writeString(accountType);\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n bDisabled = _reply.readInt() == 1;\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n return bDisabled;\n }",
"public boolean approveApp(String myAppName) {\n\t\tLog.info(\"Checking if App:\" + myAppName + \"came for approval\");\n\t\tWebElement myElement = getAppFromList(myAppName);\n\t\tif (myElement != null) {\n\t\t\tLog.info(myAppName + \"came for approval. Approving it now..\");\n\t\t\tWebElement approveButton = myElement.findElement(By.id(\"appsEditApprove\"));\n\t\t\tapproveButton.click();\n\t\t\tapp_confrim.click();\n\t\t\tif (getAccontDetails(myAppName) != null) {\n\t\t\t\tLog.info(myAppName + \"is approved now\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tLog.info(\"failed to approve\" + myAppName);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tLog.info(myAppName + \"did not showed up in approval list\");\n\t\t\treturn false;\n\t\t}\n\n\t}",
"void transactTo_setAccountDisabled(int code, String transactName, ComponentName who, String accountType, boolean disabled, int userId) {\n int i = 1;\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \" to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n _data.writeString(accountType);\n if (!disabled) {\n i = 0;\n }\n _data.writeInt(i);\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n }",
"@Override\n public void onClick(View v) {\n if(custActiveInactive.isChecked()){\n custHardwareReturned.setChecked(false);\n custHardwareReturned.setEnabled(false);\n custHardwareInstalled.setEnabled(true);\n cust.custActiveInActive = 1;\n }else{\n custHardwareInstalled.setChecked(false);\n custHardwareInstalled.setEnabled(false);\n custHardwareReturned.setEnabled(true);\n cust.custActiveInActive = 0;\n }\n }",
"private boolean isSiwtchAccountAllowed(Context context) {\n int cdmaCardNum = 0;\n int gsmCardNum = 0;\n List<PhoneAccountHandle> accountHandles =\n PhoneAccountUtils.getSubscriptionPhoneAccounts(context);\n for (PhoneAccountHandle handle : accountHandles) {\n int subId = Integer.parseInt(handle.getId());\n if (SubscriptionManager.isValidSubscriptionId(subId)) {\n int slotId = SubscriptionManager.getSlotId(subId);\n if (SvlteUiccUtils.getInstance().getSimType(slotId) == SvlteUiccUtils.SIM_TYPE_CDMA\n && TelephonyManagerEx.getDefault().isInHomeNetwork(subId)) {\n cdmaCardNum ++;\n } else if (SvlteUiccUtils.getInstance().getSimType(slotId) ==\n SvlteUiccUtils.SIM_TYPE_GSM) {\n gsmCardNum ++;\n }\n }\n }\n int mainCapabilitySlotId = getMainCapabilitySlotId();\n boolean isGsmCardHasMainCapability = SvlteUiccUtils.getInstance().getSimType(\n mainCapabilitySlotId) == SvlteUiccUtils.SIM_TYPE_GSM;\n if (cdmaCardNum > 0 && gsmCardNum > 0) {\n if (isGsmCardHasMainCapability && isAirplaneModeOn(context)) {\n showAlertToast(context, R.string.can_not_switch_account_temporarily);\n return false;\n }\n\n ITelephonyEx iTelEx = ITelephonyEx.Stub.asInterface(\n ServiceManager.getService(Context.TELEPHONY_SERVICE_EX));\n try {\n if (iTelEx != null && iTelEx.isCapabilitySwitching()) {\n showAlertToast(context, R.string.can_not_switch_account_temporarily);\n return false;\n }\n } catch (RemoteException e) {\n e.printStackTrace();\n Log.d(TAG, \"fail to judge isCapabilitySwitching, RemoteException\");\n }\n\n if (TelecomManager.from(context).isInCall()) {\n showAlertToast(context, R.string.can_not_switch_account_during_call);\n return false;\n }\n\n return true;\n } else {\n return true;\n }\n }",
"boolean withAdvanceInCampaign();",
"@ReactMethod\n public void AlertIfWhitelist(String title, String message, String dontShowAgainText, String positiveText, String negativeText) {\n final SharedPreferences settings = this.getCurrentActivity().getSharedPreferences(\"Whitelist\",Context.MODE_PRIVATE);\n final String saveIfSkip = \"skipWhitelistMessage\";\n boolean skipMessage = settings.getBoolean(saveIfSkip, false);\n // Show dialog only when \"do not show again\" hasn't been enabled yet\n if (!skipMessage) {\n final SharedPreferences.Editor editor = settings.edit();\n // Check if intent of the android whitelist apps activity is callable\n for (Intent intent : AUTO_START_INTENTS){\n if (isCallable(intent)) {\n // Prepare dialog\n final AppCompatCheckBox dontShowAgain = new AppCompatCheckBox(this.getCurrentActivity());\n dontShowAgain.setText(dontShowAgainText);\n dontShowAgain.setLeft(20);\n dontShowAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n editor.putBoolean(saveIfSkip, isChecked);\n editor.apply();\n }\n });\n\n final RelativeLayout layout = new RelativeLayout(this.getCurrentActivity());\n layout.setPadding(50,50,0,0);\n layout.addView(dontShowAgain);\n\n new AlertDialog.Builder(this.getCurrentActivity())\n .setTitle(title)\n .setMessage(message)\n .setView(layout)\n .setPositiveButton(positiveText, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n try {\n for (Intent intent : AUTO_START_INTENTS)\n if (isCallable(intent)) {\n editor.putBoolean(saveIfSkip, true);\n editor.apply();\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);\n reactContext.startActivity(intent);\n break;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n })\n .setNegativeButton(negativeText, null)\n .show();\n break;\n }\n }\n }\n }",
"private boolean onAccountSettings() {\n AccountSettings.actionSettings(mActivity, getActualAccountId());\n return true;\n }",
"void updateUserActivateStatus(User user, int newStatus);",
"boolean activateAccount(Integer userId);",
"private void updateAccountStatus() {\n\r\n }",
"boolean updateEnabling();",
"@PutMapping(value = { \"/accounts/{accountId}\" })\n\tpublic void setAccountActiveState(ModelMap model, @PathVariable(\"accountId\") String accountId,HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\n\t\tlog.info(CLASS_NAME + \"Activate has been requested for gerrit user\"+accountId);\n\t\tRestTemplate restTemplate = CustomRestTemplate.restTemplate(gerritUrl, 443, userName, password);\n\t\tResponseEntity<String> gerritresponse = restTemplate.exchange(gerritUrl + \"/a/accounts/\" + accountId + \"/active\",\n\t\t\t\tHttpMethod.PUT, null, String.class);\n\t\t\n\t\t\n\t\tHttpSession session = request.getSession(false);\n\t\tUserObject user = (UserObject) session.getAttribute(Constant.SESSION.USER);\n\t\t\n\t\tAuditEvent event = new AuditEvent();\n\t\tevent.setAction(EventAction.GERRIT_USER_ACTIVATED);\n\t\tevent.setFromUser(user.getName());\n\t\tevent.setUserId(user.getId().toString());\n\t\tevent.setDescription(user.getName() + \" Activated gerrit user - \"+ accountId);\n\t\thistoryService.logEvent(event);\n\t\tlog.debug(gerritresponse.getBody());\n\n\t}",
"public static boolean configApState(Context context, String apName) {\n WifiManager wifimanager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\n WifiConfiguration wificonfiguration = null;\n try {\n wificonfiguration = new WifiConfiguration();\n wificonfiguration.SSID = apName;\n\n if(isApEnabled(context)) {\n wifimanager.setWifiEnabled(false);\n disableAp(context);\n }\n\n Method method = wifimanager.getClass().getMethod(\"setWifiApEnabled\", WifiConfiguration.class, boolean.class);\n method.invoke(wifimanager, wificonfiguration, !isApEnabled(context));\n return true;\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n }",
"Boolean accountIsActivated(Integer userId);",
"public static boolean isAppEnabled(Context context)\n {\n return SystemServices.getSharedPreferences(context).getBoolean(context.getString(R.string.enable_pref), context.getString(R.string.enable_default) == \"true\");\n }",
"@Override\n public void onEnabled(Context context, Intent intent) {\n new EventBusUtils().send(1);\n// Toast.makeText(context, \"激活ok====\", Toast.LENGTH_SHORT).show();\n//\n }",
"public void onClick(View v) {\n is_enabled=!is_enabled;\n if(!is_enabled){\n textView_current_Status.setText(R.string.switcher_is_being_enabled_please_wait);\n //sayHello();\n Set_Switch_On();\n }else{\n textView_current_Status.setText(R.string.switcher_is_currently_disabled);\n Set_Switch_Off();\n }\n }",
"public void onToggleClicked(View view) {\n boolean on = ((ToggleButton) view).isChecked();\n if (on) {\n if (!BA.isEnabled()) {\n Intent turnOn = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(turnOn, 0);\n Toast.makeText(getApplicationContext(), \"Turned on\", Toast.LENGTH_LONG).show();\n } else {\n Toast.makeText(getApplicationContext(), \"Already on\", Toast.LENGTH_LONG).show();\n }\n } else {\n BA.disable();\n Toast.makeText(getApplicationContext(), \"Turned off\", Toast.LENGTH_LONG).show();\n }\n }",
"@Test\n\tpublic void testAdminEnable() {\n\t\tAccount acc1 = new Account(00000, \"ADMIN\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"temp\", false, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"ADMIN\", 00000, 0, \"A\"));\n\t\ttransactions.add(1, new Transaction(9, \"temp\", 00001, 0, \"A\"));\n\t\ttransactions.add(2, new Transaction(00, \"ADMIN\", 00000, 0, \"A\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (outContent.toString().contains(\"Account Enabled\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"unable to enable account as admin\", testResult);\n\t}",
"public void setActive(){\n paycheckController.setActive();\n }",
"@Override\n public void reloadStatus(Context context) {\n Uri.Builder builder = Uri.parse(context.getString(R.string.donate_server_url)).buildUpon();\n Account[] accounts = AccountManager.get(context).getAccountsByType(\"com.google\");\n for (Account acct : accounts) {\n builder.appendQueryParameter(\"id\", cleanName(acct.name));\n }\n builder.appendQueryParameter(\"id\", phoneNumber);\n \n // Send it to the server and see what comes back\n HttpService.addHttpRequest(context, new HttpRequest(builder.build(), true){\n \n @Override\n public void processBody(String body) {\n for (String line : body.split(\"<br>\")) {\n \n String flds[] = line.split(\",\");\n if (flds.length < 2) continue;\n \n // Evaluate the status field. Value of LIFE translates to year 9999\n int year = -1;\n String stat = flds[1].trim();\n if (stat.equals(\"LIFE\")) {\n year = 9999;\n } else {\n try {\n year = Integer.parseInt(stat);\n } catch (NumberFormatException ex) {}\n if (year < 2011 && year > 2050) year = -1;\n }\n \n // get the current status year. If new status is better, update\n // the user status\n int paidYear = ManagePreferences.freeRider() ? 9999 : ManagePreferences.paidYear();\n if (year > paidYear) {\n if (year == 9999) {\n ManagePreferences.setFreeRider(true);\n } else {\n ManagePreferences.setPaidYear(year, true);\n }\n }\n \n // If status is less that current, ignore everything else\n if (year < paidYear) continue;\n \n // Otherwise evaluate and accept purchase date\n if (flds.length <= 2) continue;\n if (year >= paidYear) {\n Date purchaseDate = null;\n try {\n purchaseDate = DATE_FMT.parse(flds[2].trim());\n } catch (ParseException ex) {}\n if (purchaseDate != null) {\n ManagePreferences.setPurchaseDate(purchaseDate);\n }\n }\n \n // If sponsor code is \"FREE\", set the free subscriber flag\n String sponsor = null;\n boolean free = false;\n if (flds.length > 3) {\n sponsor = flds[3].trim();\n if (sponsor.equals(\"FREE\")) { \n free = true;\n sponsor = null;\n } else if (sponsor.length() == 0) sponsor = null;\n }\n ManagePreferences.setFreeSub(free);\n ManagePreferences.setSponsor(sponsor);\n }\n \n // Set the authorization last checked date\n ManagePreferences.setAuthLastCheckTime();\n }\n });\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsiv_update.changeSwitchStatus();\n\t\t\t\tEditor editor = sharedPreferences.edit();\n\t\t\t\teditor.putBoolean(MobileGuard.APP_AUTO_UPDATE,\n\t\t\t\t\t\tsiv_update.getSwitchStatus());\n\t\t\t\teditor.commit();\n\t\t\t}",
"@Override\n public void onClick(View v) {\n if (mGlobalSwitch != null)\n mGlobalSwitch.setChecked(true);\n else {\n getSharedPreferences(getString(R.string.pref_global), Context.MODE_PRIVATE).edit().putBoolean(getString(R.string.key_enabled), true).commit();\n SendEnabledState(SettingsActivity.this, true);\n }\n mSnackBarAddService.dismiss();\n mSnackBarAddService = null;\n }",
"public void setIsApproved (boolean IsApproved);",
"public void setIsApproved (boolean IsApproved);",
"public boolean activateAccount(String accountNumber) {\r\n\t\treturn setAccountActive(accountNumber, true);\r\n\t}",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n // user didn't want to turn on BT\n if (requestCode == ENABLE_BT_REQUEST_ID) {\n if(resultCode == Activity.RESULT_CANCELED) {\n btDisabled();\n return;\n }\n }\n super.onActivityResult(requestCode, resultCode, data);\n }",
"boolean transactTo_hasHwPolicy(int code, String transactName, int userId) {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n boolean bDisabled = false;\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \" to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n bDisabled = _reply.readInt() == 1;\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n return bDisabled;\n }",
"@SuppressWarnings(\"BooleanMethodIsAlwaysInverted\")\n public boolean handleActivityResult(int requestCode)\n {\n if (requestCode == itsAppSettingsRequestCode) {\n restart();\n return true;\n }\n return false;\n }",
"@Override\r\n\tpublic boolean open() {\n\t\taccountStatus = AccountStatus.ACTIVE;\r\n\t\treturn true;\r\n\t}",
"public boolean preConnectCallAppAbility(String str, String str2) {\n HiLog.info(LOG_LABEL, \"preConnectCallAppAbility\", new Object[0]);\n if (str == null) {\n HiLog.error(LOG_LABEL, \"preConnectCallAppAbility: no call component name.\", new Object[0]);\n return false;\n } else if (str2 == null) {\n HiLog.error(LOG_LABEL, \"preConnectCallAppAbility: no call ability name.\", new Object[0]);\n return false;\n } else {\n ComponentName componentName = new ComponentName(str, str2);\n CallAppAbilityInfo callAppAbilityInfo = this.mInfo;\n if (callAppAbilityInfo == null || !componentName.equals(callAppAbilityInfo.getComponentName())) {\n if (!this.mCallMapById.isEmpty()) {\n HiLog.info(LOG_LABEL, \"preConnectCallAppAbility: still has call.\", new Object[0]);\n return false;\n }\n disconnect();\n CallAppAbilityInfo callAppAbilityInfo2 = this.mInfo;\n if (callAppAbilityInfo2 != null) {\n callAppAbilityInfo2.setComponentName(componentName);\n }\n connect();\n } else if (isConnected()) {\n HiLog.info(LOG_LABEL, \"preConnectCallAppAbility: already connected.\", new Object[0]);\n } else {\n connect();\n }\n this.mIsPreConnected = true;\n return true;\n }\n }",
"public void changeTextStatus(Context context, boolean isConnected) {\n String username = SharedPreference.getInstance(context).getString(C.USERNAME);\n\n String password = SharedPreference.getInstance(context).getString(C.PASSWORD);\n\n if (!isConnected) {\n\n DatabaseHelper databaseHelper = new DatabaseHelper(context);\n boolean str = databaseHelper.checkUser(username, password);\n if (str) {\n Util.ONLINE = false;\n Intent accountsIntent = new Intent(context, ActivityTestList.class);\n accountsIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(accountsIntent);\n\n }\n } else {\n ResponseLogin responseLogin = SharedPreference.getInstance(context).getUser(C.LOGIN_USER);\n if (responseLogin != null) {\n Util.ONLINE = true;\n Globalclass.userids = responseLogin.getUserID();\n Globalclass.roleval = responseLogin.getProfile().get(0).getRole();\n Intent accountsIntent = new Intent(context, ActivityTestList.class);\n accountsIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(accountsIntent);\n }\n }\n }",
"HttpStatus activateUserAccount(final String username);",
"public int updateBot(int botId, String activate) {\n final String updateQuery = \"UPDATE Bots SET activity_status = %s WHERE \" +\n \"bot_id = %d;\";\n final String selectQuery = \"SELECT * FROM Bots WHERE bot_id = %d;\";\n final String errorMessage = \"Error updating bot activity with id %d\";\n final String successMessage = \"Bot with id %d has been %s\";\n\n Bot bot = getBotById(botId);\n\n // Determine if we should enable or disable the bot\n int newActivity;\n if (activate.equals(\"ENABLE\")) {\n newActivity = 1;\n } else if (activate.equals(\"DISABLE\")) {\n newActivity = 0;\n } else { // No change\n newActivity = bot.getStatus();\n }\n\n // Consult the database to get information on the bot to be updated\n ResultSet result = dbConnector.selectQuery(String.format(Locale.US, selectQuery, botId));\n try {\n while (result.next()) {\n // If the bot exists, update the information\n if (result.getInt(\"bot_id\") == botId) {\n dbConnector.updateQuery(String.format(Locale.US, updateQuery, newActivity, botId));\n if(newActivity == 1) {\n System.out.println(String.format(Locale.US, successMessage, botId, \"enabled.\"));\n } else {\n System.out.println(String.format(Locale.US, successMessage, botId, \"disabled.\"));\n }\n return newActivity;\n }\n }\n } catch (SQLException e) {\n System.out.println(String.format(Locale.US, errorMessage, botId));\n }\n return newActivity;\n }",
"int setCanStatus(int canRegno, int action);",
"protected boolean isActive(String appName) {\n return appFile(appName, \"active\").exists();\n }",
"boolean transactTo_setFunctionDisabled(int code, String transactName, ComponentName who, boolean disabled, int userId) {\n int i = 1;\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \"to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n if (!disabled) {\n i = 0;\n }\n _data.writeInt(i);\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n return false;\n }",
"public String AccountStatus() {\n\t\tString Online = \"//android.widget.TextView[@text='ONLINE']\";\n\t\tString ProfileStatus;\n\t\tboolean ObjectStatus = ObjectFoundorNot(Online);\n\t\tif(ObjectStatus == true) {\n\t\t\tProfileStatus = keypad.SelectAccountStatusOnline.getText();\n\t\t}\n\t\telse {\n\t\t\tProfileStatus = keypad.SelectAccountStatusOffline.getText();\n\t\t}\n\t\treturn ProfileStatus;\n\t}",
"public void setStatus(boolean newstatus){activestatus = newstatus;}",
"public final void activateAccount() {\n\t\tthis.setIsAccountLocked(false);\n\t}",
"public boolean isCurrentUserCanChangeAccountStatus() {\r\n return currentUserCanChangeAccountStatus;\r\n }",
"@PUT(\"pushrules/global/{kind}/{ruleId}/enabled\")\n Call<Void> updateEnableRuleStatus(@Path(\"kind\") String kind, @Path(\"ruleId\") String ruleId, @Body Boolean enable);",
"public boolean setApplicationStatus(ApplicationBean application) throws UASException;",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsiv_intercep.changeSwitchStatus();\n\t\t\t\tboolean status = siv_intercep.getSwitchStatus();\n\t\t\t\tIntent intent = new Intent(SettingActivity.this,\n\t\t\t\t\t\tMgInCallStateService.class);\n\t\t\t\tif (status) {\n\t\t\t\t\tstartService(intent);\n\t\t\t\t} else {\n\t\t\t\t\tstopService(intent);\n\t\t\t\t}\n\t\t\t}",
"void checkForAccServices();",
"private boolean accountChecks(Account account){\n // ie. if the account has to be personal for the round-up service to apply\n account.getName(); // check personal\n return true;\n }",
"public void toggleEnable();",
"public void onEnabled(Context context) {\n\t}",
"public abstract void setEnabled(Context context, boolean enabled);",
"@Override\r\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\r\n super.onActivityResult(requestCode, resultCode, data);\r\n Log.v(TAG, \"** onActivityResult **\");\r\n // determine from which activity\r\n switch (requestCode) {\r\n // if it was the request to enable Bluetooth:\r\n case REQUEST_ENABLE_BT:\r\n if (resultCode == Activity.RESULT_OK) {\r\n // Bluetooth is enabled now\r\n Log.v(TAG, \"** Bluetooth is now enabled**\");\r\n } else {\r\n // user decided not to enable Bluetooth so exit application\r\n Log.v(TAG, \"** Bluetooth is NOT enabled**\");\r\n Toast.makeText(this, \"Bluetooth not enabled\",\r\n Toast.LENGTH_LONG).show();\r\n finish();\r\n }\r\n }\r\n }",
"public void enabled(int id) {\n\t\tAccount account=userDao.getAccount(id);\r\n\t\tStatus status=userDao.getStatus(\"ÆôÓÃ\");\r\n\t\taccount.setStatus(status);\r\n\t\tuserDao.updateAccount(account);\r\n\t}",
"private void updateAccessibility() {\n Set<ComponentName> enabledServices = getEnabledServicesFromSettings(context);\n if(null == enabledServices) {\n return;\n }\n // Determine enabled services and accessibility state.\n ComponentName toggledService = ComponentName.unflattenFromString(SERVICE_NAME);\n final boolean accessibilityEnabled;\n // Enabling at least one service enables accessibility.\n accessibilityEnabled = true;\n enabledServices.add(toggledService);\n // Update the enabled services setting.\n StringBuilder enabledServicesBuilder = new StringBuilder();\n // Keep the enabled services even if they are not installed since we\n // have no way to know whether the application restore process has\n // completed. In general the system should be responsible for the\n // clean up not settings.\n for (ComponentName enabledService : enabledServices) {\n enabledServicesBuilder.append(enabledService.flattenToString());\n enabledServicesBuilder.append(ENABLED_ACCESSIBILITY_SERVICES_SEPARATOR);\n }\n final int enabledServicesBuilderLength = enabledServicesBuilder.length();\n if (enabledServicesBuilderLength > 0) {\n enabledServicesBuilder.deleteCharAt(enabledServicesBuilderLength - 1);\n }\n Settings.Secure.putString(context.getContentResolver(),\n Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,\n enabledServicesBuilder.toString());\n Log.d(TAG,\"enabledServicesBuilder = \" + enabledServicesBuilder.toString());\n\n // Update accessibility enabled.\n Settings.Secure.putInt(context.getContentResolver(),\n Settings.Secure.ACCESSIBILITY_ENABLED, accessibilityEnabled ? 1 : 0);\n }",
"@Override\r\n\t\t\tpublic void onSwitchAccount() {\n\t\t\t\tshowToast(\"onSwitchAccount---\");\r\n\t\t\t}",
"public void setActiveStatus(Boolean active){ this.status = active; }",
"public void callActivateOrDeActivateBillCategory()\r\n\t{\r\n\t\tfinal String methodName = \"callActivateOrDeActivateBillCategory\";\r\n\t\tlogger.entering(CLASS_NAME, methodName);\r\n\t\ttry\r\n\t\t{\r\n\t\t\t// Set the value in Session Object\r\n\t\t\tif(getBillCategoryObject().getSelectedBillCategory().getStatus().equals(ConfigurationStatusEnum.ACTIVE))\r\n\t\t\t{\r\n\t\t\t\t// Call the backend service - DeActivate\r\n\t\t\t\tDeactivateBillCategoryRequestType dbcReq = new DeactivateBillCategoryRequestType();\r\n\t\t\t\tdbcReq.setMessageHeader(getMessageHeaderType(\"DEACTIVATE_BILL_CATEGORY\"));\r\n\t\t\t\tdbcReq.setPartnerKey(getBillCategoryObject().getPartnerKey());\r\n\t\t\t\tdbcReq.setBillCategory(getBillCategoryObject().getSelectedBillCategory().getBillCategory());\r\n\t\t\t\tpartnerProfileServices.deactivateBillCategory(dbcReq);\r\n\t\t\t\t// if it reaches here, it means response is successfull change status manually in session object\r\n\t\t\t\tgetBillCategoryObject().getSelectedBillCategory().setStatus(ConfigurationStatusEnum.INACTIVE);\r\n\t\t\t}\r\n\t\t\telse if(getBillCategoryObject().getSelectedBillCategory().getStatus().equals(ConfigurationStatusEnum.INACTIVE))\r\n\t\t\t{\r\n\t\t\t\t// Call the backend service - Activate\r\n\t\t\t\tActivateBillCategoryRequestType abcReq = new ActivateBillCategoryRequestType();\r\n\t\t\t\tabcReq.setMessageHeader(getMessageHeaderType(\"ACTIVATE_BILL_CATEGORY\"));\r\n\t\t\t\tabcReq.setPartnerKey(getBillCategoryObject().getPartnerKey());\r\n\t\t\t\tabcReq.setBillCategory(getBillCategoryObject().getSelectedBillCategory().getBillCategory());\r\n\t\t\t\tpartnerProfileServices.activateBillCategory(abcReq);\r\n\t\t\t\t// if it reaches here, it means response is successfull change status manually in session object\r\n\t\t\t\tgetBillCategoryObject().getSelectedBillCategory().setStatus(ConfigurationStatusEnum.ACTIVE);\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\tcatch (NullPointerException e)\r\n\t\t{\r\n\t\t\tlogger.logp(Level.SEVERE, CLASS_NAME, methodName, e.getMessage());\r\n\t\t\tif (logger.isLoggable(Level.FINEST))\r\n\t\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tcatch (DatatypeConfigurationException e)\r\n\t\t{\r\n\t\t\tlogger.logp(Level.SEVERE, CLASS_NAME, methodName, e.getMessage());\r\n\t\t\tif (logger.isLoggable(Level.FINEST))\r\n\t\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tcatch (PartnerProfileFaultMsg e)\r\n\t\t{\r\n\t\t\tlogger.logp(Level.SEVERE, CLASS_NAME, methodName, e.getMessage());\r\n\t\t\tif (logger.isLoggable(Level.FINEST))\r\n\t\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tlogger.exiting(CLASS_NAME, methodName);\r\n\t}",
"public boolean preDisconnectCallAppAbility(String str, String str2) {\n HiLog.info(LOG_LABEL, \"preDisconnectCallAppAbility\", new Object[0]);\n if (str == null) {\n HiLog.error(LOG_LABEL, \"preDisconnectCallAppAbility: no call component name.\", new Object[0]);\n return false;\n } else if (str2 == null) {\n HiLog.error(LOG_LABEL, \"preDisconnectCallAppAbility: no call ability name.\", new Object[0]);\n return false;\n } else {\n ComponentName componentName = new ComponentName(str, str2);\n CallAppAbilityInfo callAppAbilityInfo = this.mInfo;\n if (callAppAbilityInfo == null || !componentName.equals(callAppAbilityInfo.getComponentName())) {\n HiLog.error(LOG_LABEL, \"preDisconnectCallAppAbility, call component name is different.\", new Object[0]);\n return false;\n }\n this.mIsPreConnected = false;\n if (this.mPreAddedCall == null && this.mPendingDisconnectPreAddedCall == null && this.mCallMapById.isEmpty()) {\n disconnect();\n releaseResource();\n return true;\n }\n HiLog.info(LOG_LABEL, \"preDisconnectCallAppAbility, still has call.\", new Object[0]);\n return false;\n }\n }",
"public abstract void onEnable();",
"boolean hasAccount();",
"boolean hasAccount();",
"boolean hasAccount();",
"public void changeStatus()\n {\n if(this.isActivate == false)\n {\n this.isActivate = true;\n switchSound.play();\n //this.dungeon.updateSwitches(true); \n }\n else{\n this.isActivate = false;\n switchSound.play(1.75, 0, 1.5, 0, 1);\n //this.dungeon.updateSwitches(false); \n }\n notifyObservers();\n\n }",
"private void updateUserStatus(boolean online)\n {\n }",
"@Override\r\n\tprotected void onResume() {\r\n\t\tsuper.onResume();\r\n\t\tif (hasBeenSecurity) {\r\n\t\t\tif (KeyguardSetting.isAccessibilityEnable(this)) {\r\n\t\t\t\tUtil.putPreferenceBoolean(mContext, NOTIFICATION_CHECK, true);\r\n\t\t\t\tmCheckBoxToggle.setChecked(true);\r\n\t\t\t} else {\r\n\t\t\t\tmCheckBoxToggle.setChecked(false);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (KeyguardSetting.isAccessibilityEnable(this)\r\n\t\t\t\t\t&& Util.getPreferenceBoolean(mContext, NOTIFICATION_CHECK,\r\n\t\t\t\t\t\t\tfalse)) {\r\n\t\t\t\t// TODO 修改逻辑\r\n\t\t\t\tmCheckBoxToggle.setChecked(true);\r\n\t\t\t} else {\r\n\t\t\t\tmCheckBoxToggle.setChecked(false);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"Account apply();",
"private void hitApiForActivateDeal() {\n appUtils.showProgressDialog(mActivity, false);\n HashMap<String, String> params = new HashMap<>();\n params.put(ApiKeys.DEAL_ID, dealData.getDealId());\n params.put(ApiKeys.DEAL_STATUS, \"1\");\n\n params.put(ApiKeys.DEAL_TITLE, etTitle.getText().toString().trim());\n params.put(ApiKeys.DEAL_DESCRIPTION, etDescription.getText().toString().trim());\n params.put(ApiKeys.TOTAL_ITEMS, etTotalItems.getText().toString().trim());\n params.put(ApiKeys.ORIGINAL_PRICE, etOriginalPrice.getText().toString().trim());\n params.put(ApiKeys.NEW_PRICE, tvNewPrice.getText().toString());\n params.put(ApiKeys.START_DATE_TIME, parseTime(etBeginTime.getText().toString().trim()));\n params.put(ApiKeys.END_DATE_TIME, parseTime(etEndTime.getText().toString().trim()));\n\n ApiInterface service = RestApi.createService(ApiInterface.class);\n Call<ResponseBody> call = service.deactivateDeal(AppSharedPrefs.getInstance(mActivity).\n getString(AppSharedPrefs.PREF_KEY.ACCESS_TOKEN, \"\"), appUtils.encryptData(params));\n ApiCall.getInstance().hitService(mActivity, call, new NetworkListener() {\n @Override\n public void onSuccess(int responseCode, String response) {\n try {\n JSONObject mainObject = new JSONObject(response);\n if (mainObject.getInt(\"CODE\") == 200) {\n appUtils.showToast(mActivity, getString(R.string.deal_activated));\n Intent intent = new Intent();\n intent.putExtra(Constants.DEAL_POSITION_KEY, position);\n intent.putExtra(Constants.DEAL_STATUS_KEY, \"1\");\n setResult(Constants.DEAL_ACTIVIATE_RESULT_CODE, intent);\n Intent intent1 = new Intent(Constants.REFRESH_RECCEIVER_KEY);\n // You can also include some extra data.\n intent1.putExtra(\"refresh\", true);\n LocalBroadcastManager.getInstance(mActivity).sendBroadcast(intent1);\n finish();\n } else if (mainObject.getInt(\"CODE\") == ApiKeys.UNAUTHORISED_CODE) {\n appUtils.logoutFromApp(mActivity, mainObject.optString(\"MESSAGE\"));\n } else {\n appUtils.showSnackBar(activityCreateDeal, mainObject.optString(\"MESSAGE\"));\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n\n @Override\n public void onSuccessErrorBody(String response) {\n\n }\n\n @Override\n public void onFailure() {\n appUtils.showSnackBar(activityCreateDeal, getString(R.string.txt_something_went_wrong));\n }\n });\n\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n mCheckBt = false;\n if (requestCode == REQUEST_ENABLE_BT && resultCode != RESULT_OK) {\n// mScanButton.setEnabled(false);\n Toast.makeText(this, getString(R.string.bluetooth_not_enabled), Toast.LENGTH_LONG).show();\n }\n }",
"boolean transactTo_setPolicy(int code, String policyName, String transactName, ComponentName who, int userId, Bundle policyData, int customType) {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n boolean bDisabled = false;\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \" to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n _data.writeInt(userId);\n _data.writeString(policyName);\n _data.writeBundle(policyData);\n _data.writeInt(customType);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n bDisabled = _reply.readInt() == 1;\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n return bDisabled;\n }",
"@Override\n\tpublic String updateUsecaseState(JsonObject usecaseJson) throws InsightsCustomException {\n\t\tString message = \"\";\n\t\ttry {\n\t\t\tString usecase = usecaseJson.get(USECASE_NAME).getAsString();\n\t\t\tBoolean state = usecaseJson.get(\"isActive\").getAsBoolean();\n\t\t\tAutoMLConfig mlConfig = autoMLConfigDAL.getMLConfigByUsecase(usecase);\n\t\t\tif (mlConfig == null) {\n\t\t\t\tthrow new InsightsCustomException(\"Usecase not found.\" + usecase);\n\t\t\t} else {\n\t\t\t\tif(reportConfigDAL.getKpiConfigByUsecase(usecase).isEmpty()) {\n\t\t\t\t\tmlConfig.setIsActive(state);\n\t\t\t\t\tautoMLConfigDAL.updateMLConfig(mlConfig);\n\t\t\t\t\tmessage = usecase + \" state updated successfully.\"; \n\t\t\t\t} else {\n\t\t\t\t\tif(Boolean.TRUE.equals(state)) {\n\t\t\t\t\t\tmlConfig.setIsActive(state);\n\t\t\t\t\t\tautoMLConfigDAL.updateMLConfig(mlConfig);\n\t\t\t\t\t\tmessage = usecase + \" state updated successfully.\"; \n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new InsightsCustomException(\"Usecase cannot be deactivated as it is attached to kpi.\");\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t} catch (NoResultException e) {\n\t\t\tlog.error(e);\n\t\t\tthrow new InsightsCustomException(\"Usecase does not exists in database.\");\n\t\t} catch (Exception e) {\n\t\t\tlog.error(e);\n\t\t\tthrow new InsightsCustomException(e.getMessage());\n\t\t}\n\t\treturn message;\n\t}",
"public CampaignEditPage isActive(boolean answer)\r\n\t{ \r\n\t\treadconfig();\r\n\t\t//no\r\n\t\tif(answer==false)\r\n\t\t{\r\n\t\t\tdriver.findElement(By.xpath(library.getProperty(\"camp_status_inactive\"))).click();\r\n\t\t}\t\r\n\t\t//yes\r\n\t\telse if(answer==true)\r\n\t\t{\r\n\t\t\tdriver.findElement(By.xpath(library.getProperty(\"camp_status_active\"))).click();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new InvalidParameterException\r\n\t\t\t(\"answer \"+answer +\" is not supported, ref automation doc workflow page.\");\r\n\t\t}\r\n\t\tAssert.assertEquals(driver.getTitle(),library.getProperty(\"camp_edit_page_title\"));\r\n\t\treturn new CampaignEditPage(driver);\r\n\t}",
"public boolean enableService() {\n \tlog_d( \"enabledService()\" );\n \tshowTitleNotConnected();\n\t\t// no action if debug\n if ( BT_DEBUG_SERVICE ) return false;\n // If BT is not on, request that it be enabled.\n // setupChat() will then be called during onActivityResult\n if ( !mBluetoothAdapter.isEnabled() ) {\n\t\t\t// startActivity Adapter Enable\n\t\t\treturn true;\n // Otherwise, setup the chat session\n } else {\n initService();\n }\n return false;\n }",
"boolean getHasAccount();",
"public static boolean configApState(Context context) {\n WifiManager wifimanager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\n WifiConfiguration wificonfiguration = new WifiConfiguration();\n try {\n\n if(isApEnabled(context)) {\n wifimanager.setWifiEnabled(false);\n disableAp(context);\n }\n Method method = wifimanager.getClass().getMethod(\"setWifiApEnabled\", WifiConfiguration.class, boolean.class);\n method.invoke(wifimanager, wificonfiguration, !isApEnabled(context));\n return true;\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n }",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasHasAccount();",
"public static void ToggleEnabled()\n {\n \t\tEnabled = !Enabled;\n \t\tConfigHandler.configFile.save();\n \t \t\n }",
"private void triggerPolicyComplianceCheckIfNeeded(int profileUserId, boolean suspended) {\n synchronized (getLockObject()) {\n final ActiveAdmin profileOwner = getProfileOwnerAdminLocked(profileUserId);\n if (profileOwner == null) {\n Slogf.wtf(LOG_TAG, \"Profile owner not found for compliance check\");\n return;\n }\n if (suspended) {\n // If suspended, DPC will need to show an activity.\n final Intent intent = new Intent(ACTION_CHECK_POLICY_COMPLIANCE);\n intent.setPackage(profileOwner.info.getPackageName());\n mContext.startActivityAsUser(intent, UserHandle.of(profileUserId));\n } else if (profileOwner.mProfileOffDeadline > 0) {\n // If not suspended, but deadline set, DPC needs to acknowledge compliance so that\n // the deadline can be reset.\n sendAdminCommandLocked(profileOwner, ACTION_COMPLIANCE_ACKNOWLEDGEMENT_REQUIRED,\n /* adminExtras= */ null, /* receiver= */ null, /* inForeground = */ true);\n }\n }\n }",
"@Override\n public void onAdAvailable(Intent intent) {\n offerwallIntent = intent;\n Log.d(TAG, \"OW: Offers are available\");\n Toast.makeText(MainActivity.this, \"OW: Offers are available\", Toast.LENGTH_SHORT).show();\n showOW.setEnabled(true);\n }",
"@Override\r\n public void turnOn(){\r\n isOn = true;\r\n Reporter.report(this, Reporter.Msg.SWITCHING_ON);\r\n if (isOn){\r\n engageLoads();\r\n }\r\n }",
"@Override\n public void onCheckedChanged(CompoundButton compoundButton, boolean b) {\n if (b) {\n // Toast.makeText(getContext(), \"on\", Toast.LENGTH_LONG).show();\n\n context.startService(in);\n\n } else {\n //Toast.makeText(getContext(), \"of\", Toast.LENGTH_LONG).show();\n //in = new Intent(getContext(), HorizantelShake.class);\n context.stopService(in);\n }\n prefs = PreferenceManager.getDefaultSharedPreferences(getContext());\n SharedPreferences.Editor prefEditor = prefs.edit();\n prefEditor.putBoolean(\"service_status\", b);\n prefEditor.commit();\n }",
"public abstract void wgb_onEnable();",
"private void turnOnBT() {\n\t\tIntent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n\t\tstartActivityForResult(intent, 1);\n\t}",
"public void setActive(java.lang.String r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.telecom.ConnectionServiceAdapterServant.2.setActive(java.lang.String):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telecom.ConnectionServiceAdapterServant.2.setActive(java.lang.String):void\");\n }",
"void setHasAuditingCompany(ch.crif_online.www.webservices.crifsoapservice.v1_00.AuditingCompanyStatus.Enum hasAuditingCompany);",
"private void checkIfMyTurn(boolean currPlayer) {\n gameService.setMyTurn(currPlayer);\n System.out.println();\n System.out.println(\"My turn now: \" + gameService.isMyTurn());\n\n if (! currPlayer) {\n gameService.setLabelTurnText(\"Wait for your turn.\");\n updateFields(gameService.receiveUpdates());\n } else {\n gameService.setLabelTurnText(\"Your turn!\");\n }\n }",
"public void sendResponse(Activity activity, boolean status, int calledFrom) {\n if (calledFrom == 1) {\n if (((OtpVerificationActivity) activity) != null) {\n ((OtpVerificationActivity) activity).setServerResponseForSettingsCall(status);\n }\n } else if (calledFrom == 2) {\n if (((SplashActivity) activity) != null) {\n ((SplashActivity) activity).setServerResponseForSettingsCall(status);\n }\n\n }\n }",
"private void checkAccountLoggedIn()\r\n\t{\n\t\tSharedPreferences pref = this.getSharedPreferences(\"accountdata\", 0);\r\n\t\tSystem.out.println(\"Checking if an account is logged in\");\r\n\t\tif (pref.getBoolean(\"accountLoggedIn\", false))\r\n\t\t{\r\n\t\t\tloginButton.setEnabled(false);\r\n\t\t\tregisterButton.setEnabled(false);\r\n\r\n\t\t\t// Make a crouton notifying the user\r\n\t\t\tCrouton crouton = Crouton.makeText(this, this.getResources()\r\n\t\t\t\t\t.getString(R.string.activity_login_account_loggedin),\r\n\t\t\t\t\tStyle.INFO);\r\n\t\t\tConfiguration.Builder configBuild = new Configuration.Builder();\r\n\t\t\tconfigBuild.setDuration(Configuration.DURATION_INFINITE);\r\n\t\t\tcrouton.setConfiguration(configBuild.build());\r\n\t\t\tcrouton.setOnClickListener(new OnClickListener()\r\n\t\t\t{\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(View v)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Crouton clicked\");\r\n\t\t\t\t\t((LoginActivity) v.getContext()).onBackPressed();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tcrouton.show();\r\n\t\t}\r\n\t}"
] | [
"0.67398274",
"0.64435446",
"0.6172846",
"0.61682206",
"0.61395234",
"0.60906637",
"0.60534984",
"0.5564542",
"0.55485797",
"0.55299675",
"0.5513603",
"0.54180217",
"0.5369923",
"0.53230363",
"0.5299786",
"0.52918875",
"0.5276039",
"0.5246178",
"0.5193268",
"0.518897",
"0.5165894",
"0.5078929",
"0.5063779",
"0.5033326",
"0.5012371",
"0.49966502",
"0.4976323",
"0.4959951",
"0.4955981",
"0.49333948",
"0.4917517",
"0.49174657",
"0.49174657",
"0.49005553",
"0.4890891",
"0.48892683",
"0.48863629",
"0.4819343",
"0.4811005",
"0.48108467",
"0.48065546",
"0.4792189",
"0.4791202",
"0.47860286",
"0.4784006",
"0.47774124",
"0.47769183",
"0.47662085",
"0.47647667",
"0.4762438",
"0.47609514",
"0.4742787",
"0.47393563",
"0.4737799",
"0.47372422",
"0.47349688",
"0.47307056",
"0.4727305",
"0.472175",
"0.4718255",
"0.47146258",
"0.471349",
"0.47085288",
"0.47070047",
"0.46896195",
"0.46841884",
"0.46841884",
"0.46841884",
"0.46790382",
"0.46747434",
"0.46741563",
"0.46556437",
"0.46477854",
"0.46452475",
"0.4644217",
"0.4634158",
"0.46318495",
"0.4631308",
"0.46196648",
"0.46150097",
"0.46132603",
"0.46132603",
"0.46132603",
"0.46132603",
"0.46132603",
"0.46132603",
"0.46132603",
"0.4601611",
"0.4592267",
"0.45913032",
"0.4588362",
"0.4588129",
"0.45843178",
"0.458009",
"0.4575761",
"0.45727098",
"0.45711592",
"0.45684898",
"0.4563913",
"0.45608333"
] | 0.68119454 | 0 |
/ INFO: This method will return current Account status ( Active/Deactive ) for given app INPUT: myAppName => String RETURN: boolean, true => 'enable', false => 'disable' | public boolean checkAccountAction(String myAppName) {
Log.info("Checking current account status for app" + myAppName);
boolean currentValue = false;
WebElement myAccount = getAccontDetails(myAppName);
WebElement Tab = myAccount.findElement(By.className("adminTable5"));
String elementPageSource = Tab.getAttribute("outerHTML");
if (elementPageSource.contains("deactivate.png")) {
Log.info(myAppName + " account is activated");
currentValue = true;
} else {
Log.info(myAppName + " account is deactivated");
currentValue = false;
}
return currentValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean checkAccountStatus(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='adminTable2 ']\"));\n\t\tLog.info(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Inactive\") && myAccountField.getText().contains(strDate)) {\n\t\t\tLog.info(\"current account status for app\" + myAppName + \"is inactive\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(\"current account status for app\" + myAppName + \"is active\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public boolean checkCurrentOfferStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountOfferStatus = myAccount.findElement(By.className(\"adminTable4 \"));\n\t\tString elementPageSource = myAccountOfferStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" offer is enabled Which is a deactivated app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"public boolean checkCurrentCampaianStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountCampaianStatus = myAccount.findElement(By.className(\"adminTable3\"));\n\t\tString elementPageSource = myAccountCampaianStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" compaign is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" compaign is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" compaign is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" compaign is enabled Which is a deactivatd app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"public boolean checkAppApproveStatus(String myAppName) {\n\t\tSystem.out.println(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='approve_notify']//span]\"));\n\t\tSystem.out.println(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Approve\") && myAccountField.getText().contains(strDate)) {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is approved\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is pending\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public String AccountStatus() {\n\t\tString Online = \"//android.widget.TextView[@text='ONLINE']\";\n\t\tString ProfileStatus;\n\t\tboolean ObjectStatus = ObjectFoundorNot(Online);\n\t\tif(ObjectStatus == true) {\n\t\t\tProfileStatus = keypad.SelectAccountStatusOnline.getText();\n\t\t}\n\t\telse {\n\t\t\tProfileStatus = keypad.SelectAccountStatusOffline.getText();\n\t\t}\n\t\treturn ProfileStatus;\n\t}",
"public Integer getAccountStatus() {\n return accountStatus;\n }",
"public Account status() {\n RestRequest request = new RestRequest();\n request.setResource(\"account/status\");\n\n return client.get(request, Account.class);\n }",
"public void switchAccountStatus(boolean userValue, String myAppName) {\n\t\tLog.info(\"Searching for current account status for app\" + myAppName);\n\t\tboolean currentValue = checkAccountAction(myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tif (userValue != currentValue) {\n\t\t\tLog.info(\"Chaging the current account status for app\" + myAppName);\n\t\t\tWebElement tab = myAccount.findElement(By.className(\"adminTable5\"));\n\t\t\tWebElement slider = tab.findElement(By.id(\"navButton\"));\n\t\t\tslider.click();\n\t\t\ttry {\n\t\t\t\tThread.sleep(10000);\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\tapp_confrim.click();\n\t\t} else {\n\t\t\tLog.info(myAppName + \"is already in desired state. No Action needed\");\n\t\t}\n\t}",
"public String getCurrentUserAccount();",
"protected boolean isActive(String appName) {\n return appFile(appName, \"active\").exists();\n }",
"public String AccountStatusNave() {\n\t\tString statusNav = keypad.SelectAccountStatus.getText();\n\t\t//keypad.UserProfiles.click();\n\t\tSystem.out.println(statusNav);\n\t\treturn statusNav;\n\t}",
"public static String getAccountStatusPage ()\n {\n return BASE + \"status.wm?initUsername=\" + URL.encodeComponent(CShell.creds.accountName);\n }",
"UserStatus getStatus();",
"boolean getHasAccount();",
"public String getStatus()\r\n {\n return (\"1\".equals(getField(\"ApprovalStatus\")) && \"100\".equals(getField(\"HostRespCode\")) ? \"Approved\" : \"Declined\");\r\n }",
"public static boolean isAccountActive(String email){\n Connection connect = null;\n ResultSet set = null;\n String isAccountActiveSQL = \"SELECT active FROM users WHERE email = ?\";\n\n // Check If Account is Active Try Block:\n try {\n // Set Connection:\n connect = DBConfig.getConnection();\n // Prepare Statement:\n PreparedStatement statement = connect.prepareStatement(isAccountActiveSQL);\n // Set Parameters:\n statement.setString(1, email);\n // Execute Statement:\n set = statement.executeQuery();\n // Check For Result Set:\n while (set.next()){\n // Check Value:\n if(set.getInt(\"active\") == 1) {\n return true;\n }\n // End Of Check Value.\n }\n // End Of Check For Result Set.\n\n }catch(SQLException e){\n e.printStackTrace();\n }\n // End Of Check If Account is Active Try Block:\n\n return false;\n }",
"boolean hasAccount();",
"boolean hasAccount();",
"boolean hasAccount();",
"Boolean accountIsActivated(Integer userId);",
"public boolean getAtmStatus();",
"public boolean getStatus(){\n return activestatus;\n }",
"public boolean isActive() {\n\t\treturn (active_status);\n\t}",
"public boolean isCurrentUserCanChangeAccountStatus() {\r\n return currentUserCanChangeAccountStatus;\r\n }",
"int isActive();",
"public boolean getActive();",
"public boolean getActive();",
"public String getUserStatus() {\n return userStatus;\n }",
"public java.lang.String getUserAvaibility(int status) throws android.os.RemoteException;",
"boolean hasHasAccount();",
"public static profile getActive(){\n return active;\n }",
"public java.lang.String getUserStatus() {\n return userStatus;\n }",
"public int aclActiveStatusEnum() {\n return aclActiveStatusEnum;\n }",
"public java.lang.String getUserStatus() {\r\n return userStatus;\r\n }",
"public Boolean isActive();",
"boolean isInactive() {\n String value = configData.get(IS_ACTIVE_KEY, \"true\");\n return !Boolean.parseBoolean(value);\n }",
"public Boolean isActive(){return status;}",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.AuditingCompanyStatus.Enum getHasAuditingCompany();",
"public Boolean getActive()\r\n/* */ {\r\n/* 200 */ return this.active;\r\n/* */ }",
"@Action(value = \"user_active\", results = {@Result(name = \"active\", location = \"/WEB-INF/jsp/msg.jsp\")})\n public String active() {\n\n User exsitUser = userService.active(user.getCode());\n\n if (exsitUser == null) {\n\n this.addActionMessage(\"激活失败,验证码无效!\");\n\n } else {\n\n exsitUser.setState(1);\n exsitUser.setCode(null);\n userService.updateState(exsitUser);\n this.addActionMessage(\"激活成功,请登录!\");\n }\n\n return \"active\";\n }",
"public Boolean getActive() {\n\t\treturn this.Active;\n\t}",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"boolean hasUserAppId();",
"boolean hasUserAppId();",
"public abstract String currentStatus();",
"public boolean getHasAccount() {\n return hasAccount_;\n }",
"int getAuthAccountFlags();",
"java.lang.String getAccount();",
"public static Enumeration getActiveAccountNames() {\r\n return (accounts.keys());\r\n }",
"public int getCBRStatus();",
"public boolean favouriteCurrentAccount()\n {\n if(accountInfo == null)\n {\n System.out.println(\"You need to generate an account before getting the details.\");\n return false;\n }\n return accountInfo.favouriteAccount();\n }",
"public boolean approveApp(String myAppName) {\n\t\tLog.info(\"Checking if App:\" + myAppName + \"came for approval\");\n\t\tWebElement myElement = getAppFromList(myAppName);\n\t\tif (myElement != null) {\n\t\t\tLog.info(myAppName + \"came for approval. Approving it now..\");\n\t\t\tWebElement approveButton = myElement.findElement(By.id(\"appsEditApprove\"));\n\t\t\tapproveButton.click();\n\t\t\tapp_confrim.click();\n\t\t\tif (getAccontDetails(myAppName) != null) {\n\t\t\t\tLog.info(myAppName + \"is approved now\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tLog.info(\"failed to approve\" + myAppName);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tLog.info(myAppName + \"did not showed up in approval list\");\n\t\t\treturn false;\n\t\t}\n\n\t}",
"public boolean getHasAccount() {\n return hasAccount_;\n }",
"private String getActiveProfile() {\r\n String[] profiles = env.getActiveProfiles();\r\n String activeProfile = \"add\";\r\n if (profiles != null && profiles.length > 0) {\r\n activeProfile = profiles[0];\r\n }\r\n System.out.println(\"===== The active profile is \" + activeProfile + \" =====\");\r\n return(activeProfile);\r\n }",
"public java.lang.Boolean getActive() {\n return active;\n }",
"@Override\n public int getStorageEncryptionStatus(@Nullable String callerPackage, int userHandle) {\n if (!mHasFeature) {\n // Ok to return current status.\n }\n Preconditions.checkArgumentNonnegative(userHandle, \"Invalid userId\");\n\n final CallerIdentity caller = getCallerIdentity(callerPackage);\n Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle));\n\n\n final ApplicationInfo ai;\n try {\n ai = mIPackageManager.getApplicationInfo(callerPackage, 0, userHandle);\n } catch (RemoteException e) {\n throw new SecurityException(e);\n }\n\n boolean legacyApp = false;\n if (ai.targetSdkVersion <= Build.VERSION_CODES.M) {\n legacyApp = true;\n }\n\n final int rawStatus = getEncryptionStatus();\n if ((rawStatus == DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE_PER_USER) && legacyApp) {\n return DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE;\n }\n return rawStatus;\n }",
"boolean isActive();",
"boolean isActive();",
"boolean isActive();",
"@GetMapping(value = { \"/accounts/{accountId}\" })\n\tpublic void getAccountActiveState(ModelMap model, @PathVariable(\"accountId\") String accountId) {\n\t\tgetAccountState(accountId);\n\n\t}",
"public Boolean getActive() {\n return this.active;\n }",
"public Boolean getActive() {\n return this.active;\n }",
"public static Account getCurrentAccount() {\r\n\t\treturn currentAccount;\r\n\t}",
"public boolean getOnlineStatus(int status) throws android.os.RemoteException;",
"public String getActiveflag() {\n return (String)getAttributeInternal(ACTIVEFLAG);\n }",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"io.opencannabis.schema.commerce.Payments.PaymentStatus getStatus();",
"public static boolean isActive(){\n return active;\n }",
"@Override\n public List<User> getAccountStatusList(){\n List<User> userList = null;\n userList = adminMapper.getAccountStatusList();\n return userList;\n }",
"public boolean isInactive();",
"public int getAccountType() {\r\n return accountType;\r\n }",
"@Override\r\n\tpublic boolean open() {\n\t\taccountStatus = AccountStatus.ACTIVE;\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic String getStatusByUserName() {\n\t\treturn model.getStatusByUserName();\n\t}",
"org.hl7.fhir.Boolean getInactive();",
"private void updateAccountStatus() {\n\r\n }",
"public Boolean getIsActiveAsBoolean() {\n if (this.isActive == null) {\n return null;\n } else if (this.isActive.toLowerCase().equals(\"true\")) {\n return true;\n } else {\n return false;\n }\n }",
"@Accessor(qualifier = \"active\", type = Accessor.Type.GETTER)\n\tpublic Boolean getActive()\n\t{\n\t\treturn getPersistenceContext().getPropertyValue(ACTIVE);\n\t}",
"public static boolean hasActiveUserId(Context context) {\r\n\t\tboolean result = false;\r\n\t\tSharedPreferences prefs = PreferenceManager\r\n\t\t\t\t.getDefaultSharedPreferences(context);\r\n\t\tif (prefs != null) {\r\n\t\t\tString activeUserId = prefs.getString(PreferenceKeys.ActiveUserId,\r\n\t\t\t\t\t\"\");\r\n\t\t\treturn !TextUtils.isEmpty(activeUserId);\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}",
"public int isActive() {\n return isActive;\n }",
"public boolean isActive() {\n return (this == RecordStatusEnum.ACTIVE);\n }"
] | [
"0.8110439",
"0.75582117",
"0.7353964",
"0.7243918",
"0.7108234",
"0.6686638",
"0.653831",
"0.63651735",
"0.6203867",
"0.6175835",
"0.6029315",
"0.59242445",
"0.5920932",
"0.59095967",
"0.58594495",
"0.5824535",
"0.58173394",
"0.58173394",
"0.58173394",
"0.5766572",
"0.5766526",
"0.57653",
"0.576486",
"0.5737644",
"0.5724083",
"0.5695202",
"0.5695202",
"0.56786203",
"0.5654425",
"0.5626675",
"0.5591381",
"0.55837303",
"0.5578905",
"0.5573166",
"0.5558752",
"0.5546588",
"0.5540928",
"0.55337965",
"0.552855",
"0.5482342",
"0.5481107",
"0.547231",
"0.547231",
"0.547231",
"0.547231",
"0.547231",
"0.547231",
"0.547231",
"0.547231",
"0.547231",
"0.547231",
"0.547231",
"0.547231",
"0.547231",
"0.547231",
"0.547231",
"0.546084",
"0.546084",
"0.54583186",
"0.5454788",
"0.54509294",
"0.54485685",
"0.54477715",
"0.54463553",
"0.54329157",
"0.5431159",
"0.5427886",
"0.542627",
"0.5420457",
"0.5418694",
"0.54144204",
"0.54144204",
"0.54144204",
"0.54102325",
"0.5409072",
"0.5409072",
"0.54072416",
"0.53701884",
"0.5369988",
"0.5368625",
"0.5368625",
"0.5368625",
"0.5368625",
"0.5368625",
"0.5368625",
"0.5368625",
"0.5362336",
"0.5345767",
"0.5344262",
"0.53348494",
"0.53327805",
"0.5328858",
"0.53230083",
"0.53188705",
"0.5309929",
"0.53098404",
"0.5307135",
"0.5296182",
"0.5287205",
"0.5278134"
] | 0.76435345 | 1 |
/ INFO: This method will return current Account status active/inactive for given app INPUT: myAppName => String RETURN: boolean, true => 'enable', false => 'disable' | public boolean checkAccountStatus(String myAppName) {
Log.info("Checking current account status for app" + myAppName);
boolean currentValue;
SimpleDateFormat sdfDate = new SimpleDateFormat("dd MMM yyyy");
Date now = new Date();
String strDate = sdfDate.format(now);
WebElement myAccount = getAccontDetails(myAppName);
WebElement myAccountField = myAccount.findElement(By.xpath("//*[@class='adminTable2 ']"));
Log.info(myAccountField.getText());
if (myAccountField.getText().contains("Inactive") && myAccountField.getText().contains(strDate)) {
Log.info("current account status for app" + myAppName + "is inactive");
currentValue = true;
} else {
Log.info("current account status for app" + myAppName + "is active");
currentValue = false;
}
return currentValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean checkAccountAction(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue = false;\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement Tab = myAccount.findElement(By.className(\"adminTable5\"));\n\t\tString elementPageSource = Tab.getAttribute(\"outerHTML\");\n\t\tif (elementPageSource.contains(\"deactivate.png\")) {\n\t\t\tLog.info(myAppName + \" account is activated\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(myAppName + \" account is deactivated\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public boolean checkCurrentOfferStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountOfferStatus = myAccount.findElement(By.className(\"adminTable4 \"));\n\t\tString elementPageSource = myAccountOfferStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" offer is enabled Which is a deactivated app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"public boolean checkCurrentCampaianStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountCampaianStatus = myAccount.findElement(By.className(\"adminTable3\"));\n\t\tString elementPageSource = myAccountCampaianStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" compaign is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" compaign is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" compaign is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" compaign is enabled Which is a deactivatd app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"public boolean checkAppApproveStatus(String myAppName) {\n\t\tSystem.out.println(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='approve_notify']//span]\"));\n\t\tSystem.out.println(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Approve\") && myAccountField.getText().contains(strDate)) {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is approved\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is pending\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public String AccountStatus() {\n\t\tString Online = \"//android.widget.TextView[@text='ONLINE']\";\n\t\tString ProfileStatus;\n\t\tboolean ObjectStatus = ObjectFoundorNot(Online);\n\t\tif(ObjectStatus == true) {\n\t\t\tProfileStatus = keypad.SelectAccountStatusOnline.getText();\n\t\t}\n\t\telse {\n\t\t\tProfileStatus = keypad.SelectAccountStatusOffline.getText();\n\t\t}\n\t\treturn ProfileStatus;\n\t}",
"public Integer getAccountStatus() {\n return accountStatus;\n }",
"public Account status() {\n RestRequest request = new RestRequest();\n request.setResource(\"account/status\");\n\n return client.get(request, Account.class);\n }",
"public void switchAccountStatus(boolean userValue, String myAppName) {\n\t\tLog.info(\"Searching for current account status for app\" + myAppName);\n\t\tboolean currentValue = checkAccountAction(myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tif (userValue != currentValue) {\n\t\t\tLog.info(\"Chaging the current account status for app\" + myAppName);\n\t\t\tWebElement tab = myAccount.findElement(By.className(\"adminTable5\"));\n\t\t\tWebElement slider = tab.findElement(By.id(\"navButton\"));\n\t\t\tslider.click();\n\t\t\ttry {\n\t\t\t\tThread.sleep(10000);\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\tapp_confrim.click();\n\t\t} else {\n\t\t\tLog.info(myAppName + \"is already in desired state. No Action needed\");\n\t\t}\n\t}",
"protected boolean isActive(String appName) {\n return appFile(appName, \"active\").exists();\n }",
"public String getCurrentUserAccount();",
"UserStatus getStatus();",
"public static boolean isAccountActive(String email){\n Connection connect = null;\n ResultSet set = null;\n String isAccountActiveSQL = \"SELECT active FROM users WHERE email = ?\";\n\n // Check If Account is Active Try Block:\n try {\n // Set Connection:\n connect = DBConfig.getConnection();\n // Prepare Statement:\n PreparedStatement statement = connect.prepareStatement(isAccountActiveSQL);\n // Set Parameters:\n statement.setString(1, email);\n // Execute Statement:\n set = statement.executeQuery();\n // Check For Result Set:\n while (set.next()){\n // Check Value:\n if(set.getInt(\"active\") == 1) {\n return true;\n }\n // End Of Check Value.\n }\n // End Of Check For Result Set.\n\n }catch(SQLException e){\n e.printStackTrace();\n }\n // End Of Check If Account is Active Try Block:\n\n return false;\n }",
"public String getStatus()\r\n {\n return (\"1\".equals(getField(\"ApprovalStatus\")) && \"100\".equals(getField(\"HostRespCode\")) ? \"Approved\" : \"Declined\");\r\n }",
"public String AccountStatusNave() {\n\t\tString statusNav = keypad.SelectAccountStatus.getText();\n\t\t//keypad.UserProfiles.click();\n\t\tSystem.out.println(statusNav);\n\t\treturn statusNav;\n\t}",
"int isActive();",
"public boolean isActive() {\n\t\treturn (active_status);\n\t}",
"public boolean getStatus(){\n return activestatus;\n }",
"public boolean getActive();",
"public boolean getActive();",
"boolean isInactive() {\n String value = configData.get(IS_ACTIVE_KEY, \"true\");\n return !Boolean.parseBoolean(value);\n }",
"boolean getHasAccount();",
"Boolean accountIsActivated(Integer userId);",
"public static String getAccountStatusPage ()\n {\n return BASE + \"status.wm?initUsername=\" + URL.encodeComponent(CShell.creds.accountName);\n }",
"public boolean getAtmStatus();",
"public static profile getActive(){\n return active;\n }",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.AuditingCompanyStatus.Enum getHasAuditingCompany();",
"public Boolean isActive();",
"public Boolean getActive()\r\n/* */ {\r\n/* 200 */ return this.active;\r\n/* */ }",
"public int aclActiveStatusEnum() {\n return aclActiveStatusEnum;\n }",
"boolean hasAccount();",
"boolean hasAccount();",
"boolean hasAccount();",
"public Boolean isActive(){return status;}",
"@GetMapping(value = { \"/accounts/{accountId}\" })\n\tpublic void getAccountActiveState(ModelMap model, @PathVariable(\"accountId\") String accountId) {\n\t\tgetAccountState(accountId);\n\n\t}",
"org.hl7.fhir.Boolean getInactive();",
"@Action(value = \"user_active\", results = {@Result(name = \"active\", location = \"/WEB-INF/jsp/msg.jsp\")})\n public String active() {\n\n User exsitUser = userService.active(user.getCode());\n\n if (exsitUser == null) {\n\n this.addActionMessage(\"激活失败,验证码无效!\");\n\n } else {\n\n exsitUser.setState(1);\n exsitUser.setCode(null);\n userService.updateState(exsitUser);\n this.addActionMessage(\"激活成功,请登录!\");\n }\n\n return \"active\";\n }",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public boolean isActive();",
"public Boolean getActive() {\n\t\treturn this.Active;\n\t}",
"public boolean isCurrentUserCanChangeAccountStatus() {\r\n return currentUserCanChangeAccountStatus;\r\n }",
"public java.lang.String getUserAvaibility(int status) throws android.os.RemoteException;",
"public String getActiveflag() {\n return (String)getAttributeInternal(ACTIVEFLAG);\n }",
"public String getUserStatus() {\n return userStatus;\n }",
"public Boolean getIsActiveAsBoolean() {\n if (this.isActive == null) {\n return null;\n } else if (this.isActive.toLowerCase().equals(\"true\")) {\n return true;\n } else {\n return false;\n }\n }",
"public Boolean getActive() {\n return this.active;\n }",
"public Boolean getActive() {\n return this.active;\n }",
"boolean isActive();",
"boolean isActive();",
"boolean isActive();",
"public java.lang.Boolean getActive() {\n return active;\n }",
"@Accessor(qualifier = \"active\", type = Accessor.Type.GETTER)\n\tpublic Boolean getActive()\n\t{\n\t\treturn getPersistenceContext().getPropertyValue(ACTIVE);\n\t}",
"public boolean isInactive();",
"boolean hasHasAccount();",
"boolean hasUserAppId();",
"boolean hasUserAppId();",
"public int getCBRStatus();",
"public java.lang.String getUserStatus() {\n return userStatus;\n }",
"io.opencannabis.schema.commerce.Payments.PaymentStatus getStatus();",
"public java.lang.String getUserStatus() {\r\n return userStatus;\r\n }",
"private String getActiveProfile() {\r\n String[] profiles = env.getActiveProfiles();\r\n String activeProfile = \"add\";\r\n if (profiles != null && profiles.length > 0) {\r\n activeProfile = profiles[0];\r\n }\r\n System.out.println(\"===== The active profile is \" + activeProfile + \" =====\");\r\n return(activeProfile);\r\n }",
"public static boolean isActive(){\n return active;\n }",
"public abstract String currentStatus();",
"int getAuthAccountFlags();",
"public int isActive() {\n return isActive;\n }",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.AuditingCompanyStatus xgetHasAuditingCompany();",
"public Map<String, String> getActiveAccountsForDropDown(String companyId, boolean getAdvertiser, boolean getAgencies) throws Exception;",
"public String getActiveFlag() {\n return (String) getAttributeInternal(ACTIVEFLAG);\n }",
"public Boolean getActiveflag() {\n return activeflag;\n }",
"io.opencannabis.schema.commerce.CommercialOrder.OrderStatus getStatus();",
"io.opencannabis.schema.commerce.CommercialOrder.OrderStatus getStatus();",
"public boolean isActive() {\n return (this == RecordStatusEnum.ACTIVE);\n }",
"public Integer getIsActive() {\n return isActive;\n }",
"public static Enumeration getActiveAccountNames() {\r\n return (accounts.keys());\r\n }",
"public boolean getActive()\n {\n return this.active;\n }",
"com.google.ads.googleads.v13.enums.AccountLinkStatusEnum.AccountLinkStatus getStatus();",
"public boolean approveApp(String myAppName) {\n\t\tLog.info(\"Checking if App:\" + myAppName + \"came for approval\");\n\t\tWebElement myElement = getAppFromList(myAppName);\n\t\tif (myElement != null) {\n\t\t\tLog.info(myAppName + \"came for approval. Approving it now..\");\n\t\t\tWebElement approveButton = myElement.findElement(By.id(\"appsEditApprove\"));\n\t\t\tapproveButton.click();\n\t\t\tapp_confrim.click();\n\t\t\tif (getAccontDetails(myAppName) != null) {\n\t\t\t\tLog.info(myAppName + \"is approved now\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tLog.info(\"failed to approve\" + myAppName);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tLog.info(myAppName + \"did not showed up in approval list\");\n\t\t\treturn false;\n\t\t}\n\n\t}",
"@Override\n public int getStorageEncryptionStatus(@Nullable String callerPackage, int userHandle) {\n if (!mHasFeature) {\n // Ok to return current status.\n }\n Preconditions.checkArgumentNonnegative(userHandle, \"Invalid userId\");\n\n final CallerIdentity caller = getCallerIdentity(callerPackage);\n Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle));\n\n\n final ApplicationInfo ai;\n try {\n ai = mIPackageManager.getApplicationInfo(callerPackage, 0, userHandle);\n } catch (RemoteException e) {\n throw new SecurityException(e);\n }\n\n boolean legacyApp = false;\n if (ai.targetSdkVersion <= Build.VERSION_CODES.M) {\n legacyApp = true;\n }\n\n final int rawStatus = getEncryptionStatus();\n if ((rawStatus == DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE_PER_USER) && legacyApp) {\n return DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE;\n }\n return rawStatus;\n }",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"boolean hasAccountId();",
"public Boolean isActive() {\n return this.active;\n }",
"public boolean isActiveUser() {\r\n if (currentProcessInstance == null)\r\n return false;\r\n \r\n String[] states = currentProcessInstance.getActiveStates();\r\n if (states == null)\r\n return false;\r\n \r\n Actor[] users;\r\n for (int i = 0; i < states.length; i++) {\r\n try {\r\n users = currentProcessInstance.getWorkingUsers(states[i]);\r\n for (int j = 0; j < users.length; j++) {\r\n if (getUserId().equals(users[j].getUser().getUserId()))\r\n return true;\r\n }\r\n } catch (WorkflowException ignored) {\r\n // ignore unknown state\r\n continue;\r\n }\r\n }\r\n \r\n return false;\r\n }",
"@Override\n public List<User> getAccountStatusList(){\n List<User> userList = null;\n userList = adminMapper.getAccountStatusList();\n return userList;\n }"
] | [
"0.7459833",
"0.7424146",
"0.7244324",
"0.712317",
"0.69607675",
"0.6524469",
"0.6437316",
"0.6253495",
"0.6177469",
"0.60589355",
"0.5895189",
"0.5895066",
"0.5870897",
"0.5854983",
"0.5839223",
"0.5838748",
"0.58107805",
"0.5809503",
"0.5809503",
"0.57857186",
"0.57813805",
"0.57647145",
"0.5764325",
"0.57515144",
"0.5716209",
"0.57068205",
"0.56904066",
"0.56893754",
"0.56635416",
"0.5631568",
"0.5631568",
"0.5631568",
"0.5630586",
"0.562924",
"0.5615631",
"0.55930483",
"0.5581073",
"0.5581073",
"0.5581073",
"0.5581073",
"0.5581073",
"0.5581073",
"0.5581073",
"0.5581073",
"0.5581073",
"0.5581073",
"0.5581073",
"0.5581073",
"0.5581073",
"0.5581073",
"0.5581073",
"0.55773765",
"0.55706567",
"0.55504835",
"0.5539926",
"0.55365866",
"0.5534042",
"0.5527611",
"0.5527611",
"0.55190635",
"0.55190635",
"0.55190635",
"0.5518091",
"0.5486418",
"0.5485515",
"0.548036",
"0.5464317",
"0.5464317",
"0.54542524",
"0.54361844",
"0.54322433",
"0.5420179",
"0.54137623",
"0.5412143",
"0.54031384",
"0.53982985",
"0.53942555",
"0.5368905",
"0.5367104",
"0.536154",
"0.5356639",
"0.53560036",
"0.53560036",
"0.53547585",
"0.5354377",
"0.53534496",
"0.53472036",
"0.53301597",
"0.53293574",
"0.5319706",
"0.5313736",
"0.5313736",
"0.5313736",
"0.5313736",
"0.5313736",
"0.5313736",
"0.5313736",
"0.5312158",
"0.53119373",
"0.5308007"
] | 0.7980579 | 0 |
/ INFO: This method will logout from home page INPUT: NULL RETURN: Login Page object | public LoginPage logout() {
logoutLink.click();
LoginPage loginPage = new LoginPage(driver, prop);
return loginPage;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public HomePage logout(WebDriver driver) {\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.MILLISECONDS);\n\t\tdriver.findElement(By.xpath(\"/html/body/div[3]/div[1]/div/div/ul/li[3]/a\")).click();\n\t\t\n\t\tlogger.info(\"User is logged out\");\n\t\treturn new HomePage();\n\t}",
"private void logout() {\n\t\tgetUI().get().navigate(\"login\");\r\n\t\tgetUI().get().getSession().close();\r\n\t}",
"public void logout() {\n \n }",
"public void Logout() {\n \t\t\t\n \t\t}",
"public String logout()\n \t{\n \t\t_session.remove(GlobalConstants.USER_KEY);\n\t\treturn \"home\";\n \t}",
"public LoginPage logUserOut() {\n if (browser.findElements(By.id(LOGOUT_BUTTON_ID)).isEmpty()) {\n throw new RuntimeException(\"Cannot log the user out because the logout button is not visible. Is user logged in?\");\n }\n\n browser.findElement(By.id(LOGOUT_BUTTON_ID)).click();\n\n LoginPage shown = new LoginPage(browser);\n shown.waitUntilPageIsOpen();\n return shown;\n }",
"public void logOut() {\n try {\n // getGlobalNavigation().clickSignOut();\n } catch (TimeoutException e) {\n Log.log(\"logOut\", \"page loads for more than 30 seconds\", true);\n }\n }",
"void logout();",
"void logout();",
"public static Result logout() {\n session().clear();\n flash(\"success\", Messages.get(\"youve.been.logged.out\"));\n return GO_HOME;\n }",
"private void logout() {\n\t\tParseUser.logOut();\n\n\t\t// Go to the login view\n\t\tstartLoginActivity();\n\t}",
"public abstract void logout();",
"@Override\r\n\tpublic void logout() {\n\t\t\r\n\t}",
"public static void Logout(){\n\t\tloginSystem();\r\n\t\t\r\n\t}",
"public void logout() {\n showLoginScreen();\n }",
"public void doLogout() {\n loggedIn = false;\r\n HttpSession session = (HttpSession) FacesContext.getCurrentInstance()\r\n .getExternalContext().getSession(false);\r\n session.invalidate(); \r\n String pag= \"/login.xhtml\";\r\n redireccionar(pag);\r\n }",
"public void logout(){\n logger.debug(\"logout from the application\");\n driver.findElement(oLogout).click();\n new WebDriverWait(driver,10).until(\n ExpectedConditions.titleIs(\"Sign-on: Mercury Tours\"));\n\n }",
"@Override\n\tpublic void logout() {\n\t}",
"public Result logOut() {\n customerService().logout();\n return redirectToReturnUrl();\n }",
"@Override\n\tpublic String logout() {\n\t\treturn null;\n\t}",
"@Override\n public void Logout() {\n\t \n }",
"protected void userLoggedOut() {\n\t\tRuvego.userLoggedOut();\n\t\tResultsActivityMenu.userLoggedOut();\n\t\tHistory.newItem(\"homePage\");\n\t}",
"public void logout() {\n\n if (WarehouseHelper.warehouse_reserv_context.getUser().getId() != null) {\n //Save authentication line in HisLogin table\n HisLogin his_login = new HisLogin(\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName()\n + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + WarehouseHelper.warehouse_reserv_context.getUser().getLogin(),\n GlobalVars.APP_HOSTNAME, GlobalMethods.getStrTimeStamp()));\n his_login.setCreateId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n his_login.setWriteId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n\n String str = String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName() + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + PackagingVars.context.getUser().getLogin(), GlobalVars.APP_HOSTNAME,\n GlobalMethods.getStrTimeStamp());\n his_login.setMessage(str);\n\n str = \"\";\n his_login.create(his_login);\n\n //Reset the state\n state = new S001_ReservPalletNumberScan();\n\n this.clearContextSessionVals();\n\n connectedUserName_label.setText(\"\");\n }\n\n }",
"public void logout() {\n\n $(logOutNavigator).click();\n driver = commonMethods.waitForElement(driver, logOffBtn);\n $(logOffBtn).click();\n $(loadingProgressIcon).should(disappear);\n }",
"public void logout()\r\n {\r\n loginForForm = \"\";\r\n passwordForForm = \"\";\r\n redirectSession(\"/logout\");\r\n }",
"public void logout(){\n\t\t\n\t\tcurrentUser.logout();\n\t\tcurrentUser = null;\n\t\tchangeViewPort(new GUI_Logout(\"\", \"\", this));\n\t}",
"public void logout() {\n\n if (WarehouseHelper.warehouse_reserv_context.getUser().getId() != null) {\n //Save authentication line in HisLogin table\n /*\n HisLogin his_login = new HisLogin(\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName()\n + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + WarehouseHelper.warehouse_reserv_context.getUser().getLogin(),\n GlobalVars.APP_HOSTNAME, GlobalMethods.getStrTimeStamp()));\n his_login.setCreateId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n his_login.setWriteId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n \n \n String str = String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName() + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + PackagingVars.context.getUser().getLogin(), GlobalVars.APP_HOSTNAME,\n GlobalMethods.getStrTimeStamp());\n his_login.setMessage(str);\n\n str = \"\";\n his_login.create(his_login);\n */\n //Reset the state\n state = new S001_ReservPalletNumberScan();\n\n this.clearContextSessionVals();\n\n connectedUserName_label.setText(\"\");\n\n this.setVisible(false);\n }\n\n }",
"public String logout(){\r\n this.user = null;\r\n loggedIn = false;\r\n return \"/index?faces-redirect=true\";\r\n }",
"private void logout(){\n ParseUser.logOut();\n removeUserFromPrefs();\n Intent intent = LandingActivity.intent_factory(this);\n startActivity(intent);\n }",
"private void logout() {\n getSharedPreferences(HELP_CATEGORIES, MODE_PRIVATE).edit().clear().apply();\n getSharedPreferences(LOGIN, MODE_PRIVATE).edit().putBoolean(IS_LOGGED_IN, false).apply();\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(URL + \"/nuh/logout\")\n .build();\n AsyncTask.execute(() -> {\n try {\n client.newCall(request).execute();\n } catch (IOException e) {\n e.printStackTrace();\n }\n });\n }",
"@Override\n public void performLogout(){\n }",
"public static void logout() {\n click(MY_ACCOUNT_DROPDOWN);\n click(LOGOUT_BUTTON);\n }",
"public void logout() {\n \n FacesContext.getCurrentInstance().getExternalContext().invalidateSession();\n try {\n FacesContext.getCurrentInstance().getExternalContext()\n .redirect(\"/BookStorePelikSangat/faces/admin/loginadmin.xhtml\");\n } \n catch (IOException e) {}\n\t}",
"public PageBase click_on_login_submit_form_button () {\r\n HomePageClass homePage = new HomePageClass(driver);\r\n\r\n LGN_Login_submitBTN.click();\r\n\r\n WebDriverWait wait = getWait();\r\n wait.until(ExpectedConditions.visibilityOf(homePage.logout));\r\n\r\n return homePage;\r\n\r\n }",
"private void logout() {\n userModel.setLoggedInUser(null);\n final Intent intent = new Intent(this, LoginActivity.class);\n startActivity(intent);\n finish();\n }",
"public String logout() {\n String destination = \"/index?faces-redirect=true\";\n\n // FacesContext provides access to other container managed objects,\n // such as the HttpServletRequest object, which is needed to perform\n // the logout operation.\n FacesContext context = FacesContext.getCurrentInstance();\n HttpServletRequest request = \n (HttpServletRequest) context.getExternalContext().getRequest();\n\n try {\n // added May 12, 2014\n HttpSession session = request.getSession();\n session.invalidate();\n \n // this does not invalidate the session but does null out the user Principle\n request.logout();\n } catch (ServletException e) {\n log.log(Level.SEVERE, \"Failed to logout user!\", e);\n destination = \"/loginerror?faces-redirect=true\";\n }\n\n return destination; // go to destination\n }",
"public void logout() {\n updateToken(\"\");\n startActivity(new Intent(GarageListActivity.this, LoginScreenActivity.class));\n updateToken(\"\");\n finish();\n }",
"public static void logout(){\n driver.findElement(By.id(\"ctl00_logout\")).click();\n\n }",
"@JavascriptInterface\n public void logout() {\n Login.logout();\n Intent intent = new Intent(mContext, LoginActivity.class);\n mContext.startActivity(intent);\n }",
"@Test\n\tpublic void testLogout() throws Exception {\n\t\tgotoHomePage();\n\t\t\n\t\t// login then logout\n\t\tlogin(\"admin\", \"123456\");\n\t\t// should redirect to home page\n\t\tAssert.assertEquals(\"SIS\", driver.getTitle());\n\t\tlogout();\n\t\t// should redirect to login page\n\t\tAssert.assertEquals(\"Login Page\", driver.getTitle());\n\t\t\n\t\t// login, go to Cart page, then logout\n\t\tlogin(\"admin\", \"123456\");\n\t\tdriver.findElement(By.linkText(\"Cart\")).click();\n\t\tAssert.assertEquals(\"Cart\", driver.getTitle());\n\t\tlogout();\n\t\t// should redirect to login page\n\t\tAssert.assertEquals(\"Login Page\", driver.getTitle());\n\t\t\n\t\t// login, go to Transcript page, then logout\n\t\tlogin(\"admin\", \"123456\");\n\t\tdriver.findElement(By.linkText(\"Transcript\")).click();\n\t\tAssert.assertEquals(\"Transcript\", driver.getTitle());\n\t\tlogout();\n\t\t// should redirect to login page\n\t\tAssert.assertEquals(\"Login Page\", driver.getTitle());\n\t\t\n\t\t// login, go to Payment page, then logout\n\t\tlogin(\"admin\", \"123456\");\n\t\tdriver.findElement(By.linkText(\"Payment\")).click();\n\t\tAssert.assertEquals(\"Payment\", driver.getTitle());\n\t\tlogout();\n\t\t// should redirect to login page\n\t\tAssert.assertEquals(\"Login Page\", driver.getTitle());\n\t\t\n\t\t// login, go to Grades page, then logout\n\t\tlogin(\"admin\", \"123456\");\n\t\tdriver.findElement(By.linkText(\"Grades\")).click();\n\t\tAssert.assertEquals(\"Grades\", driver.getTitle());\n\t\tlogout();\n\t\t// should redirect to login page\n\t\tAssert.assertEquals(\"Login Page\", driver.getTitle());\n\t\t\n\t\t// login, go to Change Password page, then logout\n\t\tlogin(\"admin\", \"123456\");\n\t\tdriver.findElement(By.linkText(\"Change Password\")).click();\n\t\tAssert.assertEquals(\"Change Password\", driver.getTitle());\n\t\tlogout();\n\t\t// should redirect to login page\n\t\tAssert.assertEquals(\"Login Page\", driver.getTitle());\n\t}",
"void successLogout();",
"public static void signOut(){\n\t\tActions action_logout = new Actions(driver);\n\t\tWebElement UI = driver.findElement(By.id(\"UserNavigationTabsContainer\"));\n\t\taction_logout.moveToElement(UI).build().perform();\n\t\tdriver.findElement(By.linkText(\"Logout\")).click();\t\n\t\tpause(500);\n\t}",
"private void logout() {\n ((MyApplication)this.getApplication()).setLoggedIn(false);\n// Intent intent = new Intent(this, StartupActivity.class);\n// startActivity(intent);\n }",
"public UserActivityDDL logoutFrominMD()throws Exception{\n click(UserProfileLinkBy);\n //Click Logout Button\n click(logoutButtonBy);\n return this;\n }",
"public void logout() {\n\t\tthis.setCurrentUser(null);\n\t\tthis.setUserLoggedIn(false);\t\t\n\t}",
"@RequestMapping(value = \"/logout\", method = RequestMethod.GET)\n public String logoutPage(HttpServletRequest request, HttpServletResponse response) {\n Authentication auth = SecurityContextHolder.getContext().getAuthentication();\n if (auth != null) {\n //new SecurityContextLogoutHandler().logout(request, response, auth);\n persistentTokenBasedRememberMeServices.logout(request, response, auth);\n SecurityContextHolder.getContext().setAuthentication(null);\n }\n return \"redirect:/login?logout\";\n }",
"public void logout() {\n loggedIn = \"\";\n FacesContext.getCurrentInstance().getExternalContext()\n .getSessionMap().put(\"loggedIn\", \"\");\n }",
"private void logOut() {\n mApi.getSession().unlink();\n\n // Clear our stored keys\n clearKeys();\n // Change UI state to display logged out version\n setLoggedIn(false);\n }",
"private void logoutHandler() {\n AlertDialog.Builder builder = new AlertDialog.Builder(context, android.R.style.Theme_DeviceDefault_Dialog);\n builder.setTitle(\"Logout?\");\n builder.setMessage(\"Are you sure you want to logout?\");\n builder.setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n Util.setLoggedInFlag(false);\n\n HPIApp.getAppContext().stopService(new Intent(HPIApp.getAppContext(), StepService.class));\n\n Intent intent = new Intent(HomeActivity.this, SplashActivity.class);\n startActivity(intent);\n HomeActivity.this.finish();\n }\n });\n\n builder.setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n\n builder.show();\n }",
"public void logout() {\n\t\ttry {\n\t\t\tStage mainStage = (Stage) HomePagePane.getScene().getWindow();\n\t\t\tmainStage.close();\n\t\t\tFXMLLoader loader = new FXMLLoader(getClass().getResource(\"/application/Main.FXML\"));\n\t\t\tAnchorPane pane = loader.load();\n\t\t\tScene scene = new Scene(pane, 700, 400);\n\t\t\tStage stage = new Stage();\n\t\t\tstage.setScene(scene);\n\t\t\tstage.show();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public void redirectToHomePageNotLoggedIn() {\r\n\t\t\r\n\t\twebAppDriver.get(baseUrl);//+\"?optimizely_x8236533790=0\"\r\n\t\t/*try {\r\n\t\t\twebAppDriver.verifyElementTextContains(By.id(linkLogoutId), \"Logout\", true);\r\n\t\t\tloginAction.clickOnLogOut();\r\n\t\t} catch (Exception e) {\r\n\t\t\t// this is just to do logout if customer is auto logged in during\r\n\t\t\t// reservation\r\n\t\t}\r\n\t\t*/\r\n\t}",
"public void logout() throws Exception {\n\n Log.info(\"Logging out the user\");\n sleep(2000);\n /*$(LoginOutRepo.uatAdmin).click();\n sleep(1000);\n $(LoginOutRepo.logout).click();\n Log.info(\"Logout successful\");*/\n moveToElement(By.cssSelector(\"img[alt='Profile Picture']\"));\n $(LoginOutRepo.logout).click();\n\n }",
"@Step(\"Log out\")\n public void logOut() {\n open();\n sighOutButton.click();\n }",
"@FXML\r\n private void handleButtonLogOut() {\r\n sessionContent.remove(\"activeId\");\r\n user = null;\r\n MobileApplication.getInstance().switchView(LOGIN_VIEW);\r\n }",
"@Override\r\n\tpublic void userLogout(String login) {\n\r\n\t}",
"public String logout()\n\t{\n\t\tsession.remove(\"user_name\");\n\t\tsession.remove(\"password\");\n\t\tsession.clear();\n\t\tsession.invalidate();\t\n\t\taddActionMessage(\"You Have Been Successfully Logged Out\");\n\t\treturn SUCCESS;\n\t}",
"private void logoutUser() {\n\t\tsession.setLogin(false);\n\n\n\t\t// Launching the login activity\n\t\tIntent intent = new Intent(EnterActivity.this, LoginActivity.class);\n\t\tstartActivity(intent);\n\t\tfinish();\n\t}",
"protected void logout() {\n\t\tActiveUserModel userController = ActiveUserModel.getInstance();\n\t\tuserController.performLogout();\n\n\t\tIntent intent = new Intent(this, LoginActivity.class);\n\t\tstartActivityForResult(intent, LOGIN_ACTIVITY);\n\t}",
"public void onLogout() {\n ParseUser.logOut();\n\n promptForLogin();\n }",
"@When(\"^user should signout to exit from the loggedin page$\")\n\tpublic void user_should_signout_to_exit_from_the_loggedin_page() throws Throwable {\n\t\telementClick(pa.getAp().getLogout());\n\t\t\n\t \n\t}",
"public void logOut() {\n\t\t//Inform the database that the user want to log out\n\t\tdc.logOutPlayer(activity);\n\t\t\n\t\t/*\n\t\t * Call is made to StartActivity, which surely is in the bottom of activity-stack. Add a flag to clear stack\n\t\t * and from StartActivity a call is made to the Login screen and StartActivity is finished. By doing this we\n\t\t * assure that Login screen is at the bottom of the activity-stack and a press on back button, while placed \n\t\t * on Login screen, will result in that the application is closed\n\t\t */\n\t\tIntent intent = new Intent(activity, StartActivity.class);\n\t\tintent.putExtra(\"finish\", true);\n\t\tintent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\t\tactivity.startActivity(intent);\n\t\tactivity.finish();\n\t}",
"@AfterTest\n\t\tpublic void logout(){\n//Calling method to logout from the account and verify logout message.\n//'**********************************************************\n\t\t\tLogOutPage accountLogoutPage =myWishlistPage.logout();\n\t\t\tAssert.assertTrue(accountLogoutPage.getlogoutMsg().equals(\"Account Logout\"), \"Account Logout message is not displayed\");\n\t\t\textentTest.log(LogStatus.PASS,\"Account Logout message is displayed and the user is signed out from the account\");\n//'**********************************************************\n//Close the report\n//'**********************************************************\n\t\t\textentReports.endTest(extentTest);\n\t\t\textentReports.flush();\n\t\t\textentReports.close();\n\t\t}",
"public static void logout() {\n\t\tif (activeAccount != null) try {\n\t\t\t\n\t\t\tif (authClient != null)\n\t\t\t\tauthClient.logout();\n\t\t\tauthClient = null;\n\t\t\t\n\t\t\tactiveAccount = null;\n\t\t}\n\t\tcatch (IOException ioe) {\n\t\t\tJOptionPane.showMessageDialog(DialogPanel.getTopWindow(), (\"An error occurred while logging out from the GoldenGATE Server at\\n\" + activeAccount.host + \":\" + activeAccount.port + \"\\n\" + ioe.getMessage()), \"Error on Logout\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\t}",
"public void logout() {\n // Mengambil method clear untuk menghapus data Shared Preference\n editor.clear();\n // Mengeksekusi perintah clear\n editor.commit();\n // Membuat intent untuk berpindah halaman\n Intent intent = new Intent(context, LoginActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n context.startActivity(intent);\n }",
"private void logout() {\n Utils.showConfirmationDialogCallBack(MainActivity.this, getString(R.string.logout_sure), this);\n }",
"@GetMapping(path = \"logout\")\n public String logOut(){\n return \"home_page\";\n }",
"@When(\"^User LogOut from the Application$\")\r\n\tpublic void user_LogOut_from_the_Application() throws Throwable {\n\t\tdriver.findElement(By.xpath(\"//a[@class='ico-logout']\")).click();\r\n\t}",
"public void logout() {\n getRequest().getSession().invalidate();\n }",
"@RequestMapping(value=\"/logout\", method = RequestMethod.GET)\n\tpublic String logoutPage (HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t Authentication authentication = SecurityContextHolder.getContext().getAuthentication();\n\t if (authentication != null){ \n\t new SecurityContextLogoutHandler().logout(request, response, authentication);\n\t }\n\t return \"redirect:/login?logout\";\n\t}",
"public static void Logout() throws IOException {\n Socket client = ConnectionToServer();\n // Checks if the sever is online\n if (client.isConnected()) {\n OutputStream outputStream = client.getOutputStream();\n InputStream inputStream = client.getInputStream();\n\n ObjectOutputStream send = new ObjectOutputStream(outputStream);\n ObjectInputStream receiver = new ObjectInputStream(inputStream);\n\n send.writeUTF(\"Logout\"); // Send logout to server\n send.writeUTF(loggedInUser); // Send username to server\n send.flush();\n// End connections\n send.close();\n receiver.close();\n client.close();\n }\n// Resetting the application for the user on the client-side\n loggedInUser = \"\";\n Login.usernameText.setText(\"\");\n loginSuccessful = false;\n boolean[] falsePermission = {false, false, false, false};\n permission.SetUserPermission(falsePermission);\n token = \"\";\n ControlPanelFrameHandler.LogoutWindow();\n }",
"public static void logout(Activity a) {\n\t\t// Directing to the LogIn page\n\t\tIntent intent = new Intent(a, MainActivity.class);\n\t\tUser.getUser().setToken(\"\");\n\t\tUser.getUser().setUserid(\"\");\n\t\tUser.getUser().setAccounts(null);\n\t\ta.startActivity(intent);\n\t\ta.finish();\t\n\t}",
"private void logout()\r\n {\r\n LogoutRequest request = new LogoutRequest();\r\n request.setUsername(username);\r\n this.sendRequest(request);\r\n }",
"public void logoutUser() {\n editor.remove(Is_Login).commit();\n editor.remove(Key_Name).commit();\n editor.remove(Key_Email).commit();\n editor.remove(KEY_CUSTOMERGROUP_ID).commit();\n // editor.clear();\n // editor.commit();\n // After logout redirect user to Loing Activity\n\n }",
"private void logout() {\n fbAuth.signOut();\n startActivity(new Intent(getApplicationContext(), LoginActivity.class));\n finish();\n }",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(Activity_Main.this, Activity_Login.class);\n startActivity(intent);\n finish();\n }",
"public String logout() throws IOException, ServletException {\r\n ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();\r\n RequestDispatcher dispatcher = ((ServletRequest) context.getRequest())\r\n .getRequestDispatcher(\"/j_spring_security_logout\");\r\n dispatcher.forward((ServletRequest) context.getRequest(),\r\n (ServletResponse) context.getResponse());\r\n FacesContext.getCurrentInstance().responseComplete();\r\n return null;\r\n }",
"public static void logout(Context context) \r\n\t{\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\r\n\t\t\tcontext.sessionAttribute(\"currentUser\", null);\r\n\t\t\tcontext.redirect(\"/index.html\");\r\n\t\t\t//context.json(new MyCustomResponseMessage(\"You've successfully logged out\", \"success\"));\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tLogging.error(e);\r\n\t\t}\r\n\t}",
"private void logout() {\n LogoutTask mAuthTask = new LogoutTask();\n mAuthTask.execute((Void) null);\n }",
"@Test(dependsOnMethods = {\"loginTest\"}, description = \"User can log out the GS Cloud\", groups = \"cloud\")\n\tpublic void logoutTest() throws IOException {\n\t\tcp.clickUserDropdownLink();\n\t\tcp.clickLogoutButton();\n\t\tcp.validateLogoutSuccess();\n\t\n\t}",
"void logoutDone();",
"private void Logout() {\n\n\t\tPreferenceUtil.getInstance(mContext).saveBoolean(\"exitApp\", true);\n\t\tPreferenceUtil.getInstance(mContext).clear();\n\t\tPreferenceUtil.getInstance(mContext).destroy();\n\n\t\tZganLoginService.toClearZganDB();\n\n\t\tstopService(new Intent(mContext, ZganPushService.class));\n\n\t\tsetContentView(R.layout.nullxml);\n\t\tfinish();\n\t\tandroid.os.Process.killProcess(android.os.Process.myPid());\n\n\t\tSystem.exit(0);\n\t}",
"public void doLogout() {\r\n\t\tdestroy();\r\n\r\n\t\t/* ++++++ Kills the Http session ++++++ */\r\n\t\t// HttpSession s = (HttpSession)\r\n\t\t// Sessions.getCurrent().getNativeSession();\r\n\t\t// s.invalidate();\r\n\t\t/* ++++++ Kills the zk session +++++ */\r\n\t\t// Sessions.getCurrent().invalidate();\r\n\t\tExecutions.sendRedirect(\"/j_spring_logout\");\r\n\r\n\t}",
"public String logout() {\n\t\tFacesContext facesContext = FacesContext.getCurrentInstance();\n\t\tHttpSession session = (HttpSession) facesContext.getExternalContext().getSession(true);\n\t\tsession.invalidate();\n\t\treturn \"\";\n\t}",
"@When ( \"I log out\" )\n public void logOut () {\n driver.findElement( By.id( \"logout\" ) ).click();\n }",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(MainActivity.this, Login.class);\n startActivity(intent);\n finish();\n }",
"public void logout() throws LoginException\n\t{\n\t\tlc.logout();\n\t}",
"public static void logout() {\n userId = -1;\n aisId = -1;\n \n name = \"\";\n role = \"\";\n roleFromDatabase = \"\";\n \n lastAction = LocalDateTime.now().minusYears(100);\n }",
"@Test\n public void logoutPage() throws InterruptedException{\n \tSystem.out.println(\"My Vehicle.\");\n \tlogoutPage.logout();\n // Assert.assertEquals(loginPage.getMessage(), LOGIN_SUCCESS_MESSAGE);\n }",
"public void Logout()\n {\n isLoggedIn = false;\n connection.Disconnect(); \n connection = null;\n }",
"public void logout() {\n SharedPreferences sharedPreferences = mCtx.getSharedPreferences(AppConfig.SHARED_PREF_NAME, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.clear();\n editor.apply();\n mCtx.startActivity(new Intent(mCtx, LoginActivity.class));\n }",
"@CrossOrigin(origins = AppConstants.CORS)\n\t@RequestMapping(value = {UrlConstants.API_LOGOUT+\"org\"}, method = RequestMethod.POST)\n\tpublic void logOut() {\n\t\t try {\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"efregt\");\n\t\t}\n\t}",
"@Override\n\tpublic void logout()\n\t{\n\t\tthis.user = null;\n\t}",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(this, Login.class);\n startActivity(intent);\n finish();\n }",
"@Override\n public void doLogout() {\n // Toast.makeText(getApplicationContext(),\"Session Expired\",Toast.LENGTH_SHORT).show();\n Intent intent = new Intent(getApplicationContext(), activity_Login.class);\n startActivity(intent);\n }",
"@Override\n public void doLogout() {\n // Toast.makeText(getApplicationContext(),\"Session Expired\",Toast.LENGTH_SHORT).show();\n Intent intent=new Intent(getApplicationContext(), activity_Login.class);\n startActivity(intent);\n }",
"public void signOut() {\n ReusableActionsPageObjects.clickOnElement(driver, signOut, logger, \"log out.\");\n }",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(EscolhaProjeto.this, LoginActivity.class);\n startActivity(intent);\n finish();\n }",
"private void logout() {\n //set offline flag\n String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();\n new PostNoSqlDataBase(this).offline(uid);\n\n //logout\n // FirebaseAuth mAuth = FirebaseAuth.getInstance();\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 GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n mGoogleSignInClient.signOut();\n FirebaseAuth.getInstance().signOut();\n //go to the main activity\n startActivity(new Intent(this, SignUpActivity.class));\n finish();\n }",
"void logoutSuccessful();",
"@Override\n\tpublic void logOutUser() {\n\t\t\n\t}"
] | [
"0.7756404",
"0.75430095",
"0.74667054",
"0.7426612",
"0.74080586",
"0.73937106",
"0.7377223",
"0.7351718",
"0.7351718",
"0.732464",
"0.73166895",
"0.7309393",
"0.7300037",
"0.72906274",
"0.72493476",
"0.7226966",
"0.7139911",
"0.7138289",
"0.71178824",
"0.70800537",
"0.70407265",
"0.70182306",
"0.6998253",
"0.6995868",
"0.698136",
"0.6975758",
"0.6974655",
"0.6972377",
"0.69210625",
"0.69197917",
"0.6912448",
"0.69051933",
"0.68946844",
"0.6885465",
"0.68811345",
"0.687933",
"0.68776166",
"0.6865804",
"0.6864614",
"0.68602777",
"0.6857604",
"0.6851497",
"0.6838788",
"0.68192065",
"0.68011403",
"0.6798468",
"0.67939353",
"0.6791503",
"0.6788904",
"0.67600316",
"0.67592543",
"0.6743435",
"0.67276764",
"0.67086303",
"0.6695095",
"0.669363",
"0.6682739",
"0.667429",
"0.6642968",
"0.6624617",
"0.66233754",
"0.66221964",
"0.6621094",
"0.6620077",
"0.6616714",
"0.66130114",
"0.65961856",
"0.65936697",
"0.6589369",
"0.6589299",
"0.658764",
"0.65732247",
"0.6565656",
"0.6559943",
"0.65434843",
"0.65422136",
"0.65413725",
"0.6529322",
"0.6524705",
"0.6516744",
"0.6510944",
"0.65104514",
"0.65040463",
"0.6494278",
"0.6483204",
"0.64660215",
"0.6459829",
"0.64569247",
"0.6456846",
"0.6450756",
"0.6446668",
"0.6445436",
"0.64357233",
"0.6432116",
"0.64269376",
"0.64250326",
"0.64189893",
"0.6408211",
"0.6407719",
"0.6404903"
] | 0.79992294 | 0 |
/ INFO: This method delete app from data base INPUT: NULL RETURN: VOID | public void deleteApp(String packageName) throws SQLException {
String dburl = prop.getProperty("dburl");
String dbuser = prop.getProperty("dbuser");
String dbpw = prop.getProperty("dbpw");
methods_snw.deleteAppFromServer(dburl, dbuser, dbpw, packageName);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Result deleteApp(String app);",
"@Override\n\tpublic int delApp(int eid) {\n\t\treturn appdao.delapp(eid);\n\t}",
"@Delete({ \"delete from iiot_app_list\", \"where app_id = #{appId,jdbcType=INTEGER}\" })\n\tint deleteByPrimaryKey(Integer appId);",
"public void deletedb()\n {\n this.appContext.deleteDatabase(DB_NAME);\n Log.d(\"testdeletedb\",\"done\");\n }",
"public com.google.protobuf.Empty deleteApplication(org.thethingsnetwork.management.proto.HandlerOuterClass.ApplicationIdentifier request);",
"public void delete(App obj) {\n getClient().delete(\n String.format(Routes.APP_DELETE, obj.getId())\n );\n obj.setId(null);\n }",
"private void deleteItem()\n {\n Category categoryToDelete = dataCategories.get(dataCategories.size()-1);\n AppDatabase db = Room.databaseBuilder(getApplicationContext(),\n AppDatabase.class, \"database-name\").allowMainThreadQueries().build();\n db.categoryDao().delete(categoryToDelete);\n testDatabase();\n }",
"public void deleteApp(Appointment app, Date dat)\n {\n List z = cal.get(dat);\n boolean flag = true;\n int i = 0;\n while(flag){\n if(z.get(i)==app){\n z.remove(app);\n flag = false;\n }\n i++;\n }\n \n }",
"public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> deleteApplication(\n org.thethingsnetwork.management.proto.HandlerOuterClass.ApplicationIdentifier request);",
"void removeApp(String bundleId);",
"public void deleteEntry(String ti) throws SQLException{\n\t\tourDatabase.delete(DATABASE_TABLE,KEY_APP_ID + \"=?\", new String[] { ti });\r\n\t\t\r\n\t}",
"public Boolean delete(SessionFactory factory, EihApps input) {\n\t\treturn null;\n\t}",
"int deleteByPrimaryKey(ApplicationDOKey key);",
"@Test\n public void deleteAppPermissionTest() throws ApiException {\n String appId = null;\n String username = null;\n Boolean naked = null;\n // api.deleteAppPermission(appId, username, naked);\n\n // TODO: test validations\n }",
"public void deleteData()\n {\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(TABLE_NAME, null, null);\n //context.deleteDatabase(DATABASE_NAME);\n\n }",
"void remove(String installedAppId);",
"public void eliminar(Long id) throws AppException;",
"public void deleteDB() {\n \n sql = \"Delete from Order where OrderID = \" + getOrderID();\n db.deleteDB(sql);\n \n }",
"public void deleteAppUser(Long id) {\n\t\tappUserRepository.delete(id);\n\t\t\n\t}",
"@Override\r\n public void delete(Appointment a) throws SQLException {\r\n int id = a.getAppointmentId();\r\n String statement = \"DELETE FROM appointments WHERE Appointment_ID =\" + id + \";\";\r\n System.out.println(statement);\r\n conn.prepareStatement(statement).executeUpdate();\r\n }",
"public void deleteApplication(org.thethingsnetwork.management.proto.HandlerOuterClass.ApplicationIdentifier request,\n io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver);",
"public void deleteDevices(){\n SQLiteDatabase db = getWritableDatabase();\n db.execSQL(\"delete from \"+devicesContract.deviceEntry.tableName);\n db.close();\n }",
"public static AppRunningEntity removeApp(String paramString) {\n }",
"public void deleteUserData(){\n buttonResetDb.setOnClickListener(\n new View.OnClickListener(){\n @Override\n public void onClick(View view) {\n app_db.truncateAllFactTables();\n Toast.makeText(MainActivity.this, \"DB Cleansed\", Toast.LENGTH_LONG).show();\n resetMainActivity();\n }\n }\n );\n }",
"public void deleteDB(){\n \t\tSQLiteDatabase db = this.getWritableDatabase();\n \t\tdb.execSQL(\"DROP TABLE IF EXISTS user\");\n \t\tdb.execSQL(\"DROP TABLE IF EXISTS poll\");\n \t\tdb.execSQL(\"DROP TABLE IF EXISTS time\");\n \t\tdb.execSQL(\"DROP TABLE IF EXISTS status\");\n \t\tonCreate(db);\n \t}",
"public boolean deleteAppintment(Appointment appointment) {\n\t\treturn false;\r\n\t}",
"int deleteByPrimaryKey(String depCode);",
"public void deleteAppUser(AppUserTO appUser) {\n\t\ttry {\n\t\t\tthis.jdbcTemplate.update(\"delete from carbon_app_user where id=?\",\n\t\t\t\t\tappUser.getId());\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"Error in AppUserDAO: deleteAppUser\", e);\n\t\t}\n\t}",
"void deleteApplicantById(Integer applicantId);",
"@DELETE\n\t@Path(\"{id}\")\n\tpublic Response deleteApplication(@PathParam(\"id\") String id) {\n\t\tApplicationsDao.instance.delete(id);\n\t\treturn Response.noContent().build();\n\t}",
"@RequestMapping(value = \"/rest/application/{id}\", method = RequestMethod.DELETE,\n produces = \"application/json\")\n @Timed\n public void delete(@PathVariable String id, HttpServletResponse response) {\n log.debug(\"REST request to delete application : {}\", id);\n try {\n Application application = applicationRepository.findOne(id);\n if (application == null) {\n response.setStatus(HttpServletResponse.SC_NOT_FOUND);\n } else {\n deployer.delete(application);\n applicationRepository.delete(id);\n }\n } catch (CloudezzDeployException e) {\n log.error(\"Failed during delete app cfg\", e);\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\n }\n\n }",
"public void eliminar(){\n SQLiteDatabase db = conn.getWritableDatabase();\n String[] parametros = {cajaId.getText().toString()};\n db.delete(\"personal\", \"id = ?\", parametros);\n Toast.makeText(getApplicationContext(), \"Se eliminó el personal\", Toast.LENGTH_SHORT).show();\n db.close();\n }",
"int deleteByPrimaryKey(String maht);",
"public void clearDB(){\n \t\tbuilderDelete = new AlertDialog.Builder(this);\n \n \t\t// set title\n \t\tbuilderDelete.setTitle(\"Delete Your Checkbook?\");\n \n \t\tbuilderDelete.setMessage(\n \t\t\t\t\"Do you want to completely delete the database?\\n\\nTHIS IS PERMANENT.\")\n \t\t\t\t.setCancelable(false)\n \t\t\t\t.setPositiveButton(\"Yes\",\n \t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n \t\t\t\t\tpublic void onClick(DialogInterface arg0,\n \t\t\t\t\t\t\tint arg1) {\n \t\t\t\t\t\tdestroyDatabase();\n \t\t\t\t\t}\n \t\t\t\t})\n \t\t\t\t.setNegativeButton(\"No\",\n \t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n \t\t\t\t\tpublic void onClick(DialogInterface arg0, int arg1) {\n \t\t\t\t\t\t// no action taken\n \t\t\t\t\t}\n \t\t\t\t}).show();\n \n \t}",
"int deleteByPrimaryKey(String licFlow);",
"int deleteByPrimaryKey(String fucno);",
"int deleteByPrimaryKey(String deviceNo);",
"public static void deleteDatabase() {\n\n deleteDatabaseHelper(Paths.get(DATA_DIR));\n\n }",
"public boolean eliminaAppuntamento(int codice) {\r\n\t\tboolean ret = false;\r\n\t\tStatement stmt;\r\n\t\tString query = \"DELETE FROM appuntamento WHERE codice='\" + codice + \"'\";\r\n\t\t\r\n\t\tif(!isConnected) {\r\n\t\t\tSystem.err.println(\"AppuntamentoManager.eliminaAppuntamento() - nessuna connessione al db attiva!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif((codice < 0) || (codice > 999999)) {\r\n\t\t\tSystem.err.println(\"AppuntamentoManager.eliminaAppuntamento() - codice non valido: \\\"\" + codice + \"\\\"\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\tstmt = conn.createStatement();\r\n\t\t\tstmt.executeUpdate(query);\r\n\t\t\tret = true;\r\n\t\t}\r\n\t\tcatch(SQLException ex) {\r\n\t\t\tSystem.err.print(\"SQLException: \");\r\n\t\t\tSystem.err.println(ex.getMessage());\r\n\t\t}\r\n\t\treturn ret;\r\n\t}",
"int deleteByPrimaryKey(Long autoid);",
"@Override\r\n\tpublic void deleteDatabase() {\r\n\t\tlog.info(\"Enter deleteDatabase\");\r\n\r\n\t\t\r\n\t\tConnection connection = null;\t\t\r\n\t\ttry {\r\n\t\t\tconnection = jndi.getConnection(\"jdbc/libraryDB\");\t\t\r\n\t\t\t\r\n\r\n\t\t\t \r\n\t\t\t\tPreparedStatement pstmt = connection.prepareStatement(\"Drop Table Users_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tpstmt = connection.prepareStatement(\"Drop Table Cams_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tpstmt = connection.prepareStatement(\"Drop Table User_Cam_Mapping_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tpstmt = connection.prepareStatement(\"Drop Table Cam_Images_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Datenbank wurde erfolgreich zurueckgesetzt!\");\t\t\t\t\r\n\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Fehler: \"+e.getMessage());\r\n\t\t\tlog.error(\"Error: \"+e.getMessage());\r\n\t\t} finally {\r\n\t\t\tcloseConnection(connection);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"int deleteByPrimaryKey(@Param(\"mainId\") Integer mainId, @Param(\"alarmId\") Integer alarmId);",
"public void delete(){\n // clear the table\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(SportPartnerDBContract.LoginDB.TABLE_NAME, null, null);\n }",
"public void deleteDB() {\n File dbFile = new File(dbPath + dbName);\n if (dbFile.exists()) {\n dbFile.delete();\n }\n }",
"void deleteTheDatabase() {\n mContext.deleteDatabase(MoviesDbHelper.DATABASE_NAME);\n }",
"@Override\n\tpublic Boolean delete(AppXBaseDatosTO request) {\n\t\t// TODO Auto-generated method stub\n\t\ttblAppXBaseDatosRepository.delete(tblAppXBaseDatosRepository.\n\t\t\t\tfindTable(request.getFkIdAplicacion(),request.getFkIdBase()).orElseThrow(SupplierBusinessException.DATA_BASE_NOT_FOUND));\n\t\treturn true;\n\t}",
"@Override\n public int delete(Uri uri, String arg1, String[] arg2) {\n SQLiteDatabase db;\n\t// Modifyed by amt_chenjing for switchui-2192 20120715 begin\n try {\n db = mOpenHelper.getWritableDatabase();\n } catch (Exception e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n return 0;\n }\n\t// Modifyed by amt_chenjing for switchui-2192 20120715 end\n int count = 0;\n long rowId = 0;\n switch (graphyUri.match(uri)) {\n case ALL_APPS:\n db.beginTransaction();\n count = db.delete(Apps.TABLE_NAME, arg1, arg2);\n db.setTransactionSuccessful();\n db.endTransaction();\n break;\n case ONE_APP:\n String segment = uri.getPathSegments().get(1);\n //String segment = arg2[0];\n rowId = Long.getLong(segment);\n if (TextUtils.isEmpty(arg1)) {\n arg1 = \"_id=\" + segment;\n } else {\n arg1 = \"_id=\" + segment + \" AND (\" + arg1 + \")\";\n }\n count = db.delete(Apps.TABLE_NAME, arg1, arg2);\n break;\n case ALL_RANKS:\n db.beginTransaction();\n count = db.delete(Ranks.TABLE_NAME, arg1, arg2);\n db.setTransactionSuccessful();\n db.endTransaction();\n break;\n case ONE_RANK:\n String segment1 = uri.getPathSegments().get(1);\n rowId = Long.getLong(segment1);\n if (TextUtils.isEmpty(arg1)) {\n arg1 = \"_id=\" + segment1;\n } else {\n arg1 = \"_id=\" + segment1 + \" AND (\" + arg1 + \")\";\n }\n count = db.delete(Ranks.TABLE_NAME, arg1, arg2);\n break;\n case ALL_MANUALS:\n db.beginTransaction();\n count = db.delete(ManualList.TABLE_NAME, arg1, arg2);\n db.setTransactionSuccessful();\n db.endTransaction();\n break;\n case ONE_MANUAL:\n String segment2 = arg2[0]; //uri.getPathSegments().get(1);\n rowId = Long.getLong(segment2);\n if (TextUtils.isEmpty(arg1)) {\n arg1 = \"_id=\" + segment2;\n } else {\n arg1 = \"_id=\" + segment2 + \" AND (\" + arg1 + \")\";\n }\n count = db.delete(ManualList.TABLE_NAME, arg1, arg2);\n break;\t\n default:\n throw new IllegalArgumentException(\"cannot delete from uri:\"+uri);\n }\n if (count>0 && (graphyUri.match(uri) == ALL_MANUALS\n || graphyUri.match(uri) == ONE_MANUAL)) {\n getContext().getContentResolver().notifyChange(uri, null);\n }\n return count;\n }",
"private void cleanDatabase() {\n\t\tContentResolver cr = mContext.getContentResolver();\n\n\t\tCursor c = cr.query(\n\t\t\t\tConstantPasser.Favorites.CONTENT_URI_NO_NOTIFICATION,\n\t\t\t\tnew String[] { ConstantPasser.Favorites.APPWIDGET_ID }, null,\n\t\t\t\tnull, null);\n\t\ttry {\n\t\t\tAppWidgetHost widgetHost = ((XLauncher) mContext).getAppWidgetHost();\n\t\t\tint index = c.getColumnIndex(ConstantPasser.Favorites.APPWIDGET_ID);\n\t\t\twhile (c.moveToNext()) {\n\t\t\t\tint widgetId = c.getInt(index);\n\t\t\t\tif (Debug.MAIN_DEBUG_SWITCH){\n\t\t\t\t\tR2.echo(\"Invalid widget id : \" + widgetId);\n\t\t\t\t}\n\t\t\t\twidgetHost.deleteAppWidgetId(widgetId);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t} finally {\n\t\t\tif (c != null){\n\t\t\t\tc.close();\n\t\t\t}\n\t\t}\n\n\t\t// clean and do not notify\n\n\t\tif (enableState.enableFolder || enableState.enableQuickEntries\n\t\t\t\t|| enableState.enableWidgets){\n\t\t\tcr.delete(ConstantPasser.Favorites.CONTENT_URI_NO_NOTIFICATION,\n\t\t\t\t\tnull, null);\n\t\t}\n\n\t\tif (enableState.enablePriorities){\n\t\t\tcr.delete(ConstantPasser.Applications.CONTENT_URI, null, null);\n\t\t}\n\n\t\t/* RK_ID: RK_THEME .AUT: zhanggx1 . DATE: 2012-03-31 . S */\n\t\tSettings.System.putString(cr, SettingsValue.KEY_SET_THEME, null);\n\t\t/* RK_ID: RK_THEME .AUT: zhanggx1 . DATE: 2012-03-31 . E */\n\t}",
"int deleteByPrimaryKey(Integer adminid);",
"@Delete({\n \"delete from t_apikey\",\n \"where id = #{id,jdbcType=INTEGER}\"\n })\n int deleteByPrimaryKey(Integer id);",
"int deleteByPrimaryKey(String industryId);",
"int deleteByPrimaryKey(String deptCode);",
"private void deleteDatabase() {\n mOpenHelper.close();\r\n Context context = getContext();\r\n NoteDatabase.deleteDatabase(context);\r\n mOpenHelper = new NoteDatabase(getContext());\r\n }",
"int deleteByPrimaryKey(Integer userCode);",
"public int del(){\n int cnt = mDB.delete(DATABASE_TABLE, null , null);\n return cnt;\n }",
"void deleteTheDatabase() {\n mContext.deleteDatabase(MovieDBHelper.DATABASE_NAME);\n }",
"int deleteByPrimaryKey(String ugId);",
"@Override\r\n public void delete( int nComponentId, Plugin plugin )\r\n {\r\n DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE_APPLICATION, plugin );\r\n daoUtil.setInt( 1, nComponentId );\r\n daoUtil.executeUpdate( );\r\n daoUtil.free( );\r\n\r\n daoUtil = new DAOUtil( SQL_QUERY_DELETE, plugin );\r\n daoUtil.setInt( 1, nComponentId );\r\n daoUtil.executeUpdate( );\r\n daoUtil.free( );\r\n }",
"int deleteByPrimaryKey(String goodsId);",
"public int Delbroker(Long broker_id, String firstname, String lastname,\r\n\t\tString address, String gender, String eMail, Long phone,\r\n\t\tString experience) throws SQLException {\n\tint i=DbConnect.getStatement().executeUpdate(\"delete from broker where broker_id=\"+broker_id+\"\");\r\n\treturn i;\r\n}",
"public void delete() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.delete(this);\r\n\t}",
"int deleteByPrimaryKey(String code);",
"int deleteByPrimaryKey(String code);",
"public static int delete(Periode p){ \n int status=0; \n try{ \n //membuka koneksi\n Connection con=Koneksi.openConnection(); \n //melakukan query database untuk menghapus data berdasarkan id atau primary key\n PreparedStatement ps=con.prepareStatement(\"delete from periode where id=?\"); \n ps.setInt(1,p.getId()); \n status=ps.executeUpdate(); \n }catch(Exception e){System.out.println(e);} \n\n return status; \n }",
"private void delete()\n\t{\n\t\ttry\n\t\t{\n\t\t\tConnection con = Connector.DBcon();\n\t\t\tString query = \"select * from items where IT_ID=?\";\n\t\t\t\n\t\t\tPreparedStatement pst = con.prepareStatement(query);\n\t\t\tpst.setString(1, txticode.getText());\n\t\t\tResultSet rs = pst.executeQuery();\n\t\t\t\n\t\t\tint count = 0;\n\t\t\twhile(rs.next())\n\t\t\t{\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\n\t\t\tif(count == 1)\n\t\t\t{\n\t\t\t\tint choice = JOptionPane.showConfirmDialog(null, \"Are you sure you want to delete selected item data?\", \"ALERT\", JOptionPane.YES_NO_OPTION);\n\t\t\t\tif(choice==JOptionPane.YES_OPTION)\n\t\t\t\t{\n\t\t\t\t\tquery=\"delete from items where IT_ID=?\";\n\t\t\t\t\tpst = con.prepareStatement(query);\n\t\t\t\t\t\n\t\t\t\t\tpst.setString(1, txticode.getText());\n\t\t\t\t\t\n\t\t\t\t\tpst.execute();\n\t\t\t\t\t\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Deleted Successfully\", \"RESULT\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tloadData();\n\t\t\t\t\n\t\t\t\trs.close();\n\t\t\t\tpst.close();\n\t\t\t\tcon.close();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Record Not Found!\", \"Alert\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\n\t\t\trs.close();\n\t\t\tpst.close();\n\t\t\tcon.close();\n\t\t\t\n\t\t} \n\t\tcatch (Exception e)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, e);\n\t\t}\n\t}",
"int deleteByPrimaryKey(String idTipoPersona) throws SQLException;",
"int deleteByPrimaryKey(Long catalogId);",
"int deleteByPrimaryKey(String loginuuid);",
"public void clearDatabase();",
"int deleteByPrimaryKey(Integer actPrizeId);",
"public void delete_database() {\n //deletes file and by doing so all the tables\n File file = new File(url);\n String path = \"..\" + File.separator + file.getPath();\n File file_path = new File(path);\n file_path.delete();\n }",
"int deleteByPrimaryKey(String EQP_MODEL_ID);",
"int deleteByPrimaryKey(Long idreg);",
"int deleteByPrimaryKey(Short act_id);",
"int deleteByPrimaryKey(String idTipoComprobante) throws SQLException;",
"int deleteByPrimaryKey(Integer idenfermedad);",
"public static void clearAppList() {\n }",
"public static org.oep.ssomgt.model.Application deleteApplication(\n\t\torg.oep.ssomgt.model.Application application)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getService().deleteApplication(application);\n\t}",
"int deleteByPrimaryKey(Integer deviceId);",
"public void delete() {\r\n\t\tfor (int i = 0; i <= DatabaseUniverse.getDatabaseNumber(); i++) {\r\n\t\t\tif (this.equals(DatabaseUniverse.getDatabases(i))) {\r\n\t\t\t\tDatabaseUniverse.getAllDatabases().set(i, null);\r\n\t\t\t\tDatabaseUniverse.getAllDatabases().remove(i);\r\n\t\t\t\tDatabaseUniverse.setDatabaseNumber(-1);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"int deleteByPrimaryKey(Integer code);",
"@Override\n public void removeGameApp(Handle<GameAppContext> that) \n {\n manager.removeGameApp(that);\n }",
"int deleteByPrimaryKey(Long integralBookId);",
"int deleteByPrimaryKey(Long moepId);",
"int deleteByPrimaryKey(Integer adminId);",
"int deleteByPrimaryKey(String thingid);",
"int deleteByPrimaryKey(String vendorid);",
"public abstract void delete(Context context);",
"int deleteByPrimaryKey(String taxregcode);",
"int deleteByPrimaryKey(Long id_access);",
"public void delete() {\n\t\ttry {\n\t\t\tStatement stmt = m_db.m_conn.createStatement();\n\t\t\tString sqlString;\n\t\t\tString ret;\n\n\t\t\tsqlString = \"DELETE from country WHERE countryid=\" + m_country_id;\n\t\t\tm_db.runSQL(sqlString, stmt);\n\t\t\tstmt.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\">>>>>>>> EXCEPTION <<<<<<<<\");\n\t\t\tSystem.out.println(\"An Exception occured in delete().\");\n\t\t\tSystem.out.println(\"MESSAGE: \" + e.getMessage());\n\t\t\tSystem.out.println(\"LOCALIZED MESSAGE: \" + e.getLocalizedMessage());\n\t\t\tSystem.out.println(\"CLASS.TOSTRING: \" + e.toString());\n\t\t\tSystem.out.println(\">>>>>>>>>>>>>-<<<<<<<<<<<<<\");\n\t\t}\n\t}",
"@Override\n\tpublic int deleteAll() {\n\t\treturn SApplicationcategorydao.executeHql(\"delete from \"+tablename);\n\t}",
"@RequestMapping(\"/deleteAppusers\")\n\tpublic String deleteAppusers(@RequestParam Integer appuseridKey) {\n\t\tAppusers appusers = appusersDAO.findAppusersByPrimaryKey(appuseridKey);\n\t\tappusersService.deleteAppusers(appusers);\n\t\treturn \"forward:/indexAppusers\";\n\t}",
"int deleteByPrimaryKey(Integer actId);",
"@Override\n\tpublic void delete(String... args) throws SQLException {\n\t\t\n\t}",
"int deleteByPrimaryKey(Integer pkid);",
"int deleteByPrimaryKey(Integer pkid);",
"int deleteByPrimaryKey(String shoppingCartId);",
"int deleteByPrimaryKey(String samId);",
"int deleteByPrimaryKey(Long personId);"
] | [
"0.80331963",
"0.7566021",
"0.7294765",
"0.7093077",
"0.70611614",
"0.6920802",
"0.69194186",
"0.6892417",
"0.6806691",
"0.6788675",
"0.67451227",
"0.66989297",
"0.6696177",
"0.6686048",
"0.65894526",
"0.65825945",
"0.65550554",
"0.6503635",
"0.6474643",
"0.64638233",
"0.64447814",
"0.64414227",
"0.6398266",
"0.6396879",
"0.6382538",
"0.6351512",
"0.6314081",
"0.6252542",
"0.62343323",
"0.6223928",
"0.6208912",
"0.62008744",
"0.6188842",
"0.6186639",
"0.61829627",
"0.61816895",
"0.61538",
"0.61484236",
"0.6134873",
"0.6113155",
"0.61092836",
"0.60931444",
"0.60897326",
"0.6087698",
"0.60809076",
"0.6073062",
"0.60705745",
"0.60669774",
"0.60650206",
"0.60629576",
"0.60622907",
"0.60605913",
"0.60591274",
"0.6044712",
"0.60181206",
"0.60160714",
"0.60131884",
"0.6008326",
"0.60076785",
"0.60055643",
"0.60021466",
"0.5999181",
"0.5999181",
"0.59951925",
"0.5989666",
"0.59887844",
"0.5987262",
"0.5978495",
"0.59752494",
"0.5972531",
"0.5971529",
"0.59678876",
"0.59666777",
"0.59574705",
"0.59572834",
"0.5953142",
"0.5949306",
"0.5948121",
"0.5935858",
"0.59319985",
"0.5931729",
"0.59281075",
"0.5925727",
"0.59226304",
"0.59212226",
"0.5920865",
"0.59206665",
"0.5918573",
"0.591321",
"0.59112257",
"0.59079117",
"0.5904397",
"0.59011173",
"0.58967644",
"0.5888151",
"0.5872876",
"0.5872876",
"0.5869367",
"0.58662856",
"0.5865762"
] | 0.7500062 | 2 |
/ INFO: This method will reset the verion of app in Database. INPUT: NULL RETURN: VOID | public void updateAppVersion(String appVersion, String appName) throws SQLException {
String dburl = prop.getProperty("dburl");
String dbuser = prop.getProperty("dbuser");
String dbpw = prop.getProperty("dbpw");
methods_snw.updateAppVersionOnWeb(dburl, dbuser, dbpw, appVersion, appName);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void resetApp() {\n\t\tSession.inResetMode = true;\n\t\t// Stopping alarm and GPS services at reset.\n\t\t// MyAlarmService.cancelMyAlarmService(this.getApplicationContext());\n\t\tif (Sw_LoginScreenActivity.this.stopService(new Intent(Sw_LoginScreenActivity.this, MyAlarmService.class))) {\n\t\t\tMyAlarmService.running = false;\n\t\t\tLog.w(\"Snowboard\", \"MyAlarmService stopped due to application reset.\");\n\t\t} else {\n\t\t\tLog.e(\"Snowboard\", \"Failed to stop MyAlarmService in application reset.\");\n\t\t}\n\n\t\tif (Sw_LoginScreenActivity.this.stopService(new Intent(Sw_LoginScreenActivity.this, GPSService.class))) {\n\t\t\tLog.w(\"Snowboard\", \"GPSService stopped due to application reset.\");\n\t\t} else {\n\t\t\tLog.e(\"Snowboard\", \"Failed to stop GPSService in application reset.\");\n\t\t}\n\n\t\ttry {\n\t\t\tDataBaseHelper myDbHelper = new DataBaseHelper(Sw_LoginScreenActivity.this);\n\t\t\ttry {\n\t\t\t\t// Deleting Previous Database.\n\t\t\t\tmyDbHelper.dbDelete();\n\t\t\t} catch (Exception ioe) {\n\t\t\t\tLog.e(TAG, \"Unable to delete database\");\n\t\t\t}\n\t\t\tLog.i(TAG, \"DB Deleted\");\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// clear preferences\n\t\teditor.clear();\n\t\teditor.commit();\n\n\t\teditor.putBoolean(Config.IS_RESET_KEY, true);\n\t\teditor.putString(Config.SERVER_URL_KEY, NetworkUtilities.BASE_URL);\n\t\teditor.commit();\n\n\t\t// Recalling this activity\n\t\tstartActivity(new Intent(Sw_LoginScreenActivity.this, Sw_LoginScreenActivity.class));\n\t\tfinish();\n\t}",
"void resetApp();",
"public static boolean resetDB(Context context) {\n openDBIfClosed(context);\n try {\n mMetaDb.execSQL(\"DROP TABLE IF EXISTS languages;\");\n Log.i(AnkiDroidApp.TAG, \"Resetting all language assignment\");\n mMetaDb.execSQL(\"DROP TABLE IF EXISTS whiteboardState;\");\n Log.i(AnkiDroidApp.TAG, \"Resetting whiteboard state\");\n mMetaDb.execSQL(\"DROP TABLE IF EXISTS customDictionary;\");\n Log.i(AnkiDroidApp.TAG, \"Resetting custom Dictionary\");\n mMetaDb.execSQL(\"DROP TABLE IF EXISTS widgetStatus;\");\n Log.i(AnkiDroidApp.TAG, \"Resetting widget status\");\n mMetaDb.execSQL(\"DROP TABLE IF EXISTS smallWidgetStatus;\");\n Log.i(AnkiDroidApp.TAG, \"Resetting small widget status\");\n mMetaDb.execSQL(\"DROP TABLE IF EXISTS intentInformation;\");\n Log.i(AnkiDroidApp.TAG, \"Resetting intentInformation\");\n upgradeDB(mMetaDb, DATABASE_VERSION);\n return true;\n } catch (Exception e) {\n Log.e(\"Error\", \"Error resetting MetaDB \", e);\n }\n return false;\n }",
"public void resetDB()\n\t{\n\t\tshutdown();\n\t\t\n\t\tif(Files.exists(m_databaseFile))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tFiles.deleteIfExists(m_databaseFile);\n\t\t\t} catch (IOException e)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t\t\n\t\tloadDatabase();\n\t\tupdateCommitNumber();\n\t\tupdateDatabase();\n\t}",
"@RequestMapping(\"reset\")\n\tpublic @ResponseBody\n\tString resetDB() {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tList<SwapItem> items = dao.findAll();\n\t\tfor (SwapItem item : items) {\n\t\t\tint result = dao.delete(item);\n\t\t\tbuffer.append(result).append(\" / \");\n\t\t}\n\t\treturn buffer.toString();\n\t}",
"public void wipeDatabaseData() {\n\t\tdbHelper.onUpgrade(database, 0, 1);\n\t}",
"private static void clearDB()\n {\n if(getStatus().equals(\"no database\"))\n return;\n\n clearTable(\"myRooms\");\n clearTable(\"myReservations\");\n }",
"@Override\r\n\tpublic void clearDatabase() {\n\t\t\r\n\t}",
"public void clearDatabase();",
"private void updateDB() {\n }",
"public static boolean resetIntentInformation(Context context) {\n if (mMetaDb == null || !mMetaDb.isOpen()) {\n openDB(context);\n }\n try {\n Log.i(AnkiDroidApp.TAG, \"Resetting intent information\");\n mMetaDb.execSQL(\"DROP TABLE IF EXISTS intentInformation;\");\n openDB(context);\n return true;\n } catch (Exception e) {\n Log.e(\"Error\", \"Error resetting intentInformation \", e);\n }\n return false;\n }",
"public void reset() {\r\n id = -1;\r\n username = \"\";\r\n password = \"\";\r\n password2 = \"\";\r\n firstName = \"\";\r\n lastName = \"\";\r\n phoneNumber = \"\";\r\n email = \"\";\r\n address = \"\";\r\n socialSecurityNumber = \"\";\r\n creditCard = \"\";\r\n }",
"public void resetAppData() {\n this.materials = new ArrayList<String>();\n this.shoplistGroc = new ArrayList<String>();\n this.shopListMat = new ArrayList<String>();\n this.pantry = new ArrayList<String>();\n this.unassignedChores = new ArrayList<Chore>();\n this.finishedChores = new ArrayList<Chore>();\n this.regUsers= new ArrayList<User>();\n this.adminUsers= new ArrayList<AdminUser>();\n this.currentUserId = 0;\n this.serialNumber = 1;\n }",
"@Override\r\n\tpublic int reset() throws NotesApiException {\n\t\treturn 0;\r\n\t}",
"public void resetDB(SQLiteDatabase db) {\n db.execSQL(SQL_DELETE_ENTRIES);\n onCreate(db);\n }",
"private void resetApp() {\n\t\tthis.panelTags.setVisible(false);\n\t\tthis.panelMenu.setVisible(true);\n\t\tthis.model.clear();\n\t\tthis.btnClearAll.doClick(0);\n\t\t// textDestination jest czyszczony osobno, po JOptionPane\n\t\t// this.textDestination.setText(null);\n\t\tthis.btnDeleteAll.setEnabled(false);\n\t\tthis.btnDelete.setEnabled(false);\n\t}",
"public void resetTables() {\n SQLiteDatabase db = this.getWritableDatabase();\n // Delete All Rows\n db.delete(TABLE_LOGIN, null, null);\n db.close();\n }",
"public void resetTables(){\r\n try {\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n // Delete All Rows\r\n db.delete(User.TABLE_USER_NAME, null, null);\r\n db.close();\r\n }catch(SQLiteDatabaseLockedException e){\r\n e.printStackTrace();\r\n }\r\n }",
"public synchronized void resetOrdenDBList() {\n ordenDBList = null;\n }",
"@Override\r\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_MACHINE);\r\n\r\n // Create tables again\r\n onCreate(db);\r\n }",
"private void restartApplication() {\n android.os.Process.killProcess(android.os.Process.myPid());\r\n System.exit(0);\r\n }",
"public void reset() {\n\t\tappTda_ = new ApplicationTda();\n\t\t\n\t\t// get the associated settings\n\t\tprocessData_ = appTda_.getSettings();\n\t}",
"public static void resetADBServerRestartedMode() {\n mADBServerRestartedMode = false;\n }",
"public void resetDatabaseState(String databaseName, boolean defaultDatabase) {\n versionSource.clearAllExecutedScripts();\n\n List<Script> allScripts = scriptSource.getAllUpdateScripts(dialect, databaseName, defaultDatabase);\n for (Script script : allScripts) {\n versionSource.registerExecutedScript(new ExecutedScript(script, new Date(), true));\n }\n }",
"public void wipeDB() {\n\t\tSQLiteDatabase db = nodeData.getReadableDatabase();\n\t\tdb.delete(EventDataSQLHelper.TABLE, null, null);\n\t\tdb.close();\n }",
"public static boolean resetLanguages(Context context) {\n if (mMetaDb == null || !mMetaDb.isOpen()) {\n openDB(context);\n }\n try {\n Log.i(AnkiDroidApp.TAG, \"Resetting all language assignments\");\n mMetaDb.execSQL(\"DROP TABLE IF EXISTS languages;\");\n openDB(context);\n return true;\n } catch (Exception e) {\n Log.e(\"Error\", \"Error resetting MetaDB \", e);\n }\n return false;\n }",
"private void rollBackApplication() {\n //reset application data\n \t this.reset();\n\n log (\"Rolled back application data, current commit counter: \" + commitCounter);\n }",
"@Override\n\tpublic int updApp(ApplicationEntity App) {\n\t\tint id=App.A_id;\n\t\tString zt=null;\n\t\tApplicationEntity app=appdao.selectappById(id);\n\t\tif(\"0\".equals(app.A_state)){\n\t\t\t zt=\"1\";\n\t\t\t\n\t\t}\n\t\tApplicationEntity app1=new ApplicationEntity();\n\t\tapp1.A_state=zt;\n\t\tapp1.A_id=id;\n\t\treturn appdao.updapp(app1);\n\t}",
"private static void removeDB()\n {\n if(getStatus().equals(\"no database\"))\n return;\n\n dropTable(\"myRooms\");\n dropTable(\"myReservations\");\n }",
"private void handleClearDB() {\n try {\n ContentResolver contentResolver = this.mContext.getContentResolver();\n contentResolver.delete(KeyguardNotification.URI, null, null);\n contentResolver.notifyChange(KeyguardNotification.URI, null);\n } catch (Exception e) {\n Log.e(\"KeyguardNotifHelper\", \"handleClearDB\", e);\n }\n }",
"private ServerError updateDatabase() {\n return updateDatabase(WebConf.DB_CONN, WebConf.JSON_OBJECTS, WebConf.DEFAULT_VERSION);\r\n }",
"@Override\n public void updateDatabase() {\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n Log.d(TAG, \"update sqlite database\");\n int version = oldVersion;\n if (version < 8) {\n version = 8;\n }\n if (version != DATABASE_VERSION) {\n Log.d(TAG, \"destorying all old data\");\n db.execSQL(\"DROP TABLE IF EXISTS \" + Tables.DAILY_RANK);\n db.execSQL(\"DROP TABLE IF EXISTS \" + Ranks.TABLE_NAME);\n db.execSQL(\"DROP TABLE IF EXISTS \" + ManualList.TABLE_NAME);\n db.execSQL(\"DROP TABLE IF EXISTS \" + Apps.TABLE_NAME);\n onCreate(db);\n }\t\n }",
"public void deletedb()\n {\n this.appContext.deleteDatabase(DB_NAME);\n Log.d(\"testdeletedb\",\"done\");\n }",
"public static void reset() {\n Castle.userId(null);\n Castle.flush();\n }",
"public void reset(){\n paycheckController.reset();\n }",
"private void cmdReset() throws NoSystemException {\n fSession.reset();\n }",
"public void reset() {\n context.reset();\n state = State.NAME;\n }",
"void reseed();",
"public void clearDatabase(){\n\t\tem.createNativeQuery(\"DELETE FROM CAMINHO\").executeUpdate();\r\n\t\tem.createNativeQuery(\"DELETE FROM MAPA\").executeUpdate();\r\n\t\t\r\n\t\tlog.info(\"Limpou a base de dados\");\r\n\t\r\n\t}",
"private void hardReset() {\n softReset();\n // variables\n recordLap = 0; // force first query on database after race restart\n trackName = null;\n // ui\n recordLapTView.setText(\"--:--:---\");\n trackTView.setText(\"Track location\");\n carTView.setText(\"Car\");\n Log.d(TAG, \"HARD Reset: main menu\");\n }",
"void changeDatabase(String databaseName);",
"public void resetContactsTable(){\r\n try {\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n // Delete All Rows\r\n db.delete(Contacts.TABLE_CONTACTS, null, null);\r\n db.close();\r\n }catch(SQLiteDatabaseLockedException e){\r\n e.printStackTrace();\r\n }\r\n }",
"public void setUp() {\n deleteTheDatabase();\n }",
"public void setUp() {\n deleteTheDatabase();\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\n Log.w(TAG, \"Ažuriranje verzije baze podataka sa \" + oldVersion + \" na verziju \"\n + newVersion + \", a to će uništiti postojeće podatke\");\n db.execSQL(\"DROP TABLE IF EXISTS single_page_table\");\n db.execSQL(\"DROP TABLE IF EXISTS top_apps_table \");\n db.execSQL(\"DROP TABLE IF EXISTS virtual_games_table \");\n db.execSQL(\"DROP TABLE IF EXISTS quiz_games_table \");\n db.execSQL(\"DROP TABLE IF EXISTS math_games_table \");\n db.execSQL(\"DROP TABLE IF EXISTS casual_games_table \");\n db.execSQL(\"DROP TABLE IF EXISTS coloring_pages_table \");\n db.execSQL(\"DROP TABLE IF EXISTS do_not_miss_table \");\n\n ///SINGLE\n db.execSQL(\"DROP TABLE IF EXISTS single_page_table \");\n\n //TESTIMONIALS\n db.execSQL(\"DROP TABLE IF EXISTS testimonials \");\n\n\n onCreate(db);\n }",
"private void initialize() {\n if (databaseExists()) {\n SharedPreferences prefs = PreferenceManager\n .getDefaultSharedPreferences(mContext);\n int dbVersion = prefs.getInt(SP_KEY_DB_VER, 1);\n if (DATABASE_VERSION != dbVersion) {\n File dbFile = mContext.getDatabasePath(DBNAME);\n if (!dbFile.delete()) {\n Log.w(TAG, \"Unable to update database\");\n }\n }\n }\n if (!databaseExists()) {\n createDatabase();\n }\n }",
"public void clearDatabase() {\n\t\tstudentRepository.deleteAll();\n\t}",
"@Override\r\n public void onTerminate() {\n \r\n dataManager.closeDb();\r\n selectedBook = null;\r\n super.onTerminate();\r\n }",
"public void reset ()\n {\n final String METHOD_NAME = \"reset()\";\n this.logDebug(METHOD_NAME + \" 1/2: Started\");\n super.reset();\n this.lid = null;\n this.refId = Id.UNDEFINED;\n this.fromDocType = DocType.UNDEFINED;\n this.logDebug(METHOD_NAME + \" 2/2: Done\");\n }",
"private void resetAfterGame() {\n }",
"static void resetTestDatabase() {\n String URL = \"jdbc:mysql://localhost:3306/?serverTimezone=CET\";\n String USER = \"fourthingsplustest\";\n\n InputStream stream = UserStory1Test.class.getClassLoader().getResourceAsStream(\"init.sql\");\n if (stream == null) throw new RuntimeException(\"init.sql\");\n try (Connection conn = DriverManager.getConnection(URL, USER, null)) {\n conn.setAutoCommit(false);\n ScriptRunner runner = new ScriptRunner(conn);\n runner.setStopOnError(true);\n runner.runScript(new BufferedReader(new InputStreamReader(stream)));\n conn.commit();\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n System.out.println(\"Done running migration\");\n }",
"public void deleteUserData(){\n buttonResetDb.setOnClickListener(\n new View.OnClickListener(){\n @Override\n public void onClick(View view) {\n app_db.truncateAllFactTables();\n Toast.makeText(MainActivity.this, \"DB Cleansed\", Toast.LENGTH_LONG).show();\n resetMainActivity();\n }\n }\n );\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_ESTABLISHMENT);\n\n // Create Tables again\n onCreate(db);\n }",
"public void reset() \n {\n try \n {\n // your code here\n \tSystem.out.println(\"Resetting virtual machine '\"+vm.getName() +\"'. Please wait...\"); \n \tTask t=vm.resetVM_Task();\n \tif(t.waitForTask()== Task.SUCCESS)\n \t{\n\t \tSystem.out.println(\"Virtual machine reset.\");\n\t \tSystem.out.println(\"====================================\");\n \t}\n \telse\n \t\tSystem.out.println(\"Reset failed...\");\n } \n catch ( Exception e ) \n { \n \tSystem.out.println( e.toString() ) ; \n }\n }",
"public void resetStore() {\n try {\n db.close();\n uncommited = null;\n uncommitedDeletes = null;\n autoCommit = true;\n bloom = new BloomFilter();\n utxoCache = new LRUCache(openOutCache, 0.75f);\n } catch (IOException e) {\n log.error(\"Exception in resetStore.\", e);\n }\n\n File f = new File(filename);\n if (f.isDirectory()) {\n for (File c : f.listFiles())\n c.delete();\n }\n openDB();\n }",
"@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(DROP_USER_TABLE);\n // db.execSQL(DR);\n\n // Create tables again\n onCreate(db);\n\n }",
"public static boolean resetDb(Database db) {\n\t\tSystem.out.println(\"Eliminazione schema...\");\n\t\tif (db.deleteAll())\n\t\t\tSystem.out.println(\"OK!\");\n\t\telse \n\t\t\tSystem.out.println(\"Errore\");\n\t\t\n\t\tSystem.out.println(\"Creazione tabelle...\");\n\t\tif (db.createTable())\n\t\t\tSystem.out.println(\"OK!\");\n\t\telse\n\t\t\tSystem.out.println(\"Errore\");\n\t\t\n\t\tSystem.out.println(\"Aggiunta valori di esempio...\");\n\t\tif (db.valoriEsempio())\n\t\t\tSystem.out.println(\"OK!\");\n\t\telse\n\t\t\tSystem.out.println(\"Errore\");\n\t\t\n\t\tSystem.out.println(\"Creazione triggers...\");\n\t\tif (db.creaTriggers())\n\t\t\tSystem.out.println(\"OK!\");\n\t\telse\n\t\t\tSystem.out.println(\"Errore\");\n\t\t\n\t\tSystem.out.println(\"Creazione indici...\");\n\t\tif (db.creaIndici())\n\t\t\tSystem.out.println(\"OK!\");\n\t\telse\n\t\t\tSystem.out.println(\"Errore\");\n\t\t\n\t\tSystem.out.println(\"Aggiunta turno di oggi...\");\n\t\tif (db.nuovoTurno(Database.getOggi()))\n\t\t\tSystem.out.println(\"OK!\");\n\t\telse\n\t\t\tSystem.out.println(\"Errore\");\n\t\t\n\t\tSystem.out.println(\"Aggiunta dipendente al turno 1...\");\n\t\tif (db.aggiungiDipendenteAlTurno(\"ABCDFG89T23G312T\", 1))\n\t\t\tSystem.out.println(\"OK!\");\n\t\telse\n\t\t\tSystem.out.println(\"Errore\");\n\t\t\n\t\tSystem.out.println(\"Aggiunta evento 1 al turno 1...\");\n\t\tif (db.aggiungiEventoAlTurno(1, 1))\n\t\t\tSystem.out.println(\"OK!\");\n\t\telse\n\t\t\tSystem.out.println(\"Errore\");\n\t\t\n\t\treturn true;\n\t}",
"void dropDatabase();",
"public void deleteDB(){\n \t\tSQLiteDatabase db = this.getWritableDatabase();\n \t\tdb.execSQL(\"DROP TABLE IF EXISTS user\");\n \t\tdb.execSQL(\"DROP TABLE IF EXISTS poll\");\n \t\tdb.execSQL(\"DROP TABLE IF EXISTS time\");\n \t\tdb.execSQL(\"DROP TABLE IF EXISTS status\");\n \t\tonCreate(db);\n \t}",
"private void resetGame(){\n\n }",
"public static void reset() {\n Set<Map.Entry<Class<?>, DatabaseDefinition>> entrySet = globalDatabaseHolder.databaseClassLookupMap.entrySet();\n for (Map.Entry<Class<?>, DatabaseDefinition> value : entrySet) {\n value.getValue().reset(getContext());\n }\n globalDatabaseHolder.reset();\n loadedModules.clear();\n }",
"public void reset(){\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm -r data/games_module\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"sed -i \\\"1s/.*/ \"+\"0\"+\" /\\\" data/winnings\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"sed -i \\\"1s/.*/ \"+\"175\"+\" /\\\" data/tts_speed\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm data/answered_questions\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm data/five_random_categories\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm data/current_player\");\n\t\t_currentPlayer = null;\n\t\t_internationalUnlocked = false;\n\t\t_gamesData.clear();\n\t\t_fiveRandomCategories.clear();\n\t\tfor (int i= 0; i<5;i++) {\n\t\t\t_answeredQuestions[i]=0;\n\t\t}\n\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/answered_questions\");\n\t\tinitialiseCategories();\n\t\ttry {\n\t\t\treadCategories();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tsetFiveRandomCategories();\n\t}",
"public static void tearDown() {\n reset();\n clear();\n APIConfig.getInstance().setAppId(null, null);\n APIConfig.getInstance().setDeviceId(null);\n APIConfig.getInstance().setToken(null);\n APIConfig.getInstance().setUserId(null);\n Leanplum.setApplicationContext(null);\n }",
"public void destroyDatabase(){\n \n \t\t//Make sure database exist so you don't attempt to delete nothing\n \t\tmyDB = openOrCreateDatabase(dbFinance, MODE_PRIVATE, null);\n \n \t\t//Make sure database is closed before deleting; not sure if necessary\n \t\tif (myDB != null){\n \t\t\tmyDB.close();\n \t\t}\n \n \t\ttry{\n \t\t\tthis.deleteDatabase(dbFinance);\n \t\t}\n \t\tcatch(Exception e){\n \t\t\tToast.makeText(this, \"Error Deleting Database!!!\\n\\n\" + e, Toast.LENGTH_LONG).show();\n \t\t}\n \n \t\t//Navigate User back to dashboard\n \t\tIntent intentDashboard = new Intent(Options.this, Main.class);\n \t\tintentDashboard.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n \t\tstartActivity(intentDashboard);\n \n \t}",
"private void resetPattenIfNeeded() {\n if (KeyguardCfg.isBackupPinEnabled() && getSecurityMode() == SecurityMode.PIN && this.mLockPatternUtils.isLockPatternEnabled(KeyguardUpdateMonitor.getCurrentUser())) {\n Intent ai = new Intent(\"com.android.settings.action.HW_RESET_NEW_PASSWORD\");\n ai.setFlags(268435456);\n OsUtils.startUserActivity(this.mContext, ai);\n }\n }",
"@SuppressLint(\"WrongConstant\")\n public void cleanDB(View view) {\n\n SQLiteDatabase CDB = openOrCreateDatabase(\n \"CDB.db\"\n , SQLiteDatabase.CREATE_IF_NECESSARY\n , null\n );\n\n CDB.execSQL(\"DROP TABLE IF EXISTS t_Anglais\");\n CDB.execSQL(\"DROP TABLE IF EXISTS t_Allemand\");\n CDB.execSQL(\"DROP TABLE IF EXISTS t_Espagnol\");\n\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);\n SharedPreferences.Editor EDITOR = preferences.edit();\n EDITOR.putBoolean(\"FST_LAUNCH\", true);\n EDITOR.putString(\"TAG_LIST\", \"EMPTY_NULL\");\n EDITOR.putBoolean(\"NEED_UPD_01\", true);\n EDITOR.commit();\n\n Intent i = new Intent ( this, LoadingScreenDisplay.class );\n startActivity( i );\n finish();\n\n }",
"public Database initDB() {\n Database db = new Database(\"dataBase.db\");\n\n// db.insertData(\"1 Dragos Dinescu [email protected] 0744522600 Digi 10-12-2020\");\n// db.insertData(\"2 Adelina Mirea [email protected] 0733651320 Orange 14-10-2020\");\n// db.insertData(\"3 Radu Sorostinean [email protected] 0733723321 Digi 1-10-2020\");\n// db.insertData(\"4 Andrei Brasoveanu [email protected] 0732341390 Vodafone 12-11-2020\");\n return db;\n\n //db.deleteFromDB();\n //db.updateDB(\"1 alex radu [email protected] 022256926 orange 10/08/2010\");\n }",
"public void onClick(DialogInterface dialog, int whichButton) {\n try {\n AppDbSQLiteHelper.initDefaultEntries(db);\n } catch (Exception e) {\n e.printStackTrace();\n Utils.setToast(currentActivity, getResources().getString(R.string.error_db_restart),\n Toast.LENGTH_LONG);\n return;\n }\n Utils.setToast(currentActivity, getResources().getString(R.string.success_db_restart),\n Toast.LENGTH_LONG);\n }",
"@Override\n public void reDownloadDB(String newVersion)\n {\n }",
"@Override\n\tpublic int updblu(ApplicationEntity App) {\n\t\tint id=App.A_id;\n\t\tString zt=null;\n\t\tApplicationEntity app=appdao.selectappById(id);\n\t\tif(\"0\".equals(app.A_state)){\n\t\t\t zt=\"2\";\n\t\t\t\n\t\t}\n\t\tApplicationEntity app1=new ApplicationEntity();\n\t\tapp1.A_state=zt;\n\t\tapp1.A_id=id;\n\t\treturn appdao.updapp(app1);\n\t}",
"public void reset() {\n serverReset(game.generateUIDs(data.getObjectCount()));\n }",
"public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)\r\n {\r\n // This database is only a cache for online data, so its upgrade policy is\r\n // to simply to discard the data and start over\r\n\r\n Log.i(\"oncreatecall\",\"onupgradecalled\");\r\n db.execSQL(\"DROP TABLE IF EXISTS \" + DatabaseContract.tableDefinition.TABLE_NAME);\r\n onCreate(db);\r\n\r\n Toast.makeText(null,\"upgrade is called\",Toast.LENGTH_SHORT).show();\r\n //basically delete and start over.\r\n }",
"public void resetCigs() {\n user.resetCigs();\n saveData();\n }",
"public void reset() {\n\n\t}",
"@Override\n public void onUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion) {\n try {\n Message.logMessages(\"onUpgrade :\",\"onUpgrade() called\");\n sqLiteDatabase.execSQL(DROP_TABLE);\n onCreate(sqLiteDatabase);\n } catch (SQLException e) {\n Message.logMessages(\"Error in onUpgrade :\",\"\"+e);\n }\n }",
"public static void resetSaveCounter4(Context context) {\n prefs = context.getSharedPreferences(\"com.mobile.counterappmobile\", context.MODE_PRIVATE);\n SaveCounter4 = prefs.getInt(saveCounter4, 0);\n SaveCounter4=0;\n prefs.edit().putInt(saveCounter4, SaveCounter4).commit();\n\n }",
"@Override\r\n protected void onPause() {\n\tsuper.onPause();\r\n\tstrategy.deleteDataBase();\r\n }",
"@Override\n public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i2) {\n sqLiteDatabase.execSQL(\"DROP TABLE IF EXISTS \"+ AccompanimentData.CreateDB._TABLENAME);\n sqLiteDatabase.execSQL(\"DROP TABLE IF EXISTS \"+ MelodyData.CreateDB._TABLENAME);\n onCreate(sqLiteDatabase);\n }",
"private void resetTwoStage() {\n PrefUtils.setInstallDate(System.currentTimeMillis(), mContext);\n PrefUtils.setInstallDays(0, mContext);\n PrefUtils.setEventCount(0, mContext);\n PrefUtils.setLaunchCount(0, mContext);\n PrefUtils.setStopTrack(false, mContext);\n }",
"public void reset() {\n\r\n\t}",
"public void resetConversationFlow(){\n conversationDao.init();\n }",
"public static boolean RepairDB(Options options, String name) {\n return false;\n }",
"private void resetPassword() {\n AdminKeyFile keyFile = new AdminKeyFile(instance);\n keyFile.read();\n if (keyFile.isReset()) {\n String password = AdminKeyFile.randomPassword(\n AdminKeyFile.RANDOM_PASSWORD_LENGTH); \n instance.setAdminPassword(password);\n keyFile.setPassword(password);\n try {\n PayaraInstance.writeInstanceToFile(instance);\n } catch(IOException ex) {\n LOGGER.log(Level.INFO,\n \"Could not store Payara server attributes\", ex);\n }\n keyFile.write();\n }\n }",
"public void reset() {\n\n }",
"private static void upgradeFrom_1_to_2(SQLiteDatabase db) {\r\n Logger.info(Logger.Type.GHOST_SMS, \"*** Upgrade database from version [%s] to version [%s]\", VERSION_1, CURRENT_VERSION);\r\n\r\n //1- do migrations\r\n db.execSQL(Parameters.QUERY_CREATE);\r\n db.execSQL(Versions.QUERY_CREATE);\r\n //2- update application version value\r\n Versions.update(db, Names.GHOST_SMS, VERSION_1, VERSION_2);\r\n }",
"@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}",
"public void uptadeDB(){\n //mainDatabase.modifyStaff(this);\n }",
"public void reset() {\n\t\t\t\t\r\n\t\t\t}",
"public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(blockedAppsContract.SQL_DELETE_APPS);\r\n onCreate(db);\r\n }",
"public void verarbeite() {\n\t\t\r\n\t}",
"public void reset()\n\t{\n\t}",
"public void reset()\n\t{\n\t}",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int old_version, int new_vesion) \n\t{\n\t\tdb.execSQL(\"DROP TABLE IF EXIST \" + this.TBL_INSTITUCIONES);\t\t \n\t\tonCreate(db);\n\t}",
"@Override\n public void onCreate() {\n super.onCreate();\n if(!FirebaseApp.getApps(this).isEmpty()) {\n FirebaseDatabase.getInstance().setPersistenceEnabled(true);\n }\n appInstance = this;\n\n\n\n }",
"public static void resetSaveCounter5(Context context) {\n prefs = context.getSharedPreferences(\"com.mobile.counterappmobile\", context.MODE_PRIVATE);\n SaveCounter5 = prefs.getInt(saveCounter5, 0);\n SaveCounter5=0;\n prefs.edit().putInt(saveCounter5, SaveCounter5).commit();\n\n }",
"private void reset() {\n \t resultCount =0;\n\t searchStatus = 0;\n\t resultSetStatus = 0;\n\t errorCode = 0;\n\t errorMsg = \"None provided\";\n\t Present = null;\n\t dbResults = null;\n oclc7= null;\n oclc8 = null;\n requestLength=0;\n responseLength=0;\n }",
"@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\t db.execSQL(\"DROP TABLE IF EXISTS \" + DATABASE_TABLE1);\n\t\t onCreate(db);\n\t}"
] | [
"0.6957856",
"0.69246364",
"0.68103445",
"0.6668602",
"0.6450354",
"0.6188914",
"0.61219364",
"0.6115564",
"0.5985617",
"0.58701354",
"0.58643246",
"0.58604723",
"0.5854303",
"0.5840103",
"0.582643",
"0.5812813",
"0.5809973",
"0.58065647",
"0.5776783",
"0.5763217",
"0.5742316",
"0.5731425",
"0.57094353",
"0.5698073",
"0.5696226",
"0.56845474",
"0.56675225",
"0.56334275",
"0.56275773",
"0.56197375",
"0.5603161",
"0.55757314",
"0.55512506",
"0.55487925",
"0.55445147",
"0.5538807",
"0.5529825",
"0.5527934",
"0.55223364",
"0.5512113",
"0.55088395",
"0.54990697",
"0.54990655",
"0.5482769",
"0.5482769",
"0.54774714",
"0.54736894",
"0.5443472",
"0.5442891",
"0.5441746",
"0.5433722",
"0.5427238",
"0.54219365",
"0.54181063",
"0.5414799",
"0.54088366",
"0.5402223",
"0.5401895",
"0.5399682",
"0.53989035",
"0.5398307",
"0.53971744",
"0.5396691",
"0.53846675",
"0.5380392",
"0.5375735",
"0.5371361",
"0.53707427",
"0.53707206",
"0.53665185",
"0.5361904",
"0.53575766",
"0.5341126",
"0.53299326",
"0.53279144",
"0.5326815",
"0.5326246",
"0.53254443",
"0.53166217",
"0.53124523",
"0.53062373",
"0.5293401",
"0.5283774",
"0.52770793",
"0.5276155",
"0.527318",
"0.5261301",
"0.5261301",
"0.5261301",
"0.5261301",
"0.52608943",
"0.5259227",
"0.52521354",
"0.5251102",
"0.52479416",
"0.52479416",
"0.5247342",
"0.5245778",
"0.5241846",
"0.52409905",
"0.52408445"
] | 0.0 | -1 |
INFO: This method will click the history tab on admin portal. | public void clickHistoryTab(){
History_Tab.click();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void clickOrderHistoryLink()\n\t{\n \telementUtils.performElementClick(wbOrderHistoryLink);\n\t}",
"public void clickFreeDaysHistoryMenu() {\r\n\t\tfreeDaysHistoryButton.click();\r\n\t}",
"public void AdminLink(){\n\t\tAdminLink.click();\n\t}",
"public void clickAdminTab() throws Exception {\n\t\twdriver.findElement(By.xpath(locators.clickAdminTab)).click();\n\n\t}",
"void onHistoryButtonClicked();",
"@Test(priority=1)\n public void adminPage(){\n\t\tdriver.findElement(By.xpath(\"/html/body/div[1]/nav/a[5]\")).click();\n\t}",
"private void openHistoryManagementWindow() {\r\n\t\tnew JFrameHistory(this.jFrameMainWindow.getUser());\r\n\t}",
"@UiHandler(\"history\")\n public void showHistory (ClickEvent event){\n \tshowHistory();\n }",
"public void showHistory(){\n \tif (historyExample==null) historyExample = new HistoryExample();\n setWidgetAsExample(historyExample);\n }",
"public void clickDashboardLink() {\n this.action.click(this.dashboardLink);\n }",
"protected void intentBrowsingHistory() {\n \t// TODO accessTokenの取得がBookmarkとかぶる部分共通に‥\n \n \t// ログイン状態か確認。Cookie制御は確認済かつ表示前にチェックが走るのでここでは確認しない。\n \tString accessToken = null;\n String refreshToken = null;\n try {\n SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);\n accessToken = settings.getString(ACCESS_TOKEN, null);\n refreshToken = settings.getString(REFRESH_TOKEN, null);\n } catch (Exception e) {\n //\n }\n \n if (isNotEmpty(accessToken) && isNotEmpty(refreshToken)) { \n \tIntent intent = new Intent(this, BrowsingHistoryList.class);\n \tstartActivity(intent);\n } else {\n Intent loginIntent = new Intent(this, UserLogin.class);\n startActivityForResult(loginIntent, APL_REQUEST_BROWSINGHISTORY);\n }\n \t\n \t\n }",
"public void clickHomeIconOnAdmin() {\n\t\texecuteJavascript(\"document.getElementById('nav-home').getElementsByTagName('i')[1].click()\");\n\t\twait.waitForStableDom(250);\n\t\texecuteJavascript(\"document.getElementById('nav-home').getElementsByTagName('i')[0].click()\");\n\t\tlogMessage(\"User clicks on Home page icon on admin portal\");\n\t}",
"public void clickChannelsAdminLink() throws UIAutomationException{\r\n\t\telementController.requireElementSmart(fileName,\"Channels Admin\",GlobalVariables.configuration.getAttrSearchList(), \"Channels Admin\");\r\n\t\tUIActions.click(fileName,\"Channels Admin\",GlobalVariables.configuration.getAttrSearchList(), \"Channels Admin\");\r\n\t\t\r\n\t\t// Assertion : Check Title of Page\r\n \tString title=dataController.getPageDataElements(fileName, \"Admin Page Title\", \"Title\");\r\n \tUIActions.waitForTitle(title,Integer.parseInt(GlobalVariables.configuration.getConfigData().get(\"TimeOutForFindingElementSeconds\")));\r\n\t}",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tstartActivity(new Intent(\"comp.history.BHA\"));\n\t\t\t}",
"public void clickOnHome() {\n\t\twait.waitForStableDom(250);\n\t\tisElementDisplayed(\"link_home\");\n\t\twait.waitForElementToBeClickable(element(\"link_home\"));\n\t\texecuteJavascript(\"document.getElementById('doctor-home').getElementsByTagName('i')[0].click();\");\n//\t\t element(\"link_home\").click();\n\t\tlogMessage(\"user clicks on Home\");\n\t}",
"public void switchToHistory() {\r\n\t\thistoryPane.addEditTabs(editTabs);\r\n\t\tlayout.show(this, \"historyPane\");\r\n\t\trevalidate();\r\n\t\trepaint();\r\n\t}",
"public void afterClickHistory(View view) {\n }",
"@Given(\"click tab {string}\")\n public void clickEarlyAccessTab(String string) {\n $(page_objects.AdminPage.EarlyAccessTab).click();\n }",
"public void backToHome(){\n logger.debug(\"click on Back to Home button\");\n driver.findElement(oBackToHome).click();\n }",
"public void showHistorySwitchAction() {\n\t\tanimalsListPanel.switchToPast();\n\t}",
"public void botaohistory(View v) {\n startActivity(new Intent(this, com.example.appstore.history.class));\n }",
"public void click_dashboardMenu_button() {\n\t\tdashboardMenu.click();\n\t}",
"public static void navigateAdminLoginPage() {\n Browser.driver.get(\"http://shop.pragmatic.bg/admin\");\n }",
"@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tfinal WebHistory history=engine.getHistory();\r\n\t\t ObservableList<WebHistory.Entry> entryList=history.getEntries();\r\n\t\t int currentIndex=history.getCurrentIndex();\r\n//\t\t Out(\"currentIndex = \"+currentIndex);\r\n//\t\t Out(entryList.toString().replace(\"],\",\"]\\n\"));\r\n\t\t\t if(history.getCurrentIndex()<entryList.size()-1){\r\n\t\t\t \r\n\t\t Platform.runLater(new Runnable() { public void run() { history.go(1); } });\r\n\t\t System.out.println(entryList.get(currentIndex<entryList.size()-1?currentIndex+1:currentIndex).getUrl());\r\n\t\t\t}\r\n\t\t}",
"public void clickHistory(View v){\n\tIntent intent = new Intent(TimedWorkout.this, History.class);\n\tintent.putExtra(\"EXERCISE_NAME\", dayName);\n\tintent.putExtra(\"EXERCISE_TYPE\", 3);\n\tstartActivity(intent);\n}",
"public void openHistory() {\n usingHistoryScreen = true;\n myActivity.setContentView(R.layout.history);\n Button historyButtonToGame = myActivity.findViewById(R.id.button8);\n TextView historyText = myActivity.findViewById(R.id.textView46);\n historyText.setText(state.getHistory());\n historyText.setMovementMethod(new ScrollingMovementMethod());\n gui.invalidate();\n historyButtonToGame.setOnClickListener(\n new View.OnClickListener() {\n public void onClick(View v) {\n ShogiHumanPlayer.this.setAsGui(myActivity);\n usingHistoryScreen = false;\n if (state != null) {\n receiveInfo(state);\n }\n }\n });\n }",
"default public void clickHome() {\n\t\tremoteControlAction(RemoteControlKeyword.HOME);\n\t}",
"@Given(\"click tab {string}\")\n public void clickTab(String string) {\n $(page_objects.AdminPage.EarlyAccessTab).click();\n }",
"protected void callHome() {\n\t\tIntent intent = new Intent(this, AdminHome.class);\r\n\t\tstartActivity(intent);\r\n\t}",
"public void clickHome(){\n try{\n Thread.sleep(500);\n new WebDriverWait(this.driver, 15)\n .until(ExpectedConditions.elementToBeClickable(this.home)).click();\n } catch (Exception e){\n System.out.println(e.getMessage());\n }\n }",
"protected void clickOnNouveauClient() {\n\t\t\t_currentPage = ((DoliTiersPage)_currentPage).clickOnNouveauClient();\n\t\t}",
"public void clickAccountsLink()\n\t{\n \telementUtils.performElementClick(wbAccountsLink);\n\t}",
"public void ClickAccount() {\n if (lnkAccount.isDisplayed()) {\n lnkAccount.click();\n }\n else{System.out.println(\"Account link is not displayed\");}\n }",
"public void gotoAdminLogin(){ application.gotoAdminLogin(); }",
"public void ClickNotesAndMessagesPage() {\r\n\t\tnotesandmessages.click();\r\n\t\t\tLog(\"Clicked the \\\"Notes and Messages\\\" button on the Birthdays page\");\r\n\t}",
"public void onBottomNavHomeClick(View view){\n Intent intent = new Intent(user_history_activity.this, MainActivity.class);\n startActivity(intent);\n }",
"@Override\r\n\t\tpublic void onClick(ClickEvent event) {\n\t\t\tRootPanel.get(\"details\").clear();\r\n\t\t\thome = new AdminDashboardForm();\r\n\t\t\tRootPanel.get(\"details\").add(home);\r\n\t\t}",
"public void clickBackButton() {\n\t\tbackButton.click();\n\n\t}",
"public void clickOnEngagementLink() {\n getLogger().info(\"Click on engagement link\");\n try {\n waitForClickableOfElement(eleEngagementLink, \"Wait for click on engagement link\");\n clickElement(eleEngagementLink, \"Click on engagement\");\n NXGReports.addStep(\"Verify click on engagement link \", LogAs.PASSED, null);\n } catch (Exception ex) {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"Verify click on engagement link \", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n }",
"public static void goTo() {\n Browser.driver.get(\"https://www.abv.bg/\");\n Browser.driver.manage().window().maximize();\n }",
"public void clickEditLink() {\r\n\t\tbtn_EditLink.click();\r\n\t}",
"@Test\n public void electionListButton_onClick_navigatesToElectionListPage() {\n driver.get(\"http://localhost:9876\");\n\n Assert.assertEquals(1, driver.getWindowHandles().size());\n\n WebElement electionListButton = driver.findElement(By.id(\"show-elections-button\"));\n electionListButton.click();\n\n Assert.assertEquals(\"http://localhost:9876/electionlist.html\", driver.getCurrentUrl());\n }",
"public void clickCreateAccLink()\n\t{\n \telementUtils.performElementClick(wbCreateAccLink);\n\t}",
"@Then(\"^user clicks on new customer tab$\")\n\tpublic void user_clicks_on_new_customer_tab() {\n\t driver.findElement(By.xpath(\"//a[@href='addcustomerpage.php']\")).click();\n\t \n\t}",
"public void clickOnExploreEuropeLink() throws Exception {\n\t\tif (TestBase.flag_Mob) {\n\t\t\tscrollDown();\n\t\t\tclickUsingJavaScript(HomePageLocators.getExploreEuropeLnk());\n\t\t}\n\t\telse {\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}",
"HtmlPage clickLink();",
"public static void goTo() {\n\tBrowser.instance.findElement(maintenanceMenu).click();\r\n\tWebElement element = Browser.instance.findElement(By.linkText(\"Tender and Bag Maintenance\"));\r\n Actions action = new Actions(Browser.instance);\r\n action.moveToElement(element).build().perform(); \r\n Browser.instance.findElement(By.linkText(\"Bag Types\")).click();\r\n // WebDriverWait wait = new WebDriverWait(Browser.instance,10);\r\n WebDriverWait wait = new WebDriverWait(Browser.instance,10);\r\n\twait.until(ExpectedConditions.elementToBeClickable(editButton));\r\n//\tBrowser.instance.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n}",
"public static WebElement tab_clickExhibitorList() throws Exception{\r\n \ttry{\r\n \t\telement = driver.findElement(By.xpath(\"//a[contains(text(),'Exhibitor List')]\"));\r\n \t\tAdd_Log.info(\"Exhibitor List view tab is click on the page.\");\r\n \t\t\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.error(\"Supplier List view tab is NOT found on the page.\");\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }",
"default public void clickBack() {\n\t\tclickMenu();\n\t}",
"public static void main(String[] args) throws AWTException, InterruptedException {\n\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Users\\\\SatishPothu\\\\Downloads\\\\chromedriver_win32\\\\chromedriver.exe\");\r\n\t\t\r\n\t\tChromeDriver driver = new ChromeDriver();\r\n\t\tdriver.manage().window().maximize();\r\n\t driver.navigate().to(\"http://realestate.upskills.in/wp-admin/\");\r\n\t WebElement username = driver.findElement(By.id(\"user_login\"));\r\n\t WebElement password = driver.findElement(By.id(\"user_pass\"));\r\n\r\n\t username.sendKeys(\"admin\");\r\n\t password.sendKeys(\"adminuser@12345\");\r\n\t \r\n\t \r\n\t Actions ac = new Actions(driver);\t\r\n\t ac.sendKeys(Keys.ENTER).perform();\r\n\t \r\n WebElement link = driver.findElement(By.xpath(\"//a[text()='Howdy, ']\"));\r\n\t \r\n\t ac.contextClick(link).sendKeys(Keys.ARROW_DOWN).build().perform();\r\n\t Robot rob = new Robot();\r\n\t rob.keyPress(KeyEvent.VK_DOWN);\r\n\t Thread.sleep(2000);\r\n\t rob.keyPress(KeyEvent.VK_ENTER);\r\n\t Thread.sleep(2000);\r\n\t rob.keyPress(KeyEvent.VK_CONTROL);\r\n\t Thread.sleep(2000);\r\n\t rob.keyPress(KeyEvent.VK_TAB);\r\n\t Thread.sleep(2000);\r\n\t String url = driver.getCurrentUrl();\r\n\t System.out.println(url);\r\n\t rob.keyPress(KeyEvent.VK_CONTROL);\r\n\t Thread.sleep(2000);\r\n\t rob.keyPress(KeyEvent.VK_TAB);\r\n\t \r\n\t \r\n\t \r\n\t \r\n\t String url1 = driver.getCurrentUrl();\r\n\t System.out.println(url1);\r\n\t \r\n\t \r\n\t \r\n\t \r\n\t \r\n\t \r\n\t \r\n\t \r\n\t\t\t \r\n\t \r\n\t \r\n\t \r\n\t \r\n\t \r\n\t \r\n\t \r\n\r\n\t \r\n\t \r\n\t \r\n\t \r\n\r\n\t \r\n\t \r\n\t \r\n\t \r\n\t \r\n\t \t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public void clickCruisesTab() {\n\t\tcruisesTab.click();\n\t}",
"@Override\r\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tHistory.newItem(\"root-application\");\r\n\t\t\t}",
"public void clickOnPriorAuth() {\n\t\tscrollDown(element(\"link_priorAuth\"));\n\t\telement(\"link_priorAuth\").click();\n\t\tlogMessage(\"User clicks on Prior Authorizations on left navigation bar at Physician End\");\n\t}",
"HtmlPage clickSiteLink();",
"public void ClickAgentInformationPage() {\r\n\t\tagentinfo.click();\r\n\t\t\tLog(\"Clicked the \\\"Agent Information\\\" button on the Birthdays page\");\r\n\t}",
"public void Click_Customer_TAB()\r\n\t{\r\n\t\tdriver.findElement(Click_Customer_TAB).click();\r\n\t}",
"public void clickOnAccountSettingLink() {\r\n\t\tprint(\"Click on Account Setting Link\");\r\n\t\tlocator = Locator.MyTrader.Account_Setting.value;\r\n\t\tclickOn(locator);\r\n\t}",
"public void clickAgentTab() throws Exception {\n\t\twaitForElement.waitForElement(WebData.clickAgentTab);\n\t\twdriver.findElement(By.xpath(WebData.clickAgentTab)).click();\n\t}",
"@Test\n public void clickFaqLink() {\n homePage.clickAboutLink().clickFaqLink();\n }",
"public void invokeEvents() {\n\t\tIntent i = alertMe.createIntentFromSession();\n\t\ti.setClass(this, AlertMeEventHistory.class);\n\t\ti.putExtra(AlertMeConstants.INTENT_REQUEST_KEY, AlertMeConstants.INVOKE_HISTORY);\n startActivityForResult(i, AlertMeConstants.INVOKE_HISTORY);\n }",
"@And(\"^I clicked on \\\"([^\\\"]*)\\\" tab$\")\r\n\tpublic void clickonTab(String Acttab) throws Exception {\r\n\t\tenduser.click_Tab(Acttab);\r\n\t\tSystem.out.println(Acttab);\r\n\t \r\n\t}",
"@Test\r\n public void testHomePageButton() {\r\n WicketTester tester = new WicketTester(new GreenometerApplication());\r\n tester.startPage(StopLightPage.class);\r\n tester.assertRenderedPage(StopLightPage.class);\r\n\r\n tester.clickLink(\"HomePageButton\", false);\r\n tester.assertRenderedPage(GreenOMeterPage.class);\r\n }",
"default public void clickMenu() {\n\t\tremoteControlAction(RemoteControlKeyword.MENU);\n\t}",
"@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\n\t\t\t\t\tType = \"History\";\n\t\t\t\t\tTV_History.setTextColor(Color.parseColor(\"#FFCC00\"));\n\t\t\t\t\tTV_All.setTextColor(Color.parseColor(\"#FFFFFF\"));\n\t\t\t\t\tTV_Collect.setTextColor(Color.parseColor(\"#FFFFFF\"));\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\trefresh(getDate());\n\t\t\t\t\tmAdapter.notifyDataSetChanged();\n\t\t\t\t\t\n\t\t\t\t\tLog.i(\"---------------\", \"点击了历史\");\n\t\t\t\t}",
"public void Navigate_to_Registration_Page(){\n\n waitForVisibilityOfElement(RegistrationPageLocator.Registration_Tab_Home_Screen_Link_Text);\n Assert.assertTrue(getRegistrationTab_InHomeScreen().getText().equals(StringUtils.Registration_Tab_Text));\n getRegistrationTab_InHomeScreen().click();\n waitForVisibilityOfElement(RegistrationPageLocator.Registration_Form_Submit_Button);\n\n }",
"@Test\n public void testInChrome(){\n driver.get(\"http://localhost/litecart/admin/?app=catalog&doc=catalog&category_id=1\");\n //Do Login\n driver.findElement(By.name(\"username\")).sendKeys(\"admin\");\n driver.findElement(By.name(\"password\")).sendKeys(\"admin\");\n driver.findElement(By.name(\"login\")).click();\n wait.until(titleIs(\"Catalog | My Store\"));\n //Get list of products to be opened\n List<WebElement> listOfProducts = driver.findElements(By.cssSelector(\"td > a\"));\n int numberOfProducts = listOfProducts.size();\n for (int j = 3; j < numberOfProducts; j=j+2)\n {\n List<WebElement> listOfProducts2 = driver.findElements(By.cssSelector(\"td > a\"));\n String productName = listOfProducts2.get(j).getAttribute(\"textContent\");\n String pageName = \"Edit Product: \" + productName + \" | My Store\";\n listOfProducts2.get(j).click();\n //Log\n System.out.println(driver.manage().logs().getAvailableLogTypes());\n\n List<LogEntry> logRecords = driver.manage().logs().get(\"browser\").getAll();\n if (logRecords.size()==0)\n {\n System.out.println(\"No message in Browser Console\");\n }\n else\n {\n for (int i = 0; i < logRecords.size(); i++) {\n if ((logRecords.get(i).getLevel().equals(Level.SEVERE)) || (logRecords.get(i).getLevel().equals(Level.WARNING)) || (logRecords.get(i).getLevel().equals(Level.CONFIG)) || (logRecords.get(i).getLevel().equals(Level.INFO))|| (logRecords.get(i).getLevel().equals(Level.FINE)))\n {\n System.out.println(logRecords.get(i).getTimestamp() + \" \" + logRecords.get(i).getLevel() + \" \" + logRecords.get(i).getMessage());\n }\n else\n {\n System.out.println(logRecords.get(i).getTimestamp() + \" \" + \"No message in Browser Console\");\n }\n\n }\n }\n wait.until(titleIs(pageName));\n\n //Go back\n driver.findElement(By.name(\"cancel\")).click();\n wait.until(titleIs(\"Catalog | My Store\"));\n }\n\n }",
"public void backToFlights(){\n logger.debug(\"click on Back To Flights button\");\n driver.findElement(oBackToFlights).click();\n }",
"public static void clickBackBtn() {\t\n\t\ttry {\n\t\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"backquest\\\"]\")).click();\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\tSystem.out.println(\"Back button doesnt work\");\n\t\t}\n\t}",
"public DashBoardPage NavigateToMittICA()\n{\n\tif(Action.IsVisible(Master_Guest_Mitt_ICA_Link))\n\tAction.Click(Master_Guest_Mitt_ICA_Link);\n\telse\n\t\tAction.Click(Master_SignIN_Mitt_ICA_Link);\n\treturn this;\n}",
"public void showemplist() throws Exception {\n\t\t Log.info(\"*******started execution of showemplist() in TC_hrms_102***********\");\n\t\tActions action = new Actions(g.driver);\n\t\taction.moveToElement(g.driver.findElement(By.linkText(\"PIM\"))).perform();\n\t\tThread.sleep(3000);\n\t\t\n\t\t//clicking on addemployee submenu link\n\t\tg.driver.findElement(By.id(\"menu_pim_viewEmployeeList\")).click();\n\t\tThread.sleep(3000);\n\t\tSystem.out.println(\"Clicked on Employee List submenu\");\n\t\t Log.info(\"*******end of execution of showemplist() in TC_hrms_102***********\");\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent i = new Intent(HomeScreen.this, AddAdminScreen.class);\n\t\t\t startActivity(i);\n\t\t\t}",
"public void I_Should_click_My_Account_link(){\n\t MyAccountLink.click();\n\t \n}",
"public void navigateToDashboard() {\n String currentUrl = driver.getCurrentUrl();\n if(!currentUrl.contains(DashboardPageAddress)) {\n driver.navigate().to(baseUrl + DashboardPageAddress);\n }\n }",
"private void openPermissions(){\n WebDriverHelper.clickElement(seePermissionLvlButton);\n }",
"public void clickOnCEPortal() {\n if(CEPortal.isDisplayed()) {\n\t\twaitAndClick(CEPortal);\n\t }\n }",
"@When(\"I click on add to compare list link\")\n public void i_click_on_add_to_compare_list_link() {\n BasePage.driverUtils.waitForWebElementToBeClickable(BasePage.htcOneMiniBluePage.getHtcOneMiniBlueAddToCompareListButton());\n BasePage.htcOneMiniBluePage.getHtcOneMiniBlueAddToCompareListButton().click();\n }",
"public void goHome() {\r\n\t\tif (mActivity instanceof DashboardActivity) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfinal Intent intent = new Intent(mActivity, DashboardActivity.class);\r\n\t\tintent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n\t\tmActivity.startActivity(intent);\r\n\r\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent i = new Intent(activity, HistoricalActivity.class);\n\t\t\t\tstartActivity(i);\n\t\t\t}",
"public void clickOnMyTraderHomeIcon() {\r\n\t\tprint(\"Click on My Trader Home Icon\");\r\n\t\tlocator = Locator.MyTrader.MyTrader_Home.value;\r\n\t\tclickOn(locator);\r\n\t}",
"@And(\"^I goto Activation Page$\")\r\n\t\r\n\tpublic void I_goto_Activation_Page() throws Exception {\r\n\t\t\r\n\t\tenduser.click_activationTab();\r\n\t\t\r\n\t}",
"@Test\r\n public void testGridInfoButton() {\r\n WicketTester tester = new WicketTester(new GreenometerApplication());\r\n tester.startPage(StopLightPage.class);\r\n tester.assertRenderedPage(StopLightPage.class);\r\n\r\n tester.clickLink(\"GridInfoPageButton\", false);\r\n tester.assertRenderedPage(GridInfoPage.class);\r\n }",
"public void clickAddonLineActivity() {\r\n\t\tthis.clickAddOnlineActivity.click();\r\n\t}",
"public void click_defineSetupPage_backBtn() throws InterruptedException {\r\n\t\tclickOn(DefineSetup_backBtn);\r\n\t\tThread.sleep(1000);\r\n\t}",
"public void clickHelpLink()\n\t{\n \telementUtils.performElementClick(wbHelpLink);\n\t}",
"public void openEmployeesPage() {\n // Navigate to HumanResources > Employees through the left menu\n driver.findElement(By.cssSelector(\"div.group-items>fuse-nav-vertical-collapsable:nth-child(5)\")).click();\n driver.findElement(By.cssSelector(\"fuse-nav-vertical-collapsable:nth-child(5)>div.children>fuse-nav-vertical-item:nth-child(2)\")).click();\n }",
"@When(\"^the user open Automation Home page$\")\r\n\tpublic void the_user_open_Automation_Home_page() throws Throwable {\n\t w.Homepage1();\r\n\t}",
"@Before\n public void openNewStockPage() {\n onView(withId(R.id.button3)).perform(click());\n }",
"public void recordInProductHelpMenuItemClicked() {\n RecordUserAction.record(\"Android.ChromeHome.IPHMenuItemClicked\");\n }",
"protected void clickOnCreerClient() {\n\t\t\t_currentPage = ((DoliNouveauTiersPage)_currentPage).clickOnCreerClient();\n\t\t}",
"public void ClickPlansOfferedPage() {\r\n\t\tplansoffered.click();\r\n\t\t\tLog(\"Clicked the \\\"Plans Offered\\\" button on the Birthdays page\");\r\n\t}",
"public void back()\n\t{\n\t\tdriver.findElementById(OR.getProperty(\"BackButton\")).click();\n\t}",
"public void navigateToWomanCategory(){\n a = new Actions(driver);\n a.moveToElement(driver.findElement(By.cssSelector(\"div[id ='block_top_menu'] a[title='Women']\"))).build().perform();\n driver.findElement(By.cssSelector(\"ul[class='submenu-container clearfix first-in-line-xs'] li a[title='Casual Dresses'] \")).click();\n }",
"@Override\r\n\tpublic void goToShowList() {\n\t\t\r\n\t}",
"@Override\n public void onClick(View v) {\n Intent opnWebIntent = new Intent(getActivity(), WebViewActivity.class);\n opnWebIntent.putExtra(\"url\", \"http://www.mbtabackontrack.com/performance/index.html#/home\");\n startActivity(opnWebIntent);\n }",
"@Override\n public void onClick(View view) {\n Intent intent = new Intent(getContext(), Dashboard.class);\n startActivity(intent);\n }",
"public void clickOnProfile() {\n\t\telement(\"link_profile\").click();\n\t\tlogMessage(\"User clicks on Profile on left navigation bar\");\n\t}",
"public void openHomePage() {\n\t\tlogger.info(\"Opening Home Page\");\n\t\tdriver.get(ReadPropertyFile.getConfigPropertyVal(\"homePageURL\"));\n\t\t\n\t}",
"public void clickOnMenu() {\n\t\tgetAndroidmenubtn().isPresent();\n\t\tgetAndroidmenubtn().click();\n\t\twaitForPageToLoad();\n\t}",
"@Override\r\npublic void afterNavigateBack(WebDriver arg0) {\n\tSystem.out.println(\"as\");\r\n}",
"public static void main(String[] args) {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\selenium driver\\\\chromedriver_win32\\\\chromedriver.exe\");\n\t WebDriver driver= new ChromeDriver();\n\t driver.manage().window().maximize();\n\t driver.get(\"http://demoaut.com\");\n\t List<WebElement> linkNames = driver.findElements(By.tagName(\"a\"));\n\t System.out.println(\"Total No of links\"+linkNames.size());\n\t for(int i=0;i<linkNames.size();i++)\n\t {\n\t \t System.out.println(linkNames.get(i).getText());\n\t \t System.out.println(linkNames.get(i).getText());\n\t }\n\t \n\t driver.findElement(By.linkText(\"Hotels\")).click();\n\t String currentUrl=driver.getCurrentUrl();\n\t System.out.println(\"Current URL\"+currentUrl);\n\t \n\n\t}"
] | [
"0.7436185",
"0.7254325",
"0.6926967",
"0.67966485",
"0.67210686",
"0.6709324",
"0.6580368",
"0.6519598",
"0.64376885",
"0.63787335",
"0.6377543",
"0.63168323",
"0.6280441",
"0.62706196",
"0.6256873",
"0.6249192",
"0.6244019",
"0.62439734",
"0.6236546",
"0.6225168",
"0.62221545",
"0.62085503",
"0.6171393",
"0.61594504",
"0.6078042",
"0.60767794",
"0.60598093",
"0.60209733",
"0.60034454",
"0.59135085",
"0.590917",
"0.5894358",
"0.5889131",
"0.5879438",
"0.58777195",
"0.5868589",
"0.58680093",
"0.5860251",
"0.58583367",
"0.584326",
"0.58278257",
"0.58220637",
"0.58153814",
"0.58095306",
"0.57937396",
"0.5779136",
"0.5769088",
"0.5768657",
"0.5756281",
"0.57543635",
"0.5746333",
"0.5746137",
"0.57410115",
"0.5737034",
"0.5725035",
"0.5705043",
"0.57046294",
"0.5695235",
"0.5678201",
"0.5678075",
"0.56758094",
"0.56683034",
"0.56679505",
"0.5666222",
"0.5664857",
"0.56453735",
"0.564203",
"0.56404006",
"0.5614071",
"0.55745333",
"0.55702585",
"0.55691403",
"0.5567683",
"0.556498",
"0.5561256",
"0.55602336",
"0.5554386",
"0.55527145",
"0.5551551",
"0.55513674",
"0.5546227",
"0.5540379",
"0.5539709",
"0.5534559",
"0.55336195",
"0.55335134",
"0.55131674",
"0.551166",
"0.5509303",
"0.550254",
"0.54969454",
"0.5485489",
"0.5482653",
"0.5481481",
"0.5481362",
"0.5478108",
"0.54760534",
"0.5474714",
"0.5471331",
"0.5466404"
] | 0.8264235 | 0 |
/ INFO: This method will return current approval status with the approval date for the given app. INPUT: myAppName => String RETURN: boolean, true => 'enable', false => 'disable' | public boolean checkAppApproveStatus(String myAppName) {
System.out.println("Checking current account status for app" + myAppName);
boolean currentValue;
SimpleDateFormat sdfDate = new SimpleDateFormat("dd MMM yyyy");
Date now = new Date();
String strDate = sdfDate.format(now);
WebElement myAccount = getAccontDetails(myAppName);
WebElement myAccountField = myAccount.findElement(By.xpath("//*[@class='approve_notify']//span]"));
System.out.println(myAccountField.getText());
if (myAccountField.getText().contains("Approve") && myAccountField.getText().contains(strDate)) {
System.out.println("current approval status for app" + myAppName + "is approved");
currentValue = true;
} else {
System.out.println("current approval status for app" + myAppName + "is pending");
currentValue = false;
}
return currentValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean approveApp(String myAppName) {\n\t\tLog.info(\"Checking if App:\" + myAppName + \"came for approval\");\n\t\tWebElement myElement = getAppFromList(myAppName);\n\t\tif (myElement != null) {\n\t\t\tLog.info(myAppName + \"came for approval. Approving it now..\");\n\t\t\tWebElement approveButton = myElement.findElement(By.id(\"appsEditApprove\"));\n\t\t\tapproveButton.click();\n\t\t\tapp_confrim.click();\n\t\t\tif (getAccontDetails(myAppName) != null) {\n\t\t\t\tLog.info(myAppName + \"is approved now\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tLog.info(\"failed to approve\" + myAppName);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tLog.info(myAppName + \"did not showed up in approval list\");\n\t\t\treturn false;\n\t\t}\n\n\t}",
"public String getStatus()\r\n {\n return (\"1\".equals(getField(\"ApprovalStatus\")) && \"100\".equals(getField(\"HostRespCode\")) ? \"Approved\" : \"Declined\");\r\n }",
"public boolean checkCurrentOfferStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountOfferStatus = myAccount.findElement(By.className(\"adminTable4 \"));\n\t\tString elementPageSource = myAccountOfferStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" offer is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" offer is enabled Which is a deactivated app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"public boolean checkAccountStatus(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='adminTable2 ']\"));\n\t\tLog.info(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Inactive\") && myAccountField.getText().contains(strDate)) {\n\t\t\tLog.info(\"current account status for app\" + myAppName + \"is inactive\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(\"current account status for app\" + myAppName + \"is active\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public boolean isApproved();",
"public boolean isApproved();",
"public Date getDATE_APPROVED() {\r\n return DATE_APPROVED;\r\n }",
"public boolean isApproved()\n\t{\n\t\tif(response.containsKey(\"Result\")) {\n\t\t\tif(response.get(\"Result\").equals(\"APPROVED\")) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public boolean checkCurrentCampaianStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountCampaianStatus = myAccount.findElement(By.className(\"adminTable3\"));\n\t\tString elementPageSource = myAccountCampaianStatus.getAttribute(\"outerHTML\");\n\t\tboolean ifactive = checkAccountAction(myAppName);\n\t\tif (ifactive) {\n\t\t\tif (elementPageSource.contains(\"checked=\" + \"\\\"checked\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" compaign is enabled\");\n\t\t\t\tcurrentValue = true;\n\t\t\t} else {\n\t\t\t\tLog.info(myAppName + \" compaign is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t} else {\n\t\t\tif (elementPageSource.contains(\"disabled=\" + \"\\\"disabled\\\"\")) {\n\t\t\t\tLog.info(myAppName + \" compaign is disabled\");\n\t\t\t\tcurrentValue = false;\n\t\t\t} else {\n\t\t\t\tLog.error(myAppName + \" compaign is enabled Which is a deactivatd app\");\n\t\t\t\tcurrentValue = true;\n\t\t\t}\n\t\t\treturn currentValue;\n\t\t}\n\n\t}",
"public String getApprove() {\r\n if (approve == null)\r\n approve = initApproveElement().findElement(By.cssSelector(\"[data-role*='approvalStatus']\")).getText();\r\n return approve;\r\n }",
"public List<String> getEligibleForAutoApproval(Date todayAtMidnight);",
"@Override\n\tpublic boolean isApproved() {\n\t\treturn _scienceApp.isApproved();\n\t}",
"public boolean approveAppointment() {\n\t\tIHealthCareDAO dao = new HealthCareDAO();\r\n\t\treturn dao.approveAppointment();\r\n\t}",
"@Override\n\tpublic long getApprovedstatus() {\n\t\treturn _buySellProducts.getApprovedstatus();\n\t}",
"@SystemAPI\n\tboolean needsApproval();",
"public java.util.Date getApprovalDate () {\n\t\treturn approvalDate;\n\t}",
"List<String> viewPendingApprovals();",
"public String getApprovedFlag() {\r\n return (String) getAttributeInternal(APPROVEDFLAG);\r\n }",
"@Override\n\tpublic boolean isApproved();",
"public boolean isApproved() {\n return approved;\n }",
"public boolean isUserApproval() {\n\n if (!ACTION_UserChoice.equals(getAction())) {\n return false;\n }\n\n return (getColumn() != null) && \"IsApproved\".equals(getColumn().getColumnName());\n\n }",
"public String getCreativeApprovalStatus() {\r\n return creativeApprovalStatus;\r\n }",
"public Byte getApproveStatus() {\n return approveStatus;\n }",
"public boolean isApproved() {\n\t\treturn isApproved;\n\t}",
"public String getAPPROVED_BY() {\r\n return APPROVED_BY;\r\n }",
"private boolean doGetApproval() {\n\t\tcurrentStep = OPERATION_NAME+\": getting approval from BAMS\";\n\t\tif (!_atmssHandler.doDisDisplayUpper(SHOW_PLEASE_WAIT)) {\n\t\t\trecord(\"Dis\");\n\t\t\treturn false;\n\t\t}\n\t\tresult = _atmssHandler.doBAMSUpdatePasswd(newPassword, _session);\n\t\tif (result) {\n\t\t\trecord(\"password changed\");\n\t\t\treturn true;\n\t\t} else {\n\t\t\trecord(\"BAMS\");\n\t\t\tif (!_atmssHandler.doDisDisplayUpper(FAILED_FROM_BAMS_UPDATING_PW)) {\n\t\t\t\trecord(\"Dis\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tpause(3);\n\t\t\treturn false;\n\t\t}\n\t}",
"public boolean checkAccountAction(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue = false;\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement Tab = myAccount.findElement(By.className(\"adminTable5\"));\n\t\tString elementPageSource = Tab.getAttribute(\"outerHTML\");\n\t\tif (elementPageSource.contains(\"deactivate.png\")) {\n\t\t\tLog.info(myAppName + \" account is activated\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(myAppName + \" account is deactivated\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}",
"public boolean getAtmStatus();",
"@Override\n\tpublic boolean isApproved() {\n\t\treturn model.isApproved();\n\t}",
"cosmos.gov.v1beta1.ProposalStatus getStatus();",
"public String getApproval_Level() {\n return (String) getAttributeInternal(APPROVAL_LEVEL);\n }",
"public String approveRegistration() {\n\t\treturn \"Company approved\";\r\n\t}",
"public static URL getUrlForPostSetAppState()\r\n {\r\n String strUrl = getBaseURL() +\"account_services/api/1.0/application/app_status\";\r\n return str2url( strUrl );\r\n }",
"public boolean approveAppointment() {\n\t\tSet <String> set=(HealthCareDAO.map).keySet();\r\n\t\tint count=1;\r\n\t\tfor(String s:set)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"You have a center \"+map.get(s).getCenterName() +\"--\"+\"Center and id is \"+s);\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tSystem.out.println(\"Enter Center id :\");\r\n\t\tString str=scan.next();\r\n\t\tDiagnoisticCenter center=HealthCareDAO.map.get(str); //get Diagonistic object of given key \r\n\t\tList<Appointment> l=center.getAppointmentList();\r\n\t\t//System.out.println(l);\r\n\t\tint y=1;\r\n\t\tfor(Appointment a:l)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Enter Approval or disapproval\");\r\n\t\tboolean decision=scan.nextBoolean()\t;\r\n\t\t\ta.setApproved(decision);\r\n\t\t\tif(a.isApproved()==true)\r\n\t\t\t{\tSystem.out.println(\"Appointment id number \"+a.getAppointmentid()+\"---is Approved\");}\r\n\t\t\telse {System.out.println(\"Appointment id number \"+a.getAppointmentid()+\"---is not Approved\");}\r\n\t\t\ty++;\r\n\t\t\tif(y>3)\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t}\r\n\t\tcenter.setAppointmentList(l);\r\n\t\tSystem.out.println(\"Appointment List count :\"+l.size());\r\n\t\t\r\n\t\treturn false;\r\n\t}",
"public String checkPaymentStatus(Calendar calendar, LocalDate localdate) {\n String status = \"\";\n System.out.println(\"policy day is: \" + calendar.get(Calendar.DAY_OF_MONTH));\n System.out.println(\"policy year is: \" + calendar.get(Calendar.YEAR));\n System.out.println(\"current year is: \" + localdate.getYear());\n if ((localdate.getMonthValue() < (calendar.get(Calendar.MONTH) + 1))) {\n status = \"LATE\";\n }\n if ((localdate.getMonthValue() > (calendar.get(Calendar.MONTH) + 1))) {\n status = \"ON TIME\";\n }\n return status;\n }",
"@Override\n\tpublic java.util.Date getStatusDate() {\n\t\treturn _scienceApp.getStatusDate();\n\t}",
"@Test\n public void canGetApprovalsWithAutoApproveTrue() {\n addApproval(marissa.getId(), \"c1\", \"uaa.user\", 6000, APPROVED);\n addApproval(marissa.getId(), \"c1\", \"uaa.admin\", 12000, DENIED);\n addApproval(marissa.getId(), \"c1\", \"openid\", 6000, APPROVED);\n\n assertEquals(3, endpoints.getApprovals(\"user_id eq \\\"\"+marissa.getId()+\"\\\"\", 1, 100).size());\n\n addApproval(marissa.getId(), \"c1\", \"read\", 12000, DENIED);\n addApproval(marissa.getId(), \"c1\", \"write\", 6000, APPROVED);\n\n assertEquals(3, endpoints.getApprovals(\"user_id eq \\\"\"+marissa.getId()+\"\\\"\", 1, 100).size());\n }",
"io.opencannabis.schema.commerce.Payments.PaymentStatus getStatus();",
"public void setDATE_APPROVED(Date DATE_APPROVED) {\r\n this.DATE_APPROVED = DATE_APPROVED;\r\n }",
"public boolean isActiveLoan();",
"public LoanApplicationResponse approveLoanRequest() {\n return new LoanApplicationResponse(this, true);\n }",
"public void setApprovalDate (java.util.Date approvalDate) {\n\t\tthis.approvalDate = approvalDate;\n\t}",
"public String getApprover() {\n return approver;\n }",
"public int countByapproval_status(java.lang.String approval_status);",
"io.opencannabis.schema.commerce.CommercialOrder.OrderStatus getStatus();",
"io.opencannabis.schema.commerce.CommercialOrder.OrderStatus getStatus();",
"public static ProgramStatus getProgramStatus(String name) {\n return getProgramStatus(name, DEFAULT);\n }",
"public String AccountStatus() {\n\t\tString Online = \"//android.widget.TextView[@text='ONLINE']\";\n\t\tString ProfileStatus;\n\t\tboolean ObjectStatus = ObjectFoundorNot(Online);\n\t\tif(ObjectStatus == true) {\n\t\t\tProfileStatus = keypad.SelectAccountStatusOnline.getText();\n\t\t}\n\t\telse {\n\t\t\tProfileStatus = keypad.SelectAccountStatusOffline.getText();\n\t\t}\n\t\treturn ProfileStatus;\n\t}",
"@PostMapping(\"/addstatus\")\n\t\tpublic boolean addStatus(@RequestBody Approval approval)\n\t\t{\n\t\t\tboolean added=service.addStatus(approval);\n\t\t\tif(added)\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}",
"@RequestMapping(value = \"/approveDenyAppointment\", method = RequestMethod.GET)\n public String approveDenyAppointment()\n {\n return \"approveDenyAppointment\";\n }",
"public void setIsApproved (boolean IsApproved);",
"public void setIsApproved (boolean IsApproved);",
"public String getApprovalRuleName() {\n return this.approvalRuleName;\n }",
"List<ApparelProductModel> getProductsWithStatus(CatalogVersionModel catalogVersion, ArticleApprovalStatus productStatus);",
"public ArrayList<ApprovalInfo> getPendingApprovalRequests()\r\n\t{\r\n\t\tConnection conn=getConnection();\r\n\t\tArrayList<ApprovalInfo> approvalList=new ArrayList<ApprovalInfo>();\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\tResultSet rs = stmt.executeQuery(\"SELECT * FROM SOCIAL_EAI_APPROVAL WHERE APPROVAL_STATUS = 0\");\r\n\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tApprovalInfo approvalobj=new ApprovalInfo();\r\n\t\t\t\tapprovalobj.setSocial_ID(rs.getString(\"REQ_SOCIAL_ID\"));\r\n\t\t\t\tapprovalobj.setSocialEmail(rs.getString(\"REQ_SOCIAL_EMAIL\"));\r\n\t\t\t\tapprovalobj.setFirstName(rs.getString(\"REQ_FIRSTNAME\"));\r\n\t\t\t\tapprovalobj.setLastName(rs.getString(\"REQ_LASTNAME\"));\r\n\t\t\t\tapprovalobj.setApprovalStatus(rs.getInt(\"APPROVAL_STATUS\"));\r\n\t\t\t\tapprovalobj.setTime_Created(rs.getTimestamp(\"TIME_CREATED\"));\r\n\r\n\t\t\t\tapprovalList.add(approvalobj);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn approvalList;\r\n\t}",
"UserStatus getStatus();",
"boolean hasPlainApprove();",
"protected boolean isActive(String appName) {\n return appFile(appName, \"active\").exists();\n }",
"@Override\n\tpublic void applyObject(AppDeploymentRequest request, String appId) {\n\t\tif (client.builds().withLabels(labels).list().getItems().stream()\n\t\t\t\t.noneMatch(build -> {\n\t\t\t\t\tString phase = build.getStatus().getPhase();\n\t\t\t\t\treturn phase.equals(\"New\") || phase.equals(\"Pending\")\n\t\t\t\t\t\t\t|| phase.equals(\"Running\") || phase.equals(\"Failed\");\n\t\t\t\t})) {\n\t\t\t//@formatter:off\n client.deploymentConfigs()\n .withName(appId)\n .edit()\n .editMetadata()\n .addToAnnotations(SPRING_DEPLOYMENT_TIMESTAMP,\n\t\t\t\t\t\t\t\tString.valueOf(System.currentTimeMillis()))\n .endMetadata()\n .done();\n //@formatter:on\n\t\t}\n\t}",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.AuditingCompanyStatus.Enum getHasAuditingCompany();",
"private Boolean getStatusForPaid(final String status) {\n boolean flag = false;\n if (status.equalsIgnoreCase(PdfConstants.PAID)\n || status.equalsIgnoreCase(PdfConstants.RETURN_PENDING)\n || status.equalsIgnoreCase(PdfConstants.SCHEDULED_PENDING)\n || status.equalsIgnoreCase(PdfConstants.SCHEDULED_PROCESSING)\n || status.equalsIgnoreCase(PdfConstants.IN_PROCESS)\n || status.equalsIgnoreCase(PdfConstants.PENDING)) {\n flag = true;\n }\n return flag;\n }",
"public static String approveDeny(int leave_id,int empId,EnumLeaveStatus l_status) {\r\n Leave ld = Leave.listById(leave_id);\r\n String s=null;\r\n if (ld != null) {\r\n int noOfDays = ld.getNoLeaveDays();\r\n int emplId = ld.getEmployeeId();\r\n int empdId = Leave.showManager(leave_id);\r\n String dbStatus = null;\r\n System.out.println(l_status);\r\n System.out.println(ld.getLeaveStatus());\r\n if (empId != empdId) {\r\n s=\"You are not authorised to access this employee.\";\r\n return s;\r\n }\r\n if (l_status.equals(\"approved\") && ld.getLeaveStatus().equals(l_status.pending)) {\r\n dbStatus = \"approved\";\r\n edao().decrement(emplId, noOfDays);\r\n dao().comment( dbStatus, leave_id);\r\n s=\"Leave Approved Successfully\";\r\n \r\n } else if (l_status.equals(\"denied\") && ld.getLeaveStatus().equals(l_status.approved)) {\r\n dbStatus = \"denied\";\r\n edao().increment(emplId, noOfDays);\r\n dao().comment( dbStatus, leave_id);\r\n s=\"Leave Rejected\";\r\n } else if (l_status.equals(\"approved\") && ld.getLeaveStatus().equals(l_status.denied)) {\r\n dbStatus = \"approved\";\r\n edao().decrement(emplId, noOfDays);\r\n dao().comment(dbStatus, leave_id);\r\n s=\"Leave Approved Successfully\";\r\n } else {\r\n if (l_status.equals(\"denied\") && ld.getLeaveStatus().equals(l_status.pending)) {\r\n dbStatus = \"denied\";\r\n edao().increment(emplId, noOfDays);\r\n dao().comment( dbStatus, leave_id);\r\n s=\"Leave Rejected\";\r\n } else {\r\n s=\"Already on given status\";\r\n }\r\n }\r\n } else {\r\n s=\"Invalid LeaveId\";\r\n }\r\n return s;\r\n }",
"String getStatus();",
"String getStatus();",
"String getStatus();",
"String getStatus();",
"String getStatus();",
"com.google.ads.googleads.v6.resources.ChangeStatus getChangeStatus();",
"public java.util.Date getApproveExpenseDate () {\n\t\treturn approveExpenseDate;\n\t}",
"public String getAstatus() {\n return astatus;\n }",
"public void getApprovalInfo() {\n setLoadingText(\"正在获取新审批数据......\");\n Log.e(\"ApprovalInfo\", \"getting.\");\n approvalDataList = new ArrayList<ApprovalData>();\n approvalJsonList.add(new ApprovalJSONOperate(UID).setAct(this).getApprovalInfo(approvalDataList));\n }",
"List<Appointment> getCurrentlyAppointment();",
"public String getAutoApproveScopes() {\n return autoApproveScopes;\n }",
"public void switchAccountStatus(boolean userValue, String myAppName) {\n\t\tLog.info(\"Searching for current account status for app\" + myAppName);\n\t\tboolean currentValue = checkAccountAction(myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tif (userValue != currentValue) {\n\t\t\tLog.info(\"Chaging the current account status for app\" + myAppName);\n\t\t\tWebElement tab = myAccount.findElement(By.className(\"adminTable5\"));\n\t\t\tWebElement slider = tab.findElement(By.id(\"navButton\"));\n\t\t\tslider.click();\n\t\t\ttry {\n\t\t\t\tThread.sleep(10000);\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\tapp_confrim.click();\n\t\t} else {\n\t\t\tLog.info(myAppName + \"is already in desired state. No Action needed\");\n\t\t}\n\t}",
"public boolean getStatus(){\n return activestatus;\n }",
"public static String getStatus(Job job, Date date) {\n\t\tif (job.getEndDate().before(date) || job.getEndDate().equals(date))\n\t\t\treturn \"Finished\";\n\t\telse if ((job.getStartDate().before(date) || (job.getStartDate()\n\t\t\t\t.equals(date))) && (job.endDate.after(date)))\n\t\t\treturn \"In Progress\";\n\t\telse\n\t\t\treturn \"Pending\";\n\t}",
"@ApiModelProperty(value = \"Type of app end user is on\")\n public AppTypeEnum getAppType() {\n return appType;\n }",
"boolean hasAcquireDate();",
"@Override\n\tpublic int getStatus() {\n\t\treturn _scienceApp.getStatus();\n\t}",
"public boolean isOverdue(int today);",
"@Override\n\tpublic Date getStatusDate();",
"java.lang.String getStatus();",
"java.lang.String getStatus();",
"java.lang.String getStatus();",
"java.lang.String getStatus();",
"public DeploymentStatus getDeploymentStatus();",
"public boolean updateAppointment(Appointment app);",
"@External(readonly = true)\n\tpublic List<Address> get_approved_games() {\n\t\t\n\t\t Address[] _proposal_list = new Address[this.proposal_list.size()];\n\t\t int j = 0;\n\t\t for (int i = 0; i< this.proposal_list.size();i++ ) {\n\t\t\t Address address = this.proposal_list.get(i);\n\t\t\t String gameApproved = this.status_data.get(address);\n\t\t\t if (gameApproved!=null && gameApproved.equals(\"gameApproved\") ) {\n\t\t\t\t _proposal_list[j] = address;\n\t\t\t\t j++;\n\t\t\t }\n\t\t }\n\t\t Address[] tmp = new Address[j];\n\t\t System.arraycopy(_proposal_list, 0, tmp, 0, j);\n\t\t return List.of(tmp);\n\t}",
"public void setApprovedFlag(String value) {\r\n setAttributeInternal(APPROVEDFLAG, value);\r\n }",
"@Override\n\tpublic String viewApplicationStatus(int applicationId)\n\t\t\tthrows UniversityException {\n\t\tString status=null;\n\t\tstatus=dao.viewApplicationStatus(applicationId);\n\t\treturn status;\n\t}",
"public void autoApprove(int reimburseID, String autoReason, int status);",
"public boolean isAppUpdateInProgress(AppUpdateInfo appUpdateInfo) {\n return appUpdateInfo.updateAvailability()\n == UpdateAvailability.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS;\n }",
"boolean hasUserAppId();",
"boolean hasUserAppId();",
"private String getApprovalLink(Payment approvedPayment) {\n List<Links> links = approvedPayment.getLinks();\n String approvalLink = null;\n\n for (Links link : links) {\n if (link.getRel().equalsIgnoreCase(\"approval_url\")) {\n approvalLink = link.getHref();\n break;\n }\n }\n return approvalLink;\n }",
"private boolean isApproved() {\r\n if (rnd.nextInt(10) < 5) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n }",
"public static String arStringEquivalent(String s, Boolean isPastTense) {\n String displayString = null;\n if (s == null) {\n displayString = \"\";\n } else if (s.equals(AccessRequestHistoryItem.ACCESS_REQUEST_ACTION_APPROVE)\n && isPastTense) {\n displayString = \"Approved\";\n } else if (s.equals(AccessRequestHistoryItem.ACCESS_REQUEST_ACTION_DENY)\n && isPastTense) {\n displayString = \"Denied\";\n } else if (s.equals(AccessRequestHistoryItem.ACCESS_REQUEST_ACTION_REQUEST)\n && isPastTense) {\n displayString = \"Requested\";\n } else if (s.equals(AccessRequestStatusItem.ACCESS_RESPONSE_STATUS_APPROVED)) {\n displayString = \"Approved\";\n } else if (s.equals(AccessRequestStatusItem.ACCESS_RESPONSE_STATUS_DENIED)) {\n displayString = \"Denied\";\n } else if (s.equals(AccessRequestStatusItem.ACCESS_RESPONSE_STATUS_PI_APPROVED)) {\n //displayString = \"Approved by PI\";\n displayString = \"Pending approval by Data Provider\";\n } else if (s.equals(AccessRequestStatusItem.ACCESS_RESPONSE_STATUS_DP_APPROVED)) {\n //displayString = \"Approved by data provider\";\n displayString = \"Pending approval by PI\";\n } else if (s.equals(AccessRequestStatusItem.ACCESS_RESPONSE_STATUS_PI_DENIED)) {\n displayString = \"Denied by PI\";\n } else if (s.equals(AccessRequestStatusItem.ACCESS_RESPONSE_STATUS_DP_DENIED)) {\n displayString = \"Denied by data provider\";\n } else if (s.equals(AccessRequestStatusItem.ACCESS_RESPONSE_STATUS_NOT_REVIEWED)) {\n displayString = \"Not Reviewed\";\n } else if (s.equals(AuthorizationItem.LEVEL_EDIT)) {\n displayString = \"Edit\";\n } else if (s.equals(AuthorizationItem.LEVEL_VIEW)) {\n displayString = \"View\";\n } else if (s.equals(AuthorizationItem.LEVEL_ADMIN)) {\n displayString = \"Admin\";\n } else if (s.equals(\"requestor\")) {\n displayString = \"Requester\";\n } else if (s.equals(\"pi\")) {\n displayString = \"PI\";\n } else if (s.equals(\"dp\")) {\n displayString = \"Data provider\";\n } else if (s.equals(\"\")) {\n displayString = \"Public\"; //\"View (Public)\";\n } else {\n displayString = s;\n }\n return displayString;\n }",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.AuditingCompanyStatus xgetHasAuditingCompany();",
"AccessPoliciesStatus getAccessPoliciesStatus();",
"public List<String> getPaymentRequestInReceivingStatus();"
] | [
"0.67194295",
"0.6575146",
"0.656866",
"0.65003043",
"0.63033813",
"0.63033813",
"0.61856467",
"0.6139762",
"0.6108356",
"0.6099527",
"0.60697436",
"0.6068159",
"0.59776354",
"0.5966069",
"0.59423876",
"0.5930808",
"0.57989186",
"0.57931703",
"0.57350296",
"0.5723121",
"0.57081586",
"0.56797326",
"0.5665446",
"0.5637173",
"0.5627016",
"0.56161004",
"0.5467831",
"0.54402626",
"0.5405348",
"0.5401436",
"0.53919953",
"0.5379101",
"0.53590596",
"0.53512496",
"0.534675",
"0.53446084",
"0.53025264",
"0.52646124",
"0.5180328",
"0.51710194",
"0.5168023",
"0.51505214",
"0.5140731",
"0.51362914",
"0.51320606",
"0.51320606",
"0.5123185",
"0.5088897",
"0.5086738",
"0.50857544",
"0.50767475",
"0.50767475",
"0.50672764",
"0.50644714",
"0.50211257",
"0.501982",
"0.50167423",
"0.5009191",
"0.49872106",
"0.4973892",
"0.49438855",
"0.49374405",
"0.49297014",
"0.49297014",
"0.49297014",
"0.49297014",
"0.49297014",
"0.49271232",
"0.49065688",
"0.49037078",
"0.48959267",
"0.488926",
"0.48851246",
"0.48821723",
"0.48754752",
"0.487447",
"0.48676473",
"0.48656335",
"0.4864185",
"0.48620218",
"0.48573476",
"0.4850982",
"0.4850982",
"0.4850982",
"0.4850982",
"0.48509508",
"0.48500904",
"0.4848265",
"0.48341745",
"0.48316097",
"0.48105773",
"0.4809785",
"0.4809135",
"0.4809135",
"0.4801564",
"0.4800497",
"0.47999924",
"0.4798789",
"0.47984728",
"0.47969738"
] | 0.7939419 | 0 |
function to insert elements of the tree to map m | static void insertToHash(Node root, HashSet<Integer> s) {
if (root == null)
return;
insertToHash(root.left, s);
s.add(root.data);
insertToHash(root.right, s);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void treeMapDemo() {\n TreeMap intMap = new TreeMap();\n TreeMap abcMap = new TreeMap();\n \n // Add values to tMap\n intMap.put(1, \"Jonathan\");\n intMap.put(3, \"Kevin\");\n intMap.put(4, \"Craig\");\n \n abcMap.put(\"Name\", \"Jonathan\");\n abcMap.put(\"Age\", 26);\n abcMap.put(\"Hometown\", \"Denham Springs\");\n \n System.out.println(intMap.toString());\n \n System.out.println(abcMap.toString());\n \n // Add new value to fill the 2 position\n intMap.put(2, \"Jasmine\");\n \n // Add new value to abcMap\n abcMap.put(\"Acrobatic Skill\", \"Bad\");\n abcMap.put(\"Zoology Skill\", \"Decent\");\n \n System.out.println(intMap.toString());\n \n System.out.println(abcMap.toString());\n \n }",
"static void fillMap(TreeNode root, int d, int l) \n\t{ \n\t if(root == null) return; \n\t \n\t if(m.get(d) == null) \n\t { \n\t m.put(d, new PairNode(root.data, l)); \n\t } \n\t else if(m.get(d).second>l) \n\t { \n\t m.put(d, new PairNode(root.data, l)); \n\t } \n\t \n\t fillMap(root.left, d - 1, l + 1); \n\t fillMap(root.right, d + 1, l + 1); \n\t}",
"public void add(MapObject m){\n if (fits(m, x, y, width / 2, height / 2)) {\n //check if child tree exists to not overwrite it\n if (lu == null) {\n lu = new QuadTree(x, y, width / 2, height / 2);\n }\n lu.add(m);\n }else{\n if (fits(m,x, y + height/2, width/2, height/2)) {\n if (ld == null) {\n ld = new QuadTree(x, y + height/2, width/2, height/2);\n }\n ld.add(m);\n }else{\n if (fits(m, x + width/2, y, width/2, height/2)) {\n if (ru == null) {\n ru = new QuadTree(x + width/2, y, width/2, height/2);\n }\n ru.add(m);\n }else{\n if (fits(m, x + width/2, y + height/2, width/2, height/2)) {\n if (rd == null) {\n rd = new QuadTree(x + width/2, y + height/2, width/2, height/2);\n }\n rd.add(m);\n }else{\n //when map object does not fit in smaller sector, add it to parent\n //end of recursion\n containedObj.add(m);\n }\n }\n }\n }\n}",
"private static void treeMapMap(Map<Integer, String> treeMapMap) {\n System.out.println(\"----------------------------- TreeMap ----------------------------\");\n System.out.println(\"To work with \\\"TreeMap\\\" we need to add \\\"Equals and HashCode\\\" and \\\"Comparable\\\" to the Person Class!\");\n System.out.println(\"\\\"TreeMap\\\" is ordered by key\");\n treeMapMap.put(7, \"Cristiano Ronaldo\");\n treeMapMap.put(10, \"Leo Messi\");\n treeMapMap.put(8, \"Avi Nimni\");\n treeMapMap.put(24, \"Kobi Brian\");\n PrintUtils.printMap(treeMapMap);\n System.out.println();\n // STEP 2 - set p3 name to \"Moshe\"\n System.out.println(\"Set the name of player number 8 to be \\\"Moshe\\\":\");\n treeMapMap.replace(8, \"Avi Nimni\", \"Moshe\");\n // if you use \"put\" instead of \"replace\" it will work to!\n PrintUtils.printMap(treeMapMap);\n System.out.println();\n // STEP 3 - add p5 to the end of the list using using ADD method\n System.out.println(\"Add p5 to the end of the list using ADD method:\");\n System.out.println(\"Not an option!\");\n System.out.println();\n // STEP 4 - add p6 to position 3 the end of the list using ADD method\n System.out.println(\"Add p6 to position 3 the end of the list using ADD method:\");\n System.out.println(\"Not an option, you can wright over it!\");\n System.out.println();\n // STEP 5 - remove p2 from the list\n System.out.println(\"Remove p2 from the list and printing the list using a static method in a utility class:\");\n treeMapMap.remove(10, \"Leo Messi\");\n PrintUtils.printMap(treeMapMap);\n System.out.println();\n }",
"private void insertNodeIntoTree(Node node) {\n\t\troot = insert(root,node);\t\n\t}",
"@Override\r\n\tpublic void insert(Map<String, String> map) {\n\t\t\r\n\t}",
"void makeTree()\n \t{\n \t\t\t \n \t\tobj.insert(5,\"spandu\");\n \tobj.insert(4,\"anshu\");\n \tobj.insert(3,\"anu\");\n \tobj.insert(6,\"himani\");\n \t\t\n \t}",
"private void populate_tree(KDTree kdtree, ArrayList<Point> pointSet) {\n\t\tfor (Point p : pointSet) {\n\t\t\t\n\t\t\tArrayList<Double> coordinates = p.getCoordinates();\n\n\t\t\tdouble[] key = new double[coordinates.size()];\n\n\t\t\tfor (int i = 0; i < coordinates.size(); i++) {\n\t\t\t\tkey[i] = coordinates.get(i);\n\t\t\t}\n\n\t\t\tkdtree.insert(key, p);\n\t\t}\n\n\t}",
"public void createTree() {\n\t\taddNodeToParent(nodeMap);\n\t}",
"protected void insertFromLeaf(Node node, Page page){\n if(!node.isFull()){\n // basta inserir \n if (node instanceof Leaf){\n Entry e = new Entry<Page>(page.getKey(), page);\n node.inserir(e);\n }else{\n Entry e = new Entry<IntNode>(page.getKey());\n //e.setKey(node.getEntry(node.size-1).getKey());\n node.inserir(e);\n }\n\n }else{\n \n Node nodep;\n if(node instanceof Leaf){\n nodep = new Leaf(n);\n }else{\n nodep = new IntNode(n);\n }\n\n node.split(nodep);\n\n // a chave dessa entrada deve ser o maximo do left\n\n Node pai;\n Entry e1;\n if(!node.hasPai()){\n \n pai = new IntNode(n);\n \n int at = 0;\n if(node.size > 0){\n at = node.size-1;\n } \n\n e1 = new Entry<Node>(node.getEntry(at).getKey(), node, nodep);\n e1.setKey(node.getEntry(node.size-1).getKey());\n \n pai.inserir(e1);\n \n node.setPai((IntNode) pai);\n head = pai;\n \n }else{ \n pai = node.pai;\n e1 = new Entry<Node>(node.getKey(node.size - 1), node, nodep);\n \n pai.inserir(e1);\n }\n nodep.setPai((IntNode) pai);\n\n // decidindo se insere no node ou nodep\n int i = node.find(page.getKey());\n if(i >= node.size){\n nodep.inserir(e1);\n }else{ \n node.inserir(e1);\n }\n\n //down(pai, page);\n //insertFromLeaf(pai, page);\n }\n }",
"private void populate(Node father, TreeMap<Integer, TreeMap<Integer, Category>> categoriesMap){\n \t\tif (categoriesMap.containsKey(father.getCategory().getId())) {\n \t\t\tList<Category> temp = new ArrayList<Category>(categoriesMap.get(father.getCategory().getId()).values());\n \t\t\tfor (Category c : temp) {\n \t\t\t\tNode t = new Node(c);\n \t\t\t\tString index = father.getCategory().getIndex();\n \t\t\t\tif (father.getCategory() != null) {\n \t\t\t\t\tindex += \".\" + c.getIndex();\n \t\t\t\t}\n \t\t\t\tt.getCategory().setIndex(index);\n \t\t\t\tfather.addChild(t);\n \t\t\t}\n \t\t\tcategoriesMap.remove(father.getCategory().getId());\n \t\t\tfor (Node n : father.getChildren()) {\n \t\t\t\tpopulate(n, categoriesMap);\n \t\t\t}\n \t\t}\n \t}",
"public void insert(HuffmanTree node);",
"private static void fillupmap(Map<String, Object> m) {\n\t\tRectangle r =new Rectangle(\"A\",2,3);\r\n\t\tm.put(r.getRname(), r);\r\n\t\tr =new Rectangle(\"B\",4,1);\r\n\t\tm.put(r.getRname(), r);\r\n\t\tCircle c =new Circle(\"C\",3);\r\n\t\tm.put(c.getCname(),c);\r\n\t\tc =new Circle(\"D\",4);\r\n\t\tm.put(c.getCname(),c);\r\n\t\t\r\n\t}",
"public void insert(double key, Double value){\n\tif(search(key)!=null){\r\n\t\tLeaf Leaf = (Leaf)Search(root, key);\r\n\t\t\r\n\t\tfor(int i=0; i<Leaf.keyvalues.size(); i++) {\r\n\t\t\tif(key==Leaf.getKeyValue(i).getKey()) {\r\n\t\t\t\t\tLeaf.getKeyValue(i).values.add(value);\r\n\t\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tLeaf newleaf = new Leaf(key, value);\r\n\t\r\n\tPair<Double,Node> entry=new Pair<Double, Node>(key,newleaf);\r\n\r\n\tif(root == null ) {\r\n\t\troot = entry.getValue();\r\n\t}\r\n\t\r\n\r\n\tPair<Double, Node> newChildEntry = getChildEntry(root, entry, null);\r\n\t\r\n\tif(newChildEntry == null) {\r\n\t\treturn;\r\n\t} else {\r\n\t\tIntrnlNode newRoot = new IntrnlNode(newChildEntry.getKey(), root, newChildEntry.getValue());\r\n\t\troot = newRoot;\r\n\t\treturn;\r\n\t}\r\n}",
"static void insert(Node nd, int key)\n\t{\n\t\tif (nd == null) {\n\t\t\troot = new Node(key);\n\t\t\treturn;\n\t\t}\n\t\tQueue<Node> q = new LinkedList<Node>();\n\t\tq.add(nd);\n\n\t\t// Do level order traversal until we find an empty place\n\t\twhile (!q.isEmpty()) {\n\t\t\tnd = q.remove();\n\n\t\t\tif (nd.left == null) {\n\t\t\t\tnd.left = new Node(key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t\tq.add(nd.left);\n\n\t\t\tif (nd.right == null) {\n\t\t\t\tnd.right = new Node(key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t\tq.add(nd.right);\n\t\t}\n\t}",
"public void insert(T data){\n\t\troot = insert(data, root);\n\t}",
"Integer insertByMap(Map mapParams);",
"@SuppressWarnings({\"unchecked\", \"rawtypes\"})\n private void populateMap(Map map, Node node) {\n Map.Entry entry = getMapEntry(node);\n if (entry != null) {\n map.put(entry.getKey(), entry.getValue());\n }\n }",
"public void add(T t) {\n if (root.getNumKeys() == 4 && root.isLeaf()) {\n BTreeNode<T> newRoot = new BTreeNode(false);\n\n newRoot.setChild(root, 0);\n\n insercionOrdenada(root, t);\n splitChild(newRoot, root, 0);\n\n this.root = newRoot;\n } else {\n insertarKey(root, t);\n }\n }",
"int insertMapSelective(Map<String, Object> record);",
"public abstract String[] map() throws TooFewNocNodesException;",
"public void insert(String word) {\n char[] chs = word.toCharArray();\n TreeNode cur = root;\n for (int i = 0; i < chs.length; i++) {\n int ind = chs[i] - 'a';\n if (cur.map[ind] == null) {\n cur.map[ind] = new TreeNode();\n }\n cur = cur.map[ind];\n }\n cur.end = true;\n }",
"@Override\n\tprotected void saveTo(Map<String, Object> map) {\n\t\tmap.put(\"rootElemId\", rootElemId);\n\t}",
"protected void prepareEntityToNodeMap()\r\n\t{\n\t}",
"public void insert(int key) {\n // Implement insert() using the non-recursive version\n // This function should call findClosestLeaf()\n\n if(root!=null){ // มี node ใน tree\n Node n = findClosestLeaf(key); //หา Leaf n ที่ใกล้ค่าที่ใส่มากที่สุด โดย call findClosestLeaf()\n\n\n if(n.key!= key){ // ค่าที่จะใส่ต้องไม่มีใน tree\n if(key > n.key){ // ค่าที่จะใส่มากกว่า Leaf n ให้ใส่เป็นลูฏของ Leaf ด้านขวา\n n.right = new Node(key);\n n.right.parent = n;\n }\n\n else { // ค่าที่จะใส่น้อยกว่า Leaf n ให้ใส่เป็นลูฏของ Leaf ด้านซ้าย\n n.left = new Node(key);\n n.left.parent = n;\n }\n }\n else\n {\n return;\n }\n\n }else{ // ไม่มี node ใน tree ดังนั้นค่าที่ใส่เข้ามาจะกลายเป็ฯ root\n root = new Node(key);\n }\n }",
"private static HashSet<String> addElement(Map m, String key,int count) {\n\t\tIterator it = m.entrySet().iterator();\n\t\tHashSet<String> allParents=new HashSet<String>();\n\t\tHashSet<String> newNodeHS=new HashSet<String>();\n\t\tHashSet<String> receive=new HashSet<String>();\n\t\tString parent=\"\";\n\t\tif(readNodes.get(key)==null)\n\t\t{\n\t\t\tif(!(key.equals(root)))\n\t\t\t{\n\t\t\tallParents=(HashSet)m.get(key);\n\t\t\tIterator iter = allParents.iterator();\n\t\t\twhile(iter.hasNext())\n\t\t\t{\n\t\t\t\tparent=(String)iter.next();\n\t\t\t\tcount++;\n\t\t\t\treceive=addElement(m,parent,count);\n\t\t\t\tString str=key+\"-\"+parent;\n\t\t\t\tIterator toRecieve = receive.iterator();\n\t\t\t\twhile(toRecieve.hasNext())\n\t\t\t\t{\n\t\t\t\t\tnewNodeHS.add((String)toRecieve.next());\n\t\t\t\t}\n\t\t\t\tnewNodeHS.add(str);\n\t\t\t\tcount--;\n\t\t\t}\n\t\t\t\tif(count==0)\n\t\t\t\t{\n\t\t\t\t\tIterator<HashSet> iternew = totalDAG.iterator();\n\t\t\t\t\tHashSet<HashSet> inProgressDAG=new HashSet<HashSet>(totalDAG); \n\t\t\t\t\twhile (iternew.hasNext()) {\n\t\t\t\t\t HashSet<String> tillCreatedDAG=iternew.next();\n\t\t\t\t\t HashSet<String> union=new HashSet<String>(newNodeHS);\n\t\t\t\t\t union.addAll(tillCreatedDAG);\n\t\t\t\t\t inProgressDAG.add(union);\n\t\t\t\t\t}\n\t\t\t\t\ttotalDAG.clear();\n\t\t\t\t\ttotalDAG=inProgressDAG;\n\t\t\t\t\ttotalDAG.add(newNodeHS);\n\t\t\t\t\treadNodes.put(key, newNodeHS);\n\t\t\t\t\tSystem.out.println(\"Size: \" +totalDAG.size()+\" Nodes: \"+(++totalCount));\n\t\t\t\t\treturn newNodeHS;\n\t\t\t\t}\n\t\t\t\tcount--;\n\t\t\t\treturn newNodeHS;\t\n\t\t\t\t}\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString str=root;\n\t\t\t\t\tnewNodeHS.add(str);\n\t\t\t\t\tcount--;\n\t\t\t\t\treturn newNodeHS;\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn (HashSet)readNodes.get(key);\n\t\t}\n\t}",
"public void insert(T data)\r\n {\r\n root = insert(root, data);\r\n }",
"public void testInsert01() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(4);\r\n\r\n\t\t// Growing the leaf\r\n\t\tbt.set(\"010\", 1);\r\n\t\tbt.set(\"020\", 2);\r\n\t\tbt.set(\"030\", 3);\r\n\t\tbt.set(\"040\", 4);\r\n\t\tassertEquals(bt.root.dump(), \"[010=1, 020=2, 030=3, 040=4]\");\r\n\r\n\t\t// Leaf split (middle) and new root created\r\n\t\tbt.set(\"025\", 5);\r\n\t\tassertEquals(bt.root.dump(), \"[[010=1, 020=2], [025=5, 030=3, 040=4]]\");\r\n\r\n\t\t// Growing the right of the right side of the tree\r\n\t\t// Leaf split (last) and new child added to root\r\n\t\tbt.set(\"050\", 6);\r\n\t\tbt.set(\"060\", 7);\r\n\t\tassertEquals(bt.root.dump(), \"[[010=1, 020=2], [025=5, 030=3], [040=4, 050=6, 060=7]]\");\r\n\r\n\t\t// Growing the left of the right side of the tree\r\n\t\t// Leaf split (first) and new child added to root\r\n\t\tbt.set(\"035\", 8);\r\n\t\tbt.set(\"034\", 9);\r\n\t\tassertEquals(bt.root.dump(),\r\n\t\t\t\t\"[[010=1, 020=2], [025=5, 030=3], [034=9, 035=8, 040=4], [050=6, 060=7]]\");\r\n\r\n\t\t// Growing the right of the right side of the tree\r\n\t\t// Node split (last) and new root created\r\n\t\tbt.set(\"070\", 10);\r\n\t\tassertEquals(bt.root.dump(),\r\n\t\t\t\t\"[[[010=1, 020=2], [025=5, 030=3]], [[034=9, 035=8, 040=4], [050=6, 060=7, 070=10]]]\");\r\n\r\n\t\t// Testing key update\r\n\t\tbt.set(\"010\", -1);\r\n\r\n\t\tassertEquals(bt.get(\"010\"), Integer.valueOf(-1));\r\n\t\tassertEquals(bt.get(\"020\"), Integer.valueOf(2));\r\n\t\tassertEquals(bt.get(\"030\"), Integer.valueOf(3));\r\n\t\tassertEquals(bt.get(\"040\"), Integer.valueOf(4));\r\n\t\tassertEquals(bt.get(\"025\"), Integer.valueOf(5));\r\n\t\tassertEquals(bt.get(\"050\"), Integer.valueOf(6));\r\n\t\tassertEquals(bt.get(\"060\"), Integer.valueOf(7));\r\n\t\tassertEquals(bt.get(\"035\"), Integer.valueOf(8));\r\n\t\tassertEquals(bt.get(\"034\"), Integer.valueOf(9));\r\n\t\tassertEquals(bt.get(\"070\"), Integer.valueOf(10));\r\n\t\tassertEquals(bt.get(\"xyz\"), null);\r\n\t}",
"public HPTNode<K, V> insert(List<K> key) {\n check(key);\n init();\n int size = key.size();\n HPTNode<K, V> current = root;\n for (int i = 0; i < size; i++) {\n HPTNode<K, V> result = find(current, i, key.get(i), true);\n current.maxDepth = Math.max(current.maxDepth, size - i);\n current = result;\n }\n return current;\n }",
"void insert(int data) { \n root = insertRec(root, data); \n }",
"void insert(K key, V value) {\r\n\r\n\r\n Node child = getChild(key);\r\n child.insert(key, value);\r\n // to check if the child is overloaded\r\n if (child.isOverflow()) {\r\n Node sibling = child.split();\r\n insertChild(sibling.getFirstLeafKey(), sibling);\r\n }\r\n\r\n // if the node is full then it requires to split\r\n if (root.isOverflow()) {\r\n Node sibling = split();\r\n InternalNode newRoot = new InternalNode();\r\n newRoot.keys.add(sibling.getFirstLeafKey());\r\n newRoot.children.add(this);\r\n newRoot.children.add(sibling);\r\n root = newRoot;\r\n }\r\n\r\n }",
"private Node insertMovie(MovieInfo data, Node t) {\n\t\t\tif (t == null) { //Checks for empty tree (or in the recursion, the end of the tree)\n\t\t\t\treturn (new Node(data)); //establishes a new node!\n\t\t\t} else {\n\t\t\t\t//Must makes sure the data is not a duplicate\n\t\t\t\tif (findMovie(t, data.shortTitle) != null) {\n\t\t\t\t\treturn t; //Returns to caller\n\t\t\t\t}\n\n\t\t\t\t//check if data is alphabetically before the current node (starting with the root), if it is, recure down the left side of the tree\n\t\t\t\tif (data.shortTitle.compareTo(t.data.shortTitle) < 0 ) {\n\t\t\t\t\tt.left = insertMovie(data, t.left);\n\t\t\t\t} else {\n\t\t\t\t//it must be alphabetically after the root so we recure down the right side of the root\n\t\t\t\t\tt.right = insertMovie(data, t.right);\n\t\t\t\t}\n\n\t\t\t\treturn t; //Return the pointer (pointed at the root)\n\n\t\t\t}\n\t\t}",
"@Test\n\tpublic void testInsert4() {\n\t\t\n\t\tBTree<Long,String> T = new BTree<Long, String>(3);\n\t\tT.insert(new Long(10), \"Ten\");\n\t\tT.insert(new Long(20), \"Twenty\");\n\t\tT.insert(new Long(30), \"Thirty\");\n\t\t\n\t\tT.insert(new Long(70), \"Seventy\");\n\t\tT.insert(new Long(60), \"Sixty\");\n\t\tT.insert(new Long(80), \"Eighty\");\n\t\t\n\t\tT.insert(new Long(50), \"Fifty\");\n\t\tT.insert(new Long(40), \"Fourty\");\n\t\tT.insert(new Long(55), \"Fifty-Five\");\n\t\tT.insert(new Long(65), \"Sixty-Five\");\n\t\t\n\t\tassertTrue( T.root instanceof InnerNode);\n\t\t\n\t\tInnerNode<Long,String> root = (InnerNode<Long,String>) T.root;\n\t\tassertEquals(1, root.keys.size());\n\t\tassertEquals(60, (long) root.keys.get(0));\n\t\tassertEquals(2, root.children.size());\n\t\t\n\t\tInnerNode<Long,String> left = (InnerNode<Long,String>) root.children.get(0);\n\t\tInnerNode<Long,String> right = (InnerNode<Long,String>) root.children.get(1);\n\t\t\n\t\tassertEquals(30, (long) left.keys.get(0));\n\t\tassertEquals(50, (long) left.keys.get(1));\n\t\t\n\t\tassertEquals(70, (long) right.keys.get(0));\n\t\t\n\t\tLeafNode<Long, String> child0 = (LeafNode<Long, String>) left.children.get(0);\n\t\tLeafNode<Long, String> child1 = (LeafNode<Long, String>) left.children.get(1);\n\t\t\n\t\tLeafNode<Long, String> child2 = (LeafNode<Long, String>) left.children.get(2);\n\t\t\n\t\tLeafNode<Long, String> child3 = (LeafNode<Long, String>) right.children.get(0);\n\t\tLeafNode<Long, String> child4 = (LeafNode<Long, String>) right.children.get(1);\n\t\t\n\t\tassertEquals(10, (long) child0.children.get(0).key);\n\t\tassertEquals(20, (long) child0.children.get(1).key);\n\t\t\n\t\tassertEquals(30, (long) child1.children.get(0).key);\n\t\tassertEquals(40, (long) child1.children.get(1).key);\n\t\t\n\t\tassertEquals(50, (long) child2.children.get(0).key);\n\t\tassertEquals(55, (long) child2.children.get(1).key);\n\t\t\n\t\tassertEquals(60, (long) child3.children.get(0).key);\n\t\tassertEquals(65, (long) child3.children.get(1).key);\n\t\t\n\t\tassertEquals(70, (long) child4.children.get(0).key);\n\t\tassertEquals(80, (long) child4.children.get(1).key);\n\t\t\n\t}",
"public void insert(int key)\n {\n root = insertRec(root,key);\n }",
"private void populateTaxonomyTree() {\n\t\tfor (Node s: serviceMap.values()) {\n\t\t\taddServiceToTaxonomyTree(s);\n\t\t}\n\t}",
"private static void buildNewEncodingTableUtil(Node root , Map<Character,String> newTable , List<Character> path) {\n\t\t\n\t\tif(root!=null) {\n\t\t\t\n\t\t\tif(root.left==null && root.right==null) {//Leaf.. Put the sequence into the map.\n\t\t\t\t\n\t\t\t\tString encoding = path.stream().map(e->e.toString()).collect(Collectors.joining()); //Good stuff\n//\t\t\t\tSystem.out.println(\"--encoding : \" + encoding);\n\t\t\t\tnewTable.put(root.data, encoding);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpath.add('0');\n\t\t\t\tbuildNewEncodingTableUtil(root.left, newTable, path);\n\t\t\t\tpath.remove(path.size()-1);\n\t\t\t\tpath.add('1');\n\t\t\t\tbuildNewEncodingTableUtil(root.right, newTable, path);\n\t\t\t\tpath.remove(path.size()-1);\n\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t}",
"private void createNodesMaps()\n {\n Maze maze = gameState.getMazeState().getMaze();\n\n for (Node node : maze.getNodes()) {\n pixelsNodes.put(nodeToPixelIndex(node), node);\n }\n\n for (Node node : maze.getPillsNodes()) {\n pixelsPillNodes.put(nodeToPixelIndex(node), node);\n }\n\n for (Node node : maze.getPowerPillsNodes()) {\n pixelsPowerPillNodes.put(nodeToPixelIndex(node), node);\n }\n }",
"public void insert(Node n);",
"public void insert(String word) {\n char[] chars = word.toCharArray();\n int length = chars.length;\n\n Map<Character,Node> map = this.root.map;\n for(int i = 0;i < length;i++){\n if(map.containsKey(chars[i])){\n Node node = map.get(chars[i]);\n }else{\n map.put(chars[i],new Node(chars[i]));\n }\n\n if(i == length - 1){\n map.get(chars[i]).isWordEnd = true;\n }\n map = map.get(chars[i]).map;\n }\n }",
"@Override\r\n\tpublic void insertleftmenu(Map<String, Object> map) throws Exception {\n\t\tleftmenuDAO.insertLeftmenu(map);\r\n\t}",
"@Test\n\tpublic void testInsert3() {\n\t\t\n\t\tBTree<Long,String> T = new BTree<Long, String>(3);\n\t\tT.insert(new Long(10), \"Ten\");\n\t\tT.insert(new Long(20), \"Twenty\");\n\t\tT.insert(new Long(30), \"Thirty\");\n\t\t\n\t\tT.insert(new Long(70), \"Seventy\");\n\t\tT.insert(new Long(60), \"Sixty\");\n\t\tT.insert(new Long(80), \"Eighty\");\n\t\t\n\t\tT.insert(new Long(50), \"Fifty\");\n\t\tT.insert(new Long(40), \"Fourty\");\n\t\t\n\t\tassertTrue( T.root instanceof InnerNode);\n\t\t\n\t\tInnerNode<Long,String> root = (InnerNode<Long,String>) T.root;\n\t\tassertEquals(3, root.keys.size());\n\t\tassertEquals(30, (long) root.keys.get(0));\n\t\tassertEquals(50, (long) root.keys.get(1));\n\t\tassertEquals(70, (long) root.keys.get(2));\n\t\t\n\t\tassertEquals(4, root.children.size( ));\n\t\tassertTrue( root.children.get(0) instanceof LeafNode );\n\t\tassertTrue( root.children.get(1) instanceof LeafNode );\n\t\tassertTrue( root.children.get(2) instanceof LeafNode );\n\t\tassertTrue( root.children.get(3) instanceof LeafNode );\n\n\t\tLeafNode<Long, String> child0 = (LeafNode<Long, String>) root.children.get(0);\n\t\tLeafNode<Long, String> child1 = (LeafNode<Long, String>) root.children.get(1);\n\t\tLeafNode<Long, String> child2 = (LeafNode<Long, String>) root.children.get(2);\n\t\tLeafNode<Long, String> child3 = (LeafNode<Long, String>) root.children.get(3);\n\t\t\n\t\tassertEquals(2, child0.children.size());\n\t\tassertEquals(10, (long) child0.children.get(0).key);\n\t\tassertEquals(20, (long) child0.children.get(1).key);\n\n\t\tassertEquals(2, child1.children.size());\n\t\tassertEquals(30, (long) child1.children.get(0).key);\n\t\tassertEquals(40, (long) child1.children.get(1).key);\n\n\t\tassertEquals(2, child2.children.size());\n\t\tassertEquals(50, (long) child2.children.get(0).key);\n\t\tassertEquals(60, (long) child2.children.get(1).key);\n\t\t\n\t\tassertEquals(2, child3.children.size());\n\t\tassertEquals(70, (long) child3.children.get(0).key);\n\t\tassertEquals(80, (long) child3.children.get(1).key);\n\t}",
"public static void build ()\r\n {\r\n lgt.insert(1);\r\n lgt.insert(2);\r\n lgt.insert(5);\r\n \r\n lgt.findRoot();\r\n lgt.insert(3);\r\n \r\n lgt.findRoot();\r\n lgt.insert(4);\r\n \r\n lgt.insert(6);\r\n lgt.findParent();\r\n lgt.insert(7);\r\n \r\n }",
"void insert(String s, int index) {\n Node curr = root;//lets start by root node and insert\n for (int i = 0; i < s.length(); i++) {\n\n // we dont want to override existing key only add new key thats what putifabsent do..\n curr.childrens.putIfAbsent(s.charAt(i), new Node(s.charAt(i)));\n curr.childrens.get(s.charAt(i));\n }\n curr.end = index;\n }",
"protected static Map<Integer, ArrayList<ASNode>> addNodeToTable(\n\t\t\tASNode node, Map<Integer, ArrayList<ASNode>> paths) {\n\t\tMap<Integer, ArrayList<ASNode>> map = new HashMap<Integer, ArrayList<ASNode>>();\n\t\tfor (int currentASnum : paths.keySet()) {\n\t\t\tArrayList<ASNode> list = new ArrayList<ASNode>();\n\t\t\tlist.addAll(paths.get(currentASnum));\n\t\t\tlist.add(0, node);\n\t\t\tmap.put(currentASnum, list);\n\t\t}\n\t\treturn map;\n\t}",
"void remap()\n\t\t{\n\t\t\tif(nextMap == null)\n\t\t\t\treturn;\n\t\t\tnextMap = newNodeMap(nextMap);\n\t\t\tfor(Node<T> node : nextMap.values())\n\t\t\t\tnode.remap();\n\t\t}",
"public void insert(int data) { \n\t\troot = insert(root, data);\t\n\t}",
"public void insert(Point2D p) { // add the point to the set (if it is not already in the set)\n // \"write a simplified version of insert() which does everything except set up the RectHV for each node\"\n if (p == null) throw new IllegalArgumentException();\n\n\n if (root == null) {\n Node node = new Node();\n node.p = p;\n node.horizontal = false;\n node.rect = new RectHV(0.0, 0.0, 1.0, 1.0);\n root = node;\n size = 1;\n return;\n }\n\n if (!contains(p)) {\n size++;\n insertNextFreeSubTree(p, root);\n }\n\n }",
"private BinaryNode<E> _insert(BinaryNode<E> node, E e) {\n\n\t\tif (node == null) {\n\t\t\treturn new BinaryNode<E>(e);\n\t\t} else if (comparator.compare(e, node.getData()) < 0) { // <, so go left\n\t\t\tnode.setLeftChild(_insert(node.getLeftChild(), e));// recursive call\n\t\t} else { // >, so go right\n\t\t\tnode.setRightChild(_insert(node.getRightChild(), e));// recursive call\n\t\t}\n\t\treturn node;\n\t}",
"private static <T> Map<Character,Node<T>> newNodeMap(Map<Character,Node<T>> prev)\n\t\t{\n\t\t\treturn new HashMap<Character,Node<T>>(prev);\n\t\t}",
"public MutableMatrixTreeNode<E> buildTree() {\n\t\t// use parental relations to build the tree by directly inserting each child into it's parents\n\t\tfor (MutableMatrixTreeNode<E> node : nodeMap.values()) {\n\t\t\tPathMatrix key = node.getPathMatrix();\n\n\t\t\tif (!key.isRoot()) {\n\t\t\t\tPathMatrix parentKey = key.computeParentMatrix();\n\n\t\t\t\tMutableMatrixTreeNode<E> parentNode = nodeMap.get(parentKey);\n\t\t\t\tparentNode.insert(node);\n\t\t\t}\n\t\t}\n\n\t\t// get root\n\t\tPathMatrix firstKey = nodeMap.keySet().iterator().next();\n\t\treturn (MutableMatrixTreeNode<E>) nodeMap.get(firstKey).visitTopNode();\n\t}",
"public void insert(Node given){\n\t\tlength++;\n\t\tString retVar = \"\";\n\t\tNode curNode = root;\n\t\twhile (!curNode.isLeaf()){\n\t\t\tif (curNode.getData() > given.getData()){\n\t\t\t\tcurNode = curNode.getLeft();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcurNode = curNode.getRight();\n\t\t\t}\n\t\t}\n\t\tif (curNode.getData() > given.getData()){ \n\t\t\tcurNode.setLeft(given);\n\t\t}\n\t\telse{\n\t\t\tcurNode.setRight(given);\n\t\t}\n\t\tmyLazySearchFunction = curNode;\n\t}",
"private void insertarKey(BTreeNode<T> root, T t) {\n BTreeNode<T> currentNode = root;\n\n if (currentNode.isLeaf()) {\n if (!itsRepeated(currentNode, (I)t.getId())) {\n insercionOrdenada(currentNode, t);\n } else {\n System.out.println(\"Dato repetido\");\n }\n } else {\n int indexChild = findChildOrIndex(currentNode, (I)t.getId());\n if (!itsRepeated(currentNode.getChild(indexChild), (I)t.getId())) {\n BTreeNode<T> child = currentNode.getChild(indexChild);\n if (child.getNumKeys() == 4 && child.isLeaf()) {\n insercionOrdenada(currentNode.getChild(indexChild), t);\n splitChild(currentNode, currentNode.getChild(indexChild), indexChild);\n } else {\n insertarKey(root.getChild(indexChild), t);\n }\n\n if (currentNode.getNumKeys() == 5) {\n checkMaxKeys(currentNode);\n }\n } else {\n System.out.println(\"Dato repetido\");\n }\n }\n }",
"private void insert(RBNode<T> node) {\r\n RBNode<T> current = this.root;\r\n //need to save the information of parentNode\r\n //because need the parentNode to connect the new node to the tree\r\n RBNode<T> parentNode = null;\r\n\r\n //1. find the insert position\r\n while(current != null) {\r\n parentNode = current;//store the parent of current, because current is going to move\r\n int cmp = node.key.compareTo(current.key);\r\n if(cmp < 0)//if insert data is smaller than current data, then go into left subtree\r\n current = current.left;\r\n else//if insert data is bigger than or equal to current data, then go into right subtree\r\n current = current.right;\r\n }\r\n\r\n //find the position, let parentNode as the parent of newNode\r\n node.parent = parentNode;\r\n\r\n //2. connect newNode to parentNode\r\n if(parentNode != null) {\r\n int cmp = node.key.compareTo(parentNode.key);\r\n if(cmp < 0)\r\n parentNode.left = node;\r\n else\r\n parentNode.right = node;\r\n } else {\r\n //if parentNode is null, means tree was empty, let root = newNode\r\n this.root = node;\r\n }\r\n\r\n //3. fix the current tree to be a RBTree again\r\n insertFixUp(node);\r\n }",
"private void insert(Node node) {\n//\t\t//A*\n\t\topen.add(node);\n\t\tCollections.sort(open);\n//\t\t\n//\t\t//dfs\n//\t\topen.add(0, node);\n\t\t\n\t\t//bfs\n//\t\topen.add(node);\n\t}",
"private static <T> Map<Character,Node<T>> newNodeMap()\n\t\t{\n\t\t\treturn new HashMap<Character,Node<T>>();\n\t\t}",
"public void insert(String word) {\n char[] chars = word.toCharArray();\n Node theNode = root;\n for (char c : chars) {\n if (!theNode.leaf) theNode.leaf = false;\n if (theNode.children.containsKey(c)) {\n theNode = theNode.children.get(c);\n } else {\n Node newNode = new Node(c);\n theNode.children.put(c, newNode);\n theNode = newNode;\n }\n }\n theNode.leaf = true;\n }",
"private void insertInTree(String word, GTreeIF<Node> node) {\n\t\t\t\t\n\t\tif(word.length()>0){\n\t\t\t\t\n\t\t\t\t\tif(node.getNumChildren()==0){\n\t\t\t\t\t\tGTreeIF<Node> subarbol = new GTree<Node>();\n\t\t\t\t\t\tNode hijo = new LetterNode(word.charAt(0));\n\t\t\t\t\t\tsubarbol.setRoot(hijo);\n\t\t\t\t\t\tnode.addChild(node.getNumChildren()+1, subarbol);\n\t\t\t\t\t\tinsertInTree(word.substring(1),node.getChild(node.getNumChildren()));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tLetterNode aux;\n\t\t\t\t\t\tint i=1;\n\t\t\t\t\t\tboolean igual=false;\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\tif(node.getChild(i).getRoot().getNodeType()==NodeType.LETTERNODE) {\n\t\t\t\t\t\t\t\taux= (LetterNode) node.getChild(i).getRoot();\n\t\t\t\t\t\t\t\tif(aux.getCharacter()==word.charAt(0))\n\t\t\t\t\t\t\t\t\tigual=true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}while(!igual && i<=node.getNumChildren());\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(igual)\n\t\t\t\t\t\t\tinsertInTree(word.substring(1),node.getChild(i-1));\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tGTreeIF<Node> subarbol2= new GTree<Node>();\n\t\t\t\t\t\t\t\tNode hijo = new LetterNode(word.charAt(0));\n\t\t\t\t\t\t\t\tsubarbol2.setRoot(hijo);\n\t\t\t\t\t\t\t\tboolean inserto=false;\n\t\t\t\t\t\t\t\tint count=1;\n\t\t\t\t\t\t\t\tLetterNode nodoaux;\n\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\tif(node.getChild(count).getRoot().getNodeType()==NodeType.LETTERNODE) {\n\t\t\t\t\t\t\t\t\t\tnodoaux=(LetterNode) node.getChild(count).getRoot();\n\t\t\t\t\t\t\t\t\t\tif(nodoaux.getCharacter()>word.charAt(0)) {\n\t\t\t\t\t\t\t\t\t\t\tnode.addChild(count, subarbol2);\n\t\t\t\t\t\t\t\t\t\t\tinserto=true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}while(!inserto && count<=node.getNumChildren());\n\t\t\t\t\t\t\t\tif(!inserto) {\n\t\t\t\t\t\t\t\t\tnode.addChild(count, subarbol2);\n\t\t\t\t\t\t\t\t\tinsertInTree(word.substring(1),node.getChild(count));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\t\tinsertInTree(word.substring(1), node.getChild(i));\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}\n\t\t\t\telse {\n\t\t\t\t\tint count=1;\n\t\t\t\t\tboolean comprobar=false;\n\t\t\t\t\twhile(!comprobar && node.getNumChildren()>=count) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(node.getChild(count).getRoot().getNodeType()==NodeType.WORDNODE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcomprobar=true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t\tif(comprobar==false) {\n\t\t\t\t\t\tGTreeIF<Node> subarbol3 = new GTree<Node>();\n\t\t\t\t\t\tNode hoja = new WordNode();\n\t\t\t\t\t\tsubarbol3.setRoot(hoja);\n\t\t\t\t\t\tnode.addChild(1, subarbol3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t}",
"public int insert( Map x ) {\n throw new UnsupportedOperationException(\n \"Method insert( Map ) not supported in MRC\" );\n }",
"public interface InsertMapper<T, K> extends\n InsertAllMapper<T, K>,\n InsertSelectiveMapper<T, K> {\n}",
"void putAll(HMap m) throws NullPointerException;",
"@Override\n\tpublic int insertBoard(Map<String, Object> map) {\n\t\treturn 0;\n\t}",
"@Override\r\n public void insert(K key, V value) {\r\n // call insert of the root\r\n root.insert(key, value);\r\n }",
"public boolean add(BSTMapNode element) \n\t{\n\t\tif(element.getKey() < this.key)\n\t\t{\n\t\t\tif(this.left == null)\n\t\t\t{\n\t\t\t\tBSTMapNode e = new BSTMapNode(null, null, this, element.getKey(), element.getValue());\n\t\t\t\tthis.left = e;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tthis.left.add(element);\n\t\t\t}\n\t\t}\n\t\telse if(element.getKey() > this.key)\n\t\t{\n\t\t\tif(this.right == null)\n\t\t\t{\n\t\t\t\tBSTMapNode e = new BSTMapNode(null, null, this, element.getKey(), element.getValue());\n\t\t\t\tthis.right = e;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.right.add(element);\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"@SuppressWarnings(\"ReferenceEquality\") // cannot use equals() for check whether tree is the same\n private PersistentSortedMap<K, V> mapFromTree(@Var @Nullable Node<K, V> newRoot) {\n if (newRoot == root) {\n return this;\n } else if (newRoot == null) {\n return of();\n } else {\n // Root is always black.\n newRoot = newRoot.withColor(Node.BLACK);\n return new PathCopyingPersistentTreeMap<>(newRoot);\n }\n }",
"public void insert(Point2D p) \r\n\t{\r\n\t\troot = insert(p, root, VER);\r\n\t}",
"public static void populateTree(BinarySearchTree tree)\n {\n for(int i = 0; i < 20; i++)\n {\n tree.add(i);\n }\n }",
"private void populateOutputsInTree() {\n\t\tfor (ServiceNode s: serviceMap.values()) {\n\t\t\tfor (String outputVal : s.getOutputs())\n\t\t\t\ttaxonomyMap.get(outputVal).services.add(s);\n\t\t}\n\n\t\t// Now add the outputs of the input node\n\t\tfor (String outputVal : inputNode.getOutputs())\n\t\t\ttaxonomyMap.get(outputVal).services.add(inputNode);\n\t}",
"public void insert(Key key, Value value){\n this.root = this.insertHelper(key, value, root);\n }",
"@Override\n public void insert(K key) {\n try {\n this.rootNode = insertNode(this.rootNode, key);\n } catch (DuplicateKeyException e) {\n System.out.println(e.getMessage());\n } catch (IllegalArgumentException e) {\n System.out.println(e.getMessage());\n }\n }",
"@Override\n\tpublic void insert(Node node) {\n\t\tchildren.add(node);\n\t}",
"private static Node insertNode(Node root, String[] arr) {\n\t\tFamilyTree f = new FamilyTree();\n\t\tif (root == null)\n\t\t\treturn root;\n\t\tif (root.data.trim().equalsIgnoreCase(arr[0].trim())) {\n\t\t\tif (root.left == null) {\n\t\t\t\troot.left = f.new Node(arr[1]);\n\t\t\t} else\n\t\t\t\troot.right = f.new Node(arr[1]);\n\t\t}\n\t\tinsertNode(root.left, arr);\n\t\tinsertNode(root.right, arr);\n\t\treturn root;\n\t}",
"static TreeNode insert(TreeNode node, int key) \n\t{ \n\t // if tree is empty return new node \n\t if (node == null) \n\t return newNode(key); \n\t \n\t // if key is less then or grater then \n\t // node value then recur down the tree \n\t if (key < node.key) \n\t node.left = insert(node.left, key); \n\t else if (key > node.key) \n\t node.right = insert(node.right, key); \n\t \n\t // return the (unchanged) node pointer \n\t return node; \n\t}",
"void insert(K key, V value) {\r\n // binary search\r\n int correct_place = Collections.binarySearch(keys, key);\r\n int indexing;\r\n if (correct_place >= 0) {\r\n indexing = correct_place;\r\n } else {\r\n indexing = -correct_place - 1;\r\n }\r\n\r\n if (correct_place >= 0) {\r\n keys.add(indexing, key);\r\n values.add(indexing, value);\r\n } else {\r\n keys.add(indexing, key);\r\n values.add(indexing, value);\r\n }\r\n\r\n // to check if the node is overloaded then split\r\n if (root.isOverflow()) {\r\n Node sibling = split();\r\n InternalNode newRoot = new InternalNode();\r\n newRoot.keys.add(sibling.getFirstLeafKey());\r\n newRoot.children.add(this);\r\n newRoot.children.add(sibling);\r\n root = newRoot;\r\n }\r\n }",
"static void insertRhombus(Quadtree q, Scanner in, Map<Integer,GeometricObject> hm, int id){\n\n\t\tdouble x1,y1,x2,y2,x3,y3,x4,y4;\n\n\t\tx1=in.nextDouble();\n\t\ty1=in.nextDouble();\n\t\tx2=in.nextDouble();\n\t\ty2=in.nextDouble();\n\t\tx3=in.nextDouble();\n\t\ty3=in.nextDouble();\n\t\tx4=in.nextDouble();\n\t\ty4=in.nextDouble();\n\t\t\n\t\thm.put(id,new Rhombus(x1,y1,x2,y2,x3,y3,x4,y4,id));\n\t\tq.insert(q, new Rhombus(x1,y1,x2,y2,x3,y3,x4,y4,id));\n\t}",
"public void insert(int key){\n\t\tif(this.root == null){\n\t\t\tNode r = new Node(key);\n\t\t\tthis.root = r;\t\n\t\t}else{\n\t\t\t//if not recursively insert the node\n\t\t\trecInsert(this.root, key);\n\t\t}\n\t\treturn;\n\t}",
"public void insert(T e) {\n if (e == null) return;\n root = insert(root, e);\n }",
"public BSTMap() {\n this.clear();\n }",
"public static void insert(TreeNode root, int key) {\n\t\tcounter++;\r\n\r\n\t\t// key less than the value of root.\r\n\t\tif (key < root.item) {\r\n\t\t\tif (root.left == null) {\r\n\t\t\t\tTreeNode node = new TreeNode(null, key, null);\r\n\t\t\t\troot.left = node;\r\n\t\t\t} else {\r\n\t\t\t\tinsert(root.left, key);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (root.right == null) {\r\n\t\t\t\tTreeNode node = new TreeNode(null, key, null);\r\n\t\t\t\troot.right = node;\r\n\t\t\t} else {\r\n\t\t\t\tinsert(root.right, key);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public BSTMap() {\n clear();\n }",
"public void insertNode(int d){\n if(root == null){\n root = new TreeNode(d);\n }\n else{\n root.insert(d);\n }\n }",
"private void preorderSubtree(Position<E> p, List<Position<E>> snapshot) {\n snapshot.add(p);\n for (Position<E> c : children(p)) {\n preorderSubtree(c, snapshot); \n \n }\n }",
"public void insert(String word) {\n var node = root;\n for(char currentChar : word.toCharArray()){\n if(!node.containsKey(currentChar)) {\n node.put(currentChar, new Node());\n }\n node = node.get(currentChar);\n }\n node.setEnd();\n }",
"public TreeNode insert(TreeNode root, int key) {\n if (root == null) {\n root = new TreeNode(key);\n return root;\n }\n TreeNode cur = root, par = root;\n while (cur != null) {\n par = cur;\n if (cur.key == key) {\n return root;\n }\n if (key < cur.key) {\n cur = cur.left;\n } else {\n cur = cur.right;\n }\n }\n // this is when cur is null (out of the while)\n if (key < par.key) {\n par.left = new TreeNode(key);\n } else {\n par.right = new TreeNode(key);\n }\n \n return root;\n }",
"@Override\n\tpublic List<Map<String, Object>> selectToTreeNocheckMap(Map param) {\n\t\treturn codeRegorgMapper.selectToTreeNocheckMap(param);\n\t}",
"public void insert(int key) {\n\t\tprivateInsert(key, root, null, new Ref<Integer>(1));\n\t}",
"public void addchild(T data)\n\t{\n\t\tHtmlMap<T> child = new HtmlMap<T>(data);\n\t\tchild.setParent(this);\n\t\tthis.m_children.add(child);\n\t}",
"TreeNode addChild(TreeNode node);",
"@SuppressWarnings(\"unchecked\")\r\n private Node insertHelperSize1(Key key, Value value) {\r\n Node tmp;\r\n if(key.compareTo(keys[0]) < 0) { // add key:value before contents\r\n tmp = children[0].insert(key,value);\r\n if(tmp != children[0]) { // merge interior node that bubbled up\r\n InteriorNode merge = (InteriorNode)tmp;\r\n setKeyValuePairs(merge.keys[0],merge.values[0],keys[0],values[0]);\r\n setChildren(merge.children[0],merge.children[1],children[1]);\r\n }\r\n } else { // add key:value after contents\r\n tmp = children[1].insert(key,value);\r\n if(tmp != children[1]) { // merge interior node that bubbled up\r\n InteriorNode merge = (InteriorNode)tmp;\r\n setKeyValuePairs(keys[0],values[0],merge.keys[0],merge.values[0]);\r\n setChildren(children[0],merge.children[0],merge.children[1]);\r\n }\r\n }\r\n return this;\r\n }",
"public void insert(Point2D p) {\n if (this.n ==0) {\n this.root = new Node(p, true, new RectHV(0,0,1,1));\n this.n++;\n } else {\n if (insert1(root, p)) this.n++;\n }\n }",
"private void modifyLeafNodes(List<Top> roots) {\n\t\troots.stream()\n\t\t\t.forEach(y -> y.getMiddles()\n\t\t\t//.stream()\n\t\t\t.forEach(z -> z.getLeafs()\n\t\t\t//.stream()\n\t\t\t.forEach(x -> x.setAttribute(x.getAttribute().toLowerCase()))));\n\t\troots\n\t\t\t.forEach(x -> x.getMiddles()\n\t\t\t.forEach(y -> y.getLeafs()\n\t\t\t.forEach(i -> System.out.println(i.getId() + \",\" + i.getAttribute()))));\n\t}",
"public void testInsert02() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(10);\r\n\t\tList<String> words = TestUtils.randomWords(5000, 31);\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tbt.set(words.get(i), i);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tassertEquals(bt.get(words.get(i)), Integer.valueOf(i));\r\n\t\t}\r\n\t}",
"public void insertBST(Object o) {\n ObjectTreeNode p, q;\n \n ObjectTreeNode r = new ObjectTreeNode(o);\n if (root == null)\n root = r;\n else {\n p = root;\n q = root;\n while (q != null) {\n p = q;\n if (((TreeComparable)(r.getInfo())).compareTo((TreeComparable)(p.getInfo())) < 0 )\n q = p.getLeft();\n else\n q = p.getRight();\n }\n if (((TreeComparable)(r.getInfo())).compareTo((TreeComparable)(p.getInfo())) < 0)\n setLeftChild(p, r);\n else\n setRightChild(p, r);\n }\n }",
"private static Node buildTreeHelper(int[] preorder, int[] preorderIndex, int left, int right, Map<Integer, Integer> inorderMap) {\n\n if (left > right) { return null; }\n int rootVal = preorder[preorderIndex[0]++];\n Node root = new Node(rootVal);\n\n root.left = buildTreeHelper(preorder, preorderIndex, left, inorderMap.get(rootVal) - 1, inorderMap);\n root.right = buildTreeHelper(preorder, preorderIndex, inorderMap.get(rootVal) + 1, right, inorderMap);\n return root;\n }",
"public int insert(int k, String i) {\r\n\t\t WAVLNode parentToInsert;\r\n\t\t if(this.root == null)\r\n\t\t {\r\n\t\t\t this.root = new WAVLNode (k,i,this.getExternalNode());\r\n\t\t\t return 0;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t parentToInsert = this.root.placeToInsert(k);\r\n\t\t\t //System.out.println(parentToInsert.getKey());\r\n\t\t\t WAVLNode nodeToInsert = new WAVLNode(k,i,this.getExternalNode());\r\n\t\t\t if(parentToInsert == null)\r\n\t\t\t {\r\n\t\t\t\t return -1;\r\n\t\t\t }\r\n\t\t\t if(this.min == null || k < this.min.getKey())\r\n\t\t\t {\r\n\t\t\t\t this.min = nodeToInsert;\r\n\t\t\t }\r\n\t\t\t if(this.max == null || k > this.max.getKey())\r\n\t\t\t {\r\n\t\t\t\t this.max = nodeToInsert;\r\n\t\t\t }\r\n\t\t\t if(parentToInsert.getKey() > k)\r\n\t\t\t {\r\n\t\t\t\t parentToInsert.setLeft(nodeToInsert);\r\n\t\t\t\t nodeToInsert.setParent(parentToInsert);\r\n\t\t\t }\r\n\t\t\t else\r\n\t\t\t {\r\n\t\t\t\t parentToInsert.setRight(nodeToInsert);\r\n\t\t\t\t nodeToInsert.setParent(parentToInsert);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t WAVLNode currentNode = nodeToInsert;\r\n\t\t\t while(currentNode.getParent() != null)\r\n\t\t\t {\r\n\t\t\t\t currentNode = currentNode.getParent();\r\n\t\t\t\t currentNode.setSubTreeSize(currentNode.getSubTreeSize()+1);\r\n\t\t\t\t //System.out.println(\"Changed \" +currentNode.getKey()+ \" To \" + (currentNode.getSubTreeSize()));\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t int numRebalance = parentToInsert.rebalanceInsert();\r\n\t\t\t while(this.root.getParent() != null)\r\n\t\t\t {\r\n\t\t\t\t //System.out.println(this.root.getKey());\r\n\t\t\t\t this.setRoot(this.root.getParent());\r\n\t\t\t }\r\n\t\t\t return numRebalance;\r\n\t\t }\r\n\t }",
"private void addToKmapAndPredMetadata(Collection<Node> nodes) {\n\t\tCollection<Edge> edges = Util.flatmap(Node::getEdges, nodes);\n\t\tUtil.map( translator::edgeToStatement, edges );\n\t}",
"public Emmanuel_salcedoBST(E[] objects) {\r\n\t\tfor (int i = 0; i < objects.length; i++)\r\n\t\t\tinsert(objects[i]);\r\n\t}",
"public Node insert(Key key, Value value) { \r\n // inserting into an empty tree results in a single value leaf node\r\n return new LeafNode(key,value);\r\n }",
"public void insertingANode(T key, E value) {\r\n\t\tRBNode<T, E> insertedNode = createRBNode(key, value);\r\n\t}",
"public void insertNode(T d) {\n /* Functions to insert data */\n TreeNode newNode = new TreeNode(d);\n nodesToInsertAt.add(newNode);\n size++;\n if(root == null){\n root = newNode;\n return;\n }\n TreeNode current; \n current = nodesToInsertAt.get(0);\n if(current.left == null){\n current.left = newNode;\n return;\n }\n if(current.right == null){\n current.right = newNode;\n nodesToInsertAt.remove(0);\n }\n }",
"public void addToNodeMap(Node node) {\n nodeMap.put(node.getNodeId(), node);\n }",
"public void insert(T key, U data){\n\t\t\n\t\tAVLNode<T, U> parent = null;\n\t\tAVLNode<T, U> node = this.root;\n\t\tAVLNode<T, U> newNode = new AVLNode<T, U>(key, data);\n\t\t\n\t\tthis.amountOfNodes++;\n\t\t\n\t\twhile(node != null){\n\t\t\tparent = node;\n\t\t\tif(newNode.getKey().compareTo(node.getKey()) < 0){\n\t\t\t\tnode = node.getLeft();\n\t\t\t}else{\n\t\t\t\tnode = node.getRight();\n\t\t\t}\n\t\t}\n\t\t\n\t\tnewNode.setParent(parent);\n\t\t\n\t\tif(parent == null){ //It is the first element of the tree.\n\t\t\tthis.root = newNode;\n\t\t}else if(newNode.getKey().compareTo(parent.getKey()) < 0){\n\t\t\tparent.setLeft(newNode);\n\t\t}else{\n\t\t\tparent.setRight(newNode);\n\t\t}\n\t\tcomputeHeights(newNode);\n\t\tthis.balanceTree(parent);\n\t}"
] | [
"0.63555837",
"0.6253956",
"0.6237054",
"0.6024689",
"0.59869313",
"0.5975098",
"0.5962685",
"0.58398604",
"0.57662153",
"0.5739444",
"0.5701623",
"0.5670206",
"0.566682",
"0.5663567",
"0.56393176",
"0.5606058",
"0.5572918",
"0.5572135",
"0.5570387",
"0.5566574",
"0.55651426",
"0.55648434",
"0.5560401",
"0.5560158",
"0.5550977",
"0.5546868",
"0.553811",
"0.55246997",
"0.54889923",
"0.54755074",
"0.5462024",
"0.54486513",
"0.54483354",
"0.54476494",
"0.54335463",
"0.5417341",
"0.540304",
"0.5395085",
"0.53896284",
"0.53665537",
"0.5361075",
"0.53502774",
"0.5344502",
"0.5337307",
"0.5336793",
"0.5334568",
"0.53275317",
"0.53253806",
"0.5323216",
"0.5312749",
"0.5312366",
"0.52978706",
"0.52962494",
"0.52875185",
"0.5277599",
"0.5276858",
"0.5266119",
"0.52572256",
"0.5257074",
"0.5256581",
"0.5246915",
"0.52456176",
"0.52454305",
"0.52404773",
"0.5239106",
"0.5238402",
"0.5236435",
"0.52194095",
"0.52120596",
"0.5209213",
"0.51996464",
"0.5198713",
"0.5196336",
"0.5191434",
"0.51778144",
"0.51735413",
"0.5172691",
"0.51642853",
"0.51638365",
"0.51501477",
"0.51455235",
"0.51427406",
"0.5131173",
"0.51227206",
"0.5120416",
"0.5118157",
"0.51166785",
"0.5113343",
"0.5110409",
"0.5107084",
"0.5100785",
"0.5096969",
"0.50958824",
"0.5094972",
"0.5094064",
"0.5093756",
"0.50902754",
"0.5083211",
"0.5082327",
"0.5081254",
"0.50706565"
] | 0.0 | -1 |
Gets values from standard in Scanner scanner = new Scanner(System.in); | public static void main(String[] args) {
Class<?> clazz = ReverseShuffleMerge.class;
Scanner scanner = new Scanner(
clazz.getResourceAsStream(clazz.getSimpleName() + ".txt"));
String input = scanner.next();
scanner.close();
// Gets letter occurrence
char minLetter = MAX_ASCII_LOWER + 1;
int[] letters = new int[MAX_ASCII_LOWER - MIN_ASCII_LOWER + 1];
for (char letter : input.toCharArray()) {
letters[letter - MIN_ASCII_LOWER]++;
minLetter = (char) Math.min(minLetter, letter);
}
// Creates word string builder
int wordSize = input.length() / 2;
StringBuilder word = new StringBuilder(wordSize);
// Loops through letters storing letters that already appeared
int[] seenLetters = new int[MAX_ASCII_LOWER - MIN_ASCII_LOWER + 1];
Queue<Character> buffer = new LinkedList<>();
for (int i = input.length() - 1; i >= 0; i--) {
char letter = input.charAt(i);
int letterIndex = letter - MIN_ASCII_LOWER;
seenLetters[letterIndex] += 2;
if (letter == minLetter) {
// Prints minimum letter as soon as it appears and is still
// missing from word
if (seenLetters[letterIndex] <= letters[letterIndex]) {
word.append(letter);
}
} else if (seenLetters[letterIndex] > letters[letterIndex]) {
// Prints other letters only when inevitable
while (!buffer.isEmpty()) {
char temp = buffer.poll();
if (temp < letter) {
word.append(temp);
// seenLetters[temp - MIN_ASCII_LOWER] -= 2;
}
}
word.append(letter);
} else {
// Sends letter to buffer
if (seenLetters[letterIndex] < letters[letterIndex]) {
buffer.offer(letter);
}
}
}
System.out.print(word.toString());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n\n\n\n }",
"public void inputScanner(){\n\t\t Scanner sc=new Scanner(System.in); \n\t \n\t\t System.out.println(\"Enter your rollno\"); \n\t\t int rollno=sc.nextInt(); \n\t\t System.out.println(\"Enter your name\"); \n\t\t String name=sc.next(); \n\t\t System.out.println(\"Enter your fee\"); \n\t\t double fee=sc.nextDouble(); \n\t\t System.out.println(\"Rollno:\"+rollno+\" name:\"+name+\" fee:\"+fee); \n\t\t sc.close(); \n\t}",
"public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString line = sc.nextLine();\n\t\tString[] arr = line.split(\" \");\n\n\t\tint a = Integer.valueOf(sc.nextLine());\n\t\tint b = Integer.valueOf(sc.nextLine());\n\t\tint c = Integer.valueOf(sc.nextLine());\n\n\t\tSystem.out.println(getVal(arr, a));\n\t\tSystem.out.println(getVal(arr, b));\n\t\tSystem.out.println(getVal(arr, c));\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t}",
"public static String getStringInput() {\n Scanner in = new Scanner(System.in);\n return in.next();\n }",
"public static void main(String args[])\n {\n Scanner in=new Scanner(System.in);\n String str=in.nextLine();\n System.out.println(str);\n }",
"public static void main(String[] args) \n {\n Scanner sc = new Scanner(System.in); \n \n // String input\n System.out.print(\"What's your name? \"); \n String name = sc.nextLine(); \n \n // Print the values to check if input was correctly obtained. \n System.out.println(\"Name: \" + name); \n\n // Close the Scanner\n sc.close();\n }",
"public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\n String str=sc.next();\n String str1=sc.next();\n String str2=sc.next();\n String str3=sc.next();\n System.out.println(str);\n System.out.println(str1);\n System.out.println(str2);\n System.out.println(str3);\n\n\n }",
"public static void main(String[] args) {\n\t\tString s = \"We're learning about Scanner\";\n\t\tSystem.out.println(s);\n\t\tScanner sc = new Scanner(System.in);\n//\t\tint m = sc.nextInt();\n//\t\tint n = sc.nextInt();\n//\t\tSystem.out.println(\"The Value of m is: \"+m);\n//\t\tSystem.out.println(\"The Value of n is: \"+n);\n//\t\tdouble d = sc.nextDouble();\n//\t\tString name = sc.next();//Gives us one Word\n//\t\tSystem.out.println(\"Name is: \" + name);\n\t\t\n//\t\tString fullName = sc.nextLine();\n//\t\tSystem.out.println(\"Full Name is: \" + fullName);\n\t\t\n\t\tString intInput = sc.nextLine();\n\t\tint n = Integer.parseInt(intInput);\n\t\tSystem.out.println(n);\n\t}",
"public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\n\t}",
"public MyInput() {\r\n\t\tthis.scanner = new Scanner(System.in);\r\n\t}",
"public static void main(String[] args) {\n\n\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Testing Int Inputs\");\n System.out.print(\"Enter Number 1: \");\n int number1 = scanner.nextInt();\n System.out.println(number1);\n System.out.println(\"Enter Number 2: \");\n int number2 = scanner.nextInt();\n System.out.println(number2);\n }",
"public static String getString(){\n Scanner in = new Scanner(System.in); //scanner variable to take input\n return in.nextLine().trim();\n }",
"public void getInput(){\n\t\tScanner scan= new Scanner(System.in);\n\t\t//Get the range\n\t\tif(scan.hasNext()){\n\t\t\tcount=Integer.parseInt(scan.nextLine()); \n\t\t}\n\t\t//Initialize the array\n\t\tpeople = new People[count];\n\t\t//Get the array elements\n\t\tint i=0;\n\t\twhile(i<count){\n\t\t\tString lin[] = scan.nextLine().split(\" \");\n\t\t\tpeople[i] = new People(Integer.parseInt(lin[0]), Double.parseDouble(lin[1]));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t\n\t}",
"public Ch12Ex1to9()\n {\n scan = new Scanner( System.in );\n }",
"static void gatherInfo() {\n Scanner keyboard = new Scanner(System.in);\n System.out.print(\"Enter the type of measurement (inches, feet, etc.). >> \");\n measurementType = keyboard.nextLine();\n System.out.print(\"Enter the rectangle width. >> \");\n height = keyboard.nextDouble();\n System.out.print(\"Enter the rectangle height. >> \");\n width = keyboard.nextDouble();\n }",
"public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n String str = sc.nextLine();\n System.out.println(str);\n }",
"public static String GetInput() {\r\n\t\t// Scanner is created and a value is set for input\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tString input = in.nextLine();\r\n\t\treturn input;\r\n\r\n\t}",
"private static String getUserInput(String prompt){ \r\n Scanner in = new Scanner(System.in);\r\n System.out.print(prompt);\r\n return in.nextLine();\r\n }",
"public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in); \r\n\t\twhile(sc.hasNext()){\r\n\t\t\tint x=sc.nextInt();\r\n\t\t\tint y=sc.nextInt();\r\n\t\t\tint result=getResult(x,y);\r\n\t\t\tSystem.out.println(result);\r\n\t\t\t\r\n\t\t}\r\n\t}",
"void scanner() {\r\n\t\tSystem.out.println(\"---------- Scanner\" + ++exampleNumber\r\n\t\t\t\t+ \"----------\");\r\n\r\n\t\tString source = \"asdqw easd casa\";\r\n\t\tScanner s1 = new Scanner(source);\r\n\t\t// hasNext() - testuje wartosc kolejnego tokena, ale go nie pobiera\r\n\t\t// next() - pobiera kolejny token\r\n\t\t// domyslnie bialy znak jest delimiterem\r\n\t\twhile (s1.hasNext()) {\r\n\t\t\tSystem.out.println(s1.next());\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"---------- Scanner\" + ++exampleNumber\r\n\t\t\t\t+ \"----------\");\r\n\r\n\t\t// hasNextXxx() - dla wszystkich primitives oprocz chara\r\n\t\t// nextXxx() - pobiera kolejny prymitywny token\r\n\t\tScanner s2 = new Scanner(\"1 true 34 hi\");\r\n\t\tboolean b;\r\n\t\twhile (b = s2.hasNext()) {\r\n\t\t\tif (s2.hasNextInt()) {\r\n\t\t\t\tint i = s2.nextInt();\r\n\t\t\t\tSystem.out.println(\"integer token: \" + i);\r\n\t\t\t} else if (s2.hasNextBoolean()) {\r\n\t\t\t\tboolean b2 = s2.nextBoolean();\r\n\t\t\t\tSystem.out.println(\"boolean token: \" + b2);\r\n\t\t\t} else {\r\n\t\t\t\tString str = s2.next();\r\n\t\t\t\tSystem.out.println(\"String token: \" + str);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"---------- Scanner\" + ++exampleNumber\r\n\t\t\t\t+ \"----------\");\r\n\r\n\t\t// useDelimiter(delimiter) - ustawienie delimitera (wyrazenia regularnego) wg ktorego bedzie przetwarzany strumien\r\n\t\t// domyslnym delimiterem jest spacja, tabulator, ogolnie bialy znak lub znaki\r\n\t\tScanner s3 = new Scanner(\"Test1 true 34 hi\");\r\n\t\ts3.useDelimiter(\"\\\\d\"); // delimiterem jest cyfra\r\n\t\twhile (s3.hasNext()) {\r\n\t\t\tSystem.out.println(s3.next());\r\n\t\t}\r\n\t}",
"public static void init() {\n\t\tscanner = new Scanner(System.in);\n\t\treturn;\n\t}",
"public void get_UserInput(){\r\n\t Scanner s = new Scanner(System.in);\r\n\t // get User inputs \r\n\t System.out.println(\"Please enter a number for Dry (double):\");\r\n\t DRY = s.nextDouble();\r\n\t System.out.println(\"Please enter a number for Wet (double):\");\r\n\t WET = s.nextDouble(); \r\n\t System.out.println(\"Please enter a number for ISNOW (double):\");\r\n\t ISNOW = s.nextDouble();\r\n\t System.out.println(\"Please enter a number for Wind(double):\");\r\n\t WIND = s.nextDouble(); \r\n\t System.out.println(\"Please enter a number for BUO (double):\");\r\n\t BUO = s.nextDouble();\r\n\t System.out.println(\"Please enter a number for Iherb (int):\");\r\n\t IHERB = s.nextInt(); \r\n\t System.out.println(\"****Data for parameters are collected****.\");\r\n\t System.out.println(\"Data for parameters are collected.\");\r\n\t dry=DRY;\r\n\t wet=WET;\r\n}",
"public void getInfo() {\n Scanner scanner = new Scanner(System.in);\n //get values from the user using scanner and sets class variables appropriately\n System.out.print(\"Enter the first name: \");\n setFirstName(scanner.nextLine());\n\n System.out.print(\"Enter the last name: \");\n setLastName(scanner.nextLine());\n\n System.out.print(\"Enter the ZIP code: \");\n setZipcode(scanner.nextLine());\n\n System.out.print(\"Enter the employee ID: \");\n setEmployeeID(scanner.next());\n }",
"String readInput() {\n Scanner scanner = new Scanner(System.in);\n return scanner.nextLine();\n }",
"private void getInput() {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter a number\");\r\n\t\tn=scan.nextInt();\r\n\r\n\t}",
"@Test\n\tpublic void one()\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"enter the value of a\");\n\t\tint a = sc.nextInt();\n\t\tSystem.out.println(\"value of a is: \" +a);\n\t}",
"void Input() {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Enter name of the book::\");\n Bname = scanner.nextLine();\n System.out.println(\"Enter price of the book::\");\n price = scanner.nextDouble();\n }",
"private static Integer[] readInputFromUser(Scanner in) {\n\t\tInteger[] array = null;\n\t\t/**\n\t\t * Accept the quantity of the data along with actual data.\n\t\t */\n\t\tSystem.out.print(\"Please enter number of integers you want to input:\");\n\t\tint s = in.nextInt();\n\t\tarray = new Integer[s];\n\t\tSystem.out.print(\"Please enter Integers:\");\n\n\t\tfor (int i = 0; i < s; i++) {\n\t\t\tarray[i] = in.nextInt();\n\t\t}\n\t\tSystem.out.println(\"Input Array: \" + Arrays.toString(array));\n\t\treturn array;\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t\tScanner scanner = new Scanner(System.in);\r\n\t\t\r\n\t\tString name = scanner.nextLine();\r\n\r\n\t\tchar gender = scanner.next().charAt(0); // F\r\n\t\t\r\n\t\tint age = scanner.nextInt();\r\n\t\t\r\n\t\tlong mobileNo = scanner.nextLong();\r\n\t\t\r\n\t\tdouble cgpa = scanner.nextDouble();\r\n\t\t\r\n\t\tSystem.out.println(\"Name: \"+name);\r\n\t\tSystem.out.println(\"Gender: \"+gender);\r\n\t\tSystem.out.println(\"Age: \"+age);\r\n\t\tSystem.out.println(\"Mobile: \"+mobileNo);\r\n\t\tSystem.out.println(\"CGPA: \"+cgpa);\r\n\t\t\r\n\t\tSystem.out.println(\"Your name is: \"+name+\" \"+gender+\" \"+age);\r\n\t}",
"public static void main(String[] args) {\n Scanner scn = new Scanner(System.in);\r\n System.out.println(\"Introduzca un entero: \");\r\n int a = scn.nextInt();\r\n System.out.println(\"El numero introducido es el: \" + a);\r\n String b = scn.nextLine();\r\n System.out.println(b);\r\n String c = scn.next();\r\n System.out.println(c);\r\n }",
"private static Scanner determineInputSource(String[] args) throws FileNotFoundException{\n if (args.length > 0) {\n //Reading from file\n return new Scanner(new File(args[0]));\n }\n else {\n //Reading from standard Input\n return new Scanner(System.in);\n }\n }",
"public void userInput() {\r\n System.out.println(\"You want to convert from:\");\r\n this.fromUnit = in.nextLine();\r\n System.out.print(\"to: \");\r\n this.toUnit = in.nextLine();\r\n System.out.print(\"The value is \");\r\n this.value = in.nextDouble();\r\n }",
"private static double[] getInputs() {\n\t\tdouble[] inputs = new double[SIZE];\n\t\tint counter = 0;\n\t\t\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tSystem.out.print(\"Enter the \" + (counter + 1) + \" value: \");\n\t\t\t\tsc = new Scanner(System.in);\n\t\t\t\tdouble value = sc.nextDouble();\n\t\t\t\tinputs[counter] = value;\n\t\t\t\tcounter += 1;\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tSystem.out.println(\"Invalid datatype \" + e + \" please try again!\");\n\t\t\t}\n\t\t} while (counter != SIZE);\n\t\t\n\t\t//sc.close();\n\t\treturn inputs;\n\t}",
"public void input()\n\t{\n\t\t// this facilitates the output\n\t\tScanner sc = new Scanner(System.in) ; \n\t\tSystem.out.print(\"The Bike Number:- \") ;\n\t \tthis.bno = sc.nextInt() ; \t\n\t\tSystem.out.print(\"The Biker Name:- \") ; \n\t \tthis.name = new Scanner(System.in).nextLine() ; \t\n\t\tSystem.out.print(\"The Phone number:- \") ; \n\t \tthis.phno = sc.nextInt() ; \t\n\t\tSystem.out.print(\"The number of days:- \") ; \n\t \tthis.days = sc.nextInt() ; \t\n\t}",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n // String input\n String first = sc.nextLine();\n System.out.println(first);\n\n }",
"@Override\n public T getData() {\n Scanner scanner = new Scanner(System.in);\n return (T) scanner.next();\n }",
"public void input(Scanner in) { \r\n if (in.hasNext()) firstName = in.next();\r\n if (in.hasNext()) lastName = in.next();\r\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\twhile(sc.hasNext()) {\n\t\t\tString input = sc.nextLine();\n\t\t\tSystem.out.println(input);\n\t\t\tif(input == null || input==\"\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public static void take_inputs(){\n\t\tScanner in = new Scanner(System.in);\n\t\tSystem.out.println(\"Input the ideal restaurant attributes:\");\n\t\tSystem.out.print(\"Cheap: \"); cheap = in.nextFloat();\n\t\tSystem.out.print(\"Nice: \"); nice = in.nextFloat();\n\t\tSystem.out.print(\"Traditional: \"); traditional = in.nextFloat();\n\t\tSystem.out.print(\"creative: \"); creative = in.nextFloat();\n\t\tSystem.out.print(\"Lively: \"); lively = in.nextFloat();\n\t\tSystem.out.print(\"Quiet: \"); quiet = in.nextFloat();\n\t\t\n\t\tSystem.out.println(\"Input the attributes weights:\");\n\t\tSystem.out.print(\"Weight for Cheap: \"); wt_cheap = in.nextFloat();\n\t\tSystem.out.print(\"Weight for Nice: \"); wt_nice = in.nextFloat();\n\t\tSystem.out.print(\"Weight for Traditional: \"); wt_traditional = in.nextFloat();\n\t\tSystem.out.print(\"Weight for creative: \"); wt_creative = in.nextFloat();\n\t\tSystem.out.print(\"Weight for Lively: \"); wt_lively = in.nextFloat();\n\t\tSystem.out.print(\"Weight for Quiet: \"); wt_quiet = in.nextFloat();\n\t}",
"public static void main(String[] args) {\nScanner sc= new Scanner(System.in);\nString name=sc.nextLine();\n\t\tSystem.out.println(\"hello\\n\"+name);\n\t\t\n\t}",
"private String getUserInput(Scanner sc) {\n\t\t\n\t\tif (sc == null) {\n\t\t\treturn null;\n\t\t}\n\n\t System.out.print(\"\\nctransfer > \");\n\t return sc.nextLine();\n\t}",
"public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\t\n\t\tint x = scanner.nextInt();\n\t\tSystem.out.println(\"Gia tri cua x la \" + x);\n\t\t\n\t\tSystem.out.println(\"Vui long nhap gia tri cua y va z :\");\n\t\tlong y = scanner.nextLong();\n\t\tdouble z = scanner.nextDouble();\n\t\tdouble tong = z + y;\n\t\tSystem.out.println(\"Tong gia tri cua y va z la \" + tong);\n\t\t\n\t\tboolean b = scanner.nextBoolean();\n\t\tshort s = scanner.nextShort();\n\t\tString str = scanner.nextLine();\n\t}",
"public static void main(String[] args) {\n\t\t\n\tScanner scan = new Scanner(System.in);\n\t\n\tSystem.out.print(\"Enter a value: \");\n\tbyte num = scan.nextByte();\n\t\n\t\n\tScanner input = new Scanner(System.in);\n\t\n\tSystem.out.print(\"Enter another value: \");\n\tint n = input.nextInt();\n\t\n\t\n\tScanner car = new Scanner(System.in);\n\t\n\tSystem.out.print(\"Enter third value: \");\n\tint nn = car.nextInt();\n\t\n\tSystem.out.print(\"The total value is: \" + (num + n + nn));\n\n\t\n\t\n\t\n\t}",
"public static void getString()\n\t{\n\t\t\n\t\tScanner s=new Scanner(System.in);\n\t\t\n\t\t//Here Scanner is the class name, a is the name of object, \n\t\t//new keyword is used to allocate the memory and System.in is the input stream. \n\t\t\n\t\tSystem.out.println(\"Entered a string \");\n\t\tString inputString = s.nextLine();\n\t\tSystem.out.println(\"You entered a string \" + inputString );\n\t\tSystem.out.println();\n\t}",
"public static void getInput() {\n\t\tSystem.out.print(\"Expression y=? \");\n\t\tScanner s = new Scanner(System.in);\n\t\texpression = s.nextLine();\n\t\texpression.toLowerCase();\n\t\tSystem.out.print(\"x? \");\n\t\tx = s.nextDouble();\n\t}",
"public static String readUserInput() {\n return in.nextLine();\n }",
"public static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tint n = scn.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr[i] = scn.nextInt();\n\t\t}\n\t\tSystem.out.println(val(arr));\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tScanner sc=new Scanner(System.in);\n\t\twhile(sc.hasNextLine()){\n\t\t\tString str=sc.nextLine();\n\t\t\t\n\t\t\t\n\t\t}\n\n\t}",
"public static void main(String[] args) {\n\t\t \n\t\tScanner scanner=new Scanner(System.in);\n\t\tUtility utility=new Utility();\n\t\n\t\tdouble c;\n\tSystem.out.println(\"enter the number\");\n\t\tc=scanner.nextInt();\n\n\t\tutility.newt(c);\n\t\tscanner.close();\n\t}",
"public static void main(String[] args) {\n\n\t\tScanner console = new Scanner(System.in);\n\t\tint numEntries = console.nextInt();\n\t\tfor(int ii = 0; ii < numEntries; ii++){\n\t\t\tconsole.nextLine();\n\t\t\tString lineScan = console.nextLine();\n\t\t}\n\t}",
"public static void main(String args[])throws IOException\n\t{\n\tScanner obj=new Scanner(System.in);\n\n\t//Entering a string\n\tSystem.out.println(\"\\nEnter a string !\");\n\tString s=obj.nextLine();\n\tSystem.out.println(\"you have entered \"+ s);\n\n\t//entering a word\n\tSystem.out.println(\"\\nEnter a word !\");\n\tString w=obj.next();\n\n\t//entering an integer\n\tSystem.out.println(\"\\nEnter an integer !\");\n\tint n=obj.nextInt();\n\n\t//entering a float\n\tSystem.out.println(\"\\nEnter a floating point number !\");\n\tfloat f=obj.nextFloat();\n\n\t//Printing the inputs\n\tSystem.out.println(\"\\nThe inputs are .....\");\n\tSystem.out.println(\"\\nWord : \"+w+\"\\nInteger : \"+n+\"\\nFloat : \"+f);\n\n\n}",
"public static void main(String[] args) {\n\t\tScanner reader=new Scanner(System.in);\r\n\t\tSystem.out.println(\"what is u r name\");\r\n\t\tString name=reader.next();\r\n\t\tSystem.out.println(\"u r name is\"+ name);\r\n\t\tScanner reader1=new Scanner(System.in);\r\n\t\tSystem.out.println(\"how old r u\");\r\n\t\tint age=reader1.nextInt();\r\n\t\tSystem.out.println(\" u r age is\"+ age);\r\n\t\t\r\n\r\n\t}",
"public static void main(String[] args) {\n\t\r\n\t\tScanner reader=new Scanner(System.in);\r\n\t\tSystem.out.println(\"Input person's name\");\r\n\t\tString name=reader.next(); \r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\"Input person's age\");\r\n\t\tint age=reader.nextInt(); \r\n\t\t\r\n\t\tSystem.out.println(\"Input person's occupation\");\r\n\t\tString occupation=reader.next();\r\n\t\t\r\n\t\tSystem.out.println(\"Person's name is \"+ name); \r\n\t\tSystem.out.println(\"Person's age is \"+ age); \r\n\t\tSystem.out.println(\"Person's occupation is \"+ occupation);\r\n\t\r\n\t}",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tprocess(s);\n\t}",
"public static void main (String[] args) {\n Scanner s = new Scanner(System.in);\n System.out.print(SimpleSymbols(s.nextLine())); \n }",
"public static void main (String[] args) {\n Scanner s = new Scanner(System.in);\n System.out.print(SimpleSymbols(s.nextLine())); \n }",
"private static void scan() {\n\t\tt = la;\n\t\tla = Scanner.next();\n\t\tla.toString();\n\t\tsym = la.kind;\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n while (scanner.hasNext()) {\n int N = scanner.nextInt();\n int sum = 0;\n for (int i = 0; i < N; i++) {\n sum += scanner.nextInt();\n }\n System.out.println(sum);\n }\n }",
"public Menu() {\n scanner = new Scanner(System.in);\n }",
"public Ui() {\n this.scanner = new Scanner(System.in);\n }",
"public Ui() {\n this.scanner = new Scanner(System.in);\n }",
"public static void main(String[] args) {\n\t\t\n\t\tInputStream input = System.in;\n\t\tScanner scanner = new Scanner(input);\n\t\t// nextLine()을 실행하기 전에 \n\t\t// 무엇을 해야할지 알려주는 메시지를 먼저 출력 하라.\n\t\t// 이를 'prompt(프롬프트)' 라고 한다\n\t\tSystem.out.println(\"문자열을 입력후 Enter....\");\n\t\tString strInput = scanner.nextLine();\n\t\tSystem.out.println(strInput);\n\n\t}",
"public static String dato(){\n String dato=null;\n \n try {\n Scanner leer=new Scanner(System.in);\n dato=leer.next();\n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n return dato;\n }",
"public static void main(String[] args) {\n\t\t\t\tScanner scanner = new Scanner(System.in); \r\n\t\t\t\tSystem.out.print(\"Enter first number \");\r\n\t\t\t\t\r\n\t\t\t\t//Scans the next token of the input as an int and pass to firstValue \r\n\t\t\t\tint firstValue = scanner.nextInt();\r\n\t\t\t\tSystem.out.print(\"Enter second number \");\r\n\t\t\t\t\r\n\t\t\t\t//Scans the next token of the input as an int and pass to secondValue \r\n\t\t\t\tint secondValue = scanner.nextInt();\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"First number is: \"+ firstValue);\r\n\t\t\t\tSystem.out.println(\"Second number is: \"+ secondValue);\r\n\t\t\t\t\r\n\t\t\t\t//Calling method sum which prints the sum of two numbers\r\n\t\t\t\tsum(firstValue , secondValue);\r\n\r\n\t\t\t\t\r\n\r\n\t}",
"public String weiterSpielen(){\n Scanner keyboard = new Scanner(System.in);\n return keyboard.nextLine();\n }",
"public String userCommand(){\n return scanner.nextLine();\n }",
"public String userInputString() {\n Scanner scanner = new Scanner(System.in);\n return scanner.nextLine();\n }",
"public void readEmployeeData(){\r\n Scanner input = new Scanner(System.in);\r\n System.out.print(\"Enter the yearly salary of employee: \");\r\n salary = input.nextDouble();\r\n }",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\n\t\tprocess(s);\n\n\t}",
"public String getUserInput(String question) {\r\n System.out.print(question);\r\n return scanner.next();\r\n }",
"public static void main(String[] args) {\r\n //create a scanner to obtain input from the console window\r\n\r\n Scanner input = new Scanner(System.in);\r\n\r\n System.out.print(\"Enter Name \"); //prompt\r\n String name1 = input.nextLine(); //read first number from user \r\n\r\n System.out.print(\"Enter age: \"); //prompt\r\n\r\n int num2 = input.nextInt(); //read second number from user \r\n\r\n input.close();\r\n\r\n\r\n \r\n\r\n System.out.println(\"Your name is \" + name1 + \" You are \"+ num2 + \" years old\");\r\n\r\n }",
"public static int getInput() {\n Scanner in = new Scanner(System.in);\n\n return in.nextInt();\n }",
"public static void main (String[] args) throws java.lang.Exception\r\n\t{\n\t\tScanner sc=new Scanner(System.in);int f=0;\r\n\t\twhile(sc.hasNext()){\r\n\t\tint t=sc.nextInt();\r\n\t\t\r\n\t\tif(t==42) f=1;\r\n\t\tif(f==0) System.out.println(t);\r\n\t\t}\r\n\t}",
"private void getInput() {\n\t\tSystem.out.println(\"****Welcome to TNEB online Payment*****\");\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter your current unit\");\r\n\t\tunit = scan.nextInt();\r\n\t}",
"public static String getInput() {\n\t\tScanner inputReader = new Scanner(System.in);\n\t\tString userInput;\n\t\tuserInput = inputReader.nextLine();\n\t\treturn userInput;\n\t}",
"public static void main(String[] args) throws IOException {\n Scanner scanner = new Scanner(System.in);\n /* Use nextInt to get user integer */\n System.out.print(\"Enter Integer:\\n\");\n try{\n int i = scanner.nextInt();\n System.out.printf(\"%d\\n\", i);\n }catch(NumberFormatException nfe){\n System.err.println(\"Invalid Format!\\n\");\n }\n /* Use next to get 3 strings from user */\n System.out.println(\"Enter 3 words:\");\n String first = scanner.next();\n String second = scanner.next();\n String third = scanner.next();\n\n System.out.printf(\"%s %s %s\\n\", first, second, third);\n\n /* Use nextLine to capture user sentence */\n System.out.println(\"Enter a sentence:\");\n try{\n String userSentence = scanner.nextLine();\n userSentence = scanner.nextLine();\n System.out.printf(\"%s\\n\", userSentence);\n }catch(NumberFormatException nfe){\n System.out.println(\"No sentence\");\n }\n\n System.out.println(\"Enter length: \");\n int length = scanner.nextInt();\n\n System.out.println(\"Enter width: \");\n int width = scanner.nextInt();\n\n System.out.printf(\"area: %d\\n\", length*width);\n System.out.printf(\"perimeter: %d\\n\", 2*length+2*width);\n\n // close the scanner\n scanner.close();\n }",
"public static void setInputScanner(InputScanner scanner){\n inputScanner = scanner;\n }",
"private void readFromConsole(){\n Scanner cin = new Scanner(System.in);\n\n if(cin.hasNext()){\n number = cin.nextInt();\n }\n array = new long[number];\n\n for(int num = 0; num < number; num++){\n if(cin.hasNext()){\n array[num] = cin.nextLong();\n }\n }\n }",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint num = scan.nextInt();\n\t\tresult(num);\n\t}",
"private static String[] collectInput() {\n\t\tString command = sc.next();\n\t\tString i = sc.next();\n\t\tString destination = sc.next();\n\t\treturn new String[] { command, destination };\n\t\t\n\t}",
"private static String[] collectInput(Scanner sc) {\n\t\tString y1= \"north\";\n\t\tString y2 = \"south\";\n\t\tString y3 = \"east\";\n\t\tString y4 = \"west\"; \n\t\tString y5 = \"0\";\n\t\t\n\t\tSystem.out.println(\"\\n Choose a direction north, south, east, or west\");\n\t\tSystem.out.println(\"Press 0 to end the programd\");\n\t\n\t\t\tString y = sc.nextLine();\n\t\t\tif(y.equals(y1)) {\n\t\t\t\tSystem.out.println(\"You travel north\");\n\t\t\t} \telse if(y.equals(y2)) {\n\t\t\t\tSystem.out.println(\"You travel south\");\n\t\t\t} \telse if(y.equals(y3)) {\n\t\t\t\tSystem.out.println(\"You travel east\");\n\t\t\t} \telse if(y.equals(y4)) {\n\t\t\t\tSystem.out.println(\"You travel west\");\n\t\t\t} \telse if(y.equals(y5)) {\n\t\t\t\tSystem.out.println(\"Exiting\");\n\t\t\t\tSystem.exit(0);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Not a valid direction \");\n\t\t\t}\n\t\t\t\n\t\treturn null;\n\t}",
"public static String inputCommand() {\n String command;\n Scanner in = new Scanner(System.in);\n\n command = in.nextLine();\n\n return command;\n }",
"public static void main(String[] args) {\n\t\tScanner entrada = new Scanner(System.in);\n\t\tint numEntero;\n\t\tfloat numFlotante;\n\t\tchar caracter;\n\t\tString cadena;\n\t\t\n\t\tSystem.out.print(\"Ingrese un numero entero: \");\n\t\tnumEntero = entrada.nextInt();\n\t\tSystem.out.println(\"El numero ingresado es: \" + numEntero);\n\t\t\n\t\tSystem.out.print(\"Ingrese un numero float: \");\n\t\tnumFlotante = entrada.nextFloat();\n\t\tSystem.out.println(\"El numero ingresado es: \" + numFlotante);\n\t\t\n\t\t//CharaAt con indice 0 hace que el primer caracter ingresado sea \n\t\t//el que se va a guardar\n\t\tSystem.out.print(\"Ingrese un caracter: \");\n\t\tcaracter = entrada.next().charAt(0); \n\t\tSystem.out.println(\"El numero ingresado es: \" + caracter);\n\t\t\n\t\tSystem.out.print(\"Ingrese una cadena: \");\n\t\tcadena = entrada.next();\n\t\tSystem.out.println(\"El numero ingresado es: \" + cadena);\n\t\t\n\t\t\n\t\t\n\t}",
"static InputScanner getInputScanner() {\n return inputScanner;\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\t\n\t\tString digito1 = sc.nextLine();\n\t\tString digito2 = sc.nextLine();\n\t\tString digito3 = sc.nextLine();\n\t\tconvertir_decimal(digito1);\n\t\tconvertir_decimal(digito2);\n\t\tconvertir_decimal(digito3);\n\t\t\t\n\t\t\n\t\tsc.close();\n\t}",
"public static void main(String[] args) {\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tString a = scan.next();\r\n\t\tint x = Integer.parseInt(a);\r\n\t\tList<Integer> list = new ArrayList<>();\r\n\t\twhile (scan.hasNextInt()) {\r\n\t\t\tlist.add(scan.nextInt());\r\n\t\t}\r\n\t\tif (x > list.size()) {\r\n\t\t\tSystem.out.println(\"NIL\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.println(list.get(list.size() - x));\r\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tString hello = sc.nextLine();\n\t\tSystem.out.println(hello);\n\n\n\t}",
"public static void main(String[] args) {\nScanner s=new Scanner(System.in);\r\nSystem.out.println(\"Enter the school name\");\r\nString a=s.next();\r\nSystem.out.println(\"Enter the student name\");\r\nString b=s.next();\r\nSystem.out.println(\"Enter the roll name\");\r\nString a=s.next();\r\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n String[] tokens = scanner.nextLine().split(\"\\\\s\");\n String search = scanner.nextLine().trim();\n System.out.println(Collections.frequency(List.of(tokens), search));\n }",
"public static void main(String[] args) {\n Scanner num = new Scanner(System.in);\n for (int i = 0; i < 4; i++) {\n int number = num.nextInt();\n System.out.println(number);\n }\n }",
"public static void main(String[] args) {\n\t\t\n\t\tScanner input = new Scanner(System.in);\n\t\t \n\t\tSystem.out.println(\"Enter street address:\");\n\t\t \n\t\tint houseNumber = input.nextInt();\n\t\tString street = input.nextLine(); // instead of next(); which only reads to next space.\n\t\t \n\t\tSystem.out.println(\"house number is \" + houseNumber);\n\t\tSystem.out.println(\"street is \" + street);\n\t\t\n\t\tinput.close();\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\r\n\t\tString s=sc.nextLine();\r\n\t\tStringTokenizer st=new StringTokenizer(s,\":\");\r\n\t\twhile(st.hasMoreTokens())\r\n\t\t{\r\n\t\t\tSystem.out.println(st.nextToken());\r\n\t\t}\r\n\r\n\t}",
"private void start() {\n Scanner scanner = new Scanner(System.in);\n \n // While there is input, read line and parse it.\n String input = scanner.nextLine();\n TokenList parsedTokens = readTokens(input);\n }",
"public static void main(String[] args)\n {\n Scanner scan = new Scanner(System.in);\n String s = scan.next();\n int k = scan.nextInt();\n scan.close();\n\n System.out.println(getSmallestAndLargest(s, k));\n }",
"public static void main(String[] args) {\n\t\tScanner ler = new Scanner(System.in);\n\n\t\tString sentence = ler.nextLine();// ate o \\n (enter)\n\t\tString x, y, z;\n\t\tx = ler.next();\n\t\ty = ler.next();\n\t\tz = ler.next();\n\n\t\tSystem.out.println(sentence);\n\t\tSystem.out.println(x);\n\t\tSystem.out.println(y);\n\t\tSystem.out.println(z);\n\n\t\tx = ler.next();\n\t\ty = ler.next();\n\t\tz = ler.next();\n\t\tSystem.out.println(x);\n\t\tSystem.out.println(y);\n\t\tSystem.out.println(z);\n\t\tler.close();\n\t}",
"public static void main(String[] args) {\n\t\tScanner in=new Scanner(System.in);\n\t\twhile(in.hasNext()){\n\t\t\tString strIn=in.nextLine();\n\t\t\tString strOut=processing(strIn);\n\t\t\tSystem.out.println(strOut);\n\t\t}\n\t\tin.close();\n\t}",
"public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint min=Integer.MAX_VALUE;//2147483647;\n\t\t\tint max =Integer.MIN_VALUE;//-2147483648;\n\t\tint num=0;\n\t\tboolean first = true;\n\t\twhile(true)\n\t\t{\n\t\t\tSystem.out.println(\"Please enter numbers: \");\n\t\t\tif(scanner.hasNextInt())\n\t\t\t{\n\t\t\t\tnum= scanner.nextInt();\n\t\t\t\tif(first)\n\t\t\t\t{\n\t\t\t\t\tfirst = false;\n\t\t\t\t\tmin= num;\n\t\t\t\t\tmax= num;\n\t\t\t\t}\n\t\t\t\tif(min > num)\n\t\t\t\t{\n\t\t\t\t\tmin = num;\n\t\t\t\t}\n\t\t\t\tif(max < num)\n\t\t\t\t{\n\t\t\t\t\tmax = num;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Min is \" + min + \" Max is \" + max);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tscanner.nextLine();\n\t\t}\n\t\t\n\n\t}",
"String consoleInput();",
"private static double getUserInputCelsius() {\n Scanner input = new Scanner(System.in);\n double celsius = input.nextDouble();\n\n return celsius;\n }",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n //Reads ints from user\n int class1 = scanner.nextInt();\n int class2 = scanner.nextInt();\n int class3 = scanner.nextInt();\n\n //Your code goes here\n class1 = class1/2 + class1%2;\n class2 = class2/2 + class2%2;\n class3 = class3/2 + class3%2;\n int total = class1 + class2 + class3;\n System.out.print(total);\n\n // closing the scanner object\n scanner.close();\n }"
] | [
"0.7234384",
"0.6970491",
"0.69697267",
"0.67532045",
"0.66917855",
"0.6667758",
"0.66325784",
"0.6630381",
"0.6626196",
"0.6611392",
"0.6590251",
"0.6585407",
"0.6544522",
"0.65392214",
"0.65153354",
"0.6496249",
"0.64924765",
"0.6486762",
"0.6486206",
"0.64658344",
"0.6440603",
"0.6426895",
"0.6416586",
"0.640903",
"0.63852453",
"0.63816434",
"0.636638",
"0.6360261",
"0.6345548",
"0.6336084",
"0.63204515",
"0.62969226",
"0.6272373",
"0.62674814",
"0.6267275",
"0.62577814",
"0.62550265",
"0.6232418",
"0.6229804",
"0.62243074",
"0.6215243",
"0.61914855",
"0.6175966",
"0.6172729",
"0.61684656",
"0.6160015",
"0.61522394",
"0.6141923",
"0.61410034",
"0.6137173",
"0.61367905",
"0.61323416",
"0.6120177",
"0.6111703",
"0.6108602",
"0.61071074",
"0.61071074",
"0.6105914",
"0.61048263",
"0.61009973",
"0.60951436",
"0.60951436",
"0.60938054",
"0.6078923",
"0.6062044",
"0.60614616",
"0.60502815",
"0.60404396",
"0.603613",
"0.6025742",
"0.6021256",
"0.6020065",
"0.6017199",
"0.60068953",
"0.60041106",
"0.60023725",
"0.5995473",
"0.59829617",
"0.59779227",
"0.59707505",
"0.59698105",
"0.59579647",
"0.59555006",
"0.59531134",
"0.5952816",
"0.5945329",
"0.5944108",
"0.59359735",
"0.5927961",
"0.5924258",
"0.59059894",
"0.5902928",
"0.5901482",
"0.590095",
"0.5899583",
"0.58901864",
"0.58881605",
"0.5881747",
"0.5872395",
"0.5864057",
"0.5863746"
] | 0.0 | -1 |
Inflate the layout for this fragment | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View fragmentView = inflater.inflate(R.layout.fragment_quiz_intro_nasilje, container, false);
WebView webView = fragmentView.findViewById(R.id.webViewKviz1);
webView.loadUrl("file:///android_asset/upute_kviz__nasilje.html");
unbinder = ButterKnife.bind(this, fragmentView);
return fragmentView;
} | {
"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 |
Convert the given object to string with each line indented by 4 spaces (except the first line). | private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPACES);\n }",
"private String toIndentedString(Object o)\n/* */ {\n/* 128 */ if (o == null) {\n/* 129 */ return \"null\";\n/* */ }\n/* 131 */ return o.toString().replace(\"\\n\", \"\\n \");\n/* */ }",
"private String toIndentedString( Object o )\n {\n if ( o == null )\n {\n return \"null\";\n }\n return o.toString().replace( \"\\n\", \"\\n \" );\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }"
] | [
"0.7884939",
"0.7549351",
"0.74972624",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987"
] | 0.0 | -1 |
///////////////////////////////////////////////////////////////////////// Helper Methods Determines if CDFS is able to create a diagram from the element | protected boolean canDiagramBeCreatedFromElement(IElement pElement)
{
boolean canCreate = false;
if (pElement != null)
{
// fix for CR 6417670
// IDerivationClassifier is also an instance of IRelationship, so return false only if
// pElement is not of type IDerivationClassifier.
if (pElement instanceof IDiagram ||
pElement instanceof ISourceFileArtifact ||
(pElement instanceof IRelationship && !(pElement instanceof IDerivationClassifier)) )
{
return false;
}
// We shouldn't be able to select elements under an interaction and CDFS.
// Therefore, we should disable the CDFS menu if you select any children
// of the interaction.
IElement owner = pElement.getOwner();
if (owner == null)
return false;
if (owner instanceof IInteraction ||
pElement instanceof IMessage ||
pElement instanceof ICombinedFragment ||
pElement instanceof IOperation ||
pElement instanceof IAttribute)
{
// For operations, we have to make sure the operation can be REed
// in order to support CDFS
if (pElement instanceof IOperation)
{
// canCreate = false;
// IUMLParsingIntegrator integrator = getUMLParsingIntegrator();
// boolean canRE = integrator.canOperationBeREed((IOperation) pElement);
// if (canRE)
// {
canCreate = true;
// }
}
}
else
{
canCreate = true;
}
}
return canCreate;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static boolean isDiagram(Filesystem element) {\r\n\t\treturn true;\r\n\t}",
"private static boolean isDiagram(ConfigurableUnit element) {\n\t\treturn true;\n\t}",
"private static boolean isDiagram(AbstractEditor element){\n\t\treturn true;\n\t}",
"public boolean comesFromDiagramElement() {\n return getOriginalElement() != null;\n }",
"public boolean canLayout(ILayoutContext context) {\n\t\tPictogramElement pe = context.getPictogramElement();\r\n\t\tif (!(pe instanceof ContainerShape))\r\n\t\t\treturn false;\r\n\t\tEList<EObject> businessObjects = pe.getLink().getBusinessObjects();\r\n\t\treturn businessObjects.size() == 1 && businessObjects.get(0) instanceof Statement;\r\n\t}",
"boolean isDirected();",
"public boolean isDirected();",
"public boolean isDirected();",
"boolean isDml();",
"private boolean isSupportedModelElement(ModelElement modelElement, Diagram diagram) {\n Set<Class> allowedElements = DIAGRAM_ELEMENTS_MAP.get(DeployHelper.getTypeInfo(diagram));\n for (Class<?> class1 : allowedElements) {\n if (class1.isAssignableFrom(modelElement.getClass())) {\n return true;\n }\n }\n return false;\n }",
"public boolean isDescriptorOnly();",
"EObject getDiagrammableElement();",
"protected boolean canPaintGraph() {\r\n\t\treturn pv.canPaintGraph;\r\n\t}",
"public boolean getIsVisualElementContainer()\n {\n return root.getType().isAssignableTo(standardDefs.INTERFACE_IVISUALELEMENTCONTAINER);\n }",
"boolean hasDimension();",
"public boolean isDrawn();",
"protected boolean isStructureKnown() {\n\t\ttry {\n\t\t\treturn ((OpenableElementInfo) getElementInfo()).isStructureKnown();\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}",
"boolean hasIsNodeOf();",
"public boolean isModelChartIsVisible();",
"private boolean checkforCreating(Object element) {\n\t\tif (element == null) {\n\t\t\treturn false;\n\t\t}\n\t\tif (element instanceof Entity) {\n\t\t\tEntity entity = (Entity) element;\n\t\t\tObject entitryValue = entity.getValue(\"autocreate\");\n\t\t\tif (entitryValue != null && entitryValue instanceof Boolean) {\n\t\t\t\treturn (Boolean) entitryValue;\n\t\t\t}\n\t\t}\n\t\tif (element instanceof List<?>) {\n\t\t\tList<?> collection = (List<?>) element;\n\t\t\tfor (Object item : collection) {\n\t\t\t\tif (checkforCreating(item)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"boolean hasHasCFD();",
"public boolean isDirected(Position ep) throws InvalidPositionException;",
"boolean hasIsVertexOf();",
"public boolean initialConditions() {\n\n boolean evaluable;\n\n\n evaluable = diag.directedLinks();\n\n if (evaluable == false) {\n System.out.print(\"Influence Diagram with no directed links\\n\\n\");\n return (false);\n }\n\n evaluable = ((((IDWithSVNodes) diag).hasOnlyOneTerminalSVNode())\n || (((IDWithSVNodes) diag).hasOnlyOneValueNode()));\n\n\n if (evaluable == false) {\n System.out.print(\"Influence Diagram with 0 or more than 1 terminal super value nodes\\n or hasn't got an only utility node\\n\");\n return (false);\n }\n\n evaluable = diag.hasCycles();\n if (evaluable == true) {\n System.out.print(\"Influence Diagram with cycles\\n\\n\");\n return (false);\n }\n\n diag.addNonForgettingArcs();\n\n evaluable = diag.pathBetweenDecisions();\n if (evaluable == false) {\n System.out.print(\"Influence Diagram with non ordered decisions\\n\\n\");\n return (false);\n }\n\n evaluable = ((IDWithSVNodes) diag).isTreeStructureSV();\n if (evaluable == false) {\n System.out.print(\"Influence Diagram whose structure of value nodes isn't a tree\\n\\n\");\n return (false);\n }\n\n // Remove barren nodes\n\n //diag.eliminateRedundancy();\n diag.removeBarrenNodes();\n\n\n\n // Return true if OK\n\n return (true);\n }",
"boolean hasFillBehavior();",
"public void _getDiagramType() {\n result = true;\n\n String stype = oObj.getDiagramType();\n log.println(\"Current Diagram Type is \" + stype);\n result = (stype.startsWith(\"com.sun.star.chart.\"));\n\n tRes.tested(\"getDiagramType()\", result);\n }",
"protected abstract boolean isShapeSimple();",
"public boolean getModelChartIsVisible();",
"boolean hasIsBoundaryNodeOf();",
"boolean isValid() {\n\t\tif (this.nodeImpl != null) {\n\t\t\t\n\t\t\tfor (AbstractImplementationArtifact ia : this.nodeImpl.getImplementationArtifacts()) {\n\t\t\t\tboolean matched = false;\n\t\t\t\tfor (AbstractImplementationArtifact handledIa : this.ias) {\n\t\t\t\t\tif (ia.equals(handledIa)) {\n\t\t\t\t\t\tmatched = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!matched) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t} else {\n\t\t\t\n\t\t\tfor (AbstractImplementationArtifact ia : this.relationImpl.getImplementationArtifacts()) {\n\t\t\t\tboolean matched = false;\n\t\t\t\tfor (AbstractImplementationArtifact handledIa : this.ias) {\n\t\t\t\t\tif (ia.equals(handledIa)) {\n\t\t\t\t\t\tmatched = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!matched) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t}",
"public boolean isConicalView();",
"@Override\n public boolean isOpen(){\n boolean statement = isElementPresent(czDppButon); //TODO - zmena na pozdejsi stranku\n if(!statement){ DriverSettings.takeScreenshot(); }\n return statement;\n }",
"boolean isDrawOnChartArea();",
"boolean hasElement();",
"private static boolean supportsDnD()\r\n { // Static Boolean\r\n if (supportsDnD == null)\r\n {\r\n boolean support = false;\r\n try\r\n {\r\n //Class arbitraryDndClass = Class.forName(\"java.awt.dnd.DnDConstants\");\r\n support = true;\r\n } // end try\r\n catch (Exception e)\r\n {\r\n support = false;\r\n } // end catch\r\n supportsDnD = new Boolean(support);\r\n } // end if: first time through\r\n return supportsDnD.booleanValue();\r\n }",
"boolean isLocator();",
"public boolean isPracticallyEmpty() {\n\treturn getDimension()==0 ||\n\t getDimension()==1 && id2label.elementAt(0).equals(DUMMY_LABEL);\n }",
"boolean hasInputConstraints();",
"public boolean isDynamicGraph();",
"@Override\n public boolean isRealFigure() {\n return getD() > 0 && super.isRealFigure();\n }",
"DiagramElement getDiagramElement();",
"boolean isComposite();",
"boolean isComposite();",
"public boolean isPaintable() {\n\t\treturn false;\n\t}",
"private boolean isCoupledGraphSelected() {\n\t\treturn (getMainTabbedPane().getSelectedComponent().getName().equals(\"Coupled\"));\n\t}",
"boolean isDrawOutline(DrawContext dc, Object shape);",
"boolean hasMosaicLayout();",
"boolean hasDataset();",
"boolean hasExternalAttributionModel();",
"@Override\n public boolean isSetupToBeDrawn() {\n return !(designParameters == null || slabStrip == null || graphicsContext == null || colour == null || slabImageScale == 0);\n }",
"@objid (\"58ecd897-1664-48d8-b3fb-730128135689\")\n @Override\n public boolean isAvailable(AbstractDiagram diagram, ISelection selection) {\n if (SelectionHelper.size(selection) != 1) {\n return false;\n }\n \n // In a BPMN diagram\n if (!(diagram instanceof BpmnSubProcessDiagram) && !(diagram instanceof BpmnProcessCollaborationDiagram)) {\n return false;\n }\n \n MObject elt = SelectionHelper.getFirst(selection, MObject.class);\n return elt != null && !this.targetMetaclass.equals(elt.getMClass().getName());\n }",
"private boolean revisar(DigrafoAristaPonderada G) {\n\n // edge-weighted digraph is cyclic\n if (tieneCiclo()) {\n // verify ciclo\n AristaDirigida primero = null, ultimo = null;\n for (AristaDirigida a : ciclo()) {\n if (primero == null) primero = a;\n if (ultimo != null) {\n if (ultimo.hacia() != a.desde()) {\n System.err.printf(\n \"aristas de ciclo %s and %s no incidentes\\n\",\n ultimo, a);\n return false;\n }\n }\n ultimo = a;\n }\n\n if (ultimo.hacia() != primero.desde()) {\n System.err.printf(\n \"aristas de ciclo %s and %s no incidentes\\n\", \n ultimo, primero);\n return false;\n }\n }\n\n\n return true;\n }",
"public boolean AssetIDEnable() {\r\n\t\t// return IsElementEnabledStatus(DefineSetup_AssetID_txtBx);\r\n\t\t// DefineSetup_AssetID_txtBx.isDisplayed();\r\n\t\t// return DefineSetup_AssetID_txtBx.isDisplayed();\r\n\t\treturn IsElementEnabledStatus(DefineSetup_AssetID_txtBx);\r\n\t}",
"private boolean isListValid()\n {\n boolean isValid = true;\n Collection<RecognizedElement> elementsList = tree.getChildren();\n for (Iterator<RecognizedElement> iterator = elementsList.iterator(); iterator.hasNext();)\n {\n RecognizedElement recognizedElement = (RecognizedElement) iterator.next();\n if (isSpreadsheet)\n {\n if (recognizedElement instanceof Style || recognizedElement instanceof Regex)\n {\n isValid = false;\n break;\n }\n }\n else\n {\n if (recognizedElement instanceof Column)\n {\n isValid = false;\n break;\n }\n }\n }\n return isValid;\n }",
"protected boolean isValidElement(Object element) {\r\n\t\treturn element instanceof IRubyProject || element instanceof ISourceFolderRoot;\r\n\t}",
"public Boolean isParentable();",
"boolean isDisplay();",
"boolean isDisplay();",
"public boolean isDataFlavorSupported(DataFlavor df) {\n\t\treturn df.equals(CLASS_NODE_FLAVOR);\n\t}",
"boolean isNilConstraints();",
"boolean connected(String descrip) {\n if (this.hasNeighbor(descrip)) {\n if (descrip.equals(\"right\")) {\n return this.neighbors.get(\"right\").left && this.right;\n }\n else if (descrip.equals(\"up\")) {\n return this.neighbors.get(\"up\").down && this.up;\n }\n else if (descrip.equals(\"down\")) {\n return this.neighbors.get(\"down\").up && this.down;\n }\n else if (descrip.equals(\"left\")) {\n return this.neighbors.get(\"left\").right && this.left;\n }\n else {\n return false;\n }\n }\n else {\n return false;\n }\n }",
"boolean hasD();",
"@Override\n public void printExistFigure() {\n if (!isRealFigure()) {\n System.out.println(\"Triangular prism is not exist\");\n } else {\n System.out.println(\"Triangular prism is exist\");\n }\n }",
"boolean hasConceptGroup();",
"@Override\n public boolean isValid() {\n return getComponent().manager.getSelectedNodes().length == 1;\n }",
"boolean hasFkocs();",
"boolean isNilDescription();",
"public boolean isElementDefinition()\n {\n return elementDefinition;\n }",
"public boolean isElementDefinition()\n {\n return elementDefinition;\n }",
"public interface SourceDiagramInformationProvider {\r\n\r\n\t/**\r\n\t * @param diagram the diagram to compute information from\r\n\t * \r\n\t * @return true if this information provider can handle the given type of diagram\r\n\t */\r\n\tboolean canProvide(DiagramDescription diagram);\r\n\t\r\n\t/**\r\n\t * Compute the bounds of the given diagram.\r\n\t * \r\n\t * @param diagram the diagram to compute information from\r\n\t */\r\n\tvoid provideBounds(DiagramDescription diagram);\r\n\t\r\n}",
"boolean hasBasis();",
"public boolean canDraw() {\n return this.m_canDraw;\n }",
"public boolean isTree() {\r\n\t\tif (isConnected() && !isCyclic())\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}",
"boolean hasCharacteristicDescription();",
"boolean isSVGViewVisible(final String viewName,\n final W element);",
"public boolean\nhasNucLabel()\n{\n\tVector labelList = this.getLabelList();\n\tif (labelList == null)\n\t\treturn (false);\n\tif ((labelList.size() <= 0) || (labelList.size() > 2))\n\t\treturn (false);\n\tDrawObject drwObj0 = null;\n\tDrawObject drwObj1 = null;\n\tdrwObj0 = (DrawObject)labelList.elementAt(0);\n\tif (labelList.size() == 2)\n\t\tdrwObj1 = (DrawObject)labelList.elementAt(1);\n\tif ((drwObj1 == null) && (drwObj0 instanceof DrawLineObject))\n\t\treturn (true);\n\tif (drwObj1 == null)\n\t\treturn (false);\n\tif ((drwObj0 instanceof DrawLineObject) && (drwObj1 instanceof DrawStringObject))\n\t{\n\t\ttry\n\t\t{\n\t\t\tint val = Integer.parseInt(((DrawStringObject)drwObj1).getDrawString());\n\t\t}\n\t\tcatch (NumberFormatException e)\n\t\t{\n\t\t\treturn (false);\n\t\t}\n\t\treturn (true);\n\t}\n\tif ((drwObj1 instanceof DrawLineObject) && (drwObj0 instanceof DrawStringObject))\n\t{\n\t\ttry\n\t\t{\n\t\t\tint val = Integer.parseInt(((DrawStringObject)drwObj0).getDrawString());\n\t\t}\n\t\tcatch (NumberFormatException e)\n\t\t{\n\t\t\treturn (false);\n\t\t}\n\t\treturn (true);\n\t}\n\treturn (false);\n}",
"public boolean IsTree() {\r\n\t\treturn this.IsConnected() && !this.IsCyclic();\r\n\t}",
"boolean isSetDesc();",
"private boolean isPartOfTree(BPMNNodeInterface dat, AbstractModelAdapter model) {\r\n\t\tfor(EdgeInterface e:model.getEdges()) {\r\n\t\t\tif(e.getTarget().equals(dat) && ((BPMNNodeInterface)e.getSource()).isDataObject()) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(e.getSource().equals(dat) && ((BPMNNodeInterface)e.getTarget()).isDataObject()) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public boolean hasCompositeStructure() {\n return (getStructureType() == EquipmentType.T_STRUCTURE_COMPOSITE);\n }",
"public boolean hasDependees() {\n \treturn model.hasDependees();\n }",
"public abstract boolean isInWidgetTree();",
"Collection<? extends CFD> getHasCFD();",
"Diagram getDiagram();",
"Diagram getDiagram();",
"@DISPID(1611006036) //= 0x60060054. The runtime will prefer the VTID if present\n @VTID(111)\n boolean constraintsInGeometry();",
"public boolean isDraw() {\n for (int row = 0; row < ROWS; ++row) {\n for (int col = 0; col < COLS; ++col) {\n if (cells[row][col].getContent() == Seed.EMPTY) {\n return false;\n }\n }\n }\n return true;\n }",
"public boolean isChild();",
"public boolean isCreateCustomerDisplayed() {\n\t\tList<WebElement> lst = driver.findElements(By\n\t\t\t\t.xpath(\"//span[contains(.,'Create Customer')]\"));\n\t\tif (lst.isEmpty()) {\n\t\t\tSystem.out.println(\"element does not exist\");\n\t\t\treturn true;\n\t\t} else\n\t\t\treturn false;\n\t}",
"boolean hasSide();",
"boolean hasDynamicLineup();",
"boolean hasNode();",
"boolean hasNode();",
"public boolean isDefaultElement();",
"public static boolean getIsDrawing() {\n\t\treturn isDrawing;\n\t}",
"boolean hasChildren();",
"public boolean elementDansSchema(final Element refElement) {\n final Document domdoc = refElement.getOwnerDocument();\n return(domdoc == racine_schema.getOwnerDocument());\n }",
"public boolean isDeviceTypeFieldPresent() {\r\n\t\treturn isElementPresent(addVehiclesHeader.replace(\"Add Vehicle\", \"Select Device Type\"), SHORTWAIT);\r\n\t}",
"public boolean isViewing() { RMShape p = getParent(); return p!=null && p.isViewing(); }",
"boolean hasIsCentralNode();"
] | [
"0.76409537",
"0.7605449",
"0.72132593",
"0.6979336",
"0.62042844",
"0.61014634",
"0.6043455",
"0.6043455",
"0.59884936",
"0.59387565",
"0.5928776",
"0.5919256",
"0.5878576",
"0.585733",
"0.5813166",
"0.5809937",
"0.5783373",
"0.57306",
"0.57019794",
"0.56964076",
"0.5676695",
"0.5652949",
"0.55761147",
"0.5568502",
"0.55570805",
"0.55073404",
"0.5497591",
"0.5475027",
"0.547477",
"0.5439937",
"0.5426295",
"0.5415729",
"0.5409725",
"0.5394886",
"0.5394713",
"0.5375447",
"0.53642166",
"0.5349404",
"0.53452367",
"0.53398484",
"0.53372914",
"0.5329244",
"0.5329244",
"0.53289706",
"0.5325198",
"0.5318407",
"0.53128636",
"0.5310063",
"0.530375",
"0.5297393",
"0.5296615",
"0.52910745",
"0.5289622",
"0.52847815",
"0.52685964",
"0.52668244",
"0.5257101",
"0.5257101",
"0.52543414",
"0.524453",
"0.52389765",
"0.52303153",
"0.522645",
"0.5224669",
"0.5222075",
"0.52159625",
"0.5214168",
"0.5210873",
"0.5210873",
"0.52073926",
"0.5195877",
"0.519426",
"0.5193629",
"0.51932913",
"0.5190954",
"0.5187621",
"0.51875836",
"0.5176962",
"0.5166244",
"0.5165161",
"0.51520157",
"0.5143773",
"0.51420057",
"0.51375645",
"0.51375645",
"0.51336455",
"0.5120564",
"0.51201385",
"0.5119748",
"0.5117347",
"0.51093394",
"0.51089495",
"0.51089495",
"0.51087683",
"0.51071686",
"0.5106491",
"0.5105413",
"0.5103299",
"0.5096174",
"0.5082738"
] | 0.7801333 | 0 |
Factory method that creates the desired type of StreamGang subclass implementation. | private static Runnable makeStreamGang(String[] wordList, TestsToRun choice) {
switch (choice) {
case SEQUENTIAL_STREAM:
return new SearchWithSequentialStream(wordList, mInputStrings);
case PARALLEL_STREAM:
return new SearchWithParallelStream(wordList, mInputStrings);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Inheritance createInheritance();",
"private StreamFactory()\n {\n /*\n * nothing to do\n */\n }",
"<R> Streamlet<R> newSource(IRichSpout spout);",
"GenericSink createGenericSink();",
"Reproducible newInstance();",
"private StickFactory() {\n\t}",
"public static AisPacketStream newStream() {\n return new AisPacketStreamImpl();\n }",
"public interface BackPressuredWriteStream<T> extends WriteStream<T> {\n\n static <T> BackPressuredWriteStream create(Handler<T> writeHandler) {\n return new BackPressuredWriteStreamImpl<T>(writeHandler);\n }\n\n static <T> BackPressuredWriteStream createThrottled(Handler<T> writeHandler, long quotaPeriod, int quota, String persistentQuotaTimeFile, Vertx vertx) {\n return new ThrottleStreamImpl(writeHandler, quotaPeriod, quota, persistentQuotaTimeFile, vertx);\n }\n\n void drop();\n\n long getQueueSize();\n}",
"public GoogleanalyticsFactoryImpl() {\n\t\tsuper();\n\t}",
"public interface AbstractSenderFactory {\n Sender create();\n}",
"public interface StreamDefinitionBuilder {\n\n public String define();\n\n public String getStreamId();\n\n public String getStreamName();\n\n public String getStreamVersion();\n\n}",
"protected StreamParser()\n {\n }",
"@SuppressWarnings(\"unchecked\")\n private <T extends Event> Stream<T> makeStream(StreamMaker sm, Class<T> type) {\n\n Stream<T> stream = app.createStream(type);\n stream.setName(sm.getName());\n\n if (sm.getKeyFinder() != null)\n stream.setKey((KeyFinder<T>) sm.getKeyFinder());\n else if (sm.getKeyDescriptor() != null)\n stream.setKey(sm.getKeyDescriptor());\n\n return stream;\n }",
"protected void create(boolean stream) throws IOException {\n if(!stream)\n throw new IOException(\"Datagram socket not implemented!\");\n }",
"static <T> DataStream<T> of(Class<T> clazz) {\n return new DataStreamImpl<>();\n }",
"public interface IStreamFactory{\n Closeable getStream(Query q);\n }",
"public BuiltinFactoryImpl() {\n\t\tsuper();\n\t}",
"public interface SerializerFactory<T> {\n\t\n\t/** the method creates a new MessageSerializer.\n\t * \n\t * @return new object that implements the MessageSerializer interface. \n\t */\n MessageSerializer<T> create();\n}",
"public Fish create(){\n\t\tMovementStyle style = new NoMovement();\n\t\treturn new Shark(style);\n\t}",
"public interface ChannelFactory<T extends Channel> {\n T newChannel();\n}",
"protected abstract S createDefault();",
"Traditional createTraditional();",
"public ScribbleFactoryImpl()\n {\n\t\tsuper();\n\t}",
"public org.python.types.Type __new__(org.python.types.Type cls);",
"public GseqFactoryImpl() {\n\t\tsuper();\n\t}",
"public interface SpoutFactory {\n public IRichSpout create(Namespace namespace, Config conf);\n}",
"public LMScrambleShift (RandomStream stream) {\n super(stream);\n }",
"Instance createInstance();",
"public ObjectFactory() {\n super(grammarInfo);\n }",
"public XCanopusFactoryImpl()\r\n {\r\n super();\r\n }",
"public interface JPPFObjectStreamBuilder\n{\n\t/**\n\t * Obtain an input stream used for deserializing objects.\n * @param\tin input stream to read from.\n\t * @return an <code>ObjectInputStream</code>\n\t * @throws Exception if an error is raised while creating the stream.\n\t */\n\tObjectInputStream newObjectInputStream(InputStream in) throws Exception;\n\t/**\n\t * Obtain an Output stream used for serializing objects.\n * @param\tout output stream to write to.\n\t * @return an <code>ObjectOutputStream</code>\n\t * @throws Exception if an error is raised while creating the stream.\n\t */\n\tObjectOutputStream newObjectOutputStream(OutputStream out) throws Exception;\n}",
"<R> Streamlet<R> newSource(Source<R> generator);",
"@Override\n public Stanza createFromParcel(Parcel source) {\n return new Stanza(source);\n }",
"public PipedWriter() { throw new RuntimeException(\"Stub!\"); }",
"public Glow() {}",
"_ExtendsNotAbstract() {\n super(\"s\"); // needs this if not default ctor;\n }",
"public T newInstance();",
"public interface AbstractFactory {\n Bmw produceBmw();\n Benz produceBenz();\n}",
"@Override\n public LoggerBackend create(String loggingClassName) {\n Logger logger = (Logger) LogManager.getLogger(loggingClassName.replace('$', '.'));\n return new Log4j2LoggerBackend(logger);\n }",
"public static StaticFactoryInsteadOfConstructors create(){\n return new StaticFactoryInsteadOfConstructors();\n }",
"@Override\n protected T createInstance() throws Exception {\n return this.isSingleton() ? this.builder().build() : XMLObjectSupport.cloneXMLObject(this.builder().build());\n }",
"ShadowProtocol.Factory getShadowProtocolFactory();",
"Class createClass();",
"public Generator(){}",
"private XmlStreamFactory()\n {\n /*\n * nothing to do\n */\n }",
"private WriterFactory() {\n }",
"@Override\r\n\tpublic T createInstance() {\r\n\t\ttry {\r\n\t\t\treturn getClassType().newInstance();\r\n\t\t} catch (Exception e) {\r\n\t\t\tLogger.getLogger(AbstractCRUDBean.class.getSimpleName()).log(Level.ALL, e.getMessage());\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public interface Factory {\n LeiFeng createLeiFeng();\n}",
"public StimuliFactoryImpl() {\r\n\t\tsuper();\r\n\t}",
"protected abstract void construct();",
"public interface MediaFactory {\n TCPMediaContent createTCPObject();\n UDPMediaContent createUDPObject();\n}",
"SignatureSink createSignatureSink();",
"abstract public Buffer createBuffer();",
"abstract Truerandomness newInstance();",
"public PertFactory() {\n for (Object[] o : classTagArray) {\n addStorableClass((String) o[1], (Class) o[0]);\n }\n }",
"public interface StreamRecordGenerator<T> {\n Iterator<StreamRecord<T>> generate();\n\n TypeInformation<T> getTypeInformation();\n }",
"public interface StreamGenerator {\n Interpretation next();\n\n boolean hasNext();\n\n void reset();\n}",
"private ConcreteFactory() {}",
"@Override\n public AbstractRelic makeCopy() {\n return new SpiritualRecovery();\n }",
"public interface Generator {\n ClazzGenerator generateClazzString();\n}",
"public AggregatorFactoryImpl() {\n \t\tsuper();\n \t}",
"public Factory() {\n\t\tsuper();\n\t}",
"public interface IOFactory {\r\n /**\r\n * Creates a {@link ProfileReader} for the given {@link InputStream}.\r\n * @param stream the stream to be read.\r\n * @return the created {@link ProfileReader}.\r\n */\r\n public abstract ProfileReader createProfilerReader(InputStream stream);\r\n \r\n /**\r\n * Creates a {@link ProfileWriter} for the given {@link OutputStream}.\r\n * @param stream the stream to be written to.\r\n * @return the created {@link ProfileWriter}.\r\n */\r\n public abstract ProfileWriter createProfileWriter(OutputStream stream);\r\n \r\n /**\r\n * Creates a {@link MergeFileReader} for the given {@link InputStream}.\r\n * @param stream the stream to be read.\r\n * @return the created {@link MergeFileReader}.\r\n */\r\n public abstract MergeFileReader createMergeReader(InputStream stream);\r\n \r\n /**\r\n * Creates a {@link MergeFileWriter} for the given {@link OutputStream}.\r\n * @param stream the stream to be written.\r\n * @return the created {@link MergeFileWriter}.\r\n */\r\n public abstract MergeFileWriter createMergeWriter(OutputStream stream);\r\n \r\n /**\r\n * Creates a {@link MergeFileReader} simulating an empty merge file.\r\n * @return the created {@link MergeFileReader}.\r\n */\r\n public abstract MergeFileReader createEmptyMergeReader();\r\n}",
"@Override\n public Animal createAnimal() {\n return new Monkey();\n }",
"public StreamTests (String name)\n {\n super (name);\n }",
"public borFactoryImpl() {\n\t\tsuper();\n\t}",
"public interface Builder {\n static Builder newBuilder() {\n return new BuilderImpl();\n }\n\n /**\n * All sources of the computation should register using addSource.\n * @param supplier The supplier function that is used to create the streamlet\n */\n <R> Streamlet<R> newSource(SerializableSupplier<R> supplier);\n\n /**\n * Creates a new Streamlet using the underlying generator\n * @param generator The generator that generates the tuples of the streamlet\n * @param <R>\n * @return the new streamlet\n */\n <R> Streamlet<R> newSource(Source<R> generator);\n\n /**\n * Creates a new Streamlet using the provided spout\n * @param spout The spout that emits the tuples of the streamlet\n * @param <R>\n * @return the new streamlet\n */\n <R> Streamlet<R> newSource(IRichSpout spout);\n}",
"protected abstract Logger newInstance(String name);",
"public static ReportGenerator createInstance()\r\n {\r\n return new ReportGenerator();\r\n }",
"public SgaexpedbultoImpl()\n {\n }",
"@Override\n\tprotected Feed newFeed() {\n\t\treturn new Feed(this.feedType);\n\t}",
"public interface BackendGroup<Q> {\n\n public default <ES extends BackendGroup<Q>> ES as(Class<? super ES> type){\n return (ES) type.cast(this);\n }\n\n}",
"TGG createTGG();",
"public IndirectionsmeasuringpointFactoryImpl() {\n super();\n }",
"public BromiumFactoryImpl()\n {\n super();\n }",
"private Gng() {\n }",
"public static StaticFactoryInsteadOfConstructors newInstance() {\n return new StaticFactoryInsteadOfConstructors();\n }",
"public ClazzDslFactoryImpl()\n {\n super();\n }",
"private Instantiation(){}",
"protected Alias() {\n }",
"public Generator getGenerator(String theClass);",
"@Override\n\t\tprotected SubnodeBTree intermediateNodeFactory(java.nio.ByteBuffer entryStream)\n\t\tthrows\n\t\t\tCRCMismatchException,\n\t\t\tjava.io.IOException\n\t\t{\n\t\t\tfinal SIEntry entry = new SIEntry(this, entryStream);\n\t\t\treturn new SubnodeBTree(entry.nid.key(), this);\n\t\t}",
"public GpflFactoryImpl()\n {\n super();\n }",
"public interface NewLine extends ClouBausteinElement {\n\n static NewLine create(CodePosition codePosition){\n return new NewLineImpl(codePosition);\n }\n\n}",
"HarvestType createHarvestType();",
"public CommonsFactoryImpl() {\n\t\tsuper();\n\t}",
"public FStream newStream(String name, ISource source) {\n\t\tFStream n = new FStream(name, this, source);\n\t\t\n\t\t_graph.addVertex(n);\n\t\t\n\t\treturn n;\n\t}",
"private CloneFactory() {\n }",
"public interface QueryTypeFactory extends QueryAllFactory<QueryTypeEnum, QueryTypeParser, QueryType>\n{\n \n}",
"public abstract void create();",
"CreateEventViewModelFactory() {\n super(Storage.class, Authenticator.class);\n }",
"public static Factory factory() {\n return Document_print::new;\n }",
"public StreamHandler createStreamHandler (OutputStream outStream) {\r\n\t\t\t\t\t\r\n\t\tStreamHandler streamHandler = null;\r\n\r\n\t\ttry {\r\n\t\t\t\t \t\r\n\t\t\tstreamHandler = new StreamHandler(outStream, new SimpleFormatter());\r\n\t\t\t\t\t\t\r\n\t\t} catch (SecurityException e) {\r\n\t\t\t\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\t\t \r\n\t\t\treturn streamHandler;\r\n\t}",
"public interface RecordEventsProcessorFactory<TResult> {\r\n\r\n\t/**\r\n\t * @param res the result to feed by processor\r\n\t */\r\n\tpublic RecordEventsProcessor create(TResult res);\r\n\t\r\n}",
"private SerializerFactory() {\n // do nothing\n }",
"public interface Factory {\n Animal createAnimal();\n}",
"public static Buffer createBuffer(String sagaFactoryClassname, int size) throws BadParameterException, \n NoSuccessException {\n\tBufferFactory factory = getFactory(sagaFactoryClassname);\n return factory.doCreateBuffer(size);\n }",
"public static InstrumentedType of(String name, TypeDescription.Generic superClass, int modifiers) {\n return Factory.Default.MODIFIABLE.subclass(name, modifiers, superClass);\n }",
"@Override\n protected PoliceStory createPoliceStory() {\n if (isUseRuntimeDirectPoliceStory()) {\n return new PoliceStory(this, getRuntimeProjectDir());\n } else {\n return super.createPoliceStory();\n }\n }",
"@Override\n\tpublic void create() {\n\t\t\n\t}"
] | [
"0.5844388",
"0.5495362",
"0.5474794",
"0.5407176",
"0.53856856",
"0.53375024",
"0.5267263",
"0.52583086",
"0.5151724",
"0.51345766",
"0.511042",
"0.5091778",
"0.5074674",
"0.50654095",
"0.5037952",
"0.5032665",
"0.50176275",
"0.501236",
"0.50019723",
"0.49911842",
"0.49703175",
"0.49614802",
"0.4948063",
"0.4944948",
"0.49393615",
"0.49360788",
"0.49191162",
"0.4913427",
"0.4907723",
"0.49056786",
"0.4899272",
"0.48969546",
"0.48935747",
"0.48904908",
"0.4887784",
"0.4867612",
"0.486378",
"0.4856032",
"0.4848758",
"0.484745",
"0.48462605",
"0.48371586",
"0.48364317",
"0.48337355",
"0.48266447",
"0.48181486",
"0.48172516",
"0.48141557",
"0.48138335",
"0.48129782",
"0.4805411",
"0.48008627",
"0.47983328",
"0.47943434",
"0.47930628",
"0.47820246",
"0.47754478",
"0.47750837",
"0.4767006",
"0.4764231",
"0.4738545",
"0.4730039",
"0.47053254",
"0.47035456",
"0.46889013",
"0.46830043",
"0.46735415",
"0.4670813",
"0.46698517",
"0.46678656",
"0.46670973",
"0.46639287",
"0.46610907",
"0.46494225",
"0.46432814",
"0.46396518",
"0.463731",
"0.46353",
"0.46347985",
"0.46332237",
"0.46278808",
"0.46219927",
"0.4617327",
"0.4605207",
"0.46017596",
"0.4600142",
"0.45965332",
"0.4584002",
"0.45823058",
"0.45818242",
"0.45786503",
"0.45780513",
"0.4574566",
"0.45740733",
"0.45736596",
"0.4570133",
"0.45640388",
"0.45636424",
"0.45608944",
"0.45595354"
] | 0.484547 | 41 |
This is the entry point into the test program. | static public void main(String[] args) throws Throwable {
/*
Stream.of(mOneShotInputStrings)
.parallel()
.forEach(arrayOfStrings ->
Stream.of(arrayOfStrings)
.parallel()
.forEach(string ->
Stream.of(mWordList)
.parallel()
.map(word -> WordMatcher.search(word, string))
.forEach(results -> results.print())));
} */
printDebugging("Starting SearchStreamGangTest");
// Create/run appropriate type of StreamGang to search for words.
Stream.of(TestsToRun.values())
.forEach(test -> {
printDebugging("Starting " + test);
makeStreamGang(mWordList, test).run();
printDebugging("Ending " + test);
});
printDebugging("Ending SearchStreamGangTest");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n // PUT YOUR TEST CODE HERE\n }",
"@Test\n public void main() {\n MainApp.main(new String[] {});\n }",
"public static void main(String[] args){\n new Testing().runTests();\r\n \r\n }",
"@Test\n\tpublic void testMain() {\n\t}",
"@Test\t\n\tpublic void testMain() {\n\n\t\tSystem.out.println(\"hello\");\n\t}",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n GOL_Main.main(args);\n }",
"@Test\n\tpublic void testMain() {\n\t\t// TODO: test output streams for various IO methods, emulating a user's\n\t\t// input - kinda like Joel did for CSSE2310\n\t\tAssert.fail();\n\t}",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n Calculadora_teste.main(args);\n \n }",
"@Test\n public void main() {\n // App.main(null);\n // assertEquals(\"Hello world\", outContent.toString());\n }",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n LoginRegister.main(args);\n }",
"public static void main(String[] args) {\r\n // 2. Call your method in various ways to test it here.\r\n }",
"public static void main(String[] args) {\r\n// Use for unit testing\r\n }",
"@Test\n public void main() {\n run(\"TEST\");\n }",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n RefSystemGUI.main(args);\n }",
"public static void main(String args[]){\n\t\tTestingUtils.runTests();\n\t\t\n\t}",
"@Test\n public void testMain() throws Exception {\n //main function cannot be tested as it is dependant on user input\n System.out.println(\"main\");\n }",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n CashRegister.main(args);\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"The test case is a prototype.\");\n }",
"public static void main(String... args) throws Exception {\n //testHelloWorld();\n //testExchange();\n //testParentChild();\n //testLinking();\n //testListener();\n //testParse(\"1\");\n //testOuterInner();\n //testResourceARM();\n //testExecuteAround();\n testExecuteAroundARM();\n }",
"public static void main(String[] args) {\n\ttest(tests);\n }",
"public static void main(String[] args) {\n\t\tdeferTest();\n\t}",
"public void testMain() throws Throwable {\n\r\n\t}",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n Cic.main(args);\n \n }",
"@Override\n public void runTest() {\n }",
"@Test\r\n\tpublic void mainTest(){\r\n\t\tMain m = new Main();\r\n\t\tm.main(null);\r\n\t}",
"@Test\r\n public void testMain() {\r\n System.out.println(\"main\");\r\n String[] args = null;\r\n Prog4.main(args);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }",
"@Test\n public void main() {\n System.out.println(\"main\");\n String[] args = null;\n SaalHelper.main(args);\n }",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n SServer.main(args);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public static void main(String[] args) {\n\t\ttest();\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"Just testing\");\r\n\t\t//lisää kommenttia\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\r\n System.out.println(runAllTests());\r\n }",
"@Test\r\n public void testMain() {\r\n System.out.println(\"main\");\r\n String[] args = null;\r\n ChessMain.main(args);\r\n // TODO review the generated test code and remove the default call to fail.\r\n \r\n }",
"public static void main(String[] args) {\n\t\trun();\n\t\t//runTest();\n\n\t}",
"@Test\n public void run_main(){\n\n String resource_folder = (new File(\"src/test/resources/\")).getAbsolutePath()+ File.separator ;\n\n String[] args = new String[7];\n args[0] = \"-run\";\n args[1] = resource_folder + \"test_configs/line_ctm.xml\";\n args[2] = \"mytest\";\n args[3] = resource_folder+\"sample_output_request.xml\";\n args[4] = \"temp\";\n args[5] = \"0\";\n args[6] = \"100\";\n\n OTM.main(args);\n\n }",
"public static void main(String[] args) {\n\t\t\n\t\tglobalTest();\n//\t\ttimeTest();\n//\t\ttestPrefixSearch();\n//\t\ttestSearch();\n//\t\ttestPrediction();\n//\t\ttestTrieSearch();\n//\t\ttestRebuid();\n//\t\ttest13();\n//\t\ttest14();\n\t}",
"public static void main(String[] args) {\r\n\r\n\t\ttry {\r\n\t\t\tDatabaseManager.setPatternNumber(1);\r\n\t\t\tDatabaseManager.getSingleton().openConnection();\r\n\r\n\t\t\tSingleTableCreator.dropAllTables();\r\n\t\t\tSingleTableCreator.createTables();\r\n\t\t\tSingleTableCreator.addTestRows();\r\n\r\n\t\t\tTestEVERYTHING.testRunAllTheTests();\r\n\r\n\t\t\tSystem.out.println(\"ya done diddly did it\");\r\n\r\n\t\t\tDatabaseManager.getSingleton().closeConnection();\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tDatabaseException.detectError(e, \"Runnable - Single\");\r\n\t\t}\r\n\t}",
"@org.junit.Test\n public void main() throws Exception {\n DosEquis.main(null);\n }",
"@Override\n\tpublic void homeTestRun() {\n\t\t\n\t}",
"public static void main(String[] args) {\r\n\t\tSystem.out.println(\"Testing Calculator\");\r\n\t\ttestConstructors();\r\n\t\ttestSetters();\r\n\t\ttestGetters();\r\n\t\ttestToString();\r\n\t}",
"public static void main(String[] args) {\n //init\n Client.getLayerIntersectDao().getConfig().getIntersectionFile(null);\n\n //tests\n TestLayers();\n// TestFields();\n// TestObjects();\n// TestDistributions();\n// TestDistributionData();\n// TestDistributionShapes();\n// TestObjNames();\n }",
"public static void main()\n\t{\n\t}",
"public static void main() {\n \n }",
"public static void main(String args[]) {\n\t\t JUnitCore junit = new JUnitCore();\n\t\t junit.addListener(new TextListener(System.out));\n\t\t Result result = junit.run(registration.class); // Replace \"SampleTest\" with the name of your class\n\t\t if (result.getFailureCount() > 0) {\n\t\t System.out.println(\"Test failed.\");\n\t\t System.exit(1);\n\t\t } else {\n\t\t System.out.println(\"Session Test finished successfully.\");\n\t\t System.exit(0);\n\t\t }\n\t}",
"public static void main(String argv[]) {\n \r\n PolicyTest bmt = new PolicyTest();\r\n\r\n bmt.create_minibase();\r\n\r\n // run all the test cases\r\n System.out.println(\"\\n\" + \"Running \" + TEST_NAME + \"...\");\r\n boolean status = PASS;\r\n status &= bmt.test1();\r\n \r\n bmt = new PolicyTest();\r\n bmt.create_minibase();\r\n status &= bmt.test2();\r\n\r\n // display the final results\r\n System.out.println();\r\n if (status != PASS) {\r\n System.out.println(\"Error(s) encountered during \" + TEST_NAME + \".\");\r\n } else {\r\n System.out.println(\"All \" + TEST_NAME + \" completed successfully!\");\r\n }\r\n\r\n }",
"public static void start() {\n\t\t\n\t\ttestEmptyConstructors();\n\t\ttestConstructors();\n\n\t}",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n MainWindow1.main(args);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public static void main(String[] args) {\n inOrbitDestinationControllerTest();\n// inOrbitReplayControllerTest();\n\n }",
"public static void main() {\n }",
"public static void main(String[] args)\n {\n try\n {\n TestRunner.run(isuite());\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }",
"public static void main(String[] args)\r\n\t{\r\n\t\t// create the suite of tests\r\n\t\t/*final TestSuite tSuite = new TestSuite();\r\n\t\ttSuite.addTest(new PersonDaoGenericTest(\"testSavePerson\"));\r\n\t\ttSuite.addTest(new PersonDaoGenericTest(\"testLoadPerson\"));\r\n\t\tTestRunner.run(tSuite);*/\r\n\t}",
"public static void main(String[] args)\n {\n TestRunner.run(suite());\n }",
"public static void main(String[] args) {\n new TSL2550Test();\n }",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = new String[]{\"-i\", \"-p\", \"src/test/resources/problems_resp.xml\", \"src/test/resources/context.txt\"};\n PrintStream prev = System.out;\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n System.setOut(new PrintStream(bos));\n XpathGenerator.main(args);\n System.setOut(prev);\n System.out.println(bos.toString());\n assertTrue(bos.toString().startsWith(\"/fhir:Bundle[1]\"));\n }",
"public static void main(){\n\t}",
"public static void main(String[] args) {\n try {\n assert false;\n System.out.println(\"Please use the -ea jvm-option. Ex: java -ea AXE170009.TestMain\");\n System.exit(0);\n }catch (AssertionError error){\n System.out.println(\"-ea option enabled good to go\");\n }\n TestMain tester = new TestMain();\n tester.testAdd();\n tester.testRemove();\n System.out.println(\"All Tests passed\");\n }",
"public static void main (String[] args) {\n \n doTest (\"hello\");\n doTest (\"query\");\n doTest (\"Mississippi\");\n doTest (\"elephant\");\n doTest (\"Qatar\");\n System.out.println();\n \n }",
"public static void main(String[] args) {\n\t\tTestST st2 = TestST.getInstance();\r\n\t}",
"public static void main(String args[])\n {\n junit.textui.TestRunner.run(suite());\n }",
"public static void main(String[] args) {\n\n\n\n org.junit.runner.JUnitCore.main(\n \"dataAccessTest.databaseTest\",\n \"proxyTest.proxyTest\");\n }",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"Testing basic functions...\");\n\t\tQuiz q = new QuizImpl(1, \"Test quiz\");\n\t\tSystem.out.println(\"Quiz ID: \" + q.getId());\n\t\tSystem.out.println(\"Quiz name: \" + q.getTitle());\n\t\tSystem.out.println(\"Adding questions...\");\n\t\tq.addQuestions();\n\t\tSystem.out.println(\"Printing questions...\");\n\t\tq.printQuestions();\n\t}",
"public void TestMain(){\n SampleStatements();\n TestMyPow();\n }",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n WarPlane.main(args);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"static void mainTest(PrintWriter out) throws Exception {\n\t}",
"public static void main(String[] args) {\n\t\t\n\n\t\torg.junit.runner.JUnitCore.main(\"org.infy.idp.entities.getJob.GetResponseTest\");\n\t}",
"public static void main(String[] args) {\n\n experiment();\n }",
"public static void main(String args[]) {\n\t\tSystem.out.println(\"\\r\\ngetGameSituationTest()\");\n\t\tgetGameSituationTest();\n\n\t\tSystem.out.println(\"\\r\\nstateCheckerboardConvertionTest()\");\n\t\tstateCheckerboardConvertionTest();\n\n\t\tSystem.out.println(\"\\r\\ngetValidActionsTest()\");\n\t\tgetValidActionsTest();\n\t}",
"public static void main(String... args) throws IOException {\n new Test().test();\n }",
"public static void main(String[] args) {\n // TODO code application logic here\n // some testing? or actually we can't run it standalone??\n }",
"private void test() {\n\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tTestClass T = new TestClass();\n\t\tT.TestRun();\n\t\tT.TestQ();\n\n\t}",
"public Main() {}",
"public static void main(String[] args) {\n\t\t\n\n\t\torg.junit.runner.JUnitCore.main(\"org.infy.idp.entities.jobs.ApplicationTest\");\n\t}",
"public static void main(String[] args) {\n\t\ttestStreamMapReduce();\r\n\t\t//testMethodReference();\r\n\t}",
"@Test\r\n\tpublic void testPrintHelloWorld() {\r\n \r\n\t\tAssert.assertEquals(App.getHelloWorld(), \"Hello World\");\r\n \r\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\ttestQuery();\n\t\t//testInsert();\n\t\t\n\t}",
"public static void main(String[] args) {\n testFactorial();\n testFibonacci();\n testMissing();\n testPrime();\n\n\n }",
"public static void main(String[] args) throws Exception{\n test1();\n }",
"public static void main(String [] args) {\r\n\t\ttestOne(); //adds items to WH; tests getNumItems method & toString method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestTwo(); //tests getItem(String) method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestThree(); //test getItem(Item) method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestFour(); //tests total cost method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestFive(); //this will test the getRefrigeratedItems method\r\n\t\tSystem.out.print(\"\\n\"); \r\n\t\ttestSix(); //tests getTotalCostRefrigerated method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestSeven(); //tests remove method\r\n\t}",
"public static void main(String[] args) {\r\n\t\t// test method\r\n\t\tNewFeatures newFeatures = new NewFeatures();\r\n\t\tnewFeatures.testingArrayList();\r\n\t\tnewFeatures.testingTryCatch();\r\n\t\tnewFeatures.testingNumericValues();\r\n\t\tnewFeatures.testingSwitchWithStringStatemant();\r\n\r\n\t}",
"public static void main(String[] args) throws Exception {\n\t\tnew Test().run();\n\t}",
"@Test\r\n\tpublic void testSanity() {\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}",
"public static void main(String[] args) {\n\t\tTestListener listener=new TestListener();\r\n\t\tXmlSuite suite=new XmlSuite();\r\n\t\tsuite.setName(\"Test Results\");\r\n\t\tsuite.setParallel(ParallelMode.METHODS);\r\n\t\tsuite.setThreadCount(Integer.parseInt(TestProperties.THREAD_COUNT.toString()));\r\n\t\tList<XmlSuite> suits=new ArrayList<XmlSuite>();\r\n\t\tsuits.add(suite);\r\n\r\n\r\n\t\tList<XmlPackage> xpackage=new ArrayList<XmlPackage>();\r\n\t\txpackage.add(new XmlPackage(TestProperties.TESTNG_PACKAGE.toString()));\r\n\r\n\t\t\r\n\t\tXmlTest test=new XmlTest(suite);\r\n\t\ttest.setPackages(xpackage);\r\n\t\tString groups=TestProperties.TESTNG_GROUP.toString();\r\n\t\tString groupArray[]=groups.split(\",\");\r\n\t\tList<String> includedGroups=new ArrayList<String>();\r\n\t\tincludedGroups.addAll(Arrays.asList(groupArray));\r\n\t\ttest.setIncludedGroups(includedGroups);\r\n\t\r\n\t\t\r\n\t\tTestNG tng=new TestNG();\r\n\t\ttng.setOutputDirectory(System.getProperty(\"user.dir\")+\"\\\\test-output\\\\\");\r\n\t\ttng.setXmlSuites(suits);\r\n\t\ttng.addListener((ITestNGListener) listener);\r\n\t\ttng.run();\r\n\t\tSystem.exit(0);\r\n\t}",
"public static void main(String[] args)\n {\n Minitest app = new Minitest();\n app.doMain(args);\n }",
"public static void main(String argv[]) {\n org.junit.runner.JUnitCore.main(Test_Data.class.getName()); // full name with package\n }",
"public static void main(String[] args) {\n System.out.println(testLibraryParseCardBarCode());\n System.out.println(testLibraryParseRunLibrarianCheckoutBookCommand());\n System.out.println(testLibraryParseRunSubscriberReturnBookCommand());\n System.out.println(testparseBookId());\n System.out.println(testparseRunSubscriberCheckoutBookCommand());\n }",
"public static void main (String[] args){\n\t\tincPieceCountTest();\n\t\tdecPieceCountTest();\n\t\tsetPieceTest();\n\t\tmoveTest();\n\t\tanyMoveTest();\n\t\tgetPiecesTest();\n\t\tsetPieceTest2();\n\t}",
"@Test(enabled =true, groups={\"fast\",\"window.One\",\"unix.One\",\"release1.one\"})\n\tpublic void testOne(){\n\t\tSystem.out.println(\"In TestOne\");\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\t\n\t\ttest01();\n\t}",
"@Test\n public void run () {\n\t \n\t System.out.println(\"---------->\");\n\t //System.out.println(md5list.getResult());\n\t //System.out.println(hashsearch.getResult());\n\t \n\t \n\t \n\t // System.out.println(samples.Testing());\n\t //System.out.println(\"getserult: \"+samples.getResult());\n\t \n }",
"public static void main(String[] args) {\n\n\t\torg.junit.runner.JUnitCore.main(\"org.infy.idp.config.TokenControllerTest\");\n\t}",
"@Test\n @Category(SlowTest.class)\n public void AppSmokeTest(){\n App.main(new String[]{TEST_PATH + \"input.dot\",\"1\"});\n }",
"public static void main(String[] args){\n\t\ttest1();\r\n\t}",
"@Override\n public void run(String... args) throws Exception {\n\n logger.info(\"Test is running....\");\n }",
"public Main() {\n \n \n }",
"public static void main(String[] args) {\r\n junit.textui.TestRunner.run(suite());\r\n }",
"public static void main(String[] args) {\n TestApp testApp=new TestApp();\r\n testApp.startApp();\r\n }",
"public static void main(String[] args) {\n\t\t\n\t\tSystem.out.println(\"main method\");\n\t\ttest();\n\t\t//RunprogramwithoutObject.test();// no need to create any object of class\n\t\tcover();\n\n\t}",
"@Test\n public void testMain() {\n String simulatedUserInput = \"100AUD\" + System.getProperty(\"line.separator\")\n + \"1\" + System.getProperty(\"line.separator\");\n\n InputStream savedStandardInputStream = System.in;\n System.setIn(new ByteArrayInputStream(simulatedUserInput.getBytes()));\n\n mainFunction mainfunc = new mainFunction();\n\n try {\n mainfunc.start();\n } catch(Exception e) {\n System.out.println(\"Exception!\");\n }\n\n assertEquals(1,1);\n }",
"public void testMain(Object[] args) \n\t{\n\t\t//----------------------------------------------------------------------\n\t\t// Verify SUCCESS of Journey\n\t\t// Grab Inspection Details and Report\n\t\t//----------------------------------------------------------------------\n\t\ttry {\t\t\t\n\t\t\t//----------------------------------------------------------------------\t\t\t\t\n\t\t\thtml_thankYou().waitForExistence(20.0, 0.25);\n\t\t\t//----------------------------------------------------------------------\t\t\t\t\n\t\t\tString sPaymentSuccess_Text = (String)html_thankYou().getProperty(\".text\");\t\t\n\t\t\t//----------------------------------------------------------------------\t\t\t\t\n\t\t\tSystem.out.println(\" PAYMENT SUCCESS * * * \"+sPaymentSuccess_Text+\"* * * \");\n\t\t\tlogTestResult(\" PAYMENT SUCCESS * * * \"+sPaymentSuccess_Text+\"* * * \", true);\t\t\n\t\t\t//----------------------------------------------------------------------\t\t\t\t\n\t\t} catch (Exception e) {\t\t\t\n\t\t\tlogTestResult(\" There Is A Problem WIth The CONFIRMATION Page - Quote Text Is NULL, Payment Gateway Issue or The Page Structure Changed?\", false);\t\t\n\t\t}\n\t\t//----------------------------------------------------------------------\t\n\t\tSystem.out.println(\"Test Journey Completed\");\n\t\tSystem.out.println(\"---------------------------------------------------\");\n\t\tiE().close();\n\t\t//stop();\n\t\t//----------------------------------------------------------------------\t\n\t}",
"protected TeststepRunner() {}",
"@Test\n\tpublic void testMain() {\n\t\tProjectManagerRestfulApiApp.main(new String[] {\n\t\t\t\t\"spring.profiles.active=test\"\n\t\t});\n\t}"
] | [
"0.81178135",
"0.8013764",
"0.7851738",
"0.7750652",
"0.77121854",
"0.7657866",
"0.7514939",
"0.74740905",
"0.7459052",
"0.7434368",
"0.74222714",
"0.7361559",
"0.7351718",
"0.73507166",
"0.73464155",
"0.7338265",
"0.7298572",
"0.7275239",
"0.72344315",
"0.7233278",
"0.72239447",
"0.7217297",
"0.7200735",
"0.7196806",
"0.71588844",
"0.71214736",
"0.7115927",
"0.7071713",
"0.70665395",
"0.70577383",
"0.70313334",
"0.70284426",
"0.7025996",
"0.70009327",
"0.6997357",
"0.6985101",
"0.69675195",
"0.6947553",
"0.694036",
"0.6937479",
"0.69287544",
"0.6927794",
"0.69273925",
"0.6893741",
"0.6892077",
"0.68902427",
"0.6868602",
"0.68631345",
"0.6857947",
"0.68546814",
"0.68351865",
"0.6829064",
"0.6821993",
"0.68181306",
"0.68111753",
"0.67953247",
"0.6786169",
"0.67833036",
"0.6763355",
"0.6761798",
"0.6759684",
"0.673631",
"0.6722379",
"0.6721698",
"0.6719783",
"0.6713622",
"0.6695142",
"0.6678553",
"0.6678073",
"0.6677448",
"0.6675069",
"0.66715723",
"0.66708004",
"0.6663804",
"0.6660626",
"0.66577905",
"0.6654416",
"0.66541696",
"0.66461676",
"0.66349244",
"0.6627575",
"0.66261816",
"0.6620233",
"0.6619966",
"0.66171885",
"0.6616146",
"0.6613288",
"0.6612999",
"0.6604048",
"0.66005903",
"0.6600245",
"0.6598591",
"0.659489",
"0.6590781",
"0.6587176",
"0.658455",
"0.65836614",
"0.6580205",
"0.6575904",
"0.6575639",
"0.6572489"
] | 0.0 | -1 |
outputs are computed from the synapse list private List outputs; | public List<Synapse> getInputs() {
return inputs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Output getOutputs();",
"public void setOutputs(ArrayList<Double> outputs)\n {\n this.outputs = outputs;\n }",
"public ArrayList<Double> getOutputs()\n {\n return outputs;\n }",
"public ArrayList<Double> calculateOutput(){\n for(int i = 0; i < inputSize; i++){\n network.get(0).get(i).setInput(inputs.get(i));\n }\n //Make it go through each node in the network and calculate output for each of them top down\n for(int i = 0; i < numOutputs; i++){\n output.set(i, network.get(layers-1).get(i).calculateOutput());\n }\n return output;\n }",
"public void calculateOutputs()\n {\n numberOfOutputs = outputs.size();\n }",
"public ArrayList<String> getOutputs() {\r\n return outputs;\r\n }",
"java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getOutputsList();",
"public List<String> getOutputs() {\n\t\tif (outputs == null){\r\n\t\t\tif (checkAndGetSensorDescription() && (sensorDescription.getMemberList()!= null)) {\r\n\t\t\t\tfor(Inner_Element_member member : sensorDescription.getMemberList()){\r\n\t\t\t\t\tif (member.get_Process()!= null) {\r\n\t\t\t\t\t\t//Inner_Element_OutputList \r\n\t\t\t\t\t\tfor (IoComponentPropertyType elementOut: member.get_Process().getOutputs().getOutputList().getOutputList()){\r\n\t\t\t\t\t\t\toutputs.add(elementOut.getName());\r\n\t\t\t\t\t\t\tif (elementOut.getQuantity()!= null) {\r\n\t\t\t\t\t\t\t\tElement_Quantity quantity = elementOut.getQuantity(); \r\n\t\t\t\t\t\t\t\t//fill the properties as they are already setup\r\n\t\t\t\t\t\t\t\tupdateObservedProperty(quantity);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn outputs;\r\n\t}",
"java.util.List<org.auvua.utils.protobuffer.AUVprotocol.AUVCommand.Output> \n getOutputsList();",
"java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();",
"java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();",
"java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();",
"public java.util.List<java.lang.String> getOutputs() {\n return outputs;\n }",
"public java.util.List<java.lang.String> getOutputs() {\n return outputs;\n }",
"@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getOutputsList() {\n return outputs_;\n }",
"public void setOutputs(java.util.List<java.lang.String> value) {\n this.outputs = value;\n }",
"public java.util.List<org.auvua.utils.protobuffer.AUVprotocol.AUVCommand.Output> getOutputsList() {\n return outputs_;\n }",
"OutputsType getOutputs();",
"double collectOutput(List<NeuronsConnection> inputConnections);",
"public java.util.List<org.auvua.utils.protobuffer.AUVprotocol.AUVCommand.Output> getOutputsList() {\n if (outputsBuilder_ == null) {\n return java.util.Collections.unmodifiableList(outputs_);\n } else {\n return outputsBuilder_.getMessageList();\n }\n }",
"@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getOutputsList() {\n return java.util.Collections.unmodifiableList(\n instance.getOutputsList());\n }",
"com.dogecoin.protocols.payments.Protos.Output getOutputs(int index);",
"public java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> getOutputsList() {\n if (outputsBuilder_ == null) {\n return java.util.Collections.unmodifiableList(outputs_);\n } else {\n return outputsBuilder_.getMessageList();\n }\n }",
"public java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> getOutputsList() {\n if (outputsBuilder_ == null) {\n return java.util.Collections.unmodifiableList(outputs_);\n } else {\n return outputsBuilder_.getMessageList();\n }\n }",
"public java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> getOutputsList() {\n if (outputsBuilder_ == null) {\n return java.util.Collections.unmodifiableList(outputs_);\n } else {\n return outputsBuilder_.getMessageList();\n }\n }",
"public ImmutableList<ActionInput> getOutputs() {\n return outputs;\n }",
"public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getOutputsOrBuilderList() {\n return outputs_;\n }",
"@java.lang.Override\n public int getOutputsCount() {\n return outputs_.size();\n }",
"void setOutputs(List<ContractIOType> outputs) {\n this.outputs = outputs;\n }",
"public java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> getOutputsList() {\n return outputs_;\n }",
"public java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> getOutputsList() {\n return outputs_;\n }",
"public java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> getOutputsList() {\n return outputs_;\n }",
"public int getOutputsCount() {\n return outputs_.size();\n }",
"public int getOutputsCount() {\n return outputs_.size();\n }",
"public int getOutputsCount() {\n return outputs_.size();\n }",
"public int getOutputsCount() {\n return outputs_.size();\n }",
"java.util.List<? extends org.auvua.utils.protobuffer.AUVprotocol.AUVCommand.OutputOrBuilder> \n getOutputsOrBuilderList();",
"java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();",
"java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();",
"java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();",
"public java.util.List<? extends org.auvua.utils.protobuffer.AUVprotocol.AUVCommand.OutputOrBuilder> \n getOutputsOrBuilderList() {\n if (outputsBuilder_ != null) {\n return outputsBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(outputs_);\n }\n }",
"public java.util.List<? extends org.auvua.utils.protobuffer.AUVprotocol.AUVCommand.OutputOrBuilder> \n getOutputsOrBuilderList() {\n return outputs_;\n }",
"public List<ContractIOType> getOutputs() {\n return outputs;\n }",
"public int getNumberOfOutputs()\n {\n return numberOfOutputs;\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 }",
"public java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList() {\n if (outputsBuilder_ != null) {\n return outputsBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(outputs_);\n }\n }",
"public java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList() {\n if (outputsBuilder_ != null) {\n return outputsBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(outputs_);\n }\n }",
"public java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList() {\n if (outputsBuilder_ != null) {\n return outputsBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(outputs_);\n }\n }",
"private void calculateOutputs(Instance instance, Hashtable<NeuralNode, Double> nodeValues) {\r\n\t\tfor (OutputNode output : outputs) {\r\n\t\t\toutput.getValue(instance, nodeValues);\r\n\t\t}\r\n\t}",
"int getOutputsCount();",
"int getOutputsCount();",
"int getOutputsCount();",
"int getOutputsCount();",
"int getOutputsCount();",
"public List<NotebookCellOutputItem> getOutputs() {\n return this.outputs;\n }",
"public java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList() {\n return outputs_;\n }",
"public java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList() {\n return outputs_;\n }",
"public java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList() {\n return outputs_;\n }",
"@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getOutputs(int index) {\n return outputs_.get(index);\n }",
"public Element[] getOutputs(){\r\n \treturn new Element[] {first, second};\r\n }",
"private void clearOutputs() {\n outputs_ = emptyProtobufList();\n }",
"@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getOutputs(int index) {\n return instance.getOutputs(index);\n }",
"public String[] getOutputsAttribute();",
"public static Set<String> getOutputs() {\n\t\treturn requiredOutputs;\n\t}",
"@Override\n\tpublic TypeName[] getOutputs()\n\t{\n\t\tthis.defaultOutputNames = new TypeName[1];\n\t\tthis.defaultOutputNames[0] = new TypeName(IMAGE, \"Adjusted Image\");\n\t\t\n\t\tif(this.outputNames == null)\n\t\t{\n\t\t\treturn this.defaultOutputNames;\n\t\t}\n\t\treturn this.outputNames;\n\t}",
"@java.lang.Override\n public int getOutputsCount() {\n return instance.getOutputsCount();\n }",
"org.auvua.utils.protobuffer.AUVprotocol.AUVCommand.Output getOutputs(int index);",
"java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput> \n getDelegatedOutputsList();",
"public SensorList outputsFromRuleSets (RuleSet ruleset2) {\n \n SensorList res = new SensorList (); \n\n for (int i = 0; i < this.size(); i++) {\n \n \n for (int j = 0; j < ruleset2.size(); j++) {\n \n Sensor a = this.getSuccessor(i).merge(ruleset2.getSuccessor(j));\n res.addSensor(a);\n }\n }\n \n return res;\n }",
"public List<Value> getOutput() {\n if ( output == null ) output = new ArrayList<Value>();\n return output;\n }",
"org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);",
"org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);",
"org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);",
"public void generateOutputData() {\n\t\tArrayList<String> inputDataArray = new ArrayList<String>();\n\t\tif (removeDuplicates) {\n\t\t\tinputDataArray = removeDuplicates();\n\t\t} else {\n\t\t\tinputDataArray = inputDataValues;\n\t\t}\n\t\t\n\t\toutputDataValues.clear();\n\t\tString outputDataValue = \"\";\n\t\tif (inputDataArray.isEmpty()) {\n\t\t\toutputDataValue = getOutputDataValue(\"\");\n\t\t\toutputDataValues.add(outputDataValue);\n\t\t} else {\n\t\t\tfor (String inputDataValue: inputDataArray) {\n\t\t\t\toutputDataValue = getOutputDataValue(inputDataValue);\n\t\t\t\toutputDataValues.add(outputDataValue);\n\t\t\t}\n\t\t}\n\t}",
"public void setNumberOfOutputs(int numberOfOutputs)\n {\n this.numberOfOutputs = numberOfOutputs;\n }",
"private void addOutputs(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureOutputsIsMutable();\n outputs_.add(value);\n }",
"public NotebookCell setOutputs(List<NotebookCellOutputItem> outputs) {\n this.outputs = outputs;\n return this;\n }",
"public ObservableList<XYChart.Series<Number, Number>> getOutputData() {\n return outputData;\n }",
"public abstract boolean supportsMultipleOutputs();",
"public String[] getOutputNames()\n\t{\n\t\treturn _outputNames;\n\t}",
"public void calcOutput()\n\t{\n\t}",
"public org.auvua.utils.protobuffer.AUVprotocol.AUVCommand.Output getOutputs(int index) {\n return outputs_.get(index);\n }",
"public org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index) {\n return outputs_.get(index);\n }",
"public org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index) {\n return outputs_.get(index);\n }",
"public org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index) {\n return outputs_.get(index);\n }",
"List<Neuron> getSynapses();",
"public Output<T> output() {\n return output;\n }",
"public float getOutputsValue() {\n\t\tfloat total = 0;\n\t\tfor (TransactionOutput o : outputs) {\n\t\t\ttotal += o.getValue();\n\t\t}\n\t\treturn total;\n\t}",
"public java.util.List<MonitoringOutput> getMonitoringOutputs() {\n return monitoringOutputs;\n }",
"public br.unb.cic.bionimbus.avro.gen.JobInfo.Builder setOutputs(java.util.List<java.lang.String> value) {\n validate(fields()[5], value);\n this.outputs = value;\n fieldSetFlags()[5] = true;\n return this; \n }",
"private void addAllOutputs(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureOutputsIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, outputs_);\n }",
"public float getOutputsValue() {\n\n float total = 0;\n for (TransactionOutput o : outputs) {\n total += value;\n }\n return total;\n }",
"public void computeOutputs(double[] input){\n if (input != null) {\n for (int i=0; i<fire.length; i++) {\n fire[i] = input[i];\n }\n }\n\n //if this a hidden layer then we set the input to be\n double layerInput[] = new double[fire.length+ 1];\n for(int i=0; i<fire.length; i++){\n layerInput[i] = fire[i];\n }\n //add in another element for threshold to be multiplied by 1\n layerInput[fire.length] = 1;\n\n //compute outputs\n for (int i=0; i<next.getNeuronCount(); i++) {\n //get column at i of weightThreshold\n double colWeightThreshold[] = new double[weightThreshold.length];\n for(int j=0; j<colWeightThreshold.length; j++){\n colWeightThreshold[j] = weightThreshold[j][i];\n }\n\n double sum = dotProduct(colWeightThreshold, layerInput);\n //activation function on the sum and store neuron output\n next.fire[i] = activationFunction(sum);//(exp(sum*2.0)-1.0)/(exp(sum*2.0)+1.0);\n //System.out.println(\"output[\"+i+\"]: \"+output[i]);\n\n }\n\n }",
"public boolean[] getOutput() {\n // PROGRAM 1: Student must complete this method\n // return value is a placeholder, student should replace with correct return\n boolean[] outputCopy = new boolean[output.length]; //array to hold copy of output.\n for (int i = 0; i < outputCopy.length; i++) {\n outputCopy[i] = output[i]; //place output data into outputCopy\n }\n return outputCopy; //return copy of output\n }",
"private void addOutputs(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureOutputsIsMutable();\n outputs_.add(index, value);\n }",
"public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getOutputsOrBuilder(\n int index) {\n return outputs_.get(index);\n }",
"public Output getOutput() {\n\t\treturn output;\n\t}",
"public JSONArray getOutput() {\n\t\treturn output;\n\t}",
"private void applyMotorOutputs() {\n\t\tArrayList<MNeuron> neurons = mnetwork.getNeurons();\n\t\tint thrustNeuronID = 0;\n\t\tint turnNegativeNeuronID = 1;\n\t\tint turnPositiveNeuronID = 2;\n\n\t\tfor (MNeuron n : neurons) {\n\t\t\t/*\n\t\t\t Perform physical actions if effector neurons are firing.\n\t\t\t */\n\t\t\tif (n.getID() == thrustNeuronID) {\n\t\t\t\tif (n.isFiring()) {\n\t\t\t\t\tthrust(2);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (n.getID() == turnNegativeNeuronID) {\n\t\t\t\tif (n.isFiring()) {\n\t\t\t\t\tchangeViewHeading(-20.0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (n.getID() == turnPositiveNeuronID) {\n\t\t\t\tif (n.isFiring()) {\n\t\t\t\t\tchangeViewHeading(20.0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput> getDelegatedOutputsList() {\n return delegatedOutputs_;\n }"
] | [
"0.78269017",
"0.7559368",
"0.750312",
"0.7422393",
"0.74118584",
"0.73950267",
"0.7309719",
"0.72860837",
"0.72013414",
"0.7163749",
"0.7163749",
"0.7163749",
"0.71468735",
"0.7134493",
"0.6888851",
"0.68554634",
"0.68268305",
"0.6816961",
"0.6800744",
"0.675487",
"0.67363197",
"0.67196846",
"0.6712633",
"0.6712633",
"0.6712633",
"0.66753346",
"0.6645946",
"0.6641071",
"0.66381973",
"0.6626074",
"0.6626074",
"0.6626074",
"0.662203",
"0.662203",
"0.662203",
"0.662203",
"0.661015",
"0.6608688",
"0.6608688",
"0.6608688",
"0.65947014",
"0.6563286",
"0.65426993",
"0.6537505",
"0.652688",
"0.650842",
"0.650842",
"0.650842",
"0.6500221",
"0.64535844",
"0.64535844",
"0.64535844",
"0.64535844",
"0.64535844",
"0.64341605",
"0.64090115",
"0.64090115",
"0.64090115",
"0.63760513",
"0.63458633",
"0.6316978",
"0.630534",
"0.62896144",
"0.6277319",
"0.626241",
"0.6254949",
"0.6222492",
"0.6186577",
"0.6174052",
"0.6157611",
"0.6122958",
"0.6122958",
"0.6122958",
"0.60650915",
"0.59979093",
"0.59849924",
"0.59767634",
"0.5938017",
"0.5934978",
"0.59104264",
"0.59084874",
"0.5871622",
"0.585891",
"0.585891",
"0.585891",
"0.58420354",
"0.5812333",
"0.5791681",
"0.57843125",
"0.5781181",
"0.57686824",
"0.5768162",
"0.57601994",
"0.57578415",
"0.5755187",
"0.5734219",
"0.5731396",
"0.5726917",
"0.5718452",
"0.5714821"
] | 0.6082247 | 73 |
Sums weighted input signals and produces an output according to the neuron type. | public abstract int calculateOutput(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 }",
"public void computeOutputs(double[] input){\n if (input != null) {\n for (int i=0; i<fire.length; i++) {\n fire[i] = input[i];\n }\n }\n\n //if this a hidden layer then we set the input to be\n double layerInput[] = new double[fire.length+ 1];\n for(int i=0; i<fire.length; i++){\n layerInput[i] = fire[i];\n }\n //add in another element for threshold to be multiplied by 1\n layerInput[fire.length] = 1;\n\n //compute outputs\n for (int i=0; i<next.getNeuronCount(); i++) {\n //get column at i of weightThreshold\n double colWeightThreshold[] = new double[weightThreshold.length];\n for(int j=0; j<colWeightThreshold.length; j++){\n colWeightThreshold[j] = weightThreshold[j][i];\n }\n\n double sum = dotProduct(colWeightThreshold, layerInput);\n //activation function on the sum and store neuron output\n next.fire[i] = activationFunction(sum);//(exp(sum*2.0)-1.0)/(exp(sum*2.0)+1.0);\n //System.out.println(\"output[\"+i+\"]: \"+output[i]);\n\n }\n\n }",
"@Override\n\tpublic double computeOutput(double[][] inputs) {\n\t\t// sum weighted inputs\n\t\tdouble sum = 0;\n\t\tfor (int i = 0; i < inputs[0].length; i++) {\n\t\t\tsum += (inputs[0][i] * inputs[1][i]);\n\t\t}\n\t\treturn sum;\n\t}",
"public int sumEquipmentWeight(){\n int sum = 0;\n for (Equipment e: equipment){\n sum += e.getWeight();\n }\n return sum;\n }",
"public int feedforward(float[] inputs) {\r\n float sum = 0;\r\n for (int i = 0; i < weights.length; i++) {\r\n sum += inputs[i] * weights[i];\r\n }\r\n System.out.println(\"sum = \" + sum);\r\n return activate(sum);\r\n }",
"void calculateWeights(List<Neuron> connectedNeurons) {\n // neuron_k:weight = neuron_k:weight - this:LearningRate * neuron_k:error * this:output\n Iterator<Neuron> iter = connectedNeurons.iterator();\n while(iter.hasNext()) {\n Neuron neuron = iter.next();\n try{\n double currentWeight = neuron.inputWeights.get(this.neuronName);\n double neuronError = neuron.error;\n double newWeight = currentWeight - LEARNING_RATE*neuronError*this.getOutput(); // !!! equation difference\n \n System.out.println(\"this neuronName: \" + this.neuronName + \" that neuron keys: \" + neuron.inputWeights);\n System.out.println(\"Old weight: \" + currentWeight + \" new weight: \" + newWeight);\n \n neuron.inputWeights.put(this.getName(), newWeight);\n }catch (Exception e) {\n System.out.println(this.neuronName + \" : \" + neuron.inputWeights);\n e.printStackTrace();\n System.exit(1);\n }\n }\n }",
"@Override\n\tpublic void run() {\n\t\ttotal = 0;\n\t\tfor (Node n : inputs) {\n\t\t\ttotal += n.output * weights.get(n).getWeight();\n\t\t}\n\t\ttotal += bias * biasWeight.getWeight();\n\t\toutput = activationFunction.run(total);\n\t}",
"public void propagateSignal() {\r\n\t\tif (enabled) {\r\n\t\t\tdouble input = in.getOutput();\r\n\t\t\tdouble output = input * weight;\r\n\t\t\tout.addInput(output);\r\n\t\t\tactivated = true;\r\n\t\t}\r\n\t}",
"private double sumWeights(int index, Image image){\n double sum = 0;\n for(int i= 0; i<400 ; i++){\n sum+=perceptrons.get(i).getWeight(index)\n *normalizeImageValue(image.getImage()[i]);\n }\n return sum;\n }",
"protected double t_weight_sum(int t) throws Exception\n\t{\n\t\tdouble sum = 0;\n\t\tint i, j;\n\t\tfor (i = 0; i < user_num; i++)\n\t\t{\n\t\t\tsum += weight_ut.at(i, t);\n\t\t}\n\t\tfor (j = 0; j < item_num; j++)\n\t\t{\n\t\t\tsum += weight_ti.at(t, j);\n\t\t}\n\t\treturn sum;\n\t}",
"private Double CPLXCalculateWeightedSUM(int numTerms) {\n Double result = 0.0;\r\n\r\n for (int counter = 0; counter < numTerms; counter++) \r\n {\r\n result += CPLXCalculateWeightedSUMTerm(counter);\r\n }\r\n\r\n return result;\r\n }",
"private void calculateNewWeights(double tmp) {\n // a) for output layer (linear) neuron\n if (layer == 0) {\n for (int j = 0; j < inputs; ++j) {\n changes[j] += tmp * network.getInput()[j];\n }\n }\n // b) if neuron belongs to one of hidden layers\n else {\n for (int j = 0; j < inputs; ++j) {\n changes[j] += tmp * network.getNeurons()[layer - 1][j].output;\n }\n }\n\n // additional calculation if const input is enabled\n if (enableConstAddend)\n changes[inputs] += tmp;\n }",
"public int perform(double[] input) {\r\n\t\tif (getWeightSize() == input.length) {\r\n\t\t\tdouble sum = 0;\r\n\t\t\tfor (int i = 0; i < input.length; i++) {\r\n\t\t\t\tsum += input[i] * weigths[i];\r\n\t\t\t}\r\n\t\t\tif (activator.activate(sum)) {\r\n\t\t\t\treturn 1;\r\n\t\t\t} else {\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthrow new RuntimeException(\"Weight and input size are not equal\");\r\n\t\t}\r\n\t}",
"public void FeedForward() {\r\n\t\tfor (int i = 0; i < Node.length; i++) {\r\n\t\t\tNet = Node[i].Threshold;\r\n\r\n\t\t\tfor (int j = 0; j < Node[i].Weight.length; j++)\r\n\t\t\t\tNet = Net + Input[j] * Node[i].Weight[j];\r\n\r\n\t\t\tNode[i].Output = Sigmoid(Net);\r\n\t\t}\r\n\t}",
"public void addInput(Input input, int weight) {\n lastNeuron().addInput(input, weight);\n }",
"public static int sumAll(int n1,int n2) {\n int sum=0;\n for(int i=0;i<12;sum+=weights[n1][n2][i],i++);\n return sum;\n }",
"public double transfer(double[] inputs, double[] weights) throws Exception;",
"@Override\n /**\n * @param X The input vector. An array of doubles.\n * @return The value returned by th LUT or NN for this input vector\n */\n\n public double outputFor(double[] X) {\n int i = 0, j = 0;\n for(i=0;i<argNumInputs;i++){\n S[0][i] = X[i];\n NeuronCell[0][i] = X[i];\n }\n //then add the bias term\n S[0][argNumInputs] = 1;\n NeuronCell[0][argNumInputs] = customSigmoid(S[0][argNumInputs]);\n S[1][argNumHidden] = 1;\n NeuronCell[1][argNumHidden] = customSigmoid(S[1][argNumInputs]);\n\n for(i=0;i<argNumHidden;i++){\n for(j=0;j<=argNumInputs;j++){\n //Wji : weigth from j to i\n WeightSum+=NeuronCell[0][j]*Weight[0][j][i];\n }\n //Sj = sigma(Wji * Xi)\n S[1][i]=WeightSum;\n NeuronCell[1][i]=(customSigmoid(WeightSum));\n //reset weigthsum\n WeightSum=0;\n }\n\n for(i = 0; i < argNumOutputs; i++){\n for(j = 0;j <= argNumHidden;j++){\n WeightSum += NeuronCell[1][j] * Weight[1][j][i];\n }\n NeuronCell[2][i]=customSigmoid(WeightSum);\n S[2][i]=WeightSum;\n WeightSum=0;\n }\n //if we only return 1 double, it means we only have one output, so actually we can write return NeuronCell[2][0]\n return NeuronCell[2][0];\n }",
"public interface InputSummingFunction {\r\n\r\n\t/**\r\n\t * Performs calculations based on the output values of the input neurons.\r\n\t * \r\n\t * @param inputConnections\r\n\t * neuron's input connections\r\n\t * @return total input for the neuron having the input connections\r\n\t */\r\n\tdouble collectOutput(List<NeuronsConnection> inputConnections);\r\n\r\n}",
"NeuronType getType();",
"public interface Neuron {\n /**\n * Checks if current neuron is of type NeuronType.INPUT.\n *\n * @return true if it's input neuron, false otherwise\n */\n boolean isInputNeuron();\n\n /**\n * Checks if current neuron is of type NeuronType.HIDDEN.\n *\n * @return true if it's hidden neuron, false otherwise\n */\n boolean isHiddenNeuron();\n\n /**\n * Checks if current neuron is of type NeuronType.OUTPUT.\n *\n * @return true if it's output neuron, false otherwise\n */\n boolean isOutputNeuron();\n\n /**\n * Checks if current neuron is of type NeuronType.BIAS.\n *\n * @return true if it's bias neuron, false otherwise\n */\n boolean isBiasNeuron();\n\n /**\n * Getter for neuron's name.\n *\n * @return String of this neuron's name\n */\n String getName();\n\n /**\n * Setter for neuron's name.\n *\n * @param name String value as new name for this neuron\n * @return this Neuron instance\n */\n Neuron setName(String name);\n\n /**\n * Gets the List of all incoming neurons (dendrites) for this one.\n * Could be called for all neurons except neurons from input layer and bias neurons,\n * as they can't have incoming connections.\n *\n * @return the List of Neuron instance that leads to this neuron\n */\n List<Neuron> getDendrites();\n\n /**\n * Sets the List of all incoming neurons (dendrites) for this one.\n * Could be called for all neurons except neurons from input layer and bias neurons,\n * as they can't have incoming connections.\n *\n * @return this Neuron instance\n */\n Neuron setDendrites(List<Neuron> dendrites);\n\n /**\n * Gets the current value of this neuron.\n *\n * @return double value of this neuron\n */\n double getAxon();\n\n /**\n * Sets the value for this neuron.\n * Could be called only for input neurons.\n * Hidden neurons and output neurons calculating their values using information from their incoming connections\n * and using activation function, and bias neuron always have axon = 1.\n *\n * @param newValue new axon value for input neuron\n * @return this Neuron instance\n */\n Neuron setAxon(double newValue);\n\n /**\n * Gets the List of all outgoing neurons (synapses) from this one.\n * Could be called for all neurons except of output type as they can't have outgoing connections.\n *\n * @return the List of Neuron instance that this neuron leads to\n */\n List<Neuron> getSynapses();\n\n /**\n * Sets the List of all outgoing neurons (synapses) from this one.\n * Could be called for all neurons except of output type, as they can't have incoming connections.\n *\n * @return this Neuron instance\n */\n Neuron setSynapses(List<Neuron> synapses);\n\n /**\n * Gets the type of this neuron.\n *\n * @return NeuronType value that represents this neuron's type\n */\n NeuronType getType();\n\n /**\n * Computes the value for this neuron from all incoming neurons, using the list of weights passed in this method.\n * The size of weights list should be same as the number of incoming connections for this neuron.\n * Otherwise RuntimeException would be thrown.\n *\n * @param weights the List of double values the represents weights for each incoming connection for this neuron\n * @return new computed soma value\n */\n double calculateSoma(List<Double> weights);\n\n /**\n * Calculates the new value (axon) for this neuron from it's soma, normalized by activation function.\n *\n * @param activationFunction activation function to be used for normalizing soma value\n * @return new axon value for this neuron\n */\n double calculateAxon(ActivationFunction activationFunction);\n\n /**\n * Computes the value for this neuron from all incoming neurons, using the list of weights passed in this method.\n * The size of weights list should be same as the number of incoming connections for this neuron.\n * Otherwise RuntimeException would be thrown.\n * Then calculates the new value (axon) for this neuron from it's soma, normalized by activation function.\n *\n * @param weights the List of double values the represents weights for each incoming connection for this neuron\n * @param activationFunction activation function to be used for normalizing soma value\n * @return new axon value for this neuron\n */\n double calculateSomaAndAxon(List<Double> weights, ActivationFunction activationFunction);\n\n double getDelta();\n\n void setDelta(double delta);\n}",
"public double[] getNeuronInput(int layer, int neuron, double inputToSynapse[]) {\n\t\tdouble[] inputs = new double[synapses[layer][neuron].length]; //# of inputs is the same as the coresponding number of weights for the neuron\n\t\tfor (int i = 0 ; i < inputs.length; i++) {//each synapse is attached to each input \n\t\t\tinputs[i] = synapses[layer][neuron][i].applyWeight(inputToSynapse[i]);\n\t\t}\n\t\treturn inputs;\n\t}",
"public abstract double totalWeight();",
"public double[] processSignal(double[] input){\r\n if(input.length == 784){\r\n neuralNetwork.setInput(input);\r\n neuralNetwork.calculate();\r\n double[] output = neuralNetwork.getOutput();\r\n String s = \"\";\r\n for(double d : output){\r\n s += String.valueOf(d) + \",\";\r\n }\r\n return output;\r\n } else {\r\n return null;\r\n }\r\n }",
"double collectOutput(List<NeuronsConnection> inputConnections);",
"public double calculateOutputForInstance(Instance inst)\r\n\t{\r\n\t\tint k =0;\r\n\t\tfor(Node input_temp: inputNodes)\r\n\t\t{\r\n\t\t\tif(input_temp.getType()==0)\r\n\t\t\t{\r\n\t\t\t\tinput_temp.setInput(inst.attributes.get(k));\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t}\r\n\r\n\t\t// set output\r\n\t\tfor(Node hidden_temp: hiddenNodes)\r\n\t\t{\r\n\t\t\thidden_temp.calculateOutput();\r\n\t\t}\r\n\r\n\t\toutputNode.calculateOutput();\r\n\t\t\r\n\t\treturn outputNode.getOutput();\r\n\r\n\t}",
"public double addWeight(Weight w1, Weight w2) {\n return Double.sum(w1.value*w1.unit.baseUnitConversion, w2.value*w2.unit.baseUnitConversion);\n }",
"@Override\r\n public double getBaseWeight() { return type.getWeight(); }",
"public final double getObsWeightedSum() {\n return (myJsum);\n }",
"private void trainOnSamples() {\n for (Sample sample : samples) {\n double sum = 0;\n \n for (int i = 0; i < weights.length; i++) { //calculating w1.x1 + w2.x2 + ... \n sum += weights[i] * sample.getP()[i];\n }\n sum += bias; //adding bias to the sum\n\n if (!compareOutput(sum, sample)) { //compare network & target output\n //updating the weights\n for (int i = 0; i < weights.length; i++) {\n weights[i] += sample.getTarget() * sample.getP()[i];\n }\n //updating the bias\n bias += sample.getTarget();\n sample.setValidation(false);\n } else {\n sample.setValidation(true);\n }\n }\n }",
"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}",
"public double weightedTally() {\r\n if (tupleCount == 0) return 0;\r\n\r\n double total = 0.0;\r\n\r\n for (int i = 0; i < tupleCount; i++) {\r\n Tuple t = tuple[i];\r\n total += t.getWeight();\r\n }\r\n\r\n return total;\r\n }",
"public static List<Double> execute(Network net, Example example)\r\n\t{\r\n\t\t// variables\r\n\t\tint currLayerSize;\r\n\t\tint nextLayerSize;\r\n\t\tint nextLayerNeuronId;\r\n\t\tdouble inputSum;\r\n\t\t\r\n\t\tList<Double> result = new ArrayList<Double>();\r\n\t\t\r\n\t\t// retrieving configuration input parameters\r\n\t\tConfiguration conf = net.getConfiguration();\r\n\t\tMap<Integer, Integer> neuronPerLayer = conf.getNodesPerLayer();\r\n\t\t\r\n\t\t// retrieving neural net attributes\r\n\t\tList<List<Neuron>> neurons = net.getNeurons();\r\n\t\tList<List<List<Weight>>> weights = net.getWeights();\r\n\t\t\r\n\t\tint numLayers = conf.getLayersNumber();\r\n\t\tfor (int i = 0; i < numLayers - 1; i++)\r\n\t\t{\r\n\t\t\tnextLayerSize = neuronPerLayer.get(i+1);\r\n\t\t\tfor (int j = 0; j < nextLayerSize; j++)\r\n\t\t\t{\r\n\t\t\t\tcurrLayerSize = neuronPerLayer.get(i);\r\n\t\t\t\tinputSum = 0;\r\n\t\t\t\t\r\n\t\t\t\t// +1 for including bias\r\n\t\t\t\tfor (int k = 0; k < currLayerSize + 1; k++)\r\n\t\t\t\t{\r\n\t\t\t\t\tNeuron neuronCurrLayer = neurons.get(i).get(k);\r\n\t\t\t\t\tWeight weight = weights.get(i).get(k).get(j);\r\n\t\t\t\t\tinputSum += neuronCurrLayer.getOutput() * weight.getValue();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// necessary because the last layer has no bias\r\n\t\t\t\tnextLayerNeuronId = (i == numLayers - 2) ? j : (j+1);\r\n\t\t\t\tneurons.get(i+1).get(nextLayerNeuronId).calculateOutput(inputSum);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// copy data from neurons output to vector result\r\n\t\tfor (int i = 0; i < neurons.get(numLayers-1).size(); i++)\r\n\t\t{\r\n\t\t\tdouble output = neurons.get(numLayers-1).get(i).getOutput();\r\n\t\t\tresult.add(output);\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}",
"public ArrayList<Double> calculateOutput(){\n for(int i = 0; i < inputSize; i++){\n network.get(0).get(i).setInput(inputs.get(i));\n }\n //Make it go through each node in the network and calculate output for each of them top down\n for(int i = 0; i < numOutputs; i++){\n output.set(i, network.get(layers-1).get(i).calculateOutput());\n }\n return output;\n }",
"public void addNeuron(Neuron neuron, double[] weights) {\r\n\t\tgetNeurons().add(neuron);\r\n\t\tif(prevLayer != null) {\r\n\t\t\tif(weights.length == prevLayer.getNeurons().size() ) { \t//Check that we have the correct number of weights\r\n\t\t\t\tList<Neuron> prevLayerNeurons = prevLayer.getNeurons();\t\t\r\n\t\t\t\tfor(int i = hasBias(); i < prevLayerNeurons.size(); i++) {\t\t//Loop through each neuron in the previous layer \r\n\t\t\t\t\tConnection con = new Connection(prevLayerNeurons.get(i));\r\n\t\t\t\t\tneuron.addConnection(con);\t//Add a connection\r\n\t\t\t\t\tcon.setWeight(weights[i]); //Set the connection weight \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthrow new IllegalArgumentException(\"Unequal number of weights compared to neurons in the previous layer\");\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public double getOutcomeWeightSum() { return outcome_w_sum; }",
"@Override\n\tpublic void backProp() {\n\t\tdouble dOut = 0;\n\t\tfor (Node n : outputs) {\n\t\t\tdOut += n.dInputs.get(this);\n\t\t}\n\t\tdouble dTotal = activationFunction.derivative(total)*dOut;\n\t\tfor (Node n : inputs) {\n\t\t\tdInputs.put(n, dTotal * weights.get(n).getWeight());\n\t\t\tweights.get(n).adjustWeight(dTotal * n.output);\n\t\t}\n\t\tbiasWeight.adjustWeight(bias * dTotal);\n\t}",
"public Neuron(Network network, int numberOfInputs, int layerNumber, boolean enableConstAddend) {\n this.network = network;\n this.inputSum = 0.0;\n this.output = 0.0;\n this.delta = 0.0;\n this.inputs = numberOfInputs;\n this.layer = layerNumber;\n this.enableConstAddend = enableConstAddend;\n this.weights = new double[numberOfInputs + 1];\n this.exWeights = new double[numberOfInputs + 1];\n this.changes = new double[numberOfInputs + 1];\n\n setNewWeights(false);\n }",
"private double computeSumWeightDocuments(String term, ArrayList<Integer> listDocumentsSameType) {\n double sumWeightDoc = 0.0;\n Iterator iterator = listDocumentsSameType.iterator();\n while (iterator.hasNext()) {\n int indexDocument = (Integer) iterator.next();\n try {\n if (invertedFile.getListTermWeights().get(term).getDocumentWeightCounterInOneTerm().get(indexDocument) != null) {\n counterWeightPair counter = invertedFile.getListTermWeights().get(term).getDocumentWeightCounterInOneTerm().get(indexDocument);\n sumWeightDoc += counter.getWeight();\n }\n } catch (Exception e) {\n\n }\n }\n return sumWeightDoc;\n }",
"public void writeNumberOfInNeurals() {\r\n \r\n inputLayer.setNumberOfNeurals(numberOfInputNeurals);\r\n }",
"public FeedForwardNeuralNetwork mutate(FeedForwardNeuralNetwork net)\n\t{\n // Copies the net\n FeedForwardNeuralNetwork newNetwork = new FeedForwardNeuralNetwork(net);\n newNetwork.setWeightVector((Vector<Double>)net.getWeightVector().clone());\n\n Vector<Double> newWeights = new Vector<Double>();\n\t\tRandom gen = new Random();\n int mc = gen.nextInt(100), slSize;\n\n if (mc <= 10) { // all the weights in the network\n for(SynapseLayer sl: newNetwork.synapse_layers) {\n slSize = sl.getWeightVector().size() / 20;\n for (Double weight: sl.getWeightVector())\n newWeights.add(weight + gen.nextGaussian()*Math.sqrt(slSize));\n }\n newNetwork.setWeightVector(newWeights);\n }\n else if (mc <= 37) { // all the weights in a randomly selected layer\n SynapseLayer sl = newNetwork.synapse_layers.get(gen.nextInt(newNetwork.synapse_layers.size()));\n for (Double weight: sl.getWeightVector())\n newWeights.add(weight + gen.nextGaussian() * Math.sqrt(sl.getWeightVector().size()/20));\n sl.setWeightVector(newWeights);\n }\n else if (mc <= 64) { // all the weights going into a randomly selecte layer, i can't tell the difference between this and the last one\n SynapseLayer sl = newNetwork.synapse_layers.get(gen.nextInt(newNetwork.synapse_layers.size()));\n for (Double weight: sl.getWeightVector())\n newWeights.add(weight + gen.nextGaussian() * Math.sqrt(sl.getWeightVector().size()/20));\n sl.setWeightVector(newWeights);\n }\n else {\n newWeights = newNetwork.getWeightVector();\n int rInd = gen.nextInt(newWeights.size());\n newWeights.set(rInd, newWeights.get(rInd) + Math.sqrt(gen.nextGaussian()*14));\n newNetwork.setWeightVector(newWeights);\n }\n\t\treturn newNetwork;\n\t}",
"public void addNeuron(){\n neurons.add(new Neuron(neurons.size(), layerIndex));\n for (Neuron n: upStream.getNeurons()){\n Connection con = new Connection(n, neurons.get(neurons.size()-1));\n n.addDownStream(con);\n neurons.get(neurons.size()-1).addUpStream(con);\n }\n for (Neuron n: downStream.neurons){\n Connection con = new Connection(neurons.get(neurons.size()-1), n);\n n.addUpStream(con);\n neurons.get(neurons.size()-1).addDownStream(con);\n }\n }",
"private double[][] forwardPropogate(double[][] inputs, double[][] weights) {\n\t\tdouble[][] resultLayer = m.dot(inputs, weights);\n\t\tsigmoid(resultLayer);\n\t\treturn resultLayer;\n\t}",
"default double totalWeight() {\n return edges().stream().mapToDouble(E::weight).sum();\n }",
"public T sum();",
"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 void writeNumberOfOutNeurals() {\r\n \r\n outputLayer.setNumberOfNeurals(numberOfOutputNeurals);\r\n }",
"public float getInputsValue() {\n\t\tfloat total = 0;\n\t\tfor (TransactionInput i : inputs) {\n\t\t\tif (i.getUTXO() == null)\n\t\t\t\tcontinue; // if Transaction can't be found skip it\n\t\t\ttotal += i.getUTXO().getValue();\n\t\t}\n\t\treturn total;\n\t}",
"protected abstract void updateWeightsSpecific(double ni);",
"public static double sigmoid(double weightedSum) {\r\n\t\t\tdouble probability = 1/(1+Math.pow(Math.E, -weightedSum));\r\n\t\t\treturn probability;\r\n\t\t}",
"public void weight(double arrInOut[]) {\r\n int N = arrInOut.length;\r\n for (int n = 0; n < arrInOut.length; n++) {\r\n double multiplier = 0.5 - 0.5 * Math.cos(2 * Math.PI * n / N);\r\n arrInOut[n] = arrInOut[n] * multiplier * SCALING_COEFFICIENT;\r\n }\r\n }",
"protected void mutateWeights() {\n\t\t// TODO: Change the way weight mutation works\n\t\tif (Braincraft.gatherStats) {\n\t\t\tArrayList<Integer> mutatedgenes = new ArrayList<Integer>();\n\t\t\tfor (Gene g : genes.values()) {\n\t\t\t\tif (Braincraft.randomChance(population.perWeightMutationRate)) {\n\t\t\t\t\tg.weight = Braincraft.randomWeight();\n\t\t\t\t\tmutatedgenes.add(g.innovation);\n\t\t\t\t}\n\t\t\t}\n\t\t\tString output = \"weight mutation \" + ID;\n\t\t\tfor (Integer i : mutatedgenes) {\n\t\t\t\toutput += \" \" + i;\n\t\t\t}\n\t\t\tBraincraft.genetics.add(output);\n\t\t} else {\n\t\t\tfor (Gene g : genes.values()) {\n\t\t\t\tif (Braincraft.randomChance(population.perWeightMutationRate))\n\t\t\t\t\tg.weight = Braincraft.randomWeight();\n\t\t\t}\n\t\t}\n\t\t// TODO: Report weight mutations to stats\n\t}",
"public void addWeight(){\n\t\tweight++;\n\t}",
"public Solution(int[] w) {\n // get a Random instance\n random = new Random();\n\n // fulfill weightPrefixSum array\n int len = w.length;\n weightPrefixSum = new int[len];\n weightPrefixSum[0] = w[0];\n for(int i = 1; i < w.length; i++){\n weightPrefixSum[i] = weightPrefixSum[i-1] + w[i];\n }\n }",
"@GetMapping(\"/total-sum\")\n\tpublic Double getTotalTransactionsSumByType(@RequestParam String type) {\n\t\tDouble totalSum = null;\n\t\t\n\t\ttry {\n\t\t\ttotalSum = transactionService.getTotalTransactionsSumByType(type);\n\t\t}\n\t\tcatch (InvalidDataException e) {\n\t\t\tString exceptionMessage = e.getMessage();\n\t\t\tthrow new InvalidDataException(exceptionMessage);\n\t\t}\n\t\t\n\t\treturn totalSum;\n\t}",
"public float getInputsValue() {\n\n float total = 0;\n for (TransactionInput i : inputs) {\n // If the transaction can't be found, skip it.\n if (i.UTXO == null) continue;\n total += i.UTXO.value;\n }\n return total;\n }",
"public final EObject ruleSumOperator() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:5015:28: ( ( () otherlv_1= 'sum' ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:5016:1: ( () otherlv_1= 'sum' )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:5016:1: ( () otherlv_1= 'sum' )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:5016:2: () otherlv_1= 'sum'\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:5016:2: ()\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:5017:5: \r\n {\r\n if ( state.backtracking==0 ) {\r\n\r\n current = forceCreateModelElement(\r\n grammarAccess.getSumOperatorAccess().getSumOperatorAction_0(),\r\n current);\r\n \r\n }\r\n\r\n }\r\n\r\n otherlv_1=(Token)match(input,71,FOLLOW_71_in_ruleSumOperator11393); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_1, grammarAccess.getSumOperatorAccess().getSumKeyword_1());\r\n \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }",
"double calculateSomaAndAxon(List<Double> weights, ActivationFunction activationFunction);",
"public void updateWeights(int sampleNum) {\n\t\tint lastLayer = layers.size() - 1;\n\n\t\t/* Calculate signal error in output layer */\n\t\tfor (Node n : layers.get(lastLayer).getNodes()) {\n\t\t\tint i = layers.get(lastLayer).getNodes().indexOf(n);\n\t\t\tDouble sigErr = ((expectedOutput.get(sampleNum % expectedOutput.size()).get(i)\n\t\t\t\t\t- layers.get(lastLayer).getNodes().get(i).getOutput())\n\t\t\t\t\t* layers.get(lastLayer).getNodes().get(i).getOutput()\n\t\t\t\t\t* (1 - layers.get(lastLayer).getNodes().get(i).getOutput()));\n\t\t\tn.setSigErr(sigErr);\n\t\t}\n\n\t\t/* \n\t\t * Calculates signal errors for all nodes in hidden layers.\n\t\t * Back propagates the signal errors.\n\t\t */\n\t\tfor (int i = (lastLayer - 1); i > 0; i--) {\n\t\t\tfor (int j = 0; j < layers.get(i).getNodes().size(); j++) {\n\t\t\t\tDouble sum = 0.0;\n\t\t\t\ttry {\n\t\t\t\tfor (int k = 0; k < layers.get(i + 1).getNodes().size(); k++) {\n\t\t\t\t\tsum += layers.get(i + 1).getNodes().get(k).getWeights().get(j)\n\t\t\t\t\t\t\t* layers.get(i + 1).getNodes().get(k).getSigErr();\n\t\t\t\t}\n\t\t\t\t} catch(IndexOutOfBoundsException e) {\n\n\t\t\t\t}\n\t\t\t\tlayers.get(i).getNodes().get(j).setSigErr(sum * layers.get(i).getNodes().get(j).getOutput()\n\t\t\t\t\t\t* (1 - layers.get(i).getNodes().get(j).getOutput()));\n\t\t\t}\n\t\t}\n\n\t\t/* Updates weights */\n\t\tfor (int i = (layers.size() - 1); i > 0; i--) {\n\t\t\tfor (Node n : layers.get(i).getNodes()) {\n\t\t\t\t/* Calculate weight error */\n\t\t\t\tn.setThresholdErr(learningRate * n.getSigErr() + momentum * n.getThresholdErr());\n\t\t\t\tn.setThreshold(n.getThreshold() + n.getThresholdErr());\n\n\t\t\t\t/* updates weights */\n\t\t\t\ttry {\n\t\t\t\t\tfor (int j = 0; j < n.getWeights().size(); j++) {\n\t\t\t\t\t\t/* Calculate distance between nodes */\n\t\t\t\t\t\tn.getWeightsErr().set(j,\n\t\t\t\t\t\t\t\tlearningRate * n.getSigErr() * layers.get(i - 1).getNodes().get(j).getOutput()\n\t\t\t\t\t\t\t\t\t\t+ momentum * n.getWeightsErr().get(j));\n\t\n\t\t\t\t\t\t/* Update based on distance */\n\t\t\t\t\t\tn.getWeights().set(j, n.getWeights().get(j) + n.getWeightsErr().get(j));\n\t\t\t\t\t}\n\t\t\t\t} catch(IndexOutOfBoundsException e) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Reduces learning rate over time to prevent over or under fitting */\n\t\tepoch++;\n\t\tlearningRate = learningRate / ((1 + epoch) / (epoch));\n\t}",
"public double calcTotalOreWeight() \n {\n double fTotalOre;\n\n fTotalOre = 0.0;\n for (OrePile pile : m_orePileQueue) {\t// For this to work, Iterator must be implemented in DSAQueue\n fTotalOre += pile.getWeight();\n } \n\n return fTotalOre;\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 }",
"@Override\n public void calculate() {\n State outputState = State.ZERO;\n for(Input i: inputs){\n if(i.getState() == State.ONE) {\n outputState = State.ONE;\n break;\n }\n else if (i.getState() == State.NOT_CONNECTED) {\n state = State.NOT_CONNECTED;\n setImage();\n System.out.println(\"Invalid connection detected\");\n return;\n }\n }\n state = outputState;\n setImage();\n }",
"@Override\n public void notifySubscriber(String input) {\n int in=Integer.parseInt(input);\n int result=(in*(in+1))/2;\n System.out.println(\"SummationSeries : \" + result);\n }",
"public Vec getRawWeight();",
"public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException {\n if (inputType.length > 1)\n throw new InvalidKerasConfigurationException(\n \"Keras Masking layer accepts only one input (received \" + inputType.length + \")\");\n return this.getMaskingLayer().getOutputType(-1, inputType[0]);\n }",
"public int weight ();",
"WeightedRandomSampling(double[] w){\n int len = w.length;\n aggregatedW = new double[len];\n counts = new int[len];\n double temp = 0;\n\n for(int i=0; i<len; i++){\n aggregatedW[i] = temp;\n //System.out.println(aggregatedW[i]);\n temp+= w[i];\n }\n }",
"boolean isOutputNeuron();",
"double calculateSoma(List<Double> weights);",
"@Override\n\t\tpublic int get_weights() {\n\t\t\treturn weight;\n\t\t}",
"OutputsType getOutputs();",
"public void addNeuron() {\n neurons.add(new Neuron(function));\n }",
"private void applySensoryInputToBrain() {\n\t\tArrayList<MNeuron> neurons = mnetwork.getNeurons();\n\n\t\t/* Temporarily hardcode id's of neurons of interest. */\n\t\tint numVSegs = Agent.configNumSegments;\n\t\tint firstVFoodNid = 3;\n\t\tint lastVFoodNid = firstVFoodNid + numVSegs - 1;\n\t\tint firstVWallNid = lastVFoodNid + 1;\n\t\tint lastVWallNid = firstVWallNid + numVSegs - 1;\n\t\tint firstVEnemyNid = lastVWallNid + 1;\n\t\tint lastVEnemyNid = firstVEnemyNid + numVSegs - 1;\n\n\t\t/*\n\t\t Provide input current the network using the sensory\n\t\t components of the interface.\n\t\t */\n\t\tfor (MNeuron n : neurons) {\n\t\t\tdouble current;\n\t\t\tint index;\n\t\t\tint id = n.getID();\n\n\t\t\t/* If the neuron is a food visual neuron. */\n\t\t\tif (id >= firstVFoodNid && id <= lastVFoodNid) {\n\t\t\t\tindex = id - 3;\n\t\t\t\tcurrent = ninterface.affectors.vFood[index];\n\t\t\t\tn.addCurrent(60.0*current);\n\t\t\t} /* If the neuron is a wall visual neuron. */ else if (id >= firstVWallNid && id <= lastVWallNid) {\n\t\t\t\tindex = id - numVSegs - 3;\n\t\t\t\tcurrent = ninterface.affectors.vWall[index];\n\t\t\t\tn.addCurrent(60.0*current);\n\t\t\t} /* If the neuron is an enemy visual neuron. */ else if (id >= firstVEnemyNid && id <= lastVEnemyNid) {\n\t\t\t\tindex = id - 2 * numVSegs - 3;\n\t\t\t\tcurrent = ninterface.affectors.vEnemy[index];\n\t\t\t\tn.addCurrent(60.0*current);\n\t\t\t}\n\t\t}\n\t}",
"InputsType getInputs();",
"public double dotProduct(ArrayList<Double> outputs, ArrayList<Double> weights) {\n\t\tdouble toReturn = 0.0;\n\t\tfor (int i = 0; i < weights.size() - 1; i++) {\n\t\t\tif (!(i > outputs.size() - 1)) {\n\t\t\t\tdouble oldV = weights.get(i);\n\t\t\t\tdouble hk = outputs.get(i);\n\t\t\t\ttoReturn += hk * oldV;\n\t\t\t}\n\t\t}\n\t\treturn toReturn;\n\t}",
"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}",
"private double weight(){\n return ((double) (m_PositiveCount + m_NegativeCount)) / ((double) m_PositiveCount);\n }",
"boolean isInputNeuron();",
"public IRealVector sumWeighted(Collection<WeightedTerm> terms) throws Exception {\n IRealVector vector = null;\n for (WeightedTerm tw : terms) {\n if (wordToVector.hasWord(tw.term)) {\n if (vector == null) {\n vector = wordToVector.getWordVector(tw.term).clone();\n double factor = 1 + Math.log(tw.weight);\n vector.multiply(factor);\n }\n else {\n IRealVector v = wordToVector.getWordVector(tw.term).clone();\n double factor = 1 + Math.log(tw.weight); \n vector.add(v.multiply(factor));\n }\n }\n } \n return vector; \n }",
"static double incrementWeight(String tempInput) {\n double value;\n if (tempInput.matches(\"\")) {\n value = 2.5;\n return value;\n }\n\n value = Double.parseDouble(tempInput);\n value = value + 2.5;\n return value;\n }",
"double getSum();",
"double getSum();",
"public void addInput(double singleNodeInput) {\n\t\tinputs.add(singleNodeInput);\n\t\tinput += singleNodeInput;\n\t\tinputCounter++;\n\t\tif (inputCounter >= prevLayerNodes.size()) {\n\t\t\t//System.out.printf(\"Input = %f%n\", input);\n//\t\t\tif (prevLayerNodes.size() == 0) {\n//\t\t\t\t// Handle the input layer, no activation function necessary\n//\t\t\t\toutput = input;\n//\t\t\t} else {\n\t\t\t\toutput = nodeActivationFunction.getOutput(input);\n//\t\t\t}\n\t\t\tpreActivationFunctionOutput = input;\n\t\t\tinput = 0;\n\t\t\t//System.out.printf(\"Output = %f%n\", output);\n//\t\t\tSystem.out.printf(\"Firing...input counter = %d%n\", inputCounter);\n//\t\t\tfor (int i = 0; i < inputs.size(); i++) {\n//\t\t\t\tSystem.out.printf(\"%f,\", inputs.get(i));\n//\t\t\t}\n//\t\t\tSystem.out.println();\n\t\t\tinputs.clear();\n\t\t\tinputCounter = 0;\n\t\t\tfire();\n\t\t}\n\t\t// test printing for input layer\n\t\tif (prevLayerNodes.size() == 0) {\n\t\t\tSystem.out.printf(\"\tInput layer output = %f%n\", output);\n\t\t}\n\t}",
"public void add(double weight) {\n this.weights.add(weight);\n // flip the flag to accept query operator\n this.acceptWeight = false;\n }",
"public double getTotalAdjacentInternalWeight(int nodeIndex) {\n\t\treturn this.inWeights[nodeIndex];\n\t}",
"public double averDiff (final NeuralNetwork net) {\n double sum = 0;\n int numOfWeights = 0;\n for (int lid = 0; lid < layers.size(); lid++) {\n final Layer l = layers.get(lid);\n final Layer otherL = net.layers.get(lid);\n for (int uid = 0; uid < l.units.size(); uid++) {\n final Unit u = l.units.get(uid);\n final Unit otherU = otherL.units.get(uid);\n for (int wid = 0; wid < u.weights.size(); wid++) {\n final double w = u.weights.get(wid);\n final double otherW = otherU.weights.get(wid);\n sum += Math.abs(w - otherW);\n numOfWeights++;\n }\n }\n }\n return sum / numOfWeights;\n }",
"public void addNeuron(ArrayList<Double> weights, int i, int j) {\n this.network[i][j] = new Neuron(weights, i, j);\n }",
"public abstract double getWeight ();",
"int Weight();",
"public void updateNetworkWeights(int particleIndex) {\n int x=0;\r\n double[] weights;\r\n // loops through all nodes in first hidden layer, setting weights (there is a weight associated with each input)\r\n for (int j=0; j<layers.get(0); j++) {\r\n weights = new double[numberOfInputs+1];\r\n for (int k=0; k<numberOfInputs+1; k++) {\r\n weights[k] = particles.get(particleIndex).coordinates.get(x);\r\n x++;\r\n }\r\n n.net.get(0).get(j).setWeights(weights);\r\n }\r\n // loops through all nodes in each subesquent layer, setting weights (there is a weight associated with each node from the layer below\r\n for (int i=1; i<layers.size(); i++) {\r\n for (int j=0; j<layers.get(i); j++) {\r\n weights = new double[layers.get(i-1)+1];\r\n for (int k=0; k<layers.get(i-1); k++) {\r\n weights[k] = particles.get(particleIndex).coordinates.get(x);\r\n x++;\r\n }\r\n n.net.get(i).get(j).setWeights(weights);\r\n }\r\n }\r\n \r\n }",
"public WorkingNeuron getOutputNeuronFromName(String name) {\n\t\tfor (WorkingNeuron neuron : outputLayer) {\n\t\t\tif (name.equals(neuron.getName())) {\n\t\t\t\treturn neuron;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public float getWeight();",
"private void getSum() {\n\t\tint sum =0;\r\n\t\t\r\n\t\tfor(int i=0; i<index; i++) {\r\n\t\t\tif(products[i] != null)\r\n\t\t\t\tsum += products[i].getPrice();\r\n\t\t}\r\n\t\tSystem.out.println(sum);\r\n\t}",
"public void applyBackpropagation( float expectedOutput[] ) {\n\t\t// The code for updating weights goes here \n\t\t// NOTE: if using a single perceptron, this is not technically back-propagation, despite the function name \n }",
"public boolean isWeighted();",
"public void train(double[] inputs, double[] outputsTarget) {\n assert(outputsTarget.length == weights.get(weights.size() - 1).length);\n \n ArrayList<double[]> layersOutputs = new ArrayList<double[]>(); \n classify(inputs, layersOutputs);\n\n // Calculate sensitivities for the output nodes\n int outputNeuronCount = this.weights.get(this.weights.size() - 1).length;\n double[] nextLayerSensitivities = new double[outputNeuronCount];\n assert(layersOutputs.get(layersOutputs.size() - 1).length == outputNeuronCount);\n for (int i = 0; i < outputNeuronCount; i++) {\n nextLayerSensitivities[i] = calculateErrorPartialDerivitive(\n layersOutputs.get(layersOutputs.size() - 1)[i],\n outputsTarget[i]\n ) * calculateActivationDerivitive(layersOutputs.get(layersOutputs.size() - 1)[i]);\n assert(!Double.isNaN(nextLayerSensitivities[i]));\n }\n\n for (int weightsIndex = this.weights.size() - 1; weightsIndex >= 0; weightsIndex--) {\n int previousLayerNeuronCount = this.weights.get(weightsIndex)[0].length;\n int nextLayerNeuronCount = this.weights.get(weightsIndex).length;\n assert(nextLayerSensitivities.length == nextLayerNeuronCount);\n\n double[] previousLayerOutputs = layersOutputs.get(weightsIndex);\n double[] previousLayerSensitivities = new double[previousLayerNeuronCount];\n\n // Iterate over neurons in the previous layer\n for (int j = 0; j < previousLayerNeuronCount; j++) {\n\n // Calculate the sensitivity of this node\n double sensitivity = 0;\n for (int i = 0; i < nextLayerNeuronCount; i++) {\n sensitivity += nextLayerSensitivities[i] * this.weights.get(weightsIndex)[i][j];\n }\n sensitivity *= calculateActivationDerivitive(previousLayerOutputs[j]);\n assert(!Double.isNaN(sensitivity));\n previousLayerSensitivities[j] = sensitivity;\n\n for (int i = 0; i < nextLayerNeuronCount; i++) {\n double weightDelta = learningRate * nextLayerSensitivities[i] * calculateActivation(previousLayerOutputs[j]);\n this.weights.get(weightsIndex)[i][j] += weightDelta;\n assert(!Double.isNaN(this.weights.get(weightsIndex)[i][j]) && !Double.isInfinite(this.weights.get(weightsIndex)[i][j]));\n }\n }\n\n nextLayerSensitivities = previousLayerSensitivities;\n }\n }",
"public void sumValues(){\n\t\tint index = 0;\n\t\tDouble timeIncrement = 2.0;\n\t\tDouble timeValue = time.get(index);\n\t\tDouble packetValue;\n\t\twhile (index < time.size()){\n\t\t\tDouble packetTotal = 0.0;\n\t\t\twhile (timeValue < timeIncrement && index < packets.size()){\n\t\t\t\ttimeValue = time.get(index);\n\t\t\t\tpacketValue = packets.get(index);\n\t\t\t\tpacketTotal= packetTotal + packetValue;\n\t\t\t\tindex = index + 1;\n\t\t\t}\n\t\t\tArrayList<Double> xy = new ArrayList<Double>();\n\t\t\txy.add(timeIncrement);\n\t\t\txy.add(packetTotal);\n\t\t\ttotalIncrements.add(xy);\n\t\t\t// to get max and min need separate arrays\n\t\t\ttimeIncrements.add(timeIncrement);\n\t\t\tbyteIncrements.add(packetTotal);\n\t\t\ttimeIncrement = timeIncrement + 2.0;\t\n\t\t}\n\t\treturn;\n\n\t}",
"private void calculateWeight(Iterable<PageRankWritable> messages) {\r\n\t\tlong totalInCount = 0;\r\n\t\tlong totalOutCount = 0;\r\n\r\n\t\t// Because iterator can not go back to the first record,\r\n\t\t// so we need to new another Map to store the in/out edge counts.\r\n\t\tMap<Text, long[]> edgeCountMap = new HashMap<Text, long[]>();\r\n\t\tfor (PageRankWritable msg : messages) {\r\n\t\t\ttotalInCount += msg.getInEdgeCount().get();\r\n\t\t\ttotalOutCount += msg.getOutEdgeCount().get();\r\n\r\n\t\t\t// Store edge counts.\r\n\t\t\tlong[] edgeCounts = new long[2];\r\n\t\t\tedgeCounts[0] = msg.getInEdgeCount().get();\r\n\t\t\tedgeCounts[1] = msg.getOutEdgeCount().get();\r\n\t\t\tedgeCountMap.put(msg.getSenderId(), edgeCounts);\r\n\t\t}\r\n\r\n\t\t// Calculate weight for each destination vertex.\r\n\t\tMapWritable weightMap = new MapWritable();\r\n\t\tfor (Entry<Text, long[]> entry : edgeCountMap.entrySet()) {\r\n\t\t\tText key = entry.getKey();\r\n\t\t\tlong[] value = entry.getValue();\r\n\t\t\tdouble weight = (value[0] / (double) totalInCount)\r\n\t\t\t\t\t* (value[1] / (double) totalOutCount);\r\n\t\t\tweightMap.put(key, new DoubleWritable(weight));\r\n\t\t}\r\n\r\n\t\tgetValue().setWeightMap(weightMap);\r\n\t}",
"public void updateNeighbors(Neuron BMU, ArrayList<Double> input, int t) {\n double radiusMap = this.width / 2;\n double lambda = this.nbIterations / radiusMap;\n\n // Calculation of the radius of influence.\n double radius = radiusMap * Math.exp(-t / lambda);\n\n int iMin = (BMU.getY() - radius) < 0 ? 0 : (int) (BMU.getY() - radius);\n int iMax = (BMU.getY() + radius) > this.width ? this.width : (int) (BMU.getY() + radius);\n int jMin = (BMU.getX() - radius) < 0 ? 0 : (int) (BMU.getX() - radius);\n int jMax = (BMU.getX() + radius) > this.width ? this.width : (int) (BMU.getX() + radius);\n\n // Set the new weights of neurons in proximity\n for (int i = iMin; i < iMax; i++) {\n for (int j = jMin; j < jMax; j++) {\n // Run over weights\n Neuron n = this.network[i][j];\n double Lt = this.learningRate * Math.exp(-t / lambda);\n\n double sumDist = this.euclideDistance(BMU.getWeights(), n.getWeights());\n\n double delta = sumDist / (2 * radius * radius);\n //double theta = Math.exp(-1 * (sumDist / (2 * Math.pow(radius, 2))));\n double theta = Math.exp(-delta);\n\n for (int k = 0; k < BMU.getSizeWeights(); k++) {\n\n double value = n.getWeightI(k) + theta * Lt * (input.get(k) - n.getWeightI(k));\n\n n.setWeightI(k, value);\n if (value > 1.0)\n System.out.println(\"error\");\n }\n }\n }\n }",
"void addFuel ( double mmbtu_input) {\n fuel += mmbtu_input;\r\n }",
"private void forwardCalculation(double[] recordInputs) {\n\t\t\tfor (int j = 0; j < numberOfInputs; j++) {\n\t\t\t\tinput[j] = recordInputs[j];\n\t\t\t}\n\t\t\n\t\t// for each hidden node\n\t\tfor (int i = 0; i < numberOfMiddle; i++) {\n\t\t\tdouble sum = 0;\n\n\t\t\t// compute input at hidden node\n\t\t\tfor (int j = 0; j < numberOfInputs; j++) {\n\t\t\t\tsum += input[j] * matrixMiddle[j][i];\n\t\t\t}\n\n\t\t\t// add theta\n\t\t\tsum += thetaMiddle[i];\n\n\t\t\t// compute output at hidden node\n\t\t\tmiddle[i] = 1 / (1 + Math.exp(-sum));\n\n\t\t}\n\n\t\t// for each output node\n\t\tfor (int i = 0; i < numberOfOutputs; i++) {\n\t\t\tdouble sum = 0;\n\n\t\t\t// compute input at output node\n\t\t\tfor (int j = 0; j < numberOfMiddle; j++) {\n\t\t\t\tsum += middle[j] * matrixOutput[j][i];\n\t\t\t}\n\n\t\t\t// add theta\n\t\t\tsum += thetaOutput[i];\n\n\t\t\t// compute output at output node\n\t\t\toutput[i] = 1 / (1 + Math.exp(-sum));\n\t\t}\n\t}"
] | [
"0.63053983",
"0.5963177",
"0.5763431",
"0.5677438",
"0.56191945",
"0.5609828",
"0.55875754",
"0.5562895",
"0.54889023",
"0.53984797",
"0.53500444",
"0.5261739",
"0.52037525",
"0.51779085",
"0.51718646",
"0.5148253",
"0.51269007",
"0.5124371",
"0.50989175",
"0.5095264",
"0.5073963",
"0.50620705",
"0.50568116",
"0.50393164",
"0.5015682",
"0.49798894",
"0.49575064",
"0.49394053",
"0.49186763",
"0.49138469",
"0.49125487",
"0.49004006",
"0.48965624",
"0.48954204",
"0.4894579",
"0.48765343",
"0.48705754",
"0.48402405",
"0.48174694",
"0.4814475",
"0.48087516",
"0.47878215",
"0.47801483",
"0.47717905",
"0.47675893",
"0.4758162",
"0.47445375",
"0.47253495",
"0.47037622",
"0.46822464",
"0.46694213",
"0.4668551",
"0.4642372",
"0.46130753",
"0.46080923",
"0.45888922",
"0.45761284",
"0.45741838",
"0.4562095",
"0.45587236",
"0.45541108",
"0.45513374",
"0.45493308",
"0.45470798",
"0.45403588",
"0.45377406",
"0.4536214",
"0.4530414",
"0.45257238",
"0.45213282",
"0.45184317",
"0.45158863",
"0.4509744",
"0.4495352",
"0.44884077",
"0.44724286",
"0.44718653",
"0.44683495",
"0.44561967",
"0.44538665",
"0.4452523",
"0.4452523",
"0.44325447",
"0.44321528",
"0.442292",
"0.44145167",
"0.4408139",
"0.44069573",
"0.44030228",
"0.43892378",
"0.43783823",
"0.43733418",
"0.4368614",
"0.43588808",
"0.4358175",
"0.43558076",
"0.43535078",
"0.4349533",
"0.43493056",
"0.43401292",
"0.43281204"
] | 0.0 | -1 |
Mounts an available index database to the index database object | public IndexDatabase(String index_path) {
int k;
long p;
try {
pre_file = new RandomAccessFile(index_path + "/sorted.kmc_pre", "r");
pre_file.seek(pre_file.length() - 8);
header_pos = read_int(pre_file);
pre_file.seek(pre_file.length() - 8 - header_pos);
// read the index properties
K = read_int(pre_file);
mode = read_int(pre_file);
ctr_size = read_int(pre_file);
pre_len = read_int(pre_file);
min_count = read_int(pre_file);
max_count = read_int(pre_file);
kmers_num = read_long(pre_file);
suf_len = K - pre_len;
key = new kmer(K, pre_len, suf_len);
System.out.println("Indexing " + kmers_num + " kmers... ");
// load the prefix file into the memory
pre_file.seek(4);
int q, len = 1 << (2 * pre_len);
prefix_ptr = new long[len];
MappedByteBuffer pre_buff;
for (q = 0, p = 0; p < 8; ++p) {
pre_buff = pre_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + p * len, len);
for (k = 0; k < len / 8; ++k, ++q) {
prefix_ptr[q] = read_long(pre_buff);
}
pre_buff = null;
}
pre_file.close();
// mapping suffix file into the memory
suf_rec_size = ctr_size + suf_len / 4;
MAX_BYTE_COUNT = MAX_BYTE_COUNT / suf_rec_size * suf_rec_size;
suf_parts_num = (int) ((kmers_num * suf_rec_size) % MAX_BYTE_COUNT == 0 ? (kmers_num * suf_rec_size) / MAX_BYTE_COUNT : (kmers_num * suf_rec_size) / MAX_BYTE_COUNT + 1);
suf_parts_size = new long[suf_parts_num];
suf_file = new RandomAccessFile(index_path + "/sorted.kmc_suf", "r");
suf_buff = new MappedByteBuffer[suf_parts_num];
for (k = 0; k < suf_parts_num; ++k) {
suf_parts_size[k] = (int) (k == suf_parts_num - 1 ? (kmers_num * suf_rec_size) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);
suf_buff[k] = suf_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + k * suf_parts_size[0], suf_parts_size[k]);
}
// mapping pointers file into the memory
MAX_BYTE_COUNT = MAX_BYTE_COUNT / POINTER_LENGTH * POINTER_LENGTH;
ptr_parts_num = (int) ((kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT == 0 ? (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT : (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT + 1);
ptr_parts_size = new long[ptr_parts_num];
ptr_file = new RandomAccessFile(index_path + "/pointers.db", "rw");
ptr_buff = new MappedByteBuffer[ptr_parts_num];
for (k = 0; k < ptr_parts_num; ++k) {
ptr_parts_size[k] = (int) (k == ptr_parts_num - 1 ? (kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);
ptr_buff[k] = ptr_file.getChannel().map(FileChannel.MapMode.READ_WRITE, k * ptr_parts_size[0], ptr_parts_size[k]);
}
} catch (IOException e) {
System.out.println(e.getMessage());
System.exit(1);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void syncIndex(FundamentalData fd) throws Exception {\n\n List<MarketIndex> indexes = marketIndexService.findBySymbol(fd.getSymbol());\n if(indexes.size()>1){\n throw new Exception(\"Multiple instances (\"+indexes.size()+\") of symbol \"+fd.getSymbol()+\" present in the database.\");\n }\n\n MarketIndex index;\n if(indexes.size()==0){ // does not exist in db\n index=new MarketIndex();\n index.setSymbol(fd.getSymbol());\n index.setName(fd.getName());\n index.setCategory(fd.getType().getCode());\n\n }else{ // index exists in db\n index = indexes.get(0);\n if(fd.getName()!=null){\n index.setName(fd.getName());\n }\n if(fd.getType()!=null){\n index.setCategory(fd.getType().getCode());\n }\n\n }\n\n updateIcon(index);\n marketIndexService.update(index);\n\n }",
"@PostConstruct\n public void ensureIndexes() {\n storageStrategy.ensureIndexes(mongoTemplate.domainEventCollection(), mongoTemplate.snapshotEventCollection());\n }",
"public void start() throws Exception {\n\n createIndex();\n }",
"private void ensureHashingIndexExists() {\n DB metadataDB = client.getDB(\"cacheManagerMetadata\");\n if (!metadataDB.collectionExists(\"hashingIndex\")) {\n DBCollection hashingIndex = metadataDB.getCollection(\"hashingIndex\");\n hashingIndex.createIndex(new BasicDBObject(\"hashValue\", 1),\n new BasicDBObject(\"unique\", 1));\n }\n }",
"@Ignore\n @Test\n public void testCreateIndex() {\n System.out.println(\"createIndex\");\n Util.commonServiceIPs=\"127.0.0.1\";\n \n EntityManager em=Util.getEntityManagerFactory(100).createEntityManager();\n EntityManager platformEm = Util.getPlatformEntityManagerFactory().createEntityManager();\n \n Client client = ESUtil.getClient(em,platformEm,1,false);\n \n RuntimeContext.dataobjectTypes = Util.getDataobjectTypes();\n String indexName = \"test000000\";\n try {\n ESUtil.createIndex(platformEm, client, indexName, true);\n }\n catch(Exception e)\n {\n \n }\n \n\n }",
"private void indexItem(IndexDocument indexDoc) {\n if(bDebug) System.out.println(\"\\n*** document to index - \" + indexDoc);\n Indexer indexer=null;\n try {\n indexer=new Indexer(PetstoreConstants.PETSTORE_INDEX_DIRECTORY, false);\n PetstoreUtil.getLogger().log(Level.FINE, \"Adding document to index: \" + indexDoc.toString());\n indexer.addDocument(indexDoc);\n } catch (Exception e) {\n PetstoreUtil.getLogger().log(Level.WARNING, \"index.exception\", e);\n e.printStackTrace();\n } finally {\n try {\n // must close file or will not be able to reindex\n if(indexer != null) {\n indexer.close();\n }\n } catch (Exception ee) {\n ee.printStackTrace();\n }\n }\n }",
"LuceneMemoryIndex createLuceneMemoryIndex();",
"public void addIndex(){\n\t\tdbCol=mdb.getCollection(\"genericCollection\");\n\t\tstart=Calendar.getInstance().getTimeInMillis();\n\t\tdbCol.ensureIndex(new BasicDBObject(\"RandomGeo\", \"2d\"));\n\t\tstop = Calendar.getInstance().getTimeInMillis() - start;\n\t\tSystem.out.println(\"Mongo Index Timer \"+Long.toString(stop));\n\t}",
"InstAssignIndex createInstAssignIndex();",
"private void openStore()\n throws Exception {\n\n dbStore = Utils.openStore(master, Utils.DB_NAME);\n primaryIndex = \n dbStore.getPrimaryIndex(Integer.class, RepTestData.class);\n }",
"private void ensureIndexes() throws Exception {\n LOGGER.info(\"Ensuring all Indexes are created.\");\n\n QueryResult indexResult = bucket.query(\n Query.simple(select(\"indexes.*\").from(\"system:indexes\").where(i(\"keyspace_id\").eq(s(bucket.name()))))\n );\n\n\n List<String> indexesToCreate = new ArrayList<String>();\n indexesToCreate.addAll(Arrays.asList(\n \"def_sourceairport\", \"def_airportname\", \"def_type\", \"def_faa\", \"def_icao\", \"def_city\"\n ));\n\n boolean hasPrimary = false;\n List<String> foundIndexes = new ArrayList<String>();\n for (QueryRow indexRow : indexResult) {\n String name = indexRow.value().getString(\"name\");\n if (name.equals(\"#primary\")) {\n hasPrimary = true;\n } else {\n foundIndexes.add(name);\n }\n }\n indexesToCreate.removeAll(foundIndexes);\n\n if (!hasPrimary) {\n String query = \"CREATE PRIMARY INDEX def_primary ON `\" + bucket.name() + \"` WITH {\\\"defer_build\\\":true}\";\n LOGGER.info(\"Executing index query: {}\", query);\n QueryResult result = bucket.query(Query.simple(query));\n if (result.finalSuccess()) {\n LOGGER.info(\"Successfully created primary index.\");\n } else {\n LOGGER.warn(\"Could not create primary index: {}\", result.errors());\n }\n }\n\n for (String name : indexesToCreate) {\n String query = \"CREATE INDEX \" + name + \" ON `\" + bucket.name() + \"` (\" + name.replace(\"def_\", \"\") + \") \"\n + \"WITH {\\\"defer_build\\\":true}\\\"\";\n LOGGER.info(\"Executing index query: {}\", query);\n QueryResult result = bucket.query(Query.simple(query));\n if (result.finalSuccess()) {\n LOGGER.info(\"Successfully created index with name {}.\", name);\n } else {\n LOGGER.warn(\"Could not create index {}: {}\", name, result.errors());\n }\n }\n\n LOGGER.info(\"Waiting 5 seconds before building the indexes.\");\n\n Thread.sleep(5000);\n\n StringBuilder indexes = new StringBuilder();\n boolean first = true;\n for (String name : indexesToCreate) {\n if (first) {\n first = false;\n } else {\n indexes.append(\",\");\n }\n indexes.append(name);\n }\n\n if (!hasPrimary) {\n indexes.append(\",\").append(\"def_primary\");\n }\n\n String query = \"BUILD INDEX ON `\" + bucket.name() + \"` (\" + indexes.toString() + \")\";\n LOGGER.info(\"Executing index query: {}\", query);\n QueryResult result = bucket.query(Query.simple(query));\n if (result.finalSuccess()) {\n LOGGER.info(\"Successfully executed build index query.\");\n } else {\n LOGGER.warn(\"Could not execute build index query {}.\", result.errors());\n }\n }",
"public void createIndexOnProcessName() throws ServiceFailureException;",
"@Override\r\n protected void openInternal(\r\n final Map<String, CassandraEmbDatabase> theDatabase) {\r\n // empty the table and query complete list of keyspaces from DB.\r\n theDatabase.clear();\r\n final List<KsDef> ksDefs;\r\n try {\r\n ksDefs = server.describe_keyspaces();\r\n for (final KsDef keyspaceDefinition : ksDefs) {\r\n final CassandraEmbDatabase db = new CassandraEmbDatabase(this,\r\n keyspaceDefinition);\r\n theDatabase.put(keyspaceDefinition.getName(), db);\r\n }\r\n } catch (final Exception e) {\r\n throw new DBException(\"Error Opening Database.\", e);\r\n }\r\n }",
"yandex.cloud.api.mdb.mongodb.v1.DatabaseOuterClass.Database getDatabases(int index);",
"public void createIndex(Configuration configuration){\n }",
"private void updateIndex() throws IOException {\n // maintain the document store (corpus) - if there is one\n if (currentMemoryIndex.containsPart(\"corpus\")) {\n // get all corpora + shove into document store\n ArrayList<DocumentReader> readers = new ArrayList<>();\n readers.add((DocumentReader) currentMemoryIndex.getIndexPart(\"corpus\"));\n for (String path : geometricParts.getAllShards().getBinPaths()) {\n String corpus = path + File.separator + \"corpus\";\n readers.add(new CorpusReader(corpus));\n }\n }\n // finally write new checkpointing data (checkpoints the disk indexes)\n Parameters checkpoint = createCheckpoint();\n this.checkpointer.saveCheckpoint(checkpoint);\n }",
"public interface IndexRegistry\n{\n void registerIndex(Index index);\n void unregisterIndex(Index index);\n\n Index getIndex(IndexMetadata indexMetadata);\n Collection<Index> listIndexes();\n}",
"public void testCreIdx(){\r\n\t \r\n\t String dataDir = \"C:\\\\study\\\\Lucene\\\\Data\";\r\n\t String idxDir = \"C:\\\\study\\\\Lucene\\\\Index\";\r\n\t \r\n\t LuceneUtils.delAll(idxDir);\r\n\t \r\n\t CreateIndex ci = new CreateIndex();\r\n\t \r\n\t ci.Indexer(new File(idxDir), new File(dataDir));\r\n\t \r\n\t\t\r\n\t}",
"void initiateIndexing(HarvestResultDTO harvestResult) throws DigitalAssetStoreException;",
"StorableIndexInfo getIndexInfo();",
"@Override\n public void indexPersistable() {\n searchIndexService.indexAllResourcesInCollectionSubTreeAsync(getPersistable());\n }",
"public interface IIndexerDAO {\n\t\n\t/**\n\t * Inizializzazione dell'indicizzatore.\n\t * @param dir La cartella locale contenitore dei dati persistenti.\n\t * @throws ApsSystemException In caso di errori.\n\t */\n\tpublic void init(File dir) throws ApsSystemException;\n\t\n\t/**\n\t * Aggiunge un contenuto nel db del motore di ricerca.\n * @param entity Il contenuto da aggiungere.\n\t * @throws ApsSystemException In caso di errori.\n\t */\n\tpublic void add(IApsEntity entity) throws ApsSystemException;\n\t\n\t/**\n * Cancella un documento indicizzato.\n * @param name Il nome del campo Field da utilizzare per recupero del documento.\n * @param value La chiave mediante il quale è stato indicizzato il documento.\n * @throws ApsSystemException In caso di errori.\n */\n public void delete(String name, String value) throws ApsSystemException;\n \n public void close();\n\t\n\tpublic void setLangManager(ILangManager langManager);\n \n\tpublic static final String FIELD_PREFIX = \"entity:\"; \n public static final String CONTENT_ID_FIELD_NAME = FIELD_PREFIX + \"id\";\n public static final String CONTENT_TYPE_FIELD_NAME = FIELD_PREFIX + \"type\";\n public static final String CONTENT_GROUP_FIELD_NAME = FIELD_PREFIX + \"group\";\n public static final String CONTENT_CATEGORY_FIELD_NAME = FIELD_PREFIX + \"category\";\n\tpublic static final String CONTENT_CATEGORY_SEPARATOR = \"/\";\n\tpublic static final String ATTACHMENT_FIELD_SUFFIX = \"_attachment\";\n\t\n}",
"public void afterIndexCreated(IndexService indexService) {\n\n }",
"private void createIndex(Message<JsonObject> msg, int timeout, JsonObject headers, String dbName) {\n // check required params / attributes\n \n // REQUIRED: The name of the collection for which to create the index\n String collection = helper.getMandatoryString(msg.body(), MSG_PROPERTY_COLLECTION, msg);\n if (collection == null) return;\n\n // REQUIRED: A JSON representation of the index (see ArangoDB docs for details)\n JsonObject document = helper.getMandatoryObject(msg.body(), MSG_PROPERTY_DOCUMENT, msg);\n if (document == null) return;\n\n if (!ensureAttribute(document, DOC_ATTRIBUTE_TYPE, msg)) return;\n if (!document.getString(DOC_ATTRIBUTE_TYPE).equals(TYPE_CAP)) {\n if (!ensureAttribute(document, DOC_ATTRIBUTE_FIELDS, msg)) return;\n }\n\n // prepare PATH\n StringBuilder apiPath = new StringBuilder();\n if (dbName != null) apiPath.append(\"/_db/\").append(dbName);\n apiPath.append(API_PATH);\n apiPath.append(\"/?\").append(MSG_PROPERTY_COLLECTION).append(\"=\").append(collection);\n\n httpPost(persistor, apiPath.toString(), headers, document, timeout, msg);\n }",
"public void createIndex(final DBObject keys, final DBObject options) {\n try {\n executor.execute(createIndexOperation(keys, options), getReadConcern());\n } catch (MongoWriteConcernException e) {\n throw createWriteConcernException(e);\n }\n }",
"public void ensureIndex(Index index) {\n try {\n createIndex(index);\n } catch (HttpConflict ex) {\n // pass\n }\n }",
"@ManagedOperation(description = \"Starts rebuilding the index\", displayName = \"Rebuild index\")\n void start();",
"public void createIndex(final DBObject keys) {\n createIndex(keys, new BasicDBObject());\n }",
"public void addIndex() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"index\",\n null,\n childrenNames());\n }",
"void acquireDatasetCreateIndexLock(LockList locks, DataverseName dataverseName, String datasetName)\n throws AlgebricksException;",
"private void connectDB() throws IOException, HashtableFullException {\n\t\tFile directory = new File(Main.hashDBStore + File.separator);\n\t\tif (!directory.exists())\n\t\t\tdirectory.mkdirs();\n\t\tFile dbf = new File(directory.getPath() + File.separator + \"hashstore-\"\n\t\t\t\t+ this.getName());\n\t\tlong entries = ((Main.chunkStoreAllocationSize / Main.chunkStorePageSize)) + 8000;\n\t\tif (HashFunctionPool.max_hash_cluster > 1)\n\t\t\tentries = (Main.chunkStoreAllocationSize / HashFunctionPool.avg_page_size) + 8000;\n\t\ttry {\n\t\t\tSDFSLogger.getLog().info(\n\t\t\t\t\t\"Loading hashdb class \" + Main.hashesDBClass);\n\t\t\tSDFSLogger.getLog().info(\"Maximum Number of Entries is \" + entries);\n\t\t\tbdb = (AbstractHashesMap) Class.forName(Main.hashesDBClass)\n\t\t\t\t\t.newInstance();\n\t\t\tbdb.init(entries, dbf.getPath());\n\t\t} catch (InstantiationException e) {\n\t\t\tSDFSLogger.getLog().fatal(\"Unable to initiate ChunkStore\", e);\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\t} catch (IllegalAccessException e) {\n\t\t\tSDFSLogger.getLog().fatal(\"Unable to initiate ChunkStore\", e);\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tSDFSLogger.getLog().fatal(\"Unable to initiate ChunkStore\", e);\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\t} catch (IOException e) {\n\t\t\tSDFSLogger.getLog().fatal(\"Unable to initiate ChunkStore\", e);\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\t}\n\n\t}",
"public static void main(String[] args) throws Exception {\n\t\tString aServerUrl = \"http://localhost:5820\";\n\n\t\t// first create a temporary database to use\n\t\tAdminConnection dbms = AdminConnectionConfiguration.toServer(aServerUrl).credentials(\"admin\", \"admin\").connect();\n\n\t\t// check whether there is no such database already, and if there is, drop it\t\t\n\t\tif (dbms.list().contains(\"waldoTest\")) {\n\t\t\tdbms.drop(\"waldoTest\");\n\t\t}\n\n\t\tdbms.memory(\"waldoTest\")\n\t\t .searchable(true)\n\t\t .create();\n\n\t\tdbms.close();\n\n\t\t// obtain a connection to the database\n\t\tConnection aConn = ConnectionConfiguration\n\t\t\t .to(\"waldoTest\")\t\t // the name of the db to connect to\n\t\t\t .server(aServerUrl)\n\t\t\t .credentials(\"admin\", \"admin\") // credentials to use while connecting\n\t\t\t .connect();\t\t\t\t // now open the connection\n\n\t\t// first things first, lets add some data into the index so that it can be queried and searched\n\n\t\taConn.begin();\n\t\taConn\n\t\t\t.add().io()\n\t\t\t.format(RDFFormat.RDFXML)\n\t\t\t.file(new File(\"data/catalog.rdf\"));\n\n\t\taConn.commit();\n\n\t\t// Lets try an example with the basic Waldo API\n\n\t\t// to start, we want to view this connection as a searchable connection, so we request a view of the connection\n\t\t// as a searchable connection\n\t\tSearchConnection aSearchConn = aConn.as(SearchConnection.class);\n\n\t\t// then we'll construct a searcher\n\t\tSearcher aSearch = aSearchConn.search()\n\t\t\t .limit(50) \t\t\t// as before we only want the top fifty results\n\t\t\t .query(\"mac\")\t\t// our search term\n\t\t\t .threshold(0.5);\t\t// Since Waldo is implemented over lucene, we can also specify a min threshold for our results\n\n\t\tSearchResults aSearchResults = aSearch.search();\n\n\t\t// and now we can just iterate over the search results\n\n\t\tIteration<SearchResult, QueryEvaluationException> resultIt = aSearchResults.iteration();\n\n\t\tSystem.out.println(\"\\nAPI results: \");\n\t\twhile (resultIt.hasNext()) {\n\t\t\tSearchResult aHit = resultIt.next();\n\n\t\t\tSystem.out.println(aHit.getHit() + \" with a score of: \" + aHit.getScore());\n\t\t}\n\n\t\t// don't forget to close your iteration!\n\t\tresultIt.close();\n\n\t\t// we can also re-use the searcher if we want to find the next set of results...\n\n\t\taSearch.offset(50); // we already found the first fifty, so lets grab the next set\n\n\t\taSearchResults = aSearch.search();\n\n\t\t// we can now check the next page of search results!\n\n\t\t// SPARQL syntax based on the LARQ syntax in Jena for doing the exact same thing directly in a query.\n\n\t\tString aQuery = \"SELECT DISTINCT ?s ?score WHERE {\\n\" +\n\t\t \"\\t?s ?p ?l.\\n\" +\n\t\t \"\\t( ?l ?score ) <\" + SearchConnection.MATCH_PREDICATE + \"> ( 'mac' 0.5 50 ).\\n\" +\n\t\t \"}\";\n\n\t\tSelectQuery query = aConn.select(aQuery);\n\n\t\tTupleQueryResult aResult = query.execute();\n\n\t\tSystem.out.println(\"Query results: \");\n\t\twhile (aResult.hasNext()) {\n\t\t\tBindingSet result = aResult.next();\n\n\t\t\tSystem.out.println(result.getValue(\"s\") + \" with a score of: \" + ((Literal) result.getValue(\"score\")).doubleValue());\n\t\t}\n\n\t\t// always close your connections when you're done\n\t\taConn.close();\n\t}",
"TableIndexDAO getConnection(String tableId);",
"public String createDSIndex(String dsID, String dschemaID, String attriName);",
"void addIndexForRepository(long repositoryId);",
"public boolean setIndex(String name){\n\n //array to hold all database names from file\n ArrayList<String> dbNames = new ArrayList<String>();\n\n //create index if it doesn't exist\n File file = new File(\"databases/index.txt\");\n Scanner sc;\n FileWriter fw; \n\n try {\n sc = new Scanner(file); \n //read current database names to array\n String currName; \n if (sc.hasNextLine()){\n while(sc.hasNextLine()){\n currName = sc.nextLine();\n dbNames.add(currName);\n } \n }\n sc.close();\n\n //if database name already in index, exit\n if ( dbNames.contains(name) ){return true;}\n\n } catch(FileNotFoundException ex){}\n \n //add new database name to list of dbs\n dbNames.add(name);\n\n //create / overwrite index file\n try {\n fw = new FileWriter(\"databases/index.txt\");\n } catch (IOException ex2){\n System.out.println(\"ERROR: index not found and could not be created\");\n return false;\n }\n\n //write array of database names to file\n for (String dbName : dbNames){\n try {\n fw.write(dbName);\n fw.write(\"\\n\");\n } catch (IOException ex3) {\n System.out.println(\"ERROR: could not write to index\");\n }\n }\n\n try {\n fw.close();\n } catch (IOException ex4){\n System.out.println(\"ERROR: filewriter could not be closed\");\n return false;\n }\n\n return true;\n }",
"void prepare() throws IndexTransactionException;",
"@Test\n public void testIndexMaintenanceOnCacheLoadedData() throws Exception {\n IndexManager.TEST_RANGEINDEX_ONLY = true;\n Cache cache = CacheUtils.getCache();\n qs = cache.getQueryService();\n region = CacheUtils.createRegion(\"portfolio1\", null);\n AttributesMutator am = region.getAttributesMutator();\n am.setCacheLoader(new CacheLoader() {\n\n @Override\n public Object load(LoaderHelper helper) throws CacheLoaderException {\n String key = (String) helper.getKey();\n Portfolio p = new Portfolio(Integer.parseInt(key));\n return p;\n }\n\n @Override\n public void close() {\n // nothing\n }\n });\n\n Index i1 =\n qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID()\", SEPARATOR + \"portfolio1 pf\");\n List keys = new ArrayList();\n keys.add(\"1\");\n keys.add(\"2\");\n keys.add(\"3\");\n keys.add(\"4\");\n\n region.getAll(keys);\n }",
"public void onIndexUpdate();",
"public void openIndex(String indexPath) throws IOException {\n\n }",
"public abstract void updateIndex();",
"public interface ILuceneIndexDAO extends IStatefulIndexerSession {\n // ===================================================================\n // The domain of indexing creates a separation between\n // readers and writers. In lucene, these are searchers\n // and writers. This DAO creates the more familiar DAO-ish interface\n // for developers to use and attempts to hide the details of\n // the searcher and write.\n // Calls are stateless meaning calling a find after a save does\n // not guarantee data will be reflected for the instance of the DAO\n // ===================================================================\n\n /**\n * Updates a document by first deleting the document(s) containing a term and then adding the new document. A Term is created by termFieldName, termFieldValue.\n *\n * @param termFieldName - Field name of the index.\n * @param termFieldValue - Field value of the index.\n * @param document - Lucene document to be updated.\n * @return - True for successful addition.\n */\n boolean saveDocument(String termFieldName, String termFieldValue, Document document);\n\n /**\n * Generates a BooleanQuery from the given fields Map and uses it to delete the documents matching in the IndexWriter.\n *\n * @param fields - A Map data structure containing a field(Key) and text(value) pair.\n * @return - True for successful deletion.\n */\n boolean deleteDocuments(Map<String, String> fields);\n\n /**\n * Find the documents in the IndexSearcher matching the Terms generated from fields.\n *\n * @param fields - A Map data structure contains the field(Key) and text(value).\n * @return - Collection of Documents obtained from the search.\n */\n Set<Document> findDocuments(Map<String, String> fields);\n\n /**\n * Find the documents in the IndexSearcher matching the Terms generated from fields. Offset is the starting position for the search and numberOfResults\n * is the length from offset position.\n *\n * @param fields - A Map data structure containing a field(Key) and text(value) pair.\n * @param offset - Starting position of the search.\n * @param numberOfResults - Number of documents to be searched from an offset position.\n * @return - Collection of Documents obtained from the search.\n */\n Set<Document> findDocuments(Map<String, String> fields, int offset, int numberOfResults);\n\n /**\n * Return the count of the documents present in the IndexSearcher.\n *\n * @return - Integer representing the count of documents.\n */\n int getDocumentCount();\n\n}",
"@Test\n public void indexOrganizedTable() throws FlywayException {\n flyway.setLocations(\"migration/dbsupport/oracle/sql/iot\");\n flyway.migrate();\n flyway.clean();\n flyway.migrate();\n }",
"public IndexDatabase(String index_path, String genomes_path_file, int K_size, SequenceDatabase genomeDb) {\n int cores = Runtime.getRuntime().availableProcessors() / 2 + 1;\n int k;\n long p;\n IndexPointer null_pointer = new IndexPointer();\n try {\n Files.createDirectory(Paths.get(index_path));\n System.out.println(\"Running KMC2... \");\n executeCommand(\"kmc -r -k\" + K_size + \" -t\" + cores + \" -m\" + \n (Runtime.getRuntime().maxMemory() / 1073741824L) + \" -ci1 -fm \" + \n (genomeDb.num_genomes > 1 ? \"@\" + genomes_path_file.trim() : genomeDb.genome_names[1]) + \" \" + index_path + \"/kmers \" + index_path);\n String output = executeCommand(\"kmc_tools sort \" + index_path + \"/kmers \" + index_path + \"/sorted\");\n if (output.startsWith(\"This database contains sorted k-mers already!\")) {\n new File(index_path + \"/kmers.kmc_pre\").renameTo(new File(index_path + \"/sorted.kmc_pre\"));\n new File(index_path + \"/kmers.kmc_suf\").renameTo(new File(index_path + \"/sorted.kmc_suf\"));\n //Files.copy(Paths.get(path+\"/kmers.kmc_pre\"), Paths.get(path+\"/sorted.kmc_pre\"));\n //Files.copy(Paths.get(path+\"/kmers.kmc_suf\"), Paths.get(path+\"/sorted.kmc_suf\"));\n } else {\n new File(index_path + \"/kmers.kmc_pre\").delete();\n new File(index_path + \"/kmers.kmc_suf\").delete();\n }\n pre_file = new RandomAccessFile(index_path + \"/sorted.kmc_pre\", \"r\");\n pre_file.seek(pre_file.length() - 8);\n header_pos = read_int(pre_file);\n pre_file.seek(pre_file.length() - 8 - header_pos);\n // read the index properties \n K = read_int(pre_file);\n mode = read_int(pre_file);\n ctr_size = read_int(pre_file);\n pre_len = read_int(pre_file);\n min_count = read_int(pre_file);\n max_count = read_int(pre_file);\n kmers_num = read_long(pre_file);\n suf_len = K - pre_len;\n key = new kmer(K, pre_len, suf_len);\n System.out.println(\"Indexing \" + kmers_num + \" kmers... \");\n // load the prefix file into the memory \n pre_file.seek(4);\n int q, len = 1 << (2 * pre_len);\n prefix_ptr = new long[len];\n MappedByteBuffer pre_buff;\n for (q = 0, p = 0; p < 8; ++p) {\n pre_buff = pre_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + p * len, len);\n for (k = 0; k < len / 8; ++k, ++q) {\n prefix_ptr[q] = read_long(pre_buff);\n }\n pre_buff = null;\n }\n pre_file.close();\n\n // mapping suffix file into the memory\n suf_rec_size = ctr_size + suf_len / 4;\n MAX_BYTE_COUNT = MAX_BYTE_COUNT / suf_rec_size * suf_rec_size;\n suf_parts_num = (int) ((kmers_num * suf_rec_size) % MAX_BYTE_COUNT == 0 ? (kmers_num * suf_rec_size) / MAX_BYTE_COUNT : (kmers_num * suf_rec_size) / MAX_BYTE_COUNT + 1);\n suf_parts_size = new long[suf_parts_num];\n suf_file = new RandomAccessFile(index_path + \"/sorted.kmc_suf\", \"r\");\n suf_buff = new MappedByteBuffer[suf_parts_num];\n for (k = 0; k < suf_parts_num; ++k) {\n suf_parts_size[k] = (int) (k == suf_parts_num - 1 ? (kmers_num * suf_rec_size) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n suf_buff[k] = suf_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + k * suf_parts_size[0], suf_parts_size[k]);\n }\n // mapping pointers file into the memory\n MAX_BYTE_COUNT = MAX_BYTE_COUNT / POINTER_LENGTH * POINTER_LENGTH;\n ptr_parts_num = (int) ((kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT == 0 ? (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT : (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT + 1);\n ptr_parts_size = new long[ptr_parts_num];\n ptr_file = new RandomAccessFile(index_path + \"/pointers.db\", \"rw\");\n ptr_buff = new MappedByteBuffer[ptr_parts_num];\n for (k = 0; k < ptr_parts_num; ++k) {\n ptr_parts_size[k] = (int) (k == ptr_parts_num - 1 ? (kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n ptr_buff[k] = ptr_file.getChannel().map(FileChannel.MapMode.READ_WRITE, k * ptr_parts_size[0], ptr_parts_size[k]);\n }\n for (p = 0; p < kmers_num; ++p) {\n put_pointer(null_pointer, p);\n }\n } catch (IOException e) {\n System.out.println(e.getMessage());\n System.exit(1);\n }\n }",
"public void createIndex() throws IOException {\n\t\tindexWriter.commit();\n\t\ttaxoWriter.commit();\n\n\t\t// categories\n\t\tfor (Article.Facets f : Article.Facets.values()) {\n\t\t\ttaxoWriter.addCategory(new CategoryPath(f.toString()));\n\t\t}\n\t\ttaxoWriter.commit();\n\n\t\tfinal Iterable<Article> articles = articleRepository.findAll();\n\t\tint c = 0;\n\t\tfor (Article article : articles) {\n\t\t\taddArticle(indexWriter, taxoWriter, article);\n\t\t\tc++;\n\t\t}\n\t\t// commit\n\t\ttaxoWriter.commit();\n\t\tindexWriter.commit();\n\n\t\ttaxoWriter.close();\n\t\tindexWriter.close();\n\n\t\ttaxoDirectory.close();\n\t\tindexDirectory.close();\n\t\tLOGGER.debug(\"{} articles indexed\", c);\n\t}",
"public void mount(String mountKey);",
"private void close() throws CorruptIndexException, IOException {\n\n\t\tidxWriter.forceMerge(1);\n\t\tidxWriter.commit();\n\t\tidxWriter.close();\n\t}",
"public interface IndexBuilder {\n\n /**\n * Rebuilds the index only when the existing index is not populated.\n */\n void rebuildIfNecessary();\n\n}",
"private void createIndex(final String index, int numShards, int numReplicas) throws IOException {\n LOGGER.warn(\"CREATE ES INDEX {} with {} shards and {} replicas\", index, numShards, numReplicas);\n final Settings indexSettings = Settings.builder().put(\"number_of_shards\", numShards)\n .put(\"number_of_replicas\", numReplicas).build();\n CreateIndexRequest indexRequest = new CreateIndexRequest(index, indexSettings);\n getClient().admin().indices().create(indexRequest).actionGet();\n\n final String mapping = IOUtils.toString(\n this.getClass().getResourceAsStream(\"/elasticsearch/mapping/map_person_5x_snake.json\"));\n getClient().admin().indices().preparePutMapping(index)\n .setType(getConfig().getElasticsearchDocType()).setSource(mapping, XContentType.JSON).get();\n }",
"public IndexDatabase(String index_path, String genomes_path_file, SequenceDatabase genomeDb, GraphDatabaseService graphDb, int previous_num_genomes) {\n int cores = Runtime.getRuntime().availableProcessors() / 2 + 1;\n int i, k, p, trsc, seq_nodes;\n long c_index, p_index, l, new_kmers_num;\n IndexPointer null_pointer = new IndexPointer();\n Node node;\n ResourceIterator<Node> nodes;\n Path old_index_folder;\n // move current index files to directory old_index\n try {\n old_index_folder = Files.createDirectory(Paths.get(index_path+\"/old_index\"));\n Files.move(Paths.get(index_path + \"/sorted.kmc_pre\"), Paths.get(index_path + \"/old_index/sorted.kmc_pre\"));\n Files.move(Paths.get(index_path + \"/sorted.kmc_suf\"), Paths.get(index_path + \"/old_index/sorted.kmc_suf\"));\n Files.move(Paths.get(index_path + \"/pointers.db\"), Paths.get(index_path + \"/old_index/pointers.db\"));\n // load old_index\n IndexDatabase old_index = new IndexDatabase(index_path + \"/old_index\");\n K = old_index.K;\n // make new index for new genomes\n System.out.println(\"Running KMC2... \");\n executeCommand(\"kmc -r -k\" + K + \" -t\" + cores + \" -m\" + (Runtime.getRuntime().maxMemory() / 1073741824L) + \n \" -ci1 -fm \" + (genomeDb.num_genomes - previous_num_genomes > 1 ? \"@\" + \n genomes_path_file.trim() : genomeDb.genome_names[previous_num_genomes + 1]) + \n \" \" + index_path + \"/new_kmers \" + index_path);\n // merge two indeces \n executeCommand(\"kmc_tools union \" + index_path + \"/old_index/sorted \" + index_path + \"/new_kmers \" + index_path + \"/sorted\");\n pre_file = new RandomAccessFile(index_path + \"/sorted.kmc_pre\", \"r\");\n pre_file.seek(pre_file.length() - 8);\n header_pos = read_int(pre_file);\n pre_file.seek(pre_file.length() - 8 - header_pos);\n // read the merged index properties \n K = read_int(pre_file);\n mode = read_int(pre_file);\n ctr_size = read_int(pre_file);\n pre_len = read_int(pre_file);\n min_count = read_int(pre_file);\n max_count = read_int(pre_file);\n new_kmers_num = read_long(pre_file);\n kmers_num += new_kmers_num;\n System.out.println(new_kmers_num + \" new kmers generated. \");\n // load the prefix file into the memory \n pre_file.seek(4);\n int q, len = 1 << (2 * pre_len);\n prefix_ptr = new long[len];\n MappedByteBuffer pre_buff;\n for (q = 0, p = 0; p < 8; ++p) {\n pre_buff = pre_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + p * len, len);\n for (k = 0; k < len / 8; ++k, ++q) {\n prefix_ptr[q] = read_long(pre_buff);\n //System.out.println(q+\" \"+prefix_ptr[q]);\n }\n pre_buff = null;\n }\n pre_file.close();\n // mapping suffix file into the memory \n suf_len = K - pre_len;\n suf_rec_size = ctr_size + suf_len / 4;\n MAX_BYTE_COUNT = MAX_BYTE_COUNT / suf_rec_size * suf_rec_size;\n suf_parts_num = (int) ((kmers_num * suf_rec_size) % MAX_BYTE_COUNT == 0 ? (kmers_num * suf_rec_size) / MAX_BYTE_COUNT : (kmers_num * suf_rec_size) / MAX_BYTE_COUNT + 1);\n suf_parts_size = new long[suf_parts_num];\n suf_file = new RandomAccessFile(index_path + \"/sorted.kmc_suf\", \"r\");\n suf_buff = new MappedByteBuffer[suf_parts_num];\n key = new kmer(K, pre_len, suf_len);\n for (k = 0; k < suf_parts_num; ++k) {\n suf_parts_size[k] = (int) (k == suf_parts_num - 1 ? (kmers_num * suf_rec_size) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n suf_buff[k] = suf_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + k * suf_parts_size[0], suf_parts_size[k]);\n }\n // mapping pointers file into the memory \n MAX_BYTE_COUNT = MAX_BYTE_COUNT / POINTER_LENGTH * POINTER_LENGTH;\n ptr_parts_num = (int) ((kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT == 0 ? (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT : (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT + 1);\n ptr_parts_size = new long[ptr_parts_num];\n ptr_file = new RandomAccessFile(index_path + \"/pointers.db\", \"rw\");\n ptr_buff = new MappedByteBuffer[ptr_parts_num];\n for (k = 0; k < ptr_parts_num; ++k) {\n ptr_parts_size[k] = (int) (k == ptr_parts_num - 1 ? (kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n ptr_buff[k] = ptr_file.getChannel().map(FileChannel.MapMode.READ_WRITE, k * ptr_parts_size[0], ptr_parts_size[k]);\n }\n for (p = 0; p < kmers_num; ++p) {\n put_pointer(null_pointer, p);\n }\n // adjusting available pointers\n try (Transaction tx = graphDb.beginTx()) {\n nodes = graphDb.findNodes(DynamicLabel.label(\"node\"));\n seq_nodes = (int) graphDb.findNodes(DynamicLabel.label(\"pangenome\")).next().getProperty(\"num_nodes\");\n tx.success();\n }\n IndexPointer ptr = new IndexPointer();\n System.out.println(\"Updating kmer index... \");\n for (i = 0; nodes.hasNext();) {\n try (Transaction tx = graphDb.beginTx()) {\n for (trsc = 0; trsc < 10000 && nodes.hasNext(); ++trsc, ++i) {\n node = nodes.next();\n l = (long) node.getProperty(\"first_kmer\");\n p_index = find(old_index.get_kmer(l));\n old_index.get_pointer(ptr, l);\n put_pointer(ptr, p_index);\n node.setProperty(\"first_kmer\", p_index);\n for (l = old_index.get_next_index(l); l != -1L; l = old_index.get_next_index(l)) {\n c_index = find(old_index.get_kmer(l));\n old_index.get_pointer(ptr, l);\n put_pointer(ptr, c_index);\n put_next_index(c_index, p_index);\n p_index = c_index;\n }\n put_next_index(-1L, p_index);\n node.setProperty(\"last_kmer\", p_index);\n if (i % (seq_nodes / 100 + 1) == 0) {\n System.out.print((long) i * 100 / seq_nodes + 1 + \"% \\r\");\n }\n }\n tx.success();\n }\n }\n old_index.close();\n Files.delete(Paths.get(index_path + \"/old_index/sorted.kmc_suf\"));\n Files.delete(Paths.get(index_path + \"/new_kmers.kmc_pre\"));\n Files.delete(Paths.get(index_path + \"/new_kmers.kmc_suf\"));\n Files.delete(Paths.get(index_path + \"/old_index/pointers.db\"));\n Files.delete(Paths.get(index_path + \"/old_index/sorted.kmc_pre\"));\n //Files.delete(old_index_folder);\n } catch (IOException e) {\n System.out.println(e.getMessage() + \"\\nFailed to make index!\");\n System.exit(1);\n }\n }",
"private void flushCurrentIndexBlock() throws IOException {\n if (currentMemoryIndex.documentsInIndex() < 1) {\n return;\n }\n\n logger.info(\"Flushing current memory Index. id = \" + indexBlockCount);\n\n final MemoryIndex flushingMemoryIndex = currentMemoryIndex;\n final File shardFolder = getNextIndexShardFolder(1);\n\n try {\n // reset the current index\n // - this makes the flush operation thread safe while continuing to add new documents.\n resetCurrentMemoryIndex();\n } catch (Exception ex) {\n throw new IOException(ex);\n }\n\n try {\n // first flush the index to disk\n FlushToDisk.flushMemoryIndex(flushingMemoryIndex, shardFolder.getAbsolutePath(), false);\n\n // indicate that the flushing part of this thread is done\n synchronized (geometricParts) {\n // add flushed index to the set of bins -- needs to be a synconeous action\n geometricParts.add(0, shardFolder.getAbsolutePath());\n updateIndex();\n flushingMemoryIndex.close();\n }\n\n } catch (IOException e) {\n logger.severe(e.toString());\n }\n }",
"public void createIndex(Index index) {\n Span span = this.tracer.buildSpan(\"Client.CreateIndex\").start();\n try {\n String path = String.format(\"/index/%s\", index.getName());\n String body = index.getOptions().toString();\n ByteArrayEntity data = new ByteArrayEntity(body.getBytes(StandardCharsets.UTF_8));\n clientExecute(\"POST\", path, data, null, \"Error while creating index\");\n } finally {\n span.finish();\n }\n }",
"@Ignore \n @Test\n public void testPutMappingToIndex() {\n System.out.println(\"putMappingToIndex\");\n \n Util.commonServiceIPs=\"127.0.0.1\";\n \n EntityManager em=Util.getEntityManagerFactory(100).createEntityManager();\n EntityManager platformEm = Util.getPlatformEntityManagerFactory().createEntityManager();\n \n Client client = ESUtil.getClient(em,platformEm,1,false);\n \n String indexName = \"datastore_100_1_data_event_yearmonth_000000_1\";\n String indexType = \"AAA666_type\";\n \n try\n { \n ESUtil.createIndexWithoutType(client, indexName);\n \n DataobjectType dataobjectType = Util.getDataobjectTypeByIndexTypeName(platformEm, indexType);\n\n XContentBuilder typeMapping = ESUtil.createTypeMapping(platformEm, dataobjectType, true);\n \n ESUtil.putMappingToIndex(client, indexName, indexType, typeMapping);\n }\n catch(Exception e)\n {\n System.out.print(\" failed! e=\"+e);\n }\n }",
"@java.lang.Override\n public yandex.cloud.api.mdb.mongodb.v1.DatabaseOuterClass.Database getDatabases(int index) {\n return databases_.get(index);\n }",
"public void createIndex(final String name) {\n createIndex(new BasicDBObject(name, 1));\n }",
"public void afterIndexShardCreated(IndexShard indexShard) {\n\n }",
"IndexNameReference createIndexNameReference();",
"public static void main(String[] args) throws CorruptIndexException, LockObtainFailedException, IOException, ParseException{\n\t\tboolean lucene_im_mem = false;\n\t\t//1. Build the Index with varying \"database size\"\n\t\tString dirName =\"/data/home/duy113/SupSearchExp/AIDSNew/\";\n//\t\tString dirName = \"/Users/dayuyuan/Documents/workspace/Experiment/\";\n\t\tString dbFileName = dirName + \"DBFile\";\n\t\tString trainQueryName= dirName + \"TrainQuery\";\n//\t\tString testQuery15 = dirName + \"TestQuery15\";\n\t\tString testQuery25 = dirName + \"TestQuery25\";\n//\t\tString testQuery35 = dirName + \"TestQuery35\";\n\t\tGraphDatabase query = new GraphDatabase_OnDisk(testQuery25, MyFactory.getSmilesParser());\n\t\tdouble[] minSupts = new double[4];\n\t\tminSupts[0] = 0.05; minSupts[1] = 0.03; minSupts[2] =0.02; minSupts[3] = 0.01;\n \t\tint lwIndexCount[] = new int[1];\n\t\tlwIndexCount[0] = 479;\t\n//\t\tSystem.out.println(\"Build CIndexFlat Left-over: \");\n//\t\tfor(int j = 3; j< 4; j++){\n//\t\t\tdouble minSupt = minSupts[j];\n//\t\t\tfor(int i = 4; i<=10; i = i+2){\n//\t\t\t\tString baseName = dirName + \"G_\" + i + \"MinSup_\" + minSupt + \"/\";\n//\t\t\t\tGraphDatabase trainingDB = new GraphDatabase_OnDisk(dbFileName + i, MyFactory.getDFSCoder());\n//\t\t\t\tGraphDatabase trainQuery = new GraphDatabase_OnDisk(trainQueryName, MyFactory.getSmilesParser());\t\t\n//\t\t\t\tif(i == 2){\n//\t\t\t\t\tSystem.out.println(baseName + \"CIndexFlat\");\n//\t\t\t\t\tCIndexExp.buildIndex(trainingDB, trainQuery, trainingDB, baseName, minSupt, lwIndexCount[0]);\n//\t\t\t\t}\n//\t\t\t\telse{\n//\t\t\t\t\tString featureBaseName = dirName + \"G_2\" + \"MinSup_\" + minSupt + \"/\";\n//\t\t\t\t\tSystem.out.println(baseName + \"CIndexFlat with Features \" + featureBaseName);\n//\t\t\t\t\tCIndexExp.buildIndex(featureBaseName, trainingDB, baseName, minSupt);\n//\t\t\t\t}\n//\t\t\t\tSystem.gc();\n//\t\t\t}\n//\t\t}\n\t\tSystem.out.println(\"Run Query Processing: \");\n\t\tfor(int j = 0; j< 4; j++){\n\t\t\tdouble minSupt = minSupts[j];\n\t\t\tfor(int i = 2; i<=10; i = i+2){\n\t\t\t\tString baseName = dirName + \"G_\" + i + \"MinSup_\" + minSupt + \"/\";\n\t\t\t\tGraphDatabase trainingDB = new GraphDatabase_OnDisk(dbFileName + i, MyFactory.getDFSCoder());\n\t\t\t\tGraphDatabase trainQuery = new GraphDatabase_OnDisk(trainQueryName, MyFactory.getSmilesParser());\t\t\n\t\t\t\tif(j!=0 || i!=2){\n\t\t\t\t\tSystem.out.println(baseName + \"LWindex\");\n\t\t\t\t\t//LWIndexExp.buildIndex(trainingDB, trainQuery, trainingDB, trainQuery.getParser(),baseName, minSupt, lwIndexCount);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tLWIndexExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tLWIndexExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\t\t\n\t\t\t\t\tSystem.out.println(baseName + \"PrefixIndex\");\n\t\t\t\t\t//PrefixIndexExp.buildIndex(trainingDB, trainingDB, baseName, minSupt);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tPrefixIndexExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tPrefixIndexExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\t\t\n\t\t\t\t\tSystem.out.println(baseName + \"PrefixIndexHi\");\n\t\t\t\t\t//PrefixIndexExp.buildHiIndex(trainingDB, trainingDB, 2, baseName, minSupt);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tPrefixIndexExp.runHiIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tPrefixIndexExp.runHiIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\n\t\t\t\t\tSystem.out.println(baseName + \"GPTree\");\n\t\t\t\t\t//GPTreeExp.buildIndex(trainingDB, trainingDB, baseName, minSupt);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tGPTreeExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tGPTreeExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\n\t\t\t\t\tSystem.out.println(baseName + \"CIndexFlat\");\n\t\t\t\t\t//CIndexExp.buildIndex(trainingDB, trainQuery, trainingDB, baseName, minSupt, lwIndexCount[0]);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tCIndexExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tCIndexExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\n\t\t\t\t}\n\t\t\t\tif(j==0&&i==2){\n\t\t\t\t\tSystem.out.println(baseName + \"CIndexTopDown: \" + lwIndexCount[0]);\n\t\t\t\t\tCIndexExp.buildIndexTopDown(trainingDB, trainQuery, trainingDB,MyFactory.getUnCanDFS(), baseName, minSupt, 2*trainQuery.getTotalNum()/lwIndexCount[0] ); // 8000 test queries\n\t\t\t\t\t//System.gc();\n\t\t\t\t}\n\t\t\t\tSystem.out.println(baseName + \"CIndexTopDown: \" + lwIndexCount[0]);\n\t\t\t\tCIndexExp.runIndexTopDown(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\tCIndexExp.runIndexTopDown(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\tSystem.gc();\n\t\t\t}\n\t\t}\n\t\tAIDSLargeExp.main(args);\n\t}",
"private IndexHandler (boolean test) throws IOException {\n analyzer = new StandardAnalyzer();\n indexDir = test ? new RAMDirectory() : new DistributedDirectory(new MongoDirectory(mongoClient, \"search-engine\", \"index\"));\n //storePath = storedPath;\n config = new IndexWriterConfig(analyzer);\n\n // write separate IndexWriter to RAM for each IndexHandler\n // writer will have to be manually closed with each instance call\n // see IndexWriter documentation for .close()\n // explaining continuous closing of IndexWriter is an expensive operation\n try {\n writer = new IndexWriter(indexDir, config);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"private void init(int bytesPerId, int bytesPerType, int bytesPerPath) throws IOException {\n this.indexVersion = INDEX_VERSION;\n this.bytesPerId = bytesPerId;\n this.bytesPerType = bytesPerType;\n this.bytesPerPath = bytesPerPath;\n this.bytesPerSlot = bytesPerId + bytesPerType + bytesPerPath;\n this.entries = 0;\n \n logger.info(\"Creating uri index with {} bytes per entry\", bytesPerSlot);\n \n // Write header\n idx.seek(IDX_START_OF_HEADER);\n idx.writeInt(indexVersion);\n idx.writeInt(bytesPerId);\n idx.writeInt(bytesPerType);\n idx.writeInt(bytesPerPath);\n idx.writeLong(slots);\n idx.writeLong(entries);\n \n // If this file used to contain entries, we just null out the rest\n try {\n byte[] bytes = new byte[bytesPerSlot - 2];\n while (idx.getFilePointer() < idx.length()) {\n idx.writeChar('\\n');\n idx.write(bytes);\n }\n } catch (EOFException e) {\n // That's ok, we wanted to write until the very end\n }\n \n logger.debug(\"Uri index created\");\n }",
"private Document createMapping() {\n return getIndexOperations().createMapping();\n }",
"public void tIndex(IndexShort < O > index) throws Exception {\n File query = new File(testProperties.getProperty(\"test.query.input\"));\n File dbFolder = new File(testProperties.getProperty(\"test.db.path\"));\n\n int cx = 0;\n\n initIndex(index);\n //search(index, (short) 3, (byte) 3);\n //search(index, (short) 7, (byte) 1);\n //search(index, (short) 12, (byte) 3);\n \n search(index, (short) 1000, (byte) 1);\n\n search(index, (short) 1000, (byte) 3);\n\n search(index, (short) 1000, (byte) 10);\n \n search(index, (short) 1000, (byte) 50);\n \n long i = 0;\n // int realIndex = 0;\n // test special methods that only apply to\n // SynchronizableIndex\n \n\n // now we delete elements from the DB\n logger.info(\"Testing deletes\");\n i = 0;\n long max = index.databaseSize();\n while (i < max) {\n O x = index.getObject(i);\n OperationStatus ex = index.exists(x);\n assertTrue(ex.getStatus() == Status.EXISTS);\n assertTrue(ex.getId() == i);\n ex = index.delete(x);\n assertTrue(\"Status is: \" + ex.getStatus() + \" i: \" + i , ex.getStatus() == Status.OK);\n assertEquals(i, ex.getId());\n ex = index.exists(x); \n assertTrue( \"Exists after delete\" + ex.getStatus() + \" i \" + i, ex.getStatus() == Status.NOT_EXISTS);\n i++;\n }\n index.close();\n Directory.deleteDirectory(dbFolder);\n }",
"public void beforeIndexCreated(Index index) {\n\n }",
"public Object migrateWords2index(String wordhash) throws IOException {\n File db = plasmaWordIndexFile.wordHash2path(oldDatabaseRoot, wordhash);\r\n if (!(db.exists())) return \"not available\";\r\n plasmaWordIndexFile entity = null;\r\n try {\r\n entity = new plasmaWordIndexFile(oldDatabaseRoot, wordhash, true);\r\n int size = entity.size();\r\n indexContainer container = new indexContainer(wordhash, payloadrow(), useCollectionIndex);\r\n \r\n try {\r\n Iterator entries = entity.elements(true);\r\n indexRWIEntry entry;\r\n while (entries.hasNext()) {\r\n entry = (indexRWIEntry) entries.next();\r\n // System.out.println(\"ENTRY = \" + entry.getUrlHash());\r\n container.add(new indexRWIEntry[] { entry }, System.currentTimeMillis());\r\n }\r\n // we have read all elements, now delete the entity\r\n entity.deleteComplete();\r\n entity.close();\r\n entity = null;\r\n \r\n indexContainer feedback = collections.addEntries(container, container.updated(), false);\r\n if (feedback != null) return feedback;\r\n return new Integer(size);\r\n } catch (kelondroException e) {\r\n // database corrupted, we simply give up the database and delete it\r\n try { entity.close(); } catch (Exception ee) { }\r\n entity = null;\r\n try { db.delete(); } catch (Exception ee) { }\r\n return \"database corrupted; deleted\";\r\n }\r\n } finally {\r\n if (entity != null) try {entity.close();}catch(Exception e){}\r\n }\r\n }",
"public synchronized void createIndexIfNeeded(final String index) throws NeutronCheckedException {\n try {\n if (!doesIndexExist(index)) {\n LOGGER.warn(\"ES INDEX {} DOES NOT EXIST!!\", index);\n createIndex(index, NUMBER_OF_SHARDS, NUMBER_OF_REPLICAS);\n\n // Give Elasticsearch a moment to catch its breath.\n Thread.sleep(2000); // NOSONAR\n }\n } catch (InterruptedException | IOException e) {\n throw JobLogs.checked(LOGGER, e, \"CREATE INDEX FAILED! {}\", e.getMessage());\n }\n }",
"public abstract ODatabaseInternal<?> openDatabase();",
"public void addIndex(String collectionName, DBObject index){\n DBCollection collection =this.getDBCollection(collectionName);\n collection.createIndex(index);\n }",
"public void forceUpdateSearchIndexes() throws InterruptedException {\n\t getFullTextEntityManager().createIndexer().startAndWait();\n\t}",
"@Override\n\tpublic void build(Index index) {\n\t\tthis.indexdir = index.getPath();\n\t\tLuceneIndex luceneIndex = (LuceneIndex) index;\n\t\tthis.indexSearcher = new IndexSearcher(luceneIndex.getReader());\n\n\t}",
"SqlElasticPoolOperations.DefinitionStages.WithCreate withExistingDatabase(SqlDatabase database);",
"indexSet createindexSet();",
"public BlackLabIndex open(File indexDir) throws ErrorOpeningIndex {\n IndexType indexType = determineIndexType(indexDir, false, null);\n return indexType == IndexType.INTEGRATED ?\n new BlackLabIndexIntegrated(indexDir.getName(), this, null, indexDir, false, false, null):\n new BlackLabIndexExternal(this, indexDir, false, false, (File) null);\n }",
"public void createIndex() {\n String indexName = INDEX_BASE + \"-\" +\n LocalDateTime.now().format(DateTimeFormatter.ofPattern(\"yyyyMMddHHmmss\"));\n\n Settings settings = Settings.builder()\n .put(\"number_of_shards\", 1)\n .put(\"number_of_replicas\", 0)\n .build();\n CreateIndexRequest request = new CreateIndexRequest(indexName, settings);\n\n String mapping = \"{\\n\" +\n \" \\\"article\\\": {\\n\" +\n \" \\\"properties\\\": {\\n\" +\n \" \\\"title\\\": {\\n\" +\n \" \\\"type\\\": \\\"text\\\"\\n\" +\n \" },\\n\" +\n \" \\\"author\\\": {\\n\" +\n \" \\\"type\\\": \\\"keyword\\\"\\n\" +\n \" },\\n\" +\n \" \\\"issue\\\": {\\n\" +\n \" \\\"type\\\": \\\"keyword\\\"\\n\" +\n \" },\\n\" +\n \" \\\"link\\\": {\\n\" +\n \" \\\"type\\\": \\\"keyword\\\"\\n\" +\n \" },\\n\" +\n \" \\\"description\\\": {\\n\" +\n \" \\\"type\\\": \\\"text\\\"\\n\" +\n \" },\\n\" +\n \" \\\"postDate\\\": {\\n\" +\n \" \\\"type\\\": \\\"date\\\",\\n\" +\n \" \\\"format\\\": \\\"yyyy-MM-dd\\\"\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \" }\";\n\n request.mapping(\"article\", mapping, XContentType.JSON);\n request.alias(new Alias(INDEX_BASE));\n\n try {\n CreateIndexResponse createIndexResponse = this.client.admin().indices().create(request).get();\n if (!createIndexResponse.isAcknowledged()) {\n throw new ElasticExecutionException(\"Create java_magazine index was not acknowledged\");\n }\n } catch (InterruptedException | ExecutionException e) {\n logger.error(\"Error while creating an index\", e);\n throw new ElasticExecutionException(\"Error when trying to create an index\");\n }\n }",
"protected abstract ODatabaseInternal<?> newDatabase();",
"private Database openTestDb(ReplicatedEnvironment master)\n throws DatabaseException {\n\n Environment env = master;\n DatabaseConfig config = new DatabaseConfig();\n config.setAllowCreate(true);\n config.setTransactional(true);\n config.setSortedDuplicates(true);\n Database testDb = env.openDatabase(null, TEST_DB, config);\n return testDb;\n }",
"public interface IDbLuceneMappingService {\n\n void save(DbLuceneMapping dbLuceneMapping);\n\n DbLuceneMapping read(ObjectId id);\n\n DbLuceneMapping update(ObjectId id, DbLuceneMapping dbLuceneMapping);\n\n void delete(ObjectId id);\n\n List<DbLuceneMapping> readAll();\n\n List<DbLuceneMapping> getDatabase(String luceneName);\n\n List<DbLuceneMapping> getLuceneName(String databaseName);\n\n}",
"private DBMaster() {\r\n\t\t//The current address is localhost - needs to be changed at a later date\r\n\t\t_db = new GraphDatabaseFactory().newEmbeddedDatabase(\"\\\\etc\\\\neo4j\\\\default.graphdb\");\r\n\t\tregisterShutdownHook();\r\n\t}",
"void commit() throws IndexTransactionException;",
"@Override\n public void close()\n {\n notifyLegacyIndexOperationQueue();\n\n }",
"public yandex.cloud.api.mdb.mongodb.v1.DatabaseOuterClass.Database.Builder addDatabasesBuilder(\n int index) {\n return getDatabasesFieldBuilder().addBuilder(\n index, yandex.cloud.api.mdb.mongodb.v1.DatabaseOuterClass.Database.getDefaultInstance());\n }",
"SqlElasticPoolOperations.DefinitionStages.WithCreate withExistingDatabase(String databaseName);",
"public InfinispanDirectory(Cache<?, ?> metadataCache, Cache<?, ?> chunksCache, Cache<?, ?> distLocksCache, String indexName, int chunkSize) {\n this(metadataCache, chunksCache, indexName, makeDefaultLockFactory(distLocksCache, indexName),\n chunkSize, makeDefaultSegmentReadLocker(metadataCache, chunksCache, distLocksCache, indexName));\n }",
"@Test\n public void testIndexMaintenanceOnPutAll() throws Exception {\n IndexManager.TEST_RANGEINDEX_ONLY = true;\n Cache cache = CacheUtils.getCache();\n qs = cache.getQueryService();\n region = CacheUtils.createRegion(\"portfolio1\", null);\n region.put(\"1\", new Portfolio(1));\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"posvals.secId\",\n SEPARATOR + \"portfolio1 pf, pf.positions.values posvals \");\n Map data = new HashMap();\n for (int i = 1; i < 11; ++i) {\n data.put(\"\" + i, new Portfolio(i + 2));\n }\n\n region.putAll(data);\n }",
"public interface IndexCreator {\n\n /**\n * Creates indexes for specified persistent entity\n *\n * @param type persistent entity class, e.g. class annotated {@link org.springframework.data.mongodb.core.mapping.Document}\n * @return empty {@link Mono}\n */\n Mono<Void> createIndexes(Class<?> type);\n\n /**\n * Creates indexes for all persistent entities presented in {@link org.springframework.data.mongodb.core.mapping.MongoMappingContext}\n *\n * @return empty {@link Mono}\n */\n Mono<Void> createIndexes();\n}",
"@Override\n @Nullable\n public IndexService indexService(Index index) {\n return indices.get(index.getUUID());\n }",
"public void start() throws Exception {\n if (!getClient().admin().indices().exists(Requests.indicesExistsRequest(INDEX_NAME)).actionGet().isExists()) {\n getClient().admin().indices().prepareCreate(INDEX_NAME).execute().actionGet().isAcknowledged();\n }\n\n //Create mapping for the key. Leave it not_analyzed so it doesn't tokenize the \"-\" delimiters\n PutMappingResponse response = getClient().admin().indices()\n .preparePutMapping(INDEX_NAME)\n .setType(TYPE_NAME)\n .setSource(buildMapping())\n .execute().actionGet();\n if (!response.isAcknowledged()) {\n throw new Exception(\"Could not define mapping.\");\n }\n }",
"public void setSyncIndex(int index) {\n }",
"@Test\n @Ignore\n public void testDelete_Index() throws Exception {\n System.out.println(\"delete\");\n Index entity = TestUtils.getTestIndex();\n Identifier identifier = entity.getId();\n instance.create(entity);\n assertTrue(instance.exists(identifier));\n instance.delete(entity);\n assertFalse(instance.exists(identifier));\n }",
"@Test\n public void testCreate() throws Exception {\n System.out.println(\"create\");\n Index entity = TestUtils.getTestIndex();\n IndexResponse result = instance.create(entity);\n assertNotNull(result);\n assertEquals(entity.getDatabaseName(), result.getIndex().getDatabaseName());\n assertEquals(entity.getName(), result.getIndex().getName());\n assertEquals(entity.getTableName(), result.getIndex().getTableName());\n assertEquals(entity.getFields(), result.getIndex().getFields());\n }",
"@Test\n public void testCreateIdxOnClient() {\n getDefaultCacheOnClient().query(new SqlFieldsQuery(((\"CREATE INDEX IDX_11 ON \" + (GridCacheDynamicLoadOnClientTest.FULL_TABLE_NAME)) + \" (name asc)\"))).getAll();\n }",
"public void createIndex() throws IOException {\n\t\tLOGGER.info(\"creating photo index...\");\n\t\tCreateIndexRequest request = new CreateIndexRequest(\"files\");\n\t\tInputStream in = getClass().getClassLoader().getResourceAsStream(\"photo.json\");\n\t\tString mapping = new String(in.readAllBytes());\n\t\tin.close();\n\t\trequest.mapping(\"photo\", mapping, XContentType.JSON);\n\t\tCreateIndexResponse response = client.indices().create(request);\n\t\tLOGGER.info(\"photo index created: \" + response.toString());\n\t}",
"public int mountVolume(String mountPoint) throws RemoteException;",
"public IndexWriter getIndexWriter(String indexDir) throws IOException {\n //Directory indexDir = new RAMDirectory(); //use to put directory in RAM\n Directory dir = FSDirectory.open(new File(indexDir).toPath());\n IndexWriterConfig luceneConfig = new IndexWriterConfig(new StandardAnalyzer());\n\n return(new IndexWriter(dir, luceneConfig));\n }",
"public void enableIndexAutoCreation() {\n client.setIndexAutoCreationEnabled(true);\n }",
"public void testAddingNewIndex() throws Exception\n {\n PSJdbcDataTypeMap dataTypeMap = new PSJdbcDataTypeMap(\"MYSQL\", \"mysql\", null);\n ArrayList<PSJdbcColumnDef> coldefs = createColumnDef(dataTypeMap);\n coldefs.add(new PSJdbcColumnDef(dataTypeMap, \"col3\", PSJdbcTableComponent.ACTION_DELETE, Types.INTEGER, null,\n true, null));\n PSJdbcTableSchema tableSchema1 = createTableSchema(coldefs);\n setPrimaryKey(tableSchema1);\n PSJdbcForeignKey fk = createForeignKey(tableSchema1);\n\n List<String> indexCols = new ArrayList<String>();\n indexCols.add(\"col3\");\n PSJdbcIndex index1 = new PSJdbcIndex(\"IX_col1\", indexCols.iterator(), PSJdbcTableComponent.ACTION_CREATE);\n tableSchema1.setIndex(index1);\n\n Document doc = PSXmlDocumentBuilder.createXmlDocument();\n Element el = tableSchema1.toXml(doc);\n PSJdbcTableSchema tableSchema2 = new PSJdbcTableSchema(el, dataTypeMap);\n PSJdbcIndex newIndex = (PSJdbcIndex) tableSchema2.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE).next();\n\n // Makes sure if the table schema has changed\n assertFalse((tableSchema1.equals(tableSchema2)));\n\n // Makes sure if a new index definition of non unique have been added to\n // table schema.\n assertFalse((tableSchema1.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE)).hasNext());\n assertTrue((tableSchema2.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE)).hasNext());\n\n // Makes sure if the number of foreign key columns and eqal to that of\n // index columns.\n assertTrue(fk.getForeignKeyColumnNames().size() == newIndex.getIndexColumnNames().size());\n\n // Makes sure if the new index that got created has the same set of\n // columns as foreign key.\n assertTrue(fk.getForeignKeyColumnNames().containsAll(newIndex.getIndexColumnNames()));\n\n // Makes sure if the index name of newly created index has a unique name.\n assertTrue(tableSchema1.doesIndexNameExists(newIndex.getName()));\n\n }",
"private synchronized void criarIndice() throws Exception {\r\n\t\tIndexWriter indexWriter = getWriterPadrao(true);\r\n\t\ttry {\r\n\t\t\tindexWriter.getAnalyzer().close();\r\n\t\t\tindexWriter.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"private static RDFIndex createDefaultIndex() {\n defaultIndex = new RDFIndex(com.hp.hpl.jena.graph.Factory.createGraphMem());\n try {\n File indexFile = new File(INDEX_FILE);\n if(indexFile.exists()) {\n defaultIndex.read(new FileReader(indexFile),Constants.RESOURCE_URL);\n }\n } catch(Throwable t) {\n t.printStackTrace();\n }\n return defaultIndex;\n }",
"boolean createIndex(String indexName);",
"@Override\n public Collection<? extends DBSTableIndex> getIndexes(DBRProgressMonitor monitor) throws DBException {\n return Collections.emptyList();\n }",
"@Test\n public void testIndexRebuildCountPartitionsLeftInCluster() throws Exception {\n pds = true;\n\n Ignite ignite = startGrid(0);\n\n startGrid(1);\n\n ignite.cluster().state(ClusterState.ACTIVE);\n\n IgniteCache<Object, Object> cache1 = ignite.cache(CACHE_NAME);\n\n for (int i = 0; i < 100_000; i++) {\n Long id = (long)i;\n\n BinaryObjectBuilder o = ignite.binary().builder(OBJECT_NAME)\n .setField(KEY_NAME, id)\n .setField(COLUMN1_NAME, i / 2)\n .setField(COLUMN2_NAME, \"str\" + Integer.toHexString(i));\n\n cache1.put(id, o.build());\n }\n\n String consistentId = ignite.cluster().localNode().consistentId().toString();\n\n stopGrid(0);\n\n File dir = U.resolveWorkDirectory(U.defaultWorkDirectory(), DFLT_STORE_DIR, false);\n\n IOFileFilter filter = FileFilterUtils.nameFileFilter(\"index.bin\");\n\n Collection<File> idxBinFiles = FileUtils.listFiles(dir, filter, TrueFileFilter.TRUE);\n\n for (File indexBin : idxBinFiles)\n if (indexBin.getAbsolutePath().contains(consistentId))\n U.delete(indexBin);\n\n startGrid(0);\n\n MetricRegistry metrics = cacheGroupMetrics(0, GROUP_NAME);\n\n LongMetric idxBuildCntPartitionsLeft = metrics.findMetric(\"IndexBuildCountPartitionsLeft\");\n\n assertTrue(\"Timeout wait start rebuild index\",\n waitForCondition(() -> idxBuildCntPartitionsLeft.value() > 0, 30_000));\n\n assertTrue(\"Timeout wait finished rebuild index\",\n GridTestUtils.waitForCondition(() -> idxBuildCntPartitionsLeft.value() == 0, 30_000));\n }"
] | [
"0.5826022",
"0.5690613",
"0.55568016",
"0.553782",
"0.5397263",
"0.5369729",
"0.5343294",
"0.5239177",
"0.52003235",
"0.5175853",
"0.5152517",
"0.5150967",
"0.51505864",
"0.51420325",
"0.5103149",
"0.5080614",
"0.5071591",
"0.5071525",
"0.5062425",
"0.50573957",
"0.5037102",
"0.5001828",
"0.49950764",
"0.4984031",
"0.4982885",
"0.4968535",
"0.49530485",
"0.4939901",
"0.49237734",
"0.4919552",
"0.49018365",
"0.4886236",
"0.4883985",
"0.48756897",
"0.4858075",
"0.4856334",
"0.48546195",
"0.48453042",
"0.48187825",
"0.4812044",
"0.48119327",
"0.4807095",
"0.48064587",
"0.4797167",
"0.4795545",
"0.47817475",
"0.47800598",
"0.47786054",
"0.47722283",
"0.47702008",
"0.47647884",
"0.47639892",
"0.4757645",
"0.47527188",
"0.47420046",
"0.4736994",
"0.4727801",
"0.47202736",
"0.47178546",
"0.470703",
"0.46945596",
"0.4694297",
"0.46928173",
"0.46840814",
"0.4683764",
"0.46759218",
"0.4672188",
"0.46683452",
"0.46579427",
"0.46488222",
"0.46455914",
"0.46013048",
"0.45797604",
"0.4578243",
"0.45773795",
"0.45652574",
"0.4560726",
"0.45583984",
"0.45538557",
"0.45527306",
"0.45449293",
"0.45435855",
"0.45277423",
"0.45248905",
"0.45207474",
"0.4518714",
"0.45175347",
"0.4497334",
"0.44955954",
"0.44946867",
"0.44895077",
"0.44843918",
"0.44736263",
"0.44674367",
"0.44635504",
"0.44574818",
"0.44537565",
"0.4450466",
"0.4445552",
"0.44436774"
] | 0.5259567 | 7 |
Creates a new index database | public IndexDatabase(String index_path, String genomes_path_file, int K_size, SequenceDatabase genomeDb) {
int cores = Runtime.getRuntime().availableProcessors() / 2 + 1;
int k;
long p;
IndexPointer null_pointer = new IndexPointer();
try {
Files.createDirectory(Paths.get(index_path));
System.out.println("Running KMC2... ");
executeCommand("kmc -r -k" + K_size + " -t" + cores + " -m" +
(Runtime.getRuntime().maxMemory() / 1073741824L) + " -ci1 -fm " +
(genomeDb.num_genomes > 1 ? "@" + genomes_path_file.trim() : genomeDb.genome_names[1]) + " " + index_path + "/kmers " + index_path);
String output = executeCommand("kmc_tools sort " + index_path + "/kmers " + index_path + "/sorted");
if (output.startsWith("This database contains sorted k-mers already!")) {
new File(index_path + "/kmers.kmc_pre").renameTo(new File(index_path + "/sorted.kmc_pre"));
new File(index_path + "/kmers.kmc_suf").renameTo(new File(index_path + "/sorted.kmc_suf"));
//Files.copy(Paths.get(path+"/kmers.kmc_pre"), Paths.get(path+"/sorted.kmc_pre"));
//Files.copy(Paths.get(path+"/kmers.kmc_suf"), Paths.get(path+"/sorted.kmc_suf"));
} else {
new File(index_path + "/kmers.kmc_pre").delete();
new File(index_path + "/kmers.kmc_suf").delete();
}
pre_file = new RandomAccessFile(index_path + "/sorted.kmc_pre", "r");
pre_file.seek(pre_file.length() - 8);
header_pos = read_int(pre_file);
pre_file.seek(pre_file.length() - 8 - header_pos);
// read the index properties
K = read_int(pre_file);
mode = read_int(pre_file);
ctr_size = read_int(pre_file);
pre_len = read_int(pre_file);
min_count = read_int(pre_file);
max_count = read_int(pre_file);
kmers_num = read_long(pre_file);
suf_len = K - pre_len;
key = new kmer(K, pre_len, suf_len);
System.out.println("Indexing " + kmers_num + " kmers... ");
// load the prefix file into the memory
pre_file.seek(4);
int q, len = 1 << (2 * pre_len);
prefix_ptr = new long[len];
MappedByteBuffer pre_buff;
for (q = 0, p = 0; p < 8; ++p) {
pre_buff = pre_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + p * len, len);
for (k = 0; k < len / 8; ++k, ++q) {
prefix_ptr[q] = read_long(pre_buff);
}
pre_buff = null;
}
pre_file.close();
// mapping suffix file into the memory
suf_rec_size = ctr_size + suf_len / 4;
MAX_BYTE_COUNT = MAX_BYTE_COUNT / suf_rec_size * suf_rec_size;
suf_parts_num = (int) ((kmers_num * suf_rec_size) % MAX_BYTE_COUNT == 0 ? (kmers_num * suf_rec_size) / MAX_BYTE_COUNT : (kmers_num * suf_rec_size) / MAX_BYTE_COUNT + 1);
suf_parts_size = new long[suf_parts_num];
suf_file = new RandomAccessFile(index_path + "/sorted.kmc_suf", "r");
suf_buff = new MappedByteBuffer[suf_parts_num];
for (k = 0; k < suf_parts_num; ++k) {
suf_parts_size[k] = (int) (k == suf_parts_num - 1 ? (kmers_num * suf_rec_size) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);
suf_buff[k] = suf_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + k * suf_parts_size[0], suf_parts_size[k]);
}
// mapping pointers file into the memory
MAX_BYTE_COUNT = MAX_BYTE_COUNT / POINTER_LENGTH * POINTER_LENGTH;
ptr_parts_num = (int) ((kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT == 0 ? (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT : (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT + 1);
ptr_parts_size = new long[ptr_parts_num];
ptr_file = new RandomAccessFile(index_path + "/pointers.db", "rw");
ptr_buff = new MappedByteBuffer[ptr_parts_num];
for (k = 0; k < ptr_parts_num; ++k) {
ptr_parts_size[k] = (int) (k == ptr_parts_num - 1 ? (kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);
ptr_buff[k] = ptr_file.getChannel().map(FileChannel.MapMode.READ_WRITE, k * ptr_parts_size[0], ptr_parts_size[k]);
}
for (p = 0; p < kmers_num; ++p) {
put_pointer(null_pointer, p);
}
} catch (IOException e) {
System.out.println(e.getMessage());
System.exit(1);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createIndex(Index index) {\n Span span = this.tracer.buildSpan(\"Client.CreateIndex\").start();\n try {\n String path = String.format(\"/index/%s\", index.getName());\n String body = index.getOptions().toString();\n ByteArrayEntity data = new ByteArrayEntity(body.getBytes(StandardCharsets.UTF_8));\n clientExecute(\"POST\", path, data, null, \"Error while creating index\");\n } finally {\n span.finish();\n }\n }",
"IndexCreated createIndex(String name, Index index) throws ElasticException;",
"Database createDatabase();",
"public void createIndex(Configuration configuration){\n }",
"public void testCreIdx(){\r\n\t \r\n\t String dataDir = \"C:\\\\study\\\\Lucene\\\\Data\";\r\n\t String idxDir = \"C:\\\\study\\\\Lucene\\\\Index\";\r\n\t \r\n\t LuceneUtils.delAll(idxDir);\r\n\t \r\n\t CreateIndex ci = new CreateIndex();\r\n\t \r\n\t ci.Indexer(new File(idxDir), new File(dataDir));\r\n\t \r\n\t\t\r\n\t}",
"private void createIndex(Message<JsonObject> msg, int timeout, JsonObject headers, String dbName) {\n // check required params / attributes\n \n // REQUIRED: The name of the collection for which to create the index\n String collection = helper.getMandatoryString(msg.body(), MSG_PROPERTY_COLLECTION, msg);\n if (collection == null) return;\n\n // REQUIRED: A JSON representation of the index (see ArangoDB docs for details)\n JsonObject document = helper.getMandatoryObject(msg.body(), MSG_PROPERTY_DOCUMENT, msg);\n if (document == null) return;\n\n if (!ensureAttribute(document, DOC_ATTRIBUTE_TYPE, msg)) return;\n if (!document.getString(DOC_ATTRIBUTE_TYPE).equals(TYPE_CAP)) {\n if (!ensureAttribute(document, DOC_ATTRIBUTE_FIELDS, msg)) return;\n }\n\n // prepare PATH\n StringBuilder apiPath = new StringBuilder();\n if (dbName != null) apiPath.append(\"/_db/\").append(dbName);\n apiPath.append(API_PATH);\n apiPath.append(\"/?\").append(MSG_PROPERTY_COLLECTION).append(\"=\").append(collection);\n\n httpPost(persistor, apiPath.toString(), headers, document, timeout, msg);\n }",
"public void createIndex(final String name) {\n createIndex(new BasicDBObject(name, 1));\n }",
"public void createIndex(final DBObject keys) {\n createIndex(keys, new BasicDBObject());\n }",
"private void createDatabase() throws SQLException\r\n {\r\n myStmt.executeUpdate(\"create database \" + dbname);\r\n }",
"InstAssignIndex createInstAssignIndex();",
"void createDb(String dbName);",
"private void createDB() {\n try {\n Statement stat = conn.createStatement();\n stat.execute(\"CREATE TABLE settings (name TEXT, state);\");\n stat.execute(\"CREATE TABLE expressions (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n stat.execute(\"CREATE TABLE summaries (id INTEGER PRIMARY KEY ASC, expression_id INTEGER, title TEXT, abstract TEXT);\");\n stat.execute(\"CREATE TABLE history (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n }\n }",
"public void testAddingNewIndex() throws Exception\n {\n PSJdbcDataTypeMap dataTypeMap = new PSJdbcDataTypeMap(\"MYSQL\", \"mysql\", null);\n ArrayList<PSJdbcColumnDef> coldefs = createColumnDef(dataTypeMap);\n coldefs.add(new PSJdbcColumnDef(dataTypeMap, \"col3\", PSJdbcTableComponent.ACTION_DELETE, Types.INTEGER, null,\n true, null));\n PSJdbcTableSchema tableSchema1 = createTableSchema(coldefs);\n setPrimaryKey(tableSchema1);\n PSJdbcForeignKey fk = createForeignKey(tableSchema1);\n\n List<String> indexCols = new ArrayList<String>();\n indexCols.add(\"col3\");\n PSJdbcIndex index1 = new PSJdbcIndex(\"IX_col1\", indexCols.iterator(), PSJdbcTableComponent.ACTION_CREATE);\n tableSchema1.setIndex(index1);\n\n Document doc = PSXmlDocumentBuilder.createXmlDocument();\n Element el = tableSchema1.toXml(doc);\n PSJdbcTableSchema tableSchema2 = new PSJdbcTableSchema(el, dataTypeMap);\n PSJdbcIndex newIndex = (PSJdbcIndex) tableSchema2.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE).next();\n\n // Makes sure if the table schema has changed\n assertFalse((tableSchema1.equals(tableSchema2)));\n\n // Makes sure if a new index definition of non unique have been added to\n // table schema.\n assertFalse((tableSchema1.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE)).hasNext());\n assertTrue((tableSchema2.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE)).hasNext());\n\n // Makes sure if the number of foreign key columns and eqal to that of\n // index columns.\n assertTrue(fk.getForeignKeyColumnNames().size() == newIndex.getIndexColumnNames().size());\n\n // Makes sure if the new index that got created has the same set of\n // columns as foreign key.\n assertTrue(fk.getForeignKeyColumnNames().containsAll(newIndex.getIndexColumnNames()));\n\n // Makes sure if the index name of newly created index has a unique name.\n assertTrue(tableSchema1.doesIndexNameExists(newIndex.getName()));\n\n }",
"public static void createDataBase() {\n final Configuration conf = new Configuration();\n\n addAnnotatedClass(conf);\n\n conf.configure();\n new SchemaExport(conf).create(true, true);\n }",
"@Test\n public void testCreate() throws Exception {\n System.out.println(\"create\");\n Index entity = TestUtils.getTestIndex();\n IndexResponse result = instance.create(entity);\n assertNotNull(result);\n assertEquals(entity.getDatabaseName(), result.getIndex().getDatabaseName());\n assertEquals(entity.getName(), result.getIndex().getName());\n assertEquals(entity.getTableName(), result.getIndex().getTableName());\n assertEquals(entity.getFields(), result.getIndex().getFields());\n }",
"public void createNewSchema() throws SQLException {\n ResultSet resultSet = databaseStatement.executeQuery(\"select count(datname) from pg_database\");\n int uniqueID = 0;\n if(resultSet.next()) {\n uniqueID = resultSet.getInt(1);\n }\n if(uniqueID != 0) {\n uniqueID++;\n databaseStatement.executeQuery(\"CREATE DATABASE OSM\"+uniqueID+\";\");\n }\n }",
"public void createIndex() throws IOException {\n\t\tindexWriter.commit();\n\t\ttaxoWriter.commit();\n\n\t\t// categories\n\t\tfor (Article.Facets f : Article.Facets.values()) {\n\t\t\ttaxoWriter.addCategory(new CategoryPath(f.toString()));\n\t\t}\n\t\ttaxoWriter.commit();\n\n\t\tfinal Iterable<Article> articles = articleRepository.findAll();\n\t\tint c = 0;\n\t\tfor (Article article : articles) {\n\t\t\taddArticle(indexWriter, taxoWriter, article);\n\t\t\tc++;\n\t\t}\n\t\t// commit\n\t\ttaxoWriter.commit();\n\t\tindexWriter.commit();\n\n\t\ttaxoWriter.close();\n\t\tindexWriter.close();\n\n\t\ttaxoDirectory.close();\n\t\tindexDirectory.close();\n\t\tLOGGER.debug(\"{} articles indexed\", c);\n\t}",
"public void start() throws Exception {\n\n createIndex();\n }",
"public void createIndex() {\n String indexName = INDEX_BASE + \"-\" +\n LocalDateTime.now().format(DateTimeFormatter.ofPattern(\"yyyyMMddHHmmss\"));\n\n Settings settings = Settings.builder()\n .put(\"number_of_shards\", 1)\n .put(\"number_of_replicas\", 0)\n .build();\n CreateIndexRequest request = new CreateIndexRequest(indexName, settings);\n\n String mapping = \"{\\n\" +\n \" \\\"article\\\": {\\n\" +\n \" \\\"properties\\\": {\\n\" +\n \" \\\"title\\\": {\\n\" +\n \" \\\"type\\\": \\\"text\\\"\\n\" +\n \" },\\n\" +\n \" \\\"author\\\": {\\n\" +\n \" \\\"type\\\": \\\"keyword\\\"\\n\" +\n \" },\\n\" +\n \" \\\"issue\\\": {\\n\" +\n \" \\\"type\\\": \\\"keyword\\\"\\n\" +\n \" },\\n\" +\n \" \\\"link\\\": {\\n\" +\n \" \\\"type\\\": \\\"keyword\\\"\\n\" +\n \" },\\n\" +\n \" \\\"description\\\": {\\n\" +\n \" \\\"type\\\": \\\"text\\\"\\n\" +\n \" },\\n\" +\n \" \\\"postDate\\\": {\\n\" +\n \" \\\"type\\\": \\\"date\\\",\\n\" +\n \" \\\"format\\\": \\\"yyyy-MM-dd\\\"\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \" }\";\n\n request.mapping(\"article\", mapping, XContentType.JSON);\n request.alias(new Alias(INDEX_BASE));\n\n try {\n CreateIndexResponse createIndexResponse = this.client.admin().indices().create(request).get();\n if (!createIndexResponse.isAcknowledged()) {\n throw new ElasticExecutionException(\"Create java_magazine index was not acknowledged\");\n }\n } catch (InterruptedException | ExecutionException e) {\n logger.error(\"Error while creating an index\", e);\n throw new ElasticExecutionException(\"Error when trying to create an index\");\n }\n }",
"public void createNewDataBase() {\n try (Connection conn = DriverManager.getConnection(url)) {\n if (conn != null) {\n DatabaseMetaData meta = conn.getMetaData();\n createNewTable();\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"@Ignore\n @Test\n public void testCreateIndex() {\n System.out.println(\"createIndex\");\n Util.commonServiceIPs=\"127.0.0.1\";\n \n EntityManager em=Util.getEntityManagerFactory(100).createEntityManager();\n EntityManager platformEm = Util.getPlatformEntityManagerFactory().createEntityManager();\n \n Client client = ESUtil.getClient(em,platformEm,1,false);\n \n RuntimeContext.dataobjectTypes = Util.getDataobjectTypes();\n String indexName = \"test000000\";\n try {\n ESUtil.createIndex(platformEm, client, indexName, true);\n }\n catch(Exception e)\n {\n \n }\n \n\n }",
"boolean createIndex(String indexName);",
"private void createDatabase() throws Exception{\n Statement stm = this.con.createStatement();\n stm.execute(\"CREATE DATABASE IF NOT EXISTS \" + database +\n \" DEFAULT CHARACTER SET utf8 COLLATE utf8_persian_ci\");\n }",
"private void createIndex(final String index, int numShards, int numReplicas) throws IOException {\n LOGGER.warn(\"CREATE ES INDEX {} with {} shards and {} replicas\", index, numShards, numReplicas);\n final Settings indexSettings = Settings.builder().put(\"number_of_shards\", numShards)\n .put(\"number_of_replicas\", numReplicas).build();\n CreateIndexRequest indexRequest = new CreateIndexRequest(index, indexSettings);\n getClient().admin().indices().create(indexRequest).actionGet();\n\n final String mapping = IOUtils.toString(\n this.getClass().getResourceAsStream(\"/elasticsearch/mapping/map_person_5x_snake.json\"));\n getClient().admin().indices().preparePutMapping(index)\n .setType(getConfig().getElasticsearchDocType()).setSource(mapping, XContentType.JSON).get();\n }",
"LuceneMemoryIndex createLuceneMemoryIndex();",
"private void ensureIndexes() throws Exception {\n LOGGER.info(\"Ensuring all Indexes are created.\");\n\n QueryResult indexResult = bucket.query(\n Query.simple(select(\"indexes.*\").from(\"system:indexes\").where(i(\"keyspace_id\").eq(s(bucket.name()))))\n );\n\n\n List<String> indexesToCreate = new ArrayList<String>();\n indexesToCreate.addAll(Arrays.asList(\n \"def_sourceairport\", \"def_airportname\", \"def_type\", \"def_faa\", \"def_icao\", \"def_city\"\n ));\n\n boolean hasPrimary = false;\n List<String> foundIndexes = new ArrayList<String>();\n for (QueryRow indexRow : indexResult) {\n String name = indexRow.value().getString(\"name\");\n if (name.equals(\"#primary\")) {\n hasPrimary = true;\n } else {\n foundIndexes.add(name);\n }\n }\n indexesToCreate.removeAll(foundIndexes);\n\n if (!hasPrimary) {\n String query = \"CREATE PRIMARY INDEX def_primary ON `\" + bucket.name() + \"` WITH {\\\"defer_build\\\":true}\";\n LOGGER.info(\"Executing index query: {}\", query);\n QueryResult result = bucket.query(Query.simple(query));\n if (result.finalSuccess()) {\n LOGGER.info(\"Successfully created primary index.\");\n } else {\n LOGGER.warn(\"Could not create primary index: {}\", result.errors());\n }\n }\n\n for (String name : indexesToCreate) {\n String query = \"CREATE INDEX \" + name + \" ON `\" + bucket.name() + \"` (\" + name.replace(\"def_\", \"\") + \") \"\n + \"WITH {\\\"defer_build\\\":true}\\\"\";\n LOGGER.info(\"Executing index query: {}\", query);\n QueryResult result = bucket.query(Query.simple(query));\n if (result.finalSuccess()) {\n LOGGER.info(\"Successfully created index with name {}.\", name);\n } else {\n LOGGER.warn(\"Could not create index {}: {}\", name, result.errors());\n }\n }\n\n LOGGER.info(\"Waiting 5 seconds before building the indexes.\");\n\n Thread.sleep(5000);\n\n StringBuilder indexes = new StringBuilder();\n boolean first = true;\n for (String name : indexesToCreate) {\n if (first) {\n first = false;\n } else {\n indexes.append(\",\");\n }\n indexes.append(name);\n }\n\n if (!hasPrimary) {\n indexes.append(\",\").append(\"def_primary\");\n }\n\n String query = \"BUILD INDEX ON `\" + bucket.name() + \"` (\" + indexes.toString() + \")\";\n LOGGER.info(\"Executing index query: {}\", query);\n QueryResult result = bucket.query(Query.simple(query));\n if (result.finalSuccess()) {\n LOGGER.info(\"Successfully executed build index query.\");\n } else {\n LOGGER.warn(\"Could not execute build index query {}.\", result.errors());\n }\n }",
"public void dbCreate() {\n Logger.write(\"INFO\", \"DB\", \"Creating database\");\n try {\n if (!Database.DBDirExists())\n Database.createDBDir();\n dbConnect(false);\n for (int i = 0; i < DBStrings.createDB.length; i++)\n execute(DBStrings.createDB[i]);\n } catch (Exception e) {\n Logger.write(\"FATAL\", \"DB\", \"Failed to create databse: \" + e);\n }\n }",
"SqlElasticPoolOperations.DefinitionStages.WithCreate withNewDatabase(String databaseName);",
"public com.guidewire.datamodel.IndexDocument.Index addNewIndex()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n com.guidewire.datamodel.IndexDocument.Index target = null;\r\n target = (com.guidewire.datamodel.IndexDocument.Index)get_store().add_element_user(INDEX$12);\r\n return target;\r\n }\r\n }",
"String createIndex() {\n\t\tboolean res = indexExists();\n\t\t@SuppressWarnings(\"unused\")\n\t\tint resCode;\n\t\tif (!res) {\n\t\t\tresCode = doHttpOperation(esIndexUrl, HTTP_PUT, null);\n\t\t}\n\t\treturn lastResponse;\n\t}",
"DataBase createDataBase();",
"public void createDatabase() throws IOException{\r\n\r\n boolean dbDoesExist = checkDatabase();\r\n if(!dbDoesExist)\r\n {\r\n // Create or open db if db is not connected\r\n this.getReadableDatabase();\r\n try{\r\n createNewDB();\r\n }catch (IOException e){\r\n throw new Error(\"DB Copy Failed\");\r\n }\r\n }\r\n }",
"SqlElasticPoolOperations.DefinitionStages.WithCreate withExistingDatabase(String databaseName);",
"public void createDatabase(String dbName, String owner) throws Exception;",
"SqlElasticPoolOperations.DefinitionStages.WithCreate withExistingDatabase(SqlDatabase database);",
"long createDatabase(long actor, String nameToDisplay, long proteinDBType, long sizeInBytes, boolean bPublic, boolean bReversed, ExperimentCategory category);",
"public String createDSIndex(String dsID, String dschemaID, String attriName);",
"indexSet createindexSet();",
"protected abstract ODatabaseInternal<?> newDatabase();",
"public void createIndex() throws IOException {\n\t\tLOGGER.info(\"creating photo index...\");\n\t\tCreateIndexRequest request = new CreateIndexRequest(\"files\");\n\t\tInputStream in = getClass().getClassLoader().getResourceAsStream(\"photo.json\");\n\t\tString mapping = new String(in.readAllBytes());\n\t\tin.close();\n\t\trequest.mapping(\"photo\", mapping, XContentType.JSON);\n\t\tCreateIndexResponse response = client.indices().create(request);\n\t\tLOGGER.info(\"photo index created: \" + response.toString());\n\t}",
"public void creatDataBase(String dbName);",
"IndexNameReference createIndexNameReference();",
"private void createProductIndex() {\n\t\tLinkedList<String> ids = new LinkedList<>(productIds.keySet());\n\t\tArrayList<ArrayList<Integer>> vals = new ArrayList<>(productIds.values());\n\t\tint k = 8;\n\t\tKFront kf = new KFront();\n\t\tkf.createKFront(k, ids);\n\t\tfor (int i = 0; i < vals.size(); i++) {\n\t\t\tkf.getTable().get(i).addAll(vals.get(i));\n\t\t}\n\n\t\tProductIndex pIndex = new ProductIndex(k);\n\t\tpIndex.insertData(kf.getTable(), kf.getConcatString());\n\t\tsaveToDir(PRODUCT_INDEX_FILE, pIndex);\n\t}",
"public static void createDatabase() throws SQLException {\n\t\tSystem.out.println(\"DROP database IF EXISTS project02;\");\n\t\tstatement = connection.prepareStatement(\"DROP database IF EXISTS project02;\");\n\t\tstatement.executeUpdate();\n\t\tSystem.out.println(\"CREATE database project02;\");\n\t\tstatement = connection.prepareStatement(\"CREATE database project02;\");\n\t\tstatement.executeUpdate();\n\t\tSystem.out.println(\"USE project02;\");\n\t\tstatement = connection.prepareStatement(\"USE project02;\");\n\t\tstatement.executeUpdate();\n\t}",
"void create(QueryCursor cursor, String indexName, String... templateProperties) throws SQLException;",
"public void addIndex(String collectionName, DBObject index){\n DBCollection collection =this.getDBCollection(collectionName);\n collection.createIndex(index);\n }",
"public CreateIndexRequest prepareCreate(String index) {\n \treturn new CreateIndexRequest(hClient, index);\n }",
"private static RDFIndex createDefaultIndex() {\n defaultIndex = new RDFIndex(com.hp.hpl.jena.graph.Factory.createGraphMem());\n try {\n File indexFile = new File(INDEX_FILE);\n if(indexFile.exists()) {\n defaultIndex.read(new FileReader(indexFile),Constants.RESOURCE_URL);\n }\n } catch(Throwable t) {\n t.printStackTrace();\n }\n return defaultIndex;\n }",
"public static void createDatabase() throws ArcException {\n\t\tcreateDatabase(userWithRestrictedRights);\t\t\n\t}",
"@Override\n\tpublic Database createDatabase(Type type) throws FSException {\n\t\treturn new DummyDatabase();\n\t}",
"@POST\n @Produces({\"application/json\"})\n public String createDb() throws WebApplicationException {\n HibernateEntityManager emAdm = PersistenceManager.getInstance().getEntityManagerAdmin();\n SQLQuery qCreate = emAdm.getSession().createSQLQuery(\"CREATE DATABASE test_jeff template=postgis\");\n try{\n qCreate.executeUpdate();\n }catch(SQLGrammarException e){\n System.out.println(\"Error !!\" + e.getSQLException());\n emAdm.close();\n return e.getSQLException().getLocalizedMessage();\n }\n emAdm.close();\n Map properties = new HashMap();\n //change the connection string to the new db\n properties.put(\"hibernate.connection.url\", \"jdbc:postgresql_postGIS://192.168.12.36:5432/test_jeff\");\n EntityManagerFactory emf = Persistence.createEntityManagerFactory(\"dataPU\", properties); \n return \"Yeah\";\n }",
"public void testAddingNewIndexWithoutIndex() throws Exception\n {\n PSJdbcDataTypeMap dataTypeMap = new PSJdbcDataTypeMap(\"MYSQL\", \"mysql\", null);\n ArrayList<PSJdbcColumnDef> coldefs = createColumnDef(dataTypeMap);\n PSJdbcTableSchema tableSchema = createTableSchema(coldefs);\n setPrimaryKey(tableSchema);\n PSJdbcForeignKey fk = createForeignKey(tableSchema);\n\n Document doc = PSXmlDocumentBuilder.createXmlDocument();\n Element el = tableSchema.toXml(doc);\n PSJdbcTableSchema tableSchema2 = new PSJdbcTableSchema(el, dataTypeMap);\n\n Iterator<?> itIndex = tableSchema2.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE);\n PSJdbcIndex index = (PSJdbcIndex) itIndex.next();\n String IndexName = index.getName();\n String fkcolname = fk.getForeignKeyColumnNames().get(0);\n\n // Makes sure if the table schema has changed\n assertFalse((tableSchema.equals(tableSchema2)));\n\n // Makes sure if a new index definition of non unique have been added to\n // table schema.\n assertFalse((tableSchema.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE)).hasNext());\n assertTrue((tableSchema2.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE)).hasNext());\n\n // Makes sure if the index name has taken the first foreign key column name.\n assertTrue((StringUtils.equalsIgnoreCase(IndexName, \"IX_\" + fkcolname)));\n\n // Makes sure if the createForeignkeyIndexes attribute for mysql.\n assertTrue(dataTypeMap.isCreateForeignKeyIndexes());\n\n }",
"public void createDatabase() throws IOException {\n boolean dbExists = checkDatabase();\n\n if (dbExists) {\n // Do nothing - database already exists\n } else {\n // By calling this method an empty database will be created into the\n // default system path of our application so we are going to be able\n // to overwrite the database with our database.\n this.getReadableDatabase();\n\n try {\n copyDatabase();\n } catch (IOException e) {\n throw new Error(\"Error copying database\");\n }\n }\n }",
"public void createIndex(final DBObject keys, final String name) {\n createIndex(keys, name, false);\n }",
"public void ensureIndex(Index index) {\n try {\n createIndex(index);\n } catch (HttpConflict ex) {\n // pass\n }\n }",
"public void createDB() {\n String url = \"jdbc:sqlite:stats.db\";\n Statement stmt = null;\n try (Connection conn = DriverManager.getConnection(url)) {\n stmt = conn.createStatement();\n String query = \"CREATE TABLE IF NOT EXISTS games \"\n + \"(ownships int, \"\n + \"ownremaining int, \"\n + \"aiships int,\"\n + \"airemaining int, \"\n + \"turns int)\";\n\n stmt.executeUpdate(query);\n\n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n }\n }",
"public void createIndexOnProcessName() throws ServiceFailureException;",
"public void createIntegrationTestDatabase() throws SQLException {\n\n final Connection connection = DriverManager.getConnection(url + \"postgres\", databaseProperties);\n\n connection.prepareStatement(\"DROP DATABASE IF EXISTS test_disassembly\").execute();\n connection.prepareStatement(\"DROP DATABASE IF EXISTS test_import\").execute();\n connection.prepareStatement(\"DROP DATABASE IF EXISTS test_empty\").execute();\n\n connection.prepareStatement(\"CREATE DATABASE test_disassembly\").execute();\n connection.prepareStatement(\"CREATE DATABASE test_import\").execute();\n connection.prepareStatement(\"CREATE DATABASE test_empty\").execute();\n\n connection.close();\n\n createDatabase(TEST_IMPORT);\n createDatabase(TEST_DISASSEMBLY);\n }",
"public void createIndex(final DBObject keys, final DBObject options) {\n try {\n executor.execute(createIndexOperation(keys, options), getReadConcern());\n } catch (MongoWriteConcernException e) {\n throw createWriteConcernException(e);\n }\n }",
"public SimpleIndexFactory() {\n\t}",
"public boolean createIndex() {\n RestClient client = esrResource.getClient();\n\n try {\n Response r = client.performRequest(\"HEAD\", \"/\" + index);\n\n if (r.getStatusLine().getStatusCode() != 200) {\n client.performRequest(\"PUT\", \"/\" + index);\n\n return true;\n }\n } catch (IOException ioe) {\n getMonitor().error(\"Unable to create index\", ioe);\n }\n\n return false;\n }",
"private void ensureHashingIndexExists() {\n DB metadataDB = client.getDB(\"cacheManagerMetadata\");\n if (!metadataDB.collectionExists(\"hashingIndex\")) {\n DBCollection hashingIndex = metadataDB.getCollection(\"hashingIndex\");\n hashingIndex.createIndex(new BasicDBObject(\"hashValue\", 1),\n new BasicDBObject(\"unique\", 1));\n }\n }",
"public void createDataBase() throws IOException {\n boolean dbExist = checkDataBase();\n\n if (dbExist) {\n\n } else {\n this.getReadableDatabase();\n try {\n copyDataBase();\n } catch (IOException e) {\n Log.e(\"tle99 - create\", e.getMessage());\n }\n }\n }",
"private void setupDb(){\n try {\n openConnection();\n s.executeUpdate(\"CREATE TABLE IF NOT EXISTS LIB (NAME text UNIQUE , TYPE text, LANGUAGE text, INTRUSIVE text, OPENSOURCE text)\");\n }catch (SQLException e) {\n System.err.println(e.getMessage());\n }finally {\n if (c != null){\n close(c);\n }\n }\n }",
"public void dbCreate() throws IOException\n {\n boolean dbExist = dbCheck();\n\n if(!dbExist)\n {\n //By calling this method an empty database will be created into the default system patt\n //of the application so we can overwrite that db with our db.\n this.getReadableDatabase(); // create a new empty database in the correct path\n try\n {\n //copy the data from the database in the Assets folder to the new empty database\n copyDBFromAssets();\n }\n catch(IOException e)\n {\n throw new Error(\"Error copying database\");\n }\n }\n }",
"public void initDb() {\n String createVac = \"create table if not exists vacancies(id serial primary key,\"\n + \"name varchar(1500) NOT NULL UNIQUE, url varchar (1500), description text, dateVac timestamp);\";\n try (Statement st = connection.createStatement()) {\n st.execute(createVac);\n } catch (SQLException e) {\n LOG.error(e.getMessage());\n }\n }",
"private static void initializeDatabase()\n\t{\n\t\tResultSet resultSet = dbConnect.getMetaData().getCatalogs();\n\t\tStatment statement = dbConnect.createStatement();\n\t\t\n\t\tif (resultSet.next())\n\t\t{\n\t\t\tstatement.execute(\"USE \" + resultSet.getString(1));\n\t\t\tstatement.close();\n\t\t\tresultSet.close();\n\t\t\treturn; //A database exists already\n\t\t}\n\t\tresultSet.close();\n\t\t//No database exists yet, create it.\n\t\t\n\t\tstatement.execute(\"CREATE DATABASE \" + dbName);\n\t\tstatement.execute(\"USE \" + dbName);\n\t\tstatement.execute(createTableStatement);\n\t\tstatement.close();\n\t\treturn;\n\t}",
"private synchronized void criarIndice() throws Exception {\r\n\t\tIndexWriter indexWriter = getWriterPadrao(true);\r\n\t\ttry {\r\n\t\t\tindexWriter.getAnalyzer().close();\r\n\t\t\tindexWriter.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"void createIndexDir(String indexDirPath) throws IOException {\n File indexDir = new File(indexDirPath);\n if (!indexDir.exists())\n indexDir.mkdir();\n else {\n removeIndexDir(indexDirPath);\n indexDir.mkdir(); \n }\n }",
"public void createIndexesIfNotExists(String indexName) throws IOException {\n\t\ttry {\n\t\t\tclient.admin().indices().prepareCreate(indexName).execute().actionGet();\n\t\t} catch (Exception e) {\n\t\t}\n\t\tcreateMappings();\n\t\tclient.admin().indices().refresh(new RefreshRequest(indexName)).actionGet();\n\t}",
"public void createDataBase() throws IOException{\n \n \tboolean dbExist = checkDataBase();\n \t\n \n \tif(dbExist){\n \t\t//do nothing - database already exists\n \t\tLog.d(\"Database Check\", \"Database Exists\");\n\n \t}else{\n \t\tLog.d(\"Database Check\", \"Database Doesn't Exist\");\n \t\tthis.close();\n \t\t//By calling this method and empty database will be created into the default system path\n //of your application so we are gonna be able to overwrite that database with our database.\n \tthis.getReadableDatabase();\n \tthis.close();\n \ttry {\n \t\t\tcopyDataBase();\n \t\t\tLog.d(\"Database Check\", \"Database Copied\");\n \n \t\t} catch (IOException e) {\n \t\tLog.d(\"I/O Error\", e.toString());\n\n \t\tthrow new Error(\"Error copying database\");\n \t}\n \tcatch (Exception e) { \n \t\tLog.d(\"Exception in createDatabase\", e.toString());\n \t\t\n \t}\n \t}\n \n }",
"public void createDB(){\r\n\t\t\r\n\t\t Connection connection = null;\r\n\t try\r\n\t {\r\n\t // create a database connection\r\n\t connection = DriverManager.getConnection(\"jdbc:sqlite:project.sqlite\");\r\n\t Statement statement = connection.createStatement();\r\n\t statement.setQueryTimeout(30); // set timeout to 30 sec.\r\n\r\n\t statement.executeUpdate(\"drop table if exists task\");\r\n\t statement.executeUpdate(\"create table task (taskId integer primary key asc, description string, status string, createDate datetime default current_timestamp)\");\r\n\t statement.executeUpdate(\"insert into task values(1, 'leo', 'Active', null)\");\r\n\t statement.executeUpdate(\"insert into task values(2, 'yui', 'Complete', null)\");\r\n\t }\r\n\t catch(SQLException ex){\r\n\t \tthrow new RuntimeException(ex);\r\n\t }\r\n\t\t\r\n\t}",
"public com.guidewire.datamodel.IndexDocument.Index insertNewIndex(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n com.guidewire.datamodel.IndexDocument.Index target = null;\r\n target = (com.guidewire.datamodel.IndexDocument.Index)get_store().insert_element_user(INDEX$12, i);\r\n return target;\r\n }\r\n }",
"public void createDB() {\n\t\ttry {\n\t\t\tBufferedReader br= new BufferedReader(new FileReader(\"db_schema.txt\"));\n\t\t\tString line= null;\n\t\t\tStringBuilder sb= new StringBuilder();\n\t\t\twhile ((line=br.readLine())!=null){\n\t\t\t\tsb.append(line);\n\t\t\t\tif(sb.length()>0 && sb.charAt(sb.length()-1)==';'){//see if it is the end of one line of command\n\t\t\t\t\tstatement.executeUpdate(sb.toString());\n\t\t\t\t\tsb= new StringBuilder();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void testAddingNewIndexWithFKName() throws Exception\n {\n PSJdbcDataTypeMap dataTypeMap = new PSJdbcDataTypeMap(\"MYSQL\", \"mysql\", null);\n ArrayList<PSJdbcColumnDef> coldefs = createColumnDef(dataTypeMap);\n coldefs.add(new PSJdbcColumnDef(dataTypeMap, \"col3\", PSJdbcTableComponent.ACTION_DELETE, Types.INTEGER, null,\n true, null));\n PSJdbcTableSchema tableSchema1 = createTableSchema(coldefs);\n setPrimaryKey(tableSchema1);\n\n String foreignKeyName = \"FK_Name\";\n List<String[]> fkCols = new ArrayList<String[]>();\n String[] fcol1 =\n {\"col1\", \"etable\", \"ecol1\"};\n fkCols.add(fcol1);\n PSJdbcForeignKey fk = new PSJdbcForeignKey(foreignKeyName, fkCols.iterator(),\n PSJdbcTableComponent.ACTION_DELETE);\n List<PSJdbcForeignKey> fks = new ArrayList<>();\n fks.add(fk);\n tableSchema1.setForeignKeys(fks,true);\n\n List<String> indexCols = new ArrayList<String>();\n indexCols.add(\"col2\");\n PSJdbcIndex index1 = new PSJdbcIndex(\"IX_Name\", indexCols.iterator(), PSJdbcTableComponent.ACTION_CREATE);\n tableSchema1.setIndex(index1);\n\n Document doc = PSXmlDocumentBuilder.createXmlDocument();\n Element el = tableSchema1.toXml(doc);\n PSJdbcTableSchema tableSchema2 = new PSJdbcTableSchema(el, dataTypeMap);\n PSJdbcIndex newIndex = (PSJdbcIndex) tableSchema2.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE).next();\n\n // Makes sure if the table schema has changed.\n assertFalse((tableSchema1.equals(tableSchema2)));\n\n // Makes sure if the new index that got created has the same set of\n // columns as foreign key.\n assertTrue(fk.getForeignKeyColumnNames().containsAll(newIndex.getIndexColumnNames()));\n\n // Makes sure if the index name of newly created index has a unique name.\n assertTrue(tableSchema1.doesIndexNameExists(newIndex.getName()));\n }",
"@Override\n\t\tpublic void onCreate(SQLiteDatabase database) {\n\t\t\tcreateTable(database);\n\n\t\t}",
"public void beforeIndexCreated(Index index) {\n\n }",
"boolean isNewIndex();",
"private void createDatabase(final String databaseName) {\n\n try {\n final Connection connection =\n DriverManager.getConnection(url + databaseName, databaseProperties);\n\n try {\n NaviLogger.info(\"[i] Generating database tables for %s.\", databaseName);\n connection.prepareStatement(AbstractSQLProvider.parseResourceAsSQLFile(\n this.getClass().getResourceAsStream(TEST_DATA_DIRECTORY + \"database_schema.sql\")))\n .execute();\n } catch (final IOException exception) {\n CUtilityFunctions.logException(exception);\n }\n\n final File testDataDir = new File(\n \"./third_party/zynamics/javatests/com/google/security/zynamics/binnavi/testdata/\"\n + databaseName + \"/\");\n\n final CopyManager manager = new CopyManager((BaseConnection) connection);\n\n for (final File currentFile : testDataDir.listFiles()) {\n try (FileReader reader = new FileReader(currentFile)) {\n final String tableName = currentFile.getName().split(\".sql\")[0];\n NaviLogger.info(\"[i] Importing: %s.%s from %s\", databaseName, tableName,\n currentFile.getAbsolutePath());\n manager.copyIn(\"COPY \" + tableName + \" FROM STDIN\", reader);\n } catch (final IOException exception) {\n CUtilityFunctions.logException(exception);\n }\n }\n\n try {\n NaviLogger.warning(\"[i] Generating constraints for %s.\", databaseName);\n connection.prepareStatement(AbstractSQLProvider.parseResourceAsSQLFile(\n this.getClass().getResourceAsStream(TEST_DATA_DIRECTORY + \"database_constraints.sql\")))\n .execute();\n } catch (final IOException exception) {\n CUtilityFunctions.logException(exception);\n }\n\n final String findSequencesQuery = \"SELECT 'SELECT SETVAL(' ||quote_literal(S.relname)|| \"\n + \"', MAX(' ||quote_ident(C.attname)|| ') ) FROM ' ||quote_ident(T.relname)|| ';' \"\n + \" FROM pg_class AS S, pg_depend AS D, pg_class AS T, pg_attribute AS C \"\n + \" WHERE S.relkind = 'S' AND S.oid = D.objid AND D.refobjid = T.oid \"\n + \" AND D.refobjid = C.attrelid AND D.refobjsubid = C.attnum ORDER BY S.relname; \";\n\n try (PreparedStatement statement = connection.prepareStatement(findSequencesQuery);\n ResultSet resultSet = statement.executeQuery()) {\n while (resultSet.next()) {\n final PreparedStatement fixSequence = connection.prepareStatement(resultSet.getString(1));\n fixSequence.execute();\n }\n } catch (final SQLException exception) {\n CUtilityFunctions.logException(exception);\n }\n\n } catch (final SQLException exception) {\n CUtilityFunctions.logException(exception);\n }\n }",
"public synchronized void createIndexIfNeeded(final String index) throws NeutronCheckedException {\n try {\n if (!doesIndexExist(index)) {\n LOGGER.warn(\"ES INDEX {} DOES NOT EXIST!!\", index);\n createIndex(index, NUMBER_OF_SHARDS, NUMBER_OF_REPLICAS);\n\n // Give Elasticsearch a moment to catch its breath.\n Thread.sleep(2000); // NOSONAR\n }\n } catch (InterruptedException | IOException e) {\n throw JobLogs.checked(LOGGER, e, \"CREATE INDEX FAILED! {}\", e.getMessage());\n }\n }",
"public void createIndexBinaryTree(Index[] indexes, IndexBTree tree){\n\t\tcreateIndexBinaryTree(indexes, tree, 0, indexes.length);\n\t}",
"public void createDataBase() throws IOException {\n\n boolean dbExist = checkDataBase();\n\n if(dbExist){\n //do nothing - database already exist\n }else{\n\n //By calling this method and empty database will be created into the default system path\n //of your application so we are gonna be able to overwrite that database with our database.\n this.getReadableDatabase();\n\n try {\n\n copyDataBase();\n\n } catch (IOException e) {\n\n throw new Error(\"Error copying database\");\n\n }\n }\n\n }",
"public void createDataBase() throws IOException {\n\n boolean dbExist = checkDataBase();\n\n if(dbExist){\n //do nothing - database already exist\n }else{\n\n //By calling this method and empty database will be created into the default system path\n //of your application so we are gonna be able to overwrite that database with our database.\n this.getReadableDatabase();\n\n try {\n\n copyDataBase();\n\n } catch (IOException e) {\n\n throw new Error(\"Error copying database\");\n\n }\n }\n\n }",
"public void enableIndexAutoCreation() {\n client.setIndexAutoCreationEnabled(true);\n }",
"public static void createDB(String name) {\n\t\ttry {\n\t\t\tString Query = \"CREATE DATABASE \" + name;\n\t\t\tStatement st = conexion.createStatement();\n\t\t\tst.executeUpdate(Query);\n\t\t\tSystem.out.println(\"DB creada con exito!\");\n\n\t\t\tJOptionPane.showMessageDialog(null, \"Se ha creado la DB \" + name + \"de forma exitosa.\");\n\t\t} catch (SQLException ex) {\n\t\t\tSystem.out.println(ex.getMessage());\n\t\t\tSystem.out.println(\"Error creando la DB.\");\n\t\t}\n\t}",
"public static Index create(String name, Path path) {\n try {\n Files.createDirectory(path.resolve(INDEX));\n return new Index(name, path);\n\n } catch (IOException e) {\n throw new IOFailureException(e);\n }\n }",
"public createIndex_args(createIndex_args other) {\n }",
"public void createNewDB(String DB_Name) {\n //SQL statement\n String query = \"CREATE database if NOT EXISTS \" + DB_Name;\n\n try {\n //Connection\n stmt = con.createStatement();\n //Execute statement\n stmt.executeUpdate(query);\n System.out.println(\"\\n--Database \" + DB_Name + \" created--\");\n } catch (SQLException ex) {\n //Handle SQL exceptions\n System.out.println(\"\\n--Statement did not execute--\");\n ex.printStackTrace();\n }\n }",
"void addIndexForRepository(long repositoryId);",
"public void testAddingNewIndexWhenIndexContainsFKColumns() throws Exception\n {\n PSJdbcDataTypeMap dataTypeMap = new PSJdbcDataTypeMap(\"MYSQL\", \"mysql\", null);\n ArrayList<PSJdbcColumnDef> coldefs = createColumnDef(dataTypeMap);\n coldefs.add(new PSJdbcColumnDef(dataTypeMap, \"col3\", PSJdbcTableComponent.ACTION_DELETE, Types.INTEGER, null,\n true, null));\n PSJdbcTableSchema tableSchema1 = createTableSchema(coldefs);\n setPrimaryKey(tableSchema1);\n\n List<String[]> fkCols = new ArrayList<String[]>();\n String[] fcol1 =\n {\"col1\", \"etable\", \"ecol1\"};\n fkCols.add(fcol1);\n PSJdbcForeignKey fk = new PSJdbcForeignKey(fkCols.iterator(), PSJdbcTableComponent.ACTION_DELETE);\n List<PSJdbcForeignKey> fks = new ArrayList<>();\n fks.add(fk);\n tableSchema1.setForeignKeys(fks,true);\n\n List<String> indexCols = new ArrayList<String>();\n indexCols.add(\"col1\");\n indexCols.add(\"col2\");\n PSJdbcIndex index1 = new PSJdbcIndex(\"IX_Name\", indexCols.iterator(), PSJdbcTableComponent.ACTION_CREATE);\n tableSchema1.setIndex(index1);\n\n Document doc = PSXmlDocumentBuilder.createXmlDocument();\n Element el = tableSchema1.toXml(doc);\n PSJdbcTableSchema tableSchema2 = new PSJdbcTableSchema(el, dataTypeMap);\n PSJdbcIndex newIndex = (PSJdbcIndex) tableSchema2.getIndexes().next();\n\n // Makes sure if the table schema has not changed\n assertTrue((tableSchema1.equals(tableSchema2)));\n\n }",
"public static void main(String[] args) throws Exception {\n\t\tString aServerUrl = \"http://localhost:5820\";\n\n\t\t// first create a temporary database to use\n\t\tAdminConnection dbms = AdminConnectionConfiguration.toServer(aServerUrl).credentials(\"admin\", \"admin\").connect();\n\n\t\t// check whether there is no such database already, and if there is, drop it\t\t\n\t\tif (dbms.list().contains(\"waldoTest\")) {\n\t\t\tdbms.drop(\"waldoTest\");\n\t\t}\n\n\t\tdbms.memory(\"waldoTest\")\n\t\t .searchable(true)\n\t\t .create();\n\n\t\tdbms.close();\n\n\t\t// obtain a connection to the database\n\t\tConnection aConn = ConnectionConfiguration\n\t\t\t .to(\"waldoTest\")\t\t // the name of the db to connect to\n\t\t\t .server(aServerUrl)\n\t\t\t .credentials(\"admin\", \"admin\") // credentials to use while connecting\n\t\t\t .connect();\t\t\t\t // now open the connection\n\n\t\t// first things first, lets add some data into the index so that it can be queried and searched\n\n\t\taConn.begin();\n\t\taConn\n\t\t\t.add().io()\n\t\t\t.format(RDFFormat.RDFXML)\n\t\t\t.file(new File(\"data/catalog.rdf\"));\n\n\t\taConn.commit();\n\n\t\t// Lets try an example with the basic Waldo API\n\n\t\t// to start, we want to view this connection as a searchable connection, so we request a view of the connection\n\t\t// as a searchable connection\n\t\tSearchConnection aSearchConn = aConn.as(SearchConnection.class);\n\n\t\t// then we'll construct a searcher\n\t\tSearcher aSearch = aSearchConn.search()\n\t\t\t .limit(50) \t\t\t// as before we only want the top fifty results\n\t\t\t .query(\"mac\")\t\t// our search term\n\t\t\t .threshold(0.5);\t\t// Since Waldo is implemented over lucene, we can also specify a min threshold for our results\n\n\t\tSearchResults aSearchResults = aSearch.search();\n\n\t\t// and now we can just iterate over the search results\n\n\t\tIteration<SearchResult, QueryEvaluationException> resultIt = aSearchResults.iteration();\n\n\t\tSystem.out.println(\"\\nAPI results: \");\n\t\twhile (resultIt.hasNext()) {\n\t\t\tSearchResult aHit = resultIt.next();\n\n\t\t\tSystem.out.println(aHit.getHit() + \" with a score of: \" + aHit.getScore());\n\t\t}\n\n\t\t// don't forget to close your iteration!\n\t\tresultIt.close();\n\n\t\t// we can also re-use the searcher if we want to find the next set of results...\n\n\t\taSearch.offset(50); // we already found the first fifty, so lets grab the next set\n\n\t\taSearchResults = aSearch.search();\n\n\t\t// we can now check the next page of search results!\n\n\t\t// SPARQL syntax based on the LARQ syntax in Jena for doing the exact same thing directly in a query.\n\n\t\tString aQuery = \"SELECT DISTINCT ?s ?score WHERE {\\n\" +\n\t\t \"\\t?s ?p ?l.\\n\" +\n\t\t \"\\t( ?l ?score ) <\" + SearchConnection.MATCH_PREDICATE + \"> ( 'mac' 0.5 50 ).\\n\" +\n\t\t \"}\";\n\n\t\tSelectQuery query = aConn.select(aQuery);\n\n\t\tTupleQueryResult aResult = query.execute();\n\n\t\tSystem.out.println(\"Query results: \");\n\t\twhile (aResult.hasNext()) {\n\t\t\tBindingSet result = aResult.next();\n\n\t\t\tSystem.out.println(result.getValue(\"s\") + \" with a score of: \" + ((Literal) result.getValue(\"score\")).doubleValue());\n\t\t}\n\n\t\t// always close your connections when you're done\n\t\taConn.close();\n\t}",
"public static boolean createIndex(String appid) {\n\t\treturn createIndex(appid, Para.getConfig().elasticsearchRootIndexShards(), Para.getConfig().elasticsearchRootIndexReplicas());\n\t}",
"private void createTables() throws DatabaseAccessException {\n\t\tStatement stmt = null;\n\t\tPreparedStatement prepStmt = null;\n\n\t\ttry {\n\t\t\tstmt = this.connection.createStatement();\n\n\t\t\t// be sure to drop all tables in case someone manipulated the database manually\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS DynamicConstraints;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Features;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Groups;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Metadata;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Objects;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS StaticConstraints;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Subspaces;\");\n\n\t\t\t// populate database with tables.. by using ugly sql\n\t\t\tstmt.executeUpdate(\"CREATE TABLE DynamicConstraints(Id INTEGER PRIMARY KEY AUTOINCREMENT,\"\n\t\t\t\t\t+ \" Operator INTEGER, FeatureReference INTEGER,\"\n\t\t\t\t\t+ \" GroupReference INTEGER, Value FLOAT, Active BOOLEAN);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Features(Id INTEGER PRIMARY KEY AUTOINCREMENT,\" + \" Name VARCHAR(\"\n\t\t\t\t\t+ DatabaseConfiguration.VARCHARLENGTH + \"), OutlierFlag BOOLEAN, Min FLOAT, Max FLOAT);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Groups(Id INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR(\"\n\t\t\t\t\t+ DatabaseConfiguration.VARCHARLENGTH + \"),\"\n\t\t\t\t\t+ \" Visibility BOOLEAN, Color INTEGER, ColorCalculatedByFeature INTEGER, Description TEXT);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Metadata(Version INTEGER);\");\n\n\t\t\t// Object table is created in initFeatures, to boost performance\n\n\t\t\tstmt.executeUpdate(\"CREATE TABLE StaticConstraints(Id INTEGER, GroupReference INTEGER,\"\n\t\t\t\t\t+ \" ObjectReference INTEGER, Active BOOLEAN);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Subspaces(Id INTEGER, FeatureReference INTEGER,\" + \" Name VARCHAR(\"\n\t\t\t\t\t+ DatabaseConfiguration.VARCHARLENGTH + \"));\");\n\n\t\t\tstmt.close();\n\n\t\t\t// after creating the tables, write the layout version\n\t\t\tprepStmt = this.connection.prepareStatement(\"INSERT INTO Metadata VALUES(?);\");\n\t\t\tprepStmt.setInt(1, DatabaseConfiguration.LAYOUTVERSION);\n\t\t\tprepStmt.execute();\n\n\t\t\tprepStmt.close();\n\n\t\t} catch (SQLException e) {\n\t\t\tthrow new DatabaseAccessException(Failure.LAYOUT);\n\t\t}\n\t}",
"@Override\n\tpublic void onCreate(SQLiteDatabase database) {\n\t\tcreateTables(database);\n\t}",
"private createSingletonDatabase()\n\t{\n\t\tConnection conn = createDatabase();\n\t\tcreateTable();\n\t\tString filename = \"Summer expereince survey 2016 for oliver.csv\"; \n\t\timportData(conn, filename);\n\t}",
"public void create() {\n\t\t\tdb.execSQL(AGENCYDB_CREATE+\".separete,.import agency.txt agency\");\n\t\t\tdb.execSQL(STOPSDB_CREATE+\".separete,.import stop_times.txt stop_times\");\n\t\t\t\n\t\t\t// Add 2 agencies for testing\n\t\t\t\n\t\t\t\n\t\t\tdb.setVersion(DATABASE_VERSION);\n\t\t}",
"public void addIndex() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"index\",\n null,\n childrenNames());\n }",
"public boolean setIndex(String name){\n\n //array to hold all database names from file\n ArrayList<String> dbNames = new ArrayList<String>();\n\n //create index if it doesn't exist\n File file = new File(\"databases/index.txt\");\n Scanner sc;\n FileWriter fw; \n\n try {\n sc = new Scanner(file); \n //read current database names to array\n String currName; \n if (sc.hasNextLine()){\n while(sc.hasNextLine()){\n currName = sc.nextLine();\n dbNames.add(currName);\n } \n }\n sc.close();\n\n //if database name already in index, exit\n if ( dbNames.contains(name) ){return true;}\n\n } catch(FileNotFoundException ex){}\n \n //add new database name to list of dbs\n dbNames.add(name);\n\n //create / overwrite index file\n try {\n fw = new FileWriter(\"databases/index.txt\");\n } catch (IOException ex2){\n System.out.println(\"ERROR: index not found and could not be created\");\n return false;\n }\n\n //write array of database names to file\n for (String dbName : dbNames){\n try {\n fw.write(dbName);\n fw.write(\"\\n\");\n } catch (IOException ex3) {\n System.out.println(\"ERROR: could not write to index\");\n }\n }\n\n try {\n fw.close();\n } catch (IOException ex4){\n System.out.println(\"ERROR: filewriter could not be closed\");\n return false;\n }\n\n return true;\n }",
"private IndexMetadata createUpdatedIndexMetadata(IndexMetadata indexMetadata) {\n return IndexMetadata.builder(indexMetadata)\n .putMapping(\n createUpdatedIndexMetadata(\n indexMetadata.mapping(),\n indexMetadata.getIndex().getName()\n ))\n .build();\n }",
"public void createDatabase(String databaseName)\n\t{\n\t\tclearConnection();\n\t\ttry\n\t\t{\n\t\t\tStatement createDatabaseStatement = databaseConnection.createStatement();\n\t\t\t\n\t\t\tint result = createDatabaseStatement.executeUpdate(\"CREATE DATABASE IF NOT EXISTS \" + databaseName + \";\");\n\t\t}\n\t\tcatch (SQLException currentSQLError)\n\t\t{\n\t\t\tdisplaySQLErrors(currentSQLError);\n\t\t}\n\t}",
"@Override\n public void onCreate(SQLiteDatabase sqLiteDatabase) {\n StringBuffer ddl = new StringBuffer();\n\n\t ddl.append(\"CREATE TABLE \" + TABLE + \"( \");\n\t ddl.append(\"id INTEGER PRIMARY KEY AUTOINCREMENT, \");\n\t\tddl.append(\"search TEXT, timestamp DATETIME DEFAULT CURRENT_TIMESTAMP); \");\n\n\t ddl.append(\"CREATE UNIQUE INDEX ind_search \");\n\t ddl.append(\"ON \" + TABLE + \"(search)\");\n\n sqLiteDatabase.execSQL(ddl.toString());\n }"
] | [
"0.6876626",
"0.6870287",
"0.67698044",
"0.66386825",
"0.6595814",
"0.652742",
"0.6507595",
"0.6485415",
"0.6478327",
"0.6456215",
"0.6429751",
"0.64169043",
"0.6414307",
"0.64102507",
"0.6403235",
"0.63673127",
"0.6365072",
"0.634749",
"0.63363",
"0.63001895",
"0.6290103",
"0.6237743",
"0.61996466",
"0.6198318",
"0.6159203",
"0.6155732",
"0.6144829",
"0.6131814",
"0.60931534",
"0.6078407",
"0.6073931",
"0.60730404",
"0.60661143",
"0.60635597",
"0.60630274",
"0.5996695",
"0.5968125",
"0.5965119",
"0.5953969",
"0.59519935",
"0.5945691",
"0.5932108",
"0.5931305",
"0.5930841",
"0.59288776",
"0.59114575",
"0.5908719",
"0.5898681",
"0.5898144",
"0.58455956",
"0.5841318",
"0.58363974",
"0.5834385",
"0.58326536",
"0.58312416",
"0.5826435",
"0.5823961",
"0.5821054",
"0.5819899",
"0.5808635",
"0.58020353",
"0.576648",
"0.5758253",
"0.57519764",
"0.57401365",
"0.5723729",
"0.57041705",
"0.5700027",
"0.5693051",
"0.5691106",
"0.56885743",
"0.5685519",
"0.56713444",
"0.5670045",
"0.56694824",
"0.56656337",
"0.56640095",
"0.56562537",
"0.56469023",
"0.5632549",
"0.5615516",
"0.56143415",
"0.56143415",
"0.5613172",
"0.56102765",
"0.5610052",
"0.559264",
"0.5590377",
"0.5580336",
"0.5577053",
"0.55345744",
"0.5533237",
"0.55327696",
"0.5527133",
"0.5518229",
"0.5515734",
"0.5515295",
"0.55057436",
"0.5497581",
"0.549349",
"0.54884046"
] | 0.0 | -1 |
Updates an available index to include new genomes | public IndexDatabase(String index_path, String genomes_path_file, SequenceDatabase genomeDb, GraphDatabaseService graphDb, int previous_num_genomes) {
int cores = Runtime.getRuntime().availableProcessors() / 2 + 1;
int i, k, p, trsc, seq_nodes;
long c_index, p_index, l, new_kmers_num;
IndexPointer null_pointer = new IndexPointer();
Node node;
ResourceIterator<Node> nodes;
Path old_index_folder;
// move current index files to directory old_index
try {
old_index_folder = Files.createDirectory(Paths.get(index_path+"/old_index"));
Files.move(Paths.get(index_path + "/sorted.kmc_pre"), Paths.get(index_path + "/old_index/sorted.kmc_pre"));
Files.move(Paths.get(index_path + "/sorted.kmc_suf"), Paths.get(index_path + "/old_index/sorted.kmc_suf"));
Files.move(Paths.get(index_path + "/pointers.db"), Paths.get(index_path + "/old_index/pointers.db"));
// load old_index
IndexDatabase old_index = new IndexDatabase(index_path + "/old_index");
K = old_index.K;
// make new index for new genomes
System.out.println("Running KMC2... ");
executeCommand("kmc -r -k" + K + " -t" + cores + " -m" + (Runtime.getRuntime().maxMemory() / 1073741824L) +
" -ci1 -fm " + (genomeDb.num_genomes - previous_num_genomes > 1 ? "@" +
genomes_path_file.trim() : genomeDb.genome_names[previous_num_genomes + 1]) +
" " + index_path + "/new_kmers " + index_path);
// merge two indeces
executeCommand("kmc_tools union " + index_path + "/old_index/sorted " + index_path + "/new_kmers " + index_path + "/sorted");
pre_file = new RandomAccessFile(index_path + "/sorted.kmc_pre", "r");
pre_file.seek(pre_file.length() - 8);
header_pos = read_int(pre_file);
pre_file.seek(pre_file.length() - 8 - header_pos);
// read the merged index properties
K = read_int(pre_file);
mode = read_int(pre_file);
ctr_size = read_int(pre_file);
pre_len = read_int(pre_file);
min_count = read_int(pre_file);
max_count = read_int(pre_file);
new_kmers_num = read_long(pre_file);
kmers_num += new_kmers_num;
System.out.println(new_kmers_num + " new kmers generated. ");
// load the prefix file into the memory
pre_file.seek(4);
int q, len = 1 << (2 * pre_len);
prefix_ptr = new long[len];
MappedByteBuffer pre_buff;
for (q = 0, p = 0; p < 8; ++p) {
pre_buff = pre_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + p * len, len);
for (k = 0; k < len / 8; ++k, ++q) {
prefix_ptr[q] = read_long(pre_buff);
//System.out.println(q+" "+prefix_ptr[q]);
}
pre_buff = null;
}
pre_file.close();
// mapping suffix file into the memory
suf_len = K - pre_len;
suf_rec_size = ctr_size + suf_len / 4;
MAX_BYTE_COUNT = MAX_BYTE_COUNT / suf_rec_size * suf_rec_size;
suf_parts_num = (int) ((kmers_num * suf_rec_size) % MAX_BYTE_COUNT == 0 ? (kmers_num * suf_rec_size) / MAX_BYTE_COUNT : (kmers_num * suf_rec_size) / MAX_BYTE_COUNT + 1);
suf_parts_size = new long[suf_parts_num];
suf_file = new RandomAccessFile(index_path + "/sorted.kmc_suf", "r");
suf_buff = new MappedByteBuffer[suf_parts_num];
key = new kmer(K, pre_len, suf_len);
for (k = 0; k < suf_parts_num; ++k) {
suf_parts_size[k] = (int) (k == suf_parts_num - 1 ? (kmers_num * suf_rec_size) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);
suf_buff[k] = suf_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + k * suf_parts_size[0], suf_parts_size[k]);
}
// mapping pointers file into the memory
MAX_BYTE_COUNT = MAX_BYTE_COUNT / POINTER_LENGTH * POINTER_LENGTH;
ptr_parts_num = (int) ((kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT == 0 ? (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT : (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT + 1);
ptr_parts_size = new long[ptr_parts_num];
ptr_file = new RandomAccessFile(index_path + "/pointers.db", "rw");
ptr_buff = new MappedByteBuffer[ptr_parts_num];
for (k = 0; k < ptr_parts_num; ++k) {
ptr_parts_size[k] = (int) (k == ptr_parts_num - 1 ? (kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);
ptr_buff[k] = ptr_file.getChannel().map(FileChannel.MapMode.READ_WRITE, k * ptr_parts_size[0], ptr_parts_size[k]);
}
for (p = 0; p < kmers_num; ++p) {
put_pointer(null_pointer, p);
}
// adjusting available pointers
try (Transaction tx = graphDb.beginTx()) {
nodes = graphDb.findNodes(DynamicLabel.label("node"));
seq_nodes = (int) graphDb.findNodes(DynamicLabel.label("pangenome")).next().getProperty("num_nodes");
tx.success();
}
IndexPointer ptr = new IndexPointer();
System.out.println("Updating kmer index... ");
for (i = 0; nodes.hasNext();) {
try (Transaction tx = graphDb.beginTx()) {
for (trsc = 0; trsc < 10000 && nodes.hasNext(); ++trsc, ++i) {
node = nodes.next();
l = (long) node.getProperty("first_kmer");
p_index = find(old_index.get_kmer(l));
old_index.get_pointer(ptr, l);
put_pointer(ptr, p_index);
node.setProperty("first_kmer", p_index);
for (l = old_index.get_next_index(l); l != -1L; l = old_index.get_next_index(l)) {
c_index = find(old_index.get_kmer(l));
old_index.get_pointer(ptr, l);
put_pointer(ptr, c_index);
put_next_index(c_index, p_index);
p_index = c_index;
}
put_next_index(-1L, p_index);
node.setProperty("last_kmer", p_index);
if (i % (seq_nodes / 100 + 1) == 0) {
System.out.print((long) i * 100 / seq_nodes + 1 + "% \r");
}
}
tx.success();
}
}
old_index.close();
Files.delete(Paths.get(index_path + "/old_index/sorted.kmc_suf"));
Files.delete(Paths.get(index_path + "/new_kmers.kmc_pre"));
Files.delete(Paths.get(index_path + "/new_kmers.kmc_suf"));
Files.delete(Paths.get(index_path + "/old_index/pointers.db"));
Files.delete(Paths.get(index_path + "/old_index/sorted.kmc_pre"));
//Files.delete(old_index_folder);
} catch (IOException e) {
System.out.println(e.getMessage() + "\nFailed to make index!");
System.exit(1);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void updateIndex();",
"private void updateIndex() throws IOException {\n // maintain the document store (corpus) - if there is one\n if (currentMemoryIndex.containsPart(\"corpus\")) {\n // get all corpora + shove into document store\n ArrayList<DocumentReader> readers = new ArrayList<>();\n readers.add((DocumentReader) currentMemoryIndex.getIndexPart(\"corpus\"));\n for (String path : geometricParts.getAllShards().getBinPaths()) {\n String corpus = path + File.separator + \"corpus\";\n readers.add(new CorpusReader(corpus));\n }\n }\n // finally write new checkpointing data (checkpoints the disk indexes)\n Parameters checkpoint = createCheckpoint();\n this.checkpointer.saveCheckpoint(checkpoint);\n }",
"@Override\n public void updateItemSearchIndex() {\n try {\n // all item IDs that don't have a search index yet\n int[] allMissingIds = mDatabaseAccess.itemsDAO().selectMissingSearchIndexIds();\n // Selects the item to the id, extract all parts of the item name to create the\n // search index (all ItemSearchEntity's) and insert them into the database\n for (int missingId : allMissingIds) {\n try {\n ItemEntity item = mDatabaseAccess.itemsDAO().selectItem(missingId);\n List<ItemSearchEntity> searchEntities = createItemSearchIndex(item);\n mDatabaseAccess.itemsDAO().insertItemSearchParts(searchEntities);\n } catch (Exception ex) {\n Log.e(TAG, \"An error occurred trying to create the search index to the id\" +\n missingId, ex);\n }\n }\n } catch (Exception ex) {\n Log.e(TAG, \"A general failure has occurred while trying to load and process all \" +\n \"item IDs to generate a search index\", ex);\n }\n }",
"public void updateIndex() {\n int i = this.index;\n if (i == -1 || i > HashBiMap.this.size || !Objects.equal(HashBiMap.this.keys[this.index], this.key)) {\n this.index = HashBiMap.this.findEntryByKey(this.key);\n }\n }",
"public void forceUpdateSearchIndexes() throws InterruptedException {\n\t getFullTextEntityManager().createIndexer().startAndWait();\n\t}",
"public void onIndexUpdate();",
"public void refresh() {\n getIndexOperations().refresh();\n }",
"public interface IndexBuilder {\n\n /**\n * Rebuilds the index only when the existing index is not populated.\n */\n void rebuildIfNecessary();\n\n}",
"protected synchronized void updateIndex(DirectoryManagerIndex newIndex) {\n \n // Sanity check.\n if ((newIndex == null) && (index == null))\n throw new DirectoryManagerConfigurationException(\"Index not initialized but file \" + configuration.getIndexFilename() + \" still marked as outdated\");\n \n // Update existing index.\n index = newIndex;\n \n }",
"private Reindex() {}",
"private Reindex() {}",
"private void flushCurrentIndexBlock() throws IOException {\n if (currentMemoryIndex.documentsInIndex() < 1) {\n return;\n }\n\n logger.info(\"Flushing current memory Index. id = \" + indexBlockCount);\n\n final MemoryIndex flushingMemoryIndex = currentMemoryIndex;\n final File shardFolder = getNextIndexShardFolder(1);\n\n try {\n // reset the current index\n // - this makes the flush operation thread safe while continuing to add new documents.\n resetCurrentMemoryIndex();\n } catch (Exception ex) {\n throw new IOException(ex);\n }\n\n try {\n // first flush the index to disk\n FlushToDisk.flushMemoryIndex(flushingMemoryIndex, shardFolder.getAbsolutePath(), false);\n\n // indicate that the flushing part of this thread is done\n synchronized (geometricParts) {\n // add flushed index to the set of bins -- needs to be a synconeous action\n geometricParts.add(0, shardFolder.getAbsolutePath());\n updateIndex();\n flushingMemoryIndex.close();\n }\n\n } catch (IOException e) {\n logger.severe(e.toString());\n }\n }",
"public void UpdatePushIndex() {\n\t\tsetorgetState(true,false);\n\t}",
"private void syncIndex(FundamentalData fd) throws Exception {\n\n List<MarketIndex> indexes = marketIndexService.findBySymbol(fd.getSymbol());\n if(indexes.size()>1){\n throw new Exception(\"Multiple instances (\"+indexes.size()+\") of symbol \"+fd.getSymbol()+\" present in the database.\");\n }\n\n MarketIndex index;\n if(indexes.size()==0){ // does not exist in db\n index=new MarketIndex();\n index.setSymbol(fd.getSymbol());\n index.setName(fd.getName());\n index.setCategory(fd.getType().getCode());\n\n }else{ // index exists in db\n index = indexes.get(0);\n if(fd.getName()!=null){\n index.setName(fd.getName());\n }\n if(fd.getType()!=null){\n index.setCategory(fd.getType().getCode());\n }\n\n }\n\n updateIcon(index);\n marketIndexService.update(index);\n\n }",
"public void setRegistered(Index index) {\n\t\tfor (Registration reg : registrations) {\n\t\t\tif (reg.getIndex() == index) {\n\t\t\t\treg.setRegistered();\n\t\t\t\tau += index.getCourse().getAu();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"@ManagedOperation(description = \"Starts rebuilding the index\", displayName = \"Rebuild index\")\n void start();",
"public void updateHashedVersions() {\n for (IndexEntry indexEntry : ClientUtils.getIndexEntries(indexWave)) {\n ClientWaveView wave = backend.getWave(indexEntry.getWaveId());\n if ((wave != null) && (ClientUtils.getConversationRoot(wave) != null)) {\n lastSeenVersions.put(wave, wave.getWaveletVersion(ClientUtils.getConversationRootId(wave)));\n }\n }\n }",
"@Override\n @Secured(SecurityRoles.ADMINISTRATOR)\n public void reindex() {\n revisionDao.deleteAll();\n // OK, launches a new indexation\n indexFromLatest();\n }",
"@Test\n public void testIndexMaintenanceOnPutAll() throws Exception {\n IndexManager.TEST_RANGEINDEX_ONLY = true;\n Cache cache = CacheUtils.getCache();\n qs = cache.getQueryService();\n region = CacheUtils.createRegion(\"portfolio1\", null);\n region.put(\"1\", new Portfolio(1));\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"posvals.secId\",\n SEPARATOR + \"portfolio1 pf, pf.positions.values posvals \");\n Map data = new HashMap();\n for (int i = 1; i < 11; ++i) {\n data.put(\"\" + i, new Portfolio(i + 2));\n }\n\n region.putAll(data);\n }",
"public void addIndex() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"index\",\n null,\n childrenNames());\n }",
"private void close() throws CorruptIndexException, IOException {\n\n\t\tidxWriter.forceMerge(1);\n\t\tidxWriter.commit();\n\t\tidxWriter.close();\n\t}",
"interface CoordinateIndexUpdater {\n void updateIndex();\n }",
"void createIndex(){\n int index=0;\n for(int i=0;i<ancogs.size();i++)\n if(!cogToIndex.containsKey(ancogs.get(i).getValue2()))\n cogToIndex.put(ancogs.get(i).getValue2(), index++);\n}",
"public abstract void updateCurGene(int mid);",
"@Override\n public void reindexImpl()\n {\n List<StoreRef> storeRefs = nodeService.getStores();\n int count = 0;\n for (StoreRef storeRef : storeRefs)\n {\n // prompt the FTS reindexing\n if (!ftsIndexerCalled)\n {\n ftsIndexer.requiresIndex(storeRef);\n }\n // reindex missing content\n count += reindexMissingContent(storeRef);\n // check if we have to break out\n if (isShuttingDown())\n {\n break;\n }\n }\n \n // The FTS indexer only needs to be prompted once\n ftsIndexerCalled = true;\n\n // done\n if (logger.isDebugEnabled())\n {\n logger.debug(\"Missing content indexing touched \" + count + \" content nodes\");\n }\n }",
"@Override\n public synchronized void buildIndex(){\n for(SlotData data : slotDataList){\n data.prepareReport();\n }\n }",
"void update(String selectedGene);",
"boolean isNewIndex();",
"public void finishedDirectIndexBuild()\n\t{\n\t\tif(logger.isInfoEnabled()){\n\t\t\tlogger.info(\"flushing utf block lexicon to disk after the direct index completed\");\n\t\t}\n\t\t//only write a temporary lexicon if there are any items in it\n\t\tif (TempLex.getNumberOfNodes() > 0)\n\t\t\twriteTemporaryLexicon();\n\n\t\t//merges the temporary lexicons\n\t\tif (tempLexFiles.size() > 0)\n\t\t{\n\t\t\ttry{\n\t\t\t\tmerge(tempLexFiles);\n\t\n\t\t\t\t//creates the offsets file\n\t\t\t\tfinal String lexiconFilename = \n\t\t\t\t\tindexPath + ApplicationSetup.FILE_SEPARATOR + \n\t\t\t\t\tindexPrefix + ApplicationSetup.LEXICONSUFFIX;\n\t\t\t\tLexiconInputStream lis = getLexInputStream(lexiconFilename);\n\t\t\t\tcreateLexiconIndex(\n\t\t\t\t\tlis,\n\t\t\t\t\tlis.numberOfEntries(),\n\t\t\t\t\t/* after inverted index is built, the lexicon will be transformed into a\n\t\t\t\t\t * normal lexicon, without block frequency */\n\t\t\t\t\tUTFLexicon.lexiconEntryLength\n\t\t\t\t\t); \n\t\t\t\tTermCount = lis.numberOfEntries();\n\t\t\t\tif (index != null)\n\t\t\t\t{\n\t\t\t\t\tindex.addIndexStructure(\"lexicon\", \"uk.ac.gla.terrier.structures.UTFBlockLexicon\");\n\t\t\t\t\tindex.addIndexStructureInputStream(\"lexicon\", \"uk.ac.gla.terrier.structures.UTFBlockLexiconInputStream\");\n\t\t\t\t\tindex.setIndexProperty(\"num.Terms\", \"\"+lis.numberOfEntries());\n\t\t\t\t\tindex.setIndexProperty(\"num.Pointers\", \"\"+lis.getNumberOfPointersRead());\n\t\t\t\t}\n\t\t\t} catch(IOException ioe){\n\t\t\t\tlogger.error(\"Indexing failed to write a lexicon index file to disk\", ioe);\n\t\t\t}\t\n\t\t}\n\t\telse\n\t\t\tlogger.warn(\"No temporary lexicons to merge, skipping\");\n\t\t\n\t}",
"private void reIndex()\n {\n for(int i = 0; i < NodeList.size(); i++)\n NodeList.get(i).setID(i);\n ID = NodeList.size();\n }",
"@Override\n public void indexPersistable() {\n searchIndexService.indexAllResourcesInCollectionSubTreeAsync(getPersistable());\n }",
"public static void updateIndex(final List<Entity> entity) {\n }",
"@Override\r\n\tpublic void updateAll() throws IOException {\n\t}",
"@Override\n protected boolean preserveIndicesUponCompletion() {\n return true;\n }",
"private void update()\r\n\t{\r\n\t\tfor (Agent agent : agents)\r\n\t\t{\r\n\t\t\tint i = agent.getIndex();\r\n\t\t\tp.setEntry(i, agent.getP());\r\n\t\t\tq.setEntry(i, agent.getQ());\r\n\t\t\tvabs.setEntry(i, agent.getVabs());\r\n\t\t\tvarg.setEntry(i, agent.getVarg());\r\n\t\t\tlambdaP.setEntry(i, agent.getLambdaP());\r\n\t\t\tlambdaQ.setEntry(i, agent.getLambdaQ());\r\n\t\t}\r\n\t}",
"@Deprecated\r\n\tpublic synchronized void otimizarIndice() throws Exception {\r\n\t\tIndexWriter indexWriter = getWriterPadrao(false);\r\n\t\tindexWriter.forceMerge(50);\r\n\t\tindexWriter.close();\r\n\t}",
"public static void update() {\n if (!isEnd()) index++;\n state++;\n return;\n }",
"void setIndexed(boolean indexed);",
"private void indexItem(IndexDocument indexDoc) {\n if(bDebug) System.out.println(\"\\n*** document to index - \" + indexDoc);\n Indexer indexer=null;\n try {\n indexer=new Indexer(PetstoreConstants.PETSTORE_INDEX_DIRECTORY, false);\n PetstoreUtil.getLogger().log(Level.FINE, \"Adding document to index: \" + indexDoc.toString());\n indexer.addDocument(indexDoc);\n } catch (Exception e) {\n PetstoreUtil.getLogger().log(Level.WARNING, \"index.exception\", e);\n e.printStackTrace();\n } finally {\n try {\n // must close file or will not be able to reindex\n if(indexer != null) {\n indexer.close();\n }\n } catch (Exception ee) {\n ee.printStackTrace();\n }\n }\n }",
"@SuppressWarnings(\"unused\")\n public void buildIndex() throws IOException {\n indexWriter = getIndexWriter(indexDir);\n ArrayList <JSONObject> jsonArrayList = parseJSONFiles(JSONdir);\n indexTweets(jsonArrayList, indexWriter);\n indexWriter.close();\n }",
"void indexReset();",
"@RequestMapping(value=\"/rebuilditemindex.htm\")\n\t@ResponseBody\n\tpublic String reBuildIndex(){\n\t\ttry{\n\t\t\tthis.itemService.reBuildIndex();\n\t\t\treturn \"success\";\n\t\t}\n\t\tcatch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn \"exception\";\n\t\t}\n\t}",
"@Override\n\tpublic void build(Index index) {\n\t\tthis.indexdir = index.getPath();\n\t\tLuceneIndex luceneIndex = (LuceneIndex) index;\n\t\tthis.indexSearcher = new IndexSearcher(luceneIndex.getReader());\n\n\t}",
"private void addIndexRegions(RegionIds regionIds) {\n\t\tIterator<Integer> iter = regionIds.ids.iterator();\n\t\tint start = regionIds.start;\n\t\tint stop = regionIds.stop;\n\t\twhile (iter.hasNext()) {\n\t\t\tIndexRegion ir = null; //new IndexRegion(start, stop, iter.next());\n//IO.pl(\"\\t\\t\\tSaving \"+ir);\n\t\t\tnumRegionsLoaded++;\n\t\t\t//add start and stop irs\n\t\t\tif (workingIndex[start] == null) workingIndex[start] = new ArrayList<IndexRegion>();\n\t\t\tworkingIndex[start].add(ir);\n\t\t\tif (workingIndex[stop] == null) workingIndex[stop] = new ArrayList<IndexRegion>();\n\t\t\tworkingIndex[stop].add(ir);\n\t\t}\n\t}",
"@Override\n public void setupIndex() {\n List lst = DBClient.getList(\"SELECT a FROM AppMenu a WHERE a.moduleName='MyBranchMemberExt'\");\n if (lst!=null && !lst.isEmpty()) {\n return;\n }\n AppMenu.createAppMenuObj(\"MyBranchMemberExt\", \"Main\", \"Branch Member\", 110).save();\n AppMenu.createAppMenuObj(\"MyCenterMemberExt\", \"Main\", \"Center Member\", 120).save();\n AppMenu.createAppMenuObj(\"SearchAllMembersOnlyExt\", \"Main\", \"Search Member\", 130).save();\n AppMenu.createAppMenuObj(\"ReferenceForm\", \"Reference\", \"Reference\", 200).save();\n runUniqueIndex(8, \"firstName\", \"lastName\");\n }",
"public boolean setIndex(String name){\n\n //array to hold all database names from file\n ArrayList<String> dbNames = new ArrayList<String>();\n\n //create index if it doesn't exist\n File file = new File(\"databases/index.txt\");\n Scanner sc;\n FileWriter fw; \n\n try {\n sc = new Scanner(file); \n //read current database names to array\n String currName; \n if (sc.hasNextLine()){\n while(sc.hasNextLine()){\n currName = sc.nextLine();\n dbNames.add(currName);\n } \n }\n sc.close();\n\n //if database name already in index, exit\n if ( dbNames.contains(name) ){return true;}\n\n } catch(FileNotFoundException ex){}\n \n //add new database name to list of dbs\n dbNames.add(name);\n\n //create / overwrite index file\n try {\n fw = new FileWriter(\"databases/index.txt\");\n } catch (IOException ex2){\n System.out.println(\"ERROR: index not found and could not be created\");\n return false;\n }\n\n //write array of database names to file\n for (String dbName : dbNames){\n try {\n fw.write(dbName);\n fw.write(\"\\n\");\n } catch (IOException ex3) {\n System.out.println(\"ERROR: could not write to index\");\n }\n }\n\n try {\n fw.close();\n } catch (IOException ex4){\n System.out.println(\"ERROR: filewriter could not be closed\");\n return false;\n }\n\n return true;\n }",
"public void optimize() {\n\t\ttry {\n\t\t\t_indexWriter.forceMerge(1);\n\t\t\tlog.debug(\"Lucene index merged into one segment\");\n\t\t} catch (IOException ioEx) {\n\t\t\tlog.error(\"Error optimizing lucene index {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t ioEx);\n\t\t}\n\t}",
"void initiateIndexing(HarvestResultDTO harvestResult) throws DigitalAssetStoreException;",
"public void flush() {\n synchronized (getLock()) {\n sIndexWritersCache.flush(this);\n sIndexReadersCache.removeIndexReader(this);\n }\n }",
"public interface Index {\n\t\n\tvoid index(AddOnInfoAndVersions infoAndVersions) throws Exception;\n\t\n\tCollection<AddOnInfoSummary> search(AddOnType type, String query) throws Exception;\n\t\n\tCollection<AddOnInfoAndVersions> getAllByType(AddOnType type) throws Exception;\n\t\n\tCollection<AddOnInfoAndVersions> getByTag(String tag) throws Exception;\n\t\n\tAddOnInfoAndVersions getByUid(String uid) throws Exception;\n}",
"public void createIndex() throws IOException {\n\t\tindexWriter.commit();\n\t\ttaxoWriter.commit();\n\n\t\t// categories\n\t\tfor (Article.Facets f : Article.Facets.values()) {\n\t\t\ttaxoWriter.addCategory(new CategoryPath(f.toString()));\n\t\t}\n\t\ttaxoWriter.commit();\n\n\t\tfinal Iterable<Article> articles = articleRepository.findAll();\n\t\tint c = 0;\n\t\tfor (Article article : articles) {\n\t\t\taddArticle(indexWriter, taxoWriter, article);\n\t\t\tc++;\n\t\t}\n\t\t// commit\n\t\ttaxoWriter.commit();\n\t\tindexWriter.commit();\n\n\t\ttaxoWriter.close();\n\t\tindexWriter.close();\n\n\t\ttaxoDirectory.close();\n\t\tindexDirectory.close();\n\t\tLOGGER.debug(\"{} articles indexed\", c);\n\t}",
"@Override\n public void close()\n {\n notifyLegacyIndexOperationQueue();\n\n }",
"public void index(List<Entity> entities) {\n\t\t\n\t}",
"void addIndexForRepository(long repositoryId);",
"private void updateIndexMap(String file) {\n\t\ttry (Scanner s = new Scanner(new File(file))) {\n\t\t\twhile (s.hasNext()) {\n\t\t\t\tString word = TextParserUtil.cleanWord(s.next());\n\t\t\t\tString partition = word.substring(0, 1);\n\t\t\t\tif (indexedDir.get(partition) == null) {\n\t\t\t\t\tinsertPartitionEntry(file, word, partition);\n\t\t\t\t} else if (indexedDir.get(partition).get(word) == null) {\n\t\t\t\t\tinsertWordEntry(file, word, partition);\n\t\t\t\t} else if (indexedDir.get(partition).get(word) != null) {\n\t\t\t\t\tupdateFileList(file, word, partition);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}",
"public void updateCurrentSongIndex(int index) {\n\t\tthis.currentSongIndex = index;\n\t}",
"public void addIndex(final PgIndex index) {\n indexes.add(index);\n }",
"public void update(GL2 gl){\r\n\t\t// Not implemented, chunks are immutable\r\n\t}",
"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 interface IndexRegistry\n{\n void registerIndex(Index index);\n void unregisterIndex(Index index);\n\n Index getIndex(IndexMetadata indexMetadata);\n Collection<Index> listIndexes();\n}",
"public void addIndex(){\n\t\tdbCol=mdb.getCollection(\"genericCollection\");\n\t\tstart=Calendar.getInstance().getTimeInMillis();\n\t\tdbCol.ensureIndex(new BasicDBObject(\"RandomGeo\", \"2d\"));\n\t\tstop = Calendar.getInstance().getTimeInMillis() - start;\n\t\tSystem.out.println(\"Mongo Index Timer \"+Long.toString(stop));\n\t}",
"public generateIndex() {\n\n\t\tthis.analyzer = \"StandardAnalyzer\";\n\t}",
"public void close() {\n\t\t\n\t\ttry {\n\t\t\tindexWriter.optimize();\n\t\t\t\n\t\t\tindexWriter.close();\n\t\t\t\n\t\t\tIndexSearcher = new IndexSearcher(idx);\n\t\t\t\n\t\t} catch (CorruptIndexException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t}",
"@Test\n public void testIndexMaintenanceWithIndexOnMethodAsList() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID\",\n SEPARATOR + \"portfolio.asList() 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 }",
"String createIndex() {\n\t\tboolean res = indexExists();\n\t\t@SuppressWarnings(\"unused\")\n\t\tint resCode;\n\t\tif (!res) {\n\t\t\tresCode = doHttpOperation(esIndexUrl, HTTP_PUT, null);\n\t\t}\n\t\treturn lastResponse;\n\t}",
"public static Result changeIndice(String newIndice) {\n\n\t\ttry {\n\t\t\tFunction<String, Boolean> chind = ( (newInd) -> (ElasticReindexer.reindexOnANewIndice(Elastic.old_index, newInd)) );\n\t\t\tParallelAPICall.createPromise(chind, newIndice);\n\t\t} catch(Exception e) {\n\t\t\tlog.error(e.getMessage(), e);\n\t\t\treturn internalServerError(e.getMessage());\n\t\t}\n\n\t\treturn ok();\n\t}",
"public static void refreshIndex(String appid) throws IOException {\n\t\tif (!StringUtils.isBlank(appid)) {\n//\t\t\tif (asyncEnabled()) {\n//\t\t\t\tbulkProcessor(getRESTClient()).flush();\n//\t\t\t}\n\t\t\tgetRESTClient().indices().refresh(b -> b.index(getIndexName(appid)));\n\t\t}\n\t}",
"void index(IDocument document, IIndexerOutput output) throws java.io.IOException;",
"@Override\n public void close() throws IOException {\n flushCurrentIndexBlock();\n\n // logger.info(\"Performing final merge\");\n // try {\n //Bin finalMergeBin = geometricParts.getAllShards();\n //doMerge(finalMergeBin, getNextIndexShardFolder(finalMergeBin.size + 1));\n // check point is updated by the merge op.\n\n // } catch (IOException ex) {\n // Logger.getLogger(GeometricRetrieval.class.getName()).log(Level.SEVERE, null, ex);\n //}\n\n }",
"public void indexMap(LWMap map) {\n vueComponentMap.clear();\n removeAll();\n indexAdd(map);\n }",
"InstAssignIndex createInstAssignIndex();",
"public static void update(String indexFileName, String listOfDoc) throws IOException{\n\t\tHashMap<String, String> sCurrentHashMap = null;\n\t\tboolean hasFile = true;\n\t\t\n\t\tif(globalHash.containsKey(indexFileName)){\n\t\t\t//ถ้ามีใน global แล้ว เอาออกมาแล้วเอามารวมกับที่เพิ่งอ่านไฟล์ได้เลย\n\t\t\tsCurrentHashMap = globalHash.get(indexFileName);\n\t\t\n\t\t}else{ \n\t\t\t//if no hashmap in globalHash, then check if there's this fileName.txt in directory\n\t\t\t\n\t\t\tif(!new File(indexFileName+\".txt\").isFile()){\n\t\t\t\t\tSystem.out.println(\"ERROR: The inverted file is not found.\");\n\t\t\t\t\thasFile = false;\n\t\t\t}else{\n\t \t sCurrentHashMap = genHashMapFromInvertedIndexFile(indexFileName);\n\t\t\t \n\t\t\t}\n\t\t}\n\t\t\n\t\tif(hasFile){\n\t\t\tArrayList<Term> newTermList = extractDoc(listOfDoc);\n\t\t\t//if the new term list has value (not doc not found)\n\t\t\tif(newTermList.size()>0){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tsCurrentHashMap = addListToHashMap(sCurrentHashMap, newTermList);\n\t\t\t\t\n\t\t\t\t/*เพิ่มเงื่อนไขกรณี ลบคำออกจากไฟล์ \n\t\t\t\t * 1.ทำ list เป็น hashMap อีกอันไว้เซิชไวไว\n\t\t\t\t * loop amount of doc\n\t\t\t\t * 2.ไล่ iterative ของ hashMap ว่ามี value อันไหน contain ชื่อไฟล์บ้าง ถ้าcontain ให้เช็คกลับว่า key นั้น มีในแฮชอีกอันหรือเปล่า\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t/* // Convert new word (from file) list to HashMap\n\t\t\t\tHashMap<String, String> newWordHashMap = new HashMap<String, String>();\n\t\t\t\tfor(Term i: newTermList){\n\t\t\t\t\tnewWordHashMap.put(i.getTerm(), i.getDocNumber()+\"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tIterator it = sCurrentHashMap.entrySet().iterator();\n\t\t\t\twhile(it.hasNext()){\n\t\t\t\t\tHashMap.Entry<String, String> entry = (HashMap.Entry<String, String>) it.next();\n\t\t\t\t\t//if its value contains the doc number, then check if its key is in the newTermHash or note\n\t\t\t\t\t// if not --> this term was removed --> remove this key out from sCurrentHashMap\n\t\t\t\t\tif(entry.getValue().contains(s)) {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\tglobalHash.put(indexFileName, sCurrentHashMap);\n\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"public void updateImageForIndex(int index) {\n\t\t//Nothing to do\n\t}",
"@Override\n public void postInserts() \n {\n for(IndexObject i: myIndex.values())\n {\n i.tfidf(documentData);\n }\n }",
"public void commit () throws IOException {\n log.info(\"Internal committing index ... \");\n this.writer().commit();\n commitCounter = 0;\n this.closeReader();\n }",
"void index() {\n for (Binding<?> binding : bindings.values()) {\n index(binding);\n }\n }",
"public void testIndexCosts() {\n this.classHandler.applyIndexes();\n }",
"private void grow(int bucketIndex) {\n StopWatch.start(false);\n //String procRID = ProvenanceRecorder.documentProcedure(ProvUtils.getStoreOfCurrentThread(), this, \"grow\", \"label\", true, new String[]{\"bucketIndex\"}, new Object[]{bucketIndex}, true);\n // double the bucket size\n int[] newBucket = new int[table[bucketIndex].length * 2];\n\n int index = 0;\n for (; index < table[bucketIndex].length; index++) {\n newBucket[index] = table[bucketIndex][index];\n }\n for (; index < newBucket.length; index++) {\n newBucket[index] = NULL_ELEMENT;\n }\n table[bucketIndex] = newBucket;\n //ProvenanceRecorder.endProcedureDocumentation(ProvUtils.getStoreOfCurrentThread(), this, \"grow\", procRID, null, null, null, null, true, false, false, true);\n StopWatch.stop(false);\n }",
"private void dataFlushed(Index index) throws IOException, InterruptedException {\n Collection<String> names = new LinkedList<String>();\n // check using collected usages\n\n index.query(\n names,\n DocumentUtil.binaryNameConvertor(),\n DocumentUtil.declaredTypesFieldSelector(false, false),\n null,\n QueryUtil.createUsagesQuery(\"java.util.List\", EnumSet.of(UsageType.TYPE_REFERENCE), Occur.SHOULD));\n names.retainAll(\n Arrays.asList(\n \"usages.ClassAnnotations\",\n \"usages.ClassArrayAnnotations\",\n \"usages.MethodAnnotations\",\n \"usages.MethodArrayAnnotations\",\n \"usages.FieldAnnotations\",\n \"usages.FieldArrayAnnotations\")\n );\n assertTrue(names.isEmpty());\n\n flushCount++;\n }",
"public abstract void updateLocations();",
"public interface BoostingIndexer {\r\n\t/**\r\n\t * Add a new {@link Document} to the Index or update an existing one.<br> \r\n\t * When adding a document, its dynamic boosts values must be set. Specifying the values is accomplished by\r\n\t * passing the dynamicBoosts parameter with a Map from the boost index (zero based) to the boost value (a <code>double</code>).\r\n\t * In this map, no index can be larger than the number of available boosts the {@link IndexEngine}'s {@link Scorer} has, minus one (since it is zero based).\r\n\t * The value for any available boost index not specified in the map is defaulted to zero. \r\n\t * \r\n\t * @param docId external (customer) identifier of the document to add\r\n\t * @param document the {@link Document} to add\r\n\t * @param timestampBoost a <code>float</code> representing the time of the document (the younger the document, the larger the boost should be)\r\n\t * @param dynamicBoosts a Map from the boost index (zero based) to the boost value (a <code>double</code>).\r\n\t * @throws {@link IllegalArgumentException} if an invalid index is passed for a boost \r\n\t */\r\n\tpublic void add(String docId, Document document, int timestampBoost, Map<Integer, Double> dynamicBoosts);\r\n\r\n\t/**\r\n\t * Remove a document from the index.\r\n\t * \r\n\t * @param docId external (customer) identifier of the document to remove\r\n\t */\r\n\tpublic void del(String docId);\r\n\t\r\n\t/**\r\n\t * Update the special boost for the timestamp\r\n\t * \r\n\t * @param docId external (customer) identifier of the document\r\n\t * @param timestampBoost a <code>float</code> representing the time of the document (the younger the document, the larger the boost should be)\r\n\t */\r\n\tpublic void updateTimestamp(String docId, int timestampBoost);\r\n\t\r\n\t/**\r\n\t * Update one or more of the dynamic boosts values.\r\n\t * \r\n\t * @param docId external (customer) identifier of the document\r\n\t * @param updatedBoosts a Map from the boost index (zero based) to the boost value (a <code>double</code>). No index can be larger than the available boosts the {@link IndexEngine}'s {@link Scorer} has, minus one (since it is zero based)\r\n\t * @throws {@link IllegalArgumentException} if an invalid index is passed for a boost \r\n\t */\r\n\tpublic void updateBoosts(String docId, Map<Integer, Double> updatedBoosts);\r\n\r\n public void updateCategories(String docId, Map<String, String> categories);\r\n\t/**\r\n\t * Promote a document to be the first result for a specific query.\r\n\t * \r\n\t * @param docId external (customer) identifier of the document\r\n\t * @param query the exact query the document must be promoted to the first result for\r\n\t */\r\n public void promoteResult(String docId, String query);\r\n\r\n /**\r\n * Dumps the current state to disk.\r\n */\r\n public void dump() throws IOException;\r\n\r\n public void addScoreFunction(int functionIndex, String definition) throws Exception;\r\n\r\n public void removeScoreFunction(int functionIndex);\r\n\r\n public Map<Integer,String> listScoreFunctions();\r\n \r\n public Map<String, String> getStats();\r\n\r\n}",
"protected abstract void updateInfos();",
"public void index(final Document doc) {\t\n\t\ttry {\n\t\t\t_reopenToken = _trackingIndexWriter.addDocument(doc);\n\t\t\tlog.debug(\"document indexed in lucene\");\n\t\t} catch(IOException ioEx) {\n\t\t\tlog.error(\"Error while in Lucene index operation: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t \t\t ioEx);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\t_indexWriter.commit();\n\t\t\t} catch (IOException ioEx) {\n\t\t\t\tlog.error(\"Error while commiting changes to Lucene index: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t \t\t\t\t\t ioEx);\n\t\t\t}\n\t\t}\n\t}",
"public synchronized int resize(int newBytesPerId, int newBytesPerType, int newBytesPerPath)\n throws IOException {\n if (this.bytesPerId > newBytesPerId && this.entries > 0)\n throw new IllegalStateException(\"Cannot reduce the number of bytes per id when there are entries in the index\");\n if (this.bytesPerType > newBytesPerType && this.entries > 0)\n throw new IllegalStateException(\"Cannot reduce the number of bytes per type when there are entries in the index\");\n if (this.bytesPerPath > newBytesPerPath && this.entries > 0)\n throw new IllegalStateException(\"Cannot reduce the number of bytes per path when there are entries in the index\");\n if (this.isReadOnly)\n throw new IllegalStateException(\"This index is readonly\");\n \n int newBytesPerSlot = newBytesPerId + newBytesPerType + newBytesPerPath;\n \n logger.info(\"Resizing uri index to {} ({}) slots and {} ({}) bytes per entry\", new Object[] { slots, this.slots, newBytesPerSlot, this.bytesPerSlot });\n \n String fileName = FilenameUtils.getBaseName(idxFile.getName());\n String fileExtension = FilenameUtils.getExtension(idxFile.getName());\n String idxFilenameNew = fileName + \"_resized.\" + fileExtension;\n File idxNewFile = new File(idxFile.getParentFile(), idxFilenameNew);\n long time = System.currentTimeMillis();\n \n logger.debug(\"Creating resized index at \" + idxNewFile);\n \n // Create the new index\n RandomAccessFile idxNew = null;\n try {\n idxNew = new RandomAccessFile(idxNewFile, \"rwd\");\n } catch (FileNotFoundException e) {\n throw new IllegalArgumentException(\"Index file \" + idxNewFile + \" cannot be created: \" + e.getMessage(), e);\n }\n \n // Write header\n idxNew.seek(IDX_START_OF_HEADER);\n idxNew.writeInt(indexVersion);\n idxNew.writeInt(newBytesPerId);\n idxNew.writeInt(newBytesPerType);\n idxNew.writeInt(newBytesPerPath);\n idxNew.writeLong(slots);\n idxNew.writeLong(entries);\n \n // Position to read the whole content\n idx.seek(IDX_START_OF_CONTENT);\n \n // Write entries\n for (int i = 0; i < slots; i++) {\n byte[] bytes = new byte[newBytesPerSlot];\n if (i < this.slots) {\n idx.read(bytes, 0, this.bytesPerSlot);\n idxNew.write(bytes);\n } else {\n // Write an empty line\n idxNew.write(bytes);\n }\n }\n \n logger.debug(\"Removing old index at \" + idxFile);\n \n // Close and delete the old index\n idx.close();\n if (!idxFile.delete())\n throw new IOException(\"Unable to delete old index file \" + idxFile);\n \n // Close the new index, and move it into the old index' place\n logger.debug(\"Moving resized index into regular position at \" + idxFile);\n idxNew.close();\n if (!idxNewFile.renameTo(idxFile))\n throw new IOException(\"Unable to move new index file to \" + idxFile);\n \n try {\n idx = new RandomAccessFile(idxFile, \"rwd\");\n } catch (FileNotFoundException e) {\n throw new IllegalArgumentException(\"Index file \" + idxNewFile + \" cannot be created: \" + e.getMessage(), e);\n }\n \n this.bytesPerSlot = newBytesPerSlot;\n this.bytesPerId = newBytesPerId;\n this.bytesPerType = newBytesPerType;\n this.bytesPerPath = newBytesPerPath;\n \n time = System.currentTimeMillis() - time;\n logger.info(\"Uri index resized in {}\", ConfigurationUtils.toHumanReadableDuration(time));\n return newBytesPerSlot;\n }",
"public void openIndex(String indexPath) throws IOException {\n\n }",
"public indexing() {\n initComponents();\n }",
"public void indexAssets() {\n\t\tString json = null;\n\t\tString assetUrl = minecraftVersion.getAssetIndex().getUrl().toString();\n\t\ttry {\n\t\t\tjson = JsonUtil.loadJSON(assetUrl);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tassetsList = (AssetIndex) JsonUtil.getGson().fromJson(json, AssetIndex.class);\n\t\t}\n\t}",
"private IndexerModelEvent refreshIndex(final String indexName) throws InterruptedException, KeeperException {\n try {\n IndexDefinitionImpl index = loadIndex(indexName);\n index.makeImmutable();\n final boolean isNew = !indexes.containsKey(indexName);\n indexes.put(indexName, index);\n \n return new IndexerModelEvent(isNew ? IndexerModelEventType.INDEX_ADDED : IndexerModelEventType.INDEX_UPDATED, indexName);\n \n } catch (IndexNotFoundException e) {\n indexes.remove(indexName);\n \n return new IndexerModelEvent(IndexerModelEventType.INDEX_REMOVED, indexName);\n }\n }",
"private void addSeenInfo(\n int index, SeenInfo.Builder builderForValue) {\n ensureSeenInfoIsMutable();\n seenInfo_.add(index, builderForValue.build());\n }",
"public void WriteIndex() throws Exception {\n CorpusReader corpus = new CorpusReader();\n // initiate the output object\n IndexWriter output = new IndexWriter();\n\n // Map to hold doc_id and doc content;\n Map<String, String> doc;\n\n // index the corpus, load the doc one by one\n while ((doc = corpus.NextDoc()) != null){\n // get the doc_id and content of the current doc.\n String doc_id = doc.get(\"DOC_ID\");\n String content = doc.get(\"CONTENT\");\n\n // index the doc\n output.IndexADoc(doc_id, content);\n }\n output.close_index_writer();\n }",
"@Deprecated\n\tpublic void pushIndex(int index) {\n\t\tindices.add(index);\n\t}",
"public void setIndex(int index) { this.index = index; }",
"private void setIndex(int index){\n\t\tthis.index = index;\n\t}",
"public void start() throws Exception {\n\n createIndex();\n }",
"void loadFaidx() {\n\t\tString file = phastConsDir + \"/genome.fai\";\n\t\tif (!Gpr.exists(file)) { throw new RuntimeException(\"Cannot find fasta index file '\" + file + \"'\\n\\tYou can create one by running 'samtools faidx' command and copying the resulting index file to \" + file + \"\\n\\n\"); }\n\n\t\t// Read and parse file\n\t\tchromoSize = new HashMap<>();\n\t\tString txt = Gpr.readFile(file);\n\t\tfor (String line : txt.split(\"\\n\")) {\n\t\t\tString fields[] = line.split(\"\\\\s+\");\n\t\t\tString chrName = Chromosome.simpleName(fields[0]);\n\t\t\tint len = Gpr.parseIntSafe(fields[1]);\n\n\t\t\tchromoSize.put(chrName, len);\n\t\t}\n\t}",
"public void updateEsGoodsIndexByBrandId(List<Integer> brandIds,Integer shopId){\n List<Integer> goodsIds = goodsService.getGoodsIdByBrandId(brandIds);\n if( goodsIds.isEmpty() ){\n return ;\n }\n addEsGoodsIndex(goodsIds,shopId,DBOperating.UPDATE);\n }",
"public void onIndexReset();",
"public com.guidewire.datamodel.IndexDocument.Index addNewIndex()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n com.guidewire.datamodel.IndexDocument.Index target = null;\r\n target = (com.guidewire.datamodel.IndexDocument.Index)get_store().add_element_user(INDEX$12);\r\n return target;\r\n }\r\n }",
"@Override\n public void onConfigurationChanged(Configuration newConfig) {\n super.onConfigurationChanged(newConfig);\n\n helpPopulate(defaultIndex);\n }",
"public void ensureIndex(Index index) {\n try {\n createIndex(index);\n } catch (HttpConflict ex) {\n // pass\n }\n }"
] | [
"0.6985099",
"0.6588934",
"0.65026206",
"0.6369727",
"0.62021923",
"0.6094138",
"0.6044511",
"0.59945065",
"0.59653753",
"0.5870165",
"0.5870165",
"0.5817983",
"0.5725038",
"0.5691998",
"0.5671577",
"0.56199974",
"0.5611343",
"0.5603455",
"0.5475912",
"0.5449317",
"0.54075927",
"0.5398093",
"0.5395204",
"0.538193",
"0.53792083",
"0.5350996",
"0.5335435",
"0.5332973",
"0.53183025",
"0.53142524",
"0.529606",
"0.52937835",
"0.52908975",
"0.5274804",
"0.52743447",
"0.52660316",
"0.5260717",
"0.52395064",
"0.5226939",
"0.52248496",
"0.52164346",
"0.5207941",
"0.5205911",
"0.5201",
"0.51995593",
"0.5197218",
"0.5180636",
"0.51750225",
"0.51742196",
"0.51718366",
"0.51705366",
"0.51639265",
"0.51628906",
"0.5161114",
"0.5159652",
"0.5156435",
"0.5149883",
"0.51323724",
"0.5130796",
"0.5126783",
"0.51225996",
"0.51161593",
"0.50989616",
"0.5098337",
"0.50784785",
"0.50781524",
"0.50707567",
"0.5068681",
"0.50641954",
"0.5061268",
"0.50605434",
"0.5057969",
"0.5048254",
"0.50371665",
"0.5036067",
"0.50310725",
"0.50288504",
"0.5025743",
"0.5016408",
"0.50100464",
"0.50024164",
"0.49990776",
"0.49977583",
"0.49894026",
"0.49873912",
"0.4985668",
"0.4980224",
"0.49703932",
"0.49561796",
"0.4951015",
"0.49353358",
"0.49292672",
"0.49283388",
"0.49279448",
"0.4924982",
"0.49239042",
"0.4922885",
"0.49100855",
"0.49098167",
"0.48997977"
] | 0.50037533 | 80 |
Gives the length of index. | public long length() {
return kmers_num;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int length() {\r\n\t\treturn index.length;\r\n\t}",
"public int length() { return 1+maxidx; }",
"public int length() {\n return nextindex - startIndex;\n }",
"int getIndexesCount();",
"public int length();",
"public int length();",
"public int length();",
"public int length();",
"public int length();",
"public int getLength();",
"public int getLength();",
"public int getLength();",
"int getIndicesCount();",
"public int sizeOfIndexArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(INDEX$12);\r\n }\r\n }",
"public int size() {\n return index.size();\n }",
"public int get_length();",
"public int length() {\n\t\treturn this.n;\n\t}",
"public int size() throws IOException {\n return (int) (index.size() / INDEX_BLOCK_LEN);\n }",
"public int length()\r\n/* 26: */ {\r\n/* 27: 39 */ return this.pos;\r\n/* 28: */ }",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"private int length() { return length; }",
"public int length() {\n \treturn length;\n }",
"public int getLength()\n\t{\n\t\treturn (int) length;\n\t}",
"public int getLength() { return length;\t}",
"public int length()\n\t{\n\t\treturn 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 abstract int length();",
"public abstract int length();",
"public int length() {\n return size();\n }",
"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 long getLength();",
"public long getLength();",
"int length()\n\t{\n\t\treturn length;\n\t}",
"public int length() {\n\t\treturn length;\n\t}",
"public int length() {\n\t\treturn length;\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\t\treturn length;\n\t}",
"public int getLength(){\n\t\treturn length;\n\t}",
"public int getLength() {\r\n\t\treturn length;\r\n\t}",
"public int getLength()\n {\n\treturn length;\n }",
"public int getLength() {\n return length;\n }",
"public int getLength() {\n return length;\n }",
"public abstract int getNumIndexes();",
"public int getLength() {\n return length;\n }",
"public int getLength() {\n\t\treturn length;\n\t}",
"public int getLength() {\n\t\treturn length;\n\t}",
"public int getLength() {\n\t\treturn length;\n\t}",
"public int getLength() {\n\t\treturn length;\n\t}",
"public int getLength() {\n\t\treturn length;\n\t}",
"public int getLength() {\n\t\treturn length;\n\t}",
"public int getLength()\n {\n return length;\n }",
"public abstract int getLength();",
"public abstract int getLength();",
"protected abstract int getLength();",
"public int size() {\n\t\treturn invertedIndex.size();\n\t}",
"private int length() {\n\t\treturn this.lenght;\n\t}",
"public int getLength() {\n\t\treturn this.length;\n\t}",
"public int length() {\n \t \n \t //return the length\n \t return(len);\n }",
"public int size() {\r\n return length;\r\n }",
"public int getLength() {\n return this.length;\n }",
"public int getLength() {\n return this.length;\n }",
"public int getLength()\n\t{\n\t\treturn mLength;\n\t}",
"public int length() {\n\t\treturn size;\r\n\t}",
"public int length() { return _end - _start; }",
"int getArrayLength();",
"int getArrayLength();",
"@Override\n public Integer length() {\n return myLength;\n }",
"public double getLength() {\n return count;\n }",
"public int my_length();",
"int len();",
"public int length() {\n return 0; // REPLACE THIS LINE WITH THE RIGHT ANSWER.\n }",
"public Integer getLength() {\n return _length;\n }",
"public Integer getLength() {\n return _length;\n }",
"public int sizeOf();",
"long arrayLength();",
"public int getLength() {return length;}",
"public org.python.types.Int __len__();",
"public int getLength() {\n return length_;\n }",
"public int size()\n \t{\n \t\treturn getLength();\n \t}",
"public int size(){\n return length;\n }",
"public int getLength() {\n return length_;\n }",
"public long length() {\n return length;\n }",
"int length();",
"int length();",
"int length();",
"int length();",
"int length();"
] | [
"0.8569819",
"0.82116824",
"0.7762646",
"0.75263345",
"0.7447451",
"0.7447451",
"0.7447451",
"0.7447451",
"0.7447451",
"0.7398813",
"0.7398813",
"0.7398813",
"0.73702544",
"0.73693377",
"0.7363487",
"0.735119",
"0.7339066",
"0.7304875",
"0.7275255",
"0.7274561",
"0.7274561",
"0.7274561",
"0.7274561",
"0.7274561",
"0.7274561",
"0.7274561",
"0.7274561",
"0.7274561",
"0.7274561",
"0.7273681",
"0.72508836",
"0.7250807",
"0.724141",
"0.72323525",
"0.72213376",
"0.72213376",
"0.7216185",
"0.7216185",
"0.72006166",
"0.7191633",
"0.7191633",
"0.7191633",
"0.7186989",
"0.7186989",
"0.71830803",
"0.71749175",
"0.71749175",
"0.7168756",
"0.7168756",
"0.7168756",
"0.7168027",
"0.7168027",
"0.7162725",
"0.71467376",
"0.71427274",
"0.71427274",
"0.71406066",
"0.71294874",
"0.71254086",
"0.71254086",
"0.71254086",
"0.71254086",
"0.71254086",
"0.71254086",
"0.71247053",
"0.71089226",
"0.71089226",
"0.710649",
"0.7103599",
"0.70989716",
"0.70936763",
"0.7078643",
"0.707208",
"0.7066191",
"0.7066191",
"0.70619535",
"0.7061661",
"0.7053641",
"0.70535874",
"0.70535874",
"0.7047478",
"0.7043029",
"0.70320034",
"0.70280004",
"0.70225215",
"0.70200676",
"0.70200676",
"0.70196915",
"0.70166385",
"0.7013097",
"0.69918555",
"0.69878393",
"0.69828343",
"0.6960182",
"0.6958144",
"0.6954048",
"0.6930352",
"0.6930352",
"0.6930352",
"0.6930352",
"0.6930352"
] | 0.0 | -1 |
Gives the prefix length of kmers. | public int get_pre_len() {
return pre_len;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public long length() {\n return kmers_num;\n }",
"private int longestCanonicalPrefixLength()\n\t{\n\t\tAffix currLong; //= this.longestCanonicalPrefix();\n\n\t\tint length;\n\n\t\tif( prefixes.size() < 1 ) {\n\t\t\tlength = 0;\n\t\t} else {\n\t\t\tcurrLong = this.longestCanonicalPrefix();\n\t\t\tlength = currLong.getAffix().length();\n\t\t}\n\n\t\treturn length;\n\t}",
"public int getLengthInCentiMeters()\r\n\t{\r\n\t\treturn length;\r\n\t}",
"public short computeLength() {\n \tshort len = (short)(CORE_LENGTH + super.computeLength());\n \treturn len;\n }",
"public int get_length();",
"Length getWidth();",
"public double getLength();",
"private int getKeyLength() {\n MongoCursor<Document> cursor = this.keystoreCollection.find(eq(\"conf\", \"homomorphic-keylength\")).iterator();\n\n int keyLength = 2048; // Default value is 2048 bits\n while (cursor.hasNext()) {\n keyLength = cursor.next().getDouble(\"keylength\").intValue();\n }\n return keyLength;\n }",
"public int howManyStartsWithPrefix(String prefix) {\n Node endNode = getNodeByString(prefix, false);\n return (endNode == null) ? 0 : endNode.getNumberOfTerminalsInSubTree();\n }",
"int prefixLength() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.icu.impl.coll.CollationDataBuilder.ConditionalCE32.prefixLength():int, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.icu.impl.coll.CollationDataBuilder.ConditionalCE32.prefixLength():int\");\n }",
"public int getSnakeStartLength();",
"public int getWidth() {\r\n if ( fontMetrics != null && lbl != null ) {\r\n return fontMetrics.stringWidth(lbl) + 12; \r\n } else {\r\n return 10;\r\n }\r\n }",
"public ParseResult prefixOfLength (Object input, int length, int peel)\n {\n ParseResult r = prefixInternal(input, peel + 1);\n assertTrue(r.matchSize == length, peel + 1,\n () -> r.toString(map, onlyRulesInCallStacks));\n clearLocals();\n return r;\n }",
"public int getWingLength() {\n if (arrowhead != null) {\n return arrowhead.getWingLength();\n }\n return 0;\n }",
"public int getMarkerLength() {\n\t\treturn m_nMarkerLength;\n\t}",
"protected float measurePrefix() {\n return measureLineNumber() + mDividerMargin * 2 + mDividerWidth;\n }",
"public int getLength ()\r\n {\r\n return glyph.getBounds().width;\r\n }",
"String getWidth();",
"String getWidth();",
"int length() {\n if (extMap.isEmpty()) {\n return 0;\n } else {\n return encodedLength;\n }\n }",
"int getWayLength();",
"public long getLength();",
"public long getLength();",
"float getLength();",
"float getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"public long length() {\n\tint nBits;\n\tlong x, y;\n\tlong length = 7 + Math.max(minBitsS(toFixed(getTranslateX())),\n\t\t\t\t minBitsS(toFixed(getTranslateY())));\n\tif (hasScale()) {\n\t length += 5 + Math.max(minBitsS(toFixed(getScaleX())),\n\t\t\t\t minBitsS(toFixed(getScaleY())));\n\t}\n\tif (hasRotate()) {\n\t length += 5 + Math.max(minBitsS(toFixed(getRotate1())),\n\t\t\t\t minBitsS(toFixed(getRotate2())));\n\t}\n\treturn length;\n }",
"public int getLength();",
"public int getLength();",
"public int getLength();",
"public int my_length();",
"public int getWidth()\n {\n return larghezza;\n }",
"public int getWordLength();",
"public int getFootprintLength() {\n return 1;\n }",
"public int numberOfMatches(String prefix)\n {\n int r = prefix.length();\n Comparator<Term> c_pf = Term. byPrefixOrder(r);\n\n int first = BinarySearchDeluxe.firstIndexOf(terms,\n new Term(prefix, 0),\n c_pf);\n int last = BinarySearchDeluxe.lastIndexOf(terms,\n new Term(prefix, 0),\n c_pf);\n StdOut.printf(\"first\");\n return last - first + 1;\n\n }",
"public int getLength() {\n/* 301 */ return this.stream.getInt(COSName.LENGTH, 0);\n/* */ }",
"public int length();",
"public int length();",
"public int length();",
"public int length();",
"public int length();",
"BigInteger getWidth();",
"public double klSize() {\n\t\tif (klSize_ == 0) {\n\t\t\tdouble klSum = 0;\n\t\t\tint size = size();\n\t\t\tif (size <= 1)\n\t\t\t\treturn 0;\n\t\t\tdouble uniform = 1.0 / size;\n\t\t\tfor (Double prob : itemProbs_.values()) {\n\t\t\t\tklSum += klDivergence(prob, uniform);\n\t\t\t}\n\t\t\tdouble logBase = Math.log(size);\n\t\t\tklSize_ = Math.max(size * (1 - klSum / logBase), 1);\n\t\t}\n\t\treturn klSize_;\n\t}",
"BigInteger getLength();",
"public int prefixCount(String prefix) \n {\n \tEntry curr = root;\n \tprefixCnt = 0;\n \tfor (int i=0; i<prefix.length(); i++)\n \t{\n \t\tchar ch = prefix.charAt(i);\n \t\tEntry node = curr.child.get(ch);\n \t\t//If node does not exist for given character\n \t\tif (node == null) \n \t\t{\n \t\t return 0;\t\n \t\t}\n \t\tcurr = node;\n \t}\n \tcount(curr);\n \treturn prefixCnt;\n }",
"public double getLength() {\n return count;\n }",
"public double get_length() {\n\t\treturn _length;\n\t}",
"public int getCharHeight(String prefix) {\r\n\t\ttry {\r\n\t\t\treturn Integer.parseInt(bundle.getString(prefix + \".height\"));\r\n\t\t} catch (MissingResourceException e) {\r\n\t\t\treturn Integer.parseInt(bundle.getString(\"preference.toc.notes.default.height\"));\r\n\t\t}\r\n\t}",
"public String getlength()\n\t{\n\t\treturn length.getText();\n\t}",
"public int getLength()\n {\n return encryptionDictionary.getInt( \"Length\", 40 );\n }",
"public static int size_length() {\n return (8 / 8);\n }",
"public void calculateStreetLength(){\r\n\t\tBigDecimal streetLength = BigDecimal.ZERO;\r\n\t\tBigDecimal streetLength_old = BigDecimal.ZERO;\r\n\t\t\r\n\t\tRegion[][] regions = Map.getInstance().getRegions();\r\n\t\t\t\r\n\t\t//iterate trough all regions and streets\r\n\t\tfor(int i = 0; i < regions.length; i++){\r\n\t\t\tfor(int j = 0; j < regions[i].length; j++){\r\n\t\t\t\tStreet[] tmpStreets = regions[i][j].getStreets();\r\n\t\t\t\tfor(int k = 0; k < tmpStreets.length; k++){\t\r\n\t\t\t\t\tstreetLength_old = new BigDecimal(streetLength.toString());\r\n\t\t\t\t\tstreetLength = streetLength_old.add(BigDecimal.valueOf(tmpStreets[k].getLength()));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\tstreetLength_old = new BigDecimal(streetLength.toString());\r\n\t\tstreetLength = streetLength_old.divide(new BigDecimal(100000));\r\n\t\t\t\r\n\t\tJOptionPane.showMessageDialog(null, streetLength.toPlainString() + \"km\", \"Information\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\r\n\t}",
"public int getKMSelanjutnya(){\n\t\treturn (getDistance() - N * 1000) * costPerKm / 1000;\n\t}",
"protected int getLength() {\n int length = super.getLength(); //see if it is defined in the ncml\n if (length < 0) {\n double[] t = getTimes();\n if (t != null) length = t.length;\n else length = 0;\n }\n return length;\n }",
"protected int length() { return FormatTools.getRasterLength(lengths); }",
"public int commonPrefixLength(String s1, String s2)\r\n {\r\n\r\n int length = 0;\r\n if (s1.isEmpty() || s2.isEmpty())\r\n {\r\n return 0;\r\n }\r\n while (s1.charAt(length) == s2.charAt(length))\r\n {\r\n length++;\r\n //if (k >= s1.length() || k >= s2.length() || k >= system.getLookupTableSize() - 1)\r\n if (length >= s1.length() || length >= s2.length())\r\n {\r\n break;\r\n }\r\n }\r\n\r\n return length;\r\n\r\n }",
"public int getKiloWatts(){\n\t\treturn kiloWatts;\n\t}",
"public double getLength()\n\t{\n\t\treturn length;\n\t}",
"public double getLength(){\r\n\t\treturn length;\r\n\t}",
"public String getMountains()\n {\n return \"has \" + numMountains + \" mountains\";\n }",
"public void findLength()\n\t{\n\t\tlength = name.length();\n\t}",
"public int levelWidth() {\r\n\t\treturn left_map_width + \r\n\t\t\t\tmap[r()].getProperties().get(\"width\", Integer.class);\r\n\t}",
"public NM getNumberOfItemsPerUnit() { \r\n\t\tNM retVal = this.getTypedField(14, 0);\r\n\t\treturn retVal;\r\n }",
"int getBiasPrefixMatchCount();",
"public abstract long getLength();",
"public abstract long getLength();",
"public double getWidthInMillimeters()\n {\n return MILLIMETERS * width;\n }",
"public String getKm() {\n return km;\n }",
"public static int getMapWidth() {\r\n\t\treturn 7;\r\n\t}",
"public double getLength() {\r\n return length;\r\n }",
"public int printLength() { return printLength; }",
"public double getLength() {\r\n\t\treturn length;\r\n\t}",
"public int prefixCount(String s) {\n\n StringIterator iter = new StringIterator(s);\n Entry start = prefixCount(iter, root);\n if(start==null) // If the prefix is not in the trie, return 0.\n return 0;\n\n return dfs(start);\n }",
"public double getLength()\n {\n return length;\n }",
"public int getSizeMultipler() {\n return (int) Math.ceil(numberOfWordsOriginal / Parameters.SIZE_MULTIPLIER);\n }",
"public double getLength() {\n\t\treturn length;\n\t}",
"public static Integer getMapWidth() {\n\t\treturn MAPWIDTH;\n\t}",
"static int size_of_cm(String passed){\n\t\treturn 3;\n\t}",
"public double getLength() {\n return length;\n }",
"@Override\n\tpublic int getWidth() {\n\t\treturn POWER_STATION_WIDTH;\n\t}",
"public String getWidth() {\n return width;\n }",
"public static int getWordlenght() {\r\n\t\treturn lenght;\r\n\t}",
"int size() {\n return _letters.length();\n }",
"double getZLength();",
"int getSearchLength();",
"private String countFileSize(long length) {\n\n if (length < UNIT) {\n return length + \" B\";\n }\n int exp = (int) (Math.log(length) / Math.log(UNIT));\n String pre = \"KMGTPE\".charAt(exp - 1) + \"i\";\n\n return String.format(\"%.1f %sB\", length / Math.pow(UNIT, exp), pre);\n\n }",
"public static void getPerms(HashMap<Character,Integer> freqMap,String prefix,int length,ArrayList<String> result) {\n if(length==0) {\n result.add(prefix);\n return;\n }\n for(Character c:freqMap.keySet()){\n Integer count= freqMap.get(c);\n if(count>0){\n freqMap.put(c,count-1);\n getPerms(freqMap,prefix+c,length-1,result);\n freqMap.put(c,count);\n }\n\n }\n }",
"public int getGlyphWidth() {\n return glyphWidth;\n }",
"private Affix longestCanonicalPrefix()\n\t{\n\t\tAffix currLong \t\t= this.prefixes.get(0); // longest found affix\n\t\tint currLongLength = currLong.getAffix().length();\n\n\t\tfor( int i = 1; i < prefixes.size(); i++ )\n\t\t{\n\t\t\tAffix temp = this.prefixes.get(i);\n\t\t\tint prefixLength\t= temp.getAffix().length();\n\n\t\t\tif( currLongLength < prefixLength )\n\t\t\t{\n\t\t\t\tcurrLong = temp;\n\t\t\t}\n\t\t}\n\n\t\treturn currLong;\n\t}",
"public double getLength() {\r\n\t\t\treturn length;\r\n\t\t}",
"public double getNeckLength() {\n MessageUtility.logGetter(name,\"getNeckLength\",neckLength);\n return neckLength;\n }"
] | [
"0.77234954",
"0.6569389",
"0.6391252",
"0.6202217",
"0.6181078",
"0.6118823",
"0.61010844",
"0.6097451",
"0.60055536",
"0.59964615",
"0.5994521",
"0.59818876",
"0.5973587",
"0.5947285",
"0.5933905",
"0.5930112",
"0.5929897",
"0.5928773",
"0.5928773",
"0.5928338",
"0.5919417",
"0.59180623",
"0.59180623",
"0.58974224",
"0.58974224",
"0.5878632",
"0.5878632",
"0.5878632",
"0.5878632",
"0.5878632",
"0.5878632",
"0.5878632",
"0.5878632",
"0.5878632",
"0.5878632",
"0.5877075",
"0.58736026",
"0.58736026",
"0.58736026",
"0.5869758",
"0.58346206",
"0.5827311",
"0.58015543",
"0.579764",
"0.5784985",
"0.5782811",
"0.5782811",
"0.5782811",
"0.5782811",
"0.5782811",
"0.5766754",
"0.57663095",
"0.57566047",
"0.5747561",
"0.57436",
"0.5742465",
"0.57355785",
"0.5728142",
"0.5723573",
"0.57141685",
"0.57084787",
"0.56993604",
"0.5697185",
"0.5694172",
"0.566829",
"0.5650675",
"0.5649247",
"0.5648748",
"0.56487393",
"0.56469214",
"0.5636428",
"0.56277084",
"0.5621692",
"0.5616579",
"0.5616579",
"0.56137246",
"0.5613433",
"0.56125957",
"0.55930156",
"0.5592325",
"0.55909455",
"0.5585424",
"0.5583962",
"0.55835015",
"0.55823475",
"0.5580816",
"0.55793715",
"0.5577495",
"0.55752105",
"0.5570692",
"0.5569716",
"0.5569004",
"0.5564315",
"0.5552397",
"0.554889",
"0.5543928",
"0.55362207",
"0.5531546",
"0.5531506",
"0.55258036"
] | 0.56642574 | 65 |
Gives the suffix length of kmers. | public int get_suf_len() {
return suf_len;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public long length() {\n return kmers_num;\n }",
"public int suffixArrayLength() {\r\n return mText.length();\r\n }",
"public int getKnownSuffixesCount() {\n if (knownSuffixesBuilder_ == null) {\n return knownSuffixes_.size();\n } else {\n return knownSuffixesBuilder_.getCount();\n }\n }",
"public int maxSuffixLength() {\r\n return mMaxSuffixLength;\r\n }",
"@java.lang.Override\n public int getKnownSuffixesCount() {\n return knownSuffixes_.size();\n }",
"public int getLength ()\r\n {\r\n return glyph.getBounds().width;\r\n }",
"public char get_floating_suffix();",
"private int longestCanonicalPrefixLength()\n\t{\n\t\tAffix currLong; //= this.longestCanonicalPrefix();\n\n\t\tint length;\n\n\t\tif( prefixes.size() < 1 ) {\n\t\t\tlength = 0;\n\t\t} else {\n\t\t\tcurrLong = this.longestCanonicalPrefix();\n\t\t\tlength = currLong.getAffix().length();\n\t\t}\n\n\t\treturn length;\n\t}",
"public int getFootprintLength() {\n return 1;\n }",
"public int getLengthInCentiMeters()\r\n\t{\r\n\t\treturn length;\r\n\t}",
"public int get_length();",
"public double getLength();",
"float getLength();",
"float getLength();",
"public int getMarkerLength() {\n\t\treturn m_nMarkerLength;\n\t}",
"public int getWordLength();",
"private String countFileSize(long length) {\n\n if (length < UNIT) {\n return length + \" B\";\n }\n int exp = (int) (Math.log(length) / Math.log(UNIT));\n String pre = \"KMGTPE\".charAt(exp - 1) + \"i\";\n\n return String.format(\"%.1f %sB\", length / Math.pow(UNIT, exp), pre);\n\n }",
"public int lengthOfLongestWord(){\n int n=0;\n for(int i=0;i<size();i++)\n if(get(i).length()>n)n=get(i).length();\n return n;\n }",
"public void findLength()\n\t{\n\t\tlength = name.length();\n\t}",
"public long getLength();",
"public long getLength();",
"public int getSizeMultipler() {\n return (int) Math.ceil(numberOfWordsOriginal / Parameters.SIZE_MULTIPLIER);\n }",
"public short computeLength() {\n \tshort len = (short)(CORE_LENGTH + super.computeLength());\n \treturn len;\n }",
"private void adjustMaxPrefixCharacterLenghtAfterRemoval(){\n int prefixFullNameMaxLength = !getAllPrefixFullNames().isEmpty() ? Collections.max(getAllPrefixFullNames(), stringCharacterLengthComparator).length() : 0;\n int prefixAbbreviationMaxLength = !getAllPrefixAbbreviations().isEmpty() ? Collections.max(getAllPrefixAbbreviations(), stringCharacterLengthComparator).length() : 0;\n\n maxPrefixCharacterLength = Math.max(prefixAbbreviationMaxLength, prefixFullNameMaxLength);\n }",
"public int getMaxAliasLength() {\n \t\treturn 10;\n \t}",
"int length() {\n if (extMap.isEmpty()) {\n return 0;\n } else {\n return encodedLength;\n }\n }",
"protected int getLength() {\n int length = super.getLength(); //see if it is defined in the ncml\n if (length < 0) {\n double[] t = getTimes();\n if (t != null) length = t.length;\n else length = 0;\n }\n return length;\n }",
"BigInteger getLength();",
"public static int size_estLength() {\n return (8 / 8);\n }",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"public void calculateStreetLength(){\r\n\t\tBigDecimal streetLength = BigDecimal.ZERO;\r\n\t\tBigDecimal streetLength_old = BigDecimal.ZERO;\r\n\t\t\r\n\t\tRegion[][] regions = Map.getInstance().getRegions();\r\n\t\t\t\r\n\t\t//iterate trough all regions and streets\r\n\t\tfor(int i = 0; i < regions.length; i++){\r\n\t\t\tfor(int j = 0; j < regions[i].length; j++){\r\n\t\t\t\tStreet[] tmpStreets = regions[i][j].getStreets();\r\n\t\t\t\tfor(int k = 0; k < tmpStreets.length; k++){\t\r\n\t\t\t\t\tstreetLength_old = new BigDecimal(streetLength.toString());\r\n\t\t\t\t\tstreetLength = streetLength_old.add(BigDecimal.valueOf(tmpStreets[k].getLength()));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\tstreetLength_old = new BigDecimal(streetLength.toString());\r\n\t\tstreetLength = streetLength_old.divide(new BigDecimal(100000));\r\n\t\t\t\r\n\t\tJOptionPane.showMessageDialog(null, streetLength.toPlainString() + \"km\", \"Information\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\r\n\t}",
"public int my_length();",
"public int getPatchNameLength() \n {\n return 16; \n }",
"public String getSleeveLength() {\r\n\t\treturn sleeveLength;\r\n\t}",
"int getStrLngth(String name){\r\n int l= name.length();\r\n return l;}",
"@Override\n\tpublic double getLength() {\n \tdouble muscleLength = myAmplitude * Math.sin(myPie);\n\t\tmyPie += myFrequency;\n\t\treturn muscleLength;\n }",
"public int getLength();",
"public int getLength();",
"public int getLength();",
"public static int getWordlenght() {\r\n\t\treturn lenght;\r\n\t}",
"public int getCharHeight(String prefix) {\r\n\t\ttry {\r\n\t\t\treturn Integer.parseInt(bundle.getString(prefix + \".height\"));\r\n\t\t} catch (MissingResourceException e) {\r\n\t\t\treturn Integer.parseInt(bundle.getString(\"preference.toc.notes.default.height\"));\r\n\t\t}\r\n\t}",
"public int getLagLength() {\r\n\t\treturn Integer.parseInt(properties.getProperty(KEY_LAG_LENGTH)) * 1000;\r\n \t}",
"int getWayLength();",
"public abstract long getLength();",
"public abstract long getLength();",
"public int getWingLength() {\n if (arrowhead != null) {\n return arrowhead.getWingLength();\n }\n return 0;\n }",
"public String getlength()\n\t{\n\t\treturn length.getText();\n\t}",
"static int size_of_cm(String passed){\n\t\treturn 3;\n\t}",
"public static int size_length() {\n return (8 / 8);\n }",
"public String getCharacterSize() {\n\t\tString result = null;\n\t\tRaces dropDownText = (Races) race.getSelectedItem();\n\n\t\tif (dropDownText.equals(Races.DWARF)) {\n\t\t\tresult = Races.DWARF.getSize();\n\t\t} else if (dropDownText.equals(Races.ELF)) {\n\t\t\tresult = Races.ELF.getSize();\n\t\t} else if (dropDownText.equals(Races.GNOME)) {\n\t\t\tresult = Races.GNOME.getSize();\n\t\t} else if (dropDownText.equals(Races.HALFELF)) {\n\t\t\tresult = Races.HALFELF.getSize();\n\t\t} else if (dropDownText.equals(Races.HALFORC)) {\n\t\t\tresult = Races.HALFORC.getSize();\n\t\t} else if (dropDownText.equals(Races.HALFLING)) {\n\t\t\tresult = Races.HALFLING.getSize();\n\t\t} else if (dropDownText.equals(Races.HUMAN)) {\n\t\t\tresult = Races.HUMAN.getSize();\n\t\t}\n\n\t\treturn result;\n\t}",
"public double get_length() {\n\t\treturn _length;\n\t}",
"private int getKeyLength() {\n MongoCursor<Document> cursor = this.keystoreCollection.find(eq(\"conf\", \"homomorphic-keylength\")).iterator();\n\n int keyLength = 2048; // Default value is 2048 bits\n while (cursor.hasNext()) {\n keyLength = cursor.next().getDouble(\"keylength\").intValue();\n }\n return keyLength;\n }",
"public int getWidth() {\r\n if ( fontMetrics != null && lbl != null ) {\r\n return fontMetrics.stringWidth(lbl) + 12; \r\n } else {\r\n return 10;\r\n }\r\n }",
"public double klSize() {\n\t\tif (klSize_ == 0) {\n\t\t\tdouble klSum = 0;\n\t\t\tint size = size();\n\t\t\tif (size <= 1)\n\t\t\t\treturn 0;\n\t\t\tdouble uniform = 1.0 / size;\n\t\t\tfor (Double prob : itemProbs_.values()) {\n\t\t\t\tklSum += klDivergence(prob, uniform);\n\t\t\t}\n\t\t\tdouble logBase = Math.log(size);\n\t\t\tklSize_ = Math.max(size * (1 - klSum / logBase), 1);\n\t\t}\n\t\treturn klSize_;\n\t}",
"public int getKMSelanjutnya(){\n\t\treturn (getDistance() - N * 1000) * costPerKm / 1000;\n\t}",
"public int getLongestRepeatedSubstringLength()\r\n {\r\n return maxLength;\r\n }",
"public long length() {\n\tint nBits;\n\tlong x, y;\n\tlong length = 7 + Math.max(minBitsS(toFixed(getTranslateX())),\n\t\t\t\t minBitsS(toFixed(getTranslateY())));\n\tif (hasScale()) {\n\t length += 5 + Math.max(minBitsS(toFixed(getScaleX())),\n\t\t\t\t minBitsS(toFixed(getScaleY())));\n\t}\n\tif (hasRotate()) {\n\t length += 5 + Math.max(minBitsS(toFixed(getRotate1())),\n\t\t\t\t minBitsS(toFixed(getRotate2())));\n\t}\n\treturn length;\n }",
"public double getLength() {\n return count;\n }",
"protected int length() { return FormatTools.getRasterLength(lengths); }",
"Length getWidth();",
"String getWidth();",
"String getWidth();",
"abstract double getLength();",
"public double getLength(){\r\n\t\treturn length;\r\n\t}",
"public double getLength()\n\t{\n\t\treturn length;\n\t}",
"static int size_of_jm(String passed){\n\t\treturn 3;\n\t}",
"public int thesize(long d) {\n String num = d + \"\";\n return num.length();\n }",
"String getSuffix();",
"private static int suffixLength(char[] needle, int p) {\n int len = 0;\n for (int i = p, j = needle.length - 1;\n i >= 0 && needle[i] == needle[j]; --i, --j) {\n len += 1;\n }\n return len;\n }",
"public int getLength() {\n/* 301 */ return this.stream.getInt(COSName.LENGTH, 0);\n/* */ }",
"public double getLength() {\r\n\t\treturn length;\r\n\t}",
"public int getIntronLength() { \n\t\tfinal int start = getLast5SSPos(); \n\t\tfinal int end = getLast3SSPos();\n\t\treturn( Math.abs( end - start ) ); \n\t}",
"public double getLength() {\r\n return length;\r\n }",
"public double getNeckLength() {\n MessageUtility.logGetter(name,\"getNeckLength\",neckLength);\n return neckLength;\n }",
"public double getLength() {\n\t\treturn length;\n\t}",
"public int getTrieDictionaryForestMaxTrieSizeMB() {\n return Integer.parseInt(getOptional(\"kylin.dictionary.forest-trie-max-mb\", \"500\"));\n }",
"public String getSuffix(Player player) {\n \t\treturn getValue(player, \"suffix\");\n \t}",
"public int getIntervalLength() {\r\n\t\treturn Integer.parseInt(properties.getProperty(KEY_INTERVAL_LENGTH)) * 1000;\r\n \t}",
"public String getSuffix() {\n return suffix;\n }",
"public double getLength()\n {\n return length;\n }",
"public int getLength()\n {\n return encryptionDictionary.getInt( \"Length\", 40 );\n }",
"public final double kilobytes()\n\t{\n\t\treturn value / 1024.0;\n\t}",
"public int longestRod ();",
"public int length();",
"public int length();",
"public int length();",
"public int length();",
"public int length();",
"public double getLength() {\r\n\t\t\treturn length;\r\n\t\t}",
"int getSearchLength();",
"public java.lang.String getSuffix() {\r\n return suffix;\r\n }"
] | [
"0.726541",
"0.6685033",
"0.65213364",
"0.64970565",
"0.6176435",
"0.6151953",
"0.6099317",
"0.60983425",
"0.607332",
"0.6065447",
"0.6049843",
"0.60447955",
"0.600853",
"0.600853",
"0.600275",
"0.59866923",
"0.5946989",
"0.5907673",
"0.59039503",
"0.58941305",
"0.58941305",
"0.5879394",
"0.5867571",
"0.5853526",
"0.5834458",
"0.57898843",
"0.577318",
"0.5765368",
"0.5748475",
"0.5741607",
"0.5741607",
"0.5741607",
"0.5741607",
"0.5741607",
"0.5741607",
"0.5741607",
"0.5741607",
"0.5741607",
"0.5741607",
"0.57341605",
"0.57280535",
"0.5724925",
"0.57077146",
"0.57066995",
"0.5706145",
"0.5700246",
"0.5700246",
"0.5700246",
"0.56927186",
"0.568125",
"0.5659782",
"0.5637364",
"0.5633005",
"0.5633005",
"0.5632366",
"0.56304216",
"0.56247",
"0.56245494",
"0.5619339",
"0.5602557",
"0.5601525",
"0.55973",
"0.5593459",
"0.5589861",
"0.55894464",
"0.5588191",
"0.5579834",
"0.5572903",
"0.5557806",
"0.55563414",
"0.55563414",
"0.55497104",
"0.5536951",
"0.5520412",
"0.552028",
"0.5514704",
"0.55144644",
"0.5504714",
"0.5504128",
"0.5491648",
"0.54843736",
"0.54668784",
"0.54629236",
"0.545581",
"0.5455659",
"0.5455274",
"0.5452963",
"0.54499257",
"0.5447021",
"0.5441572",
"0.54412305",
"0.5440972",
"0.5439571",
"0.5439571",
"0.5439571",
"0.5439571",
"0.5439571",
"0.54385275",
"0.5437742",
"0.54376847"
] | 0.5545981 | 72 |
Closes the index database | public void close() {
try {
ptr_file.close();
suf_file.close();
int k;
for (k = 0; k < ptr_parts_num; ++k) {
ptr_buff[k] = null;
}
for (k = 0; k < suf_parts_num; ++k) {
suf_buff[k] = null;
}
} catch (IOException e) {
System.out.println(e.getMessage());
System.exit(1);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void close() throws IndexException {\n }",
"private void close() throws CorruptIndexException, IOException {\n\n\t\tidxWriter.forceMerge(1);\n\t\tidxWriter.commit();\n\t\tidxWriter.close();\n\t}",
"public void close() throws IndexerException {\n\t\t//TODO\n\t\t\n\t}",
"public void close() {\n\t\t\n\t\ttry {\n\t\t\tindexWriter.optimize();\n\t\t\t\n\t\t\tindexWriter.close();\n\t\t\t\n\t\t\tIndexSearcher = new IndexSearcher(idx);\n\t\t\t\n\t\t} catch (CorruptIndexException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t}",
"@Override\n public void close()\n {\n notifyLegacyIndexOperationQueue();\n\n }",
"public void closeIndexWriter() throws IOException {\n if(indexWriter != null) {\n try {\n indexWriter.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }",
"@Override\npublic void close() throws IOException, JoinsException, SortException, IndexException {\n\t\n}",
"public void close() {\r\n closeDatabase();\r\n }",
"public synchronized void close() {\n\n mOpenCounter--;\n\n if(mOpenCounter == 0) {\n // Closing database\n mDatabase.close();\n }\n }",
"public void close() throws IOException{\n\t\tSystem.out.println(\"Indexed \" + writer.numDocs() + \" Docs!\");\n\t\twriter.commit();\n\t\twriter.close();\n\t}",
"public void close() {\n db.close();\n }",
"public void close() {\n db.close();\n }",
"private void closeDatabase() {\r\n SearchHelper.close();\r\n }",
"public void close() {\n\t\t\tdb.close();\n\t\t}",
"public void close() {\n \t\tdb.close();\n \t}",
"@Override\n public void close() {\n closeDB();\n }",
"public void close() {\n if (db.isOpen()) {\n db.close();\n }\n }",
"public void close(){\n this.db.close();\n }",
"public void Close() throws IOException, ClassNotFoundException {\n\t\tsaveBlock(); \n\t\tmergeAllIndex();\n\t\tsaveToken();\n\t\tdocIdx.close();\n\t}",
"public void close() {\r\n --accessNb;\r\n if (accessNb == 0) {\r\n databaseHelper.close();\r\n }\r\n }",
"@Override\n\tpublic void closeDB()\n\t{\n\n\t}",
"@Override\r\n public synchronized void close() {\r\n super.close();\r\n if (myWritableDb != null) {\r\n myWritableDb.close();\r\n myWritableDb = null;\r\n }\r\n }",
"public void closeDatabase() {\n hoardDBOpenHelper.close();\n }",
"@Override\n public void close() throws IOException {\n flushCurrentIndexBlock();\n\n // logger.info(\"Performing final merge\");\n // try {\n //Bin finalMergeBin = geometricParts.getAllShards();\n //doMerge(finalMergeBin, getNextIndexShardFolder(finalMergeBin.size + 1));\n // check point is updated by the merge op.\n\n // } catch (IOException ex) {\n // Logger.getLogger(GeometricRetrieval.class.getName()).log(Level.SEVERE, null, ex);\n //}\n\n }",
"public static void closeDatabase() {\n\t\ttry {\n\t\t\tif (status == OPEN_SUCCESS) {\n\t\t\t\tif (stmt != null)\n\t\t\t\t\tstmt.close();\n\t\t\t\tif (c != null)\n\t\t\t\t\tc.close();\n\t\t\t\tlogger.info(\"Closed database successfully\");\n\t\t\t} else {\n\t\t\t\tlogger.warn(\"Can not close: previous operation failed.\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tstatus = OPEN_FAILED;\n\t\t\tlogger.warn(e.getClass().getName() + \": \" + e.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"public void close(){\n\t\tif(tr != null && tr.inTransaction()){\n\t\t\ttr.rollback();\n\t\t}\n\t\ttry{\n\t\t\tif(db != null)\n\t\t\t\tdb.close();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void closeWriter () {\n try {\n writer.close();\n indexDir.close();\n indexHandler = null;\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public final void close() {\n\t\ttry {\n\t\t\tcon.commit( ); // Commit any updates\n\t\t\tcon.close ( );\n\t\t}\n\t\tcatch ( Exception e ) {\n\t\t\tnotify( \"Db.close\", e );\n\t\t};\n\t}",
"public void close() {\n\t\tthis.closed = true;\n\t\ttry {\n\t\t\tbdb.close();\n\t\t\tbdb = null;\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}",
"@Test\n public void close() throws Exception {\n ResizeRequest request = new ResizeRequest(\"target_index\", \"source_index\");\n /** 可选参数*/\n\n AcknowledgedResponse response = synchronousShrink(client, request);\n log.info(\"Shrink索引:{}成功?:{}\", Consts.INDEX_NAME, response.isAcknowledged());\n\n }",
"public static void closeDatabase() {\n if (instance != null) {\n instance.kill();\n instance = null;\n }\n }",
"public void schliessen() {\n mDb.close();\n }",
"private void closeDB() {\n locationDBAdapter.close();\n }",
"public void close()\n\t{\n\t\thdbTsDb.closeConnection();\n\t\thdbTsDb = null;\n\t\tif (timeSeriesDAO != null)\n\t\t\ttimeSeriesDAO.close();\n\t}",
"public void closeStorage() {\n\t\tdbStats.commit();\n\t\tdbStats.close();\n\t}",
"private void closeDatabase() {\r\n try {\r\n if ( connect != null ) {\r\n connect.close();\r\n }\r\n } catch ( Exception e ) {\r\n System.err.println( \"ERROR: Could not close database connection, \" + e.getMessage() );\r\n } finally {\r\n connect = null;\r\n }\r\n }",
"@Override\n public void close() {\n dbOptions.close();\n columnFamilyOptions.close();\n }",
"@Override\n\tpublic void closeDB() {\n\t\tcommonDao.closeDB();\n\t}",
"public void close() {\n\t\tDbHelper.closeDbObjects(this.con, this.itemRangeStatement,\n\t\t\t\tthis.itemRangeResultSet);\n\t}",
"public void CloseDB() {\n \n }",
"public static void close_DB() {\n try {\n for (int i=0; i<conns; i++) {\n if (con_pool[i]!=null)\n con_pool[i].close();\n }\n } catch (SQLException ex) {\n Logger.getLogger(DB_Backend.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void close() {\n if (database != null) {\n this.database.close();\n }\n }",
"public void close() {\n if (database != null) {\n this.database.close();\n }\n }",
"public void close() {\n if (database != null) {\n this.database.close();\n }\n }",
"public void close() {\n if (database != null) {\n this.database.close();\n }\n }",
"public void closeConnection(int index) {\n\t\tconnections.get(index).disconnect();\n\t}",
"public void afterIndexClosed(Index index) {\n\n }",
"public void close();",
"public void close();",
"public void close();",
"public void close();",
"public void close();",
"public void close();",
"public void close();",
"public void close();",
"public void close();",
"public void close();",
"public void close();",
"public void close();",
"public void close();",
"public void close();",
"public void close();",
"public void deleteIndex() throws Exception {\n\n\t\tRetryingRunnable runnable = new RetryingRunnable() \n\t\t{\t\n\t\t\tpublic void run() throws Exception \n\t\t\t{\n\t\t\t\tIndexWriter w = createIndexWriter(true); // open for writing and close (make empty)\n\t\t\t\tw.deleteAll();\n\t\t\t\tw.commit();\n\t\t\t\tw.close(true);\n\t\t\t\t\n\t\t\t\tDirectory dir = getIndexDir();\n\t\t\t\tfor(String file: dir.listAll())\n\t\t\t\t{\n\t\t\t\t\tif( dir.fileExists(file) ) // still exits\n\t\t\t\t\t{\n\t\t\t\t\t\tdir.sync(file);\n\t\t\t\t\t\tdir.deleteFile(file);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdir.close();\n\t\t\t}\n\t\t\t\n\t\t\tpublic boolean handleException(Throwable e) \n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\t\t\n\t\tchangeListener.onIndexReset(); // close searcher because index is deleted\n\t\t\n\t\trunRetryingRunnable(runnable); // delete index with retry\n\t}",
"public void close(){\n myDB.close();\n myDataBase.close();\n }",
"public void closeDB() {\n\t\ttry {\n\t\t\tconn.close();\n\t\t\tconn = null;\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"Failed to close database connection: \" + e);\n\t\t}\n\t}",
"public void close() {\n\t\tdbHelper.close();\n\t}",
"public void schliessen() {\n try {\n mDb.close();\n } catch (SQLException ex) {\n System.out.println(ex);\n }\n }",
"public void truncate() {\n\t\ttry {\n\t\t\t_reopenToken = _trackingIndexWriter.deleteAll();\n\t\t\tlog.warn(\"lucene index truncated\");\n\t\t} catch(IOException ioEx) {\n\t\t\tlog.error(\"Error truncating lucene index: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t \t\t \t ioEx);\t\t\t\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\t_indexWriter.commit(); \n\t\t\t} catch (IOException ioEx) {\n\t\t\t\tlog.error(\"Error truncating lucene index: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t ioEx);\n\t\t\t}\n\t\t}\n\t}",
"public void close() {}",
"public void closeDB() {\n\t\tSQLiteDatabase db = this.getReadableDatabase();\n\t\tif (db != null && db.isOpen())\n\t\t\tdb.close();\n\t}",
"public void close() {\n\t\t}",
"@Override\r\n @SuppressWarnings(\"empty-statement\")\r\n public void close()\r\n {\r\n curDb_ = null;\r\n curConnection_ = null;\r\n try\r\n {\r\n for(Map.Entry<Db_db, Connection> entry: connections_.entrySet())\r\n {\r\n entry.getValue().close();\r\n }\r\n }catch(Exception e){};\r\n \r\n connections_.clear();\r\n }",
"public void close()\r\n {\r\n DBHelper.close();\r\n }",
"public void close(){\n\t\tif(dbReadable != null && dbReadable.isOpen()){\n\t\t\tdbReadable.close();\n\t\t\tdbReadable = null;\n\t\t}\n\t\t\n\t\tif(dbWritable != null && dbWritable.isOpen()){\n\t\t\tdbWritable.close();\n\t\t\tdbWritable = null;\n\t\t}\n\t}",
"public void close () throws IOException , GateException {\n try{\n conn.close();\n }\n catch (SQLException e){\n log.error(\"Problem closing database connection\", e);\n System.exit(5);\n }\n\n }",
"public void close() {\r\n\t\tthis.mDbHelper.close();\r\n\t}",
"public void close()\n throws DataOrderingException;",
"public void close() {\n\t\t\r\n\t}",
"private void close() {\n\t\t\tDB.close(m_rs, m_pstmt);\n\t\t\tm_rs = null;\n\t\t\tm_pstmt = null;\n\t\t}",
"public void close() {\r\n\t}",
"public void close()\n\t\t{\n\t\t}",
"public void close() {\n }",
"public void close() {\n }",
"public void close() {\n }",
"void close();",
"void close();",
"void close();",
"void close();",
"void close();",
"void close();",
"void close();",
"void close();",
"void close();",
"void close();",
"void close();",
"void close();",
"void close();",
"void close();",
"void close();",
"void close();",
"void close();"
] | [
"0.8058744",
"0.76378155",
"0.758246",
"0.75362015",
"0.75083023",
"0.71673274",
"0.7136052",
"0.69909674",
"0.6962262",
"0.6899707",
"0.6881291",
"0.6881291",
"0.68670475",
"0.6831806",
"0.6819954",
"0.6772681",
"0.67622286",
"0.6728139",
"0.66900086",
"0.66650426",
"0.65936476",
"0.65509176",
"0.6502625",
"0.6499105",
"0.6492698",
"0.647742",
"0.64766586",
"0.64758754",
"0.6447493",
"0.6425228",
"0.6422043",
"0.6416813",
"0.6381072",
"0.6360569",
"0.6342018",
"0.63372034",
"0.6310421",
"0.626294",
"0.6250586",
"0.62386614",
"0.6231024",
"0.62195957",
"0.62195957",
"0.62195957",
"0.62195957",
"0.6201444",
"0.61616015",
"0.6161233",
"0.6161233",
"0.6161233",
"0.6161233",
"0.6161233",
"0.6161233",
"0.6161233",
"0.6161233",
"0.6161233",
"0.6161233",
"0.6161233",
"0.6161233",
"0.6161233",
"0.6161233",
"0.6161233",
"0.6160051",
"0.6155878",
"0.6145892",
"0.6143338",
"0.61339194",
"0.61322457",
"0.6130548",
"0.6130327",
"0.61170524",
"0.6116501",
"0.60975724",
"0.6089333",
"0.6086835",
"0.6084423",
"0.6082616",
"0.60794693",
"0.60724014",
"0.6070007",
"0.60664105",
"0.60451347",
"0.60451347",
"0.60451347",
"0.60433424",
"0.60433424",
"0.60433424",
"0.60433424",
"0.60433424",
"0.60433424",
"0.60433424",
"0.60433424",
"0.60433424",
"0.60433424",
"0.60433424",
"0.60433424",
"0.60433424",
"0.60433424",
"0.60433424",
"0.60433424",
"0.60433424"
] | 0.0 | -1 |
Reads an integer from the byte stream. | private int read_int(RandomAccessFile file) throws IOException {
int number = 0;
for (int i = 0; i < 4; ++i) {
number += (file.readByte() & 0xFF) << (8 * i);
}
return number;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int readInt() throws IOException {\n return in.readInt();\n }",
"public int readInt() throws IOException;",
"public static final int readInt(InputStream in) throws IOException {\n byte[] buff = new byte[4];\n StreamTool.readFully(in, buff);\n return getInt(buff, 0);\n }",
"int readInt() throws IOException;",
"private static int readInt(InputStream is) throws IOException {\n int a = is.read();\n int b = is.read();\n int c = is.read();\n int d = is.read();\n return a | b << 8 | c << 16 | d << 24;\n }",
"public static int readInt() {\n return Integer.parseInt(readString());\n }",
"public int readInt();",
"public int readInt() {\n return ((int) readLong());\n }",
"public int read() throws IOException;",
"public int readByte() {\n waitForData();\n try {\n return m_DataInputStream.readByte();\n }\n catch (IOException e) {\n return 256;\n }\n }",
"int readInt();",
"public int read() throws IOException {\n ensureOpen();\n return read(singleByteBuf, 0, 1) == -1 ? -1 : Byte.toUnsignedInt(singleByteBuf[0]);\n }",
"public final int read() throws IOException {\r\n\t\treturn f.read();\r\n\t}",
"private static int readInt(@Nullable byte[] data) {\n if (data == null || data.length == 0) {\n return 0;\n }\n int value = 0;\n for (byte b : data) {\n value <<= 8;\n value += (0xff & b);\n }\n return value;\n }",
"@Override\n\tpublic int read() throws IOException {\n\t\tif (buf.isReadable()) {\n return buf.readByte() & 0xff;\n }\n return -1;\n\t}",
"public static int readInt(InputStream source) throws IOException {\n int b1 = source.read();\n int b2 = source.read();\n int b3 = source.read();\n int b4 = source.read();\n if ((b1 | b2 | b3 | b4) < 0) {\n throw new EOFException();\n } else {\n return makeInt(b1, b2, b3, b4);\n }\n }",
"public int readUnsignedByte() throws IOException {\n\t\treturn read() | 0x00ff;\n\t}",
"protected static final int parseUnsignedByte(ByteArrayInputStream stream) throws EOFException\n {\n int value = stream.read();\n if (value < 0)\n {\n throw new EOFException(\"Corrupt section table - premature end of stream\");\n }\n return value;\n }",
"public byte[] readRawInt() throws IOException {\n byte[] bytes = new byte[5];\n bytes[0] = (byte) Type.INT.code;\n in.readFully(bytes, 1, 4);\n return bytes;\n }",
"private int getInt() {\n intBuffer.rewind();\n archive.read(intBuffer);\n intBuffer.flip();\n return intBuffer.getInt();\n }",
"public byte readByte() throws IOException {\n return in.readByte();\n }",
"public int read() throws IOException {\n/* 173 */ long next = this.pointer + 1L;\n/* 174 */ long pos = readUntil(next);\n/* 175 */ if (pos >= next) {\n/* 176 */ byte[] buf = this.data.get((int)(this.pointer >> 9L));\n/* */ \n/* 178 */ return buf[(int)(this.pointer++ & 0x1FFL)] & 0xFF;\n/* */ } \n/* 180 */ return -1;\n/* */ }",
"@Override\n public int read() throws IOException {\n return input.read();\n }",
"public static final int readUInt(InputStream in) throws IOException {\n byte[] buff = new byte[4];\n StreamTool.readFully(in, buff);\n return getUInt(buff, 0);\n }",
"public int readByte() {\n try {\n return in.read();\n } catch (IOException e) {\n print(\"Error reading byte from \" + portName);\n }\n return -1;\n }",
"byte readByte();",
"public int read ()\n {\n return (_buffer.remaining() > 0) ? (_buffer.get() & 0xFF) : -1;\n }",
"public static Integer readInteger(DataInputStream dis) throws IOException {\r\n\t\tif(dis.readBoolean())\r\n\t\t\treturn new Integer(dis.readInt());\r\n\t\treturn null;\r\n\t}",
"static int readInt() throws Exception {\n\t\treturn Integer.parseInt(readString());\n\t}",
"public int read() throws IOException {\n if (!started) {\n start();\n }\n if (buffer == null)\n return -1;\n if (bufpos == buflen) {\n buffer = refreshBuffer();\n if (buffer == null)\n return -1;\n }\n return 0xFF & buffer[bufpos++];\n }",
"public final int read() {\r\n \r\n if (cbyte == size) {\r\n return -1;\r\n }\r\n \r\n // Otherwise, the byte under the head at \"cbyte\" can be read.\r\n \r\n if (bytenum == BYTES_IN_ELEMENT) {\r\n // Read next byte\r\n offset++;\r\n elem = data[offset];\r\n bytenum = 0;\r\n }\r\n \r\n int rval = 0;\r\n rval = elem & 0xff;\r\n \r\n // increase byte position\r\n elem = elem >>> 8; // unsigned SHR\r\n bytenum++;\r\n cbyte++;\r\n \r\n return rval;\r\n }",
"@Override\n public final int readVarint32() throws IOException {\n return (int) readVarint64();\n }",
"public static int readNumberFromBytes(byte[] data) {\n return readNumberFromBytes(data, data.length, 0);\n }",
"public int get_reading() {\n return (int)getUIntBEElement(offsetBits_reading(), 16);\n }",
"int readFrom(byte[] iStream, int pos, ORecordVersion version);",
"public int read() {\n return (readInt());\n }",
"public int readInt() {\n return Integer.parseInt(readNextLine());\n }",
"public int readInt() throws IOException {\n int token = fTokenizer.nextToken();\n if (token == StreamTokenizer.TT_NUMBER)\n return (int) fTokenizer.nval;\n\n String msg = \"Integer expected in line: \" + fTokenizer.lineno();\n throw new IOException(msg);\n }",
"public static int read4bytes(InputStream inputStream) throws IOException {\n int b, value = 0;\n for (int i = 3; i >= 0; i--) {\n b = inputStream.read();\n if (b < 0) throw new EOFException();\n value |= b << i * 8;\n }\n return value;\n }",
"public int read() throws IOException {\n if (closed)\n throw new IOException(\"requestStream.read.closed\");\n\n // Have we read the specified content length already?\n if ((length >= 0) && (count >= length))\n return (-1); // End of file indicator\n\n // Read and count the next byte, then return it\n int b = stream.read();\n if (b >= 0)\n count++;\n return (b);\n }",
"@Override\n public int read(final byte[] b) throws IOException {\n return input.read(b);\n }",
"private int readByte() {\n return src[srcPos++] & 0xFF;\n }",
"public int readRaw()\r\n {\r\n \tbyte[] buf = new byte[1];\r\n \treadRaw(buf, 0, 1);\r\n \treturn buf[0] & 0xFF;\r\n }",
"public int read_int32() throws IOException {\n byte bytes[] = read_bytes(4);\n\n return bytesToInt32(bytes, Endianness.BIG_ENNDIAN);\n }",
"@Override\n\tpublic int read() {\n\t\treturn super.read();\n\t}",
"String intRead();",
"private final int readBytes( int number ) throws IOException {\n byte[] buffer = new byte[ number ];\n int read = dataSource.read( buffer, 0, number );\n\n if ( read != buffer.length ) {\n if ( read < 0 ) throw new IOException( \"End of Stream\" );\n for ( int i = read; i < buffer.length; i++ ) buffer[ i ] = (byte)readByte();\n }\n \n\t/**\n * Create integer\n */\n switch ( number ) {\n case 1: return (buffer[ 0 ] & 0xff);\n\t case 2: return (buffer[ 0 ] & 0xff) | ((buffer[ 1 ] & 0xff) << 8);\n\t case 3: return (buffer[ 0 ] & 0xff) | ((buffer[ 1 ] & 0xff) << 8) | ((buffer[ 2 ] & 0xff) << 16);\n\t case 4: return (buffer[ 0 ] & 0xff) | ((buffer[ 1 ] & 0xff) << 8) | ((buffer[ 2 ] & 0xff) << 16) | ((buffer[ 3 ] & 0xff) << 24);\n\t default: throw new IOException( \"Illegal Read quantity\" );\n\t}\n }",
"public int readFromDataStream( MixedDataInputStream in )\n {\n try {\n etype = new Integer( in.readInt() );\n pad = in.readInt();\n color = in.readString( StrColor.BYTESIZE );\n name = in.readString( StrDesc.BYTESIZE );\n format = in.readString( StrFormat.BYTESIZE );\n } catch ( IOException ioerr ) {\n ioerr.printStackTrace();\n return 0;\n }\n\n return BYTESIZE;\n }",
"public int read(int i);",
"public int readInt() {\n\t\tif(!isInit) return 0;\n\t\tint result = 0;\n\t\tisListening = true;\n\t\twriteLine(\"Waiting for Integer input...\");\n\t\twhile(isListening) {\n\t\t\ttry {\n\t\t\t\tresult = Integer.parseInt(inputArea.getText());\n\t\t\t} catch(NumberFormatException nfe) {\n\t\t\t\tresult = 0;\n\t\t\t}\n\t\t}\n\t\tinputArea.setText(\"\");\n\t\twriteLine(\"Input: \" + result);\n\t\treturn result;\n\t}",
"abstract int readInt(int start);",
"public final int read(byte[] b) throws IOException {\r\n\t\treturn f.read( b );\r\n\t}",
"public byte read(int param1) {\n }",
"public static int deserializeInteger(ByteBuffer bb) {\n return bb.getInt();\n }",
"public int read() throws FTD2XXException {\n byte[] c = new byte[1];\n int ret = read(c);\n return (ret == 1) ? (c[0] & 0xFF) : -1;\n }",
"public long readLong() throws IOException {\n return in.readLong();\n }",
"public byte readByte() {\n return ((byte) readLong());\n }",
"public int readInt(){\n\t\tif(sc.hasNextInt()){\n\t\t\treturn sc.nextInt();\n\t\t}\n\t\tsc.nextLine();\n\t\treturn -1;\n\t}",
"public static int readInt(){\n\t\tSystem.out.println();\n\t\tstringInput = readInput();\n\t\ttry{\n\t\t\tintInput = Integer.parseInt(stringInput);\n\t\t}\n\t\tcatch (NumberFormatException ex) {\n\t\t System.err.println(\"Not a valid number: \" + stringInput);\n\t\t}\n\t\treturn intInput; \t\t\n\t}",
"@Override\n public int readUnsignedByte() throws IOException\n {\n if (!hasRemaining())\n {\n throw new IOException(\"End off buffer reached\");\n }\n return randomAccessRead.read();\n }",
"public Integer readIntegerFromCmd() throws IOException {\r\n\t\tSystem.out.println(\"Enter your number:\");\r\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tString number = null;\r\n\t\tnumber = br.readLine();\r\n\t\treturn new Integer(number);\r\n\t}",
"protected final long parseUnsignedInt(ByteArrayInputStream stream) throws EOFException\n {\n long value = 0;\n for (int i = 0; i < 4; ++i)\n {\n value = (value << 8) | EASMessage.parseUnsignedByte(stream);\n }\n return value;\n }",
"public synchronized int read() throws IOException {\n if (in == null) {\n throw new IOException(\"Stream Closed\");\n }\n\n byte result;\n if (slack != null && begin < slack.length) {\n result = slack[begin];\n if (++begin == slack.length) {\n\tslack = null;\n }\n } else {\n byte[] buf = new byte[1];\n if (read(buf, 0, 1) <= 0) {\n\treturn -1;\n } else {\n\tresult = buf[0];\n }\n }\n\n return result & 0xFF;\n }",
"public static int getInt() throws IOException {\n String s = getString();\n return Integer.parseInt(s);\n }",
"protected final int readBytes()\n throws IOException\n {\n _inputPtr = 0;\n _inputEnd = 0;\n if (_inputSource != null) {\n int count = _inputSource.read(_inputBuffer, 0, _inputBuffer.length);\n if (count > 0) {\n _inputEnd = count;\n }\n return count;\n }\n return -1;\n }",
"public static int getInt() throws IOException {\r\n String s = getString();\r\n return Integer.parseInt(s);\r\n }",
"@Override\n\tpublic int ReadByte()\n\t{\n//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:\n//ORIGINAL LINE: byte[] oneByteBuffer = new byte[1];\n\t\tbyte[] oneByteBuffer = new byte[1];\n\t\tint num = Read(oneByteBuffer, 0, 1);\n\t\tif (num <= 0)\n\t\t{\n\t\t\t// return -1 to indicate that no byte was read.\n\t\t\treturn -1;\n\t\t}\n\t\treturn oneByteBuffer[0];\n\t}",
"public int getInt2() {\n\t\tfinal int b1 = payload.get() & 0xFF;\n\t\tfinal int b2 = payload.get() & 0xFF;\n\t\tfinal int b3 = payload.get() & 0xFF;\n\t\tfinal int b4 = payload.get() & 0xFF;\n\t\treturn b2 << 24 & 0xFF | b1 << 16 & 0xFF | b4 << 8 & 0xFF | b3 & 0xFF;\n\t}",
"public int read(byte b[]) throws IOException {\r\n return read(b, 0, b.length);\r\n }",
"@Override\n\tpublic byte readByte() throws IOException {\n\t\treturn (byte) (_buff.get() & 0xFF);\n\t}",
"public int read(byte[] p_bytes, int p_offset, int p_length);",
"public void read(DataInputStream in) throws IOException;",
"static int readRawVarint32(InputStream input) throws IOException {\r\n int result = 0;\r\n int offset = 0;\r\n for (; offset < 32; offset += 7) {\r\n int b = input.read();\r\n if (b == -1) {\r\n throw new EOFException(\"stream is truncated\");\r\n }\r\n result |= (b & 0x7f) << offset;\r\n if ((b & 0x80) == 0) {\r\n return result;\r\n }\r\n }\r\n // Keep reading up to 64 bits.\r\n for (; offset < 64; offset += 7) {\r\n int b = input.read();\r\n if (b == -1) {\r\n throw new EOFException(\"stream is truncated\");\r\n }\r\n if ((b & 0x80) == 0) {\r\n return result;\r\n }\r\n }\r\n throw new IOException(\"malformed varInt\");\r\n }",
"long readLong() throws IOException;",
"long readS32BE()\n throws IOException, EOFException;",
"@Override\n public int read() throws IOException {\n int r = -1;\n \n if (encryptedDataBuffer!=null && pos>=encryptedDataBuffer.length && !closed)\n fillBuffer();\n \n if (encryptedDataBuffer!=null && pos<encryptedDataBuffer.length)\n r = (int)encryptedDataBuffer[pos++]; // next element in the buffer\n return r;\n }",
"int read(byte[] buffer, int bufferOffset, int length) throws IOException;",
"public byte readByte() throws IOException {\n\t\treturn (byte) read();\n\t}",
"public int read() throws IOException {\n if (!_open)\n return -1;\n long _here = position();\n int val = _backing.read();\n if (val >= 0) {\n val = _head.crypt((byte) val, _here);\n }\n return val;\n }",
"public int read()\n throws IOException\n {\n if ( position == this.buffer.length() )\n {\n return -1;\n }\n\n return this.buffer.charAt( this.position++ );\n }",
"public int read() {\n\t\tif (bufferIndex == bufferLast)\n\t\t\treturn -1;\n\n\t\tsynchronized (buffer) {\n\t\t\tint outgoing = buffer[bufferIndex++] & 0xff;\n\t\t\tif (bufferIndex == bufferLast) { // rewind\n\t\t\t\tbufferIndex = 0;\n\t\t\t\tbufferLast = 0;\n\t\t\t}\n\t\t\treturn outgoing;\n\t\t}\n\t}",
"public int read() throws IOException {\n if(available() == 0) throw new EOFException(\"No data available.\");\n int ret = data.getFirst().get();\n updateBufferList();\n return ret;\n }",
"int decode()\n throws IOException {\n final int start = _in.getBytesRead() - 4;\n \n _callback.objectStart();\n while ( decodeElement() );\n _callback.objectDone();\n \n final int read = _in.getBytesRead() - start;\n\n if ( read != _in._length ) {\n //throw new IllegalArgumentException( \"bad data. lengths don't match \" + read + \" != \" + len );\n }\n\n return _in._length;\n }",
"private int read() throws IOException {\n int c = this.in.read();\n if (c == -1)\n throw new EOFException();\n return c;\n }",
"boolean readByte(int c, String streamProvider) throws RawDataEventException ;",
"public int readValue() { \n\t\treturn (port.readRawValue() - offset); \n\t}",
"public static int readIntFromBytes(byte[] data, int startIndex) {\n return readNumberFromBytes(data, Constants.INTEGER_SIZE, startIndex);\n }",
"@Override\n public int read(byte[] byteBuffer) throws IOException {\n return this.read(byteBuffer, 0, byteBuffer.length);\n }",
"@Override\n public int read() throws IOException\n {\n try\n {\n byte [] buff = fAVMRemote.readInput(fTicketHolder.getTicket(), fHandle, 1);\n if (buff.length == 0)\n {\n return -1;\n }\n return ((int)buff[0]) & 0xff;\n }\n catch (Exception e)\n {\n throw new IOException(\"Remote I/O Error.\");\n }\n }",
"public static byte readByte(InputStream input) throws IOException {\n\n return readBytes(input, 1)[0];\n }",
"@Test\n void testReadIntPacked() throws IOException {\n byte[] input = new byte[]{(byte) 0x35, (byte) 0x54};\n r = new BitReader(input);\n assertEquals(5402, r.readIntPacked());\n }",
"private int readStream(final DataInputStream dis)\n\t\tthrows IOException {\n\t\tif(dis.readInt() > MAX_PROTOCOL_VERSION) {\n\t\t\treturn E_UNSUPPORTED_PROTOCOL_VERSION;\n\t\t}\n\n\t\tint length = dis.readInt();\n\t\tLog.i(\"PhoneLink\", \"Received a \"+length+\" byte parcel\");\n\t\tbyte[] data = new byte[length];\n\t\tint position = 0;\n\t\tdo {\n\t\t\tposition += dis.read(data, position, length-position);\n\t\t} while(position < length);\n\n\t\tParcel parcel = Parcel.obtain();\n\t\tparcel.unmarshall(data, 0, length);\n\t\tparcel.setDataPosition(0);\n\t\tIntent newIntent = (Intent) parcel.readValue(Intent.class.getClassLoader());\n\t\tmIntentHandler.processIntent(newIntent);\n\t\treturn OK;\n\t}",
"@Override\n public int read() throws IOException {\n if (pos >= count) {\n fill();\n if (pos >= count) {\n return -1;\n }\n }\n checkIfClosed();\n return buf[pos++] & 0xFF;\n }",
"public static int readLittleEndianInt(byte[] bytes) {\n int signum = 1;\n if ((bytes[0] & 0x80) != 0) {\n signum = -1;\n bytes[0] &= 0x7F;\n }\n return new BigInteger(signum, bytes).intValue();\n }",
"public static int readInt( String message) throws IOException {\n\t\tint number=0;\n\t\tint redFlag=0;\n\t\twhile(redFlag==0){\n\t\t\tSystem.out.print(message);\n\t\t\ttry{\n\t\t\t\t\tnumber = Integer.parseInt(read.readLine());\n\t\t\t\t\tredFlag=1;\n\t\t\t}\n\t\t\tcatch (Exception e){\n\t\t\t\tSystem.out.print(\"You must enter numbers\\n\");\n\t\t\t\tredFlag=0;\n\t\t\t}\n\t\t}\n\t\treturn (number); \n\t}",
"int read(long pos, byte[] buf)throws IOException;",
"public static int readNumberFromBytes(byte[] data, int readSize, int startIndex) {\n int value = 0;\n for (int i = 0; i < readSize; i++)\n value += ((long) data[startIndex + i] & 0xFFL) << (Constants.BITS_PER_BYTE * i);\n return value;\n }",
"int readS16BE()\n throws IOException, EOFException;",
"@Override\n\tpublic int read() {\n\t\tint lowByte = getFirstArg();\n\t\tint highByte = getSecondArg();\n\t\tint address = highByte;\n\t\taddress = address << 8;\n\t\taddress |= lowByte;\n\t\treturn CpuMem.getInstance().readMem(address);\n\t}",
"private static Integer getInteger(BufferedReader reader) throws IOException{\n Integer result=null;\n while(result==null) {\n try {\n result = Integer.parseInt(reader.readLine().trim());\n } catch (NumberFormatException e) {\n throw new NumberFormatException(\"You should feed integer for this input.\");\n }\n }\n return result;\n }"
] | [
"0.7589677",
"0.745604",
"0.7343956",
"0.7236958",
"0.7231928",
"0.714644",
"0.7130498",
"0.7094766",
"0.6826128",
"0.6723859",
"0.66989094",
"0.668464",
"0.6654532",
"0.66467506",
"0.6641267",
"0.6631256",
"0.66311204",
"0.66090506",
"0.6605669",
"0.65817565",
"0.6575696",
"0.6569089",
"0.65681964",
"0.6565136",
"0.6564054",
"0.654495",
"0.6544752",
"0.6541974",
"0.6541876",
"0.650085",
"0.6477518",
"0.6475899",
"0.6442107",
"0.64208573",
"0.6403835",
"0.6397131",
"0.6376185",
"0.636641",
"0.63605905",
"0.63604975",
"0.63380927",
"0.6330495",
"0.63300794",
"0.6329632",
"0.6313751",
"0.6308702",
"0.62959987",
"0.62953544",
"0.62910813",
"0.62838155",
"0.62699366",
"0.6256636",
"0.6251216",
"0.62269586",
"0.62181014",
"0.6211371",
"0.6208775",
"0.61984736",
"0.61803126",
"0.6170578",
"0.61469334",
"0.614477",
"0.6135872",
"0.60998917",
"0.608924",
"0.6081498",
"0.6074383",
"0.6071245",
"0.6068758",
"0.6012045",
"0.5994044",
"0.59891254",
"0.59886724",
"0.5985728",
"0.5983386",
"0.59732056",
"0.596705",
"0.59600943",
"0.59563065",
"0.59536827",
"0.594668",
"0.5943752",
"0.5939858",
"0.59353536",
"0.59321237",
"0.5919522",
"0.59143084",
"0.58849436",
"0.58700275",
"0.58700174",
"0.58619946",
"0.5859225",
"0.5856184",
"0.5852052",
"0.58425057",
"0.58393437",
"0.5835903",
"0.5833629",
"0.5830416",
"0.58213747"
] | 0.62032396 | 57 |
Reads a long integer from the byte stream. | private long read_long(RandomAccessFile file) throws IOException {
long number = 0;
for (int i = 0; i < 8; ++i) {
number += ((long) (file.readByte() & 0xFF)) << (8 * i);
}
return number;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"long readLong() throws IOException;",
"public long readLong() throws IOException;",
"public long readLong() throws IOException {\n return in.readLong();\n }",
"public static final long readLong(InputStream in) throws IOException {\n byte[] buff = new byte[8];\n StreamTool.readFully(in, buff);\n return getLong(buff, 0);\n }",
"long readLong();",
"private synchronized long readLong(int len) throws IOException {\n\t\tread(bytes, len);\n\t\treturn readLong(bytes, 0, len);\n\t}",
"public abstract int read_long();",
"public static long readlong()\n\t{\n\t\treturn sc.nextLong();\n\t}",
"String longRead();",
"private long read_long(MappedByteBuffer buff) throws IOException {\n long number = 0;\n for (int i = 0; i < 8; ++i) {\n number += ((long) (buff.get() & 0xFF)) << (8 * i);\n }\n return number;\n }",
"private long getLong() {\n longBuffer.rewind();\n archive.read(longBuffer);\n longBuffer.flip();\n return longBuffer.getLong();\n }",
"long readS64LE()\n throws IOException, EOFException;",
"public abstract long read_longlong();",
"public static long readLong(byte[] source, int position) {\n return makeLong(source[position], source[position + 1], source[position + 2], source[position + 3],\n source[position + 4], source[position + 5], source[position + 6], source[position + 7]);\n }",
"public abstract long read_ulonglong();",
"long readS64BE()\n throws IOException, EOFException;",
"public long readLong() {\n while (isEmpty()) {\n }\n Timing.waitSyncLocal();\n readEnable.setNow(1);\n Timing.waitClockLocal();\n return (readData.getLong());\n }",
"public long readLong() {\n\t\tif(!isInit) return 0L;\n\t\tlong result = 0L;\n\t\tisListening = true;\n\t\twriteLine(\"Waiting for Long input...\");\n\t\twhile(isListening) {\n\t\t\ttry {\n\t\t\t\tresult = Long.parseLong(inputArea.getText());\n\t\t\t} catch(NumberFormatException nfe) {\n\t\t\t\tresult= 0L;\n\t\t\t}\n\t\t}\n\t\tinputArea.setText(\"\");\n\t\twriteLine(\"Input: \" + result);\n\t\treturn result;\n\t}",
"public long readVarLong() throws IOException {\n final int type = (int) this.read(2).toLong();\n return this.read(BitOutputStream.varLongDepths[type]).toLong();\n }",
"@Test\n\tpublic void testTooLargeValueBinaryReaderStreamPosition() throws IOException {\n\n\t\tbyte[] bytes =\n\t\t\tbytes(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x1, 0x2);\n\t\tInputStream is = is(bytes);\n\n\t\ttry {\n\t\t\tlong value = LEB128.read(is, false);\n\t\t\tAssert.fail(\n\t\t\t\t\"Should not be able to read a LEB128 that is larger than what can fit in java 64bit long int: \" +\n\t\t\t\t\tLong.toUnsignedString(value));\n\t\t}\n\t\tcatch (IOException ioe) {\n\t\t\t// good\n\t\t}\n\n\t\tAssert.assertEquals(bytes.length - 10, is.available());\n\t}",
"public static long readLong(String prompt) throws IOException {\r\n\t\tlong value = 0;\r\n\t\twhile (true) {\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.print(prompt + \" _>\");\r\n\t\t\t\tvalue = Long.valueOf(reader.readLine()).longValue();\r\n\t\t\t\tbreak;\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tSystem.err.println(ex.getLocalizedMessage());\r\n\t\t\t\tthrow ex;\r\n\t\t\t} catch (NumberFormatException ex) {\r\n\t\t\t\tSystem.err.println(\"Conversion Error: \" + ex.getLocalizedMessage());\r\n\t\t\t\treturn readLong(\"Try again: \" + prompt);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn value;\r\n\t}",
"public long readAsLong(int nrBits) {\n return readAsLong(bitPos, nrBits, ByteOrder.BigEndian);\n }",
"public long readLong()\r\n/* 435: */ {\r\n/* 436:448 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 437:449 */ return super.readLong();\r\n/* 438: */ }",
"long decodeLong();",
"public byte[] readRawLong() throws IOException {\n byte[] bytes = new byte[9];\n bytes[0] = (byte) Type.LONG.code;\n in.readFully(bytes, 1, 8);\n return bytes;\n }",
"@Override\n public long readSInt64() throws IOException {\n long value = decoder.readVarint64();\n return (value >>> 1) ^ -(value & 1);\n }",
"public long readLongNonBlock() {\n Timing.throughputLocal(0);\n readEnable.setNow(1);\n Timing.waitClockLocal();\n return (readData.getLong());\n }",
"public long readLongLE()\r\n/* 853: */ {\r\n/* 854:862 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 855:863 */ return super.readLongLE();\r\n/* 856: */ }",
"long fetch64(BytesStore bytes, @NonNegative long off) throws IllegalStateException, BufferUnderflowException {\n return bytes.readLong(off);\n }",
"public static double readLong() {\n return Long.parseLong(readString());\n }",
"public int readInt() {\n return ((int) readLong());\n }",
"public String getLong(long offset) throws IOException {\n\t\tdataBase.seek(offset);\n\t\tString[] array = dataBase.readLine().split(\"\\\\|\");\n\t\treturn array[8];\n\t}",
"public final long getLong(final boolean endianess) throws IOException {\r\n b1 = (tagBuffer[bPtr] & 0xff);\r\n b2 = (tagBuffer[bPtr + 1] & 0xff);\r\n b3 = (tagBuffer[bPtr + 2] & 0xff);\r\n b4 = (tagBuffer[bPtr + 3] & 0xff);\r\n b5 = (tagBuffer[bPtr + 4] & 0xff);\r\n b6 = (tagBuffer[bPtr + 5] & 0xff);\r\n b7 = (tagBuffer[bPtr + 6] & 0xff);\r\n b8 = (tagBuffer[bPtr + 7] & 0xff);\r\n\r\n long tmpLong;\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n tmpLong = ( ((long) b1 << 56) | ((long) b2 << 48) | ((long) b3 << 40) | ((long) b4 << 32)\r\n | ((long) b5 << 24) | ((long) b6 << 16) | ((long) b7 << 8) | b8);\r\n } else {\r\n tmpLong = ( ((long) b8 << 56) | ((long) b7 << 48) | ((long) b6 << 40) | ((long) b5 << 32)\r\n | ((long) b4 << 24) | ((long) b3 << 16) | ((long) b2 << 8) | b1);\r\n }\r\n\r\n bPtr += 8;\r\n\r\n return (tmpLong);\r\n }",
"long readS32LE()\n throws IOException, EOFException;",
"private long getNumberBufAsLong(ByteOrder byteOrder, int nrReadBytes,\n int firstBytePos) {\n\n long result = 0L;\n long bytePortion = 0L;\n for (int i = 0; i < nrReadBytes; i++) {\n bytePortion = 0xFF & (byteBuffer.get(firstBytePos++));\n\n if (byteOrder == ByteOrder.LittleEndian)\n // reshift bytes\n result = result | bytePortion << (i << 3);\n else\n result = bytePortion << ((nrReadBytes - i - 1) << 3) | result;\n }\n\n return result;\n }",
"public int read(long[] l) throws IOException {\n\t\treturn read(l, 0, l.length);\n\t}",
"public static final long readULong(InputStream in) throws IOException {\n byte[] buff = new byte[8];\n StreamTool.readFully(in, buff);\n return getULong(buff, 0);\n }",
"protected final long parseUnsignedInt(ByteArrayInputStream stream) throws EOFException\n {\n long value = 0;\n for (int i = 0; i < 4; ++i)\n {\n value = (value << 8) | EASMessage.parseUnsignedByte(stream);\n }\n return value;\n }",
"@Override\n\tpublic int decode(byte[] buffer, int offset) throws IOException {\n\t\tlong value = NeuronReader.readRawInt64(buffer, offset);\n\t\tunionCache.setLong(fieldIndex, value);\n\n\t\treturn NeuronReader.LONG_SIZE;\n\t}",
"public final Long _parseLong(JsonParser jVar, DeserializationContext gVar) throws IOException {\n int m = jVar.mo29329m();\n if (m == 3) {\n return (Long) _deserializeFromArray(jVar, gVar);\n }\n if (m == 11) {\n return (Long) _coerceNullToken(gVar, this._primitive);\n }\n switch (m) {\n case 6:\n String trim = jVar.mo29334t().trim();\n if (trim.length() == 0) {\n return (Long) _coerceEmptyString(gVar, this._primitive);\n }\n if (_hasTextualNull(trim)) {\n return (Long) _coerceTextualNull(gVar, this._primitive);\n }\n _verifyStringForScalarCoercion(gVar, trim);\n try {\n return Long.valueOf(NumberInput.m23786b(trim));\n } catch (IllegalArgumentException unused) {\n return (Long) gVar.mo31517b(this._valueClass, trim, \"not a valid Long value\", new Object[0]);\n }\n case 7:\n return Long.valueOf(jVar.mo29248D());\n case 8:\n if (!gVar.mo31509a(DeserializationFeature.ACCEPT_FLOAT_AS_INT)) {\n _failDoubleToIntCoercion(jVar, gVar, \"Long\");\n }\n return Long.valueOf(jVar.mo29297L());\n default:\n return (Long) gVar.mo31493a(this._valueClass, jVar);\n }\n }",
"public long getLong() throws NoSuchElementException,\n\t NumberFormatException\n {\n\tString s = tokenizer.nextToken();\n\treturn Long.parseLong(s);\n }",
"@Override\n\tpublic long readScalarLong() throws IOException {\n\t\treturn 0;\n\t}",
"public long toLong()\n\t{\n\t\t// holds the int to return\n\t\tlong result = 0;\n\t\t\n\t\t// for every byte value\n\t\tfor (int i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\t// Extract the bits out of the array by \"and\"ing them with the\n\t\t\t// maximum value of\n\t\t\t// a byte. This is done because java does not support unsigned\n\t\t\t// types. Now that the\n\t\t\t// unsigned byte has been extracted, shift it to the right as far as\n\t\t\t// it is needed.\n\t\t\t// Examples:\n\t\t\t// byte array int\n\t\t\t// {0x01, 0x00} = 256\n\t\t\t//\n\t\t\t// byte array int\n\t\t\t// {0x01, 0x8C 0xF0} = 0x018CF0\n\t\t\tresult += (byteToLong(bytes[i]) << (Byte.SIZE * (bytes.length - i - 1)));\n\t\t}\n\t\t\n\t\t// return the int\n\t\treturn result;\n\t}",
"public long getLong(int addr) throws ProgramException {\n return getLittleEndian(addr, Long.BYTES);\n }",
"@Test(expected = IOException.class)\n\tpublic void testToolargeUnsigned() throws IOException {\n\t\tInputStream is = is(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02);\n\n\t\tlong value = LEB128.read(is, false);\n\t\tAssert.fail(\n\t\t\t\"Should not be able to read a LEB128 that is larger than what can fit in java 64bit long int: \" +\n\t\t\t\tvalue);\n\t}",
"@Override\n public long applyAsLong(BytesStore bytes) {\n return applyAsLong(bytes, bytes.readRemaining());\n }",
"long readS32BE()\n throws IOException, EOFException;",
"public static long getLong(final byte[] buffer, final int index, final int len) {\n switch (len) {\n case 0: return 0xFFFFFFFF_FFFFFFFFL;\n case 1: return 0xFFFFFFFF_FFFFFF00L | _getByte(buffer, index, 1);\n case 2: return 0xFFFFFFFF_FFFF0000L | _getShort(buffer, index, 2);\n case 3: return 0xFFFFFFFF_FF000000L | _getInt(buffer, index, 3);\n case 4: return 0xFFFFFFFF_00000000L | _getInt(buffer, index, 4);\n case 5: return 0xFFFFFF00_00000000L | _getLong(buffer, index, 5);\n case 6: return 0xFFFF0000_00000000L | _getLong(buffer, index, 6);\n case 7: return 0xFF000000_00000000L | _getLong(buffer, index, 7);\n case 8: return _getLong(buffer, index, 8);\n default: throw new IllegalArgumentException(\"len is out of range: \" + len);\n }\n }",
"@Override\r\n\tpublic long getLong(int pos) {\n\t\treturn buffer.getLong(pos);\r\n\t}",
"public long getLong(String key) {\n long result;\n Object value = get(key);\n if (value instanceof Long) {\n result = (Long)value;\n } else if (value instanceof String) {\n try {\n String valueString = (String)value;\n if (valueString.length() == 0) {\n result = 0;\n } else if (valueString.charAt(0) == '-') {\n result = Long.parseLong(valueString);\n } else {\n result = Long.parseUnsignedLong((String)value);\n }\n } catch (NumberFormatException exc) {\n result = 0;\n }\n } else {\n result = 0;\n }\n return result;\n }",
"public long getLong(String key) {\n\t\tString value = getString(key);\n\t\t\n\t\ttry {\n\t\t\treturn Long.parseLong(value);\n\t\t}\n\t\tcatch( NumberFormatException e ) {\n\t\t\tthrow new IllegalStateException( \"Illegal value for long integer configuration parameter: \" + key);\n\t\t}\n\t}",
"public long nextLong()\r\n\t{\r\n\t\tif(st == null || !st.hasMoreTokens())\r\n\t\t\tnewst();\r\n\t\treturn Long.parseLong(st.nextToken());\r\n\t}",
"public int read(long[] l, int start, int len) throws IOException {\n\n\t\tint i = start;\n\t\ttry {\n\t\t\tfor (; i < start + len; i += 1) {\n\t\t\t\tif (count - pos < 8) {\n\t\t\t\t\tfillBuf(8);\n\t\t\t\t}\n\t\t\t\tint i1 = buf[pos] << 24 | (buf[pos + 1] & 0xFF) << 16\n\t\t\t\t\t\t| (buf[pos + 2] & 0xFF) << 8 | (buf[pos + 3] & 0xFF);\n\t\t\t\tint i2 = buf[pos + 4] << 24 | (buf[pos + 5] & 0xFF) << 16\n\t\t\t\t\t\t| (buf[pos + 6] & 0xFF) << 8 | (buf[pos + 7] & 0xFF);\n\t\t\t\tl[i] = ((long) i1) << 32 | ((long) i2 & 0x00000000FFFFFFFFL);\n\t\t\t\tpos += 8;\n\t\t\t}\n\n\t\t} catch (EOFException e) {\n\t\t\treturn eofCheck(e, i, start, 8);\n\t\t}\n\t\treturn 8 * len;\n\t}",
"@Test\n public void testReadWriteLong() {\n System.out.println(\"readLong\");\n ByteArray instance = new ByteArray();\n \n instance.writeLong(12, 0);\n instance.writeLong(12345678, 8);\n instance.writeLong(13, instance.compacity());\n \n assertEquals(12, instance.readLong(0));\n assertEquals(12345678, instance.readLong(8));\n assertEquals(13, instance.readLong(instance.compacity() - 8));\n \n instance.writeLong(14, 8);\n assertEquals(14, instance.readLong(8));\n }",
"public abstract int read_ulong();",
"public abstract void read_long_array(int[] value, int offset, int\nlength);",
"public long[] read();",
"long readS64LE(String name)\n throws IOException, EOFException;",
"private long byteToLong(byte b)\n\t{\n\t\treturn (b & 0xFF);\n\t}",
"public static long parseLong(CharSequence seq) {\n long result = 0;\n int max = seq.length() - 1;\n long position = 1;\n boolean negative = false;\n for (int i = max; i >= 0; i--) {\n char c = seq.charAt(i);\n switch (c) {\n case '-':\n if (i == 0) {\n negative = true;\n continue;\n }\n throw new NumberFormatException(\"- encountered not at start of '\" + seq + \"'\");\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n long prev = result;\n result += position * (c - '0');\n if (prev > result) {\n throw new NumberFormatException(\"Number too large for long: '\" + seq + \"' - \"\n + \" \" + prev + \" + \" + (position * (c - '0')) + \" = \" + result);\n }\n position *= 10;\n continue;\n default:\n throw new NumberFormatException(\"Illegal character '\" + c + \"' in number '\" + seq + \"'\");\n }\n }\n return negative ? -result : result;\n }",
"public static long readLong(File file) \n\t\t\t\t\t\t throws Exception{\n\t\tBufferedReader br = null;\n\t\ttry {\n\t\t\tbr = new BufferedReader(\n\t\t\t\tnew InputStreamReader(new FileInputStream(file))\t\n\t\t\t);\n\t\t\tString line = br.readLine().trim();\n\t\t\treturn Long.parseLong(line);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow e;\n\t\t} finally{\n\t\t\tif(br != null){\n\t\t\t\tbr.close();\n\t\t\t}\n\t\t}\n\t}",
"public static long getBytesAsLong(byte[] b) {\n\t\treturn ((long) (b[0] & 0xff) << 56)\n\t\t\t\t| ((long) (b[1] & 0xFF) << 48)\n\t\t\t\t| ((long) (b[2] & 0xFF) << 40)\n\t\t\t\t| ((long) (b[3] & 0xFF) << 32)\n\t\t\t\t| ((long) (b[4] & 0xFF) << 24)\n\t\t\t\t| ((long) (b[5] & 0xFF) << 16)\n\t\t\t\t| ((long) (b[6] & 0xFF) << 8)\n\t\t\t\t| ((long) (b[7] & 0xFF));\n\t}",
"public static long parseLong(final CharSequence s)\n {\n // no string\n if (s == null)\n {\n throw new NumberFormatException(\"null\");\n }\n\n // determine length\n final int length = s.length();\n\n if (length == 0)\n {\n throw new NumberFormatException(\"length = 0\");\n }\n\n // that is safe, we already know that we are > 0\n final int digit = s.charAt(0);\n\n // turn the compare around to allow the compiler and cpu\n // to run the next code most of the time\n if (digit < '0' || digit > '9')\n {\n return Long.parseLong(s.toString());\n }\n\n long value = digit - DIGITOFFSET;\n\n for (int i = 1; i < length; i++)\n {\n final int d = s.charAt(i);\n if (d < '0' || d > '9')\n {\n throw new NumberFormatException(\"Not a long \" + s.toString());\n }\n\n value = ((value << 3) + (value << 1));\n value += (d - DIGITOFFSET);\n }\n\n return value;\n }",
"long getLongValue();",
"long getLongValue();",
"void writeLong(long v) throws IOException;",
"public long readUnsignedIntLE()\r\n/* 847: */ {\r\n/* 848:856 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 849:857 */ return super.readUnsignedIntLE();\r\n/* 850: */ }",
"public final long getLong(final String tagToGet) {\n try {\n return Long.parseLong(getStr(tagToGet));\n } catch (final Exception t) {\n return 0;\n }\n }",
"public static long bytesToLong(byte[] bytes) {\n\n ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);\n return byteBuffer.getLong();\n\n }",
"public long getLongValue() {\n if (typeCase_ == 3) {\n return (java.lang.Long) type_;\n }\n return 0L;\n }",
"@ZenCodeType.Caster\n @ZenCodeType.Method\n default long asLong() {\n \n return notSupportedCast(BasicTypeID.LONG);\n }",
"public Long getLong(String key) throws JsonException {\r\n\t\tObject object = get(key);\r\n\t\tLong result = PrimitiveDataTypeConvertor.toLong(object);\r\n\t\tif (result == null) {\r\n\t\t\tthrow PrimitiveDataTypeConvertor.exceptionType(key, object, \"Long\");\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public Long getLong(String key)\n\t{\n\t\tverifyParseState();\n\t\t\n\t\tValue value = values.get(key);\n\t\tif(value == null || value.value == null)\n\t\t\treturn null;\n\t\tif(value.type != ValueType.LONG)\n\t\t\tthrow new JsonTypeException(value.value.getClass(), Long.class);\n\t\treturn (Long)value.value;\n\t}",
"@Override\n public final int readVarint32() throws IOException {\n return (int) readVarint64();\n }",
"public static long consecutiveBytesAsLong(byte... bytes) {\r\n\t\tlong result = 0;\r\n\t\tfor(int i=0; i<bytes.length; i++) {\r\n\t\t\tint shiftFactor = 8 * (bytes.length - (i + 1));\r\n\t\t\tresult += bytes[i] << shiftFactor;\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"@Override\n\tprotected void readDataStream(DataInputStream dataInStream) throws IOException {\n\t\tid = dataInStream.readLong();\n\t\tsuper.read(dataInStream);\n\t}",
"public static final long crc64Long(String in) {\r\n if (in == null || in.length() == 0) {\r\n return 0;\r\n }\r\n return crc64Long(getBytes(in));\r\n }",
"long readS64BE(String name)\n throws IOException, EOFException;",
"public static long convertToLong(byte[] longBuffer)\r\n {\r\n if (longBuffer.length >= 8)\r\n {\r\n return (((long) longBuffer[0] << 56)\r\n + ((long) (longBuffer[1] & 255) << 48)\r\n + ((long) (longBuffer[2] & 255) << 40)\r\n + ((long) (longBuffer[3] & 255) << 32)\r\n + ((long) (longBuffer[4] & 255) << 24)\r\n + ((longBuffer[5] & 255) << 16)\r\n + ((longBuffer[6] & 255) << 8) + ((longBuffer[7] & 255) << 0));\r\n }\r\n return 0;\r\n }",
"private static long getLongLittleEndian(byte[] buf, int offset) {\n return ((long) buf[offset + 7] << 56) | ((buf[offset + 6] & 0xffL) << 48)\n | ((buf[offset + 5] & 0xffL) << 40) | ((buf[offset + 4] & 0xffL) << 32)\n | ((buf[offset + 3] & 0xffL) << 24) | ((buf[offset + 2] & 0xffL) << 16)\n | ((buf[offset + 1] & 0xffL) << 8) | ((buf[offset] & 0xffL));\n }",
"public long getFieldAsLong(int tag) {\n return getFieldAsLong(tag, 0);\n }",
"long fetch32(BytesStore bytes, @NonNegative long off) throws IllegalStateException, BufferUnderflowException {\n return bytes.readUnsignedInt(off);\n }",
"private String getLongInstruction(int nextVal) throws java.io.IOException {\n\t\treadUntilEndOfLine(nextVal);\n\t\treturn next;\n\t}",
"public static long toInt64(byte[] value) {\r\n\t\treturn toInt16(value, 0);\r\n\t}",
"public static long parse(String s) throws NumberFormatException {\n return parse(s, ByteUnit.B);\n }",
"public static long inputLong()\n\t{\n\t\treturn(sc.nextLong());\n\t}",
"public long readBoundedLong(final long max) throws IOException {\n final int bits = 0 >= max ? 0 : (int) (Math.floor(Math.log(max) / Math.log(2)) + 1);\n return 0 < bits ? this.read(bits).toLong() : 0;\n }",
"private static long l(String s) {\n return Long.parseLong(s);\n }",
"public static long read(byte[] buffer, long offset, long length) {\n offset =0;\n long result = 0 ;\n int shift_count = 0 ;\n\n while ( length -- > 0 ) {\n int temp = buffer[(int) offset++] & 0xFF;\n result |= temp << shift_count ;\n shift_count += 8;\n }\n return(result);\n }",
"private long getResultAsLong(long bitPos, int nrBits, ByteOrder byteOrder,\n int maxNrBitsRead) {\n\n // check if input params are correct otherwise throw BitBufferException\n validateInputParams(bitPos, nrBits, maxNrBitsRead);\n\n // min number of bytes covering specified bits\n int nrReadBytes = getNrNecessaryBytes(bitPos, nrBits);\n\n // buffer containing specified bits\n long numberBuf = getNumberBufAsLong(byteOrder, nrReadBytes,\n (int) (bitPos >> 3));\n\n // mask leaving only specified bits\n long mask = getMaskAsLong(nrBits);\n\n // apply the mask for to the right shifted number buffer with the\n // specific bits to the most right\n long result = mask\n & getRightShiftedNumberBufAsLong(numberBuf, bitPos, nrBits,\n byteOrder);\n\n // increase bit pointer position by the number of read bits\n this.bitPos = bitPos + nrBits;\n\n return result;\n }",
"public static Long getLong(final Envelop envelop) {\n return In.request(envelop, 0, Long.class);\n }",
"public long readRawVarint64() throws java.io.IOException {\n /*\n r9 = this;\n int r0 = r9.bufferPos\n int r1 = r9.bufferSize\n if (r1 != r0) goto L_0x0008\n goto L_0x00b8\n L_0x0008:\n byte[] r2 = r9.buffer\n int r3 = r0 + 1\n byte r0 = r2[r0]\n if (r0 < 0) goto L_0x0014\n r9.bufferPos = r3\n long r0 = (long) r0\n return r0\n L_0x0014:\n int r1 = r1 - r3\n r4 = 9\n if (r1 >= r4) goto L_0x001b\n goto L_0x00b8\n L_0x001b:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 7\n r0 = r0 ^ r3\n long r3 = (long) r0\n r5 = 0\n int r0 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x002f\n r5 = -128(0xffffffffffffff80, double:NaN)\n L_0x002b:\n long r2 = r3 ^ r5\n goto L_0x00bf\n L_0x002f:\n int r0 = r1 + 1\n byte r1 = r2[r1]\n int r1 = r1 << 14\n long r7 = (long) r1\n long r3 = r3 ^ r7\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 < 0) goto L_0x0042\n r1 = 16256(0x3f80, double:8.0315E-320)\n L_0x003d:\n long r2 = r3 ^ r1\n r1 = r0\n goto L_0x00bf\n L_0x0042:\n int r1 = r0 + 1\n byte r0 = r2[r0]\n int r0 = r0 << 21\n long r7 = (long) r0\n long r3 = r3 ^ r7\n int r0 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x0052\n r5 = -2080896(0xffffffffffe03f80, double:NaN)\n goto L_0x002b\n L_0x0052:\n int r0 = r1 + 1\n byte r1 = r2[r1]\n long r7 = (long) r1\n r1 = 28\n long r7 = r7 << r1\n long r3 = r3 ^ r7\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 < 0) goto L_0x0063\n r1 = 266354560(0xfe03f80, double:1.315966377E-315)\n goto L_0x003d\n L_0x0063:\n int r1 = r0 + 1\n byte r0 = r2[r0]\n long r7 = (long) r0\n r0 = 35\n long r7 = r7 << r0\n long r3 = r3 ^ r7\n int r0 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x0076\n r5 = -34093383808(0xfffffff80fe03f80, double:NaN)\n goto L_0x002b\n L_0x0076:\n int r0 = r1 + 1\n byte r1 = r2[r1]\n long r7 = (long) r1\n r1 = 42\n long r7 = r7 << r1\n long r3 = r3 ^ r7\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 < 0) goto L_0x0089\n r1 = 4363953127296(0x3f80fe03f80, double:2.1560793202584E-311)\n goto L_0x003d\n L_0x0089:\n int r1 = r0 + 1\n byte r0 = r2[r0]\n long r7 = (long) r0\n r0 = 49\n long r7 = r7 << r0\n long r3 = r3 ^ r7\n int r0 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x009c\n r5 = -558586000294016(0xfffe03f80fe03f80, double:NaN)\n goto L_0x002b\n L_0x009c:\n int r0 = r1 + 1\n byte r1 = r2[r1]\n long r7 = (long) r1\n r1 = 56\n long r7 = r7 << r1\n long r3 = r3 ^ r7\n r7 = 71499008037633920(0xfe03f80fe03f80, double:6.838959413692434E-304)\n long r3 = r3 ^ r7\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 >= 0) goto L_0x00bd\n int r1 = r0 + 1\n byte r0 = r2[r0]\n long r7 = (long) r0\n int r0 = (r7 > r5 ? 1 : (r7 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x00be\n L_0x00b8:\n long r0 = r9.readRawVarint64SlowPath()\n return r0\n L_0x00bd:\n r1 = r0\n L_0x00be:\n r2 = r3\n L_0x00bf:\n r9.bufferPos = r1\n return r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlin.reflect.jvm.internal.impl.protobuf.CodedInputStream.readRawVarint64():long\");\n }",
"public long readUnsignedInt()\r\n/* 429: */ {\r\n/* 430:442 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 431:443 */ return super.readUnsignedInt();\r\n/* 432: */ }",
"public long readRawVarint64SlowPath() throws IOException {\n long j = 0;\n for (int i = 0; i < 64; i += 7) {\n byte readRawByte = readRawByte();\n j |= ((long) (readRawByte & ByteCompanionObject.MAX_VALUE)) << i;\n if ((readRawByte & ByteCompanionObject.MIN_VALUE) == 0) {\n return j;\n }\n }\n throw InvalidProtocolBufferException.malformedVarint();\n }",
"public static long byteArrayToUnsignedLong(byte @NotNull [] data) {\n return byteArrayToUnsignedLong(data, 0, Endian.BIG, LONG_WIDTH);\n }",
"public long get(int i) {\n return read(i);\n }",
"public abstract void read_longlong_array(long[] value, int offset, int\nlength);",
"public static Long getLong2(final Envelop envelop) {\n return In.request(envelop, 2, Long.class);\n }",
"public static long parseHexLong(CharSequence seq) {\n long result = 0;\n int last = seq.length() - 1;\n if (last > 15) {\n throw new NumberFormatException(\"Too many characters (> 16) for a \"\n + \"long in '\" + seq + \"'\");\n }\n if (Strings.startsWith(seq, \"0x\")) {\n seq = seq.subSequence(2, seq.length());\n }\n for (int i = last, j = 0; i >= 0; i--, j += 4) {\n long val = charToNybbl(seq.charAt(i));\n val <<= j;\n result |= val;\n }\n return result;\n }",
"public static long readLongFromFile(String executionCursorFile) throws IOException {\n BufferedReader in = null;\n try {\n String line;\n in = new BufferedReader(new FileReader(getFile(executionCursorFile)));\n line = in.readLine();\n return Long.parseLong(line);\n } finally {\n if (in != null) {\n in.close();\n }\n }\n }"
] | [
"0.8317689",
"0.8246908",
"0.824032",
"0.79463017",
"0.7913742",
"0.7709309",
"0.7627782",
"0.7615855",
"0.73993635",
"0.72097254",
"0.71840894",
"0.7130915",
"0.7092692",
"0.7000996",
"0.6999538",
"0.6993016",
"0.69926447",
"0.69534385",
"0.6897291",
"0.68874496",
"0.6867397",
"0.68524015",
"0.6837833",
"0.6835737",
"0.67898715",
"0.6769584",
"0.6714627",
"0.6675464",
"0.66381544",
"0.660881",
"0.6592735",
"0.6514387",
"0.6454999",
"0.6440546",
"0.6429098",
"0.6421324",
"0.6409119",
"0.63798416",
"0.6376792",
"0.63658124",
"0.635139",
"0.63478047",
"0.6313065",
"0.6285979",
"0.62838125",
"0.62464863",
"0.6243358",
"0.61832607",
"0.61741436",
"0.6142157",
"0.61087775",
"0.6094748",
"0.60936207",
"0.6084259",
"0.6077962",
"0.6068858",
"0.60553765",
"0.6042347",
"0.60331583",
"0.6006501",
"0.59969044",
"0.59838814",
"0.5972896",
"0.5965618",
"0.5965618",
"0.59614515",
"0.5960604",
"0.59481686",
"0.5938149",
"0.5930574",
"0.59209156",
"0.5912976",
"0.5876627",
"0.58234453",
"0.5817982",
"0.58146465",
"0.5812328",
"0.5809891",
"0.57970864",
"0.5791608",
"0.57857436",
"0.57662237",
"0.57484055",
"0.5743599",
"0.5742788",
"0.5731808",
"0.5718937",
"0.57156473",
"0.5709149",
"0.57058287",
"0.570574",
"0.5687488",
"0.56823206",
"0.5674341",
"0.567357",
"0.565513",
"0.56536514",
"0.56505275",
"0.5649837",
"0.56451494"
] | 0.70973295 | 12 |
Reads a long integer from the memory mapped buffer. | private long read_long(MappedByteBuffer buff) throws IOException {
long number = 0;
for (int i = 0; i < 8; ++i) {
number += ((long) (buff.get() & 0xFF)) << (8 * i);
}
return number;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public long readLong() throws IOException;",
"long readLong() throws IOException;",
"public abstract int read_long();",
"long readLong();",
"public static long readlong()\n\t{\n\t\treturn sc.nextLong();\n\t}",
"public long readLong() throws IOException {\n return in.readLong();\n }",
"public abstract long read_ulonglong();",
"public abstract long read_longlong();",
"public long readLong() {\n while (isEmpty()) {\n }\n Timing.waitSyncLocal();\n readEnable.setNow(1);\n Timing.waitClockLocal();\n return (readData.getLong());\n }",
"private long read_long(RandomAccessFile file) throws IOException {\n long number = 0;\n for (int i = 0; i < 8; ++i) {\n number += ((long) (file.readByte() & 0xFF)) << (8 * i);\n }\n return number;\n }",
"private long getLong() {\n longBuffer.rewind();\n archive.read(longBuffer);\n longBuffer.flip();\n return longBuffer.getLong();\n }",
"public long readLongNonBlock() {\n Timing.throughputLocal(0);\n readEnable.setNow(1);\n Timing.waitClockLocal();\n return (readData.getLong());\n }",
"String longRead();",
"public long readLong()\r\n/* 435: */ {\r\n/* 436:448 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 437:449 */ return super.readLong();\r\n/* 438: */ }",
"long fetch64(BytesStore bytes, @NonNegative long off) throws IllegalStateException, BufferUnderflowException {\n return bytes.readLong(off);\n }",
"public long readLongLE()\r\n/* 853: */ {\r\n/* 854:862 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 855:863 */ return super.readLongLE();\r\n/* 856: */ }",
"private synchronized long readLong(int len) throws IOException {\n\t\tread(bytes, len);\n\t\treturn readLong(bytes, 0, len);\n\t}",
"public long getLong(int addr) throws ProgramException {\n return getLittleEndian(addr, Long.BYTES);\n }",
"@Override\r\n\tpublic long getLong(int pos) {\n\t\treturn buffer.getLong(pos);\r\n\t}",
"long readS64LE()\n throws IOException, EOFException;",
"@Override\n\tpublic int decode(byte[] buffer, int offset) throws IOException {\n\t\tlong value = NeuronReader.readRawInt64(buffer, offset);\n\t\tunionCache.setLong(fieldIndex, value);\n\n\t\treturn NeuronReader.LONG_SIZE;\n\t}",
"public int read(long[] l) throws IOException {\n\t\treturn read(l, 0, l.length);\n\t}",
"private long getNumberBufAsLong(ByteOrder byteOrder, int nrReadBytes,\n int firstBytePos) {\n\n long result = 0L;\n long bytePortion = 0L;\n for (int i = 0; i < nrReadBytes; i++) {\n bytePortion = 0xFF & (byteBuffer.get(firstBytePos++));\n\n if (byteOrder == ByteOrder.LittleEndian)\n // reshift bytes\n result = result | bytePortion << (i << 3);\n else\n result = bytePortion << ((nrReadBytes - i - 1) << 3) | result;\n }\n\n return result;\n }",
"public String getLong(long offset) throws IOException {\n\t\tdataBase.seek(offset);\n\t\tString[] array = dataBase.readLine().split(\"\\\\|\");\n\t\treturn array[8];\n\t}",
"public abstract void read_long_array(int[] value, int offset, int\nlength);",
"public long[] read();",
"public abstract int read_ulong();",
"public long readAsLong(int nrBits) {\n return readAsLong(bitPos, nrBits, ByteOrder.BigEndian);\n }",
"public long readVarLong() throws IOException {\n final int type = (int) this.read(2).toLong();\n return this.read(BitOutputStream.varLongDepths[type]).toLong();\n }",
"public long readLong() {\n\t\tif(!isInit) return 0L;\n\t\tlong result = 0L;\n\t\tisListening = true;\n\t\twriteLine(\"Waiting for Long input...\");\n\t\twhile(isListening) {\n\t\t\ttry {\n\t\t\t\tresult = Long.parseLong(inputArea.getText());\n\t\t\t} catch(NumberFormatException nfe) {\n\t\t\t\tresult= 0L;\n\t\t\t}\n\t\t}\n\t\tinputArea.setText(\"\");\n\t\twriteLine(\"Input: \" + result);\n\t\treturn result;\n\t}",
"public static final long readLong(InputStream in) throws IOException {\n byte[] buff = new byte[8];\n StreamTool.readFully(in, buff);\n return getLong(buff, 0);\n }",
"long readS64BE()\n throws IOException, EOFException;",
"long decodeLong();",
"public long getLongFromMemory(long number){\n\t\tif (number % 8L != 0L){\n\t\t\tSystem.out.println(\"Wrong number for access in memory\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tlong l1 = 0L;\n\t\ttry{\n\t\t\tint i = memory[((int)number / 4)];\n\t\t\tint j = memory[(((int)number + 4) / 4)];\n\t\t\tlong l3 = i;\n\t\t\tl3 &= 0xFFFFFFFFL; //bitwise AND with FFFFFFFF long\n\t\t\tlong l2 = j; \n\t\t\tl2 <<= 32;\t\t//shift 32 bits to left\n\t\t\tl1 = l2 | l3; \t//bitwise OR to get the result\n\t\t}\n\t\tcatch (Exception e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t\treturn l1;\n\t}",
"public static long readLong(byte[] source, int position) {\n return makeLong(source[position], source[position + 1], source[position + 2], source[position + 3],\n source[position + 4], source[position + 5], source[position + 6], source[position + 7]);\n }",
"public final long getLong(final boolean endianess) throws IOException {\r\n b1 = (tagBuffer[bPtr] & 0xff);\r\n b2 = (tagBuffer[bPtr + 1] & 0xff);\r\n b3 = (tagBuffer[bPtr + 2] & 0xff);\r\n b4 = (tagBuffer[bPtr + 3] & 0xff);\r\n b5 = (tagBuffer[bPtr + 4] & 0xff);\r\n b6 = (tagBuffer[bPtr + 5] & 0xff);\r\n b7 = (tagBuffer[bPtr + 6] & 0xff);\r\n b8 = (tagBuffer[bPtr + 7] & 0xff);\r\n\r\n long tmpLong;\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n tmpLong = ( ((long) b1 << 56) | ((long) b2 << 48) | ((long) b3 << 40) | ((long) b4 << 32)\r\n | ((long) b5 << 24) | ((long) b6 << 16) | ((long) b7 << 8) | b8);\r\n } else {\r\n tmpLong = ( ((long) b8 << 56) | ((long) b7 << 48) | ((long) b6 << 40) | ((long) b5 << 32)\r\n | ((long) b4 << 24) | ((long) b3 << 16) | ((long) b2 << 8) | b1);\r\n }\r\n\r\n bPtr += 8;\r\n\r\n return (tmpLong);\r\n }",
"public static long getLong(final byte[] buffer, final int index, final int len) {\n switch (len) {\n case 0: return 0xFFFFFFFF_FFFFFFFFL;\n case 1: return 0xFFFFFFFF_FFFFFF00L | _getByte(buffer, index, 1);\n case 2: return 0xFFFFFFFF_FFFF0000L | _getShort(buffer, index, 2);\n case 3: return 0xFFFFFFFF_FF000000L | _getInt(buffer, index, 3);\n case 4: return 0xFFFFFFFF_00000000L | _getInt(buffer, index, 4);\n case 5: return 0xFFFFFF00_00000000L | _getLong(buffer, index, 5);\n case 6: return 0xFFFF0000_00000000L | _getLong(buffer, index, 6);\n case 7: return 0xFF000000_00000000L | _getLong(buffer, index, 7);\n case 8: return _getLong(buffer, index, 8);\n default: throw new IllegalArgumentException(\"len is out of range: \" + len);\n }\n }",
"public int readInt() {\n return ((int) readLong());\n }",
"public long getLong(String key) {\n\t\tString value = getString(key);\n\t\t\n\t\ttry {\n\t\t\treturn Long.parseLong(value);\n\t\t}\n\t\tcatch( NumberFormatException e ) {\n\t\t\tthrow new IllegalStateException( \"Illegal value for long integer configuration parameter: \" + key);\n\t\t}\n\t}",
"public abstract void read_longlong_array(long[] value, int offset, int\nlength);",
"public long readUnsignedIntLE()\r\n/* 847: */ {\r\n/* 848:856 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 849:857 */ return super.readUnsignedIntLE();\r\n/* 850: */ }",
"public byte[] readRawLong() throws IOException {\n byte[] bytes = new byte[9];\n bytes[0] = (byte) Type.LONG.code;\n in.readFully(bytes, 1, 8);\n return bytes;\n }",
"public static long readLong(String prompt) throws IOException {\r\n\t\tlong value = 0;\r\n\t\twhile (true) {\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.print(prompt + \" _>\");\r\n\t\t\t\tvalue = Long.valueOf(reader.readLine()).longValue();\r\n\t\t\t\tbreak;\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tSystem.err.println(ex.getLocalizedMessage());\r\n\t\t\t\tthrow ex;\r\n\t\t\t} catch (NumberFormatException ex) {\r\n\t\t\t\tSystem.err.println(\"Conversion Error: \" + ex.getLocalizedMessage());\r\n\t\t\t\treturn readLong(\"Try again: \" + prompt);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn value;\r\n\t}",
"public long getLong(int index)\r\n/* 394: */ {\r\n/* 395:408 */ ensureAccessible();\r\n/* 396:409 */ return _getLong(index);\r\n/* 397: */ }",
"public long getReadPointer();",
"public long get(int i) {\n return read(i);\n }",
"public ByteBuf writeLongLE(long value)\r\n/* 877: */ {\r\n/* 878:886 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 879:887 */ return super.writeLongLE(value);\r\n/* 880: */ }",
"public long getLong(String key) {\n long result;\n Object value = get(key);\n if (value instanceof Long) {\n result = (Long)value;\n } else if (value instanceof String) {\n try {\n String valueString = (String)value;\n if (valueString.length() == 0) {\n result = 0;\n } else if (valueString.charAt(0) == '-') {\n result = Long.parseLong(valueString);\n } else {\n result = Long.parseUnsignedLong((String)value);\n }\n } catch (NumberFormatException exc) {\n result = 0;\n }\n } else {\n result = 0;\n }\n return result;\n }",
"public static long read(byte[] buffer, long offset, long length) {\n offset =0;\n long result = 0 ;\n int shift_count = 0 ;\n\n while ( length -- > 0 ) {\n int temp = buffer[(int) offset++] & 0xFF;\n result |= temp << shift_count ;\n shift_count += 8;\n }\n return(result);\n }",
"long fetch32(BytesStore bytes, @NonNegative long off) throws IllegalStateException, BufferUnderflowException {\n return bytes.readUnsignedInt(off);\n }",
"protected long _getLong(int index)\r\n/* 400: */ {\r\n/* 401:414 */ return HeapByteBufUtil.getLong(this.array, index);\r\n/* 402: */ }",
"@Test\n public void testReadWriteLong() {\n System.out.println(\"readLong\");\n ByteArray instance = new ByteArray();\n \n instance.writeLong(12, 0);\n instance.writeLong(12345678, 8);\n instance.writeLong(13, instance.compacity());\n \n assertEquals(12, instance.readLong(0));\n assertEquals(12345678, instance.readLong(8));\n assertEquals(13, instance.readLong(instance.compacity() - 8));\n \n instance.writeLong(14, 8);\n assertEquals(14, instance.readLong(8));\n }",
"public static double readLong() {\n return Long.parseLong(readString());\n }",
"public int read(long addr) {\n\t\treturn findBlock(addr);\n\t}",
"public Long getLong(String key) throws JsonException {\r\n\t\tObject object = get(key);\r\n\t\tLong result = PrimitiveDataTypeConvertor.toLong(object);\r\n\t\tif (result == null) {\r\n\t\t\tthrow PrimitiveDataTypeConvertor.exceptionType(key, object, \"Long\");\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"@Override\n public long readSInt64() throws IOException {\n long value = decoder.readVarint64();\n return (value >>> 1) ^ -(value & 1);\n }",
"protected long _getLongLE(int index)\r\n/* 411: */ {\r\n/* 412:425 */ return HeapByteBufUtil.getLongLE(this.array, index);\r\n/* 413: */ }",
"long getLongValue();",
"long getLongValue();",
"public long getLongLE(int index)\r\n/* 405: */ {\r\n/* 406:419 */ ensureAccessible();\r\n/* 407:420 */ return _getLongLE(index);\r\n/* 408: */ }",
"public int read(long[] l, int start, int len) throws IOException {\n\n\t\tint i = start;\n\t\ttry {\n\t\t\tfor (; i < start + len; i += 1) {\n\t\t\t\tif (count - pos < 8) {\n\t\t\t\t\tfillBuf(8);\n\t\t\t\t}\n\t\t\t\tint i1 = buf[pos] << 24 | (buf[pos + 1] & 0xFF) << 16\n\t\t\t\t\t\t| (buf[pos + 2] & 0xFF) << 8 | (buf[pos + 3] & 0xFF);\n\t\t\t\tint i2 = buf[pos + 4] << 24 | (buf[pos + 5] & 0xFF) << 16\n\t\t\t\t\t\t| (buf[pos + 6] & 0xFF) << 8 | (buf[pos + 7] & 0xFF);\n\t\t\t\tl[i] = ((long) i1) << 32 | ((long) i2 & 0x00000000FFFFFFFFL);\n\t\t\t\tpos += 8;\n\t\t\t}\n\n\t\t} catch (EOFException e) {\n\t\t\treturn eofCheck(e, i, start, 8);\n\t\t}\n\t\treturn 8 * len;\n\t}",
"@Test\n\tpublic void testTooLargeValueBinaryReaderStreamPosition() throws IOException {\n\n\t\tbyte[] bytes =\n\t\t\tbytes(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x1, 0x2);\n\t\tInputStream is = is(bytes);\n\n\t\ttry {\n\t\t\tlong value = LEB128.read(is, false);\n\t\t\tAssert.fail(\n\t\t\t\t\"Should not be able to read a LEB128 that is larger than what can fit in java 64bit long int: \" +\n\t\t\t\t\tLong.toUnsignedString(value));\n\t\t}\n\t\tcatch (IOException ioe) {\n\t\t\t// good\n\t\t}\n\n\t\tAssert.assertEquals(bytes.length - 10, is.available());\n\t}",
"public long nextLong()\r\n\t{\r\n\t\tif(st == null || !st.hasMoreTokens())\r\n\t\t\tnewst();\r\n\t\treturn Long.parseLong(st.nextToken());\r\n\t}",
"final long internalLongLock() {\n return byteBase.longLockPointer();\n }",
"public abstract void read_ulonglong_array(long[] value, int offset, int\nlength);",
"private long getResultAsLong(long bitPos, int nrBits, ByteOrder byteOrder,\n int maxNrBitsRead) {\n\n // check if input params are correct otherwise throw BitBufferException\n validateInputParams(bitPos, nrBits, maxNrBitsRead);\n\n // min number of bytes covering specified bits\n int nrReadBytes = getNrNecessaryBytes(bitPos, nrBits);\n\n // buffer containing specified bits\n long numberBuf = getNumberBufAsLong(byteOrder, nrReadBytes,\n (int) (bitPos >> 3));\n\n // mask leaving only specified bits\n long mask = getMaskAsLong(nrBits);\n\n // apply the mask for to the right shifted number buffer with the\n // specific bits to the most right\n long result = mask\n & getRightShiftedNumberBufAsLong(numberBuf, bitPos, nrBits,\n byteOrder);\n\n // increase bit pointer position by the number of read bits\n this.bitPos = bitPos + nrBits;\n\n return result;\n }",
"public ByteBuf writeLong(long value)\r\n/* 557: */ {\r\n/* 558:568 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 559:569 */ return super.writeLong(value);\r\n/* 560: */ }",
"public static long getLong(String key, long i) {\n\t\tString token = getString(key);\n\t\tif (token == null) {\n\t\t\treturn i;\n\t\t}\n\t\treturn Long.parseLong(token);\n\t}",
"void writeLong(long v) throws IOException;",
"public long retrieve(long record) {\n return (record & MASK) >>> OFFSET;\n }",
"private final long get_BIGINT(int column) {\n // @AGG force Little Endian\n if (metadata.isZos())\n return dataBuffer_.getLong(columnDataPosition_[column - 1]);\n else\n return dataBuffer_.getLongLE(columnDataPosition_[column - 1]);\n// return SignedBinary.getLong(dataBuffer_,\n// columnDataPosition_[column - 1]);\n }",
"long readS32LE()\n throws IOException, EOFException;",
"void writeLong(long value);",
"public ByteBuffer read(long address)\n {\n return tryRead(address, null);\n }",
"@Override\n\tpublic long readScalarLong() throws IOException {\n\t\treturn 0;\n\t}",
"public abstract void load(IntLongsCol col, DataInputStream output) throws IOException;",
"public static long convertToLong(byte[] longBuffer)\r\n {\r\n if (longBuffer.length >= 8)\r\n {\r\n return (((long) longBuffer[0] << 56)\r\n + ((long) (longBuffer[1] & 255) << 48)\r\n + ((long) (longBuffer[2] & 255) << 40)\r\n + ((long) (longBuffer[3] & 255) << 32)\r\n + ((long) (longBuffer[4] & 255) << 24)\r\n + ((longBuffer[5] & 255) << 16)\r\n + ((longBuffer[6] & 255) << 8) + ((longBuffer[7] & 255) << 0));\r\n }\r\n return 0;\r\n }",
"public static long readLong(File file) \n\t\t\t\t\t\t throws Exception{\n\t\tBufferedReader br = null;\n\t\ttry {\n\t\t\tbr = new BufferedReader(\n\t\t\t\tnew InputStreamReader(new FileInputStream(file))\t\n\t\t\t);\n\t\t\tString line = br.readLine().trim();\n\t\t\treturn Long.parseLong(line);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow e;\n\t\t} finally{\n\t\t\tif(br != null){\n\t\t\t\tbr.close();\n\t\t\t}\n\t\t}\n\t}",
"public abstract long nextLong();",
"public Long getLong(String key) throws AgentBuilderRuntimeException {\n\t\tif (!extContainsKey(key))\n\t\t\tthrow new AgentBuilderRuntimeException(\n\t\t\t\t\t\"Dictionary does not contain key \\\"\" + key + \"\\\"\");\n\t\treturn (Long) extGet(key);\n\t}",
"public long readUnsignedInt()\r\n/* 429: */ {\r\n/* 430:442 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 431:443 */ return super.readUnsignedInt();\r\n/* 432: */ }",
"private static long getLongLittleEndian(byte[] buf, int offset) {\n return ((long) buf[offset + 7] << 56) | ((buf[offset + 6] & 0xffL) << 48)\n | ((buf[offset + 5] & 0xffL) << 40) | ((buf[offset + 4] & 0xffL) << 32)\n | ((buf[offset + 3] & 0xffL) << 24) | ((buf[offset + 2] & 0xffL) << 16)\n | ((buf[offset + 1] & 0xffL) << 8) | ((buf[offset] & 0xffL));\n }",
"long readS64LE(String name)\n throws IOException, EOFException;",
"public static long getLong(String key) throws UnknownID, ArgumentNotValid {\n\t\tString value = get(key);\n\t\ttry {\n\t\t\treturn Long.parseLong(value);\n\t\t} catch (NumberFormatException e) {\n\t\t\tString msg = \"Invalid setting. Value '\" + value + \"' for key '\" + key + \"' could not be parsed as a long.\";\n\t\t\tthrow new ArgumentNotValid(msg, e);\n\t\t}\n\t}",
"public void read(long address, ByteBuffer destination)\n {\n tryRead(address, destination);\n }",
"public long getLongValue() {\n if (getValueIndex() <= 0)\n return 0L;\n return ((LongEntry) getPool().getEntry(getValueIndex())).getValue();\n }",
"public Long getLong(String key)\n\t{\n\t\tverifyParseState();\n\t\t\n\t\tValue value = values.get(key);\n\t\tif(value == null || value.value == null)\n\t\t\treturn null;\n\t\tif(value.type != ValueType.LONG)\n\t\t\tthrow new JsonTypeException(value.value.getClass(), Long.class);\n\t\treturn (Long)value.value;\n\t}",
"public long readBoundedLong(final long max) throws IOException {\n final int bits = 0 >= max ? 0 : (int) (Math.floor(Math.log(max) / Math.log(2)) + 1);\n return 0 < bits ? this.read(bits).toLong() : 0;\n }",
"public long getLong(int index)\r\n/* 185: */ {\r\n/* 186:202 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 187:203 */ return super.getLong(index);\r\n/* 188: */ }",
"protected final long getLong(int offset)\n {\n final byte[] tableData = tables.getTablesData();\n return Bytes.getLong(tableData, cursor+offset);\n }",
"public long getFieldAsLong(int tag) {\n return getFieldAsLong(tag, 0);\n }",
"@ZenCodeType.Caster\n @ZenCodeType.Method\n default long asLong() {\n \n return notSupportedCast(BasicTypeID.LONG);\n }",
"public void putLongInMemory(long number1, long number2){\n\t\tif (number1 % 8L != 0L){\n\t\t\tSystem.out.println(\"Wrong number for access in memory\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\ttry{\n\t\t\tint i = (int)(number2 & 0xFFFFFFFF); //bitwise AND to get the integer\n\t\t\tint j = (int)(number2 >> 32 & 0xFFFFFFFF); //shift 32 bits to right and AND bitwise to get the second integer\n\t\t\t//put the numbers in memory big endian\n\t\t\tmemory[((int)number1 / 4)] = i;\n\t\t\tmemory[(((int)number1 + 4) / 4)] = j;\n\t\t}\n\t\tcatch (Exception e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"private static long getRightShiftedNumberBufAsLong(long numberBuf,\n long bitPos, int nrBits, ByteOrder byteOrder) throws BitBufferException {\n\n // number of bits integer buffer needs to be shifted to the right in\n // order to reach the last bit in last byte\n long shiftBits;\n if (byteOrder == ByteOrder.BigEndian)\n shiftBits = 7 - ((nrBits + bitPos + 7) % 8);\n else\n shiftBits = bitPos % 8;\n\n return numberBuf >> shiftBits;\n }",
"public long getLong() throws NoSuchElementException,\n\t NumberFormatException\n {\n\tString s = tokenizer.nextToken();\n\treturn Long.parseLong(s);\n }",
"public long toLong() {\n return this.toLongArray()[0];\n }",
"public Long getLong(String key) {\n if (!jsonData.has(key))\n return null;\n try {\n return jsonData.getLong(key);\n } catch (Exception ex) {\n return null;\n }\n }",
"@Test(expected = IOException.class)\n\tpublic void testToolargeUnsigned() throws IOException {\n\t\tInputStream is = is(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02);\n\n\t\tlong value = LEB128.read(is, false);\n\t\tAssert.fail(\n\t\t\t\"Should not be able to read a LEB128 that is larger than what can fit in java 64bit long int: \" +\n\t\t\t\tvalue);\n\t}",
"private String getLongInstruction(int nextVal) throws java.io.IOException {\n\t\treadUntilEndOfLine(nextVal);\n\t\treturn next;\n\t}",
"public static long inputLong()\n\t{\n\t\treturn(sc.nextLong());\n\t}"
] | [
"0.78694624",
"0.78141785",
"0.77674514",
"0.77190524",
"0.7567656",
"0.7458654",
"0.727255",
"0.72087413",
"0.7130311",
"0.7075227",
"0.70544606",
"0.6948374",
"0.6933567",
"0.69196874",
"0.6899881",
"0.679002",
"0.67559636",
"0.6731585",
"0.67195755",
"0.67063284",
"0.6686941",
"0.65626913",
"0.65596217",
"0.6511327",
"0.650652",
"0.6501935",
"0.6479998",
"0.645383",
"0.64390206",
"0.6430316",
"0.641217",
"0.6402912",
"0.6378857",
"0.6352817",
"0.6324913",
"0.6247106",
"0.62147266",
"0.6177369",
"0.61576474",
"0.6150922",
"0.61456335",
"0.61100245",
"0.61060035",
"0.6072392",
"0.60721433",
"0.6052189",
"0.6034826",
"0.6026215",
"0.60210484",
"0.60086936",
"0.5996699",
"0.5992959",
"0.5976491",
"0.5964946",
"0.5950045",
"0.59412825",
"0.59341455",
"0.5921996",
"0.5921996",
"0.59026206",
"0.5893741",
"0.5884389",
"0.5881831",
"0.5878966",
"0.5873966",
"0.5867122",
"0.5860662",
"0.5846427",
"0.5846096",
"0.58376557",
"0.5837418",
"0.582284",
"0.5822058",
"0.58160007",
"0.5802119",
"0.5794404",
"0.5792967",
"0.5766494",
"0.57654864",
"0.57639796",
"0.5751603",
"0.5749285",
"0.5733548",
"0.5722625",
"0.5721427",
"0.5720987",
"0.5712298",
"0.57052",
"0.57047486",
"0.5695782",
"0.5688606",
"0.5686735",
"0.5686346",
"0.5678639",
"0.566753",
"0.5650901",
"0.56347674",
"0.5631106",
"0.5625678",
"0.5619758"
] | 0.80432767 | 0 |
Reads a kmer from th index database. | public kmer get_kmer(long number) {
kmer k_mer = new kmer(K, pre_len, suf_len);
boolean found = false;
int low = 0, high = (1 << (2 * pre_len)) - 1, mid = 0;
while (low <= high && !found) {
mid = (low + high) / 2;
if (number < prefix_ptr[mid]) {
high = mid - 1;
} else if (number > prefix_ptr[mid]) {
low = mid + 1;
} else {
found = true;
}
}
if (!found) {
mid = high;
} else {
for (; mid < prefix_ptr.length - 1 && prefix_ptr[mid + 1] == prefix_ptr[mid]; ++mid);
}
k_mer.prefix = mid;
suf_buff[(int) (number * suf_rec_size / suf_parts_size[0])].position((int) (number * suf_rec_size % suf_parts_size[0]));
suf_buff[(int) (number * suf_rec_size / suf_parts_size[0])].get(k_mer.suffix, 0, suf_len / 4);
return k_mer;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public IndexDatabase(String index_path) {\n int k;\n long p;\n try {\n pre_file = new RandomAccessFile(index_path + \"/sorted.kmc_pre\", \"r\");\n pre_file.seek(pre_file.length() - 8);\n header_pos = read_int(pre_file);\n pre_file.seek(pre_file.length() - 8 - header_pos);\n // read the index properties \n K = read_int(pre_file);\n mode = read_int(pre_file);\n ctr_size = read_int(pre_file);\n pre_len = read_int(pre_file);\n min_count = read_int(pre_file);\n max_count = read_int(pre_file);\n kmers_num = read_long(pre_file);\n suf_len = K - pre_len;\n key = new kmer(K, pre_len, suf_len);\n System.out.println(\"Indexing \" + kmers_num + \" kmers... \");\n // load the prefix file into the memory \n pre_file.seek(4);\n int q, len = 1 << (2 * pre_len);\n prefix_ptr = new long[len];\n MappedByteBuffer pre_buff;\n for (q = 0, p = 0; p < 8; ++p) {\n pre_buff = pre_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + p * len, len);\n for (k = 0; k < len / 8; ++k, ++q) {\n prefix_ptr[q] = read_long(pre_buff);\n }\n pre_buff = null;\n }\n pre_file.close();\n // mapping suffix file into the memory\n suf_rec_size = ctr_size + suf_len / 4;\n MAX_BYTE_COUNT = MAX_BYTE_COUNT / suf_rec_size * suf_rec_size;\n suf_parts_num = (int) ((kmers_num * suf_rec_size) % MAX_BYTE_COUNT == 0 ? (kmers_num * suf_rec_size) / MAX_BYTE_COUNT : (kmers_num * suf_rec_size) / MAX_BYTE_COUNT + 1);\n suf_parts_size = new long[suf_parts_num];\n suf_file = new RandomAccessFile(index_path + \"/sorted.kmc_suf\", \"r\");\n suf_buff = new MappedByteBuffer[suf_parts_num];\n for (k = 0; k < suf_parts_num; ++k) {\n suf_parts_size[k] = (int) (k == suf_parts_num - 1 ? (kmers_num * suf_rec_size) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n suf_buff[k] = suf_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + k * suf_parts_size[0], suf_parts_size[k]);\n }\n // mapping pointers file into the memory\n MAX_BYTE_COUNT = MAX_BYTE_COUNT / POINTER_LENGTH * POINTER_LENGTH;\n ptr_parts_num = (int) ((kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT == 0 ? (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT : (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT + 1);\n ptr_parts_size = new long[ptr_parts_num];\n ptr_file = new RandomAccessFile(index_path + \"/pointers.db\", \"rw\");\n ptr_buff = new MappedByteBuffer[ptr_parts_num];\n for (k = 0; k < ptr_parts_num; ++k) {\n ptr_parts_size[k] = (int) (k == ptr_parts_num - 1 ? (kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n ptr_buff[k] = ptr_file.getChannel().map(FileChannel.MapMode.READ_WRITE, k * ptr_parts_size[0], ptr_parts_size[k]);\n }\n } catch (IOException e) {\n System.out.println(e.getMessage());\n System.exit(1);\n }\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}",
"public void ReadIndex(int K) throws IOException {\n IndexReader indexReader = new IndexReader();\n\n // get doc frequency, termFrequency in all docs\n// int df = indexReader.getDocFreq(token);\n// long collectionTf = indexReader.getCollectionFrequency(token);\n//// System.out.println(\" The token \\\"\" + token + \"\\\" appeared in \" + df + \" documents and \" + collectionTf\n//// + \" times in total\");\n// if (df > 0) {\n// int[][] posting = indexReader.getPostingList(token);\n// for (int i = 0; i < posting.length; i++) {\n// int doc_id = posting[i][0];\n//// int term_freq = posting[i][1];\n// String doc_no = indexReader.getDocNo(doc_id);\n//// System.out.println(\"doc_no: \" + doc_id);\n//\n//// System.out.printf(\"%10s %6d %6d\\n\", doc_no, doc_id, term_freq);\n//// System.out.printf(\"%10s 10%6d %6d\\n\", doc_no, doc_id, indexReader.getTF(token, doc_id));\n// System.out.println(\"tf_idf: \" + indexReader.getTF_IDF_weight(token, doc_id));\n//\n// }\n// }\n\n\n String doc_no = indexReader.getDocNo(FileConst.query_doc_id);\n // retreived top K relevant doc ids\n System.out.println(\"=== Top 20 Most Relevant Documents and its Cosine Similarity Score ===\");\n indexReader.retrieveRank(query_tokens, Integer.parseInt(doc_no), K);\n\n indexReader.close();\n }",
"E read(K id);",
"public IndexDatabase(String index_path, String genomes_path_file, int K_size, SequenceDatabase genomeDb) {\n int cores = Runtime.getRuntime().availableProcessors() / 2 + 1;\n int k;\n long p;\n IndexPointer null_pointer = new IndexPointer();\n try {\n Files.createDirectory(Paths.get(index_path));\n System.out.println(\"Running KMC2... \");\n executeCommand(\"kmc -r -k\" + K_size + \" -t\" + cores + \" -m\" + \n (Runtime.getRuntime().maxMemory() / 1073741824L) + \" -ci1 -fm \" + \n (genomeDb.num_genomes > 1 ? \"@\" + genomes_path_file.trim() : genomeDb.genome_names[1]) + \" \" + index_path + \"/kmers \" + index_path);\n String output = executeCommand(\"kmc_tools sort \" + index_path + \"/kmers \" + index_path + \"/sorted\");\n if (output.startsWith(\"This database contains sorted k-mers already!\")) {\n new File(index_path + \"/kmers.kmc_pre\").renameTo(new File(index_path + \"/sorted.kmc_pre\"));\n new File(index_path + \"/kmers.kmc_suf\").renameTo(new File(index_path + \"/sorted.kmc_suf\"));\n //Files.copy(Paths.get(path+\"/kmers.kmc_pre\"), Paths.get(path+\"/sorted.kmc_pre\"));\n //Files.copy(Paths.get(path+\"/kmers.kmc_suf\"), Paths.get(path+\"/sorted.kmc_suf\"));\n } else {\n new File(index_path + \"/kmers.kmc_pre\").delete();\n new File(index_path + \"/kmers.kmc_suf\").delete();\n }\n pre_file = new RandomAccessFile(index_path + \"/sorted.kmc_pre\", \"r\");\n pre_file.seek(pre_file.length() - 8);\n header_pos = read_int(pre_file);\n pre_file.seek(pre_file.length() - 8 - header_pos);\n // read the index properties \n K = read_int(pre_file);\n mode = read_int(pre_file);\n ctr_size = read_int(pre_file);\n pre_len = read_int(pre_file);\n min_count = read_int(pre_file);\n max_count = read_int(pre_file);\n kmers_num = read_long(pre_file);\n suf_len = K - pre_len;\n key = new kmer(K, pre_len, suf_len);\n System.out.println(\"Indexing \" + kmers_num + \" kmers... \");\n // load the prefix file into the memory \n pre_file.seek(4);\n int q, len = 1 << (2 * pre_len);\n prefix_ptr = new long[len];\n MappedByteBuffer pre_buff;\n for (q = 0, p = 0; p < 8; ++p) {\n pre_buff = pre_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + p * len, len);\n for (k = 0; k < len / 8; ++k, ++q) {\n prefix_ptr[q] = read_long(pre_buff);\n }\n pre_buff = null;\n }\n pre_file.close();\n\n // mapping suffix file into the memory\n suf_rec_size = ctr_size + suf_len / 4;\n MAX_BYTE_COUNT = MAX_BYTE_COUNT / suf_rec_size * suf_rec_size;\n suf_parts_num = (int) ((kmers_num * suf_rec_size) % MAX_BYTE_COUNT == 0 ? (kmers_num * suf_rec_size) / MAX_BYTE_COUNT : (kmers_num * suf_rec_size) / MAX_BYTE_COUNT + 1);\n suf_parts_size = new long[suf_parts_num];\n suf_file = new RandomAccessFile(index_path + \"/sorted.kmc_suf\", \"r\");\n suf_buff = new MappedByteBuffer[suf_parts_num];\n for (k = 0; k < suf_parts_num; ++k) {\n suf_parts_size[k] = (int) (k == suf_parts_num - 1 ? (kmers_num * suf_rec_size) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n suf_buff[k] = suf_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + k * suf_parts_size[0], suf_parts_size[k]);\n }\n // mapping pointers file into the memory\n MAX_BYTE_COUNT = MAX_BYTE_COUNT / POINTER_LENGTH * POINTER_LENGTH;\n ptr_parts_num = (int) ((kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT == 0 ? (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT : (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT + 1);\n ptr_parts_size = new long[ptr_parts_num];\n ptr_file = new RandomAccessFile(index_path + \"/pointers.db\", \"rw\");\n ptr_buff = new MappedByteBuffer[ptr_parts_num];\n for (k = 0; k < ptr_parts_num; ++k) {\n ptr_parts_size[k] = (int) (k == ptr_parts_num - 1 ? (kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n ptr_buff[k] = ptr_file.getChannel().map(FileChannel.MapMode.READ_WRITE, k * ptr_parts_size[0], ptr_parts_size[k]);\n }\n for (p = 0; p < kmers_num; ++p) {\n put_pointer(null_pointer, p);\n }\n } catch (IOException e) {\n System.out.println(e.getMessage());\n System.exit(1);\n }\n }",
"V readFromStore(K k);",
"Material findMaterial(String name) throws ReadException;",
"public Record getRecord(int index) throws IOException{\n\t\t//buff.checkBuffers(index);\n\t\t//buff=new BufferPool();\n\t\t//System.out.println(\"f\");\n\t\tRecord rec = buff.checkBuffers(index);\n\t\t//System.out.println(\"f\");\n\t\tif(rec.getKey()==-1){\n\t\tRecord recs = buff.doLRU(index);\n\t\t\treturn recs;\n\t\t}\n\t\t\n\t\t//buff.checkBuff(index)\n\t\t\n\t\t\n\t\treturn rec;\n\t\t\n\t\t//looks to see if index is in buffer length.\n\t\t//if not. checks which buffer is dirty\n\t\t//if none, still write buffer back to file if all are full\n\t\t//then read in what hasnt been read from index\n\t\t\n\t\t\n\t}",
"ByteBuffer readKey(int entryIndex) {\n if (entryIndex == Chunk.NONE) {\n return null;\n }\n\n long keyReference = getKeyReference(entryIndex);\n int[] keyArray = longToInts(keyReference);\n int blockID = keyArray[BLOCK_ID_LENGTH_ARRAY_INDEX] >> KEY_BLOCK_SHIFT;\n int keyPosition = keyArray[POSITION_ARRAY_INDEX];\n int length = keyArray[BLOCK_ID_LENGTH_ARRAY_INDEX] & KEY_LENGTH_MASK;\n\n return memoryManager.getByteBufferFromBlockID(blockID, keyPosition, length);\n }",
"StorableIndexInfo getIndexInfo();",
"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}",
"int readerIndex();",
"protected abstract int readInternal(int index);",
"public StructManager read() throws Exception;",
"private static void readDatabase(String path) {\n try {\n FileInputStream fileIn = new FileInputStream(path + \"/database.ser\");\n ObjectInputStream inStream = new ObjectInputStream(fileIn);\n database = (Database) inStream.readObject();\n inStream.close();\n fileIn.close();\n } catch (IOException i) {\n i.printStackTrace();\n } catch (ClassNotFoundException c) {\n c.printStackTrace();\n }\n }",
"protected IndexReader getReader() {\n\t\treturn indexReader;\n\t}",
"io.dstore.engine.MetaInformation getMetaInformation(int index);",
"io.dstore.engine.MetaInformation getMetaInformation(int index);",
"io.dstore.engine.MetaInformation getMetaInformation(int index);",
"io.dstore.engine.MetaInformation getMetaInformation(int index);",
"io.dstore.engine.MetaInformation getMetaInformation(int index);",
"@Override\n\tpublic Map<String, Object> read(int bno) throws Exception {\n\t\treturn boardDao.read(bno);\n\t}",
"public IndexReader getIndexReader() {\n return indexReader;\n }",
"Kaiwa selectByPrimaryKey(String maht);",
"@Override public MeasureRawColumnChunk readMeasureChunk(FileReader fileReader, int columnIndex) {\n // operation of getting the measure chunk is not supported as its a non\n // leaf node\n // and in case of B+Tree data will be stored only in leaf node and\n // intermediate\n // node will be used only for searching the leaf node\n throw new UnsupportedOperationException(\"Unsupported operation\");\n }",
"public Book read(int bookId){\n System.out.println(\"looking for Book with id \" + bookId);\n Book b = new Book();\n \n try (DBIterator keyIterator = dbmanager.getDB().iterator()) {\n keyIterator.seekToFirst();\n\n while (keyIterator.hasNext()) {\n String key = asString(keyIterator.peekNext().getKey());\n String[] splittedString = key.split(\"-\");\n\n if(!\"book\".equals(splittedString[0])){\n keyIterator.next();\n continue;\n }\n\n String resultAttribute = asString(dbmanager.getDB().get(bytes(key)));\n JSONObject jbook = new JSONObject(resultAttribute);\n\n if(jbook.getInt(\"idBOOK\") == bookId){\n b = new Book(jbook);\n break;\n }\n keyIterator.next(); \n }\n }\n catch(Exception ex){\n ex.printStackTrace();\n } \n return b;\n }",
"@Override\n\tpublic String indexData(String db, String filename,\n\t\t\tWeightComputer weightComputer, TextTransformer trans)\n\t\t\tthrows IOException {\n\t\tString cascades_collection=MongoDB.mongoDB.createCollection(db,\"cascades\",\" cascades from \"+filename+\" selon \"+this.toString()+\" avec \"+weightComputer+\" transform par \"+trans);\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Indexation \"+filename);\n\t\t//ArrayListStruct<User> ret=new ArrayListStruct<User>();\n\t\tHashMap<String,User> users=new HashMap<String,User>();\n\t\tHashSet<Post> posts=new HashSet<Post>();\n\t\tHashSet<Cascade> cascades=new HashSet<Cascade>();\n\t\t\n\t\tStemmer stemmer=new Stemmer();\n\t\tBufferedReader lecteur=new BufferedReader(new FileReader(filename));\n\t\tBufferedReader lecteurW=new BufferedReader(new FileReader(this.cascadesWeightsFile));\n\t\ttry{\n\t\t\tString ligne;\n\t\t\tint nbl=0;\n\t\t\twhile((ligne=lecteur.readLine())!=null){\n\t\t\t\tnbl++;\n\t\t\t}\n\t\t\tSystem.out.println(nbl+\" lignes\");\n\t\t\tlecteur.close();\n\t\t\tlecteur=new BufferedReader(new FileReader(filename));\n\t\t\tint nb=0;\n\t\t\tint nbc=0;\n\t\t\tint nbinvalides=0;\n\t\t\tlecteur.readLine();\n\t\t\tlecteurW.readLine();\n\t\t\twhile(((ligne=lecteur.readLine())!=null)){ // && (nb<10000)){\n\t\t\t\t\t//System.out.println(ligne); \n\t\t\t\t\t\n\t\t\t\tligne=ligne.replaceAll(\"\\r\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\\\r\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\\\\\\\r\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\n\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\\\n\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\\\\\\\n\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\t\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\\\t\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\\\\\\\t\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\" \", \" \");\n\t\t\t\tligne=ligne.replace(\"^ \", \"\");\n\t\t\t\t\t//System.out.println(ligne);\n\t\t\t\t\tString[] li=ligne.split(\" \");\n\t\t\t\t\tUser user;\n\t\t\t\t\t\n\t\t\t\t\tif (li.length>=2){\n\t\t\t\t\t\t//System.out.println(li[0]+\":\"+li[1]);\n\t\t\t\t\t\tHashMap<String,Post> pc=new HashMap<String,Post>();\n\t\t\t\t\t\tHashMap<String,Long> vusUsers=new HashMap<String,Long>();\n\t\t\t\t\t\tfor(int i=0;i<li.length;i++){\n\t\t\t\t\t\t\tString[] triplet=li[i].split(\",\");\n\t\t\t\t\t\t\tif (users.containsKey(triplet[1])){\n\t\t\t\t\t\t\t\tuser=users.get(triplet[1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\tuser=User.getUser(triplet[1]);\n\t\t\t\t\t\t\t\tusers.put(triplet[1],user);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlong t=Long.valueOf(triplet[2])+1;\n\t\t\t\t\t\t\tif(triplet[0].compareTo(\"i\")==0){\n\t\t\t\t\t\t\t\tt=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif((!vusUsers.containsKey(user.getName())) || (vusUsers.get(user.getName())<t)){\n\t\t\t\t\t\t\t\tPost p=new Post(\"\",user,t,null);\n\t\t\t\t\t\t\t\tpc.put(user.getName(),p);\n\t\t\t\t\t\t\t\tvusUsers.put(user.getName(),t);\n\t\t\t\t\t\t\t\tposts.add(p);\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}\n\t\t\t\t\t\tif(pc.size()>1){\n\t\t\t\t\t\t\tString wl=lecteurW.readLine();\n\t\t\t\t\t\t\tString[] ws=wl.split(\" \");\n\t\t\t\t\t\t\tHashMap<Integer,Double> weights=new HashMap<Integer,Double>();\n\t\t\t\t\t\t\tfor(int i=0;i<ws.length;i++){\n\t\t\t\t\t\t\t\tString[] st=ws[i].split(\",\");\n\t\t\t\t\t\t\t\tweights.put(Integer.parseInt(st[0])+add, Double.valueOf(st[1]));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnbc++;\n\t\t\t\t\t\t\tCascade c=new ArtificialCascade(nbc,nbc+\"\",new HashSet<Post>(pc.values()),weights);\n\t\t\t\t\t\t\tc.indexInto(db, cascades_collection);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"ligne invalide :\" + ligne);\n\t\t\t\t\t\tnbinvalides++;\n\t\t\t\t\t\t//break;\n\t\t\t\t\t}\n\t\t\t\t\tnb++;\n\t\t\t\t\tif (nb%100==0){\n\t\t\t\t\t\tSystem.out.println(nb+\"/\"+nbl+\" lignes traitees\");\n\t\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println(nbinvalides+\" lignes invalides\");\n\t\t\t\n\t\t\t/*nb=0;\n\t\t\tnbl=posts.size();\n\t\t\tfor(Post post:posts){\n\t\t\t\tpost.indexInto(collection);\n\t\t\t\tif (nb%100==0){\n\t\t\t\t\tSystem.out.println(nb+\"/\"+nbl+\" posts inseres\");\n\t\t\t\t}\n\t\t\t\tnb++;\n\t\t\t}*/\n\t\t\tSystem.out.println(\"Creation indexs\");\n\t\t\tDBCollection col=MongoDB.mongoDB.getCollectionFromDB(db,cascades_collection);\n\t\t\tcol.ensureIndex(new BasicDBObject(\"id\", 1));\n\t\t}\n\t\tfinally{\n\t\t\tlecteur.close();\n\t\t\tlecteurW.close();\n\t\t}\n\t\t\n\t\treturn cascades_collection;\n\t}",
"public static void load() {\r\n\t\tString mar = new String(readMAR().getStr());\r\n\t\tTraceINF.write(\"Read memory \"+mar);\r\n\t\tFormatstr content = new Formatstr();\r\n//\t\tSystem.out.println(\"index\"+Integer.parseInt(mar.substring(0, mar.length() - 2), 2));\r\n\t\tcontent.setStr(getBank(mar)[Integer.parseInt(mar.substring(0, mar.length() - 2), 2)]);\r\n\t\t\r\n\t\twriteMBR(content);\r\n\t\tTraceINF.write(\"Read finished.\");\r\n\t}",
"JournalEntry read() throws IOException, InvalidJournalEntryException;",
"MongoDBEntry<K, V> get(byte[] key);",
"private void readEntry(long Key)\n\t{\n\t\tString SQL = \"SELECT * FROM cd_songs \";\n\t\tSQL += \"WHERE ID = \" + Long.toString(Key);\n\t\t\n\t\tResultSet rSet = DBConnection.executeQuery(SQL);\n\t\t\n\t\tif (rSet == null) return;\n\t\t\n\t\ttry\n\t\t{\n\t\t\t\n\t\t\tif (rSet.next())\n\t\t\t{\n\t\t\t\t\n\t\t\t\t// The index of one ResultSet starts in 1 NOT IN 0 (DO NOT FORGET)\n\t\t\t\t// System.out.println(rSet.getString(\"Typ_Music\")); // Si funciona\n\t\t\t\t// System.out.println(rSet.getString(1)); \t\t // Si funciona\n\t\t\t\t// System.out.println(rSet.getNString(1)); \t\t\t// No funciona\n\t\t\t\t/* System.out.println(rSet.getString(2)); \n\t\t\t\t System.out.println(rSet.getString(3));\n\t\t\t\t System.out.println(rSet.getString(4));\n\t\t\t\t System.out.println(rSet.getString(5));\n\t\t\t\t System.out.println(rSet.getString(6)); */\n\t\t\t\t\n\t\t\t\t//tbID, tbTypMusic, tbAuthor, tbCD_Name, tbSong_Name, tbCountry\n\t\t\t\t\n\t\t\t\t tbID.setText(rSet.getString(\"ID\")); \t\t\t //funciona de ambas formas \"ID\" y con getInt(1).\n\t\t\t\t //tbID.setText(toString(rSet.getInt(1)));\n\t\t\t\t //tbID.setText(String.valueOf(rSet.getInt(0)));\n\t\t\t\t\n\t\t\t\t tbTypMusic.setText(rSet.getString(2));\n\t\t\t\t //tbTypMusic.setText(rSet.getString(\"Typ_Music\")); //funciona\n\t\t\t\t\n\t\t\t\t tbAuthor.setText(rSet.getString(3));\n\t\t\t\t tbCD_Name.setText(rSet.getString(4));\n\t\t\t\t tbSong_Name.setText(rSet.getString(5));\n\t\t\t\t tbCountry.setText(rSet.getString(6));\n\t\t\t\t\n\t\t\t\trSet.close();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Der Datensatz konnte nicht gefunden werden\", \"Datensatz lesen\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\tthis.mKey = -1;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch (Exception ex) {}\n\t\t\n\t\t//hasChanged = true;\n\t\t\n\t}",
"public <T> T readKey() {\n return readObject();\n }",
"public long find(kmer k_mer) {\n long low, mid, high;\n int j, comp;\n low = prefix_ptr[k_mer.prefix];\n if (k_mer.prefix == prefix_ptr.length - 1) {\n high = kmers_num - 1;\n } else {\n high = prefix_ptr[k_mer.prefix + 1] - 1;\n }\n while (low <= high) {\n mid = (low + high) / 2;\n j = (int) (mid * suf_rec_size / suf_parts_size[0]);\n suf_buff[j].position((int) (mid * suf_rec_size % suf_parts_size[0]));\n suf_buff[j].get(key.suffix, 0, suf_len / 4);\n comp = k_mer.compare_suffix(key);\n if (comp == -1) {\n high = mid - 1;\n } else if (comp == 1) {\n low = mid + 1;\n } else {\n return mid;\n }\n }\n return -1L; // not found\n }",
"public abstract Slice Get(ReadOptions options, Slice key) throws IOException, DecodeFailedException, BadFormatException;",
"public Object migrateWords2index(String wordhash) throws IOException {\n File db = plasmaWordIndexFile.wordHash2path(oldDatabaseRoot, wordhash);\r\n if (!(db.exists())) return \"not available\";\r\n plasmaWordIndexFile entity = null;\r\n try {\r\n entity = new plasmaWordIndexFile(oldDatabaseRoot, wordhash, true);\r\n int size = entity.size();\r\n indexContainer container = new indexContainer(wordhash, payloadrow(), useCollectionIndex);\r\n \r\n try {\r\n Iterator entries = entity.elements(true);\r\n indexRWIEntry entry;\r\n while (entries.hasNext()) {\r\n entry = (indexRWIEntry) entries.next();\r\n // System.out.println(\"ENTRY = \" + entry.getUrlHash());\r\n container.add(new indexRWIEntry[] { entry }, System.currentTimeMillis());\r\n }\r\n // we have read all elements, now delete the entity\r\n entity.deleteComplete();\r\n entity.close();\r\n entity = null;\r\n \r\n indexContainer feedback = collections.addEntries(container, container.updated(), false);\r\n if (feedback != null) return feedback;\r\n return new Integer(size);\r\n } catch (kelondroException e) {\r\n // database corrupted, we simply give up the database and delete it\r\n try { entity.close(); } catch (Exception ee) { }\r\n entity = null;\r\n try { db.delete(); } catch (Exception ee) { }\r\n return \"database corrupted; deleted\";\r\n }\r\n } finally {\r\n if (entity != null) try {entity.close();}catch(Exception e){}\r\n }\r\n }",
"com.rpg.framework.database.Protocol.MonsterState getData(int index);",
"@Test\n public void testRead() {\n // Choose a random key to read, among the available ones.\n int readKeyNumber = new Random().nextInt(RiakKVClientTest.recordsToInsert);\n // Prepare two fields to read.\n Set<String> fields = new HashSet<>();\n fields.add(RiakKVClientTest.firstField);\n fields.add(RiakKVClientTest.thirdField);\n // Prepare an expected result.\n HashMap<String, String> expectedValue = new HashMap<>();\n expectedValue.put(RiakKVClientTest.firstField, Integer.toString(readKeyNumber));\n expectedValue.put(RiakKVClientTest.thirdField, Integer.toString((readKeyNumber * readKeyNumber)));\n // Define a HashMap to store the actual result.\n HashMap<String, ByteIterator> readValue = new HashMap<>();\n // If a read transaction has been properly done, then one has to receive a Status.OK return from the read()\n // function. Moreover, the actual returned result MUST match the expected one.\n Assert.assertEquals(\"Read transaction FAILED.\", OK, RiakKVClientTest.riakClient.read(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(readKeyNumber))), fields, readValue));\n Assert.assertEquals(\"Read test FAILED. Actual read transaction value is NOT MATCHING the expected one.\", expectedValue.toString(), readValue.toString());\n }",
"public KrillIndex () throws IOException {\n this((Directory) new RAMDirectory());\n }",
"@Override\r\n public void read() {\n System.out.println('\\n' + \"DB repo: \");\r\n //Idk, probably search for a person and read data??\r\n\r\n }",
"entities.Torrent.ChunkInfo getChunks(int index);",
"@Test\n public void testCase4 () throws IOException {\n //\t\tlog.trace(\"Testcase4\");\n\n ki = new KrillIndex();\n ki.addDoc(createFieldDoc0());\n ki.commit();\n ki.addDoc(createFieldDoc1());\n ki.addDoc(createFieldDoc2());\n ki.commit();\n\n sq = new SpanSegmentQuery(new SpanElementQuery(\"base\", \"e\"),\n new SpanNextQuery(new SpanTermQuery(new Term(\"base\", \"s:a\")),\n new SpanTermQuery(new Term(\"base\", \"s:b\"))));\n\n kr = ki.search(sq, (short) 10);\n ki.close();\n\n assertEquals(\"totalResults\", kr.getTotalResults(), 2);\n // Match #0\n assertEquals(\"doc-number\", 0, kr.getMatch(0).getLocalDocID());\n assertEquals(\"StartPos\", 3, kr.getMatch(0).startPos);\n assertEquals(\"EndPos\", 5, kr.getMatch(0).endPos);\n // Match #1\n assertEquals(\"doc-number\", 0, kr.getMatch(1).getLocalDocID());\n assertEquals(\"StartPos\", 1, kr.getMatch(1).startPos);\n assertEquals(\"EndPos\", 3, kr.getMatch(1).endPos);\n }",
"public IndexDatabase(String index_path, String genomes_path_file, SequenceDatabase genomeDb, GraphDatabaseService graphDb, int previous_num_genomes) {\n int cores = Runtime.getRuntime().availableProcessors() / 2 + 1;\n int i, k, p, trsc, seq_nodes;\n long c_index, p_index, l, new_kmers_num;\n IndexPointer null_pointer = new IndexPointer();\n Node node;\n ResourceIterator<Node> nodes;\n Path old_index_folder;\n // move current index files to directory old_index\n try {\n old_index_folder = Files.createDirectory(Paths.get(index_path+\"/old_index\"));\n Files.move(Paths.get(index_path + \"/sorted.kmc_pre\"), Paths.get(index_path + \"/old_index/sorted.kmc_pre\"));\n Files.move(Paths.get(index_path + \"/sorted.kmc_suf\"), Paths.get(index_path + \"/old_index/sorted.kmc_suf\"));\n Files.move(Paths.get(index_path + \"/pointers.db\"), Paths.get(index_path + \"/old_index/pointers.db\"));\n // load old_index\n IndexDatabase old_index = new IndexDatabase(index_path + \"/old_index\");\n K = old_index.K;\n // make new index for new genomes\n System.out.println(\"Running KMC2... \");\n executeCommand(\"kmc -r -k\" + K + \" -t\" + cores + \" -m\" + (Runtime.getRuntime().maxMemory() / 1073741824L) + \n \" -ci1 -fm \" + (genomeDb.num_genomes - previous_num_genomes > 1 ? \"@\" + \n genomes_path_file.trim() : genomeDb.genome_names[previous_num_genomes + 1]) + \n \" \" + index_path + \"/new_kmers \" + index_path);\n // merge two indeces \n executeCommand(\"kmc_tools union \" + index_path + \"/old_index/sorted \" + index_path + \"/new_kmers \" + index_path + \"/sorted\");\n pre_file = new RandomAccessFile(index_path + \"/sorted.kmc_pre\", \"r\");\n pre_file.seek(pre_file.length() - 8);\n header_pos = read_int(pre_file);\n pre_file.seek(pre_file.length() - 8 - header_pos);\n // read the merged index properties \n K = read_int(pre_file);\n mode = read_int(pre_file);\n ctr_size = read_int(pre_file);\n pre_len = read_int(pre_file);\n min_count = read_int(pre_file);\n max_count = read_int(pre_file);\n new_kmers_num = read_long(pre_file);\n kmers_num += new_kmers_num;\n System.out.println(new_kmers_num + \" new kmers generated. \");\n // load the prefix file into the memory \n pre_file.seek(4);\n int q, len = 1 << (2 * pre_len);\n prefix_ptr = new long[len];\n MappedByteBuffer pre_buff;\n for (q = 0, p = 0; p < 8; ++p) {\n pre_buff = pre_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + p * len, len);\n for (k = 0; k < len / 8; ++k, ++q) {\n prefix_ptr[q] = read_long(pre_buff);\n //System.out.println(q+\" \"+prefix_ptr[q]);\n }\n pre_buff = null;\n }\n pre_file.close();\n // mapping suffix file into the memory \n suf_len = K - pre_len;\n suf_rec_size = ctr_size + suf_len / 4;\n MAX_BYTE_COUNT = MAX_BYTE_COUNT / suf_rec_size * suf_rec_size;\n suf_parts_num = (int) ((kmers_num * suf_rec_size) % MAX_BYTE_COUNT == 0 ? (kmers_num * suf_rec_size) / MAX_BYTE_COUNT : (kmers_num * suf_rec_size) / MAX_BYTE_COUNT + 1);\n suf_parts_size = new long[suf_parts_num];\n suf_file = new RandomAccessFile(index_path + \"/sorted.kmc_suf\", \"r\");\n suf_buff = new MappedByteBuffer[suf_parts_num];\n key = new kmer(K, pre_len, suf_len);\n for (k = 0; k < suf_parts_num; ++k) {\n suf_parts_size[k] = (int) (k == suf_parts_num - 1 ? (kmers_num * suf_rec_size) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n suf_buff[k] = suf_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + k * suf_parts_size[0], suf_parts_size[k]);\n }\n // mapping pointers file into the memory \n MAX_BYTE_COUNT = MAX_BYTE_COUNT / POINTER_LENGTH * POINTER_LENGTH;\n ptr_parts_num = (int) ((kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT == 0 ? (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT : (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT + 1);\n ptr_parts_size = new long[ptr_parts_num];\n ptr_file = new RandomAccessFile(index_path + \"/pointers.db\", \"rw\");\n ptr_buff = new MappedByteBuffer[ptr_parts_num];\n for (k = 0; k < ptr_parts_num; ++k) {\n ptr_parts_size[k] = (int) (k == ptr_parts_num - 1 ? (kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n ptr_buff[k] = ptr_file.getChannel().map(FileChannel.MapMode.READ_WRITE, k * ptr_parts_size[0], ptr_parts_size[k]);\n }\n for (p = 0; p < kmers_num; ++p) {\n put_pointer(null_pointer, p);\n }\n // adjusting available pointers\n try (Transaction tx = graphDb.beginTx()) {\n nodes = graphDb.findNodes(DynamicLabel.label(\"node\"));\n seq_nodes = (int) graphDb.findNodes(DynamicLabel.label(\"pangenome\")).next().getProperty(\"num_nodes\");\n tx.success();\n }\n IndexPointer ptr = new IndexPointer();\n System.out.println(\"Updating kmer index... \");\n for (i = 0; nodes.hasNext();) {\n try (Transaction tx = graphDb.beginTx()) {\n for (trsc = 0; trsc < 10000 && nodes.hasNext(); ++trsc, ++i) {\n node = nodes.next();\n l = (long) node.getProperty(\"first_kmer\");\n p_index = find(old_index.get_kmer(l));\n old_index.get_pointer(ptr, l);\n put_pointer(ptr, p_index);\n node.setProperty(\"first_kmer\", p_index);\n for (l = old_index.get_next_index(l); l != -1L; l = old_index.get_next_index(l)) {\n c_index = find(old_index.get_kmer(l));\n old_index.get_pointer(ptr, l);\n put_pointer(ptr, c_index);\n put_next_index(c_index, p_index);\n p_index = c_index;\n }\n put_next_index(-1L, p_index);\n node.setProperty(\"last_kmer\", p_index);\n if (i % (seq_nodes / 100 + 1) == 0) {\n System.out.print((long) i * 100 / seq_nodes + 1 + \"% \\r\");\n }\n }\n tx.success();\n }\n }\n old_index.close();\n Files.delete(Paths.get(index_path + \"/old_index/sorted.kmc_suf\"));\n Files.delete(Paths.get(index_path + \"/new_kmers.kmc_pre\"));\n Files.delete(Paths.get(index_path + \"/new_kmers.kmc_suf\"));\n Files.delete(Paths.get(index_path + \"/old_index/pointers.db\"));\n Files.delete(Paths.get(index_path + \"/old_index/sorted.kmc_pre\"));\n //Files.delete(old_index_folder);\n } catch (IOException e) {\n System.out.println(e.getMessage() + \"\\nFailed to make index!\");\n System.exit(1);\n }\n }",
"List<Material> findAllMaterials() throws ReadException;",
"public MedicalRecord getMedicalRecord(String patient, String index){\n int i = Integer.parseInt(index);\n if(database.containsKey(patient)){\n if(database.get(patient).size() > i){\n return database.get(patient).get(i);\n } else{\n System.out.println(\"No such Medical Records found for \" + patient);\n }\n } else {\n System.out.println(patient + \" Not found in database\");\n }\n return null;\n }",
"Engine selectByPrimaryKey(String num);",
"public static int readIndex(final Scanner kb)\r\n {\r\n // Preconditions\r\n if(kb == null)\r\n throw new IllegalArgumentException(\"bad readIndex Scanner\");\r\n \r\n int index;\r\n \r\n do\r\n {\r\n System.out.print(\"Please enter an index (0 or more): \");\r\n index = Integer.parseInt(kb.nextLine());\r\n } while(index < 0);\r\n \r\n return index;\r\n }",
"String readKeyFromIndex(int position) throws IOException {\n file.seek(indexPositionToKeyFp(position));\n return file.readUTF();\n }",
"@Test\n @Ignore\n public void testRead() throws Exception {\n System.out.println(\"read\");\n Identifier identifier = null;\n IndexDaoImpl instance = null;\n Index expResult = null;\n Index result = instance.read(identifier);\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 }",
"SingleDocumentModel getDocument(int index);",
"public long load(Map<Token,Long> revisions) throws IOException {\n long rev = -1;\n \n readBytes(13);\n readHeader(buffer);\n version = readVersion(buffer);\n int bufferSize = buffer.getInt();\n\n ByteBuffer uncompressedBuffer = ByteBuffer.allocate(bufferSize);\n byte[] compressedBuffer = new byte[bufferSize];\n \n int compressedLength = 0;\n while ((compressedLength = readCompressedChunk(compressedBuffer)) != 0) {\n \n // uncompress the chunk\n uncompressedBuffer.clear();\n int size = Snappy.uncompress(compressedBuffer, 0, compressedLength, uncompressedBuffer.array(), 0);\n uncompressedBuffer.position(size);\n uncompressedBuffer.flip();\n \n // load the database from the uncompressed buffer\n while (uncompressedBuffer.hasRemaining()) {\n Storable s = readType(uncompressedBuffer);\n if (s == revision) {\n revision.deserialize(uncompressedBuffer, version);\n rev = revision.getValue();\n continue;\n }\n \n Long expirationTime = null;\n if (s == expires) {\n expires.deserialize(uncompressedBuffer, version);\n expirationTime = expires.getExpires();\n s = readType(uncompressedBuffer);\n }\n \n Token key = new Token();\n key.deserialize(uncompressedBuffer, version);\n \n Model model = (Model) s;\n model.deserialize(uncompressedBuffer, version);\n if (expirationTime != null) {\n model.setExpirationTime(expirationTime);\n }\n Database.put(key, model);\n revisions.put(key, rev);\n }\n }\n \n return rev;\n }",
"public Object read() throws IOException, RecordIOException;",
"LogEntry getEntry(final long index);",
"public Schema readSchema() {\n Schema result = Schema.defaultSchema();\n SchemaInfo schema = readServerSchema();\n for (IndexInfo indexInfo : schema.getIndexes()) {\n Index index =\n result.index(indexInfo.getName(), indexInfo.getIndexOptions(), indexInfo.getShardWidth());\n List<FieldInfo> fields = indexInfo.getFields();\n if (fields != null) {\n for (IFieldInfo fieldInfo : indexInfo.getFields()) {\n // do not read system fields\n if (systemFields.contains(fieldInfo.getName())) {\n continue;\n }\n index.field(fieldInfo.getName(), fieldInfo.getOptions());\n }\n }\n }\n return result;\n }",
"public M load(K id);",
"ContentInputStream get(int key) throws ContentStoreException;",
"private void loadKaryotype() throws ProjectDataAccessException\r\n {\r\n try\r\n {\r\n currentKaryotype = inventoryMgr.getKaryotype(id);\r\n\r\n }\r\n catch(Exception e)\r\n {\r\n e.printStackTrace();\r\n }\r\n }",
"@Override public DimensionRawColumnChunk readDimensionChunk(FileReader fileReader,\n int columnIndex) {\n // operation of getting the dimension chunk is not supported as its a\n // non leaf node\n // and in case of B+Tree data will be stored only in leaf node and\n // intermediate\n // node will be used only for searching the leaf node\n throw new UnsupportedOperationException(\"Unsupported operation\");\n }",
"PdfKeywordIterator() {\n\t\t\ttry {\n\t\t\t\tmReadStmt = getConnection()\n\t\t\t\t\t\t.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);\n\t\t\t\tmReadSet = mReadStmt.executeQuery(\"SELECT * FROM PdfKeyword\");\n\t\t\t\tmReadSet.beforeFirst();\n\n\t\t\t\t// wie viele columns\n\t\t\t\tResultSetMetaData rsmd = mReadSet.getMetaData();\n\t\t\t\tmAnzahlCols = rsmd.getColumnCount();\n\n\t\t\t} catch (SQLException ex) {\n\t\t\t}\n\t\t}",
"@PostConstruct\r\n public void init() {\n File database = new File(applicationProps.getGeodb());\r\n try {\r\n reader = new DatabaseReader.Builder(database).withCache(new CHMCache()).build();\r\n } catch (IOException e) {\r\n log.error(\"Error reading maxmind DB, \", e);\r\n }\r\n }",
"public String read_from_mem(ChunkName n) {\n\tfor (ChunkName key : this.my_data.keySet()) {\n\t if (n.to_String().equals(key.to_String())) {\n\t\treturn this.my_data.get(key);\n\t }\n\t}\n\treturn null;\n }",
"public void read () throws IOException, ClassNotFoundException {\n BufferedReader reader = FileManager.getReader\n (JerboaProperties.getString(\"KeyFeatureContainer.filename\"));\n double kThreshold = JerboaProperties.getDouble(\"KeyFeatureContainer.keyThreshold\",0.0);\n double fThreshold = JerboaProperties.getDouble(\"KeyFeatureContainer.featureThreshold\",0.0);\n\n String line;\n String[] tokens;\n double x;\n line = reader.readLine();\n tokens = line.split(\"\\\\t\");\n \n sf = Double.parseDouble(tokens[2]);\n\n while ((line = reader.readLine()) != null) {\n tokens = line.split(\"\\\\t\");\n if (tokens.length == 2) {\n if ((! filterKeys) || kTable.containsKey(tokens[0])) {\n x = Double.parseDouble(tokens[1]);\n if (x >= kThreshold)\n kTable.put(tokens[0],x);\n else if (filterKeys)\n kTable.remove(tokens[0]);\n }\n } else {\n x = Double.parseDouble(tokens[1]);\n if (x >= fThreshold) {\n kfTable.put(tokens[0],x);\n fTable.put(tokens[0],Double.parseDouble(tokens[2]));\n }\n }\n }\n }",
"protected void modelRead(){\r\n\t\tthis.model.read(in, null);\r\n\t\tSystem.out.println(\"\\n -- model read finished --\\n\");\r\n\t}",
"public static KidDatabaseDisk loadFileFromText(String filename, int chunk) {\n\n KidDatabaseDisk result = new KidDatabaseDisk();\n result.fileName = filename;\n try(BufferedReader br = new BufferedReader(new FileReader(filename+\".txt\"))) {\n for (String line; (line = br.readLine()) != null; ) {\n String[] pieces = line.split(\"\\t\");\n result.add(new Kid(pieces[0]));\n result.sequenceLength.add(Integer.parseInt(pieces[1]));\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n result.sequence128db = new RocksDbKlue(filename+\".disk.\"+String.format(\"%02d\", chunk), false);\n return result;\n }",
"WdWordDict selectByPrimaryKey(Long dictId);",
"public synchronized V get(K key) throws IOException {\n\t\t\treadIndex();\n\t\t\t\n\t\t\tPair<K, V> pair = seekInternal(key);\n\t\t\tif (pair != null) {\n\t\t\t\treturn pair.value();\n\t\t\t} else\n\t\t\t\treturn null;\n\t\t}",
"@Override\n public Status read(String table, String key, Set<String> fields,\n Map<String, ByteIterator> result) {\n ReadM request = ReadM.newBuilder().setTable(table).setKey(key).build();\n ReadResult response;\n try {\n response = blockingStub.read(request);\n Map<String, ByteIterator> output = deserialize(response.getOutput());\n if(fields == null) {\n return Status.OK;\n }\n for(String s : fields) {\n ByteIterator v = output.get(s);\n result.put(s, v);\n }\n } catch (StatusRuntimeException e) {\n return Status.ERROR;\n }\n if (result.isEmpty()) {\n return Status.NOT_FOUND;\n }\n return Status.OK;\n }",
"public long index() {\n return manager.compactIndex();\n }",
"public long readMem(int index) throws Exception{\n\t\tif(index >= 0 && index < Constants.MEM_SIZE)\n\t\t\treturn memory[index];\n\t\telse\n\t\t\tthrow new Exception(\"Illegal memory location, trying to access MEM[\"+index+\"]\");\n\t}",
"Text getKey() throws IOException;",
"public Record readRecord(Long id);",
"protected IndexReader getIndexReader(String indexFolder) throws IOException {\n return DirectoryReader.open(FSDirectory.open(Paths.get(indexFolder)));\n }",
"public void load(String indexPath, String dbPath) {\n int lineIndex = 0;\n String line = \"\";\n BatchInserter inserter = null;\n BufferedReader reader = null;\n int id;\n try {\n Map<String, String> config = new HashMap<String, String>();\n config.put(\"dbms.pagecache.memory\", \"100g\");\n if (Util.pathExist(dbPath) == false)\n throw new Exception(dbPath + \" does not exist!\");\n inserter = BatchInserters.inserter(new File(dbPath).getAbsoluteFile(), config);\n\n reader = new BufferedReader(new FileReader(new File(indexPath)));\n\n lineIndex++;\n line = reader.readLine();\n String[] strList = line.split(\",\");\n int nodeCount = Integer.parseInt(strList[0]);\n int MAX_HOP = Integer.parseInt(strList[1]);\n\n for (int i = 0; i < nodeCount; i++) {\n lineIndex++;\n id = Integer.parseInt(reader.readLine());\n long neo4j_ID = graph_pos_map_list[id];\n for (int j = 1; j <= MAX_HOP; j++) {\n lineIndex++;\n line = reader.readLine();\n strList = line.split(\":\");\n int type = Integer.parseInt(strList[0]);\n switch (type) {\n case 0:\n inserter.setNodeProperty(neo4j_ID, reachGridName + \"_\" + j, strList[1]);\n break;\n case 1:\n inserter.setNodeProperty(neo4j_ID, rmbrName + \"_\" + j, strList[1]);\n break;\n case 2:\n if (strList[1].equals(\"true\"))\n inserter.setNodeProperty(neo4j_ID, geoBName + \"_\" + j, true);\n else {\n inserter.setNodeProperty(neo4j_ID, geoBName + \"_\" + j, false);\n }\n break;\n default:\n throw new Exception(String.format(\"Vertex %d hop %d has type %d!\", id, j, type));\n }\n inserter.setNodeProperty(neo4j_ID, GeoReachTypeName + \"_\" + j, type);\n }\n }\n\n inserter.shutdown();\n\n } catch (Exception e) {\n if (reader != null)\n try {\n reader.close();\n } catch (IOException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n\n if (inserter != null)\n inserter.shutdown();\n Util.println(String.format(\"line %d: %s\", lineIndex, line));\n e.printStackTrace();\n System.exit(-1);\n }\n }",
"int getChunkIndex();",
"int getChunkIndex();",
"public static IndexLocalDate recoverIndexFromDisk(String fileRootPath, String keyWord){\n String fileName = fileRootPath + \"/boolean_index/local_dates/\" + keyWord;\n return (IndexLocalDate) DiskIOHandler.readObjectFromFile(fileName);\n }",
"private String GetWordFromKID(int kid)\n\t{\n\t\tString word = \"\"; \n\t\ttry\n\t\t{\n\t\t\tConnector con = new Connector();\n\t\t\tString query = \"SELECT word FROM Keywords WHERE k_id = '\"+kid+\"'\"; \n\t\t\tResultSet inTable = con.stmt.executeQuery(query); \n\t\t\t\n\t\t\t//keyword is already in table, get kid of word\n\t\t\tif(inTable.next())\n\t\t\t{\n\t\t\t\tword = inTable.getString(\"word\"); \n\t\t\t} \n\t\t\t\n\t\t\tcon.closeConnection();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage()); \n\t\t}\n\t\treturn word; \n\t}",
"public RecordData readRecord(String key) {\n\t\tsynchronized (key.intern()) {\n\t\t\tRecordData data = records.get(key);\n\t\t\tif (data == null)\n\t\t\t\trecords.put(key, data = new RecordData(\"\", 0, \"\"));\n\t\t\treturn data;\n\t\t}\n\t}",
"public UnsignedByte read(int index) {\n if (index > -1 && index < MEMORY_LENGTH) return memory[index];\n else throw new IndexOutOfBoundsException(\"Index \" + index + \" is out of bounds (0 - \" + MEMORY_LENGTH + \")\");\n }",
"public EncogPersistedObject readObject(final String name) {\r\n\r\n\t\t// did we find the object?\r\n\t\tif (advance(name)) {\r\n\t\t\tfinal String objectType = this.in.getTag().getName();\r\n\t\t\tfinal Persistor persistor = PersistorUtil\r\n\t\t\t\t\t.createPersistor(objectType);\r\n\r\n\t\t\tif (persistor == null) {\r\n\t\t\t\tthrow new PersistError(\"Do not know how to load: \" + objectType);\r\n\t\t\t}\r\n\t\t\treturn persistor.load(this.in);\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"public static void loadWikipediaIndex() throws IOException {\n\t\tSystem.out.println(\"Wikpedia index: \" + WikipediaIndexEn_location);\t\t\n\t\tDirectory WikiIndexDirectory = FSDirectory.open(new File(WikipediaIndexEn_location));\t\t\n\t\twikipediaEn = new IndexSearcher((IndexReader.open(WikiIndexDirectory)));\t\n\t}",
"public static int read(int xact, int key) throws Exception {\n\t if (! mData.containsKey(key))\n\t\t\tthrow new Exception(\"Try to read a non-existing key\");\n\t\t\n\t int index = find_right_version(xact, key);\n\t Version v = mData.get(key).get(index);\n\t \n\t // Change RTS if necessary\n\t if (xact > v.getRTS())\n\t \tmData.get(key).get(index).setRTS(xact);\n\t \n\t Transaction tran = mTransactions.get(xact);\n\t tran.addReadList(new Tuple(key, v.getValue()));\n\t mData.get(key).get(index).addReadList(tran);\n\t System.out.println(\"T(\"+(xact+1)+\"):R(\"+key+\") => \"+v.getValue());\n\t \n\t return v.getValue();\n }",
"public Document readDocument();",
"protected abstract RMItem readData( int id, String key );",
"public static void initialize() throws IOException {\n\t\tString config_path = \"./configure.txt\";\n\t\tFile config = new File(config_path);\n\t\tif (!config.exists()) {\n\t\t\tSystem.err.println(\"Cannot find configuration file\");\n\t\t\treturn;\n\t\t}\n\t\tBufferedReader reader = new BufferedReader(new FileReader(config));\n\t\tString data_path = reader.readLine();\n\t\treader.close();\n\n\t\t/* Compression method */\n\t\tString compression = \"Gamma\";\n\t\t/* Get index */\n\t\tString className = \"dm341.index.\" + compression + \"Index\";\n\t\ttry {\n\t\t\tClass<?> indexClass = Class.forName(className);\n\t\t\tindex = (BaseIndex) indexClass.newInstance();\n\t\t} catch (Exception e) {\n\t\t\tSystem.err\n\t\t\t\t\t.println(\"Index method must be \\\"Basic\\\", \\\"VB\\\", or \\\"Gamma\\\"\");\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\n\t\t/* Get index directory */\n\t\tString input_path = data_path + \"/FEC/output\";\n\t\tFile inputdir = new File(input_path);\n\t\tif (!inputdir.exists() || !inputdir.isDirectory()) {\n\t\t\tSystem.err.println(\"Invalid index directory: \" + input_path);\n\t\t\treturn;\n\t\t}\n\n\t\t/* Index file */\n\t\tindexFile = new RandomAccessFile(new File(input_path,\n\t\t\t\t\"corpus.index\"), \"r\");\n\t\tfc = indexFile.getChannel();\n\n\t\tString line = null;\n\t\t/* Term dictionary */\n\t\tBufferedReader termReader = new BufferedReader(new FileReader(new File(\n\t\t\t\tinput_path, \"term.dict\")));\n\t\twhile ((line = termReader.readLine()) != null) {\n\t\t\tString[] tokens = line.split(\"\\t\");\n\t\t\ttermDict.put(tokens[0], Integer.parseInt(tokens[1]));\n\t\t}\n\t\ttermReader.close();\n\n\t\t/* Com dictionary */\n\t\tBufferedReader docReader = new BufferedReader(new FileReader(new File(\n\t\t\t\tinput_path, \"com.dict\")));\n\t\twhile ((line = docReader.readLine()) != null) {\n\t\t\tString[] tokens = line.split(\"\\t\");\n\t\t\tdocDict.put(Integer.parseInt(tokens[2]), tokens[0] + \"\\t\" + tokens[1]);\n\t\t}\n\t\tdocReader.close();\n\n\t\t/* Posting dictionary */\n\t\tBufferedReader postReader = new BufferedReader(new FileReader(new File(\n\t\t\t\tinput_path, \"posting.dict\")));\n\t\twhile ((line = postReader.readLine()) != null) {\n\t\t\tString[] tokens = line.split(\"\\t\");\n\t\t\tposDict.put(Integer.parseInt(tokens[0]), Long.parseLong(tokens[1]));\n\t\t\tfreqDict.put(Integer.parseInt(tokens[0]),\n\t\t\t\t\tInteger.parseInt(tokens[2]));\n\t\t}\n\t\tpostReader.close();\n\t}",
"<K, V> KeyValueStoreReader<K, V> getStore(String storeName) throws IOException;",
"public void readNode(long location) throws IOException {\n //locate node to read\n file.seek(location);\n //read key\n this.offset = file.readLong();\n //read numKeys\n this.numKeys = file.readLong();\n //read children from node\n for (int i = 0; i < children.length; i++) {\n children[i] = file.readLong();\n }\n /// read key data\n long key = -1;\n int freq = -1;\n\n for (int i = 0; i < keys.length; i++){\n key = file.readLong();\n freq = file.readInt();\n if (key == -1){\n keys[i] = null;\n }\n else {\n if (keys[i] == null) {\n keys[i] = new TreeObject(key);\n }\n keys[i].frequency = freq;\n keys[i].key = key;\n }\n }\n\n }",
"private void readMote(int index)\n {\n if (index < 0)\n return;\n\n SwapMote mote = swapDmt.getMote(index);\n\n jLabelManufact.setText(\"Manufacturer: (ID: 0x\" + Long.toHexString(mote.getManufactId()) + \")\");\n jLabelProduct.setText(\"Product: (ID: 0x\" + Long.toHexString(mote.getProductId()) + \")\");\n jLabelManufactDescr.setText(mote.getManufacturer());\n jLabelProductDescr.setText(mote.getProduct());\n jLabelAddress.setText(\"Address: \" + Integer.toString(mote.getAddress()));\n }",
"UnalignedRecords read(long position, int size) throws IOException;",
"@Override\r\n\tpublic BoardDto read(int bno) throws Exception {\n\t\treturn dao.read(bno);\r\n\t}",
"T read(int id);",
"T read(int id);",
"LuceneMemoryIndex createLuceneMemoryIndex();",
"@Override\r\n\tpublic cms_board_vo read(int cms_bno) throws Exception {\n\t\treturn sql.selectOne(\"cms_board.read\", cms_bno);\r\n\t}",
"public IndexReader getIndexReader() {\n\t\ttry {\n\t\t\tcheckDirectory();\n\t\t\tcheckIndexLocking();\n\n\t\t\tboolean exist = IndexReader.indexExists(getDirectory());\n\t\t\tif( exist ) {\n\t\t\t\treturn IndexReader.open(getDirectory());\n\t\t\t} else {\n\t\t\t\tthrow new LuceneIndexAccessException(\"The index doesn't exist for the specified directory\");\n\t\t\t}\n\t\t} catch(IOException ex) {\n\t\t\tthrow new LuceneIndexAccessException(\"Error during opening the reader\",ex);\n\t\t}\n\t}",
"public static void main(String... args) {\n Cluster cluster = Cluster.connect(\"127.0.0.1\", \"Administrator\", \"password\");\n\n /*\n * Open a bucket with the bucket name.\n */\n Bucket bucket = cluster.bucket(\"beer-sample\");\n\n /*\n * Performs the view query\n */\n ViewResult result = bucket.viewQuery(\"beer\", \"brewery_beers\", viewOptions().limit(2));\n\n /*\n * Prints metadata like the total number of rows.\n */\n System.err.println(result.metaData());\n\n /*\n * Iterates the rows and prints the information from each row\n */\n result.rows().forEach(r -> {\n System.out.println(\"-- Row --\");\n System.out.println(\"ToString(): \" + r);\n System.out.println(\"ID: \" + r.id());\n System.out.println(\"Key: \" + r.keyAs(JsonArray.class));\n System.out.println(\"Value: \" + r.valueAs(JsonObject.class));\n });\n }",
"private BufferedReader inFromFile(String indexFullName) \n {\n try \n { return new BufferedReader( new FileReader( new File( indexFullName ) ) ); } \n catch (FileNotFoundException e) \n {\n log.warn( \"could not find index file \" + indexFullName + \": no bindings created\" );\n return new BufferedReader( new EmptyReader() );\n }\n }",
"public SCDataSpec get(String key) throws IOException;",
"@Override\n public void modify(PKMonomer monomer) {\n if(this.aminoAcid.equals(\"N/A\"))\n return;\n StructureLoader loader = new AminoAcidStructLoader(this.aminoAcid);\n try {\n IAtomContainer aaMol = loader.loadStructure();\n //Join K in amino acid mol file to the K in the Monomer\n\n IAtom K_monomer=null;\n IAtom N_monomer = null;\n IAtom c_conn_K_monomer=null;\n\n IAtom K_aa=null;\n IAtom L_aa = null;\n IAtom atom_conn_K_aa=null;\n\n for(IAtom atom_monomer : monomer.getMolecule().atoms()) {\n if(atom_monomer.getSymbol().equals(\"K\")) {\n K_monomer = atom_monomer;\n c_conn_K_monomer = monomer.getMolecule().getConnectedAtomsList(atom_monomer).get(0);\n } else if(atom_monomer.getSymbol().equals(\"N\")) {\n N_monomer = atom_monomer;\n }\n }\n\n for(IAtom atom_aa : aaMol.atoms()) {\n if(atom_aa.getSymbol().equals(\"K\")) {\n K_aa = atom_aa;\n atom_conn_K_aa = aaMol.getConnectedAtomsList(atom_aa).get(0);\n } else if(atom_aa instanceof IPseudoAtom && ((IPseudoAtom) atom_aa).getLabel().equals(\"L\")) {\n L_aa = atom_aa;\n }\n }\n\n if(K_aa!=null && K_monomer!=null) {\n IBond c_k_monomer = monomer.getMolecule().getBond(K_monomer,c_conn_K_monomer);\n IBond conn_k_aa = aaMol.getBond(K_aa,atom_conn_K_aa);\n\n c_k_monomer.setOrder(conn_k_aa.getOrder());\n c_k_monomer.setAtom(c_conn_K_monomer,0);\n c_k_monomer.setAtom(atom_conn_K_aa,1);\n\n aaMol.removeAtom(K_aa);\n aaMol.removeBond(conn_k_aa);\n\n monomer.getMolecule().add(aaMol);\n monomer.getMolecule().removeAtom(K_monomer);\n\n //If L is present in the aminoacid, join it with N of the monomer.\n if(L_aa!=null && N_monomer!=null) {\n IBond L_bond = monomer.getMolecule().getConnectedBondsList(L_aa).get(0);\n IAtom atom_conn_L = monomer.getMolecule().getConnectedAtomsList(L_aa).get(0);\n L_bond.setAtom(N_monomer,0);\n L_bond.setAtom(atom_conn_L,1);\n monomer.getMolecule().removeAtom(L_aa);\n }\n }\n\n } catch (Exception e) {\n LOGGER.error(\"Issues when processing monomer:\",e);\n }\n }",
"yandex.cloud.api.mdb.mongodb.v1.DatabaseOuterClass.Database getDatabases(int index);",
"public static void test()\n\t{\n\t Environment myDbEnvironment = null;\n\t Database myDatabase = null;\n\n\t /* OPENING DB */\n\n\t // Open Database Environment or if not, create one.\n\t EnvironmentConfig envConfig = new EnvironmentConfig();\n\t envConfig.setAllowCreate(true);\n\t myDbEnvironment = new Environment(new File(\"db/\"), envConfig);\n\n\t // Open Database or if not, create one.\n\t DatabaseConfig dbConfig = new DatabaseConfig();\n\t dbConfig.setAllowCreate(true);\n\t dbConfig.setSortedDuplicates(true);\n\t myDatabase = myDbEnvironment.openDatabase(null, \"schema\", dbConfig);\n\n\t Cursor cursor = null;\n\t /* GET <K,V > FROM DB */\n\t DatabaseEntry foundKey = new DatabaseEntry();\n\t DatabaseEntry foundData = new DatabaseEntry();\n\n\t cursor = myDatabase.openCursor(null, null);\n\t cursor.getFirst(foundKey, foundData, LockMode.DEFAULT);\n\n\t do {\n\t try {\n\t String keyString = new String(foundKey.getData(), \"UTF-8\");\n\t String dataString = new String(foundData.getData(), \"UTF-8\");\n\t System.out.println(\"<\" + keyString + \", \" + dataString + \">\");\n\t } catch (UnsupportedEncodingException e) {\n\t e.printStackTrace();\n\t }\n\t } while (cursor.getNext(foundKey, foundData, LockMode.DEFAULT) == OperationStatus.SUCCESS);\n\t if (cursor != null) cursor.close();\n\t System.out.println(\"-----\");\n\t \n\t if (myDatabase != null) myDatabase.close();\n\t if (myDbEnvironment != null) myDbEnvironment.close();\n\t}",
"@Override public MeasureRawColumnChunk[] readMeasureChunks(FileReader fileReader,\n int[][] columnIndexRange) {\n // operation of getting the measure chunk is not supported as its a non\n // leaf node\n // and in case of B+Tree data will be stored only in leaf node and\n // intermediate\n // node will be used only for searching the leaf node\n throw new UnsupportedOperationException(\"Unsupported operation\");\n }"
] | [
"0.6503544",
"0.58549696",
"0.58298457",
"0.5632296",
"0.55087006",
"0.5058057",
"0.5052891",
"0.503855",
"0.50131804",
"0.49835542",
"0.4977191",
"0.48612344",
"0.48355505",
"0.47987166",
"0.4795724",
"0.4779317",
"0.47763258",
"0.47763258",
"0.47763258",
"0.47763258",
"0.47763258",
"0.47434652",
"0.473795",
"0.47250018",
"0.47123122",
"0.47100627",
"0.47057983",
"0.46874925",
"0.46692878",
"0.4669054",
"0.46661046",
"0.46492314",
"0.46412107",
"0.46312672",
"0.46170217",
"0.4615337",
"0.46094573",
"0.4582407",
"0.45751628",
"0.45716843",
"0.45667148",
"0.45534113",
"0.45227796",
"0.45222476",
"0.4512208",
"0.45056513",
"0.4498716",
"0.44982734",
"0.44631836",
"0.44534174",
"0.44359025",
"0.4433185",
"0.44286028",
"0.4416069",
"0.44090533",
"0.44010383",
"0.43969256",
"0.4387419",
"0.43825698",
"0.436611",
"0.4364905",
"0.43538827",
"0.43510076",
"0.43436322",
"0.4339099",
"0.43288463",
"0.4323363",
"0.4316216",
"0.4314172",
"0.43027934",
"0.4275811",
"0.42706078",
"0.4267264",
"0.4267264",
"0.426394",
"0.4262692",
"0.42553923",
"0.42490777",
"0.42485493",
"0.42472467",
"0.42405155",
"0.42284584",
"0.42263052",
"0.4225292",
"0.42229298",
"0.42228433",
"0.42203885",
"0.42147332",
"0.42137763",
"0.42080975",
"0.42080975",
"0.42052767",
"0.42043743",
"0.42007735",
"0.4199769",
"0.419752",
"0.4196403",
"0.4195876",
"0.41946593",
"0.41923305",
"0.4192248"
] | 0.0 | -1 |
Reads a pointer from the kmer index. | public void get_pointer(IndexPointer poniter, long number) {
poniter.node_id = ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getLong((int) (number * POINTER_LENGTH % ptr_parts_size[0]));
poniter.canonical = ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].get((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 8)) == 0;
poniter.position = ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getInt((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 9));
poniter.next_index = ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getLong((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 13));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract int readInternal(int index);",
"public long getReadPointer();",
"public int[] getIndexPointer(){\r\n \treturn this.index;\r\n \t}",
"private WALPointer readPointer(File cpMarkerFile, ByteBuffer buf) throws IgniteCheckedException {\n buf.position(0);\n\n try (FileIO io = ioFactory.create(cpMarkerFile, READ)) {\n io.readFully(buf);\n\n buf.flip();\n\n return new FileWALPointer(buf.getLong(), buf.getInt(), buf.getInt());\n }\n catch (IOException e) {\n throw new IgniteCheckedException(\n \"Failed to read checkpoint pointer from marker file: \" + cpMarkerFile.getAbsolutePath(), e);\n }\n }",
"int getOffset();",
"int getOffset();",
"int getOffset();",
"int readerIndex();",
"public Integer getOffset();",
"int getReadPosition(int index) {\n/* 170 */ return index - this.origPos + this.readerIndex;\n/* */ }",
"public int read() throws IOException {\n/* 173 */ long next = this.pointer + 1L;\n/* 174 */ long pos = readUntil(next);\n/* 175 */ if (pos >= next) {\n/* 176 */ byte[] buf = this.data.get((int)(this.pointer >> 9L));\n/* */ \n/* 178 */ return buf[(int)(this.pointer++ & 0x1FFL)] & 0xFF;\n/* */ } \n/* 180 */ return -1;\n/* */ }",
"ByteBuffer readKey(int entryIndex) {\n if (entryIndex == Chunk.NONE) {\n return null;\n }\n\n long keyReference = getKeyReference(entryIndex);\n int[] keyArray = longToInts(keyReference);\n int blockID = keyArray[BLOCK_ID_LENGTH_ARRAY_INDEX] >> KEY_BLOCK_SHIFT;\n int keyPosition = keyArray[POSITION_ARRAY_INDEX];\n int length = keyArray[BLOCK_ID_LENGTH_ARRAY_INDEX] & KEY_LENGTH_MASK;\n\n return memoryManager.getByteBufferFromBlockID(blockID, keyPosition, length);\n }",
"public static int offset_reading() {\n return (32 / 8);\n }",
"private long readJumpOffset() throws IOException {\n byte[] sec = new byte[4];\n ins.read(sec);\n return convertByteValueToLong(sec);\n }",
"private static native long getControllerForGamepadIndex(long pointer, int index);",
"public abstract int getRawOffset();",
"public abstract int getRawOffset();",
"int getRawOffset();",
"public int getSeekIndex() {\n return getIntegerProperty(\"Index\");\n }",
"@Override\n public int getPosition() throws IOException\n {\n return (int) randomAccessRead.getPosition();\n }",
"public void offsetToPointer(ByteCode bc) {\n }",
"public long readMem(int index) throws Exception{\n\t\tif(index >= 0 && index < Constants.MEM_SIZE)\n\t\t\treturn memory[index];\n\t\telse\n\t\t\tthrow new Exception(\"Illegal memory location, trying to access MEM[\"+index+\"]\");\n\t}",
"public int get(int index);",
"public abstract long getIndex();",
"public static int readIndex(final Scanner kb)\r\n {\r\n // Preconditions\r\n if(kb == null)\r\n throw new IllegalArgumentException(\"bad readIndex Scanner\");\r\n \r\n int index;\r\n \r\n do\r\n {\r\n System.out.print(\"Please enter an index (0 or more): \");\r\n index = Integer.parseInt(kb.nextLine());\r\n } while(index < 0);\r\n \r\n return index;\r\n }",
"int get(int idx);",
"private synchronized Pair<K, V> seekInternal(K key) throws IOException {\n\t\t\treadIndex(); // make sure index is read\n\n\t\t\tLong pos = keys.get(key);\n\t\t\tif (pos != null) {\n\t\t\t\tdata.seek(pos);\n\t\t\t\treturn data.next();\n\t\t\t} else\n\t\t\t\treturn null;\n\t\t}",
"public int getPosition(int index);",
"public int getOffset() {\r\n return this.offset;\r\n }",
"public int getIndex();",
"public int getIndex();",
"public int getIndex();",
"public int getOffset() {\r\n return offset;\r\n }",
"public static native long GetAt(long lpjFbxArrayVector2, int pIndex);",
"public int read(int i);",
"public UnsignedByte read(int index) {\n if (index > -1 && index < MEMORY_LENGTH) return memory[index];\n else throw new IndexOutOfBoundsException(\"Index \" + index + \" is out of bounds (0 - \" + MEMORY_LENGTH + \")\");\n }",
"int getIndex();",
"int getIndex();",
"int getIndex();",
"int getIndex();",
"int getIndex();",
"int getIndex();",
"int getIndex();",
"int getIndex();",
"int getIndex();",
"int getIndex();",
"int getIndex();",
"int getIndex();",
"int getIndex();",
"public long getOffset() throws IOException {\n\t\treturn offset;\n\t}",
"public int getOffset() \n {\n return offset;\n }",
"int sampleOffset();",
"public int getIndex()\n/* */ {\n/* 46 */ return this.index;\n/* */ }",
"abstract int get(int index);",
"double getOffset();",
"public synchronized V get(K key) throws IOException {\n\t\t\treadIndex();\n\t\t\t\n\t\t\tPair<K, V> pair = seekInternal(key);\n\t\t\tif (pair != null) {\n\t\t\t\treturn pair.value();\n\t\t\t} else\n\t\t\t\treturn null;\n\t\t}",
"public int getFoundOffset() { return _foundoffset; }",
"public ByteBuffer read(int location)\n throws DataOrderingException;",
"public int getOffset() {\r\n\t\treturn this.offset;\r\n\t}",
"int getLineOfOffset(int offset) throws BadLocationException;",
"@Generated\n @Selector(\"fetchOffset\")\n @NUInt\n public native long fetchOffset();",
"int read(long pos, byte[] buf)throws IOException;",
"public int getOffset() {\n return offset_;\n }",
"public int getOffset() {\r\n\t\treturn offset;\r\n\t}",
"public int getOffset() {\n return this.offset;\n }",
"public abstract long getStartOffset();",
"short getKeyIx();",
"public int getOffset() {\n return offset;\n }",
"public int getOffset() {\n return offset;\n }",
"@Override\n abstract public int peekIndex (ThreadInfo ti);",
"protected final int getRawOffset(int paramInt, char paramChar) {\n/* 264 */ return (this.m_index_[paramInt + (paramChar >> 5)] << 2) + (paramChar & 0x1F);\n/* */ }",
"int getChunkIndex();",
"int getChunkIndex();",
"public synchronized long getPosition() {\n\t\treturn m_read;\n\t}",
"public int getOffset() {\n return offset;\n }",
"public abstract int getStartIndex();",
"@Override\n\tpublic int read() {\n\t\tint lowByte = getFirstArg();\n\t\tint highByte = getSecondArg();\n\t\tint address = highByte;\n\t\taddress = address << 8;\n\t\taddress |= lowByte;\n\t\treturn CpuMem.getInstance().readMem(address);\n\t}",
"public int arrayOffset()\r\n/* 133: */ {\r\n/* 134:162 */ return 0;\r\n/* 135: */ }",
"E read(K id);",
"public int getOffset() {\n\t\treturn this.offset;\n\t}",
"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 Integer getPosition();",
"public abstract LogPointer getPointer() throws IOException;",
"public abstract LogPointer getPointer() throws IOException;",
"public int getIndex(\n )\n {return index;}",
"public int read(long addr) {\n\t\treturn findBlock(addr);\n\t}",
"public int getBlockIndex() {\n return mCursorPosition;\n }",
"public java.lang.Integer getOffset() {\n return offset;\n }",
"public int getOffset() {\n return offset_;\n }",
"private int getPmidIdx() {\n return this.colStartOffset + 2;\n }",
"public Integer getOffset() {\n return this.offset;\n }",
"public Integer getOffset() {\n return this.offset;\n }",
"public int getEndOffset(int childViewIndex);",
"private static native int getGamepadIndexForController(long pointer, long controllerHandle);",
"protected int _getInt(int index)\r\n/* 378: */ {\r\n/* 379:392 */ return HeapByteBufUtil.getInt(this.array, index);\r\n/* 380: */ }",
"public Integer getOffset() {\n return offset;\n }",
"private int[] findPointer() {\n \n int initialAux = 4095;\n int header = 0;\n \n \n for (int i = 0; i < 4096; i++) {\n String initialBinary = Integer.toBinaryString(0xFF & serialize[i * 4]) + Integer.toBinaryString(0xFF & serialize[i * 4 + 1]);\n short initial = Short.parseShort(initialBinary, 2);\n String sizeBinary = Integer.toBinaryString(0xFF & serialize[i * 4 + 2]) + Integer.toBinaryString(0xFF & serialize[i * 4 + 3]);\n short sizeData = Short.parseShort(sizeBinary, 2);\n \n if (initial == 0 && sizeData == 0) {\n header = i*4;\n break;\n }\n //get the higher initial \n if (initialAux > initial){\n initialAux = initial;\n }\n \n }\n\n int[] toReturn = new int[2];\n \n toReturn[0] = header;\n toReturn[1] = initialAux-1;\n \n return toReturn;\n }",
"public E peek() throws IndexOutOfBoundsException {\n return index(0);\n }",
"public static native long nativeAssetSeek(long j, long j2, int i);",
"public abstract int getIndex();"
] | [
"0.6614945",
"0.6533522",
"0.635516",
"0.6271672",
"0.62590826",
"0.62590826",
"0.62590826",
"0.6255022",
"0.6207478",
"0.6149271",
"0.61186194",
"0.60756546",
"0.5966375",
"0.5924649",
"0.5843722",
"0.58356816",
"0.58356816",
"0.5804417",
"0.5791824",
"0.5782883",
"0.57388186",
"0.571209",
"0.5639243",
"0.5623946",
"0.562014",
"0.55611724",
"0.55417717",
"0.5523682",
"0.55202645",
"0.5511947",
"0.5511947",
"0.5511947",
"0.55116975",
"0.5511504",
"0.54919714",
"0.5491011",
"0.54862845",
"0.54862845",
"0.54862845",
"0.54862845",
"0.54862845",
"0.54862845",
"0.54862845",
"0.54862845",
"0.54862845",
"0.54862845",
"0.54862845",
"0.54862845",
"0.54862845",
"0.54858106",
"0.54778093",
"0.5474474",
"0.5466662",
"0.5457078",
"0.545179",
"0.5439334",
"0.5435124",
"0.5432801",
"0.5432738",
"0.54291135",
"0.5424893",
"0.5422554",
"0.54188865",
"0.5416865",
"0.5410954",
"0.5410361",
"0.54097825",
"0.54027796",
"0.54027796",
"0.540185",
"0.5395313",
"0.53941363",
"0.53941363",
"0.53886276",
"0.5380932",
"0.5377103",
"0.5366383",
"0.5362942",
"0.5353535",
"0.53522736",
"0.53477436",
"0.53460145",
"0.5338917",
"0.5338917",
"0.533856",
"0.53351945",
"0.53183657",
"0.5315281",
"0.531334",
"0.5295179",
"0.529447",
"0.529447",
"0.5293165",
"0.5291062",
"0.5284457",
"0.52826595",
"0.527877",
"0.5278427",
"0.52758235",
"0.5263119"
] | 0.5815358 | 17 |
Writes a pointer in the index database | public void put_pointer(IndexPointer poniter, long number) {
ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putLong((int) (number * POINTER_LENGTH % ptr_parts_size[0]), poniter.node_id);
ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].put((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 8), (byte) (poniter.canonical ? 0 : 1));
ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putInt((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 9), poniter.position);
ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putLong((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 13), poniter.next_index);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public long getWritePointer();",
"protected abstract void writeInternal(int index, int value);",
"@Override\r\n\tpublic void write(IByteBuffer target, long offset) {\n\r\n\t}",
"@Override\n protected void writeInternal(int index, int value) {\n\n }",
"@Override\n protected void writeInternal(int index, int value) {\n\n }",
"int writerIndex();",
"public void write(int index, char c) {\n\t\t//Check if the page is in the main memory\n\t\tif (valid[index]) {\n\t\t\t//if the page is in the main memory, check if the page is replaced by LRU \n\t\t\tif (this.useLRU) {\n\t\t\t\t//move the current page to the beginning of the list \n\t\t\t\tmainMemory.updateToFirst(nodes[index]);\n\t\t\t}\n\t\t} \n\t\t// if the page is in the secondary memory\n\t\telse {\n\t\t\t// Pull the page out of the secondary memory\n\t\t\tString data = secondaryMemory[index];\n\t\t\t// Remove the last node in the linkList\n\t\t\tPage last = mainMemory.removeLast();\n\t\t\t// Check if the node that we deleted has been changed\n\t\t\tif (last.hasChanged()) {\n\t\t\t\tsecondaryMemory[last.getIndex()] = last.getData();\n\t\t\t}\n\t\t\t//Update the VAILD array to a false value because the page has been deleted from the main memory\n\t\t\tvalid[last.getIndex()] = false;\n\t\t\t//Update the Nodes array to null in the page index that we deleted\n\t\t\tnodes[last.getIndex()] = null;\n\t\t\t// adding the page to the head of the link\n\t\t\tnodes[index] = mainMemory.addFirst(new Page(data, index, false));\n\t\t\t// update the valid array to a true value \n\t\t\tvalid[index] = true;\n\t\t}\n\t\t// adding the char c to the data of the page using WriteData method\n\t\tnodes[index].element.WriteData(c);\n\t}",
"public void write(int index, UnsignedByte unsignedByte) {\n memory[index] = unsignedByte;\n }",
"void commit() throws IndexTransactionException;",
"public void commit () throws IOException {\n log.info(\"Internal committing index ... \");\n this.writer().commit();\n commitCounter = 0;\n this.closeReader();\n }",
"public void writeDatabase();",
"public abstract void updateIndex();",
"public void write(VirtualPointer value)\r\n {\r\n write(value, false);\r\n }",
"@DSSink({DSSinkKind.IO})\n @DSSpec(DSCat.IO)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-09-03 14:59:52.264 -0400\", hash_original_method = \"C10E35B15C5C34D2F11AD8F56A8AFBE7\", hash_generated_method = \"8538DC9FDF04C178771F287DC9084D00\")\n \n@Override\r\n public void write(int idx) throws IOException {\r\n try {\r\n beforeWrite(1);\r\n out.write(idx);\r\n afterWrite(1);\r\n } catch (IOException e) {\r\n handleIOException(e);\r\n }\r\n }",
"public long writeMem(int index, long data) throws Exception{\n\t\tif(index >= 0 && index < Constants.MEM_SIZE){\n\t\t\tmemory[index] = data;\n\t\t} else {\n\t\t\tthrow new Exception(\"Invalid memory location!!\");\n\t\t}\n\t\treturn memory[index];\n\t}",
"public void write(int datum) throws IOException {\n if (!_open)\n return;\n datum &= 0xff;\n long _here = position();\n\n // Are we synced up?\n if (_here == _digestvalidto) {\n\n // Yes, digest the byte and move the valid to pointer.\n _digest.update((byte) datum);\n _digestvalidto++; // JMC: Was missing.\n\n } // Otherwise, advancing of the position will destroy the digest sync.\n\n datum = _head.crypt((byte) datum, _here);\n _backing.write(datum);\n }",
"public void writeNode() throws IOException {\n // seek to end of file\n file.seek(offset);\n // write offset data\n file.writeLong(offset);\n // write numKeys data\n file.writeLong(numKeys);\n // write children offset\n for (int i = 0; i < children.length; i++){\n file.writeLong(children[i]);\n }\n // write key data\n for (int i = 0; i < keys.length; i++){\n if (keys[i] == null){\n file.writeLong(-1);\n file.writeInt(0);\n }\n else{\n file.writeLong(keys[i].getKey());\n file.writeInt(keys[i].getFrequency());\n }\n }\n\n //The node has been updated -- move it to the front of the cache\n if (cache != null){\n cache.addObject(this);\n }\n\n\n }",
"public void set(long index);",
"protected void txPut(int n) {}",
"public static void bgfx_update_dynamic_index_buffer(@NativeType(\"bgfx_dynamic_index_buffer_handle_t\") short _handle, @NativeType(\"uint32_t\") int _startIndex, @NativeType(\"bgfx_memory_t const *\") BGFXMemory _mem) {\n nbgfx_update_dynamic_index_buffer(_handle, _startIndex, _mem.address());\n }",
"public void onIndexUpdate();",
"void setObject(int index, Object value) throws SQLException;",
"public void saveMetaData(Transaction tr) {\r\n\t\tDebug.indexLogger.debug(\"save BPlus index meta data on page {}\",\r\n\t\t\t\tmetaPageID);\r\n\t\tPage page = BufferManager.getPage(tr, metaPageID);\r\n\r\n\t\tpage.setType(tr, Page.TYPE_BTREE_HEADER);\r\n\t\t// always remember: first seek, then write\r\n\t\tpage.seek(Page.HEADER_LENGTH);\r\n\t\tpage.writeString(tr, name);\r\n\t\tpage.writeString(tr, table.getName());\r\n\t\tpage.writeInt(tr, columnID);\r\n\t\tpage.writeInt(tr, metaPageID);\r\n\t\tpage.writeInt(tr, isPrimary ? 1 : 0);\r\n\t\tpage.writeInt(tr, treeRoot);\r\n\r\n\t\tpage.release(tr);\r\n\r\n\t}",
"void setRef(int index, Ref value) throws SQLException;",
"LuceneMemoryIndex createLuceneMemoryIndex();",
"public void store(DBConnection db) throws IOException;",
"BinaryArrayReadWrite set(int index, byte x);",
"private synchronized void flushPage(PageId pid) throws IOException {\n // some code goes here\n // not necessary for lab1\n if (bufferPool.pageIdxMap.containsKey(pid)) {\n Page pg = bufferPool.pageIdxMap.get(pid);\n if (pg.isDirty() != null) {\n Database.getCatalog().getDatabaseFile(pg.getId().getTableId()).writePage(pg);\n }\n }\n\n }",
"void write();",
"public int write(long addr) {\n\t\treturn findBlock(addr);\n\t}",
"public void write(PreparedStatement arg0) throws SQLException {\n\t\targ0.setString(1, startingPhrase);\n\t\targ0.setString(2, followingWord);\n\t\targ0.setInt(3, count);\n\t}",
"public void write(String id);",
"protected void writeReference(long offset, Object reference) {\n assert referenceMessageSize != 0 : \"References are not in use\";\n // Is there a way to compute the element offset once and just\n // arithmetic?\n UnsafeRefArrayAccess.spRefElement(references, UnsafeRefArrayAccess.calcRefElementOffset(offset), reference);\n }",
"public void write(byte[] data, long offset);",
"void writeTo(DataOutputStream dout) throws IOException {\r\n throw new Error(\"Method no longer available\");\r\n// dout.writeInt(commit_id);\r\n// dout.writeInt(table_id);\r\n// dout.writeInt(journal_entries);\r\n// dout.write(command_journal, 0, journal_entries);\r\n// int size = command_parameters.size();\r\n// dout.writeInt(size);\r\n// for (int i = 0; i < size; ++i) {\r\n// dout.writeInt(command_parameters.intAt(i));\r\n// }\r\n }",
"public void write(int location, ByteBuffer data)\n throws DataOrderingException;",
"boolean commitEntryMemTableFlush() throws IOException;",
"private void addIndexWrite(Object key, Object value, BitSet dirty, IndexMetadata idxMeta, long clock, Mutator<byte[]> mutator, EConsistencyLevel level)\n {\n List<Object> propVals = null;\n DynamicComposite colName = new DynamicComposite();\n boolean propertyNotSet = false;\n int ttl = -1;\n for(SimplePropertyMetadata pm : idxMeta.getIndexedProperties())\n {\n Object pval = invokeGetter(pm, value);\n if(pval != null)\n {\n if(propVals == null)\n propVals = new ArrayList<Object>(idxMeta.getIndexedProperties().size());\n\n if(pm.isTtlSet())\n {\n int colTtl = pm.ttl();\n if(ttl < 0 || colTtl < ttl) //min ttl of the indexed properties\n ttl = colTtl;\n }\n propVals.add(pval);\n colName.add(pval);\n }\n else if(!dirty.get(_entityMeta.getPropertyPosition(pm))) //prop value is null and not set\n propertyNotSet = true;\n }\n\n if(propVals == null) //no index property updated\n return;\n \n if(propertyNotSet) //must update none or all of a multi column index\n throw new IllegalArgumentException(\"cannot write a subset of columns to multi-column index: \" + idxMeta);\n \n if(propVals.size() < idxMeta.getIndexedProperties().size()) //some index properties set to null -> entry is removed from index\n return;\n \n colName.add(key);\n \n HColumn<DynamicComposite, byte[]> column = HFactory.createColumn(colName, IDX_COL_VAL, clock, SER_DYNAMIC_COMPOSITE, SER_BYTES);\n \n DynamicComposite rowKey = new DynamicComposite(idxMeta.id());\n \n List<List<Object>> allPartitions = idxMeta.getIndexPartitioner().partitionValue(propVals);\n if(allPartitions.size() != 1)\n throw new IllegalStateException(\"expected single partition but encountered \" + allPartitions.size());\n \n _logger.trace(\"writing to partition {}\", allPartitions.get(0));\n for(Object partitionVal : allPartitions.get(0))\n rowKey.add(partitionVal);\n \n if(ttl > 0)\n column.setTtl(ttl);\n \n mutator.addInsertion(SER_DYNAMIC_COMPOSITE.toBytes(rowKey), _entityMeta.getIndexFamilyName(), column);\n }",
"public void put_next_index(long next_index, long number) {\n ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putLong((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 13), next_index);\n }",
"void writeReference(Object obj);",
"public void insert(int index, String fragment);",
"public abstract void write(int rowCount) throws IOException;",
"void write(ByteBuffer b, int off, int len) throws IOException;",
"StorableIndexInfo getIndexInfo();",
"void writeBlock(int blockId, byte[] buffer, int offset) throws IOException;",
"public long insert();",
"void setBytes(int index, byte[] value) throws SQLException;",
"@Override\n\tpublic void set(int index, T insertItem) {\n\t\t\n\t}",
"@Override\r\n\tpublic int write() throws Exception {\n\t\treturn 0;\r\n\t}",
"Write createWrite();",
"@Override\n public void write(int b) throws IOException {\n byte ib = (byte) b;\n long p = df.position();\n // If not at the end yet,\n if (p < df.size()) {\n // Get the current value,\n byte cur_b = df.get();\n // If the value we are inserting is different,\n if (cur_b != ib) {\n // Reposition and put the new value,\n df.position(p);\n df.put(ib);\n// ++change_count;\n }\n }\n // At the end so write the byte,\n else {\n df.put(ib);\n }\n }",
"@Override\r\n\tpublic void write() {\n\t\t\r\n\t}",
"public int serialize(VirtualPointer vp, Object val);",
"public T put(int index, T t);",
"public int write(int va){\n int[] address = translate(va);\n int result = 0;\n int pos = 0;\n for(int i=0;i<2;i++){\n pos = address[i] + result;\n result = pMem[pos];\n if(result==-1)\n return -1;\n else if(result==0){\n if(i==0){\n int newPT = createPT();\n pMem[address[0]]=newPT;\n result = newPT;\n }\n else{\n int newPage = createPage();\n pMem[pos] = newPage;\n result = newPage;\n }\n }\n }\n return result+address[2];\n }",
"@ZenCodeType.Method\n @ZenCodeType.Operator(ZenCodeType.OperatorType.INDEXSET)\n default void put(String index, @ZenCodeType.Nullable IData value) {\n \n notSupportedOperator(OperatorType.INDEXSET);\n }",
"void setBlob(int index, Blob value) throws SQLException;",
"public void insert (Object object) throws IOException {\n assert indexWriter != null : \"IndexWriter is uninitialized. Initialize it before inserting.\";\n insert(AppUtils.getMapFromObject(object));\n }",
"void writeCurrentBuffer();",
"public int[] getIndexPointer(){\r\n \treturn this.index;\r\n \t}",
"@Override\r\n public void store(long key, O object) throws OBException {\n }",
"private void updateIndex() throws IOException {\n // maintain the document store (corpus) - if there is one\n if (currentMemoryIndex.containsPart(\"corpus\")) {\n // get all corpora + shove into document store\n ArrayList<DocumentReader> readers = new ArrayList<>();\n readers.add((DocumentReader) currentMemoryIndex.getIndexPart(\"corpus\"));\n for (String path : geometricParts.getAllShards().getBinPaths()) {\n String corpus = path + File.separator + \"corpus\";\n readers.add(new CorpusReader(corpus));\n }\n }\n // finally write new checkpointing data (checkpoints the disk indexes)\n Parameters checkpoint = createCheckpoint();\n this.checkpointer.saveCheckpoint(checkpoint);\n }",
"InstAssignIndex createInstAssignIndex();",
"public void writePointer(String id, Class toWrite, String fieldName, String parentNode, boolean doNotTransformFieldName, Class parentClass)\n {\n String writeClassCode = \"\";\n \n String var;\n var = generateGetterConstruct(id, null, fieldName, toWrite);\n\n boolean foundVarInClass = false;\n for(Field f : parentClass.getDeclaredFields())\n {\n if(f.getName().equals(fieldName))\n {\n foundVarInClass = true;\n break;\n }\n }\n \n if(!foundVarInClass)\n {\n var = generateGetterConstruct(id, \"id\", fieldName, toWrite);\n }\n \n if(doNotTransformFieldName)\n {\n var = fieldName;\n }\n \n writeClassCode += \"if(\"+var+\"!=null)\";\n writeClassCode += \"{\";\n writeClassCode += \"Integer index\" + fieldName+\" = \" + toWrite.getSimpleName() +\"PMap.get(Ids.getUniqueId(\" + var +\"));\";\n if(doNotTransformFieldName)\n {\n writeClassCode += \"Element wrapper\"+fieldName +\" = \" + parentNode+\";\";\n }\n else\n {\n writeClassCode += \"Element wrapper\"+fieldName+\" = new Element(\\\"\"+fieldName+\"\\\");\";\n writeClassCode += parentNode + \".addContent(\" + \"wrapper\"+fieldName+\");\";\n }\n writeClassCode += \"if(index\"+fieldName+\"!=null)\";\n writeClassCode += \"{\";\n writeClassCode += handlePointerRef(fieldName);\n //writeClassCode += \"return;\";\n writeClassCode += \"}\";\n writeClassCode += \"else\";\n writeClassCode += \"{\";\n writeClassCode += \"index\"+ fieldName+\" = new Integer(\"+toWrite.getSimpleName() +\"PMap.size());\";\n writeClassCode += handlePointerRef(fieldName);\n writeClassCode += toWrite.getSimpleName() +\"PMap.put(Ids.getUniqueId(\"+var+\"),index\"+fieldName+\");\";\n addString(id, writeClassCode);\n \n callClassWriteMethod(null, toWrite, var, \"wrapper\"+fieldName, id);\n \n writeClassCode = \"}\";\n writeClassCode += \"}\";\n addString(id, writeClassCode);\n }",
"public abstract int writeData(int address, byte[] buffer, int length);",
"void itemAddedToIndex(Object key, Object o);",
"public abstract long getIndex();",
"@Override\n public void write() {\n\n }",
"protected void direct_write(int address, byte val) {\n segment_data[address] = val;\n }",
"int insert(Position record);",
"public boolean createIndex(Hashtable<String, Hashtable<Integer,Quad>> ind_buffer){\n\t\tSet<String> keys = ind_buffer.keySet();\n\t\tHashtable<Integer,Quad> list;\n\t\tQuad comp;\n\t\tint part;\n\t\tint type1_s, type1_o;\n\t\tint type_s,type_o;\n\t\tint wei, wei1; // compared use\n\t\tint o_bytes, s_bytes, o_bytes1, s_bytes1;\n\t\tString check = \"select resource, part, type_s, type_o, weight, o_bytes, s_bytes from `\"+table+\"` where \";\n\t\t//String insert = \"insert into `sindex` values \";\n//\t\tString update = \"update \"\n\t\tResultSet rs = null;\n\t\tPreparedStatement prepstmt = null;\n\t\tString res;\n\t\tfor(String key : keys){\n\t\t\tlist = ind_buffer.get(key);\n\t\t\tif(key.indexOf('\\'') != -1 )\n\t\t\t\tres = key.replaceAll(\"'\", \"''\");\n\t\t\telse res = key;\n\t\t// hashcode sealing\t\n\t\t//\tkey = String.valueOf(key.hashCode()); \n\t\t\t\n\t\t\tfor(int i : list.keySet()){\n\t\t\t\tcomp = list.get(i);\n\t\t\t\tpart = i;\n\t\t\t\ttype_s = comp.type_s;\n\t\t\t\ttype_o = comp.type_o;\n\t\t\t\twei = comp.weight;\n\t\t\t\to_bytes = comp.o_bytes;\n\t\t\t\ts_bytes = comp.s_bytes;\n\t\t\t// seach if have res in table\n\t\t\t\tStringBuilder sql = new StringBuilder();\n\t\n\t\t\t\tsql.append(check).append(\"resource='\").append(res).append(\"' and part=\").append(part);\n\n\t\t\t\ttry {\n\t\t\t\t\tprepstmt = conn.prepareStatement(sql.toString(),ResultSet.TYPE_SCROLL_INSENSITIVE,\n\t\t\t\t\t\t\tResultSet.CONCUR_UPDATABLE);\n\t\t\t\t\trs = prepstmt.executeQuery();\n\t\t\t\t\tif(rs.next()){\n\t\t\t\t\t\t// updates the records\t\n\t\t\t\t\t\ttype1_o = rs.getInt(\"type_o\");\n\t\t\t\t\t\ttype1_s = rs.getInt(\"type_s\");\n\t\t\t\t\t\twei1 = rs.getInt(\"weight\");\n\t\t\t\t\t\to_bytes1 = rs.getInt(\"o_bytes\");\n\t\t\t\t\t\ts_bytes1 = rs.getInt(\"s_bytes\");\n\t\t\t\t\t\t// unpdate records\t\n\t\t\t\t\t\twei += wei1;\n\t\t\t\t\t\t/*if(wei < wei1){\n\t\t\t\t\t\t\twei = wei1;\n\t\t\t\t\t\t\tflag2 = 1;\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\n\t\t\t\t\t\to_bytes1 += o_bytes;\n\t\t\t\t\t\ts_bytes1 += s_bytes;\n\t\t\t\t\t\tif(type_s != 0 && type1_s == 0)\n\t\t\t\t\t\t\trs.updateInt(\"type_s\", type_s);\n\t\t\t\t\t\tif(type_o != 0 && type1_o == 0)\n\t\t\t\t\t\t\trs.updateInt(\"type_o\", type_o);\n\t\t\t\t\t//\tif(flag2 == 1)\n\t\t\t\t\t\t\trs.updateInt(\"weight\", wei);\n\t\t\t\t\t\trs.updateInt(\"o_bytes\", o_bytes1);\n\t\t\t\t\t\trs.updateInt(\"s_bytes\", s_bytes1);\n\t\t\t\t\t\t\n\t\t\t\t\t\trs.updateRow();\n\t\t\t\t\t}else {\n\t\t\t\t// directly insert the record\n\t\t\t\t\t\n\t\t\t\t/**\t\t(option 1 as below)\t\n\t\t\t\t *\t\tvalue = \"('\"+key+\"',\"+part+\",'\"+type+\"',\"+wei+\")\";\n\t\t\t\t *\t\tupdateSql(insert+value);\n\t\t\t\t */\n\t\t\t\t//\t\toption 2 to realize\t\t\n\t\t\t\t\t\trs.moveToInsertRow();\n\t\t\t\t\t\trs.updateString(\"resource\", key);\n\t\t\t\t\t\trs.updateInt(\"part\", part);\n\t\t\t\t\t\trs.updateInt(\"type_s\", type_s);\n\t\t\t\t\t\trs.updateInt(\"type_o\", type_o);\n\t\t\t\t\t\trs.updateInt(\"weight\", wei);\n\t\t\t\t\t\trs.updateInt(\"o_bytes\", o_bytes);\n\t\t\t\t\t\trs.updateInt(\"s_bytes\", s_bytes);\n\t\t\t\t\t\trs.insertRow();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tSystem.out.println(key);\n\t\t\t\t}finally{\n\t\t\t\t// ??should wait until all database operation finished!\t\t\n\t\t\t\t\tif (rs != null) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\trs.close();\n\t\t\t\t\t\t\tprepstmt.close();\n\t\t\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public void writePage(Page page) throws IOException {\n // some code goes here\n // not necessary for proj1\n try {\n PageId pid= page.getId();\n HeapPageId hpid= (HeapPageId)pid;\n\n RandomAccessFile rAf=new RandomAccessFile(f,\"rw\");\n int offset = pid.pageNumber()*BufferPool.PAGE_SIZE;\n byte[] b=new byte[BufferPool.PAGE_SIZE];\n b=page.getPageData();\n rAf.seek(offset);\n rAf.write(b, 0, BufferPool.PAGE_SIZE);\n rAf.close(); \n page.markDirty(false,null); \n }catch (IOException e){\n e.printStackTrace();\n }\n\n }",
"void write(Point point) throws InfluxDbApiNotFoundException, InfluxDbApiBadrequestException, InfluxDbTransportException;",
"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}",
"public <E extends Writeable> void write(String sql);",
"public void get_pointer(IndexPointer poniter, long number) {\n poniter.node_id = ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getLong((int) (number * POINTER_LENGTH % ptr_parts_size[0]));\n poniter.canonical = ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].get((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 8)) == 0;\n poniter.position = ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getInt((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 9));\n poniter.next_index = ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getLong((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 13));\n }",
"void setInt(int index, int value) throws SQLException;",
"@Override\n public void writeWaypoint(Waypoint waypoint) {\n }",
"public synchronized void append(K key, V val) throws IOException {\n\n\t\t\tlong pos = data.sync();\n\t\t\t// Only write an index if we've changed positions. In a block compressed\n\t\t\t// file, this means we write an entry at the start of each block\n\t\t\t// position.set(pos); // point to current eof\n\t\t\tindex.append(new Pair<K, Long>(key, keySchema, pos, Schema\n\t\t\t\t\t.create(Type.LONG)));\n\n\t\t\tdata.append(new Pair<K, V>(key, keySchema, val, valueSchema)); // append\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// key/value\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// to data\n\t\t\tsize++;\n\t\t}",
"public void put(Text key,LongWritable value){\n\t\tindexcontainer.put(key, value);\n\t}",
"@InterfaceAudience.Private\npublic interface ByteBufferWriter {\n\n /**\n * Writes <code>len</code> bytes from the specified ByteBuffer starting at offset <code>off</code>\n * @param b the data.\n * @param off the start offset in the data.\n * @param len the number of bytes to write.\n * @exception IOException if an I/O error occurs.\n */\n void write(ByteBuffer b, int off, int len) throws IOException;\n\n /**\n * Writes an <code>int</code> to the underlying output stream as four bytes, high byte first.\n * @param i the <code>int</code> to write\n * @throws IOException if an I/O error occurs.\n */\n // This is pure performance oriented API been added here. It has nothing to do with\n // ByteBuffer and so not fully belong to here. This allows an int to be written at one go instead\n // of 4 (4 bytes one by one).\n // TODO remove it from here?\n void writeInt(int i) throws IOException;\n}",
"void write (String s, int offset);",
"public void writePage(Page page) throws IOException {\n // some code goes here\n // not necessary for proj1\n try {\n PageId pid = page.getId();\n HeapPageId hpid = (HeapPageId) pid;\n\n RandomAccessFile accessor = new RandomAccessFile(f, \"rw\");\n int offset = pid.pageNumber() * BufferPool.PAGE_SIZE;\n byte[] data = new byte[BufferPool.PAGE_SIZE];\n data = page.getPageData();\n\n accessor.seek(offset);\n accessor.write(data, 0, BufferPool.PAGE_SIZE);\n accessor.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"static void generateIndex(Table table, Key key, PrintWriter outData)\r\n {\r\n String comma = \"( \";\r\n String keyname = key.name.toUpperCase();\r\n if (keyname.indexOf(table.name.toUpperCase()) == -1)\r\n keyname = table.name.toUpperCase()+\"_\"+keyname;\r\n outData.println(\"DROP INDEX \"+keyname+\";\");\r\n outData.println(\"\");\r\n outData.println(\"CREATE INDEX \"+keyname+\" ON \"+table.database.userid+ \"\" +table.name);\r\n for (int i=0; i<key.fields.size(); i++, comma = \", \")\r\n {\r\n String name = (String) key.fields.elementAt(i);\r\n outData.println(comma+name);\r\n }\r\n outData.print(\")\");\r\n for (int i=0; i < key.options.size(); i++)\r\n {\r\n outData.println();\r\n String option = (String) key.options.elementAt(i);\r\n outData.print(option);\r\n }\r\n outData.println(\";\");\r\n outData.println();\r\n }",
"@Override\n\tpublic void postWALWrite(ObserverContext<? extends WALCoprocessorEnvironment> ctx, HRegionInfo hRegionInfo, WALKey key,\n\t\t\tWALEdit edit) throws IOException {\n\t\t\n\t}",
"void write(IdWriter writer) throws IOException {\n cellRevision.write(writer);\n writer.writeBoolean(modified);\n }",
"void setByte(int index, byte value) throws SQLException;",
"public final long getWritePosition() {\n\t\treturn m_txpos;\n\t}",
"void write(byte[] buffer, int bufferOffset, int length) throws IOException;",
"void insert(int idx, int val);",
"public void saveNewAddress(Address addr) throws BackendException;",
"public void setIndex(int index)\n/* */ {\n/* 39 */ this.index = index;\n/* */ }",
"public native static void jniaddNode(int nodeId, int type) throws AddDBException;",
"public void onWriteShortBegin(ICPU cpu, int addr) {\n\t}",
"private void writeKey(K key, int ei) {\n int keySize = keySerializer.calculateSize(key);\n Slice s = memoryManager.allocateSlice(keySize, MemoryManager.Allocate.KEY);\n // byteBuffer.slice() is set so it protects us from the overwrites of the serializer\n keySerializer.serialize(key, s.getByteBuffer().slice());\n\n setEntryFieldInt(ei, OFFSET.KEY_BLOCK, s.getBlockID());\n setEntryFieldInt(ei, OFFSET.KEY_POSITION, s.getByteBuffer().position());\n setEntryFieldInt(ei, OFFSET.KEY_LENGTH, keySize);\n }",
"public abstract void save(LongLongsCol col, DataOutputStream output) throws IOException;",
"void set(int index, T data);",
"int insert(PmKeyDbObj record);",
"HRESULT SafeArrayPutElement(SAFEARRAY psa, LONG[] idx, Pointer pv);",
"void writeBlock(int blockId, byte[] buffer) throws IOException;"
] | [
"0.6551198",
"0.6415216",
"0.5966423",
"0.59406936",
"0.59406936",
"0.5919451",
"0.58756727",
"0.57795715",
"0.57612807",
"0.5693024",
"0.5681479",
"0.5630017",
"0.5605925",
"0.5598484",
"0.5551319",
"0.5503368",
"0.5476988",
"0.54535633",
"0.54358786",
"0.54186773",
"0.54134905",
"0.5407518",
"0.5371568",
"0.5353906",
"0.5339351",
"0.53293854",
"0.5323571",
"0.5323467",
"0.5301414",
"0.5300264",
"0.5292634",
"0.5275849",
"0.5273624",
"0.5262464",
"0.525676",
"0.5238828",
"0.52203363",
"0.5213224",
"0.521016",
"0.5191663",
"0.5175549",
"0.5172079",
"0.5165026",
"0.51435465",
"0.5142825",
"0.51420414",
"0.5140147",
"0.51396424",
"0.51321715",
"0.5118204",
"0.5115976",
"0.5114886",
"0.5114351",
"0.5109658",
"0.5106968",
"0.51060045",
"0.51030433",
"0.51029557",
"0.50980407",
"0.5095656",
"0.50871193",
"0.50811666",
"0.5079844",
"0.5077125",
"0.5075866",
"0.5072188",
"0.5054054",
"0.5053838",
"0.505094",
"0.5050647",
"0.5049451",
"0.50419986",
"0.50375235",
"0.5032474",
"0.50258696",
"0.50221527",
"0.49953112",
"0.4994728",
"0.49881002",
"0.49749118",
"0.49746305",
"0.49707785",
"0.496409",
"0.4958949",
"0.49530873",
"0.49508983",
"0.4931249",
"0.49262574",
"0.4924058",
"0.49238014",
"0.49212348",
"0.4918297",
"0.4914379",
"0.4907859",
"0.4906368",
"0.49020568",
"0.4898212",
"0.48803556",
"0.4879976",
"0.48719233"
] | 0.64078665 | 2 |
Reads the node id of a kmer from the index database. | public long get_node_id(long number) {
return ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getLong((int) (number * POINTER_LENGTH % ptr_parts_size[0]));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public long getNodeIndex();",
"entities.Torrent.NodeId getNode();",
"entities.Torrent.NodeId getNode();",
"NodeId getNodeId();",
"@Override public int getNodeId(String name) {\n\t\tint id = node_index_.tryGet(name);\n\t\tif (id == -1) System.err.println(\"Unknown node name=\" + name);\n\t\treturn id;\n\t}",
"public String getNode_id() {\r\n\t\treturn node_id;\r\n\t}",
"io.dstore.values.IntegerValue getNodeCharacteristicId();",
"io.dstore.values.IntegerValue getNodeCharacteristicId();",
"public int getID() {\n return graphConfig.getIndex();\n }",
"@Override\n public String getNodeId() throws IOException {\n return getFirstLineOfFile(nodeIdPath);\n }",
"public long key()\n\t\t{\n\t\t\treturn nid.key();\n\t\t}",
"io.dstore.values.IntegerValue getTreeNodeId();",
"int getBlockId();",
"public int getNodeID() {\r\n \t\treturn nodeID;\r\n \t}",
"public int getNodeID() {\n return nodeID;\n }",
"public int getObjectID(){\n\t\treturn _lodNodeData.getObjectID();\n\t}",
"public String getId() {\n return _node_id;\n }",
"public int getIndexNumber(){\n return id;\r\n }",
"entities.Torrent.NodeId getNodes(int index);",
"public int getAD_WF_Node_ID();",
"public String getNodeKey() {\n return nodeKey;\n }",
"E read(K id);",
"NodeId getLeaderId();",
"private static String findNode(int index){\n return indexTable.get(index);\n }",
"public io.dstore.values.IntegerValue getNodeCharacteristicId() {\n if (nodeCharacteristicIdBuilder_ == null) {\n return nodeCharacteristicId_ == null ? io.dstore.values.IntegerValue.getDefaultInstance() : nodeCharacteristicId_;\n } else {\n return nodeCharacteristicIdBuilder_.getMessage();\n }\n }",
"public io.dstore.values.IntegerValue getNodeCharacteristicId() {\n if (nodeCharacteristicIdBuilder_ == null) {\n return nodeCharacteristicId_ == null ? io.dstore.values.IntegerValue.getDefaultInstance() : nodeCharacteristicId_;\n } else {\n return nodeCharacteristicIdBuilder_.getMessage();\n }\n }",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"public int getDataNodeID() throws Exception {\n\t\tSocket socket = new Socket(nameNodeHost, nameNodePort);\n\t\tFSMessage message = new FSMessage(FSMessage.MESSAGE_DATANODE_REQ)\n\t\t\t\t.withPort(port)\n\t\t\t\t.withNodeHost(InetAddress.getLocalHost().getHostAddress().toString());\n\t\tFSMessage recv = FSMessage.exchangeMessage(socket, message);\n\t\t\n\t\tint ret;\n\t\tif (recv.getType() == FSMessage.MESSAGE_DATANODE_REQ_ACK)\n\t\t\tret = recv.getNodeID();\n\t\telse\n\t\t\tret = -1;\n\t\tsocket.close();\n\t\treturn ret;\n\t}",
"io.dstore.values.IntegerValueOrBuilder getNodeCharacteristicIdOrBuilder();",
"io.dstore.values.IntegerValueOrBuilder getNodeCharacteristicIdOrBuilder();",
"public int getID()\n\t{\n\t\treturn m_nNodeID;\n\t}",
"public entities.Torrent.NodeId getNode() {\n if (nodeBuilder_ == null) {\n return node_ == null ? entities.Torrent.NodeId.getDefaultInstance() : node_;\n } else {\n return nodeBuilder_.getMessage();\n }\n }",
"public entities.Torrent.NodeId getNode() {\n if (nodeBuilder_ == null) {\n return node_ == null ? entities.Torrent.NodeId.getDefaultInstance() : node_;\n } else {\n return nodeBuilder_.getMessage();\n }\n }",
"public String getNodeIdForKernel (Kernel k) {\n Set<String> keys = kernels.keySet();\n for (String key: keys) {\n if (kernels.get(key).getContainerId().equals(k.getContainerId())) { return key; }\n }\n\n return \"\";\n }",
"N getNode(int id);",
"String getClusteringKey(int index);",
"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 }",
"public long getNodeID()\n {\n return vnodeid; \n }",
"public String getID() {\r\n\t\treturn this.idNode;\r\n\t}",
"public io.dstore.values.IntegerValue getNodeCharacteristicId() {\n return nodeCharacteristicId_ == null ? io.dstore.values.IntegerValue.getDefaultInstance() : nodeCharacteristicId_;\n }",
"public io.dstore.values.IntegerValue getNodeCharacteristicId() {\n return nodeCharacteristicId_ == null ? io.dstore.values.IntegerValue.getDefaultInstance() : nodeCharacteristicId_;\n }",
"public int getNode() {\r\n\t\t\treturn data;\r\n\t\t}",
"public Long getNodeId() {\n return nodeId;\n }",
"public io.dstore.values.IntegerValueOrBuilder getNodeCharacteristicIdOrBuilder() {\n return getNodeCharacteristicId();\n }",
"public io.dstore.values.IntegerValueOrBuilder getNodeCharacteristicIdOrBuilder() {\n return getNodeCharacteristicId();\n }",
"@VisibleForTesting\n NodeKey getNodeKey() {\n return nodeKey;\n }",
"@Override\n\tpublic long getClusterId() {\n\t\treturn model.getClusterId();\n\t}",
"String getRootId();",
"String getRootId();",
"public UUID nodeId();",
"public int getNodeId() {\n return m_nodeId;\n }",
"protected int pkFromDatabase(DataNode node, DbEntity entity) throws Exception {\n String sql = generatePkForDbEntityString(entity);\n QueryLogger.logQuery(QueryLogger.DEFAULT_LOG_LEVEL, sql, Collections.EMPTY_LIST);\n\n Connection con = node.getDataSource().getConnection();\n try {\n Statement st = con.createStatement();\n try {\n\n ResultSet rs = st.executeQuery(sql);\n try {\n //Object pk = null;\n if (!rs.next()) {\n throw new CayenneRuntimeException(\n \"Error generating pk for DbEntity \" + entity.getName());\n }\n return rs.getInt(1);\n }\n finally {\n rs.close();\n }\n }\n finally {\n st.close();\n }\n }\n finally {\n con.close();\n }\n }",
"entities.Torrent.NodeIdOrBuilder getNodeOrBuilder();",
"entities.Torrent.NodeIdOrBuilder getNodeOrBuilder();",
"public String getNodeId() {\r\n return nodeId;\r\n }",
"public int getMPC_Order_Node_ID() {\n\t\tInteger ii = (Integer) get_Value(\"MPC_Order_Node_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\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 }",
"private Node getNodeById(int objId){\n return dungeonPane.lookup(\"#\" + Integer.toString(objId));\n }",
"public String getINodeId(String resource_id, String inode_id)\n {\n String node_id = null;\n OrientGraph graph = null;\n try\n {\n graph = factory.getTx();\n\n Iterable<Vertex> resultIterator = graph.command(new OCommandSQL(\"SELECT rid FROM INDEX:iNode.nodePath WHERE key = [\\\"\" + resource_id + \"\\\",\\\"\" + inode_id + \"\\\"]\")).execute();\n\n Iterator<Vertex> iter = resultIterator.iterator();\n if(iter.hasNext())\n {\n Vertex v = iter.next();\n node_id = v.getProperty(\"rid\").toString();\n }\n if(node_id != null)\n {\n node_id = node_id.substring(node_id.indexOf(\"[\") + 1, node_id.indexOf(\"]\"));\n }\n }\n catch(Exception ex)\n {\n System.out.println(\"GraphDBEngine : getINodeID : Error \" + ex.toString());\n }\n finally\n {\n if(graph != null)\n {\n graph.shutdown();\n }\n }\n return node_id;\n }",
"NodeRecord nodeLoadLight( long id );",
"public io.dstore.values.IntegerValueOrBuilder getNodeCharacteristicIdOrBuilder() {\n if (nodeCharacteristicIdBuilder_ != null) {\n return nodeCharacteristicIdBuilder_.getMessageOrBuilder();\n } else {\n return nodeCharacteristicId_ == null ?\n io.dstore.values.IntegerValue.getDefaultInstance() : nodeCharacteristicId_;\n }\n }",
"public io.dstore.values.IntegerValueOrBuilder getNodeCharacteristicIdOrBuilder() {\n if (nodeCharacteristicIdBuilder_ != null) {\n return nodeCharacteristicIdBuilder_.getMessageOrBuilder();\n } else {\n return nodeCharacteristicId_ == null ?\n io.dstore.values.IntegerValue.getDefaultInstance() : nodeCharacteristicId_;\n }\n }",
"int getKey();",
"int getKey();",
"public node_info getNode(int key)\n{\n\treturn getNodes().get(key);\n\t\n}",
"public Node read_node2(String MAC, String port_number) throws HibernateException\r\n\t\t\t\t{ \r\n\t\t\t\t\tNode node = null; \r\n\t\t\t\t\tString i=null;\r\n\t\t\t\t\tlong id_node=0;\r\n\t\t\t\t try \r\n\t\t\t\t { \r\n\t\t\t\t iniciaOperacion(); //unique result me devuelve el objeto encontrado con dicho correo electronico\r\n\t\t\t\t \r\n\t\t\t\t i= sesion.createQuery(\"SELECT u.id_node FROM Node u WHERE u.MAC_address ='\"+MAC+\"' and u.port_number ='\"+port_number+\"'\").uniqueResult().toString();\r\n\t\t\t\t //una vez encontrado el id del user puedo buscarlo\r\n\t\t\t\t id_node= Integer.parseInt(i);\r\n\t\t\t\t node = (Node) sesion.get(Node.class, id_node); \r\n\t\t\t\t \r\n\t\t\t\t } finally \r\n\t\t\t\t { \r\n\t\t\t\t sesion.close(); \r\n\t\t\t\t } \r\n\t\t\t\t return node; \r\n\t\t\t\t}",
"public int keyId() {\n return keyId;\n }",
"public entities.Torrent.NodeIdOrBuilder getNodeOrBuilder() {\n if (nodeBuilder_ != null) {\n return nodeBuilder_.getMessageOrBuilder();\n } else {\n return node_ == null ?\n entities.Torrent.NodeId.getDefaultInstance() : node_;\n }\n }",
"public entities.Torrent.NodeIdOrBuilder getNodeOrBuilder() {\n if (nodeBuilder_ != null) {\n return nodeBuilder_.getMessageOrBuilder();\n } else {\n return node_ == null ?\n entities.Torrent.NodeId.getDefaultInstance() : node_;\n }\n }",
"public NodeId getNodeId() {\n return nodeId;\n }",
"java.lang.String getDocumentId();",
"public String getNodeId() {\n return nodeId;\n }",
"public String getNodeId() {\n return nodeId;\n }",
"public NodeId getId() {\n return id;\n }",
"String getChildId();",
"@Override\n\tpublic node_data getNode(int key) {\n\n\t\treturn this.Nodes.get(key);\n\n\t}",
"io.dstore.values.IntegerValue getTreeNodeIdForVariantMatrix();",
"public String getNodeId() {\r\n\t\treturn nodeId;\r\n\t}",
"public String getNodeId() {\n\t\treturn nodeId;\n\t}",
"public String read_node(NodeWS node) throws HibernateException\r\n\t\t{ \r\n\t\t\t\r\n\t\t\tString i=null;\r\n\t\t\t\r\n\t\t try \r\n\t\t { \r\n\t\t iniciaOperacion(); //unique result me devuelve el objeto encontrado con dicho correo electronico\r\n\t\t \r\n\t\t i= (String) sesion.createQuery(\"SELECT u.node_name FROM Node u WHERE u.MAC_address ='\"+node.getMAC_address()+\"' and u.port_number ='\"+node.getPort_number()+\"'\").uniqueResult();\r\n\t\t //una vez encontrado el id del user puedo buscarlo\r\n\t\t //id_user= Integer.parseInt(i);\r\n\t\t //user = (User) sesion.get(User.class, id_user); \r\n\t\t \r\n\t\t } finally \r\n\t\t { \r\n\t\t sesion.close(); \r\n\t\t } \r\n\t\t return i; \r\n\t\t}",
"public String getIndexColumn() {\n return \"id\";\n }",
"public String getIdNode() {\r\n String idNode = null;\r\n idNode = this.getParam(ESCOConstantes.ID_NODE);\r\n // Add the root element if not present\r\n if (null != idNode && !idNode.startsWith(ESCOConstantes.STEM_NAME_SEPARATOR)) {\r\n idNode = ESCOConstantes.STEM_NAME_SEPARATOR + idNode;\r\n }\r\n\r\n return idNode;\r\n }",
"public String nodeId() {\n return this.nodeId;\n }",
"public Integer getBlockID() {\n this.next_id++;\n return this.next_id;\n }",
"public static int offset_nodeid() {\n return (0 / 8);\n }",
"public String selectNodeId(Node node, String remoteHost, String remoteAddress);",
"public String getNode_pid() {\r\n\t\treturn node_pid;\r\n\t}",
"Engine selectByPrimaryKey(String num);",
"public int getKey()\n {\n return key;\n }",
"public int getKey()\n {\n return key;\n }",
"public int getKey()\n {\n return key;\n }",
"public int getKey()\n {\n return key;\n }",
"public int getTid();",
"public long getKeyID()\n {\n return keyID;\n }",
"private static short findIndexNode(String path, IndexNode inode)\n throws Exception {\n // start with the root file system, root inode\n FileSystem fileSystem = openFileSystems[ROOT_FILE_SYSTEM];\n IndexNode indexNode = getRootIndexNode();\n short indexNodeNumber = FileSystem.ROOT_INDEX_NODE_NUMBER;\n\n // parse the path until we get to the end\n StringTokenizer st = new StringTokenizer(path, \"/\");\n while (st.hasMoreTokens()) {\n String s = st.nextToken();\n if (!s.equals(\"\")) {\n // check to see if it is a directory\n if ((indexNode.getMode() & S_IFMT) != S_IFDIR) {\n // return (ENOTDIR) if a needed directory is not a directory\n process.errno = ENOTDIR;\n return -1;\n }\n\n // check to see if it is readable by the user\n // ??? tbd\n // return (EACCES) if a needed directory is not readable\n\n IndexNode nextIndexNode = new IndexNode();\n // get the next index node corresponding to the token\n indexNodeNumber = findNextIndexNode(\n fileSystem, indexNode, s, nextIndexNode);\n if (indexNodeNumber < 0) {\n // return ENOENT\n process.errno = ENOENT;\n return -1;\n }\n indexNode = nextIndexNode;\n }\n }\n // copy indexNode to inode\n indexNode.copy(inode);\n return indexNodeNumber;\n }"
] | [
"0.6272324",
"0.61716926",
"0.61716926",
"0.6099366",
"0.59812343",
"0.5889243",
"0.584015",
"0.584015",
"0.58311325",
"0.57677007",
"0.57516545",
"0.56938225",
"0.56490153",
"0.56395054",
"0.560418",
"0.56018746",
"0.55719286",
"0.5496584",
"0.5491145",
"0.5472864",
"0.54693747",
"0.5452367",
"0.54454166",
"0.54406494",
"0.5439949",
"0.5439949",
"0.5427088",
"0.5427088",
"0.5427088",
"0.5427088",
"0.5427088",
"0.5427088",
"0.5385309",
"0.5375064",
"0.5375064",
"0.5366594",
"0.5357035",
"0.5357035",
"0.5347089",
"0.5337001",
"0.5315242",
"0.531378",
"0.5308961",
"0.5302813",
"0.53024167",
"0.53024167",
"0.5299494",
"0.5270957",
"0.52577204",
"0.52577204",
"0.52395874",
"0.523936",
"0.5232188",
"0.5232188",
"0.52280456",
"0.520852",
"0.5171899",
"0.51696986",
"0.51696986",
"0.5166111",
"0.51640636",
"0.51611745",
"0.51512074",
"0.51484174",
"0.5141159",
"0.5134335",
"0.5134335",
"0.51325804",
"0.51325804",
"0.51207155",
"0.5119224",
"0.5095063",
"0.5092321",
"0.5092321",
"0.5091552",
"0.5091115",
"0.5085959",
"0.5085959",
"0.5080493",
"0.50608534",
"0.50545794",
"0.5054481",
"0.5035628",
"0.5033649",
"0.50281334",
"0.502437",
"0.5022883",
"0.5019528",
"0.50139874",
"0.50081486",
"0.5005817",
"0.5004175",
"0.49941188",
"0.4992352",
"0.4992352",
"0.4992352",
"0.4992352",
"0.49865347",
"0.49807912",
"0.49786332"
] | 0.52403116 | 50 |
Writes the node id of a kmer into the index database. | public void put_node_id(long node_id, long number) {
ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putLong((int) (number * POINTER_LENGTH % ptr_parts_size[0]), node_id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void writeNode() throws IOException {\n // seek to end of file\n file.seek(offset);\n // write offset data\n file.writeLong(offset);\n // write numKeys data\n file.writeLong(numKeys);\n // write children offset\n for (int i = 0; i < children.length; i++){\n file.writeLong(children[i]);\n }\n // write key data\n for (int i = 0; i < keys.length; i++){\n if (keys[i] == null){\n file.writeLong(-1);\n file.writeInt(0);\n }\n else{\n file.writeLong(keys[i].getKey());\n file.writeInt(keys[i].getFrequency());\n }\n }\n\n //The node has been updated -- move it to the front of the cache\n if (cache != null){\n cache.addObject(this);\n }\n\n\n }",
"public void write(String id);",
"public long getNodeIndex();",
"void nodeCreate( long id );",
"void write(IdWriter writer) throws IOException {\n cellRevision.write(writer);\n writer.writeBoolean(modified);\n }",
"NodeId getNodeId();",
"void setNode(int nodeId, double lat, double lon, double ele);",
"entities.Torrent.NodeId getNode();",
"entities.Torrent.NodeId getNode();",
"public void markEnodebIdDelete() throws JNCException {\n markLeafDelete(\"enodebId\");\n }",
"public <T> void write(MDSKey id, T value) {\n try {\n table.put(new Put(id.getKey()).add(COLUMN, serialize(value)));\n } catch (Exception e) {\n throw Throwables.propagate(e);\n }\n }",
"public String getNode_id() {\r\n\t\treturn node_id;\r\n\t}",
"private void writeKey(K key, int ei) {\n int keySize = keySerializer.calculateSize(key);\n Slice s = memoryManager.allocateSlice(keySize, MemoryManager.Allocate.KEY);\n // byteBuffer.slice() is set so it protects us from the overwrites of the serializer\n keySerializer.serialize(key, s.getByteBuffer().slice());\n\n setEntryFieldInt(ei, OFFSET.KEY_BLOCK, s.getBlockID());\n setEntryFieldInt(ei, OFFSET.KEY_POSITION, s.getByteBuffer().position());\n setEntryFieldInt(ei, OFFSET.KEY_LENGTH, keySize);\n }",
"public void markEnodebIdMerge() throws JNCException {\n markLeafMerge(\"enodebId\");\n }",
"public int getNodeID() {\r\n \t\treturn nodeID;\r\n \t}",
"public void put(int key) { root = put(root, key); }",
"public int getNodeID() {\n return nodeID;\n }",
"@Override public int getNodeId(String name) {\n\t\tint id = node_index_.tryGet(name);\n\t\tif (id == -1) System.err.println(\"Unknown node name=\" + name);\n\t\treturn id;\n\t}",
"public long key()\n\t\t{\n\t\t\treturn nid.key();\n\t\t}",
"public void markEnodebIdReplace() throws JNCException {\n markLeafReplace(\"enodebId\");\n }",
"private static void readAndWriteNodes(String name) throws IOException {\n System.out.println(name);\n Map<Long, Long> nodeMap = new HashMap<>();\n boolean firstLine = true;\n fileReader = new BufferedReader(new FileReader(PATH + name));\n fileWriter = new BufferedWriter(new FileWriter(PATH + \"/uid/\" + name));\n String line;\n while ((line = fileReader.readLine()) != null) {\n if (!firstLine) {\n long globalId = getGlobalId();\n String[] lineTokens = LINE_TOKEN_SEPARATOR.split(line);\n long ID = Long.parseLong(lineTokens[0]);\n nodeMap.put(ID, globalId);\n String writeLine = \"\";\n for (int i = 0; i < lineTokens.length; i++) {\n if (i == 0) {\n writeLine += globalId;\n } else {\n writeLine += lineTokens[i];\n }\n writeLine += \"|\";\n }\n fileWriter.write(writeLine);\n fileWriter.newLine();\n vertexCount++;\n globalVertexCount++;\n } else {\n fileWriter.write(line);\n fileWriter.newLine();\n firstLine = false;\n }\n }\n fileWriter.close();\n fileReader.close();\n counterMapNodes.put(name, vertexCount);\n vertexCount = 0;\n vertexList.add(nodeMap);\n }",
"void setNode(int nodeId, double lat, double lon);",
"public Object saveNode(IBTreeNode node) {\n\t\tOID oid = null;\n\n\t\t// Here we only save the node if it does not have id,\n\t\t// else we just save into the hashmap\n\t\tif (node.getId() == StorageEngineConstant.NULL_OBJECT_ID) {\n\t\t\ttry {\n\t\t\t\tnbSaveNodes++;\n\t\t\t\t// first get the oid. : -2:it could be any value\n\t\t\t\toid = engine.getObjectWriter().getIdManager().getNextObjectId(\n\t\t\t\t\t\t-2);\n\t\t\t\tnode.setId(oid);\n\t\t\t\toid = engine.store(oid, node);\n\t\t\t\tif (OdbConfiguration.isDebugEnabled(LOG_ID)) {\n\t\t\t\t\tDLogger.debug(\"Saved node id \" + oid);// + \" : \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// node.toString());\n\t\t\t\t}\n\t\t\t\tif (tree != null && node.getBTree() == null) {\n\t\t\t\t\tnode.setBTree(tree);\n\t\t\t\t}\n\t\t\t\toids.put(oid, node);\n\t\t\t\treturn oid;\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new ODBRuntimeException(BTreeError.INTERNAL_ERROR\n\t\t\t\t\t\t.addParameter(\"While saving node\"), e);\n\t\t\t}\n\t\t}\n\t\tnbSaveNodesInCache++;\n\t\toid = (OID) node.getId();\n\t\toids.put(oid, node);\n\t\taddModifiedOid(oid);\n\n\t\treturn oid;\n\n\t}",
"public int getID() {\n return graphConfig.getIndex();\n }",
"public void writeNode(BTreeNode node) throws IOException {\n\t\tif (useCache) {\n\t\t\tif (cache.indexOf(node) == -1) {\n\t\t\t\tcache.add(node);\n\t\t\t}\n\t\t} else {\n\t\t\tfile.write(node);\n\t\t}\n\t}",
"public void addEnodebId() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"enodeb-id\",\n null,\n childrenNames());\n }",
"public void addNode(int key)\n{\n Node n1 = new Node(key);\n\t\n\tif(!getNodes().containsKey(n1.getKey())) \n\t{\n\tmc++;\n\tthis.getNodes().put(n1.getKey(),n1);\n\t\t\n\t}\n\telse {\n\t\treturn;\n\t\t//System.out.println(\"Node already in the graph\");\n\t}\n}",
"void addId(String root);",
"entities.Torrent.NodeId getNodes(int index);",
"public void writeDHTKeyVal(String key, String val){\n\t\tDHTNode node = dynamoRing.getResponsibleNode(key);\n\t\tArrayList<DHTNode> successorList = dynamoRing.getNSuccessors(node, REPLICATION_COUNT-1);\n\t\tArrayList<DHTNode> responsibleNodeList = successorList;\n\t\tresponsibleNodeList.add(node);\n\t\tfor(int i=0;i<responsibleNodeList.size();i++){\n\t\t\ttry{\t\t// try block inside the for loop so as to continue writing data to other\n\t\t\t\t\t\t// responsible nodes even if one node fails\n\t\t\t\tDHTNode nextNode = responsibleNodeList.get(i);\n\t\t\t\tSocket socket = new Socket(InetAddress.getByAddress(new byte[]{10, 0, 2, 2}),\n\t\t\t\t\t\tnextNode.getAddress());\n\t\t\t\tLog.v(TAG, \"Connected with \"+nextNode.getAddress());\n\t\t\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));\n\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\t\tMessage msg = new Message();\n\t\t\t\tmsg.setType(Message.WRITE);\n\t\t\t\tmsg.setKey(key);\n\t\t\t\tmsg.setValue(val);\n\t\t\t\tString msgStr = msg.toJson();\n\t\t\t\tbw.write(msgStr+\"\\n\");\n\t\t\t\tbw.flush();\n\t\t\t\tString responseStr = br.readLine();\n\t\t\t\tMessage response = Message.fromJson(responseStr);\n\t\t\t\tif(response == null)\t\t// null returned, remote node must have failed\n\t\t\t\t\t\t\t\t\t\t\t// continue writing to next responsible node\n\t\t\t\t\tcontinue;\n\t\t\t\tbw.close();\n\t\t\t\tbr.close();\n\t\t\t\tsocket.close();\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void write() {\r\n\t\ttry {\r\n\t\t\tDataOutputStream dat = new DataOutputStream(new FileOutputStream(signlink.getDirectory() + \"idk.dat\"));\r\n\t\t\tdat.writeShort(IdentityKit.cache.length);\r\n\t\t\tfor (IdentityKit idk : IdentityKit.cache) {\r\n\t\t\t\tif (idk.partId != -1) {\r\n\t\t\t\t\tdat.writeByte(1);\r\n\t\t\t\t\tdat.writeByte(idk.partId);\r\n\t\t\t\t}\r\n\t\t\t\tif (idk.models != null) {\r\n\t\t\t\t\tdat.writeByte(2);\r\n\t\t\t\t\tdat.writeByte(idk.models.length);\r\n\t\t\t\t\tfor (int index = 0; index < idk.models.length; index++) {\r\n\t\t\t\t\t\tdat.writeShort(idk.models[index]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (idk.disableDisplay) {\r\n\t\t\t\t\tdat.writeByte(3);\r\n\t\t\t\t}\r\n\t\t\t\tif (idk.oldColors != null) {\r\n\t\t\t\t\tfor (int index = 0; index < idk.oldColors.length; index++) {\r\n\t\t\t\t\t\tdat.writeByte(40 + index);\r\n\t\t\t\t\t\tdat.writeShort(idk.oldColors[index]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (idk.newColors != null) {\r\n\t\t\t\t\tfor (int index = 0; index < idk.newColors.length; index++) {\r\n\t\t\t\t\t\tdat.writeByte(50 + index);\r\n\t\t\t\t\t\tdat.writeShort(idk.newColors[index]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (idk.dialogModels != null) {\r\n\t\t\t\t\tfor (int index = 0; index < idk.dialogModels.length; index++) {\r\n\t\t\t\t\t\tdat.writeByte(60 + index);\r\n\t\t\t\t\t\tdat.writeShort(idk.dialogModels[index]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdat.writeByte(0);\r\n\t\t\t}\r\n\t\t\tdat.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public NodeKey createNodeKey();",
"public void markEnodebIdCreate() throws JNCException {\n markLeafCreate(\"enodebId\");\n }",
"public void put(Text key,LongWritable value){\n\t\tindexcontainer.put(key, value);\n\t}",
"public static void write(Index index, Integer dictId){\n\t\tFile file = new File(\"dict/block/block\"+Integer.toString(dictId)+\".dict\");\n\t\tfile.getParentFile().mkdirs();\n\t\tWriter writer;\n\t\ttry {\n\t\t\twriter = new FileWriter(file);\n\t\t\t\n\t\t\tStringBuffer blockString = new StringBuffer();\n\t\t\t\n\t\t\t//for each term write print term and posting list on new line (format: word[1, 2, 3, 4])\n\t\t\tfor(String term : index.sortEntries().keySet()){\n\t\t\t\tblockString.append(term+index.get(term).toString()+\"\\n\");\n\t\t\t\t\t\n }\n\t\t\t//System.out.println(blockString.toString());\n\t\t\t\n\t\t\twriter.write(blockString.toString());\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}",
"public long create_node(Node node)\r\n\t\t{ \r\n\t\t long id = 0; //id de la tabla user (único) \r\n\r\n\t\t try \r\n\t\t { \r\n\t\t iniciaOperacion(); \r\n\t\t id = (Long)sesion.save(node); //metodo para guardar cliente (del objeto hibernate.sesion) \r\n\t\t tx.commit(); \r\n\t\t }catch(HibernateException he) \r\n\t\t { \r\n\t\t manejaExcepcion(he);\r\n\t\t throw he; \r\n\t\t }finally \r\n\t\t { \r\n\t\t sesion.close(); \r\n\t\t } \r\n\t\t return id; \r\n\t\t}",
"@Override\n\t\tpublic void write(K key, V value) throws IOException, InterruptedException {\n\t\t\t// TODO Auto-generated method stub\n\t\t\t//System.out.println(key.toString()+\":\"+value.toString());\n\t\t\tConfiguration conf = HBaseConfiguration.create();\n\t\t\t//conf.set(\"hbase.zookeeper.quorum\", \"10.105.245.143,10.105.245.144,10.105.245.147\");\n\t\t\tString mess[] = key.toString().split(\":\");\n\t\t\tString time = mess[0];\n\t\t\tString nation = mess[1];\n\t\t\tString nationid = PeopleCountByNation.asmap.get(nation);\n\t\t\tconf.set(\"hbase.zookeeper.quorum\", \"localhost\");\n\t\t\tint sum = Integer.parseInt(value.toString());\n\t\t\t@SuppressWarnings(\"resource\")\n\t\t\tHTable table = new HTable(conf,\"nation\".getBytes());\n\t\t\tPut put = new Put(Bytes.toBytes(time+nationid));\n\t\t\tput.add(Bytes.toBytes(\"n\"),Bytes.toBytes(\"n\"),Bytes.toBytes(sum));\n\t\t\ttable.put(put);\n\t\t /* String record = value.toString();\n\t\t String mess [] = record.split(\"----\");\n\t\t String recordmess [] = mess[0].split(\"////\");\n\t\t HTable table = new HTable(conf,\"sort\".getBytes());\n\t\t //System.out.println(key.toString());\n\t\t Put put = new Put(Bytes.toBytes(key.toString()));\n\t\t put.add(Bytes.toBytes(\"title\"),Bytes.toBytes(recordmess[0]),Bytes.toBytes(mess[1]));\n\t\t table.put(put);*/\n\t\t \n\t\t //将数据存储在 hbase 中,这次存储的是word与title的集合\n\t\t \n\t\t \n\t\t \n\t\t}",
"int writerIndex();",
"@Override\r\n protected Node getStoringNode(Integer key) {\r\n return getNetworkNode();\r\n }",
"private void broadcastVertexId() throws IOException {\r\n\t\tPageRankWritable msg = new PageRankWritable();\r\n\t\tmsg.setSenderId(getVertexID());\r\n\t\tsendMessageToNeighbors(msg);\r\n\t}",
"public synchronized void writeData(int id, String key, RMItem value) {\n if (id >= 0) {\n txLocal.get(id).put(key, value);\n } else {\n getMaster().put(key, value);\n }\n }",
"public String getId() {\n return _node_id;\n }",
"String getClusteringKey(int index);",
"@Override\n\tpublic void writeFile(String hashname) {\n\t\tfor(CircosNode node : nodes){\n\t\t\tString useThisLabel = \"\";\n\t\t\tif(node.getLabel().length() > maxLabelLenght){\n\t\t\t\tuseThisLabel = node.getLabel().substring(0, maxLabelLenght) + \"...\";\n\t\t\t}else{\n\t\t\t\tuseThisLabel = node.getLabel();\n\t\t\t}\n\t\t\toutput += \"chr\" + Settings.CIRCOS_DELIMITER + \"-\" + Settings.CIRCOS_DELIMITER + node.getID() + Settings.CIRCOS_DELIMITER + useThisLabel + \n\t\t\t\t\tSettings.CIRCOS_DELIMITER + \"0\" + Settings.CIRCOS_DELIMITER + Math.round(node.getSzMetricValue()) + \n\t\t\t\t\tSettings.CIRCOS_DELIMITER + node.getID() + \"\\n\";\n\t\t}\n\t\tTools.createFile(Settings.CIRCOS_DATA_PREFIX+\"node\"+hashname+\".txt\", output);\n\t}",
"private int rebuild() {\n String rebuildPath = \"/graphs/hugegraph/jobs/rebuild/indexlabels\";\n String personByCity = \"personByCity\";\n Map<String, Object> params = ImmutableMap.of();\n Response r = client().put(rebuildPath, personByCity, \"\", params);\n String content = assertResponseStatus(202, r);\n return assertJsonContains(content, \"task_id\");\n }",
"public int getIndexNumber(){\n return id;\r\n }",
"public void setID() throws IOException;",
"protected void map(Object key, Text value, Context context) throws IOException, InterruptedException {\n String[] line_author = value.toString().split(\"\\t\");\n id_author.set(Integer.parseInt(line_author[1]));\n context.write(id_author, new IntWritable(1));\n }",
"public void insertOtherNode(String key,String value) {\n Log.v(\"insert\", value);\n String filename = key;\n String string = value;\n String hashedKey=\"\";\n Log.v(\"Created \" + hashedKey, \"with value \" + string + \"Before hash \" + filename);\n FileOutputStream outputStream;\n try {//Context.MODE_PRIVATE\n System.out.println(filename);\n System.out.println(context);\n outputStream = context.openFileOutput(filename, Context.MODE_PRIVATE);\n outputStream.write(string.getBytes());\n outputStream.flush();\n outputStream.close();\n } catch (Exception e) {\n e.printStackTrace();\n Log.e(TAG, \"File write failed\");\n }\n\n\n }",
"@Override\n\tpublic UUID insert(KomponenNilai komp) {\n\t\tSession session = sessionFactory.openSession();\n\t\tTransaction tx = session.beginTransaction();\n\t\tUUID insertId = (UUID)session.save(komp);\n\t\ttx.commit();\n\t\tsession.flush();\n\t\tsession.close();\n\t\treturn insertId;\n\t}",
"public String getNodeId() {\r\n return nodeId;\r\n }",
"@Override\n public void writeIdFile(String idName) throws IOException {\n File file = new File(getOutputDir() + \"/log\");\n file.mkdirs();\n FileWriter fw = new FileWriter(getOutputDir() + \"/log/\" + idName);\n for (String s : idMap.keySet()) fw.write(idMap.get(s) + \" \" + s + \"\\n\");\n fw.close();\n }",
"@Override\n public int insert(KlantBedrijf kb) {\n Connection connection = createConnection();\n int id = -1;\n try {\n PreparedStatement preparedStatement = connection.prepareStatement(\"INSERT INTO klant_has_bedrijf (klant_id,bedrijf_id) VALUES (?,?)\", Statement.RETURN_GENERATED_KEYS);\n preparedStatement.setInt(1, kb.getKlantId());\n preparedStatement.setInt(2, kb.getBedrijfId());\n preparedStatement.executeUpdate();\n\n ResultSet rs = preparedStatement.getGeneratedKeys();\n rs.next();\n id = rs.getInt(1);\n rs.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n closeConnection(connection);\n return id;\n }",
"public Long getNodeId() {\n return nodeId;\n }",
"@Override\r\n\tpublic void write(DataOutput out) throws IOException {\n\t\tWritableUtils.writeVInt(out, this.id);\r\n\t}",
"public String getID() {\r\n\t\treturn this.idNode;\r\n\t}",
"private void addNode(String name)\n {\n try (Session session = driver.session())\n {\n // Wrapping Cypher in an explicit transaction provides atomicity\n // and makes handling errors much easier.\n try (Transaction tx = session.beginTransaction())\n {\n tx.run(\"MERGE (a:Node {value: {x}})\", parameters(\"x\", name));\n tx.success(); // Mark this write as successful.\n }\n }\n }",
"public void deleteNode (NodeId id) throws IOException\n\t{\n\t}",
"public long getNodeID()\n {\n return vnodeid; \n }",
"public void putId(String key, Long userId) {\n Collection<Long> batch = index.get(key);\n if (batch == null) {\n batch = new HashSet<Long>();\n index.put(key, batch);\n }\n batch.add(userId);\n }",
"@Transactional\n public abstract void updateNode(OnmsNode node);",
"protected abstract void writeInternal(int index, int value);",
"public JsonWriter key(long key) {\n startKey();\n\n writer.write('\\\"');\n writer.print(key);\n writer.write('\\\"');\n writer.write(':');\n return this;\n }",
"public String getNodeKey() {\n return nodeKey;\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 }",
"public void deleteNode(int key){\n\t\t//System.out.println(\" in delete Node \");\n\t\tNode delNode = search(key);\n\t\tif(delNode != nil){\n\t\t\t//System.out.println(\" del \" + delNode.id);\n\t\t\tdelete(delNode);\n\t\t}else{\n\t\t\tSystem.out.println(\" Node not in RB Tree\");\n\t\t}\n\t}",
"public <T> SerializationStream writeKey( T key) {\n return writeObject(key);\n }",
"io.dstore.values.IntegerValue getNodeCharacteristicId();",
"io.dstore.values.IntegerValue getNodeCharacteristicId();",
"public void insert(int key)\n {\n root = insertRec(root,key);\n }",
"public String getNodeIdForKernel (Kernel k) {\n Set<String> keys = kernels.keySet();\n for (String key: keys) {\n if (kernels.get(key).getContainerId().equals(k.getContainerId())) { return key; }\n }\n\n return \"\";\n }",
"public void write(int datum) throws IOException {\n if (!_open)\n return;\n datum &= 0xff;\n long _here = position();\n\n // Are we synced up?\n if (_here == _digestvalidto) {\n\n // Yes, digest the byte and move the valid to pointer.\n _digest.update((byte) datum);\n _digestvalidto++; // JMC: Was missing.\n\n } // Otherwise, advancing of the position will destroy the digest sync.\n\n datum = _head.crypt((byte) datum, _here);\n _backing.write(datum);\n }",
"private void saveindex() throws IOException {\n File dense = new File(DenseLayerPath + \"DenseLayer\" + \".class\");\n if (!dense.exists())\n dense.createNewFile();\n ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(dense));\n oos.writeObject(this);\n oos.close();\n }",
"public long wsadd_node(NodeWS node)\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\tlong id = 0; //id de la tabla user (único) \r\n\t\t\t\t Node nodeC = new Node(node.getNode_name(),node.getMAC_address(),node.getPort_number());\r\n\t\t\t\t \r\n\t\t\t\t //User cliente1 = new User(\"[email protected]\", \"gutie33\", 1, \"Luis\",\"677899876\", \"Informatica\"); \r\n\t\t\t\t \r\n\t\t\t\t try \r\n\t\t\t\t { \r\n\t\t\t\t iniciaOperacion(); \r\n\t\t\t\t \r\n\t\t\t\t id= (Long) sesion.createQuery(\"SELECT u.id_company FROM Company u WHERE u.company_name ='\"+node.getName_company()+\"'\").uniqueResult();\r\n\t\t\t\t Company x = (Company) sesion.load(Company.class, id);\r\n\t\t\t\t x.addNodo(nodeC);\r\n\t\t\t\t \r\n\t\t\t\t\t nodeC.setCompany(x);\r\n\t\t\t\t \r\n\t\t\t\t //sesion.update(compx);\r\n\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t //metodo para guardar cliente (del objeto hibernate.sesion) \r\n\t\t\t\t tx.commit(); \r\n\t\t\t\t }catch(HibernateException he) \r\n\t\t\t\t { \r\n\t\t\t\t manejaExcepcion(he);\r\n\t\t\t\t throw he; \r\n\t\t\t\t }finally \r\n\t\t\t\t { \r\n\t\t\t\t \t//Busqueda del id con qu elo ha introducido a la BBDD\r\n\t\t\t\t \tid= (Long) sesion.createQuery(\"SELECT u.id_node FROM Node u WHERE u.node_name ='\"+node.getNode_name()+\"'\").uniqueResult();\r\n\t\t\t\t sesion.close(); \r\n\t\t\t\t } \r\n\t\t\t\t return id; \r\n\t\t\t\t}",
"void setRoot(Node<K, V> root) throws IOException;",
"@Override\npublic int sendToID(NodeIDType id, byte[] msg) throws IOException {\n\treturn 0;\n}",
"@Override\n void postValueWrite(SerializerElem e, String key) {\n\n }",
"public UUID nodeId();",
"public int getNodeId() {\n return m_nodeId;\n }",
"public String getNodeId() {\n return nodeId;\n }",
"public String getNodeId() {\n return nodeId;\n }",
"public void setID(String s) {\r\n\t\tthis.idNode = s;\r\n\t}",
"io.dstore.values.IntegerValue getTreeNodeId();",
"public String getNodeId() {\r\n\t\treturn nodeId;\r\n\t}",
"public native static void jniaddNode(int nodeId, int type) throws AddDBException;",
"public void sentTo(String id, InfinispanComMessage infinispanComMessage){\n nodes.put(id, infinispanComMessage);\n }",
"public String getNodeId() {\n\t\treturn nodeId;\n\t}",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"java.lang.String getClusterId();",
"@Override\n\t\tpublic void write(Writable key, SolrInputDocument doc)\n\t\t\t\tthrows IOException, InterruptedException {\n\t\t\ttry {\n\t\t\t\tdocs.add(doc);\n\t\t\t\tif (docs.size() >= batch) {\n\t\t\t\t\tserver.add(docs);\n\t\t\t\t\tdocs.clear();\n\t\t\t\t}\n\t\t\t} catch (SolrServerException e) {\n\t\t\t\tRuntimeException exc = new RuntimeException(e.toString(), e);\n\t\t\t\texc.setStackTrace(e.getStackTrace());\n\t\t\t\tthrow exc;\n\t\t\t}\n\t\t}",
"public NodeId getNodeId() {\n return nodeId;\n }",
"public String getIndexColumn() {\n return \"id\";\n }",
"public boolean put(int key, String value) {\n\t\t//YOUR CODE HERE\n\t\tif(root == null) {\n\t\t\tLeafNode leaf = new LeafNode(key, value);\n\t\t\troot = leaf;\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\tPair pair = add(key, value, this.root);\n\t\t\tif(pair != null) {\n\t\t\t\tInternalNode node = new InternalNode();\n\t\t\t\tnode.size = 1;\n\t\t\t\tnode.children[0] = root;\n\t\t\t\tnode.keys[1] = pair.newKey;\n\t\t\t\tnode.children[1] = pair.rightChild;\n\t\t\t\tthis.root = node;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"void createNode(NodeKey key);",
"public long getWriteId() {\n return writeId;\n }",
"@Override\n\tpublic long getClusterId() {\n\t\treturn model.getClusterId();\n\t}"
] | [
"0.5752877",
"0.55147654",
"0.54558605",
"0.5339208",
"0.52023697",
"0.5184208",
"0.5150775",
"0.5119344",
"0.5119344",
"0.5103429",
"0.50957364",
"0.50692683",
"0.5061059",
"0.50225604",
"0.5015031",
"0.5002563",
"0.49884146",
"0.4980751",
"0.49692342",
"0.49638647",
"0.49629584",
"0.492153",
"0.4896352",
"0.48837486",
"0.48661178",
"0.48510066",
"0.4841015",
"0.4837994",
"0.48360527",
"0.4823441",
"0.4820014",
"0.4793328",
"0.478329",
"0.47786564",
"0.47782207",
"0.47600532",
"0.47503626",
"0.47473627",
"0.47339243",
"0.47273895",
"0.47244647",
"0.47226506",
"0.47162166",
"0.47139955",
"0.46966505",
"0.46836662",
"0.46817192",
"0.46792307",
"0.46775684",
"0.46670738",
"0.46644634",
"0.46631354",
"0.4657277",
"0.46530598",
"0.46499053",
"0.46438876",
"0.46435812",
"0.4642376",
"0.46404678",
"0.46357694",
"0.46347007",
"0.4634305",
"0.46328694",
"0.4626682",
"0.4626517",
"0.46236268",
"0.46212932",
"0.46122834",
"0.46122834",
"0.46108717",
"0.46055868",
"0.46045384",
"0.46032396",
"0.45964748",
"0.4593996",
"0.45909563",
"0.45886976",
"0.45883176",
"0.45882183",
"0.45832098",
"0.45832098",
"0.4580477",
"0.45770445",
"0.45693156",
"0.45630553",
"0.45515537",
"0.4539693",
"0.45394865",
"0.45394865",
"0.45394865",
"0.45394865",
"0.45394865",
"0.45394865",
"0.4539055",
"0.45373654",
"0.45366558",
"0.45305455",
"0.45302343",
"0.45253736",
"0.45237958"
] | 0.5225223 | 4 |
Looks if a kmer has been canonical at the first visit. | public boolean get_canonical(long number) {
return ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].get((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 8)) == 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isFirst() {\n\t\treturn (prev == null);\n\t}",
"protected boolean _isFirstTime() {\n return _firstTime;\n }",
"public boolean isFirst() {\n return !hasPrevious();\n }",
"@SuppressWarnings(\"unused\")\n public boolean isFirstTime() {\n return firstTime;\n }",
"public boolean isFirstOfTheDay() {\r\n return !strDate.equals(game.settings.getLastSeen());\r\n }",
"private boolean firstTimeVisiting(HttpServletRequest request)\n throws ServletException, IOException {\n return request.getParameter(\"title\") == null || request.getParameter(\"body\") == null ||\n request.getParameter(\"tags\") == null;\n }",
"public boolean isFirstCycle() {\n return cycle == 0;\n }",
"public boolean isFirstStart() {\n return !sp.contains(UUID_SP_KEY);\n }",
"public boolean isFirstLaunchCalled() {\n return this.f51;\n }",
"public boolean isCanonicallyLabelled() {\n this.generateVertexSignatures();\n \n // Sort a copy of the vertex signatures thus keeping the original order. \n List<String> sortedVertexSignatures = new ArrayList<String>();\n sortedVertexSignatures.addAll(this.vertexSignatures);\n Collections.sort(sortedVertexSignatures);\n \n // It has to be the first vertexSignature that corresponds to the graphSignature,\n // otherwise it is impossible that it is the canonical labeling according to our deifinition,\n // ie that the canonical labeling is an icreasing order of vertex ID:s when looking at the graph signature.\n // Check if the vertex ID:s are in increasing order.\n this.graphSignature = sortedVertexSignatures.get(0);\n String vertexSignature = this.vertexSignatures.get(0);\n List<Integer> labels = this.canonicalLabelMapping.get(0);\n boolean canonical = this.graphSignature.equals(vertexSignature);\n if (canonical && isInIncreasingOrder(labels)) {\n \treturn true;\n }\t\n return false;\n \n }",
"boolean isFirstJoinKit();",
"boolean isEntriesFirst();",
"public boolean isFirst() {\n\t\treturn first;\n\t}",
"boolean isIsInitial();",
"public boolean istKorrupt() {\n\t\tif (this.korrupt) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"private boolean firstPerson(Mention a, Mention b) {\n if (a.getPerson() == Person.FIRST && b.getPerson() == Person.FIRST) {\n addToCluster(a, b);\n return true;\n }\n\n return false;\n }",
"private boolean isRankConsistent() {\n for (int i = 0; i < size(); i++)\n if (i != rank(select(i))) return false;\n for (K key : keys())\n if (key.compareTo(select(rank(key))) != 0) return false;\n return true;\n }",
"public boolean hasBeenVisited() {\n\t\treturn visited; // Replace with your code\n\t}",
"boolean isOnSecondMark(){\n return getDistanceFromSecondMark() == 0;\n }",
"private boolean isRankConsistent() {\r\n for (int i = 0; i < size(); i++)\r\n if (i != rank(select(i))) return false;\r\n for (Key key : keys())\r\n if (key.compareTo(select(rank(key))) != 0) return false;\r\n return true;\r\n }",
"public boolean tienePrepaga() {\r\n\t\treturn obraSocial != null;\r\n\t}",
"public synchronized boolean ifShouldVisitMarkVisited(String URL) {\n\t\tString key = getKey(URL);\n\t\tif (alreadyVisited(key)) {\n\t\t\treturn false;\n\t\t}\n\t\t/*\n\t\t * Mark the current URL as 'visited' by storing it in the BloomFilter\n\t\t * so that no other thread continues further than this\n\t\t */\n\t\tmarkVisited(key);\n\t\treturn true;\n\t}",
"public boolean first() {\n initialize();\n return next();\n }",
"private static boolean isFirstLaunch() {\n if (new File(\"couchbase-sync.state\").exists()) {\n return false;\n }\n return true;\n }",
"public boolean hasMcc() {\n return genClient.cacheHasKey(CacheKey.mcc);\n }",
"boolean isCanonicalVersion() {\n\t\treturn isLocal() && isVersion() && !Namespace.create(this.ontology).equals(Namespace.create(this.versionIRI));\n\t}",
"private boolean isFirstView(int viewIndex){\r\n\t\treturn viewIndex == 0;\r\n\t}",
"public boolean isFirstRun() {\n int currentVersionCode = 0;\n boolean firstRun = false;\n\n try {\n currentVersionCode = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode;\n } catch (android.content.pm.PackageManager.NameNotFoundException e) {\n // handle exception\n //e.printStackTrace();\n }\n\n // Get saved version code\n SharedPreferences prefs = context.getSharedPreferences(VERSION_PREFS_NAME, Context.MODE_PRIVATE);\n int savedVersionCode = prefs.getInt(PREF_VERSION_CODE_KEY, DOESNT_EXIST);\n\n // Check for first run or upgrade\n if (currentVersionCode == savedVersionCode) {\n\n // This is just a normal run\n\n } else if (savedVersionCode == DOESNT_EXIST) {\n\n // TODO This is a new install (or the user cleared the shared preferences)\n firstRun = true;\n\n } else if (currentVersionCode > savedVersionCode) {\n\n // TODO This is an upgrade\n\n }\n\n // Update the shared preferences with the current version code\n prefs.edit().putInt(PREF_VERSION_CODE_KEY, currentVersionCode).commit();\n\n return firstRun;\n\n }",
"@java.lang.Override\n public boolean hasEtaToFirstWaypoint() {\n return etaToFirstWaypoint_ != null;\n }",
"public boolean alreadyVisited(String key) {\n\t\tif (visitedPages.mightContain(key)) {\n\t\t\treturn pageToAssets.containsKey(key);\n\t\t}\n\t\treturn false;\n\t}",
"protected boolean isCurEqualsToCacheCur() {\n return reqCurLocCacheData != null;\n }",
"private boolean hasUniqueState()\n {\n return (getExternalArcState() == getMiddleArcState() && getExternalArcState() == getInternalArcState() && getExternalArcState() == getCircleState());\n }",
"public static boolean isFirstRun(Context context) {\n SharedPreferences sp = context.getSharedPreferences(SHARED_PREFERENCES_KEY, context.MODE_PRIVATE);\n return sp.getBoolean(IS_FIRST_TOKEN,true);\n }",
"public boolean isInitialSetuped(){\r\n\t\treturn initialSetuped;\r\n\t}",
"public static boolean isPubKeyCanonical(byte[] pubkey) {\n if (pubkey.length < 33)\n return false;\n if (pubkey[0] == 0x04) {\n // Uncompressed pubkey\n if (pubkey.length != 65)\n return false;\n } else if (pubkey[0] == 0x02 || pubkey[0] == 0x03) {\n // Compressed pubkey\n if (pubkey.length != 33)\n return false;\n } else\n return false;\n return true;\n }",
"public boolean isFirstAction() {\n return _firstAction;\n }",
"public boolean isNotNullMid() {\n return genClient.cacheValueIsNotNull(CacheKey.mid);\n }",
"public boolean onFirstMove() {\n\t\treturn (PawnMoveInformation.NOT_MOVED_YET == this.info);\n\t}",
"public boolean hasEtaToFirstWaypoint() {\n return etaToFirstWaypointBuilder_ != null || etaToFirstWaypoint_ != null;\n }",
"public boolean isNotNullMcc() {\n return genClient.cacheValueIsNotNull(CacheKey.mcc);\n }",
"public boolean isSetFirstpictrue() {\n return __isset_bit_vector.get(__FIRSTPICTRUE_ISSET_ID);\n }",
"public boolean hasK() {\n return resultCase_ == 3;\n }",
"public boolean mo29013c() {\n ValueAnimator valueAnimator = this.f19137e;\n return valueAnimator != null && valueAnimator.isStarted();\n }",
"public boolean hasFirstFrame() {\n return firstFrame_ != null;\n }",
"private boolean isNovemberFirst(final Calendar date) {\n return NOVEMBER_1ST_DAY == date.get(Calendar.DAY_OF_MONTH)\n && Calendar.NOVEMBER == date.get(Calendar.MONTH);\n }",
"public boolean isConstructed(String landmark) {\n for (int i = 0; i < Landmarks.size(); i++) {\n if (Landmarks.get(i).getName().equals(landmark)) {\n if (Landmarks.get(i).getConstructed() == true) {\n return true;\n } else {\n return false;\n }\n }\n }\n return false;\n }",
"private boolean validate(K key,\n\t\t\tDictionaryEntry<K,V> pre,\n\t\t\tDictionaryEntry<K,V> cur) {\n\t\treturn (!pre.isMarked()\n\t\t\t\t&& (cur == pre.getNext())\n\t\t\t\t&& (cur.isSentinel()\n\t\t\t\t\t\t|| (key.compareTo(cur.getKey()) <= 0))\n\t\t\t\t);\n\t}",
"private boolean isFirstTime() {\n SharedPreferences preferences = getActivity().getPreferences(MODE_PRIVATE);\n boolean ranBefore = preferences.getBoolean(\"RanBefore\", false);\n if (!ranBefore) {\n\n SharedPreferences.Editor editor = preferences.edit();\n editor.putBoolean(\"RanBefore\", true);\n editor.apply();\n mBind.topLayout.setVisibility(View.VISIBLE);\n mBind.topLayout.setOnTouchListener(new View.OnTouchListener() {\n\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n mBind.topLayout.setVisibility(View.INVISIBLE);\n return false;\n }\n\n });\n }\n return ranBefore;\n\n }",
"public boolean isFirstPage();",
"public boolean hasK() {\n return resultCase_ == 3;\n }",
"boolean getCollFirstFlag();",
"public boolean isIs_pre_hgk_published() {\n return is_pre_hgk_published;\n }",
"public boolean isFirstClick(){\n\t\treturn firsttime;\n\t}",
"public boolean isSetKau() {\n return this.kau != null;\n }",
"public boolean isSetKau() {\n return this.kau != null;\n }",
"boolean hasFirstToken();",
"boolean hasInitialResponse();",
"public boolean hasInitialResponse() {\n return instance.hasInitialResponse();\n }",
"private boolean isFirstMove(int numberGeneratedSoFarLength) {\n\t\treturn numberGeneratedSoFarLength == 1;\n\t}",
"private boolean hasCycle() {\n\t\tNode n = head;\n\t\tSet<Node> nodeSeen = new HashSet<>();\n\t\twhile (nodeSeen != null) {\n\t\t\tif (nodeSeen.contains(n)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tnodeSeen.add(n);\n\t\t\t}\n\t\t\tn = n.next;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isInitier() {\n\t\treturn getStatut().equals(StatusBonPreparation.INITIER);\n\t}",
"protected boolean checkCache()\n\t{\n\t\ttry {\n\t\t\tStream<String> lines = Files.lines(Paths.get(output.getAbsolutePath(), markerFile));\n\t\t\tString content = lines.collect(Collectors.joining());\n\t\t\t//System.out.println(content);\n\t\t\treturn content.equals(successString);\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}",
"public boolean hasMid() {\n return genClient.cacheHasKey(CacheKey.mid);\n }",
"@Override\n public boolean processUnStableCluster(ICluster unStableCluster) {\n unStableClusterProcessed = true;\n\n int startSpectraCount = unStableCluster.getClusteredSpectraCount();\n for (ICluster stableCluster : stableClusters) {\n boolean empty = mergeUnstableCluster(stableCluster, unStableCluster);\n if (empty)\n break;\n }\n return startSpectraCount != unStableCluster.getClusteredSpectraCount();\n\n }",
"public boolean isInit() {\r\n\t\treturn isInit;\r\n\t}",
"public boolean hasPreviousSet() { \n return (firstIndexOfCurrentSet > firstIndex);\n }",
"boolean hasCurMP();",
"boolean hasCurMP();",
"boolean hasCurMP();",
"boolean hasCurMP();",
"boolean hasCurMP();",
"boolean hasCurMP();",
"public boolean isUnauthored() {\n return this.scientificNameAuthorship == null;\n }",
"private boolean firstMilestoneAccomplished()\n {\n if(\n (beliefs.puzzle[0][0] == 1) &&\n (beliefs.puzzle[0][1] == 2) &&\n (beliefs.puzzle[0][2] == 3) &&\n (beliefs.puzzle[0][3] == 4)\n )\n return true;\n else\n return false;\n }",
"public boolean isSetKin() {\n return this.kin != null;\n }",
"public boolean isSeen() {\n return seen;\n }",
"boolean hasEmbeddingTokenLow();",
"boolean hasEmbeddingTokenLow();",
"public boolean isSetReferer() {\n return this.referer != null;\n }",
"public boolean first(String key) {\n initialize();\n return next(key);\n }",
"public boolean isSetIs_preaggregation() {\n return EncodingUtils.testBit(__isset_bitfield, __IS_PREAGGREGATION_ISSET_ID);\n }",
"private boolean checkNext(){\n boolean ret = this.hasNext;\n if ((this.allStatesIterator.hasNext()) || (this.allSubsetsIterator.hasNext()) || (this.allTransitionsIterator.hasNext())){\n hasNext = true;\n return hasNext;\n }\n hasNext = false;\n return ret;\n }",
"private boolean isJanuaryFirst(final Calendar date) {\n return JANUARY_1ST_DAY == date.get(Calendar.DAY_OF_MONTH)\n && Calendar.JANUARY == date.get(Calendar.MONTH);\n }",
"@Transactional\n\tpublic boolean isFirstLogin(String name) {\n\t\treturn userInfoDAO.isFirstLogin(name);\n\n\t}",
"public boolean isSperret() {\n\t\treturn sperretKort;\n\t}",
"public boolean isFirstToConnect() throws IOException;",
"protected final boolean computeHasNext() {\n return this.getEnds().getGraph().getPredecessorEdges(this.getNext()).isEmpty();\n }",
"public boolean isFirstPlayer()\r\n\t{\r\n\t\tgetStartGameDataFromServer();\r\n\t\treturn isFirstPlayer;\r\n\t}",
"boolean isSetDelegateSuggestedSigner();",
"protected final boolean computeHasNext() {\n return this.getEnds().getGraph().getSuccessorEdges(this.getNext()).isEmpty();\n }",
"public boolean isRewrittenByVulas() {\n // Somehow the containsKey does not work, use getValue instead\n //\t\tfinal boolean modif =\n // this.originalManifest.getMainAttributes().containsKey(JarWriter.MANIFEST_ENTRY_VULAS_MODIF);\n //\t\tfinal boolean sha1 =\n // this.originalManifest.getMainAttributes().containsKey(JarWriter.MANIFEST_ENTRY_ORIG_SHA1);\n final boolean modif =\n this.originalManifest.getMainAttributes().getValue(JarWriter.MANIFEST_ENTRY_VULAS_MODIF)\n != null;\n final boolean sha1 =\n this.originalManifest.getMainAttributes().getValue(JarWriter.MANIFEST_ENTRY_ORIG_SHA1)\n != null;\n return modif && sha1;\n }",
"public boolean isSetStartPage()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(STARTPAGE$12) != null;\n }\n }",
"public boolean alwaysFits() {\n return _alwaysFits;\n }",
"public boolean isSetLinkman() {\n return this.linkman != null;\n }",
"private boolean m12737d() {\n return FetchService.m12666b(this.f9046c);\n }",
"public boolean isSetKey() {\n return this.key != null;\n }",
"public boolean isSetKey() {\n return this.key != null;\n }",
"public boolean isSetKey() {\n return this.key != null;\n }",
"public boolean isNotNullFrontendMid() {\n return genClient.cacheValueIsNotNull(CacheKey.frontendMid);\n }",
"public boolean isCanonical() {\n/* 244 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public static boolean isInit() {\n\t\treturn isInit;\n\t}"
] | [
"0.59918344",
"0.5750043",
"0.5707491",
"0.56456447",
"0.55440587",
"0.5541954",
"0.55274177",
"0.55026513",
"0.5484003",
"0.5434514",
"0.5424616",
"0.54064584",
"0.5352575",
"0.53267115",
"0.5255478",
"0.5236433",
"0.5234987",
"0.5216274",
"0.5183875",
"0.51770234",
"0.5163485",
"0.51611614",
"0.5158313",
"0.5156711",
"0.5141551",
"0.51115525",
"0.508788",
"0.5078061",
"0.5077114",
"0.5065956",
"0.5060195",
"0.50491846",
"0.50223434",
"0.500029",
"0.49999955",
"0.49969536",
"0.49859735",
"0.49778923",
"0.49767253",
"0.4965371",
"0.49624342",
"0.49544603",
"0.49505845",
"0.49394813",
"0.49310398",
"0.4925437",
"0.49004555",
"0.48983926",
"0.48906592",
"0.48904595",
"0.48861516",
"0.4883392",
"0.4880181",
"0.48568988",
"0.48568988",
"0.48544678",
"0.48513946",
"0.48483846",
"0.4847371",
"0.48414916",
"0.48367962",
"0.48332214",
"0.48284572",
"0.48151964",
"0.4814236",
"0.4813661",
"0.48124886",
"0.48124886",
"0.48124886",
"0.48124886",
"0.48124886",
"0.48124886",
"0.4810804",
"0.48065704",
"0.4797311",
"0.47971725",
"0.47949046",
"0.47949046",
"0.47939187",
"0.47897646",
"0.47896662",
"0.47886994",
"0.4783847",
"0.47818998",
"0.47770026",
"0.47746477",
"0.47720686",
"0.4771002",
"0.47708482",
"0.4770144",
"0.4769846",
"0.4756118",
"0.47532898",
"0.4749751",
"0.47471383",
"0.47446415",
"0.47446415",
"0.47446415",
"0.4741344",
"0.4741337",
"0.47404623"
] | 0.0 | -1 |
Writes the canonical status of a kmer at the first visit. | public void put_canonical(boolean canonical, long number) {
ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].put((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 8), (byte) (canonical ? 0 : 1));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void canonize(int color, StringBuffer canonicalVertexSignature) {\n if (this.getVertexCount() == 0) return;\n \n // Only add a new list of Integers if this is the first time this \n // function is called for a particular root vertex.\n // The labelling that corresponds to the mapping for the vertex\n // signature should be the only one stored.\n \n if ( color == 1 ) {\n \tthis.currentCanonicalLabelMapping = new ArrayList<Integer>();\n \tthis.canonicalLabelMapping.add(this.currentCanonicalLabelMapping); \n }\n \n this.dag.updateVertexInvariants();\n \n List<Integer> orbit = this.dag.createOrbit();\n \n if (orbit.size() < 2) {\n // Color all uncolored atoms having two parents \n // or more according to their invariant.\n for (InvariantIntIntPair pair : this.dag.getInvariantPairs()) {\n this.dag.setColor(pair.index, color);\n color++;\n }\n // Creating the root signature string.\n String signature = this.toString(); \n if (signature.compareTo(canonicalVertexSignature.toString()) > 0) {\n int l = canonicalVertexSignature.length();\n canonicalVertexSignature.replace(0, l, signature);\n this.canonicalLabelMapping.set(\n this.canonicalLabelMapping.size() - 1,\n this.currentCanonicalLabelMapping);\n }\n return;\n } else {\n for (int o : orbit) {\n this.dag.setColor(o, color);\n Invariants invariantsCopy = this.dag.copyInvariants();\n this.canonize(color + 1, canonicalVertexSignature);\n this.dag.setInvariants(invariantsCopy);\n this.dag.setColor(o, 0);\n }\n }\n }",
"@Override\n protected void writeStreamHeader() throws IOException {\n reset();\n }",
"private void sendStatus() throws IOException {\n\t\tWriteStatus status = new WriteStatus.Builder().build();\n\t\tstatus.writeTo(out);\n\t\tout.flush();\n\t}",
"private void writeSuccessor(INode prev, Node succ) {\n if (succ == null) {\n return;\n }\n Label prevKey = trapwriter.localID(prev);\n writeSuccessor(prevKey, succ);\n }",
"private void resetWrittenToCPN() {\n\t\tthis.pnWrittenToCPN = false;\n\t\tIterator transitions = this.getTransitions().iterator();\n\t\twhile (transitions.hasNext()) {\n\t\t\tColoredTransition transition = (ColoredTransition) transitions.next();\n\t\t\tif (transition.getSubpage() != null) {\n\t\t\t\ttransition.getSubpage().resetWrittenToCPN();\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\t\tprotected void writeStreamHeader() throws IOException {\n\t\t}",
"@Override\n protected void writeStreamHeader() throws IOException {\n // metodo honek ez du ezer egiten\n }",
"private void writeSuccessor(Label prevKey, Node succ) {\n trapwriter.addTuple(\"successor\", prevKey, trapwriter.localID(succ));\n }",
"@Override\n\tpublic void statusVomMenschen() {\n\t\tSystem.out.println(\"Sie wurden getroffen nun können Sie nicht mehr so schnell laufen!\");\n\t}",
"@Override\npublic int writingBenches() {\n\treturn 200;\n}",
"public synchronized void writeCheckpoint() {\n\t\tflush();\n\t\tpw.println(\"CHECKPOINT \" \n\t\t\t\t\t+ TransactionManager.instance().transactionList());\n\t\tflush();\n\t}",
"private void writeCoAuthorPajekFile(PrintWriter coAuthWriter) {\n\t\tauthorOffset = 0;\n\n\t\tcoAuthWriter.println(\"*Vertices \" + authors.size());\n\t\tthis.writeAuthVertices(coAuthWriter);\n\n\t\tcoAuthWriter.println(\"*Arcs\\n*Edges\");\n\t\tthis.writeAuthEdges(coAuthWriter);\n\t}",
"@Override\n public void writeStartDocument()\n throws XMLStreamException\n {\n if (mEncoding == null) {\n mEncoding = WstxOutputProperties.DEFAULT_OUTPUT_ENCODING;\n }\n writeStartDocument(mEncoding, WstxOutputProperties.DEFAULT_XML_VERSION);\n }",
"public UnifiedFormat() {\n getMetadata().setStatus(HttpStatus.SC_OK);\n }",
"@Override\n public void write() {\n MDC.put(this.key, this.value!=null ? this.value : \"?\");\n }",
"@Override\n\tpublic synchronized boolean writeHeader() {\n\t\tif(!trailerWritten) \n\t\t{\n\t\t\tlong startTime = System.currentTimeMillis();\n\t\t\tsuper.writeHeader();\n\t\t\tlong diff = System.currentTimeMillis() - startTime;\n\t\t\tlogger.info(\"write header takes {} for rtmp:{}\", diff, getOutputURL());\n\t\t\t\n\t\t\theaderWritten = true;\n\t\t\tsetStatus(IAntMediaStreamHandler.BROADCAST_STATUS_BROADCASTING);\n\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\tlogger.warn(\"Trying to write header after writing trailer\");\n\t\t\treturn false;\n\t\t}\n\t}",
"@Override\n public void updateFirstHeader() {\n padToCacheAlign();\n long pos = bytes.writePosition();\n updateFirstHeader(pos);\n }",
"public void write() {\r\n\t\ttry {\r\n\t\t\tDataOutputStream dat = new DataOutputStream(new FileOutputStream(signlink.getDirectory() + \"idk.dat\"));\r\n\t\t\tdat.writeShort(IdentityKit.cache.length);\r\n\t\t\tfor (IdentityKit idk : IdentityKit.cache) {\r\n\t\t\t\tif (idk.partId != -1) {\r\n\t\t\t\t\tdat.writeByte(1);\r\n\t\t\t\t\tdat.writeByte(idk.partId);\r\n\t\t\t\t}\r\n\t\t\t\tif (idk.models != null) {\r\n\t\t\t\t\tdat.writeByte(2);\r\n\t\t\t\t\tdat.writeByte(idk.models.length);\r\n\t\t\t\t\tfor (int index = 0; index < idk.models.length; index++) {\r\n\t\t\t\t\t\tdat.writeShort(idk.models[index]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (idk.disableDisplay) {\r\n\t\t\t\t\tdat.writeByte(3);\r\n\t\t\t\t}\r\n\t\t\t\tif (idk.oldColors != null) {\r\n\t\t\t\t\tfor (int index = 0; index < idk.oldColors.length; index++) {\r\n\t\t\t\t\t\tdat.writeByte(40 + index);\r\n\t\t\t\t\t\tdat.writeShort(idk.oldColors[index]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (idk.newColors != null) {\r\n\t\t\t\t\tfor (int index = 0; index < idk.newColors.length; index++) {\r\n\t\t\t\t\t\tdat.writeByte(50 + index);\r\n\t\t\t\t\t\tdat.writeShort(idk.newColors[index]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (idk.dialogModels != null) {\r\n\t\t\t\t\tfor (int index = 0; index < idk.dialogModels.length; index++) {\r\n\t\t\t\t\t\tdat.writeByte(60 + index);\r\n\t\t\t\t\t\tdat.writeShort(idk.dialogModels[index]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdat.writeByte(0);\r\n\t\t\t}\r\n\t\t\tdat.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"@Override\n public void markSuccess() {\n }",
"public void resetWriter() {\n\t\tinit();\n\t}",
"@Override\r\n\t\tpublic void onStatus(Map<String, Object> arg0) {\n\t\t\tSystem.out.println(\"Method createMeetiong status: \" + arg0);\r\n\t\t}",
"@Test\n public void packClustersWithSparseData() throws IOException, MkvElementVisitException {\n final byte [] inputBytes = TestResourceUtil.getTestInputByteArray(\"output_get_media_sparse_fragments.mkv\");\n\n //Stream to receive the merged output.\n final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n\n //Do the actual merge.\n final OutputSegmentMerger merger =\n OutputSegmentMerger.create(outputStream, OutputSegmentMerger.Configuration.builder()\n .packClusters(true)\n .build());\n\n final StreamingMkvReader mkvStreamReader =\n StreamingMkvReader.createDefault(new InputStreamParserByteSource(new ByteArrayInputStream(inputBytes)));\n while(mkvStreamReader.mightHaveNext()) {\n final Optional<MkvElement> mkvElement = mkvStreamReader.nextIfAvailable();\n if (mkvElement.isPresent()) {\n mkvElement.get().accept(merger);\n }\n }\n\n final byte[] outputBytes = outputStream.toByteArray();\n final byte [] expectedOutputBytes = TestResourceUtil.getTestInputByteArray(\"output_get_media_sparse_fragments_merged.mkv\");\n Assert.assertArrayEquals(expectedOutputBytes, outputBytes);\n }",
"private void writeObject(ObjectOutputStream out) throws IOException {\n Set<PackageIdentifier> successfulPkgs = transitiveSuccessfulPkgs.toSet();\n out.writeInt(successfulPkgs.size());\n for (PackageIdentifier pkg : successfulPkgs) {\n out.writeObject(pkg);\n }\n\n out.writeObject(transitiveUnsuccessfulPkgs);\n // Deliberately do not write out transitiveTargets. There is a lot of those and they drive\n // serialization costs through the roof, both in terms of space and of time.\n // TODO(bazel-team): Deal with this properly once we have efficient serialization of NestedSets.\n out.writeObject(transitiveRootCauses);\n out.writeObject(errorLoadingTarget);\n }",
"@Override\n public AutoBuffer write_impl(AutoBuffer ab) {\n if (_vocabHM == null) return ab.put1(1); // killed\n\n int strLen = 0;\n for (ValueStringCount val : VOCABHM.values())\n strLen += val.length();\n ab.put1(0); // not killed\n ab.put4(strLen); //length of string buffer\n for (ValueStringCount val : VOCABHM.values())\n ab.put2((char) val.length()).putA1(val.getBuffer(), val.getOffset(), val.getOffset() + val.length()).put8(val._cnt);\n return ab.put2((char) 65535); // End of map marker\n }",
"public void markMajorOnsetMerge() throws JNCException {\n markLeafMerge(\"majorOnset\");\n }",
"private void writePresentFilesKey() {\n writeSpacesCorrespondingToNestedLevel(COMMIT_METADATA_NEST_LEVEL);\n writer.println(\"present:\");\n }",
"public void markMajorActionMerge() throws JNCException {\n markLeafMerge(\"majorAction\");\n }",
"private void serializeBeforeOpen() {\r\n sr.save(this.path);\r\n }",
"public Date getFirst_seen() {\n return first_seen;\n }",
"private void markOutputDirSuccessful(JobContext context) throws IOException {\r\n JobConf conf = context.getJobConf();\r\n // get the o/p path\r\n Path outputPath = FileOutputFormat.getOutputPath(conf);\r\n if (outputPath != null) {\r\n // get the filesys\r\n FileSystem fileSys = outputPath.getFileSystem(conf);\r\n // create a file in the output folder to mark the job completion\r\n Path filePath = new Path(outputPath, SUCCEEDED_FILE_NAME);\r\n fileSys.create(filePath).close();\r\n }\r\n }",
"public void reportInitSuccessful() {\n\n System.out.println(\"Subsystem \" + getName() + \" has initialized successfully.\");\n\n SmartDashboard.putBoolean(getName()+\" status\", true);\n }",
"private void doWrite() throws IOException {\n\t\t\tbb.flip();\n\t\t\tsc.write(bb);\n\t\t\tbb.compact();\n\n\t\t\tupdateInterestOps();\n\t\t}",
"public void encode(org.ccsds.moims.mo.mal.MALEncoder encoder) throws org.ccsds.moims.mo.mal.MALException\n {\n encoder.encodeNullableShort(counter);\n }",
"@Override\n protected boolean shouldSwitchWriterInCurrentLocation(DecoratedKey key)\n {\n final long uncompressedBytesWritten = sstableWriter.currentWriter().getFilePointer();\n if (boundaries.advanceTo(key.getToken()) && uncompressedBytesWritten > 0)\n {\n logger.debug(\"Switching writer at boundary {}/{} index {}, with uncompressed size {} for {}.{}\",\n key.getToken(), boundaries.shardStart(),\n boundaries.shardIndex(),\n FBUtilities.prettyPrintMemory(uncompressedBytesWritten),\n cfs.getKeyspaceName(), cfs.getTableName());\n return true;\n }\n\n return false;\n }",
"public void markBearerEventsMmeMerge() throws JNCException {\n markLeafMerge(\"bearerEventsMme\");\n }",
"public boolean checkpoint() {\n\t\ttry {\n\t\t\toutputStream.flush();\n\t\t} catch (IOException e) {\n\t\t\tif (RTS_COMMON.Option.VERBOSE)\n\t\t\t\te.printStackTrace();\n\t\t\treturn (false);\n\t\t}\n\t\treturn (true);\n\t}",
"@Override\n public void onWrite() {\n onChannelPreWrite();\n }",
"public void status() {\n\t\tString bName;\n\t\tSystem.out.println(\"=== Branches ===\");\n\t\tIterator iter = myBranch.entrySet().iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tMap.Entry entry = (Map.Entry) iter.next();\n\t\t\tbName = (String) entry.getKey();\n\n\t\t\tif (currentBranch.equals(bName)) {\n\t\t\t\tSystem.out.println(\"*\" + bName);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(bName);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"=== Staged Files ===\");\n\t\tfor (int i = 0; i < stagedFiles.size(); i++) {\n\t\t\tSystem.out.println(stagedFiles.get(i));\n\t\t}\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"=== Files Marked for Untracking ===\");\n\t\tfor (int i = 0; i < untrackedFiles.size(); i++) {\n\t\t\tSystem.out.println(untrackedFiles.get(i));\n\t\t}\n\t}",
"public void doWrite() throws IOException {\n\t\tbbout.flip();\n\t\tsc.write(bbout);\n\t\tbbout.compact();\n\t\tprocessOut();\n\t\tupdateInterestOps();\n\t}",
"private void setRedstoneOutput(final short value) {\n // Clamp to valid redstone range.\n final short validatedValue = (short)Math.max(0, Math.min(15, value));\n if (validatedValue == output) {\n return;\n }\n\n output = validatedValue;\n\n // If the value changed, make sure we're saved.\n getCasing().markDirty();\n\n // Notify neighbors, avoid multiple world updates per tick.\n scheduledNeighborUpdate = true;\n\n sendData();\n }",
"private void writeObject(final java.io.ObjectOutputStream out) throws java.io.IOException {\n\t\t/*\n\t\t * out.writeInt(0); // Version of the stream. // Version 0 outstuff...\n\t\t * out.writeObject(states); out.writeObject(initialState);\n\t\t * out.writeObject(finalStates); out.writeObject(transitions); if (this\n\t\t * instanceof TuringMachine) { out.writeInt(((TuringMachine)\n\t\t * this).tapes); } out.writeObject(\"SENT\"); // The sentinel object.\n\t\t */\n\t}",
"private void writeSuccessors(INode prev, Collection<Node> succs) {\n Label prevKey = trapwriter.localID(prev);\n for (Node succ : succs) writeSuccessor(prevKey, succ);\n }",
"public void setAsSuccessful_OK(){\n setStatus(200);\n }",
"boolean isCanonicalVersion() {\n\t\treturn isLocal() && isVersion() && !Namespace.create(this.ontology).equals(Namespace.create(this.versionIRI));\n\t}",
"private void sentOutputAsRealMin() {\n outputAsRealMin = true;\n }",
"public M csseStatusNull(){if(this.get(\"csseStatusNot\")==null)this.put(\"csseStatusNot\", \"\");this.put(\"csseStatus\", null);return this;}",
"public KSCrashReportFilterJSONEncode() {\n this(-1);\n }",
"protected void write_output_header() {\t\t\n\t\tSystem.out.println(\" H Lennard-Jones lattice-switch monte carlo code: hcp v fcc:\");\n\t\tSystem.out.println(\" H \");\n\t\t// Write out the standard parts of the LSMC header:\n\t\tsuper.write_output_header();\n\t\t// Write out LJLS-specific section:\n\t\tSystem.out.println(\" H For the Lennard-Jones Lattice-Switch: \");\n\t\tSystem.out.print(\" H lj_eta = 4*beta = +\"+lj_eta+\"\\n\");\n\t\tif( VIRT_NSWC == 1 ) {\n\t\t\tSystem.out.println(\" H VIRTUAL n-switch, structure \"+INIT_PHASE+\", en_shift = \"+EN_SHIFT);\n\t\t}\n\t\t\n\t\t// Optionally output E v. density:\n\t\tif( OUTPUT_E_V_DENSITY ) calc_e_v_dens();\n\n\t}",
"public M csmiStatusNull(){if(this.get(\"csmiStatusNot\")==null)this.put(\"csmiStatusNot\", \"\");this.put(\"csmiStatus\", null);return this;}",
"public MantaObjectResponse head() throws IOException {\n final MantaFileSystem fs = getAbstractFileSystem();\n\n synchronized (fs) {\n final MantaClient client = fs.getClient();\n return client.head(path());\n }\n }",
"protected void writeStart() throws IOException {\n writer.write(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\");\r\n writer.write(\"<kml xmlns=\\\"http://www.opengis.net/kml/2.2\\\" xmlns:gx=\\\"http://www.google.com/kml/ext/2.2\\\">\\n\");\r\n writer.write(\"<Document>\\n\");\r\n writer.write(\"<name>\" + this.title + \"</name>\\n\");\r\n writer.write(\"<description></description>\\n\");\r\n writer.write(\"<Style id=\\\"\" + LINE_STYLE_YELLOW + \"\\\">\\n\");\r\n writer.write(\"<LineStyle>\\n\");\r\n writer.write(\"<color>7f00ffff</color>\\n\");\r\n writer.write(\"<width>4</width>\\n\");\r\n writer.write(\"</LineStyle>\\n\");\r\n writer.write(\"</Style>\\n\");\r\n writer.write(\"<Style id=\\\"\" + LINE_STYLE_BLUE + \"\\\">\\n\");\r\n writer.write(\"<LineStyle>\\n\");\r\n writer.write(\"<color>7fff0000</color>\\n\");\r\n writer.write(\"<width>4</width>\\n\");\r\n writer.write(\"</LineStyle>\\n\");\r\n writer.write(\"</Style>\\n\");\r\n writer.write(\"<Style id=\\\"\" + LINE_STYLE_RED + \"\\\">\\n\");\r\n writer.write(\"<LineStyle>\\n\");\r\n writer.write(\"<color>7f0000ff</color>\\n\");\r\n writer.write(\"<width>4</width>\\n\");\r\n writer.write(\"</LineStyle>\\n\");\r\n writer.write(\"</Style>\\n\");\r\n }",
"CompressingMessageWriter(MessageWriter wr) {\n this.writer = wr;\n }",
"public void markMajorAbateMerge() throws JNCException {\n markLeafMerge(\"majorAbate\");\n }",
"void setNewerRevisionSeen() {\n\n // If we have previously written something, then we've detected a write conflict; fail early.\n if ( !this.versionedItemsWritten.isEmpty() ) {\n throw new WriteConflictException();\n }\n\n // Track the newer revision number to fail early if we subsequently write something.\n this.newerRevisionSeen = true;\n\n }",
"@Override\n\tpublic void toJson(Writer writer) throws IOException {\n\t\tString status = \"deleted.\";\n\t\tJsonObject json = new JsonObject();\n\t\tjson.put(\"status\", status);\n\t\tjson.toJson(writer);\n\t}",
"private static void\n extraWrite (final Map.Entry <String, VersionedValue> entry, State self)\n {\n self.putString (entry.getKey ());\n self.putNumber4 (entry.getValue ().getVersion ());\n self.putString (entry.getValue ().getValue ());\n }",
"public boolean syncCommitPhase() {\n return syncCommitPhase;\n }",
"private static void\n headersWrite (final Map.Entry <String, VersionedValue> entry, Hello self)\n {\n self.putString (entry.getKey ());\n self.putNumber4 (entry.getValue ().getVersion ());\n self.putString (entry.getValue ().getValue ());\n }",
"@Override\n public void flush() throws IOException {\n checkStreamState();\n flushIOBuffers();\n }",
"public void markVlanTag1Merge() throws JNCException {\n markLeafMerge(\"vlanTag1\");\n }",
"@Override\n protected void serialize(OutputStream os) throws IOException {\n writeInt(os,_gateCounter);\n }",
"public void markFinalizePartitionCounters() {\n finalizePartitionCounters = true;\n }",
"public void write(LineWriter writer) {\n\t\tsuper.write(writer);\n\t\twriter.writeLine(1); // version\n\t}",
"public void finished() {\n\n\t\tencodeCounter = 0;\n\t}",
"public ReadClusterVersionStatus pretty(String pretty) {\n put(\"pretty\", pretty);\n return this;\n }",
"@Test\n public void testResetJadler() throws IOException {\n initJadler();\n\n try {\n onRequest().respond().withStatus(EXPECTED_STATUS);\n assertExpectedStatus();\n\n resetJadler();\n\n onRequest().respond().withStatus(201);\n assertExpectedStatus(201);\n }\n finally {\n closeJadler();\n }\n }",
"@Override\n public void onNotifySuccess() {\n Log.i(\"SleepDoc\", \"notify SYNC_CONTROL Success\");\n bleManager.write(bleDevice, ServiceUUID.SYNC.toString(), CharacteristicUUID.SYNC_CONTROL.toString(), new byte[]{Command.SYNC_CONTROL_START}, logWriteCallback);\n }",
"public void setFirst_seen(Date first_seen) {\n this.first_seen = first_seen;\n }",
"public void output(IndentedWriter out, SerializationContext sCxt) \n {\n }",
"protected void computeEntryWritten(K key, InternalCacheEntry<K, V> value) {\n // Do nothing by default\n }",
"void flush(String metaName, BufferedReader in, PrintWriter out) {\n try {\n Hashtable meta = getMeta(metaName, true);\n String sectionName = \"\";\n Hashtable section = null; // keys of current section\n\n int blank = 0; // count of blank lines\n String pending_section = null;\n String pending_comments = \"\";\n\n for (String line=in.readLine(); line!=null; line=in.readLine()) {\n String saved_line = line; // in case value is unchanged\n\n // remember comment\n String comment;\n {\n int commentpos = line.indexOf(';');\n if (commentpos>=0) {\n comment = line.substring(commentpos);\n line = line.substring(0, commentpos);\n } else {\n comment = \"\";\n }\n }\n\n line = line.trim();\n if (line.length()==0) {\n if (pending_section!=null) {\n pending_comments += saved_line+newline;\n line = null;\n } else {\n if (saved_line.trim().length()==0) { // empty line\n line = null;\n blank++;\n } else { // comment-only line\n line = saved_line;\n }\n }\n } else {\n char c = line.charAt(0);\n switch (c) {\n case '[':\n // a section, so finish current section\n if (section!=null) {\n writeSection(out, section, null);\n removeSection(meta, sectionName);\n }\n\n int endpos = line.indexOf(']');\n if (endpos>=2) {\n sectionName = line.substring(1, endpos);\n section = getSection(meta, sectionName, false);\n }\n\n line = null;\n pending_section = saved_line;\n pending_comments = \"\"; // throw away any comments from previous omitted section\n\n break;\n\n default:\n int eqpos = line.indexOf('=');\n if (eqpos<0) {\n line = saved_line;\n } else {\n CaseFoldString key = new CaseFoldString(line.substring(0, eqpos).trim());\n String value = ((section==null)? null: getValue(section, key));\n if (value==null) {\n line = saved_line;\n } else if (value==DELETED) {\n line = null;\n } else {\n // here's the real work!\n line = key + \"=\" + value + comment;\n }\n if (section!=null)\n removeValue(section, key);\n if (line!=null && pending_section!=null) {\n line = pending_section + newline + pending_comments + line;\n pending_section = null;\n pending_comments = \"\";\n }\n }\n }\n }\n\n if (line!=null) {\n while (blank>0) {\n out.println();\n blank--;\n }\n out.println(line);\n }\n\n }\n\n // We've got the end of the input; finish the current section\n if (section!=null) {\n writeSection(out, section, null);\n removeSection(meta, sectionName);\n }\n\n // now output any remaining sections.\n writeSections(out, meta);\n\n // We're done - record the fact\n removeMeta(metaName);\n\n } catch (IOException e) {\n // what should we do with it?\n }\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 void Serialization() {\n\t\tGitlet myGitlet = new Gitlet(1);\n\t\tmyGitlet.myBranch = this.myBranch;\n\t\tmyGitlet.myCommit = this.myCommit;\n\t\tmyGitlet.messageMap = this.messageMap;\n\t\tmyGitlet.myHead = this.myHead;\n\t\tmyGitlet.stagedFiles = this.stagedFiles;\n\t\tmyGitlet.tracked = this.tracked;\n\t\tmyGitlet.stagePath = this.stagePath;\n\t\tmyGitlet.ID = this.ID;\n\t\tmyGitlet.currentBranch = this.currentBranch;\n\t\tmyGitlet.untrackedFiles = this.untrackedFiles;\n\t\tmyGitlet.conflictState = this.conflictState;\n\t\ttry {\n\t\t\tFileOutputStream fileOut = new FileOutputStream(\n\t\t\t\t\t\".gitlet/Serialization.ser\");\n\t\t\tObjectOutputStream outStream = new ObjectOutputStream(fileOut);\n\t\t\toutStream.writeObject(myGitlet);\n\t\t\toutStream.close();\n\t\t\tfileOut.close();\n\n\t\t} catch (IOException i) {\n\t\t\ti.printStackTrace();\n\t\t}\n\n\t}",
"private void writeNullCommitMetaData() {\n writer.println(\"commit_NULL:\");\n writeSpacesCorrespondingToNestedLevel(COMMIT_METADATA_NEST_LEVEL);\n writer.println(\"author:\");\n writeSpacesCorrespondingToNestedLevel(COMMIT_METADATA_NEST_LEVEL);\n writer.println(\"modified:\");\n writeSpacesCorrespondingToNestedLevel(COMMIT_METADATA_NEST_LEVEL);\n writer.println(\"removed:\");\n }",
"public long flushCheckpoint()\r\n/* 119: */ {\r\n/* 120:150 */ return this.checkpoint;\r\n/* 121: */ }",
"public void printSuccess() {\n LOGGER.info(\"PACKMAN: Client connection success\");\n }",
"private void mian() {\n\t\tSystem.out.println(\"提交\");\r\n\t\tSystem.out.println(\"提交2次\");\r\n\t}",
"public void markVersionMerge() throws JNCException {\n markLeafMerge(\"version\");\n }",
"@Override\n public void write() {\n for(MDCWriter writer : this.writers) {\n writer.write();\n }\n }",
"public void writeVisits() {\n try {\n FileOutputStream fileOut = new FileOutputStream(\"temp/visits.ser\");\n ObjectOutputStream out = new ObjectOutputStream(fileOut);\n out.writeObject(visits);\n out.close();\n fileOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"public void markRadiobearerEventsMmeMerge() throws JNCException {\n markLeafMerge(\"radiobearerEventsMme\");\n }",
"public void write(int datum) throws IOException {\n if (!_open)\n return;\n datum &= 0xff;\n long _here = position();\n\n // Are we synced up?\n if (_here == _digestvalidto) {\n\n // Yes, digest the byte and move the valid to pointer.\n _digest.update((byte) datum);\n _digestvalidto++; // JMC: Was missing.\n\n } // Otherwise, advancing of the position will destroy the digest sync.\n\n datum = _head.crypt((byte) datum, _here);\n _backing.write(datum);\n }",
"public int writeReCMC(CMCDto dto) throws Exception;",
"protected void writeHeader() throws IOException {\n _baos = new ByteArrayOutputStream();\n _dos = new DataOutputStream(_baos);\n _dos.write(PushCacheProtocol.instance().header(), 0, PushCacheProtocol.instance().header().length);\n }",
"public void doWrite() throws IOException {\n bbout.flip();\n sc.write(bbout);\n bbout.compact();\n processOut();\n updateInterestOps();\n }",
"public void doWrite() throws IOException {\n bbout.flip();\n sc.write(bbout);\n bbout.compact();\n processOut();\n updateInterestOps();\n }",
"public void markMajorOnsetCreate() throws JNCException {\n markLeafCreate(\"majorOnset\");\n }",
"private static void writeResults() {\n\t\t//Sort hashMap before sending to file\n\t\tTreeSet<Word> mySet = new TreeSet<>(hm.values());\n\n\t\t//Create result.txt file and write treeMap out to it\n\t\tWriter writer = null;\n\t\ttry {\n\t\t\t//System.out.println(\"Here\");\n\t\t\twriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"output\\\\results.txt\")));\n\t\t\tfor (Word word : mySet) {\n\t\t\t\twriter.write(word.getValue() + \"\\t\" + word.getCount() + \"\\n\");\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\twriter.close();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"private void do_marshal (MarshalWriter writer) {\n\n\t\t// Version\n\n\t\twriter.marshalInt (M_VERSION_NAME, MARSHAL_VER_1);\n\n\t\t// Contents\n\n\t\twriter.marshalLong (\"mode_timestamp\" , mode_timestamp + OFFSERL);\n\t\twriter.marshalInt (\"relay_mode\" , relay_mode );\n\t\twriter.marshalInt (\"configured_primary\", configured_primary);\n\n\t\treturn;\n\t}",
"public void flush() {\n flushed = true;\n }",
"public synchronized void finishWriting() {\n readerNumber++; // readerNumber = -1 + 1 = 0; \n// readerNumber must be 0 at this point \n this.notifyAll(); // notify possible waiting writers or waiting readers \n }",
"public void mo38109c() throws IOException {\n mo38102a(true);\n }",
"public void beginOutput() {\n this.currentState = states.OUTPUT;\n this.buildOutStack();\n this.setOutputMode(0);\n }",
"public void reportSuccess() {\n Crashlytics.logBreadcrumb(\"MuunLockOverlay: reportSuccess\");\n\n pinInput.setSuccess();\n }",
"public void setStatus(String st) {\n status = CMnServicePatch.getRequestStatus(st);\n }",
"private void getStatus() {\n\t\t\n\t}",
"public void startOutput(Response response, Writer writer) throws ScalarActionException {\r\n\t\ttry {\r\n\t\t\t// We send back a serialized object rather than an array to avoid JS hijacking\r\n\t\t\t// and prefix for JS cross-site hacking prevention\r\n\t\t\twriter.write(\"/*{\" + getRootName() + \":{\");\r\n\r\n\t\t\t// Output metatdata\r\n\t\t\twriter.write(getMetadataName());\r\n\t\t\twriter.write(\":{\");\r\n\r\n\t\t\tboolean comma = false;\r\n\t\t\tMap<String, String> data = getMetaData(response);\r\n\t\t\tfor ( Map.Entry<String, String> entry : data.entrySet() ) {\r\n\t\t\t\taddOutputAttribute(entry.getKey(), entry.getValue(), writer, comma);\r\n\t\t\t\tcomma = true;\r\n\t\t\t}\r\n\r\n\t\t\twriter.write(\"},\");\r\n\r\n\t\t\t// Start container\r\n\t\t\twriter.write(getContainerName());\r\n\t\t\twriter.write(\":{\");\r\n\r\n\t\t\tcomma = false;\r\n\t\t\tdata = getContainerAttributes(response);\r\n\t\t\tfor ( Map.Entry<String, String> entry : data.entrySet() ) {\r\n\t\t\t\taddOutputAttribute(entry.getKey(), entry.getValue(), writer, comma);\r\n\t\t\t\tcomma = true;\r\n\t\t\t}\r\n\r\n\t\t\tif ( comma ) {\r\n\t\t\t\twriter.write(',');\r\n\t\t\t}\r\n\r\n\t\t\twriter.write(\"data:[\");\r\n\t\t} catch ( IOException e ) {\r\n MsgObject msgObject = MsgObjectUtil.getMsgObject(FrameworkResource.BASE_NAME, FrameworkResource.WRITE_OUTPUT_FAILURE);\r\n\t\t\tthrow ScalarActionException.create(msgObject, e);\r\n\t\t}\r\n\t}",
"public void sync(boolean flush) throws IOException\n {\n segmentManager.sync(flush);\n }",
"public void flush() {\n wasFlushed = true;\n }",
"public Status zzc(Status status) {\n return status;\n }"
] | [
"0.4980041",
"0.47585365",
"0.44480968",
"0.43847707",
"0.43731993",
"0.43700278",
"0.42995664",
"0.4298192",
"0.42834753",
"0.4253894",
"0.42487144",
"0.42407176",
"0.41991132",
"0.41946834",
"0.41846094",
"0.41830453",
"0.4182301",
"0.41624606",
"0.41616833",
"0.40842745",
"0.40799302",
"0.40792745",
"0.4077087",
"0.40733662",
"0.4067911",
"0.40482676",
"0.4045094",
"0.40229237",
"0.4022773",
"0.40064016",
"0.39976084",
"0.39970225",
"0.39967462",
"0.39836213",
"0.3971714",
"0.39587134",
"0.39552268",
"0.39454085",
"0.3939867",
"0.39349282",
"0.39302713",
"0.3925312",
"0.39235413",
"0.39187524",
"0.39154685",
"0.39094684",
"0.39082474",
"0.39063507",
"0.39060998",
"0.3899936",
"0.3898873",
"0.3897358",
"0.3891938",
"0.38885945",
"0.38865742",
"0.38860914",
"0.38756803",
"0.3874759",
"0.38707775",
"0.3869661",
"0.38678563",
"0.38604438",
"0.3859441",
"0.38583705",
"0.3850936",
"0.38464227",
"0.38444772",
"0.38439685",
"0.3843452",
"0.38355732",
"0.38347375",
"0.38339475",
"0.38307628",
"0.38291195",
"0.38268027",
"0.38238147",
"0.38221136",
"0.38218027",
"0.38198376",
"0.3817714",
"0.38170215",
"0.38162926",
"0.38156247",
"0.3815471",
"0.3813069",
"0.3813069",
"0.38035935",
"0.3801788",
"0.379825",
"0.3796628",
"0.37947476",
"0.3793909",
"0.37914002",
"0.37892574",
"0.37888104",
"0.37881333",
"0.37871826",
"0.37853578",
"0.3783",
"0.3776496"
] | 0.4335575 | 6 |
Reads the position of a kmer in the node where it occurs. | public int get_position(long number) {
return ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getInt((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 9));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public int getPosition() throws IOException\n {\n return (int) randomAccessRead.getPosition();\n }",
"public synchronized long getPosition() {\n\t\treturn m_read;\n\t}",
"@Override\n\t\tpublic long getPos() throws IOException {\n\t\t\treturn 0;\n\t\t}",
"public static int offset_reading() {\n return (32 / 8);\n }",
"@Override\n\tpublic long getPosition()\n\t{\n\t\treturn inputStream.Position;\n\t}",
"int getOffset();",
"int getOffset();",
"int getOffset();",
"public double getPosition() {\n return spark_encoder.getPosition();\n }",
"public long getOffset() throws IOException {\n\t\treturn offset;\n\t}",
"public int getOffset(ParseTree node) {\n\t\treturn this.offsets.get(node);\n\t}",
"private long readJumpOffset() throws IOException {\n byte[] sec = new byte[4];\n ins.read(sec);\n return convertByteValueToLong(sec);\n }",
"public double getPosition() {\n return sequence.getPosition(BPMNode);\n }",
"public Location getOffset() {\n\t\treturn pos;\n\t}",
"public Integer getOffset();",
"public Integer getPosition();",
"public long getPosition();",
"public java.lang.Integer getPosition() {\n return position;\n }",
"public int startOffset();",
"public int getPosition()\n\t{\n\t\treturn position;\n\t}",
"public long find(kmer k_mer) {\n long low, mid, high;\n int j, comp;\n low = prefix_ptr[k_mer.prefix];\n if (k_mer.prefix == prefix_ptr.length - 1) {\n high = kmers_num - 1;\n } else {\n high = prefix_ptr[k_mer.prefix + 1] - 1;\n }\n while (low <= high) {\n mid = (low + high) / 2;\n j = (int) (mid * suf_rec_size / suf_parts_size[0]);\n suf_buff[j].position((int) (mid * suf_rec_size % suf_parts_size[0]));\n suf_buff[j].get(key.suffix, 0, suf_len / 4);\n comp = k_mer.compare_suffix(key);\n if (comp == -1) {\n high = mid - 1;\n } else if (comp == 1) {\n low = mid + 1;\n } else {\n return mid;\n }\n }\n return -1L; // not found\n }",
"public int getPosition();",
"public java.lang.Integer getPosition() {\n return position;\n }",
"public Integer getPosition() {\n return this.position;\n }",
"public int getPosition()\n {\n return m_sequence;\n }",
"int getReadPosition(int index) {\n/* 170 */ return index - this.origPos + this.readerIndex;\n/* */ }",
"public int getOffset() {\r\n return this.offset;\r\n }",
"public int getPosition() {\r\n\t\treturn position;\r\n\t}",
"public int getOffset() {\r\n return offset;\r\n }",
"public Integer getPosition()\n {\n return position;\n }",
"DVector3C getOffsetPosition();",
"@Override\n public long position() throws IOException {\n return _backing.getFilePointer() - _head.offset;\n }",
"public int getOffset() {\r\n\t\treturn this.offset;\r\n\t}",
"public int getOffset() {\r\n\t\treturn offset;\r\n\t}",
"public int getOffset() {\n return this.offset;\n }",
"public int PositionGet();",
"public int getPosition()\r\n {\r\n return position;\r\n }",
"public Position receivePosition(){\t\t\n\t\ttry {\n\t\t\tPosition position = (Position) in.readObject();\n\t\t\tif (position == null) {\n\t\t\t\treceiveString();\n\t\t\t}\n\t\t\treturn position;\n\t\t} catch (ClassNotFoundException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"public int getOffset() {\n\t\treturn this.offset;\n\t}",
"public Integer getPosition() {\n return position;\n }",
"public int getOffset() {\n return offset;\n }",
"public int position(String fieldName) {\n if (fieldPositions.containsKey(fieldName)) {\n return fieldPositions.get(fieldName);\n } else {\n throw new DatasetException(\"Cannot recover \" + fieldName + \" from key\");\n }\n }",
"public int getOffset() {\n return offset;\n }",
"public int getOffset() {\n return offset;\n }",
"public int getPos();",
"public int getPos();",
"public java.lang.Integer getOffset() {\n return offset;\n }",
"public abstract long getStartOffset();",
"public int getOffset() {\n return offset_;\n }",
"public Position getOffset() {\r\n return offset;\r\n }",
"public int getPosition() {\r\n return position;\r\n }",
"public int getBlockIndex() {\n return mCursorPosition;\n }",
"public int getPosition()\n {\n return getInt(\"Position\");\n }",
"public int getPosition() {\n return position;\n }",
"public final int getPosition() {\n return position;\n }",
"public Integer getOffset() {\n return this.offset;\n }",
"public Integer getOffset() {\n return this.offset;\n }",
"public final long getReadPosition() {\n\t\treturn m_rxpos;\n\t}",
"public String getPosition(){\r\n\t\treturn position;\r\n\t}",
"public int getPosition() {\n return position;\n }",
"public int getPosition() {\n return position;\n }",
"public int getPosition() {\n return position;\n }",
"public int getOffset() {\n return offset_;\n }",
"public Integer getOffset() {\n return offset;\n }",
"public int getPos()\n {\n return pos;\n }",
"public int getOffset() \n {\n return offset;\n }",
"public java.lang.Integer getOffset() {\n return offset;\n }",
"public int getPosition() {\n log.log(Level.FINE, \"position: \" + position + \"ms\");\n return position;\n }",
"public int getFoundOffset() { return _foundoffset; }",
"public int position() {\n return pos;\n }",
"public int getPosition(){\n\t\treturn this.cell;\n\t}",
"public int getPosition(){\n return -1;\n }",
"public int getStartOffset() {\n return startOffset;\n }",
"public int getLineNumber() {\n\t\treturn _tokenizer.getLineNumber();\n\t}",
"public int getPosition(Chamber c) {\n if (chambers.containsKey(c)) {\n return chambers.get(c);\n } else {\n return -1;\n }\n }",
"public long position() {\n return _pos;\n }",
"@Override\n\tpublic Position getPosition() {\n\t\treturn this.posn;\n\t}",
"int getRawOffset();",
"public int getPos()\n {\n return pos;\n }",
"public int getMolePosition() {\n return molePosition;\n }",
"public long getStartOffset() {\n return mStartOffset;\n }",
"int getLineOfOffset(int offset) throws BadLocationException;",
"public String getPosition() {\n return position;\n }",
"public String getPosition() {\n return position;\n }",
"public String getPosition() {\n return position;\n }",
"public String getPosition() {\n return position;\n }",
"public String getPosition() {\n return position;\n }",
"public int getLineNumber()\n {\n return parser.getLineNumber();\n }",
"public int getXOffset();",
"double getOffset();",
"int getPosition();",
"@Override\n\tpublic D3int getOffset() {\n\t\treturn myOffset;\n\t}",
"int getChunkIndex();",
"int getChunkIndex();",
"public long getCurrentOffset() {\n return (long)current_chunk * (long)chunksize;\n }",
"public int[] get_position()\r\n\t{\r\n\t\treturn this.position;\r\n\t}",
"int getLineOffset(int line) throws BadLocationException;",
"int readerIndex();",
"public int getStartOffset() {\n if (view != null) {\n return view.getStartOffset();\n }\n return getElement().getStartOffset();\n }",
"protected int getMarkerPosition() {\n\t\treturn valueToMarkerPosition(getValue());\n\t}",
"public long getPos()\n\t{\n\t\treturn -1;\n\t}"
] | [
"0.6152697",
"0.6102783",
"0.608616",
"0.59681565",
"0.5843092",
"0.5834955",
"0.5834955",
"0.5834955",
"0.58298254",
"0.57823217",
"0.57744765",
"0.57623184",
"0.57444286",
"0.57288307",
"0.57254153",
"0.5687727",
"0.56656075",
"0.56487405",
"0.56377256",
"0.5627649",
"0.562587",
"0.56135345",
"0.56013626",
"0.5559962",
"0.5555995",
"0.5555075",
"0.5551704",
"0.55505556",
"0.5527923",
"0.55249006",
"0.5524144",
"0.55228436",
"0.55163497",
"0.55162",
"0.5506142",
"0.55059606",
"0.5490378",
"0.54903615",
"0.54877454",
"0.54865605",
"0.5483727",
"0.5477722",
"0.54715365",
"0.54715365",
"0.54691386",
"0.54691386",
"0.5467551",
"0.5466705",
"0.5461036",
"0.5459925",
"0.5458632",
"0.54545105",
"0.5453806",
"0.5452793",
"0.54452014",
"0.54430467",
"0.54430467",
"0.5412631",
"0.54114944",
"0.54053766",
"0.54053766",
"0.54053766",
"0.54038453",
"0.54002917",
"0.53955597",
"0.53878945",
"0.5384545",
"0.5383862",
"0.53772926",
"0.53770435",
"0.5349264",
"0.534912",
"0.53452015",
"0.5340939",
"0.5340282",
"0.533358",
"0.53319037",
"0.5316948",
"0.53165096",
"0.5313604",
"0.5313035",
"0.5306967",
"0.5306218",
"0.5306218",
"0.5306218",
"0.5306218",
"0.5306218",
"0.5294912",
"0.5282775",
"0.5279047",
"0.5274757",
"0.52719164",
"0.52651167",
"0.52651167",
"0.5258073",
"0.5247516",
"0.5236664",
"0.5236597",
"0.5231855",
"0.52286834",
"0.52213544"
] | 0.0 | -1 |
Writes the position of a kmer in the node where it occurs. | public void put_position(int position, long number) {
ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putInt((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 9), position);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void writeNode() throws IOException {\n // seek to end of file\n file.seek(offset);\n // write offset data\n file.writeLong(offset);\n // write numKeys data\n file.writeLong(numKeys);\n // write children offset\n for (int i = 0; i < children.length; i++){\n file.writeLong(children[i]);\n }\n // write key data\n for (int i = 0; i < keys.length; i++){\n if (keys[i] == null){\n file.writeLong(-1);\n file.writeInt(0);\n }\n else{\n file.writeLong(keys[i].getKey());\n file.writeInt(keys[i].getFrequency());\n }\n }\n\n //The node has been updated -- move it to the front of the cache\n if (cache != null){\n cache.addObject(this);\n }\n\n\n }",
"@Override\n\t\tpublic long getPos() throws IOException {\n\t\t\treturn 0;\n\t\t}",
"void write (char ch, int offset);",
"public Document decoratePosition (Document parseTree);",
"public final long getWritePosition() {\n\t\treturn m_txpos;\n\t}",
"public double getPosition() {\n return spark_encoder.getPosition();\n }",
"@Override\n\t\tpublic void write(DataOutput arg0) throws IOException {\n\t\t\tk.write(arg0);\n\t\t\tv.write(arg0);\n\t\t}",
"public int changeOutput(Pair p, int pos) {\n return 0;\n }",
"public void guardar(PrintWriter writer) {\n writer.println(posX);\n writer.println(posY);\n }",
"public void write(int datum) throws IOException {\n if (!_open)\n return;\n datum &= 0xff;\n long _here = position();\n\n // Are we synced up?\n if (_here == _digestvalidto) {\n\n // Yes, digest the byte and move the valid to pointer.\n _digest.update((byte) datum);\n _digestvalidto++; // JMC: Was missing.\n\n } // Otherwise, advancing of the position will destroy the digest sync.\n\n datum = _head.crypt((byte) datum, _here);\n _backing.write(datum);\n }",
"private MsoSmartArtNodePosition(int value) { this.value = value; }",
"public int getOutputPositionIncrement () { return 1; }",
"@Override\n protected void writeInternal(int index, int value) {\n\n }",
"@Override\n protected void writeInternal(int index, int value) {\n\n }",
"int writerIndex();",
"@Override\n\tpublic void generateSetter(PrintWriter writer)\n\t{\n\t\tgenerateSetter(writer, \"int\", String.format(\"buffer.data[offset+%d] = (byte)value;\", annotation.offset()));\n\t}",
"public void setPos(int pos);",
"public void setPos(int pos);",
"public String getPos(){\r\n\t\t return pos;\r\n\t }",
"public int getPos()\n {\n return pos;\n }",
"public void setPosition(Position<Edge<E>> p) { pos = p; }",
"public int getPos()\n {\n return pos;\n }",
"public String getPos() {\n return this.pos;\n }",
"void setOffsetWorldPosition(double x, double y, double z);",
"protected abstract void writeInternal(int index, int value);",
"public void PositionSet(int position);",
"public long getNodeIndex();",
"public int position() {\n return pos;\n }",
"public void setPosition(Integer position);",
"@Override\n\tpublic void posModify() {\n\t\t\n\t}",
"@Override\n\tpublic void posModify() {\n\t\t\n\t}",
"private void writeKey(K key, int ei) {\n int keySize = keySerializer.calculateSize(key);\n Slice s = memoryManager.allocateSlice(keySize, MemoryManager.Allocate.KEY);\n // byteBuffer.slice() is set so it protects us from the overwrites of the serializer\n keySerializer.serialize(key, s.getByteBuffer().slice());\n\n setEntryFieldInt(ei, OFFSET.KEY_BLOCK, s.getBlockID());\n setEntryFieldInt(ei, OFFSET.KEY_POSITION, s.getByteBuffer().position());\n setEntryFieldInt(ei, OFFSET.KEY_LENGTH, keySize);\n }",
"protected int getMarkerPosition() {\n\t\treturn valueToMarkerPosition(getValue());\n\t}",
"public void dumpPositions() {\r\n \t\ttry {\r\n \t\t\tthis.removePositionCategory(EclipseEditorTag.CHAMELEON_CATEGORY);\r\n \t\t\tthis.addPositionCategory(EclipseEditorTag.CHAMELEON_CATEGORY);\r\n \t\t} catch (BadPositionCategoryException e) {}\r\n \t\t\r\n \t}",
"private static void setWordPosition() {\n\t\tSet setKeys = Utility.vocabHM.keySet();\n\t\tIterator i = setKeys.iterator();\n\t\tint position = 0;\n\t\twhile (i.hasNext()) {\n\t\t\tString w = (String) i.next();\n\t\t\tInteger rows[] = new Integer[2];\n\t\t\trows[0] = new Integer(position); /* word position */\n\t\t\trows[1] = (Integer) Utility.vocabHM.get(w); /* df */\n\n\t\t\tUtility.vocabHM.put(w, rows);\n\t\t\tposition++;\n\t\t}\n\t}",
"@DSSink({DSSinkKind.IO})\n @DSSpec(DSCat.IO)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-09-03 14:59:52.264 -0400\", hash_original_method = \"C10E35B15C5C34D2F11AD8F56A8AFBE7\", hash_generated_method = \"8538DC9FDF04C178771F287DC9084D00\")\n \n@Override\r\n public void write(int idx) throws IOException {\r\n try {\r\n beforeWrite(1);\r\n out.write(idx);\r\n afterWrite(1);\r\n } catch (IOException e) {\r\n handleIOException(e);\r\n }\r\n }",
"@Override\r\n\tpublic void write(IByteBuffer target, long offset) {\n\r\n\t}",
"public void setPosition(int position);",
"public FreeMindWriter position( Posn posn ) {\n if( ! tagOpen ) throw new IllegalStateException( \"Node start element is no longer open\" );\n if( nodeDepth != 2 ) throw new IllegalStateException( \"Position only valid on 2nd level nodes\" );\n\n out.print( \" POSITION='\" + posn.name().toLowerCase() + \"'\" );\n return this; \n }",
"@Override\n\tpublic int getPos() {\n\t\treturn 0;\n\t}",
"public void set(int pos);",
"@Override\n\tpublic void setOffsetBackToFile() {\n\t\tString newXString;\n\t\tString newYString;\n\t\t newXString = String.valueOf(getX().getValueInSpecifiedUnits())+getX().getUserUnit();\n\t newYString = String.valueOf(getY().getValueInSpecifiedUnits())+getY().getUserUnit();\n\t\tjc.getElement().setAttribute(\"x\", newXString);\n\t\tjc.getElement().setAttribute(\"y\", newYString);\n\t\ttry {\n\t\t\tjc.getView().getFrame().writeFile();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} \n\t}",
"public void toIKL(PrintWriter iklout, int offset) {\r\n\t\t//TODO: implement toIKL\r\n\t}",
"public String getPosition(){\r\n\t\treturn position;\r\n\t}",
"@Override\n\tpublic int getPosition() {\n\t\treturn 0;\n\t}",
"public void write(int position, int value) {\n if (isDiskImageMounted()) {\n writeInternal(getPositionIndex(position), value);\n }\n }",
"@Override\n public void modify(PKMonomer monomer) {\n if(this.aminoAcid.equals(\"N/A\"))\n return;\n StructureLoader loader = new AminoAcidStructLoader(this.aminoAcid);\n try {\n IAtomContainer aaMol = loader.loadStructure();\n //Join K in amino acid mol file to the K in the Monomer\n\n IAtom K_monomer=null;\n IAtom N_monomer = null;\n IAtom c_conn_K_monomer=null;\n\n IAtom K_aa=null;\n IAtom L_aa = null;\n IAtom atom_conn_K_aa=null;\n\n for(IAtom atom_monomer : monomer.getMolecule().atoms()) {\n if(atom_monomer.getSymbol().equals(\"K\")) {\n K_monomer = atom_monomer;\n c_conn_K_monomer = monomer.getMolecule().getConnectedAtomsList(atom_monomer).get(0);\n } else if(atom_monomer.getSymbol().equals(\"N\")) {\n N_monomer = atom_monomer;\n }\n }\n\n for(IAtom atom_aa : aaMol.atoms()) {\n if(atom_aa.getSymbol().equals(\"K\")) {\n K_aa = atom_aa;\n atom_conn_K_aa = aaMol.getConnectedAtomsList(atom_aa).get(0);\n } else if(atom_aa instanceof IPseudoAtom && ((IPseudoAtom) atom_aa).getLabel().equals(\"L\")) {\n L_aa = atom_aa;\n }\n }\n\n if(K_aa!=null && K_monomer!=null) {\n IBond c_k_monomer = monomer.getMolecule().getBond(K_monomer,c_conn_K_monomer);\n IBond conn_k_aa = aaMol.getBond(K_aa,atom_conn_K_aa);\n\n c_k_monomer.setOrder(conn_k_aa.getOrder());\n c_k_monomer.setAtom(c_conn_K_monomer,0);\n c_k_monomer.setAtom(atom_conn_K_aa,1);\n\n aaMol.removeAtom(K_aa);\n aaMol.removeBond(conn_k_aa);\n\n monomer.getMolecule().add(aaMol);\n monomer.getMolecule().removeAtom(K_monomer);\n\n //If L is present in the aminoacid, join it with N of the monomer.\n if(L_aa!=null && N_monomer!=null) {\n IBond L_bond = monomer.getMolecule().getConnectedBondsList(L_aa).get(0);\n IAtom atom_conn_L = monomer.getMolecule().getConnectedAtomsList(L_aa).get(0);\n L_bond.setAtom(N_monomer,0);\n L_bond.setAtom(atom_conn_L,1);\n monomer.getMolecule().removeAtom(L_aa);\n }\n }\n\n } catch (Exception e) {\n LOGGER.error(\"Issues when processing monomer:\",e);\n }\n }",
"@Override\n public int getPosition() throws IOException\n {\n return (int) randomAccessRead.getPosition();\n }",
"protected void writeLoc(IPositionable loc)\n\t{\n\t\twriteD(loc.getX());\n\t\twriteD(loc.getY());\n\t\twriteD(loc.getZ());\n\t}",
"public long position() {\n return _pos;\n }",
"public void setPosition(Position pos);",
"public Location getOffset() {\n\t\treturn pos;\n\t}",
"void setOffsetPosition(double x, double y, double z);",
"public void write() {\n\t\tint xDist, yDist;\r\n\t\ttry {\r\n\t\t\tif (Pipes.getPipes().get(0).getX() - b.getX() < 0) { // check if pipes are behind bird\r\n\t\t\t\txDist = Pipes.getPipes().get(1).getX() - b.getX();\r\n\t\t\t\tyDist = Pipes.getPipes().get(1).getY() - b.getY() + Pipes.height;\r\n\t\t\t} else {\r\n\t\t\t\txDist = Pipes.getPipes().get(0).getX() - b.getX();\r\n\t\t\t\tyDist = Pipes.getPipes().get(0).getY() - b.getY() + Pipes.height;\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\txDist = -6969;\r\n\t\t\tyDist = -6969;\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Pipe out of bounds\");\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tFile file = new File(\"DATA.txt\");\r\n\t\t\tFileWriter fr = new FileWriter(file, true);\r\n\t\t\tfr.write(xDist + \",\" + yDist + \",\" + b.getYVel() + \",\" + didJump);\r\n\t\t\tfr.write(System.getProperty(\"line.separator\")); // makes a new line\r\n\t\t\tfr.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Wtrie file error\");\r\n\t\t}\r\n\t}",
"public void setPlayerPosition() throws IOException\r\n\t{\r\n\t\tboolean flag = false;\r\n\t\t\r\n\t\tint X = 0;\r\n\t\tint Y = 0;\r\n\t\t\r\n\t\twhile(flag == false)\r\n\t\t{\r\n\t\t\toStream.writeInt(X);\r\n\t\t\toStream.writeInt(Y);\r\n\t\t\tflag = iStream.readBoolean();\r\n\t\t\tX++;\r\n\t\t\tY++;\r\n\t\t}\r\n\t\tboard.makePlayer(X-1, Y-1);\r\n\t}",
"@Override\n public void write() throws IOException\n {\n super.write();//Chamada para metodo da superclasse ajusta ponteiro para \n //gravacao sequencial apos posicao do ultimo registro\n //gravado\n writeString(id, TOPIC_ID_STRLENGTH);\n writeString(title, TITLE_STRLENGTH);\n writeShort(rank);\n }",
"public void writeThrough(Mention mention) {\n Entity mentionEntity = new Entity(\"chat-mentions\", mention.getId().toString());\n mentionEntity.setProperty(\"uuid\", mention.getId().toString());\n mentionEntity.setProperty(\"userWhoWasMentioned\", mention.getUserWhoWasMentioned().toString());\n mentionEntity.setProperty(\n \"userWhoDidTheMentioning\", mention.getUserWhoDidTheMentioning().toString());\n mentionEntity.setProperty(\"start\", Integer.toString(mention.getStart()));\n mentionEntity.setProperty(\"end\", Integer.toString(mention.getEnd()));\n mentionEntity.setProperty(\"creation_time\", mention.getCreationTime().toString());\n mentionEntity.setProperty(\"messageId\", mention.getMessageId().toString());\n datastore.put(mentionEntity);\n }",
"public int getPosition() {\r\n\t\treturn position;\r\n\t}",
"public int getPosition();",
"void write(IdWriter writer) throws IOException {\n cellRevision.write(writer);\n writer.writeBoolean(modified);\n }",
"private static void readAndWriteNodes(String name) throws IOException {\n System.out.println(name);\n Map<Long, Long> nodeMap = new HashMap<>();\n boolean firstLine = true;\n fileReader = new BufferedReader(new FileReader(PATH + name));\n fileWriter = new BufferedWriter(new FileWriter(PATH + \"/uid/\" + name));\n String line;\n while ((line = fileReader.readLine()) != null) {\n if (!firstLine) {\n long globalId = getGlobalId();\n String[] lineTokens = LINE_TOKEN_SEPARATOR.split(line);\n long ID = Long.parseLong(lineTokens[0]);\n nodeMap.put(ID, globalId);\n String writeLine = \"\";\n for (int i = 0; i < lineTokens.length; i++) {\n if (i == 0) {\n writeLine += globalId;\n } else {\n writeLine += lineTokens[i];\n }\n writeLine += \"|\";\n }\n fileWriter.write(writeLine);\n fileWriter.newLine();\n vertexCount++;\n globalVertexCount++;\n } else {\n fileWriter.write(line);\n fileWriter.newLine();\n firstLine = false;\n }\n }\n fileWriter.close();\n fileReader.close();\n counterMapNodes.put(name, vertexCount);\n vertexCount = 0;\n vertexList.add(nodeMap);\n }",
"public int getPosition()\n\t{\n\t\treturn position;\n\t}",
"void write (String s, int offset);",
"void setPosNr(String posNr);",
"public int getPosition()\r\n {\r\n return position;\r\n }",
"public Vector getSectorPosition(){\n\t\treturn this.sectorPos;\n\t}",
"public int getPositionIncrement() {\n return positionIncrement;\n }",
"@Override\n public long position() throws IOException {\n return _backing.getFilePointer() - _head.offset;\n }",
"void set_marker_position (double p_position) {\n //\n // Ensure the specific value is legal.\n //\n double l_position = Range.clip\n (p_position , SERVO_MARKER_MIN\n , SERVO_MARKER_MAX); // Servo position is restricted to protect from mechanical damage\n\n\n\n //\n // Set the right value.\n //\n if (marker!= null)\n {\n marker.setPosition (l_position);\n }\n\n }",
"public void map(Object key, Text value, Context context)\n\t\t\t\tthrows IOException, InterruptedException {\n\t\t\t\t\n\t\t\tint which_center = 0;\n\t\t\tstringToDoubleArray (value.toString(), dimension, point);\n\n\t\t\t// get the vectors of the k cluster centers \n\t\t\t// emit a key-value pair \n\t\t\t// emitKey : cluster id that the input point belongs to\n\t\t\t// value : the input point and the squared error of the current point \n\t\t\t// with the coses center\n\t\t\t//context.write (emitKey, valudde);\n // TODO\n // ------------------------------------------------------\n //\n // ------------------------------------------------------\n\t\t\temitKey.set (which_center);\n\t\t\tcontext.write (emitKey, emitval);\n\t\t}",
"public void write(int c) throws IOException {\n ensureOpen();\n out.write(c);\n }",
"public int getPosition() {\r\n return position;\r\n }",
"@Override\n protected void map(Text key, Text value, Context context) throws IOException, InterruptedException {\n int runCount = context.getConfiguration().getInt(\"runCount\", 1);\n\n String page = key.toString();\n\n Node node = null;\n if (runCount == 1) {\n node = Node.formatNode(\"1.0\" , value.toString());\n } else {\n node = Node.formatNode(value.toString());\n }\n context.write(new Text(page), new Text(node.toString()));\n if(node.constainsAdjances()){\n double outValue = node.getPageRank() / node.getAdjacentNodeNames().length;\n\n for (String adjacentNodeName : node.getAdjacentNodeNames()) {\n// System.out.println(\"--------------------\"+ adjacentNodeName +\"------\" +outValue);\n\n context.write(new Text(adjacentNodeName),new Text(outValue + \"\"));\n }\n }\n }",
"public void put_pointer(IndexPointer poniter, long number) {\n ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putLong((int) (number * POINTER_LENGTH % ptr_parts_size[0]), poniter.node_id);\n ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].put((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 8), (byte) (poniter.canonical ? 0 : 1));\n ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putInt((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 9), poniter.position);\n ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putLong((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 13), poniter.next_index);\n }",
"public void write(int location, ByteBuffer data)\n throws DataOrderingException;",
"public void outputForGraphviz() {\n\t\tString label = \"\";\n\t\tfor (int j = 0; j <= lastindex; j++) {\n\t\t\tif (j > 0) label += \"|\";\n\t\t\tlabel += \"<p\" + ptrs[j].myname + \">\";\n\t\t\tif (j != lastindex) label += \"|\" + String.valueOf(keys[j+1]);\n\t\t\t// Write out any link now\n\t\t\tBTree.writeOut(myname + \":p\" + ptrs[j].myname + \" -> \" + ptrs[j].myname + \"\\n\");\n\t\t\t// Tell your child to output itself\n\t\t\tptrs[j].outputForGraphviz();\n\t\t}\n\t\t// Write out this node\n\t\tBTree.writeOut(myname + \" [shape=record, label=\\\"\" + label + \"\\\"];\\n\");\n\t}",
"public int getPos();",
"public int getPos();",
"public void exportTo(PrintWriter pw, Animator animator) {\n // 1. write out the info contained in the ancestor\n // note: this ends without a space\n super.exportTo(pw, animator);\n Put put = (Put) animator;\n\n // 2. write out the new cell content\n pw.print(\" entering \\\"\");\n pw.print(PTText.escapeText(put.getContent()));\n\n // 3. write out the cell number\n pw.print(\"\\\" into cell \");\n pw.print(put.getCell());\n\n // 5. write out the used IDs\n int[] IDs = put.exportIDs();\n pw.print(\" using IDs \");\n pw.print(IDs[0]);\n pw.print(\" \");\n pw.println(IDs[1]);\n }",
"public int getPosition() {\n return position;\n }",
"public void write(LineWriter writer) {\n\t\tsuper.write(writer);\n\t\twriter.writeLine(1); // version\n\t}",
"public void writeObject( DataOutput out ) throws IOException {\n boolean sgIO = node instanceof eu.mihosoft.ext.j3d.com.sun.j3d.scenegraph.io.SceneGraphIO;\n out.writeBoolean( sgIO );\n out.writeInt( symbol.nodeID );\n\n\n int nodeClassID = control.getNodeClassID( node );\n\n out.writeShort( nodeClassID );\n\n if (nodeClassID==-1)\n out.writeUTF( nodeClassName );\n\n writeConstructorParams( out );\n\n if (sgIO) {\n ByteArrayOutputStream byteStream = new ByteArrayOutputStream();\n\t DataOutputStream tmpOut = new DataOutputStream( byteStream );\n ((eu.mihosoft.ext.j3d.com.sun.j3d.scenegraph.io.SceneGraphIO)node).writeSceneGraphObject( tmpOut );\n\t tmpOut.close();\n\t out.writeInt( byteStream.size() );\n\t out.write( byteStream.toByteArray() );\n }\n\n writeUserData( out );\n writeString(node.getName(), out);\n\n writeCapabilities( out );\n }",
"public void setOffset(Location value) {\n\t\tgfPos = value;\n\t}",
"public void setNodePositionXY (Point2D position) { n.setXYPositionMap(position); }",
"public int getBlockIndex() {\n return mCursorPosition;\n }",
"public int getMolePosition() {\n return molePosition;\n }",
"@Override\r\n\tpublic void write() {\n\t\t\r\n\t}",
"public void setOffset(ParseTree node, int offset) {\n\t\tthis.offsets.put(node, offset);\n\t}",
"void write();",
"public int getPosition() {\n return position;\n }",
"public int getPosition() {\n return position;\n }",
"public int getPosition() {\n return position;\n }",
"public void seek(long pos) throws IOException {\n raos.seek(pos);\n }",
"public int getSeekIndex() {\n return getIntegerProperty(\"Index\");\n }",
"public long getPosition();",
"void seek(long pos) throws IOException;",
"public static void DumpLocationCoordinatestoKMLRevised(Places places) throws IOException{\n\n String filen = folder_path+\"loc2kmlRevised.txt\";\n File file = new File(filen);\n if (!file.exists()) {\n file.createNewFile();\n }\n BufferedWriter output = new BufferedWriter(new FileWriter(file));\n\n for(int i=0;i<places.places.size();i++){\n LocationCluster locationcls=places.places.get(i);\n output.write(locationcls.placeID+\"~\");\n\n List<UserPhoto> sublist=locationcls.getIdenticalsubLocations();\n if(sublist.size()>2){\n\n for(int j=0;j<sublist.size()-1;j++){\n\n output.write(sublist.get(j).geotag.lat+\",\"+sublist.get(j).geotag.lng);\n if(j<sublist.size()-2){\n output.write(\"|\");\n }\n }\n\n }\n else{\n\n GeoTag center =locationcls.GetCentriod();\n output.write(center.lat+\",\"+center.lng);\n }\n\n\n output.write(\"\\n\");\n\n\n\n\n }\noutput.flush();\n\n }",
"int getChunkIndex();",
"int getChunkIndex();",
"public String getPosition() {\n return position;\n }"
] | [
"0.5440271",
"0.5031121",
"0.49452788",
"0.49257421",
"0.49104542",
"0.4902783",
"0.48734972",
"0.4863322",
"0.48631203",
"0.4786421",
"0.4779338",
"0.4775433",
"0.47462967",
"0.47462967",
"0.47458312",
"0.47427472",
"0.47199395",
"0.47199395",
"0.46746504",
"0.46714658",
"0.46417582",
"0.46229884",
"0.46224463",
"0.4612543",
"0.46089116",
"0.45984674",
"0.45828223",
"0.45824212",
"0.45815814",
"0.45806044",
"0.45806044",
"0.45689073",
"0.4560311",
"0.45578644",
"0.4556518",
"0.4554154",
"0.45514542",
"0.4550709",
"0.45388022",
"0.4531083",
"0.45152432",
"0.45061147",
"0.45050693",
"0.44937956",
"0.44651192",
"0.44636285",
"0.4462454",
"0.44534189",
"0.44499567",
"0.4449696",
"0.44456798",
"0.44446498",
"0.44389385",
"0.44358122",
"0.44355404",
"0.4433506",
"0.4432217",
"0.44266596",
"0.44264498",
"0.442346",
"0.44213802",
"0.44188377",
"0.44146147",
"0.44118088",
"0.4402833",
"0.43971956",
"0.43948734",
"0.43848845",
"0.43836266",
"0.43825117",
"0.43814513",
"0.43798712",
"0.4379508",
"0.43756652",
"0.43718728",
"0.4365112",
"0.4363776",
"0.4363776",
"0.43604505",
"0.43552014",
"0.43516567",
"0.43458286",
"0.43440595",
"0.4342454",
"0.43423626",
"0.43419376",
"0.43379498",
"0.4326971",
"0.43263438",
"0.43243572",
"0.43243572",
"0.43243572",
"0.43158785",
"0.43130028",
"0.43086535",
"0.43075365",
"0.43011415",
"0.43009076",
"0.43009076",
"0.4299807"
] | 0.46023676 | 25 |
Reads the number of the next in the index database. | public long get_next_index(long number) {
return ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getLong((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 13));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int readerIndex();",
"public int nextIndex() {\n\t\t\treturn cursor;\n\t\t}",
"public int next() {\n moveToNextIndex();\n return _hash._set[_index];\n }",
"public int nextIndex() {\n return curIndex;\n }",
"public int nextInt() {\n int temp = results.get(index);\n index = index + 1;\n System.out.println(index);\n return temp;\n }",
"public int getDataIndexAndIncrement() {\n\t\tint x = dataIndex;\n\t\tnext();\n\t\treturn x;\n\t}",
"int getNext(int node_index) {\n\t\treturn m_list_nodes.getField(node_index, 2);\n\t}",
"protected long getRecordNumber() {\n\t\treturn _nextRecordNumber.getAndIncrement();\n\t}",
"public int nextIndex()\n {\n // TODO: implement this method\n return -1;\n }",
"private Optional<Integer> nextReaderIndex() {\n Optional<Integer> index = Optional.absent();\n for (int i = 0; i < callReaders.size(); i++) {\n if (callReaders.get(i).hasNext()) {\n index = Optional.of(i);\n break;\n }\n }\n\n return index;\n }",
"public synchronized int getNext(String key) {\n // Get value from counter map\n Integer nextObject = counters.get(key);\n int next = 0;\n if (nextObject != null) {\n next = nextObject;\n }\n\n // Handle overflows\n int incr = next + 1;\n if (incr < 0) {\n incr = 0;\n }\n\n // Store value for next call\n counters.put(key, incr);\n\n return next;\n }",
"protected abstract int readInternal(int index);",
"public Index next() {\n return Index.valueOf(value + 1);\n }",
"public int GetNewIndex() {\n int count = 0;\n try {\n Statement stmt = Con.createStatement();\n String query = \"SELECT COUNT(qora) AS REGULAR_COUNT FROM dqs_qanda WHERE LENGTH(content) < 2\";\n ResultSet rs = stmt.executeQuery(query);\n while(rs.next()) {\n count = rs.getInt(\"REGULAR_COUNT\");\n }\n }\n catch (Exception e) {\n System.out.println(e.getMessage());\n }\n return count;\n }",
"public int getNext() {\n return value++;\n }",
"@Override\r\n public int nextIndex() {\r\n if (next == null) {\r\n return size; \r\n }\r\n return nextIndex - 1;\r\n }",
"@Override\n public int rowNumber() throws IOException {\n return recordNumber;\n }",
"public int getCurrentNext() {\n\t\tInteger ii = (Integer) get_Value(\"CurrentNext\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}",
"@Override\n\t\tpublic int nextIndex() {\n\t\t\treturn 0;\n\t\t}",
"public int getNbr_read() {\r\n\t\treturn nbrRead;\r\n\t}",
"@Override\n public int nextIndex()\n {\n return idx+1; \n }",
"public int getIndex()\n {\n return getInt(\"Index\");\n }",
"private int nextIndex() {\n return ThreadLocalRandom.current().nextInt(currentIndex, tracks.size());\n }",
"private int next(int index)\n\t{\n\t\tif (index == list.length - 1)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn index + 1;\n\t\t}\n\t}",
"public Integer nextOffset() {\n return this.nextOffset;\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}",
"public abstract long getIndex();",
"public IndexRecord getIteratorNext() {\n iter = (iter == next - 1 ? -1: iter + 1);\n return (iter == -1 ? null : data[iter]);\n }",
"public int getNext() {\n synchronized(this) {\n System.out.println(\"For Value: \" + value);\n value = value + 1;\n return value;\n }\n }",
"public int getSeekIndex() {\n return getIntegerProperty(\"Index\");\n }",
"public long getNextID() throws SQLException {\n\t\tConnection conn = null;\n\t\tPreparedStatement stmt = null;\n\t\t\n\t\ttry {\n\t\t\tconn = getConnection();\n\t\t\tstmt = conn.prepareStatement(\"SELECT Auto_increment FROM information_schema.tables WHERE table_schema = DATABASE()\");\n\t\t\tResultSet rs = stmt.executeQuery();\n\t\t\trs.next();\n\t\t\tlong id = rs.getLong(1);\n\t\t\treturn id;\n\t\t}catch (SQLException e) {\n\t\t\tSystem.out.println(e);\n\t\t\treturn 0;\n\t\t}finally {\n\t\t\tif(conn != null) {\n\t\t\t\tconn.close();\n\t\t\t}\n\t\t\tif(stmt != null) {\n\t\t\t\tstmt.close();\n\t\t\t}\n\t\t}\n\t}",
"private static short findNextIndexNode(\n FileSystem fileSystem, IndexNode indexNode, String name,\n IndexNode nextIndexNode)\n throws Exception {\n if ((indexNode.getMode() & S_IFMT) != S_IFDIR) {\n // return (ENOTDIR) if a needed directory is not a directory\n process.errno = ENOTDIR;\n return -1;\n }\n\n // if user isn't alowed to read directory, give an error\n // ??? tbd\n // return (EACCES) if a needed directory is not readable\n\n FileDescriptor fileDescriptor =\n new FileDescriptor(fileSystem, indexNode, O_RDONLY);\n int fd = open(fileDescriptor);\n if (fd < 0) {\n // process.errno = ???\n return -1;\n }\n\n // create a buffer for reading directory entries\n DirectoryEntry directoryEntry = new DirectoryEntry();\n\n int status = 0;\n short indexNodeNumber = -1;\n // while there are more directory blocks to be read\n while (true) {\n // read a directory entry\n status = readdir(fd, directoryEntry);\n if (status <= 0) {\n // we got to the end of the directory, or \n // encountered an error, so quit\n break;\n }\n if (directoryEntry.getName().equals(name)) {\n indexNodeNumber = directoryEntry.getIno();\n // read the inode block\n fileSystem.readIndexNode(nextIndexNode, indexNodeNumber);\n // we're done searching\n break;\n }\n }\n\n // close the file since we're done with it\n int close_status = close(fd);\n if (close_status < 0) {\n // process.errno = ???\n return -1;\n }\n\n // if we encountered an error reading, return error\n if (status < 0) {\n // process.errno = ???\n return -1;\n }\n\n // if we got to the directory without finding the name, return error\n if (status == 0) {\n process.errno = ENOENT;\n return -1;\n }\n\n // return index node number if success\n return indexNodeNumber;\n }",
"public int getCurrentRowNumber() throws SQLException {\n/* 174 */ return this.currentPositionInEntireResult + 1;\n/* */ }",
"public static Integer next() {\n return incrementingInteger++;\n }",
"private int getIndex() {\n\t\treturn this.index;\r\n\t}",
"static synchronized long getNextSeqNumber() {\n return seqNumber++;\n }",
"public int getIndex() { \n\t\t\treturn currIndex;\n\t\t}",
"private int queryNumberChar() throws IOException {\n\t\tbrin.mark(2);\n\t\treturn brin.read();\n\t}",
"public int getN() {\n return writeResult.getN();\n }",
"public synchronized final int getIndex() {\r\n return f_index;\r\n }",
"public int nextIndex() {\r\n throw new UnsupportedOperationException();\r\n }",
"public synchronized int getSynchronisedNext() {\n value++;\n return value;\n }",
"private int findNextElement() {\n\t\tif (hasNext()) {\n\t\t\tint value = this.index + 1;\n\t\t\treturn value;\n\n\t\t}\n\t\treturn -1;\n\t}",
"public abstract int getSequenceNextVal(String sequenceName, Connection con) throws DBException;",
"public int getNext(){\n synchronized (ThreadSave.class){\n if(value > 0){\n return 1;\n }\n else if (value < 0){\n return -1;\n }\n else\n return value ++;\n }\n\n }",
"public int getIndex() {\r\n return _index;\r\n }",
"public int getIndex() {\r\n return _index;\r\n }",
"public int nextIndex(int i) {\n\t\treturn (i + 1) % data.length;\n\t}",
"@Override\n public Integer next() {\n return query.poll();\n }",
"public int next() {\n\treturn _current < _last ? _data[_current++] : END;\n }",
"int getIndex() {\n\t\treturn index;\n\t}",
"public int getIndex() {\n \t\treturn index;\n \t}",
"private int getLastItemEntryIndex() {\n int sortedCount = this.sortedCount.get();\n int entryIndex = sortedCount == 0 ? HEAD_NODE : (sortedCount - 1) * (FIELDS) + 1;\n int nextEntryIndex = getEntryFieldInt(entryIndex, OFFSET.NEXT);\n while (nextEntryIndex != Chunk.NONE) {\n entryIndex = nextEntryIndex;\n nextEntryIndex = getEntryFieldInt(entryIndex, OFFSET.NEXT);\n }\n return entryIndex;\n }",
"public short getNextNodeID() {\n\t\treturn nodeIdCounter++;\n\t}",
"io.dstore.values.IntegerValue getPageNo();",
"io.dstore.values.IntegerValue getPageNo();",
"public int size() throws IOException {\n return (int) (index.size() / INDEX_BLOCK_LEN);\n }",
"public int nextVersion() {\n int version = 1;\n File symLink = new File(parent + \"/\" + symbolic);\n if (!symLink.exists()) {\n String absPath = null;\n try {\n absPath = symLink.getCanonicalPath();\n } catch (IOException e) {\n LOG.error(\"Can't get canonical path of \" + parent + \"/\" + symbolic, e);\n absPath = symLink.getAbsolutePath();\n }\n String vStr = CacheDirectory.getCacheVersion(absPath);\n try {\n version = Integer.parseInt(vStr) + 1;\n } catch(NumberFormatException e) {\n LOG.error(\"Can't get version number of \" + absPath);\n } \n }\n return version;\n }",
"BigInteger getNumberReturned();",
"int index(){\n\n\t\t\n\t\tif (cursor == null) \n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\treturn index;\n\t}",
"public int read(long addr) {\n\t\treturn findBlock(addr);\n\t}",
"public int read() throws IOException {\n if (!_open)\n return -1;\n long _here = position();\n int val = _backing.read();\n if (val >= 0) {\n val = _head.crypt((byte) val, _here);\n }\n return val;\n }",
"private int doNext() throws IOException {\n int first = 0;\n SirenScorer lastScorer = scorers[scorers.length - 1];\n SirenScorer firstScorer = scorers[first];\n while (more &&\n (firstScorer.entity() < lastScorer.entity() ||\n (firstScorer.entity() == lastScorer.entity() && firstScorer.tuple() < lastScorer.tuple()))) {\n more = (firstScorer.advance(lastScorer.entity(), lastScorer.tuple()) != NO_MORE_DOCS);\n lastScorer = firstScorer;\n first = (first == (scorers.length - 1)) ? 0 : first + 1;\n firstScorer = scorers[first];\n }\n\n // Load occurrences for nextPosition() and score()\n if (more) {\n lastEntity = lastScorer.entity();\n lastTuple = lastScorer.tuple();\n this.loadOccurrences();\n p = 0; // reset pointer\n return lastEntity;\n }\n else {\n lastEntity = lastTuple = Integer.MAX_VALUE; // sentinel value\n return NO_MORE_DOCS;\n }\n }",
"protected final int nextIndex() {\n\t\t\tif ( _expectedSize != TOrderedHashMap.this.size() ) { throw new ConcurrentModificationException(); }\n\n\t\t\tObject[] set = TOrderedHashMap.this._set;\n\t\t\tint i = _index + 1;\n\t\t\twhile (i <= _lastInsertOrderIndex &&\n\t\t\t\t(_indicesByInsertOrder[i] == EMPTY || set[_indicesByInsertOrder[i]] == TObjectHash.FREE || set[_indicesByInsertOrder[i]] == TObjectHash.REMOVED)) {\n\t\t\t\ti++;\n\t\t\t}\n\t\t\treturn i <= _lastInsertOrderIndex ? i : -1;\n\t\t}",
"public long getNextObjectID() {\n return (Long) getProperty(\"nextObjectID\");\n }",
"default int getIndex() {\n return meta(\"nlpcraft:nlp:index\");\n }",
"private static Integer getSeq()throws SQLException{\r\n String selectSql = \"SELECT max(idArt) from Artigo\";\r\n Statement statement = dbConnection.createStatement();\r\n ResultSet rs = statement.executeQuery(selectSql);\r\n int seqIdPe = -1;\r\n if(rs.next()){\r\n seqIdPe = rs.getInt(1);\r\n }\r\n return seqIdPe + 1; \r\n }",
"public int getIndex()\n {\n return index;\n }",
"public Integer getBlockID() {\n this.next_id++;\n return this.next_id;\n }",
"public Integer nextPK() throws DatabaseException {\n log.debug(\"Model nextPK Started\");\n Connection conn = null;\n int pk = 0;\n try {\n conn = JDBCDataSource.getConnection();\n PreparedStatement pstmt = conn\n .prepareStatement(\"SELECT MAX(ID) FROM ST_COURSE\");\n ResultSet rs = pstmt.executeQuery();\n while (rs.next()) {\n pk = rs.getInt(1);\n }\n rs.close();\n\n } catch (Exception e) {\n log.error(\"Database Exception..\", e);\n throw new DatabaseException(\"Exception : Exception in getting PK\");\n } finally {\n JDBCDataSource.closeConnection(conn);\n }\n log.debug(\"Model nextPK End\");\n return pk + 1;\n }",
"public synchronized int getNumRecords() {\n return memIndex.size();\n }",
"public int read() throws IOException {\n/* 173 */ long next = this.pointer + 1L;\n/* 174 */ long pos = readUntil(next);\n/* 175 */ if (pos >= next) {\n/* 176 */ byte[] buf = this.data.get((int)(this.pointer >> 9L));\n/* */ \n/* 178 */ return buf[(int)(this.pointer++ & 0x1FFL)] & 0xFF;\n/* */ } \n/* 180 */ return -1;\n/* */ }",
"protected int readNumRecordsHeader() throws IOException {\n file.seek(NUM_RECORDS_HEADER_LOCATION);\n return file.readInt();\n }",
"public short getIndex()\n {\n return index;\n }",
"public int getNumRows() { return index.size(); }",
"private int getNextIndicator() throws IOException {\n if (this.indicator == 0) {\n this.indicator = in.read();\n }\n return this.indicator;\n }",
"public int read(int addressCode) {\n Integer cacheValue = codes.get(addressCode);\n if(cacheValue != null) return cacheValue.intValue();\n\n int value = current.search(addressCode);\n if(value > -1) return value;\n\n// System.out.println(\"===== > \"+databases.size());\n for(int i = 0; i < databases.size(); i++) {\n// System.out.println(\" doc den database thu i \"+ databases.get(i).getName() + \" : \"+ i);\n if(databases.get(i) == current) continue;\n value = databases.get(i).search(addressCode);\n if(value < 0) continue;\n codes.put(addressCode, value);\n tempSize++;\n return value;\n }\n\n return -1;\n }",
"public Integer getIndex() {\n return index;\n }",
"public int getIndex() {\n\t\treturn this.index;\n\t}",
"public int getIndex() {\r\n \t\t\treturn index;\r\n \t\t}",
"public int get() {\n if(smallestFreeIndex == max) {\n return -1;\n }\n int num = smallestFreeIndex;\n bitset.set(smallestFreeIndex);\n //Only scan for the next free bit, from the previously known smallest free index\n smallestFreeIndex = bitset.nextClearBit(smallestFreeIndex);\n return num;\n }",
"public int getIndex() {\n\t\treturn index;\n\t}",
"public int getIndex() {\n\t\treturn index;\n\t}",
"public int getIndex() {\n\t\treturn index;\n\t}",
"public 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 long getFileIndex()\r\n {\r\n return fileIndex;\r\n }",
"public int getIndex()\n {\n return index;\n }",
"public static int getNumber(RandomAccessFile raf, int i) throws IOException {\n raf.seek(i*4);\n return raf.readInt();\n }",
"public long getReadCounter () {\n\t\treturn readCounter;\n\t}",
"public int nextInt()\r\n\t{\r\n\t\tif(st == null || !st.hasMoreTokens())\r\n\t\t\tnewst();\r\n\t\treturn Integer.parseInt(st.nextToken());\r\n\t}",
"public int nextIndexOf(String identifier){\n Token token;\n int tempCurrentToken = currentToken, result;\n \n nextTokenOf(identifier);\n result = currentToken;\n currentToken = tempCurrentToken;\n return result;\n }",
"public int getIndex() {\n return index;\n }",
"public int getIndex() {\n\t\treturn 0;\n\t}",
"public int getKeyNumber()\r\n {\r\n return number_of_key;\r\n }",
"public int getIndex() {\r\n\t\treturn index;\r\n\t}",
"public int nextOffset(int curr) {\n return curr + 1;\n }",
"public int getIndexNumber(){\n return id;\r\n }",
"public IndexReader getIndexReader() {\n return indexReader;\n }",
"int node(final int index) {\r\n\t\tif (index < (size >> 1)) {\r\n\t\t\tint x = first;\r\n\t\t\tfor (long l = 0; l < index; l++) {\r\n\t\t\t\tx = getNextPointer(x);\r\n\t\t\t}\r\n\t\t\treturn x;\r\n\t\t} else {\r\n\t\t\tint x = last;\r\n\t\t\tfor (int i = size - 1; i > index; i--) {\r\n\t\t\t\tx = getPrevPointer(x);\r\n\t\t\t}\r\n\t\t\treturn x;\r\n\t\t}\r\n\t}",
"public int getIndex(){\r\n \treturn index;\r\n }"
] | [
"0.67619735",
"0.6734448",
"0.6557697",
"0.6450406",
"0.6428978",
"0.6398979",
"0.63732046",
"0.63658047",
"0.631205",
"0.62624276",
"0.6129579",
"0.6129332",
"0.61276287",
"0.60923475",
"0.6089478",
"0.60816056",
"0.6062438",
"0.6023321",
"0.6011853",
"0.5918626",
"0.58896095",
"0.5877165",
"0.584671",
"0.5825843",
"0.581945",
"0.5815461",
"0.57909614",
"0.57650506",
"0.5762124",
"0.57608676",
"0.57450545",
"0.5734284",
"0.57034343",
"0.5696541",
"0.5691621",
"0.5675297",
"0.56739765",
"0.5673055",
"0.56696135",
"0.5665257",
"0.5642714",
"0.5638754",
"0.56374073",
"0.56204355",
"0.5610109",
"0.56033075",
"0.56033075",
"0.5598493",
"0.5593847",
"0.55818903",
"0.5579083",
"0.5572412",
"0.55569285",
"0.554944",
"0.55415046",
"0.55415046",
"0.55328107",
"0.5528192",
"0.552785",
"0.5526613",
"0.5518415",
"0.55161864",
"0.55156034",
"0.5513196",
"0.5507539",
"0.5505625",
"0.55034715",
"0.55021054",
"0.55015206",
"0.5496693",
"0.5493628",
"0.54899985",
"0.5483822",
"0.54796606",
"0.54785264",
"0.5478174",
"0.5476987",
"0.5462318",
"0.5458091",
"0.5457019",
"0.5448006",
"0.5445642",
"0.5445642",
"0.5445642",
"0.5439088",
"0.543815",
"0.5428408",
"0.542468",
"0.5419513",
"0.54174745",
"0.5411976",
"0.54080045",
"0.54035264",
"0.5402517",
"0.5402477",
"0.54005533",
"0.5396601",
"0.53861934",
"0.5383409",
"0.5377104"
] | 0.63818824 | 6 |
Writes the number of the next in the index database. | public void put_next_index(long next_index, long number) {
ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putLong((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 13), next_index);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int nextIndex() {\n return curIndex;\n }",
"public int nextIndex() {\n\t\t\treturn cursor;\n\t\t}",
"@Override\n public int nextIndex()\n {\n return idx+1; \n }",
"public int nextInt() {\n int temp = results.get(index);\n index = index + 1;\n System.out.println(index);\n return temp;\n }",
"int writerIndex();",
"@Override\n\t\tpublic int nextIndex() {\n\t\t\treturn 0;\n\t\t}",
"public void incrementIndex() {\n\t\tindex++;\n\t\tif (nextItem != null) {\n\t\t\tnextItem.incrementIndex();\n\t\t}\n\t}",
"public Index next() {\n return Index.valueOf(value + 1);\n }",
"public int nextIndex()\n {\n // TODO: implement this method\n return -1;\n }",
"public int next() {\n moveToNextIndex();\n return _hash._set[_index];\n }",
"protected long getRecordNumber() {\n\t\treturn _nextRecordNumber.getAndIncrement();\n\t}",
"public int getNext() {\n return value++;\n }",
"public int getDataIndexAndIncrement() {\n\t\tint x = dataIndex;\n\t\tnext();\n\t\treturn x;\n\t}",
"@Override\r\n public int nextIndex() {\r\n if (next == null) {\r\n return size; \r\n }\r\n return nextIndex - 1;\r\n }",
"public short getNextNodeID() {\n\t\treturn nodeIdCounter++;\n\t}",
"protected abstract void writeInternal(int index, int value);",
"private int next(int index)\n\t{\n\t\tif (index == list.length - 1)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn index + 1;\n\t\t}\n\t}",
"public long get_next_index(long number) {\n return ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getLong((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 13));\n }",
"public int nextIndex(int i) {\n\t\treturn (i + 1) % data.length;\n\t}",
"int getNext(int node_index) {\n\t\treturn m_list_nodes.getField(node_index, 2);\n\t}",
"private String nextIndex() {\n return ArrayElement.nameFor(myElements.size());\n }",
"private int nextIndex() {\n return ThreadLocalRandom.current().nextInt(currentIndex, tracks.size());\n }",
"public synchronized void updateCommitNumber()\n\t{\n\t\tm_dbCommitNum++;\n\t}",
"@Override\n protected void writeInternal(int index, int value) {\n\n }",
"@Override\n protected void writeInternal(int index, int value) {\n\n }",
"public synchronized long getNextTransactionID(){\n\t\treturn this.id++;\n\t}",
"public int getNext() {\n synchronized(this) {\n System.out.println(\"For Value: \" + value);\n value = value + 1;\n return value;\n }\n }",
"public int nextIndex() {\r\n throw new UnsupportedOperationException();\r\n }",
"public int getN() {\n return writeResult.getN();\n }",
"protected final int nextIndex() {\n\t\t\tif ( _expectedSize != TOrderedHashMap.this.size() ) { throw new ConcurrentModificationException(); }\n\n\t\t\tObject[] set = TOrderedHashMap.this._set;\n\t\t\tint i = _index + 1;\n\t\t\twhile (i <= _lastInsertOrderIndex &&\n\t\t\t\t(_indicesByInsertOrder[i] == EMPTY || set[_indicesByInsertOrder[i]] == TObjectHash.FREE || set[_indicesByInsertOrder[i]] == TObjectHash.REMOVED)) {\n\t\t\t\ti++;\n\t\t\t}\n\t\t\treturn i <= _lastInsertOrderIndex ? i : -1;\n\t\t}",
"public int nextSerialNumber(){\n serialNumber++;\n return serialNumber;\n }",
"@Override\n\t\tpublic int next() {\n\t\t\treturn current++;\n\t\t}",
"public synchronized int getSynchronisedNext() {\n value++;\n return value;\n }",
"private int increment(int index) {\n\t\treturn (++index < this.capacity) ? index : 0;\n\t}",
"@Override\n public void updateToNextDoc() {\n if(idx < postingList.size())\n idx += postingList.get(idx+1)+2;\n }",
"private long writeFreeList(long nextPageId) throws IgniteCheckedException {\n long curId = 0L;\n long curPage = 0L;\n long curAddr = 0L;\n\n PagesListMetaIO curIo = null;\n\n try {\n for (int bucket = 0; bucket < buckets; bucket++) {\n Stripe[] tails = getBucket(bucket);\n\n if (tails != null) {\n int tailIdx = 0;\n\n while (tailIdx < tails.length) {\n int written = curPage != 0L ?\n curIo.addTails(pageMem.realPageSize(grpId), curAddr, bucket, tails, tailIdx) :\n 0;\n\n if (written == 0) {\n if (nextPageId == 0L) {\n nextPageId = allocatePageNoReuse();\n\n if (curPage != 0L) {\n curIo.setNextMetaPageId(curAddr, nextPageId);\n\n releaseAndClose(curId, curPage, curAddr);\n }\n\n curId = nextPageId;\n curPage = acquirePage(curId, IoStatisticsHolderNoOp.INSTANCE);\n curAddr = writeLock(curId, curPage);\n\n curIo = PagesListMetaIO.VERSIONS.latest();\n\n curIo.initNewPage(curAddr, curId, pageSize(), metrics);\n }\n else {\n releaseAndClose(curId, curPage, curAddr);\n\n curId = nextPageId;\n curPage = acquirePage(curId, IoStatisticsHolderNoOp.INSTANCE);\n curAddr = writeLock(curId, curPage);\n\n curIo = PagesListMetaIO.VERSIONS.forPage(curAddr);\n\n curIo.resetCount(curAddr);\n }\n\n nextPageId = curIo.getNextMetaPageId(curAddr);\n }\n else\n tailIdx += written;\n }\n }\n }\n }\n finally {\n releaseAndClose(curId, curPage, curAddr);\n }\n\n return nextPageId;\n }",
"public void next(){\n\t\tif(generated)\n\t\t\tcurr++;\n\t}",
"public void incrementPacketNumber()\n {\n nextPacketNumber++;\n }",
"static synchronized long getNextSeqNumber() {\n return seqNumber++;\n }",
"public void incrementCurrentIndex() {\n currentIndex++;\n }",
"public void add()\n {\n set(++ current);\n }",
"public int nextVersion() {\n int version = 1;\n File symLink = new File(parent + \"/\" + symbolic);\n if (!symLink.exists()) {\n String absPath = null;\n try {\n absPath = symLink.getCanonicalPath();\n } catch (IOException e) {\n LOG.error(\"Can't get canonical path of \" + parent + \"/\" + symbolic, e);\n absPath = symLink.getAbsolutePath();\n }\n String vStr = CacheDirectory.getCacheVersion(absPath);\n try {\n version = Integer.parseInt(vStr) + 1;\n } catch(NumberFormatException e) {\n LOG.error(\"Can't get version number of \" + absPath);\n } \n }\n return version;\n }",
"public short getIndex()\n {\n return index;\n }",
"public void increaseNonce() {\n this.index++;\n }",
"public void inc(){\n this.current += 1;\n }",
"public void increment() {\n this.data++;\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 }",
"public void Next(int key){\n\t\tNode res;\n\t\tif(search(key)!=nil){\n\t\t\tres = getNext(root,key,nil);\n\t\t}else{\n\t\t\tint next = findNext(root,key);\n\t\t\tres = getNode(root,next);\n\t\t}\n\t\t\n\t\tif(res != nil){\n\t\t\tSystem.out.println( res.id + \" \" + res.count);\n\t\t}else{\n\t\t\tSystem.out.println(\"0 0\");\n\t\t}\n\t}",
"public int getIndex() { \n\t\t\treturn currIndex;\n\t\t}",
"public static Integer next() {\n return incrementingInteger++;\n }",
"public int getSeekIndex() {\n return getIntegerProperty(\"Index\");\n }",
"public long getNextID() throws SQLException {\n\t\tConnection conn = null;\n\t\tPreparedStatement stmt = null;\n\t\t\n\t\ttry {\n\t\t\tconn = getConnection();\n\t\t\tstmt = conn.prepareStatement(\"SELECT Auto_increment FROM information_schema.tables WHERE table_schema = DATABASE()\");\n\t\t\tResultSet rs = stmt.executeQuery();\n\t\t\trs.next();\n\t\t\tlong id = rs.getLong(1);\n\t\t\treturn id;\n\t\t}catch (SQLException e) {\n\t\t\tSystem.out.println(e);\n\t\t\treturn 0;\n\t\t}finally {\n\t\t\tif(conn != null) {\n\t\t\t\tconn.close();\n\t\t\t}\n\t\t\tif(stmt != null) {\n\t\t\t\tstmt.close();\n\t\t\t}\n\t\t}\n\t}",
"public long inc(final String key) {\n String c = get(key);\n if (c == null) c = \"0\";\n final long l = Long.parseLong(c) + 1;\n put(key, Long.toString(l));\n return l;\n }",
"@Override\n\tpublic String getNextOrderNumber() {\n\t\t// TODO Auto-generated method stub\n\t\treturn \"ORD\"+sequenceNumberDao.findNextSequenceType(ESequenceType.ORDER);\n\t}",
"public int GetNewIndex() {\n int count = 0;\n try {\n Statement stmt = Con.createStatement();\n String query = \"SELECT COUNT(qora) AS REGULAR_COUNT FROM dqs_qanda WHERE LENGTH(content) < 2\";\n ResultSet rs = stmt.executeQuery(query);\n while(rs.next()) {\n count = rs.getInt(\"REGULAR_COUNT\");\n }\n }\n catch (Exception e) {\n System.out.println(e.getMessage());\n }\n return count;\n }",
"public synchronized int getNext(String key) {\n // Get value from counter map\n Integer nextObject = counters.get(key);\n int next = 0;\n if (nextObject != null) {\n next = nextObject;\n }\n\n // Handle overflows\n int incr = next + 1;\n if (incr < 0) {\n incr = 0;\n }\n\n // Store value for next call\n counters.put(key, incr);\n\n return next;\n }",
"static synchronized int nextID() {\n\t\treturn g_nID++;\n\t}",
"private int getNextSessionID() {\n\t\treturn sessionNum++;\n\t}",
"public int getNext(){\n synchronized (ThreadSave.class){\n if(value > 0){\n return 1;\n }\n else if (value < 0){\n return -1;\n }\n else\n return value ++;\n }\n\n }",
"public int promoteVersion() {\n return dbVersion.incrementAndGet();\n }",
"public int getIndex() {\r\n return _index;\r\n }",
"public int getIndex() {\r\n return _index;\r\n }",
"public int next() {\n\treturn _current < _last ? _data[_current++] : END;\n }",
"private int getNext(int index) {\n return index + (index & -index);\n }",
"public int nextOffset(int curr) {\n return curr + 1;\n }",
"protected void txPut(int n) {}",
"public int getIndex() {\n \t\treturn index;\n \t}",
"public abstract void write(int rowCount) throws IOException;",
"long getNextSequenceNumber();",
"public int getNextFieldIndex () {\n return labelStart;\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 }",
"private synchronized long nextId() {\n\t\treturn ++curID;\n\t}",
"public int getIndex() { return this.index; }",
"public void commit () throws IOException {\n log.info(\"Internal committing index ... \");\n this.writer().commit();\n commitCounter = 0;\n this.closeReader();\n }",
"public int getIndexNumber(){\n return id;\r\n }",
"public int getIndex(){\r\n \treturn index;\r\n }",
"public String getNextId() {\n while (!this.isIdFree(this.nextId)) {\n this.nextId += 1;\n }\n return Integer.toString(this.nextId);\n }",
"protected abstract void write( int value ) throws IOException;",
"public int counter (){\n return currentID;\n }",
"public String getNextId() {\n while (!isIdFree(this.nextId)) {\n this.nextId += 1;\n }\n return Integer.toString(this.nextId);\n }",
"public int getIndex()\n {\n return index;\n }",
"private synchronized void increment() {\n count++;\n atomicInteger.incrementAndGet();\n }",
"int readerIndex();",
"private static int nextID() {\r\n\t\treturn ID++;\r\n\t}",
"public int getNextVersion() {\n return emlVersion + 1;\n }",
"public int getIndex(){\n\t\treturn index;\n\t}",
"public int getIndex(){\n\t\treturn index;\n\t}",
"public int getIndex(){\n\t\treturn index;\n\t}",
"int getIndex() {\n\t\treturn index;\n\t}",
"public Integer nextOffset() {\n return this.nextOffset;\n }",
"public void inc(int index) {\r\n\t\tthis.vclock.set(index, this.vclock.get(index)+1);\r\n\t}",
"@Override\n protected void writeAttributes(XMLStreamWriter out)\n throws XMLStreamException {\n super.writeAttributes(out);\n \n out.writeAttribute(\"nextID\", Integer.toString(nextID));\n }",
"public void increment() {\n sync.increment();\n }",
"public int getNextUnSafeSequence(){ return value++;}",
"private int getIndex() {\n\t\treturn this.index;\r\n\t}",
"public abstract long getIndex();",
"public int getIndex() {\n return index;\n }",
"public int nextValue() {\n\t\tint temp = counter;\n\t\tcounter++;\n\t\treturn temp;\n\t}",
"@Override\n public int rowNumber() throws IOException {\n return recordNumber;\n }",
"public int getIndex() {\r\n \t\t\treturn index;\r\n \t\t}"
] | [
"0.63619393",
"0.63564724",
"0.6288477",
"0.6170552",
"0.61421925",
"0.61151737",
"0.6089959",
"0.60428286",
"0.6028428",
"0.5974196",
"0.5963869",
"0.5954834",
"0.591055",
"0.5903457",
"0.58556443",
"0.5797945",
"0.5763323",
"0.57574713",
"0.5750152",
"0.5683381",
"0.5657187",
"0.5638902",
"0.55729353",
"0.5566439",
"0.5566439",
"0.55207336",
"0.54818726",
"0.54697305",
"0.54670525",
"0.54581046",
"0.545736",
"0.5454432",
"0.5453086",
"0.5439971",
"0.5417807",
"0.5409752",
"0.53861463",
"0.5382056",
"0.5377329",
"0.53485763",
"0.53449494",
"0.5338682",
"0.53125507",
"0.5304049",
"0.5295191",
"0.52881175",
"0.5275291",
"0.5275175",
"0.5274589",
"0.52657294",
"0.52609026",
"0.5259987",
"0.5256127",
"0.52514416",
"0.52301383",
"0.5228483",
"0.5220447",
"0.5214814",
"0.52115244",
"0.52022165",
"0.5196269",
"0.5196269",
"0.5196059",
"0.519432",
"0.51868623",
"0.51845956",
"0.51795244",
"0.5177499",
"0.51662046",
"0.5156556",
"0.5154669",
"0.51516587",
"0.515099",
"0.514941",
"0.51414865",
"0.514051",
"0.51385826",
"0.5137959",
"0.5136015",
"0.5134206",
"0.51262766",
"0.51217157",
"0.51189196",
"0.51153946",
"0.5114365",
"0.5099204",
"0.5099204",
"0.5099204",
"0.5098525",
"0.5088772",
"0.50866264",
"0.5084961",
"0.5083302",
"0.5083201",
"0.5081397",
"0.5081074",
"0.5075693",
"0.5069482",
"0.5067429",
"0.50655675"
] | 0.6461711 | 0 |
Finds the number of a kmer in the database. | public long find(kmer k_mer) {
long low, mid, high;
int j, comp;
low = prefix_ptr[k_mer.prefix];
if (k_mer.prefix == prefix_ptr.length - 1) {
high = kmers_num - 1;
} else {
high = prefix_ptr[k_mer.prefix + 1] - 1;
}
while (low <= high) {
mid = (low + high) / 2;
j = (int) (mid * suf_rec_size / suf_parts_size[0]);
suf_buff[j].position((int) (mid * suf_rec_size % suf_parts_size[0]));
suf_buff[j].get(key.suffix, 0, suf_len / 4);
comp = k_mer.compare_suffix(key);
if (comp == -1) {
high = mid - 1;
} else if (comp == 1) {
low = mid + 1;
} else {
return mid;
}
}
return -1L; // not found
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic int kyunggicount() throws Exception {\n\t\treturn dao.kyunggicount();\n\t}",
"int findCount();",
"public int getGameNumber() {\n\t\tint result = -1;\n\t\ttry {\n\t\t\tthis.rs = smt.executeQuery(\"SELECT count(id) FROM tp.gamerecord\");\n\t\t\tif(this.rs.next()) {\n\t\t\t\tresult = rs.getInt(1);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"Query is Failed!\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}",
"@Override\n\tpublic int kyungsangcount() throws Exception {\n\t\treturn dao.kyungsangcount();\n\t}",
"public static int getCountofPeople(){\n int training_set = 0;\n \n try (Connection con = DriverManager.getConnection(url, user, password)){\n String query = \"SELECT count(*) FROM \"+DATABASE_NAME+\".People;\";\n Statement st = con.createStatement();\n ResultSet rs = st.executeQuery(query);\n if (rs.next()) {\n training_set = rs.getInt(1);\n }\n con.close();\n }catch (SQLException ex) {\n ex.printStackTrace();\n } \n\n return training_set;\n }",
"public int getHeuristic(){\n\t\tint count = 0;\n\t\tfor (int i = 0; i < getRows(); i++) {\n\t\t\tfor (int j = 0; j < getColumns(); j++) {\n\t\t\t\tif (cells[i][j].getSand() != getK()) \n\t\t\t\t\tcount++;\n\t\t\t}\n\t\t} \n\t\treturn count;\n\t}",
"public int find(String key){\n\tint spotCheck = hashIt(key);\n\tfor(int b = 0; b <= theTable.length; b++){\n\t /** System.out.println(\"b + spotCheck: \" + (b + spotCheck));\n\t System.out.println(\"(b + spotCheck) % theTable.length: \" + ((b + spotCheck) % theTable.length));\n\t System.out.println(\"theTable.length: \" + theTable.length);\n\t */\n\t if(theTable[(b + spotCheck) % theTable.length] != null){\n\t\tif(theTable[(b + spotCheck) % theTable.length].getKey().toLowerCase().equals(key)){\n\t\t theTable[(b + spotCheck) % theTable.length].incrCount();\n\t\t return (b + spotCheck) % theTable.length;\n\t\t}\n\t }\n\n\t}\n\treturn -1;\n\t\t\n }",
"public int findKthNumber(int m, int n, int k) {\n int low = 1, high = m * n + 1, mid;\n\n while (low < high) {\n mid = low + ((high - low) >> 1);\n if (count(mid, m, n) >= k) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }",
"public int getNumberFound() {\n return numberFound;\n }",
"int getBlockNumbersCount();",
"public int getK() {\n\t\treturn k;\n\t}",
"@Override\r\n\tpublic int findtotalbooks() {\n\t\t\r\n\t\tString sql=\"select count(*) from books where tag=1\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\tObject query = runner.query(sql, new ScalarHandler<Object>(1));\r\n\t\t\tLong long1=(Long)query;\r\n\t\t\treturn long1.intValue();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn 0;\r\n\t}",
"public int getSkoreCount() {\n \tString countQuery = \"SELECT * FROM \" + \"skore\";\n \tSQLiteDatabase db = this.getReadableDatabase();\n \tCursor cursor = db.rawQuery(countQuery, null);\n \tint count = cursor.getCount(); //added line here\n \t\n \tcursor.close(); \t\n \tdb.close();\n \t\n \treturn count;\n }",
"public int getMnth() throws Exception \n\t{\n\t\tint m=0;\n\t\ttry(Connection connection = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/usersdb?useTimezone=true&serverTimezone=UTC\", \"root\", \"123\");\n\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(\"SELECT month FROM usersdb.bills WHERE clients_username = ?;\"))\n\t\t{\n\t\t\tpreparedStatement.setString(1,username);\n\t\t\tResultSet result = preparedStatement.executeQuery();\n\t\t\t\n\t\t\twhile(result.next()) \n\t\t\t{\n\t\t\t\tif (month==result.getInt(\"month\")) \n\t\t\t\t{\n\t\t\t\t\tm = result.getInt(\"month\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(SQLException e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn m;\n\t}",
"@Override\n\tpublic int koreacount() throws Exception {\n\t\treturn dao.koreacount();\n\t}",
"public int getK() {\n\t\treturn K; \n\t}",
"Object getNumberMatched();",
"public int numberOfKnightsIn() { // numero di cavalieri a tavola\n \n return numeroCompl;\n }",
"public int getK() {\r\n\t\treturn this.k;\r\n\t}",
"public long length() {\n return kmers_num;\n }",
"@Override\n\tpublic int kangwoncount() throws Exception {\n\t\treturn dao.kangwoncount();\n\t}",
"BigInteger getNumberReturned();",
"BigInteger getNumRegistro();",
"BigInteger getCount();",
"public int rank() throws MPJException {\n\n IbisIdentifier id = MPJ.getMyId();\n if (this.table != null) {\n for (int i = 0; i < this.table.size(); i++) {\n IbisIdentifier a = this.table.elementAt(i);\n if (a.equals(id)) {\n return (i);\n }\n }\n }\n\n return (MPJ.UNDEFINED);\n }",
"public int getKeyNumber()\r\n {\r\n return number_of_key;\r\n }",
"public int calculerKgsNourritureParJour(){\r\n\t\treturn noms.size() * 10;\r\n\t}",
"public int findTotalPapersWithVariants() throws DAOException;",
"@Override\r\n\tpublic int findNum(int state) {\n\t\treturn sqlSessionTemplate.selectOne(typeNameSpace + \".findNum\", state);\r\n\t}",
"int getBlockNumsCount();",
"int getBlockNumsCount();",
"private Integer getNoOfOccurences(String key) {\n\t\ttry {\n\t\t\tif (key != null && key.trim().length() > 0){\n\t\t\t\tInteger noOfOccurences = DataLoader.data.get(key.toString().trim().toLowerCase());\n\t\t\t\tif(noOfOccurences != null)\n\t\t\t\t\treturn noOfOccurences;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn 0;\n\t}",
"public int getKMSelanjutnya(){\n\t\treturn (getDistance() - N * 1000) * costPerKm / 1000;\n\t}",
"public static long findNb(long m) {\n\n long res = -1, i = 0, sum = 0;\n\n while (sum < m) {\n\n i++;\n sum += i * i * i;\n\n if (sum == m) {\n res = i;\n break;\n }\n }\n\n return res;\n }",
"public static int getCandidateNumber(String query, String Package) {\r\n\t\tConnection conn = null;\r\n\t\tint i=0;\r\n\t\ttry {\r\n\t\t\tconn = ConnectDB.getConnection();\r\n\t\t\ttry (PreparedStatement ps = conn.prepareStatement(query)) {\r\n\t\t\t\tps.setString(1, Package);\r\n\t\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\t\twhile (rs.next()) {\r\n\t\t\t\t\ti = (rs.getInt(1));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tif (conn != null)\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn i;\r\n\t}",
"public static int getNforNgram(){\r\n\t\tString path = \"conf/ngram.txt\"; \r\n\t\tint res = 0;\r\n\t\tArrayList<String> words = TextFile.getLines(path);\r\n\t\tString s = words.get(0);\r\n\t\tres = Integer.valueOf(s);\r\n\t\treturn res;\r\n\t}",
"public int getMountainCount() {\n\t\tcounter = 0;\n\t\tfor (int row = 0; row < battlefield.length; row++) {\n\t\t\tfor (int column = 0; column < battlefield[row].length; column++) {\n\t\t\t\tif (battlefield[row][column].getTerrain().getIcon() == \"M\") {\n\t\t\t\t\tcounter++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn counter;\n\t}",
"long countNumberOfProductsInDatabase();",
"@Override\r\n\tpublic Long getPlantNameCount(String name) {\n\t\tIterator<Object> iterator = null;\r\n\t\tLong i = 0l;\r\n\t\ttry {\r\n\t\t\tsql = \"select count(*) from Plant p where p.plantName='\" + name\r\n\t\t\t\t\t+ \"'\";\r\n\t\t\tList<Object> list = getHibernateTemplate().find(sql);\r\n\t\t\titerator = list.iterator();\r\n\r\n\t\t\twhile (iterator.hasNext()) {\r\n\t\t\t\tObject object = (Object) iterator.next();\r\n\t\t\t\ti = (Long) object;\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn i;\r\n\t}",
"public int searchTotals(int meetid, int diverid){\n int id = 0;\n SQLiteDatabase db = this.getReadableDatabase();\n String selectQuery = \"SELECT dive_count from dive_total \"\n + \" WHERE meet_id = \" + meetid\n + \" AND diver_id = \" + diverid;\n Cursor c = db.rawQuery(selectQuery, null);\n\n if (c != null && c.getCount()>0 && c.moveToFirst()){\n do{\n id = c.getInt(0); //getKeyId();\n }while (c.moveToNext());\n }\n if (c != null) {\n c.close();\n }\n db.close();\n return id;\n }",
"public int getCount()\r\n {\r\n int answer=0;\r\n answer+=recCount(root);\r\n return answer;\r\n }",
"public int findTotalPapers() throws DAOException;",
"public int getMembreCount() {\n try {\n// CriteriaQuery cq = entManager.getCriteriaBuilder().createQuery();\n// Root<Membre> rt = cq.from(Membre.class);\n// cq.select(entManager.getCriteriaBuilder().count(rt));\n// Query q = entManager.createQuery(cq);\n// return ((Long) q.getSingleResult()).intValue();\n \n Query q = entManager.createNamedQuery(\"Membre.findAll\");\n return q.getResultList().size();\n \n } finally {\n// em.close();\n }\n }",
"public static int getNumber(String query);",
"public int getRecCnt (String where) {\n Vector result = db.select (\"count(*)\",TABLE, where);\n Vector row = (Vector) result.elementAt(0);\n return (new Integer((String) row.elementAt(0)).intValue());\n }",
"public int anzahlRundenziel() {\n // TODO: eine Seite aufsetzen mit Informationen zur Datenbank\n // TODO: Anzahl der Einträge pro Tabelle\n int nReturn = 0;\n final Cursor c = mDb.getReadableDatabase().rawQuery(\n \"select count(*) from \" + RundenZielTbl.TABLE_NAME,\n null);\n if (!c.moveToFirst()) {\n Log.d(TAG, \"anzahlRundenziel(): Kein Rundenziel gespeichert\");\n nReturn = 0;\n } else {\n nReturn = c.getInt(0);\n }\n c.close();\n return nReturn;\n }",
"@Override\n\tpublic int countBySoKU(String soKU) {\n\t\tsoKU = Objects.toString(soKU, \"\");\n\n\t\tFinderPath finderPath = _finderPathCountBySoKU;\n\n\t\tObject[] finderArgs = new Object[] {soKU};\n\n\t\tLong count = (Long)finderCache.getResult(finderPath, finderArgs, this);\n\n\t\tif (count == null) {\n\t\t\tStringBundler query = new StringBundler(2);\n\n\t\t\tquery.append(_SQL_COUNT_PHATVAY_WHERE);\n\n\t\t\tboolean bindSoKU = false;\n\n\t\t\tif (soKU.isEmpty()) {\n\t\t\t\tquery.append(_FINDER_COLUMN_SOKU_SOKU_3);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbindSoKU = true;\n\n\t\t\t\tquery.append(_FINDER_COLUMN_SOKU_SOKU_2);\n\t\t\t}\n\n\t\t\tString sql = query.toString();\n\n\t\t\tSession session = null;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\tQuery q = session.createQuery(sql);\n\n\t\t\t\tQueryPos qPos = QueryPos.getInstance(q);\n\n\t\t\t\tif (bindSoKU) {\n\t\t\t\t\tqPos.add(soKU);\n\t\t\t\t}\n\n\t\t\t\tcount = (Long)q.uniqueResult();\n\n\t\t\t\tfinderCache.putResult(finderPath, finderArgs, count);\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tfinderCache.removeResult(finderPath, finderArgs);\n\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\treturn count.intValue();\n\t}",
"@Override\r\n\tpublic int maxNum() throws Exception {\n\t\treturn session.selectOne(\"com.mapper.cook.maxNum\");\r\n\t}",
"int getEducationsCount();",
"@Override\n public int findRoomsSize() throws AppException {\n log.info(\"#findRoomsSize\");\n Connection con = null;\n Statement st;\n ResultSet rs;\n int size = 0;\n try {\n con = DataSource.getConnection();\n st = con.createStatement();\n rs = st.executeQuery(FIND_SIZE);\n if (rs.next()) {\n size = rs.getInt(1);\n }\n } catch (SQLException e) {\n rollback(con);\n log.error(\"Problem findRooms\");\n throw new AppException(\"Cannot find rooms, try again\");\n } finally {\n close(con);\n }\n log.info(\"size = \" + size);\n return size;\n }",
"Integer countForKey(String key);",
"public int countOfKnownWord() {\n\t\tint count = 0;\t\t\n\t\ttry {\n \t\t\tClass.forName(DRIVER);\n \t\t} catch (ClassNotFoundException e1) {\n \t\t\t// TODO Auto-generated catch block\n \t\t\te1.printStackTrace();\n \t\t}\t\t\n\t\ttry ( Connection con = DriverManager.getConnection(URL, USER, PW)) {\n\t\t\tStatement stmt = con.createStatement();\n\t\t\tString sql;\n\t\t\tsql = \"SELECT count(*) countWordLevel from \" + tbl_USER_DIC + \" WHERE \" + Constants.FLD_KNOW + \" = \" + Constants.WORD_KNOWN + \";\";\n\t\t\tResultSet rs = stmt.executeQuery(sql);\n\t\t\twhile (rs.next()) {\n\t\t\t\tcount = rs.getInt(\"countWordLevel\");\n\t\t\t}\n\t\t\t\n\t stmt.close();\n\t con.close();\n\t\t} catch(Exception e) {\n\t\t\tlogger.info(\"fail to open mysql\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn count;\t\n\t}",
"int getNumHar();",
"public int numberOfOccorrence();",
"public int rank(K key);",
"public long getPersonesCount()throws personNotFoundExeption{\n EntityManager em = emf.createEntityManager();\n try{\n long personesCount = (long)em.createQuery(\"SELECT COUNT(p) FROM Person p\").getSingleResult();\n return personesCount;\n }finally{ \n em.close();\n }\n }",
"public static long findNum(long m) {\n if (m > 0 && m < Long.MAX_VALUE) {\n /**\n * Algo:\n *\n * (1 pow 3) = 1 ---> this will be the case, if input \"m\" is 1 (then result \"n\" = 1)\n * (2 pow 3) + (1 pow 3) = 9 ---> if input \"m\" is 9 (then result \"n\" = 2)\n * (3 pow 3) + (2 pow 3) + (1 pow 3) = 36 ---> if input \"m\" is 36 (then result \"n\" = 3)\n * (4 pow 3) + (3 pow 3) + (2 pow 3) + (1 pow 3) = 100 ---> if input \"m\" is 100 (then result \"n\" = 4)\n *\n *\n * Let's start with counter i = 1;\n * calculate m - (i pow 3), then if result is 0 then n = i\n *\n * Example, consider m = 9,\n * store m in some variable ---> result = 9\n * calculate result - (1 pow 3) = 8, then return i if result = 0, if not increment i\n * calculate result - (2 pow 3) = 0, then return i if result = 0, if not increment i\n *\n * continue this loop until result = 0, in any step if result < 0, then exit from loop and return -1\n */\n\n long result = m;\n for (int i = 1; i < Integer.MAX_VALUE; i++) {\n result = result - ((long) Math.pow(i, 3));\n if (result < 0) {\n break;\n } else if (result == 0) {\n return i;\n }\n }\n\n }\n return -1;\n }",
"public int getFirstKDigitNumber(int[] digits, int k) \r\n\t{\r\n\t\tint count = 0;\r\n\t\tfor(int i = 0; i < k; i++)\r\n\t\t{\r\n\t\t\tcount *= 10;\r\n\t\t\tcount += digits[i];\r\n\t\t}\r\n\r\n\t\treturn count;\r\n\t}",
"public int m2710k() {\n return ((Integer) this.f2439a.m2666a(ea.aW)).intValue();\n }",
"public int getRanking(){\n int spelerID = Integer.valueOf(spelerIDField.getText());\n int ranking=0;\n try {\n Connection con = Main.getConnection();\n PreparedStatement st = con.prepareStatement(\"SELECT ranking FROM Spelers WHERE idcode = ?\");\n st.setInt(1, spelerID);\n ResultSet rs= st.executeQuery();\n if(rs.next()) {\n return rs.getInt(\"ranking\");\n }\n }catch(Exception e) {\n System.out.println(e);\n }\n return ranking;\n }",
"public static int GetKIDFromWord(String word)\n\t{\n\t\tint kid = -1; \n\t\ttry\n\t\t{\n\t\t\tConnector con = new Connector();\n\t\t\tString query = \"SELECT k_id FROM Keywords WHERE word = '\"+word+\"'\"; \n\t\t\tResultSet inTable = con.stmt.executeQuery(query); \n\t\t\t\n\t\t\t//keyword is already in table, get kid of word\n\t\t\tif(inTable.next())\n\t\t\t{\n\t\t\t\tkid = inTable.getInt(\"k_id\"); \n\t\t\t} \n\t\t\t\n\t\t\tcon.closeConnection();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage()); \n\t\t}\n\t\treturn kid; \n\t}",
"public int getSoupKitchenCount() {\n\n MapSqlParameterSource params = new MapSqlParameterSource();\n //here we want to get total from food pantry table\n String sql = \"SELECT COUNT(*) FROM cs6400_sp17_team073.Soup_kitchen\";\n\n Integer skcount = jdbc.queryForObject(sql,params,Integer.class);\n\n return skcount;\n }",
"public int getNumberOfEntries();",
"@Override\n\tpublic Integer getTotalNum(String hql) {\n\t\treturn super.findTotleNum(hql);\n\t}",
"public int getNumberOfMeds() {\n return medications.size();\n }",
"@Override\r\n\tpublic int getGeunTaeCnt(HashMap<String, String> params) {\n\t\treturn sqlsession.selectOne(\"GeuntaeMgnt.getGeunTaeCnt\",params);\r\n\t}",
"public static int getNrReservas() {\r\n\t\tint reservas = 0;\r\n\t\tString sql=\"select count(*) as reservas from reserva;\";\r\n\r\n\t\ttry {\r\n\t\t\tConnection conn=singleton.getConnector().getConnection();\r\n\t\t\tPreparedStatement stat=conn.prepareStatement(sql);\r\n\t\t\tResultSet utils=stat.executeQuery();\r\n\t\t\twhile(utils.next()) {\r\n\t\t\t\treservas = utils.getInt(\"reservas\");\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn reservas;\r\n\t}",
"long getUsesCount(K key);",
"int getClusteringKeyCount();",
"public int findNet(String name) {\r\n if (name.indexOf(\" \") > 0) {\r\n int k = Integer.valueOf(name.substring(name.indexOf(\" \") + 1));\r\n for (int i = 0; i < models.size(); i++) {\r\n if (getModel(i) != null) {\r\n if (getModel(i).getName().compareTo(name.substring(0, name.indexOf(\" \"))) == 0) {\r\n if (k-- == 0) {\r\n return i;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n /*\r\n * //todo FIXME inkonzistentne spravanie\r\n * Ak mame iba jeden model, tak ho necislujeme a nasledujuci kod je v poriadku\r\n * Ak mame viacero modelov (ensemble) tak nasledujuci for-cyklus vrati prvu najdenu siet\r\n * s danym menom, t.j. nakde siet s 'menom' \"NAME 0\"\r\n */\r\n for (int i = 0; i < models.size(); i++) {\r\n if (getModel(i) != null) {\r\n if (getModel(i).getName().compareTo(name) == 0) { //the same name\r\n return i;\r\n }\r\n }\r\n }\r\n return -1; //search failed\r\n }",
"long getMaxItemFindings();",
"private int findOne(int bankNumber) {\n\t\tfor (int i=0;i<bankDb.size();i++) {\n\t\t\tBankModel model = bankDb.get(i);\n\t\t\tif (model.getBankNumber()==bankNumber) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -7;\n\t}",
"static int printCount(Node root, int k) {\n\t\tHashMap<Integer, Integer> p = new HashMap<>();\n\n\t\t// Function call\n\t\tk_paths(root, k, p, 0);\n\n\t\t// Return the required answer\n\t\treturn res;\n\t}",
"int getNumberOfInfantry();",
"private int getRecordsCount(final HtmlPage resultPage) {\n if (resultPage == null) {\n return 0;\n }\n \n DomElement countElement = resultPage.getElementById(\"K66\");\n if (countElement == null) {\n return 0;\n }\n \n return Integer.parseInt(countElement.getTextContent().replaceAll(\"[^0-9]\", \"\"), 10);\n }",
"protected int countDistractors(double concentration) {\n int count = 0;\n for (FamilyMember fm : family) {\n if (fm.isRandomPlayer()) {\n continue;\n }\n //localized num of monkeys in 40\n double localDensity = getAnimalsWithIn(AnimalType.MONKEY, 40, fm.getLocation()).size();\n if (localDensity / numMonkeys > concentration) {\n count++;\n }\n }\n return count;\n }",
"public int getNumOfMatchedBets();",
"public Integer getClusterNum(Integer key)\n{\n return NPchains.get(key);\n}",
"protected int queryNum(int id, String key) {\n Trace.info(\"RM::queryNum(\" + id + \", \" + key + \") called\" );\n ReservableItem curObj = (ReservableItem) readData( id, key);\n int value = 0; \n if ( curObj != null ) {\n value = curObj.getCount();\n } // else\n Trace.info(\"RM::queryNum(\" + id + \", \" + key + \") returns count=\" + value);\n return value;\n }",
"int getBouncesNumber() throws SQLException;",
"public String getPremierNumeroLibre() {\n\t\tString requete_s = \"SELECT id from LIVRES\";\n\t\tint i = 0;\n\t\tboolean egalite = true;\n\t\t\n\t\ttry{\n\t\t\trequete.execute(requete_s);\n\t\t\t\n\t\t\tResultSet rs = requete.getResultSet();\n\t\t\t\n\t\t\tdo{\n\t\t\t\ti++;\n\t\t\t\trs.next();\n\t\t\t\tegalite = (i ==((Integer) rs.getObject(1)));\n\t\t\t}while(egalite);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString s = \"\" + i;\n\t\t\n\t\treturn s;\n\t}",
"public int entier() {\n int nb = 1;\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n\n String url = \"jdbc:mysql://localhost:3306/gestionconvo\";\n try {\n Connection con = DriverManager.getConnection(url, \"root\", \"\");\n Statement st = con.createStatement();\n\n ResultSet rs = st.executeQuery(\"Select Id_sal from salle\");\n\n while (rs.next()) {\n if (nb == rs.getInt(\"Id_sal\")) {\n nb++;\n }\n }\n\n rs.close();\n st.close();\n con.close();\n\n } catch (SQLException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n } catch (ClassNotFoundException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n return nb;\n }",
"@Override\n\tpublic int countByMaCTV(String maCTV) {\n\t\tmaCTV = Objects.toString(maCTV, \"\");\n\n\t\tFinderPath finderPath = _finderPathCountByMaCTV;\n\n\t\tObject[] finderArgs = new Object[] {maCTV};\n\n\t\tLong count = (Long)finderCache.getResult(finderPath, finderArgs, this);\n\n\t\tif (count == null) {\n\t\t\tStringBundler query = new StringBundler(2);\n\n\t\t\tquery.append(_SQL_COUNT_PHATVAY_WHERE);\n\n\t\t\tboolean bindMaCTV = false;\n\n\t\t\tif (maCTV.isEmpty()) {\n\t\t\t\tquery.append(_FINDER_COLUMN_MACTV_MACTV_3);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbindMaCTV = true;\n\n\t\t\t\tquery.append(_FINDER_COLUMN_MACTV_MACTV_2);\n\t\t\t}\n\n\t\t\tString sql = query.toString();\n\n\t\t\tSession session = null;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\tQuery q = session.createQuery(sql);\n\n\t\t\t\tQueryPos qPos = QueryPos.getInstance(q);\n\n\t\t\t\tif (bindMaCTV) {\n\t\t\t\t\tqPos.add(maCTV);\n\t\t\t\t}\n\n\t\t\t\tcount = (Long)q.uniqueResult();\n\n\t\t\t\tfinderCache.putResult(finderPath, finderArgs, count);\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tfinderCache.removeResult(finderPath, finderArgs);\n\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\treturn count.intValue();\n\t}",
"private int getKeyLength() {\n MongoCursor<Document> cursor = this.keystoreCollection.find(eq(\"conf\", \"homomorphic-keylength\")).iterator();\n\n int keyLength = 2048; // Default value is 2048 bits\n while (cursor.hasNext()) {\n keyLength = cursor.next().getDouble(\"keylength\").intValue();\n }\n return keyLength;\n }",
"private int nobValue() {\n int numberOfCards= cards.length;\n int nValue = 0;\n \n for (int i = 0; i < numberOfCards - 1; i++) {\n char cardRank = cards[i].charAt(0);\n char cardSuit = cards[i].charAt(1);\n char startSuit = cards[numberOfCards - 1].charAt(1);\n \n if (cardRank=='J'&&cardSuit == startSuit) {\n nValue += 1;\n }\n } \n return nValue;\n }",
"int getUniquesNumber() throws SQLException;",
"public static int getNumberOfStudent(int ringId) {\n\r\n String sql = \"select count(studentId) from Student where ringId = ?\";\r\n System.out.println(ringId);\r\n Connection conn = DB.connect();\r\n PreparedStatement st;\r\n ResultSet rs;\r\n try {\r\n st = conn.prepareStatement(sql);\r\n st.setInt(1, ringId);\r\n rs = st.executeQuery();\r\n\r\n if (rs.next()) {\r\n return rs.getInt(\"count(studentId)\");\r\n } else {\r\n return -1;\r\n }\r\n } catch (SQLException ex) {\r\n Logger.getLogger(User.class.getName()).log(Level.SEVERE, null, ex);\r\n return -1;\r\n }\r\n\r\n }",
"int getInCount();",
"public int knightWithJugIn() {\n \n return knightsBefore.car();\n }",
"public int digitCounts(int k, int n) {\n\n\n int count = 0;\n char kChar = (char)(k + '0');\n for (int i = k; i <= n; i++) {\n char[] iChars = Integer.toString(i).toCharArray();\n for (char iChar : iChars) {\n if (kChar == iChar) count++;\n }\n }\n\n return count;\n }",
"public int GetNewIndex() {\n int count = 0;\n try {\n Statement stmt = Con.createStatement();\n String query = \"SELECT COUNT(qora) AS REGULAR_COUNT FROM dqs_qanda WHERE LENGTH(content) < 2\";\n ResultSet rs = stmt.executeQuery(query);\n while(rs.next()) {\n count = rs.getInt(\"REGULAR_COUNT\");\n }\n }\n catch (Exception e) {\n System.out.println(e.getMessage());\n }\n return count;\n }",
"public int getKerning(char first, char second) {\n Map toMap = (Map) ansiKerning.get(Integer.valueOf(first));\n if (toMap == null) {\n return 0;\n }\n\n Integer kerning = (Integer) toMap.get(Integer.valueOf(second));\n if (kerning == null) {\n return 0;\n }\n\n return Math.round(convertUnitToEm(size, kerning.intValue()));\n }",
"public int getMilkWeight(T key);",
"public int getKOfCV(ArrayList<String[]> records){\n\t\tString[] firstLine=records.get(0);\n\t\treturn Integer.parseInt(firstLine[0]);\n\t}",
"public int digitCounts(int k, int n) {\n int result = 0;\n for (int i = 1; i <= n; i++) {\n String nStr = String.valueOf(i);\n for (int j = 0; j < nStr.length(); j++) {\n if (nStr.charAt(j) == Character.forDigit(k, 10)) {\n result++;\n }\n }\n\n }\n return result;\n }",
"public static int getRecordNum(IQueryResult queryResult) {\r\n Map<String, List<IRecord>> allRecords = queryResult.getRecords();\r\n int n = 0;\r\n for (List<IRecord> values : allRecords.values()) {\r\n n += values.size();\r\n }\r\n return n;\r\n }",
"public int digitCounts(int k, int n) {\n\n int result = 0;\n int base = 1;\n while (n/base > 0) {\n\n int cur = (n/base)%10;\n int low = n-(n/base) * base;;\n int high = n/(base * 10);\n\n if (cur < k)\n {\n result += high*base;\n }\n else if (cur > k)\n {\n result += (high+1)*base;\n }\n else\n {\n result += high*base+low+1;\n }\n\n base *= 10;\n }\n\n return result;\n }",
"public int get_count();",
"public int digitCounts(int k, int n) {\n if (k <= 0 || n < 0) {\n return 0;\n }\n if (n == 0) {\n return 1;\n }\n// int res=0;\n ArrayList<Integer> arrayList = new ArrayList<>();\n for (int i = 0; i <= k; i++) {\n\n if ((i + \"\").indexOf(n + \"\") != -1) {\n arrayList.add(i);\n }\n }\n System.out.println(Arrays.asList(arrayList) + \" have \" + (arrayList.toString().length() - arrayList.toString().replace(n + \"\", \"\").length()) + \" n ( n = \" + n + \" )\");\n return arrayList.size();\n }",
"public int numberOfEntries();"
] | [
"0.6262294",
"0.58835995",
"0.5881908",
"0.58721864",
"0.58371335",
"0.5814007",
"0.5782743",
"0.576411",
"0.5756135",
"0.57305574",
"0.5727463",
"0.56991273",
"0.56938446",
"0.56742764",
"0.56727284",
"0.56649613",
"0.5641435",
"0.5596346",
"0.55801004",
"0.55749923",
"0.55742395",
"0.5573917",
"0.5550099",
"0.5541888",
"0.55211645",
"0.5504533",
"0.55011725",
"0.54968107",
"0.5494653",
"0.5488854",
"0.5488854",
"0.5471455",
"0.54616386",
"0.5452138",
"0.54382503",
"0.5433795",
"0.54236525",
"0.54225993",
"0.5412418",
"0.5409634",
"0.54048663",
"0.54008853",
"0.5395299",
"0.53922707",
"0.5390547",
"0.5381088",
"0.53754807",
"0.5375257",
"0.5373767",
"0.53570354",
"0.534316",
"0.5342625",
"0.5338268",
"0.5324834",
"0.5320963",
"0.531576",
"0.53092855",
"0.5301183",
"0.52999336",
"0.5291333",
"0.5288858",
"0.52860224",
"0.528391",
"0.52811867",
"0.5268602",
"0.52624214",
"0.5260662",
"0.5260465",
"0.5259501",
"0.5259211",
"0.525868",
"0.52575547",
"0.5239222",
"0.5238566",
"0.523418",
"0.5233694",
"0.5232153",
"0.52306974",
"0.5230439",
"0.52277213",
"0.52268285",
"0.5226212",
"0.5221531",
"0.52188146",
"0.52182996",
"0.5211668",
"0.52099466",
"0.52043027",
"0.5199374",
"0.5193252",
"0.5182966",
"0.51818347",
"0.5181476",
"0.51716197",
"0.5169212",
"0.5165638",
"0.5163792",
"0.5160961",
"0.5160602",
"0.5155173"
] | 0.65575945 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.