query
stringlengths 8
1.54M
| document
stringlengths 9
312k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Returns a newly instantiated SlidesConfig class that contains path to the image directory, path to the sound files, selection of manual or automatic change, and if automatic is selected, the interval of change. | public SlidesConfig getSlidesConfig()
{
String slidesFolder = folderPathTextField;
if (slidesFolder.trim().isEmpty()) {
slidesFolder = null;
}
String[] soundFiles = wavComponent.getElements().stream().map(SelectableElement::getData).toArray(String[]::new);
boolean manualChange = manualChangeRadioButton.isSelected();
int slideIntervalSeconds = (Integer)intervalInSecondsSpinner.getValue();
String[] slidesFileList = slideComponent.getElements().stream().map(SelectableElement::getData).toArray(String[]::new);
SlideEffect[] slidesEffectList = slideComponent.getElements().stream().map(ImageWithEffectThumbnail::getSlideEffect).toArray(SlideEffect[]::new);
return new SlidesConfig(slidesFolder, slidesFileList, slidesEffectList, soundFiles, manualChange, slideIntervalSeconds);
} | [
"public PictureConfig getConfig() {\n return config;\n }",
"public StepConfig getConfig() {\n StepConfig stepConfig = new StepConfig();\n stepConfig.setEnableTickCallback(true);\n stepConfig.setRunningPeriodicDelay(5);//10 Seconds\n stepConfig.setMonitorEnabledForStep(true);\n stepConfig.setRunningPeriodicDelayUnit(TimeUnit.SECONDS);\n stepConfig.setMonitorEmmitTimeout(10);\n return stepConfig;\n }",
"private VibrationConfig getConfig() {\n if (mVibrationConfig == null) {\n Resources resources = mResources;\n if (resources == null) {\n final Context ctx = ActivityThread.currentActivityThread().getSystemContext();\n resources = ctx != null ? ctx.getResources() : null;\n }\n // This might be constructed more than once, but it only loads static config data from a\n // xml file, so it would be ok.\n mVibrationConfig = new VibrationConfig(resources);\n }\n return mVibrationConfig;\n }",
"protected DrawableConfigurationInterface getConfig() {\n return config;\n }",
"public IProjectConfiguration getConfiguration()\n {\n return new ProjectConfiguration(mProject, mCheckConfigs, mFileSets, mFilters,\n mUseSimpleConfig);\n }",
"public static ConfigControl config() {\r\n\t\treturn ConfigControl.conf;\r\n\t}",
"private static Configuration getConfig() {\n Configuration vgConfig = new Configuration();\n vgConfig.addBrowser(1200, 800, BrowserType.CHROME);\n vgConfig.addBrowser(1200, 800, BrowserType.FIREFOX);\n vgConfig.addBrowser(1200, 800, BrowserType.EDGE);\n vgConfig.addBrowser(1200, 800, BrowserType.SAFARI);\n vgConfig.addDeviceEmulation(DeviceName.iPhone_X, ScreenOrientation.PORTRAIT);\n return vgConfig;\n }",
"protected static Config getDefaultConfig() {\n return new Config() {{\n bounds = new BoundsWrapper() {{\n value = new CenterDef() {{\n centerLat = 48.401;\n centerLon = 11.738;\n extent = 8.0;\n unit = Unit.KM;\n }};\n }};\n relief = new ReliefWrapper() {{\n value = new SrtmDef() {{\n heightScale = \"1.0\";\n }};\n }};\n texture = new TextureWrapper() {{\n value = new OsmDef() {{\n colors = ColorDef.getDefaults();\n entities = EntityDef.getDefaults();\n }};\n }};\n }};\n }",
"public SoundConfiguration getSoundConfiguration()\n {\n return this.soundConfiguration;\n }",
"public interface IGameConfigurator {\n\t/**\n\t * Called on game start. Might allow the player to choose\n\t * difficulty and other values.\n\t * \n\t * @return The newly constructed configuration object.\n\t */\n\tConfig getConfig();\n}",
"public Config getConfig();",
"@Override\n public AlgoConfig getConfig() {\n AlgoConfig algoConfig = new AlgoConfig();\n algoConfig.setEnableTickCallback(true);\n algoConfig.setRunningPeriodicDelay(1000);//1 sec\n algoConfig.setInitMonitorCollector(true);\n algoConfig.setMonitorReportReleaseTimeout(10);\n return algoConfig;\n }",
"public interface CalibrationConfig {\n\tfinal static int DEFAULT_CALIBRATION_START_TIME = 1,\n\t\t\tDEFAULT_CALIBRATION_END_TIME = 24;\n\tfinal static String BSE_CONFIG_MODULE_NAME = \"bse\",\n\t\t\tCONSTANT_LEFT_TURN = \"constantLeftTurn\";\n\tfinal static String PARAM_NAME_INDEX = \"parameterName_\",\n\t\t\tPARAM_STDDEV_INDEX = \"paramStddev_\";\n}",
"public Slide() {\r\n\t\tthis.title = \"NewSlide\";\r\n\t\tthis.imageFileName = \"\";\r\n\t\tthis.slideType = SlideType.NORMAL;\r\n\t\tthis.actionChoices = new ArrayList<>();\r\n\t\tthis.gameText = \"\";\r\n\t\tgameOver = false;\r\n\t}",
"public Config(){\n loadProperties(PROPERTIESFILES);\n }",
"static Config getInstance() {\n if (instance == null) {\n instance = new Config();\n }\n return instance;\n }",
"public Config createConfig(String filename);",
"Config newCfg(Path p);",
"public static PhotoConfiguration readConfiguration( String pathToApplication ) throws PhotoException {\r\n\r\n\t\tif (log.isDebugEnabled())\r\n\t\t\tlog.debug(\"Attempting to read internal configuration\"); //$NON-NLS-1$\r\n\t\t\r\n\t\tFile file = getInternalConfigurationFile(pathToApplication);\r\n\t\tif (!file.exists()) {\r\n\t\t\tlog.error(PhotoConstants.FILE_NOT_FOUND_ERROR+\", \"+file.getName());\r\n\t\t\tthrow new PhotoException(PhotoConstants.FILE_NOT_FOUND_ERROR);\r\n\t\t}\r\n\t\t\r\n\t\t// Internal configuration\r\n\t\tPhotoConfiguration config = new PhotoConfiguration();\r\n\t\tPropertiesConfiguration configFile = null;\r\n\t\ttry {\r\n\t\t\tconfigFile = new PropertiesConfiguration(file);\r\n\t\t} catch (ConfigurationException e) {\r\n\t\t\tlog.error(\"Error reading internal properties\");\r\n\t\t\tthrow new PhotoException(PhotoConstants.CONFIG_IO_ERROR);\r\n\t\t}\r\n\t\t\r\n\t\tconfig.pathToApplication = pathToApplication;\r\n\t\t\r\n\t\tString pathToImages = configFile.getString(PhotoConfigurationConstants.PATH_TO_IMAGES_KEY);\r\n\t\tif (pathToImages != null)\r\n\t\t\tconfig.pathToImages = pathToImages;\r\n\t\t\r\n\t\tString photoFactoryClass = configFile.getString(PhotoConfigurationConstants.PHOTO_FILE_FACTORY_CLASS_NAME_KEY);\r\n\t\tif (photoFactoryClass != null)\r\n\t\t\tconfig.photoFactoryClass = photoFactoryClass;\r\n\t\t\r\n\t\tString photoUserFactoryClass = configFile.getString(PhotoConfigurationConstants.PHOTO_USER_FACTORY_CLASS_NAME_KEY);\r\n\t\tif (photoUserFactoryClass != null)\r\n\t\t\tconfig.photoUserFactoryClass = photoUserFactoryClass;\r\n\r\n\t\tif (config.photoUserFactoryClass.endsWith(\"JDBCPhotoUserFactory\")) {\r\n\t\t\tString jdbcConnectionURL = configFile.getString(PhotoConfigurationConstants.JDBC_CONNECTION_URL_KEY);\r\n\t\t\tif (jdbcConnectionURL != null)\r\n\t\t\t\tconfig.jdbcConnectionURL = jdbcConnectionURL;\r\n\t\t\t\t\t\t\r\n\t\t\tString jdbcDriverName = configFile.getString(PhotoConfigurationConstants.JDBC_DRIVER_KEY);\r\n\t\t\tif (jdbcDriverName != null)\r\n\t\t\t\tconfig.jdbcDriverName = jdbcDriverName;\r\n\t\t\t\t\r\n\t\t\tString jdbcLogin = configFile.getString(PhotoConfigurationConstants.DATABASE_LOGIN_KEY);\r\n\t\t\tif (jdbcLogin != null)\r\n\t\t\t\tconfig.jdbcLogin = jdbcLogin;\r\n\t\t\t\t\t\t\r\n\t\t\tString jdbcPassword = configFile.getString(PhotoConfigurationConstants.DATABASE_PASSWORD_KEY);\r\n\t\t\tif (jdbcPassword != null)\r\n\t\t\t\tconfig.jdbcPassword = jdbcPassword;\r\n\t\t} \r\n\t\t\r\n\t\treadInternalConfiguration(config);\r\n\t\treturn config;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test of setMotor method, of class Motorization. | @Test
public void testSetMotor() {
System.out.println("setMotor");
String motor = "GE CF6-80C2B1F";
Motorization instance = new Motorization();
instance.setMotor(motor);
} | [
"void setMotor(Motor motor);",
"@Test\n public void testSetMotorType() {\n System.out.println(\"setMotorType\");\n String motorType = \"swzrsdfxhb\";\n Motorization instance = new Motorization();\n instance.setMotorType(motorType);\n\n }",
"@Test\n public void testSetMotor_type() {\n System.out.println(\"setMotor_type\");\n String motor_type = \"turbofan\";\n Motorization instance = new Motorization();\n instance.setMotorType(motor_type);\n }",
"@Test\n public void testSetNumberMotors() {\n System.out.println(\"setNumberMotors\");\n int numberMotors = 10;\n Motorization instance = new Motorization();\n instance.setNumberMotors(numberMotors);\n }",
"@Test\n public void testSetNumber_motors() {\n System.out.println(\"setNumber_motors\");\n int number_motors = 10;\n Motorization instance = new Motorization();\n instance.setNumberMotors(number_motors);\n }",
"@Override\n public void setMotorType(MotorConfigurationType motorType) {\n\n }",
"Motor() {\n\t\tthis.potencia = 200;\n\t\tthis.consumoEnergia = 50;\n\t\tthis.peso = 100;\n\t\tthis.turbo = 2;\n\t}",
"@Test\n public void testSetCruise_speed() {\n System.out.println(\"setCruise_speed\");\n double cruise_speed =80.0;\n Motorization instance = new Motorization();\n instance.setCruise_speed(cruise_speed);\n }",
"@Test\n public void testSetCruise_speed_() {\n System.out.println(\"setCruise_speed_\");\n String cruise_speed = \"0.84 M\";\n Motorization instance = new Motorization();\n instance.setCruise_speed_(cruise_speed);\n }",
"@Test\n public void testGetMotorType() {\n System.out.println(\"getMotorType\");\n Motorization instance = new Motorization();\n String expResult = \"stdhf\";\n instance.setMotorType(expResult);\n String result = instance.getMotorType();\n assertEquals(expResult, result);\n }",
"public MotorControl() {\n leftMotor = new Jaguar(Constants.LEFT_MOTOR);\n leftMotor.setInverted(false);\n rightMotor = new Jaguar(Constants.RIGHT_MOTOR);\n rightMotor.setInverted(false);\n\n servo = new Servo(Constants.SERVO);\n\n spikeMotor = new Relay(Constants.SPIKE_MOTOR);\n\n rangeFinder = new AnalogInput(Constants.RANGE_FINDER);\n\n limitSwitch = new DigitalInput(Constants.LIMIT_SWITCH);\n\n }",
"Motor getMotor();",
"void setMotorsMode(DcMotor.RunMode runMode);",
"@Test\n public void testSetTorque() {\n System.out.println(\"setTorque\");\n double torque = 95.0;\n Regime instance = r1;\n instance.setTorque(torque);\n double result=instance.getTorque();\n double expResult=95.0;\n assertEquals(expResult, result, 0.0);\n }",
"void setMotorOutput(double output);",
"@Test\n\tpublic void testSetVehicle() {\n\t\tSystem.out.println(\"setVehicle\");\n\t\tString result = \"vehicle\";\n this.step.setVehicle(result);\n\t\tassertEquals(this.step.getVehicle(), result);\n\t}",
"@Override\n public void setMotorPower(double power)\n {\n final String funcName = \"setMotorPower\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API, \"value=%f\", power);\n }\n\n if (power != currPower)\n {\n motor.set(power);\n currPower = power;\n }\n\n if (debugEnabled)\n {\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API, \"! (value=%f)\", power);\n }\n }",
"void enableMotor();",
"@Test\n public void testGetNumberMotors() {\n System.out.println(\"getNumberMotors\");\n Motorization instance = new Motorization();\n int expResult = 10;\n instance.setNumberMotors(expResult);\n int result = instance.getNumberMotors();\n assertEquals(expResult, result);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the layout of the footer frame | public void createFooterLayout(List<Node> elements) {
footerFrame = new BorderPane();
Label currentKeg = (Label) elements.get(0);
Button adminSettings = (Button) elements.get(1);
StackPane headerStack = new StackPane();
adminSettings.setGraphic(images.get("settings"));
adminSettings.setBackground(Background.EMPTY);
headerStack.getChildren().addAll(images.get("footerheader"), adminSettings);
StackPane.setAlignment(adminSettings, Pos.CENTER_RIGHT);
StackPane.setMargin(adminSettings, new Insets(0, 15, 0, 0));
currentKeg.getStyleClass().add("data-labels");
footerFrame.getStyleClass().addAll("all-frames", "footer-frame");
footerFrame.setPrefWidth(1190);
footerFrame.setMaxWidth(1190);
footerFrame.setTop(headerStack);
footerFrame.setLeft(currentKeg);
footerFrame.setRight(images.get("teralogo"));
BorderPane.setAlignment(currentKeg, Pos.BOTTOM_LEFT);
BorderPane.setMargin(currentKeg, new Insets(5, 0, 0, 14));
BorderPane.setAlignment(images.get("teralogo"), Pos.BOTTOM_RIGHT);
BorderPane.setMargin(images.get("teralogo"), new Insets(5, 0, 15, 0));
} | [
"private void createFooter() {\n okButton = new JButton(new OKAction());\n JPanel footerPanel = new JPanel(new MigLayout(\"fill, insets 0 15 10 15\"));\n footerPanel.add(okButton, \"alignx right, aligny bottom, split, tag ok\");\n footerPanel.add(new JButton(new CancelAction()), \"aligny bottom, tag cancel\");\n footerPanel.setBackground(backgroundColor);\n \n add(footerPanel, \"grow, south\");\n }",
"private void createSouthPanel() {\n FooterPanel footer = new FooterPanel(this);\n add(footer, BorderLayout.SOUTH);\n }",
"protected abstract void createFooterButtons(HorizontalLayout footerButtons);",
"private JPanel createFooterButtons() {\n GridLayout layout = new GridLayout(1,2);\n layout.setHgap(10);\n JPanel footer = new JPanel(layout);\n footer.add(okButton);\n footer.add(cancelButton);\n\n return footer;\n }",
"private void createMainMenuFooterComposite() {\n\n\t\tGridData gridData22 = new GridData();\n\t\tgridData22.horizontalAlignment = GridData.BEGINNING;\n\t\tgridData22.verticalAlignment = GridData.END;\n\t\tGridData gridData2 = new GridData();\n\t\tgridData2.grabExcessHorizontalSpace = true;\n\t\tgridData2.grabExcessVerticalSpace = true;\n\t\tgridData2.verticalAlignment = GridData.END;\n\t\tgridData2.heightHint = 75;\n\t\tgridData2.widthHint = 75;\n\t\tgridData2.horizontalAlignment = GridData.END;\n\n\t\tGridLayout gridLayout2 = new GridLayout();\n\t\tgridLayout2.horizontalSpacing = 30;\n\t\tgridLayout2.marginHeight = 20;\n\t\tgridLayout2.numColumns = 2;\n\t\tgridLayout2.marginWidth = 20;\n\n\t\tGridData gridData = new GridData();\n\t\tgridData.grabExcessHorizontalSpace = true;\n\t\tgridData.verticalAlignment = GridData.END;\n\t\tgridData.heightHint = 150;\n\t\tgridData.horizontalAlignment = GridData.FILL;\n\t\tmainMenuFooterComposite = new Composite(this, SWT.NONE);\n\t\tmainMenuFooterComposite.setBackground(new Color(Display.getCurrent(),\n\t\t\t\t255, 255, 255));\n\t\tmainMenuFooterComposite.setLayout(gridLayout2);\n\t\tmainMenuFooterComposite.setLayoutData(gridData);\n\n\t\tlblBallyCopyright = new CbctlLabel(mainMenuFooterComposite, SWT.NONE);\n\t\tlblBallyCopyright.setText(LabelLoader.getLabelValue(LabelKeyConstants.BALLY_COPYRIGHT_LABEL));\n\t\tlblBallyCopyright.setLayoutData(gridData22);\n\t\tlblBallyCopyright.setFont(new Font(Display.getDefault(), \"Arial\", 8, SWT.NORMAL));\n\t\tbtnExit = new CbctlButton(mainMenuFooterComposite, SWT.NONE, \"\",\n\t\t\t\tLabelKeyConstants.EXIT_BUTTON);\n\t\tbtnExit.setImage(new Image(Display.getCurrent(), getClass()\n\t\t\t\t.getResourceAsStream(imgExitBtn)));\n\t\tbtnExit.setLayoutData(gridData2);\n\t}",
"public void setupFooterView() {\n\t\t\tcheckCustomContentView();\n\t\t\tactivity.findViewById(R.id.custom_footer).setVisibility(View.VISIBLE);\n\t\t\tFrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mContentView.getLayoutParams();\n\t\t\tint b = (int) activity.getResources().getDimension(R.dimen.footer_height);\n\t\t\tlp.bottomMargin = b;\n\t\t\tmContentView.setLayoutParams(lp);\n\t\t\t\n\t\t}",
"private void layoutBottom(){\t\n\t\tbottom = new JPanel();\n\t\tbottom.setBackground(Color.white);\n\t\t/*create JLabel and JTextField for Transaction Amount\n\t\t * and Customer Balance input from CustomerAccount */\n\t\ttransAmountLabel = new JLabel(\"Amount of Transaction:\");\n\t\tbottom.add(transAmountLabel);\n\t\ttransactionField = new JTextField(10);//from CustomerAccount\n\t\ttransactionField.setEditable(false);\n\t\tbottom.add(transactionField);\t\n\t\tcurrBalanceLabel = new JLabel(\"Current Balance:£ \");\n\t\tbottom.add(currBalanceLabel);\n\t\tcurrbalanceField = new JTextField\n\t\t\t\t(\"\"+ customerObject.getInitBalance(),10);//from CustomerAccount\n\t\tcurrbalanceField.setEditable(false);\n\t\tbottom.add(currbalanceField);\n\t\t//add the bottom panel to the content pane\n\t\tadd(bottom,BorderLayout.SOUTH);\n\t}",
"int getFooterLayoutId();",
"protected Widget addFooter() {\n return null;\n }",
"private VBox footerVBox() {\n VBox footer = new VBox();\n // Back button for turning back to the main menu\n Button btnBack = new Button(\"Back\");\n // Setting the size of the button\n btnBack.setPrefSize(VBOX_WIDTH, 35);\n btnBack.setStyle(\"-fx-text-fill:white; -fx-background-color:\" + BUTTON_COLOR);\n // Turning back to the main menu when clicking to the back button\n btnBack.setOnAction(e -> mainMenu());\n footer.getChildren().add(btnBack);\n // Setting its size\n footer.setPrefWidth(VBOX_WIDTH);\n // Setting its position\n footer.setAlignment(Pos.BOTTOM_CENTER);\n // Giving space for VBox\n footer.setPadding(new Insets(0, 0, 10, 0));\n footer.setSpacing(25);\n return footer;\n }",
"private JPanel createBottomPanel() {\n JPanel bottomPanel = new JPanel(new GridBagLayout());\n bottomPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\n\n GridBagConstraints bottomConstraints = new GridBagConstraints();\n\n JButton cancelButton = new JButton(Translator.localize(\"argopdf.dialog.tab.general.button.cancel\"));\n bottomConstraints.fill = GridBagConstraints.NONE;\n bottomConstraints.weightx = 0.0;\n bottomConstraints.insets = new Insets(3, 5, 3, 0);\n bottomPanel.add(cancelButton, bottomConstraints);\n cancelButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n closeDialog();\n }\n });\n\n bottomConstraints.weightx = 1.0;\n bottomConstraints.fill = GridBagConstraints.NONE;\n bottomConstraints.anchor = GridBagConstraints.EAST;\n bottomConstraints.insets = new Insets(3, 5, 3, 0);\n JButton generateButton = new JButton(Translator.localize(\"argopdf.dialog.tab.general.button.generate\"));\n bottomPanel.add(generateButton, bottomConstraints);\n generateButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n \n IReport report = new PdfReport();\n setOptions(report);\n String result = report.generateReport();\n if(result != null) {\n JOptionPane.showMessageDialog(ArgoPDFDialog.this, result);\n return;\n }\n\n JOptionPane.showMessageDialog(ArgoPDFDialog.this, Translator.localize(\"argopdf.report.message.report.generated\"));\n\n closeDialog();\n }\n\n private void setOptions(IReport report) {\n report.setPath(pathField.getText());\n report.setTitle(title.getText());\n report.setAuthor(author.getText());\n report.setLogoPath(logoPath.getText());\n\n report.setGenerateTitlePage(generateTitlePage.isSelected());\n //report.setGenerateTableOfContents(generateToC.isSelected());\n report.setGenerateDiagrams(generateDiagrams.isSelected());\n report.setTree(tree);\n }\n });\n\n return bottomPanel;\n }",
"protected View getBottomLayout() {\n\t\treturn new View(this);\n\t}",
"public void layoutBottom() {\n\t\t// instantiate panel for bottom of display\n\t\tJPanel bottom = new JPanel(new GridLayout(3, 3));\n\n\t\t// add upper label, text field and button\n\t\tJLabel idLabel = new JLabel(\"Enter Class Id\");\n\t\tbottom.add(idLabel);\n\t\tidIn = new JTextField();\n\t\tbottom.add(idIn);\n\t\tJPanel panel1 = new JPanel();\n\t\taddButton = new JButton(\"Add\");\n\t\taddButton.addActionListener(this);\n\t\tpanel1.add(addButton);\n\t\tbottom.add(panel1);\n\n\t\t// add middle label, text field and button\n\t\tJLabel nmeLabel = new JLabel(\"Enter Class Name\");\n\t\tbottom.add(nmeLabel);\n\t\tclassIn = new JTextField();\n\t\tbottom.add(classIn);\n\t\tJPanel panel2 = new JPanel();\n\t\tdeleteButton = new JButton(\"Delete\");\n\t\tdeleteButton.addActionListener(this);\n\t\tpanel2.add(deleteButton);\n\t\tbottom.add(panel2);\n\n\t\t// add lower label text field and button\n\t\tJLabel tutLabel = new JLabel(\"Enter Tutor Name\");\n\t\tbottom.add(tutLabel);\n\t\ttutorIn = new JTextField();\n\t\tbottom.add(tutorIn);\n\n\t\tadd(bottom, BorderLayout.SOUTH);\n\t}",
"private void createLayout() {\n\t\tGroupLayout layout = new GroupLayout(getContentPane());\n\t\tgetContentPane().setLayout(layout);\n\t\t\n\t\tlayout.setAutoCreateContainerGaps(true);\n\t\tlayout.setAutoCreateGaps(true);\n\t\t\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t.addComponent(scrollPane)\n\t\t\t\t.addComponent(exitButton));\n\t\t\n\t\tlayout.setVerticalGroup(layout.createSequentialGroup()\n\t\t\t\t.addComponent(scrollPane)\n\t\t\t\t.addComponent(exitButton));\n\t\t\n\t\tpack();\n\t}",
"private void setUpFooter(){\n JButton newItem = new JButton();\n JTextField name = new JTextField();\n DatePicker date = new DatePicker();\n ColorPicker priority = ColorPicker.createColorPicker(4,Color.RED);\n newItem.setText(\"+\");\n newItem.addActionListener(e -> {\n Tasks tasks = new Tasks();\n JPanel list = this.getPanelForList();\n boolean allFiled = true;\n if(!name.getText().isEmpty()) {\n tasks.setName(name.getText());\n name.setText(null);\n }else {\n this.emptyTextFieldPopUp(\"name\");\n allFiled = false;\n }\n if(!date.getDate().isEmpty()) {\n tasks.setDeadline(DateHandler.getDateFromString(date.getDate()));\n date.resetDate();\n }else {\n this.emptyTextFieldPopUp(\"deadline\");\n allFiled = false;\n }\n tasks.setPriority(ColorPriorityHandler.getPriority(priority.getColor()));\n tasks.setItems_id(currentList);\n tasks.setStatus(0);\n JPanel taskList = (JPanel)((JViewport)((JScrollPane)list.getComponent(1)).getComponent(0)).getComponent(0);\n if(allFiled) {\n this.addTask(taskList,tasks);\n priority.setColor(currentList.getColor());\n }\n });\n footer.setLayout(new GridLayout(2,4));\n footer.add(new JLabel(\"Add new\"));\n footer.add(new JLabel(\"Name:\"));\n footer.add(new JLabel(\"Date:\"));\n footer.add(new JLabel(\"Priority:\"));\n footer.add(newItem);\n footer.add(name);\n footer.add(date);\n footer.add(priority);\n }",
"private org.gwtbootstrap3.client.ui.PanelFooter get_f_PanelFooter81() {\n return build_f_PanelFooter81();\n }",
"private org.gwtbootstrap3.client.ui.PanelFooter get_f_PanelFooter88() {\n return build_f_PanelFooter88();\n }",
"private void addFooter(){\n\t\t\n\t\tViewGroup ll= (ViewGroup) findViewById(R.id.footer_container);\n\t\tView footerView=View.inflate(getListView().getContext(), R.xml.footer,ll); \n\t\tgetListView().addFooterView(footerView);\n\t\t\n\t}",
"private org.gwtbootstrap3.client.ui.PanelFooter get_f_PanelFooter32() {\n return build_f_PanelFooter32();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new object of class 'Expression List Entry'. | ExpressionListEntry createExpressionListEntry(); | [
"public static EntryList getEntryList(){\n if (entryList == null){\n entryList = new EntryList();\n\n }\n return entryList;\n }",
"ExpressionList createExpressionList();",
"public Registry(List<Entry> entryList){\n\t\tthis.entryList = entryList;\n\t}",
"Entry createEntry();",
"ExpressionList getExpressionList();",
"EList createEList();",
"public static ElementInsertionList create()\n {\n return new ElementInsertionList();\n }",
"public List<Entry> getEntryList() {\n\t\treturn entryList;\n\t}",
"CommandContainerEntryListType getEntryList();",
"public EquationListRecord() {\n\t\tsuper(EquationListTable.EQUATION_LIST);\n\t}",
"public ListEntry() {\n this.data = null;\n this.next = null;\n this.prev = null;\n }",
"public final EObject entryRuleExpressionList() throws RecognitionException {\n EObject current = null;\n\n EObject iv_ruleExpressionList = null;\n\n\n try {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5904:2: (iv_ruleExpressionList= ruleExpressionList EOF )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5905:2: iv_ruleExpressionList= ruleExpressionList EOF\n {\n currentNode = createCompositeNode(grammarAccess.getExpressionListRule(), currentNode); \n pushFollow(FOLLOW_ruleExpressionList_in_entryRuleExpressionList10249);\n iv_ruleExpressionList=ruleExpressionList();\n _fsp--;\n\n current =iv_ruleExpressionList; \n match(input,EOF,FOLLOW_EOF_in_entryRuleExpressionList10259); \n\n }\n\n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }",
"private AppendEntries createAppendEntries(Entry entry) {\n\n return this.createAppendEntries(entry, new ArrayList<>());\n\n }",
"ExprListRule createExprListRule();",
"public final AliaChecker.exprlist_return exprlist() throws RecognitionException {\n\t\tAliaChecker.exprlist_return retval = new AliaChecker.exprlist_return();\n\t\tretval.start = input.LT(1);\n\n\t\tCommonTree root_0 = null;\n\n\t\tCommonTree _first_0 = null;\n\t\tCommonTree _last = null;\n\n\n\t\tTreeRuleReturnScope tl =null;\n\t\tTreeRuleReturnScope t =null;\n\n\n\t\ttry {\n\t\t\t// src\\\\alia\\\\AliaChecker.g:258:5: (tl= exprentry (t= exprentry )* )\n\t\t\t// src\\\\alia\\\\AliaChecker.g:258:7: tl= exprentry (t= exprentry )*\n\t\t\t{\n\t\t\troot_0 = (CommonTree)adaptor.nil();\n\n\n\t\t\t_last = (CommonTree)input.LT(1);\n\t\t\tpushFollow(FOLLOW_exprentry_in_exprlist1563);\n\t\t\ttl=exprentry();\n\t\t\tstate._fsp--;\n\n\t\t\tadaptor.addChild(root_0, tl.getTree());\n\n\n\t\t\t\t\t\tcheckNotVoid((tl!=null?((AliaChecker.exprentry_return)tl).type:null), (tl!=null?((CommonTree)tl.getTree()):null));\n\t\t\t\t\t\tretval.type = (tl!=null?((AliaChecker.exprentry_return)tl).type:null);\n\t\t\t\t\t\n\t\t\t// src\\\\alia\\\\AliaChecker.g:263:3: (t= exprentry )*\n\t\t\tloop15:\n\t\t\twhile (true) {\n\t\t\t\tint alt15=2;\n\t\t\t\tint LA15_0 = input.LA(1);\n\t\t\t\tif ( ((LA15_0 >= AND && LA15_0 <= BECOMES)||(LA15_0 >= CHAR_EXPR && LA15_0 <= COLON)||(LA15_0 >= COMPOUND && LA15_0 <= CONST)||LA15_0==DIV||LA15_0==EQ||LA15_0==FALSE||(LA15_0 >= GE && LA15_0 <= GT)||(LA15_0 >= IDENTIFIER && LA15_0 <= IF)||LA15_0==LE||(LA15_0 >= LT && LA15_0 <= MOD)||(LA15_0 >= NOT && LA15_0 <= PRINT)||LA15_0==READ||(LA15_0 >= TIMES && LA15_0 <= TRUE)) ) {\n\t\t\t\t\talt15=1;\n\t\t\t\t}\n\n\t\t\t\tswitch (alt15) {\n\t\t\t\tcase 1 :\n\t\t\t\t\t// src\\\\alia\\\\AliaChecker.g:263:4: t= exprentry\n\t\t\t\t\t{\n\t\t\t\t\t_last = (CommonTree)input.LT(1);\n\t\t\t\t\tpushFollow(FOLLOW_exprentry_in_exprlist1574);\n\t\t\t\t\tt=exprentry();\n\t\t\t\t\tstate._fsp--;\n\n\t\t\t\t\tadaptor.addChild(root_0, t.getTree());\n\n\n\t\t\t\t\t\t\t\t\tcheckNotVoid((t!=null?((AliaChecker.exprentry_return)t).type:null), (t!=null?((CommonTree)t.getTree()):null));\n\t\t\t\t\t\t\t\t\tretval.type = new _Void();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault :\n\t\t\t\t\tbreak loop15;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t}\n\n\t\t\tretval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n\n\t\t}\n\t\t \n\t\t catch (RecognitionException e) { \n\t\t \tif(!e.getMessage().equals(\"\")) {\n\t\t\t\t\tSystem.err.println(\"Exception!:\"+e.getMessage());\n\t\t\t\t}\n\t\t\t\tthrow (new AliaException(\"\"));\n\t\t } \n\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t\treturn retval;\n\t}",
"ExpressionList getEpl();",
"public void setEntryList(List<Entry> entryList) {\n\t\tthis.entryList = entryList;\n\t}",
"public CompositeInlineList(Context context, Type type, Type entry, String name) {\n this.factory = new CollectionFactory(context, type);\n this.root = new Traverser(context);\n this.entry = entry;\n this.type = type;\n this.name = name;\n }",
"@Override\n\tpublic Collection createEntries() {\n\t\t// get output field from view component\n\t\tcollection.getBlock().setEntries(transformationMultipleFormImpl.getEntries(viewComponentMultipleForm));\n\t\t// then navigate data model to set name and type of entries\n\t\tcollection.getBlock().getEntries().stream().forEach(e -> e.setName(\n\t\t\t\tdataModelTransformation.retrieveEntryName(e, collection.getBlock().getKey().getIdEntity(), dataModel)));\n\t\tcollection.getBlock().getEntries().stream().forEach(e -> e.setType(\n\t\t\t\tdataModelTransformation.retrieveEntryType(e, collection.getBlock().getKey().getIdEntity(), dataModel)));\n\t\t\n\t\t//add also entry by partition key\n\t\t\t\tfor (PartitionKey pk : collection.getBlock().getKey().getPartitionKeys())\n\t\t\t\t\tcollection.getBlock().addEntry(new Entry (pk.getId().substring(pk.getId().lastIndexOf(\".\") + 1),pk.getName(),pk.getType()));\n\t\t\t\t\n\t\t\t\t//add also entry by sort key\n\t\t\t\tfor (SortKey sk : collection.getBlock().getKey().getSortKeys())\n\t\t\t\t\tcollection.getBlock().addEntry(new Entry (sk.getId().substring(sk.getId().lastIndexOf(\".\") + 1),sk.getName(),sk.getType()));\n\t\t\t\t\n\t\treturn collection;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when the page has requested to go fullscreen. The delegate is responsible for putting the system into fullscreen mode. The delegate can exit out of fullscreen by running the supplied Runnable (calling exitFullscreenRunner.Run() results in calling exitFullscreen()). NOTE: we expect WebLayer to be covering the whole display without any other UI elements from the embedder or Android on screen. Otherwise some web features (e.g. WebXR) might experience clipped or misaligned UI elements. NOTE: the Runnable must not be used synchronously, and must be run on the UI thread. | public abstract void onEnterFullscreen(@NonNull Runnable exitFullscreenRunner); | [
"public abstract void onExitFullscreen();",
"public void doToggleFullscreen() {\n // If there is no callback for handling fullscreen, don't do anything.\n if (fullscreenCallback == null) {\n return;\n }\n\n MediaPlayerController playerControl = layerManager.getControl();\n if (playerControl == null) {\n return;\n }\n\n Activity activity = layerManager.getActivity();\n FrameLayout container = layerManager.getContainer();\n\n if (isFullscreen) {\n activity.setRequestedOrientation(savedOrientation);\n\n // Make the status bar and navigation bar visible again.\n activity.getWindow().getDecorView().setSystemUiVisibility(0);\n\n container.setLayoutParams(originalContainerLayoutParams);\n\n fullscreenButton.setImageResource(R.drawable.toro_ext_ic_fullscreen_enter);\n\n fullscreenCallback.onReturnFromFullscreen();\n isFullscreen = false;\n } else {\n savedOrientation = activity.getResources().getConfiguration().orientation;\n activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);\n\n activity.getWindow()\n .getDecorView()\n .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);\n\n container.setLayoutParams(\n ViewUtil.getLayoutParamsBasedOnParent(container, ViewGroup.LayoutParams.MATCH_PARENT,\n ViewGroup.LayoutParams.MATCH_PARENT));\n\n fullscreenButton.setImageResource(R.drawable.toro_ext_ic_fullscreen_exit);\n fullscreenCallback.onGoToFullscreen();\n isFullscreen = true;\n }\n }",
"@Override\n public void onFullscreen(boolean b) {\n if (!b) {\n finish();\n }\n }",
"public void onFullScreenChanged(boolean fullScreen);",
"public void setFullscreenCallback(PlaybackControlLayer.FullscreenCallback fullscreenCallback) {\n playbackControlLayer.setFullscreenCallback(fullscreenCallback);\n }",
"@Test //@Disabled(\"Not Yet Implemented\")\n public void testFullscreen() {\n LOG.entering(CLASS, \"testFullscreen\"); \n try{\n JsonObject result = MarionetteUtil.parseJsonObject(POST(getUri(\"fullscreen\", sessionId), \"\").body());\n Assertions.assertTrue(null != result);\n LOG.exiting(CLASS, \"testFullscreen\", result);\n } catch(Exception e){\n LOG.throwing(CLASS, \"testFullscreen\", e);\n throw e;\n }\n }",
"public interface FullScreenContainerListener {\n\n public void switchedFullScreenMode(FullScreenContainer fullScreenContainer, boolean isFullScreen);\n \n}",
"@Override\n public void onAdShowedFullScreenContent() {\n Log.d(TAG, \"Ad showed fullscreen content.\");\n if (hasListeners(AdmobModule.AD_SHOWED_FULLSCREEN_CONTENT)) {\n fireEvent(AdmobModule.AD_SHOWED_FULLSCREEN_CONTENT, new KrollDict());\n }\n }",
"public void setFullscreenCallback(FullscreenCallback fullscreenCallback) {\n this.fullscreenCallback = fullscreenCallback;\n if (fullscreenButton != null && fullscreenCallback != null) {\n fullscreenButton.setVisibility(View.VISIBLE);\n emptySpace.setVisibility(View.GONE);\n } else if (fullscreenButton != null) {\n fullscreenButton.setVisibility(View.GONE);\n emptySpace.setVisibility(View.VISIBLE);\n }\n }",
"private void showWebcamFullscreen() {\n\t\t//show a progress dialog\n\t\tshowDialog(DIALOG_PREPARE_FOR_FULLSCREEN);\n\t\t\n\t\t//file is places inside application private data directory\n\t\tmSaveWebcamImageThread = new SaveWebcamImageThread(\n\t\t\t\tmLogFacility,\n\t\t\t\tmImageMediaHelper,\n\t\t\t\tActWebcam.this,\n\t\t\t\tmActivityHandler,\n\t\t\t\tmImgWebcam,\n\t\t\t\tApp.WEBCAM_IMAGE_DUMP_FILE,\n\t\t\t\tSaveWebcamImageThread.AT_THE_END_FULLSCREEN);\n\t\tmSaveWebcamImageThread.start();\n\t}",
"public void setFullscreen(boolean fullscreen);",
"public void goFullscreen() {\n int uiOptions = getWindow().getDecorView().getSystemUiVisibility();\n int newUiOptions = uiOptions;\n boolean isImmersiveModeEnabled = ((uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) == uiOptions);\n if (isImmersiveModeEnabled) {\n Log.i(\"\", \"Turning immersive mode mode off. \");\n } else {\n Log.i(\"\", \"Turning immersive mode mode on.\");\n }\n\n newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;\n newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;\n newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n getWindow().\n getDecorView().\n setSystemUiVisibility(newUiOptions);\n //END_INCLUDE (set_ui_flags)\n }",
"public void setOnFullScreenListener(OnFullScreenListener l) {\n mProvider.setOnFullScreenListener_impl(l);\n }",
"private void setfullscreen() {\n switch(fullScreenMode) {\n case 0:\n System.out.println(\"No Full Screen\");\n setUndecorated(false);\n break;\n case 1:\n setUndecorated(true);\n setExtendedState(JFrame.MAXIMIZED_BOTH);\n \n break;\n case 2:\n setUndecorated(true);\n device.setFullScreenWindow(this);\n \n break;\n }\n }",
"synchronized public void toggleFullScreen() {\n\t\tif(Global.isRunning) {\n\t\t\treturn;\n\t\t}\n\t\tboolean full = !isUndecorated();\n\t\tdispose();\n\t\tsetUndecorated(full); // window must be disposed prior to calling this method\n\t\t// setResizable(!full);\n\t\tsetVisible(true);\t\t\n\t\tif(full) {\n\t\t\t// the following line seems to cause problems with transparent images under windows\n\t\t\t// at least sometimes on my machine, but not on a notebook...\n\t\t\t// under windows, we could use the commented commands, but this seems not to work under linux\n\t\t\tGraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(this);\n\t\t\t//setExtendedState(JFrame.MAXIMIZED_BOTH);\n\t\t} else {\n\t\t\t// restore the normal window size\n\t\t\t//setExtendedState(JFrame.NORMAL);\n\t\t\t//GUI.this.setSize(appConfig.guiWindowWidth, appConfig.guiWindowHeight);\n\t\t\t//GUI.this.setLocation(appConfig.guiWindowPosX, appConfig.guiWindowPosY);\n\t\t\tGraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(null);\n\t\t}\n\t\t// update the menu title \n\t\tviewFullScreenMenuItem.setText(full ? \"Exit Full Screen\" : \"Full Screen\");\n\t\t\n\t}",
"public void FullScreenMethod() {\n\n try {\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n\n setBounds(0, 0, screenSize.width, screenSize.height);\n setVisible(true);\n Toolkit tk = Toolkit.getDefaultToolkit();\n\n int xsize = (int) tk.getScreenSize().getWidth();\n int ysize = (int) tk.getScreenSize().getHeight();\n\n this.setSize(xsize, ysize);\n this.setExtendedState(this.MAXIMIZED_BOTH);\n\n } catch (HeadlessException e) {\n Logger.getLogger(Dashboard.class.getName()).log(Level.SEVERE, null, e);\n }\n }",
"void setFullscreen(boolean full);",
"boolean canFullscreen();",
"public boolean isFullscreen();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ ITERATE FROM COMPOSITE CLUSTERED ENTITY | @Test
public void should_iterate_with_partition_keys_and_partition_keys_IN() throws Exception {
//Given
long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);
insertCompositeClusteredValues(partitionKey,"bucket1",1,"name1",1);
insertCompositeClusteredValues(partitionKey,"bucket2",1,"name2",1);
insertCompositeClusteredValues(partitionKey,"bucket3",1,"name3",1);
//When
final Iterator<CompositeClusteredEntity> iterator = manager.sliceQuery(CompositeClusteredEntity.class)
.forIteration()
.withPartitionComponents(partitionKey)
.andPartitionComponentsIN("bucket1", "bucket3")
.iterator();
//Then
assertThat(iterator.hasNext()).isTrue();
CompositeClusteredEntity next = iterator.next();
assertThat(next.getId().getId()).isEqualTo(partitionKey);
assertThat(next.getId().getBucket()).isEqualTo("bucket1");
assertThat(next.getId().getName()).isEqualTo("name11");
assertThat(next.getValue()).isEqualTo("value11");
assertThat(iterator.hasNext()).isTrue();
next = iterator.next();
assertThat(next.getId().getId()).isEqualTo(partitionKey);
assertThat(next.getId().getBucket()).isEqualTo("bucket3");
assertThat(next.getId().getName()).isEqualTo("name31");
assertThat(next.getValue()).isEqualTo("value11");
} | [
"@Test\n public void should_iterate_with_default_params() throws Exception {\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n insertClusteredValues(partitionKey, 1, \"name1\", 5);\n\n Iterator<ClusteredEntity> iter = manager.sliceQuery(ClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .iterator();\n\n assertThat(iter.hasNext()).isTrue();\n ClusteredEntity next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name12\");\n assertThat(next.getValue()).isEqualTo(\"value12\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name13\");\n assertThat(next.getValue()).isEqualTo(\"value13\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name14\");\n assertThat(next.getValue()).isEqualTo(\"value14\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name15\");\n assertThat(next.getValue()).isEqualTo(\"value15\");\n\n assertThat(iter.hasNext()).isFalse();\n }",
"@Override\r\n\tpublic Iterator<Cluster> iterator() {\r\n\t\treturn C.iterator();\r\n\t}",
"@Override\n public Iterator<Entity> iterator() {\n return entities.iterator();\n }",
"public interface ICluster<T> extends Iterable<T>, ISelfDescription {\n\n\t/**\n\t * number of elements in it\n\t * \n\t * @return\n\t */\n\tpublic int size();\n\n\t/**\n\t * allows the assessment of centroid distances and related stuff.\n\t * \n\t * Discussion: remove distance measure from Cluster? a lot of convenient\n\t * functionality and context information will be gone.\n\t * \n\t * @return\n\t */\n\tpublic IDistanceMeasure<T> getDistanceMeasure();\n\n\t/**\n\t * in most cases clusters can be represented with a centroid\n\t * \n\t * @return\n\t */\n\tpublic Centroid<T> getCentroid();\n\n\t/**\n\t * retrieves the distance of a given T to the centroid. to be discussed: shall\n\t * an exception be thrown iff T is not contained in the cluster?!\n\t * \n\t * Discussion: remove distance measure from Cluster? a lot of convenient\n\t * functionality and context information will be gone.\n\t * \n\t * @param element\n\t * @return\n\t */\n\tpublic double getCentroidDistance(T element);\n\n\t/**\n\t * in some cases T's may be added to a cluster\n\t * \n\t * @param element\n\t */\n\tpublic boolean add(T element);\n\n\t/**\n\t * whether or not a cluster contains a particular element.\n\t * \n\t * @param element\n\t * @return\n\t */\n\tpublic boolean contains(Object element);\n\n\t/**\n\t * in some cases T's may be removed from a cluster\n\t * \n\t * @param element\n\t */\n\tpublic boolean remove(Object element);\n\n\t/**\n\t * alternative to the iterator.\n\t * \n\t * @return\n\t */\n\tpublic Set<T> getElements();\n\n\t/**\n\t * variance information produced by the elements of the cluster.\n\t * \n\t * @return\n\t */\n\tpublic double getVariance();\n\n\t/**\n\t * we are interested in the T's that are contained in clusters. The\n\t * constellation of these guys should also determine the equals function\n\t * \n\t * @param o\n\t * @return\n\t */\n\tpublic boolean equals(Object o);\n\n\tpublic int hashCode();\n}",
"public Iterator<String> getPrimitiveEntityIterator();",
"@Override\n public Iterator<NFetchMode> iterator() {\n return Arrays.asList(all).iterator();\n }",
"io.cloudstate.protocol.EntityProto.Entity getEntities(int index);",
"Iterator<Element> getIdentities();",
"public Iterable<HashNode> iterator() {\n\t\treturn bucket;\n\t\t//for(HashTable<Character, Integer>.HashNode x : HT.iterator()) {\n\t}",
"public void Next() {\n OCCwrapJavaJNI.Interface_EntityIterator_Next(swigCPtr, this);\n }",
"boolean isClustered();",
"public Iterator<Long> getEntityIterator(Class<? extends Component> componentType)\n\t{\n\t\tif(!typeExists(componentType))\n\t\t\treturn null;\n\t\t\n\t\tMap<Long, Component> components = componentMap.get(componentType);\n\t\tIterator<Long> entityIterator = components.keySet().iterator();\n\t\t\n\t\treturn new Iterator<Long>()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic boolean hasNext()\n\t\t\t{\n\t\t\t\treturn entityIterator.hasNext();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic Long next()\n\t\t\t{\n\t\t\t\treturn entityIterator.next();\n\t\t\t}\n\t\t\t\n\t\t};\n\t}",
"public java.util.List<edu.jhu.hlt.concrete.Clustering> getEntityClusterList() {\n return this.entityClusterList;\n }",
"@Test\r\n public void testFindAll() throws Exception {\r\n List<CriticoEntity> list = criticoPersistence.findAll();\r\n Assert.assertEquals(data.size(), list.size());\r\n for (CriticoEntity critico : list ) {\r\n boolean found = false;\r\n for (CriticoEntity critico2 : data ) {\r\n if (critico.getId().equals(critico2.getId())) {\r\n found = true;\r\n }\r\n }\r\n Assert.assertTrue(found);\r\n } \r\n }",
"protected synchronized void constructCache() {\n clearCache();\n\n // rebuild index\n Iterator mapIterator = maps.iterator();\n while (mapIterator.hasNext()) {\n DataMap map = (DataMap) mapIterator.next();\n\n // index ObjEntities\n Iterator objEntities = map.getObjEntities().iterator();\n while (objEntities.hasNext()) {\n ObjEntity oe = (ObjEntity) objEntities.next();\n\n // index by name\n objEntityCache.put(oe.getName(), oe);\n\n // index by class\n String className = oe.getClassName();\n if (indexedByClass && className != null) {\n Class entityClass;\n try {\n entityClass =\n Configuration.getResourceLoader().loadClass(className);\n }\n catch (ClassNotFoundException e) {\n // print a big warning and continue... DataMaps can contain all kinds of garbage...\n logObj.warn(\"*** Class '\" + className + \"' not found in runtime. Ignoring.\");\n continue;\n }\n\n if (objEntityCache.get(entityClass) != null) {\n throw new CayenneRuntimeException(\n getClass().getName()\n + \": More than one ObjEntity (\"\n + oe.getName()\n + \" and \"\n + ((ObjEntity) objEntityCache.get(entityClass)).getName()\n + \") uses the class \"\n + entityClass.getName());\n }\n\n objEntityCache.put(entityClass, oe);\n if (oe.getDbEntity() != null) {\n dbEntityCache.put(entityClass, oe.getDbEntity());\n }\n }\n }\n\n // index ObjEntity inheritance\n objEntities = map.getObjEntities().iterator();\n while (objEntities.hasNext()) {\n ObjEntity oe = (ObjEntity) objEntities.next();\n\n // build inheritance tree... include nodes that \n // have no children to avoid uneeded cache rebuilding on lookup...\n EntityInheritanceTree node =\n (EntityInheritanceTree) entityInheritanceCache.get(oe.getName());\n if (node == null) {\n node = new EntityInheritanceTree(oe);\n entityInheritanceCache.put(oe.getName(), node);\n }\n\n String superOEName = oe.getSuperEntityName();\n if (superOEName != null) {\n EntityInheritanceTree superNode =\n (EntityInheritanceTree) entityInheritanceCache.get(superOEName);\n \n if (superNode == null) {\n // do direct entity lookup to avoid recursive cache rebuild\n ObjEntity superOE = (ObjEntity) objEntityCache.get(superOEName);\n if (superOE != null) {\n superNode = new EntityInheritanceTree(superOE);\n entityInheritanceCache.put(superOEName, superNode);\n }\n else {\n // bad mapping?\n logObj.debug(\n \"Invalid superEntity '\"\n + superOEName\n + \"' for entity '\"\n + oe.getName()\n + \"'\");\n continue;\n }\n }\n\n superNode.addChildNode(node);\n }\n }\n\n // index DbEntities\n Iterator dbEntities = map.getDbEntities().iterator();\n while (dbEntities.hasNext()) {\n DbEntity de = (DbEntity) dbEntities.next();\n dbEntityCache.put(de.getName(), de);\n }\n\n // index stored procedures\n Iterator procedures = map.getProcedures().iterator();\n while (procedures.hasNext()) {\n Procedure proc = (Procedure) procedures.next();\n procedureCache.put(proc.getName(), proc);\n }\n\n // index queries\n Iterator queries = map.getQueries().iterator();\n while (queries.hasNext()) {\n Query query = (Query) queries.next();\n String name = query.getName();\n Object existingQuery = queryCache.put(name, query);\n\n if (existingQuery != null && query != existingQuery) {\n throw new CayenneRuntimeException(\n \"More than one Query for name\" + name);\n }\n }\n }\n }",
"CloseableIterable<Entity> adjacencies(List<EntityIdentifier> fromVertices, Node query, Direction direction,\n Set<String> labels, Auths auths);",
"public interface CompoundKeyCacheable {\r\n\t/**\r\n\t * <P>Returns all available keys used by a Cacheable entity.</P>\r\n\t *\r\n\t * <P><B>Note:</b> It is mandatory that the array returned must be always the same size, with the\r\n\t * equivalent keys under the same position. Also, use most common keys on the beggining of the\r\n\t * array since the array will be queried from pos 0 to the last position.</P>\r\n\t *\r\n\t * @return\r\n\t */\r\n\tpublic Object[] getSecondaryKeys();\r\n}",
"public interface IClusterSet<E> extends Serializable {\n\t\n\t/**\n\t * Checks if the ClusterSet contains the passed object.\n\t * @param o the object to look up\n\t * @return true if object is contained, else false.\n\t */\n\tpublic abstract boolean contains(Object o);\n\n\t/**\n\t * Removes an object from this ClusterSet and \n\t * updates the combinationsMap and combinationIndices.\n\t * @param o the object to remove\n\t * @return false if object was not contained in this ClusterSet, else true\n\t */\n\tpublic abstract boolean remove(Object o);\n\n\t/**\n\t * Adds a new element to the ClusterSet if the passed element\n\t * is not already contained in the ClusterSet.\n\t * Updates the combinationsMap and combinationIndices.\n\t * @param e element to add.\n\t * @return false if passed element already present, else true\n\t */\n\tpublic abstract boolean add(E e);\n\n\t/**\n\t * Gets the size of the set.\n\t * @return the size\n\t */\n\tpublic abstract int size();\n\n\t/**\n\t * Checks if this cluster set is already fully clustered.\n\t * @return true if set is clustered, else false.\n\t */\n\tpublic abstract boolean clusteringDone();\n\n\t/**\n\t * Gets a read only view of the collection to cluster.\n\t * The collection reflects changes to the underlying collection but\n\t * the underlying collection can not be changed\n\t * through the returned collection.\n\t * @return a read only view of the collection to cluster\n\t */\n\tpublic abstract Collection<E> getUnmodifiableView();\n\n\t/**\n\t * Gets the root of a cluster set if clustering is completed.\n\t * @return the root cluster of the cluster set if or \n\t * null if clusteringDone() == false or set was initialized with 0 leaves.\n\t */\n\tpublic abstract E getRoot();\n\n\t/**\n\t * Gets any cluster.\n\t * <br>\n\t * <br>\n\t * Used for testing.\n\t * @return any cluster\n\t */\n\tpublic abstract E getAnyElement();\n\n\t/**\n\t * Gets the Set of all possible cluster combinations with a size <= {@code MAX_SUBSET_SIZE}.\n\t * @return the possible combinations.\n\t */\n\tpublic abstract Set<Collection<E>> getCombinations();\n\n\t/**\n\t * Gets the set of all possible cluster combinations with a size <= {@code MAX_SUBSET_SIZE}\n\t * and the passed element as cluster component.\n\t * @param element the element for which cluster combinations are queried\n\t * @return all possible combinations containing the passed element\n\t */\n\tpublic abstract Set<Collection<E>> getCombinations(E element);\n\n}",
"@Test\r\n public void testFindAll() throws Exception {\r\n List<MonitoriaEntity> totalEntidades = persistence.findAll();\r\n Assert.assertEquals(data.size(), totalEntidades.size());\r\n for(MonitoriaEntity ent: totalEntidades){\r\n boolean encontro = false;\r\n for(MonitoriaEntity entity: data){\r\n if(ent.equals(entity)){\r\n encontro = true;\r\n }\r\n }\r\n Assert.assertTrue(true);\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert all the days an alarm is scheduled to go off, to Calendars. | public static List<Calendar> toCalendars(NacAlarm alarm)
{
List<Calendar> calendars = new ArrayList<>();
// Alarm is null. Return an empty list
if (alarm == null)
{
return calendars;
}
// No days are selected. This alarm will occur either today or tomorrow and
// is a one-time alarm
if (!alarm.areDaysSelected())
{
Calendar c = NacCalendar.toNextOneTimeCalendar(alarm);
calendars.add(c);
}
// One or more days are selected. Add a calendar for each day that is
// selected
else
{
EnumSet<Day> days = alarm.getDays();
long timeOfDismissEarlyAlarm = alarm.getTimeOfDismissEarlyAlarm();
// Iterate over each selected day
for (Day d : days)
{
// Get calendar and time of calendar
Calendar c = NacCalendar.toNextCalendar(alarm, d);
long t = c.getTimeInMillis();
// Time matches the alarm that was dismissed early. Add a week to
// this calendar
if ((timeOfDismissEarlyAlarm > 0) && (t == timeOfDismissEarlyAlarm))
{
c.add(Calendar.DAY_OF_MONTH, 7);
}
// Add calendar to list of calendars
calendars.add(c);
}
}
return calendars;
} | [
"Calendar toCalendar();",
"public static HolidayCalendar[] calendarArray() {\n return new HolidayCalendar[] {TARGET };\n }",
"public void removeAllCalendar();",
"public static Calendar toCalendar(NacAlarm alarm, Day day)\n\t{\n\t\tint dow = NacCalendar.Days.toCalendarDay(day);\n\t\tint hour = alarm.getHour();\n\t\tint minute = alarm.getMinute();\n\t\tCalendar calendar = Calendar.getInstance();\n\n\t\tcalendar.set(Calendar.DAY_OF_WEEK, dow);\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, hour);\n\t\tcalendar.set(Calendar.MINUTE, minute);\n\t\tcalendar.set(Calendar.SECOND, 0);\n\t\tcalendar.set(Calendar.MILLISECOND, 0);\n\n\t\treturn calendar;\n\t}",
"protected void initDates() {\n Calendar cal = Calendar.getInstance();\n cal.add(Calendar.DAY_OF_MONTH, -1);\n dateTo = cal.getTime();\n cal.add(Calendar.MONTH, -1);\n dateFrom = cal.getTime();\n }",
"public void fillDays() {\r\n\t\t/*\r\n\t\t * Changes variable depending on the month value.\r\n\t\t * 0 for 30 day months\r\n\t\t * 1 for 31 day months\r\n\t\t * 2 for 28 day months\r\n\t\t * 3 for 29 day months\r\n\t\t */\r\n\t\tint firstDay = LocalDate.of(calendar.getYear(), calendar.getMonth(), 1).getDayOfWeek().getValue();\r\n\t\tint monthStatus = 0;\r\n\t\tif (calendar.getMonthValue() == 1 || calendar.getMonthValue() == 3 || calendar.getMonthValue() == 5 || \r\n\t\t\t\tcalendar.getMonthValue() == 7 || calendar.getMonthValue() == 8 || calendar.getMonthValue() == 10 || calendar.getMonthValue() == 12) {\r\n\t\t\t monthStatus = 1;\r\n\t\t}\r\n\t\tif (calendar.getMonthValue() == 2) {\r\n\t\t\t monthStatus = 2;\r\n\t\t}\r\n\t\tif (calendar.getMonthValue() == 2 && calendar.getYear() % 4 == 0) {\r\n\t\t\tmonthStatus = 3;\r\n\t\t}\r\n\t\tint count = 0;\r\n\t\tfor (int row = 0; row < days.length; row++) {\r\n\t\t\tfor (int col = 0; col < days[0].length; col++ ) {\r\n\t\t\t\tif (row == 0 && col < firstDay - 1) {\r\n\t\t\t\t\tdays[row][col] = 0;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tdays[row][col] = count;\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t\tif (count > 29) {\r\n\t\t\t\t\tif (monthStatus == 0) {\r\n\t\t\t\t\t\tif (count > 31) {\r\n\t\t\t\t\t\t\tdays[row][col] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (monthStatus == 1) {\r\n\t\t\t\t\t\tif (count > 32) {\r\n\t\t\t\t\t\t\tdays[row][col] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (monthStatus == 2) {\r\n\t\t\t\t\t\tdays[row][col] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (monthStatus == 3) {\r\n\t\t\t\t\t\tif (count > 30) {\r\n\t\t\t\t\t\tdays[row][col] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public ReactorResult<java.util.Calendar> getAllDate_as() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), DATE, java.util.Calendar.class);\r\n\t}",
"private Calendar[] getAlarmStartEndTime() {\n SettingsActivity.NOTIFICATION_TIME START_TIME = SettingsActivity.NOTIFICATION_TIME.START_TIME;\n String startTimeString = helperPreferences.getPreferences(START_TIME.toString(), \"08:30 AM\");\n SettingsActivity.NOTIFICATION_TIME END_TIME = SettingsActivity.NOTIFICATION_TIME.END_TIME;\n String endTimeString = helperPreferences.getPreferences(END_TIME.toString(), \"08:30 PM\");\n\n // The calendars to represent the start and end times.\n Calendar alarmStartCal = Calendar.getInstance();\n Calendar alarmEndCal = Calendar.getInstance();\n\n // Temp calendar reused to store hour of day.\n Calendar tempCal = Calendar.getInstance();\n\n // Set the time of day for the start cal.\n tempCal.setTime(SettingsActivity.parseStringToDate(startTimeString, SettingsActivity.AM_TIME_FORMAT));\n alarmStartCal.set(Calendar.HOUR_OF_DAY, tempCal.get(Calendar.HOUR_OF_DAY));\n alarmStartCal.set(Calendar.MINUTE, tempCal.get(Calendar.MINUTE));\n\n // Set the time of day for the end cal.\n tempCal.setTime(SettingsActivity.parseStringToDate(endTimeString, SettingsActivity.AM_TIME_FORMAT));\n alarmEndCal.set(Calendar.HOUR_OF_DAY, tempCal.get(Calendar.HOUR_OF_DAY));\n alarmEndCal.set(Calendar.MINUTE, tempCal.get(Calendar.MINUTE));\n\n return new Calendar[]{alarmStartCal, alarmEndCal};\n }",
"public ArrayList<Event> getCalendarEventsByDay()\n {\n ArrayList<Event> dayListOfEvents = new ArrayList<>();\n\n for(int i = 0; i < events.size(); i++)\n {\n if( (events.get(i).getCalendar().get(Calendar.YEAR) == currentCalendar.get(Calendar.YEAR)) &&\n (events.get(i).getCalendar().get(Calendar.MONTH) == currentCalendar.get(Calendar.MONTH)) &&\n (events.get(i).getCalendar().get(Calendar.DAY_OF_MONTH) == currentCalendar.get(Calendar.DAY_OF_MONTH)))\n {\n dayListOfEvents.add(events.get(i));\n }\n }\n\n return dayListOfEvents;\n }",
"private void setCalendarEvents() {\n for (Session session : sessionList.getList()) {\n events.add(session.getEventDay());\n }\n calendarView.setEvents(events);\n }",
"public static ReactorResult<java.util.Calendar> getAllDate_as(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource) {\r\n\t\treturn Base.getAll_as(model, instanceResource, DATE, java.util.Calendar.class);\r\n\t}",
"public Calendar toCalendar(){\r\n\t\tSimpleDateFormat[] formats = new SimpleDateFormat[] {\r\n\t\t\t\tYYYY_MM_DD_FORMATTER, YYYY_MMT_DD_T_HH_MM_FORMATTER,\r\n\t\t\t\tYYYY_MMT_DD_T_HH_MM_SS_FORMATTER };\r\n\t\tfor (SimpleDateFormat format : formats) {\r\n\t\t\ttry {\r\n\t\t\t\tDate date = format.parse(this.timeString);\r\n\t\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\t\tcalendar.setTime(date);\r\n\t\t\t\treturn calendar;\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"private boolean makeCalendarByDays() {\n if (calendar != null) {\n for (Date date:calendar.keySet()) {\n Date startDay;\n if (date.getTime() > date.getTime() - 3600000 * 2 - date.getTime() % 86400000)\n startDay = new Date(date.getTime() + 3600000 * 22 - date.getTime() % 86400000);\n else startDay = new Date(date.getTime() - 3600000 * 2 - date.getTime() % 86400000);\n calendarByDays.put(startDay, calendar.get(date));\n }\n return true;\n }\n return false;\n }",
"public ArrayList<Const_calendar> getCalendars() {\n Cursor cursor = contentResolver.query(CALENDAR_URI, FIELDS2, null, null, \"dtstart ASC\");\n\n try {\n if(cursor.getCount() > 0) {\n while (cursor.moveToNext()) {\n// String name = cursor.getString(0);\n// String displayName = cursor.getString(1);\n// // This is actually a better pattern:\n// String color = cursor.getString(cursor.getColumnIndex(\n// CalendarContract.Calendars.CALENDAR_COLOR));\n// Boolean selected = !cursor.getString(3).equals(\"0\");\n//\n// String cla_id = cursor.getString(4);\n// String cla_discription = cursor.getString(5);\n// String location = cursor.getString(6);\n// // String events_begin_time = cursor.getString(7);\n// // String events_end_time = cursor.getString(8);\n Const_calendar item =new Const_calendar();\n\n// item.setCal_id(cursor.getString(4));//\n// item.setDisplayName(cursor.getString(1));//\n// item.setName(cursor.getString(0));//\n// item.setColor(cursor.getString(cursor.getColumnIndex(\n// CalendarContract.Calendars.CALENDAR_COLOR)));\n// item.setLocation(cursor.getString(6));//\n// item.setDiscription(cursor.getString(5));//\n// item.setEVENT_BEGIN_TIME(cursor.getString(7));\n//\n ///////////////////////////////////////////////////////////////////////////\n Const_calendar item2 =new Const_calendar();\n\n item2.setCal_id(cursor.getString(3));//\n item2.setDisplayName(cursor.getString(7));//\n item2.setName(cursor.getString(0));//\n // item2.setColor(cursor.getString(cursor.getColumnIndex(\n // CalendarContract.Calendars.CALENDAR_COLOR)));\n item2.setLocation(cursor.getString(5));//\n item2.setDiscription(cursor.getString(1));//\n item2.setEVENT_BEGIN_TIME(cursor.getString(2));\n item2.setEVENT_END_TIME(cursor.getString(4));\n calendarList.add(item2);\n }\n }\n } catch (AssertionError ex) {\n // TODO: log exception and bail\n }\n return calendarList;\n }",
"public List<Serie> parseCalendar() {\n return parseCalendar(new LocalDate());\n }",
"private void setDay() {\n Boolean result = false;\n for (int i = 0; i < 7; ++i) {\n if(mAlarmDetails.getRepeatingDay(i))\n result = true;\n mAlarmDetails.setRepeatingDay(i, mAlarmDetails.getRepeatingDay(i));\n }\n if(!result)\n mAlarmDetails.setRepeatingDay((Calendar.getInstance().get(Calendar.DAY_OF_WEEK) - 1), true);\n }",
"private void setEachDayAppt() {\n\t\tAppt[] list;\n\t\t\n\n\t\t\n\t\tTimestamp start = new Timestamp(0);\t\t// Set a timestamp for the start of each day\n\t\tstart.setYear(currentY);\n\t\tstart.setMonth(currentM - 1);\n\t\tstart.setDate(1);\n\t\tstart.setHours(0);\n\t\tstart.setMinutes(0);\n\n\t\tTimestamp end = new Timestamp(0);\t\t// Set a timestamp for the end of each day\n\t\tend.setYear(currentY);\n\t\tend.setMonth(currentM - 1);\n\t\tend.setHours(23);\n\t\tend.setMinutes(59);\n\t\t\n\t\tint day = hkust.cse.calendar.gui.Utility.getweekday(start) - 1;\t// get the weekday of the 1st of current Month\n\t\t\n\t\tif( day < 0)\t\n\t\t\tday = 6;\n\t\t\n\t\tTimeSpan period;\n\t\t\n\t\tGregorianCalendar g = new GregorianCalendar(currentY, currentM - 1, 1);\t\n\t\tint maximum = g.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);\t// get the maximum day of current Month\n\t\t\n\t\tfor (int i = 0; i < 6; i++)\t\n\t\t\tfor (int j = 0; j < 7; j++) {\n\t\t\t\tint temp1 = i * 7 + j - day + 1;\t\n\t\t\t\tif (temp1 > 0 && temp1 <= maximum){\t\t\n\t\t\t\t\t\n\t\t\t\t\tstart.setDate(temp1);\t\t\n\t\t\t\t\tend.setDate(temp1);\n\t\t\t\t\tperiod = new TimeSpan(start, end);\n\t\t\t\t\tlist = controller.RetrieveAppts(mCurrUser, period);\t\t// get the Appt at specific day in current Month\n\t\t\t\t\tcheckDate[i][j] = true;\n\t\t\t\t\t\n\t\t\t\t\tint year = start.getYear()+1900;\n\t\t\t\t\tint month = start.getMonth()+1;\n\t\t\t\t\tint date = start.getDate();\n\t\t\t\t\t\n\t\t\t\t\tString combineDate = new String();\n\t\t\t\t\tString date2 ;\n\t\t\t\t\tif (date<10){\n\t\t\t\t\t\tdate2 = \"0\" + Integer.toString(date);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tdate2 = Integer.toString(date);\n\t\t\t\t\tString month2;\n\t\t\t\t\tif (month<10){\n\t\t\t\t\t\tmonth2 = \"0\" + Integer.toString(month);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tmonth2 = Integer.toString(month);\n\t\t\t\t\t\n\t\t\t\t\tcombineDate = Integer.toString(year)+month2+date2;\n\t\t\t\t\t\n\t\t\t\t\tint combinetheDate = Integer.parseInt(combineDate);\n\t\t\t\t\t\n\t\t\t\t\t//Object[] temp = controller.getSummary().keySet().toArray();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (controller.getSummary().containsKey(combinetheDate)){\n\t\t\t\t\t\tweatherOption[i][j] = new String(controller.getSummary().get(combinetheDate));\n\t\t\t\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\tweatherOption[i][j] = null;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif( list != null)\n\t\t\t\t\t\thasAppt[i][j] = true;\n//\t\t\t\t\t\tcontinue;\n//\t\t\t\t\tfor( int k = 0; k < list.length; k++)\n//\t\t\t\t\t\tapptMarker[i][j].add(list[k]);\t\t\n\t\t\t\t}\n\t\t\t}\n\t}",
"private void buildWeekDays() {\n weekDays = new ArrayList<>();\n for(DayOfWeek d : DayOfWeek.values()) {\n weekDays.add(new WeekDay(d));\n }\n }",
"public void refreshDays() {\n\n //clear List\n mEventList.clear();\n //create clone\n mPMonth = (GregorianCalendar) mCalendar.clone();\n\n CalendarGridviewAdapter.firstDay = mCalendar.get(GregorianCalendar.DAY_OF_WEEK);\n\n\n\n\n int mMaxWeekNumber = mCalendar.getActualMaximum(Calendar.WEEK_OF_MONTH);\n\n mMonthLength = mMaxWeekNumber * 7;\n int mMaxP = getmMaxP();\n int mCalMaxP = mMaxP - (CalendarGridviewAdapter.firstDay - 1);\n\n mPMonthMaxSet = (GregorianCalendar) mPMonth.clone();\n\n mPMonthMaxSet.set(GregorianCalendar.DAY_OF_MONTH, mCalMaxP + 1);\n\n setData(getCalendarData());\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the networkAccessPolicy property: Policy for accessing the disk via network. | public NetworkAccessPolicy networkAccessPolicy() {
return this.networkAccessPolicy;
} | [
"@NonNull\n public NetworkPolicy getNetworkPolicy() {\n return networkPolicy;\n }",
"public com.google.cloud.vmwareengine.v1.NetworkPolicy getNetworkPolicy(\n com.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getGetNetworkPolicyMethod(), getCallOptions(), request);\n }",
"com.google.container.v1.NetworkPolicyConfig getNetworkPolicyConfig();",
"public DiskRestorePointProperties withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy) {\n this.networkAccessPolicy = networkAccessPolicy;\n return this;\n }",
"public com.google.common.util.concurrent.ListenableFuture<\n com.google.cloud.vmwareengine.v1.NetworkPolicy>\n getNetworkPolicy(com.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getGetNetworkPolicyMethod(), getCallOptions()), request);\n }",
"public PublicNetworkAccess publicNetworkAccess() {\n return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess();\n }",
"public NatPolicy getNatPolicy();",
"public PublicNetworkAccess publicNetworkAccess() {\n return this.publicNetworkAccess;\n }",
"public void getNetworkPolicy(\n com.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest request,\n io.grpc.stub.StreamObserver<com.google.cloud.vmwareengine.v1.NetworkPolicy>\n responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getGetNetworkPolicyMethod(), getCallOptions()),\n request,\n responseObserver);\n }",
"public long[] getNetworkPermissions() {\n return networkPermissions;\n }",
"public File getNetwork() {\n\t\treturn network;\n\t}",
"public Boolean allowVirtualNetworkAccess() {\n return this.innerProperties() == null ? null : this.innerProperties().allowVirtualNetworkAccess();\n }",
"public List<NfsAccessPolicy> accessPolicies() {\n return this.accessPolicies;\n }",
"boolean hasNetworkPolicyConfig();",
"public UnaryCallSettings<GetNetworkPolicyRequest, NetworkPolicy> getNetworkPolicySettings() {\n return getNetworkPolicySettings;\n }",
"public com.vmware.converter.DVSPolicy getPolicy() {\r\n return policy;\r\n }",
"public CachePolicy getCachePolicy() {\n return cachePolicy;\n }",
"LinphoneNatPolicy getNatPolicy();",
"public NatPolicy createNatPolicy();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Forwards the request to delete the given term to the repo | public void deleteTerm(TermEntity term) {
mRepository.deleteTerm(term);
} | [
"Observable<String> deleteTermAsync(String listId, String term, String language);",
"public void removeTerm(VocabularyTerm term) throws IOException;",
"public void deleteSingleTerm(String termName)\n\t{\t\t\n\t\t//To check the status of \"Continued_Execution\" parameter, if it is set to NO it will skip this method, if not it will resume the execution \n\t\tif(oParameters.GetParameters(\"Continued_Execution\").equalsIgnoreCase(\"No\"))\n\t\t{\t\t\t\n\t\t\t//Adding step result to report\n\t\t\toReport.AddStepResult(\"Skipped Method :\", \"Skipped Method : \" + Thread.currentThread().getStackTrace()[1].getMethodName().toUpperCase(), \"INFO\");\n\t\t\treturn ;\n\t\t}\n\t\t\n\t\tBy term = By.xpath(\"//div[@class='col-lg-3 col-md-3 col-sm-3 col-xs-4 ng-binding'][contains(.,'\"+termName+\"')]\");\n\t\t\n\t\tmouse_hover(\"Term\", term);\t\t\n\t\tclick_button(\"Delete Term\", termDeleteIcon);\n\t\t\n\t\tif(IsDisplayed(\"Delete Term Popup\", deleteTermPopup))\n\t\t\toReport.AddStepResult(\"Delete rate sheet term popup\", \"Clicked on term delete icon, verified that 'Delete rate sheet term' popup is displayed \", \"PASS\");\n\t\telse\n\t\t\toReport.AddStepResult(\"Delete rate sheet term popup\", \"Clicked on term delete icon but 'Delete rate sheet term' popup is not displayed \", \"FAIL\");\n\t\t\n\t\tclick_button(\"Delete Term\", SectionDelete);\n\t\tfixed_wait_time(3);\n\t\twaitFor(openedRateSheet, \"Rate Sheet Title bar\");\n\t\t\n\t\tif(IsDisplayed(termName+\" Term\", term))\n\t\t\toReport.AddStepResult(\"Term Delete\", \"Clicked on \"+termName+\" delete icon then clicked on delete term but that term not deleted\", \"FAIL\");\n\t\telse\n\t\t\toReport.AddStepResult(\"Term Delete\", \"Clicked on \"+termName+\" delete icon then clicked on delete term, Verified that term deleted\", \"PASS\");\n\t}",
"@Override\n\tpublic com.liferay.cm.model.Term deleteTerm(com.liferay.cm.model.Term term)\n\t\tthrows com.liferay.portal.kernel.exception.PortalException {\n\n\t\treturn _termLocalService.deleteTerm(term);\n\t}",
"public final int delete(Term term) throws IOException {\n TermDocs docs = termDocs(term);\n if ( docs == null ) return 0;\n int n = 0;\n try {\n while (docs.next()) {\n\tdelete(docs.doc());\n\tn++;\n }\n } finally {\n docs.close();\n }\n return n;\n }",
"abstract void removeTermFromText(Term term);",
"@Override\n\tpublic void delete(Term iTerm) {\n\t\tfor (Course course : mCourseManager.getAllForTerm(iTerm.getID())) {\n\t\t\tmCourseManager.delete(course);\n\t\t}\n\t\t\n\t\topen(OPEN_MODE.WRITE);\n\t\tmDB.delete(DBHelper.TABLE_Term, DBHelper.COL_TERM_ID + \"=?\", new String[] { \"\" + iTerm.getID() });\n\t\tclose();\n\t}",
"HttpDelete deleteRequest(HttpServletRequest request, String address) throws IOException;",
"public static int deleteStatusTermByTerm(beans.TermBean termBean, int term)throws java.sql.SQLException{\n\t\tjava.sql.Statement st = null;\n\n\t\ttry{\n\t\t\tst=con.createStatement();\n\t\t\tString query=\"UPDATE term SET status=0 WHERE term=\"+term+\";\";\n\t\t\treturn st.executeUpdate(query);\n\t\t}finally{\n\t\t\tst.close();\n\t\t}\n\t}",
"public abstract String delete(HttpServletRequest request);",
"public int delete(Term term){\r\n int deletedRow = 0;\r\n SQLiteDatabase db = WguDatabaseManager.getInstance().openDatabase();\r\n try\r\n {\r\n deletedRow = db.delete(Term.TABLE_TERM,Term.TERM_ID + \" = \" + term.getTermId(),null);\r\n }\r\n catch(SQLiteException sQe){\r\n Log.e(CLASS_NAME,\"Problem deleting row.\" +\"\\n\" + sQe.getMessage());\r\n }\r\n return deletedRow;\r\n\r\n }",
"@Delete\n void deleteWord(Word word);",
"public static int deleteExamListDetailByTerm(int term)throws java.sql.SQLException{\n\t\tjava.sql.Statement st = null;\n\n\t\ttry{\n\t\t\tst=con.createStatement();\n\t\t\tString query=\"DELETE FROM exam_list_detail WHERE term=\"+term+\";\";\n\t\t\treturn st.executeUpdate(query);\n\t\t}finally{\n\t\t\tst.close();\n\t\t}\n\t}",
"void deleteRecipe(RecipeObject recipe);",
"Ack deleteFilter(ID branchId, String name);",
"@Override\n public void delete(String id) {\n log.debug(\"Request to delete Catalog : {}\", id); catalogRepository.deleteById(id);\n catalogSearchRepository.deleteById(id);\n }",
"@Test\n public void deleteEnrollmentTermTest() {\n String accountId = null;\n String id = null;\n // EnrollmentTerm response = api.deleteEnrollmentTerm(accountId, id);\n\n // TODO: test validations\n }",
"@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Ordre : {}\", id); ordreRepository.deleteById(id);\n }",
"@Override\r\n \tprotected void doDelete(HttpServletRequest req, HttpServletResponse resp)\r\n \t\t\tthrows ServletException, IOException {\r\n \t\tString agentUrl = req.getRequestURI();\r\n \t\tString agentId = httpTransport.getAgentId(agentUrl);\r\n \t\t\r\n \t\tif (!handleSession(req, resp)) {\r\n \t\t\tif (!resp.isCommitted()) {\r\n \t\t\t\tresp.sendError(HttpServletResponse.SC_UNAUTHORIZED);\r\n \t\t\t}\r\n \t\t\treturn;\r\n \t\t}\r\n \t\tif (agentId == null) {\r\n \t\t\tresp.sendError(HttpServletResponse.SC_BAD_REQUEST,\r\n \t\t\t\t\t\"No agentId found in url.\");\r\n \t\t\treturn;\r\n \t\t}\r\n \t\t\r\n \t\ttry {\r\n \t\t\tagentHost.deleteAgent(agentId);\r\n \t\t\tresp.getWriter().write(\"Agent \" + agentId + \" deleted\");\r\n \t\t} catch (Exception e) {\r\n \t\t\tthrow new ServletException(e);\r\n \t\t}\r\n \t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether the 'approvalDetails' field has an active Builder instance | public boolean hasApprovalDetailsBuilder() {
return approvalDetailsBuilder != null;
} | [
"public boolean hasApprovalDetails() {\n return fieldSetFlags()[17];\n }",
"public boolean isSetApprovalPerson() {\n return this.approvalPerson != null;\n }",
"public boolean isSetApprovalDate() {\n return this.approvalDate != null;\n }",
"public boolean isSetApprovalStep() {\n return this.approvalStep != null;\n }",
"public boolean isSetApprovalEndDate() {\n return this.approvalEndDate != null;\n }",
"public com.diviso.graeshoppe.order.avro.ApprovalDetails.Builder getApprovalDetailsBuilder() {\n if (approvalDetailsBuilder == null) {\n if (hasApprovalDetails()) {\n setApprovalDetailsBuilder(com.diviso.graeshoppe.order.avro.ApprovalDetails.newBuilder(approvalDetails));\n } else {\n setApprovalDetailsBuilder(com.diviso.graeshoppe.order.avro.ApprovalDetails.newBuilder());\n }\n }\n return approvalDetailsBuilder;\n }",
"public boolean isSetApprovalStatusName() {\n return this.approvalStatusName != null;\n }",
"public boolean verifyAwaitingClaimApprovalOnCommercial() {\r\n\t\tboolean status = new VerificationHelper(driver).isDisplayed(AwaitingClaimApproval_Link_Commercial);\r\n\t\treturn status;\r\n\t}",
"public com.diviso.graeshoppe.order.avro.Order.Builder setApprovalDetailsBuilder(com.diviso.graeshoppe.order.avro.ApprovalDetails.Builder value) {\n clearApprovalDetails();\n approvalDetailsBuilder = value;\n return this;\n }",
"public boolean isBusinessApprove() {\n return this.equals(WAIT_FOR_BUSINESS_APPROVED);\n }",
"public boolean isSetApprovalStatus() {\n return EncodingUtils.testBit(__isset_bitfield, __APPROVALSTATUS_ISSET_ID);\n }",
"public boolean waitSellerApprove() {\n return isBusinessApprove() || isBusinessReceipted();\n }",
"public boolean hasDeliveryInfoBuilder() {\n return deliveryInfoBuilder != null;\n }",
"public boolean hasDepartmentBuilder() {\n return departmentBuilder != null;\n }",
"protected boolean isSaveApprovalEnabled(Map<String,Object> options){\n\t \t\n \t\treturn checkOptions(options, SupplyOrderTokens.APPROVAL);\n \t}",
"private boolean xmlGenerationRequired() {\r\n boolean xmlOutOfSync = false;\r\n BudgetSubAwardBean budgetSubAwardBean;\r\n for(int index = 0; index < data.size(); index++) {\r\n budgetSubAwardBean = (BudgetSubAwardBean)data.get(index);\r\n if(budgetSubAwardBean.getXmlAcType()!=null || budgetSubAwardBean.getXmlUpdateTimestamp() == null) {\r\n xmlOutOfSync = true;\r\n break;\r\n }\r\n }\r\n \r\n return xmlOutOfSync;\r\n }",
"public boolean isWaitingForPaymentDetailsUpdate() {\n ThreadUtils.assertOnUiThread();\n return mCallback != null;\n }",
"@Override\n\tpublic boolean isApproved() {\n\t\treturn model.isApproved();\n\t}",
"@Override\n public boolean isApproved() {\n return _person.isApproved();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method was generated by Abator for iBATIS. This method sets the value of the database column WLSCM.JAT_MATER_TRANS.STYLEORNACLASS | public void setStyleornaclass(BigDecimal styleornaclass) {
this.styleornaclass = styleornaclass;
} | [
"protected void setStyle(RMTextStyle aStyle) { _style = aStyle; }",
"public void setStyle(Style newStyle){\r\n\tstyle = newStyle;\r\n }",
"protected String getStyleClass()\n {\n return _styleClass;\n }",
"public void setStyle(String operationStyle)\n {\n mOperationStyle = operationStyle;\n }",
"final public void setStyleClass(String styleClass)\n {\n setProperty(STYLE_CLASS_KEY, (styleClass));\n }",
"public void setStyle(int style)\r\n {\r\n this.style = style;\r\n }",
"public void setEncodingStyle(String val) {\n mEncodingStyle = val;\n }",
"public void setStylemiddleclass(BigDecimal stylemiddleclass) {\n this.stylemiddleclass = stylemiddleclass;\n }",
"public BigDecimal getStyleornaclass() {\n return styleornaclass;\n }",
"public void xsetEncodingStyle(org.xmlsoap.schemas.wsdl.soap.EncodingStyle encodingStyle)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.xmlsoap.schemas.wsdl.soap.EncodingStyle target = null;\n target = (org.xmlsoap.schemas.wsdl.soap.EncodingStyle)get_store().find_attribute_user(ENCODINGSTYLE$2);\n if (target == null)\n {\n target = (org.xmlsoap.schemas.wsdl.soap.EncodingStyle)get_store().add_attribute_user(ENCODINGSTYLE$2);\n }\n target.set(encodingStyle);\n }\n }",
"public void setEncodingStyle(java.util.List encodingStyle)\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(ENCODINGSTYLE$2);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(ENCODINGSTYLE$2);\n }\n target.setListValue(encodingStyle);\n }\n }",
"@Override\n public void initStyle() {\n\t// NOTE THAT EACH CLASS SHOULD CORRESPOND TO\n\t// A STYLE CLASS SPECIFIED IN THIS APPLICATION'S\n\t// CSS FILE\n \n // FOR CHANGING THE ITEMS INSIDE THE EDIT TOOLBAR\n editToolbarPane.getStyleClass().add(CLASS_EDITTOOLBAR_PANE);\n \n mapNameLabel.getStyleClass().add(CLASS_MAPNAME_LABEL);\n mapName.getStyleClass().add(CLASS_MAPNAME_TEXTFIELD);\n backgroundColorLabel.getStyleClass().add(CLASS_LABEL);\n borderColorLabel.getStyleClass().add(CLASS_LABEL);\n borderThicknessLabel.getStyleClass().add(CLASS_LABEL);\n zoomLabel.getStyleClass().add(CLASS_MAPNAME_LABEL);\n borderThicknessSlider.getStyleClass().add(CLASS_BORDER_SLIDER);\n mapZoomingSlider.getStyleClass().add(CLASS_ZOOM_SLIDER);\n buttonBox.getStyleClass().add(CLASS_PADDING);\n // FIRST THE WORKSPACE PANE\n workspace.getStyleClass().add(CLASS_BORDERED_PANE);\n }",
"private void setStyle() {\n this.getStyleClass().add(\"edge-arrow\");\n// idle();\n }",
"STYLE createSTYLE();",
"public void setSTYLE_ID(BigDecimal STYLE_ID)\r\n {\r\n\tthis.STYLE_ID = STYLE_ID;\r\n }",
"public abstract void setEncodingStyle(String encodingStyle)\n throws SOAPException;",
"public void setStyleName(String styleName) {\n cellState.styleName = styleName;\n row.section.markAsDirty();\n }",
"@VTID(90)\r\n void setTableStyle(\r\n java.lang.String rhs);",
"protected void createUrnopengisspecificationgmlschemadefaultStylev3Annotations() {\n\t\tString source = \"urn:opengis:specification:gml:schema-defaultStyle:v3.1.0\";\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\n\t\taddAnnotation\n\t\t (this, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"appinfo\", \"defaultStyle.xsd\"\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\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\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\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\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\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\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the attribute value for NtnNo, using the alias name NtnNo. | public String getNtnNo() {
return (String)getAttributeInternal(NTNNO);
} | [
"public String getNRN();",
"public String getCnicNo() {\n return (String)getAttributeInternal(CNICNO);\n }",
"public Number getNoatel()\r\n {\r\n return (Number) getAttributeInternal(NOATEL);\r\n }",
"public String getTallaNbr() {\n return (String)getAttributeInternal(TALLANBR);\n }",
"public Number getEmpno() {\r\n return (Number) getAttributeInternal(EMPNO);\r\n }",
"public String getNo() {\n return no;\n }",
"public String getShipMnftNo() {\n return (String) getAttributeInternal(SHIPMNFTNO);\n }",
"public abstract T getAttributValue(Node n);",
"public void setNtnNo(String value) {\n setAttributeInternal(NTNNO, value);\n }",
"public java.lang.String getNwaNumber() {\r\r\n return nwaNumber;\r\r\n }",
"public String getNpCod() {\n return (String)getAttributeInternal(NPCOD);\n }",
"public Long getNnid() {\n return nnid;\n }",
"public String getpropNo() {\n return (String)getNamedWhereClauseParam(\"propNo\");\n }",
"public String getprop_no() {\n return (String)getNamedWhereClauseParam(\"prop_no\");\n }",
"public Number getNumber(String attr) {\n return (Number) super.get(attr);\n }",
"java.lang.String getN();",
"public Number getTara()\n {\n return (Number)getAttributeInternal(TARA);\n }",
"public String getdNo() {\n return dNo;\n }",
"public int getNational_sale_number() {\n return national_sale_number;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ (2) The signatures on each input of the transaction are valid | private boolean checkSignatures(Transaction tx) {
boolean isValid = false;
int i = 0;
for (Transaction.Input txInput : tx.getInputs()) {
if (txInput.outputIndex >= 0 && txInput.prevTxHash.length > 0) {
UTXO utxo = new UTXO(txInput.prevTxHash, txInput.outputIndex);
if (utxoPool.contains(utxo)) {
if (utxoPool.getTxOutput(utxo) != null) {
Transaction.Output tOutput = utxoPool.getTxOutput(utxo);
if (tOutput.address != null) {
PublicKey publicKey = tOutput.address;
if (tx.getRawDataToSign(i) != null) {
byte[] message = tx.getRawDataToSign(i);
byte[] signature = txInput.signature;
if (publicKey != null && message != null && signature != null && message.length > 0
&& signature.length > 0) {
isValid = Crypto.verifySignature(publicKey, message, signature);
if (!isValid) {
return false;
}
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
i++;
} else {
return false;
}
}
return true;
} | [
"@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }",
"@Override\n public boolean isValid() {\n final BlockChainInt outputHash = getOutputHash();\n\n return inputs.stream().map(input -> input.verifySignature(outputHash)).reduce(true, (a, b) -> a && b)\n && outputs.stream().map(output -> output.getAmount() >= 0).reduce(true, (a, b) -> a && b)\n && getTransactionFee() >= 0;\n }",
"protected void validateSigner(Signer[] param){\r\n \r\n }",
"@Override\n public boolean verifySignature(byte[] signature) {\n try {\n Element[] sig = derDecode(signature);\n CL04SignPublicPairingKeySerParameter pk = (CL04SignPublicPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(pairingKeySerParameter.getParameters());\n Element a = sig[0];\n Element b = sig[1];\n Element c = sig[2];\n List<Element> A = IntStream.range(3, 3 + messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n List<Element> B = IntStream.range(3 + messages.size(), 3 + 2 * messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n return aFormedCorrectly(pairing, a, A, pk) && bFormedCorrectly(pairing, a, b, A, B, pk) && cFormedCorrectly(pairing, a, b, c, B, pk);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return false;\n\n }",
"void verifyTransactions();",
"@Override\n\tpublic void validateTimestamps() {\n\n\t\t/*\n\t\t * This validates the content-timestamp tokensToProcess present in the signature.\n\t\t */\n\t\tfor (final TimestampToken timestampToken : getContentTimestamps()) {\n\n\t\t\tfinal byte[] timestampBytes = getContentTimestampData(timestampToken);\n\t\t\ttimestampToken.matchData(timestampBytes);\n\t\t}\n\n\t\t/*\n\t\t * This validates the signature timestamp tokensToProcess present in the signature.\n\t\t */\n\t\tfor (final TimestampToken timestampToken : getSignatureTimestamps()) {\n\n\t\t\tfinal byte[] timestampBytes = getSignatureTimestampData(timestampToken, null);\n\t\t\ttimestampToken.matchData(timestampBytes);\n\t\t}\n\n\t\t/*\n\t\t * This validates the SigAndRefs timestamp tokensToProcess present in the signature.\n\t\t */\n\t\tfor (final TimestampToken timestampToken : getTimestampsX1()) {\n\n\t\t\tfinal byte[] timestampBytes = getTimestampX1Data(timestampToken, null);\n\t\t\ttimestampToken.matchData(timestampBytes);\n\t\t}\n\n\t\t/*\n\t\t * This validates the RefsOnly timestamp tokensToProcess present in the signature.\n\t\t */\n\t\tfor (final TimestampToken timestampToken : getTimestampsX2()) {\n\n\t\t\tfinal byte[] timestampBytes = getTimestampX2Data(timestampToken, null);\n\t\t\ttimestampToken.matchData(timestampBytes);\n\t\t}\n\n\t\t/*\n\t\t * This validates the archive timestamp tokensToProcess present in the signature.\n\t\t */\n\t\tfor (final TimestampToken timestampToken : getArchiveTimestamps()) {\n\n\t\t\tfinal byte[] timestampData = getArchiveTimestampData(timestampToken, null);\n\t\t\ttimestampToken.matchData(timestampData);\n\t\t}\n\t}",
"protected void validateReturn_signs(SignReturnV2[] param){\r\n \r\n }",
"private void validateFermatPacketSignature(FermatPacket fermatPacketReceive){\n\n System.out.println(\" WsCommunicationVPNClient - validateFermatPacketSignature\");\n\n /*\n * Validate the signature\n */\n boolean isValid = AsymmectricCryptography.verifyMessageSignature(fermatPacketReceive.getSignature(), fermatPacketReceive.getMessageContent(), vpnServerIdentity);\n\n System.out.println(\" WsCommunicationVPNClient - isValid = \" + isValid);\n\n /*\n * if not valid signature\n */\n if (!isValid){\n throw new RuntimeException(\"Fermat Packet received has not a valid signature, go to close this connection maybe is compromise\");\n }\n\n }",
"protected void validateCountersigners(Signer[] param){\r\n \r\n }",
"@Test\n public void TxHandlerTestForth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid signature\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx1: scrooge to alice 20 coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: alice to bob 20coins[signed by bob]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(20, pkBob.getPublic());\n tx2.signTx(pkBob.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n }",
"@Test\n public void testGetSignature() {\n System.out.println(\"getSignature\");\n Transaction instance = new Transaction();\n byte[] expResult = null;\n byte[] result = instance.getSignature();\n assertArrayEquals(expResult, result);\n }",
"private void checkSignature() {\n try { \n if(message.checkSignature()){\n JOptionPane.showMessageDialog(null, \"Signature was verified. The identity of the sender is displayed in the text area.\", \"Signature Confirmed\", JOptionPane.INFORMATION_MESSAGE);\n } else {\n JOptionPane.showMessageDialog(null, \"Signature could not be verified. This means the message was likely modified in transit or forged.\", \"Warning\", JOptionPane.WARNING_MESSAGE);\n }\n } catch (MessageEncryptedException ex) {\n JOptionPane.showMessageDialog(null, \"You must decrypt the message before you can check the signature.\", \"Error\", JOptionPane.ERROR_MESSAGE);\n } catch (MessageNotSignedException ex) {\n JOptionPane.showMessageDialog(null, \"The message was not signed, so we cannot validate the identity of the sender.\", \"Error\", JOptionPane.ERROR_MESSAGE);\n }\n }",
"public boolean verifyTransaction(Transaction transaction){\n\t\tString p;\n\t\tdouble calculated_amount=0;\n\t\tString sender=transaction.getSenderId();\n\t\tboolean flag = false;\n\t\tListIterator<String> itr=transaction.getInputTransactions().listIterator();\n\t\twhile(itr.hasNext())\n\t\t{\n\t\t\tp=itr.next();\n\t\t\tListIterator<Transaction> itr_ledger=ledger.listIterator();\n\t\t\twhile(itr_ledger.hasNext())\n\t\t\t{\n\t\t\t\tflag=false;\n\t\t\t\tTransaction t=itr_ledger.next();\n\t\t\t\tif(t.getTransactionId().equals(p))\n\t\t\t\t{\n\t\t\t\t\tif(t.isValid())\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(t.getReceiverId().equals(sender))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcalculated_amount +=t.getAmount();\n\t\t\t\t\t\t\t\tflag=true;\n\t\t\t\t\t\t\t\tbreak;\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\tSystem.out.println(transaction.getTransactionId()+\":Input transaction contains a useless Transaction\");\n\t\t\t\t\t\t\t\treturn false; //useless transaction\t\n\t\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\t\tSystem.out.println(transaction.getTransactionId()+\"Input transaction contains an invalid transaction\");\n\t\t\t\t\t\t\treturn false; //transaction is invalid\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!flag)\n\t\t\t{\n\t\t\t\tSystem.out.println(transaction.getTransactionId()+\" Transaction wasn't found in the ledger\");\n\t\t\t\treturn false; //transaction not found\n\t\t\t}\t\n\t\t}\n\n\t\tif(calculated_amount > transaction.getAmount())\n\t\t{\n\t\t\taddTransaction(transaction);\n\t\t\tdouble difference=calculated_amount-transaction.getAmount();\n\t\t\tTransaction self= new Transaction();\n\t\t\t\n\t\t\tString transaction_parts[]=transaction.getTransactionId().split(\"T\");\n\t\t\tint transaction_number=Integer.parseInt(transaction_parts[1]);\n\t\t\ttransaction_number++;\n\t\t\tself.setTransactionId(transaction_parts[0]+\"T\"+transaction_number);\n\t\t\t//int transaction_number=Integer.parseInt(transaction.getTransactionId().substring(id_length-4));\n\t\t\t//self.setTransactionId(transaction.getTransactionId().substring(0,id_length-4)+(transaction_number+1));\n\t\t\tself.setAmount(difference);\n\t\t\tself.setSenderId(transaction.getSenderId());\n\t\t\tself.setReceiverId(transaction.getSenderId());\n\t\t\tself.setWitnessId(transaction.getWitnessId());\n\t\t\tself.setValid(true);\n\t\t\taddTransaction(self);\n\t\t}\n\t\telse if(calculated_amount < transaction.getAmount())\n\t\t{\n\t\t\tSystem.out.println(transaction.getTransactionId()+\"Total amount insufficient for the transaction\");\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\taddTransaction(transaction);\n\t\t}\n\t\tinvalidateInputTransactions(transaction);\n\t\treturn true;\n\t}",
"public boolean verifiySignature() {\n\t\tString data = StringUtil.getStringFromKey(sender) + StringUtil.getStringFromKey(reciepient)\n\t\t\t\t+ Float.toString(value);\n\t\treturn StringUtil.verifyECDSASig(sender, data, signature);\n\t}",
"@Suspendable\n @Override\n protected void checkTransaction(SignedTransaction stx) throws FlowException {\n }",
"protected void validateSignRequestV2(SignRequestV2[] param){\r\n \r\n }",
"boolean verifySignature(byte[] data, byte[] signature, PublicKey publicKey);",
"Entry<StatusType, String> verifyExternalSignature(Document document, Document signature);",
"boolean verifySignature(byte[] message, byte[] signature, PublicKey publicKey) throws IOException;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve the details of stage columns within this particular DataStage job using the type provided: some IGC versions need to retrieve 'stage_column' and others must retrieve 'ds_stage_column'. | private List<StageColumn> getStageColumnDetailsForLinks(String usingType, String jobRid) throws IGCException {
final String methodName = "getStageColumnDetailsForLinks";
IGCSearch igcSearch = new IGCSearch(usingType);
igcSearch.addProperties(DataStageConstants.getStageColumnSearchProperties());
IGCSearchCondition condition = new IGCSearchCondition("link.job_or_container", "=", jobRid);
IGCSearchConditionSet conditionSet = new IGCSearchConditionSet(condition);
igcSearch.addConditions(conditionSet);
ItemList<StageColumn> stageCols = igcRestClient.search(igcSearch);
if (stageCols.getPaging().getNumTotal() > 0) {
return igcRestClient.getAllPages(null, stageCols);
}
return null;
} | [
"private void getStageColumnDetailsForLinks() throws IGCException {\n String jobRid = job.getId();\n log.debug(\"Retrieving stage column details for job: {}\", jobRid);\n List<StageColumn> stageCols = getStageColumnDetailsForLinks(\"stage_column\", jobRid);\n if (stageCols == null) {\n log.info(\"Unable to identify stage columns for job by 'stage_column', reverting to 'ds_stage_column'.\");\n stageCols = getStageColumnDetailsForLinks(\"ds_stage_column\", jobRid);\n }\n if (stageCols != null) {\n buildMap(columnMap, stageCols);\n } else if (type.equals(JobType.JOB)) {\n // Only warn about finding no columns if this is a Job (Sequences in general will not have stage columns)\n log.warn(\"Unable to identify any stage columns for job: {}\", jobRid);\n }\n }",
"@DISPID(20) //= 0x14. The runtime will prefer the VTID if present\n @VTID(43)\n String columnType();",
"public TypeData getTypeData(MigrationType type);",
"public String getCOL_TYPE() {\r\n return COL_TYPE;\r\n }",
"public String getColType() {\r\n return colType;\r\n }",
"public void addColumnTumorStageType() {\n addColumnInPrimarySection(ColumnMetaData.KEY_SECTION_TUMOR_STAGE_TYPE);\n }",
"private String parseColumnNameAndTypesInSchemaJson(String schema) {\n JSONObject json = (JSONObject) new JSONObject(schema).query(\"/mappings/properties\");\n return json.keySet().stream().\n map(colName -> colName + \" \" + mapToJDBCType(json.getJSONObject(colName).getString(\"type\")))\n .collect(joining(\",\"));\n }",
"@DISPID(15) //= 0xf. The runtime will prefer the VTID if present\n @VTID(34)\n String userColumnType();",
"public String[] externalTypesForJdbcType(int type);",
"public List<Datatype> getColumnsType();",
"public String getClassColumnTypeName(int colTypeId) throws Exception {\n String dataTypeName;\n\n switch (colTypeId) {\n case 1:\n case 2:\n case 19:\n case 21:\n case 22:\n case 24:\n dataTypeName = \"int\";\n break;\n\n case 20:\n case 23:\n dataTypeName = \"long\";\n break;\n\n case 3:\n case 4:\n case 5:\n case 27:\n dataTypeName = \"double\";\n break;\n\n case 7:\n case 33:\n case 34:\n dataTypeName = \"char\";\n break;\n\n case 8:\n case 9:\n case 10:\n // case 11:\n // case 12:\n case 28:\n case 32:\n case 35:\n case 36:\n dataTypeName = \"String\";\n break;\n\n case 11:\n case 12:\n // binary and long Binary (mutilmedia files)\n dataTypeName = \"byte[]\";\n break;\n\n case 6:\n case 13:\n case 14:\n dataTypeName = \"java.util.Date\";\n break;\n\n default:\n dataTypeName = \"\";\n break;\n } // end switch\n return dataTypeName;\n }",
"ColumnTypeMetadata getTypeMetadata();",
"public Datatype getcolumnType(int index);",
"public TypeOffreDTO getStage(){\n\t\tstage = null;\n\t\tList<TypeOffreDTO> l = getNomenclatureDomainService().getTypesOffre();\n\t\tfor(TypeOffreDTO t : l){\n\t\t\tif(t.getCodeCtrl().equalsIgnoreCase(DonneesStatic.TYPE_OFFRE_CODE_CTRL_STAGE)){\n\t\t\t\tstage=t;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn stage;\n\t}",
"com.vitessedata.llql.llql_proto.LLQLData.Schema getCols();",
"String getJdbcType();",
"public java.lang.String getColumnType() {\n return columnType;\n }",
"public com.amazon.ask.smapi.model.v1.StageV2Type getStage() {\n return com.amazon.ask.smapi.model.v1.StageV2Type.fromValue(stage);\n }",
"public int getJdbcType();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get token life duration | Duration getTokenExpiredIn(); | [
"public long getTokenValidityInSeconds() {\n return tokenValidityInSeconds;\n }",
"public long getTokenValidityInSecondsForRememberMe() {\n return tokenValidityInSecondsForRememberMe;\n }",
"public Long getExpiryDuration() {\n return jwtExpirationInMs;\n }",
"long getMaxLifetime();",
"public long getLifetime(){ return lifetime; }",
"public Date getTokenExpTime() {\r\n return tokenExpTime;\r\n }",
"public long getLifetime() {\n return lifetime;\n }",
"public int getContainerTokenExpiryInterval() {\n return containerTokenExpiryInterval;\n }",
"public long getLifetime() {\n return lifetime;\n }",
"@Override\n public Integer getAccessTokenValiditySeconds() {\n return client.getAccessTokenValidity();\n }",
"public double getLifeTime() {\n\t\treturn lifetime;\n\t}",
"private LocalDateTime getRefreshTokenExpiresIn() {\n return LocalDateTime.now().plus(jwtConfigProperties.getRefreshToken().getValidity(), ChronoUnit.DAYS);\n }",
"public Integer getAccessTokenValiditySeconds() {\n return accessTokenValiditySeconds;\n }",
"public double getLifetime() { return lifetime; }",
"public int getLifeTime() {\n return lifeTime;\n }",
"@Override\n public Integer getRefreshTokenValiditySeconds() {\n return client.getRefreshTokenValidity();\n }",
"public Integer getSessionTokenExpiryInMillis() {\n return sessionTokenExpiryInMillis;\n }",
"long getExpiration();",
"public Integer getRefreshTokenValiditySeconds() {\n return refreshTokenValiditySeconds;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether the action associated with this form instance maps to the Narrative page | private boolean isNarrativeAction() {
boolean isNarrativeAction = false;
if (StringUtils.isNotBlank(actionName) && StringUtils.isNotBlank(getMethodToCall())
&& actionName.contains("AbstractsAttachments")
&& StringUtils.isEmpty(navigateTo) && !getMethodToCall().equalsIgnoreCase(Constants.HEADER_TAB)) {
isNarrativeAction = true;
} else if (StringUtils.isNotEmpty(navigateTo) && navigateTo.equalsIgnoreCase(Constants.ATTACHMENTS_PAGE)) {
isNarrativeAction = true;
}
return isNarrativeAction;
} | [
"public boolean isPageRequested() {\n\n // If we're in add XML MO mode and have at least one future MO, a new page is not desired.\n if (wizard.isInAddXmlMoMode() && wizard.hasFutureManagedObjects()) {\n return false;\n }\n\n return getPageIdx() >= 0;\n }",
"public boolean isSetAction() {\n return this.action != null;\n }",
"private boolean isProposalAction() {\n boolean isProposalAction = false;\n\n if ((StringUtils.isNotBlank(actionName) && StringUtils.isNotBlank(getMethodToCall()))\n && actionName.startsWith(\"Proposal\") && !actionName.contains(\"AbstractsAttachments\")\n && !actionName.contains(\"BudgetVersions\")\n && StringUtils.isEmpty(navigateTo) && !getMethodToCall().equalsIgnoreCase(Constants.HEADER_TAB)) {\n isProposalAction = true;\n } else if (StringUtils.isNotEmpty(navigateTo) && (navigateTo.equalsIgnoreCase(Constants.PROPOSAL_PAGE)\n || navigateTo.equalsIgnoreCase(Constants.SPECIAL_REVIEW_PAGE) || navigateTo.equalsIgnoreCase(Constants.CUSTOM_ATTRIBUTES_PAGE)\n || navigateTo.equalsIgnoreCase(Constants.KEY_PERSONNEL_PAGE) || navigateTo.equalsIgnoreCase(Constants.PERMISSIONS_PAGE)\n || navigateTo.equalsIgnoreCase(Constants.QUESTIONS_PAGE)\n || navigateTo.equalsIgnoreCase(Constants.GRANTS_GOV_PAGE) || navigateTo.equalsIgnoreCase(Constants.PROPOSAL_ACTIONS_PAGE))) {\n isProposalAction = true;\n }\n\n return isProposalAction;\n }",
"public boolean isActionAllowed(T document, String action);",
"public boolean isSetAction() {\n\t\treturn this.action != null;\n\t}",
"public static boolean validAction(HttpServletRequest request) {\r\n return (request != null && !StringUtils.isNullOrEmpty(request.getParameter(Actions.ACTION)));\r\n }",
"boolean hasHas_action();",
"public boolean hasAction() {\n return Check.hasLength(action);\n }",
"public boolean action_allowed(){\r\n\t\treturn action_holds.size()==0;\r\n\t}",
"public abstract void verifyCurrentPage();",
"private boolean isActionAlreadySet() {\n\t\treturn this.action != noAction;\n\t}",
"Boolean isFormReference();",
"private boolean isPageToolDefault(HttpServletRequest request)\n\t{\n\t\tif ( request.getPathInfo() != null && request.getPathInfo().startsWith(\"/helper/\") ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tString action = request.getParameter(RequestHelper.ACTION);\n\t\tif (action != null && action.length() > 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tString pageName = request.getParameter(ViewBean.PAGE_NAME_PARAM);\n\t\tif (pageName == null || pageName.trim().length() == 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"boolean hasRemarketingAction();",
"public boolean isForm();",
"public boolean validateAction(AIAction act){\n if(act.getAIAction() == AIAction.None){\n return true;\n }\n return false;\n }",
"public boolean isSetErrorAffectedPageactionCount()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(ERRORAFFECTEDPAGEACTIONCOUNT$8) != null;\r\n }\r\n }",
"public abstract void isOnPage();",
"public abstract void checkPage();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new XY series consisting of the x values and the imaginary parts of the complex y values in this complex XY series. | public XYSeries imagXYSeries()
{
final XYSeriesComplex outer = this;
return new XYSeries()
{
public int length()
{
return outer.length();
}
public double x (int i)
{
return outer.x (i);
}
public double y (int i)
{
return outer.imag (i);
}
};
} | [
"public Series imagSeries()\n\t\t{\n\t\tfinal XYSeriesComplex outer = this;\n\t\treturn new Series()\n\t\t\t{\n\t\t\tpublic int length()\n\t\t\t\t{\n\t\t\t\treturn outer.length();\n\t\t\t\t}\n\t\t\tpublic double x (int i)\n\t\t\t\t{\n\t\t\t\treturn outer.imag (i);\n\t\t\t\t}\n\t\t\t};\n\t\t}",
"public XYSeries realXYSeries()\n\t\t{\n\t\tfinal XYSeriesComplex outer = this;\n\t\treturn new XYSeries()\n\t\t\t{\n\t\t\tpublic int length()\n\t\t\t\t{\n\t\t\t\treturn outer.length();\n\t\t\t\t}\n\t\t\tpublic double x (int i)\n\t\t\t\t{\n\t\t\t\treturn outer.x (i);\n\t\t\t\t}\n\t\t\tpublic double y (int i)\n\t\t\t\t{\n\t\t\t\treturn outer.real (i);\n\t\t\t\t}\n\t\t\t};\n\t\t}",
"public XYSeries magnitudeXYSeries()\n\t\t{\n\t\tfinal XYSeriesComplex outer = this;\n\t\treturn new XYSeries()\n\t\t\t{\n\t\t\tpublic int length()\n\t\t\t\t{\n\t\t\t\treturn outer.length();\n\t\t\t\t}\n\t\t\tpublic double x (int i)\n\t\t\t\t{\n\t\t\t\treturn outer.x (i);\n\t\t\t\t}\n\t\t\tpublic double y (int i)\n\t\t\t\t{\n\t\t\t\treturn outer.magnitude (i);\n\t\t\t\t}\n\t\t\t};\n\t\t}",
"public XYSeriesComplex()\n\t\t{\n\t\t}",
"public Complex complexMaker(int x, int y){\n return new Complex((realStart + (((double)x / (double)dimensionX) * (realEnd - realStart))), (imStart + (((double)y / (double)dimensionY) * (imEnd - imStart))));\n }",
"public XYSeries squaredMagnitudeXYSeries()\n\t\t{\n\t\tfinal XYSeriesComplex outer = this;\n\t\treturn new XYSeries()\n\t\t\t{\n\t\t\tpublic int length()\n\t\t\t\t{\n\t\t\t\treturn outer.length();\n\t\t\t\t}\n\t\t\tpublic double x (int i)\n\t\t\t\t{\n\t\t\t\treturn outer.x (i);\n\t\t\t\t}\n\t\t\tpublic double y (int i)\n\t\t\t\t{\n\t\t\t\treturn outer.squaredMagnitude (i);\n\t\t\t\t}\n\t\t\t};\n\t\t}",
"public XYSeries phaseXYSeries()\n\t\t{\n\t\tfinal XYSeriesComplex outer = this;\n\t\treturn new XYSeries()\n\t\t\t{\n\t\t\tpublic int length()\n\t\t\t\t{\n\t\t\t\treturn outer.length();\n\t\t\t\t}\n\t\t\tpublic double x (int i)\n\t\t\t\t{\n\t\t\t\treturn outer.x (i);\n\t\t\t\t}\n\t\t\tpublic double y (int i)\n\t\t\t\t{\n\t\t\t\treturn outer.phase (i);\n\t\t\t\t}\n\t\t\t};\n\t\t}",
"public Series realSeries()\n\t\t{\n\t\tfinal XYSeriesComplex outer = this;\n\t\treturn new Series()\n\t\t\t{\n\t\t\tpublic int length()\n\t\t\t\t{\n\t\t\t\treturn outer.length();\n\t\t\t\t}\n\t\t\tpublic double x (int i)\n\t\t\t\t{\n\t\t\t\treturn outer.real (i);\n\t\t\t\t}\n\t\t\t};\n\t\t}",
"public Series magnitudeSeries()\n\t\t{\n\t\tfinal XYSeriesComplex outer = this;\n\t\treturn new Series()\n\t\t\t{\n\t\t\tpublic int length()\n\t\t\t\t{\n\t\t\t\treturn outer.length();\n\t\t\t\t}\n\t\t\tpublic double x (int i)\n\t\t\t\t{\n\t\t\t\treturn outer.magnitude (i);\n\t\t\t\t}\n\t\t\t};\n\t\t}",
"public void complexValue(double i,double j)\r\n{\r\n\tznow_r=(((double)i*2)/800)-1;\r\n\tznow_c=1-(((double)j*2)/800);\r\n}",
"private Complex[] toComplex(double[] real, double[] imaginary) {\n int N = real.length;\n Complex[] x = complexResult;\n for (int i = 0; i < N; i++) {\n x[i].re = real[i];\n x[i].im = imaginary[i];\n }\n return x;\n }",
"public Series squaredMagnitudeSeries()\n\t\t{\n\t\tfinal XYSeriesComplex outer = this;\n\t\treturn new Series()\n\t\t\t{\n\t\t\tpublic int length()\n\t\t\t\t{\n\t\t\t\treturn outer.length();\n\t\t\t\t}\n\t\t\tpublic double x (int i)\n\t\t\t\t{\n\t\t\t\treturn outer.squaredMagnitude (i);\n\t\t\t\t}\n\t\t\t};\n\t\t}",
"private double[] combineComplex(double[] real, double[] imaginary) {\n int N = real.length*2;\n double[] c = doubleMemoryArray;\n for (int i = 0; i < N; i+=2) {\n c[i] = real[i/2];\n c[i + 1] = imaginary[i/2];\n }\n return c;\n }",
"public Complex getComplex() {return this;}",
"Complex(){\r\n real = 1;\r\n imaginary = 1;\r\n }",
"public ComplexFrame toComplexFrame(float[] fftValues) {\n int length = resolution / 2 + 1;\n float[] real = new float[length];\n float[] imag = new float[length];\n\n //bin 0 and n/2 always have an imaginary value of 0\n real[0] = fftValues[0];\n imag[0] = 0;\n real[length - 1] = fftValues[1];\n imag[length - 1] = 0;\n for (int i = 1; i < resolution / 2; i++) {\n real[i] = fftValues[2 * i];\n imag[i] = fftValues[2 * i + 1];\n }\n return new ComplexFrame(real, imag);\n }",
"public Series phaseSeries()\n\t\t{\n\t\tfinal XYSeriesComplex outer = this;\n\t\treturn new Series()\n\t\t\t{\n\t\t\tpublic int length()\n\t\t\t\t{\n\t\t\t\treturn outer.length();\n\t\t\t\t}\n\t\t\tpublic double x (int i)\n\t\t\t\t{\n\t\t\t\treturn outer.phase (i);\n\t\t\t\t}\n\t\t\t};\n\t\t}",
"public void complex_mult_0_10() {\n final double t = x_10 * x_0 - y_10 * y_0;\n y_10 = x_10 * y_0 + y_10 * x_0;\n x_10 = t;\n }",
"public void complex_mult_2_10() {\n final double t = x_10 * x_2 - y_10 * y_2;\n y_10 = x_10 * y_2 + y_10 * x_2;\n x_10 = t;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Popup to remove a trap | private void popupRemoveTrap() {
new AlertDialog.Builder(this)
.setTitle("Remove " + trap.getName())
.setMessage("Do you really want to remove " + trap.getName() + "?")
.setIcon(android.R.drawable.ic_dialog_alert)
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
Auth.getInstance().removeDeviceTopics(trap.getId(), new Runnable() {
@Override
public void run() {
MqttClient.getInstance().connect();
runOnUiThread(new Runnable() {
@Override
public void run() {
remove = true;
finish();
}
});
}
});
}
})
.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
}).show();
} | [
"private void popupDelete() {\n\t\taufzugschacht.removeElement(this);\n\t}",
"public void removeBtnHandler(MouseEvent event){\n RemoveScreenStarter r = new RemoveScreenStarter(); //Open remove windwo\n r.start(null);\n }",
"void commandHidePopup() throws UnifyException;",
"private void RemoveTileFromRack(){\n setOnMouseClicked(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n event.consume();\n hideTiles(tileval);\n }\n });\n }",
"public void OnDeleteRecipe (View View)\n {\n \t\tImageView darkenScreen = (ImageView) findViewById(R.id.darkenScreen);\n \t\tLayoutParams darkenParams = darkenScreen.getLayoutParams();\n \t\tdarkenParams.height = 1000;\n \t\tdarkenParams.width = 1000;\n \t\tdarkenScreen.setLayoutParams(darkenParams);\n \t\t//make the popup\n \t\tLinearLayout layout = new LinearLayout(this);\n \t\tLayoutInflater inflater = LayoutInflater.from(this);\n \t\tpopUp = new PopupWindow(inflater.inflate(R.layout.popup_delete_recipe, null, false),300,150,true);\n \t\tpopUp.showAtLocation(layout, Gravity.CENTER, 0, 0);\n \t\t\n \t\t//Log.d(\"what\", \"what\");\n \t\t//popUp.update(50, 50, 300, 80);\n \t\t\n \n }",
"void deactivatePopupContainer();",
"public static String _btncerrarpopup_click() throws Exception{\nmostCurrent._panelpopups_1.RemoveView();\n //BA.debugLineNum = 117;BA.debugLine=\"butPatas.Visible = True\";\nmostCurrent._butpatas.setVisible(anywheresoftware.b4a.keywords.Common.True);\n //BA.debugLineNum = 118;BA.debugLine=\"butColor.Visible = True\";\nmostCurrent._butcolor.setVisible(anywheresoftware.b4a.keywords.Common.True);\n //BA.debugLineNum = 119;BA.debugLine=\"lblFondo.RemoveView\";\nmostCurrent._lblfondo.RemoveView();\n //BA.debugLineNum = 120;BA.debugLine=\"End Sub\";\nreturn \"\";\n}",
"void declineTheTouchIdAccessSetUpPopupIfDisplayed() throws Exception;",
"public void windowDeiconified(WindowEvent arg0) {\n //textArea1.append(\"Window is in normal state\");\n\n }",
"private void dismissPlayerTipView()\n {\n LogTool.d(LogTool.MEPG, \"dismissPlayerTipView()\");\n Intent dissmissIntent = new Intent(CommonValue.DTV_INTENT_DISMISS_TIP);\n //this.sendBroadcast(dissmissIntent);\n CommonDef.sendBroadcastEx(RecordingListActivity.this, dissmissIntent);\n }",
"public void hidePopup() {\n showPopup(false);\n }",
"private void exitAction_main_region_DismissCall() {\n\t\ttimer.unsetTimer(this, 2);\n\t}",
"public void remClickEvent(){\n ((ViewDMO) core).remClickEvent();\n }",
"private void checkTrap(MMClient client) {\n\t\tbodyToRemove = trapToRemove.poll();\n\t\tif (bodyToRemove != null) {\n\t\t\ttrapList.remove(bodyToRemove.getPosition());\n\t\t\tclient.removeTrapLocation(bodyToRemove.getPosition().x, bodyToRemove.getPosition().y);\n\t\t\tbodyToRemove.setActive(false);\n\t\t\tbodyToRemove.setTransform(0, 0, 0);\n\t\t}\n\t}",
"protected void onRemove() {\n currentSo = null;\n showInformation(\"simulationObjectView\");\n }",
"public void uninstallPopup(JTable table) {\n\t\t// Remove Listener\n\t\ttable.getTableHeader().removeMouseListener(mouseListener);\n\t}",
"public void onNoDeletePlayer() {\n view.dismissPopUp();\n }",
"public void mouseReleased(MouseEvent evt) {\n\t\ttryPopUp(evt);\n//\t\t***** GMA 1.6.2\n\t}",
"void removePopupMessageListener(SystrayPopupMessageListener listener);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the usuarioFirmante value for this RequestExternalGenerarTarea. | public void setUsuarioFirmante(generartarea.external.services.satra.gedo.gcaba.gob.ar.RequestExternalGenerarTareaUsuarioFirmanteEntry[] usuarioFirmante) {
this.usuarioFirmante = usuarioFirmante;
} | [
"public generartarea.external.services.satra.gedo.gcaba.gob.ar.RequestExternalGenerarTareaUsuarioFirmanteEntry[] getUsuarioFirmante() {\n return usuarioFirmante;\n }",
"public void setUsuario(java.lang.String usuario) {\n this.usuario = usuario;\n }",
"public void setUsuarioRegistro(String usuarioRegistro) {\r\n this.usuarioRegistro = usuarioRegistro;\r\n }",
"public void setPaqueteUsuario(final PaqueteUsuario paqueteUsuario) {\r\n this.paqueteUsuario = paqueteUsuario;\r\n }",
"public void setUsuario(java.lang.String usuario);",
"public void setPaqueteUsuario(final PaqueteUsuario paqueteUsuario) {\r\n\tthis.paqueteUsuario = paqueteUsuario;\r\n }",
"public void setUsuarioAsociador(java.lang.String usuarioAsociador) {\n this.usuarioAsociador = usuarioAsociador;\n }",
"public void setCodigoUsuario(String codigoUsuario) {\r\n\t\tthis.codigoUsuario = codigoUsuario;\r\n\t}",
"public void setUsuarioModifico(String usuarioModifico) {\r\n this.usuarioModifico = usuarioModifico;\r\n }",
"public void ativarUsuario() {\n\t\tSystem.out.println(this.getUsuario().getNome());\n\n\t\tthis.getUsuario().setStatus(true);\n\t\tMsg.addMsgInfo(\"USUARIO: \" + getUsuario().getNome()\n\t\t\t\t+ \" ATIVADO COM SUCESSO\");\n\t\tdao.atualiza(usuario);\n\t\tSystem.out.println(\"...Usuario ativado\");\n\n\t\tthis.usuario = new Usuario();\n\t\tSystem.out.println(\"...usuario ativado com sucesso\");\n\n\t}",
"public void setUsuarioN(String usuarioN) {\n\t\tthis.usuarioN = usuarioN;\n\t}",
"public void setUsuario(java.lang.String newUsuario);",
"public void setCorreoUsuario(String correoUsuario) {\r\n this.correoUsuario = correoUsuario;\r\n }",
"public void setUsuarioReceptor(java.lang.String usuarioReceptor) {\n this.usuarioReceptor = usuarioReceptor;\n }",
"public abstract void setUsuarioModificacion( String usuarioModificacion );",
"public final void rule__ProveedorNube__AutenticacionUsuarioAssignment_7_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8288:1: ( ( ruleAutenticacionUsuario ) )\n // InternalCeffective.g:8289:2: ( ruleAutenticacionUsuario )\n {\n // InternalCeffective.g:8289:2: ( ruleAutenticacionUsuario )\n // InternalCeffective.g:8290:3: ruleAutenticacionUsuario\n {\n before(grammarAccess.getProveedorNubeAccess().getAutenticacionUsuarioAutenticacionUsuarioParserRuleCall_7_1_0()); \n pushFollow(FOLLOW_2);\n ruleAutenticacionUsuario();\n\n state._fsp--;\n\n after(grammarAccess.getProveedorNubeAccess().getAutenticacionUsuarioAutenticacionUsuarioParserRuleCall_7_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public void setOtro_telef(String otro_telef) {\n this.otro_telef = otro_telef;\n }",
"public void setUsuarioEmisor(java.lang.String usuarioEmisor) {\n this.usuarioEmisor = usuarioEmisor;\n }",
"public void setFaseActivaSegunPermisos(Usuario pUsuario) {\r\n\t\tif(faseActual != null) {\r\n\t\t\tif(faseActual.getFaseAVolver() != null) {\r\n\t\t\t\t// Es una Fase Especial, solo ciertas personas pueden ver que está en esta fase.\r\n\t\t\t\tif(nodoProcedimiento.getResponsable().esResponsable(pUsuario)\r\n\t\t\t\t\t\t|| nodoProcedimiento.getResponsable().esSupervisor(pUsuario)\r\n\t\t\t\t\t\t|| (faseActual.getNodoProcedimiento().getResponsable() != null && (faseActual.getNodoProcedimiento().getResponsable().esResponsable(pUsuario) || faseActual\r\n\t\t\t\t\t\t\t\t.getNodoProcedimiento().getResponsable().esSupervisor(pUsuario)))\r\n\t\t\t\t\t\t|| (faseActual.getFaseAVolver().getNodoProcedimiento().getResponsable() != null && (faseActual.getFaseAVolver().getNodoProcedimiento().getResponsable()\r\n\t\t\t\t\t\t\t\t.esResponsable(pUsuario) || faseActual.getFaseAVolver().getNodoProcedimiento().getResponsable().esSupervisor(pUsuario)))) {\r\n\t\t\t\t\tfaseActualSegunPermisos = faseActual;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Va a ver como Fase actual la Fase a la que vuelve el expediente.\r\n\t\t\t\t\tfaseActualSegunPermisos = faseActual.getFaseAVolver();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tfaseActualSegunPermisos = faseActual;\r\n\t\t\t}\r\n\t\t}\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
// whatsAtPos test // // This test case is unique and distinct because we are testing a condition in which our board is empty and thus our method should always return false | @Test
public void test_WhatsAtPos_boardEmpty(){
char[][] boardArray;
boardArray = new char[5][8];
for(int i = 0; i < 5; i++){
for(int j = 0; j < 8; j++){
boardArray[i][j] = ' ';
}
}
IGameBoard ourBoard = boardMaker(5, 8, 3);
assertEquals(' ', ourBoard.whatsAtPos(new BoardPosition(0, 0)));
assertEquals(ourBoard.toString(), boardDisplay(boardArray, 5, 8));
} | [
"@Test\n public void testIsPositionValid() {\n assertFalse(this.board.isPositionValid(new Position(-1, -1)));\n assertFalse(this.board.isPositionValid(new Position(11, 11)));\n for (int line = 0; line < 11; line++) {\n for (int column = 0; column < 11; column++) {\n assertTrue(this.board.isPositionValid(new Position(line, column)));\n }\n }\n }",
"@Test\n public void test_isPlayerAtPos_playerAtWrongPlace(){\n\n char[][] boardArray;\n boardArray = new char[5][8];\n\n for(int i = 0; i < 5; i++){\n for(int j = 0; j < 8; j++){\n boardArray[i][j] = ' ';\n }\n }\n\n // Putting player at random position\n boardArray[0][3] = 'X';\n\n IGameBoard ourBoard = boardMaker(5, 8, 3);\n\n ourBoard.placeToken('X',3);\n\n assertFalse(ourBoard.isPlayerAtPos(new BoardPosition(3, 3), 'X'));\n assertEquals(ourBoard.toString(), boardDisplay(boardArray, 5, 8));\n }",
"protected abstract void checkIfPosIsHole();",
"public boolean isValidPosition(Position pos){\n return (numCols > pos.getCol() && numRows > pos.getRow() && !(pos.getCol() < 0 || pos.getRow() < 0));\n}",
"private static void checkGridPos(int pos) {\n // Verifies if the colors in the position are all the same\n int[] pcs = pieces[pos - 1];\n int f = 0;\n for (; f < ColorFrames.FRAMES_DIM; ++f) {\n int color = pcs[f];\n if (color != pcs[0] || color == ColorFrames.NO_FRAME)\n break;\n }\n\n if (f == ColorFrames.FRAMES_DIM) {\n // If a piece is filled with one color only, then delete this piece\n clearGridPosition(pos);\n } else {\n // Verifies for lines, columns and diagonals that have colors different that NO_FRAME\n for (int fr = 0; fr < ColorFrames.FRAMES_DIM; ++fr) {\n int color = pcs[fr];\n if (color != ColorFrames.NO_FRAME) {\n checkLine(pos, color);\n checkColumn(pos, color);\n\n if (isInDiagonal(pos))\n checkDiagonals(pos, color);\n }\n }\n }\n\n Scoreboard.addPoints(pointsToAdd);\n pointsToAdd = 0;\n }",
"public static boolean attackedPos(Position pos) {\n TeamColour initialColour = ChessGame.getInstance().getColour();\n ChessGame.getInstance().switchTeam();\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n if (ChessBoard.getInstance().getBoard()[i][j] != null\n && ChessBoard.getInstance().getBoard()[i][j].getColour().\n equals(ChessGame.getInstance().getColour()) &&\n ChessBoard.getInstance().getBoard()[i][j].idx != 5) {\n LinkedList<Move> moves = ChessBoard.getInstance().\n getChessPiece(new Position(i, j)).getMoves(new Position(i, j));\n if (moves != null) {\n for (Move move : moves) {\n // if a move lands the opponent on the position that is being checked\n // that means the position is under possible attack\n if (move.getDest().getColumn() == pos.getColumn() \n && move.getDest().getRow() == pos.getRow()) {\n ChessGame.getInstance().setColour(initialColour);\n return true;\n }\n }\n }\n }\n }\n }\n ChessGame.getInstance().setColour(initialColour);\n return false;\n }",
"boolean isValidPosition(Position pos) {\n\t\tif ((pos.column>=0)&&(pos.column<=7)&&(pos.row>=0)&&(pos.row<=7)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"boolean checkPlacement( Square[] piece, Board board, Color color){\n\n \t//Checks for out of bounds or already taken\n \tfor (Square s : piece){\n \t\t\n \t\t//System.out.println(s.xLoc);\n \t\t//System.out.println(s.yLoc);\n \t\t\n \t\tif (s.xLoc > 19 || s.xLoc < 0) {\n \t\t\treturn false;\n \t\t}\n \t\t\n \t\tif (s.yLoc > 19 || s.yLoc < 0) {\n \t\t\treturn false;\n \t\t}\n \t\t\n \t\tif(Board.getTaken(s.xLoc , s.yLoc)) {\n \t\t\treturn false;\n \t\t}\n\n \t\t// if not first turn\n \t\tif(!firstTurnP) {\n \t\t\t\n \t\t\tboolean up = false;\n\t\t\t\tboolean left = false;\n\t\t\t\tboolean right = false;\n\t\t\t\tboolean down = false;\n\t\t\t\t\n\t\t\t\t// loop that checks which parts of a piece are a corner\n \t\t\tfor (int i = 0; i < piece.length; i ++) {\n \t\t\t\t\t\n \t\t\t\t\n \t\t\t\t\n \t\t\t\tif (piece[i].xLoc + 1 == s.xLoc && piece[i].yLoc == s.yLoc){\n \t\t\t\t\tdown = true;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (piece[i].xLoc - 1 == s.xLoc && piece[i].yLoc == s.yLoc){\n \t\t\t\t\tup = true;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (piece[i].yLoc + 1 == s.yLoc && piece[i].xLoc == s.xLoc){\n \t\t\t\t\tright = true;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (piece[i].yLoc - 1 == s.yLoc && piece[i].xLoc == s.xLoc){\n \t\t\t\t\tleft = true;\n \t\t\t\t}\n\n \t\t\t\t}\n \t\t\t\t\n \t\t\t//System.out.println(up);\n \t\t\t//System.out.println(down);\n \t\t\t//System.out.println(left);\n \t\t\t//System.out.println(right);\n \t\t\t\n \t\t\t//The rest of the if statements check corners against the current state of the board. checking if taken and color of pieces on board\n \t\t\t\n \t\t\tif(!up && !down && !left && !right ) {\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\tif(board.getTaken(s.xLoc - 1, s.yLoc -1) && board.gameBoard[s.xLoc - 1][s.yLoc -1].color == color) {\n\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif(board.gameBoard[s.xLoc - 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc-1].color == color) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(board.getTaken(s.xLoc - 1, s.yLoc + 1)&& board.gameBoard[s.xLoc - 1][s.yLoc +1].color == color) {\n\t\t\t\t\t\tif(board.gameBoard[s.xLoc - 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc+1].color == color) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(board.getTaken(s.xLoc + 1, s.yLoc -1)&& board.gameBoard[s.xLoc + 1][s.yLoc -1].color == color) {\n\t\t\t\t\t\tif(board.gameBoard[s.xLoc + 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc-1].color == color) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(board.getTaken(s.xLoc + 1, s.yLoc + 1)&& board.gameBoard[s.xLoc + 1][s.yLoc +1].color == color) {\n\t\t\t\t\t\tif(board.gameBoard[s.xLoc + 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc+1].color == color) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e) {\n\t\t\t\t\t\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\t\n \t\t\t\n \t\t\t\tif(up && !down && !left && !right) {\n \t\t\t\t\t\n \t\t\t\t\ttry {\n \t\t\t\t\tif(board.getTaken(s.xLoc - 1, s.yLoc + 1)&& board.gameBoard[s.xLoc - 1][s.yLoc +1].color == color) {\n \t\t\t\t\t\tif(board.gameBoard[s.xLoc - 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc+1].color == color) {\n \t\t\t\t\t\t\treturn false;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\treturn true;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\tif (board.getTaken(s.xLoc - 1, s.yLoc - 1)&& board.gameBoard[s.xLoc - 1][s.yLoc -1].color == color){\n \t\t\t\t\t\tif(board.gameBoard[s.xLoc - 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc-1].color == color) {\n \t\t\t\t\t\t\treturn false;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\treturn true;\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\n \t\t\t\t\t}\n \t\t\t\t\tcatch(Exception e) {\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\tif(down&& !left && !right && !up) {\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\ttry {\n \t\t\t\t\tif(board.getTaken(s.xLoc + 1, s.yLoc +1)&& board.gameBoard[s.xLoc + 1][s.yLoc +1].color == color) {\n \t\t\t\t\t\tif(board.gameBoard[s.xLoc + 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc+1].color == color) {\n \t\t\t\t\t\t\treturn false;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\treturn true;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\tif(board.getTaken(s.xLoc + 1, s.yLoc - 1)&& board.gameBoard[s.xLoc + 1][s.yLoc -1].color == color) {\n \t\t\t\t\t\tif(board.gameBoard[s.xLoc + 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc-1].color == color) {\n \t\t\t\t\t\t\treturn false;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\treturn true;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tcatch(Exception e) {\n \t\t\t\t\t\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\t\n \t\t\t\tif(left && !up && !down && !right) {\n \t\t\t\t\t\n \t\t\t\t\ttry {\n \t\t\t\t\tif(board.getTaken(s.xLoc + 1, s.yLoc -1)&& board.gameBoard[s.xLoc + 1][s.yLoc -1].color == color) {\n \t\t\t\t\t\tif(board.gameBoard[s.xLoc + 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc-1].color == color) {\n \t\t\t\t\t\t\treturn false;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\treturn true;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tif(board.getTaken(s.xLoc - 1, s.yLoc - 1)&& board.gameBoard[s.xLoc - 1][s.yLoc -1].color == color) {\n \t\t\t\t\t\tif(board.gameBoard[s.xLoc - 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc-1].color == color) {\n \t\t\t\t\t\t\treturn false;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\treturn true;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tcatch(Exception e) {\n \t\t\t\t\t\t\n \t\t\t\t\t}\n\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif(right && !up && !down && !left) {\n \t\t\t\n \t\t\t\t\t\n \t\t\t\t\ttry {\n \t\t\t\t\tif(board.getTaken(s.xLoc + 1, s.yLoc +1)&& board.gameBoard[s.xLoc + 1][s.yLoc +1].color == color) {\n \t\t\t\t\t\tif(board.gameBoard[s.xLoc + 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc+1].color == color) {\n \t\t\t\t\t\t\treturn false;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\treturn true;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tif(board.getTaken(s.xLoc - 1, s.yLoc + 1)&& board.gameBoard[s.xLoc - 1][s.yLoc +1].color == color) {\n \t\t\t\t\t\tif(board.gameBoard[s.xLoc - 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc+1].color == color) {\n \t\t\t\t\t\t\treturn false;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\treturn true;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tcatch(Exception e) {\n \t\t\t\t\t\t\n \t\t\t\t\t}\n\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\n \t\t\t\tif(down&& !left && right && !up) {\n \t\t\t\t\t\n \t\t\t\t\ttry {\n \t\t\t\t\n \t\t\t\t\tif(board.getTaken(s.xLoc + 1, s.yLoc +1)&& board.gameBoard[s.xLoc + 1][s.yLoc +1].color == color){\n \t\t\t\t\t\tif(board.gameBoard[s.xLoc + 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc+1].color == color) {\n \t\t\t\t\t\t\treturn false;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\treturn true;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tcatch(Exception e) {\n \t\t\t\t\t\t\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif(!down && !left && right && up) {\n \t\t\t\t\t\n \t\t\t\t\ttry {\n \t\t\t\t\n \t\t\t\t\tif(board.getTaken(s.xLoc - 1, s.yLoc +1)&& board.gameBoard[s.xLoc - 1][s.yLoc +1].color == color){\n \t\t\t\t\t\t\n \t\t\t\t\t\tif(board.gameBoard[s.xLoc - 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc+1].color == color) {\n \t\t\t\t\t\t\treturn false;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\treturn true;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tcatch(Exception e) {\n \t\t\t\t\t\t\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif(down && left && !right && !up) {\n \t\t\t\t\t\n \t\t\t\t\ttry {\n \t\t\t\t\n \t\t\t\t\tif(board.getTaken(s.xLoc + 1, s.yLoc -1)&& board.gameBoard[s.xLoc + 1][s.yLoc -1].color == color){\n \t\t\t\t\t\t\n \t\t\t\t\t\tif(board.gameBoard[s.xLoc + 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc-1].color == color) {\n \t\t\t\t\t\t\treturn false;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\treturn true;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tcatch(Exception e) {\n \t\t\t\t\t\t\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif(!down&& left && !right && up) {\n \t\t\t\t\n \t\t\t\t\ttry {\n \t\t\t\t\n \t\t\t\t\tif(board.getTaken(s.xLoc - 1, s.yLoc -1)&& board.gameBoard[s.xLoc - 1][s.yLoc -1].color == color){\n \t\t\t\t\t\tif(board.gameBoard[s.xLoc - 1][s.yLoc].color == color ||board.gameBoard[s.xLoc][s.yLoc-1].color == color) {\n \t\t\t\t\t\t\treturn false;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\treturn true;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tcatch(Exception e) {\n \t\t\t\t\t\t\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\n \t\t\t\tup = false;\n \t\t\t\tleft = false;\n \t\t\t\tright = false;\n \t\t\t\tdown = false;\n \t\t\t\n \t\t}\n \t\t\t\n \t\t//placement check for first turn. Must be corner\n \t\t\n \t\tif (firstTurnP){\n \t\t\t\n \t\t\t\n \t\t\tSystem.out.print(s.xLoc);\n \t\t\tSystem.out.println(s.yLoc);\n \t\t\tif(color == Color.RED) {\n \t\t\tif(s.xLoc == 19 && s.yLoc == 19) {\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\t}\n \t\t\tif(color == Color.BLUE) {\n \t\t\tif(s.xLoc == 19 && s.yLoc == 0) {\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\t}\n \t\t\tif(color == Color.GREEN) {\n \t\t\tif(s.xLoc == 0 && s.yLoc == 0) {\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\t}\n \t\t\tif(color == Color.YELLOW) {\n \t\t\tif(s.xLoc == 0 && s.yLoc == 19) {\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t\n \t\t\n \t\t\t\n \t\t}\n \t\t\n \t\t\n \t}\n\n \treturn false;\n \t\n \t\n }",
"public char whatsAtPos(BoardPosition pos){\n return gameGrid[pos.getRow()][pos.getColumn()];\n }",
"@Test\n public void ableToMoveTest() {\n /*\n At current position and out of bound\n */\n boolean case1 = bishopTestPiece.ableToMove(3, 3);\n assertEquals(case1, false);\n boolean case2 = bishopTestPiece.ableToMove(8, 8);\n assertEquals(case2, false);\n /*\n Possible moving position\n */\n boolean case3 = bishopTestPiece.ableToMove(5, 1);\n assertEquals(case3, true);\n boolean case4 = bishopTestPiece.ableToMove(1, 5);\n assertEquals(case4, true);\n boolean case5 = bishopTestPiece.ableToMove(1, 1);\n assertEquals(case5, true);\n boolean case6 = bishopTestPiece.ableToMove(5, 5);\n assertEquals(case6, true);\n /*\n Not possible moving position\n */\n boolean case7 = bishopTestPiece.ableToMove(0, 3);\n assertEquals(case7, false);\n boolean case8 = bishopTestPiece.ableToMove(6, 3);\n assertEquals(case8, false);\n boolean case9 = bishopTestPiece.ableToMove(3, 0);\n assertEquals(case9, false);\n boolean case10 = bishopTestPiece.ableToMove(3, 6);\n assertEquals(case10, false);\n\n }",
"public boolean isInsideBoard(Position pos){\n\t\tboolean inside = false;\n\t\t\n\t\tif (pos.getX()<this.getSize().getWidth() && pos.getX()>=0 &&\n\t\t\t\tpos.getY()<this.getSize().getHeight() && pos.getY()>=0)\n\t\t\tinside=true;\n\t\t\n\t\treturn inside;\n\t\t\n\t}",
"private boolean isValidMove(int position) {\n\t\tif( !(position >= 0) || !(position <= 8) ) return false;\n\n\t\treturn gameBoard[position] == 0;\n\t}",
"@Test\n\tvoid testMoveBlankBoard(){\n\t\tLocation v1 = new Location(0,1);\n\t\tLocation v2 = new Location(1,1);\n\t\tArrayList<Location> compare = PTestTOP.validMoves(board1);\n\t\tassertTrue(compare.contains(v1));\n\t\tassertTrue(compare.contains(v2));\n\n\t\t//Test for correct moves for PTestRIGHT (moving down):\n\t\t//Placed in location where pawn condition of 3 moves is possible\n\t\tv1 = new Location(5,4);\n\t\tv2 = new Location (5,5);\n\t\tLocation v3 = new Location(5,6);\n\t\tcompare.clear();\n\t\tcompare = PTestRIGHT.validMoves(board1);\n\t\tassertTrue(compare.contains(v1));\n\t\tassertTrue(compare.contains(v2));\n\t\tassertTrue(compare.contains(v3));\n\n\t\t//Test for correct moves for PTestLEFT (moving up):\n\t\tv1 = new Location(2,0);\n\t\tv2 = new Location (2,1);\n\t\tcompare.clear();\n\t\tcompare = PTestLEFT.validMoves(board1);\n\t\tassertTrue(compare.contains(v1));\n\t\tassertTrue(compare.contains(v2));\n\n\t\t//Test for correct moves for PTestBOTTOM (moving left):\n\t\tv1 = new Location(5,2);\n\t\tv2 = new Location (6,2);\n\t\tcompare.clear();\n\t\tcompare = PTestBOTTOM.validMoves(board1);\n\t\tassertTrue(compare.contains(v1));\n\t\tassertTrue(compare.contains(v2));\n\n\t}",
"boolean isIndirectUnderAttack(int kPos, Move m){\n int from = m.getFrom();\n if(kPos < 0 || kPos > 63 || state.at(m.getFrom()) == null)\n throw new IllegalArgumentException(\"invalid move\");\n Player currentPlayer = (state.at(m.getFrom()).getColor() == Color.BLACK)? black : white;\n\n if (kPos / 8 == from / 8) { // Same Row\n state.add(m);\n if (from < kPos) {\n int i = kPos - 1;\n while (i >=0 && i <64 && state.at(i) == null && i / 8 == kPos / 8)\n i++;\n if (( i >=0 && i <64 && state.at(i) != null && state.at(i).getColor() != currentPlayer.getColor() ) && (state.at(i).getPieceType() == PieceType.Rook || state.at(i).getPieceType() == PieceType.Queen) ) {\n state.undo();\n return true;\n }\n } else {\n int i = kPos + 1;\n while (i >=0 && i <64 && state.at(i) == null && i / 8 == kPos / 8)\n i++;\n if (( i >=0 && i <64 && state.at(i) != null && state.at(i).getColor() != currentPlayer.getColor() ) && (state.at(i).getPieceType() == PieceType.Rook || state.at(i).getPieceType() == PieceType.Queen) ) {\n state.undo();\n return true;\n }\n }\n state.undo();\n } else if (kPos % 8 == from % 8) { // Same Column\n state.add(m);\n if (from < kPos) {\n int i = kPos - 8;\n while (i >=0 && i <64 && state.at(i) == null && i % 8 == kPos % 8)\n i -= 8;\n if (( i >=0 && i <64 && state.at(i) != null && state.at(i).getColor() != currentPlayer.getColor() ) && (state.at(i).getPieceType() == PieceType.Rook || state.at(i).getPieceType() == PieceType.Queen) ) {\n state.undo();\n return true;\n }\n } else {\n int i = kPos + 8;\n while (i >=0 && i <64 && state.at(i) == null && i % 8 == kPos % 8)\n i += 8;\n if (( i >=0 && i <64 && state.at(i) != null && state.at(i).getColor() != currentPlayer.getColor() ) && (state.at(i).getPieceType() == PieceType.Rook || state.at(i).getPieceType() == PieceType.Queen) ) {\n state.undo();\n return true;\n }\n }\n state.undo();\n } else if (Math.abs(from / 8 - kPos / 8) == Math.abs(from % 8 - kPos % 8)) { // same diagonal\n state.add(m);\n if (from < kPos) {\n if (from % 8 < kPos % 8) {\n int i = kPos - 8 - 1;\n while (i >=0 && i <64 && state.at(i) == null && Math.abs(i / 8 - kPos / 8) == Math.abs(i % 8 - kPos % 8)) {\n i = i - 8 - 1;\n }\n if ((i >=0 && i <64 && state.at(i) != null && state.at(i).getColor() != currentPlayer.getColor()) && (state.at(i).getPieceType() == PieceType.Bishop || state.at(i).getPieceType() == PieceType.Queen)){\n state.undo();\n return true;\n }\n } else {\n int i = kPos - 8 + 1;\n while (i >=0 && i <64 && state.at(i) == null && Math.abs(i / 8 - kPos / 8) == Math.abs(i % 8 - kPos % 8)) {\n i = i - 8 + 1;\n }\n if ((i >=0 && i <64 && state.at(i) != null && state.at(i).getColor() != currentPlayer.getColor()) && (state.at(i).getPieceType() == PieceType.Bishop || state.at(i).getPieceType() == PieceType.Queen)) {\n state.undo();\n return true;\n }\n }\n } else {\n if (from % 8 < kPos % 8) {\n int i = kPos + 8 - 1;\n while (i >=0 && i <64 && state.at(i) == null && Math.abs(i / 8 - kPos / 8) == Math.abs(i % 8 - kPos % 8)) {\n i = i + 8 - 1;\n }\n if ((i >=0 && i <64 && state.at(i) != null && state.at(i).getColor() != currentPlayer.getColor()) && (state.at(i).getPieceType() == PieceType.Bishop || state.at(i).getPieceType() == PieceType.Queen)) {\n state.undo();\n return true;\n }\n } else {\n int i = kPos + 8 + 1;\n while (i >=0 && i <64 && state.at(i) == null && Math.abs(i / 8 - kPos / 8) == Math.abs(i % 8 - kPos % 8)) {\n i = i + 8 + 1;\n }\n if ((i >=0 && i <64 && state.at(i) != null && state.at(i).getColor() != currentPlayer.getColor()) && (state.at(i).getPieceType() == PieceType.Bishop || state.at(i).getPieceType() == PieceType.Queen)) {\n state.undo();\n return true;\n }\n }\n }\n state.undo();\n }\n return false;\n }",
"public boolean posTouching(Position pos, String s){\n\t\t// check whether at least one of the 8 (horizontal/vertical/diagonal) neighbors \n\t\t// of the specified position pos has a symbol as the incoming string s\n\t\t//\n\t\t// The eight horizontal/vertical/diagonal neighbors of a pos is shown as below: \n\t\t// up left / up / up right / left / right / down left/ down/ down right\n\t\t//\n\t\t// UL U UR\n\t\t// L pos R\n\t\t// DL D DR\n\t\t// \n\t\t// if at least one of the eight cells has string s as the symbol, return true;\n\t\t// return false otherwise\n\t\t// assuming HashMap overhead constant, O(1)\n\t\t\n\t\t\n\t\tif(isValidPosition(pos) && isValidSymbol(s)) {\n\t\t\t\n\t\t\tif(!grid.has(pos, s)) {\n\t\t\t\tint tempRow = pos.getRow();\n\t\t\t\tint tempCol = pos.getCol();\n\t\t\t\t\n\t\t\t\tboolean condition1 = false;\n\t\t\t\tboolean condition2 = false;\n\t\t\t\tboolean condition3 = false;\n\t\t\t\t\n\t\t\t\tif(tempRow == 0) { //if you want to add the tent to the first row (first row check)\n\t\t\t\t\t\n\t\t\t\t\tif(grid.has(new Position(tempRow,tempCol-1),treeSymbol) || grid.has(new Position(tempRow,tempCol+1),treeSymbol) || grid.has(new Position(tempRow+1,tempCol),treeSymbol)) { //If there is a tree next to or below the position\n\t\t\t\t\t\tcondition1 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!grid.has(new Position(tempRow,tempCol-1),tentSymbol) || !grid.has(new Position(tempRow,tempCol+1),tentSymbol) || !grid.has(new Position(tempRow+1,tempCol),tentSymbol)) { //If there is NO tent next to or below the position\n\t\t\t\t\t\tcondition2 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!grid.has(new Position(tempRow+1,tempCol-1),treeSymbol) || !grid.has(new Position(tempRow+1,tempCol+1),treeSymbol) || !grid.has(new Position(tempRow+1,tempCol-1),treeSymbol) || !grid.getValue(new Position(tempRow+1,tempCol+1)).equals(treeSymbol)){ //If there is NO tree or tent at the diagonal\n\t\t\t\t\t\tcondition3 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(condition1&&condition2&&condition3) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tgrid.add(pos, tentSymbol);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tempRow == numRows-1) { //if you want to add the tent in the last row (last row check)\n\t\t\t\t\t\n\t\t\t\t\tif(grid.has(new Position(tempRow,tempCol-1),treeSymbol) || grid.has(new Position(tempRow,tempCol+1),treeSymbol) || grid.has(new Position(tempRow-1,tempCol),treeSymbol)) { //If there is a tree next to or below the position\n\t\t\t\t\t\tcondition1 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!grid.has(new Position(tempRow,tempCol-1),tentSymbol) || !grid.has(new Position(tempRow,tempCol+1),tentSymbol) || !grid.has(new Position(tempRow-1,tempCol),tentSymbol)) { //If there is NO tent next to or below the position\n\t\t\t\t\t\tcondition2 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!grid.has(new Position(tempRow-1,tempCol-1),tentSymbol) || !grid.has(new Position(tempRow-1,tempCol+1),treeSymbol) || !grid.has(new Position(tempRow-1,tempCol-1),treeSymbol) || !grid.has(new Position(tempRow-1,tempCol+1),treeSymbol)){ //If there is NO tree or tent at the diagonal\n\t\t\t\t\t\tcondition3 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(condition1&&condition2&&condition3) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tgrid.add(pos, tentSymbol);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tempCol == 0) { //if you want to add the tent in the first column (first column check)\n\t\t\t\t\t\n\t\t\t\t\tif(grid.has(new Position(tempRow-1,tempCol),treeSymbol) || grid.has(new Position(tempRow+1,tempCol),treeSymbol) || grid.has(new Position(tempRow,tempCol+1),treeSymbol)) { //If there is a tree next to or below the position\n\t\t\t\t\t\tcondition1 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!grid.has(new Position(tempRow-1,tempCol),tentSymbol) || !grid.has(new Position(tempRow+1,tempCol),tentSymbol) || !grid.has(new Position(tempRow,tempCol+1),tentSymbol)) { //If there is NO tent next to or below the position\n\t\t\t\t\t\tcondition2 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!grid.has(new Position(tempRow-1,tempCol-1),treeSymbol) || !grid.has(new Position(tempRow+1,tempCol+1),treeSymbol) || !grid.has(new Position(tempRow-1,tempCol-1),treeSymbol) || !grid.has(new Position(tempRow+1,tempCol+1),treeSymbol)){ //If there is NO tree or tent at the diagonal\n\t\t\t\t\t\tcondition3 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(condition1&&condition2&&condition3) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tgrid.add(pos, tentSymbol);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tempCol == numCols-1) { //if you want to add the tent in the last column (last column check)\n\t\t\t\t\t\n\t\t\t\t\tif(grid.has(new Position(tempRow-1,tempCol),treeSymbol) || grid.has(new Position(tempRow+1,tempCol),treeSymbol) || grid.has(new Position(tempRow,tempCol-1),treeSymbol)) { //If there is a tree next to or below the position\n\t\t\t\t\t\tcondition1 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!grid.has(new Position(tempRow-1,tempCol),tentSymbol) || !grid.has(new Position(tempRow+1,tempCol),tentSymbol) || !grid.has(new Position(tempRow,tempCol-1),tentSymbol)) { //If there is NO tent next to or below the position\n\t\t\t\t\t\tcondition2 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!grid.has(new Position(tempRow-1,tempCol-1),treeSymbol) || !grid.has(new Position(tempRow+1,tempCol-1),treeSymbol) || !grid.has(new Position(tempRow-1,tempCol-1),treeSymbol) || !grid.has(new Position(tempRow-1,tempCol-1),treeSymbol)){ //If there is NO tree or tent at the diagonal\n\t\t\t\t\t\tcondition3 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(condition1&&condition2&&condition3) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tgrid.add(pos, tentSymbol);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\n\t\t\t\t\tif(grid.has(new Position(tempRow-1,tempCol-1),s) || grid.has(new Position(tempRow+1,tempCol-1),s) || grid.has(new Position(tempRow-1,tempCol+1),s) || grid.has(new Position(tempRow+1,tempCol+1),s)) { //If there is NO tree diagonally to position\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else {\n\t\t\t\t\t\treturn false;\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\n\t\treturn false;\t\n\t}",
"public static boolean isValidMove(char[][] board, int row, int column, int direction)\n\t{\n\t\trow --; // because start counting at 0, while the game starts counting at 1 (1 greater than zero)\n\t\tcolumn --;\n\t\tif (board[row][column] == '@') { // 1) there must be a peg at position row, column within the board,\n\t\t\t// Position is a Peg\n\t\t\tboolean validNeighbor = false; // 2) there must be another peg neighboring that first one in the specified direction, and\n\t\t\ttry {\n\t\t\t\tswitch (direction) { // 1) UP, 2) DOWN, 3) LEFT, or 4) RIGHT:\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tif (board[row - 1][column] == '@') validNeighbor = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tif (board[row + 1][column] == '@') validNeighbor = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tif (board[row][column - 1] == '@') validNeighbor = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tif (board[row][column + 1] == '@') validNeighbor = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} catch(ArrayIndexOutOfBoundsException e) {\n\t\t\t\t// Direction places endpoint outside\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (validNeighbor) { // 3) there must be an empty hole on the other side of that\n\t\t\t\t// Neighbor is valid\n\t\t\t\tboolean emptyLocation = false;\n\t\t\t\ttry {\n\t\t\t\t\tswitch (direction) { // 1) UP, 2) DOWN, 3) LEFT, or 4) RIGHT:\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tif (board[row - 2][column] == '-') emptyLocation = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tif (board[row + 2][column] == '-') emptyLocation = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tif (board[row][column - 2] == '-') emptyLocation = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tif (board[row][column + 2] == '-') emptyLocation = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (emptyLocation){\n\t\t\t\t\t\t// Location is empty\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Location overlaps (non-empty)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} catch(ArrayIndexOutOfBoundsException e) {\n\t\t\t\t\t// Direction places end point outside\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isMovePossible(int boardIndex, int markIndex) throws IllegalArgumentException;",
"private static boolean isPositionOutsideBoard(Position position,\n PacmanBoard board) {\n return position.getX() < 0 || position.getY() < 0\n || position.getX() >= board.getWidth()\n || position.getY() >= board.getHeight();\n }",
"@Test\n public void testPawnPosition() {\n // initialize the complete chess board\n ChessBoard chessBoard = init(\"CHESS\");\n\n // compare the position of the pawn on the table to the correct position\n for (int i = 0; i < 8; ++i) {\n assertEquals(1, chessBoard.getPiece(1, i).getRow());\n assertEquals(i, chessBoard.getPiece(1, i).getColumn());\n\n assertEquals(6, chessBoard.getPiece(6, i).getRow());\n assertEquals(i, chessBoard.getPiece(6, i).getColumn());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ function encoding our problem to sat | @Override
public CNFFormula encodeToSAT ()
{
CNFFormula formula = super.encodeToSAT ();
encodeForbiddenColorClauses (formula);
encodeExplicitOneOnOneMappingPieces (formula);
encodeExplicitOneOnOneMappingPlaces (formula);
return formula;
} | [
"double[] encodeNetwork();",
"void decode(T solution, double[] values);",
"private static void encode(short di, BSI bsi) {\n // compute di category\n short di_abs;\n if (di < 0) {\n di_abs = (short)-di;\n } else {\n di_abs = di;\n }\n byte ni = computeBinaryLog(di_abs);\n // extract si from Table\n short si = si_tbl.data[ni];\n byte si_length = si_length_tbl.data[ni];\n short ai = 0;\n byte ai_length = 0;\n // build bsi\n if (ni == 0) {\n bsi.value = si;\n bsi.length = si_length;\n } else {\n // build ai\n if (di > 0) {\n ai = di;\n ai_length = ni;\n } else {\n ai = (short)(di-1);\n ai_length = ni; \n }\n bsi.value = (si << ai_length) | (ai & ((1 << ni) -1));\n bsi.length = (byte)(si_length + ai_length);\n }\n }",
"public static native long CommitmentTransaction_to_countersignatory_value_sat(long this_arg);",
"public static native long CommitmentTransaction_to_broadcaster_value_sat(long this_arg);",
"private final List<State> SAT(String expression) {\r\n \tSystem.out.println(\"Original\"+expression);\r\n //System.Diagnostics.Debug.WriteLine(String.Format(\"Original Expression: {0}\", expression));\r\n List<State> states = new ArrayList<State>();\r\n // from Logic in Computer Science, page 227\r\n \r\n // TypeSAT typeSAT = DetermineTypeSAT(expression, ref leftExpression, ref rightExpression);\r\n TypeSAT typeSAT = this.GetTypeSAT(expression, leftExpression, rightExpression);\r\n System.out.println(\"SAT\"+typeSAT.toString()+\"-\"+leftExpression+\"-\"+rightExpression);\r\n System.out.println(\"SAT\"+typeSAT.toString()+\"-\"+this.leftExpression+\"-\"+rightExpression);\r\n //System.Diagnostics.Debug.WriteLine(String.Format(\"Type SAT: {0}\", typeSAT.ToString()));\r\n //System.Diagnostics.Debug.WriteLine(String.Format(\"Left Expression: {0}\", leftExpression));\r\n //System.Diagnostics.Debug.WriteLine(String.Format(\"Right Expression: {0}\", rightExpression));\r\n //System.Diagnostics.Debug.WriteLine(\"------------------------------------\");\r\n switch (typeSAT) {\r\n case AllTrue:\r\n // all states\r\n \tfor(State state:this._kripke.States)\r\n \t{\r\n \t\tstates.add(state);\r\n \t}\r\n break;\r\n case AllFalse:\r\n // empty \r\n break;\r\n case Atomic:\r\n for (State state : this._kripke.States) {\r\n if (state.Atoms.contains(leftExpression)) {\r\n states.add(state);\r\n }\r\n \r\n }\r\n \r\n break;\r\n case Not:\r\n // S \u0012 SAT (�1)\r\n \tfor(State state:this._kripke.States)\r\n \t{\r\n \t\tstates.add(state);\r\n \t}\r\n List<State> f1States = this.SAT(leftExpression);\r\n for (State state : f1States) {\r\n if (states.contains(state)) {\r\n states.remove(state);\r\n }\r\n \r\n }\r\n \r\n break;\r\n case And:\r\n // SAT (�1) ) SAT (�2)\r\n List<State> andF1States = this.SAT(leftExpression);\r\n List<State> andF2States = this.SAT(rightExpression);\r\n for (State state : andF1States) {\r\n if (andF2States.contains(state)) {\r\n states.add(state);\r\n }\r\n \r\n }\r\n \r\n break;\r\n case Or:\r\n // SAT (�1) * SAT (�2)\r\n List<State> orF1States = this.SAT(leftExpression);\r\n List<State> orF2States = this.SAT(rightExpression);\r\n states = orF1States;\r\n for (State state : orF2States) {\r\n if (!states.contains(state)) {\r\n states.add(state);\r\n }\r\n \r\n }\r\n \r\n break;\r\n case Implies:\r\n // SAT (��1 ( �2)\r\n // TODO: reevaluate impliesFormula\r\n String impliesFormula = \"!\"+leftExpression+\"|\"+rightExpression;\r\n states = this.SAT(impliesFormula);\r\n break;\r\n case AX:\r\n // SAT (�EX��1)\r\n // TODO: reevaluate axFormula\r\n String axFormula = \"!\"+\"EX\"+\"!\"+leftExpression;\r\n states = this.SAT(axFormula);\r\n // check if states actually has link to next state\r\n List<State> tempStates = new ArrayList<State>();\r\n for (State sourceState : states) {\r\n for (Transition transition : this._kripke.Transitions) {\r\n if (sourceState.Equals(transition.FromState)) {\r\n tempStates.add(sourceState);\r\n break;\r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n states = tempStates;\r\n break;\r\n case EX:\r\n // SATEX(�1)\r\n // TODO: reevaluate exFormula\r\n String exFormula = leftExpression;\r\n states = this.SAT_EX(exFormula);\r\n break;\r\n case AU:\r\n // A[�1 U �2]\r\n // SAT(�(E[��2 U (��1 '��2)] ( EG��2))\r\n // TODO: reevaluate auFormulaBuilder\r\n StringBuilder auFormulaBuilder = new StringBuilder();\r\n auFormulaBuilder.append(\"!(E(!\");\r\n auFormulaBuilder.append(rightExpression);\r\n auFormulaBuilder.append(\"U(!\");\r\n auFormulaBuilder.append(leftExpression);\r\n auFormulaBuilder.append(\"&!\");\r\n auFormulaBuilder.append(rightExpression);\r\n auFormulaBuilder.append(\"))|(EG!\");\r\n auFormulaBuilder.append(rightExpression);\r\n auFormulaBuilder.append(\"))\");\r\n states = this.SAT(auFormulaBuilder.toString());\r\n break;\r\n case EU:\r\n // SATEU(�1, �2)\r\n // TODO: reevaluate euFormula\r\n states = this.SAT_EU(leftExpression, rightExpression);\r\n break;\r\n case EF:\r\n // SAT (E(\u0003 U �1))\r\n // TODO: reevaluate efFormula\r\n String efFormula = \"E(TU\"+leftExpression+\")\";\r\n states = this.SAT(efFormula);\r\n break;\r\n case EG:\r\n // SAT(�AF��1)\r\n // TODO: reevaulate egFormula\r\n String egFormula = \"!AF!\"+leftExpression;\r\n states = this.SAT(egFormula);\r\n break;\r\n case AF:\r\n // SATAF (�1)\r\n // TODO: reevaluate afFormula\r\n String afFormula = leftExpression;\r\n states = this.SAT_AF(afFormula);\r\n break;\r\n case AG:\r\n // SAT (�EF��1)\r\n // TODO: reevaluate agFormula\r\n String agFormula = \"!EF!\"+leftExpression;\r\n states = this.SAT(agFormula);\r\n break;\r\n case Unknown:\r\n System.err.println(\"Invalid CTL expression\");\r\n break;\r\n }\r\n return states;\r\n }",
"double[] decode(T solution);",
"public String getStringRepresentationForProblem(InterfaceOptimizer opt) {\n String result = \"\";\n\n result += \"Minimize Bits Problem:\\n\";\n result += \"The task is to reduce the number of TRUE Bits in the given bit string.\\n\";\n result += \"Parameters:\\n\";\n result += \"Number of Bits: \" + this.m_ProblemDimension +\"\\n\";\n result += \"Solution representation:\\n\";\n //result += this.m_Template.getSolutionRepresentationFor();\n return result;\n }",
"void setSat(int sat);",
"public static String solve8Puzzle(State s0)\n\t{\n\t\n\t\t// 1) Return null if the puzzle is not solvable. \n\t\tif(s0.solvable() != true){\n\t\t\treturn null;\n\t\t}\n\n\t\t// 2) Otherwise, solve the puzzle with two heuristics. The two solutions may be different\n\t\t// but must have the same length for optimality. \n\t\t\n\t\tHeuristic h[] = {Heuristic.TileMismatch, Heuristic.ManhattanDist }; \n\t\tString [] moves = new String[2]; \n\t\t\n\t\tfor (int i = 0; i < 2; i++)\n\t\t{\n\t\t\tmoves[i] = AStar(s0, h[i]); \n\t\t}\n\t\t\n\t\t// 3) Combine the two solution strings into one that would print out in the \n\t\t// output format specified in Section 5 of the project description.\n\t\t\n\t\treturn null; \n\t}",
"private int Huffmancodebits( int [] ix, EChannel gi ) {\n\t\tint region1Start;\n\t\tint region2Start;\n\t\tint count1End;\n\t\tint bits, stuffingBits;\n\t\tint bvbits, c1bits, tablezeros, r0, r1, r2;//, rt, pr;\n\t\tint bitsWritten = 0;\n\t\tint idx = 0;\n\t\ttablezeros = 0;\n\t\tr0 = r1 = r2 = 0;\n\n\t\tint bigv = gi.big_values * 2;\n\t\tint count1 = gi.count1 * 4;\n\n\n\t\t/* 1: Write the bigvalues */\n\n\t\tif ( bigv!= 0 ) {\n\t\t\tif ( (gi.mixed_block_flag) == 0 && gi.window_switching_flag != 0 && (gi.block_type == 2) ) { /* Three short blocks */\n\t\t\t\t// if ( (gi.mixed_block_flag) == 0 && (gi.block_type == 2) ) { /* Three short blocks */\n\t\t\t\t/*\n Within each scalefactor band, data is given for successive\n time windows, beginning with window 0 and ending with window 2.\n Within each window, the quantized values are then arranged in\n order of increasing frequency...\n\t\t\t\t */\n\n\t\t\t\tint sfb, window, line, start, end;\n\n\t\t\t\t//int [] scalefac = scalefac_band_short; //da modificare nel caso si convertano mp3 con fs diversi\n\n\t\t\t\tregion1Start = 12;\n\t\t\t\tregion2Start = 576;\n\n\t\t\t\tfor ( sfb = 0; sfb < 13; sfb++ ) {\n\t\t\t\t\tint tableindex = 100;\n\t\t\t\t\tstart = scalefac_band_short[ sfb ];\n\t\t\t\t\tend = scalefac_band_short[ sfb+1 ];\n\n\t\t\t\t\tif ( start < region1Start )\n\t\t\t\t\t\ttableindex = gi.table_select[ 0 ];\n\t\t\t\t\telse\n\t\t\t\t\t\ttableindex = gi.table_select[ 1 ];\n\n\t\t\t\t\tfor ( window = 0; window < 3; window++ )\n\t\t\t\t\t\tfor ( line = start; line < end; line += 2 ) {\n\t\t\t\t\t\t\tx = ix[ line * 3 + window ];\n\t\t\t\t\t\t\ty = ix[ (line + 1) * 3 + window ];\n\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tif ( gi.mixed_block_flag!= 0 && gi.block_type == 2 ) { /* Mixed blocks long, short */\n\t\t\t\t\tint sfb, window, line, start, end;\n\t\t\t\t\tint tableindex;\n\t\t\t\t\t//scalefac_band_long;\n\n\t\t\t\t\t/* Write the long block region */\n\t\t\t\t\ttableindex = gi.table_select[0];\n\t\t\t\t\tif ( tableindex != 0 )\n\t\t\t\t\t\tfor (int i = 0; i < 36; i += 2 ) {\n\t\t\t\t\t\t\tx = ix[i];\n\t\t\t\t\t\t\ty = ix[i + 1];\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t}\n\t\t\t\t\t/* Write the short block region */\n\t\t\t\t\ttableindex = gi.table_select[ 1 ];\n\n\t\t\t\t\tfor ( sfb = 3; sfb < 13; sfb++ ) {\n\t\t\t\t\t\tstart = scalefac_band_long[ sfb ];\n\t\t\t\t\t\tend = scalefac_band_long[ sfb+1 ];\n\n\t\t\t\t\t\tfor ( window = 0; window < 3; window++ )\n\t\t\t\t\t\t\tfor ( line = start; line < end; line += 2 ) {\n\t\t\t\t\t\t\t\tx = ix[ line * 3 + window ];\n\t\t\t\t\t\t\t\ty = ix[ (line + 1) * 3 + window ];\n\t\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else { /* Long blocks */\n\t\t\t\t\tint scalefac_index = 100;\n\n\t\t\t\t\tif ( gi.mixed_block_flag != 0 ) {\n\t\t\t\t\t\tregion1Start = 36;\n\t\t\t\t\t\tregion2Start = 576;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscalefac_index = gi.region0_count + 1;\n\t\t\t\t\t\tregion1Start = scalefac_band_long[ scalefac_index ];\n\t\t\t\t\t\tscalefac_index += gi.region1_count + 1;\n\t\t\t\t\t\tregion2Start = scalefac_band_long[ scalefac_index ];\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int i = 0; i < bigv; i += 2 ) {\n\t\t\t\t\t\tint tableindex = 100;\n\t\t\t\t\t\tif ( i < region1Start ) {\n\t\t\t\t\t\t\ttableindex = gi.table_select[0];\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tif ( i < region2Start ) {\n\t\t\t\t\t\t\t\ttableindex = gi.table_select[1];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttableindex = gi.table_select[2];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* get huffman code */\n\t\t\t\t\t\tx = ix[i];\n\t\t\t\t\t\ty = ix[i + 1];\n\t\t\t\t\t\tif ( tableindex!= 0 ) {\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttablezeros += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t}\n\t\tbvbits = bitsWritten;\n\n\t\t/* 2: Write count1 area */\n\t\tint tableindex = gi.count1table_select + 32;\n\n\t\tcount1End = bigv + count1;\n\t\tfor (int i = bigv; i < count1End; i += 4 ) {\n\t\t\tv = ix[i];\n\t\t\tw = ix[i+1];\n\t\t\tx = ix[i+2];\n\t\t\ty = ix[i+3];\n\t\t\tbitsWritten += huffman_coder_count1(tableindex);\n\t\t}\n\n\t\t// c1bits = bitsWritten - bvbits;\n\t\t// if ( (stuffingBits = gi.part2_3_length - gi.part2_length - bitsWritten) != 0 ) {\n\t\t// int stuffingWords = stuffingBits / 32;\n\t\t// int remainingBits = stuffingBits % 32;\n\t\t//\n\t\t// /*\n\t\t// Due to the nature of the Huffman code\n\t\t// tables, we will pad with ones\n\t\t// */\n\t\t// while ( stuffingWords-- != 0){\n\t\t// mn.add_entry( -1, 32 );\n\t\t// }\n\t\t// if ( remainingBits!=0 )\n\t\t// mn.add_entry( -1, remainingBits );\n\t\t// bitsWritten += stuffingBits;\n\t\t//\n\t\t// }\n\t\treturn bitsWritten;\n\t}",
"public CodedProblem parseAndEncode() {\n\t\tfinal Parser parser = new Parser();\n\t\tfinal String ops = (String) this.arguments.get(AHSP.Argument.DOMAIN);\n\t\tfinal String facts = (String) this.arguments.get(AHSP.Argument.PROBLEM);\n\t\ttry {\n\t\t\tparser.parse(ops, facts);\n\t\t} catch (FileNotFoundException e) {\n\t\t}\n\t\tif (!parser.getErrorManager().isEmpty()) {\n\t\t\tparser.getErrorManager().printAll();\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tfinal Domain domain = parser.getDomain();\n\t\tfinal Problem problem = parser.getProblem();\n\t\tfinal int traceLevel = (Integer) this.arguments.get(AHSP.Argument.TRACE_LEVEL);\n\t\tif (traceLevel > 0 && traceLevel != 8) {\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"Parsing domain file \\\"\" + new File(ops).getName()\n\t\t\t\t\t+ \"\\\" done successfully\");\n\t\t\tSystem.out.println(\"Parsing problem file \\\"\" + new File(facts).getName()\n\t\t\t\t\t+ \"\\\" done successfully\\n\");\n\t\t}\n\t\tif (traceLevel == 8) {\n\t\t\tPreprocessing.setLogLevel(0);\n\t\t} else {\n\t\t\tPreprocessing.setLogLevel(Math.max(0, traceLevel - 1));\n\t\t}\n\t\tlong begin = System.currentTimeMillis();\n\t\tfinal CodedProblem pb = Preprocessing.encode(domain, problem);\n\t\tlong end = System.currentTimeMillis();\n\t\tthis.preprocessing_time = end - begin;\n\t\tthis.problem_memory = MemoryAgent.deepSizeOf(pb);\n\t\treturn pb;\n\t}",
"private double getFitness() {\n aLstVertex v1,v2;\n BitSet totalBad = new BitSet(solLen);\n BitSet tempBits = new BitSet(solLen);\n\n\t\n\tint badNum = 0;\n\tint numSetGenes =0;\n\tboolean bad = false;\n\tfor (int j = 1; j <= solLen; j++ ) {\n\t if (solution.get(j)) {\n\t\tnumSetGenes++;\n\t\tv1 = (aLstVertex) adjList.vertexArray.get(j-1);\n\t\tfor (int l = 1; l <= solLen; l++) {\n\t\t if (v1.connections.get(l)) {tempBits.set(l);}\n\t\t}\n\t\ttempBits.and(solution);\n\t\t\n\t\t// HOW MANY GENES ARE BAD? (LOWERING THE FITNESS VAL) \n\t\t\n\t\tbad = false;\n\t\tfor (int k = 1; (k <= solLen) && !bad; k++) {\n\t\t if (tempBits.get(k)) {bad = true;}\n\t\t}\n\t\tif (bad) {badNum++;} \n\t\t\n\t\t// 'OR' THE BAD VERTS TO THE TOTAL-ACCUMULATED-BITSET.\n\t\t// IN THIS CASE THE 'BAD' VERTS ARE DUE TO A PARTICULAR\n\t\t// GENE HAVING BEEN SET (VERTEX SELECTED).\n\t\t// THIS WILL BE STORED LATER IN THE CHROMOSOME.\n\t\t// I.E.: THE CHROMOSOME WILL STORE A BITSET WHICH \n\t\t// REPRESENTS THE BAD VERTICIES. IF A BIT IS SET\n\t\t// THEN THE VERTEX WITH THE CORRESPONDING BIT INDEX\n\t\t// IS CAUSING PROBLEMS IN THE FITNESS.\n\t\t\n\t\ttotalBad.or(tempBits);\n\t\ttempBits.andNot(tempBits);\n\t }\n\t \n\t}\n\t\n\t\n\t\n\t//STORE BAD VERTICIES IN A BITSTREAM REPRESENTATION\n\tint goodNum = numSetGenes - badNum;\n\tif (goodNum < 0) { goodNum = 0; }\n\tSystem.out.println(\"100*\"+goodNum+\"/\"+solLen+\" * (1-\"+badNum+\"/\"+solLen+\")\");\n\tSystem.out.println(\"bad:\"+badNum);\n\n\treturn ( 100*goodNum/solLen *(1-badNum/solLen) );\n\t\n }",
"public static String decodeBitsAdvanced(String bitsInput) {\n \t \n \t \n \t String bits = bitsInput.replaceAll(\"(^[0]+)|([0]+$)\", \"\");\n \t \n \t //bits = bits.replaceAll(\"010\", \"00\");\n \t //bits = bits.replaceAll(\"101\", \"11\");\n \t \n \t int minZero = 100;\n Matcher matcher0 = Pattern.compile(\"0+\").matcher(bits);\n while (matcher0.find()) {\n \t minZero = Math.min(minZero,matcher0.group().length());\n } \n \n ArrayList<String> allMatches = new ArrayList<String>();\n \t\n Matcher matcher = Pattern.compile(\"1+|0+\").matcher(bits);\n while (matcher.find()) {\n allMatches.add(matcher.group());\n }\n \t\n \tString[] bit1 = bits.split(\"[0]+\");\n \tdouble numZ = bits.replaceAll(\"0\", \"\").length();\n if (numZ == 0 ) {return \" \";}\n \tArrays.sort(bit1);\n \tdouble unitLength = 0.0;\n if (bit1[0].length() == bit1[bit1.length-1].length()) \n \t {\n \t\tunitLength = bit1[0].length();\n if (unitLength < (minZero*2)) {unitLength = unitLength*1.2;}\n \t }\n \telse \n \t {\n \tdouble num1 = bits.replaceAll(\"0\", \"\").length();\n \tunitLength = (1.1)*num1/bit1.length;\n \t }\n \t\n \tString curr = \"\";\n \tStringBuilder result = new StringBuilder();\n \tfor (String word: allMatches) \n \t{ if (word.contains(\"0\")) \n \t {\n \t\tif (word.length() > (Math.max(Math.min(minZero,unitLength*4),unitLength*2.33))) {curr = \" \";}\n \t\telse if (word.length() >= (Math.max(minZero,unitLength))) {curr = \" \";}\n \t\telse {curr = \"\";}\n \t }\n \telse \n \t {\n \t\tif (word.length() >= (unitLength*1.05)) {curr = \"-\";}\n \t\telse {curr = \".\";}\n \t }\n \tresult.append(curr); \n \t}\n \tSystem.out.println(\"result:\"+unitLength+\":\"+bitsInput+\":\"+result.toString()+\":\"+decodeMorse(result.toString()));\n \treturn result.toString();\n }",
"@Test\n public void encodeAsBitSet()\n {\n int value = 6;\n final BinaryEncoder encoder = new BinaryEncoder(16);\n\n BitSet result = encoder.encodeAsBitSet(value);\n\n if (IS_VERBOSE)\n {\n System.out.println(\"result = \" + result);\n }\n assertNotNull(result);\n\n assertFalse(result.get(0));\n assertTrue(result.get(1));\n assertTrue(result.get(2));\n assertFalse(result.get(3));\n\n value = 20; // > 16 outside range\n result = encoder.encodeAsBitSet(value);\n if (IS_VERBOSE)\n {\n System.out.println(\"result = \" + result);\n }\n assertNotNull(result);\n\n // 0100 Best fit into 4 digits; ignores higher bits.\n assertFalse(result.get(0));\n assertFalse(result.get(1));\n assertTrue(result.get(2));\n assertFalse(result.get(3));\n }",
"public CodeBook getOptimalCodificacion(){\n ArrayList<ArbolCod> listaA=new ArrayList<ArbolCod>();\n \n // Se inicializan los árboles con las probabilidades.\n for (int i=0;i<probabilidades.size();i++)\n listaA.add(new ArbolCod(alfabeto.getI(i),probabilidades.get(i)));\n \n return codHuffman(listaA);\n }",
"private static String solvePuzzle(String puzzle) {\n\t\tString answer = \"\";\n\n\t\tfor (int i = 0; i < puzzle.length(); i++) {\n\t\t\tchar currentChar = puzzle.charAt(i);\n\t\t\tint currentCharPos = alphabetPos(currentChar);\n\t\t\tint shiftAmount = i + 1;\n\t\t\tboolean shiftingBackwards = i % 2 == 0;\n\t\t\tint resultingLetterPosition;\n\n\t\t\tif (shiftingBackwards) {\n\t\t\t\tresultingLetterPosition = (currentCharPos - shiftAmount) % ALPHABET.length;\n\t\t\t\tif (resultingLetterPosition > -1) {\n\t\t\t\t\tanswer += ALPHABET[resultingLetterPosition];\n\t\t\t\t} else {\n\t\t\t\t\tanswer += ALPHABET[ALPHABET.length + resultingLetterPosition];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresultingLetterPosition = (currentCharPos + shiftAmount) % ALPHABET.length;\n\t\t\t\tanswer += ALPHABET[resultingLetterPosition];\n\t\t\t}\n\t\t}\n\t\tanswer = \"CS-230\" + answer;\n\t\tanswer += answer.length();\n\t\treturn answer;\n\t}",
"@Test\n public void testEncode() {\n String hash = GeoHashUtils.stringEncode(-5.6, 42.6, 12);\n assertEquals(\"ezs42e44yx96\", hash);\n\n hash = GeoHashUtils.stringEncode(10.40744, 57.64911, 12);\n assertEquals(\"u4pruydqqvj8\", hash);\n }",
"private static void spacesToBinary() {\n\t\tString stringBinary = \"\"; \n\t\tfor(int i = 0; i < spaces.length; i++) {\n\t\t\tif(spaces[i].length() % 2 == 0) { stringBinary += \"1\"; }\n\t\t\telse if(spaces[i].length() % 2 == 1) { stringBinary += \"0\"; }\n\n\t\t\tif(i != 0 && (i+1) % 5 == 0) {\n\t\t\t\tbinary.add(stringBinary);\n\t\t\t\tstringBinary = \"\";\n\t\t\t} \n\t\t\telse if(i+1 == spaces.length) {\n\t\t\t\tfor(int k = (i+1)%5; k < 5; k++) {\n\t\t\t\t\tstringBinary += \"0\";\n\t\t\t\t}\n\t\t\t\tbinary.add(stringBinary);\n\t\t\t\tstringBinary = \"\";\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
computer play Computer checks the board from the first row to the last row. In each row, the computer checks from the first column to the last column. The simplest placement is to find the first available cell. A more sophisticated approach is to use "mark first; if unfit, then remove mark" 1. Try to win first. Mark an available cell by COMPUTER_ID, if this leads to win by computer, take this cell and return, otherwise, do not take this cell (that is, set this cell to be available). 2. Try to block the opponent from winning. This approach is adopted after the trytowin approach fails. Mark an available cell by HUMAN_ID (that is, suppose this cell is taken by HUMAN_ID), if this leads to win by user, mark this cell by computerId, and return. otherwise, do not take this cell (that is, set this cell to be available). 3. If neither one of the above two approaches works (that is, the computer does not take a cell yet), then mark the first available cell. | public void computerPlay() {
System.out.print("Computer places O at ");
int numRows = board.getNumRows();
int numCols = board.getNumCols();
for (int row = 0; row < numRows ; row++){
for (int col = 0; col <numCols ; col++)
if (board.isAvailable(row, col)) {
board.mark(row, col, COMPUTER_ID);
if(board.win(row, col)) {
currRow = row;
currCol = col;
System.out.println(row + " " + col);
return;
}
else
board.mark(row, col, ' ');
}
}
//If we take an empty cell leads to win,
//then we take that empty cell.
for (int row = 0; row < numRows ; row++){
for (int col = 0; col <numCols ; col++)
if (board.isAvailable(row, col)) {
board.mark(row, col, HUMAN_ID);
if(board.win(row, col)) {
currRow = row;
currCol = col;
System.out.println(row + " " + col);
board.mark(row, col, COMPUTER_ID);
return;
}
else
board.mark(row, col, ' ');
}
}
for (int row = 0; row < numRows; row++){
for (int col= 0; col < numCols; col++)
if (board.isAvailable(row, col)) {
board.mark(row, col, COMPUTER_ID);
System.out.println(row + " " + col);
currRow = row;
currCol = col;
return; //once we find the first available item, return.
}
}
} | [
"static int blockOrWin(char[][] board){\r\n int open = 0;\r\n int human = 0;\r\n int comp = 0;\r\n boolean win = false;\r\n int cell = -1;\r\n int openPos = 0;\r\n \r\n //check for horizontal block/win\r\n for (int row = 0; row < 3; row++){\r\n for (int col = 0; col < 3; col++) {\r\n if(board[row][col] == HUMAN_PLAYER){\r\n human++;\r\n } else if(board[row][col] == COMPUTER_PLAYER){\r\n comp++;\r\n } else {\r\n open++;\r\n openPos = col;\r\n }\r\n \r\n //prioritize win over block\r\n if(open == 1 && comp == 2){\r\n cell = (row*3)+openPos+1;\r\n win = true;\r\n } else if(open == 1 && human == 2 && !win){\r\n cell = (row*3)+openPos+1;\r\n }\r\n }\r\n \r\n human=0;\r\n comp=0;\r\n open=0;\r\n openPos=0;\r\n }\r\n \r\n //check for vertical block/win\r\n for (int col = 0; col < 3; col++){\r\n for (int row = 0; row < 3; row++) {\r\n if(board[row][col] == HUMAN_PLAYER){\r\n human++;\r\n } else if(board[row][col] == COMPUTER_PLAYER){\r\n comp++;\r\n } else {\r\n open++;\r\n openPos = row;\r\n }\r\n \r\n if(open == 1 && comp == 2){\r\n cell = (openPos*3)+col+1;\r\n win = true;\r\n } else if(open == 1 && human == 2 && !win){\r\n cell = (openPos*3)+col+1;\r\n }\r\n }\r\n \r\n human=0;\r\n comp=0;\r\n open=0;\r\n openPos=0;\r\n }\r\n \r\n //check for top L-r diagonal win/block\r\n for (int rocol = 0; rocol < 3; rocol++){\r\n if(board[rocol][rocol] == HUMAN_PLAYER){\r\n human++; \r\n } else if(board[rocol][rocol] == COMPUTER_PLAYER){\r\n comp++; \r\n } else {\r\n open++;\r\n openPos = rocol;\r\n }\r\n if(open == 1 && comp == 2){\r\n cell = (openPos*3+openPos+1);\r\n win = true;\r\n } else if(open == 1 && human == 2 && !win){\r\n cell = (openPos*3+openPos+1);\r\n }\r\n \r\n }\r\n human=0;\r\n comp=0;\r\n open=0;\r\n openPos=0;\r\n \r\n //check for top r-L diagonal win/block\r\n if(board[1][1] == HUMAN_PLAYER){\r\n human++; \r\n } else if(board[1][1] == COMPUTER_PLAYER){\r\n comp++; \r\n } else {\r\n open++;\r\n openPos = 1;\r\n }\r\n \r\n if(board[0][2] == HUMAN_PLAYER){\r\n human++; \r\n } else if(board[0][2] == COMPUTER_PLAYER){\r\n comp++; \r\n } else {\r\n open++;\r\n openPos = 0;\r\n }\r\n \r\n if(board[2][0] == HUMAN_PLAYER){\r\n human++; \r\n } else if(board[2][0] == COMPUTER_PLAYER){\r\n comp++; \r\n } else {\r\n open++;\r\n openPos = 2;\r\n }\r\n \r\n if(open == 1 && comp == 2){\r\n cell = (openPos*3)+(3-openPos);\r\n win = true;\r\n } else if(open == 1 && human == 2 && !win){\r\n cell = (openPos*3)+(3-openPos);\r\n } \r\n human=0;\r\n comp=0;\r\n open=0;\r\n openPos=0;\r\n \r\n return cell;\r\n }",
"public final Tile selectComputerMove() {\r\n Tile tile = null;\r\n int count = 0;\r\n String tileName = null;\r\n boolean continueLoop = true;\r\n \r\n // First try to find a winning move\r\n for (Rail rail : rails) {\r\n for (Tile t : rail.getTiles()) {\r\n if (t.getText().equals(\"0\")) count++;\r\n }\r\n if (count == 2) {\r\n for (Tile t : rail.getTiles()) {\r\n if (t.getText().equals(\"\")) {\r\n tileName = t.getName();\r\n return t;\r\n }\r\n }\r\n }\r\n count = 0; \r\n }\r\n \r\n // If none found, try to block \"X\"\r\n for (Rail rail : rails) {\r\n for (Tile t : rail.getTiles()) {\r\n if (t.getText().equals(\"X\")) count++;\r\n }\r\n if (count == 2) {\r\n for (Tile t : rail.getTiles()) {\r\n if (t.getText().equals(\"\")) {\r\n tileName = t.getName();\r\n return t;\r\n }\r\n }\r\n }\r\n count = 0;\r\n }\r\n \r\n // If no blocking move, try to play the center which gives \"O\"\r\n // a statistical advantage\r\n if (!tiles[R2C2].isSelected()) {\r\n return tiles[R2C2];\r\n }\r\n \r\n \r\n // If center move is not available, try to find an open corner tile, \r\n // which might set up an winning combination\r\n if (!tiles[R1C1].isSelected()) {\r\n return tiles[R1C1];\r\n } else if (!tiles[R3C3].isSelected()) {\r\n return tiles[R3C3];\r\n } else if (!tiles[R3C1].isSelected()) {\r\n return tiles[R3C1];\r\n } else if (!tiles[R1C3].isSelected()) {\r\n return tiles[R1C3];\r\n }\r\n \r\n // If none found just pick an empty tile at random\r\n if(tileName == null) {\r\n int row = rand.nextInt(3) + 1;\r\n int col = rand.nextInt(3) + 1;\r\n tileName = \"r\" + row + \"c\" + col;\r\n for (Tile btn: tiles) {\r\n if (btn.getName().equals(tileName)) {\r\n tile = btn;\r\n break;\r\n }\r\n }\r\n }\r\n \r\n return tile;\r\n }",
"public boolean checkWin(){\n int j;\n int i;\n\n for(j = 0; j<(BOARD_HEIGHT); j++){\n for(i = 0; i<(BOARD_WIDTH-BOARD_BOUNDARY); i++){ /* horizontal win */\n if(getPiece(i,j).getColour() == getPiece(i+COORDINATE_ONE,j).getColour() &&\n getPiece(i,j).getColour() == getPiece(i+COORDINATE_TWO,j).getColour() &&\n getPiece(i,j).getColour() == getPiece(i+COORDINATE_THREE,j).getColour() &&\n getBoard().isEmpty(i,j) == false){\n setWinner(getPiece(i,j));\n setWinningi(i);\n setWinningj(j);\n setWinningMove(HORIZONTAL_WIN);\n return true;\n }\n }\n }\n\n for(i = 0; i<(BOARD_WIDTH); i++){ /* vertical win */\n for(j = 0; j<(BOARD_HEIGHT-BOARD_BOUNDARY); j++){\n if(getPiece(i,j).getColour() == getPiece(i,j+COORDINATE_ONE).getColour() &&\n getPiece(i,j).getColour() == getPiece(i,j+COORDINATE_TWO).getColour() &&\n getPiece(i,j).getColour() == getPiece(i,j+COORDINATE_THREE).getColour() &&\n getBoard().isEmpty(i,j) == false){\n setWinner(getPiece(i,j));\n setWinningi(i);\n setWinningj(j);\n setWinningMove(VERTICAL_WIN);\n return true;\n }\n }\n }\n\n for(j = 0; j<(BOARD_HEIGHT-BOARD_BOUNDARY); j++){ /* diagonal right facing win */\n for(i = 0; i<(BOARD_WIDTH-BOARD_BOUNDARY); i++){\n if(getPiece(i,j).getColour() == getPiece(i+COORDINATE_ONE,j+COORDINATE_ONE).getColour() &&\n getPiece(i,j).getColour() == getPiece(i+COORDINATE_TWO,j+COORDINATE_TWO).getColour() &&\n getPiece(i,j).getColour() == getPiece(i+COORDINATE_THREE,j+COORDINATE_THREE).getColour() &&\n getBoard().isEmpty(i,j) == false){\n setWinner(getPiece(i,j));\n setWinningi(i);\n setWinningj(j);\n setWinningMove(RIGHT_DIAGONAL_WIN);\n return true;\n }\n }\n }\n\n for(j = 0; j<(BOARD_HEIGHT-BOARD_BOUNDARY); j++){ /* diagonal left facing win */\n for(i = COORDINATE_THREE; i<(BOARD_WIDTH); i++){\n if(getPiece(i,j).getColour() == getPiece(i-COORDINATE_ONE,j+COORDINATE_ONE).getColour() &&\n getPiece(i,j).getColour() == getPiece(i-COORDINATE_TWO,j+COORDINATE_TWO).getColour() &&\n getPiece(i,j).getColour() == getPiece(i-COORDINATE_THREE,j+COORDINATE_THREE).getColour() &&\n getBoard().isEmpty(i,j) == false){\n setWinner(getPiece(i,j));\n setWinningi(i);\n setWinningj(j);\n setWinningMove(LEFT_DIAGONAL_WIN);\n return true;\n }\n }\n }\n\n boolean boardFull = isBoardFull(BOARD_WIDTH, BOARD_HEIGHT);\n if(boardFull == true){\n super.setWinner(DRAW); /* draw if board is full */\n }else{}\n return boardFull;\n }",
"private static boolean executeComputerTurn() {\n\t\tRandom randomGenerator = new Random();\n\t\tint computerRow;\n\t\tint computerColumn;\n\t\tdo {\n\t\t\tcomputerRow = randomGenerator.nextInt(3);\n\t\t\tcomputerColumn = randomGenerator.nextInt(3);\n\t\t} while (!isOpenSpace(Integer.toString(computerRow), Integer.toString(computerColumn)));\n\t\tticTacToeBoard[computerRow][computerColumn] = computerXO;\n\t\treturn isGameOver();\n\n\t}",
"public boolean checkWin(int row, int col, int board, String marker){\n\t\tif(boards[0].getBlock(row, col).getMarker().equals(marker)&& boards[1].getBlock(row, col).getMarker().equals(marker) && boards[2].getBlock(row, col).getMarker().equals(marker))\n\t\t\treturn true;\n\n\t\t// check if 1 row is straight = xxx \n\t\tif(col == 0){\n\t\t\tif(boards[0].getBlock(row, col+1).getMarker().equals(marker) && boards[0].getBlock(row, col+2).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t\telse if(boards[1].getBlock(row, col+1).getMarker().equals(marker) && boards[1].getBlock(row, col+2).getMarker().equals(marker))\t\n\t\t\t\treturn true;\n\t\t\telse if(boards[2].getBlock(row, col+1).getMarker().equals(marker) && boards[2].getBlock(row, col+2).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t}\n\t\telse if(col == 1){\n\t\t\tif(boards[0].getBlock(row, col-1).getMarker().equals(marker) && boards[0].getBlock(row, col+1).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t\tif(boards[1].getBlock(row, col-1).getMarker().equals(marker) && boards[1].getBlock(row, col+1).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t\tif(boards[2].getBlock(row, col-1).getMarker().equals(marker) && boards[2].getBlock(row, col+1).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t}\n\t\telse if(col == 2){\n\t\t\tif(boards[0].getBlock(row, col-1).getMarker().equals(marker) && boards[0].getBlock(row, col-2).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t\tif(boards[1].getBlock(row, col-1).getMarker().equals(marker) && boards[1].getBlock(row, col-2).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t\tif(boards[2].getBlock(row, col-1).getMarker().equals(marker) && boards[2].getBlock(row, col-2).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t}\n\n\t\t// check if 1 col is straight = xxx \n\t\tif(row == 0){\n\t\t\tif(boards[0].getBlock(row+1, col).getMarker().equals(marker) && boards[0].getBlock(row+2, col).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t\tif(boards[1].getBlock(row+1, col).getMarker().equals(marker) && boards[1].getBlock(row+2, col).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t\tif(boards[2].getBlock(row+1, col).getMarker().equals(marker) && boards[2].getBlock(row+2, col).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t}\n\t\telse if(row == 1){\n\t\t\tif(boards[0].getBlock(row-1, col).getMarker().equals(marker) && boards[0].getBlock(row+1, col).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t\tif(boards[1].getBlock(row-1, col).getMarker().equals(marker) && boards[1].getBlock(row+1, col).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t\tif(boards[2].getBlock(row-1, col).getMarker().equals(marker) && boards[2].getBlock(row+1, col).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t}\n\t\telse if(row == 2){\n\t\t\tif(boards[0].getBlock(row-1, col).getMarker().equals(marker) && boards[0].getBlock(row-2, col).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t\tif(boards[1].getBlock(row-1, col).getMarker().equals(marker) && boards[1].getBlock(row-2, col).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t\tif(boards[2].getBlock(row-1, col).getMarker().equals(marker) && boards[2].getBlock(row-2, col).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// check diagonals\n\t\tif(boards[0].getBlock(0, 0).getMarker().equals(marker) && boards[0].getBlock(1, 1).getMarker().equals(marker) && boards[0].getBlock(2, 2).getMarker().equals(marker))\n\t\t\treturn true;\n\t\tif(boards[1].getBlock(0, 0).getMarker().equals(marker) && boards[1].getBlock(1, 1).getMarker().equals(marker) && boards[1].getBlock(2, 2).getMarker().equals(marker))\n\t\t\treturn true;\n\t\tif(boards[2].getBlock(0, 0).getMarker().equals(marker) && boards[2].getBlock(1, 1).getMarker().equals(marker) && boards[2].getBlock(2, 2).getMarker().equals(marker))\n\t\t\treturn true;\n\t\t\n\t\tif(boards[0].getBlock(0, 2).getMarker().equals(marker) && boards[0].getBlock(1, 1).getMarker().equals(marker) && boards[0].getBlock(2, 0).getMarker().equals(marker))\n\t\t\treturn true;\n\t\tif(boards[1].getBlock(0, 2).getMarker().equals(marker) && boards[1].getBlock(1, 1).getMarker().equals(marker) && boards[1].getBlock(2, 0).getMarker().equals(marker))\n\t\t\treturn true;\n\t\tif(boards[2].getBlock(0, 2).getMarker().equals(marker) && boards[2].getBlock(1, 1).getMarker().equals(marker) && boards[2].getBlock(2, 0).getMarker().equals(marker))\n\t\t\treturn true;\n\t\t\n\t\t// check corner to corner = xxx\n\t\t// check first if middle block has the marker\n\t\tif(boards[1].getBlock(1, 1).getMarker().equals(marker)){\n\t\t\tif(boards[0].getBlock(0, 0).getMarker().equals(marker) &&\n\t\t\t\t\tboards[2].getBlock(2, 2).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t\t\n\t\t\tif(boards[0].getBlock(2, 0).getMarker().equals(marker) &&\n\t\t\t\t\tboards[2].getBlock(0, 2).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t\t\n\t\t\tif(boards[0].getBlock(0, 2).getMarker().equals(marker) &&\n\t\t\t\t\tboards[2].getBlock(2, 0).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t\t\n\t\t\tif(boards[0].getBlock(2, 2).getMarker().equals(marker) &&\n\t\t\t\t\tboards[2].getBlock(0, 0).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// check diagonally across the board = xxx\n\t\tfor(int i = 0; i < 3; i++){\n\t\t\tif(boards[0].getBlock(0, i).getMarker().equals(marker) &&\n\t\t\t\t\tboards[1].getBlock(1, i).getMarker().equals(marker) &&\n\t\t\t\t\tboards[2].getBlock(2, i).getMarker().equals(marker))\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public interface IGameBoard {\r\n int getNumRows();\r\n int getNumColumns();\r\n int getNumToWin();\r\n void placeToken(char p, int c);\r\n boolean checkHorizWin(int r, int c, char p);\r\n boolean checkVertWin(int r, int c, char p);\r\n boolean checkDiagWin(int r, int c, char p);\r\n char whatsAtPos(int r, int c);\r\n\r\n /**\r\n * @pre c > 0, c <= number of columns\r\n * @param c is the column the user selected on the most recent turn\r\n * @return true if the top of the column is free\r\n */\r\n default boolean checkIfFree(int c){ // this function checks the top of each row\r\n if (whatsAtPos(getNumRows()-1, c) == ' ') // if the top of the row is blank, return true (because there is space in the column)\r\n return true;\r\n else\r\n return false;\r\n }\r\n\r\n /**\r\n * @pre c > 0, c <= number of columns\r\n * @param c is the column the user selected on the most recent turn\r\n * @return true if either player won horizontally, vertically, or diagonally\r\n */\r\n default boolean checkForWin(int c){ // this function checks for a win horizontally, vertically, and diagonally\r\n int row = 0;\r\n// for(int i = 0; i < getNumRows(); i++) { // this loop finds the last placed token in the last column chosen (COUNTING UP)\r\n// if (whatsAtPos(i, c) == ' ') {\r\n// row = i - 1;\r\n// break;\r\n// }\r\n// }\r\n for(int i = getNumRows()-1; i >= 0; i--){ // this loop finds the last placed token in the last column chosen (COUNTING DOWN)\r\n if(whatsAtPos(i, c) != ' '){\r\n row = i;\r\n break;\r\n }\r\n }\r\n char player = whatsAtPos(row, c); // set temporary variable player to the last placed token\r\n\r\n if(checkHorizWin(row, c, player)){ // check for win horizontally\r\n return true;\r\n }\r\n if(checkVertWin(row, c, player)){ // check for win vertically\r\n return true;\r\n }\r\n else if(checkDiagWin(row, c, player)){ // check for win diagonally\r\n return true;\r\n }\r\n else{return false;} // return false if none of these are true\r\n }\r\n\r\n /**\r\n * @pre whatsAtPos == 'X', 'O', or ' '\r\n * @return true if board is full\r\n */\r\n default boolean checkTie() { // this function checks for a tie (if the board is full)\r\n int count = 0;\r\n for(int c = 0; c < getNumColumns(); c++) { // check the top of each column\r\n if (!checkIfFree(c)){ // if it is full, increment count\r\n count++;\r\n }\r\n }\r\n if(count == getNumColumns()){ // if count reaches the number of columns, all columns are full; it's tie\r\n return true; // return true\r\n }\r\n else{return false;} // if any columns are not full, then it is not a tie\r\n }\r\n}",
"public Status status() {\n for (int row = 0; row < board.length; row++) {\n CellState player = board[row][0];\n if (player != CellState.E) {\n boolean winner = true;\n for (int col = 1; col < board.length; col++) {\n if (board[row][col] != player) {\n winner = false;\n break;\n }\n }\n if (winner) {\n if (player == CellState.X) {\n return Status.WIN_X;\n } else {\n return Status.WIN_O;\n }\n }\n }\n }\n for (int col = 0; col < board.length; col++) {\n CellState player = board[0][col];\n if (player != CellState.E) {\n boolean winner = true;\n for (int row = 1; row < board.length; row++) {\n if (board[row][col] != player) {\n winner = false;\n break;\n }\n }\n if (winner) {\n if (player == CellState.X) {\n return Status.WIN_X;\n } else {\n return Status.WIN_O;\n }\n }\n }\n }\n CellState player = board[0][0];\n if (player != CellState.E) {\n boolean winner = true;\n for (int row = 1; row < board.length; row++) {\n if (board[row][row] != player) {\n winner = false;\n break;\n }\n }\n if (winner) {\n if (player == CellState.X) {\n return Status.WIN_X;\n } else {\n return Status.WIN_O;\n }\n }\n }\n player = board[0][board.length - 1];\n if (player != CellState.E) {\n boolean winner = true;\n for (int col = board.length - 2; col >= 0; col--) {\n if (board[(board.length - 1) - col][col] != player) {\n winner = false;\n break;\n }\n }\n if (winner) {\n if (player == CellState.X) {\n return Status.WIN_X;\n } else {\n return Status.WIN_O;\n }\n }\n }\n if (moves == board.length * board.length) {\n return Status.DRAW;\n }\n return Status.GAMEON;\n }",
"private CellValue getWinnerOfCol() {\n\t\tCellValue winner = null;\n\t\tint oldBoardIndex = 1;\n\t\tfor(int i=0; i<BOARD_GRID_SIZE;i=i+BOARD_SUB_GRID_SIZE) {\n\t\t\tint gridsComplete = 0;\n\t\t\tint newBoardIndex = oldBoardIndex;\n\t\t\tCellValue winnerOfGrid = null;\n\t\t\tfor(int j=0; j<BOARD_GRID_SIZE; j=j+BOARD_SUB_GRID_SIZE) {\n\t\t\t\tCellValue winnerOfBoard = winningBoardToPlayerMapping.get(newBoardIndex);\n\t\t\t\tif(winnerOfBoard != null) {\n\t\t\t\t\tif(winnerOfGrid != null) {\n\t\t\t\t\t\tif(winnerOfBoard == winnerOfGrid) {\n\t\t\t\t\t\t\tgridsComplete++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\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\telse {\n\t\t\t\t\t\twinnerOfGrid = winnerOfBoard;\n\t\t\t\t\t\tgridsComplete++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tnewBoardIndex += 3;\n\t\t\t}\n\t\t\tif(gridsComplete == BOARD_SUB_GRID_SIZE) {\n\t\t\t\twinner = winnerOfGrid;\n\t\t\t\tbreak;\t\t\t\t\n\t\t\t}\t\n\t\t\toldBoardIndex += 1;\n\t\t}\n\t\treturn winner;\n\t}",
"public void winIndicators(){\n\n\t\tint row = 0,col = 0;\n\n\t\tfor(int col_iter = 0;col_iter < 3;col_iter++)\n\t\t\tif (tilePlays[row][col_iter] == tilePlays[row+1][col_iter] && tilePlays[row+1][col_iter] == tilePlays[row+2][col_iter] && tilePlays[row][col_iter] > 0){\t\n\n\t\t\t\twinner = tilePlays[row][col_iter];\n\t\t\t\twinningCol = col_iter;\n\t\t\t\tscore[winner-1]++;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tfor(int row_iter = 0;row_iter < 3;row_iter++)\n\t\t\tif (tilePlays[row_iter][col] == tilePlays[row_iter][col+1] && tilePlays[row_iter][col+1] == tilePlays[row_iter][col+2] && tilePlays[row_iter][col] > 0){\t\n\n\t\t\t\twinner = tilePlays[row_iter][col];\n\t\t\t\twinningRow = row_iter;\n\t\t\t\tscore[winner-1]++;\n\t\t\t\tbreak;\n\t\t\t}\n\n\n\t\tif (tilePlays[0][0] == tilePlays[1][1] && tilePlays[1][1] == tilePlays[2][2] && tilePlays[0][0] > 0){\n\n\t\t\twinner = tilePlays[0][0];\n\t\t\twinningDiagonal = 0;\n\t\t\tscore[winner-1]++;\n\t\t}\n\t\tif (tilePlays[0][2] == tilePlays[1][1] && tilePlays[1][1] == tilePlays[2][0] && tilePlays[0][2] > 0){\n\n\t\t\twinner = tilePlays[0][2];\n\t\t\twinningDiagonal = 1;\n\t\t\tscore[winner-1]++;\n\t\t}\n\n\t}",
"public static int imminentWin(char mark) {\n\t\t// check if there is an imminent win in first row\n\t\tif (board[0][0] == mark && board[0][1] == mark && isSquareEmpty(3)) {\n\t\t\treturn 3;\n\t\t} else if (board[0][1] == mark && board[0][2] == mark\n\t\t\t\t&& isSquareEmpty(1)) {\n\t\t\treturn 1;\n\t\t} else if (board[0][0] == mark && board[0][2] == mark\n\t\t\t\t&& isSquareEmpty(2)) {\n\t\t\treturn 2;\n\t\t}\n\t\t// check if there is an imminent win in the second row\n\t\telse if (board[1][0] == mark && board[1][1] == mark && isSquareEmpty(6)) {\n\t\t\treturn 6;\n\t\t} else if (board[1][1] == mark && board[1][2] == mark\n\t\t\t\t&& isSquareEmpty(4)) {\n\t\t\treturn 4;\n\t\t} else if (board[1][0] == mark && board[1][2] == mark\n\t\t\t\t&& isSquareEmpty(5)) {\n\t\t\treturn 5;\n\t\t}\n\t\t// check if there is an imminent win in the third row\n\t\telse if (board[2][0] == mark && board[2][1] == mark && isSquareEmpty(9)) {\n\t\t\treturn 9;\n\t\t} else if (board[2][1] == mark && board[2][2] == mark\n\t\t\t\t&& isSquareEmpty(7)) {\n\t\t\treturn 7;\n\t\t} else if (board[2][0] == mark && board[2][2] == mark\n\t\t\t\t&& isSquareEmpty(8)) {\n\t\t\treturn 8;\n\t\t}\n\t\t// check if there is an imminent win in the first column\n\t\telse if (board[0][0] == mark && board[1][0] == mark && isSquareEmpty(7)) {\n\t\t\treturn 7;\n\t\t} else if (board[0][0] == mark && board[2][0] == mark\n\t\t\t\t&& isSquareEmpty(4)) {\n\t\t\treturn 4;\n\t\t} else if (board[2][0] == mark && board[1][0] == mark\n\t\t\t\t&& isSquareEmpty(1)) {\n\t\t\treturn 1;\n\t\t}\n\t\t// check if there is an imminent win in the second column\n\t\telse if (board[0][1] == mark && board[1][1] == mark && isSquareEmpty(8)) {\n\t\t\treturn 8;\n\t\t} else if (board[0][1] == mark && board[2][1] == mark\n\t\t\t\t&& isSquareEmpty(5)) {\n\t\t\treturn 5;\n\t\t} else if (board[2][1] == mark && board[1][1] == mark\n\t\t\t\t&& isSquareEmpty(2)) {\n\t\t\treturn 2;\n\t\t}\n\t\t// check if there is an imminent win in the third column\n\t\telse if (board[0][2] == mark && board[1][2] == mark && isSquareEmpty(9)) {\n\t\t\treturn 9;\n\t\t} else if (board[0][2] == mark && board[2][2] == mark\n\t\t\t\t&& isSquareEmpty(6)) {\n\t\t\treturn 6;\n\t\t} else if (board[2][2] == mark && board[1][2] == mark\n\t\t\t\t&& isSquareEmpty(3)) {\n\t\t\treturn 3;\n\t\t}\n\t\t// check if there is an imminent win along the diagonal 1\n\t\telse if (board[0][0] == mark && board[1][1] == mark && isSquareEmpty(9)) {\n\t\t\treturn 9;\n\t\t} else if (board[0][0] == mark && board[2][2] == mark\n\t\t\t\t&& isSquareEmpty(5)) {\n\t\t\treturn 5;\n\t\t} else if (board[2][2] == mark && board[1][1] == mark\n\t\t\t\t&& isSquareEmpty(1)) {\n\t\t\treturn 1;\n\t\t}\n\t\t// check if there is an imminent win along diagonal 2\n\t\telse if (board[0][2] == mark && board[1][1] == mark && isSquareEmpty(7)) {\n\t\t\treturn 7;\n\t\t} else if (board[0][2] == mark && board[2][0] == mark\n\t\t\t\t&& isSquareEmpty(5)) {\n\t\t\treturn 5;\n\t\t} else if (board[2][0] == mark && board[1][1] == mark\n\t\t\t\t&& isSquareEmpty(3)) {\n\t\t\treturn 3;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}",
"public GameState won() {\n if ( (board[0][0] != TileState.BLANK) && (board[0][0] == board[0][1]) && (board[0][0] == board[0][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[1][0] != TileState.BLANK) && (board[1][0] == board[1][1]) && (board[1][0] == board[1][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[2][0] != TileState.BLANK) && (board[2][0] == board[2][1]) && (board[2][0] == board[2][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[0][0] != TileState.BLANK) && (board[0][0] == board[1][1]) && (board[0][0] == board[2][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ( (board[0][2] != TileState.BLANK) && (board[0][2] == board[1][1]) && (board[0][2] == board[2][0])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[0][0] != TileState.BLANK) && (board[0][0] == board[1][0]) && (board[0][0] == board[2][0])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[0][1] != TileState.BLANK) && (board[0][1] == board[1][1]) && (board[0][1] == board[2][1])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[0][2] != TileState.BLANK) && (board[0][2] == board[1][2]) && (board[0][2] == board[2][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if (movesPlayed == 9)\n return GameState.DRAW;\n return GameState.IN_PROGRESS;\n }",
"public Cell chooseCellToShoot(){\n Cell cellToShoot = null;\n if(lastSuccessfulShot != null) {\n int x = lastSuccessfulShot.getX(), y = lastSuccessfulShot.getY();\n\n for (int i = -1; i <= 1; i += 2) {\n if ((x + i >= 0 && x + i < Constants.BOARD_WIDTH) && isAvailableForShot(new Cell(x + i, y))) {\n cellToShoot = new Cell(x + i, y);\n break;\n } else if ((y + i >= 0 && y + i < Constants.BOARD_HEIGHT) && isAvailableForShot(new Cell(x, y + i))) {\n cellToShoot = new Cell(x, y + i);\n break;\n }\n }\n }\n\n if(cellToShoot == null) {\n int i = 10;\n cellToShoot = strategy.choseCellToShoot();\n\n while (i > 0){\n if(!isAvailableForShot(cellToShoot))\n cellToShoot = strategy.choseCellToShoot();\n else break;\n i--;\n }\n\n if (i == 0 && !isAvailableForShot(cellToShoot)) {\n if(predefinedStrategiesUsageCount != 0) {\n changeStrategy();\n cellToShoot = chooseCellToShoot();\n } else\n cellToShoot = chooseEmptyCell();\n }\n }\n return cellToShoot;\n }",
"private boolean checkBoard() {\r\n\t\tboolean gameOver = false;\r\n\t\tif ((c[1][1] == 0 && c[2][2] == 0 && c[3][3] == 0)\r\n\t\t\t\t|| (c[1][3] == 0 && c[2][2] == 0 && c[3][1] == 0)\r\n\t\t\t\t|| (c[1][2] == 0 && c[2][2] == 0 && c[3][2] == 0)\r\n\t\t\t\t|| (c[1][3] == 0 && c[2][3] == 0 && c[3][3] == 0)\r\n\t\t\t\t|| (c[1][1] == 0 && c[1][2] == 0 && c[1][3] == 0)\r\n\t\t\t\t|| (c[2][1] == 0 && c[2][2] == 0 && c[2][3] == 0)\r\n\t\t\t\t|| (c[3][1] == 0 && c[3][2] == 0 && c[3][3] == 0)\r\n\t\t\t\t|| (c[1][1] == 0 && c[2][1] == 0 && c[3][1] == 0)) {\r\n\t\t\ttextView.setText(\"Game over. You win!\");\r\n\t\t\tgameOver = true;\r\n\t\t} else if ((c[1][1] == 1 && c[2][2] == 1 && c[3][3] == 1)\r\n\t\t\t\t|| (c[1][3] == 1 && c[2][2] == 1 && c[3][1] == 1)\r\n\t\t\t\t|| (c[1][2] == 1 && c[2][2] == 1 && c[3][2] == 1)\r\n\t\t\t\t|| (c[1][3] == 1 && c[2][3] == 1 && c[3][3] == 1)\r\n\t\t\t\t|| (c[1][1] == 1 && c[1][2] == 1 && c[1][3] == 1)\r\n\t\t\t\t|| (c[2][1] == 1 && c[2][2] == 1 && c[2][3] == 1)\r\n\t\t\t\t|| (c[3][1] == 1 && c[3][2] == 1 && c[3][3] == 1)\r\n\t\t\t\t|| (c[1][1] == 1 && c[2][1] == 1 && c[3][1] == 1)) {\r\n\t\t\ttextView.setText(\"Game over. You lost!\");\r\n\t\t\tgameOver = true;\r\n\t\t} else {\r\n\t\t\tboolean empty = false;\r\n\t\t\tfor (i = 1; i <= 3; i++) {\r\n\t\t\t\tfor (j = 1; j <= 3; j++) {\r\n\t\t\t\t\tif (c[i][j] == 2) {\r\n\t\t\t\t\t\tempty = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!empty) {\r\n\t\t\t\tgameOver = true;\r\n\t\t\t\ttextView.setText(\"Game over. It's a draw!\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn gameOver;\r\n\t}",
"public static boolean isBlackWin(char[][] board){\r\n for (int r= 0; r < 6; r++ ){\r\n for (int c = 0; c < 7; c++){\r\n if (r < 3){\r\n if (board [r][c] =='b' && board [r + 1][c] =='b' && board [r + 2][c] =='b' && board [r + 3][c] =='b' ){\r\n return true;\r\n }\r\n }\r\n if (c < 4){\r\n if (board [r][c] =='b' && board [r][c + 1] =='b' && board [r ][c + 2] =='b' && board [r][c + 3] =='b' ){\r\n return true;\r\n }\r\n }\r\n\r\n \r\n }\r\n }\r\n \r\n for (int r = 0; r < 3; r++){\r\n for (int c = 0; c < 4; c++){\r\n if (board [r][c] =='b' && board [r + 1][c +1 ] =='b' && board [r + 2][c +2] =='b' && board [r + 3][c +3 ] =='b' ){\r\n return true; }\r\n }\r\n }\r\n\r\n for (int r = 0; r < 3 ; r++){\r\n for (int c = 6; c > 2; c--){\r\n if (board [r][c] =='b' && board [r + 1][c - 1 ] =='b' && board [r + 2][c - 2] =='b' && board [r + 3][c - 3 ] =='b' ){\r\n return true; }\r\n }\r\n }\r\n return false;\r\n }",
"public int determineWinner(){\n\n int hello = board.checkWin(globalMarker,compMarker);\n\n return hello;\n }",
"void playerInRow(int[][] coords, Board board, int inRow) {\r\n int max = 0;\r\n Coord bestMove = new Coord();\r\n\r\n\r\n for (int y = 0; y < board.getHeight(); y++) {\r\n for (int x = 0; x < board.getWidth(); x++) {\r\n int horizontal = 0;\r\n int vertical = 0;\r\n int diagonal = 0;\r\n int antiDiagonal = 0;\r\n if (coords[y][x] == 1) {\r\n\r\n // Checks horizontal\r\n for (int i = 0; i < inRow-1; i++) {\r\n int xi = x + i;\r\n int yi = y;\r\n if (!board.tileOnBoard(xi, yi))\r\n break;\r\n if (coords[yi][xi] != 1)\r\n break;\r\n\r\n horizontal++;\r\n if (horizontal >= max) {\r\n\r\n if (board.tileAvailable(x - 1, y)) {\r\n bestMove.x = x - 1;\r\n bestMove.y = y;\r\n max = horizontal;\r\n } else if (board.tileAvailable(xi + 1, yi)) {\r\n bestMove.x = xi + 1;\r\n bestMove.y = yi;\r\n max = horizontal;\r\n }\r\n }\r\n }\r\n\r\n // Checks vertical\r\n for (int i = 0; i < inRow-1; i++) {\r\n int xi = x;\r\n int yi = y + i;\r\n if (!board.tileOnBoard(xi, yi))\r\n break;\r\n if (coords[yi][xi] != 1)\r\n break;\r\n\r\n vertical++;\r\n if (vertical >= max) {\r\n\r\n if (board.tileAvailable(x, y - 1)) {\r\n bestMove.y = y - 1;\r\n bestMove.x = x;\r\n max = vertical;\r\n } else if (board.tileAvailable(xi, yi+1)) {\r\n bestMove.y = yi + 1;\r\n bestMove.x = xi;\r\n max = vertical;\r\n }\r\n }\r\n }\r\n\r\n // Checks diagonal\r\n for (int i = 0; i < inRow-1; i++) {\r\n int xi = x + i;\r\n int yi = y + i;\r\n if (!board.tileOnBoard(xi, yi))\r\n break;\r\n if (coords[yi][xi] != 1)\r\n break;\r\n\r\n diagonal++;\r\n if (diagonal >= max) {\r\n\r\n if (board.tileAvailable(x - 1, y - 1)) {\r\n bestMove.y = y - 1;\r\n bestMove.x = x - 1;\r\n max = diagonal;\r\n } else if (board.tileAvailable(xi + 1, yi + 1)) {\r\n bestMove.y = yi + 1;\r\n bestMove.x = xi + 1;\r\n max = diagonal;\r\n }\r\n }\r\n }\r\n\r\n // Checks antiDiagonal\r\n for (int i = 0; i < inRow-1; i++) {\r\n int xi = x - i;\r\n int yi = y + i;\r\n if (!board.tileOnBoard(xi, yi))\r\n break;\r\n if (coords[yi][xi] != 1)\r\n break;\r\n\r\n antiDiagonal++;\r\n if (antiDiagonal >= max) {\r\n\r\n if (board.tileAvailable(x + 1, y - 1)) {\r\n bestMove.y = y - 1;\r\n bestMove.x = x + 1;\r\n max = antiDiagonal;\r\n } else if (board.tileAvailable(xi - 1, yi + 1)) {\r\n bestMove.y = yi + 1;\r\n bestMove.x = xi - 1;\r\n max = antiDiagonal;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n board.placeO(bestMove.y, bestMove.x);\r\n }",
"public void humanPlay() { \n \tSystem.out.print(\"Enter position \");\n \tint row, col;\n \trow = sc.nextInt();\n \tcol = sc.nextInt();\n \tint numRows = board.getNumRows();\n \tint numCols = board.getNumCols();\n \n \twhile (!(board.isValidRow(row) && (board.isValidCol(col)) && (board.isAvailable(row, col))) ){ //updated\n \t\tif (!board.isValidRow(row)){\n \t\t\tSystem.out.println(\"Row number should be in [0, \" + (numRows-1) + \"]\");\n \t\t\t\n \t\t}\n \t\t\n \t\tif (!board.isValidCol(col)){\n \t\t\tSystem.out.println(\"Col should be in [0, \" + (numCols -1) + \"]\");\n \t\t\t\n \t\t}\n \n \t\tif ((board.isValidRow(row)) && (board.isValidCol(col))&& (!(board.isAvailable(row, col)))) //updated\n \t\t\tSystem.out.println(\"That is not a valid position\");\n \t\t\n \t\tSystem.out.print(\"Enter the row and col: \");\n \t\t\n \t\trow = sc.nextInt();\n \t\tcol = sc.nextInt();\n \t}\n \t\tcurrRow = row;\n \t\tcurrCol = col;\n \tboard.mark(currRow, currCol, HUMAN_ID);\n \t\n }",
"private int[] checkNextPlayerEffectiveCell(int i, int j) {\n\n int nNoofSel = 0;\n int row = -1, col = -1;\n int nPlayerBoardCnt = 0;\n boolean bValidCell = false;\n int nReturnData[] = new int[3];\n nReturnData[0] = 0;\n nReturnData[1] = 0;\n nReturnData[2] =0;\n\n\n resetSelectedArray();\n\n if (pCellDataPlayerTurn[i][j].nPlayerID == nPlayerId || pCellDataPlayerTurn[i][j].bEmpty) {\n\n\n if(pCellDataPlayerTurn[i][j].nTouchCount+1<pCellDataPlayerTurn[i][j].nMatchCount)\n {\n pCellDataPlayerTurn[i][j].bEmpty=false;\n pCellDataPlayerTurn[i][j].nTouchCount++;\n pCellDataPlayerTurn[i][j].nPlayerID=nPlayerId;\n\n for(int r=0;r<NO_OF_CELL;r++)\n {\n for(int c=0;c<NO_OF_CELL;c++)\n {\n if(!pCellDataPlayerTurn[r][c].bEmpty&&pCellDataPlayerTurn[r][c].nPlayerID==nCpuId)\n {\n nReturnData[1]++;\n }\n if(!pCellDataPlayerTurn[r][c].bEmpty&&pCellDataPlayerTurn[r][c].nPlayerID==nPlayerId)\n {\n nReturnData[2]++;\n }\n\n }\n }\n\n return nReturnData;\n }\n\n if ((pCellDataPlayerTurn[i][j].nTouchCount + 1)\n % pCellDataPlayerTurn[i][j].nMatchCount == 0) {\n pCellDataPlayerTurn[i][j].nTouchCount = 0;\n pCellDataPlayerTurn[i][j].bEmpty = true;\n\n } else {\n pCellDataPlayerTurn[i][j].nTouchCount = (pCellDataPlayerTurn[i][j].nTouchCount + 1)\n % pCellDataPlayerTurn[i][j].nMatchCount;\n }\n\n // pCellDataCPUTurn[i][j].nTouchCount = 0;\n // pCellDataCPUTurn[i][j].bEmpty = true;\n\n row = i - 1;\n col = j;\n\n if (checkFitArray(row, col)) {\n\n pCellDataPlayerTurn[row][col].nPlayerID = nPlayerId;\n pCellDataPlayerTurn[row][col].nTouchCount++;\n pCellDataPlayerTurn[row][col].bEmpty = false;\n\n\n if (pCellDataPlayerTurn[row][col].nTouchCount >= pCellDataPlayerTurn[row][col].nMatchCount) {\n nSelectedArr[nNoofSel][0] = row;\n nSelectedArr[nNoofSel][1] = col;\n nNoofSel++;\n\n }\n\n }\n\n row = i;\n col = j - 1;\n\n if (checkFitArray(row, col)) {\n\n pCellDataPlayerTurn[row][col].nPlayerID = nPlayerId;\n pCellDataPlayerTurn[row][col].nTouchCount++;\n pCellDataPlayerTurn[row][col].bEmpty = false;\n\n\n if (pCellDataPlayerTurn[row][col].nTouchCount >= pCellDataPlayerTurn[row][col].nMatchCount) {\n nSelectedArr[nNoofSel][0] = row;\n nSelectedArr[nNoofSel][1] = col;\n nNoofSel++;\n\n }\n\n }\n\n row = i;\n col = j + 1;\n\n if (checkFitArray(row, col)) {\n\n pCellDataPlayerTurn[row][col].nPlayerID = nPlayerId;\n pCellDataPlayerTurn[row][col].nTouchCount++;\n pCellDataPlayerTurn[row][col].bEmpty = false;\n\n if (pCellDataPlayerTurn[row][col].nTouchCount >= pCellDataPlayerTurn[row][col].nMatchCount) {\n nSelectedArr[nNoofSel][0] = row;\n nSelectedArr[nNoofSel][1] = col;\n nNoofSel++;\n\n }\n\n }\n\n row = i + 1;\n col = j;\n\n if (checkFitArray(row, col)) {\n\n pCellDataPlayerTurn[row][col].nPlayerID = nPlayerId;\n pCellDataPlayerTurn[row][col].nTouchCount++;\n pCellDataPlayerTurn[row][col].bEmpty = false;\n\n if (pCellDataPlayerTurn[row][col].nTouchCount >= pCellDataPlayerTurn[row][col].nMatchCount) {\n nSelectedArr[nNoofSel][0] = row;\n nSelectedArr[nNoofSel][1] = col;\n nNoofSel++;\n\n }\n\n }\n\n if (checkGameOverforPlayer()) {\n nReturnData[0] = 1;\n return nReturnData;\n\n }\n\n\n int r, c;\n\n for (int k = 0; k < nNoofSel; k++) {\n\n row = nSelectedArr[k][0];\n col = nSelectedArr[k][1];\n\n if (checkFitArray(row, col)\n && pCellDataPlayerTurn[row][col].nTouchCount >= pCellDataPlayerTurn[row][col].nMatchCount) {\n\n if (pCellDataPlayerTurn[row][col].nTouchCount\n % pCellDataPlayerTurn[row][col].nMatchCount == 0) {\n pCellDataPlayerTurn[row][col].nTouchCount = 0;\n pCellDataPlayerTurn[row][col].bEmpty = true;\n } else {\n pCellDataPlayerTurn[row][col].nTouchCount = pCellDataPlayerTurn[row][col].nTouchCount\n % pCellDataPlayerTurn[row][col].nMatchCount;\n }\n\n r = row - 1;\n c = col;\n\n if (checkFitArray(r, c)) {\n\n pCellDataPlayerTurn[r][c].nPlayerID = nPlayerId;\n pCellDataPlayerTurn[r][c].nTouchCount++;\n\n pCellDataPlayerTurn[r][c].bEmpty = false;\n\n if (pCellDataPlayerTurn[r][c].nTouchCount >= pCellDataPlayerTurn[r][c].nMatchCount) {\n nSelectedArr[nNoofSel][0] = r;\n nSelectedArr[nNoofSel][1] = c;\n nNoofSel++;\n }\n\n\n if (nNoofSel >= nSelectedArr.length) {\n //System.out.println(\"arr limit excedded\");\n //return true;\n nReturnData[0] = 1;\n return nReturnData;\n }\n\n }\n\n r = row;\n c = col - 1;\n\n if (checkFitArray(r, c)) {\n\n pCellDataPlayerTurn[r][c].nPlayerID = nPlayerId;\n pCellDataPlayerTurn[r][c].nTouchCount++;\n pCellDataPlayerTurn[r][c].bEmpty = false;\n\n if (pCellDataPlayerTurn[r][c].nTouchCount >= pCellDataPlayerTurn[r][c].nMatchCount) {\n nSelectedArr[nNoofSel][0] = r;\n nSelectedArr[nNoofSel][1] = c;\n nNoofSel++;\n }\n\n\n if (nNoofSel >= nSelectedArr.length) {\n// System.out.println(\"arr limit excedded\");\n// return true;\n nReturnData[0] = 1;\n return nReturnData;\n }\n\n }\n\n r = row;\n c = col + 1;\n\n if (checkFitArray(r, c)) {\n\n pCellDataPlayerTurn[r][c].nPlayerID = nPlayerId;\n pCellDataPlayerTurn[r][c].nTouchCount++;\n pCellDataPlayerTurn[r][c].bEmpty = false;\n\n if (pCellDataPlayerTurn[r][c].nTouchCount >= pCellDataPlayerTurn[r][c].nMatchCount) {\n nSelectedArr[nNoofSel][0] = r;\n nSelectedArr[nNoofSel][1] = c;\n nNoofSel++;\n }\n\n if (nNoofSel >= nSelectedArr.length) {\n //System.out.println(\"arr limit excedded\");\n //return true;\n nReturnData[0] = 1;\n return nReturnData;\n }\n\n }\n\n r = row + 1;\n c = col;\n\n if (checkFitArray(r, c)) {\n\n pCellDataPlayerTurn[r][c].nPlayerID = nPlayerId;\n pCellDataPlayerTurn[r][c].nTouchCount++;\n pCellDataPlayerTurn[r][c].bEmpty = false;\n\n if (pCellDataPlayerTurn[r][c].nTouchCount >= pCellDataPlayerTurn[r][c].nMatchCount) {\n nSelectedArr[nNoofSel][0] = r;\n nSelectedArr[nNoofSel][1] = c;\n nNoofSel++;\n }\n\n\n if (nNoofSel >= nSelectedArr.length) {\n //System.out.println(\"arr limit excedded\");\n //return true;\n nReturnData[0] = 1;\n return nReturnData;\n }\n\n }\n\n }\n\n if (checkGameOverforPlayer()) {\n nReturnData[0] = 1;\n return nReturnData;\n\n }\n\n }\n\n }\n\n// if (bValidCell)\n// {\n// // player on board after split\n//\n// int nCpuBoardCnt = 0;\n//\n// for (int r = 0; r < NO_OF_CELL; r++)\n// {\n// for (int c = 0; c < NO_OF_CELL; c++)\n// {\n// if (!pCellDataPlayerTurn[r][c].bEmpty)\n//\n// {\n// if (pCellDataPlayerTurn[r][c].nPlayerID == nPlayerId)\n// nPlayerBoardCnt++;\n// else\n// nCpuBoardCnt++;\n// }\n//\n// }\n// }\n//\n// // copyCellDatatoCpuData();\n// pTriggerCell[nNoOfTrigCell].row = i;\n// pTriggerCell[nNoOfTrigCell].col = j;\n// pTriggerCell[nNoOfTrigCell].playercountonboard = nPlayerBoardCnt;\n// pTriggerCell[nNoOfTrigCell].cpucountonboard = nCpuBoardCnt;\n// pTriggerCell[nNoOfTrigCell].priority = 1;\n// nNoOfTrigCell++;\n//\n// if (nCpuBoardCnt == 0)\n// {\n// return true;\n// }\n//\n// }\n\n // }\n\n nReturnData[1] = 0;\n nReturnData[2]=0;\n\n for (int r = 0; r < NO_OF_CELL; r++) {\n for (int c = 0; c < NO_OF_CELL; c++) {\n if (!pCellDataPlayerTurn[r][c].bEmpty && pCellDataPlayerTurn[r][c].nPlayerID == nCpuId)\n nReturnData[1]++;\n if (!pCellDataPlayerTurn[r][c].bEmpty && pCellDataPlayerTurn[r][c].nPlayerID == nPlayerId)\n nReturnData[2]++;\n }\n\n }\n\n\n return nReturnData;\n\n }",
"public boolean winCheck(){\n for(int i=0; i<3; i++){//goes through rows\n for(int j=0; j<4; j++){//goes through columns\n if(board[i][j+3] != 0 && board[i+1][j+2] != 0 && board[i+2][j+1] != 0 && \n board[i+3][j] != 0)\n if(board[i][j+3]==(board[i+1][j+2]))\n if(board[i][j+3]==(board[i+2][j+1]))\n if(board[i][j+3]==(board[i+3][j])){\n GBoard[i][j+3].setIcon(star);\n GBoard[i+1][j+2].setIcon(star);\n GBoard[i+2][j+1].setIcon(star);\n GBoard[i+3][j].setIcon(star);\n wonYet=true;\n return true;\n }\n }\n }\n //checks for subdiagonals\n for(int i=0; i<3; i++){//goes through rows\n for(int j=0; j<4; j++){//goes through columns\n if(board[i][j] != 0 && board[i+1][j+1] != 0 && board[i+2][j+2] != 0 &&\n board[i+3][j+3] != 0)\n if(board[i][j] == (board[i+1][j+1]))\n if(board[i][j] == (board[i+2][j+2]))\n if(board[i][j] == (board[i+3][j+3])){\n GBoard[i][j].setIcon(star);\n GBoard[i+1][j+1].setIcon(star);\n GBoard[i+2][j+2].setIcon(star);\n GBoard[i+3][j+3].setIcon(star);\n wonYet=true;\n return true;\n } \n }\n }\n //check horizontals\n for(int i=0; i<6; i++){//goes through rows\n for(int j=0; j<4; j++){//goes through columns\n if(board[i][j] != 0 && board[i][j+1] != 0 && board[i][j+2] != 0 && \n board[i][j+3] != 0){\n if(board[i][j]==(board[i][j+1]))\n if(board[i][j]==(board[i][j+2]))\n if(board[i][j]==(board[i][j+3])){\n GBoard[i][j].setIcon(star);\n GBoard[i][j+1].setIcon(star);\n GBoard[i][j+2].setIcon(star);\n GBoard[i][j+3].setIcon(star);\n wonYet=true;\n return true;\n }\n }\n }\n }\n //checks for vertical wins\n for(int i=0; i<3; i++){//checks rows\n for(int j=0; j<7; j++){//checks columns\n if(board[i][j] != 0 && board[i+1][j] != 0 && board[i+2][j] != 0 && \n board[i+3][j] != 0){\n if(board[i][j]==(board[i+1][j]))\n if(board[i][j]==(board[i+2][j]))\n if(board[i][j]==(board[i+3][j])){\n GBoard[i][j].setIcon(star);\n GBoard[i+1][j].setIcon(star);\n GBoard[i+2][j].setIcon(star);\n GBoard[i+3][j].setIcon(star);\n wonYet=true;\n return true;\n }\n }\n }\n }\n return false; \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears the value of the 'OT_AVAIL_CACHE_IND' field. | public org.LNDCDC_NCS_TCS.ORDER_TYPES.apache.nifi.LNDCDC_NCS_TCS_ORDER_TYPES.Builder clearOTAVAILCACHEIND() {
OT_AVAIL_CACHE_IND = null;
fieldSetFlags()[11] = false;
return this;
} | [
"public void setOTAVAILCACHEIND(java.lang.CharSequence value) {\n this.OT_AVAIL_CACHE_IND = value;\n }",
"public org.LNDCDC_NCS_TCS.ORDER_TYPES.apache.nifi.LNDCDC_NCS_TCS_ORDER_TYPES.Builder setOTAVAILCACHEIND(java.lang.CharSequence value) {\n validate(fields()[11], value);\n this.OT_AVAIL_CACHE_IND = value;\n fieldSetFlags()[11] = true;\n return this;\n }",
"public java.lang.CharSequence getOTAVAILCACHEIND() {\n return OT_AVAIL_CACHE_IND;\n }",
"public java.lang.CharSequence getOTAVAILCACHEIND() {\n return OT_AVAIL_CACHE_IND;\n }",
"public boolean hasOTAVAILCACHEIND() {\n return fieldSetFlags()[11];\n }",
"public void clear() {\n cache = new BigDecimal[cache.length];\n }",
"public void clear() {\t\t\n\t\tcurrentValue = 0.0;\n\t}",
"@JMXBeanOperation(sortValue = \"21\", nameKey = \"org.fujion.console.cache.exp.clear.name\", impactType = IMPACT_TYPES.ACTION, descriptionKey = \"org.fujion.console.cache.exp.clear.description\")\n public String clearELCache() {\n int size = elCache.size();\n elCache.clear();\n return formatResult(\"exp.clear\", size);\n }",
"public org.LNDCDC_NCS_NCSAR.NCSAR_BUSINESS_UNITS.apache.nifi.LNDCDC_NCS_NCSAR_NCSAR_BUSINESS_UNITS.Builder clearADDRESSIND() {\n ADDRESS_IND = null;\n fieldSetFlags()[8] = false;\n return this;\n }",
"public void resetAvailable() {\n available = 0;\n }",
"void clear() {\n\t\tsumVal = Double.valueOf(0);\n\t\tnumbIDs.clear();\n\t}",
"public void reset() {\n cache.clear();\n cacheStart = 0;\n length = 0L;\n }",
"public void unsetAvailableValue() throws JNCException {\n delete(\"available\");\n }",
"public void reset() {\r\n\t\tsynchronized(cache) {\r\n\t\t\tcache.clear();\r\n\t\t}\r\n\t}",
"void resetCacheCounters();",
"public void resetCounters()\n {\n cacheHits = 0;\n cacheMisses = 0;\n }",
"public void clearAmountRemaining() {\n genClient.clear(CacheKey.amountRemaining);\n }",
"public void invalidateCountersCache() {\n if (settingsService.getLocalSettings().isShowCountersInAdCategories()) {\n getCountersCache().clear();\n }\n }",
"public void clear() {\r\n total = 0;\r\n history = \"0\";\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
declare and instantiate a FileController object for text file "student.txt" | public static void main (String[] args) throws IOException {
File file = new File ("student.txt");
FileController fc = new FileController (file);
ArrayList<String> recs = new ArrayList <String>();
ArrayList<String> recsReturn;
recs.add("031111A;Mary Tan;1/06/1981;100;100;90");
recs.add("155555P;John Tan;3/08/1982;80;70;90");
recs.add("170293B;Jane Lim;7/09/1983;90;80;70");
// add 2 more records to the recs ArrayList
// invoke the writeLine method in FileController
// to write records to file
fc.writeLine(recs);
// invoke the readLine methods in FileController to read
// records from file and stores the records in variable recsReturn
// write a for loop to print out names of the students
} | [
"public FileController() {\n\n\t}",
"public void openTxtFile() {\n try {\n input = new ObjectInputStream(new FileInputStream(\"myfile.txt\"));\n System.out.println(\"*** txt File opened for reading ***\");\n } catch (IOException iow) {\n System.out.println(\"Error opening txt File: \" + iow.getMessage());\n }\n }",
"private void readFromFile(){\n\t\t\n\t\ttry {\n\t\t\tFile file=new File(\"controller.txt\");\n\t\t\tFileInputStream fin;\n\t\t\tfin = new FileInputStream(file);\n\t\t\tDataInputStream din=new DataInputStream(fin);\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(din));\n\t\t\t\n\t\t\tfor(int i=0; i<2; i++){\n\t\t\t\tif(i==0)\n\t\t\t\t\tcodedUserName=br.readLine();\n\t\t\t\telse \n\t\t\t\t\tcodedPassword=br.readLine();\n\t\t\t}\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}",
"public TextFile(String filePath) {\r\n // textFile is created if a file with given path/name does not exist\r\n // otherwise, filePath is simply assigned (no need to create a new file)\r\n if (textFileNew(filePath))\r\n textFileCreate(filePath);\r\n this.filePath = filePath;\r\n }",
"public TextFile(Scanner input) {\n \tSystem.out.println(\"Enter your Textfile name: \");\n \tString textfilename = input.nextLine(); \n \ttextFile = new File(textfilename);\n \tthis.checkFile();\n }",
"CreamCaretaker(String filename)\n {\n file = filename;\n }",
"public FileEditor(String filename){\n this.filename = filename+\".txt\";\n }",
"public TextFileWriter(String fileName)\n {\n this.fileName = fileName;\n }",
"public ReadTextFileToString() {\n }",
"public ProteinMaker(File file, Controller cont, Main main) {\n\t\tthis.file = file;\n\t\tcontroller = cont;\n\t\tthis.main = main;\n\t}",
"public interface IFilesController {\n /**\n * This method is used to create a file.\n *\n * @param fileName This parameter is the name of the file that should be created.\n * @throws IOException An error might occur at creating files, that already exist or that cannot be created.\n */\n void createFile(String fileName) throws IOException;\n\n /**\n * This method provides abstract read access to a requested file.\n *\n * @param fileName This parameter is the name of the file that read access is requested for.\n * @return The method returns abstract read access for the given file.\n * @throws IOException An error might occur, if the file does not exist.\n */\n IFileReadAccess getReaderForFile(String fileName) throws IOException;\n\n /**\n * This method provides abstract write access to a requested file.\n *\n * @param fileName This parameter is the name of the file that write access is requested for.\n * @return The method returns abstract write access for the given file.\n * @throws IOException An error might occur, if the file does not exist.\n */\n IFileWriteAccess getWriterForFile(String fileName) throws IOException;\n}",
"public InputHandler(String filename)\r\n {\r\n setInputFile(filename);\r\n }",
"public SpecfileTaskHandler(FileEditorInput file, IDocument document) {\n \t\tthis(file.getFile(), document);\n \t}",
"public void readFromFile(){\n\t\ttry {\r\n\t\t\tFile f = new File(\"E:\\\\Study\\\\Course\\\\CSE215L\\\\Project\\\\src\\\\Railway.txt\");\r\n\t\t\tScanner s = new Scanner(f);\r\n\t\t\tpersons = new Person [50]; // since we don't know the exact number of records, initialize the array to a reasonably sized one\r\n\t\t\tint i = 0;\r\n\t\t\t\r\n\t\t\twhile(s.hasNextLine()){\r\n\t\t\t\tString a = s.nextLine(); // read id;\r\n\t\t\t\tString b = s.nextLine();\r\n\t\t\t\tString c = s.nextLine();\r\n\t\t\t\tString d = s.nextLine();\r\n\t\t\t\tString e = s.nextLine();\r\n\t\t\t\tString g = s.nextLine();\r\n\t\t\t\tString h = s.nextLine();\r\n\t\t\t\tString j = s.nextLine();\r\n\t\t\t\tPerson temp = new Person (a,b,c,d,e,g,h,j); // create Student object\r\n\t\t\t\tpersons[i] = temp; // store in array\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}",
"public FileService(String fileName){\r\n \r\n //String is passed in first and then converted to an actual file\r\n File file = new File(fileName); //need to create exception handling here!!!\r\n \r\n //set properties\r\n inputStrategy = new CsvInput();\r\n inputStrategy.setFile(file);\r\n \r\n outputStrategy = new CsvOutput();\r\n outputStrategy.setFile(file);\r\n }",
"private void readStudent() throws IOException {\n FileReader fd = new FileReader(\"/Users/dawitgebremichael/hcc/javaII/src/main/java/domain/student.txt\");\n BufferedReader br = new BufferedReader(fd);\n String line = br.readLine(); //This read the first line\n\n Student student; //variable declaration\n\n // This reads address from the address.text and loads it to addressesList\n readAddress();\n\n while (line != null){\n\n //1,Mike,3.2,2 -- this is the first line that is read but we read the rest of the file\n String[] data = line.split(\",\");\n // what is the address of the student\n int addressId = Integer.parseInt(data[3]);\n //Let's find the address from addressList collection\n Address address = searchByAddressId(addressId);\n //create object for each line in the file\n student = new Student(Integer.parseInt(data[0]),data[1],Float.parseFloat(data[2]),address);\n //add each object in the collection\n studentList.add(student);\n //read the next line\n line = br.readLine();\n }\n\n }",
"public BiomartAccess(String fname) \n {\n m_file = new File(fname);\n }",
"public void setFile(File contactFile);",
"public RouteDocument(File file) {\n this.file = file;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete the okuSofor by id. | @Override
public void delete(Long id) {
log.debug("Request to delete OkuSofor : {}", id);
okuSoforRepository.delete(id);
} | [
"@Override\n public void delete(Long id) {\n log.debug(\"Request to delete OkuSefer : {}\", id);\n okuSeferRepository.delete(id);\n okuSeferSearchRepository.delete(id);\n }",
"@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Sintoma : {}\", id);\n sintomaRepository.delete(id);\n }",
"public void delete(Long id) {\n log.debug(\"Request to delete Kohnegi : {}\", id);\n kohnegiRepository.deleteById(id);\n }",
"@Override\n public void delete(Long id) {\n log.debug(\"Request to delete MSatuan : {}\", id);\n mSatuanRepository.deleteById(id);\n }",
"public void delete(Long id) {\n log.debug(\"Request to delete SolicitacaoExame : {}\", id);\n solicitacaoExameRepository.deleteById(id);\n solicitacaoExameSearchRepository.deleteById(id);\n }",
"@Override\n public void delete(String id) {\n log.debug(\"Request to delete DuLieuBaoCao : {}\", id);\n duLieuBaoCaoRepository.deleteById(id);\n }",
"public void delete(Long id) {\n log.debug(\"Request to delete KohnegiBadane : {}\", id);\n kohnegiBadaneRepository.deleteById(id);\n }",
"@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Jeu : {}\", id);\n jeuRepository.delete(id);\n jeuSearchRepository.delete(id);\n }",
"@Override\n public void delete(String id) {\n log.debug(\"Request to delete Aluno : {}\", id);\n alunoRepository.delete(id);\n alunoSearchRepository.delete(id);\n }",
"public void delete(Long id) {\n log.debug(\"Request to delete AdamKhesaratSarneshin : {}\", id); adamKhesaratSarneshinRepository.deleteById(id);\n }",
"@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Infortunio : {}\", id);\n infortunioRepository.deleteById(id);\n }",
"public void delete(Long id) {\n log.debug(\"Request to delete NextOfKin : {}\", id);\n nextOfKinRepository.deleteById(id);\n }",
"public void delete(Long id) {\n log.debug(\"Request to delete Fornecedor : {}\", id);\n fornecedorRepository.delete(id);\n }",
"void deletePesawat(Long idPesawat);",
"@Override\n\tpublic void delete(Long id) {\n\t\tlog.debug(\"Request to delete Apeksha : {}\", id);\n\t\tapekshaRepository.delete(id);\n\t\tapekshaSearchRepository.delete(id);\n\t}",
"@DeleteMapping(\"/sabeghes/{id}\")\n public ResponseEntity<Void> deleteSabeghe(@PathVariable Long id) {\n log.debug(\"REST request to delete Sabeghe : {}\", id);\n sabegheService.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }",
"public void delById(Serializable id) ;",
"@DeleteMapping(\"/uoms/{id}\")\n @Timed\n public ResponseEntity<Void> deleteUom(@PathVariable String id) {\n log.debug(\"REST request to delete Uom : {}\", id);\n uomService.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id)).build();\n }",
"@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Wilaya : {}\", id);\n wilayaRepository.delete(id);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensure the directory exists and has the given permissions. Security risk: the mode argument is passed as is to chmod (and thus may be used to inject undesired switches). Only pass values you trust as this argument. | public static void mkdir (String path, String mode) throws IOException, InterruptedException
{
final File f = new File(path);
final String abs_path = f.getAbsolutePath();
if (!f.mkdirs())
{
throw new RuntimeException(
"could not create " + path + "; " +
"please make sure that it is not a file " +
"and make sure that the nearest directory is writable"
);
}
// Java NIO doesn't have anything to convert octal to Set<PosixFilePermission>.
final int r = exec("chmod", mode, abs_path);
if (r != 0)
{
throw new IOException("chmod " + mode + " " + abs_path + " exited with code " + r);
}
} | [
"private static void setFilePermissions(String path, int mode) throws Exception {\n \n int errorCode = (Integer) Class.forName(\"android.os.FileUtils\")\n .getMethod(\"setPermissions\", String.class, int.class, int.class, int.class)\n .invoke(null, path, mode, -1, -1);\n assertThat(errorCode).isEqualTo(0);\n assertThat(getFilePermissions(path) & 0777).isEqualTo(mode);\n }",
"public static native boolean mkdir(String path, int mode)\n throws IOException;",
"public static int setPermissions(String file, int mode) {\n return setPermissions(file, mode, -1, -1);\n }",
"@TaskAction\n public void create() {\n dir.mkdirs();\n getChmod().chmod(dir, dirMode);\n }",
"public static native void chmod(String path, int mode) throws IOException;",
"private static void checkAccess(File directory, boolean isWriteable) throws IOException {\n if(!directory.exists()) {\n if(directory.mkdirs()) {\n logger.debug(\"Created directory [{}]\", directory.getCanonicalPath());\n } else {\n throw new IOException(\"Could not create directory \" +\n \"[\"+directory.getCanonicalPath()+\"], \" +\n \"make sure you have the proper \" +\n \"permissions to create, read & write \" +\n \"to the file system\");\n }\n }\n // Find if we can write to the record root directory\n if(!directory.canRead())\n throw new IOException(\"Cant read from : \"+directory.getCanonicalPath());\n if(isWriteable) {\n if(!directory.canWrite())\n throw new IOException(\"Cant write to : \"+directory.getCanonicalPath());\n }\n }",
"private static boolean checkFsWritable() {\n\n\t\tString directoryName = Environment.getExternalStorageDirectory().toString() + \"/DCIM\";\n\t\tFile directory = new File(directoryName);\n\t\tif (!directory.isDirectory()) {\n\t\t\tif (!directory.mkdirs()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn directory.canWrite();\n\t}",
"private boolean setPermissions(String fileid, String gmail, int mode) throws IOException {\n\t\tPermission newPermission = new Permission();\n\n\t newPermission.setValue(gmail);\n\t newPermission.setType(\"user\");\n\t if (mode == READ) {\n\t \tnewPermission.setRole(\"reader\"); //owner,writer,reader\n\t } else {\n\t \tnewPermission.setRole(\"writer\"); //owner,writer,reader\n\t }\n\t \n\t mService.permissions().insert(fileid, newPermission).execute();\t \n\t \n\t return true;\n\t \n\n\t}",
"private static boolean checkFsWritable() {\n String directoryName = Environment.getExternalStorageDirectory().toString() + \"/DCIM\";\n File directory = new File(directoryName);\n if (!directory.isDirectory()) {\n if (!directory.mkdirs()) {\n return false;\n }\n }\n return directory.canWrite();\n }",
"public static int creat(String pathname, short mode)\n throws Exception {\n // get the full path\n String fullPath = getFullPath(pathname);\n FileSystem fileSystem = openFileSystems[ROOT_FILE_SYSTEM];\n\n StringBuffer dirname = new StringBuffer(\"/\");\n IndexNode currIndexNode = getRootIndexNode();\n IndexNode prevIndexNode = null;\n short indexNodeNumber = FileSystem.ROOT_INDEX_NODE_NUMBER;\n\n StringTokenizer st = new StringTokenizer(fullPath, \"/\");\n String name = \".\"; // start at root node\n while (st.hasMoreTokens()) {\n name = st.nextToken();\n if (!name.equals(\"\")) {\n // check to see if the current node is a directory\n if ((currIndexNode.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 if (st.hasMoreTokens()) {\n dirname.append(name);\n dirname.append('/');\n }\n\n // get the next inode corresponding to the token\n prevIndexNode = currIndexNode;\n currIndexNode = new IndexNode();\n indexNodeNumber = findNextIndexNode(\n fileSystem, prevIndexNode, name, currIndexNode);\n }\n }\n\n // ??? we need to set some fields in the file descriptor\n int flags = O_WRONLY; // ???\n FileDescriptor fileDescriptor = null;\n\n if (indexNodeNumber < 0) {\n // file does not exist. We check to see if we can create it.\n\n // check to see if the prevIndexNode (a directory) is writeable\n // ??? tbd\n // return (EACCES) if the file does not exist and the directory\n // in which it is to be created is not writable\n\n currIndexNode.setMode(mode);\n currIndexNode.setNlink((short) 1);\n\n // allocate the next available inode from the file system\n short newInode = fileSystem.allocateIndexNode();\n if (newInode == -1)\n return -1;\n\n fileDescriptor =\n new FileDescriptor(fileSystem, currIndexNode, flags);\n // assign inode for the new file\n fileDescriptor.setIndexNodeNumber(newInode);\n\n// System.out.println( \"newInode = \" + newInode ) ;\n fileSystem.writeIndexNode(currIndexNode, newInode);\n\n // open the directory\n // ??? it would be nice if we had an \"open\" that took an inode \n // instead of a name for the dir\n// System.out.println( \"dirname = \" + dirname.toString() ) ;\n int dir = open(dirname.toString(), O_RDWR);\n if (dir < 0) {\n Kernel.perror(PROGRAM_NAME);\n System.err.println(PROGRAM_NAME +\n \": unable to open directory for writing\");\n process.errno = ENOENT;\n return -1;\n }\n\n // scan past the directory entries less than the current entry\n // and insert the new element immediately following\n int status;\n DirectoryEntry newDirectoryEntry =\n new DirectoryEntry(newInode, name);\n DirectoryEntry currentDirectoryEntry = new DirectoryEntry();\n while (true) {\n // read an entry from the directory\n status = readdir(dir, currentDirectoryEntry);\n if (status < 0) {\n System.err.println(PROGRAM_NAME +\n \": error reading directory in creat\");\n System.exit(EXIT_FAILURE);\n } else if (status == 0) {\n // if no entry read, write the new item at the current \n // location and break\n writedir(dir, newDirectoryEntry);\n break;\n } else {\n // if current item > new item, write the new item in \n // place of the old one and break\n if (currentDirectoryEntry.getName().compareTo(\n newDirectoryEntry.getName()) > 0) {\n int seek_status =\n lseek(dir, -DirectoryEntry.DIRECTORY_ENTRY_SIZE, 1);\n if (seek_status < 0) {\n System.err.println(PROGRAM_NAME +\n \": error during seek in creat\");\n System.exit(EXIT_FAILURE);\n }\n writedir(dir, newDirectoryEntry);\n break;\n }\n }\n }\n // copy the rest of the directory entries out to the file\n while (status > 0) {\n DirectoryEntry nextDirectoryEntry = new DirectoryEntry();\n // read next item\n status = readdir(dir, nextDirectoryEntry);\n if (status > 0) {\n // in its place\n int seek_status =\n lseek(dir, -DirectoryEntry.DIRECTORY_ENTRY_SIZE, 1);\n if (seek_status < 0) {\n System.err.println(PROGRAM_NAME +\n \": error during seek in creat\");\n System.exit(EXIT_FAILURE);\n }\n }\n // write current item\n writedir(dir, currentDirectoryEntry);\n // current item = next item\n currentDirectoryEntry = nextDirectoryEntry;\n }\n\n // close the directory\n close(dir);\n } else {\n // file does exist ( indexNodeNumber >= 0 )\n\n // if it's a directory, we can't truncate it\n if ((currIndexNode.getMode() & S_IFMT) == S_IFDIR) {\n // return (EISDIR) if the file is a directory\n process.errno = EISDIR;\n return -1;\n }\n\n // check to see if the file is writeable by the user\n // ??? tbd\n // return (EACCES) if the file does exist and is unwritable\n\n // free any blocks currently allocated to the file\n int blockSize = fileSystem.getBlockSize();\n int blocks = (currIndexNode.getSize() + blockSize - 1) /\n blockSize;\n for (int i = 0; i < blocks; i++) {\n int address = currIndexNode.getBlockAddress(i);\n if (address != FileSystem.NOT_A_BLOCK) {\n fileSystem.freeBlock(address);\n currIndexNode.setBlockAddress(i, FileSystem.NOT_A_BLOCK);\n }\n }\n\n // update the inode to size 0\n currIndexNode.setSize(0);\n\n // write the inode to the file system.\n fileSystem.writeIndexNode(currIndexNode, indexNodeNumber);\n\n // set up the file descriptor\n fileDescriptor =\n new FileDescriptor(fileSystem, currIndexNode, flags);\n // assign inode for the new file\n fileDescriptor.setIndexNodeNumber(indexNodeNumber);\n\n }\n\n return open(fileDescriptor);\n }",
"@Override\n // A directory can always be written (add files and sub-dirs)\n public boolean canWrite()\n {\n return (isDirectory() ? isReadable() : isModifiable());\n }",
"protected void ensurePathExists(String path, final CreateMode flags) {\n\t\tensureExists(path, null, acl, flags);\n\t}",
"public void setChmod(String theMode) {\n this.chmod = theMode;\n }",
"public static void demonstrateMkDir(String testDirPath )\n {\n boolean result = false;\n \n // set file & directory names \n String dirname1 = getDirPath1(testDirPath);\n String dirname2 = getDirPath2(testDirPath);\n String dirname3 = getDirPath3(testDirPath);\n String dirname4 = getDirPath4(testDirPath);\n String readOnlyDirPath = getReadOnlyDirPath(testDirPath);\n String readOnlyDirPath2 = getReadOnlyDirPath(testDirPath)+\"\\\\\"+\"testdir\";\n String invalidDirPath = testDirPath+FILE_1+\"\\\\\"+FILE_2;\n \n File dir1 = osFile(dirname1);\n File dir2 = osFile(dirname2); \n File dir3 = osFile(dirname3);\n File dir4 = osFile(dirname4);\n\n File readOnlyDir = osFile(readOnlyDirPath);\n File invalidDir = osFile(invalidDirPath);\n \n System.out.println();\n System.out.println();\n\n System.out.println(\"\\nDemonstrate mkdir() without try/catch\\n\");\n \n // mkdir test 1 : without try/catch : directory does not exist\n System.out.println(\"mkdir Test 1: creating directory with valid path\"); \n \n // mkdir() - Creates the directory named by this abstract pathname. \n result = dir4.mkdir();\n if (result)\n System.out.println(\"mkdir Test 1: Success \" + dir4.getName() + \" was created\");\n else \n System.out.println(\"mkdir Test 1: Failed \" + dir4.getName() + \" was not created\");\n System.out.println();\n \n \n // mkdir test 2 : without try/catch : directory exists\n System.out.println(\"mkdir Test 2: creating directory that already exists\"); \n result = dir4.mkdir();\n if (result)\n System.out.println(\"mkdir Test 2: Failed \" + dir4.getName() + \" was created\");\n else \n System.out.println(\"mkdir Test 2: Success \" + dir4.getName() + \" was not created\");\n System.out.println();\n \n // mkdir test 3 : without try/catch : only read permissions directory \n System.out.println(\"mkdir Test 3: creating directory in a readonly directory\"); \n result = readOnlyDir.mkdir();\n if (result)\n System.out.println(\"mkdir Test 3: Failed \" + readOnlyDir.getName() + \" was created\");\n else \n System.out.println(\"mkdir Test 3: Success \" + readOnlyDir.getName() + \" was not created\");\n System.out.println();\n \n // mkdir test 4 : without try/catch : invalid path \n System.out.println(\"mkdir Test 4: creating directory with an invalid path\"); \n\n result = invalidDir.mkdir();\n if (result)\n System.out.println(\"mkdir Test 4: Failed \" + invalidDir.getName() + \" was created\");\n else \n System.out.println(\"mkdir Test 4: Success \" + invalidDir.getName() + \" was not created\");\n System.out.println();\n \n // mkdir test 5 : without try/catch : null file \n System.out.println(\"mkdir Test 5: creating a null directory \"); \n System.out.printf(\"The next test throws an exception & causes the program to halt. \"\n + \"Do you want to continue? y n : \");\n Scanner keyboard = new Scanner(System.in);\n String runTest = keyboard.nextLine();\n if(runTest.equals(\"y\"))\n {\n File nullfile = null;\n result = nullfile.mkdir();\n if (result)\n System.out.println(\"mkdir Test 5: Failed nullfile was created\");\n else \n System.out.println(\"mkdir Test 5: Success nullfile was not created\");\n }\n else\n System.out.println(\"mkdir Test 5: did not run\");\n System.out.println(); \n }",
"@Test\n public void testIsWritableDirectory() {\n System.out.println(\"isWritableDirectory\");\n String directory;\n boolean expResult;\n boolean result;\n\n try {\n File temp = File.createTempFile(\"dummy\", null);\n temp.deleteOnExit();\n directory = temp.getAbsolutePath();\n directory = directory.substring(0, directory.lastIndexOf('/'));\n System.out.println(\"temporary directory is \\\"\" + directory + \"\\\"\");\n expResult = true;\n result = NativeLibraryUtil.isWritableDirectory(directory);\n assertEquals(expResult, result);\n }\n catch (IOException e) {\n\n }\n\n directory = \"no-such-directory\";\n expResult = false;\n result = NativeLibraryUtil.isWritableDirectory(directory);\n assertEquals(expResult, result);\n }",
"private static void setPermission(Path path) throws JulongChainException {\n if(System.getProperty(SYSTEM_PROP_OS).contains(SYSTEM_PROP_VALUE_WINDOWS)) {\n return;\n }\n\n Set<PosixFilePermission> filePermissions = new HashSet<>();\n filePermissions.add(PosixFilePermission.OWNER_READ);\n filePermissions.add(PosixFilePermission.OWNER_WRITE);\n filePermissions.add(PosixFilePermission.OWNER_EXECUTE);\n filePermissions.add(PosixFilePermission.GROUP_READ);\n filePermissions.add(PosixFilePermission.GROUP_EXECUTE);\n filePermissions.add(PosixFilePermission.OTHERS_READ);\n filePermissions.add(PosixFilePermission.OTHERS_EXECUTE);\n try {\n Files.setPosixFilePermissions(path, filePermissions);\n } catch (IOException e) {\n throw new JulongChainException(\"set directory\" + path + \" permission failed \" + e.getMessage());\n }\n }",
"boolean create_folder();",
"@Test\n public void testSetUmaskInRealTime() throws Exception {\n PlatformAssumptions.assumeNotWindows();\n LocalFileSystem localfs = FileSystem.getLocal(new Configuration());\n Configuration conf = localfs.getConf();\n conf.set(FS_PERMISSIONS_UMASK_KEY, \"022\");\n TestLocalFileSystemPermission.LOGGER.info(\"Current umask is {}\", conf.get(FS_PERMISSIONS_UMASK_KEY));\n Path dir = new Path(((TestLocalFileSystemPermission.TEST_PATH_PREFIX) + \"dir\"));\n Path dir2 = new Path(((TestLocalFileSystemPermission.TEST_PATH_PREFIX) + \"dir2\"));\n try {\n Assert.assertTrue(localfs.mkdirs(dir));\n FsPermission initialPermission = getPermission(localfs, dir);\n Assert.assertEquals((\"With umask 022 permission should be 755 since the default \" + \"permission is 777\"), new FsPermission(\"755\"), initialPermission);\n // Modify umask and create a new directory\n // and check if new umask is applied\n conf.set(FS_PERMISSIONS_UMASK_KEY, \"062\");\n Assert.assertTrue(localfs.mkdirs(dir2));\n FsPermission finalPermission = localfs.getFileStatus(dir2).getPermission();\n Assert.assertThat((\"With umask 062 permission should not be 755 since the \" + \"default permission is 777\"), new FsPermission(\"755\"), CoreMatchers.is(CoreMatchers.not(finalPermission)));\n Assert.assertEquals(\"With umask 062 we expect 715 since the default permission is 777\", new FsPermission(\"715\"), finalPermission);\n } finally {\n conf.set(FS_PERMISSIONS_UMASK_KEY, \"022\");\n cleanup(localfs, dir);\n cleanup(localfs, dir2);\n }\n }",
"public void testSystemDirAccess() {\n File file = new File(\"/system\");\n assertTrue(file.canRead());\n assertFalse(file.canWrite());\n\n File fakeSystemFile = new File(file, \"test\");\n try {\n fakeSystemFile.createNewFile();\n fail(\"should throw out IO exception\");\n } catch (IOException e) {\n }\n\n assertFalse(fakeSystemFile.mkdirs());\n\n file = new File(\"/system/app\");\n assertTrue(file.canRead());\n assertFalse(file.canWrite());\n\n // Test not writable / deletable for all files\n File[] allFiles = file.listFiles();\n for (File f : allFiles) {\n assertFalse(f.canWrite());\n assertFalse(f.delete());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method was generated by MyBatis Generator. This method sets the value of the database column BLACKLIST_OVERRIDE_REASON.PARENT_REF | public void setPARENT_REF(String PARENT_REF) {
this.PARENT_REF = PARENT_REF == null ? null : PARENT_REF.trim();
} | [
"public void setPARENT_APP_REF(BigDecimal PARENT_APP_REF) {\r\n this.PARENT_APP_REF = PARENT_APP_REF;\r\n }",
"public void setPARENT_COUNTRY_CODE_OLD(BigDecimal PARENT_COUNTRY_CODE_OLD)\r\n {\r\n\tthis.PARENT_COUNTRY_CODE_OLD = PARENT_COUNTRY_CODE_OLD;\r\n }",
"public String getPARENT_REF() {\r\n return PARENT_REF;\r\n }",
"private void createSetFKParent(){\n Hashtable table=sqlTagsGeneratorTable.getImportedForeignKeyHash();\n Enumeration enum=table.keys();\n\n buffer.append(\" /**\\n\");\n buffer.append(\" * The <b><code>setFKParent</code></b> method is \");\n buffer.append(\"used to initializes Foreign\\n\");\n buffer.append(\" * Key columns within the HCYP_EVENTS table.\\n\");\n buffer.append(\" * @author Booker Northington II\\n\");\n buffer.append(\" * @version 1.0\\n\");\n buffer.append(\" * @param depth how many levels to initialize.\\n\");\n buffer.append(\" * @return none\\n\");\n buffer.append(\" * @since JDK1.3\\n\");\n buffer.append(\" */\\n\");\n buffer.append(spacer);\n buffer.append(\" public void setFKParent(int depth){\\n\");\n buffer.append(spacer);\n buffer.append(\" if(depth>0){\\n\");\n\n for(;enum.hasMoreElements();){\n String key=(String)enum.nextElement();\n SQLTagsGeneratorForeignKey object=(SQLTagsGeneratorForeignKey)\n table.get(key);\n String fkName=object.getFkName();\n buffer.append(\" \"+fkName+\"_PARENT=get\"+fkName+\"_PARENT\");\n buffer.append(\"(depth-1);\\n\");\n }\n buffer.append(\" }\\n\");\n buffer.append(\" return;\\n\");\n buffer.append(\" }// setFKParent() ENDS\\n\");\n }",
"public void relationParentChanged(RelationInstance ri, int signal)\r\n\t{\n\r\n\t\tm_flags |= REFILL_FLAG;\r\n\t}",
"@ApiModelProperty(value = \"Do you ever get the feeling that a system has become so overburdened by edge cases that it probably should have become some other system entirely? So do I! In totally unrelated news, Plugs can now override properties of their parent items. This is some of the relevant definition data for those overrides. If this is populated, it will have the override data to be applied when this plug is applied to an item.\")\n public Object getParentItemOverride() {\n return parentItemOverride;\n }",
"public void setPARENT_COUNTRY_CODE(BigDecimal PARENT_COUNTRY_CODE)\r\n {\r\n\tthis.PARENT_COUNTRY_CODE = PARENT_COUNTRY_CODE;\r\n }",
"public void setParentCode(String parentCode) {\r\n\t\tthis.parentCode = parentCode;\r\n\t}",
"public void setParentCode(String parentCode) {\n this.parentCode = parentCode;\n }",
"public void setParent(RationaleElement parent) {\r\n \t\tif (parent != null) {\r\n \t\t\tthis.parent = parent.getID();\r\n \t\t\tthis.ptype = parent.getElementType();\r\n \t\t}\r\n \t}",
"private static void updateConstraintPropertiesForInheritance() throws SQLException,\r\n\t\t\tDAOException\r\n\t{\r\n\t\tSystem.out\r\n\t\t\t\t.println(\"UpdateSchemaForConstraintProperties.updateConstraintPropertiesForInheritance()\");\r\n\t\tJDBCDAO jdbcdao = null;\r\n\t\tfinal String appName = CommonServiceLocator.getInstance().getAppName();\r\n\t\tfinal IDAOFactory daoFactory = DAOConfigFactory.getInstance().getDAOFactory(appName);\r\n\t\tjdbcdao = daoFactory.getJDBCDAO();\r\n\t\tjdbcdao.openSession(null);\r\n\t\tfinal String getEntityIdQuery = \"select IDENTIFIER, PARENT_ENTITY_ID from DYEXTN_ENTITY where PARENT_ENTITY_ID is not null\";\r\n\t\tfinal ResultSet resultSet = jdbcdao.getQueryResultSet(getEntityIdQuery);\r\n\t\tfinal String getTablePropertiesQuery = \"select CONSTRAINT_NAME from DYEXTN_TABLE_PROPERTIES where ABSTRACT_ENTITY_ID = \";\r\n\r\n\t\tfinal List<Vector> list = new ArrayList<Vector>();\r\n\t\twhile (resultSet.next())\r\n\t\t{\r\n\t\t\tlong entityId = 0;\r\n\t\t\tlong parentEntityId = 0;\r\n\t\t\tString cnstrName = null;\r\n\t\t\tfinal Vector vList = new Vector<List>();\r\n\t\t\tentityId = resultSet.getLong(1);\r\n\t\t\tparentEntityId = resultSet.getLong(2);\r\n\r\n\t\t\tfinal ResultSet rsltSet = jdbcdao.getQueryResultSet(getTablePropertiesQuery + entityId);\r\n\t\t\tif (rsltSet.next())\r\n\t\t\t{\r\n\t\t\t\tcnstrName = rsltSet.getString(1);\r\n\t\t\t}\r\n\t\t\tjdbcdao.closeStatement(rsltSet);\r\n\t\t\tvList.add(Long.toString(entityId));\r\n\t\t\tvList.add(Long.toString(parentEntityId));\r\n\t\t\tvList.add(cnstrName);\r\n\t\t\tlist.add(vList);\r\n\t\t}\r\n\r\n\t\tjdbcdao.closeStatement(resultSet);\r\n\t\tjdbcdao.closeSession();\r\n\r\n\t\tfor (final Vector v : list)\r\n\t\t{\r\n\t\t\tjdbcdao = daoFactory.getJDBCDAO();\r\n\t\t\tjdbcdao.openSession(null);\r\n\t\t\tfinal long entityId = Long.parseLong(v.get(0).toString());\r\n\t\t\tfinal long parentEntityId = Long.parseLong(v.get(1).toString());\r\n\t\t\tString cnstrName = null;\r\n\r\n\t\t\tif (v.get(2) != null)\r\n\t\t\t{\r\n\t\t\t\tcnstrName = v.get(2).toString();\r\n\t\t\t}\r\n\t\t\taddConstraintProperties(entityId, parentEntityId, cnstrName, jdbcdao);\r\n\t\t\tjdbcdao.commit();\r\n\t\t\tjdbcdao.closeSession();\r\n\r\n\t\t}\r\n\r\n\t}",
"public void setParentCode(String parentCode) {\n this.parentCode = parentCode == null ? null : parentCode.trim();\n }",
"public void setParentFkey(long ruleFk) {\r\n this.parentFkey = ruleFk;\r\n this.dirtyFlag = true;\r\n }",
"private void onChangeParent()\r\n {\r\n if ( !this.beingBuilt ) {\r\n String newParentName = (String) this.cbParent.getSelectedItem();\r\n\r\n if ( !( this.getObj().getParentObject().getName().equals( newParentName ) ) ) {\r\n this.visualEngine.execute( this.getObj().getPath() + \".parent = \" + newParentName );\r\n this.updateObjectBasicAttributes();\r\n this.finish();\r\n }\r\n }\r\n }",
"private void handleChangeParent(RelationshipVersionBI<?> rel) throws Exception\n\t{\t\n\t\tif (rel.getTypeNid() == Snomed.IS_A.getLenient().getNid()) \n\t\t{\n\t\t\tbt.selectSheet(SHEET.Change_Parent);\n\t\t\tbt.addRow();\n\t\t\tfor (COLUMN column : bt.getColumnsOfSheet(SHEET.Change_Parent)) {\n\t\t\t\tswitch(column)\n\t\t\t\t{\n\t\t\t\t\tcase Topic:\n\t\t\t\t\t\tbt.addStringCell(column, this.getTopic(OTFUtility.getConceptVersion(rel.getConceptNid())));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Source_Terminology:\n\t\t\t\t\t\tbt.addStringCell(column, getTerminology(OTFUtility.getConceptVersion(rel.getConceptNid())));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Concept_Id:\n\t\t\t\t\t\tbt.addNumericCell(column, getSct(rel.getConceptNid()));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase New_Parent_Concept_Id:\n\t\t\t\t\t\tbt.addNumericCell(column, getSct(rel.getDestinationNid()));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase New_Parent_Terminology:\n\t\t\t\t\t\tbt.addStringCell(column, getTerminology(OTFUtility.getConceptVersion(rel.getDestinationNid())));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Justification:\n\t\t\t\t\t\tif(ExtendedAppContext.getCurrentlyLoggedInUserProfile().getExtensionNamespace() != null) {\n\t\t\t\t\t\t\tbt.addStringCell(column, \"Developed as part of extension namespace \" + ExtendedAppContext.getCurrentlyLoggedInUserProfile().getExtensionNamespace());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbt.addStringCell(column, \"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Note:\n\t\t\t\t\t\tgetNote(rel.getDestinationNid());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault :\n\t\t\t\t\t\tthrow new RuntimeException(\"Unexpected column type found in Sheet: \" + column + \" - \" + SHEET.Change_Parent);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void setParentResourceId(Long parentResourceId) {\n\t\tthis.parentResourceId = parentResourceId;\n\t}",
"public void setParentStyleHint(String styleHint) {\n this.parentStyleHint = styleHint;\n }",
"String getSelectListItemReferenceFixStatement();",
"public void setParentCodeId(Long parentCodeId) {\r\n this.parentCodeId = parentCodeId;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the level of enchantment of the item | public int getEnchantLevel()
{
return _enchantLevel;
} | [
"public int getItemEnchantability()\n {\n return this.toolMaterial.getEnchantability();\n }",
"public int getItemEnchantability()\r\n {\r\n return this.toolMaterial.getEnchantability();\r\n }",
"public int getItemEnchantability()\n\t{\n\t\treturn 0; //this.material.getEnchantability();\n\t}",
"public int getItemEnchantability()\n\t {\n\t return 1;\n\t }",
"public int getItemEnchantability()\n {\n return this.field_150933_b.getEnchantability();\n }",
"public int getItemEnchantability()\n {\n return this.field_77878_bZ.func_78045_a();\n }",
"public int getItemEnchantability()\n {\n return 13;\n }",
"public int getItemEnchantability()\n {\n return 0;\n }",
"public double getEnchantRarity() {\n return enchantRarity;\n }",
"public long getEnchantLevel(CustomEnchantment ce, Player p){\n List<String> lore = getLore(p);\n\n for(String s : lore){\n if(s.contains(ce.getDisplayName())){\n return Long.parseLong(s.split(\" \")[s.split(\" \").length-1]);\n }\n }\n return 0;\n\n\n }",
"public static int getEnchantability(String name) {\n\n EnumMoreSwords swordType = getType(name);\n\n if (swordType != null) {\n\n return swordType.swordEnchantability;\n }\n\n return -1;\n }",
"public int getMaxEnchantability(int enchantmentLevel) {\n\t\treturn super.getMinEnchantability(enchantmentLevel) + 50;\n\t}",
"@Override\r\n public int getMinEnchantability(int level) {\n return 5 + (level + 1) * 6;\r\n }",
"@Override\r\n public int getMaxEnchantability(int level) {\n return getMinEnchantability(level) + 10;\r\n }",
"public int getMaxEnchantability(int p_77317_1_)\n {\n return super.getMinEnchantability(p_77317_1_) + 50;\n }",
"public long getEnchantLevel(String ce, Player p){\n List<String> lore = getLore(p);\n for(String s : p.getInventory().getItemInMainHand().getItemMeta().getLore()){\n if(s.contains(ce)){\n return Long.parseLong(s.split(\" \")[s.split(\" \").length-1]);\n }\n }\n return 0;\n\n\n }",
"public int getMinEnchantability(int enchantmentLevel) {\n\t\treturn 5 + (enchantmentLevel - 1) * 8;\n\t}",
"public static Map<CustomEnchantment, Integer> getEnchantments(ItemStack item) {\n HashMap<CustomEnchantment, Integer> list = new HashMap<CustomEnchantment, Integer>();\n ItemMeta meta = item.getItemMeta();\n if (meta == null) return list;\n if (!meta.hasLore()) return list;\n for (String lore : meta.getLore()) {\n String name = ENameParser.parseName(lore);\n int level = ENameParser.parseLevel(lore);\n if (name == null) continue;\n if (level == 0) continue;\n if (EnchantAPI.isRegistered(name)) {\n list.put(EnchantAPI.getEnchantment(name), level);\n }\n }\n return list;\n }",
"public int getManaIncreasePerLevel() {\r\n if (_index == 3 || _index == 11 || _index == 6 || _index == 14) {\r\n // Acolytes, High Priests, Druids, or High Druids\r\n return 1;\r\n } else if (isSpellCaster()) {\r\n return 2;\r\n }\r\n return 0;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an instance of VoucherSaleModeInfo given an JSON string | public static VoucherSaleModeInfo fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, VoucherSaleModeInfo.class);
} | [
"public static VoucherPackageSalesInfo fromJson(String jsonString) throws IOException {\n return JSON.getGson().fromJson(jsonString, VoucherPackageSalesInfo.class);\n }",
"public static IsvMerchantSalesDetailRequest fromJson(String jsonString) throws IOException {\n return JSON.getGson().fromJson(jsonString, IsvMerchantSalesDetailRequest.class);\n }",
"@JsonCreator\n public static CreateMode fromString(String name) {\n return fromString(name, CreateMode.class);\n }",
"public static Market fromJson(String json) {\n\t\tGson gson = new Gson();\n\t\treturn gson.fromJson(json, Market.class);\t\n\t}",
"public static SKUData fromJSON(String json) {\n JSONObject obj = null;\n try {\n obj = new JSONObject(json);\n String sku = obj.getString(SKU);\n int fulfilledQuantity = obj.getInt(FULFILLED_QTY);\n int consumedQuantity = obj.getInt(CONSUMED_QTY);\n SKUData result = new SKUData(sku);\n result.setFulfilledQuantity(fulfilledQuantity);\n result.setConsumedQuantity(consumedQuantity);\n // KGLog.i(\"fromJSON: \" + result);\n return result;\n } catch (JSONException e) {\n e.printStackTrace();\n }\n return null;\n }",
"public static AlipayOpenServicemarketOrderCreateModel fromJson(String jsonString) throws IOException {\n return JSON.getGson().fromJson(jsonString, AlipayOpenServicemarketOrderCreateModel.class);\n }",
"public Product CreateProduct(String product_str){\n Gson gson = new GsonBuilder().create();\n return gson.fromJson(product_str, Product.class);\n\n }",
"public static SofortInfo fromJson(String jsonString) throws JsonProcessingException {\n return JSON.getMapper().readValue(jsonString, SofortInfo.class);\n }",
"BaseFilter createBaseFilterFromJson(String jsonString);",
"public Object fromJson(final String jsonR) {\n\t\treturn DESERIALIZATION_PROCESSOR.deserialize(jsonR, converter, null);\n\t}",
"public static CustomerTO fromJson(String txnJson) {\n\t\tGson gson = new Gson();\n\t\tCustomerTO customer = gson.fromJson(txnJson, CustomerTO.class);\n\t\treturn customer;\n\t}",
"public static final void fromJson(final String json) {\n\t\tfinal Context context = new Gson().fromJson(json, Context.class);\n\t\tINSTANCE = context;\n\t}",
"public static CryptoSymbol fromJson(JSONObject jsonObject) {\n CryptoSymbol b = new CryptoSymbol();\n // Deserialize json into object fields\n try {\n// b.id = jsonObject.getString(\"id\");\n b.base = jsonObject.getString(\"base\");\n b.target = jsonObject.getString(\"target\");\n b.price = jsonObject.getString(\"price\");\n } catch (JSONException e) {\n e.printStackTrace();\n return null;\n }\n // Return new object\n return b;\n }",
"public static VippsInfo fromJson(String jsonString) throws JsonProcessingException {\n return JSON.getMapper().readValue(jsonString, VippsInfo.class);\n }",
"public Proveedor(String jsonProveedor) {\n JsonObject jo = new Gson().fromJson(jsonProveedor, JsonObject.class);\n nombre = jo.get(JSONHelper.JSON_NOMBRE).getAsString();\n telefono = jo.get(JSONHelper.JSON_TELEFONO).getAsString();\n email = jo.get(JSONHelper.JSON_EMAIL).getAsString();\n }",
"public void createFromJSONString(String jsonData) throws JSONException {\n JSONObject placeJSON = new JSONObject(jsonData);\n\n // set id of place object\n this.setId(placeJSON.getString(\"_id\"));\n // set title of place object\n this.setTitle(placeJSON.getString(\"title\"));\n // set lat of place object\n this.setLat(placeJSON.getString(\"lat\"));\n // set lon of place object\n this.setLon(placeJSON.getString(\"lon\"));\n }",
"public static Item deserializeItemObject(String json) {\n var propertyPattern = Pattern.compile(\"\\\"([^\\\"\\\\\\\\]+)\\\"\\\\s*:\\\\s*\\\"([^\\\"\\\\\\\\]*)\\\"\");\n var propertyMatcher = propertyPattern.matcher(json);\n var propertyTable = new HashMap<String, String>();\n while (propertyMatcher.find())\n propertyTable.put(propertyMatcher.group(1), propertyMatcher.group(2));\n if (propertyTable.get(\"type\") != null && propertyTable.get(\"type\").equals(\"Item\"))\n return new Item(propertyTable.get(\"name\"), Double.parseDouble(propertyTable.get(\"price\")),\n Integer.parseInt(propertyTable.get(\"amount\")));\n else\n throw new UnsupportedOperationException(\"Invalid/Missing type field\");\n }",
"public T createObject (String json) throws ParseException {\r\n\t\treturn createObject(new JSONObject(new JSONTokener(json)));\r\n\t}",
"public static StockData fromJson(String jsonString) throws JsonProcessingException {\n return JSON.getMapper().readValue(jsonString, StockData.class);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Number of bytes being requested (<= 1024) optional uint32 data_length = 1; | int getDataLength(); | [
"int getRequestDataLength();",
"int getDataSize();",
"public int getDataLength() {\n\t\treturn length;\n\t}",
"boolean hasRequestDataLength();",
"public int length(){\n\t\treturn data.length;\n\t}",
"int getResponseDataLength();",
"Long payloadLength();",
"public @Int32 int getUserDataLength();",
"@Override public long getInitializedDataLength() {\n return getDataLength();\n }",
"DataSize getRequestSizeLimitRegular();",
"protected int getPayloadLength() {\n if (data == null) {\n return 0;\n } else {\n return data.length;\n }\n }",
"public final int getRxDataBlockLength() {\n return getParameter(11);\n }",
"int getServerPayloadSizeBytes();",
"public int getDataLength() {\n int length = 0;\n length += _dummySyncData.getDataSize();\n for (Packet packet : _packets) {\n length += (4 + packet.getNumWords() * 4); // 4 bytes for the header, plus the data size\n }\n return length;\n }",
"public int getLovDataByteSize() {\n\t\treturn 0; // sometimes first 4 bytes give the length of data + 4 bytes for number\n\t}",
"int urg_set_communication_data_size(urg_t urg, int data_byte);",
"public int getDataSize() {\n\t\treturn Data.size();\n\t}",
"public int getDataBlockSize();",
"DataSize getRequestSizeLimitBinaryUpload();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the grouping size. Grouping size is the number of digits between grouping separators in the integer portion of a number. For example, in the number "123,456.78", the grouping size is 3. | public void setGroupingSize(int newValue) {
groupingSize = (byte) newValue;
} | [
"public void setGroupingSize(int newValue) { throw new RuntimeException(\"Stub!\"); }",
"public void setGroupingSize(AVT v)\n {\n m_groupingSize_avt = v;\n }",
"int getGroupingSize() {\n return groupingSize;\n }",
"public void setDecimalSize(int size);",
"public AVT getGroupingSize()\n {\n return m_groupingSize_avt;\n }",
"boolean setGroupCountSize(int count, int size)\n {\n if (count <= 0 || size <= 0) {\n return false;\n }\n m_groupcount_ = count;\n m_groupsize_ = size;\n return true;\n }",
"public void setSizeGroupId(String value) {\n setAttributeInternal(SIZEGROUPID, value);\n }",
"public static void setOptimizedNumOfGroups(int number) {\n\t\tSBESchemaLoader.setOptimizedNumOfGroups(number);\n\t}",
"public static void setOptimizedNumOfGroupRows(int number) {\n\t\tSBESchemaLoader.setOptimizedNumOfGroupRows(number);\n\t}",
"public JwList<JwSet<E>> splitByGroupSize(int groupSize)\n {\n int groupCount = size() / groupSize;\n if ( size() % groupSize != 0 )\n groupCount++;\n return _split(groupCount, groupSize);\n }",
"public void setNumericalGrouping(boolean isGroupingUsed) {\r\n\t\tnf.setGroupingUsed(isGroupingUsed);\r\n\t}",
"protected abstract int actualGroupSize();",
"public void setWorkersGroupSize(Integer workersGroupSize) {\n this.workersGroupSize = workersGroupSize;\n }",
"public static String groupify(String text, int groupSize) {\r\n String newText = \"\";\r\n int textLength = text.length();\r\n int amountXNeeded = groupSize - (textLength % groupSize);\r\n\r\n for (int i = 0; i < textLength; i += groupSize) {\r\n int range = groupSize + i;\r\n if (range > textLength) {\r\n range = textLength;\r\n }\r\n newText += text.substring(i, range);\r\n if (range != textLength) {\r\n newText += \" \";\r\n }\r\n }\r\n if( amountXNeeded != groupSize){\r\n for (int i = 0; i < amountXNeeded; i++) {\r\n newText += \"x\";\r\n }\r\n }\r\n\r\n return newText;\r\n }",
"public void setHeightGroup(int num)\n\t{\n\t\tsetGroup(_Prefix + HardZone.HEIGHT.toString(), num);\n\t}",
"public void setHeightGroup(int num)\n\t{\n\t\tsetGroup(_Prefix + Station.HEIGHT.toString(), num);\n\t}",
"void setGroupLimit(int group, long numBytes);",
"public void setSize(int size) {\n\tthis.sizeNumber = sizeNumber;\r\n}",
"public static void set_batch_size(JCas aJCAS, int batch_size) {\n\t\tMetaDataStringField field = new MetaDataStringField(aJCAS);\n\t\tfield.setValue(Integer.toString(batch_size));\n\t\t//Set the key to something constant\n\t\tfield.setKey(BiofidFlair.DYNAMIC_CONFIGURATION_BATCH_SIZE_KEY);\n\t\tfield.addToIndexes();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getElements get ordered list of menu elements that are members of this menu; possibly contains options, nested menus, or separators | public List<MenuElement> getElements()
{
return elements;
} | [
"public List<OpcionMenu> getElementosMenu()\n\t{\n\t\treturn elementosMenu;\n\t}",
"@Override\n public List<WebElement> getSubMenu() {\n\n final List<WebElement> subMenus = DriverConfig.getDriver().findElements(\n By.xpath(\"//*[@id='submenu']/a\"));\n if (subMenus != null) {\n for (final WebElement webElement : subMenus) {\n DriverConfig.setLogString(\"SubMenu :\" + webElement.getText(), true);\n }\n }\n return subMenus;\n }",
"public List<AccessibleElement> getAccessibleChildren();",
"List<WebElement> getAllOptions();",
"public List getMenu() {\n createMenuGroupError = false;\n menulist = new Menus_List();\n return menulist.getMenu();\n }",
"public List<TestBenchElement> getAllSubMenus() {\n waitForSubMenu();\n List<TestBenchElement> elements = new ArrayList<>();\n getDriver().findElements(By.tagName(OVERLAY_TAG))\n .forEach(element -> elements.add((TestBenchElement) element));\n return elements;\n }",
"public String[] menuOrder();",
"List<TreeElement> getSelectedElements();",
"List<WebElement> getAllSelectedOptions();",
"public static List<WebElement> getFirstLevelMenuItems() throws Exception {\n\t\ttry {\n\t\t\tgetCurrentFunctionName(true);\n\n\t\t\tlogs.debug(\"Get the menu items first level.\");\n\t\t\tList<WebElement> menuFirstLevelElements = new ArrayList<WebElement>();\n\n\t\t\t// Get the menu items list.\n\t\t\tif (isBD()) {\n\t\t\t\tmenuFirstLevelElements = SelectorUtil.getAllElements(HomePageSelectors.menuItemsBD.get());\n\t\t\t} else if (isRY()) {\n\t\t\t\tmenuFirstLevelElements = SelectorUtil.getAllElements(HomePageSelectors.RYmenuItems.get());\n\t\t\t} \n\t\t\telse if(isFG() || isGH()) {\n\t\t\t\tmenuFirstLevelElements = SelectorUtil.getAllElements(HomePageSelectors.menuItemsFGGH.get());\n\t\t\t} else if (isGR()) {\n\t\t\t\tmenuFirstLevelElements = SelectorUtil.getAllElements(HomePageSelectors.menuItemsGR.get());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmenuFirstLevelElements = SelectorUtil.getAllElements(HomePageSelectors.menuItems.get());\n\t\t\t}\n\t\t\tgetCurrentFunctionName(false);\n\t\t\treturn menuFirstLevelElements;\n\t\t\t\n\t\t} catch (NoSuchElementException e) {\n\t\t\tlogs.debug(MessageFormat.format(\n\t\t\t\t\tExceptionMsg.PageFunctionFailed + \"First level menu items selector cant be found by selenium\",\n\t\t\t\t\tnew Object() {\n\t\t\t\t\t}.getClass().getEnclosingMethod().getName()));\n\t\t\tthrow e;\n\t\t}\n\t}",
"public List<FieldOption> getOptions(WebElement element);",
"public void getMenuItems(){ \n\t\tParseUser user = ParseUser.getCurrentUser();\n\t\tmenu = user.getParseObject(\"menu\");\n\n\t\tParseQuery<ParseObject> query = ParseQuery.getQuery(\"Item\");\n\t\tquery.whereEqualTo(\"menu\", menu);\n\n\t\tquery.findInBackground(new FindCallback<ParseObject>() {\n\t\t\tpublic void done(List<ParseObject> menuItems, ParseException e) {\n\t\t\t\tif (e == null) {\n\t\t\t\t\tlistMenuItems(menuItems);\n\t\t\t\t} else {\n\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}",
"List<UmsMenuNode> treeList();",
"public List<TestBenchElement> getSubMenuItems() {\n return getSubMenuItems(getSubMenu());\n }",
"public JList getSideMenuList(){\n return framework.getSideMenuItems();\n }",
"public void list_of_menu_items() {\n\t\tdriver.findElement(open_menu_link).click();\n\t}",
"public List<WebElement> getallOptions() { return se.getOptions(); }",
"private List<Element> getChilds(Element CurrentElem) {\n\t\tList<Element> res = new ArrayList<Element>();\n\t\tif (!loadrez)\n\t\t\treturn res;\n\t\tNodeList list = CurrentElem.getChildNodes();\n\t\tfor (int i = 0; i < list.getLength(); i++)\n\t\t\tif (list.item(i).getNodeType() == Node.ELEMENT_NODE)\n\t\t\t\tres.add((Element) list.item(i));\n\t\treturn res;\n\t}",
"public List getMenuItemList() {\n return this.menuItemList;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "rule__BodyRepetition__Group__1" $ANTLR start "rule__BodyRepetition__Group__1__Impl" ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/srcgen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4352:1: rule__BodyRepetition__Group__1__Impl : ( ( rule__BodyRepetition__NumberAssignment_1 ) ) ; | public final void rule__BodyRepetition__Group__1__Impl() throws RecognitionException {
int stackSize = keepStackSize();
try {
// ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4356:1: ( ( ( rule__BodyRepetition__NumberAssignment_1 ) ) )
// ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4357:1: ( ( rule__BodyRepetition__NumberAssignment_1 ) )
{
// ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4357:1: ( ( rule__BodyRepetition__NumberAssignment_1 ) )
// ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4358:1: ( rule__BodyRepetition__NumberAssignment_1 )
{
before(grammarAccess.getBodyRepetitionAccess().getNumberAssignment_1());
// ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4359:1: ( rule__BodyRepetition__NumberAssignment_1 )
// ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4359:2: rule__BodyRepetition__NumberAssignment_1
{
pushFollow(FOLLOW_rule__BodyRepetition__NumberAssignment_1_in_rule__BodyRepetition__Group__1__Impl8930);
rule__BodyRepetition__NumberAssignment_1();
state._fsp--;
}
after(grammarAccess.getBodyRepetitionAccess().getNumberAssignment_1());
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
restoreStackSize(stackSize);
}
return ;
} | [
"public final void rule__BodyRepetition__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4344:1: ( rule__BodyRepetition__Group__1__Impl rule__BodyRepetition__Group__2 )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4345:2: rule__BodyRepetition__Group__1__Impl rule__BodyRepetition__Group__2\n {\n pushFollow(FOLLOW_rule__BodyRepetition__Group__1__Impl_in_rule__BodyRepetition__Group__18900);\n rule__BodyRepetition__Group__1__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__BodyRepetition__Group__2_in_rule__BodyRepetition__Group__18903);\n rule__BodyRepetition__Group__2();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__BodyRepetition__Group__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4313:1: ( rule__BodyRepetition__Group__0__Impl rule__BodyRepetition__Group__1 )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4314:2: rule__BodyRepetition__Group__0__Impl rule__BodyRepetition__Group__1\n {\n pushFollow(FOLLOW_rule__BodyRepetition__Group__0__Impl_in_rule__BodyRepetition__Group__08838);\n rule__BodyRepetition__Group__0__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__BodyRepetition__Group__1_in_rule__BodyRepetition__Group__08841);\n rule__BodyRepetition__Group__1();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__BodyRepetition__Group__6() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4500:1: ( rule__BodyRepetition__Group__6__Impl )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4501:2: rule__BodyRepetition__Group__6__Impl\n {\n pushFollow(FOLLOW_rule__BodyRepetition__Group__6__Impl_in_rule__BodyRepetition__Group__69221);\n rule__BodyRepetition__Group__6__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void ruleBodyRepetition() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:661:2: ( ( ( rule__BodyRepetition__Group__0 ) ) )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:662:1: ( ( rule__BodyRepetition__Group__0 ) )\n {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:662:1: ( ( rule__BodyRepetition__Group__0 ) )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:663:1: ( rule__BodyRepetition__Group__0 )\n {\n before(grammarAccess.getBodyRepetitionAccess().getGroup()); \n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:664:1: ( rule__BodyRepetition__Group__0 )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:664:2: rule__BodyRepetition__Group__0\n {\n pushFollow(FOLLOW_rule__BodyRepetition__Group__0_in_ruleBodyRepetition1354);\n rule__BodyRepetition__Group__0();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getBodyRepetitionAccess().getGroup()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__BodyRepetition__Group__2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4373:1: ( rule__BodyRepetition__Group__2__Impl rule__BodyRepetition__Group__3 )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4374:2: rule__BodyRepetition__Group__2__Impl rule__BodyRepetition__Group__3\n {\n pushFollow(FOLLOW_rule__BodyRepetition__Group__2__Impl_in_rule__BodyRepetition__Group__28960);\n rule__BodyRepetition__Group__2__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__BodyRepetition__Group__3_in_rule__BodyRepetition__Group__28963);\n rule__BodyRepetition__Group__3();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Body__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:3966:1: ( rule__Body__Group__1__Impl rule__Body__Group__2 )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:3967:2: rule__Body__Group__1__Impl rule__Body__Group__2\n {\n pushFollow(FOLLOW_rule__Body__Group__1__Impl_in_rule__Body__Group__18156);\n rule__Body__Group__1__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__Body__Group__2_in_rule__Body__Group__18159);\n rule__Body__Group__2();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__BodyRepetition__Group__3() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4404:1: ( rule__BodyRepetition__Group__3__Impl rule__BodyRepetition__Group__4 )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4405:2: rule__BodyRepetition__Group__3__Impl rule__BodyRepetition__Group__4\n {\n pushFollow(FOLLOW_rule__BodyRepetition__Group__3__Impl_in_rule__BodyRepetition__Group__39022);\n rule__BodyRepetition__Group__3__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__BodyRepetition__Group__4_in_rule__BodyRepetition__Group__39025);\n rule__BodyRepetition__Group__4();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__NumberLiteral__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:8927:1: ( rule__NumberLiteral__Group__1__Impl )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:8928:2: rule__NumberLiteral__Group__1__Impl\n {\n pushFollow(FOLLOW_rule__NumberLiteral__Group__1__Impl_in_rule__NumberLiteral__Group__117900);\n rule__NumberLiteral__Group__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__BodyRepetition__Group__4() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4433:1: ( rule__BodyRepetition__Group__4__Impl rule__BodyRepetition__Group__5 )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4434:2: rule__BodyRepetition__Group__4__Impl rule__BodyRepetition__Group__5\n {\n pushFollow(FOLLOW_rule__BodyRepetition__Group__4__Impl_in_rule__BodyRepetition__Group__49082);\n rule__BodyRepetition__Group__4__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__BodyRepetition__Group__5_in_rule__BodyRepetition__Group__49085);\n rule__BodyRepetition__Group__5();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Number__Group_1__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:15161:1: ( ( ( rule__Number__Group_1_1__0 )? ) )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:15162:1: ( ( rule__Number__Group_1_1__0 )? )\n {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:15162:1: ( ( rule__Number__Group_1_1__0 )? )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:15163:1: ( rule__Number__Group_1_1__0 )?\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getNumberAccess().getGroup_1_1()); \n }\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:15164:1: ( rule__Number__Group_1_1__0 )?\n int alt108=2;\n int LA108_0 = input.LA(1);\n\n if ( (LA108_0==16) ) {\n int LA108_1 = input.LA(2);\n\n if ( ((LA108_1>=RULE_INT && LA108_1<=RULE_DECIMAL)) ) {\n alt108=1;\n }\n }\n switch (alt108) {\n case 1 :\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:15164:2: rule__Number__Group_1_1__0\n {\n pushFollow(FOLLOW_rule__Number__Group_1_1__0_in_rule__Number__Group_1__1__Impl30593);\n rule__Number__Group_1_1__0();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n break;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getNumberAccess().getGroup_1_1()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Number__Group_1__1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:26269:1: ( rule__Number__Group_1__1__Impl )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:26270:2: rule__Number__Group_1__1__Impl\r\n {\r\n pushFollow(FOLLOW_rule__Number__Group_1__1__Impl_in_rule__Number__Group_1__152752);\r\n rule__Number__Group_1__1__Impl();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public final void rule__Number__Group_1__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:15150:1: ( rule__Number__Group_1__1__Impl )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:15151:2: rule__Number__Group_1__1__Impl\n {\n pushFollow(FOLLOW_rule__Number__Group_1__1__Impl_in_rule__Number__Group_1__130566);\n rule__Number__Group_1__1__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Number__Group_1_1__1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:26332:1: ( rule__Number__Group_1_1__1__Impl )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:26333:2: rule__Number__Group_1_1__1__Impl\r\n {\r\n pushFollow(FOLLOW_rule__Number__Group_1_1__1__Impl_in_rule__Number__Group_1_1__152876);\r\n rule__Number__Group_1_1__1__Impl();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public final void rule__BodyRepetition__Group__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4325:1: ( ( 'repeat' ) )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4326:1: ( 'repeat' )\n {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4326:1: ( 'repeat' )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4327:1: 'repeat'\n {\n before(grammarAccess.getBodyRepetitionAccess().getRepeatKeyword_0()); \n match(input,44,FOLLOW_44_in_rule__BodyRepetition__Group__0__Impl8869); \n after(grammarAccess.getBodyRepetitionAccess().getRepeatKeyword_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__MidiBody__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../ufscar.Compiladores2.ui/src-gen/ufscar/compiladores2/ui/contentassist/antlr/internal/InternalMusy.g:1165:1: ( rule__MidiBody__Group__1__Impl rule__MidiBody__Group__2 )\n // ../ufscar.Compiladores2.ui/src-gen/ufscar/compiladores2/ui/contentassist/antlr/internal/InternalMusy.g:1166:2: rule__MidiBody__Group__1__Impl rule__MidiBody__Group__2\n {\n pushFollow(FOLLOW_rule__MidiBody__Group__1__Impl_in_rule__MidiBody__Group__12477);\n rule__MidiBody__Group__1__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__MidiBody__Group__2_in_rule__MidiBody__Group__12480);\n rule__MidiBody__Group__2();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Number__Group_1__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:14253:1: ( rule__Number__Group_1__1__Impl )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:14254:2: rule__Number__Group_1__1__Impl\n {\n pushFollow(FOLLOW_rule__Number__Group_1__1__Impl_in_rule__Number__Group_1__128753);\n rule__Number__Group_1__1__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Number__Group_1_1__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:15213:1: ( rule__Number__Group_1_1__1__Impl )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:15214:2: rule__Number__Group_1_1__1__Impl\n {\n pushFollow(FOLLOW_rule__Number__Group_1_1__1__Impl_in_rule__Number__Group_1_1__130690);\n rule__Number__Group_1_1__1__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__BodyRepetition__Group__6__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4511:1: ( ( '}' ) )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4512:1: ( '}' )\n {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4512:1: ( '}' )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:4513:1: '}'\n {\n before(grammarAccess.getBodyRepetitionAccess().getRightCurlyBracketKeyword_6()); \n match(input,26,FOLLOW_26_in_rule__BodyRepetition__Group__6__Impl9249); \n after(grammarAccess.getBodyRepetitionAccess().getRightCurlyBracketKeyword_6()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Number__Group_1_1__1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:15199:1: ( rule__Number__Group_1_1__1__Impl )\r\n // InternalDroneScript.g:15200:2: rule__Number__Group_1_1__1__Impl\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__Number__Group_1_1__1__Impl();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This filter specifies a structured syntax to match against the [PropertyDefinition].[is_filterable][] marked as `true`. The syntax for this expression is a subset of SQL syntax. Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the left of the operator is a property name and the right of the operator is a number or a quoted string. You must escape backslash (&92;&92;) and quote (&92;") characters. Supported functions are `LOWER([property_name])` to perform a case insensitive match and `EMPTY([property_name])` to filter on the existence of a key. Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 comparisons or functions are allowed in the expression. The expression must be < 6000 bytes in length. Sample Query: `(LOWER(driving_license)="class &92;"a&92;"" OR EMPTY(driving_license)) AND driving_years > 10` string custom_property_filter = 4 [deprecated = true]; | @java.lang.Deprecated
java.lang.String getCustomPropertyFilter(); | [
"boolean isFilterByExpression();",
"private void renderFilterProperties(Collection<StringPropertyFilter> properties,\r\n StringBuilder query, List<Object> args) {\r\n if (properties == null || properties.size() == 0) {\r\n return;\r\n }\r\n List<StringPropertyFilter> genericExcludedFilter = new ArrayList<StringPropertyFilter>();\r\n int counter = 0;\r\n propertiesLoop: for (StringPropertyFilter property : properties) {\r\n counter++;\r\n if (property.getPropertyValue() == null && !property.isInclude()) {\r\n genericExcludedFilter.add(property);\r\n continue propertiesLoop;\r\n }\r\n args.add(property.getKeyGroup());\r\n args.add(property.getPropertyKey());\r\n String note = \" note\" + counter;\r\n String noteProperty = \" noteProperty\" + counter;\r\n query.append(\" AND note.\" + NoteConstants.ID + \" IN ( SELECT \" + note + \".\"\r\n + NoteConstants.ID + \" FROM \" + NoteConstants.CLASS_NAME + note);\r\n query.append(\" left join \" + note + \".\" + NoteConstants.PROPERTIES + noteProperty);\r\n query.append(\" WHERE \" + note + \".\" + NoteConstants.ID + \" = note.\" + NoteConstants.ID\r\n + \" AND \" + noteProperty + \".\" + PropertyConstants.KEYGROUP + \" = ? AND\");\r\n query.append(noteProperty + \".\" + PropertyConstants.PROPERTYKEY + \" = ? \");\r\n if (property.getPropertyValue() != null) {\r\n query.append(\" AND \" + noteProperty + \".\" + StringPropertyConstants.PROPERTYVALUE);\r\n if (!property.isInclude()) {\r\n query.append(\" !\");\r\n }\r\n query.append(\" = ?\");\r\n args.add(property.getPropertyValue());\r\n }\r\n query.append(\")\");\r\n }\r\n counter++;\r\n for (int e = 0; e < genericExcludedFilter.size(); e++) {\r\n String note = \" note\" + (e + counter);\r\n String noteProperty = \" noteProperty\" + (e + counter);\r\n query.append(\" AND note.\" + NoteConstants.ID + \" NOT IN ( SELECT \" + note + \".\"\r\n + NoteConstants.ID + \" FROM \" + NoteConstants.CLASS_NAME + note);\r\n query.append(\" left join \" + note + \".\" + NoteConstants.PROPERTIES + noteProperty);\r\n query.append(\" WHERE \" + note + \".\" + NoteConstants.ID + \" = note.\" + NoteConstants.ID\r\n + \" AND \" + noteProperty + \".\" + PropertyConstants.KEYGROUP + \" = ? AND\");\r\n query.append(noteProperty + \".\" + PropertyConstants.PROPERTYKEY + \" = ? )\");\r\n StringPropertyFilter property = genericExcludedFilter.get(e);\r\n args.add(property.getKeyGroup());\r\n args.add(property.getPropertyKey());\r\n }\r\n }",
"private boolean isUseFilterProperty(String property) {\n return property.equals(IJDIPreferencesConstants.PREF_FILTER_CONSTRUCTORS) || property.equals(IJDIPreferencesConstants.PREF_FILTER_STATIC_INITIALIZERS) || property.equals(IJDIPreferencesConstants.PREF_FILTER_GETTERS) || property.equals(IJDIPreferencesConstants.PREF_FILTER_SETTERS) || property.equals(IJDIPreferencesConstants.PREF_FILTER_SYNTHETICS) || property.equals(IJDIPreferencesConstants.PREF_STEP_THRU_FILTERS);\n }",
"@DISPID(3083)\n @PropGet\n boolean getIsFiltered();",
"java.util.List<com.google.cloud.contentwarehouse.v1.PropertyFilter> getPropertyFilterList();",
"public interface IFilterExpressionGenerator\n{\n /**\n * Generates a simple filter expression.\n * \n * @param field The filter field.\n * @param operation The filter operation.\n * @param value The filter value.\n * @param type The type of field.\n * @return The filter expression.\n */\n String generateSimpleExpression( String field, FieldFilterOperation operation, String value, FieldType type );\n\n /**\n * Generates a compound filter expression ( A equals 5 and ( B equals 8 or C notEquals 0 ) )\n * \n * @param leftSideExpression The left side expression.\n * @param operation The filter operator.\n * @param rightSideExpression The right side expression.\n * @return The filter expression.\n */\n String generateCompoundExpression( String leftSideExpression, FieldFilterOperation operation, String rightSideExpression );\n}",
"com.google.cloud.contentwarehouse.v1.PropertyFilter getPropertyFilter(int index);",
"protected QueryFilter convertJsNamingQuery(String inputFilterString) throws PortalException {\n // local variables\n QueryFilter queryFilter;\n String[] tempArray;\n String operatorSplitCharacter;\n String operator, operand, lineNumberString, tempString, propertyString;\n Property property;\n\n if (inputFilterString != null) {\n // split the string on the line delimiter\n tempArray = inputFilterString.split(this.QUERY_NUMBER_DELIMITER_STRING,2);\n\n // make sure we have two parts\n if (tempArray.length > 1) {\n lineNumberString = tempArray[0].trim();\n tempString = tempArray[1].trim();\n\n // get the line number and create the query\n if (lineNumberString == null) {\n throw new PortalException(\"Got null line number string: \" + lineNumberString);\n\n } else if (lineNumberString.equals(this.QUERY_GENE_LINE_NUMBER)) {\n queryFilter = new QueryFilterBean((Property)this.jsonParser.getMapOfAllDataSetNodes().get(PortalConstants.PROPERTY_KEY_COMMON_GENE), PortalConstants.OPERATOR_EQUALS, tempString);\n\n }else if (lineNumberString.equals(this.QUERY_CHROMOSOME_LINE_NUMBER)) {\n queryFilter = new QueryFilterBean((Property)this.jsonParser.getMapOfAllDataSetNodes().get(PortalConstants.PROPERTY_KEY_COMMON_CHROMOSOME), PortalConstants.OPERATOR_EQUALS, tempString);\n\n } else if (lineNumberString.equals(this.QUERY_START_POSITION_LINE_NUMBER)) {\n queryFilter = new QueryFilterBean((Property)this.jsonParser.getMapOfAllDataSetNodes().get(PortalConstants.PROPERTY_KEY_COMMON_POSITION), PortalConstants.OPERATOR_MORE_THAN_EQUALS, tempString);\n\n } else if (lineNumberString.equals(this.QUERY_END_POSITION_LINE_NUMBER)) {\n queryFilter = new QueryFilterBean((Property)this.jsonParser.getMapOfAllDataSetNodes().get(PortalConstants.PROPERTY_KEY_COMMON_POSITION), PortalConstants.OPERATOR_LESS_THAN_EQUALS, tempString);\n\n } else if (lineNumberString.equals(this.QUERY_PROPERTY_FILTER_LINE_NUMBER) || lineNumberString.equals(this.QUERY_PROTEIN_EFFECT_LINE_NUMBER)) {\n // find out what the operator is\n operatorSplitCharacter = JsNamingQueryTranslator.determineOperatorSplitCharacter(tempString);\n operator = JsNamingQueryTranslator.convertSymbolicOperatorToString (operatorSplitCharacter);\n\n // split the string\n tempArray = tempString.split(operatorSplitCharacter);\n propertyString = tempArray[0];\n operand = tempArray[1];\n\n // check\n if (propertyString == null) {\n throw new PortalException(\"Got null property in query string: \" + tempString);\n } else if (operand == null) {\n throw new PortalException(\"Got null operand in query string: \" + tempString);\n }\n\n // get the property\n Property propertyForFilter = null;\n String requestedPhenotype = null;\n if (lineNumberString.equals(this.QUERY_PROTEIN_EFFECT_LINE_NUMBER)) {\n // default to common property if more than one found with the same name\n propertyForFilter = this.jsonParser.findPropertyByName(propertyString, true, false);\n\n } else {\n propertyForFilter = this.jsonParser.getPropertyFromJavaScriptNamingScheme(propertyString);\n // when the user has requested a sample group, we need to remember which phenotype they are asking about\n String[] tempArray2 = propertyString.split(QUERY_SAMPLE_GROUP_BEGIN_STRING);\n if ((tempArray2 != null ) &&\n (tempArray2.length == 2)){\n requestedPhenotype = tempArray2[0];\n }\n }\n\n // create the query\n if ((requestedPhenotype != null ) &&\n (requestedPhenotype.length() > 0)) {\n // if this is a P property- based filter then we can get the information from the property, and we will\n // at the point of filter generation, thereby ignoring the requestedPhenotype parameter. If however\n // this is a D property then currently we need to know, since every query made by user exists within\n // the context of a phenotype. In the long run we will have a better solution, I'm sure, but for now\n // letter D properties and P properties are used interchangeably from the user's perspective\n queryFilter = new QueryFilterBean(propertyForFilter, operator, operand,requestedPhenotype);\n } else {\n queryFilter = new QueryFilterBean(propertyForFilter, operator, operand);\n }\n\n\n } else {\n throw new PortalException(\"Got incorrect line number string: \" + lineNumberString);\n }\n\n } else {\n throw new PortalException(\"Got badly formatted filter string: \" + inputFilterString + \" creating array: \" + tempArray);\n }\n\n } else {\n throw new PortalException(\"Got null filter string: \" + inputFilterString);\n }\n\n // return\n return queryFilter;\n }",
"public void addBusinessFilterToAdvancedtablecompositionRequiredProperty(ViewerFilter filter);",
"public String buildWhereSQL() throws Exception {\r\n if (!inputData.hasFilter()) {\r\n return null;\r\n }\r\n\r\n List<BasicFilter> filters = null;\r\n try {\r\n String filterString = inputData.getFilterString();\r\n Object filterObj = getFilterObject(filterString);\r\n\r\n filters = convertBasicFilterList(filterObj, filters);\r\n\r\n StringBuffer sb = new StringBuffer();\r\n String andDivisor = \"\";\r\n for (Object obj : filters) {\r\n BasicFilter filter = (BasicFilter) obj;\r\n\r\n sb.append(andDivisor);\r\n andDivisor = \" AND \";\r\n\r\n ColumnDescriptor column = inputData.getColumn(filter.getColumn().index());\r\n //the column name of filter\r\n sb.append(column.columnName());\r\n\r\n //the operation of filter\r\n FilterParser.Operation op = filter.getOperation();\r\n switch (op) {\r\n case HDOP_LT:\r\n sb.append(\"<\");\r\n break;\r\n case HDOP_GT:\r\n sb.append(\">\");\r\n break;\r\n case HDOP_LE:\r\n sb.append(\"<=\");\r\n break;\r\n case HDOP_GE:\r\n sb.append(\">=\");\r\n break;\r\n case HDOP_EQ:\r\n sb.append(\"=\");\r\n break;\r\n default:\r\n throw new UnsupportedFilterException(\"unsupported Filter operation : \" + op);\r\n }\r\n\r\n Object val = filter.getConstant().constant();\r\n switch (DataType.get(column.columnTypeCode())) {\r\n case SMALLINT:\r\n case INTEGER:\r\n case BIGINT:\r\n case FLOAT8:\r\n case REAL:\r\n case BOOLEAN:\r\n sb.append(val.toString());\r\n break;\r\n case TEXT:\r\n sb.append(\"'\").append(val.toString()).append(\"'\");\r\n break;\r\n case DATE:\r\n sb.append(\"'\" + val.toString() + \"'\");\r\n break;\r\n default:\r\n throw new UnsupportedFilterException(\"unsupported column type for filtering : \" + column.columnTypeCode());\r\n }\r\n\r\n }\r\n return sb.toString();\r\n } catch (UnsupportedFilterException ex) {\r\n // Do not throw exception, impose no constraints instead\r\n return null;\r\n }\r\n }",
"Conjunction getFilterQuery();",
"java.util.List<? extends com.google.cloud.contentwarehouse.v1.PropertyFilterOrBuilder>\n getPropertyFilterOrBuilderList();",
"void applyPropertyFilter(PropertyFilter filter);",
"public void addBusinessFilterToAdvancedtablecompositionOptionalProperty(ViewerFilter filter);",
"@Test\n @DisplayName(\"Test Filtering of the properties field with no admin privileges\")\n void testFilterPrivilegedFields() throws Exception {\n logger.info(\"Testing filtering of properties field with no admin privileges\");\n\n replaceConfiguration(RESOURCE_DIR\n + \"/exporter/rest_filter_jdbc_privileged.yaml\",\n \"wls_datasource_state%7Bname%3D%22TestDataSource%22%7D%5B15s%5D\",\n \"Running, Suspended, Shutdown, Overloaded, Unknown\", \"TestDataSource\");\n }",
"public String getFilterPredicate() {\n return this.filterPredicate;\n }",
"public static String constructFilter(Map<String, String> properties) {\r\n\r\n String filter = null;\r\n StringBuffer filterBuffer = new StringBuffer();\r\n\r\n if (properties != null && properties.size() > 0) {\r\n filterBuffer.append(\"(&\");\r\n\r\n Map<String, String> serviceProperties = properties;\r\n for (String key : serviceProperties.keySet()) {\r\n filterBuffer.append(\"(\" + key + \"=\" + serviceProperties.get(key) + \")\");\r\n }\r\n\r\n filterBuffer.append(\")\");\r\n filter = new String(filterBuffer);\r\n }\r\n\r\n return filter;\r\n }",
"public Filter getStandardOrFilter(String filterText, String[] caseInsensitivePropertyNames, String[] otherPropertyNames) {\n\t\tif (StringUtils.isBlank(filterText)) {\n\t\t\treturn null;\n\t\t}\n\t\tString[] filterTextElements = StringUtils.split(filterText, ' ');\n\t\tOr[] ors = new Or[filterTextElements.length];\n\t\tfor (int f = 0; f < filterTextElements.length; f++) {\n\t\t\tLike[] likes = new Like[caseInsensitivePropertyNames.length + otherPropertyNames.length];\n\t\t\tfor (int l = 0; l < likes.length; l++) {\n\t\t\t\tif (l < caseInsensitivePropertyNames.length) {\n\t\t\t\t\tlikes[l] = new Like(caseInsensitivePropertyNames[l], filterTextElements[f], false);\n\t\t\t\t} else {\n\t\t\t\t\t// Note: for non-string properties we can't specify case-insensitive filtering (causes error)\n\t\t\t\t\tlikes[l] = new Like(otherPropertyNames[l-caseInsensitivePropertyNames.length], filterTextElements[f]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tors[f] = new Or(likes);\n\t\t}\n\t\tif (ors.length == 1) {\n\t\t\treturn ors[0];\n\t\t} else {\n\t\t\treturn new And(ors);\n\t\t}\n\t}",
"private boolean isFilterListProperty(String property) {\n return property.equals(IJDIPreferencesConstants.PREF_ACTIVE_FILTERS_LIST) || property.equals(IJDIPreferencesConstants.PREF_INACTIVE_FILTERS_LIST);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instantiates a new Proxy uri. | public ProxyUri() {
this.number = 35;
this.formatter = StringFormatter.getInstance();
this.minSize = 1;
this.maxSize = 1034;
} | [
"public ProxyUri(String s) {\n this();\n value = s;\n }",
"URI createURI();",
"public static <T> ProxyAndInfo<T> createProxy(Configuration conf,\n URI nameNodeUri, Class<T> xface) throws IOException {\n return createProxy(conf, nameNodeUri, xface, null);\n }",
"void setProxyUri(String uri);",
"public ProxyInitializer(String host, String port){\n this.host = host;\n this.port = port;\n }",
"public URI() {\n }",
"public Proxy() {\n\t\t\tthis(null);\n\t\t}",
"public BaseProxy() {}",
"public ProxyConfig createProxyConfig();",
"private HttpProxyCacheServer newProxy() {\n return new HttpProxyCacheServer(this);\n }",
"public HttpURLBuilder() {\n\t\t// Empty\n\t}",
"public UriBuilder(final URI uri) {\n this(uri, null);\n }",
"private static NetworkProxy newProxy(final Proxy proxy) {\n if (null == proxy || Proxy.NO_PROXY == proxy || Proxy.Type.DIRECT == proxy.type()) {\n return null;\n } else {\n return new NetworkProxy(newAddress(proxy));\n }\n }",
"public LinphoneProxyConfig createProxyConfig();",
"@SuppressWarnings(\"unchecked\")\n public static <T> ProxyAndInfo<T> createProxy(Configuration conf,\n URI nameNodeUri, Class<T> xface, AtomicBoolean fallbackToSimpleAuth)\n throws IOException {\n Class<FailoverProxyProvider<T>> failoverProxyProviderClass =\n getFailoverProxyProviderClass(conf, nameNodeUri, xface);\n \n if (failoverProxyProviderClass == null) {\n // Non-HA case\n return createNonHAProxy(conf, NameNode.getAddress(nameNodeUri), xface,\n UserGroupInformation.getCurrentUser(), true, fallbackToSimpleAuth);\n } else {\n // HA case\n FailoverProxyProvider<T> failoverProxyProvider = NameNodeProxies\n .createFailoverProxyProvider(conf, failoverProxyProviderClass, xface,\n nameNodeUri, fallbackToSimpleAuth);\n DfsClientConf config = new DfsClientConf(conf);\n T proxy = (T) RetryProxy.create(xface, failoverProxyProvider,\n RetryPolicies.failoverOnNetworkException(\n RetryPolicies.TRY_ONCE_THEN_FAIL, config.getMaxFailoverAttempts(),\n config.getMaxRetryAttempts(), config.getFailoverSleepBaseMillis(),\n config.getFailoverSleepMaxMillis()));\n \n Text dtService = HAUtilClient.buildTokenServiceForLogicalUri(nameNodeUri, HdfsConstants.HDFS_URI_SCHEME);\n return new ProxyAndInfo<T>(proxy, dtService);\n }\n }",
"URI build();",
"public void createProxy() throws Exception{\r\n ESBCommon esbCommon = new ESBCommon(selenium); \r\n //Creating a local entry to store the WSDL file\r\n ESBManageLocalEntriesTest esbManageLocalEntriesTest = new ESBManageLocalEntriesTest(selenium);\r\n esbManageLocalEntriesTest.addSourceUrlEntry(\"proxy_wsdl\",\"file:\"+esbCommon.getCarbonHome()+\"/repository/samples/resources/proxy/sample_proxy_1.wsdl\");\r\n }",
"public Object instanceCreate() throws IOException, ClassNotFoundException {\n return new URLPresenter(this);\n }",
"public SimpleUriGenerator(String uriPrefix) {\n this.namedGraphURIPrefix = uriPrefix;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs and returns the ServiceItemFilter to be applied by the service discovery manager to the results of the template matching. | protected ServiceItemFilter getFirstStageFilter() {
return new TestFilter2(); //returns even-valued services
} | [
"public static DiscoveryFilter discoveryFilter() {\n return new DiscoveryFilter(ID, \"FireTV\");\n }",
"T getMatchingItem(Filter filter);",
"FilterPattern createFilterPattern();",
"@Override\n public Filter getFilter() {\n return new Filter() {\n @Override\n protected FilterResults performFiltering(CharSequence constraint) {\n FilterResults results = new FilterResults();\n if (constraint == null || constraint.length() == 0) {\n //no constraint given, just return all the data. (no search)\n results.count = stores.size();\n results.values = stores;\n } else {//do the search\n String searchStr = constraint.toString().toUpperCase();\n List<Store> resultsData = new ArrayList<>();\n for (Store store : stores)\n if (store.getName().toUpperCase().contains(searchStr)) {\n resultsData.add(store);\n }\n results.count = resultsData.size();\n results.values = resultsData;\n }\n return results;\n }\n @Override\n protected void publishResults(CharSequence constraint, FilterResults results) {\n if (results.count != 0) {\n filterStores = (List<Store>) results.values;\n notifyDataSetChanged();\n }\n }\n };\n }",
"public SAutoFilter createAutoFilter();",
"public ItemFilterHolder getFilterManager()\r\n\t{\r\n\t\treturn filterHolder;\r\n\t}",
"protected IUIFilterable createFilterable() {\n \t\treturn new UIFilterable();\n \t}",
"public XMLFilter newXMLFilter(Templates templates)\n throws TransformerConfigurationException \n {\n TransformerHandler handler = newTransformerHandler(templates);\n XMLFilterImpl xmlFilter = new XMLFilterImpl();\n xmlFilter.setContentHandler(handler);\n return xmlFilter;\n }",
"Filter getFilter();",
"public PipelineElementFilter<E> createFilter(List<String> fPath);",
"public static NodeFilter makeFilter()\n\t{\n\t\tNodeFilter[] fa = new NodeFilter[3];\n\t\tfa[0] = new HasAttributeFilter(\"HREF\");\n\t\tfa[1] = new TagNameFilter(\"A\");\n\t\tfa[2] = new HasParentFilter(new TagNameFilter(\"H3\"));\n\t\tNodeFilter filter = new AndFilter(fa);\n\t\treturn filter;\n\t}",
"private Filter getCustomFilter( ) {\n if(( customFilter != null ) \n ||( customFilterError ) )\n {\n return customFilter;\n }\n LogService logService = getLogService( );\n if( logService == null ) {\n return null;\n }\n String customFilterClassName = null;\n try {\n customFilterClassName = logService.getLogFilter( );\n customFilter = (Filter) getInstance( customFilterClassName );\n } catch( Exception e ) {\n customFilterError = true;\n new ErrorManager().error( \"Error In Instantiating Custom Filter \" +\n customFilterClassName, e, ErrorManager.GENERIC_FAILURE );\n }\n return customFilter;\n }",
"private Filter createFirstFilter(){\n\t\t\n\t\t// creazione l'attributo\n\t\tAttribute att1 = new Attribute(\"String:anno\");\n\t\t\n\t\t// creazione fuzzy set\n\t\tFuzzySet fs1 = new FuzzySet();\n\t\tfs1.setValue(\"horror\", 0.7);\n\t\tfs1.setValue(\"thriller\", 1.0);\n\t\tfs1.setValue(\"drammatico\", 0.2);\n\n\t\t// creazione metadato\n\t\tMetadata m = new Metadata(att1, fs1,\n\t\t\tOpenVeristicInterpretation.getinstance());\n\n\t\t// mi creo un Description Based Filter\n\t\tFilter filtro = new DescriptionBasedFilter(m);\n\t\t\n\t\treturn filtro;\n\t\t\n\t}",
"private static IntentFilter createIntentFilter() {\r\n\t\t//register broadcast receiver to receive SocietiesEvents return values\r\n\t\tIntentFilter intentFilter = new IntentFilter();\r\n\t\t//EVENT MANAGER INTENTS\r\n\t\tintentFilter.addAction(IAndroidSocietiesEvents.SUBSCRIBE_TO_EVENT);\r\n\t\tintentFilter.addAction(IAndroidSocietiesEvents.SUBSCRIBE_TO_EVENTS);\r\n\t\tintentFilter.addAction(IAndroidSocietiesEvents.UNSUBSCRIBE_FROM_EVENTS);\r\n\t\t//PUBSUB INTENTS\r\n\t\tintentFilter.addAction(IAndroidSocietiesEvents.UF_ACCESS_CONTROL_REQUEST_INTENT);\r\n\t\tintentFilter.addAction(IAndroidSocietiesEvents.UF_ACCESS_CONTROL_RESPONSE_INTENT);\r\n\t\tintentFilter.addAction(IAndroidSocietiesEvents.UF_PRIVACY_NEGOTIATION_REQUEST_INTENT);\r\n\t\tintentFilter.addAction(IAndroidSocietiesEvents.UF_PRIVACY_NEGOTIATION_RESPONSE_INTENT);\r\n\t\tintentFilter.addAction(IAndroidSocietiesEvents.UF_REQUEST_INTENT);\r\n\t\tintentFilter.addAction(IAndroidSocietiesEvents.UF_EXPLICIT_RESPONSE_INTENT);\r\n\t\tintentFilter.addAction(IAndroidSocietiesEvents.UF_IMPLICIT_RESPONSE_INTENT);\r\n\t\treturn intentFilter;\r\n\t}",
"FilterContainer getFilterContainer();",
"private FiltersManager createFilters() {\n FiltersDescription desc = new FiltersDescription();\n \n desc.addFilter(ATTRIBUTES_FILTER,\n NbBundle.getMessage(NavigatorContent.class, \"LBL_ShowAttributes\"), //NOI18N\n NbBundle.getMessage(NavigatorContent.class, \"LBL_ShowAttributesTip\"), //NOI18N\n showAttributes, ImageUtilities.loadImageIcon(\"org/netbeans/modules/xml/text/navigator/resources/a.png\", false), //NOI18N\n null\n );\n desc.addFilter(CONTENT_FILTER,\n NbBundle.getMessage(NavigatorContent.class, \"LBL_ShowContent\"), //NOI18N\n NbBundle.getMessage(NavigatorContent.class, \"LBL_ShowContentTip\"), //NOI18N\n showContent, ImageUtilities.loadImageIcon(\"org/netbeans/modules/xml/text/navigator/resources/content.png\", false), //NOI18N\n null\n );\n \n return FiltersDescription.createManager(desc);\n }",
"java.lang.String getDocumentCreatorFilter(int index);",
"ResourceListFilter<?> getFilter(String name);",
"BasicMappingBasedFilter createBasicMappingBasedFilter();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether the 'fired' field is set and is not null | public boolean isNotNullFired() {
return genClient.cacheValueIsNotNull(CacheKey.fired);
} | [
"public boolean isFired(){\n return fired;\n }",
"public boolean hasFired() {\n return genClient.cacheHasKey(CacheKey.fired);\n }",
"public boolean isSetEvents() {\n return this.events != null;\n }",
"public final synchronized boolean hasTriggered()\n {\n return triggered ;\n }",
"private void checkIsAbleToFire() {\n\n\t\tif (ticksToNextFire <= currentTickCount) {\n\t\t\tisAbleToFire = true;\n\t\t} else {\n\t\t\tisAbleToFire = false;\n\t\t}\n\t}",
"public boolean isSetTrigger() {\n\t\treturn this.trigger != null;\n\t}",
"@Override\n public boolean getCalledOnNullInput() {\n return calledOnNullInput_;\n }",
"@Override\n public boolean getCalledOnNullInput() {\n return calledOnNullInput_;\n }",
"boolean isSetDeclassEvent();",
"public boolean is_set_e() {\n return this.e != null;\n }",
"private boolean isFireCoolDownOver() {\n if (fired && fireCoolDown >= FIRE_COOL_DOWN_PERIOD) {\n fired = false;\n fireCoolDown = 0;\n return true;\n } else if (!fired) {\n return true;\n } else {\n return false;\n }\n }",
"boolean isAlreadyTriggered();",
"default boolean dispatchesEvents() {\n return !events().isEmpty();\n }",
"public boolean isFire() {\n return this.type == Type.FIRE;\n }",
"public boolean fireSensorExists() {\n\t\tif (fireSensor != null) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}",
"public boolean isSetStopEvent() {\n return EncodingUtils.testBit(__isset_bitfield, __STOPEVENT_ISSET_ID);\n }",
"boolean hasTriggerFulfillment();",
"public boolean isSetEventId() {\n return EncodingUtils.testBit(__isset_bitfield, __EVENTID_ISSET_ID);\n }",
"boolean hasFieldactualchange();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the crewId value for this FlightDetails. | public int getCrewId() {
return crewId;
} | [
"public long getCrewNumber() {\n\t\treturn _tempNoTiceShipMessage.getCrewNumber();\n\t}",
"public void setCrewId(int crewId) {\r\n this.crewId = crewId;\r\n }",
"@Override\n\tpublic long getId() {\n\t\treturn _tempCrewList.getId();\n\t}",
"public CrewMember getCrew() {\r\n\t\treturn this.crewSelect;\r\n\t}",
"public String getCrewName() {\r\n\t\treturn crewName;\r\n\t}",
"public String getCrewName() {\r\n return crewName;\r\n }",
"@Override\n\tpublic long getCrewNumber() {\n\t\treturn _tempNoTiceShipMessage.getCrewNumber();\n\t}",
"public int getCrewCount() {\n\t\treturn crewCount;\n\t}",
"public Integer getComplaintCreatDepId() {\n return complaintCreatDepId;\n }",
"public int getCustordId() {\n return custordId;\n }",
"public Integer getCrowdId() {\n return crowdId;\n }",
"public Long getRelCustId() {\n return relCustId;\n }",
"public BigDecimal getChcCreateId() {\n return chcCreateId;\n }",
"public Long getCustId() {\n\t\treturn custId;\n\t}",
"public java.lang.String getCrmId() {\n return crmId;\n }",
"public String getCId() {\n return (String) ensureVariableManager().getVariableValue(\"CId\");\n }",
"String getCreatorId();",
"@Override\n\tpublic long getPrimaryKey() {\n\t\treturn _tempCrewList.getPrimaryKey();\n\t}",
"public String getCafetoriumId() {\n return cafetoriumId;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "rule__XOrExpression__Group_1__1" $ANTLR start "rule__XOrExpression__Group_1__1__Impl" ../org.xtext.mongobeans.ui/srcgen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4646:1: rule__XOrExpression__Group_1__1__Impl : ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) ) ; | public final void rule__XOrExpression__Group_1__1__Impl() throws RecognitionException {
int stackSize = keepStackSize();
try {
// ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4650:1: ( ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) ) )
// ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4651:1: ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) )
{
// ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4651:1: ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) )
// ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4652:1: ( rule__XOrExpression__RightOperandAssignment_1_1 )
{
if ( state.backtracking==0 ) {
before(grammarAccess.getXOrExpressionAccess().getRightOperandAssignment_1_1());
}
// ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4653:1: ( rule__XOrExpression__RightOperandAssignment_1_1 )
// ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4653:2: rule__XOrExpression__RightOperandAssignment_1_1
{
pushFollow(FOLLOW_rule__XOrExpression__RightOperandAssignment_1_1_in_rule__XOrExpression__Group_1__1__Impl9888);
rule__XOrExpression__RightOperandAssignment_1_1();
state._fsp--;
if (state.failed) return ;
}
if ( state.backtracking==0 ) {
after(grammarAccess.getXOrExpressionAccess().getRightOperandAssignment_1_1());
}
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
restoreStackSize(stackSize);
}
return ;
} | [
"public final void rule__XOrExpression__Group_1__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:5547:1: ( ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) ) )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:5548:1: ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) )\n {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:5548:1: ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:5549:1: ( rule__XOrExpression__RightOperandAssignment_1_1 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXOrExpressionAccess().getRightOperandAssignment_1_1()); \n }\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:5550:1: ( rule__XOrExpression__RightOperandAssignment_1_1 )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:5550:2: rule__XOrExpression__RightOperandAssignment_1_1\n {\n pushFollow(FOLLOW_rule__XOrExpression__RightOperandAssignment_1_1_in_rule__XOrExpression__Group_1__1__Impl11701);\n rule__XOrExpression__RightOperandAssignment_1_1();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXOrExpressionAccess().getRightOperandAssignment_1_1()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XOrExpression__Group_1__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3941:1: ( ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) ) )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3942:1: ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) )\n {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3942:1: ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3943:1: ( rule__XOrExpression__RightOperandAssignment_1_1 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXOrExpressionAccess().getRightOperandAssignment_1_1()); \n }\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3944:1: ( rule__XOrExpression__RightOperandAssignment_1_1 )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3944:2: rule__XOrExpression__RightOperandAssignment_1_1\n {\n pushFollow(FOLLOW_rule__XOrExpression__RightOperandAssignment_1_1_in_rule__XOrExpression__Group_1__1__Impl8447);\n rule__XOrExpression__RightOperandAssignment_1_1();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXOrExpressionAccess().getRightOperandAssignment_1_1()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XOrExpression__Group__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4589:1: ( ( ( rule__XOrExpression__Group_1__0 )* ) )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4590:1: ( ( rule__XOrExpression__Group_1__0 )* )\n {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4590:1: ( ( rule__XOrExpression__Group_1__0 )* )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4591:1: ( rule__XOrExpression__Group_1__0 )*\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXOrExpressionAccess().getGroup_1()); \n }\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4592:1: ( rule__XOrExpression__Group_1__0 )*\n loop49:\n do {\n int alt49=2;\n int LA49_0 = input.LA(1);\n\n if ( (LA49_0==14) ) {\n int LA49_2 = input.LA(2);\n\n if ( (synpred85_InternalMongoBeans()) ) {\n alt49=1;\n }\n\n\n }\n\n\n switch (alt49) {\n \tcase 1 :\n \t // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4592:2: rule__XOrExpression__Group_1__0\n \t {\n \t pushFollow(FOLLOW_rule__XOrExpression__Group_1__0_in_rule__XOrExpression__Group__1__Impl9766);\n \t rule__XOrExpression__Group_1__0();\n\n \t state._fsp--;\n \t if (state.failed) return ;\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop49;\n }\n } while (true);\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXOrExpressionAccess().getGroup_1()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XOrExpression__Group_1__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4622:1: ( ( ( rule__XOrExpression__Group_1_0__0 ) ) )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4623:1: ( ( rule__XOrExpression__Group_1_0__0 ) )\n {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4623:1: ( ( rule__XOrExpression__Group_1_0__0 ) )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4624:1: ( rule__XOrExpression__Group_1_0__0 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXOrExpressionAccess().getGroup_1_0()); \n }\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4625:1: ( rule__XOrExpression__Group_1_0__0 )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4625:2: rule__XOrExpression__Group_1_0__0\n {\n pushFollow(FOLLOW_rule__XOrExpression__Group_1_0__0_in_rule__XOrExpression__Group_1__0__Impl9831);\n rule__XOrExpression__Group_1_0__0();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXOrExpressionAccess().getGroup_1_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XOrExpression__Group_1__1__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17614:1: ( ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) ) )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17615:1: ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) )\r\n {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17615:1: ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17616:1: ( rule__XOrExpression__RightOperandAssignment_1_1 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXOrExpressionAccess().getRightOperandAssignment_1_1()); \r\n }\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17617:1: ( rule__XOrExpression__RightOperandAssignment_1_1 )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17617:2: rule__XOrExpression__RightOperandAssignment_1_1\r\n {\r\n pushFollow(FOLLOW_rule__XOrExpression__RightOperandAssignment_1_1_in_rule__XOrExpression__Group_1__1__Impl35740);\r\n rule__XOrExpression__RightOperandAssignment_1_1();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXOrExpressionAccess().getRightOperandAssignment_1_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public final void rule__XOrExpression__Group_1_0__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4682:1: ( ( ( rule__XOrExpression__Group_1_0_0__0 ) ) )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4683:1: ( ( rule__XOrExpression__Group_1_0_0__0 ) )\n {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4683:1: ( ( rule__XOrExpression__Group_1_0_0__0 ) )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4684:1: ( rule__XOrExpression__Group_1_0_0__0 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXOrExpressionAccess().getGroup_1_0_0()); \n }\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4685:1: ( rule__XOrExpression__Group_1_0_0__0 )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4685:2: rule__XOrExpression__Group_1_0_0__0\n {\n pushFollow(FOLLOW_rule__XOrExpression__Group_1_0_0__0_in_rule__XOrExpression__Group_1_0__0__Impl9949);\n rule__XOrExpression__Group_1_0_0__0();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXOrExpressionAccess().getGroup_1_0_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XOrExpression__Group_1__0__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17586:1: ( ( ( rule__XOrExpression__Group_1_0__0 ) ) )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17587:1: ( ( rule__XOrExpression__Group_1_0__0 ) )\r\n {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17587:1: ( ( rule__XOrExpression__Group_1_0__0 ) )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17588:1: ( rule__XOrExpression__Group_1_0__0 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXOrExpressionAccess().getGroup_1_0()); \r\n }\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17589:1: ( rule__XOrExpression__Group_1_0__0 )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17589:2: rule__XOrExpression__Group_1_0__0\r\n {\r\n pushFollow(FOLLOW_rule__XOrExpression__Group_1_0__0_in_rule__XOrExpression__Group_1__0__Impl35683);\r\n rule__XOrExpression__Group_1_0__0();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXOrExpressionAccess().getGroup_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public final void rule__XOrExpression__Group_1_0__0__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17646:1: ( ( ( rule__XOrExpression__Group_1_0_0__0 ) ) )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17647:1: ( ( rule__XOrExpression__Group_1_0_0__0 ) )\r\n {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17647:1: ( ( rule__XOrExpression__Group_1_0_0__0 ) )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17648:1: ( rule__XOrExpression__Group_1_0_0__0 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXOrExpressionAccess().getGroup_1_0_0()); \r\n }\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17649:1: ( rule__XOrExpression__Group_1_0_0__0 )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17649:2: rule__XOrExpression__Group_1_0_0__0\r\n {\r\n pushFollow(FOLLOW_rule__XOrExpression__Group_1_0_0__0_in_rule__XOrExpression__Group_1_0__0__Impl35801);\r\n rule__XOrExpression__Group_1_0_0__0();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXOrExpressionAccess().getGroup_1_0_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public final void rule__XOrExpression__Group_1_0__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:5579:1: ( ( ( rule__XOrExpression__Group_1_0_0__0 ) ) )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:5580:1: ( ( rule__XOrExpression__Group_1_0_0__0 ) )\n {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:5580:1: ( ( rule__XOrExpression__Group_1_0_0__0 ) )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:5581:1: ( rule__XOrExpression__Group_1_0_0__0 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXOrExpressionAccess().getGroup_1_0_0()); \n }\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:5582:1: ( rule__XOrExpression__Group_1_0_0__0 )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:5582:2: rule__XOrExpression__Group_1_0_0__0\n {\n pushFollow(FOLLOW_rule__XOrExpression__Group_1_0_0__0_in_rule__XOrExpression__Group_1_0__0__Impl11762);\n rule__XOrExpression__Group_1_0_0__0();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXOrExpressionAccess().getGroup_1_0_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XOrExpression__Group_1__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3913:1: ( ( ( rule__XOrExpression__Group_1_0__0 ) ) )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3914:1: ( ( rule__XOrExpression__Group_1_0__0 ) )\n {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3914:1: ( ( rule__XOrExpression__Group_1_0__0 ) )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3915:1: ( rule__XOrExpression__Group_1_0__0 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXOrExpressionAccess().getGroup_1_0()); \n }\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3916:1: ( rule__XOrExpression__Group_1_0__0 )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3916:2: rule__XOrExpression__Group_1_0__0\n {\n pushFollow(FOLLOW_rule__XOrExpression__Group_1_0__0_in_rule__XOrExpression__Group_1__0__Impl8390);\n rule__XOrExpression__Group_1_0__0();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXOrExpressionAccess().getGroup_1_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XOrExpression__Group_1_0__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3973:1: ( ( ( rule__XOrExpression__Group_1_0_0__0 ) ) )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3974:1: ( ( rule__XOrExpression__Group_1_0_0__0 ) )\n {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3974:1: ( ( rule__XOrExpression__Group_1_0_0__0 ) )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3975:1: ( rule__XOrExpression__Group_1_0_0__0 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXOrExpressionAccess().getGroup_1_0_0()); \n }\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3976:1: ( rule__XOrExpression__Group_1_0_0__0 )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3976:2: rule__XOrExpression__Group_1_0_0__0\n {\n pushFollow(FOLLOW_rule__XOrExpression__Group_1_0_0__0_in_rule__XOrExpression__Group_1_0__0__Impl8508);\n rule__XOrExpression__Group_1_0_0__0();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXOrExpressionAccess().getGroup_1_0_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XOrExpression__Group_1__1__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:6560:1: ( ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:6561:1: ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) )\r\n {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:6561:1: ( ( rule__XOrExpression__RightOperandAssignment_1_1 ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:6562:1: ( rule__XOrExpression__RightOperandAssignment_1_1 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXOrExpressionAccess().getRightOperandAssignment_1_1()); \r\n }\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:6563:1: ( rule__XOrExpression__RightOperandAssignment_1_1 )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:6563:2: rule__XOrExpression__RightOperandAssignment_1_1\r\n {\r\n pushFollow(FOLLOW_rule__XOrExpression__RightOperandAssignment_1_1_in_rule__XOrExpression__Group_1__1__Impl13771);\r\n rule__XOrExpression__RightOperandAssignment_1_1();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXOrExpressionAccess().getRightOperandAssignment_1_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public final void rule__XOrExpression__Group_1_0__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:3703:1: ( ( ( rule__XOrExpression__Group_1_0_0__0 ) ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:3704:1: ( ( rule__XOrExpression__Group_1_0_0__0 ) )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:3704:1: ( ( rule__XOrExpression__Group_1_0_0__0 ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:3705:1: ( rule__XOrExpression__Group_1_0_0__0 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXOrExpressionAccess().getGroup_1_0_0()); \n }\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:3706:1: ( rule__XOrExpression__Group_1_0_0__0 )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:3706:2: rule__XOrExpression__Group_1_0_0__0\n {\n pushFollow(FOLLOW_rule__XOrExpression__Group_1_0_0__0_in_rule__XOrExpression__Group_1_0__0__Impl7758);\n rule__XOrExpression__Group_1_0_0__0();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXOrExpressionAccess().getGroup_1_0_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void ruleXOrExpression() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:384:2: ( ( ( rule__XOrExpression__Group__0 ) ) )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:385:1: ( ( rule__XOrExpression__Group__0 ) )\n {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:385:1: ( ( rule__XOrExpression__Group__0 ) )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:386:1: ( rule__XOrExpression__Group__0 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXOrExpressionAccess().getGroup()); \n }\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:387:1: ( rule__XOrExpression__Group__0 )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:387:2: rule__XOrExpression__Group__0\n {\n pushFollow(FOLLOW_rule__XOrExpression__Group__0_in_ruleXOrExpression761);\n rule__XOrExpression__Group__0();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXOrExpressionAccess().getGroup()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void ruleXOrExpression() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:1982:2: ( ( ( rule__XOrExpression__Group__0 ) ) )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:1983:1: ( ( rule__XOrExpression__Group__0 ) )\r\n {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:1983:1: ( ( rule__XOrExpression__Group__0 ) )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:1984:1: ( rule__XOrExpression__Group__0 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXOrExpressionAccess().getGroup()); \r\n }\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:1985:1: ( rule__XOrExpression__Group__0 )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:1985:2: rule__XOrExpression__Group__0\r\n {\r\n pushFollow(FOLLOW_rule__XOrExpression__Group__0_in_ruleXOrExpression4184);\r\n rule__XOrExpression__Group__0();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXOrExpressionAccess().getGroup()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public final void ruleXOrExpression() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:468:2: ( ( ( rule__XOrExpression__Group__0 ) ) )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:469:1: ( ( rule__XOrExpression__Group__0 ) )\n {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:469:1: ( ( rule__XOrExpression__Group__0 ) )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:470:1: ( rule__XOrExpression__Group__0 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXOrExpressionAccess().getGroup()); \n }\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:471:1: ( rule__XOrExpression__Group__0 )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:471:2: rule__XOrExpression__Group__0\n {\n pushFollow(FOLLOW_rule__XOrExpression__Group__0_in_ruleXOrExpression941);\n rule__XOrExpression__Group__0();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXOrExpressionAccess().getGroup()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XOrExpression__Group_1__0() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17574:1: ( rule__XOrExpression__Group_1__0__Impl rule__XOrExpression__Group_1__1 )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:17575:2: rule__XOrExpression__Group_1__0__Impl rule__XOrExpression__Group_1__1\r\n {\r\n pushFollow(FOLLOW_rule__XOrExpression__Group_1__0__Impl_in_rule__XOrExpression__Group_1__035653);\r\n rule__XOrExpression__Group_1__0__Impl();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n pushFollow(FOLLOW_rule__XOrExpression__Group_1__1_in_rule__XOrExpression__Group_1__035656);\r\n rule__XOrExpression__Group_1__1();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public final void rule__XAssignment__Group_1__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3637:1: ( ( ruleXOrExpression ) )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3638:1: ( ruleXOrExpression )\n {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3638:1: ( ruleXOrExpression )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:3639:1: ruleXOrExpression\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXAssignmentAccess().getXOrExpressionParserRuleCall_1_0()); \n }\n pushFollow(FOLLOW_ruleXOrExpression_in_rule__XAssignment__Group_1__0__Impl7846);\n ruleXOrExpression();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXAssignmentAccess().getXOrExpressionParserRuleCall_1_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XOrExpression__Group_1_0_0__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4701:1: ( rule__XOrExpression__Group_1_0_0__0__Impl rule__XOrExpression__Group_1_0_0__1 )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4702:2: rule__XOrExpression__Group_1_0_0__0__Impl rule__XOrExpression__Group_1_0_0__1\n {\n pushFollow(FOLLOW_rule__XOrExpression__Group_1_0_0__0__Impl_in_rule__XOrExpression__Group_1_0_0__09981);\n rule__XOrExpression__Group_1_0_0__0__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n pushFollow(FOLLOW_rule__XOrExpression__Group_1_0_0__1_in_rule__XOrExpression__Group_1_0_0__09984);\n rule__XOrExpression__Group_1_0_0__1();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
drops apples on the given tiles | public void appleBomb(List<Tile> area) {
for (Tile t :
area) {
int x = t.getCoordinate().getX();
int y = t.getCoordinate().getY();
if (isOnMap(x, y) && !isWall(t.getCoordinate()))
updateTile(x, y, TileType.Apple);
}
} | [
"public void dropNewTile() {\n ArrayList<Integer> emptyTilesX= new ArrayList<Integer>();\n ArrayList<Integer> emptyTilesY= new ArrayList<Integer>();\n\n for(int x= 0; x<4; x++) {\n for(int y= 0; y<4; y++) {\n if(board[x][y]==0) {\n emptyTilesX.add(x);\n emptyTilesY.add(y);\n }\n }\n }\n\n int randTile= rand.nextInt(emptyTilesX.size());\n int percent= rand.nextInt(20);\n int newTileNumber= 2;\n if(percent==0 || percent==1 || percent==2) {\n newTileNumber= 4;\n }\n \n int dropX= emptyTilesX.get(randTile);\n int dropY= emptyTilesY.get(randTile);\n board[dropX][dropY]= newTileNumber;\n }",
"void dropMissileAsItem();",
"private void wipeBoard(){\n Tile11.setIcon(Blank);\n Tile12.setIcon(Blank);\n Tile13.setIcon(Blank);\n Tile14.setIcon(Blank);\n Tile21.setIcon(Blank);\n Tile22.setIcon(Blank);\n Tile23.setIcon(Blank);\n Tile24.setIcon(Blank);\n Tile31.setIcon(Blank);\n Tile32.setIcon(Blank);\n Tile33.setIcon(Blank);\n Tile34.setIcon(Blank);\n Tile41.setIcon(Blank);\n Tile42.setIcon(Blank);\n Tile43.setIcon(Blank);\n Tile44.setIcon(Blank);\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 drop(Tile t) {\n this.onTile = t;\n this.character = null;\n }",
"void delete_missiles() {\n // Player missiles\n for (int i = ship.missiles.size()-1; i >= 0; i --) {\n Missile missile = ship.missiles.get(i);\n if (missile.y_position <= Dimensions.LINE_Y) {\n ImageView ship_missile_image_view = ship_missile_image_views.get(i);\n game_pane.getChildren().remove(ship_missile_image_view);\n ship_missile_image_views.remove(i);\n ship.missiles.remove(missile);\n }\n }\n\n // Enemy missiles\n for (int i = Alien.missiles.size()-1; i >= 0; i --) {\n Missile missile = Alien.missiles.get(i);\n if (missile.y_position > scene_height) {\n ImageView alien_missile_image_view = alien_missile_image_views.get(i);\n game_pane.getChildren().remove(alien_missile_image_view);\n alien_missile_image_views.remove(i);\n Alien.missiles.remove(missile);\n }\n }\n }",
"public void unlockTiles() {\n for (int i = 0; i < stacks.size(); i++) {\n if (stacks.get(i).size() > 0) {\n stacks.get(i).get(stacks.get(i).size() - 1).setIsDraggable(true);\n }\n }\n }",
"void removeTile(Tile t);",
"@Override\n\tprotected void dropFewItems(boolean par1, int par2) {\n\t\tsuper.dropFewItems(par1, par2);\n\n\t\t// drop saddle if equipped\n\t\tif (isSaddled()) {\n\t\t\tdropItem(Items.SADDLE, 1);\n\t\t}\n\t}",
"private static void RemoveTile(int x, int y) { city.setTile(EMPTY, x, y); }",
"private void dropAllDrops(ItemStack drop, int amount, Location dropLocation, boolean addEnchantment){\n double inStacks = (double) amount / (double) drop.getMaxStackSize();\n double floor = Math.floor(inStacks);\n double leftOver = inStacks - floor;\n for(int i = 1; i <= floor; i++){\n ItemStack newStack = drop.clone();\n newStack.setAmount(drop.getMaxStackSize());\n if(addEnchantment){\n newStack.addUnsafeEnchantment(Enchantment.DIG_SPEED, 1);\n }\n dropLocation.getWorld().dropItemNaturally(dropLocation, newStack);\n }\n if(leftOver > 0){\n ItemStack newStack = drop.clone();\n newStack.setAmount((int) Math.round(leftOver * drop.getMaxStackSize()));\n if(addEnchantment){\n newStack.addUnsafeEnchantment(Enchantment.DIG_SPEED, 1);\n }\n dropLocation.getWorld().dropItemNaturally(dropLocation, newStack);\n }\n }",
"private void RemoveTileFromRack(){\n setOnMouseClicked(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n event.consume();\n hideTiles(tileval);\n }\n });\n }",
"void clear_missiles() {\n // Remove ship missiles\n ship.missiles.clear();\n for (ImageView ship_missile_image_view : ship_missile_image_views) {\n game_pane.getChildren().remove(ship_missile_image_view);\n }\n ship_missile_image_views.clear();\n\n // Remove alien missiles\n Alien.missiles.clear();\n for (ImageView alien_missile_image_view : alien_missile_image_views) {\n game_pane.getChildren().remove(alien_missile_image_view);\n }\n alien_missile_image_views.clear();\n }",
"private void uncoverTiles(Set<Tile> tiles) {\r\n\t\tfor (Tile tile : tiles) {\r\n\t\t\t// Update status\r\n\t\t\ttile.setStatus(TileStatus.UNCOVERED);\r\n\r\n\t\t\t// Update button\r\n\t\t\tJButton button = boardButtons[tile.getX()][tile.getY()];\r\n\t\t\tbutton.setEnabled(false);\r\n\t\t\tbutton.setText(tile.getRank() == 0 ? \"\" : String.valueOf(tile.getRank()));\r\n\t\t}\r\n\t}",
"public void fruitDrop()\n {\n fruit.slowMoveVertical(60);\n }",
"public void playerKillShot() {\n\t\tfor(int i = 1; i < store.size(); i++) {\r\n\t\t\tif(store.elementAt(i) instanceof Missile) {\r\n\t\t\t\tstore.remove(0);\r\n\t\t\t\tplayerLives--;\r\n\t\t\t\tif(playerLives < 1) {\r\n\t\t\t\t\tSystem.out.println(\"GAME OVER\");\r\n\t\t\t\t}else {\r\n\t\t\t\t\taddPlayerShip();\r\n\t\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"There are no missiles\");\r\n\t\t\t}\r\n\t\t}//end for to search for Missiles\r\n\t\tupdate();\r\n\t}",
"public void npsKillShot() {\n\t\tfor(int i = 1; i < store.size(); i++) {\r\n\t\t\tif(store.elementAt(i) instanceof Missile) {\r\n\t\t\t\tfor(int j = 1; j < store.size(); j++) {\r\n\t\t\t\t\tif(store.elementAt(j) instanceof NonPlayerShip) {\r\n\t\t\t\t\t\tstore.remove(i);\r\n\t\t\t\t\t\tstore.remove(j);\r\n\t\t\t\t\t\tplayerScore += 3;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tSystem.out.println(\"There are no Non Player Ships\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end for loop searching for Asteroids\r\n\t\t\tbreak;\t\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"There are no missiles\");\r\n\t\t\t}\r\n\t\t}//end for to search for Missiles\r\n\t\tupdate();\r\n\t}",
"public void asteroidKillShot() {\n\t\tfor(int i = 1; i < store.size(); i++) {\r\n\t\t\tif(store.elementAt(i) instanceof Missile) {\r\n\t\t\t\tfor(int j = 1; j < store.size(); j++) {\r\n\t\t\t\t\tif(store.elementAt(j) instanceof Asteroid) {\r\n\t\t\t\t\t\tstore.remove(i);\r\n\t\t\t\t\t\tstore.remove(j);\r\n\t\t\t\t\t\tplayerScore++;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tSystem.out.println(\"There are no Asteroids\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end for loop searching for Asteroids\r\n\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"There are no in flight missiles\");\r\n\t\t\t}\r\n\t\t}//end for to search for Missiles\t\r\n\t\tupdate();\r\n\t}",
"public void clearTiles() {\r\n\r\n for (int i = 0; i < 16; i += 1) {\r\n tiles[i] = 0;\r\n }\r\n boardView.invalidate();\r\n placedShips = 0;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Getters a getter for the direction vector | public Vector get_direction() {
return _direction;
} | [
"public DependenceDirection getDirectionVector()\n {\n return _directionVector;\n }",
"public Vector getDirection(){\n\t\treturn new Vector(_direction);\n\t}",
"public Vector2 getDirection() { return direction.cpy(); }",
"default Vector3 getDirection() {\r\n return Vector3.fromXYZ(getDirX(), getDirY(), getDirZ());\r\n }",
"float getDirection();",
"public double getDirection() {\n return direction;\n }",
"public Direction getDirection()\n {\n return dir;\n }",
"@Override\n public Vector getFacingVector() {\n double[] rotation = {Math.cos(this.rot), Math.sin(this.rot)};\n Vector v = new Vector(rotation);\n v = VectorUtil.direction(v);\n Vector w = VectorUtil.direction(this.getR());\n v.plus(w);\n return v;\n }",
"public nvo_coords.CoordsType getVector() {\n return vector;\n }",
"int getDirection();",
"public Vector3 getVector() {\r\n\t\treturn vector;\r\n\t}",
"@NotNull Vector getVelocity();",
"public abstract Vector3 directionFrom(Point3 point);",
"public Vector2D getOffsetDirection() {\n return Vector2D.of(direction.getY(), -direction.getX());\n }",
"public Vector2f toVector() {\n\t\treturn this.direction.copy().scale( this.value );\n\t}",
"public float getDirection() {\n return angle;\n }",
"Direction getMoveDir();",
"public Direction getDirection() {\n return currentDirection;\n }",
"public final Vector3d getRight()\n {\n return myDir.cross(myUp).getNormalized();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
We're being destroyed. It's important to dispose of the helper here! | @Override
public void onDestroy() {
super.onDestroy();
// very important:
BasesUtils.logDebug(TAG, "Destroying helper.");
if (mHelper != null) {
try {
mHelper.dispose();
} catch (Exception e) {
BasesUtils.logError(TAG, "Google onDestroy() exception:" + e.getMessage());
}
mHelper = null;
}
} | [
"@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\n\t\t// very important:\n\t\tLog.d(TAG, \"Destroying helper.\");\n\t\tif (mHelper != null)\n\t\t\tmHelper.dispose();\n\t\tmHelper = null;\n\t}",
"protected void cleanup() {\n }",
"private void cleanup()\n\t{\n\t}",
"@Override\n public void destroy()\n {\n \t// Do not remove the super.destroy() call below.\n super.destroy();\n\n // Additional clean-up is optional.\n }",
"public void DoDestroy() {\r\n\t\tSaveState();\r\n\t}",
"public void destroy(){\r\n\t\tunbindSubscriber(ContextProvider.getInstance().getSubscriber());\r\n\t}",
"public void destroy(){\n destroyed = true;\n }",
"public void destroy(){\n \twheels.destroy();\n \tshooter.destroy();\n \tintake.destroy();\n \tgyro.destroy();\n \taccel.destroy();\n \tcompressor.free();\n }",
"public void cleanup() {\r\n\t\tif (debugMessageCallback != null) {\r\n\t\t\tdebugMessageCallback.release();\r\n\t\t}\r\n\t\tif (window != NULL) {\r\n\t\t\tglfwDestroyWindow(window);\r\n\t\t}\r\n\t\t// Callbacks need to be released because they use native resources\r\n\t\tif (keyCallback != null) {\r\n\t\t\tkeyCallback.release();\r\n\t\t}\r\n\t\tif (framebufferSizeCallback != null) {\r\n\t\t\tframebufferSizeCallback.release();\r\n\t\t}\r\n\t\tif (windowSizeCallback != null) {\r\n\t\t\twindowSizeCallback.release();\r\n\t\t}\r\n\t\tif (cursorPosCollback != null) {\r\n\t\t\tcursorPosCollback.release();\r\n\t\t}\r\n\t\tglfwTerminate();\r\n\t\terrorCallback.release();\r\n\t}",
"@Override\n protected void onDestroy() {\n super.onDestroy();\n\n this.cb.onDestroy(this);\n }",
"@Override\r\n public void destroy() {\n mFeedParser.shutdownTask();\r\n super.destroy();\r\n }",
"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 }",
"@PreDestroy\n private void destroy() {\n factory.close();\n }",
"public void cleanup() {\n\t\tref.removeEventListener(listener);\n\t\tmodels.clear();\n\t\tmodelNames.clear();\n\t\tmodelNamesMapping.clear();\n\t}",
"public void destroy(){\n runner.destroy();\n }",
"public void destroy()\n\t{\n\t\tsuper.destroy();\n\t\tnumInstances--;\n\t}",
"@Destroy\r\n\tpublic void destroy() {\r\n\t\t// Component disposal code.\r\n\t\t// All properties are disposed.\r\n\t\temailConfiguration=null;\r\n\t}",
"@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 cleanUp() {\n\n ui.paint( DCDUtility.getInstance().getGraphics(),\n DCDComponentUI.DELETED ) ;\n // TODO=> Have to inform the model that this component is being\n // deleted. The model should then take care as to release\n // the connections and do other nessary cleanup actions.\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
deleteDVD Delete a dvd. | private void deleteDVD(){
try{
DVDCtr dvdCtr = new DVDCtr();
Scanner keyboard = new Scanner(System.in);
System.out.print("What's the ID of the dvd you want to delete?" );
int deleteID = keyboard.nextInt();
String title = dvdCtr.getTitleByID(deleteID);
if(confirm("Are you sure you wish to delete the dvd with the following ID: " + deleteID + " " + title)){
dvdCtr.deleteDVD(deleteID);
System.out.println(title + " was deleted");
pause();
}
}catch(InputMismatchException e1){
System.out.println("Invalid values");
pause();
return;
}catch(NullPointerException e){
System.out.println(e.getMessage());
pause();
return;
}
} | [
"@Test\n public void testDeleteDVD() {\n Director director = new Director();\n director.setDirectorName(\"dirTest\");\n\n Studio studio = new Studio();\n studio.setStudioName(\"stuTest\");\n\n Dvd dvd = new Dvd();\n dvd.setTitle(\"Test Title\");\n dvd.setReleaseYear(\"1998\");\n dvd.setRating(\"R\");\n dvd.setReview(\"test review\");\n dvd.setDirector(director);\n dvd.setStudio(studio);\n\n service.addDVD(dvd);\n\n Dvd fromDao = service.getDVDInfo(dvd.getDvdId());\n\n assertEquals(dvd, fromDao);\n\n service.deleteDVD(fromDao.getDvdId());\n\n assertNull(service.getDVDInfo(fromDao.getDvdId()));\n }",
"public static void removeDVD(DvdItem dvd)\n {\n DVDList.remove(dvd);\n }",
"@Override\n public Dvd removeDvd(String title) throws DvdLibraryPersistenceException {\n Dvd removedDvd = dao.removeDvd(title); \n auditDao.writeAuditEntry(\"Dvd \" + title + \"REMOVED\");\n return removedDvd; \n }",
"private void removeDvd() {\n String idToRemove = console.getMultiChoiceString(\"What dvd would you like to delete? \"\n + \"Enter its Id #>>>\", createDvdListWithIds(), true, \"Exit\");\n boolean deletedADVD = false;\n\n while (!deletedADVD) {\n //if they choose to exit, exit the loop\n if (idToRemove.equals(\"Exit\")) {\n deletedADVD = true;\n } else {\n //split the user input by the \", \" \n //the response will always look like 'id#, TITLE_NAME'\n String[] idAccesor = idToRemove.split(\", \");\n //make the first half of the array an integer\n int actualIdToRemove = Integer.parseInt(idAccesor[0]);\n //iterate through the dvd's\n for (DVD currentDVD : dao.listAll()) {\n\n //if the integer = the current Dvd's id\n if (actualIdToRemove == currentDVD.getId()) {\n //deletes the dvd with the id\n dao.remove(currentDVD.getId());\n //stops the loop\n deletedADVD = true;\n //stops the iteration\n break;\n }\n }\n }\n }\n }",
"public static void eliminarTablaBDDVD() {\n\t\tif (statement == null)\n\t\t\treturn;\n\t\ttry {\n\t\t\tstatement.executeUpdate(\"drop table DVDS\");\n\t\t\tarrayDVD = new ArrayList<ClsDVD>();\n\t\t} catch (SQLException e) {\n\t\t\t// Si hay excepci�n es que la tabla ya exist�a (lo cual es correcto)\n\t\t\t// e.printStackTrace();\n\t\t}\n\t}",
"@Override\n public DVDdto editDVD(String title, DVDdto DVD)\n throws DVDLibraryDaoPersistenceException{\n DVDColection.remove(title);\n DVDdto newDVD = DVDColection.put(title, DVD);\n writeDVDLibrary();\n return newDVD;\n }",
"private void deleteCopy(){\r\n try{\r\n DVDCtr dvdCtr = new DVDCtr();\r\n Scanner keyboard = new Scanner(System.in);\r\n System.out.print(\"What's the ID of the dvd you want to delete a copy from?\" );\r\n int dvdID = keyboard.nextInt();\r\n keyboard.nextLine();\r\n System.out.print(dvdCtr.getCopies(dvdID));\r\n System.out.print(\"\");\r\n System.out.print(\"What's the serialnumber of the copy you want to delete?\" );\r\n int copyID = keyboard.nextInt();\r\n if(confirm(\"Are you sure you wish to delete the copy with the following serialnumber: \" + copyID)){\r\n dvdCtr.deleteCopy(dvdID, copyID);\r\n System.out.println(copyID + \" was deleted\");\r\n pause();\r\n }\r\n }catch(InputMismatchException e1){\r\n System.out.println(\"Invalid values\");\r\n pause();\r\n return;\r\n }catch(NullPointerException e){\r\n System.out.println(e.getMessage());\r\n pause();\r\n return;\r\n }\r\n }",
"public void checkInCustomer(DVD dvd){\r\n this.customerDVD.remove(dvd);\r\n }",
"Boolean removeCategoryfromDvd(Integer category_Id, Integer dvdId) \n throws DvdStoreException;",
"public void deleteMovie(){\n\t\tint response = JOptionPane.showConfirmDialog(mainFrame, \"Are you sure you wish to delete \" + currentMovie.getTitle() + \"?\",\n\t\t\t\t\"****************Confirm Delete****************\",\n\t\t\t\tJOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);\n\t\tif (response == JOptionPane.OK_OPTION) {\n\t\t\tcontroller.deleteFromDisk(currentMovie);\n\t\t}\n\t}",
"public String deleteAction(Movie movie) throws ClassNotFoundException, SQLException{\r\n Connection con = null;\r\n try{\r\n Class.forName(\"org.apache.derby.jdbc.ClientDriver\");\r\n con=DriverManager.getConnection(\"jdbc:derby://localhost:1527/movies\",\"yehuda\",\"1984\");\r\n String sql = \"DELETE FROM YEHUDA.MOVIES WHERE MOVIEID=?\";\r\n PreparedStatement st=con.prepareStatement(sql);\r\n \r\n st.setInt(1, movie.getMovieid());\r\n st.executeUpdate();\r\n }finally{\r\n con.close();\r\n }\r\n movies.remove(movie);\r\n return null;\r\n }",
"public void deleteDepartmentByDeptName(String dept_name);",
"public void deleteDepartmentByDeptNo(int dept_no);",
"public void displayRemoveDVDBanner () {\n\t io.print(\"=== Remove DVD ===\");\n }",
"public void deleteDistrict(District District);",
"public void addDVD() {\n DVD dvd = new DVD();\n libraryDatabase.getMediaDatabase().add(dvd);\n }",
"ActionResponse delete(String volumeId);",
"private void retrieveDvd() {\n String howTo = console.getMultiChoiceString(\"How would you like to find the DVD?\", new String[]{\n \"By Title\", \"By Id\", \"By Rating\", \"By Studio\"\n });\n //if they chose \"By Title\"\n if (howTo.equals(\"By Title\")) {\n //asks for a title name\n String initialTitle = console.getMultiChoiceString(\"Which title would you like to see? \", createDvdListWithIds(), true, \"\");\n if (initialTitle.equals(\"Exit\")) {\n } else {\n //seperates my answer, will always be 'id#, TITLE_NAME'\n String[] seperatedAnswer = initialTitle.split(\", \");\n //want to grab the second half of the array\n String title = seperatedAnswer[1];\n for (DVD dvd : dao.listAll()) {\n if (title.contains(dvd.getTitle())) {\n List<DVD> toPrint = dao.getByTitle(title);\n for (DVD print : toPrint) {\n console.println(print.getTitle() + \"\\nRelased: \" + print.getRealseDate() + \"\\nRating: \"\n + print.getMpaaRating() + \"\\nStudio: \" + print.getStudio() + \"\\nComments:\"\n + print.getComments());\n }\n break;\n }\n }\n }\n //if they choose Id\n } else if (howTo.equals(\"By Id\")) {\n //Asks from a list which one they want to delete\n String initialId = console.getMultiChoiceString(\"Which title, by id number, would you like to see? \",\n createDvdListWithIds(), true, \"\");\n //return to the main menu if they choose the Exit option\n if (initialId.equals(\"Exit\")) {\n } else {\n //split the answer\n String[] seperated = initialId.split(\", \");\n //grab the first part, and make it an int\n int id = Integer.parseInt(seperated[0]);\n //iterate through the dvds that exist\n for (DVD dvd : dao.listAll()) {\n if (id == dvd.getId()) {\n // store found dvd in reference variable\n DVD toPrint = dao.getById(id);\n //print the attriibutes\n console.println(toPrint.getTitle() + \"\\nRelased: \" + toPrint.getRealseDate() + \"\\nRating: \"\n + toPrint.getMpaaRating() + \"\\nStudio: \" + toPrint.getStudio() + \"\\nComments: \"\n + toPrint.getComments());\n }\n }\n }\n } else if (howTo.equals(\"By Rating\")) {\n String initialRating = console.getMultiChoiceString(\"Which Rating would you like to see? \", createDvdListWithIds(), true, \"\");\n if (initialRating.equals(\"Exit\")) {\n } else {\n String[] seperatedAnswer = initialRating.split(\", \");\n String rating = seperatedAnswer[1];\n for (DVD dvd : dao.listAll()) {\n if (rating.contains(dvd.getMpaaRating())) {\n List<DVD> toPrint = dao.getByTitle(rating);\n for (DVD print : toPrint) {\n console.println(print.getTitle() + \"\\nRelased: \" + print.getRealseDate() + \"\\nRating: \"\n + print.getMpaaRating() + \"\\nStudio: \" + print.getStudio() + \"\\nComments:\"\n + print.getComments());\n }\n break;\n }\n }\n }\n } else if (howTo.equals(\"By Studio\")) {\n String initialStudio = console.getMultiChoiceString(\"Which Rating would you like to see? \", createDvdListWithIds(), true, \"\");\n if (initialStudio.equals(\"Exit\")) {\n } else {\n String[] seperatedAnswer = initialStudio.split(\", \");\n String studio = seperatedAnswer[1];\n for (DVD dvd : dao.listAll()) {\n if (studio.contains(dvd.getMpaaRating())) {\n List<DVD> toPrint = dao.getByTitle(studio);\n for (DVD print : toPrint) {\n console.println(print.getTitle() + \"\\nRelased: \" + print.getRealseDate() + \"\\nRating: \"\n + print.getMpaaRating() + \"\\nStudio: \" + print.getStudio() + \"\\nComments:\"\n + print.getComments());\n }\n break;\n }\n }\n }\n }\n }",
"public void deleteMovie() {\n\n // Delete\n String folderPath = targetDirectory + \"/\" + activeMovie.getTitle() + \" \" + activeMovie.getYear();\n System.out.println(IOHelper.deleteFile(new File(folderPath)));\n\n // Reload\n loadMovieList();\n pickActiveMovie();\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true if the definition is a type definition. | public boolean isTypeDefinition()
{
return false;
} | [
"public TypeDefinition isType(String name){\n return((TypeDefinition)typeDefs.get(getDefName(name)));\n }",
"boolean isBuiltInType();",
"public boolean hasName() {\n return typeDeclaration.hasName();\n }",
"public boolean isContainedType(ResourceTypeDefinition def, String resourceTypeName);",
"public boolean hasType() {\n return fieldSetFlags()[2];\n }",
"public boolean hasTypedefName() {\n return hasTypedefName;\n }",
"private boolean nodeTypesAreDefined(String startNodeType, String endNodeType) {\n Set<NodeDefinition> nodes = this.schemaAssembler.getNodes();\n return nodes.contains(new NodeDefinition(startNodeType)) && nodes.contains(new NodeDefinition(endNodeType));\n }",
"public boolean hasType() {\n return fieldSetFlags()[3];\n }",
"boolean isExternalType();",
"boolean validTypeDef(String sourceName,\n TypeDef typeDef);",
"public static boolean declarationType(FileInputStream f){\n if(observer != null){\n observer.parser.setCurrentRule(\"declarationType\", true);\n }\n CToken t = new CToken();\n\n //DataType\n if(!dataType(f)){\n return false;\n }\n if(observer != null){\n observer.parser.setCurrentRule(\"declarationType\", true);\n }\n t = CScanner.getNextToken(f);\n if(observer != null){\n observer.parser.setCurrentToken(t);\n }\n //Identifier\n if (!t.type.equals(\"Identifier\")) {\n System.err.format(\"Syntax Error: In rule DeclarationType unexpected token \\\"%s\\\" of type %s on line %d.\\n\", t.token, t.type, t.lineNum);\n System.exit(0);\n }\n if(observer != null){\n observer.parser.setCurrentRule(\"declarationType\", false);\n }\n return true;\n }",
"private boolean hasTypeNamed(String simpleName) {\n IType[] types = getAllTypes();\n for (int i = 0, length = types.length; i < length; i++) {\n if (types[i].getElementName().equals(simpleName)) {\n return true;\n }\n }\n return false;\n }",
"boolean isMetadataType(TypeReference t);",
"public boolean isBuiltInType() {\n return SimpleTypesFactory.isBuiltInType(_typeCode);\n }",
"boolean isAnnotationType();",
"public boolean is( Type type ) {\n return this.type == type;\n }",
"public boolean isTypeDefMapped(String guid) { return mappingByTypeDefGUID.containsKey(guid); }",
"public\tboolean isUserDefinedType();",
"boolean isSupportedTypeAnnotation();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
testCheckRoot() Tests the checkRoot() method of ProofTree. | @Test
public void testCheckRoot(){
//Test a right-only tree
ProofTree t1 = ProofTree.createATree("~q");
assertTrue(t1.checkRoot("~"));
//Test a root-only tree
t1 = ProofTree.createATree("a");
assertTrue(t1.checkRoot("a"));
//Test a simple tree
t1 = ProofTree.createATree("(a=>b)");
assertTrue(t1.checkRoot("=>"));
//Test an empty tree
t1 = new ProofTree();
assertFalse(t1.checkRoot("=>"));
//Tests that should fail
t1 = ProofTree.createATree("(a=>b)");
assertFalse(t1.checkRoot("a"));
assertFalse(t1.checkRoot("b"));
assertFalse(t1.checkRoot(""));
assertFalse(t1.checkRoot(null));
assertFalse(t1.checkRoot("asdf"));
} | [
"@Test\n public void testRoot() {\n String message = \"Root node was incorrectly determined\";\n assertEquals(message, root, root);\n assertEquals(message, root, node1.root());\n assertEquals(message, root, node4.root());\n assertEquals(message, root, node7.root());\n assertEquals(message, root, node10.root());\n }",
"@Test\n\tpublic void testRoot() {\n\t\tassertNull(treeTwo.fatherOf(1));\n\t}",
"@Test\r\n public void testGetRoot()\r\n {\r\n assertEquals(\"Wrong root object\", config.getRootNode(), model.getRoot());\r\n }",
"@Test\n\tpublic void testCheckRoot_1()\n\t\tthrows Exception {\n\t\tDLLocalServiceImpl fixture = new DLLocalServiceImpl();\n\t\tfixture.groupLocalService = new GroupLocalServiceWrapper(new GroupLocalServiceImpl());\n\t\tfixture.hook = new CMISHook();\n\t\tfixture.dlFolderService = new DLFolderServiceWrapper(new DLFolderServiceImpl());\n\t\tlong companyId = 1L;\n\n\t\tfixture.checkRoot(companyId);\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.ClassNotFoundException: com.liferay.documentlibrary.service.impl.DLLocalServiceImpl\n\t\t// at java.net.URLClassLoader.findClass(Unknown Source)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.UserDefinedClassLoader.loadClass(UserDefinedClassLoader.java:62)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionContextImpl.getClass(ExecutionContextImpl.java:99)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.SimpleTypeExpression.execute(SimpleTypeExpression.java:205)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.MethodInvocationExpression.execute(MethodInvocationExpression.java:544)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionRequest.execute(ExecutionRequest.java:286)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.communication.LocalExecutionClient$1.run(LocalExecutionClient.java:158)\n\t\t// at java.lang.Thread.run(Unknown Source)\n\t}",
"@Test\n public void isRoot() {\n System.out.println(\"isRoot\");\n PasswordGroup group = model.getRoot();\n assertEquals(true, model.isRoot(group));\n }",
"@Test\r\n public void testRoot() {\r\n System.out.print(\"root\");\r\n BinaryTree<String> instance = new BinaryTree<>(\"Padre\");\r\n String expResult = \"Padre\";\r\n BinaryTree<String> aux_instance1 = new BinaryTree<>(\"Hijo1\");\r\n BinaryTree<String> aux_instance2 = new BinaryTree<>(\"Hijo2\");\r\n BinaryTree<String> aux_instance3 = new BinaryTree<>(\"Hijo3\");\r\n aux_instance1.setParent(instance);\r\n aux_instance2.setParent(aux_instance1);\r\n aux_instance3.setParent(aux_instance2);\r\n String result = aux_instance3.root().val;\r\n assertEquals(expResult, result);\r\n System.out.println(\" --> passed\");\r\n }",
"@Test\n\tpublic void testCheckRoot_2()\n\t\tthrows Exception {\n\t\tDLLocalServiceImpl fixture = new DLLocalServiceImpl();\n\t\tfixture.groupLocalService = new GroupLocalServiceWrapper(new GroupLocalServiceImpl());\n\t\tfixture.hook = new CMISHook();\n\t\tfixture.dlFolderService = new DLFolderServiceWrapper(new DLFolderServiceImpl());\n\t\tlong companyId = 1L;\n\n\t\tfixture.checkRoot(companyId);\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.ClassNotFoundException: com.liferay.documentlibrary.service.impl.DLLocalServiceImpl\n\t\t// at java.net.URLClassLoader.findClass(Unknown Source)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.UserDefinedClassLoader.loadClass(UserDefinedClassLoader.java:62)\n\t\t// at java.lang.ClassLoader.loadClass(Unknown Source)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionContextImpl.getClass(ExecutionContextImpl.java:99)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.SimpleTypeExpression.execute(SimpleTypeExpression.java:205)\n\t\t// at com.instantiations.eclipse.analysis.expression.model.MethodInvocationExpression.execute(MethodInvocationExpression.java:544)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.core.ExecutionRequest.execute(ExecutionRequest.java:286)\n\t\t// at com.instantiations.assist.eclipse.junit.execution.communication.LocalExecutionClient$1.run(LocalExecutionClient.java:158)\n\t\t// at java.lang.Thread.run(Unknown Source)\n\t}",
"@Test\n\tpublic void testCheckLeft(){\n\t\t//Test most simple case\n\t\tProofTree t1 = ProofTree.createATree(\"(a=>b)\");\n\t\tProofTree t2 = ProofTree.createATree(\"a\");\n\t\tassertTrue(t1.checkLeft(t2));\n\t\tassertFalse(t2.checkLeft(t1));\n\t\t\n\t\t//Test a more complicated tree\n\t\tt1 = ProofTree.createATree(\"(~a=>(~b=>~(b|b)))\");\n\t\tt2 = ProofTree.createATree(\"~a\");\n\t\tassertTrue(t1.checkLeft(t2));\n\t\tassertFalse(t2.checkLeft(t1));\n\t\t\n\t\t//Test another tree\n\t\tt1 = ProofTree.createATree(\"((a|b)=>b)\");\n\t\tt2 = ProofTree.createATree(\"(a|b)\");\n\t\tassertTrue(t1.checkLeft(t2));\n\t\tassertFalse(t2.checkLeft(t1));\n\t\t\n\t\t//Test a tree with no left subtree\n\t\tt1 = ProofTree.createATree(\"~a\");\n\t\tassertFalse(t1.checkLeft(t2));\n\t\tassertFalse(t2.checkLeft(t1));\n\t\t\n\t\t//check an empty tree;\n\t\tt1 = new ProofTree();\n\t\tassertFalse(t1.checkLeft(t2));\n\t\tassertFalse(t2.checkLeft(t1));\n\t\t\n\t\t//check what happens if null is passed in\n\t\tassertFalse(t2.checkLeft(null));\n\t}",
"public void testIsRoot() {\n File f = testFile;\n FileSystem fs = FileBasedFileSystem.getInstance();\n assertNotNull(fs);\n FileObject fo = null;\n while (f != null && f.exists()) {\n fo = FileBasedFileSystem.getFileObject(f);\n assertNotNull(f.getAbsolutePath(),fo);\n f = f.getParentFile(); \n }\n assertNotNull(fo.toString(), fo); \n FileObject root = fo;// fo.getParent ();\n \n assertNotNull(root.toString(), root); \n if (Utilities.isWindows()) {\n assertNotNull(root.getParent());\n root = root.getParent();\n } \n assertTrue(root.isRoot());\n assertTrue(root instanceof RootObj<?>);\n assertSame(root, fs.getRoot()); \n }",
"@Test\r\n public void testIsRoot() {\r\n System.out.println(\"isRoot\");\r\n ConfigNode configNode = new ConfigNode();\r\n ConfigNode childNode1 = new ConfigNode(testLine);\r\n configNode.appendChild(childNode1);\r\n assertTrue(configNode.isRoot());\r\n assertFalse(childNode1.isRoot());\r\n }",
"boolean hasRooted();",
"boolean hasRoot();",
"@Test\r\n public void testGetRoot() {\r\n System.out.println(\"getRoot\");\r\n ConfigNode configNode = new ConfigNode();\r\n ConfigNode childNode1 = new ConfigNode(testLine);\r\n configNode.appendChild(childNode1);\r\n assertEquals(configNode, childNode1.getRoot());\r\n }",
"@DisplayName(\"Get root\")\n @Test\n public void testGetRoot() {\n Assertions.assertEquals(0, graph.getRoot());\n }",
"boolean isRoot();",
"@Test\n public void test01isEmpty() {\n assertTrue(tree.isEmpty());\n }",
"protected void checkRoot(){\n if (this.isEmpty() && this.root != null){\n this.root.setElement(null); //\n }\n }",
"private void testGetRootUri003() {\n\t\tDmtSession session = null;\n\t\ttry {\n\t\t\tDefaultTestBundleControl.log(\"#testGetRootUri003\");\n\t\t\tsession = tbc.getDmtAdmin().getSession(TestExecPluginActivator.LEAF_NODE,\n\t\t\t\t\tDmtSession.LOCK_TYPE_ATOMIC);\n\t\t\tTestCase.assertEquals(\"Asserting root uri\", TestExecPluginActivator.LEAF_NODE, session.getRootUri());\n\t\t} catch (Exception e) {\n\t\t\ttbc.failUnexpectedException(e);\n\t\t} finally {\n\t\t\ttbc.closeSession(session);\n\t\t}\n\t}",
"@Test\n\tpublic void testCheckRightST(){\n\t\t//Test a simple tree\n\t\tProofTree t1 = ProofTree.createATree(\"~q\");\n\t\tProofTree t2 = ProofTree.createATree(\"(a=>q)\");\n\t\tassertTrue(t1.checkRightST(t2));\n\t\tassertTrue(t2.checkRightST(t1));\n\t\t\n\t\t//Test a more complex tree\n\t\tt1 = ProofTree.createATree(\"((a|b)=>(c&d))\");\n\t\tt2 = ProofTree.createATree(\"((a=>b)=>(c&d))\");\n\t\tassertTrue(t1.checkRightST(t2));\n\t\tassertTrue(t2.checkRightST(t1));\n\t\t\n\t\t//Test some empty trees\n\t\tt1 = new ProofTree();\n\t\tassertFalse(t1.checkRightST(t2));\n\t\tassertFalse(t2.checkRightST(t1));\n\t\t\n\t\t//Test another tree\n\t\tt1 = ProofTree.createATree(\"(a=>(p|q))\");\n\t\tt2 = ProofTree.createATree(\"((a=>d)=>(p|q))\");\n\t\tassertTrue(t1.checkRightST(t2));\n\t\tassertTrue(t2.checkRightST(t1));\n\t\t\t\n\t\t//Another tree\n\t\tt1 = ProofTree.createATree(\"(~a=>(~b=>~(b|b)))\");\n\t\tt2 = ProofTree.createATree(\"~(~b=>~(b|b))\");\n\t\tassertTrue(t1.checkRightST(t2));\n\t\tassertTrue(t2.checkRightST(t1));\n\t\t\n\t\t//Some that should fail\n\t\tt2 = ProofTree.createATree(\"a\");\n\t\tassertFalse(t2.checkRightST(t1));\n\t\tassertFalse(t1.checkRightST(t2));\n\t\t\n\t\tt1 = ProofTree.createATree(\"~q\");\n\t\tassertFalse(t2.checkRightST(t1));\n\t\tassertFalse(t1.checkRightST(t2));\n\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the constructor of a lambda yes/no menu with a title and an action on clicking yes or no | public LambdaYesNoMenu(final String title, final Consumer<Player> onYes, final Consumer<Player> onNo) {
super(title);
this.onYes = onYes;
this.onNo = onNo;
} | [
"public LambdaYesNoMenu(final String title, final Consumer<Player> onYes) {\r\n\t\tsuper(title);\r\n\t\t\r\n\t\tthis.onYes = onYes;\r\n\t\tthis.onNo = null;\r\n\t}",
"public LambdaYesNoMenu(final String title, final ItemStack item, final Consumer<Player> onYes, final Consumer<Player> onNo) {\r\n\t\tsuper(title, item);\r\n\t\t\r\n\t\tthis.onYes = onYes;\r\n\t\tthis.onNo = onNo;\r\n\t}",
"public LambdaYesNoMenu(final String title, final ItemStack item, final Consumer<Player> onYes) {\r\n\t\tsuper(title, item);\r\n\t\t\r\n\t\tthis.onYes = onYes;\r\n\t\tthis.onNo = null;\r\n\t}",
"void yesPressed();",
"void onYesClicked(int position);",
"static void askUserYesNo(String message, String title, int optionType, Runnable yesAction, Runnable noAction) {\n int answer = JOptionPane.showConfirmDialog(null,\n message,\n title,\n JOptionPane.YES_NO_OPTION,\n optionType);\n\n if (answer == JOptionPane.YES_OPTION) {\n yesAction.run();\n } else {\n noAction.run();\n }\n }",
"private void AboutMenuItem(){\n\t\tnew AlertDialog.Builder(this)\n\t\t.setTitle(\"About\")\n\t\t.setMessage(\"Gathers all the subject details and enters into database\")\n\t\t.setNeutralButton(\"OK\", new DialogInterface.OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t}).show();\n\t\t\n\t}",
"@Override\r\n public void start(Stage primaryStage) {\n MenuItem menuItem1 = new MenuItem(\"Action 1\");\r\n MenuItem menuItem2 = new MenuItem(\"Action 2\");\r\n MenuItem menuItem3 = new MenuItem(\"Action 3\");\r\n\r\n menuItem1.setOnAction((event) -> { System.out.println(\"MenuItem1 activated\"); });\r\n menuItem2.setOnAction((event) -> { System.out.println(\"MenuItem2 activated\"); });\r\n menuItem3.setOnAction((event) -> { System.out.println(\"MenuItem3 activated\"); });\r\n\r\n MenuButton menuButton = new MenuButton(\"Actions\", null, menuItem1, menuItem2, menuItem3);\r\n\r\n\r\n //second, more elaborate example of how a MenuButton can be created, and configured via setter methods\r\n MenuButton menuButton2 = new MenuButton();\r\n menuButton2.setText(\"More Actions\");\r\n\r\n MenuItem menuItem2_1 = new MenuItem(\"Action 1\");\r\n MenuItem menuItem2_2 = new MenuItem(\"Action 2\");\r\n MenuItem menuItem2_3 = new MenuItem(\"Action 3\");\r\n\r\n menuItem2_1.setOnAction((event) -> { System.out.println(\"MenuItem2_1 activated\"); });\r\n menuItem2_2.setOnAction((event) -> { System.out.println(\"MenuItem2_2 activated\"); });\r\n menuItem2_3.setOnAction((event) -> { System.out.println(\"MenuItem2_3 activated\"); });\r\n\r\n menuButton2.getItems().add(menuItem2_1);\r\n menuButton2.getItems().add(menuItem2_2);\r\n menuButton2.getItems().add(menuItem2_3);\r\n\r\n VBox vbox = new VBox(menuButton, menuButton2);\r\n Scene scene = new Scene(vbox);\r\n primaryStage.setScene(scene);\r\n primaryStage.setWidth (300);\r\n primaryStage.setHeight(300);\r\n primaryStage.show();\r\n }",
"public ActionMenuItem() {\n this(\"\");\n }",
"void displayConfirm(String title, String message, DialogInterface.OnClickListener positive, DialogInterface.OnClickListener negative);",
"private Stage confirmation(EventHandler<ActionEvent> action, String text) {\n\tStage stage = new Stage();\n\tVBox outer = new VBox(20);\n\n\touter.setStyle(\"-fx-background-color: linear-gradient(to bottom right, Plum, MediumOrchid); \"\n\t\t\t + \"-fx-spacing: 20px; -fx-padding: 40px;\");\t\n\t\n\tLabel label = new Label(text);\n\n\tHBox yesno = new HBox(30);\n\tButton yes = new Button(\"Yes\");\n\tyes.setOnAction(action);\n\t\n\tButton no = new Button(\"No\");\n\tno.setOnAction(e -> stage.close());\n\tyesno.getChildren().addAll(yes, no);\n\t\n\touter.getChildren().addAll(label, yesno);\n\t\n\tScene scene = new Scene(outer);\n\tstage.setScene(scene);\n\tstage.initModality(Modality.APPLICATION_MODAL);\n\tstage.sizeToScene();\n\t\n\treturn stage;\n }",
"public void makeConfirm(String title, String message, OnClickListener yesListener) {\n this.dismiss();\n this.dialog = new AlertDialog.Builder(this.context)\n .setTitle(title)\n .setMessage(message)\n .setCancelable(false)\n .setPositiveButton(this.context.getString(android.R.string.yes), yesListener)\n .setNegativeButton(this.context.getString(android.R.string.no), null)\n .show();\n }",
"public abstract JSFunctionDefinition createShowMenuEventFunction();",
"void aboutMenuClicked();",
"private void createHelpButton()\r\n {\r\n // Instantiate the CustomYellowButtons class and give it the text for the button.\r\n CustomBlueButtons checkHelpButton = new CustomBlueButtons(\"HELP\");\r\n // Adds the help button to the menu of buttons.\r\n addBlueButtonsToMenu(checkHelpButton);\r\n // Adds an on action listener to the button.\r\n checkHelpButton.setOnAction(new EventHandler<ActionEvent>()\r\n {\r\n @Override\r\n public void handle(ActionEvent event) \r\n {\r\n // If the button is clicked load the corresponsing sub scene.\r\n System.out.println(\"HELP\");\r\n }\r\n });\r\n }",
"public NewAction() {\n\t\tsuper(\"New...\", null);\n\t\tputValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_N, MAIN_MENU_MASK));\n\t}",
"public PropPanelAction() {\r\n this(\"label.action\", null);\r\n }",
"protected GuiTestObject Btn_Yes() \n\t{\n\t\treturn new GuiTestObject(\n getMappedTestObject(\"Btn_Yes\"));\n\t}",
"void add(String prompt, UIMenuAction action);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This constructor creates a new FormLine object based on the name and help String passed to it as arguments. It will create a JPanel and fill it with a customdrawn JPanel for feedback, a JLabel, a JTextField, and a JButton for help. | public FormLine(String name, String help, Predicate<String> predicate) {
super();
this.help = help;
this.predicate = predicate;
setLayout(new FlowLayout());
notifySpot = new JPanel() {
private static final long serialVersionUID = -5602302297053566788L;
@Override
public Dimension getPreferredSize() {
return new Dimension(60, 60);
}
};
add(notifySpot);
wrong = new JPanel() {
private static final long serialVersionUID = 420522625552541384L;
@Override
public Dimension getPreferredSize() {
return new Dimension(50, 50);
}
@Override
public void paintComponent(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.setColor(new Color(0xFF, 0x00, 0x00));
g2.setStroke(new BasicStroke(10));
g2.drawLine(0, 0, 50, 50);
g2.drawLine(0, 50, 50, 0);
}
};
right = new JPanel() {
private static final long serialVersionUID = -3956457224682491642L;
@Override
public Dimension getPreferredSize() {
return new Dimension(50, 50);
}
@Override
public void paintComponent(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.setColor(new Color(0x00, 0xFF, 0x00));
g2.setStroke(new BasicStroke(10));
g2.drawLine(0, 25, 17, 42);
g2.drawLine(17, 42, 50, 8);
}
};
JLabel inputLabel = new JLabel(name + ": ");
inputLabel.setPreferredSize(new Dimension(100, 50));
add(inputLabel);
input = new JTextField(20);
add(input);
JButton helpButton = new JButton("Help");
helpButton.addActionListener((e) -> {
help();
});
add(helpButton);
} | [
"public QuestionPanel(Question question)\r\n\t {\r\n\t this.question = question;\r\n\t \r\n\t text = new JLabel(\" \" + question.getText());\r\n\t \r\n\t setLayout(new GridLayout(1, 2));\r\n\t setBorder(BorderFactory.createLineBorder(Color.WHITE));\r\n\t text.setAlignmentY(0.5F);\r\n\t add(text);\r\n\t inputAnswerPanel = createInputAnswerPanel();\r\n\t inputAnswerPanel.getPanel().setAlignmentY(0.5F);\r\n\t add(inputAnswerPanel.getPanel());\r\n\t }",
"public Feedback() {\n super(\"Feedback Form\");\n initComponents();\n groupButton();\n }",
"private JComponent makeCommandLinePanel() {\n \t\tJPanel commandLinePanel = new JPanel();\n \t\tcommandLinePanel.setLayout(new BoxLayout(commandLinePanel,\n \t\t\t\tBoxLayout.LINE_AXIS));\n \n \t\tcommandLinePanel.add(new JLabel(myResources.getString(\"CommandLine\")));\n \t\tcommandLinePanel.add(makeCommandLine());\n \t\treturn commandLinePanel;\n \t}",
"public FormFeedback()\r\n {\r\n this(true);\r\n }",
"public HelpFrame(String[] cmdN, String[] cmd){\n\t\tsuper(\"Help\"); // window name\n\t\t\n\t\tpanel[0].add(new JLabel(\"List of Commands\"));\n\n\t\t// empty JLabels to be used as a new line\n\t\tpanel[0].add(new JLabel()); \n\t\tpanel[0].add(new JLabel());\n\t\t\n\t\t// for each row, add the command name and Text Field\n\t\tfor(int i=0; i<cmdN.length;i++){\n\t\t\tJTextField cN = new JTextField(cmd[i]);\n\t\t\tpanel[1].add(new JLabel(cmdN[i]));\n\t\t\tpanel[1].add(cN);\n\t\t\tcN.setEditable(false);\n\t\t\t\n\t\t}\n\t\t\n\t\t// new line & informative text\n\t\tpanel[2].add(new JLabel());\n\t\tpanel[2].add( new JLabel(\"For changes to take effect, after changing the host name and/or port number,\"));\n\t\tpanel[2].add( new JLabel(\"please logoff/stop and login/start the server again. \"));\n\t\t\n\t\t// placing my panels in the proper order\n\t\tadd(panel[0], BorderLayout.NORTH);\n\t\tadd(panel[1], BorderLayout.CENTER);\n\t\tadd(panel[2], BorderLayout.SOUTH);\n\t\t\n\t\t// default close operation\n\t\tsetDefaultCloseOperation(getDefaultCloseOperation());\n\t\t\n\t\t//make everything nice and cozy then show the window.\n\t\tsetResizable(false);\n\t\tpack();\n\t\tsetVisible(true);\n\t}",
"public HelpPanel() {\n initComponents();\n }",
"public HelpAboutForm() {\n initComponents();\n \n setVisible( true);\n }",
"public GUI(String title) {\r\n this(title, 600, 600, Color.BLACK);\r\n }",
"public Form() {\n\t\tthis(\"\");\n\t\t\n\t}",
"public ShapeCommentPanel(ShapeComment sc, String info, String aUser, String mail, Date aDate) {\n initComponents();\n\n /*Hold the information*/\n comment = info;\n creatorUserName = aUser;\n email = mail;\n creationDate = aDate;\n parent = sc;\n\n /*Add the information to the appropriate Components*/\n this.usernameTxt.setText(creatorUserName);\n this.editedTxt.setText(editedByList);\n this.emailTxt.setText(email);\n this.dateTxt.setText(creationDate.toString());\n this.commentArea.setText(comment);\n\n }",
"public Question() {\r\n // This is the defult constructor b/c it takes no parameters\r\n firstPrompt = \"Please enter something:\";\r\n minScale = 1;\r\n maxScale = 10;\r\n secondPrompt = \"Additional comments:\";\r\n }",
"public AutomationArgumentPanel(DemistoAutomationYML.DemistoArgument arg, Project project, String commandName) {\n super();\n\n this.setLayout(new GridLayoutManager(4, 3, JBUI.insets(0, 5), -1, -1));\n try {\n msgBus = project.getMessageBus();\n } catch (NullPointerException e) {\n // this is used to be able to test this panel\n }\n JPanel argDescWrapPanel = new JPanel();\n argDescWrapPanel.setLayout(new GridLayoutManager(2, 2, JBUI.insets(0, 5), -1, -1));\n\n titleLabel = new JLabel();\n titleLabel.setLabelFor(titleTextField);\n titleLabel.setText(\"Argument *\");\n titleTextField = new JTextField(arg.getName());\n titleTextField.setName(\"titleTextField\");\n titleTextField.setBorder(LineBorder.createGrayLineBorder());\n titleTextField.getDocument().addDocumentListener(new DocumentListener() {\n @Override\n public void changedUpdate(DocumentEvent e) {\n updateLabel(e);\n }\n\n @Override\n public void insertUpdate(DocumentEvent e) {\n updateLabel(e);\n }\n\n @Override\n public void removeUpdate(DocumentEvent e) {\n updateLabel(e);\n }\n\n private void updateLabel(DocumentEvent e) {\n arg.setName(titleTextField.getText());\n firePropertyChange(YML_CHANGE_AUTOMATION_ARG_FIELD, false, true);\n msgBus.syncPublisher(DEMISTO_ARGUMENT_CHANGE).updateDemistoEvent();\n }\n });\n\n argDescWrapPanel.add(titleLabel, new GridConstraints(\n 0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.ALIGN_FILL,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n null, null, null));\n argDescWrapPanel.add(titleTextField, new GridConstraints(\n 0, 1, 1, 1,\n GridConstraints.ANCHOR_WEST, GridConstraints.ALIGN_FILL,\n GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED,\n null, null, null));\n\n descriptionLabel = new JLabel();\n descriptionLabel.setLabelFor(descriptionText);\n descriptionLabel.setText(\"Description\");\n descriptionText = new JTextArea(arg.getDescription());\n descriptionText.setName(\"descriptionText\");\n descriptionText.setLineWrap(true);\n descriptionText.setWrapStyleWord(true);\n descriptionText.setBorder(BorderFactory.createCompoundBorder(\n LineBorder.createGrayLineBorder(),\n BorderFactory.createEmptyBorder(5, 5, 5, 5)));\n descriptionText.setFont(titleTextField.getFont());\n descriptionText.getDocument().addDocumentListener(new DocumentListener() {\n @Override\n public void changedUpdate(DocumentEvent e) {\n updateLabel(e);\n }\n\n @Override\n public void insertUpdate(DocumentEvent e) {\n updateLabel(e);\n }\n\n @Override\n public void removeUpdate(DocumentEvent e) {\n updateLabel(e);\n }\n\n private void updateLabel(DocumentEvent e) {\n arg.setDescription(descriptionText.getText());\n firePropertyChange(YML_CHANGE_AUTOMATION_ARG_FIELD, false, true);\n }\n });\n\n argDescWrapPanel.add(descriptionLabel, new GridConstraints(\n 1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.ALIGN_FILL,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n null, null, null));\n argDescWrapPanel.add(descriptionText, new GridConstraints(\n 1, 1, 1, 1,\n GridConstraints.ANCHOR_WEST, GridConstraints.ALIGN_FILL,\n GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED,\n null, null, null));\n\n JPanel checkBoxesWrapPanel = new JPanel();\n checkBoxesWrapPanel.setLayout(new GridLayoutManager(2, 3, JBUI.insets(0, 5), -1, -1));\n\n attributesLabel = new JLabel(\"Attributes\");\n checkBoxesWrapPanel.add(attributesLabel, new GridConstraints(0, 0, 2, 1,\n GridConstraints.ALIGN_FILL, GridConstraints.FILL_BOTH,\n GridConstraints.SIZEPOLICY_FIXED,\n GridConstraints.SIZEPOLICY_FIXED,\n null, null, null));\n\n isMandatoryCheckBox = new JCheckBox(\"Mandatory\", null, arg.getRequired());\n isMandatoryCheckBox.setName(\"isMandatoryCheckBox\");\n\n checkBoxesWrapPanel.add(isMandatoryCheckBox, new GridConstraints(0, 1, 1, 1,\n GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,\n GridConstraints.SIZEPOLICY_CAN_SHRINK,\n GridConstraints.SIZEPOLICY_CAN_SHRINK,\n null, null, null));\n\n isMandatoryCheckBox.addActionListener(e -> {\n AbstractButton abstractButton = (AbstractButton) e.getSource();\n boolean selected = abstractButton.getModel().isSelected();\n arg.setRequired(selected);\n firePropertyChange(YML_CHANGE_AUTOMATION_ARG_FIELD, false, true);\n });\n\n isDefaultCheckBox = new JCheckBox(\"Default\", null, arg.getDefault());\n isDefaultCheckBox.setName(\"isDefaultCheckBox\");\n checkBoxesWrapPanel.add(isDefaultCheckBox, new GridConstraints(0, 2, 1, 1,\n GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,\n GridConstraints.SIZEPOLICY_CAN_SHRINK,\n GridConstraints.SIZEPOLICY_CAN_SHRINK,\n null, null, null));\n\n isDefaultCheckBox.addActionListener(e -> {\n AbstractButton abstractButton = (AbstractButton) e.getSource();\n boolean selected = abstractButton.getModel().isSelected();\n arg.setDefault(selected);\n firePropertyChange(YML_CHANGE_AUTOMATION_ARG_FIELD, false, true);\n });\n\n isSensitiveCheckBox = new JCheckBox(\"Sensitive\", null, arg.getSecret());\n isSensitiveCheckBox.setName(\"isSensitiveCheckBox\");\n checkBoxesWrapPanel.add(isSensitiveCheckBox, new GridConstraints(1, 1, 1, 1,\n GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,\n GridConstraints.SIZEPOLICY_CAN_SHRINK,\n GridConstraints.SIZEPOLICY_CAN_SHRINK,\n null, null, null));\n\n isSensitiveCheckBox.addActionListener(e -> {\n AbstractButton abstractButton = (AbstractButton) e.getSource();\n boolean selected = abstractButton.getModel().isSelected();\n arg.setSecret(selected);\n firePropertyChange(YML_CHANGE_AUTOMATION_ARG_FIELD, false, true);\n });\n\n isArrayCheckBox = new JCheckBox(\"Is array\", null, arg.getIsArray());\n isArrayCheckBox.setName(\"isArrayCheckBox\");\n checkBoxesWrapPanel.add(isArrayCheckBox, new GridConstraints(1, 2, 1, 1,\n GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,\n GridConstraints.SIZEPOLICY_CAN_SHRINK,\n GridConstraints.SIZEPOLICY_CAN_SHRINK,\n null, null, null));\n isArrayCheckBox.addActionListener(e -> {\n AbstractButton abstractButton = (AbstractButton) e.getSource();\n boolean selected = abstractButton.getModel().isSelected();\n arg.setIsArray(selected);\n firePropertyChange(YML_CHANGE_AUTOMATION_ARG_FIELD, false, true);\n });\n\n\n JPanel initialValOptionsWrapPanel = new JPanel();\n initialValOptionsWrapPanel.setLayout(new GridLayoutManager(2, 2, JBUI.insets(0, 5), -1, -1));\n\n initialValueLabel = new JLabel(\"Initial value\");\n initialValueLabel.setLabelFor(initialValueText);\n initialValueText = new JTextField(arg.getDefaultValue());\n initialValueText.setName(\"initialValueText\");\n initialValueText.setBorder(LineBorder.createGrayLineBorder());\n initialValueText.getDocument().addDocumentListener(new DocumentListener() {\n @Override\n public void changedUpdate(DocumentEvent e) {\n updateLabel(e);\n }\n\n @Override\n public void insertUpdate(DocumentEvent e) {\n updateLabel(e);\n }\n\n @Override\n public void removeUpdate(DocumentEvent e) {\n updateLabel(e);\n }\n\n private void updateLabel(DocumentEvent e) {\n arg.setDefaultValue(initialValueText.getText());\n firePropertyChange(YML_CHANGE_AUTOMATION_ARG_FIELD, false, true);\n }\n });\n\n initialValOptionsWrapPanel.add(initialValueLabel, new GridConstraints(\n 0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.ALIGN_FILL,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n null, null, null));\n initialValOptionsWrapPanel.add(initialValueText, new GridConstraints(\n 0, 1, 1, 1,\n GridConstraints.ANCHOR_WEST, GridConstraints.ALIGN_FILL,\n GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED,\n null, null, null));\n\n\n listOptionsLabel = new JLabel(\"List options\");\n listOptionsLabel.setLabelFor(listOptionsText);\n\n listOptionsText = new JTextArea(String.join(\",\", arg.getPredefined()));\n listOptionsText.setLineWrap(true);\n listOptionsText.setWrapStyleWord(true);\n listOptionsText.setBorder(BorderFactory.createCompoundBorder(\n LineBorder.createGrayLineBorder(),\n BorderFactory.createEmptyBorder(5, 5, 5, 5)));\n listOptionsText.setName(\"listOptionsText\");\n listOptionsText.setFont(titleTextField.getFont());\n listOptionsText.getDocument().addDocumentListener(new DocumentListener() {\n @Override\n public void changedUpdate(DocumentEvent e) {\n updateLabel(e);\n }\n\n @Override\n public void insertUpdate(DocumentEvent e) {\n updateLabel(e);\n }\n\n @Override\n public void removeUpdate(DocumentEvent e) {\n updateLabel(e);\n }\n\n private void updateLabel(DocumentEvent e) {\n arg.setPredefined(new ArrayList<>(Arrays.asList(listOptionsText.getText().split(\",\"))));\n if (!listOptionsText.getText().trim().equals(\"\")) {\n arg.setAuto(PREDEFINED);\n } else {\n arg.setAuto(\"\");\n }\n firePropertyChange(YML_CHANGE_AUTOMATION_ARG_FIELD, false, true);\n }\n });\n\n initialValOptionsWrapPanel.add(listOptionsLabel, new GridConstraints(\n 1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.ALIGN_FILL,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n null, null, null));\n initialValOptionsWrapPanel.add(listOptionsText, new GridConstraints(\n 1, 1, 1, 1,\n GridConstraints.ANCHOR_WEST, GridConstraints.ALIGN_FILL,\n GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED,\n null, null, null));\n\n // ---- Delete Argument button ----\n JPanel deleteButtonPanel = new JPanel();\n deleteButtonPanel.setLayout(new GridLayoutManager(1, 2, JBUI.insets(0, 5), -1, -1));\n\n deleteArgumentButton = new JButton(\"Delete Argument\", IconLoader.getIcon(DEMISTO_DELETE_ICON));\n deleteArgumentButton.setName(\"deleteArgumentButton\");\n deleteArgumentButton.addActionListener(e ->\n msgBus.syncPublisher(DEMISTO_DELETE).deleteDemistoArgument(titleTextField.getText(), commandName));\n deleteButtonPanel.add(deleteArgumentButton, new GridConstraints(0, 1, 1, 1,\n GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE,\n GridConstraints.SIZEPOLICY_CAN_SHRINK,\n GridConstraints.SIZEPOLICY_CAN_SHRINK,\n null, null, null));\n\n this.add(argDescWrapPanel, new GridConstraints(0, 0, 1, 1,\n GridConstraints.FILL_HORIZONTAL, GridConstraints.FILL_HORIZONTAL,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n null, null, null));\n this.add(checkBoxesWrapPanel, new GridConstraints(1, 0, 1, 1,\n GridConstraints.FILL_HORIZONTAL, GridConstraints.FILL_BOTH,\n GridConstraints.SIZEPOLICY_WANT_GROW,\n GridConstraints.SIZEPOLICY_WANT_GROW,\n null, null, null));\n this.add(initialValOptionsWrapPanel, new GridConstraints(2, 0, 1, 1,\n GridConstraints.FILL_HORIZONTAL, GridConstraints.FILL_HORIZONTAL,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n null, null, null));\n this.add(deleteButtonPanel, new GridConstraints(3, 0, 1, 1,\n GridConstraints.ANCHOR_EAST, GridConstraints.FILL_HORIZONTAL,\n GridConstraints.SIZEPOLICY_WANT_GROW,\n GridConstraints.SIZEPOLICY_WANT_GROW,\n null, null, null));\n this.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.lightGray), BorderFactory.createEmptyBorder(10, 0, 10, 0)));\n this.addPropertyChangeListener(YML_CHANGE_AUTOMATION_ARG_FIELD, evt -> firePropertyChange(YML_CHANGE_AUTOMATION_ARG, false, true));\n }",
"public AddLineDialog(){\n dialog = new TextInputDialog(\"walter\");\n vbox = new VBox();\n hbox = new HBox();\n label1 = new Label(\"Name: \");\n tx = new TextField();\n colorPickerCircle = new Circle();\n colorPicker = new ColorPicker();\n }",
"@Messages({\n\t\"MSG_Hello=Hello from Term\",\n\t\"FontChooser.title=Font Chooser\",\n\t\"FontChooser.defaultFont.label=Default Font\"\n })\n public TermOptionsPanel() {\n\tpropertyListener = new PropertyChangeListener() {\n\t @Override\n\t public void propertyChange(PropertyChangeEvent e) {\n\t\trefreshView();\n\t }\n\t};\n\t\n\tinitComponents();\n\tinitCustomComponents();\n\n\tterm = new Term();\n\tfinal String line1String = MSG_Hello() + \"\\r\\n\";\t// NOI18N\n\tfinal char line1[] = line1String.toCharArray();\n\tterm.putChars(line1, 0, line1.length);\n\tterm.pushStream(new LineDiscipline());\n\tterm.setRowsColumns(7, 60);\n\tterm.setClickToType(true);\n\n\tpreviewPanel.add(term, BorderLayout.CENTER);\n }",
"public HelpMenuView()\r\n {\r\n super(\"\\n\" + \r\n \"**************************\\n\" +\r\n \"* HELP MENU *\\n\" +\r\n \"**************************\\n\" +\r\n \" 1 - What are the goals of the game?\\n\" +\r\n \" 2 - Where is the city of Aaron?\\n\" +\r\n \" 3 - How do I view the map?\\n\" +\r\n \" 4 - How do I move to another location?\\n\" +\r\n \" 5 - How do I display a list of animals, provisions and\" +\r\n \" tools in the city storehouse?\\n\" +\r\n \" 6 - back to the Main Menu\", 6);\r\n }",
"public LineBorderPanel()\n {\n\tthis(null);\n }",
"Help createHelp();",
"public GUI(String title, int width, int height) {\r\n this(title, width, height, Color.BLACK);\r\n }",
"public TetrisGUI()\n {\n super(\"Tetris\");\n myBoard = new Board();\n myEastPanel = new JPanel(); \n myInputField = new JTextField(); \n myInfoPanel = new TetrisNextPiecePanel(getBlocks(), myBoard);\n myDrawingPanel = new TetrisDrawingPanel(getBlocks(), myBoard); \n myScoringPanel = new TetrisScoringPanel(myDrawingPanel);\n myControls = myDrawingPanel.getControls(); \n start(); \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Container's getter for DcmJobView. | public ViewObjectImpl getDcmJobView() {
return (ViewObjectImpl)findViewObject("DcmJobView");
} | [
"public Dsjob getJobObject() { return job; }",
"public ViewObjectImpl getJobsView1() {\n return (ViewObjectImpl) findViewObject(\"JobsView1\");\n }",
"@Override\n\tpublic JobListView getJobListView() {\n\t\tif(jobListView == null){\n\t\t\tjobListView = new JobListViewImpl();\n\t\t}\n\t\treturn jobListView;\n\t}",
"public ViewObjectImpl getJobHistoryView() {\n return (ViewObjectImpl) findViewObject(\"JobHistoryView\");\n }",
"public ViewObjectImpl getJobsView2() {\n return (ViewObjectImpl) findViewObject(\"JobsView2\");\n }",
"@Override\n public ScheduledRepairJobView getView()\n {\n long now = System.currentTimeMillis();\n return new ScheduledRepairJobView(getId(), getTableReference(), getRepairConfiguration(), getStatus(now),\n getProgress(), getNextRunInMs(), getLastSuccessfulRun(), RepairOptions.RepairType.INCREMENTAL);\n }",
"public String getJob() {\r\n return job;\r\n }",
"CiCdJob getJob(int index);",
"public String getJob() {\n return job;\n }",
"public Long getJobID() {\n return jobID;\n }",
"public Integer getJob_id() {\n return job_id;\n }",
"public abstract Utility.Job getJob();",
"public ViewObjectImpl getJobsVO1() {\n return (ViewObjectImpl)findViewObject(\"JobsVO1\");\n }",
"java.lang.String getJob();",
"public String getJob() {\n\t\treturn this.job;\n\t}",
"public ObservableList<Job> getJobData() {\n return jobData;\n }",
"public JobConfig getJobConfig() {\n return _jobConfig;\n }",
"public Integer getJob_id(){\r\n\t\treturn this.job_id ;\r\n\t}",
"public String getJobID() {\r\n \treturn jobID;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if AUTO_PK_TABLE already exists in the database. | protected boolean autoPkTableExists(DataNode node) throws SQLException {
Connection con = node.getDataSource().getConnection();
boolean exists = false;
try {
DatabaseMetaData md = con.getMetaData();
ResultSet tables = md.getTables(null, null, "AUTO_PK_SUPPORT", null);
try {
exists = tables.next();
} finally {
tables.close();
}
} finally {
// return connection to the pool
con.close();
}
return exists;
} | [
"abstract boolean tableExist() throws SQLException;",
"private boolean checkExisitingPK(String table, String PK) throws SQLException {\n\t\tString query = \"SELECT COUNT(*) FROM \" + tables.get(table) + \" WHERE \" + pks.get(table) + \"=\" + PK;\n\t\tResultSet rs = query(query);\n\t\trs.next();\n\t\tint num = rs.getInt(\"COUNT(*)\");\n\t\tif (num == 0)\n\t\t\treturn false;\n\t\treturn true;\n\t}",
"private void createEoPkTable() throws SQLException\n {\n if (!database().hasTable(\"EO_PK_TABLE\", \"PK\", \"1\"))\n {\n log.info(\"creating table EO_PK_TABLE\");\n database().executeSQL(\n \"CREATE TABLE EO_PK_TABLE \"\n + \"(NAME CHAR(40) PRIMARY KEY, PK INT)\");\n }\n }",
"public static boolean tableAlreadyExists(SQLException e) {\n boolean exists;\n if (e.getSQLState().equals(\"X0Y32\")) {\n exists = true;\n } else {\n exists = false;\n }\n return exists;\n }",
"public boolean isSetPktable_name() {\n return this.pktable_name != null;\n }",
"public boolean isAutoCreateTable() {\n return autoCreateTable;\n }",
"boolean getTableExists(String table);",
"boolean isAutoIncrement();",
"boolean hasIsPk();",
"public boolean isSetPktable_db() {\n return this.pktable_db != null;\n }",
"private boolean tableAlreadyExists(UUID id, String name) {\n\t\tboolean exists = false;\n\t\tfor (Map.Entry<UUID, Table> entry : getTableMap().entrySet()) {\n\t\t\tif (!(entry.getKey().equals(id)) && entry.getValue().getName().equals(name)) {\n\t\t\t\texists = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn exists;\n\t}",
"public boolean checkTable() {\n\t\treturn gradeJdbc.checkTable();\n\t}",
"public void verifyExists(Connection db)\n\t{\n\t\tString sql = \"\";\n\t\t\n\t\t// We don't want to create any columns without tables, so make sure to break if there aren't any\n\t\tif(cols.length <1)\n\t\t{\n\t\t\tSystem.err.println(\"Cannot create table \" +name+ \" because it has no columns!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\ttry \n\t\t{\n\t\t\tif(db == null || !db.isValid(3)) // break if invalid or null\n\t\t\t{\n\t\t\t\tSystem.err.println(\"Invalid database at verifyTable\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tsql = \"CREATE TABLE IF NOT EXISTS \" +name+ \" (\";\n\t\t\tsql += cols[0]; // add the first one seperately without the comma\n\t\t\tfor(int i=1; i<this.cols.length; i++)\n\t\t\t\tsql += \", \" +cols[i];\n\t\t\t\n\t\t\tif(!primaryKey.trim().isEmpty()) //if the primary key isn't null, empty, or whitespace, add the primary key flag\n\t\t\t\tsql += \", PRIMARY KEY('\" +primaryKey+ \"')\";\n\t\t\t\n\t\t\tsql +=\");\"; // cap off the statement, and execute\n\t\t\tStatement s = db.createStatement();\n\t\t\ts.execute(sql);\n\t\t\ts.close();\n\t\t\t\n\t\t} catch (SQLException e) \n\t\t{\n\t\t\tSystem.err.println(\"Failed to verify table existance with SQL \" +sql);\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static boolean tableIsExist(String name) throws Exception {\n init();\n TableName tableName = TableName.valueOf(name);\n boolean flag = admin.tableExists(tableName);\n close();\n return flag;\n }",
"public boolean validateTableExist(String tableName) {\n\t\tResultSet rs;\n\t\tboolean flag = false;\n\t\ttry {\n\t\t\tDatabaseMetaData meta = dataSource.getConnection().getMetaData();\n\t\t\tString type[] = { \"TABLE\" };\n\t\t\trs = meta.getTables(null, null, tableName, type);\n\t\t\tflag = rs.next();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn flag;\n\t}",
"public boolean tableExists(Class<?> clazz) {\n String tableName = clazz.getDeclaredAnnotation(org.ufl.aida.ldc.dbloader.tmpORM.withReflection.model.Table.class).sqlTable();\n return jooq().meta().getTables().stream().anyMatch(x -> x.getName().equals(tableName));\n }",
"@Override\n public boolean isAutoIncrement(int column) throws SQLException {\n return false;\n }",
"boolean hasAdm0002Pk();",
"protected abstract boolean existsByTable(String table);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper method that makes the Player buttons visible called when user is loged in. | private void showPlayerButtons() {
previous.setVisibility(View.VISIBLE);
play.setVisibility(View.VISIBLE);
next.setVisibility(View.VISIBLE);
} | [
"protected void onUserVisible() {\n }",
"private void playingButtons() {\n\t\tcloseButton.setEnabled(false);\n\t\tpauseButton.setEnabled(true);\n\t}",
"private void showPlayerOptions() {\n playStartLinearLayout.setVisibility(View.INVISIBLE);\n timeInfoLinearLayout.setVisibility(View.INVISIBLE);\n gsOpenPlayImage.setVisibility(View.VISIBLE);\n\n\n }",
"private void setupPlayerUI() {\r\n // for now hide the player\r\n setPlayerVisible(false);\r\n\r\n // disable unnecesary buttons\r\n setButtonEnabled(mButtonPlayerSeekBackward, false);\r\n setButtonEnabled(mButtonPlayerSeekForward, false);\r\n setButtonEnabled(mButtonPlayerSkipBackward, false);\r\n\r\n setButtonEnabled(mButtonPlayerRepeat, false);\r\n }",
"public void isLoggedIn(){\n boolean login = currUser.length() > 0;\n\n navigationView.getMenu().getItem(0).setVisible(!login);\n navigationView.getMenu().getItem(1).setVisible(login);\n loggedInUserView.setText(currUser);\n\n if(login) {\n calibrationBtn.setVisibility(View.VISIBLE);\n welcomeView.setText(R.string.text_welcome_as_admin);\n }\n else {\n calibrationBtn.setVisibility(View.GONE);\n welcomeView.setText(R.string.text_welcome);\n }\n }",
"private void updateLoggedInIcon(boolean value)\n {\n currentAthlete.setLoggedIn(value);\n\n if (currentAthlete.getLoggedIn())\n {\n stravaConnectedAP.toFront();\n stravaConnectedAP.setOpacity(1.0);\n\n authorizationButton.setOpacity(0.0);\n authorizationButton.setDisable(true);\n authorizationButton.toBack();\n }\n else\n {\n authorizationButton.setOpacity(1.0);\n authorizationButton.setDisable(false);\n authorizationButton.toFront();\n\n stravaConnectedAP.toBack();\n stravaConnectedAP.setOpacity(0.0);\n }\n }",
"public boolean isVisibleTo(Player player);",
"public void lobby() {\n// chaseCam.setDragToRotate(false);\n inputManager.setCursorVisible(true);\n nifty.gotoScreen(\"lobby\");\n }",
"public void playerTurnOver(){\n\t\tfor(JButton button: playCardButtons)\n\t\t\tbutton.setEnabled(false);\n\t}",
"private void showLeaders(){\n\t\thandlers.get(currentPlayer).send(currentPlayer.displayLeader());\n\n\t}",
"public void acivatePlayer() {\n\t\tthis.setEnabled(true);\n\t}",
"private void updatePlayersButtons() {\n updatePlayerButtons(0);\n updatePlayerButtons(1);\n }",
"private void updateButtons() {\n if (UserCredentials.INSTANCE.isAuthenticated()) {\n mShowQuestions.setEnabled(true);\n mEditQuestion.setEnabled(true);\n mSearchQuestion.setEnabled(true);\n mOfflineMode.setEnabled(true);\n mTequilaLogin.setText(R.string.tequila_logout);\n } else {\n mShowQuestions.setEnabled(false);\n mEditQuestion.setEnabled(false);\n mSearchQuestion.setEnabled(false);\n mOfflineMode.setEnabled(false);\n mTequilaLogin.setText(R.string.tequila_login);\n }\n \n if (Proxy.INSTANCE.isOnline()) {\n mOfflineMode.setChecked(false);\n } else {\n mOfflineMode.setChecked(true);\n }\n }",
"private void overChat() {\n if (!inChat) {\n base.setOpacity(0);\n base.setVisible(false);\n this.playerNames.setVisible(false);\n }\n }",
"public static void signin(){\n\t\t\n JLabel titleText = layout.getTitleText();\n JLabel subTitleText = layout.getSubTitleText();\n JPanel menuButtons = layout.getMenuButtons();\n ExitButton exitButton = layout.getExitButton();\n JPanel signinPanel = layout.getSigninPanel();\n\n menuButtons.setVisible(false);\n exitButton.setVisible(true);\n titleText.setVisible(true);\n subTitleText.setVisible(true);\n signinPanel.setVisible(true);\n\n currentPlayer = new Player();\n\n titleText.setText(\"Sign In\");\n\t\t\n\t}",
"public void playerIsActive(){\n\t\tfor(int i=0; i<5; i++){\n\t\t\tif(cardNums[i] > 0)\n\t\t\t\tplayCardButtons[i].setEnabled(true);\n\t\t\telse\n\t\t\t\tplayCardButtons[i].setEnabled(false);\n\t\t}\n\t}",
"protected void botonesVisibles(boolean sw) {\n\t\t\n\t\t\n\t\tif (aiPlayer!=null && randomPlayer!=null)\n\t\t\tsettings.playermodes(sw);\n\t\tif (localPiece==null)\n\t\t{\n\t\t\tsettings.restart(sw);\n\t\t\tsettings.quit(sw);\n\t\t}\t\n\t}",
"public static void showLogin(){\n login.show();\n loginController.onLoad();\n Game.hide();\n }",
"public void hidePins() {\n\t\t\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
go to particular channel | boolean goToChannel(int channel_id) {
for (Map.Entry channel : channel_list.entrySet()) {
if (channel.getKey() == channel_id) {
current_channel = channel_id;
return true;
}
}
return false;
} | [
"Channel channel();",
"public Channel nextChannel();",
"public void nextChannel() {\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.NEXT_CHANNEL));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.NEXT_CHANNEL) {\n isSwitchingNext = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n }\n }",
"void joinChannel(String channel) throws IOException, InvalidChannelException;",
"public synchronized void join(String channel) {\n sendRaw(\"JOIN \" + channel);\n }",
"public void switchChannels(String channel){\n\t\tif(channels.contains(channel)){\n\t\t\tthis.activeChannel = channel;\n\t\t}else{\n\t\t\tSystem.out.println(\"You are not currently subscribed to that channel.\\nTo switch to \"+channel+\", type /join \"+ channel);\n\t\t}\n\t}",
"public void SetChannel(int channel);",
"ChabuChannel getChannel( int channelId );",
"public void gotoManageChannels() throws InterruptedException {\n waitHelper.waitForElementClickable(manageChannels, 120);\n manageChannels.click();\n log.info(\"User has navigated to Manage Channel tab.... \");\n //Sometimes wait for staleness will just time out, unreliable\n //wait.until(ExpectedConditions.stalenessOf(getWhenVisible(channelTypeField)));\n Thread.sleep(3000);\n }",
"void setChannel(java.lang.String channel);",
"java.lang.String getChannel();",
"int getChannel();",
"public void myChannelPressed(View view) {\n\n Intent myChannelIntent = new Intent(AllChannelListActivity.this, UserChannelActivity.class);\n\n myChannelIntent.putExtra(\"userName\", userName);\n startActivity(myChannelIntent);\n\n finish();\n }",
"public void incrementChannel(){\r\n channelNumber += 1;\r\n }",
"public void addChannel(String channel) {\n if (!existsChannel(channel)) {\n channels.add(new Channel(channel, this));\n System.out.println(\"Trying to join channel \" + channel);\n }\n }",
"public void kick(String channel, String userName);",
"public void goToLobby() {\n lobbyTransition.go();\n }",
"public void setChannel(int channel)\r\n {\r\n channelNumber = channel;\r\n }",
"private synchronized void setCurrentChannel(String currentChannel) {\n\n this.currentChannel = currentChannel;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates if the Bishops move set allows it to move from its current location (the Tile it currently is placed on) to the desired location (the given target Tile). This method only checks if the move is possible from the viewpoint of the chess piece. It returns false, if the targeted Tile is either not reachable from its current location or if there are other chess pieces in between the two locations. Bishops can only move diagonally. | @Override
public boolean isValidMove(Tile target, Board board) {
if (target == null || board == null) {
throw new NullPointerException("Arguments for the isValidMove method can not be null.");
}
// current and target tiles have to be on a diagonal (delta between row and col index have to be identical)
int currentCol = this.getTile().getCol();
int currentRow = this.getTile().getRow();
int targetCol = target.getCol();
int targetRow = target.getRow();
int deltaRow = Math.abs(currentRow - targetRow);
int deltaCol = Math.abs(currentCol - targetCol);
int minDelta = Math.min(deltaCol, deltaRow);
boolean sameDiagonal = deltaCol == deltaRow;
// check if there are pieces between the tiles
boolean noPiecesBetween = true;
// Directions -- (Up and to the left) , -+ (Up and to the right), ++, +-
if (targetRow < currentRow && targetCol < currentCol) { // --
for (int delta = 1; delta < minDelta; delta++) {
Tile tileInBetween = board.getTile(currentRow - delta, currentCol - delta);
if (tileInBetween.hasChessPiece()) {
noPiecesBetween = false;
}
}
} else if (targetRow > currentRow && targetCol < currentCol) { // +-
for (int delta = 1; delta < minDelta; delta++) {
Tile tileInBetween = board.getTile(currentRow + delta, currentCol - delta);
if (tileInBetween.hasChessPiece()) {
noPiecesBetween = false;
}
}
} else if (targetRow > currentRow && targetCol > currentCol) { // ++
for (int delta = 1; delta < minDelta; delta++) {
Tile tileInBetween = board.getTile(currentRow + delta, currentCol + delta);
if (tileInBetween.hasChessPiece()) {
noPiecesBetween = false;
}
}
} else if (targetRow < currentRow && targetCol > currentCol) { // -+
for (int delta = 1; delta < minDelta; delta++) {
Tile tileInBetween = board.getTile(currentRow - delta, currentCol + delta);
if (tileInBetween.hasChessPiece()) {
noPiecesBetween = false;
}
}
}
return sameDiagonal && noPiecesBetween;
} | [
"public boolean canMove()\n {\n\t\t// create grid object\n Grid<Actor> gr = getGrid();\n if (gr == null)\n return false;\n Location loc = getLocation();\n // check if next location is \n Location next = loc.getAdjacentLocation(getDirection()).getAdjacentLocation(getDirection());\n if (!gr.isValid(next))\n return false;\n Actor neighbor = gr.get(next);\n return (neighbor == null) || (neighbor instanceof Blossom);\n // ok to move into empty location or onto blossom\n // not ok to move onto any other actor\n }",
"public abstract boolean canMove(Board board, Spot from, Spot to);",
"public boolean isValidMove(Location from, Location to, Piece[][]b) {\n\t\t// Bishop\n\t\tboolean pieceInWay = true;\n\t\tint direction =0; \n\t\tboolean finalLocation = false;\n\t\tboolean verticalUp = false, verticalDown = false, horizontalLeft = false, horizontalRight = false;\n\t\t\n\t\tif(to.getColumn()>from.getColumn() && to.getRow()<from.getRow()){\n\t\t\tdirection = 1;\n\t\t}\n\t\telse if (to.getColumn()<from.getColumn() && to.getRow()>from.getRow()){\n\t\t\tdirection = 2;\n\t\t}\n\t\telse if (to.getColumn()<from.getColumn() && to.getRow()<from.getRow()){\n\t\t\tdirection = 4;\n\t\t}\n\t\telse\n\t\t\tdirection = 3;\t\n\t\t\n\t\t\n\t\tif (Math.abs(from.getColumn() - to.getColumn()) == Math.abs(from.getRow() - to.getRow())\n\t\t\t\t&& b[to.getRow()][to.getColumn()].getPlayer() != getPlayer()\n\t\t\t\t&& !pieceInWay/*b[to.getRow()][to.getColumn()].getPlayer() == 0 b[from.getRow()+1][from.getColumn()+1]*/) {\n\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Rook\n\n\t\t//This line checks to see if the final destination of the piece contains anything but a friendly piece. This is here, because\n\t\t//anything other than a friendly piece would make the move valid, given that every space in between is blank.\n\t\tif(b[to.getRow()][to.getColumn()].getPlayer() != b[from.getRow()][from.getColumn()].getPlayer())\n\t\t\tfinalLocation = true;\n\t\telse\n\t\t\tfinalLocation = false;\n\t\t\n\t\t//verticalUp\n\t\tif(from.getRow() == to.getRow() && from.getColumn() > to.getColumn()){\n\t\t\tverticalUp = true;\n\t\t\tfor(int i = to.getColumn(); i < from.getColumn() && verticalUp; i++){\n\t\t\t\tif(b[to.getRow()][i].getPlayer() == 0 && verticalUp){\n\t\t\t\t\tverticalUp = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tverticalUp = false;\n\t\t\t}\n\t\t}\n\t\t//verticalDown\n\t\telse if(from.getRow() == to.getRow() && from.getColumn() < to.getColumn()){\n\t\t\tverticalDown = true;\n\t\t\tfor(int i = from.getColumn(); i < to.getColumn() && verticalDown; i++){\n\t\t\t\tif(b[from.getRow()][i].getPlayer() == 0 && verticalDown){\n\t\t\t\t\tverticalDown = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tverticalDown = false;\n\t\t\t}\n\t\t}\n\t\t//horizontalLeft\n\t\telse if(from.getColumn() == to.getColumn() && from.getRow() > to.getRow()){\n\t\t\thorizontalLeft = true;\n\t\t\tfor(int i = to.getRow(); i < from.getRow() && horizontalLeft; i++){\n\t\t\t\tif(b[i][to.getColumn()].getPlayer() == 0 && horizontalLeft){\n\t\t\t\t\thorizontalLeft = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\thorizontalLeft = false;\n\t\t\t}\n\t\t}\n\t\t//horizontalRight\n\t\telse if(from.getColumn() == to.getColumn() && from.getRow() < to.getRow()){\n\t\t\thorizontalRight = true;\n\t\t\tfor(int i = from.getRow(); i < to.getRow() && horizontalRight; i++){\n\t\t\t\tif(b[i][from.getColumn()].getPlayer() == 0 && horizontalRight){\n\t\t\t\t\thorizontalRight = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\thorizontalRight = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(verticalUp || verticalDown || horizontalLeft || horizontalRight && finalLocation){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"private boolean possibleMove(){\n\n boolean moveAvailable = false;\n\n //Loop through each block on the board and check 4 possible spaces around it\n for(GameBlock block: blocks){\n int x = block.getCoord()[0];\n int y = block.getCoord()[1];\n int value = block.myValue;\n GameBlock test;\n if((test = isOccupied(x+(int)GameBlock.SQUARE_SIZE, y)) != null && test.myValue == value){\n moveAvailable = true;\n break;\n }\n if((test = isOccupied(x-(int)GameBlock.SQUARE_SIZE, y)) != null && test.myValue == value){\n moveAvailable = true;\n break;\n }\n if((test = isOccupied(x, y-(int)GameBlock.SQUARE_SIZE)) != null && test.myValue == value){\n moveAvailable = true;\n break;\n }\n if((test = isOccupied(x, y+(int)GameBlock.SQUARE_SIZE)) != null && test.myValue == value){\n moveAvailable = true;\n break;\n }\n }\n\n return moveAvailable;\n }",
"boolean legalMove(Move mov) {\n if (mov == null || !validSquare(mov.toIndex())\n || !validSquare(mov.fromIndex())) {\n throw new IllegalArgumentException(\"Illegal move\");\n }\n PieceColor from = get(mov.fromIndex());\n PieceColor to = get(mov.toIndex());\n if (!mov.isJump() && jumpPossible()) {\n return false;\n }\n if (from != _whoseMove) {\n return false;\n } else if (mov.isJump()) {\n return checkJump(mov, false);\n } else if (from == BLACK && row(mov.fromIndex()) == '1') {\n return false;\n } else if (from == WHITE && row(mov.fromIndex()) == '5') {\n return false;\n } else if (mov.isLeftMove()) {\n ArrayList<String> rec = _directions.get(mov.fromIndex());\n return get(mov.toIndex()) == EMPTY\n && !rec.get(rec.size() - 1).equals(\"Right\");\n } else if (mov.isRightMove()) {\n ArrayList<String> rec = _directions.get(mov.fromIndex());\n return get(mov.toIndex()) == EMPTY\n && !rec.get(rec.size() - 1).equals(\"Left\");\n } else if (from == BLACK) {\n if (mov.fromIndex() % 2 == 0 && to == EMPTY) {\n return mov.fromIndex() - mov.toIndex() == SIDE\n || mov.fromIndex() - mov.toIndex() == SIDE - 1\n || mov.fromIndex() - mov.toIndex() == SIDE + 1;\n } else {\n return mov.fromIndex() - mov.toIndex() == SIDE && to == EMPTY;\n }\n } else if (from == WHITE) {\n if (mov.fromIndex() % 2 == 0 && to == EMPTY) {\n return mov.toIndex() - mov.fromIndex() == SIDE\n || mov.toIndex() - mov.fromIndex() == SIDE + 1\n || mov.toIndex() - mov.fromIndex() == SIDE - 1;\n } else {\n return mov.toIndex() - mov.fromIndex() == SIDE && to == EMPTY;\n }\n }\n return false;\n }",
"public boolean canMove2() {\n\t\tGrid<Actor> gr = getGrid(); \n\t\tif (gr == null) {\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\tLocation loc = getLocation(); \n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (!gr.isValid(next)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!gr.isValid(next2)) {\n\t\t\treturn false;\n\t\t}\n\t\tActor neighbor = gr.get(next2); \n\t\treturn (neighbor == null) || (neighbor instanceof Flower); \n\t}",
"public abstract boolean canMove(int originX, int originY, int destX, int destY);",
"private boolean checkValidMoveKnight(Coordinate from, Coordinate to, Board b)\n\t{\n\t\tint fromColumn = from.getColumn();\n\t\tint fromRow = from.getRow();\n\t\tint toColumn = to.getColumn();\n\t\tint toRow = to.getRow();\n\t\t\n\t\tint columnDiff = Math.abs(fromColumn - toColumn);\n\t\tint rowDiff = Math.abs(fromRow - toRow);\n\t\t\n\t\t// Check if the proposed movement is equivalent to a horse movement, aka, an L-shape\n\t\tif (getHypotenuse(columnDiff, rowDiff) == Math.sqrt(2 * 2 + 1))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"protected final boolean canReachEnd() {\n\t\tif (piece == null)\n\t\t\treturn false;\n\t\tint currRow = piece.getCurrentRow() + dx;\n\t\tint currColumn = piece.getCurrentColumn() + dy;\n\t\tint remainingSteps = allowedSteps - 1;\n\t\twhile (remainingSteps >= 0 && currRow >= 0 && currRow < 8 && currColumn >= 0 && currColumn < 8) {\n\t\t\tif (currRow == toRow && currColumn == toColumn)\n\t\t\t\treturn true;\n\t\t\tif (game.getBoard()[currRow][currColumn] != null)\n\t\t\t\tbreak;\n\t\t\tcurrRow = currRow + dx;\n\t\t\tcurrColumn = currColumn + dy;\n\t\t\tremainingSteps--;\n\t\t}\n\t\treturn false;\n\t}",
"private boolean isBishopMove(int from, int to) {\r\n\t\tint i, j;\r\n\t\tint fromRow = from / BOARD_SIZE;\r\n\t\tint toRow = to / BOARD_SIZE;\r\n\t\tint fromCol = from % BOARD_SIZE;\r\n\t\tint toCol = to % BOARD_SIZE;\r\n\t\t// 'from' and 'to' are on the same / diagonal\r\n\t\tif (toRow - fromRow == toCol - fromCol) {\r\n\t\t\tif (toRow < fromRow) {\r\n\t\t\t\t// Move not blocked\r\n\t\t\t\tj = fromCol - 1;\r\n\t\t\t\tfor (i = fromRow - 1; i > toRow; --i) {\r\n\t\t\t\t\tif (pos[i * BOARD_SIZE + j--] != NONE) return false;\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif (fromRow < toRow) {\r\n\t\t\t\t// Move not blocked\r\n\t\t\t\tj = fromCol + 1;\r\n\t\t\t\tfor (i = fromRow + 1; i < toRow; ++i) {\r\n\t\t\t\t\tif (pos[i * BOARD_SIZE + j++] != NONE) return false;\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// 'from' and 'to' are on the same \\ diagonal\r\n\t\tif (toRow - fromRow == fromCol - toCol) {\r\n\t\t\tif (toRow < fromRow) {\r\n\t\t\t\t// Move not blocked\r\n\t\t\t\tj = fromCol + 1;\r\n\t\t\t\tfor (i = fromRow - 1; i > toRow; --i) {\r\n\t\t\t\t\tif (pos[i * BOARD_SIZE + j++] != NONE) return false;\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif (fromRow < toRow) {\r\n\t\t\t\t// Move not blocked\r\n\t\t\t\tj = fromCol - 1;\r\n\t\t\t\tfor (i = fromRow + 1; i < toRow; ++i) {\r\n\t\t\t\t\tif (pos[i * BOARD_SIZE + j--] != NONE) return false;\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"@Test\n public void ableToMoveTest() {\n /*\n At current position and out of bound\n */\n boolean case1 = bishopTestPiece.ableToMove(3, 3);\n assertEquals(case1, false);\n boolean case2 = bishopTestPiece.ableToMove(8, 8);\n assertEquals(case2, false);\n /*\n Possible moving position\n */\n boolean case3 = bishopTestPiece.ableToMove(5, 1);\n assertEquals(case3, true);\n boolean case4 = bishopTestPiece.ableToMove(1, 5);\n assertEquals(case4, true);\n boolean case5 = bishopTestPiece.ableToMove(1, 1);\n assertEquals(case5, true);\n boolean case6 = bishopTestPiece.ableToMove(5, 5);\n assertEquals(case6, true);\n /*\n Not possible moving position\n */\n boolean case7 = bishopTestPiece.ableToMove(0, 3);\n assertEquals(case7, false);\n boolean case8 = bishopTestPiece.ableToMove(6, 3);\n assertEquals(case8, false);\n boolean case9 = bishopTestPiece.ableToMove(3, 0);\n assertEquals(case9, false);\n boolean case10 = bishopTestPiece.ableToMove(3, 6);\n assertEquals(case10, false);\n\n }",
"public boolean isMoveLegal(Square desiredLocationToMove) {\n Square currentLocationOnBoard = getLocationOnBoard();\n\n return moveChecker.isKnightMove(currentLocationOnBoard, desiredLocationToMove);\n }",
"public static boolean canMove(Board board, int[] locCurrentTile, Direction moveDirection){\n \n boolean canMoveDirection = false;\n int board_size = board.tiles.length;\n Tile moveToTile;\n Tile currentTile = board.tiles[locCurrentTile[0]][locCurrentTile[1]];\n\n // If the current tile has a path up and it is not on the top row\n if (moveDirection ==\n Direction.up &&\n currentTile.up &&\n locCurrentTile[0] > 0){\n\n moveToTile = board.tiles[locCurrentTile[0] - 1][locCurrentTile[1]];\n\n if (moveToTile.down){\n canMoveDirection = true;\n }\n }\n\n // If the current tile has a path right and it is not on the right column\n else if (moveDirection ==\n Direction.right &&\n currentTile.right &&\n locCurrentTile[1] < board_size-1){\n\n moveToTile = board.tiles[locCurrentTile[0]][locCurrentTile[1] + 1];\n\n if (moveToTile.left){\n canMoveDirection = true;\n }\n }\n\n // If the current tile has a path down and it is not on the bottom row\n else if (moveDirection ==\n Direction.down &&\n currentTile.down &&\n locCurrentTile[0] < board_size-1){\n\n moveToTile = board.tiles[locCurrentTile[0] + 1][locCurrentTile[1]];\n\n if (moveToTile.up){\n canMoveDirection = true;\n }\n }\n\n // If the current tile has a path left and it is not on the left column\n else if (moveDirection ==\n Direction.left &&\n currentTile.left &&\n locCurrentTile[1] > 0){\n\n moveToTile = board.tiles[locCurrentTile[0]][locCurrentTile[1] - 1];\n\n if (moveToTile.right){\n canMoveDirection = true;\n }\n }\n return canMoveDirection;\n }",
"public boolean canMove() {\n\t\t\n\t\t\t// for a simple pawn this is just Board.canMoveSimple()\n\t\treturn Board.getInstance().canMoveSimple(this.position, 0);\n\t\t\n\t}",
"boolean canMove(Tile t);",
"private boolean validMove(int xi, int yi, int xf, int yf){\n if(outOfBounds(xf, 0, boardSize) || outOfBounds(yf, 0, boardSize)) //ensures off-board locations can't be moved to\n return false;\n Piece moving = pieceAt(xi, yi);\n if(!sameTeam(moving)) return false; //can't move opponent's pieces\n int perspective = 1 - 2*moving.side(); //water moves down, fire moves up\n int dX = xf - xi, dY = yf - yi; \n if(Math.abs(dX) != Math.abs(dY)) return false; //must move diagonally\n if(dX == 0) return false; //can't move nowhere\n boolean baseChecks = pieceAt(xf, yf) == null; //can't move onto another piece\n if(dY*perspective < 0){ //trying to move relatively backwards\n baseChecks = baseChecks && moving.isKing(); //must be kinged\n }\n if(Math.abs(dX) == 1) return baseChecks; //regular move\n else if(Math.abs(dX) == 2) return baseChecks && canTake(xi + dX / 2, yi + dY / 2); //must be capturing to move 2\n else return false; //must move 1 or 2 spaces\n\n }",
"private boolean checkValidMovePawn(ChessPiece piece, Coordinate from, Coordinate to, Board b)\n\t{\n\t\tint fromColumn = from.getColumn();\n\t\tint fromRow = from.getRow();\n\t\tint toColumn = to.getColumn();\n\t\tint toRow = to.getRow();\n\t\t\n\t\tint columnDiff = Math.abs(fromColumn - toColumn);\n\t\tint rowDiff = Math.abs(fromRow - toRow);\n\t\tdouble hypotenuse = getHypotenuse(columnDiff, rowDiff);\n\t\tCoordinate nextSpace;\n\t\tCoordinate twoSpacesAway;\n\t\t\n\t\t// Pawn can't move if it reaches the end of the board\n\t\tif (fromRow == 1 || fromRow == 8) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Pawn can't move more than 2 spaces forward or 1 space diagonally\n\t\tif (rowDiff > 2 || (hypotenuse > Math.sqrt(2) && fromColumn != toColumn)) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Row numbers are different based on pawn color\n\t\tswitch (piece.getColor()) \n\t\t{\n\t\t\tcase WHITE:\n\t\t\t\t// Cannot move backwards or sideways\n\t\t\t\tif ((fromRow > toRow || toColumn != fromColumn) && fromRow >= toRow) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Get adjacent spaces on the board\n\t\t\t\tnextSpace = makeCoordinate(fromColumn, fromRow + 1);\n\t\t\t\ttwoSpacesAway = makeCoordinate(fromColumn, fromRow + 2);\n\n\t\t\t\t// Pawns are able to move forward two spaces if they are on their starting position\n\t\t\t\tif (!piece.hasMoved && rowDiff == 2 && !b.isSpaceOccupied(nextSpace)\n\t\t\t\t\t&& !b.isSpaceOccupied(twoSpacesAway) && fromColumn == toColumn) \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Otherwise, they move only one space\n\t\t\t\tif (fromRow >= 2 && rowDiff == 1 && !b.isSpaceOccupied(nextSpace)\t&& fromColumn == toColumn) \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Able to capture an opponent piece that is diagonally left or right forward one space\n\t\t\t\tif (b.isSpaceOccupied(to) && toRow == fromRow + 1 && (toColumn == fromColumn + 1 || toColumn == fromColumn - 1)) \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BLACK:\n\t\t\t\t// Cannot move backwards or sideways\n\t\t\t\tif ((fromRow < toRow || toColumn != fromColumn) && fromRow <= toRow) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Get adjacent spaces on the board\n\t\t\t\tnextSpace = makeCoordinate(fromColumn, fromRow - 1);\n\t\t\t\ttwoSpacesAway = makeCoordinate(fromColumn, fromRow - 2);\n\n\t\t\t\t// Pawns are able to move forward two spaces if they are on their starting position\n\t\t\t\tif (!piece.hasMoved && rowDiff == 2 && !b.isSpaceOccupied(nextSpace)\n\t\t\t\t\t&& !b.isSpaceOccupied(twoSpacesAway) && fromColumn == toColumn) \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Otherwise, they move only one space\n\t\t\t\tif (fromRow >= 2 && rowDiff == 1 && !b.isSpaceOccupied(nextSpace)\t&& fromColumn == toColumn) \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Able to capture an opponent piece that is diagonally left or right forward one space\n\t\t\t\tif (b.isSpaceOccupied(to) && toRow == fromRow - 1 && (toColumn == fromColumn + 1 || toColumn == fromColumn - 1)) \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t}\n\t\treturn false;\n\t}",
"public static boolean move() {\n S.rc.setIndicatorString(2, \"move\");\n if (target == null) {\n System.err.println(\"ERROR: tried to move without target\");\n return false;\n }\n\n // Check if we are close enough.\n int distanceSqToTarget = S.rc.getLocation().distanceSquaredTo(target);\n if (distanceSqToTarget <= thresholdDistanceSq) {\n // Stop bugging.\n start = null;\n S.rc.setIndicatorString(2, \"close enough\");\n return moveCloserToTarget();\n }\n\n if (start == null) {\n // Not currently bugging.\n forward = S.rc.getLocation().directionTo(target);\n S.rc.setIndicatorString(2, \"not buggin\");\n if (moveForwardish()) return true;\n // Start bugging.\n start = S.rc.getLocation();\n forward = forward.rotateRight().rotateRight();\n return move();\n } else {\n // Already bugging.\n // Stop bugging if we got closer to the target than when we started bugging.\n if (distanceSqToTarget < start.distanceSquaredTo(target)) {\n start = null;\n return move();\n }\n\n // Stop bugging if back-left is clear.\n // This means that we must have bugged around something that has since moved.\n if (canMove(forward.rotateLeft().rotateLeft().rotateLeft())) {\n start = null;\n forward = S.rc.getLocation().directionTo(target);\n S.rc.setIndicatorString(2, \"back left clear, forward \" + forward);\n return moveForwardish();\n }\n\n S.rc.setIndicatorString(2, \"scan circle\");\n forward = forward.rotateLeft().rotateLeft();\n // Try moving left, and try every direction in a circle from there.\n for (int i = 0; i < 8; i++) {\n if (moveForwardStrict()) return true;\n forward = forward.rotateRight();\n }\n return false;\n }\n }",
"public boolean checkForPossibleMoves()\n\n\t{\n\t\tfor (int row = 1; row < NO_OF_ROWS; row++)\n\t\t\tfor (int column = 1; column < NO_OF_COLUMNS; column++)\n\n\t\t\t{\n\t\t\t\t// two connected horizontally\n\t\t\t\tif (board[row][column] == board[row][column + 1]\n\t\t\t\t\t\t&& (board[row - 1][column + 2] == board[row][column] // upper-right\n\t\t\t\t\t\t\t\t|| board[row + 1][column + 2] == board[row][column] // lower-right\n\t\t\t\t\t\t\t\t|| board[row - 1][column - 1] == board[row][column] // upper-left\n\t\t\t\t\t\t\t\t|| board[row + 1][column - 1] == board[row][column] // lower-left\n\t\t\t\t\t\t\t\t|| column + 3 <= NO_OF_COLUMNS\n\t\t\t\t\t\t\t\t&& board[row][column + 3] == board[row][column] // right\n\t\t\t\t\t\t|| column - 2 >= 1\n\t\t\t\t\t\t\t\t&& board[row][column - 2] == board[row][column] // left\n\t\t\t\t\t\t))\n\t\t\t\t\treturn true;\n\n\t\t\t\t// one between two\n\t\t\t\tif (board[row][column] == board[row][column + 2]\n\t\t\t\t\t\t&& (board[row - 1][column + 1] == board[row][column] // upper\n\t\t\t\t\t\t|| board[row + 1][column + 1] == board[row][column] // lower\n\t\t\t\t\t\t))\n\t\t\t\t\treturn true;\n\n\t\t\t\t// two connected vertically\n\t\t\t\tif (board[row][column] == board[row + 1][column]\n\t\t\t\t\t\t&& (board[row - 1][column + 1] == board[row][column] // upper-right\n\t\t\t\t\t\t\t\t|| board[row + 2][column + 1] == board[row][column] // lower-right\n\t\t\t\t\t\t\t\t|| board[row - 1][column - 1] == board[row][column] // upper-left\n\t\t\t\t\t\t\t\t|| board[row + 2][column - 1] == board[row][column] // lower-left\n\t\t\t\t\t\t\t\t|| row - 2 >= 1\n\t\t\t\t\t\t\t\t&& (board[row - 2][column] == board[row][column])// upper\n\t\t\t\t\t\t|| row + 3 <= NO_OF_ROWS\n\t\t\t\t\t\t\t\t&& (board[row + 3][column] == board[row][column])// lower\n\t\t\t\t\t\t))\n\t\t\t\t\treturn true;\n\n\t\t\t\t// one between two\n\t\t\t\tif (board[row][column] == board[row + 2][column]\n\t\t\t\t\t\t&& (board[row + 1][column + 1] == board[row][column] // right\n\t\t\t\t\t\t|| board[row - 1][column - 1] == board[row][column] // left\n\t\t\t\t\t\t))\n\t\t\t\t\treturn true;\n\n\t\t\t}\n\t\treturn false;\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
waits for broadcast from the master which tells his ip | public void catchMasterIp() throws IOException{
DatagramSocket dataSocket = new DatagramSocket(1861);
byte[] buf = new byte[1024];
DatagramPacket packet = new DatagramPacket(buf, buf.length);
dataSocket.receive(packet);
serverIp = new String(packet.getData());
dataSocket.close();
print("Master ip is "+serverIp);
} | [
"public void broadcast(){\r\n Settings settings = Settings.getInstance();\r\n try {\r\n Enumeration<NetworkInterface> it = NetworkInterface.getNetworkInterfaces();\r\n while(it.hasMoreElements()){\r\n for(InterfaceAddress address : it.nextElement().getInterfaceAddresses()){\r\n\r\n //ignore loopback interface and IPv6\r\n if (address.getAddress().getAddress()[0] != 127 && address.getBroadcast() != null){\r\n System.out.println(String.format(\"broadcasting on %s\", address.getBroadcast()));\r\n\r\n DatagramPacket packet = new DatagramPacket(\r\n Constants.BEACON_MESSAGE.getBytes(),\r\n Constants.BEACON_MESSAGE.length(),\r\n address.getBroadcast(),\r\n settings.getTCPPort());\r\n socket.send(packet);\r\n }\r\n }\r\n }\r\n }\r\n catch (IOException ex){\r\n ex.printStackTrace();\r\n }\r\n }",
"public void run() {\n\t\t\t\tInetAddress bAddr = AndyNet.getBroadcastIP(activity);\n\t\t\t\tLog.i(TAG, \"Broadcast Address: \" + bAddr.getHostAddress());\n\t\t\t\tif (bAddr != null) {\n\t\t\t\t\tAndyNet.startBroadcast(AndyMaster.getName(), 0, bAddr);\n\t\t\t\t}\n\n\t\t\t}",
"private void getServerIP() throws IOException, SocketTimeoutException{\r\n\t\t//socket used to broadcast with a 3 second timeout exception\r\n\t\tDatagramSocket c = new DatagramSocket();\r\n\t\tc.setBroadcast(true);\r\n\t\tc.setSoTimeout(3000);\r\n\t\t\t\r\n\t\tbyte[] sendData = Protocal.CONNECT.getBytes();\t\r\n\t\t\r\n\t\t// Broadcast the message over all the network interfaces\r\n\t\tEnumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();\r\n\t\t\t\t\r\n\t\twhile (interfaces.hasMoreElements()) {\r\n\t\t\tNetworkInterface networkInterface = (NetworkInterface) interfaces.nextElement();\r\n\t\t\t\r\n\t\t\tif (networkInterface.isLoopback() || !networkInterface.isUp()) \r\n\t\t\t\tcontinue;//Don't want to broadcast to loopback or network interfaces that are down\r\n\t\t\t\r\n\t\t\tfor (InterfaceAddress interfaceAddress : networkInterface.getInterfaceAddresses()) {\r\n\t\t\t\tInetAddress broadcast = interfaceAddress.getBroadcast();\r\n\t\t\t\t\r\n\t\t\t\tif(broadcast == null)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t\r\n\t\t\t\t//send the broadcast packet if the broadcast is not null\r\n\t\t\t\tDatagramPacket sendPacket = new DatagramPacket\r\n\t\t\t\t\t\t(sendData, sendData.length, broadcast, portNumber);\r\n\t\t\t\tc.send(sendPacket);\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t}\t\t\r\n\t\t\r\n\t\tgui.connectionLog(\"Done looping over all network interfaces. Now waiting for a reply..\");\r\n\t\t\r\n\t\tbyte recieveBuffer[] = new byte[1024*1024];\r\n\t\tDatagramPacket receivePacket = new DatagramPacket(recieveBuffer, recieveBuffer.length);\r\n\t\t\r\n\t\tc.receive(receivePacket);\t\t\r\n\t\t\r\n\t\tgui.connectionLog(\"Broadcast response from server: \" + receivePacket.getAddress().getHostAddress());\r\n\t\t//check if message is correct\r\n\t\tString message = new String(receivePacket.getData()).trim();\r\n\t\t\r\n\t\t//Test if the server returned the correct message and if so set the host ip to that machine\r\n\t\tif (message.equals(Protocal.CONNECT)) {\r\n\t\t\t//set hostIP\r\n\t\t\thostIP = receivePacket.getAddress().getHostAddress();\r\n\t\t}\t\t\r\n\t\t//close discovery port\r\n\t\tc.close();\r\n\t}",
"protected void sendBroadcast() {\n printWriter.println(\"SERVER_BROADCAST: \" + new Date());\n }",
"public static void broadcastName(final String action, final String name,\n final InetAddress broadcastIP) {\n Log.i(LOG_TAG, \"Broadcasting started!\");\n BROADCAST = true;\n broadcastThread = new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n String request = action + name;\n byte[] message = request.getBytes();\n DatagramSocket socket = new DatagramSocket();\n socket.setBroadcast(true);\n DatagramPacket packet = new DatagramPacket(message, message.length, broadcastIP, DISCOVER_PORT);\n while(BROADCAST) {\n socket.send(packet);\n Log.i(LOG_TAG, \"Broadcast packet sent: \" + packet.getAddress().toString());\n Thread.sleep(BROADCAST_INTERVAL);\n }\n Log.i(LOG_TAG, \"Broadcaster ending!\");\n socket.disconnect();\n socket.close();\n }\n catch(SocketException e) {\n Log.e(LOG_TAG, \"SocketExceltion in broadcast: \" + e);\n Log.i(LOG_TAG, \"Broadcaster ending!\");\n }\n catch(IOException e) {\n Log.e(LOG_TAG, \"IOException in broadcast: \" + e);\n Log.i(LOG_TAG, \"Broadcaster ending!\");\n }\n catch(InterruptedException e) {\n Log.e(LOG_TAG, \"InterruptedException in broadcast: \" + e);\n Log.i(LOG_TAG, \"Broadcaster ending!\");\n }\n }\n });\n broadcastThread.start();\n }",
"private void serverBroadcast()\n\t{\n\t\tServerAnnounceMessage message = new ServerAnnounceMessage(serverID,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t numberOfLoggedInUsers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Settings.getLocalHostname(), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Settings.getLocalPort()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\n\t\tfor(Connection con: getConnections())\n\t\t{\n\t\t\tif(connectionType.get(con) == ConnectionType.SERVER)\n\t\t\t{\n\t\t\t\tcon.writeMsg(message.messageToString());\n\t\t\t}\n\t\t}\n\t}",
"public void startServerBroadcast() { \r\n if(running) {\r\n return;\r\n } \r\n running = true;\r\n byte[] buffer = initCode.getBytes();\r\n try {\r\n start();\r\n InetAddress broadcastAddress = InetAddress.getByName(\"255.255.255.255\");\r\n DatagramPacket packet = new DatagramPacket(buffer, buffer.length, broadcastAddress, udpServerPortNb);\r\n socket.send(packet);\r\n } catch(Exception e) {\r\n System.out.println(e.getMessage());\r\n }\r\n responseListenTimer = new Timer(responseWaitTime, new ActionListener() {\r\n @Override\r\n public void actionPerformed(ActionEvent e) {\r\n stopServer(); \r\n }\r\n });\r\n responseListenTimer.setRepeats(false);\r\n responseListenTimer.start();\r\n }",
"public void update_self() { \r\n\r\n\t\tPRIMARY_SERVER_IP = null; \r\n\t\tPRIMARY_SERVER_PORT = -1; \r\n\t\tisPrimary = true; \r\n\t\treportFailure = true;\r\n\r\n\t\t// replicate to other servers including bootstrap\r\n\t\tSet<String> key = IPADDRESS_TABLE.keySet(); \r\n\t\tIterator<String> it = key.iterator(); \r\n\t\ttry { \r\n\r\n\t\t\tbyte[] sendData = new byte[size];\r\n\t\t\tsendData = NewPrimary.getBytes();\r\n\r\n\t\t\t// send to bootstrap server\r\n\t\t\tInetAddress IPAddress = InetAddress.getByName(BOOTSTRAP_IP); \r\n\t\t\tDatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, IPAddress, BOOTSTRAP_PORT); \r\n\t\t\tserverSocket.send(sendPacket); \r\n\r\n\t\t\twhile (it.hasNext()) { \r\n\t\t\t\tString ip = it.next(); \r\n\t\t\t\tString ip_port[] = ip.split(COLON); \r\n\r\n\t\t\t\t// if IP address in the list is not its own then broadcast \r\n\t\t\t\tInetAddress myAddress = InetAddress.getLocalHost(); \r\n\t\t\t\tif (!ip_port[0].equalsIgnoreCase(myAddress.getHostAddress())) { \r\n\t\t\t\t\t// broadcast to other active servers\r\n\t\t\t\t\tIPAddress = InetAddress.getByName(ip_port[0]); \r\n\t\t\t\t\tint port = Integer.parseInt(ip_port[1]); \r\n\t\t\t\t\tsendPacket = new DatagramPacket(sendData, sendData.length, IPAddress, port); \r\n\t\t\t\t\tserverSocket.send(sendPacket); \r\n\t\t\t\t} \r\n\t\t\t} \r\n\t\t} catch (Exception e) { \r\n\t\t\t//\t\t\te.printStackTrace(); \r\n\t\t} \r\n\t}",
"public void broadcastStart() {\n\t\t\t_clients.broadcast(\"START\\n\");\n\t}",
"@Override\n public void run() {\n \t\n Set<InetAddress> localAddresses = NetUtil.getLocalAddresses();\n MulticastLock multicastLock = null;\n \n // initialize the network\n try {\n networkInterface = netUtil.getFirstWifiOrEthernetInterface();\n if (networkInterface == null) {\n throw new IOException(\"Your WiFi is not enabled.\");\n }\n groupAddress = InetAddress.getByAddress(MDNS_ADDR); \n\n multicastLock = netUtil.getWifiManager().createMulticastLock(\"unmote\");\n multicastLock.acquire();\n } catch (IOException e) {\n activity.ipc.setStatus(\"Your WiFi is not enabled.\");\n activity.ipc.error(e);\n return;\n }\n \n try {\n \topenAylaSocket();\n } catch (IOException e) {\n \te.printStackTrace();\n activity.ipc.setStatus(\"cannot initialize ayla socket.\");\n activity.ipc.error(e);\n return;\n }\n \n try {\n \topenStandardMDSSocket();\n } catch (IOException e) {\n \te.printStackTrace();\n activity.ipc.setStatus(\"cannot initialize standard DNS socket.\");\n activity.ipc.error(e);\n return;\n }\n\n // set up the buffer for incoming packets\n byte[] responseBuffer = new byte[BUFFER_SIZE];\n DatagramPacket response = new DatagramPacket(responseBuffer, BUFFER_SIZE);\n\n byte[] responseBuffer2 = new byte[BUFFER_SIZE];\n DatagramPacket response2 = new DatagramPacket(responseBuffer2, BUFFER_SIZE);\n \n // loop!\n while (true) {\n // zero the incoming buffer for good measure.\n java.util.Arrays.fill(responseBuffer, (byte) 0); // clear buffer\n \n java.util.Arrays.fill(responseBuffer2, (byte) 0); // clear buffer \n // receive a packet (or process an incoming command)\n try {\n \tif (mMulticastAylaSocket != null) {\n \t\tmMulticastAylaSocket.receive(response);\n \t}\n \n if (mMulticastStdSocket != null) {\n \tmMulticastStdSocket.receive(response2);\n }\n } catch (IOException e) {\n // check for commands to be run\n Command cmd = commandQueue.poll();\n if (cmd == null) {\n activity.ipc.error(e);\n return;\n }\n // reopen the socket\n try {\n //First close the socket in case it is still open\n closeAylaSocket();\n openAylaSocket(); \n } catch (IOException e1) {\n activity.ipc.error(new RuntimeException(\"socket reopen: \"+e1.getMessage()));\n return;\n }\n \n try {\n //First close the socket in case it is still open\n closemMulticastStdSocket();\n openStandardMDSSocket(); \n } catch (IOException e1) {\n activity.ipc.error(new RuntimeException(\"socket reopen: \"+e1.getMessage()));\n return;\n }\n \n // process commands\n if (cmd instanceof QueryCommand) {\n try {\n query(((QueryCommand)cmd).host);\n } catch (IOException e1) {\n activity.ipc.error(e1);\n }\n } else if (cmd instanceof QuitCommand) {\n break;\n }\n continue;\n }\n // Ignore our own packet transmissions.\n if ( !localAddresses.contains(response.getAddress()) ) {\n \t// parse the DNS packet\n DNSMessage message;\n try {\n message = new DNSMessage(response.getData(), response.getOffset(), response.getLength());\n // send the packet to the UI\n Packet packet = new Packet(response, mMulticastAylaSocket);\n packet.description = message.toString().trim();\n activity.ipc.addPacket(packet);\n } catch (Exception e) {\n activity.ipc.error(e);\n continue;\n }\n }// end of localAddresses.response \n \n \n if ( !localAddresses.contains(response2.getAddress()) ) {\n \t// parse the DNS packet\n DNSMessage message;\n try {\n message = new DNSMessage(response2.getData(), response2.getOffset(), response2.getLength());\n // send the packet to the UI\n Packet packet = new Packet(response2, mMulticastStdSocket);\n packet.description = message.toString().trim();\n activity.ipc.addPacket(packet);\n } catch (Exception e) {\n activity.ipc.error(e);\n continue;\n }\n }// end of localAddresses.response2 \n \n }// end of true loop \n // release the multicast lock\n multicastLock.release();\n multicastLock = null;\n }",
"private void broadcastRequestMessage() throws Exception{\n byte[] sendData;\n InetAddress broadcastIP = InetAddress.getByName(\"255.255.255.255\");\n sendData = createRequestMessage();\n udpSocket.send(new DatagramPacket(sendData, sendData.length, broadcastIP, udpPort));\n logger.info(\"Sending request message via udp broadcast. Message: \" + getMessage(sendData) + \", Port: \" + udpPort);\n }",
"public InetAddress getBroadcastAddress() {\r\n InetAddress ip=null;\r\n try{\r\n WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\r\n DhcpInfo dhcp = wifi.getDhcpInfo();\r\n int broadcast = (dhcp.ipAddress & dhcp.netmask) | ~dhcp.netmask;\r\n byte[] quads = new byte[4];\r\n for (int k = 0; k < 4; k++)\r\n quads[k] = (byte) (broadcast >> (k * 8));\r\n ip= InetAddress.getByAddress(quads);\r\n }catch(IOException e)\r\n {\r\n\r\n }\r\n\r\n return ip;\r\n }",
"public void broadcast_neighborhood() {\n\t\tthis.sim.local_broadcast(this.address, this.message_buffer.clone());\t\t\n\t}",
"private static void _startBroadcasting(){\n\t\t //We will broadcast two different services:\n\t\t //A junglejepps service and an http service.\n\t\t //This way our client application can connect uniquely to it\n\t\t //and other http service discoveries can use it to see our public \n\t\t //http site, \"http://<host>:<port>/repository/\"\n\t\t ServiceInfo jjtpService, httpService;\n\n\t\t //If we do not have a JmDNS created yet, make one\n\t\t if(broadcasting == null)\n\t\t\ttry {\n\t\t\t\tbroadcasting = JmDNS.create();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn;\n\t\t\t}\t\t \n\t\t \n\t\ttry \n\t\t{\n\t\t\t// Assign service name and info\n\t\t\tjjtpService = ServiceInfo.create(PROPRIETARY_MDNS_SERVICE_TYPE, MDNS_SERVICE_NAME_PRETTY, SERVER_PORT, MDNS_SERVICE_NAME);\n\t\t\thttpService = ServiceInfo.create(HTTP_MDNS_SERVICE_TYPE, MDNS_SERVICE_NAME_PRETTY, SERVER_PORT, MDNS_SERVICE_NAME);\n\n\t\t\t// Register service and broadcast over LAN\n\t\t\tSystem.out.println(\"Registering service and starting broadcast...\");\n\t\t\tbroadcasting.registerService( jjtpService );\n\t\t\tbroadcasting.registerService( httpService );\n\t\t}\n\t\tcatch(IOException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t }",
"private void sendPingMessages() {\n List<ID> members = lastView.getMembers();\n for (ID addr : members) {\n if (!receivedAcks.contains(addr)) {\n JGAddress dest = new JGAddress(addr);\n if (isInfoEnabled) {\n logger.info(\"quorum check: sending request to {}\", addr);\n }\n try {\n pingPonger.sendPingMessage(channel, myAddress, dest);\n } catch (Exception e) {\n logger.info(\"Failed sending Ping message to \" + dest);\n }\n }\n }\n }",
"private void ping()\n {\n pinged = false;\n if(client != null){client.send_message(\"{\\\"type\\\": \\\"PING\\\"}\");}\n }",
"private void sendtoAllClients(Map<String, Object> exe_result) {\r\n\t\tfor(ClientNode client : Server.servernodes.getClients()){\r\n\t\t\tfor(Connection con : Server.connections){\r\n\t\t\t\tif(client.equals(con.cAddress, con.cPort)){\r\n\t\t\t\t\t//there, the broadcast message will be sent to all\r\n\t\t\t\t\t// clients of THIS NODE.\r\n\t\t\t\t\t//if the source is client, it will receive the broadcast\r\n\t\t\t\t\t// as well. if the source is a server, it will not\r\n\t\t\t\t\t// receive any message.\r\n\t\t\t\t\tcon.send(exe_result);\r\n\t\t\t\t\tLogger.info(\"A message has been sent to all clients.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void broadcastRequest() {\n N.set(index, N.get(index) + 1);\n LOGGER.debug(\"(\" + index + \") broadcasting request\");\n LOGGER.trace(\"(\" + index + \") N: \" + N);\n for (String url : urls) {\n DA_Suzuki_Kasami_RMI dest = getProcess(url);\n try {\n RequestMessage rm = new RequestMessage(urls[index], index, N.get(index));\n dest.receiveRequest(rm);\n } catch (RemoteException e) {\n throw new RuntimeException(e);\n }\n }\n }",
"private void discoverServer() {\n DhcpInfo dhcpInfo = ((WifiManager) activity.getApplicationContext().getSystemService(Context.WIFI_SERVICE)).getDhcpInfo();\n\n int minIp, maxIp;\n int deviceIp = dhcpInfo.ipAddress;\n int mask = dhcpInfo.netmask;\n int maskCode = 1;\n\n if (ByteOrder.nativeOrder().equals(ByteOrder.LITTLE_ENDIAN)) {\n deviceIp = Integer.reverseBytes(deviceIp);\n mask = Integer.reverseBytes(mask);\n }\n\n for (; maskCode <= 4 * 8; maskCode++) {\n if (((mask >> maskCode) & 1) == 1)\n break;\n }\n\n minIp = deviceIp & mask;\n maxIp = (Integer.MAX_VALUE >> (8 * 4 - maskCode - 1)) | minIp;\n\n RequestQueue queue = Volley.newRequestQueue(activity);\n\n for (int i = minIp; i < maxIp && serverIp == null; i++) {\n StringRequest stringRequest = new StringRequest(com.android.volley.Request.Method.GET, \"http://\" + getIp(i) + \":\" + port + \"/identify\", this, this);\n queue.add(stringRequest);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds the predicate does not contain ignore case to the selector for the given field and value. | @UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})
SelectorBuilderInterface<SelectorT> doesNotContainIgnoreCase(String field, String propertyValue); | [
"@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER, AdsUtility.SELECTOR_FIELD})\n SelectorBuilderInterface<SelectorT> doesNotContainIgnoreCase(\n EntityField field, String propertyValue);",
"@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER, AdsUtility.SELECTOR_FIELD})\n SelectorBuilderInterface<SelectorT> containsIgnoreCase(EntityField field, String propertyValue);",
"@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})\n SelectorBuilderInterface<SelectorT> containsIgnoreCase(String field, String propertyValue);",
"public static FieldMatcher ignoreCase() {\n return (columnName, recordOneField, recordTwoField) -> {\n //we do not want to do a case-insensitive comparison for the key and for case-sensitive columns\n if (!caseSensitiveColumns.contains(columnName) && !columnName.equals(keyColumn)) {\n return recordOneField.equalsIgnoreCase(recordTwoField);\n } else {\n return recordOneField.equals(recordTwoField);\n }\n };\n }",
"@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER, AdsUtility.SELECTOR_FIELD})\n SelectorBuilderInterface<SelectorT> notEquals(EntityField field, String propertyValue);",
"@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER, AdsUtility.SELECTOR_FIELD})\n SelectorBuilderInterface<SelectorT> doesNotContain(EntityField field, String propertyValue);",
"public void setIgnoreCase(boolean aVal) { _ignoreCase = aVal; }",
"@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})\n SelectorBuilderInterface<SelectorT> notEquals(String field, String propertyValue);",
"@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER, AdsUtility.SELECTOR_FIELD})\n SelectorBuilderInterface<SelectorT> contains(EntityField field, String propertyValue);",
"@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER, AdsUtility.SELECTOR_FIELD})\n SelectorBuilderInterface<SelectorT> notIn(EntityField field, String... values);",
"protected String prepLikeOperand(final String value, final boolean caseInsensitive) {\n if (CaseSensitivity.SENSITIVE == caseSensitivity && caseInsensitive) {\n return format(\" UPPER(%s) \", value);\n } else {\n return value;\n }\n }",
"public static BiPredicate<String,String> getIgnoreCase(){\n if(IgnoreCase.obj==null){\n synchronized(IgnoreCase.class){\n if(IgnoreCase.obj==null)\n IgnoreCase.obj=new IgnoreCase();\n }\n }\n return IgnoreCase.obj;\n }",
"@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})\n SelectorBuilderInterface<SelectorT> contains(String field, String propertyValue);",
"@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})\n SelectorBuilderInterface<SelectorT> notIn(String field, String... values);",
"public CharSequenceFilter addContainsIgnoreCase(CharSequence... partialText) {\n mCachedToString = null;\n for (CharSequence item : partialText) {\n mContainsIgnoreCase.add(item.toString().toLowerCase());\n }\n return this;\n }",
"@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER, AdsUtility.SELECTOR_FIELD})\n SelectorBuilderInterface<SelectorT> in(EntityField field, String... values);",
"public FieldPredicate(String fieldName) {\n this.fieldName = fieldName;\n }",
"public void setIgnoreCase(boolean ignoreCase)\r\n\t{\r\n\t\tthis.ignoreCase = ignoreCase;\r\n\t}",
"@PublicAtsApi\n public void checkFieldValueDoesNotContain(\n String tableName,\n String fieldName,\n String value ) {\n\n DbStringFieldRule matchingRule = new DbStringFieldRule(tableName,\n fieldName,\n value,\n DbStringFieldRule.MatchRelation.CONTAINS,\n \"checkFieldValueDoesNotContain\",\n false);\n matchingRule.setDbEncryptor(dbEncryptor);\n checkFieldValue(matchingRule);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a set of values consisting of 1 keyvalue pair using the specified value. The key associated with the value is the number 0. value: The value to use to create the keyvalue pair. | private void createSingleValueSet(final double value)
{
m_mockery.checking(new Expectations()
{
{
allowing(m_values).getItemCount();
will(returnValue(1));
allowing(m_values).getValue(0);
will(returnValue(value));
allowing(m_values).getKey(0);
will(returnValue(0));
allowing(m_values).getIndex(0);
will(returnValue(0));
allowing(m_values).getKeys();
will(returnValue(new ArrayList<Integer>().add(0)));
}
});
} | [
"@Override\n public void makeSet(int value) {\n allNodes.put(value, new Node(value));\n }",
"public KeyVal(V value) {\n\t\tk = new InfKey();\n\t\tv = value;\n\t}",
"public static <V> ReadableIdentitySet<V> singleton(final V value) {\n Preconditions.checkNotNull(value, \"Can not create singleton of null\");\n return new ReadableIdentitySet<V>() {\n @Override\n public boolean contains(V s) {\n // Note that == is used, not .equals(), because this is an identity set.\n return value == s;\n }\n\n @Override\n public int countEntries() {\n return 1;\n }\n\n @Override\n public void each(Proc<? super V> procedure) {\n procedure.apply(value);\n }\n\n @Override\n public V someElement() {\n return value;\n }\n\n @Override\n public boolean isEmpty() {\n return false;\n }\n };\n }",
"public static TransactionState forValue(int value) {\n return values()[value];\n }",
"public void add(int value) {\n short key = Util.highbits(value);\n short low = Util.lowbits(value);\n if (key != currentKey) {\n if (Util.compareUnsigned(key, currentKey) < 0) {\n throw new IllegalStateException(\"Must write in ascending key order\");\n }\n flush();\n }\n int ulow = low & 0xFFFF;\n bitmap[(ulow >>> 6)] |= (1L << ulow);\n currentKey = key;\n dirty = true;\n }",
"public SharedSpaceSet createNodeIdCondition(String value)\n {\n SharedSpaceSet result = new SharedSpaceSet();\n \n for (SharedSpace obj : this)\n {\n if (value.equals(obj.getNodeId()))\n {\n result.add(obj);\n }\n }\n \n return result;\n }",
"public double makeset(int value){\n\tdouble price = 0;\n\tint ssset = maxset(value);\n\t\n\t// form the set of the distinct books\n\tfor (int i=0; i< ssset; i++){\n\t for (Integer a: bookset){\n\t \tif (!bookset2.contains(a)){\n\t \t\tbookset2.add(a);\n\t \t\t\n\t \t}\n\t }\n\t // record the sets of the different books into a different array\n\t // and remove these books from the original array\n\t array.add(bookset2.size());\n\t for (Integer a: bookset2){\n\t \tif (bookset.contains(a)){\n\t \t\tbookset.remove(a);\n\t \t}\n\t }\n\t bookset2.clear();\n\t}\n\n\tprice = calc.calcSet(array);\n\tcalcul(array);\n\tprice = compare(price);\n\treturn price;\n\t\n\t\n\n}",
"Values createValues();",
"private Pair(K key, V value) {\n \tthis.key = key;\n \tthis.value = value;\n }",
"Value createValue();",
"public static <X> Value<X> Value(X value) { return new Value(value); }",
"public void addValue(Object value)\n {\n valueList = (Object[]) ArrayList.add(valueList, value);\n valueSet = true;\n }",
"ImmutableIntSet add(int value);",
"public SharedSpaceSet createSpaceIdCondition(String value)\n {\n SharedSpaceSet result = new SharedSpaceSet();\n \n for (SharedSpace obj : this)\n {\n if (value.equals(obj.getSpaceId()))\n {\n result.add(obj);\n }\n }\n \n return result;\n }",
"public void insert(T value) {\r\n\t\t// Hash the value to be inserted with all the hash functions.\r\n\t\t// Take the newly obtained values and set those indices in the bits array to 1/true.\r\n\t\tfor (int i = 0; i < numHash; i++) {\r\n\t\t\tint index = hashes.getIndex(i).hash(value) % size;\r\n\t\t\tbits.set(index, true);\r\n\t\t}\r\n\t}",
"private HashTableNode<K, V> getNodeWithValue(V value) {\n if (size() == ??) {\n return null;\n }\n\n\t// This seems too tough for Sketch\n\tint bs = buckets.size();\n\tint b = {|this.size, this.currentCapacity, this.capacityGrowth,\n\t\t this.initialCapacity, bs|};\n\tfor (int i = ??; i < b; i++) {\n // for (int i = 0; i < buckets.size(); i++) {\n HashTableNode<K, V> current = buckets.get(i);\n\n while (current != null) {\n\t\tV v = current.getValue();\n\t\tboolean b2 = v.equals(value);\n if ({|b2, v == value|}) {\n // if (v.equals(value)) {\n return current;\n }\n current = current.getNext();\n }\n }\n\n return null;\n }",
"private Tuple(K key, V value) {\n this.key = key;\n this.value = value;\n }",
"Set createSet();",
"org.hl7.fhir.ValueSet addNewValueSet();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
speichert einen Dienstleister in der Datenbank | public static void saveDienstleister(Dienstleister neu) {
Session session = getSession();
Transaction tx = session.beginTransaction();
session.save(neu);
tx.commit();
session.close();
} | [
"public static Dienstleister getOneById(int id) {\r\n\t\tDienstleister dienstleister = new Dienstleister();\r\n\t\tSession session = getSession();\r\n\t\tdienstleister = session.get(Dienstleister.class, id);\r\n\t\tsession.close();\r\n\t\treturn dienstleister;\t\r\n\t}",
"public static BenutzerDatenbank datenBankFactory()\r\n {\r\n if(bd == null)\r\n {\r\n bd = ladeAusDatei();\r\n }\r\n\r\n if(bd == null)\r\n {\r\n bd = new BenutzerDatenbank();\r\n speichereInDatei();\r\n }\r\n\r\n return bd;\r\n }",
"Schueler createSchueler();",
"public GestioneDomandeD() {\n this.daoDomande = null;\n this.daoPunteggi = null;\n this.daoDipendenti = null;\n this.gestionePunteggiD = null;\n this.gestioneLog = null;\n this.gestioneBadge = null;\n }",
"Klassenstufe createKlassenstufe();",
"public interface KundenDAO {\n\n\t/**\n\t * Liste aller Kunden aus der DB holen\n\t * @return ArrayList von Kunden\n\t */\n\tpublic ArrayList<Kunde> getKundenListe();\n\t\n\t/**\n\t * Kunde anhand der als int uebergebenen id suchen\n\t * @param id\n\t * @return Kunde\n\t */\n\tpublic Kunde getKundeById(int id);\n\n\t/**\n\t * Neuen Kunde hinzufuegen\n\t * @param Kunde\n\t */\n\tpublic void addKunde(Kunde kunde);\n\t\n\t/**\n\t * Bestehenden Kunde loeschen \n\t * @param id\n\t */\n\tpublic void deleteKunde(int id);\n\t\n\t/**\n\t * Bestehenden Kunde updaten bzw. aendern \n\t * @param Kunde\n\t */\n\tpublic void updateKunde(Kunde kunde);\n\t\n}",
"public Dentist(String fullName) {\n\t\tsuper(fullName);\t\t\n\t}",
"Schulleiter createSchulleiter();",
"public ElevSeRegKurser() {\n initComponents();\n try {\n idb = new InfDB(\"C://db//HOGDB.FDB\");\n } catch (InfException e) {\n JOptionPane.showMessageDialog(null, \"Något gick visst fel\");\n System.out.println(\"Internt felmeddelande\" + e.getMessage());\n }\n }",
"public void liesDaten(String datei) throws IOException {\n\t\t// PersistenzManager fuer Lesevorgaenge oeffnen\n\t\tpm.openForReading(datei);\n\n\t\tArtikel einArtikel;\n\t\tdo {\n\t\t\t// Artikel-Objekt einlesen\n\t\t\teinArtikel = pm.ladeArtikel();\n\t\t\tif (einArtikel != null) {\n\t\t\t\t// Artikel in die Liste einfuegen\n\t\t\t\ttry {\n\t\t\t\t\teinfuegen(einArtikel);\n\t\t\t\t} catch (ArtikelExistiertBereitsException e) {\n\t\t\t\t\tSystem.err.println(e.getMessage());\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t} while (einArtikel != null);\n\n\t\t// Persistenz-Schnittstelle wieder schließen\n\t\tpm.close();\n\t}",
"public Etudiant(){ \n \n super()://personne();\n }",
"public Nodo getNodoDerecho(){\n return der;\n }",
"public GestioneDomandeD(DAODomande daoDom, DAOPunteggi daoPunt, DAODipendenti daoDip, GestionePunteggiD gestPuntD, GestioneLog gestLog, GestioneBadgeD gestBadgeD) {\n this.daoDomande = daoDom;\n this.daoPunteggi = daoPunt;\n this.daoDipendenti = daoDip;\n this.gestionePunteggiD = gestPuntD;\n this.gestioneLog = gestLog;\n this.gestioneBadge = gestBadgeD;\n }",
"Debut getDebut();",
"public DTRuteo(DTNodo d)\r\n\t{\r\n\t\tthis.deposito=d;\r\n\t\tthis.ruta=new ArrayList<DTNodo>();\r\n\t\tcosto=0;\r\n\t}",
"public KundeRegister() {\n kundeliste = new ArrayList<KundeVO>();\n kundelyttere = new ArrayList<KundeListener>();\n }",
"public interface FakturaTekstVDAO extends DAO<FakturaTekstV> {\r\n\t/**\r\n\t * Finner tekster tilhørende faktura\r\n\t * \r\n\t * @param fakturaId\r\n\t * @return tekster\r\n\t */\r\n\tList<FakturaTekstV> findByFakturaId(Integer fakturaId);\r\n}",
"public void heilen(){\r\n\t\taktuellerZustand=aktuellerZustand.heilen();\t\t\r\n\t}",
"private static void maakDeductieStructuren() {\r\n geefStationsBurenEnLijnen();\r\n maakKruisingen();\r\n for (Lijn l : DAO.getLijnenLijst()) {\r\n System.out.println(l.toString());\r\n }\r\n for (Station s : DAO.getStationLijst()) {\r\n System.out.println(s.toString());\r\n }\r\n //onderstaande code init juiste trein voor elke reiziger,MOET na geefStationsBurenEnLijnen() komen\r\n /*for(Map.Entry<Integer,ArrayList<Reiziger>> hm : reizigersLijst.entrySet()){\r\n for (Reiziger r : hm.getValue()){\r\n r.setJuisteTrein(r.zoekTrein());\r\n }\r\n }*/\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an xml node for this agent style | public Node createNode(Document doc, int position, File modelPath) {
Node agentNode = doc.createElement("agentstyle");
addAttr(doc, agentNode, "name", name);
addAttr(doc, agentNode, ATTR_VISIBLE, visible);
addAttr(doc, agentNode, ATTR_TRANSPARENT, transparent);
addAttr(doc, agentNode, ATTR_BORDER, border);
addAttr(doc, agentNode, ATTR_LABEL, label);
addAttr(doc, agentNode, ATTR_PRIORITY, position);
// Parameters
addAttr(doc, agentNode, ATTR_SCALE, scaleFactor);
// Flags
addAttr(doc, agentNode, ATTR_COLOR_BLENDING, colorBlending);
addAttr(doc, agentNode, ATTR_DRAW_SHAPE, drawShapeWithImage);
addAttr(doc, agentNode, ATTR_MODULATE_SIZE, modulateSize);
// Save label options
if (fontFamily != null) {
addAttr(doc, agentNode, ATTR_FONT_FAMILY, fontFamily);
addAttr(doc, agentNode, ATTR_FONT_SIZE, fontSize);
addAttr(doc, agentNode, ATTR_FONT_STYLE, fontStyle);
}
// Bitmap font
if (bitmapFontName != null) {
addAttr(doc, agentNode, ATTR_BITMAP_FONT_NAME, bitmapFontName);
}
addAttr(doc, agentNode, ATTR_BITMAP_FONT_SIZE, bitmapFontSize);
addAttr(doc, agentNode, ATTR_TEXT_ALIGNMENT, textAlignment.toString());
// Label properties
addAttr(doc, agentNode, ATTR_DX_LABEL, dxLabel);
addAttr(doc, agentNode, ATTR_DY_LABEL, dyLabel);
addAttr(doc, agentNode, ATTR_LABEL_WIDTH, labelWidth);
addAttr(doc, agentNode, ATTR_LABEL_HEIGHT, labelHeight);
addAttr(doc, agentNode, ATTR_LABEL_COLOR, labelColor);
addAttr(doc, agentNode, ATTR_MODULATE_LABEL_COLOR, modulateLabelColor);
addAttr(doc, agentNode, ATTR_MODULATE_LABEL_SIZE, modulateLabelSize);
if (this.tileFile != null) {
// Tile file
addAttr(doc, agentNode, ATTR_TILE_MANAGER,
FileUtils.getRelativePath(modelPath, tileFile));
}
// Transparency
addAttr(doc, agentNode, ATTR_TRANSPARENCY, transparencyCoefficient);
// Alpha
addAttr(doc, agentNode, ATTR_ALPHA_FUNC, alphaFunc);
addAttr(doc, agentNode, ATTR_ALPHA_FUNC_VALUE, alphaFuncValue);
// Stencil
addAttr(doc, agentNode, ATTR_STENCIL_FUNC, stencilFunc);
addAttr(doc, agentNode, ATTR_STENCIL_REF, stencilRef);
addAttr(doc, agentNode, ATTR_STENCIL_MASK, stencilMask);
if (stencilFail > 0)
addAttr(doc, agentNode, ATTR_STENCIL_FAIL, stencilFail);
if (stencilZFail > 0)
addAttr(doc, agentNode, ATTR_STENCIL_ZFAIL, stencilZFail);
if (stencilZPass > 0)
addAttr(doc, agentNode, ATTR_STENCIL_ZPASS, stencilZPass);
// Blending
if (blendDst > 0) {
addAttr(doc, agentNode, ATTR_BLEND_DST, blendDst);
}
if (blendSrc > 0) {
addAttr(doc, agentNode, ATTR_BLEND_SRC, blendSrc);
}
addAttr(doc, agentNode, ATTR_TEXTURE_ENV, textureEnv);
return agentNode;
} | [
"private String toXML(){\n return \"<paint>\\n\"+\"\\t<background_color>\" + this.backgroundColor +\n \"</background_color>\\n\" + touchArea.toXML() + \"</paint>\\n\";\n }",
"private void createXML() {\n\t\txml.writeXML(problemName.getText(), model ,problemDescription.getText(), problemWaitTime.getText() + \" \" + timeComboBox.getSelectedItem() , problemInvalidValue.getText());\n\t\tJOptionPane.showMessageDialog(doneButton, \"XML Created\");\n }",
"public Element createXMLnode(String tokenType) {\n\t\tElement temp;\n\t\ttemp = document.createElement(tokenType);\n\t\ttemp.setTextContent(\" \" + jTokenizer.returnTokenVal(tokenType) + \" \");\n\t\treturn temp;\n\t}",
"NodeAttribute createNodeAttribute();",
"@Override public Node toNode(Document doc)\r\n {\r\n Document document = doc;\r\n try\r\n {\r\n if (doc==null)\r\n {\r\n DocumentBuilder factory = DocumentBuilderFactory.newInstance().newDocumentBuilder();\r\n document = factory.newDocument();\r\n document.setXmlVersion(\"1.0\");\r\n }\r\n } catch (ParserConfigurationException e)\r\n {\r\n return null;\r\n }\r\n \r\n Element layoutElement = document.createElement(\"g\");\r\n layoutElement.setAttribute(\"transform\", \"translate(\"+(getWidth()/2)+\",\"+(getHeight()/2)+\")\");\r\n for (StateContainer c : stateContainers)\r\n {\r\n layoutElement.appendChild(c.toNode(document));\r\n }\r\n\r\n for (TransitionArrow c : transitionArrows)\r\n {\r\n layoutElement.appendChild(c.toNode(document));\r\n }\r\n\r\n if (doc==null)\r\n {\r\n Element svgElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\r\n \r\n svgElement.setAttribute(\"width\", Double.toString(width));\r\n svgElement.setAttribute(\"height\", Double.toString(height));\r\n \r\n Element styleElement = document.createElement(\"style\");\r\n {\r\n styleElement.setAttribute(\"type\", \"text/css\");\r\n CDATASection cdataNode;\r\n {\r\n String cssStyle= \"svg {\\n\" +\r\n\"\tfont-family: Arial;\\n\" +\r\n\"\tfont-size: 14px;\\n\" +\r\n\"}\\n\" +\r\n\"\\n\" +\r\n\".state-rect {\\n\" +\r\n\" stroke: black;\\n\" +\r\n\" stroke-width: 1;\\n\" +\r\n\" fill: white;\\n\" +\r\n\"}\\n\" +\r\n\"\\n\" +\r\n\".final-rect {\\n\" +\r\n\"\tstroke: black;\\n\" +\r\n\" stroke-width: 0.75;\\n\" +\r\n\" fill: white;\\n\" +\r\n\"}\\n\" +\r\n\"\\n\" +\r\n\".parallel-rect {\\n\" +\r\n\"\tstroke: black;\\n\" +\r\n\"\tstroke-width: 1;\\n\" +\r\n\"\tstroke-dasharray: 2,2;\\n\" +\r\n\"\tfill: white;\\n\" +\r\n\"}\\n\" +\r\n\"\\n\" +\r\n\".history-rect {\\n\" +\r\n\"\tstroke: black;\\n\" +\r\n\"\tstroke-width: 3;\\n\" +\r\n\"\tstroke-dasharray: 12,2;\\n\" +\r\n\"\tfill: white;\\n\" +\r\n\"}\\n\" +\r\n\"\\n\" +\r\n\".id-caption {\\n\" +\r\n\"\tfont-weight: bold;\\n\" +\r\n\"}\\n\" +\r\n\"\\n\" +\r\n\".transition line {\\n\" +\r\n\"\tstroke: black;\\n\" +\r\n\"\tstroke-width: 1;\\n\" +\r\n\"}\\n\" +\r\n\"\\n\" +\r\n\".transition .initial circle {\\n\" +\r\n\"\tfill: black;\\n\" +\r\n\"}\\n\"+\r\n\"\\n\" +\r\n\".transition .transition-event {\\n\" +\r\n\"\tfont-size: 11px; \\n\" +\r\n\"}\\n\"\r\n+ \"\\n\"\r\n+ \".transition path.self-transition {\\n\"\r\n+ \" stroke: black;\\n\"\r\n+ \" stroke-width: 1;\\n\"\r\n+ \" fill: none;\\n\"\r\n+ \" stroke-linejoin: miter;\\n\"\r\n+ \" stroke-linecap: butt;\\n\"\r\n+ \"}\";\r\n \r\n cdataNode = document.createCDATASection(cssStyle);\r\n }\r\n styleElement.appendChild(cdataNode);\r\n }\r\n svgElement.appendChild(styleElement);\r\n \r\n svgElement.appendChild(layoutElement);\r\n \r\n document.appendChild(svgElement);\r\n return document;\r\n }\r\n else return layoutElement;\r\n }",
"public S create() {\n\t\tS style = createDefault();\n\t\tint id = nextID();\n\t\tstyle.setId(id);\n\t\taddStyle(style);\n\t\treturn style;\n\t}",
"public Node makeNode(Document xmlDoc) {\r\n Element out = xmlDoc.createElement(this.parent.getHeader());\r\n this.parent.updateSave();\r\n if (this.nodeText != null) {\r\n out.setTextContent(nodeText);\r\n }\r\n this.makeAtributes(out);\r\n for (int i = 0; i < this.children.size(); i++) {\r\n out.appendChild(this.children.get(i).makeNode(xmlDoc));\r\n }\r\n return out;\r\n}",
"Node createNode();",
"public void write(Tree<?, ?> tree) throws IOException {\n this.writer.append(\"<?xml version=\\\"1.0\\\" encoding=\\\"iso-8859-1\\\"?>\\n\"); //$NON-NLS-1$\n this.writer.append(\"<gxl>\\n\"); //$NON-NLS-1$\n\n if (tree != null) {\n this.writer.append(\"\\t<graph id=\\\"\"); //$NON-NLS-1$\n this.writer.append(Integer.toHexString(System.identityHashCode(Integer.valueOf(tree.hashCode()))));\n this.writer.append(\"-\"); //$NON-NLS-1$\n this.writer.append(Integer.toString(this.graphIndex++));\n this.writer.append(\"\\\" edgeids=\\\"true\\\" edgemode=\\\"directed\\\">\\n\"); //$NON-NLS-1$\n\n // Write the node attributes\n Iterator<? extends TreeNode<?, ?>> iterator = tree.breadthFirstIterator();\n TreeNode<?, ?> node;\n int dataCount;\n while (iterator.hasNext()) {\n node = iterator.next();\n dataCount = node.getUserDataCount();\n final String name = \"NODE\" + Integer.toHexString(node.hashCode()); //$NON-NLS-1$\n final String label = Integer.toString(dataCount);\n\n this.writer.append(\"\\t\\t<node id=\\\"\"); //$NON-NLS-1$\n this.writer.append(name);\n this.writer.append(\"\\\">\\n\"); //$NON-NLS-1$\n\n this.writer.append(\"\\t\\t\\t<attr name=\\\"label\\\">\\n\"); //$NON-NLS-1$\n this.writer.append(\"\\t\\t\\t\\t<string>\"); //$NON-NLS-1$\n this.writer.append(label);\n this.writer.append(\"</string>\\n\"); //$NON-NLS-1$\n this.writer.append(\"\\t\\t\\t</attr>\\n\"); //$NON-NLS-1$\n\n this.writer.append(\"\\t\\t</node>\\n\"); //$NON-NLS-1$\n }\n\n // Write the node attributes\n iterator = tree.breadthFirstIterator();\n TreeNode<?, ?> child;\n String childName;\n while (iterator.hasNext()) {\n node = iterator.next();\n final String name = \"NODE\" + Integer.toHexString(node.hashCode()); //$NON-NLS-1$\n if (!node.isLeaf()) {\n final int childCount = node.getChildCount();\n for (int i = 0; i < childCount; ++i) {\n child = node.getChildAt(i);\n if (child != null) {\n childName = \"NODE\" + Integer.toHexString(child.hashCode()); //$NON-NLS-1$\n\n this.writer.append(\"\\t\\t<edge id=\\\"\"); //$NON-NLS-1$\n this.writer.append(name);\n this.writer.append(\"--\"); //$NON-NLS-1$\n this.writer.append(childName);\n this.writer.append(\"\\\" isdirected=\\\"true\\\" from=\\\"\"); //$NON-NLS-1$\n this.writer.append(name);\n this.writer.append(\"\\\" to=\\\"\"); //$NON-NLS-1$\n this.writer.append(childName);\n this.writer.append(\"\\\">\\n\"); //$NON-NLS-1$\n\n this.writer.append(\"\\t\\t\\t<attr name=\\\"label\\\">\\n\"); //$NON-NLS-1$\n this.writer.append(\"\\t\\t\\t\\t<string>\"); //$NON-NLS-1$\n this.writer.append(Integer.toString(i));\n this.writer.append(\"</string>\\n\"); //$NON-NLS-1$\n this.writer.append(\"\\t\\t\\t</attr>\\n\"); //$NON-NLS-1$\n\n this.writer.append(\"\\t\\t</edge>\\n\"); //$NON-NLS-1$\n }\n }\n }\n }\n\n this.writer.append(\"\\t</graph>\\n\"); //$NON-NLS-1$\n }\n\n this.writer.append(\"</gxl>\\n\"); //$NON-NLS-1$\n }",
"public static String generateXML(WriteableRootElement node) {\n StringBuffer sb = new StringBuffer(\"<?xml version='1.0' ?>\").append(LINE_BREAK);\n appendElement(sb, node, \"\");\n return sb.toString();\n }",
"public /*virtual*/ XmlNode CreateNode( String nodeTypeString, String name, String namespaceURI ) {\r\n return CreateNode( ConvertToNodeType( nodeTypeString ), name, namespaceURI );\r\n }",
"public void createRootEle()\n {\n rootEle = dom.createElement(\"ACPT\");\n dom.appendChild(rootEle);\n\n }",
"public /*virtual*/ XmlNode CreateNode( XmlNodeType type, String prefix, String name, String namespaceURI ) {\r\n switch (type) {\r\n case XmlNodeType.Element:\r\n if (prefix != null) \r\n return CreateElement( prefix, name, namespaceURI );\r\n else \r\n return CreateElement( name, namespaceURI ); \r\n\r\n case XmlNodeType.Attribute: \r\n if (prefix != null)\r\n return CreateAttribute( prefix, name, namespaceURI );\r\n else\r\n return CreateAttribute( name, namespaceURI ); \r\n\r\n case XmlNodeType.Text: \r\n return CreateTextNode( String.Empty ); \r\n\r\n case XmlNodeType.CDATA: \r\n return CreateCDataSection( String.Empty );\r\n\r\n case XmlNodeType.EntityReference:\r\n return CreateEntityReference( name ); \r\n\r\n case XmlNodeType.ProcessingInstruction: \r\n return CreateProcessingInstruction( name, String.Empty ); \r\n\r\n case XmlNodeType.XmlDeclaration: \r\n return CreateXmlDeclaration( \"1.0\", null, null );\r\n\r\n case XmlNodeType.Comment:\r\n return CreateComment( String.Empty ); \r\n\r\n case XmlNodeType.DocumentFragment: \r\n return CreateDocumentFragment(); \r\n\r\n case XmlNodeType.DocumentType: \r\n return CreateDocumentType( name, String.Empty, String.Empty, String.Empty );\r\n\r\n case XmlNodeType.Document:\r\n return new XmlDocument(); \r\n\r\n case XmlNodeType.SignificantWhitespace: \r\n return CreateSignificantWhitespace( String.Empty ); \r\n\r\n case XmlNodeType.Whitespace: \r\n return CreateWhitespace( String.Empty );\r\n\r\n default:\r\n throw new ArgumentException( Res.GetString( Res.Arg_CannotCreateNode, type ) ); \r\n }\r\n }",
"public void writeXML(String xml){\n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\tDocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance(); \n\t\t\tDocumentBuilder documentBuilder = documentFactory.newDocumentBuilder(); \n\t\t\t// define root elements \n\t\t\tDocument document = documentBuilder.newDocument(); \n\t\t\tElement rootElement = document.createElement(\"graph\"); \n\t\t\tdocument.appendChild(rootElement);\n\t\t\t\n\t\t\tfor(int i=0;i<Rel.getChildCount();i++){\n\t\t\t\tif(Rel.getChildAt(i).getTag() != null){\n\t\t\t\t\tif(Rel.getChildAt(i).getTag().toString().compareTo(\"node\") == 0){\n\t\t\t\t\t\tArtifact artifact = (Artifact) Rel.getChildAt(i);\n\t\t\t\t\t\tElement node = addElement(rootElement, \"node\", document);\n\t\t\t\t\t\tElement id = addAttribute(\"id\",artifact.getId()+\"\", document); //we create an attribute for a node\n\t\t\t\t\t\tnode.appendChild(id);//and then we attach it to the node\n\t\t\t\t\t\t\n\t\t\t\t\t\tArrayList <Artifact> fathers = artifact.getFathers();\n\t\t\t\t\t\tif(fathers != null){\n\t\t\t\t\t\t\taddElement(node, \"fathers\", document);//for complex attribute like array of fathers we add an element to the node\n\t\t\t\t\t\t\tfor(int j=0;j<fathers.size();j++){\n\t\t\t\t\t\t\t\tElement father = addAttribute(\"father\",fathers.get(j).getId()+\"\", document);//inside this element created in the node we add all its fathers as attributes\n\t\t\t\t\t\t\t\tnode.appendChild(father);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tArrayList <Artifact> sons = artifact.getSons();\n\t\t\t\t\t\tif(sons != null){\n\t\t\t\t\t\t\taddElement(node, \"sons\", document);//for complex attribute like array of sons we add an element to the node\n\t\t\t\t\t\t\tfor(int j=0;j<sons.size();j++){\n\t\t\t\t\t\t\t\tElement son = addAttribute(\"son\",sons.get(j).getId()+\"\", document);//inside this element created in the node we add all its sons as attributes\n\t\t\t\t\t\t\t\tnode.appendChild(son);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tElement label = addAttribute(\"label\", artifact.getText()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(label);\n\t\t\t\t\t\t\n\t\t\t\t\t\tElement age = addAttribute(\"age\", artifact.getAge()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(age);\n\t\t\t\t\t\t\n\t\t\t\t\t\tElement type = addAttribute(\"type\", artifact.getType()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(type);\n\t\t\t\t\t\t\n\t\t\t\t\t\tElement information = addAttribute(\"information\", artifact.getInformation()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(information);\n\t\t\t\t\t\t\n\t\t\t\t\t\tElement position = addAttribute(\"position\", artifact.getPosition()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(position);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// creating and writing to xml file \n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance(); \n\t\t\tTransformer transformer = transformerFactory.newTransformer(); \n\t\t\tDOMSource domSource = new DOMSource(document); \n\t\t\tStreamResult streamResult = new StreamResult(new File(xml)); \n\t\t\ttransformer.transform(domSource, streamResult);\n \n \n }catch(Exception e){\n \tLog.v(\"error writing xml\",e.toString());\n }\n\t\t\n\t\t\n\t}",
"abstract protected InlineStyle createInlineStyle(Node owner);",
"public String generateXML() \n { \n \n String xml = new String();\n \n String nodetype = new String();\n if (type.equals(\"internal\")){\n nodetype = \"INTERNAL\"; //change this for change in XML node name\n }\n else {\n nodetype = \"LEAF\"; //change this for change in XML node name\n }\n \n xml = \"<\" + nodetype;\n if (!name.equals(\"\")){\n xml = xml + \" name = \\\"\" + name + \"\\\"\";\n }\n if (length >0){\n xml = xml + \" length = \\\"\" + length + \"\\\"\";\n }\n //Section below tests tree size and depths\n // if (level > 0){\n // xml = xml + \" level = \\\"\" + level + \"\\\"\";\n // }\n //if (depth > 0){\n // xml = xml + \" depth = \\\"\" + depth + \"\\\"\";\n //}\n //if (newicklength > 0){\n // xml = xml + \" newicklength = \\\"\" + newicklength + \"\\\"\";\n //}\n // if (treesize > 0){\n // xml = xml + \" treesize = \\\"\" + treesize + \"\\\"\";\n //}\n //if (startxcoord >= 0){\n // xml = xml + \" startx = \\\"\" + startxcoord + \"\\\"\";\n //}\n //if (endxcoord >= 0){\n // xml = xml + \" endx = \\\"\" + endxcoord + \"\\\"\";\n //}\n //Test section done\n xml = xml + \">\";\n \n if (!children.isEmpty()){ //if there are children in this node's arraylist\n Iterator it = children.iterator();\n while(it.hasNext()){\n Node child = (Node) it.next();\n xml = xml + child.generateXML(); //The recursive coolness happens here!\n }\n }\n xml = xml + \"</\" + nodetype + \">\";\n \n return xml;\n }",
"private XMLNode() {}",
"ChildNode createChildNode();",
"STYLE createSTYLE();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "rule__ServidorAplicaciones__RecursosAssignment_8_2" $ANTLR start "rule__ServidorAplicaciones__RecursosAssignment_8_3_1" InternalCeffective.g:8641:1: rule__ServidorAplicaciones__RecursosAssignment_8_3_1 : ( ( ruleEString ) ) ; | public final void rule__ServidorAplicaciones__RecursosAssignment_8_3_1() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalCeffective.g:8645:1: ( ( ( ruleEString ) ) )
// InternalCeffective.g:8646:2: ( ( ruleEString ) )
{
// InternalCeffective.g:8646:2: ( ( ruleEString ) )
// InternalCeffective.g:8647:3: ( ruleEString )
{
before(grammarAccess.getServidorAplicacionesAccess().getRecursosRecursoCrossReference_8_3_1_0());
// InternalCeffective.g:8648:3: ( ruleEString )
// InternalCeffective.g:8649:4: ruleEString
{
before(grammarAccess.getServidorAplicacionesAccess().getRecursosRecursoEStringParserRuleCall_8_3_1_0_1());
pushFollow(FOLLOW_2);
ruleEString();
state._fsp--;
after(grammarAccess.getServidorAplicacionesAccess().getRecursosRecursoEStringParserRuleCall_8_3_1_0_1());
}
after(grammarAccess.getServidorAplicacionesAccess().getRecursosRecursoCrossReference_8_3_1_0());
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
restoreStackSize(stackSize);
}
return ;
} | [
"public final void rule__Servidor_Impl__RecursosAssignment_7_3_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:9026:1: ( ( ( ruleEString ) ) )\n // InternalCeffective.g:9027:2: ( ( ruleEString ) )\n {\n // InternalCeffective.g:9027:2: ( ( ruleEString ) )\n // InternalCeffective.g:9028:3: ( ruleEString )\n {\n before(grammarAccess.getServidor_ImplAccess().getRecursosRecursoCrossReference_7_3_1_0()); \n // InternalCeffective.g:9029:3: ( ruleEString )\n // InternalCeffective.g:9030:4: ruleEString\n {\n before(grammarAccess.getServidor_ImplAccess().getRecursosRecursoEStringParserRuleCall_7_3_1_0_1()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getServidor_ImplAccess().getRecursosRecursoEStringParserRuleCall_7_3_1_0_1()); \n\n }\n\n after(grammarAccess.getServidor_ImplAccess().getRecursosRecursoCrossReference_7_3_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Servidor_Impl__RecursosAssignment_7_2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:9007:1: ( ( ( ruleEString ) ) )\n // InternalCeffective.g:9008:2: ( ( ruleEString ) )\n {\n // InternalCeffective.g:9008:2: ( ( ruleEString ) )\n // InternalCeffective.g:9009:3: ( ruleEString )\n {\n before(grammarAccess.getServidor_ImplAccess().getRecursosRecursoCrossReference_7_2_0()); \n // InternalCeffective.g:9010:3: ( ruleEString )\n // InternalCeffective.g:9011:4: ruleEString\n {\n before(grammarAccess.getServidor_ImplAccess().getRecursosRecursoEStringParserRuleCall_7_2_0_1()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getServidor_ImplAccess().getRecursosRecursoEStringParserRuleCall_7_2_0_1()); \n\n }\n\n after(grammarAccess.getServidor_ImplAccess().getRecursosRecursoCrossReference_7_2_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__ServidorAplicaciones__RecursosAssignment_8_2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8626:1: ( ( ( ruleEString ) ) )\n // InternalCeffective.g:8627:2: ( ( ruleEString ) )\n {\n // InternalCeffective.g:8627:2: ( ( ruleEString ) )\n // InternalCeffective.g:8628:3: ( ruleEString )\n {\n before(grammarAccess.getServidorAplicacionesAccess().getRecursosRecursoCrossReference_8_2_0()); \n // InternalCeffective.g:8629:3: ( ruleEString )\n // InternalCeffective.g:8630:4: ruleEString\n {\n before(grammarAccess.getServidorAplicacionesAccess().getRecursosRecursoEStringParserRuleCall_8_2_0_1()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getServidorAplicacionesAccess().getRecursosRecursoEStringParserRuleCall_8_2_0_1()); \n\n }\n\n after(grammarAccess.getServidorAplicacionesAccess().getRecursosRecursoCrossReference_8_2_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__ServidorBD__RecursosAssignment_9_3_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8909:1: ( ( ( ruleEString ) ) )\n // InternalCeffective.g:8910:2: ( ( ruleEString ) )\n {\n // InternalCeffective.g:8910:2: ( ( ruleEString ) )\n // InternalCeffective.g:8911:3: ( ruleEString )\n {\n before(grammarAccess.getServidorBDAccess().getRecursosRecursoCrossReference_9_3_1_0()); \n // InternalCeffective.g:8912:3: ( ruleEString )\n // InternalCeffective.g:8913:4: ruleEString\n {\n before(grammarAccess.getServidorBDAccess().getRecursosRecursoEStringParserRuleCall_9_3_1_0_1()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getServidorBDAccess().getRecursosRecursoEStringParserRuleCall_9_3_1_0_1()); \n\n }\n\n after(grammarAccess.getServidorBDAccess().getRecursosRecursoCrossReference_9_3_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Almacenamiento__RecursosAssignment_7_2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8743:1: ( ( ( ruleEString ) ) )\n // InternalCeffective.g:8744:2: ( ( ruleEString ) )\n {\n // InternalCeffective.g:8744:2: ( ( ruleEString ) )\n // InternalCeffective.g:8745:3: ( ruleEString )\n {\n before(grammarAccess.getAlmacenamientoAccess().getRecursosRecursoCrossReference_7_2_0()); \n // InternalCeffective.g:8746:3: ( ruleEString )\n // InternalCeffective.g:8747:4: ruleEString\n {\n before(grammarAccess.getAlmacenamientoAccess().getRecursosRecursoEStringParserRuleCall_7_2_0_1()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getAlmacenamientoAccess().getRecursosRecursoEStringParserRuleCall_7_2_0_1()); \n\n }\n\n after(grammarAccess.getAlmacenamientoAccess().getRecursosRecursoCrossReference_7_2_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Almacenamiento__RecursosAssignment_7_3_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8762:1: ( ( ( ruleEString ) ) )\n // InternalCeffective.g:8763:2: ( ( ruleEString ) )\n {\n // InternalCeffective.g:8763:2: ( ( ruleEString ) )\n // InternalCeffective.g:8764:3: ( ruleEString )\n {\n before(grammarAccess.getAlmacenamientoAccess().getRecursosRecursoCrossReference_7_3_1_0()); \n // InternalCeffective.g:8765:3: ( ruleEString )\n // InternalCeffective.g:8766:4: ruleEString\n {\n before(grammarAccess.getAlmacenamientoAccess().getRecursosRecursoEStringParserRuleCall_7_3_1_0_1()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getAlmacenamientoAccess().getRecursosRecursoEStringParserRuleCall_7_3_1_0_1()); \n\n }\n\n after(grammarAccess.getAlmacenamientoAccess().getRecursosRecursoCrossReference_7_3_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__ServidorBD__RecursosAssignment_9_2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8890:1: ( ( ( ruleEString ) ) )\n // InternalCeffective.g:8891:2: ( ( ruleEString ) )\n {\n // InternalCeffective.g:8891:2: ( ( ruleEString ) )\n // InternalCeffective.g:8892:3: ( ruleEString )\n {\n before(grammarAccess.getServidorBDAccess().getRecursosRecursoCrossReference_9_2_0()); \n // InternalCeffective.g:8893:3: ( ruleEString )\n // InternalCeffective.g:8894:4: ruleEString\n {\n before(grammarAccess.getServidorBDAccess().getRecursosRecursoEStringParserRuleCall_9_2_0_1()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getServidorBDAccess().getRecursosRecursoEStringParserRuleCall_9_2_0_1()); \n\n }\n\n after(grammarAccess.getServidorBDAccess().getRecursosRecursoCrossReference_9_2_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Servidor_Impl__NombreAssignment_3_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8947:1: ( ( ruleEString ) )\n // InternalCeffective.g:8948:2: ( ruleEString )\n {\n // InternalCeffective.g:8948:2: ( ruleEString )\n // InternalCeffective.g:8949:3: ruleEString\n {\n before(grammarAccess.getServidor_ImplAccess().getNombreEStringParserRuleCall_3_1_0()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getServidor_ImplAccess().getNombreEStringParserRuleCall_3_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__ServidorAplicaciones__SistemaOperativoAssignment_7_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8611:1: ( ( ruleEString ) )\n // InternalCeffective.g:8612:2: ( ruleEString )\n {\n // InternalCeffective.g:8612:2: ( ruleEString )\n // InternalCeffective.g:8613:3: ruleEString\n {\n before(grammarAccess.getServidorAplicacionesAccess().getSistemaOperativoEStringParserRuleCall_7_1_0()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getServidorAplicacionesAccess().getSistemaOperativoEStringParserRuleCall_7_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__ServidorAplicaciones__NombreAssignment_3_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8551:1: ( ( ruleEString ) )\n // InternalCeffective.g:8552:2: ( ruleEString )\n {\n // InternalCeffective.g:8552:2: ( ruleEString )\n // InternalCeffective.g:8553:3: ruleEString\n {\n before(grammarAccess.getServidorAplicacionesAccess().getNombreEStringParserRuleCall_3_1_0()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getServidorAplicacionesAccess().getNombreEStringParserRuleCall_3_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AutenticacionFirma__CorreoAssignment_4_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8506:1: ( ( ruleEString ) )\n // InternalCeffective.g:8507:2: ( ruleEString )\n {\n // InternalCeffective.g:8507:2: ( ruleEString )\n // InternalCeffective.g:8508:3: ruleEString\n {\n before(grammarAccess.getAutenticacionFirmaAccess().getCorreoEStringParserRuleCall_4_1_0()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getAutenticacionFirmaAccess().getCorreoEStringParserRuleCall_4_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Servidor_Impl__ZonaDisponibilidadAssignment_4_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8962:1: ( ( ruleEString ) )\n // InternalCeffective.g:8963:2: ( ruleEString )\n {\n // InternalCeffective.g:8963:2: ( ruleEString )\n // InternalCeffective.g:8964:3: ruleEString\n {\n before(grammarAccess.getServidor_ImplAccess().getZonaDisponibilidadEStringParserRuleCall_4_1_0()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getServidor_ImplAccess().getZonaDisponibilidadEStringParserRuleCall_4_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__ServidorBD__SistemaManejadorAssignment_8_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8875:1: ( ( ruleEString ) )\n // InternalCeffective.g:8876:2: ( ruleEString )\n {\n // InternalCeffective.g:8876:2: ( ruleEString )\n // InternalCeffective.g:8877:3: ruleEString\n {\n before(grammarAccess.getServidorBDAccess().getSistemaManejadorEStringParserRuleCall_8_1_0()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getServidorBDAccess().getSistemaManejadorEStringParserRuleCall_8_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AutenticacionUsuario_Impl__CorreoAssignment_4_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8378:1: ( ( ruleEString ) )\n // InternalCeffective.g:8379:2: ( ruleEString )\n {\n // InternalCeffective.g:8379:2: ( ruleEString )\n // InternalCeffective.g:8380:3: ruleEString\n {\n before(grammarAccess.getAutenticacionUsuario_ImplAccess().getCorreoEStringParserRuleCall_4_1_0()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getAutenticacionUsuario_ImplAccess().getCorreoEStringParserRuleCall_4_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AmbienteDespliegue__RecursosAssignment_4_3_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8427:1: ( ( ( ruleEString ) ) )\n // InternalCeffective.g:8428:2: ( ( ruleEString ) )\n {\n // InternalCeffective.g:8428:2: ( ( ruleEString ) )\n // InternalCeffective.g:8429:3: ( ruleEString )\n {\n before(grammarAccess.getAmbienteDespliegueAccess().getRecursosRecursoCrossReference_4_3_1_0()); \n // InternalCeffective.g:8430:3: ( ruleEString )\n // InternalCeffective.g:8431:4: ruleEString\n {\n before(grammarAccess.getAmbienteDespliegueAccess().getRecursosRecursoEStringParserRuleCall_4_3_1_0_1()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getAmbienteDespliegueAccess().getRecursosRecursoEStringParserRuleCall_4_3_1_0_1()); \n\n }\n\n after(grammarAccess.getAmbienteDespliegueAccess().getRecursosRecursoCrossReference_4_3_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__ServidorAplicaciones__ZonaDisponibilidadAssignment_4_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8566:1: ( ( ruleEString ) )\n // InternalCeffective.g:8567:2: ( ruleEString )\n {\n // InternalCeffective.g:8567:2: ( ruleEString )\n // InternalCeffective.g:8568:3: ruleEString\n {\n before(grammarAccess.getServidorAplicacionesAccess().getZonaDisponibilidadEStringParserRuleCall_4_1_0()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getServidorAplicacionesAccess().getZonaDisponibilidadEStringParserRuleCall_4_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Empresa__NombreAssignment_2_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.catalogo.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalCatalogo.g:3316:1: ( ( ruleEString ) )\n // ../org.xtext.catalogo.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalCatalogo.g:3317:1: ( ruleEString )\n {\n // ../org.xtext.catalogo.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalCatalogo.g:3317:1: ( ruleEString )\n // ../org.xtext.catalogo.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalCatalogo.g:3318:1: ruleEString\n {\n before(grammarAccess.getEmpresaAccess().getNombreEStringParserRuleCall_2_1_0()); \n pushFollow(FollowSets000.FOLLOW_ruleEString_in_rule__Empresa__NombreAssignment_2_16503);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getEmpresaAccess().getNombreEStringParserRuleCall_2_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AmbienteDespliegue__RecursosAssignment_4_2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8408:1: ( ( ( ruleEString ) ) )\n // InternalCeffective.g:8409:2: ( ( ruleEString ) )\n {\n // InternalCeffective.g:8409:2: ( ( ruleEString ) )\n // InternalCeffective.g:8410:3: ( ruleEString )\n {\n before(grammarAccess.getAmbienteDespliegueAccess().getRecursosRecursoCrossReference_4_2_0()); \n // InternalCeffective.g:8411:3: ( ruleEString )\n // InternalCeffective.g:8412:4: ruleEString\n {\n before(grammarAccess.getAmbienteDespliegueAccess().getRecursosRecursoEStringParserRuleCall_4_2_0_1()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getAmbienteDespliegueAccess().getRecursosRecursoEStringParserRuleCall_4_2_0_1()); \n\n }\n\n after(grammarAccess.getAmbienteDespliegueAccess().getRecursosRecursoCrossReference_4_2_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AutenticacionFirma__UsuarioAssignment_3_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCeffective.g:8491:1: ( ( ruleEString ) )\n // InternalCeffective.g:8492:2: ( ruleEString )\n {\n // InternalCeffective.g:8492:2: ( ruleEString )\n // InternalCeffective.g:8493:3: ruleEString\n {\n before(grammarAccess.getAutenticacionFirmaAccess().getUsuarioEStringParserRuleCall_3_1_0()); \n pushFollow(FOLLOW_2);\n ruleEString();\n\n state._fsp--;\n\n after(grammarAccess.getAutenticacionFirmaAccess().getUsuarioEStringParserRuleCall_3_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Follow a path down into an Edition and return what is at the end of the path. Fail if at any point there is not precisely one choice. | public FeRangeElement follow(FeEdition edition) {
FeRangeElement result;
FeLabel label;
result = edition;
for (int index = 0; index < edition().count(); index ++ ) {
label = (FeLabel) (edition().get(IntegerPos.make(index)));
result = ((FeEdition) result).get((((FeEdition) result).positionsLabelled(label)).theOne());
}
return result;
/*
udanax-top.st:25106:FePath methodsFor: 'operations'!
{FeRangeElement CLIENT} follow: edition {FeEdition}
"Follow a path down into an Edition and return what is at the end of the path. Fail if at any point there is not precisely one choice."
| result {FeRangeElement} label {FeLabel} |
result := edition.
IntegerVarZero almostTo: self edition count do: [ :index {IntegerVar} |
label := (self edition get: index integer) cast: FeLabel.
result := (result cast: FeEdition) get: ((result cast: FeEdition) positionsLabelled: label) theOne].
^result!
*/
} | [
"@Override\n public MFEDirection next()\n {\n if (!this.isPathValid()) {\n String msg = \"Annotated Path\" + this.getStart().getLocation() + \"->\" +\n this.getGoal().getLocation() + \": Cannot get next step \" +\n \"when path is invalid.\";\n logger.severe(msg);\n throw new IllegalStateException(msg);\n }\n final MFEDirection dir = this.path.poll();\n\n if (dir == null) {\n String msg = \"Annotated Path \" + this.getStart().getLocation() + \"->\" +\n this.getGoal().getLocation() + \": No more steps.\";\n logger.severe(msg);\n throw new NoSuchElementException(msg);\n }\n\n return dir;\n }",
"public String getExcerptionPath() {\n\t\tif (excerPath == null) {\n\t\t\texcerPath = \"\"; //$NON-NLS-1$\n\t\t\t// Lazy Initialization\n\t\t\tVector<Chapter> chaps = new Vector<Chapter>(10);\n\t\t\tChapter currParent = getParent();\n\t\t\twhile (currParent != null) {\n\t\t\t\tchaps.add(currParent);\n\t\t\t\tcurrParent = currParent.getParent();\n\t\t\t}\n\n\t\t\t// Using -2 and not -1 because we want to skip the root\n\t\t\tfor (int i = chaps.size() - 2; i >= 0; i--) {\n\t\t\t\texcerPath += chaps.get(i).name;\n\t\t\t\tif (i != 0) {\n\t\t\t\t\texcerPath += \"/\"; //$NON-NLS-1$\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn excerPath;\n\t}",
"private String getNextLevelPath() {\n String path = levelsPath.get(0);\n levelsPath.remove(0);\n return path;\n }",
"@Override\r\n\tpublic void findPath() {\r\n\t\tPathRoom current = maze.start();\r\n\t\tPosition currentPos = current.getPosition();\r\n\t\t\r\n\t\tmaze.setHasPath(findPath(currentPos.rowNum(), currentPos.colNum()));\r\n\t\t\r\n\t\tif(maze.hasPath()){\r\n\t\t\tfor(PathRoom i: path){\r\n\t\t\t\ti.setOnPath(true);\r\n\t\t\t\treverseP.push(i);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private Vector2 FollowPath() {\n //move to next target if close enough to current target (working in\n //distance squared space)\n if (m_pPath.CurrentWaypoint().dst2(m_pVehicle.getPosition()) < m_dWaypointSeekDistSq) {\n m_pPath.SetNextWaypoint();\n }\n\n if (!m_pPath.Finished()) {\n return Seek(m_pPath.CurrentWaypoint());\n } else {\n return Arrive(m_pPath.CurrentWaypoint(), Deceleration.normal);\n }\n }",
"public SoNode \ngetCurPathTail() \n{\n//#ifdef DEBUG\n if (currentpath.getTail() != (SoFullPath.cast(getCurPath())).getTail()){\n SoDebugError.post(\"SoAction::getCurPathTail\\n\", \n \"Inconsistent path tail. Did you change the scene graph\\n\"+\n \"During traversal?\\n\");\n }\n//#endif /*DEBUG*/\n return(currentpath.getTail());\n}",
"protected Expression parseRemainingPath(Expression start) throws XPathException {\r\n Expression exp = start;\r\n int op = Token.SLASH;\r\n while (true) {\r\n Expression next = parseStepExpression(false);\r\n if (op == Token.SLASH) {\r\n exp = new SlashExpression(exp, next);\r\n } else {\r\n // add implicit descendant-or-self::node() step\r\n AxisExpression descOrSelf = new AxisExpression(Axis.DESCENDANT_OR_SELF, null);\r\n setLocation(descOrSelf);\r\n SlashExpression step = new SlashExpression(descOrSelf, next);\r\n setLocation(step);\r\n exp = new SlashExpression(exp, step);\r\n }\r\n setLocation(exp);\r\n op = t.currentToken;\r\n if (op != Token.SLASH && op != Token.SLSL) {\r\n break;\r\n }\r\n nextToken();\r\n }\r\n return exp;\r\n }",
"private String getPath(Element e) {\n String path = \"\";\n Element parent = e.getParentElement();\n while (parent != null) {\n path = getSyntax(parent) + path;\n parent = parent.getParentElement();\n }\n return path;\n\n }",
"private void selectNextPath(boolean inc) {\n\t\tif (this.allPathsList.size() < 1)\n\t\t\treturn;\n\t\tList<GraphPath<PathwayVertexRep, DefaultEdge>> paths = this.allPathsList.get(this.allPathsList.size() - 1)\n\t\t\t\t.getFirst();\n\t\tif (paths.size() > 1) {\n\t\t\t// System.out.println(\"allPaths.size() > 1\");\n\n\t\t\tif (inc)\n\t\t\t\tselectedPathID++;\n\t\t\telse\n\t\t\t\tselectedPathID--;\n\n\t\t\tif (selectedPathID < 0)\n\t\t\t\tselectedPathID = paths.size() - 1;\n\t\t\tif (selectedPathID > paths.size() - 1)\n\t\t\t\tselectedPathID = 0;\n\n\t\t\tif (allPaths.size() > 0) {\n\t\t\t\tselectedPath = paths.get(selectedPathID);\n\t\t\t\t// System.out.println(\"selectedPathID\"+selectedPathID);\n\t\t\t\tif (selectedPath.getEdgeList().size() > 0 && !isShiftKeyDown) {\n\t\t\t\t\tPathwayVertexRep startPrevVertex = selectedPath.getStartVertex();\n\t\t\t\t\tPathwayVertexRep endPrevVertex = selectedPath.getEndVertex();\n\t\t\t\t\tList<DefaultEdge> edgePrevList = selectedPath.getEdgeList();\n\t\t\t\t\tpreviousSelectedPath = new GraphPathImpl<PathwayVertexRep, DefaultEdge>(pathway, startPrevVertex,\n\t\t\t\t\t\t\tendPrevVertex, edgePrevList, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tselectedPathID = 0;\n\t\t}\n\n\t\t// System.out.println(\"selectedPathID=\"+selectedPathID);\n\t\tthis.allPathsList.get(this.allPathsList.size() - 1).setSecond(selectedPathID);\n\t\tisBubbleTextureDirty = true;\n\t\tsetDisplayListDirty();\n\t\ttriggerPathUpdate();\n\t}",
"private String findPath() {\r\n\t\tTreePath[] paths = tree.getSelectionPaths();\r\n\t\tString temp = \"\";\r\n\t\t\r\n\t\tif(paths != null) {\r\n for (int i = 0; i < paths.length; i++) {\r\n \t\r\n \t//gets the absolute path of the selected directory\r\n \tfor(int j = 0; j < paths[i].getPathCount(); j++) {\r\n \t\tif(j == 0) {\r\n \t\ttemp = temp + paths[i].getPathComponent(j);\r\n \t\t}\r\n \t\telse {\r\n \t\t\ttemp = temp + \"/\" + paths[i].getPathComponent(j);\r\n \t\t}\r\n \t}\r\n }\r\n\t\t}\r\n\t\treturn temp;\r\n\t}",
"@Test\n public void findPathToReturnsStraightLineIfPossible() {\n assertThat(pathPlanner.findPathTo(pt(0.4, 0.6)), is(new Path<>(pt(0.4, 1.6), pt(0.4, 0.6))));\n }",
"public String listFoodChain(){\n\n OrganismNode[] path = new OrganismNode[1000];\n boolean found = false;\n// OrganismNode[] finalPath = new OrganismNode[1000];\n\n try{\n path = cursor.findFoodPath(path, root, cursor, 0);\n }catch(Exception ex)\n {\n System.out.print(\"\");\n }\n\n\n int count = 0;\n\n String pathString = \"\";\n\n while(path[count] != null && !found){\n\n if(path[count].getName().equals(cursor.getName()))\n found = true;\n pathString += path[count].getName();\n if(path[count + 1] != null && !found)\n pathString += \" -> \";\n count++;\n }\n\n return pathString;\n\n }",
"int getEndFromRev();",
"public Path getShortestExitPath(CellInfo start);",
"java.lang.String getParentPath();",
"public void advancePath() {\n start = shortestPath[shortestPath.length - 2]; \n \n // recreate Graph object with new updated maze\n mazeGraph = new Graph(maze);\n mazeGraph.insertEdges(); \n \n // find new path \n pathExists = mazeGraph.findShortestPath(start,end);\n shortestPath = mazeGraph.shortestPath();\n }",
"public abstract DerivationPath getParent();",
"private void findPath(Cell current, Cell destination, Player p){\t\t\n\t\t//get information of currently located cell\n\t\tCoordinate coor = current.getCoor();\n\t\tp.recordPath(coor);\n\t\tint oldScore = p.getScore(coor);\t\t\n\t\t\n\t\t//base case\n\t\tif (current.equals(destination)){\t\t\t\n//\t\t\tSystem.out.println(\"base case\");\n//\t\t\tSystem.out.println(oldScore + \", \" + p.calcScore());\n//\t\t\tSystem.out.println(p.formattedPlayerInfo());\n\t\t\t\n\t\t\t//save the state of the player if a better score at the destination have been achieved\n\t\t\tboolean betterPath = p.updateCellScore(destination.getCoor(), p.calcScore());\n\t\t\tif (betterPath){\n\t\t\t\toptPlayer = p.clone();\n\t\t\t}\n\n\t\t\tp.revertPath();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//get cell gameobject\n\t\tGameObject gobj = current.getGameObj();\n\t\t\n\t\t//capture is set to true if the Pokemon is captured or supplies were obtained\n\t\tboolean capture = false;\n\t\tif (gobj.isActive()){\n\t\t\t//reach pokemon\n\t\t\tif (gobj instanceof Pokemon){\n\t\t\t\tcapture = p.catchPokemon((Pokemon)gobj);\t\t\t\n\t\t\t}\n\t\t\t//reach pokestop\n\t\t\telse if (gobj instanceof Station){\n\t\t\t\tcapture = true;\n\t\t\t\tp.collectStation((Station)gobj);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//check is the player is visiting a visited cell with lower score, end the current recursion if true\n\t\tif (!p.updateCellScore(coor, p.calcScore())){\n\t\t\tp.revertPath();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//proceed the recursion\n\t\tint row = coor.getRow();\n\t\tint col = coor.getCol();\n\t\t\n\t\tCell left = map.getCell(row, col-1);\n\t\tCell right = map.getCell(row, col+1);\n\t\tCell up = map.getCell(row-1, col);\n\t\tCell down = map.getCell(row+1, col);\n\t\t\n\t\tif (left != null && left.getGameObj().isPassable())\n\t\t\tfindPath(left, destination, p);\n\t\tif (right != null && right.getGameObj().isPassable())\n\t\t\tfindPath(right, destination, p);\n\t\tif (up != null && up.getGameObj().isPassable())\n\t\t\tfindPath(up, destination, p);\n\t\tif (down != null && down.getGameObj().isPassable())\n\t\t\tfindPath(down, destination, p);\t\n\t\t\n\t\t//reset the state of the Pokemon or Station if they are used at this recursion\n\t\tif (capture){\n\t\t\tp.rollback(gobj);\n\t\t}\n\t\t\n\t\tp.revertScore(coor, oldScore);\n\t\tp.revertPath();\n\t\treturn;\n\t}",
"public String getRelPath () throws java.io.IOException, com.linar.jintegra.AutomationException;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests a correct service definition list XML parsing. | @Test
public void serviceDefinitionParsingTest() throws MalformedURLException,
IOException, DataParsingException {
DataParser parser = new XMLParser();
ServiceDefinition serviceDefinition = parser
.parseServiceDefinition(netManager.doGet(new URL(BASE_URL
+ "/services/001.xml"), null));
assertEquals(serviceDefinition.getServiceCode(), "DMV66");
Attribute at1 = serviceDefinition.getAttributes().get(0);
assertEquals(at1.isVariable(), true);
assertEquals(at1.getCode(), "WHISHETN");
assertEquals(at1.getDatatype(), Datatype.SINGLEVALUELIST);
assertEquals(at1.isRequired(), true);
assertEquals(at1.getDatatypeDescription(), "");
assertEquals(at1.getOrder(), 1);
assertEquals(at1.getDescription(), "What is the ticket/tag/DL number?");
assertEquals(at1.getValues().get("123"), "Ford");
assertEquals(at1.getValues().get("124"), "Chrysler");
} | [
"@Test\n \tpublic void serviceListParsingTest() throws MalformedURLException,\n \t\t\tIOException, DataParsingException {\n \t\tDataParser parser = new XMLParser();\n \t\tList<Service> services = parser.parseServiceList(netManager.doGet(\n \t\t\t\tnew URL(BASE_URL + \"/services.xml\"), null));\n \t\tassertEquals(services.size(), 2);\n \t\tService service1 = services.get(0);\n \t\tassertEquals(service1.getServiceCode(), \"001\");\n \t\tassertEquals(service1.getServiceName(), \"Cans left out 24x7\");\n \t\tassertEquals(service1.getDescription(),\n \t\t\t\t\"Garbage or recycling cans that have been left \"\n \t\t\t\t\t\t+ \"out for more than 24 hours after collection. \"\n \t\t\t\t\t\t+ \"Violators will be cited.\");\n \t\tassertTrue(service1.hasMetadata());\n \t\tassertEquals(service1.getType(), Type.REALTIME);\n \t\tassertEquals(service1.getGroup(), \"sanitation\");\n \t\tString[] keywordList = service1.getKeywords();\n \t\tassertEquals(keywordList.length, 3);\n \t\tassertEquals(keywordList[0], \"lorem\");\n \t\tassertEquals(keywordList[1], \"ipsum\");\n \t\tassertEquals(keywordList[2], \"dolor\");\n \t}",
"boolean isSetListOfServiceElements();",
"private static void xmlHandler(String xmlText) {\n try {\n // Create a DOM document from the XML text.\n final DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();\n final Document doc = builder.parse(new ByteArrayInputStream(xmlText.getBytes(\"UTF-8\")));\n final Element root = doc.getDocumentElement();\n\n // Loop on all SDT in XML document (there should be only one).\n final NodeList sdtList = root.getElementsByTagName(\"SDT\");\n for (int sdtIndex = 0; sdtIndex < sdtList.getLength(); sdtIndex++) {\n Element sdt = (Element) sdtList.item(sdtIndex);\n\n // Display some SDT properties.\n int version = Integer.decode(sdt.getAttribute(\"version\"));\n int tsId = Integer.decode(sdt.getAttribute(\"transport_stream_id\"));\n int nwId = Integer.decode(sdt.getAttribute(\"original_network_id\"));\n System.out.printf(\"SDT version: %d, TS id: %d, original network id: %d\\n\", version, tsId, nwId);\n\n // Loop on all services in the SDT.\n final NodeList srvList = sdt.getElementsByTagName(\"service\");\n for (int srvIndex = 0; srvIndex < srvList.getLength(); srvIndex++) {\n Element srv = (Element) srvList.item(srvIndex);\n int srvId = Integer.decode(srv.getAttribute(\"service_id\"));\n String srvName = \"(unknown)\";\n String srvProvider = \"(unknown)\";\n // Find first service descriptor, if there is one.\n final NodeList descList = srv.getElementsByTagName(\"service_descriptor\");\n if (descList.getLength() > 0) {\n Element desc = (Element) descList.item(0);\n srvName = desc.getAttribute(\"service_name\");\n srvProvider = desc.getAttribute(\"service_provider_name\");\n }\n System.out.printf(\"Service id: %d, name: \\\"%s\\\", provider: \\\"%s\\\"\\n\", srvId, srvName, srvProvider);\n }\n }\n }\n catch (Exception e) {\n System.err.printf(\"Exception in XML handler: %s\\n\", e.getMessage());\n }\n }",
"@Test\n public void whenParseXMLEntriesThatReturnListValues() {\n List<Entry> entryList = List.of(new Entry(1), new Entry(2), new Entry(3));\n StoreXML storeXML = new StoreXML(new File(\"xmlEntries.xml\"));\n File xml = storeXML.save(entryList);\n File xmlQuotes = new File(\"xmlQuotes.xml\");\n File scheme = new File(\"scheme.xsl\");\n ConvertXSQT convertXSQT = new ConvertXSQT();\n convertXSQT.convert(xml, xmlQuotes, scheme);\n\n XMLEntryParser parser = new XMLEntryParser();\n int result = parser.calculateSumEntriesFromXMLFile(xmlQuotes);\n int expected = 6;\n\n Assert.assertThat(expected, is(result));\n }",
"@Test\n public void getTextFromDefinitionListMatching() {\n browseTo(\"/getTextFromDefinitionList-1.html\", \"getTextFromDefinitionList - 1\");\n assertEquals(\"Should find matching text\",\n \"Value 2\", driverWrapper.getTextFromDefinitionList(\"Item 2\"));\n }",
"boolean isSetServiceConfigurationList();",
"@Test\n public void testGetAccessibilityServiceList() throws Exception {\n List<AccessibilityServiceInfo> expectedServices = new ArrayList<>();\n AccessibilityServiceInfo accessibilityServiceInfo = new AccessibilityServiceInfo();\n accessibilityServiceInfo.packageNames = new String[] { \"foo.bar\" };\n expectedServices.add(accessibilityServiceInfo);\n\n // configure the mock service behavior\n when(mMockService.getInstalledAccessibilityServiceList(anyInt()))\n .thenReturn(expectedServices);\n\n // invoke the method under test\n AccessibilityManager manager = createManager(true);\n List<AccessibilityServiceInfo> receivedServices =\n manager.getInstalledAccessibilityServiceList();\n\n verify(mMockService).getInstalledAccessibilityServiceList(UserHandle.USER_CURRENT);\n // check expected result (list equals() compares it contents as well)\n assertEquals(\"All expected services must be returned\", expectedServices, receivedServices);\n }",
"private static List<String> parseXmlForList(File xmlFile) throws Exception {\r\n\tList<String> list = new ArrayList<String>();\r\n\tDocumentBuilder docBuilder =\r\n\t\tDocumentBuilderFactory.newInstance().newDocumentBuilder();\r\n\tDocument dom = docBuilder.parse(xmlFile);\r\n\tElement nodeElement = dom.getDocumentElement();\r\n\tNodeList nodeList = nodeElement.getChildNodes();\r\n\tif (nodeList != null) {\r\n\t for (int i = 0; i < nodeList.getLength(); i++) {\r\n\t\tNode node = nodeList.item(i);\r\n\t\tif (node.getNodeName().equalsIgnoreCase(ITEM_NODE_NAME)) {\r\n\t\t String value =\r\n\t\t\t node.getAttributes().getNamedItem(\r\n\t\t\t\t VALUE_ATTRIBUTE_NAME).getNodeValue();\r\n\t\t list.add(value);\r\n\t\t}\r\n\t }\r\n\t}\r\n\treturn list;\r\n }",
"public void testElementListWithFormat() {\n ElementListWithFormatTestDTO obj = new ElementListWithFormatTestDTO();\n obj.elementList = new ArrayList<Date>();\n obj.elementList.add(getDateForFormat(\"28.02.2007:15:21:27\"));\n obj.elementList.add(getDateForFormat(\"01.03.2007:15:21:27\"));\n assertTrue(JSefaTestUtil.serialize(XML, obj).indexOf(\"28.02.2007:15:21:27\") >= 0);\n assertTrue(JSefaTestUtil.serialize(XML, obj).indexOf(\"01.03.2007:15:21:27\") >= 0);\n }",
"public void setServiceList(java.lang.String[] serviceList) {\r\n this.serviceList = serviceList;\r\n }",
"void setListOfServiceElements(com.icare.eai.schema.om.evSORequest.ListOfServiceElementsComplexType listOfServiceElements);",
"@Test\n \tpublic void serviceRequestsTest() throws MalformedURLException,\n \t\t\tIOException, DataParsingException {\n \t\tDataParser parser = new XMLParser();\n \t\tList<ServiceRequest> list = parser.parseServiceRequests(netManager\n \t\t\t\t.doGet(new URL(BASE_URL + \"/requests.xml\"), null));\n \t\tassertEquals(list.size(), 2);\n \t\tServiceRequest sr1 = list.get(0);\n \t\tassertEquals(sr1.getServiceRequestId(), \"638344\");\n \t\tassertEquals(sr1.getStatus(), Status.CLOSED);\n \t\tassertEquals(sr1.getStatusNotes(), \"Duplicate request.\");\n \t\tassertEquals(sr1.getServiceName(), \"Sidewalk and Curb Issues\");\n \t\tassertEquals(sr1.getServiceCode(), \"006\");\n \t\tassertEquals(sr1.getDescription(), \"\");\n \t\tassertEquals(sr1.getAgencyResponsible(), \"\");\n \t\tassertEquals(sr1.getServiceNotice(), \"\");\n \t\tDateParsingUtils dateParser = DateParsingUtils.getInstance();\n \n \t\t/*\n \t\t * These three following tests do parsing and printing in order to avoid\n \t\t * timezone differences.\n \t\t */\n \t\tassertEquals(\n \t\t\t\tDateParsingUtils.getInstance().printDate(\n \t\t\t\t\t\tsr1.getRequestedDatetime()),\n \t\t\t\tdateParser.printDate(dateParser\n \t\t\t\t\t\t.parseDate(\"2010-04-14T06:37:38-08:00\")));\n \t\tassertEquals(\n \t\t\t\tDateParsingUtils.getInstance().printDate(\n \t\t\t\t\t\tsr1.getUpdatedDatetime()),\n \t\t\t\tdateParser.printDate(dateParser\n \t\t\t\t\t\t.parseDate(\"2010-04-14T06:37:38-08:00\")));\n \t\tassertEquals(\n \t\t\t\tDateParsingUtils.getInstance().printDate(\n \t\t\t\t\t\tsr1.getExpectedDatetime()),\n \t\t\t\tdateParser.printDate(dateParser\n \t\t\t\t\t\t.parseDate(\"2010-04-15T06:37:38-08:00\")));\n \t\tassertEquals(sr1.getAddress(), \"8TH AVE and JUDAH ST\");\n \t\tassertEquals(sr1.getAddressId(), \"545483\");\n \t\tassertEquals(sr1.getZipCode(), 94122);\n \t\tassertTrue(sr1.getLatitude() == 37.762221815F);\n \t\tassertTrue(sr1.getLongitude() == -122.4651145F);\n \t\tassertEquals(sr1.getMediaUrl(), new URL(\n \t\t\t\t\"http://city.gov.s3.amazonaws.com/requests/media/638344.jpg\"));\n \t}",
"private void parseEntityServiceMapperXMLFile() {\r\n //Read the xml file\r\n InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(\r\n ENTITY_SERVICE_MAPPER_FILENAME);\r\n if (inputStream == null) {\r\n throw new RuntimeException(\"File not found: \" + ENTITY_SERVICE_MAPPER_FILENAME);\r\n }\r\n\r\n //Parse xml into the Document\r\n Document document = null;\r\n try {\r\n document = new SAXReader().read(inputStream);\r\n } catch (DocumentException e) {\r\n throw new RuntimeException(\"Unable to parse XML file: \" + ENTITY_SERVICE_MAPPER_FILENAME, e);\r\n }\r\n\r\n //Traverse and fetch the data from the Document\r\n Element entityServiceMapperElement = document.getRootElement();\r\n if (entityServiceMapperElement != null) {\r\n List<Element> serviceElementList = entityServiceMapperElement.elements(SERVICE);\r\n if (serviceElementList == null || serviceElementList.isEmpty()) {\r\n throw new RuntimeException(\"Invalid XML file: Service entries not found.\");\r\n }\r\n registerServiceElements(serviceElementList);\r\n\r\n List<Element> entityElementList = entityServiceMapperElement.elements(ENTITY);\r\n if (entityElementList == null || entityElementList.isEmpty()) {\r\n throw new RuntimeException(\"Invalid XML file: Entity entries not found.\");\r\n }\r\n registerEntityElements(entityElementList);\r\n } else {\r\n throw new RuntimeException(\"Invalid XML file: Root element not found.\");\r\n }\r\n }",
"public static void parse() {\r\n ((ItemDefinitionService) World.getWorld().getApplicationContext().\r\n getBean(\"itemDefinitionService\")).initializeDefinitions();\r\n }",
"public List validateSLD(InputStream xml, ServletContext servContext) {\n \t// a riminder not to use the data directory for the schemas\n \t//String url = GeoserverDataDirectory.getGeoserverDataDirectory(servContext).toString();\n \tFile schemaFile = new File(servContext.getRealPath(\"/\"),\n \"/schemas/sld/StyledLayerDescriptor.xsd\");\n \n try {\n return validateSLD(xml, schemaFile.toURL().toString());\n } catch (Exception e) {\n ArrayList al = new ArrayList();\n al.add(new SAXException(e));\n \n return al;\n }\n }",
"@Test\n public void testGetDescList() throws FileNotFoundException {\n System.out.println(\"getDescList\");\n int i = 0;\n DecidePeriodServiceController instance = new DecidePeriodServiceController();\n AssociationProviderRequestRecords aprr = AppGPSD.getInstance().getCompany().getAssociationRecords();\n ServiceProvider sp = new ServiceProvider(\"andre Nuno\", \"andre\", 123456789, 919999999, \"andrenuno@gmail.com\");\n PostalCode pc = new PostalCode(\"4000-9\");\n PostalAddress pa = new PostalAddress(\"Porto\", pc, \"Paredes\");\n Client cli = new Client(\"Name\", \"123456789\", \"987654321\", \"Email\", pa);\n ServiceProvidingRequest request = new ServiceProvidingRequest(cli, pa);\n ServiceProvidingRequestRecords m_servProvRequest = AppGPSD.getInstance().getCompany().getServiceProvidingRequestRecords();\n ServiceProvidingRequest requestTest = m_servProvRequest.newRequest(cli, pa);\n List<ServiceProvidingRequestDescription> requestDesc = new ArrayList<>();\n CategoryRecords cr = AppGPSD.getInstance().getCompany().getCategoryRecords();\n Category cat = new Category(\"1\", \"Plumber\");\n cr.addCategory(cat);\n Category cat1 = cr.getCategoryById(\"1\");\n FixedService serv1 = new FixedService(\"1\", \"Light Plumbing\", \"Install water tap\", 100, cat1);\n ServiceRecords sr = AppGPSD.getInstance().getCompany().getServiceRecords();\n sr.registersService(serv1);\n ServiceProvidingRequestDescription desc = new ServiceProvidingRequestDescription(serv1, \"ola\", 30);\n requestDesc.add(desc);\n aprr.addAssociation(sp, request);\n instance.getListAssociatedClient();\n List<ServiceProvidingRequestDescription> expResult = new ArrayList<ServiceProvidingRequestDescription>();\n List<ServiceProvidingRequestDescription> result = instance.getDescList(i);\n assertEquals(expResult, result);\n }",
"private ArrayList<Integer> parseXSD(String s, ArrayList<Integer> match){\n String xmlversion = \"((\\\\<\\\\?)\\\\s*(xml)\\\\s+(version)\\\\s*(=)\\\\s*(\\\".*?\\\")\\\\s*(\\\\?\\\\>))\";\n String attribDefault = \"((attributeFormDefault)\\\\s*(=)\\\\s*(\\\"qualified\\\"))\";\n String elementDefault = \"((elementFormDefault)\\\\s*(=)\\\\s*(\\\"qualified\\\"))\";\n String schema1 = \"^(\\\\<(schema)\\\\s+\"+ attribDefault + \"\\\\s+\" + elementDefault + \"\\\\s*(\\\\>))$\";\n String schema2 = \"^(\\\\<(schema)\\\\s+\"+ elementDefault + \"\\\\s+\" + attribDefault + \"\\\\s*(\\\\>))$\";\n String tableName = \"^((<xsd:complexType)\\\\s+(name)\\\\s*(=)\\\\s*(\\\".+\\\")\\\\s*(\\\\>))$\";\n String name = \"(name(\\\\s*)(=)\\\\4(\\\\\\\"\\\\w+?\\\\\\\")\\\\2)\";\n String type = \"(type\\\\4\\\\5\\\\4(\\\\\\\"(xsd:)(string|int(eger)?|(date)|(decimal))\\\\\\\")\\\\2)\";\n String date = \"(\\\\2fraction\\\\4\\\\5\\\\4(\\\\\\\"\\\\d+\\\\\\\")\\\\4)\";\n String fraction = \"(\\\\2date\\\\4\\\\5\\\\4(\\\\\\\"mm\\\\/dd\\\\/(yy)?yy\\\\\\\"))\";\n String maxo = \"(maxOccurs\\\\4\\\\5(\\\\\\\"\\\\d+\\\\\\\")\\\\2)\";\n String mino = \"(minOccurs\\\\4\\\\5\\\\4(\\\\\\\"\\\\d+\\\\\\\")\\\\4)\";\n String field3 = \"^(<xsd:\\\\w+?(\\\\s+)\" + name + type + maxo + mino + \"\\\\4\" + fraction + \"?\\\\s*\" + date+ \"?\\\\s*(\\\\/>))$\";\n String field4 = \"^(<xsd:\\\\w+?(\\\\s+)\" + type + name + maxo + mino + \"\\\\4\" + fraction + \"?\\\\s*\" + date+ \"?\\\\s*(\\\\/>))$\";\n String field1 = \"^(<xsd:\\\\w+?(\\\\s+)name(\\\\s*)(=)\\\\3(\\\"\\\\w+?\\\")\\\\2(type\\\\3\\\\4\\\\3(\\\"(xsd:)(string|int(eger)?|(date)|(decimal))\\\")\\\\2)(maxOccurs\\\\3\\\\4(\\\"\\\\d+\\\")\\\\2)(minOccurs\\\\3\\\\4\\\\3(\\\"\\\\d+\\\")\\\\3)\\\\3(\\\\2fraction\\\\3\\\\4\\\\3(\\\"\\\\d+\\\")\\\\3)?\\\\s*(\\\\2date\\\\3\\\\4\\\\3(\\\"mm\\\\/dd\\\\/(yy)?yy\\\"))?\\\\s*(\\\\/>))$\";\n String field2 = \"^(<xsd:\\\\w+?(\\\\s+)name(\\\\s*)(=)\\\\3(\\\"\\\\w+?\\\")\\\\2(type\\\\3\\\\4\\\\3(\\\"(xsd:)(string|int(eger)?|(date)|(decimal))\\\")\\\\2)(minOccurs\\\\3\\\\4\\\\3(\\\"\\\\d+\\\")\\\\2)(maxOccurs\\\\3\\\\4(\\\"\\\\d+\\\")\\\\3)\\\\3(\\\\2fraction\\\\3\\\\4\\\\3(\\\"\\\\d+\\\")\\\\3)?\\\\s*(\\\\2date\\\\3\\\\4\\\\3(\\\"mm\\\\/dd\\\\/(yy)?yy\\\"))?\\\\s*(\\\\/>))$\";\n String closeTable = \"^(<\\\\/xsd:complexType>)$\";\n String closeSchema = \"^(<\\\\/schema>)$\";\n String error = \"***Error- \";\n int last = match.size()-1;\n if (match.get(last) == 1){\n// Matcher m = Pattern.compile(xmlversion).matcher(s);\n// boolean b = m.find();\n if(s.matches(xmlversion)){\n match.add(2);\n }else {\n System.out.println(error + \"xml version tag should be on the very top of xsd file.\");\n match.add(8);\n }\n } else if(match.get(last)==2){\n Matcher m = Pattern.compile(schema1).matcher(s);\n boolean b = m.find();\n if(b){\n match.add(3);\n }else {\n Matcher m2 = Pattern.compile(schema2).matcher(s);\n boolean b2 = m2.find();\n if(b2) {\n match.add(3);\n }else {\n System.out.println(error + \"no schema tag provided in xsd file.\");\n match.add(8);\n }\n }\n } else if(match.get(last)==3){\n Matcher m = Pattern.compile(tableName).matcher(s);\n boolean b = m.find();\n if(b){\n match.add(4);\n }else {\n System.out.println(error + \"no complexType provided in xsd file\");\n match.add(8);\n }\n } else if(match.get(last) == 4){\n Matcher m = Pattern.compile(field1).matcher(s);\n boolean b = m.find();\n if(b){\n if(XSDErrorChecks(m.group())){\n match.add(8);\n }else {\n match.add(4);\n }\n }else {\n Matcher m2 = Pattern.compile(field2).matcher(s);\n boolean b2 = m2.find();\n if(b2) {\n if(XSDErrorChecks(m2.group()))\n match.add(8);\n else {match.add(4);}\n }else {\n Matcher m3 = Pattern.compile(closeTable).matcher(s);\n boolean b3 = m3.find();\n if(b3){\n match.add(5);\n match.add(6);\n }else {\n if(s.matches(\"(.*)(xsd:element)(.*)\")){\n System.out.println(error + \"xsd:element syntax\");\n }else if(match.get(last)==4 && match.get(last-1)==4){\n System.out.println(error + \"complexType tag is not closed properly\");\n }else {\n System.out.println(error + \"no elements are provided under complexType in xsd file\");\n }\n match.add(8);\n }\n }\n }\n } else if(match.get(last) == 6){\n Matcher m = Pattern.compile(closeSchema).matcher(s);\n boolean b = m.find();\n if(b){\n match.add(7);\n }else {\n System.out.println(error + \"schema tag not closed in xsd file\"); match.add(8);\n }\n } else if(match.get(last) == 7){\n System.out.println(error + s + \" string is found after closed schema tag. \\n Program ignores everything after closed schema tag.\");\n match.add(8);\n }\n return match;\n }",
"public void testXMLParsing() throws ParserException {\n tpcs = new TestParserContextStack(ALL_XML_ATTRS);\n TestWordReader wordReader = new TestWordReader();\n Parser parser = new Parser(tpcs);\n parser.addWordReader( wordReader );\n parser.parse( XML_STREAM );\n wordReader.checkResult( XML_STREAM );\n }",
"public void testParseServiceDescriptor() throws IOException {\n\n ServiceDescriptor sd;\n StringBuilder bodyBuilder = new StringBuilder();\n BufferedReader in = new BufferedReader(new InputStreamReader(\n new FileInputStream(new File(\"./YAML/sonata-demo.yml\")), Charset.forName(\"UTF-8\")));\n String line;\n while ((line = in.readLine()) != null)\n bodyBuilder.append(line + \"\\n\\r\");\n in.close();\n ObjectMapper mapper = new ObjectMapper(new YAMLFactory());\n mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);\n sd = mapper.readValue(bodyBuilder.toString(), ServiceDescriptor.class);\n\n assertNotNull(sd.getDescriptor_version());\n assertNotNull(sd.getVendor());\n assertNotNull(sd.getName());\n assertNotNull(sd.getVersion());\n assertNotNull(sd.getAuthor());\n assertNotNull(sd.getDescription());\n assertTrue(sd.getNetwork_functions().size() > 0);\n assertTrue(sd.getConnection_points().size() > 0);\n assertTrue(sd.getVirtual_links().size() > 0);\n assertTrue(sd.getForwarding_graphs().size() > 0);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find books by genre | public List<Books> findBooksByGenre(String genre) {
HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
List<Genre> list = new ArrayList();
Genre g = new Genre();
g.setType(genre);
list.add(g);
session.setAttribute("lastGenre",list);
return bookController.findBooksByGenre(genre);
} | [
"public ArrayList<Film> searchByGenre(Genre genre);",
"List<Genre> searchByTitle(String title);",
"private static void queryBooksByGenre(){\n\t\tSystem.out.println(\"===Query Books By Genre===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter Genre to Query Books by: \");\n\t\tString genre = string_input.next();\n\t\tint genre_index = getGenreIndex(genre); //returns the index of the genre entered, in ALL_GENRES\n\t\t\n\t\tif(genre_index > -1){//valid genre was entered\n\t\t\tIterator<String> iter = ALL_GENRES.get(genre_index).iterator();\n\t\t\tSystem.out.println(\"All \" + genre + \" books are: \");\n\t\t\tprintAllElements(iter);\n\t\t}\n\t}",
"List<Author> getAuthorByGenre(String genre);",
"public List<Film> findAllByGenre(String genre);",
"public void browseGenre(String genre) {\n for (int i = 0; i < libraryDatabase.getMediaDatabase().size(); i++) {\n String MediaGenre = (libraryDatabase.getMediaDatabase().get(i)).getGenre();\n if (genre.equals(MediaGenre)) {\n System.out.println(libraryDatabase.getMediaDatabase().get(i));\n }\n }\n }",
"Genre getGenre(int genreId);",
"ArrayList<FilmData> filterByGenre(String genre){\n \tArrayList<FilmData> filteredSet = new ArrayList<FilmData>();\n \tfor(FilmData film: films){\n \t\tif(film.getGenres().contains(genre)){\n \t\t\tfilteredSet.add(film);\n \t\t}\n \t}\n \treturn filteredSet;\n }",
"@Query(\"select b from Book b where b.genre =:genre and b.available =:available\")\n List<Book> findBooksByGenre(String genre, boolean available);",
"public ArrayList<Show> searchGenre(String genre) {\n\t\tArrayList<Show> matches = new ArrayList<Show>();\n\t\tfor (Venue venue : venues) {\n\t\t\tfor (Theater theater : venue.theaters) {\n\t\t\t\tfor (Show show : theater.shows) {\n\t\t\t\t\tif (show.genre.equalsIgnoreCase(genre))\n\t\t\t\t\t\tmatches.add(show);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn matches;\n\t}",
"Genre findById(Long id);",
"Page<Book> findByPublisherAndGenreAndYear(\n String publisher,\n String genre,\n String year,\n Pageable pageable);",
"public void showGenre(Genre genre) {\n for (Record r : cataloue) {\n if (r.getGenre() == genre) {\n System.out.println(r);\n }\n }\n\n }",
"List<Genre> getFilmGenres(int filmId);",
"Genre findByDescription(@Param(\"description\") String description);",
"public ArrayList<String> searchMoviebyGenre(String name){\n\t\tArrayList<String> moviesByGenre = new ArrayList<String>(); \n\t\ttry (Transaction tx = getDbsiIMDB().beginTx()) {\n\t\t\tNode gNode = getDbsiIMDB().findNode(genreLabel, \"name\", name);\n\t\t\tif(gNode == null){\n\t\t\t\treturn moviesByGenre;\n\t\t\t}else{\n\t\t\t\tfor (Relationship r : gNode.getRelationships()) {\n\t\t\t\t\tNode tempMovie = r.getEndNode();\n\t\t\t\t\tmoviesByGenre.add((String)tempMovie.getProperty(\"name\"));\n\t\t\t\t}\n\t\t\t\ttx.success();\n\t\t\t\tSystem.out.println(moviesByGenre);\n\t\t\t}\n\t\t}catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t}\t\n\t\treturn moviesByGenre;\n\t}",
"@Secured({\"ROLE_USER\", \"ROLE_ADMIN\"}) \r\n\t@Query(\"SELECT m FROM Movie m INNER JOIN m.genres g WHERE g.genreID IN (:genreID)\")\r\n\tList<Movie> findByGenreID(@Param(\"genreID\") Long genreID);",
"Book getBookByTitle(String title);",
"@Query(\"select b from Book b where b.available =:available and b.genre =:genre and b.author in (select a from Author a where a.name =:author_name)\")\n List<Book> findBooksByGenreAuthor(String genre, String author_name, boolean available);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "rule__Enum__Group__11__Impl" $ANTLR start "rule__Enum__Group__12" InternalMyDsl.g:1576:1: rule__Enum__Group__12 : rule__Enum__Group__12__Impl rule__Enum__Group__13 ; | public final void rule__Enum__Group__12() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalMyDsl.g:1580:1: ( rule__Enum__Group__12__Impl rule__Enum__Group__13 )
// InternalMyDsl.g:1581:2: rule__Enum__Group__12__Impl rule__Enum__Group__13
{
pushFollow(FOLLOW_5);
rule__Enum__Group__12__Impl();
state._fsp--;
pushFollow(FOLLOW_2);
rule__Enum__Group__13();
state._fsp--;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
restoreStackSize(stackSize);
}
return ;
} | [
"public final void rule__Enum__Group__11() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1553:1: ( rule__Enum__Group__11__Impl rule__Enum__Group__12 )\n // InternalMyDsl.g:1554:2: rule__Enum__Group__11__Impl rule__Enum__Group__12\n {\n pushFollow(FOLLOW_18);\n rule__Enum__Group__11__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Enum__Group__12();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group__8() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1472:1: ( rule__Enum__Group__8__Impl rule__Enum__Group__9 )\n // InternalMyDsl.g:1473:2: rule__Enum__Group__8__Impl rule__Enum__Group__9\n {\n pushFollow(FOLLOW_16);\n rule__Enum__Group__8__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Enum__Group__9();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group__13() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1607:1: ( rule__Enum__Group__13__Impl )\n // InternalMyDsl.g:1608:2: rule__Enum__Group__13__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Enum__Group__13__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group__2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1310:1: ( rule__Enum__Group__2__Impl rule__Enum__Group__3 )\n // InternalMyDsl.g:1311:2: rule__Enum__Group__2__Impl rule__Enum__Group__3\n {\n pushFollow(FOLLOW_17);\n rule__Enum__Group__2__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Enum__Group__3();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group__10() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1526:1: ( rule__Enum__Group__10__Impl rule__Enum__Group__11 )\n // InternalMyDsl.g:1527:2: rule__Enum__Group__10__Impl rule__Enum__Group__11\n {\n pushFollow(FOLLOW_18);\n rule__Enum__Group__10__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Enum__Group__11();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group_11__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1688:1: ( rule__Enum__Group_11__0__Impl rule__Enum__Group_11__1 )\n // InternalMyDsl.g:1689:2: rule__Enum__Group_11__0__Impl rule__Enum__Group_11__1\n {\n pushFollow(FOLLOW_21);\n rule__Enum__Group_11__0__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Enum__Group_11__1();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group__9() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1499:1: ( rule__Enum__Group__9__Impl rule__Enum__Group__10 )\n // InternalMyDsl.g:1500:2: rule__Enum__Group__9__Impl rule__Enum__Group__10\n {\n pushFollow(FOLLOW_21);\n rule__Enum__Group__9__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Enum__Group__10();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group__11__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1565:1: ( ( ( rule__Enum__Group_11__0 )* ) )\n // InternalMyDsl.g:1566:1: ( ( rule__Enum__Group_11__0 )* )\n {\n // InternalMyDsl.g:1566:1: ( ( rule__Enum__Group_11__0 )* )\n // InternalMyDsl.g:1567:2: ( rule__Enum__Group_11__0 )*\n {\n before(grammarAccess.getEnumAccess().getGroup_11()); \n // InternalMyDsl.g:1568:2: ( rule__Enum__Group_11__0 )*\n loop9:\n do {\n int alt9=2;\n int LA9_0 = input.LA(1);\n\n if ( (LA9_0==26) ) {\n alt9=1;\n }\n\n\n switch (alt9) {\n \tcase 1 :\n \t // InternalMyDsl.g:1568:3: rule__Enum__Group_11__0\n \t {\n \t pushFollow(FOLLOW_19);\n \t rule__Enum__Group_11__0();\n\n \t state._fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop9;\n }\n } while (true);\n\n after(grammarAccess.getEnumAccess().getGroup_11()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void ruleEnum() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalReflex.g:484:2: ( ( ( rule__Enum__Group__0 ) ) )\n // InternalReflex.g:485:2: ( ( rule__Enum__Group__0 ) )\n {\n // InternalReflex.g:485:2: ( ( rule__Enum__Group__0 ) )\n // InternalReflex.g:486:3: ( rule__Enum__Group__0 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getEnumAccess().getGroup()); \n }\n // InternalReflex.g:487:3: ( rule__Enum__Group__0 )\n // InternalReflex.g:487:4: rule__Enum__Group__0\n {\n pushFollow(FOLLOW_2);\n rule__Enum__Group__0();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getEnumAccess().getGroup()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group__2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../com.mguidi.soa.ui/src-gen/com/mguidi/soa/ui/contentassist/antlr/internal/InternalSOA.g:1932:1: ( rule__Enum__Group__2__Impl rule__Enum__Group__3 )\n // ../com.mguidi.soa.ui/src-gen/com/mguidi/soa/ui/contentassist/antlr/internal/InternalSOA.g:1933:2: rule__Enum__Group__2__Impl rule__Enum__Group__3\n {\n pushFollow(FOLLOW_rule__Enum__Group__2__Impl_in_rule__Enum__Group__23940);\n rule__Enum__Group__2__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__Enum__Group__3_in_rule__Enum__Group__23943);\n rule__Enum__Group__3();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void ruleEnum() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:316:2: ( ( ( rule__Enum__Group__0 ) ) )\n // InternalMyDsl.g:317:2: ( ( rule__Enum__Group__0 ) )\n {\n // InternalMyDsl.g:317:2: ( ( rule__Enum__Group__0 ) )\n // InternalMyDsl.g:318:3: ( rule__Enum__Group__0 )\n {\n before(grammarAccess.getEnumAccess().getGroup()); \n // InternalMyDsl.g:319:3: ( rule__Enum__Group__0 )\n // InternalMyDsl.g:319:4: rule__Enum__Group__0\n {\n pushFollow(FOLLOW_2);\n rule__Enum__Group__0();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getEnumAccess().getGroup()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group__3() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1337:1: ( rule__Enum__Group__3__Impl rule__Enum__Group__4 )\n // InternalMyDsl.g:1338:2: rule__Enum__Group__3__Impl rule__Enum__Group__4\n {\n pushFollow(FOLLOW_16);\n rule__Enum__Group__3__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Enum__Group__4();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1256:1: ( rule__Enum__Group__0__Impl rule__Enum__Group__1 )\n // InternalMyDsl.g:1257:2: rule__Enum__Group__0__Impl rule__Enum__Group__1\n {\n pushFollow(FOLLOW_4);\n rule__Enum__Group__0__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Enum__Group__1();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group__6() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1418:1: ( rule__Enum__Group__6__Impl rule__Enum__Group__7 )\n // InternalMyDsl.g:1419:2: rule__Enum__Group__6__Impl rule__Enum__Group__7\n {\n pushFollow(FOLLOW_18);\n rule__Enum__Group__6__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Enum__Group__7();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group__2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalReflex.g:4908:1: ( rule__Enum__Group__2__Impl rule__Enum__Group__3 )\n // InternalReflex.g:4909:2: rule__Enum__Group__2__Impl rule__Enum__Group__3\n {\n pushFollow(FOLLOW_5);\n rule__Enum__Group__2__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n pushFollow(FOLLOW_2);\n rule__Enum__Group__3();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group_11__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1715:1: ( rule__Enum__Group_11__1__Impl )\n // InternalMyDsl.g:1716:2: rule__Enum__Group_11__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Enum__Group_11__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../com.mguidi.soa.ui/src-gen/com/mguidi/soa/ui/contentassist/antlr/internal/InternalSOA.g:1884:1: ( ( '@enum' ) )\n // ../com.mguidi.soa.ui/src-gen/com/mguidi/soa/ui/contentassist/antlr/internal/InternalSOA.g:1885:1: ( '@enum' )\n {\n // ../com.mguidi.soa.ui/src-gen/com/mguidi/soa/ui/contentassist/antlr/internal/InternalSOA.g:1885:1: ( '@enum' )\n // ../com.mguidi.soa.ui/src-gen/com/mguidi/soa/ui/contentassist/antlr/internal/InternalSOA.g:1886:1: '@enum'\n {\n before(grammarAccess.getEnumAccess().getEnumKeyword_0()); \n match(input,34,FOLLOW_34_in_rule__Enum__Group__0__Impl3849); \n after(grammarAccess.getEnumAccess().getEnumKeyword_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1283:1: ( rule__Enum__Group__1__Impl rule__Enum__Group__2 )\n // InternalMyDsl.g:1284:2: rule__Enum__Group__1__Impl rule__Enum__Group__2\n {\n pushFollow(FOLLOW_16);\n rule__Enum__Group__1__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Enum__Group__2();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Enum__Group__7() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:1445:1: ( rule__Enum__Group__7__Impl rule__Enum__Group__8 )\n // InternalMyDsl.g:1446:2: rule__Enum__Group__7__Impl rule__Enum__Group__8\n {\n pushFollow(FOLLOW_20);\n rule__Enum__Group__7__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Enum__Group__8();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a module to the gadget by copying the original module file to the currently expanded gadget directory | public IGadget AddModuleToGadget(IGadget gadget, IModule module) throws Exception {
if(gadget != null && gadget instanceof IGadget){
if(module != null && module instanceof Module){
int hasAlreadyCount = 0;
boolean hasMoreThanOne = false;
for(int i = 0; i < gadget.getModules().length; i++){
if(gadget.getModules()[i].getName().startsWith((module.getName()))){
hasAlreadyCount ++;
hasMoreThanOne = true;
}
}
//Count the number of modules and increment the name
String moduleName = module.getName();
if(hasMoreThanOne){
moduleName = module.getName() + "_" + hasAlreadyCount;
}
//copy the module to the base directory of the gadget
//get the file copy it to the book directory, unpack it to a subfolder
Gadget gadgetBase = (Gadget) gadget;
Module moduleOriginal = (Module)module;
File moduleFileOriginal = moduleOriginal.getPackedFile();
File outDirectory = new File(gadgetBase.getTempDirectory() + File.separator + moduleName);
if(!outDirectory.exists()){
outDirectory.mkdir();
}
File moduleFileNew = new File(outDirectory + File.separator + moduleName + ".module");
Base.copyFile(moduleFileOriginal, moduleFileNew);
ModuleFactory factory = new ModuleFactory();
try {
IModule copiedGadget = factory.loadModule(moduleFileNew, outDirectory.getPath(), true);
File f =new File(copiedGadget.getSketchFile().getParentFile().getPath()
+ File.separator + moduleName + ".pde");
copiedGadget.getSketchFile().renameTo(f);
copiedGadget.setSketchFile(f);
copiedGadget.setName(moduleName);
IPackedFile pf = (IPackedFile)copiedGadget;
String packedFileName = ((IPackedFile)copiedGadget).getPackedFile().getParentFile().getParentFile().getPath() + File.separator + moduleName + ".module";
pf.setPackedFile(new File(packedFileName));
factory.WriteModuleToFile(copiedGadget, outDirectory.getPath());
factory.CreateModuleXML(copiedGadget);
IModule[] oldGadgets = gadget.getModules();
IModule[] newGadgets = new IModule[oldGadgets.length + 1];
for(int i=0; i<oldGadgets.length; i++)
{
newGadgets[i] = oldGadgets[i];
}
newGadgets[newGadgets.length - 1] = copiedGadget;
gadget.setModule(newGadgets);
return gadget;
} catch (Exception e) {
System.out.println("Error adding gadget to sketch");
e.printStackTrace();
}
}
}
throw new Exception("Error creating gadget");
} | [
"IModule addModule(String name, IModule module);",
"private void duplicateModule(ModuleFrame moduleFrame) {\n try {\n //Marshall the existing module to a file then read it in again\n //This avoids having to deal with cloning objects\n Module module = moduleFrame.getModule();\n String moduleName = module.getModuleName();\n File tempFile = File.createTempFile(\"CRAM\", \"mamx\");\n tempFile.deleteOnExit();\n ModuleMarshaller marshaller = new ModuleMarshaller(tempFile);\n marshaller.marshallModule(module);\n ModuleUnmarshaller unmarshaller = new ModuleUnmarshaller(tempFile);\n Module duplicateModule = unmarshaller.unmarshallModule();\n String duplicateModuleName = moduleName + \" (Copy)\";\n duplicateModule.setModuleName(duplicateModuleName);\n addModule(duplicateModule, null, duplicateModuleName);\n } catch (IOException | JAXBException ex) {\n LOGGER.log(Level.SEVERE, \"Unable to duplicate module\", ex);\n JOptionPane.showMessageDialog(moduleFrame, \"See log for details\", \"Unable to duplicate module\", JOptionPane.ERROR_MESSAGE);\n }\n \n }",
"public void syncModuleAddition()\n {\n syncModuleTree();\n }",
"public void addModule( TapModule module )\n {\n //check for classname\n int count = tree.getChildNodeCount( tree.getRootNode() );\n TreePath selectedNode = tree.getSelectedNode();\n TreePath classTreePath = null;\n for ( int j = count - 1; j >= 0; --j )\n {\n TreePath tp = tree.getChildNode( tree.getRootNode(), j );\n String className = ( (ModuleTypeInfo) ( (DefaultMutableTreeNode) tp.getLastPathComponent() ).getUserObject() ).toString();\n if ( className.equals( module.getModuleTypeInfo().toString() ) )\n classTreePath = tp;\n }\n if ( classTreePath == null )\n classTreePath = tree.addNode( tree.getRootNode(), new DefaultMutableTreeNode( module.getModuleTypeInfo() ) );\n DefaultMutableTreeNode tn;\n TreePath modulePath = tree.addNode( classTreePath, tn = new DefaultMutableTreeNode( module ) );\n if ( module.getNumEditWidgets() <= 1 )\n tn.setAllowsChildren( false );\n else\n {\n for ( int i = 0; i < module.getNumEditWidgets(); ++i )\n {\n tn = new DefaultMutableTreeNode( new ModuleTreeChild( module.getEditWidgetName( i ), i ) );\n tree.addNode( modulePath, tn );\n tn.setAllowsChildren( false );\n }\n }\n ( (DefaultTreeModel) tree.getModel() ).reload();\n setDividerLocation( getChild( 0 ).getPreferredSize().width );\n if ( selectedNode != null )\n {\n ( (JTree) tree.getComponent() ).collapsePath( selectedNode );\n tree.setNodeSelected( selectedNode, true );\n doSelectionChanged();\n }\n\n }",
"public void addModule(Module module, String name) {\n module.parentMobile = this;\n modules.put(name, module);\n if(module instanceof LightSource)\n Scene.addLightSource((LightSource) module);\n }",
"public String copyModule(String sourceModuleName,\n String destModuleName) throws SerializationException;",
"private void addModule(ZipOutputStream out, File file) throws IOException\n\t{\n\t\tif (file.isDirectory())\n\t\t{\n\t\t\tfor (File f : file.listFiles())\n\t\t\t{\n\t\t\t\t// FIXME: remove MainModule.java\n\t\t\t\tif (!f.getName().equals(\"MainModule.java\"))\n\t\t\t\t{\n\t\t\t\t\taddModule(out, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString fileName = \"/src/main/java/modules/\" + file.getName();\n\t\t\t\n\t\t\tcreateZipEntry(out, fileName, Files.readAllBytes(Paths.get(file.getAbsolutePath())));\t\t}\n\t}",
"void registerModule(Module module);",
"public File writeGadgetToFile(IGadget gadget, File originalFile){\n File outDir = new File(originalFile.getPath());\n if(!outDir.exists())\n {\n outDir.mkdir();\n }\n \n File tmpDir = Base.createTempFolder(originalFile.getName());\n tmpDir.mkdir();\n \n ModuleFactory fact = new ModuleFactory();\n \n for(int i=0; i < gadget.getModules().length; i++)\n {\n try {\n \t//NOTE: We may need to add a hook for the module rules\n fact.WriteModuleToFile(gadget.getModules()[i], tmpDir.getPath());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n \n try {\n XMLWriter.Writer(gadget.getConfiguration(), \"config.xml\", tmpDir.getPath());\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n \n File returnFile = null;\n \t\ttry {\n \t\t\treturnFile = Packer.packageFile(originalFile.getPath()\n \t\t\t , tmpDir.listFiles());\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \n File[] tmpFiles = tmpDir.listFiles();\n for(int i =0; i < tmpFiles.length; i++)\n {\n tmpFiles[i].delete();\n } \n \n tmpDir.delete();\n return returnFile;\n }",
"@Override\n public <M extends IsModule<?>> void addModule(M module) {\n module.setRouter(this);\n module.setEventBus(this.eventBus);\n module.setAlwaysLoadComposite(this.alwaysLoadComposite);\n module.setAlwaysShowPopUp(this.alwaysShowPopUp);\n module.loadModule(this.routerConfiguration);\n this.shellConfiguration.getShells()\n .addAll(module.getShellConfigs());\n this.routerConfiguration.getRouters()\n .addAll(module.getRouteConfigs());\n this.compositeReferences.addAll(module.getCompositeReferences());\n }",
"public void createModuleSnapshot(String moduleName,\n String snapshotName,\n boolean replaceExisting,\n String comment);",
"public void loadMod(File modlocation);",
"@Override\n\tpublic void add(final IModule module) {\n\t\tthis.setModuleOnTile(module);\n\t}",
"public void pushModuleIntoEditedRecipe(Module module) throws RecipeManagerException {\n Recipe editingRecipe = getEditingRecipe();\n editingRecipe.push(module);\n }",
"void onModuleAdded(final ModularConfigurationModule<T> module) {\n for (ModularConfigurationEntry<T> newEntry : module.getAll()) {\n ModularConfigurationEntry<T> existing = entries.getIfExists(newEntry.getName());\n if (existing == null) {\n existing = removedEntries.remove(newEntry.getName());\n }\n\n // Directly store the module's entry. No change notification as there's\n // no listeners registered yet.\n if (existing == null) {\n this.entries.set(newEntry.getName(), newEntry);\n continue;\n }\n\n // Check whether the existing entry's module overrides the module that\n // we are adding to this store. If so, the entry isn't loaded.\n // Instead it's added to the \"shadow modules\" - a list modules are taken\n // from when the entry is removed from higher-priority modules.\n if (!existing.isRemoved() && !isModuleOverriding(module, existing.getModule())) {\n int index = 0;\n while (index < existing.shadowModules.size() &&\n isModuleOverriding(module, existing.shadowModules.get(index)))\n {\n index++;\n }\n existing.shadowModules.add(index, module);\n continue;\n }\n\n // Swap the entry for the existing one\n existing.loadFromModule(module);\n }\n }",
"public void append(Module other) {\n artifacts = appendBuildFileLists(artifacts, other.getArtifacts());\n excludedArtifacts = appendBuildFileLists(excludedArtifacts, other.getExcludedArtifacts());\n dependencies = appendBuildFileLists(dependencies, other.getDependencies());\n }",
"private void importMods() throws IOException {\n setProgressNote(UiString.get(_S4));\n final String directoryName = \"mods\";\n final Path sourcePath = importDataPath.resolve(directoryName);\n if (sourcePath.toFile().exists()) {\n final Path targetPath = MagicFileSystem.getDataPath().resolve(directoryName);\n FileUtils.copyDirectory(sourcePath.toFile(), targetPath.toFile(), getModsFileFilter());\n }\n setProgressNote(OK_STRING);\n }",
"public void testAddModule() {\n\t System.out.println(\"addModule\");\n\t Module module = module1;\n\t Student instance = student1;\n\t instance.addModule(module);\n\t }",
"public void addModule(Module moduleToAdd) {\n requireNonNull(moduleToAdd);\n\n modules.add(moduleToAdd);\n indicateModified();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Handle right click. Fire black hole at target. / \param position coordinates of mouse event. / \return this state (No transition). | public SceneState handleRightClick(PVector position) {
mContext.mManager.fireBlackHole(position);
return this;
} | [
"abstract void onRightClick(int x, int y, boolean down);",
"public abstract void onRightClick(double x, double y, boolean release);",
"public void handleRightClick() {\r\n\t\tgetMatch().handleRightClickNear(player);\r\n\t\tuseRight();\r\n\t}",
"public void rightClick();",
"private void rightClick(boolean onlyMainScreen, int x, int y, HttpServletResponse resp) throws IOException {\r\n\t\ttry {\r\n\t\t\tlogger.info(String.format(\"right clic at %d,%d\", x, y));\r\n\t\t\tCustomEventFiringWebDriver.rightClicOnDesktopAt(onlyMainScreen, x, y, DriverMode.LOCAL, null);\r\n\t\t\tsendOk(resp, \"right clic ok\");\r\n\t\t} catch (Exception e) {\r\n\t\t\tsendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, resp, e.getMessage());\r\n\t\t}\r\n\t}",
"public void mouseClick()\n {\n\t thisRobot.mousePress(RightClick);\n }",
"public int rightClick()\r\n {\r\n if(!pressed)\r\n {\r\n switch( flag )\r\n {\r\n // flag a square with a 'flag'\r\n case 0:\r\n flag = 1;\r\n this.setIcon(FLAG);\r\n return -1;\r\n // mark a square with a '?'\r\n case 1:\r\n flag = 2;\r\n this.setIcon(QUESTIONMARK);\r\n return +1;\r\n // clear '?'\r\n case 2:\r\n flag = 0;\r\n this.setIcon(UNCLICKED);\r\n return 0;\r\n default:\r\n break;\r\n }\r\n }\r\n return 0;\r\n }",
"public SceneState handleLeftClick(PVector position) {\n \n mContext.mManager.fireMissile(position); \n return this;\n\n }",
"public static void rightClick() {\r\n\t\tMinecraftForge.EVENT_BUS.register(playerUtil);\r\n\t}",
"public void leftClick();",
"default public void clickRight() {\n\t\tremoteControlAction(RemoteControlKeyword.RIGHT);\n\t}",
"@OnlyIn(Dist.CLIENT)\n @SubscribeEvent\n public void onRightClickBlock(PlayerInteractEvent.RightClickBlock event) {\n // Saving the last used hand in order to determine which hand caused the action\n // This fires before the EntityPlaceEvent and RightClickItem events\n lastUsedHand = event.getHand();\n }",
"private void leftClick(boolean onlyMainScreen, int x, int y, HttpServletResponse resp) throws IOException {\r\n\t\ttry {\r\n\t\t\tlogger.info(String.format(\"left clic at %d,%d\", x, y));\r\n\t\t\tCustomEventFiringWebDriver.leftClicOnDesktopAt(onlyMainScreen, x, y, DriverMode.LOCAL, null);\r\n\t\t\tsendOk(resp, \"left clic ok\");\r\n\t\t} catch (Exception e) {\r\n\t\t\tsendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, resp, e.getMessage());\r\n\t\t}\r\n\t}",
"public void mousePressed(MouseEvent e) {\n if (e.getButton() == MouseEvent.BUTTON3) {\n isRightPressed = true;\n }\n }",
"public void rightClick(Rectangle rectangle, String imgPath, SikuliClickLocation location) throws Exception {\n\t\tSikuliObject object = new SikuliObject(SikuliAction.RECTANGLE_MOUSE_RIGHT_CLICK_AT, location,\n\t\t\t\tgetBufferedImage(imgPath), minScore, rectangle);\n\t\thandleEvent(object);\n\t}",
"public Boolean analyzeRightClick() {\n\t\tBoolean retVal = false;\n\n\t\tint ySize = getScreenXOrient().getHistory().size();\n\n\t\tint peakLocation = getScreenXOrient().findIndexOfLocalMaxima( Math.max(0, ySize-100), ySize);\n\n\t\tif( (peakLocation != 0)\n\t\t\t\t&& (!getScreenXOrient().isInDeadzone( getScreenXOrient().getHistory().get(peakLocation), 0) )\n\t\t) {\n\t\t\tInteger[] temp = getScreenXOrient().findNearestNeutralPoints( peakLocation, 30 );\n\t\t\tif( temp != null ) {\n\t\t\t\tint firstDeadPointLocation = temp[0];\n\t\t\t\tint secondDeadPointLocation = temp[1];\n\n\t\t\t\ttry{\n\t\t\t\t\tint tmp = getScreenXOrient().getHistory().get(peakLocation).intValue();\n\t\t\t\t\ttmp = (tmp+8)/2;\n\t\t\t\t\tParameters.setMouseRightClickHeightMin( tmp );\n\n\t\t\t\t\ttmp = secondDeadPointLocation - firstDeadPointLocation;\n\t\t\t\t\ttmp = (tmp+8)/2;\n\t\t\t\t\tParameters.setMouseRightClickTimeMin( tmp );\n\n//\t\t\t\t\tSystem.out.println(\"Parameters.getMouseRightClickTimeMin() = \" + Parameters.getMouseRightClickTimeMin());\n//\t\t\t\t\tSystem.out.println(\"Parameters.getMouseRightClickHeightMin() = \" + Parameters.getMouseRightClickHeightMin());\n\n\t\t\t\t\tretVal = true;\n\t\t\t\t}catch(Exception e) {}\n\t\t\t}\n\t\t}\n\n\t\treturn retVal;\n\t}",
"void click(int x, int y, Keys... modifiers);",
"@Override\n public void mouseReleased(MouseEvent e)\n {\n mouseLeftClick = false;\n }",
"private MouseListener createPointAndShootMouseListenerInstance() {\n return new MouseAdapter() {\n @Override\n public void mouseClicked(MouseEvent e) {\n if (e.isShiftDown()) {\n Point p = e.getPoint();\n ImageCanvas canvas = (ImageCanvas) e.getSource();\n Point pOffscreen = new Point(canvas.offScreenX(p.x), canvas.offScreenY(p.y));\n System.out.println(pOffscreen.x + \"_\" + pOffscreen.y );\n // final Point2D.Double devP = transformAndMirrorPoint(loadMapping(), canvas.getImage(),\n // new Point2D.Double(pOffscreen.x, pOffscreen.y));\n final Point2D.Double devP = transformPoint(loadMapping(), new Point2D.Double(pOffscreen.x, pOffscreen.y));\n System.out.println(devP);\n // final Configuration originalConfig = prepareChannel();\n // final boolean originalShutterState = prepareShutter();\n makeRunnableAsync(\n new Runnable() {\n @Override\n public void run() {\n try {\n if (devP != null) {\n displaySpot(devP.x, devP.y);\n Thread.sleep(dev_.getExposure());\n // displaySpot(0, 0);\n } else ReportingUtils.showError(\"Please Try Again! Your click return Null\");\n\n // returnShutter(originalShutterState);\n // returnChannel(originalConfig);\n } catch (Exception e1) {\n ReportingUtils.showError(e1);\n }\n }\n }).run();\n }\n }\n };\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
move to my ticket page activity | @Override
public void userPageMyTickets() {
String phone_number = getphoneNumber();
Intent intent = new Intent(userPageModel.this, myTicketsPageModel.class);
intent.putExtra("phone",phone_number);
startActivity(intent);
} | [
"public void goToTicketsTab() {\n logging(\"Attempting to click on the ticket upper tab.\");\n solo.clickOnImage(1);\n searchAndReport(searchTextCaseInsensitive(TEXT_TEXTVIEW_MOVIES), \"Filmer tab found,\", \"Could not find tab with filmer.\");\n clickOnTextCaseInsensitive(TEXT_TEXTVIEW_MOVIES);\n loadView(android.widget.ImageView.class, 6, DEFAULT_NUMBER_OF_TRIES_WAITING_FOR_VIEW, \"Too long loading time when waiting for available movies.\");\n searchAndReport(searchTextCaseInsensitive(TEXT_TEXTVIEW_MOVIES), \"Went to the tickets tab\", \"Did not go to the tickets tab\");\n }",
"public void startViewTripActivity() {\r\n\t\t\r\n\t\t// TODO - fill in here\r\n Intent intent = new Intent(this,TripHistoryActivity.class);\r\n startActivity(intent);\r\n\t}",
"public void goToToDoList() {\r\n\t\tif (isComplete()) {\r\n\t\t\tthis.saveTrip(false);\r\n\t\t\tIntent intent = new Intent(this, ToDoListActivity.class);\r\n\t\t\tintent.putExtra(\"trip_id\",\r\n\t\t\t\t\tInteger.toString(NewTrip.this.activeTrip.getID()));\r\n\t\t\tstartActivity(intent);\r\n\t\t} else {\r\n\t\t\tToast.makeText(NewTrip.this, \"All Fields Required\",\r\n\t\t\t\t\tToast.LENGTH_SHORT).show();\r\n\t\t}\r\n\t}",
"public void goToSchedScreen() {\n\t\t// TODO: line below is inefficient, refactor if at all possible\n\t\tsetCurrSchedulableTitles();\n\t\tdisplay.schedScreen(user.getCreateSchedulablesData(Communication.get(CURR_SCHEDULABLE_TYPE)), user.getDisplaySchedulablesData(Communication.get(CURR_TRIP), Communication.get(CURR_SCHEDULABLE_TYPE)), Integer.valueOf(Communication.get(CURR_SCHED)));\n\t}",
"public void navigateToCampaignsPage()\r\n\t{\r\n\t\twLib.performMouseOver(More);\r\n\t\tCampaignslnk.click();\r\n\t\tWaitForElement(Campaignslnk);\r\n\t}",
"void navigateToCurrentOrder() {\n Intent gotoCurrentOrder = new Intent(this, CurrentOrderActivity.class);\n startActivity(gotoCurrentOrder);\n }",
"void navigateToOrderingCoffee() {\n Intent gotoOrderCoffee = new Intent(this, OrderingCoffeeActivity.class);\n startActivity(gotoOrderCoffee);\n }",
"private void goToInbox() {\n\n Logger.d(TAG, \"goToInbox()\");\n\n // in case the screen was not created by the inbox screen (but by a new\n // message notification)\n if (!screenLaunchedByInbox) {\n // block other threads from entering while the flag is updated\n synchronized (this) {\n\n if (!goToInboxCalled) {\n goToInboxCalled = true;\n // launch the inbox screen only of not launch before\n Intent intent = new Intent(getApplicationContext(),\tInboxActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(intent);\n }\n }\n }\n finish();\n\n Logger.d(TAG, \"goToInbox() ended\");\n }",
"private void nextScreen() \n\t{\n\t\tIntent intent=null;\n\t\trelativeLayoutBASign.setVisibility(View.INVISIBLE);\n\t\tif(isAudit)\n\t\t{\n\t\t\tintent=new Intent(BASearch.this,BAAuditForm.class); \n\t\t}\n\t\telse\n\t\t{\n\t\t\tintent=new Intent(BASearch.this,BASearchData.class); \n\t\t}\n\t\tstartActivity(intent);\n\t\tBASearch.this.finish();\n\t\tintent=null;\n\t}",
"void navigateToOrderingDonut() {\n Intent gotoOrderDonut = new Intent(this, OrderingDonutActivity.class);\n startActivity(gotoOrderDonut);\n }",
"private void goToTripCreation() {\n\t\tdisplay.resetView();\n\t\tdisplay.makeTripScreen();\n\t}",
"protected void goTo(String url) {\n \t\tcontext.goTo(url);\n \t}",
"public String navigateTicketList() {\n Tipoticket selected = this.getSelected();\n if (selected != null) {\n TipoticketFacade ejbFacade = (TipoticketFacade) this.getFacade();\n List<Ticket> selectedTicketList = ejbFacade.findTicketList(selected);\n FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"Ticket_items\", selectedTicketList);\n }\n return \"/app/ticket/index\";\n }",
"private void goToNewReleases() {\n final Intent intent = new Intent(this, NewReleasesActivity.class);\n startActivity(intent);\n }",
"public void gotToLessonSteps(View view) {\n Intent intent = new Intent(this, LessonSteps.class);\n intent.putExtra(\"conceptID\",conceptID);\n intent.putExtra(\"lessonID\",lessonID);\n startActivity(intent);\n }",
"@Override\n public void onClick(View v){\n Intent intent = new Intent(MainActivity.this,PromotedEventsPage.class);\n startActivity(intent);\n }",
"@Override\n public void onClick(View view){\n Intent goToList = new Intent(SPQ7Page.this,SPQuestionList.class );\n\n // Executes Intent object.\n startActivity(goToList);\n\n }",
"public void gotoCheckPost(View view) {\n Intent CheckPost = new Intent(this, CheckPostActivity.class);\n startActivity(CheckPost);\n }",
"public void ClickVtube(View view){\n MainActivity.redirectActivity(this,Vtube.class);\n\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/SDTests1 Inform a transporter that the client (such as brokerws) decided to accept the job offer. | @Test
public void testAcceptJob() throws Exception {
JobView jv = CLIENT1.requestJob(CENTRO_1, SUL_1, PRICE_UPPER_LIMIT);
jv = CLIENT1.decideJob(jv.getJobIdentifier(), true);
assertEquals(JobStateView.ACCEPTED, jv.getJobState());
} | [
"public void waitingForPartner();",
"public void sendOffer(Offer offer) {\r\n\r\n }",
"@Test\n\tpublic void madeOfferHasPendingStatus() {\n\t}",
"@Test\n\tpublic void acceptedOfferCanNotBeRejected() {\n\t}",
"public void acceptOffer(long offerId) {\r\n }",
"public void confirmSent() {\n\t\tthis.acknowledged = true;\n\t\tthis.timer.killThread();\n\t}",
"boolean hasEstablishConsume();",
"public boolean acceptedTradeOffer()\n\t{\n\t\treturn m_isReadyToTrade;\n\t}",
"public void alertTheWaiter()\n {\n //Enters in critical region.\n mutex.down();\n\n //One more portion cooked.\n numPortionsProducedByChef++;\n\n //Get current thread.\n ClientProxy c = (ClientProxy) Thread.currentThread();\n //Update chef's state to delivering portions\n c.setChefState(ChefStates.DILPOR);\n repoStub.updateChefState(ChefStates.DILPOR);\n\n\n //Waiter is called when the first portion of each course has been\n //prepared.\n if(numPortionsProducedByChef==1){\n barStub.alertTheWaiter();\n }\n\n\n //When all portions have been prepared, next course comes and the number\n //of portions cooked starts at 0.\n if(numPortionsProducedByChef == NSTUDENTS)\n numPortionsProducedByChef = 0;\n\n //Leaves critical region.\n mutex.up();\n\n\n //Chef blocks here, waiting for the waiter's arrival\n waitForWaiter.down();\n\n }",
"boolean isReadyToAccept(Job job) throws ServiceRegistryException, UndispatchableJobException;",
"public void saluteTheClient(){\n Waiter w = (Waiter) Thread.currentThread();\n CommunicationChannel com = new CommunicationChannel(serverHostName, serverPortNumb);\n Object[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n state_fields[0] = w.getWaiterID();\n \tstate_fields[1] = w.getWaiterState();\n\n Message m_toServer = new Message(0, params, 0, state_fields, 2, null); \n Message m_fromServer;\n\n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n\t\t\t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n \t}\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n\n w.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }",
"public void handlePaxosAcceptRequestAccepted(Transaction t, int shardIdOfSender) {\n\t\tif (this.paxosAcceptsManager.increaseAcceptAccepted(t)) {\n\t\t\t// Transaction has to be committed\n\t\t\tthis.start2PCcommitInDatacenter(t);\n\t\t}\n\t}",
"@ParameterizedTest\n\t@ValueSource(booleans = { true, false })\n\tvoid notifyAllianceRequestAccepted(boolean localRequester) {\n\t\tboolean localAccepter = !localRequester;\n\n\t\tmessenger.addObserver(observer);\n\t\tassertFalse(observer.allianceRequestAccepted);\n\n\t\tmessenger.notifyAllianceRequestAccepted(new MockPlayerAttributes(localRequester), new MockPlayerAttributes(localAccepter));\n\t\tassertTrue(observer.allianceRequestAccepted);\n\t}",
"@Test\n public void testAcceptTether() throws IOException, InterruptedException {\n createTethering(\"xyz\", NAMESPACES, REQUEST_TIME, DESCRIPTION);\n // Tethering status should be PENDING\n expectTetheringStatus(\n \"xyz\",\n TetheringStatus.PENDING,\n NAMESPACES,\n REQUEST_TIME,\n DESCRIPTION,\n TetheringConnectionStatus.INACTIVE);\n\n // Duplicate tether initiation should be ignored\n createTethering(\"xyz\", NAMESPACES, REQUEST_TIME, DESCRIPTION);\n // Tethering status should be PENDING\n expectTetheringStatus(\n \"xyz\",\n TetheringStatus.PENDING,\n NAMESPACES,\n REQUEST_TIME,\n DESCRIPTION,\n TetheringConnectionStatus.INACTIVE);\n\n TetheringControlResponseV2 expectedResponse =\n new TetheringControlResponseV2(Collections.emptyList(), TetheringStatus.PENDING);\n // Tethering status on server side should be PENDING.\n expectTetheringControlResponse(\"xyz\", HttpResponseStatus.OK, GSON.toJson(expectedResponse));\n\n // User accepts tethering on the server\n acceptTethering();\n // Tethering status should become ACTIVE\n expectTetheringStatus(\n \"xyz\",\n TetheringStatus.ACCEPTED,\n NAMESPACES,\n REQUEST_TIME,\n DESCRIPTION,\n TetheringConnectionStatus.ACTIVE);\n\n // Duplicate accept tethering should fail\n TetheringActionRequest request = new TetheringActionRequest(\"accept\");\n HttpRequest.Builder builder =\n HttpRequest.builder(HttpMethod.POST, config.resolveURL(\"tethering/connections/xyz\"))\n .withBody(GSON.toJson(request));\n HttpResponse response = HttpRequests.execute(builder.build());\n Assert.assertEquals(HttpResponseStatus.BAD_REQUEST.code(), response.getResponseCode());\n\n // Wait until we don't receive any control messages from the peer for upto the timeout interval.\n Thread.sleep(cConf.getInt(Constants.Tethering.CONNECTION_TIMEOUT_SECONDS) * 1000);\n // Tethering connection status should become INACTIVE\n expectTetheringStatus(\n \"xyz\",\n TetheringStatus.ACCEPTED,\n NAMESPACES,\n REQUEST_TIME,\n DESCRIPTION,\n TetheringConnectionStatus.INACTIVE);\n }",
"@Test\n\tpublic void rejectedOfferCanNotBeAccepted() {\n\t}",
"@Test\n void startListening_question() {\n List<List<String>> options = Arrays.asList(\n Arrays.asList(\"aa\", \"ab\"),\n Arrays.asList(\"bb\")\n );\n MessageType type = MessageType.ACTION;\n send(new ProtocolMessage(type, options));\n String[][] controllerReceived = controller.options;\n MessageType typeReceived = controller.message;\n for (int i = 0; i < options.size(); i++) {\n for (int j = 0; j < options.get(i).size(); j++) {\n assertEquals(options.get(i).get(j), controllerReceived[i][j]);\n }\n }\n assertEquals(type, typeReceived);\n int choice = Integer.parseInt(server.contents().getUserChoice());\n for (int i = 0; i < options.get(DEFAULT_CHOICE).size(); i++) {\n assertEquals(options.get(DEFAULT_CHOICE).get(i),\n options.get(choice).get(i));\n }\n }",
"void readyToSend();",
"@Test\r\n\tpublic void testDeliveryChuteFull() {\r\n\t\tdcListen.chuteFull(vend.getDeliveryChute());\r\n\t\tassertTrue(vend.getDeliveryChute().isDisabled());\r\n\t}",
"public abstract boolean isDelivered();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uses inverse kinematics to convert a Twist2d into left and right wheel velocities | public static DriveVelocity inverseKinematics(Twist2d velocity) {
if (Math.abs(velocity.dtheta) < kEpsilon) {
return new DriveVelocity(velocity.dx, velocity.dx);
}
double delta_v = kTrackWidthInches * velocity.dtheta / (2 * kTrackScrubFactor);
return new DriveVelocity(velocity.dx - delta_v, velocity.dx + delta_v);
} | [
"void updateVectors() {\n\t\t\t\tcurrViewAngle=angleEyeGameWorld+gameWorld.getAngle();\n\t\t\t\tforward.x=PApplet.cos(currViewAngle)*SCROLL_SPEED;\n\t\t\t\tforward.z=PApplet.sin(currViewAngle)*SCROLL_SPEED;\n\t\t\t\tcurrViewAngle+=PConstants.PI; //backwards\n\t\t\t\tbackward.x=PApplet.cos(currViewAngle)*SCROLL_SPEED; \n\t\t\t\tbackward.z=PApplet.sin(currViewAngle)*SCROLL_SPEED;\n\t\t\t}",
"@Override\n\tpublic double calculateVelocity() {\n\t\tdouble result = distance / time + velocitySame - velocityReverse;\n\t\treturn result;\n\t}",
"public void updateRK4_m2(){\n m2x = this.getVelX() + (Game.dt/2.)*this.k1x;\n m2y = this.getVelY() + (Game.dt/2.)*this.k1y;\n }",
"void updateMotion(boolean altitudeLock)\n {\n \n ascendDescendLift:\n {\n // as pitch and roll increases, lift decreases by fall-off function.\n\t // thrust.y ranges from 0 to 1. at 1, almost perfectly balances gravity\n\t \n //thrust.y = MathHelper.cos(pitchRad) * MathHelper.cos(rollRad);\n thrust.y = MathHelper.cos(pitchRad) * MathHelper.cos(rollRad) * MathHelper.cos(rollRad);\n }\n\n forwardBack:\n {\n // as pitch increases, forward-back motion increases\n // but sin function was too touchy so using 1-cos\n float accel = 1f - MathHelper.cos(pitchRad);\n if (pitchRad > 0f) accel *= -1f;\n \n thrust.x = -fwd.x * accel;\n thrust.z = -fwd.z * accel;\n \n // also adjust y in addition to ascend/descend to simulate diving\n thrust.y += -fwd.y * accel * .3f;\n }\n\n strafeLeftRight:\n {\n // float strafe = -MathHelper.sin(roll);\n float strafe = 1f - MathHelper.cos(rollRad);\n if (rollRad > 0f) strafe *= -1f;\n\n // use perp of yaw and scale by roll\n thrust.x -= fwd.z * strafe;\n thrust.z += fwd.x * strafe;\n }\n\n // start with current velocity\n velocity.set((float)motionX, (float)motionY, (float)motionZ);\n\n // friction, very little!\n velocity.scale(FRICTION);\n\n // scale thrust by current throttle and delta time\n //thrust.normalize().scale(MAX_ACCEL * (1f + throttle) * deltaTime / .05f);\n thrust.normalize().scale(MAX_ACCEL * (1f + throttle) * deltaTime / .05f);\n\n // apply the thrust\n Vector3.add(velocity, thrust, velocity);\n\n // gravity is always straight down\n //if (!inWater && !onGround) velocity.y -= GRAVITY * deltaTime / .05f;\n velocity.y -= GRAVITY * deltaTime / .05f;\n\n // limit max velocity\n if (velocity.lengthSquared() > MAX_VELOCITY * MAX_VELOCITY)\n {\n velocity.scale(MAX_VELOCITY / velocity.length());\n }\n\n // apply velocity changes\n motionX = (double) velocity.x;\n motionY = (double) velocity.y;\n motionZ = (double) velocity.z;\n \n if (altitudeLock && riddenByEntity != null)\n {\n motionY *= .9;\n if (motionY < .00001) motionY = .0;\n }\n \n moveEntity(motionX, motionY, motionZ);\n }",
"public Vector3f forwardKinematics() {\n float[] ROSpos = KDL.forwardKinematics(kdlRobot, getPositions());\n //convert from ROS to OpenGL coordinates\n return new Vector3f(ROSpos[0], ROSpos[2], -ROSpos[1]);\n }",
"private Vector3f getOrbitalVelocity(CelestialEntity entity1, CelestialEntity entity2) {\r\n\t\tVector3f p1 = entity1.getPosition();\r\n\t\tVector3f p2 = entity2.getPosition();\r\n\t\tfloat m1 = entity1.getMass();\r\n\t\tfloat m2 = entity2.getMass();\r\n\t\tVector3f r = Vector3f.sub(p2, p1);\r\n\t\t\r\n\t\tVector3f velocity = new Vector3f();\r\n\t\t// Perpendicular vector in the x-z plane\r\n\t\tvelocity.x = -r.z;\r\n\t\tvelocity.z = r.x;\r\n\t\t// Calculate velocity magnitude (speed)\r\n\t\tdouble distance = r.magnitude();\r\n\t\tdouble speed = Math.sqrt(Constants.G * (m1 + m2) / distance);\r\n\t\tvelocity.setMagnitude((float) speed);\r\n\t\t\r\n\t\treturn velocity;\r\n\t}",
"int[] convertToNativeVelocity(final double[] velocitiesInCentimeters);",
"public float[] inverseKinematics(Vector3f goalPos, Quaternionf goalOrient){\n //convert from OpenGL to ROS coordinates\n return KDL.inverseKinematics(kdlRobot, getPositions(), new float[]{goalPos.x, -goalPos.z, goalPos.y},\n new float[]{goalOrient.x, goalOrient.z, goalOrient.y, goalOrient.w});\n }",
"private void updateDirection()\n {\n if (Math.abs(InputSystem.LT_Button_Control_Stick) > 0.1)\n {\n // if lt button is pressed, reverse direction of elevator\n setReverseDirection(true);\n }\n else\n {\n setReverseDirection(false);\n }\n }",
"public void update(Vehicle v, float dt) {\nPoint2D.Float p = v.getPosition();\r\nPoint2D.Float tp = target.getPosition();\r\nPoint2D.Float desired_velocity = new Point2D.Float(tp.x - p.x , tp.y - p.y);\r\nVehicle.scale(desired_velocity, v.getMaxSpeed());\r\nv.updateSteering(desired_velocity.x, desired_velocity.y);\r\n}",
"public void reflectVertically ()\r\n {\r\n\tif ((direction == UP)) //An IF statement which works when the direction of the ball is RIGHT and the wall motion is 0\r\n\t{\r\n\t direction = DOWN; // direction changes to LEFT\r\n\t speed = speedNorm; //speed of the ball is now normal speed\r\n\t}\r\n\r\n\r\n\telse if ((direction == DOWN)) //An ELSE IF statement which works when the direction of the ball is LEFT and the wall motion is 0\r\n\t{\r\n\t direction = UP; // direction changes to RIGHT\r\n\t speed = speedNorm; //ball has a normal speed\r\n\t}\r\n\r\n\r\n\telse if (direction == UPLEFT)\r\n\t{\r\n\t direction = DOWNLEFT;\r\n\t}\r\n\r\n\r\n\telse if (direction == UPRIGHT)\r\n\t{\r\n\t direction = DOWNRIGHT;\r\n\t}\r\n\r\n\r\n\telse if (direction == DOWNLEFT)\r\n\t{\r\n\t direction = UPLEFT;\r\n\t}\r\n\r\n\r\n\telse if (direction == DOWNRIGHT)\r\n\t{\r\n\t direction = UPRIGHT;\r\n\t}\r\n }",
"public float getMotor_lin_target_velocity() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 128);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 120);\n\t\t}\n\t}",
"double motor_y () { return strut.span + DRIVING_FORCE_HEIGHT; }",
"protected abstract Vector3f calculateNewVelocity();",
"public void reverseVectorY() {\n vy = -vy;\n radian = -radian;\n }",
"protected void calcVelocity()\n\t{}",
"private static Vector2 getMotorOutputs(double leftJoystickXInput, double leftJoystickYInput) {\r\n\t\tdouble stickXSquare = leftJoystickXInput * Math.abs(leftJoystickXInput) * Math.abs(leftJoystickXInput)\r\n\t\t\t\t* Math.abs(leftJoystickXInput);\r\n\t\tdouble stickYSquare = leftJoystickYInput;\r\n\t\tdouble radiusSquare = Math.abs(getRadiusOfSquare(stickXSquare, stickYSquare));\r\n\r\n\t\t// Normalize all stick inputs to have a maximum length of 1, because\r\n\t\t// rawInput can be anywhere in the square with diagonals (-1, -1) and\r\n\t\t// (1, 1)\r\n\t\tdouble stickX = stickXSquare / radiusSquare;\r\n\t\tdouble stickY = stickYSquare / radiusSquare;\r\n\r\n\t\t// convert from Cartesian to polar so things work later\r\n\t\tdouble radius = Math.hypot(stickX, stickY);\r\n\r\n\t\t// example coordinates --> leftPower : right power\r\n\t\t// (0, 1) --> 1 : 1\r\n\t\t// (1, 0) --> 1 : -1\r\n\t\t// (-1, 0) --> -1 : 1\r\n\t\t// (0, -1) --> -1 : -1\r\n\r\n\t\t// the amount of turn is 2*stickX because the difference between the\r\n\t\t// left and right at full turn is 2, and the max x is 1\r\n\t\tdouble differenceBetweenMotors = 2 * Math.abs(stickX / radius);\r\n\t\tdouble maxMotor = 1;\r\n\t\tdouble minMotor = maxMotor - differenceBetweenMotors;\r\n\r\n\t\t// scale the motor values back depending on how far the joystick is\r\n\t\t// pressed\r\n\t\tmaxMotor *= radius;\r\n\t\tminMotor *= radius;\r\n\r\n\t\tdouble leftMotorsTemp = 0, rightMotorsTemp = 0;\r\n\r\n\t\tif (stickX > 0) {// turning right\r\n\t\t\tleftMotorsTemp = maxMotor;\r\n\t\t\trightMotorsTemp = minMotor;\r\n\t\t} else {// turning left\r\n\t\t\tleftMotorsTemp = minMotor;\r\n\t\t\trightMotorsTemp = maxMotor;\r\n\t\t}\r\n\r\n\t\t// If we are going backwards, the left and right motors need to be made\r\n\t\t// negative. If we are also turning, then they have to be switched with\r\n\t\t// each other as well.\r\n\t\tif (stickY < 0) {\r\n\t\t\tleftMotorsTemp *= -1;\r\n\t\t\trightMotorsTemp *= -1;\r\n\t\t\tdouble temp = leftMotorsTemp;\r\n\t\t\tleftMotorsTemp = rightMotorsTemp;\r\n\t\t\trightMotorsTemp = temp;\r\n\t\t}\r\n\r\n\t\treturn new Vector2(leftMotorsTemp, rightMotorsTemp);\r\n\t}",
"private void updatePositionPhased() {\n // Update velocity if needed\n if (gameEngine.updateCounter % velAbruptness == velAbruptnessOffset)\n updateVelocityPhased();\n\n // Update heading if needed\n if (gameEngine.updateCounter % turnAbruptness == turnAbruptnessOffset)\n updateTurnPhase();\n\n // Update turn and velocty and map onto x/y velocities\n velCurrent += velChange;\n turnCurrent += turnChange;\n heading += turnCurrent;\n\n velocityx = velCurrent * Math.cos(heading);\n velocityy = velCurrent * Math.sin(heading);\n\n updatePositionAndRotation(1.0 / \n (double) (gameEngine.getGameUpdatePeriod()/1000000));\n\n if (GameObjectUtilities.reboundIfGameLayerExited(this)) {\n velCurrent = -velCurrent;\n velChange = -velChange;\n\n turnCurrent = -turnCurrent;\n turnChange = -turnChange;\n }\n }",
"double getyVelocity();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sends data to ResultFile to save them | public void saveResult() throws FileNotFoundException, IOException
{
ResultsFile resFile = new ResultsFile();
resFile.addResults(jmeno, points, (int) timeDuration);
} | [
"public void saveResults();",
"public void saveData() {\n\t\tString preJson = \"{'data':[\";\n\t\tString contentJson = null;\n\t\tString postJson = \"]}\";\n\t\tLog.i(tag, \"saveData method hit\");\n\t\tfor (int i = 0; i < savedData.size(); i++) {\n\t\t\tif (i == 0) {\n\t\t\t\tcontentJson = \"{'Title':\" + \"'\" + savedData.get(i).title.toString() + \"'\" + \",\" +\n\t\t\t\t\t\t\"'Information':\" + \"'\" + savedData.get(i).info.toString() + \"'\" + \",\" +\n\t\t\t\t\t\t\"'Image':\" + \"'\" + savedData.get(i).image.toString() + \"'\" + \",\" +\n\t\t\t\t\t\t\"'Latitude':\" + \"'\" + savedData.get(i).latitude.toString() + \"'\" + \",\" +\n\t\t\t\t\t\t\"'Longitude':\" + \"'\" + savedData.get(i).longitude.toString() + \"'\" + \"}\";\n\t\t\t} else {\n\t\t\t\tcontentJson = contentJson + \"{'Title':\" + \"'\" + savedData.get(i).title.toString() + \"'\" + \",\" +\n\t\t\t\t\t\t\"'Information':\" + \"'\" + savedData.get(i).info.toString() + \"'\" + \",\" +\n\t\t\t\t\t\t\"'Image':\" + \"'\" + savedData.get(i).image.toString() + \"'\" + \",\" +\n\t\t\t\t\t\t\"'Latitude':\" + \"'\" + savedData.get(i).latitude.toString() + \"'\" + \",\" +\n\t\t\t\t\t\t\"'Longitude':\" + \"'\" + savedData.get(i).longitude.toString() + \"'\" + \"}\";\n\t\t\t}\n\n\t\t\tif (i != savedData.size() - 1) {\n\t\t\t\tcontentJson = contentJson + \",\";\n\t\t\t}\t\n\t\t}\n\t\tString fullJson = preJson + contentJson + postJson;\n\t\tLog.i(tag, fullJson);\n\t\tfileManager.writeToFile(context, getResources().getString(R.string.data_file_name), fullJson);\n\t\tsetResult(RESULT_OK, finishedIntent);\n\t\tfinish();\n\t}",
"public void writeResultsFile() throws java.io.IOException {\n results.writeOut();\n }",
"void saveResult() throws IOException {\n BufferedWriter file = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"out.txt\")));\n for (int i = 0; i < graph.getSize(); i++) {\n file.write(graph.getVertex(i).getName() + \" \" + threads.get(resultThreadIndex).getResult().get(i));\n file.newLine();\n }\n file.close();\n }",
"public void save() {\n UTILS.write(FILE.getAbsolutePath(), data);\n }",
"void fileWrite() {\r\n try {\r\n FileWriter fw = new FileWriter(fileout);\r\n BufferedWriter bw = new BufferedWriter(fw);\r\n for(int i = 0; i < results.size(); i++) {\r\n bw.write(results.get(i));\r\n bw.newLine();\r\n }\r\n bw.close();\r\n }\r\n catch(IOException ex) {\r\n System.out.println(\r\n \"Error reading file '\"\r\n + \"mpa3.in\" + \"'\");\r\n }\r\n }",
"@Override\n public void writeFile(String arg0, Map result) {\n\n // Initial variables\n ArrayList<HashMap> records;\n ArrayList<HashMap> recordT;\n ArrayList<HashMap> observeRecords; // Array of data holder for time series data\n BufferedWriter bwT; // output object\n StringBuilder sbData = new StringBuilder(); // construct the data info in the output\n HashMap<String, String> altTitleList = new HashMap(); // Define alternative fields for the necessary observation data fields; key is necessary field\n // P.S. Add alternative fields here\n HashMap titleOutput; // contain output data field id\n DssatObservedData obvDataList = DssatObservedData.INSTANCE; // Varibale list definition\n\n try {\n\n // Set default value for missing data\n setDefVal();\n\n // Get Data from input holder\n Object tmpData = getObjectOr(result, \"observed\", new Object());\n if (tmpData instanceof ArrayList) {\n records = (ArrayList) tmpData;\n } else if (tmpData instanceof HashMap) {\n records = new ArrayList();\n records.add((HashMap) tmpData);\n } else {\n return;\n }\n if (records.isEmpty()) {\n return;\n }\n\n observeRecords = new ArrayList();\n for (HashMap record : records) {\n recordT = getObjectOr(record, \"timeSeries\", new ArrayList());\n String trno = getValueOr(record, \"trno\", \"1\");\n if (!recordT.isEmpty()) {\n String[] sortIds = {\"date\"};\n Collections.sort(recordT, new DssatSortHelper(sortIds));\n for (HashMap recordT1 : recordT) {\n recordT1.put(\"trno\", trno);\n }\n observeRecords.addAll(recordT);\n }\n }\n\n // Initial BufferedWriter\n String fileName = getFileName(result, \"T\");\n if (fileName.endsWith(\".XXT\")) {\n String crid = DssatCRIDHelper.get2BitCrid(getValueOr(result, \"crid\", \"XX\"));\n fileName = fileName.replaceAll(\"XX\", crid);\n }\n arg0 = revisePath(arg0);\n outputFile = new File(arg0 + fileName);\n bwT = new BufferedWriter(new FileWriter(outputFile));\n\n // Output Observation File\n // Titel Section\n sbError.append(String.format(\"*EXP.DATA (T): %1$-10s %2$s\\r\\n\\r\\n\",\n fileName.replaceAll(\"\\\\.\", \"\").replaceAll(\"T$\", \"\"),\n getObjectOr(result, \"local_name\", defValBlank)));\n\n titleOutput = new HashMap();\n // TODO get title for output\n // Loop all records to find out all the titles\n for (HashMap record : observeRecords) {\n // Check if which field is available\n for (Object key : record.keySet()) {\n // check which optional data is exist, if not, remove from map\n if (obvDataList.isTimeSeriesData(key)) {\n titleOutput.put(key, key);\n\n } // check if the additional data is too long to output\n else if (key.toString().length() <= 5) {\n if (!key.equals(\"date\") && !key.equals(\"trno\")) {\n titleOutput.put(key, key);\n }\n\n } // If it is too long for DSSAT, give a warning message\n else {\n sbError.append(\"! Waring: Unsuitable data for DSSAT observed data (too long): [\").append(key).append(\"]\\r\\n\");\n }\n }\n // Check if all necessary field is available // P.S. conrently unuseful\n for (String title : altTitleList.keySet()) {\n\n // check which optional data is exist, if not, remove from map\n if (getValueOr(record, title, \"\").equals(\"\")) {\n\n if (!getValueOr(record, altTitleList.get(title), \"\").equals(\"\")) {\n titleOutput.put(title, altTitleList.get(title));\n } else {\n sbError.append(\"! Waring: Incompleted record because missing data : [\").append(title).append(\"]\\r\\n\");\n }\n\n } else {\n }\n }\n }\n\n // decompress observed data\n// decompressData(observeRecords);\n // Observation Data Section\n Object[] titleOutputId = titleOutput.keySet().toArray();\n Arrays.sort(titleOutputId);\n String pdate = getPdate(result);\n for (int i = 0; i < (titleOutputId.length / 39 + titleOutputId.length % 39 == 0 ? 0 : 1); i++) {\n\n sbData.append(\"@TRNO DATE\");\n int limit = Math.min(titleOutputId.length, (i + 1) * 39);\n for (int j = i * 39; j < limit; j++) {\n sbData.append(String.format(\"%1$6s\", titleOutput.get(titleOutputId[j]).toString().toUpperCase()));\n }\n sbData.append(\"\\r\\n\");\n\n for (HashMap record : observeRecords) {\n \n if (record.keySet().size() <= 2 && record.containsKey(\"trno\") && record.containsKey(\"date\")) {\n continue;\n }\n sbData.append(String.format(\" %1$5s\", getValueOr(record, \"trno\", \"1\")));\n sbData.append(String.format(\" %1$5s\", formatDateStr(getObjectOr(record, \"date\", defValI))));\n for (int k = i * 39; k < limit; k++) {\n\n if (obvDataList.isDapDateType(titleOutputId[k], titleOutput.get(titleOutputId[k]))) {\n sbData.append(String.format(\"%1$6s\", formatDateStr(pdate, getObjectOr(record, titleOutput.get(titleOutputId[k]).toString(), defValI))));\n } else if (obvDataList.isDateType(titleOutputId[k])) {\n sbData.append(String.format(\"%1$6s\", formatDateStr(getObjectOr(record, titleOutput.get(titleOutputId[k]).toString(), defValI))));\n } else {\n sbData.append(\" \").append(formatNumStr(5, record, titleOutput.get(titleOutputId[k]), defValI));\n }\n\n }\n sbData.append(\"\\r\\n\");\n }\n }\n // Add section deviding line\n sbData.append(\"\\r\\n\");\n\n // Output finish\n bwT.write(sbError.toString());\n bwT.write(sbData.toString());\n bwT.close();\n } catch (IOException e) {\n LOG.error(DssatCommonOutput.getStackTrace(e));\n }\n }",
"private void saveData() {\n\t\tlogger.trace(\"saveData() is called\");\n\t\t\n\t\tObjectOutputStream out = null;\n\t\ttry {\n\t\t\tFileOutputStream fileOut = new FileOutputStream(\"server-info.dat\");\n\t\t\tout = new ObjectOutputStream(fileOut);\n\t\t\tout.writeObject(jokeFile);\n\t\t\tout.writeObject(kkServerPort);\n\t\t\tout.flush();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.err.println(\"saving server-info.dat file is encountering an error for some reason.\");\n\t\t\tlogger.error(\"saving server-info.dat file is encountering an error for some reason.\");\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"saving server-info.dat file is encountering an error for some reason.\");\t\n\t\t\tlogger.error(\"saving server-info.dat file is encountering an error for some reason.\");\n\t\t} \n\t\tfinally {\n\t\t\tif (out != null){\n\t\t\t\ttry{\n\t\t\t\t\tout.close();\n\t\t\t\t}\n\t\t\t\tcatch (IOException e){\n\t\t\t\t\tSystem.err.println(\"saving server-info.dat file is encountering an error for some reason.\");\n\t\t\t\t\tlogger.error(\"saving server-info.dat file is encountering an error for some reason.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void saveSearchTaskResult(String writePath, JsonObject request) {\t\n\t\t\tthis.rwl.lockRead();\n\t\t\t//Search songs according to request\n\t\t\tJsonObject result = this.search(request);\t\n\t\t\tPath outpath = Paths.get(writePath);\n\t\t\t//Create the file.\n\t\t\toutpath.getParent().toFile().mkdir();\n\t\t\ttry(BufferedWriter output = Files.newBufferedWriter(outpath)) {\n\t\t\t\t//Write the result to the file.\n\t\t\t\toutput.write(result.toString());\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Exception in saveSearchTaskResult in SongLibrary class!! \" + e.getMessage());\n\t\t\t}\n\t\t\tthis.rwl.unlockRead();\n\t\t}",
"public void saveData() {\r\n\tDocument doc = new Document(getXML());\r\n\tXMLOutputter outputter = new XMLOutputter();\r\n\t\r\n\tString fileName = getFileFromChooser();\r\n\tif ( fileName != null) {\r\n\t try {\r\n\t\tDataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(fileName)));\r\n\t\toutputter.output(doc,out);\r\n\t\tlogger.log(Level.FINEST,\"Writing into file: \" + fileName); \r\n\t } catch ( IOException ioex) {\r\n\t\tlogger.log(Level.WARNING,\"Could not write data\");\r\n\t\tlogger.log(Level.INFO,ioex.getMessage());\r\n\t }\r\n\t}\r\n }",
"void saveQueryResults(String queryId, List<QueryResult> queryResults) throws FileNotFoundException;",
"private void saveToServer() {\n\t\tString[] data = {\"http://users.aber.ac.uk/wia2/WTC/upload.php\"};\n\t\tnew SendData(this, tour).execute(data);\n\t}",
"public static void writeDataToFile() {\n println(\"Write data to file start.\");\n try {\n Thread.sleep(1000 * 10L);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n println(\"Write data to file and handled it.\");\n }",
"@Override\n public void savingAllData(String nameOfFile) throws IOException {\n FileOutputStream fileOUTPUTSTREAM = new FileOutputStream(nameOfFile);\n ObjectOutputStream objectOUTPUTSTREAM = new ObjectOutputStream(fileOUTPUTSTREAM);\n\n for (SportClub club_A : footballClubs){\n objectOUTPUTSTREAM.writeObject(club_A); //write club details one by one to file\n }\n objectOUTPUTSTREAM.flush();\n fileOUTPUTSTREAM.close();\n objectOUTPUTSTREAM.close();\n\n\n System.out.println(\"@@@@@--Saving all data to file is successfully-@@@@@\");\n\n }",
"public void saveFile() {\n try {\n saveFileContent();\n } catch(IOException ev) {\n ev.printStackTrace();\n }\n }",
"void save(String data, File file);",
"private void saveData(){\n\t\tsynchronized(onlineAllInfoList){\n\t\t\tRecorder.save(onlineAllInfoList, onlineAllInfoListFileName);\n\t\t}\n\t\t//System.out.println(\"Saving onlineCompetitionInfoList...\");System.out.flush();\n\t\tsynchronized(onlineCompetitionInfoList){\n\t\t\tRecorder.save(onlineCompetitionInfoList, onlineCompetitionInfoListFileName);\t\t\t\n\t\t}\n\t\t//System.out.println(\"Saving competitionList...\");System.out.flush();\n\t\tsynchronized(competitionList){\n\t\t\tRecorder.save(competitionList, competitionInfoListFileName);\n\t\t}\n\t\t//System.out.println(\"Saving allAIInfoList...\");System.out.flush();\n\t\tsynchronized(allAIInfoList){\n\t\t\tRecorder.save(allAIInfoList, allInfoListFileName);\t\t\t\n\t\t}\n\t\t//System.out.println(\"Saving waitingInfoList...\");System.out.flush();\n\t\tsynchronized(waitingInfoList){\n\t\t\tRecorder.save(waitingInfoList, waitingInfoListFileName);\t\t\t\n\t\t}\n\t\t//System.out.println(\"Saving sortedAIInfoPool...\");System.out.flush();\n\t\tsynchronized(sortedAIInfoPool){\n\t\t\tRecorder.save(sortedAIInfoPool, sortedInfoListFileName);\t\t\t\n\t\t}\n\t}",
"void saveRequestToFile(MovilizerRequest request, Path filePath);",
"public void saveToFile() {\n List<VideoInfoEntity> videoList = (new VideoInfoDao()).getAllVideoInfo();\n\n for (VideoInfoEntity videoInfo : videoList) {\n\n // if (doneFileList.contains(videoInfo.getVideoId())) {\n //// System.out.println(\"Video has been processed: \" + videoInfo.getVideoId());\n // continue;\n // }\n List<KeyFrameEntity> keyframeList = (new KeyFrameDao()).getKeyFrameByVideoId(videoInfo.getVideoId());\n\n Collections.sort(keyframeList, new KeyFrameEntity());\n\n Runnable r = new SIFTSigToFile(videoInfo, keyframeList);\n\n MyThreadPool.getPool().submit(r);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the maximum heap size of the Java VM running plmaster(1). | public void
setMasterHeapSize
(
long size
)
throws IllegalConfigException
{
validateHeapSize(size, "master");
pProfile.put("MasterHeapSize", size);
} | [
"void setMaxPrimaryMemory(long maxBytes);",
"public void setMaxHeap(int heap) {\r\n\t\tthis.heap = Math.max(heap, this.heap);\r\n\t}",
"void setMaxSpecialMemory(long maxBytes);",
"void setMaximumSize(int newMaxSize);",
"public void setMaxSize(long new_size)\n {\n this.max_size=new_size;\n }",
"public void setMaxMemMBOptimalPerf(int value) {\r\n this.maxMemMBOptimalPerf = value;\r\n }",
"public static void setMaxMemoryMB(int value)\r\n {\r\n prefGeneral.putInt(ID_MAX_MEMORY, Math.min(getMaxMemoryMBLimit(), value));\r\n }",
"public static void setMaxMemoryMB(int value)\r\n {\r\n preferences.putInt(ID_MAX_MEMORY, Math.min(getMaxMemoryMBLimit(), value));\r\n }",
"public void setMemMax(long memMax) {\n this.memMax = memMax;\n }",
"void setMaxDeviceMemory(long maxBytes);",
"public static void setMaxHeapSize( final String maxHeapSize ) throws FileNotFoundException, IOException {\n processAppIni(false, new Function<String, String>(){\n \n public String apply( String line ) {\n if (line.matches(\".*Xmx([0-9]+)([mMgGkKbB]).*\")) { //$NON-NLS-1$\n line = line.replaceFirst(\"Xmx([0-9]+)([mMgGkKbB])\", \"Xmx\" + maxHeapSize + \"M\"); //$NON-NLS-1$ //$NON-NLS-2$\n }\n return line;\n }\n \n });\n \n }",
"public void setHeapConfigUsage(Integer heapConfigUsage) {\n this.heapConfigUsage = heapConfigUsage;\n }",
"private static long getHeapMaxSize() {\n\n\t\tlong heapMaxSize = Runtime.getRuntime().maxMemory();\n\t\treturn heapMaxSize;\n\t}",
"public void setMaxcpu(Integer maxcpu) {\r\n this.maxcpu = maxcpu;\r\n }",
"public void setMaxMemoryCacheSize(int val) {\n this.mMaxMemoryCacheSize = val;\n }",
"public void maxBytesLocalHeapChanged(long oldValue, long newValue);",
"public void setHeapConfigHardLimit(Integer heapConfigHardLimit) {\n this.heapConfigHardLimit = heapConfigHardLimit;\n }",
"public MaxHeap() {\n this(64);\n }",
"public long\n getMasterHeapSize()\n {\n return (Long) pProfile.get(\"MasterHeapSize\"); \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the default Z position for the glyph. | protected float getDefaultZPosition() {
return (control == null)
? 0.f
: (float) control.getZPosition();
} | [
"String getZPosition();",
"public int getzPos() {\n return zPos;\n }",
"public double getZOffset() {\n return getOffset(\"z\");\n }",
"public float getZPosition() {\n return zPosition;\n }",
"double getCurrentZPos();",
"public int getZIndex() {\n return z_index;\n }",
"float getPositionZ();",
"public int getZIndex() {\n return zIndex;\n }",
"@JsOverlay public final Number getzIndex() {\n\t\treturn this.zIndex;\n\t}",
"public double getZMax() { return getBBox()[1].z; }",
"public int getZOrder() {\r\n\t\treturn zOrder;\r\n\t}",
"public int getZIndex()\n {\n return zIndex;\n }",
"default int getCurrentZLevel() {\n\t\treturn currentZLevelProperty().get();\n\t}",
"public int getRenderZ() {\n return this.renderZ;\n }",
"public double getZ() {\n return zCoord;\n }",
"public double getZ() \n\t{\n\t\treturn z.coord;\n\t}",
"public int getBlockZ()\n\t {\n\t\t if(z >= 0.0) return (int)z;\n\t\t return -1 + (int)(z);\n\t }",
"final public double getFocusZ() {\n return focusZ;\n }",
"public final float getZIndex() {\n if (org.xms.g.utils.GlobalEnvSetting.isHms()) {\n org.xms.g.utils.XmsLog.d(\"XMSRouter\", \"((com.huawei.hms.maps.model.PolygonOptions) this.getHInstance()).getZIndex()\");\n return ((com.huawei.hms.maps.model.PolygonOptions) this.getHInstance()).getZIndex();\n } else {\n org.xms.g.utils.XmsLog.d(\"XMSRouter\", \"((com.google.android.gms.maps.model.PolygonOptions) this.getGInstance()).getZIndex()\");\n return ((com.google.android.gms.maps.model.PolygonOptions) this.getGInstance()).getZIndex();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generamos las referencias de los diferentes views | private void generarReferenciasViews() {
this.contexto = this;
editText = (EditText)findViewById(R.id.editText);
boton = (Button)findViewById(R.id.btnEjecutarMapa);
boton3 = (Button) findViewById(R.id.buttonActividad3);
editTextLat = (EditText) findViewById(R.id.editTextLatitud);
editTextLong = (EditText) findViewById(R.id.editTextLong);
ControladorBotones cb = new ControladorBotones(contexto,editText,editTextLong,editTextLat);
boton.setOnClickListener(cb);
boton3.setOnClickListener(cb);
/*
boton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// crear el intento que nos ejecute la SecondActivity
Intent intento = new Intent(contexto,SecondActivity.class);
contexto.startActivity(intento);
}
});
*/
} | [
"public java.lang.String getReferenciado();",
"private void getReferences() {\n llCommentsResource = (LinearLayout) findViewById(R.id.llCommentsResource);\n bAddNewComment = (Button) findViewById(R.id.bAddNewComment);\n getActionBar().setDisplayHomeAsUpEnabled(true);\n }",
"public void setReferenciado(java.lang.String referenciado);",
"static String computePathFromViews(Collection<String> views) {\n \n StringBuilder path = new StringBuilder(\"\");\n \n for (String view : views) {\n StringTokenizer columns = new StringTokenizer(view, \" \");\n String leftColumn = columns.nextToken().trim();\n if (leftColumn.indexOf(EXCLUSION_VIEW_PREFIX + DEPOT_ROOT) != -1) {\n continue;\n }\n leftColumn = leftColumn.substring(leftColumn.indexOf(DEPOT_ROOT));\n path.append(leftColumn + \" \");\n }\n \n return path.toString();\n }",
"private void extraerReferencias() {\r\n\t\tElements referencias = documento.select(PARRAFO);\r\n\t\tfor (Element referencia : referencias) {\r\n\t\t\tString texto = referencia.text();\r\n\t\t\tif (texto.startsWith(INICIO_REFERENCIA)\r\n\t\t\t\t\t&& (texto.endsWith(FIN_REFERENCIA) || texto.endsWith(FIN_REFERENCIA + \".\"))) {\r\n\t\t\t\tarticulo.agregarReferencia(texto.replace(FIN_REFERENCIA, \"\"));\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void resetReferenciado();",
"private void findViews() {\n\n }",
"public String navigateDetalleficharetirobasesCollection() {\n if (this.getSelected() != null) {\n FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"Detalleficharetirobases_items\", this.getSelected().getDetalleficharetirobasesCollection());\n }\n return \"/detalleficharetirobases/index\";\n }",
"Variable getRefers();",
"private final Map<String, String> getUrls(String themeDir, UrlBuilder urlBuilder) {\n // The urls that are accessible to the templates. \n // NB We are not using our menu object mechanism to build menus here, because we want the \n // view to control which links go where, and the link text and title.\n Map<String, String> urls = new HashMap<String, String>();\n \n urls.put(\"home\", urlBuilder.getHomeUrl());\n \n urls.put(\"about\", urlBuilder.getPortalUrl(Route.ABOUT));\n if (ContactMailServlet.getSmtpHostFromProperties() != null) {\n urls.put(\"contact\", urlBuilder.getPortalUrl(Route.CONTACT));\n }\n urls.put(\"search\", urlBuilder.getPortalUrl(Route.SEARCH)); \n urls.put(\"termsOfUse\", urlBuilder.getPortalUrl(Route.TERMS_OF_USE)); \n urls.put(\"login\", urlBuilder.getPortalUrl(Route.LOGIN)); \n urls.put(\"logout\", urlBuilder.getLogoutUrl()); \n urls.put(\"siteAdmin\", urlBuilder.getPortalUrl(Route.LOGIN)); \n \n urls.put(\"siteIcons\", urlBuilder.getPortalUrl(themeDir + \"/site_icons\"));\n return urls;\n }",
"public void Link (View view) {\n setContentView(R.layout.link_in);\n\n }",
"private void getViewReferences() {\n now_playing_album_cover = findViewById(R.id.now_playing_album_cover);\n now_playing_progress_bar = findViewById(R.id.now_playing_progress_bar);\n now_playing_song_current_length = findViewById(R.id.now_playing_song_current_length);\n now_playing_song_total_length = findViewById(R.id.now_playing_song_total_length);\n now_playing_song_title = findViewById(R.id.now_playing_song_title);\n now_playing_artist_name = findViewById(R.id.now_playing_artist_name);\n now_playing_album_title = findViewById(R.id.now_playing_album_title);\n now_playing_previous_button = findViewById(R.id.now_playing_previous_button);\n now_playing_play_button = findViewById(R.id.now_playing_play_button);\n now_playing_next_button = findViewById(R.id.now_playing_next_button);\n }",
"private void findViews() {\n jurgen = (ImageView) findViewById(R.id.jurgen_view);\n jurgen.setTag(JURGEN_VIEW_TAG);\n joost = (ImageView) findViewById(R.id.joost_view);\n joost.setTag(JOOST_VIEW_TAG);\n nick = (ImageView) findViewById(R.id.nick_view);\n nick.setTag(NICK_VIEW_TAG);\n stijn = (ImageView) findViewById(R.id.stijn_view);\n stijn.setTag(STIJN_VIEW_TAG);\n }",
"private void registerViews() {\n\t}",
"public void setReferencia(java.lang.String referencia) {\n this.referencia = referencia;\n }",
"private void findControlReferences() {\n header = (TextView)findViewById(R.id.header);\n addRestaurant = (Button)findViewById(R.id.addRestaurant);\n restaurantsList = (ExpandableListView)findViewById(R.id.restaurantsList);\n }",
"private void populateViewCollections() {\n\n\t}",
"public String navigateRebajas() {\n if (this.getSelected() != null) {\n FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"Rebaja_items\", this.getSelected().getRebajas());\n }\n return \"/mantenedor/rebaja/index\";\n }",
"@Override\r\n\tpublic String getReferringURL() {\r\n\t\treturn (String)map.get(REFERRING_URL);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes the square at the given coordinate and terminates it. | @Override
public void deleteSquareAt(Coordinate coordinate)
throws IllegalArgumentException, CoordinateNotOccupiedException {
if (!isEffectiveCoordinate(coordinate))
throw new IllegalArgumentException();
if (getSubDungeonContaining(coordinate) == null)
throw new CoordinateNotOccupiedException(coordinate, this);
getSubDungeonContaining(coordinate).deleteSquareAt(coordinate);
} | [
"public void clearSquare(int x, int y)\n {\n mBoard.setCell(x, y, mSolution.getCell(x, y));\n }",
"public void removePiece(Coordinate coord) \n\t{//tested via data method it calls \n\t\t_data.set(getIndex(coord),-1);\n\t\t\n\t}",
"@Override\r\n\tpublic void removeAsSquareAt(Point position) {\r\n\t\tif (position != null) {\r\n\t\t\tSquare removed = squares.remove(position);\r\n\t\t\tif (removed != null) {\r\n\t\t\t\t// Neighbors are removed in all directions.\r\n\t\t\t\tfor (Direction d : Direction.values()){\r\n\t\t\t\t\tremoved.removeNeighbor(d);\r\n\t\t\t\t}\r\n\t\t\t\ttry {\r\n\t\t\t\t\tremoved.setDungeon(null);\r\n\t\t\t\t} catch (IllegalDungeonException e) {\r\n\t\t\t\t\t// never happens\r\n\t\t\t\t\tassert false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void removeTargetSquare(Square square);",
"public void removePiece(int x, int y)\r\n {\r\n if(isValidSqr(x, y)) board[x][y] = null;\r\n }",
"void clearCell(int x, int y);",
"abstract protected boolean clearSquareHitMine(Location m);",
"public void removeMarkFromSquare(int row, int column) {\n checkDimension(row, column);\n if (board[row][column] == Mark.EMPTY) {\n return;\n }\n board[row][column] = Mark.EMPTY;\n marksPlaced--;\n }",
"public void deleteCoordinates() {\n this.openWriteableDB();\n db.delete(COORD_TABLE, null, null);\n this.close();\n }",
"public void deleteObject(int x,int y)\n {\n map.deleteFromMap(x/OBJECT_SIZE,y/OBJECT_SIZE);\n }",
"public void removeFromWindow() {\r\n this.theSquare.removeFromWindow();\r\n }",
"@Override\n\tpublic void removeSquareAt(Position position) \n\t\tthrows NullPointerException, IllegalStateException\n\t{\n\t\tif (hasSquareAt(position))\n\t\t\tgetSubDungeonAt(position).removeSquareAt(position.subtract(getPositionOfSubDungeon(getSubDungeonAt(position))));\n\t}",
"public void shrinkSquare()\n {\n squareSize--;\n }",
"void deleteShape(String shape);",
"public Piece remove(int x, int y) {\n Piece p;\n if (x >= 8 || y >= 8) {\n System.out.println(\"(x,y) is out of bounds\");\n return null;\n }\n if (piecesMatrix[x][y] == null) {\n System.out.println(\"No piece at (x,y)\");\n return null;\n }\n p = piecesMatrix[x][y];\n piecesMatrix[x][y] = null;\n return p;\n }",
"public void removeFreeSpace(int position) {\n\t\tfor(int i = 0;i<coordinate.size();i++) {\n\t\t\tif(coordinate.get(i) == position) {\n\t\t\t\tcoordinate.remove(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"private static void RemoveTile(int x, int y) { city.setTile(EMPTY, x, y); }",
"public void removeRabbitAt(int x, int y) {\n \t\trabbitSpace.putObjectAt(x, y, null);\n \t}",
"private void cleanSquare() {\n\t\tcleanIfDirty();\n\t\tsetDirection(0);\n\t\tmove();\n\t\tcleanIfDirty();\n\t\tsetDirection(2);\n\t\tmove();\n\t\tmove();\n\t\tcleanIfDirty();\n\t\tsetDirection(0);\n\t\tmove();\n\t\tsetDirection(1);\n\t\treturn;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
VOMencodes the provided VSignature. | static byte[] encodeSignature(VSignature signature) throws VException {
return VomUtil.encode(signature, VSignature.class);
} | [
"int getSignatureV();",
"protected abstract byte[] encode(Object o) throws EncoderException;",
"com.google.protobuf.ByteString getSignatureS();",
"public static native void CommitmentSigned_set_signature(long this_ptr, byte[] val);",
"com.google.protobuf.ByteString getSignature();",
"private byte[] prepareSignature(){\n\t\tByteArrayOutputStream outputStream = new ByteArrayOutputStream( );\n\t\ttry {\n\t\t\toutputStream.write(this.type.toString().getBytes());\n\t\t\toutputStream.write(this.sender.getBytes());\n\t\t\toutputStream.write(this.message);\n\t\t\tbyte encrypted = (byte) (isEncrypted ? 1 : 0);\n\t\t\toutputStream.write(encrypted);\n\n\t\t\treturn outputStream.toByteArray( );\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}",
"private String encode(APIKey apiKey) {\n if (!signer.sign(apiKey)) {\n return null;\n }\n\n String json = apiKey.toJson();\n String base64 = new String(Base64.getEncoder().encode(json.getBytes()));\n return String.format(\"%s.%s\", base64, apiKey.getApiKeySignature());\n }",
"public abstract byte[] encode(Object value);",
"public static native void ClosingSigned_set_signature(long this_ptr, byte[] val);",
"byte[] encodePublicKey(PublicKey publicKey) throws IOException;",
"com.google.protobuf.ByteString getSignatureR();",
"public Signature signMessage(String message);",
"public CBORObject EncodeToCBORObject() throws CoseException {\n CBORObject obj;\n \n obj = EncodeCBORObject();\n \n if (emitTag) {\n obj = CBORObject.FromObjectAndTag(obj, messageTag.value);\n }\n \n return obj;\n }",
"java.lang.String getSignature();",
"com.google.protobuf.StringValue getSignature();",
"public static native byte[] CommitmentSigned_write(long obj);",
"public static native byte[] CommitmentSigned_get_signature(long this_ptr);",
"public static native byte[] AnnouncementSignatures_write(long obj);",
"protected abstract CBORObject EncodeCBORObject() throws CoseException;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get data schema directory. | private File getDataSchemaDirectory(String schemaName) {
return dataDir.configFile(CONFIG_FOLDER + "/" + schemaName);
} | [
"public static File getDataDirectory() {\n\t\treturn DATA_DIRECTORY;\n\t}",
"private String getDataDirectory() {\n Session session = getSession();\n String dataDirectory;\n try {\n dataDirectory = (String) session.createSQLQuery(DATA_DIRECTORY_QUERY).list().get(0);\n } finally {\n releaseSession(session);\n }\n return dataDirectory;\n }",
"public String getDataDir() {\n return dataDir.getAbsolutePath();\n }",
"public Path getDataDirectory();",
"private File getDataDir(){\n\t\tFile file = new File(this.configManager.getConfigDirectory() +\n\t\t\t\tFile.separator + \n\t\t\t\tDATA_DIR);\n\t\t\n\t\tif(!file.exists()){\n\t\t\tfile.mkdirs();\n\t\t}\n\t\t\n\t\treturn file;\n\t}",
"public static String getDataDirectory() {\n return getHomeDirectory() + File.separator + \"data\";\n }",
"protected String getSchemaBindingDirectory()\n {\n \tif (schemaBindingDirectory != null)\n \t\treturn schemaBindingDirectory;\n \treturn getDefaultSchemaBindingDirectory();\n }",
"public String getOutputDataDirectory();",
"public List<String> getSchemaDirectories() {\n return schemaDirectories;\n }",
"public String getDataDir() {\n\t\treturn dataDir;\n\t}",
"private static String getDataDir() {\n return self.get(\"dataDir\");\n }",
"public String getSchemaLocation();",
"public File getDataDirectoryRoot() {\n return data;\n }",
"public String getDataFolder (){\n\t\t\treturn data_folder;\n\t}",
"String getSchemaFile();",
"File getDataFolder();",
"String getSchemafile();",
"private File getDataSchema(String schemaIdentifier, String schemaName) {\n String filename = \"_\" + org.gbif.ipt.utils.FileUtils.getSuffixedFileName(schemaIdentifier, DATA_SCHEMA_FILE_SUFFIX);\n return dataDir.configFile(CONFIG_FOLDER + \"/\" + schemaName + \"/\" + filename);\n }",
"public static String getDataPath() {\n return getAbsolutePath(Environment.getDataDirectory());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Notifies the launch manager that a launch configuration has been added. The configuration is added to the index of configurations by project, and listeners are notified. | protected void launchConfigurationAdded(ILaunchConfiguration config) {
if (config.isWorkingCopy()) {
return;
}
if (isValid(config)) {
boolean added = false;
synchronized (this) {
List<ILaunchConfiguration> allConfigs = getAllLaunchConfigurations();
if (!allConfigs.contains(config)) {
allConfigs.add(config);
added = true;
}
}
if (added) {
getConfigurationNotifier().notify(config, ADDED);
clearConfigNameCache();
}
} else {
launchConfigurationDeleted(config);
}
} | [
"public void launchAdded(ILaunch launch)\n\t{\n\t\t// Verify that the launch is of the correct configuration type.\n\t\ttry\n\t\t{\n\t\t\tILaunchConfiguration config = launch.getLaunchConfiguration();\n\t\t\tif (! (config.getType().getIdentifier().equals(IRuntimePlayerLaunchConfigurationConstants.ID_RUNTIMEPLAYER_CONFIGURATION)))\n\t\t\t\treturn;\n\t\t} catch (CoreException ex)\n\t\t{\n\t\t\tBRenderLog.logError(ex,\"Unable to query launch configuration.\");\n\t\t}\n\n\t\tif (g_currentLaunch == null)\n\t\t{\n\t\t\tg_currentLaunch = launch;\n\t\t} else\n\t\t{\n\t\t\tBRenderLog.logWarning(\"Runtime Player is currently launched with configuration \"\n\t\t\t + g_currentLaunch.getLaunchConfiguration().getName() + \".\");\n\t\t\t\n\t\t\t// Display a dialog \n\t\t\tDisplay.getDefault().syncExec(new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tGuiUtilities.popupMessage(\"Runtime Player is already launched with configuration \"\n\t\t\t\t\t + g_currentLaunch.getLaunchConfiguration().getName() + \".\",\n\t\t\t\t\t Display.getCurrent().getActiveShell());\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}",
"protected void fireConfigUpdated()\r\n {\r\n List executeListeners = new ArrayList(listeners);\r\n \r\n for (int i=0; i < executeListeners.size(); i++)\r\n {\r\n IConfigurationListener listener = (IConfigurationListener) executeListeners.get(i);\r\n listener.configUpdated();\r\n }\r\n }",
"protected abstract void addConfigurationOnComponents();",
"protected void projectOpened(IProject project) {\n\t\tfor (ILaunchConfiguration config : findLaunchConfigurations(project)) {\n\t\t\tlaunchConfigurationAdded(config);\n\t\t}\n\t}",
"@SuppressWarnings(\"unchecked\")\n public void addRunConfiguration(RunConfiguration config) {\n listRun.add(config);\n }",
"void addConfigurationListener(ConfigurationListener listener);",
"protected void launchConfigurationChanged(ILaunchConfiguration config) {\n\t\tsynchronized(this) {\n\t\t\tfLaunchConfigurations.remove(config);\n\t\t}\n\t\tclearConfigNameCache();\n\t\tif (isValid(config)) {\n\t\t\t// in case the config has been refreshed and it was removed from the\n\t\t\t// index due to 'out of synch with local file system' (see bug 36147),\n\t\t\t// add it back (will only add if required)\n\t\t\tlaunchConfigurationAdded(config);\n\t\t\tgetConfigurationNotifier().notify(config, CHANGED);\n\t\t} else {\n\t\t\tlaunchConfigurationDeleted(config);\n\t\t}\n\t}",
"public void receiveConfiguration() {\r\n\t\tfinal Callable<ArrayList<IComponentDefinition>> query = new Callable<ArrayList<IComponentDefinition>>() {\r\n\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t@Override\r\n\t\t\tpublic ArrayList<IComponentDefinition> call() throws Exception {\r\n\t\t\t\tIMessage<IComponentAddress, Serializable> message = null;\r\n\t\t\t\twhile (message == null) {\r\n\t\t\t\t\tmessage = communicationService.receive(COMPONENT_NAME);\r\n\t\t\t\t\tThread.sleep(1000);\r\n\t\t\t\t}\r\n\t\t\t\treturn Messages.getPayloadOfTypeOrThrow(message, ArrayList.class);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfinal ListenableFuture<ArrayList<IComponentDefinition>> future = service.submit(query);\r\n\r\n\t\t// Add an action performed when a message is received.\r\n\t\tFutures.addCallback(future, new FutureCallback<ArrayList<IComponentDefinition>>() {\r\n\t\t\t@Override\r\n\t\t\tpublic void onSuccess(final ArrayList<IComponentDefinition> result) {\r\n\t\t\t\tnotifyAboutConfigurationChange(result);\r\n\t\t\t\tstartCoreComponent();\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onFailure(final Throwable t) {\r\n\t\t\t\tlog.error(\"Could not receive a new configuration.\", t);\r\n\t\t\t\tteardownPlatform();\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"void addConfigurationListener(ConfigListener listener);",
"void addListener( ConfigurationListener listener );",
"private void fireSDKAdded(ISdk pSdk) {\n for (int i = 0, length = mListeners.size(); i < length; i++) {\n IConfigListener listeneri = mListeners.get(i);\n listeneri.ConfigAdded(pSdk);\n }\n }",
"private void attachConfigurationAdapter() {\n \t\tconfigurationAdapter = new AdapterImpl() {\n \t\t\tpublic void notifyChanged(Notification msg) {\n \t\t\t\tif(GraalfeatureextensionsPackage.Literals.UI_CONFIGURATION__ACTIVE_USER_STORIES.equals(msg.getFeature())) {\n \t\t\t\t\trefresh();\n \t\t\t\t}\n \t\t\t}\n \t\t};\n \t\tuiConfiguration.eAdapters().add(configurationAdapter);\n \t}",
"void add(RegistryCenterConfig config);",
"public void onConfigurationChanged(Configuration newConfig) {\n }",
"@Test\n public void testAddConfiguration()\n {\n AbstractConfiguration c = setUpTestConfiguration();\n config.addConfiguration(c);\n checkAddConfig(c);\n assertEquals(\"Wrong number of configs\", 1, config\n .getNumberOfConfigurations());\n assertTrue(\"Name list is not empty\", config.getConfigurationNames()\n .isEmpty());\n assertSame(\"Added config not found\", c, config.getConfiguration(0));\n assertTrue(\"Wrong property value\", config.getBoolean(TEST_KEY));\n listener.checkEvent(1, 0);\n }",
"void insertTriggerConfig(TriggerConfigData config, int run);",
"public abstract void registerConfigurationListener(ConfigurationListener l);",
"public void add(final Configuration configuration) {\n\t\tadd(configuration, ConfigurationButton.NORMAL);\n\t}",
"public void onConfigChange(List<HelixProperty> configs, NotificationContext context);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set GraduatesPerYear of the Company | public void setGraduatesPerYear ( int GraduatesPerYear )
throws DataObjectException {
try {
// business actions/assertions prior to data assignment
beforeAnySet();
} catch ( Exception e ) {
throw new DataObjectException( "beforeAnySet: " + e.getMessage() );
}
checkLoad();
data.GraduatesPerYear = markNewValue(
data.GraduatesPerYear, GraduatesPerYear );
afterAnySet(); // business actions/assertions after data assignment
} | [
"public void setYears(double years){\r\n\t\tthis.years = years;\r\n\t}",
"public void setGrossTonnage(double grossTonnage);",
"void setYears(int x) {\n\t\tyearsWorked = x;\r\n\t}",
"public void setCurrentYear(BigDecimal currentYear) {\n this.currentYear = currentYear;\n }",
"public double payoffYears() {\n\t\treturn (myNumberOfBulbs * myReplacementBulbCost) / returnPerYear();\n\t}",
"public void setBirthyear(Date birthyear) {\n this.birthyear = birthyear;\n }",
"void setMaxYears(int val);",
"@Override\n\tpublic void setYear(int year) {\n\t\t_esfShooterAffiliationChrono.setYear(year);\n\t}",
"public void setYear(int year)\n {\n Year = year;\n }",
"int getGradYear() {\n return this.year;\n }",
"public void setbrithyear(int by) {\r\n\tbirthyear= by;\r\n}",
"public void setDecorateyear(Date decorateyear) {\n this.decorateyear = decorateyear;\n }",
"public void setYear(int year) throws Exception {\n\t\tset(year, birthdate.get(Calendar.MONTH) + 1,\n\t\t\t\tbirthdate.get(Calendar.DATE));\n\t}",
"public void setRoyalty_cost(double royalty_cost);",
"public void setDocumentYear(int documentYear);",
"public void setYearInClaimsMade(java.lang.Integer value);",
"public void setNumberOfYears(int numberOfYears) {\n this.numberOfYears = numberOfYears;\n }",
"public void setYear(int y) {\n year = y;\n }",
"public Double getDistributionYear() {\r\n return distributionYear;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
.org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmUnknownPlatformProto unknown = 5; | org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmUnknownPlatformProto getUnknown(); | [
"org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmUnknownPlatformProtoOrBuilder getUnknownOrBuilder();",
"org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmNativePlatformProto getNative();",
"org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmNativePlatformProtoOrBuilder getNativeOrBuilder();",
"org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmJvmPlatformProto getJvm();",
"org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmJvmPlatformProtoOrBuilder getJvmOrBuilder();",
"org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmUnresolvedBinaryDependencyProto getUnresolvedBinaryDependency();",
"org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmUnresolvedBinaryDependencyProtoOrBuilder getUnresolvedBinaryDependencyOrBuilder();",
"org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmJsPlatformProtoOrBuilder getJsOrBuilder();",
"org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmJsPlatformProto getJs();",
"proto.PlatformOrBuilder getPlatformOrBuilder();",
"proto.Platform getPlatform();",
"org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmWasmPlatformProtoOrBuilder getWasmOrBuilder();",
"org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmResolvedBinaryDependencyProtoOrBuilder getResolvedBinaryDependencyOrBuilder();",
"proto.PlatformVersion getPlatformVersion();",
"org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmResolvedBinaryDependencyProto getResolvedBinaryDependency();",
"org.jetbrains.kotlin.gradle.idea.proto.generated.kpm.IdeaKpmWasmPlatformProto getWasm();",
"com.google.protobuf.ByteString\n getKotlinSupportVersionBytes();",
"com.google.protobuf.ByteString getUnknown71();",
"com.google.protobuf.ByteString getUnknown73();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getter method for the column indexes for the neighborhood | public int[] getNeighborColIndex() {
if (myRow % 2 == 0) {
return neighborEvenColIndex;
} else {
return neighborOddColIndex;
}
} | [
"public int[] getNeighborRowIndex() {\n return neighborRowIndex;\n }",
"int [] getNeighbors(int cellId);",
"private int getNIdx() {\n return this.colStartOffset + 7;\n }",
"public Location[] getNeighbors() {\n\t\treturn new Location[] {new Location(row - 1, column),\n\t\t\t\tnew Location(row + 1, column),\n\t\t\t\tnew Location(row, column - 1),\n\t\t\t\tnew Location(row, column + 1)};\n\t}",
"public MapCell[] getNeighbors(){\n\t\tMapCell[] neighbors = new MapCell[4];\n\t\tneighbors[0] = getNeighbor(\"east\");\n\t\tneighbors[1] = getNeighbor(\"north\");;\n\t\tneighbors[2] = getNeighbor(\"west\");\n\t\tneighbors[3] = getNeighbor(\"south\");\n\t\treturn neighbors;\n\t}",
"public List<Cell> getNeighbors() {\n return this.neighbors;\n }",
"int getColumns();",
"public java.util.List<Integer> getNeighbors(int index);",
"private Map getColumnIndexMap() {\r\n Map columnIndexMap = new HashMap();\r\n for (int i = 0; i < getHydrateSpan(); i++) {\r\n columnIndexMap.put(\r\n getActualPropertyColumnNames(i)[0].toUpperCase(),\r\n new Integer(i));\r\n }\r\n\r\n return columnIndexMap;\r\n }",
"long getCells(int index);",
"public List<Cell<V>> getNeighbourhood();",
"long getCellColumn();",
"protected Cell[] getNeighbours() {\r\n\t\treturn this.neighbours;\r\n\t}",
"int[] getColsGrid();",
"public int[] getNeighborhoodArray()\n\t{\n\t\treturn neighborhoodArray;\n\t}",
"int getColumnIndex();",
"public int getColumnIndex();",
"@Override\n public List<Cell> getNeighbors(int row, int col) {\n int[] indexR = {1, -1, 0, 0};\n int[] indexC = {0, 0, 1, -1};\n return mySimulationGrid.getSpecifiedNeighbors(row, col, indexR, indexC, mySimulationGrid);\n }",
"java.math.BigInteger getCollocation();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set all LEDs in the strip to one color | void setStrip( Color color ); | [
"void setColor(int aLedIndex, int aRed, int aGreen, int aBlue);",
"void setStrip( int red, int green, int blue );",
"public void updateLEDs()\n\t\t{\n\t\t\tm_spi.write( m_colorBuffer, m_colorBuffer.length);\t\t\t\n\t\t\t\n\t\t\tresetLatch();\n\t\t}",
"private void reDrawLEDs(){\r\n if (this.isLEDEnable == false) {\r\n for (int i = 1; i < 8; i++) {\r\n LEDs[i].setOff();\t\t\t// turn off all display LEDs\r\n }\r\n }\r\n else {\r\n for (int i = 1; i < 8; i++) {\r\n LEDs[i].setOn(); \r\n LEDs[i].setColor(LEDColor.BLUE);\r\n //Utils.sleep(200);\r\n //leds[i].setOff();\r\n //Utils.sleep(200);\r\n }\r\n }\r\n }",
"void setLedColour(int position, int colour);",
"synchronized void setColors() {\r\n\r\n\t\tswitch (currentLightColor) {\r\n\r\n\t\tcase RED:\r\n\t\t\tred = Color.red;\r\n\t\t\tyellow = Color.gray;\r\n\t\t\tgreen = Color.gray;\r\n\t\t\tbreak;\r\n\r\n\t\tcase YELLOW:\r\n\t\t\tyellow = Color.blue; // make blue so not to blend in with the background\r\n\t\t\tred = Color.gray;\r\n\t\t\tgreen = Color.gray;\r\n\t\t\tbreak;\r\n\r\n\t\tcase GREEN:\r\n\t\t\tgreen = Color.green;\r\n\t\t\tyellow = Color.gray;\r\n\t\t\tred = Color.gray;\r\n\t\t\tbreak;\r\n\r\n\t\t}\r\n\t\trepaint(); // make sure to call repaint method to repaint the colors\r\n\t\tlightChange = false;\r\n\t}",
"private void setRed()\n {\n setColors(2.0,3.0,4.0,5.0,3.0,4.0);\n }",
"public void turnOnAll() throws RemoteException {\n turnOn(Light.RED, Light.GREEN, Light.YELLOW, Light.BLUE);\n }",
"public void setAllLeds(int red, int green, int blue)\n {\n // Verify service is connected\n assertService();\n \n try {\n \tmLedService.setAllLeds(mBinder, red, green, blue);\n } catch (RemoteException e) {\n Log.e(TAG, \"setAllLeds failed\");\n }\n }",
"void makeAllOne(Color color){\n for(int i = 3; i < Config.NUMBER_OF_LEDS * 3; i+=3 ){\n bytes[i] = (byte) color.getBlue();\n bytes[i-1] = (byte) color.getGreen();\n bytes[i-2] = (byte) color.getRed();\n }\n\n }",
"private void setYellow()\n {\n setColors(2.0,3.0,4.0,5.0,3.0,4.0);\n }",
"private void setGreen()\n {\n setColors(30.0,46.0,87.0,177.0,20.0,150.0);\n }",
"private void setColor() {\r\n\t\tswitch (counter) {\r\n\t\tcase 1:\r\n\t\t\tvehicleColor = Color.orange;\r\n\t\t\tbreak;\r\n\r\n\t\tcase 2:\r\n\t\t\tvehicleColor = Color.magenta;\r\n\t\t\tbreak;\r\n\r\n\t\tcase 3:\r\n\t\t\tvehicleColor = Color.pink;\r\n\t\t\tbreak;\r\n\r\n\t\tcase 4:\r\n\t\t\tvehicleColor = Color.cyan;\r\n\t\t\tbreak;\r\n\r\n\t\tcase 5:\r\n\t\t\tvehicleColor = Color.black;\r\n\t\t\tbreak;\r\n\r\n\t\tcase 6:\r\n\t\t\tvehicleColor = Color.GRAY;\r\n\t\t\tbreak;\r\n\r\n\t\t}\r\n\r\n\t}",
"protected void setLED(boolean on) throws IllegalActionException {\n\t\tstateLED=on;\n\t\tif (on)\n\t\t\t_circle.fillColor.setToken(\"{1.0, 0.0, 0.0, 1.0}\"); // red\n\t\telse\n\t\t\t_circle.fillColor.setToken(\"{0.0, 0.0, 0.0, 1.0}\"); // black\n\t}",
"private void setOrange()\n {\n setColors(2.0,3.0,4.0,5.0,3.0,4.0);\n }",
"public void setColorBlue() {\n redLight.enable(true);\n blueLight.enable(false);\n ledColorString = \"blue\";\n }",
"public void resetColor() {\n for (int col = 0; col < squares.length; col++) {\n for (int row = 0; row < squares[0].length; row++) {\n squares[col][row].determineColor(); \n }\n }\n }",
"public void resetColors ()\n {\n fixedNumberPanel.setBackground(Selectable.COLOR_GREY);\n proportionalValuePanel.setBackground(Selectable.COLOR_GREY);\n increasePanel.setBackground(Selectable.COLOR_GREY);\n decreasePanel.setBackground(Selectable.COLOR_GREY);\n bothPanel.setBackground(Selectable.COLOR_GREY);\n differencePanel.setBackground(Selectable.COLOR_GREY);\n ratioTwoQuantitiesPanel.setBackground(Selectable.COLOR_GREY);\n\n }",
"private void updateColorSwatch() {\n float hue = mModel.getHue();\n float saturation = mModel.getSaturation();\n float brightness = mModel.getBrightness();\n float[] hsv = new float[]{hue, (saturation / 100.f), (brightness / 100.f)};\n\n mColorSwatch.setBackgroundColor(Color.HSVToColor(hsv));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "rule__XSwitchExpression__Group__0" $ANTLR start "rule__XSwitchExpression__Group__0__Impl" ../org.xtext.guicemodules.ui/srcgen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10564:1: rule__XSwitchExpression__Group__0__Impl : ( () ) ; | public final void rule__XSwitchExpression__Group__0__Impl() throws RecognitionException {
int stackSize = keepStackSize();
try {
// ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10568:1: ( ( () ) )
// ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10569:1: ( () )
{
// ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10569:1: ( () )
// ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10570:1: ()
{
if ( state.backtracking==0 ) {
before(grammarAccess.getXSwitchExpressionAccess().getXSwitchExpressionAction_0());
}
// ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10571:1: ()
// ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10573:1:
{
}
if ( state.backtracking==0 ) {
after(grammarAccess.getXSwitchExpressionAccess().getXSwitchExpressionAction_0());
}
}
}
}
finally {
restoreStackSize(stackSize);
}
return ;
} | [
"public final void rule__XSwitchExpression__Group_2_0_0__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10848:1: ( rule__XSwitchExpression__Group_2_0_0__0__Impl )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10849:2: rule__XSwitchExpression__Group_2_0_0__0__Impl\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group_2_0_0__0__Impl_in_rule__XSwitchExpression__Group_2_0_0__022111);\n rule__XSwitchExpression__Group_2_0_0__0__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group_2_1_0__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:11035:1: ( rule__XSwitchExpression__Group_2_1_0__0__Impl )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:11036:2: rule__XSwitchExpression__Group_2_1_0__0__Impl\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group_2_1_0__0__Impl_in_rule__XSwitchExpression__Group_2_1_0__022478);\n rule__XSwitchExpression__Group_2_1_0__0__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group_2_0_0__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:9242:1: ( rule__XSwitchExpression__Group_2_0_0__0__Impl )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:9243:2: rule__XSwitchExpression__Group_2_0_0__0__Impl\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group_2_0_0__0__Impl_in_rule__XSwitchExpression__Group_2_0_0__018857);\n rule__XSwitchExpression__Group_2_0_0__0__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group_2_1_0__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:9429:1: ( rule__XSwitchExpression__Group_2_1_0__0__Impl )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:9430:2: rule__XSwitchExpression__Group_2_1_0__0__Impl\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group_2_1_0__0__Impl_in_rule__XSwitchExpression__Group_2_1_0__019224);\n rule__XSwitchExpression__Group_2_1_0__0__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10556:1: ( rule__XSwitchExpression__Group__0__Impl rule__XSwitchExpression__Group__1 )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10557:2: rule__XSwitchExpression__Group__0__Impl rule__XSwitchExpression__Group__1\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group__0__Impl_in_rule__XSwitchExpression__Group__021533);\n rule__XSwitchExpression__Group__0__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n pushFollow(FOLLOW_rule__XSwitchExpression__Group__1_in_rule__XSwitchExpression__Group__021536);\n rule__XSwitchExpression__Group__1();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group_2_0_0_0__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:9301:1: ( rule__XSwitchExpression__Group_2_0_0_0__1__Impl )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:9302:2: rule__XSwitchExpression__Group_2_0_0_0__1__Impl\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group_2_0_0_0__1__Impl_in_rule__XSwitchExpression__Group_2_0_0_0__118976);\n rule__XSwitchExpression__Group_2_0_0_0__1__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group_2_0_0_0__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10907:1: ( rule__XSwitchExpression__Group_2_0_0_0__1__Impl )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10908:2: rule__XSwitchExpression__Group_2_0_0_0__1__Impl\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group_2_0_0_0__1__Impl_in_rule__XSwitchExpression__Group_2_0_0_0__122230);\n rule__XSwitchExpression__Group_2_0_0_0__1__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group_2_0_0__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:9951:1: ( rule__XSwitchExpression__Group_2_0_0__0__Impl )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:9952:2: rule__XSwitchExpression__Group_2_0_0__0__Impl\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group_2_0_0__0__Impl_in_rule__XSwitchExpression__Group_2_0_0__020298);\n rule__XSwitchExpression__Group_2_0_0__0__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group_2_0_0__0() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:10683:1: ( rule__XSwitchExpression__Group_2_0_0__0__Impl )\r\n // InternalDroneScript.g:10684:2: rule__XSwitchExpression__Group_2_0_0__0__Impl\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__XSwitchExpression__Group_2_0_0__0__Impl();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public final void rule__XSwitchExpression__Group_2_1_0_0__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:11077:1: ( ( '(' ) )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:11078:1: ( '(' )\n {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:11078:1: ( '(' )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:11079:1: '('\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXSwitchExpressionAccess().getLeftParenthesisKeyword_2_1_0_0_0()); \n }\n match(input,56,FOLLOW_56_in_rule__XSwitchExpression__Group_2_1_0_0__0__Impl22568); if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXSwitchExpressionAccess().getLeftParenthesisKeyword_2_1_0_0_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group_2_1_0__0() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:22091:1: ( rule__XSwitchExpression__Group_2_1_0__0__Impl )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:22092:2: rule__XSwitchExpression__Group_2_1_0__0__Impl\r\n {\r\n pushFollow(FOLLOW_rule__XSwitchExpression__Group_2_1_0__0__Impl_in_rule__XSwitchExpression__Group_2_1_0__044542);\r\n rule__XSwitchExpression__Group_2_1_0__0__Impl();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public final void rule__XSwitchExpression__Group_2_1_0__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:10138:1: ( rule__XSwitchExpression__Group_2_1_0__0__Impl )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:10139:2: rule__XSwitchExpression__Group_2_1_0__0__Impl\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group_2_1_0__0__Impl_in_rule__XSwitchExpression__Group_2_1_0__020665);\n rule__XSwitchExpression__Group_2_1_0__0__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group_2_0__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:9210:1: ( rule__XSwitchExpression__Group_2_0__1__Impl )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:9211:2: rule__XSwitchExpression__Group_2_0__1__Impl\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group_2_0__1__Impl_in_rule__XSwitchExpression__Group_2_0__118796);\n rule__XSwitchExpression__Group_2_0__1__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group_2_0_0_0__1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:21963:1: ( rule__XSwitchExpression__Group_2_0_0_0__1__Impl )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:21964:2: rule__XSwitchExpression__Group_2_0_0_0__1__Impl\r\n {\r\n pushFollow(FOLLOW_rule__XSwitchExpression__Group_2_0_0_0__1__Impl_in_rule__XSwitchExpression__Group_2_0_0_0__144294);\r\n rule__XSwitchExpression__Group_2_0_0_0__1__Impl();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public final void rule__XSwitchExpression__Group_2_0__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10816:1: ( rule__XSwitchExpression__Group_2_0__1__Impl )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:10817:2: rule__XSwitchExpression__Group_2_0__1__Impl\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group_2_0__1__Impl_in_rule__XSwitchExpression__Group_2_0__122050);\n rule__XSwitchExpression__Group_2_0__1__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group_2_0_0_0__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:10010:1: ( rule__XSwitchExpression__Group_2_0_0_0__1__Impl )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:10011:2: rule__XSwitchExpression__Group_2_0_0_0__1__Impl\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group_2_0_0_0__1__Impl_in_rule__XSwitchExpression__Group_2_0_0_0__120417);\n rule__XSwitchExpression__Group_2_0_0_0__1__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:8950:1: ( rule__XSwitchExpression__Group__0__Impl rule__XSwitchExpression__Group__1 )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:8951:2: rule__XSwitchExpression__Group__0__Impl rule__XSwitchExpression__Group__1\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group__0__Impl_in_rule__XSwitchExpression__Group__018279);\n rule__XSwitchExpression__Group__0__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n pushFollow(FOLLOW_rule__XSwitchExpression__Group__1_in_rule__XSwitchExpression__Group__018282);\n rule__XSwitchExpression__Group__1();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:9659:1: ( rule__XSwitchExpression__Group__0__Impl rule__XSwitchExpression__Group__1 )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:9660:2: rule__XSwitchExpression__Group__0__Impl rule__XSwitchExpression__Group__1\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group__0__Impl_in_rule__XSwitchExpression__Group__019720);\n rule__XSwitchExpression__Group__0__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n pushFollow(FOLLOW_rule__XSwitchExpression__Group__1_in_rule__XSwitchExpression__Group__019723);\n rule__XSwitchExpression__Group__1();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__XSwitchExpression__Group_2_1_0__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:11046:1: ( ( ( rule__XSwitchExpression__Group_2_1_0_0__0 ) ) )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:11047:1: ( ( rule__XSwitchExpression__Group_2_1_0_0__0 ) )\n {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:11047:1: ( ( rule__XSwitchExpression__Group_2_1_0_0__0 ) )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:11048:1: ( rule__XSwitchExpression__Group_2_1_0_0__0 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXSwitchExpressionAccess().getGroup_2_1_0_0()); \n }\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:11049:1: ( rule__XSwitchExpression__Group_2_1_0_0__0 )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:11049:2: rule__XSwitchExpression__Group_2_1_0_0__0\n {\n pushFollow(FOLLOW_rule__XSwitchExpression__Group_2_1_0_0__0_in_rule__XSwitchExpression__Group_2_1_0__0__Impl22505);\n rule__XSwitchExpression__Group_2_1_0_0__0();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXSwitchExpressionAccess().getGroup_2_1_0_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Increase Team B fouls counter by 1 | public void foulTeamB(View v){
teamBScores[1]++;
displayForTeamB(1);
} | [
"public void add1ToTeamB(View view){\n scoreTeamB = scoreTeamB+1;\n displayForTeamB(scoreTeamB);\n }",
"public void increaseTotalForTeamB(int score) {\n totalScoreTeamB = totalScoreTeamB + score;\n displayTotalForTeamB(totalScoreTeamB);\n }",
"public void addOneFoulForTeamB(View view) {\n\n foulsForTeamB = foulsForTeamB + 1;\n displayFoulsForTeamB(foulsForTeamB);\n }",
"public void incGameCount() {\n\t\tthis.gameCount +=1; \n\t}",
"public void incrementNumOfBoats() {\n\t\tnumOfBoats++;\n\t}",
"public void addFoulTeamB(View view) {\r\n foul_TeamB = foul_TeamB + 1;\r\n displayFoulForTeamB(foul_TeamB);\r\n }",
"public void addFoulForTeamB(View view) {\n foulsTeamB += 1;\n displayFoulsTeamB(foulsTeamB);\n }",
"public void incGamesPlayed() {\n gamesPlayed++;\n }",
"public void updateNumberOfTimesHitBounceBall ()\r\n\t{\r\n\t\tnumberOfTimesHitBounceBall++;\r\n\t}",
"public void addScoreForTeamB(View v) {\n scoreTeamB += 1;\n updateText(scoreTeamB, v);\n }",
"public void incGamesPlayed() {\r\n\t\tgamesPlayed ++;\r\n\t\tinstance_gamesPlayed ++;\r\n\t}",
"public void incLost() {\n this.gamesLost = gamesLost + 1;\n }",
"public void increamentTheNumberOfTurns() {\n\n this.noofTurns += 1;\n }",
"public void addSixForTeamB(View v) {\n scoreTeamB = scoreTeamB + 6;\n displayForTeamB(scoreTeamB);\n }",
"public void incrementSplitBrain() {\n splitBrainCounter.increment(GIT_UPDATE_SPLIT_BRAIN);\n }",
"public void incrementBallsIllusion() {\r\n\t\tballsInsideIllusion++;\r\n\t}",
"public void updateGamesPlayed() {\n gamesPlayed++;\n }",
"public void increaseCount() {\r\n\t\t\tcount++;\r\n\t\t}",
"public void add1ToTeamA(View view){\n scoreTeamA = scoreTeamA+1;\n displayForTeamA(scoreTeamA);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Spring Data repository for the Car entity. | @SuppressWarnings("unused")
@Repository
public interface CarRepository extends JpaRepository<Car, Long> {
Optional<Car> findByCode(String code);
} | [
"@Repository\r\npublic interface CarRepo extends CrudRepository<Car, Long> {\r\n\t\r\n\t/**\r\n\t * Fetch the Car entry from database for the matching carId and not set as deleted\r\n\t * @param carId\r\n\t * @return Car entity of the matching carId\r\n\t */\r\n\t@Query(\"SELECT c FROM Car c WHERE c.carId=:carId AND c.carDeleted = false\")\r\n\tpublic Car findByCarId(@Param(\"carId\") Long carId);\r\n\t\r\n\t/**\r\n\t * Fetch the Car entry from database for the matching Registration Number and not set as deleted\r\n\t * @param registrationNumber\r\n\t * @return Car entity of the matching Registration Number\r\n\t */\r\n\t@Query(\"SELECT c FROM Car c WHERE c.registrationNumber =:regNum AND c.carDeleted = false\")\r\n\tpublic Car findByRegistrationNumber(@Param(\"regNum\") String registrationNumber);\r\n\r\n\t\r\n\t//public void deleteByRegistrationNumber(String registrationNumber);\r\n\r\n\t/**\r\n\t * Fetch all the car entries from the database which matches the specified model and not set as deleted\r\n\t * @param model\r\n\t * @return List of Car entities\r\n\t */\r\n\t@Query(\"SELECT c FROM Car c WHERE c.model =:model AND c.carDeleted = false\")\r\n\tpublic List<Car> findAllByModel(@Param(\"model\") String model);\r\n\r\n\t/**\r\n\t * Fetch all the car entries from database which matches the specified price and not set as deleted \r\n\t * @param pricePerDay\r\n\t * @return List of Car entities\r\n\t */\r\n\t@Query(\"SELECT c FROM Car c WHERE c.pricePerDay =:price and c.carDeleted = false\")\r\n\tpublic List<Car> findAllByPricePerDay(@Param(\"price\") Double pricePerDay);\r\n\t\r\n\t/**\r\n\t * Fetch all car entries which are marked as deleted\r\n\t * @return List of deleted car entities\r\n\t */\r\n\t@Query(\"SELECT c FROM Car c WHERE c.carDeleted = true\")\r\n\tpublic List<Car> allDeletedCar();\r\n\r\n\t\r\n\t\r\n\r\n}",
"public interface ManufacturerRepository extends CrudRepository<Manufacturer, Integer>\n{\n\t/**\n\t * Retrieves all the Manufacturers from the database.\n\t * @return an Iterable of Manufacturer entities from the database\n\t */\n\tpublic Iterable<Manufacturer> findAll(); \n}",
"@Query(\"SELECT c FROM Car c WHERE c.carId=:carId AND c.carDeleted = false\")\r\n\tpublic Car findByCarId(@Param(\"carId\") Long carId);",
"@Repository\r\npublic interface VehicleRepository extends JpaRepository<Vehicle, Integer> {\r\n\t\r\n\t/**\r\n\t * This is a custom finder to filter all vehicles by Make.\r\n\t * \r\n\t * @param make: the Make of the vehicle to filter on, e.g Tesla\r\n\t * @return a collection of Vehicle of the Make criteria.\r\n\t */\r\n\t@Query(value=\"SELECT * FROM Vehicle WHERE Make = ?\", nativeQuery=true)\r\n\tCollection<Vehicle> findByMake(String make);\r\n}",
"@SuppressWarnings(\"unused\")\n@Repository\npublic interface CarerClientRelationRepository extends JpaRepository<CarerClientRelation, Long>, JpaSpecificationExecutor<CarerClientRelation> {\n}",
"public Car findCarByName(String name){\r\n return repository.findCarByName(name);\r\n }",
"public Car findCarById(int id);",
"public Car saveCar(Car car) {\r\n return repository.save(car);\r\n }",
"@Override\n\tpublic List<CarDO> findAll(Specification<CarDO> spec) {\n\t\treturn carRepository.findAll(spec);\n\t}",
"@Repository\npublic interface ComentarioRepository extends JpaRepository<Comentario, Long> {\n\n}",
"@Repository\npublic interface VendorsRepository extends CrudRepository<Vendor, Long> {\n}",
"List<Car> findByBrand(String brand);",
"@Transactional\npublic interface CarparkSpaceRepository extends JpaRepository<CarparkSpace, Long> {\n List<CarparkSpace> findByBooked(boolean bookingstatus);\n\n CarparkSpace findBySpaceType_NameAndBooked(String spaceTypeName, boolean availability);\n\n List<CarparkSpace> findAllBySpaceType_NameAndBooked(String spaceTypeName, boolean availability);\n\n List<CarparkSpace> findAllByCarpark(Carpark carpark);\n\n List<CarparkSpace> findBySpaceType_IdAndBooked(Long spaceType, boolean status);\n\n List<CarparkSpace> findByCarpark_Airport_IdAndCarpark_IdAndSpaceType_IdAndBooked(Long airportId, Long carparkId, Long spaceTypeId, boolean status);\n\n List<CarparkSpace> findAllBySpaceType_NameAndCarpark(String spaceTypeName, Carpark carpark);\n\n}",
"@Repository(value = \"spectaclesRepository\")\r\npublic interface ISpectaclesRepository extends JpaRepository<Spectacles, Integer>{\t\r\n\t\r\n}",
"List<Car> findByBrand(@NonNull String brand);",
"@Repository\npublic interface BookRepository extends JpaRepository<Book, Long> {\n\n}",
"@SuppressWarnings(\"unused\")\n@Repository\npublic interface SchemeRepository extends JpaRepository<Scheme,Long> {\n\n List<Scheme> findSchemeByDriver(Driver driver);\n\n}",
"@Override\n public List<CarDO> find(CarStatus carStatus)\n {\n return carRepository.findByCarStatus(carStatus);\n }",
"public interface CurrencyRepository extends CrudRepository<CurrencyEntity, Long> {\r\n\tCurrencyEntity findByName(String name);\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
index of shortest tour in population: used for elitism | private int indexFittest(Tour[] population) {
Tour a = population[0];
int index = 0;
for(int i=1;i<population.length;i++) {
if (a.getLength() > population[i].getLength()) {
a = population[i];
index = i;
}
}
return index;
} | [
"private int getBestTourIndex()\r\n {\r\n return Math.min(bestIndex,bestTourNumber-1);\r\n }",
"private short minTurns(){\n\t\tshort tempTurn = 1000;\t// current max turn\n\t\tshort index = 0;\t\t// the index for current max turn\n\t\tshort turn;\t\t\t// current turn\n\t\tfor(short i=0; i<sizeTour; i++){\n\t\t\tturn = population[selected[i]].getTurn();\n\t\t\tif(tourOcc[i]==0){\n\t\t\t\tif(tempTurn>turn){\n\t\t\t\t\tindex = i;\n\t\t\t\t\ttempTurn = turn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttourOcc[index] = 1;\n\t\treturn index;\t\n\t}",
"private int findStartingTile() {\n this.visited = new boolean[this.map.length * this.map[0].length];\n int index = (this.visited.length/2) + (this.columnLen/2);\n while (true) {\n int col = index % this.columnLen;\n int row = (index - col) / this.columnLen;\n this.visited[index] = true;\n\n Type tileType = tileTypes[map[row][col]];\n if (tileType != Type.EMPTY) {\n return row * this.columnLen + col;\n }\n\n index++;\n if (index == this.map.length * this.columnLen) {\n index = 0;//return -1;\n }\n \n if (this.visited[index]) {\n return -1;\n }\n }\n }",
"private int getWorstIndex() {\n\t\tIndividual worst = null;\n\t\tint idx = -1;\n\t\tfor (int i = 0; i < population.size(); i++) {\n\t\t\tIndividual individual = population.get(i);\n\t\t\tif (worst == null) {\n\t\t\t\tworst = individual;\n\t\t\t\tidx = i;\n\t\t\t} else if (individual.fitness > worst.fitness) {\n\t\t\t\tworst = individual;\n\t\t\t\tidx = i; \n\t\t\t}\n\t\t}\n\t\treturn idx;\n\t}",
"int freecabInd(int dest) {\n int index = 0;\n int min = 0;\n int minIndex = 0;\n\n for(int i=0;i<freeCab.length;i++){\n\n int matLandmark = matchingLandmark(freeCab[index][0], freeCab[index][1]);\n\n int dis = distance.dijkstra(adjancy, matLandmark, dest);\n\n if (dis < min) {\n min = dis;\n minIndex = index;\n }\n index++;\n\n }\n\n return minIndex;\n\n }",
"public static void tour()\r\n {\r\n int[] vect = new int[n];\r\n int start = Arrays.binarySearch(city, \"Spokane\");\r\n\r\n // First permutation n vector.\r\n for ( int k = 0; k < n; k++ )\r\n vect[k] = k;\r\n // We will, however, start from Spokane, not Coulee City\r\n // --- IF the data file is the one for the inland Pacific NW\r\n if ( start >= 0 )\r\n { vect[start] = 0; vect[0] = start; }\r\n so_far = 0; // Distance traveled SO FAR\r\n // Consequently, we start the permutations at [1], NOT [0].\r\n tour(1, vect);\r\n }",
"public void generateNeighborhood(TSPSolution s){\r\n\t\tint [] rounte = new int[problem.city_num+1];\r\n\t\tfor(int i=0;i<problem.city_num;i++) rounte[i] = s.route[i];\r\n\t\trounte[problem.city_num] = rounte[0];\r\n\t\tint [] pos = new int[problem.city_num];\r\n\t\tproblem.calculatePosition(rounte, pos);\r\n\t\tint pos1 = 0;\r\n\t\tint pos2 = 0;\r\n\t\tfor(int k=0;k<problem.city_num;k++){\r\n\t\t\tint i = k;\r\n\t\t\tpos1 = i;\r\n\t\t\tint curIndex = rounte[i];\r\n\t\t\tint nextIndex = rounte[i+1];\r\n\t\t\tArrayList<Integer> candidate = problem.candidateList.get(curIndex);\r\n\t\t\tIterator<Integer> iter = candidate.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tint next = iter.next();\r\n\t\t\t\tpos2 = pos[next];\r\n\t\t\t\tint curIndex1 = rounte[pos2];\r\n\t\t\t\tint nextIndex1 = rounte[pos2+1];\r\n\t\t\t\tif(curIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex == curIndex1) continue;\r\n\t\t\t\tif(nextIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex1 == nextIndex) continue;\r\n\t\t\t\tint betterTimes = 0;\r\n\t\t\t\tTSPSolution solution = new TSPSolution(problem.city_num, problem.obj_num, -1);\r\n\t\t\t\tfor(int j=0;j<problem.obj_num;j++){\r\n\t\t\t\t\tint gain = problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+curIndex1] +\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+nextIndex*problem.city_num+nextIndex1] - \r\n\t\t\t\t\t\t\t(problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+nextIndex]+\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+curIndex1*problem.city_num+nextIndex1]);\r\n\t\t\t\t\tif(gain<0) betterTimes++;\r\n\t\t\t\t\tsolution.object_val[j] = s.object_val[j] + gain;\r\n\t\t\t\t}\r\n\t\t\t\tif(betterTimes==0) continue;\r\n\t\t\t\tsolution.route = s.route.clone();\r\n\r\n\t\t\t\tif(problem.kdSet.add(solution)){\r\n\t\t\t\t\tproblem.converse(pos1, pos2, solution.route, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private short maxTurns(){\n\t\tshort tempTurn = 0;\t// current max turn\n\t\tshort index = 0;\t\t// the index for current max turn\n\t\tshort turn;\t\t\t// current turn\n\t\tfor(short i=0; i<sizeTour; i++){\n\t\t\tturn = population[selected[i]].getTurn();\n\t\t\tif(tourOcc[i]==0){\n\t\t\t\tif(tempTurn<turn){\n\t\t\t\t\tindex = i;\n\t\t\t\t\ttempTurn = turn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttourOcc[index] = 1;\n\t\treturn index;\n\t}",
"public int findPosition(Solution indiv) {\r\n\r\n for (int i = 0; i < populationSize; i++) {\r\n if (indiv.equals(population.get(i)))\r\n return i;\r\n }\r\n\r\n return -1;\r\n }",
"int getStartCellIdx(Game game, Player player);",
"public int minIndex(){return pq[1];}",
"private static int heuristic(int[] unsortedPancakes) {\n int h = 0;\n for (int i = 0; i < unsortedPancakes.length - 1; i++) {\n if (Math.abs(unsortedPancakes[i] - unsortedPancakes[i + 1]) > 1) {\n h++;\n }\n }\n return h;\n }",
"int getParentMonsterIndex();",
"private TspTour getBestTour(int index)\r\n {\r\n return bestTours[index];\r\n }",
"private int smallestF(){\r\n int smallest = 100000;\r\n int smallestIndex = 0;\r\n int size = _openSet.size();\r\n for(int i=0;i<size;i++){\r\n int thisF = _map.get_grid(_openSet.get(i)).get_Fnum();\r\n if(thisF < smallest){\r\n smallest = thisF;\r\n smallestIndex = i;\r\n }\r\n }\r\n return smallestIndex;\r\n }",
"public int getNearestDestUp() {\n int auxPos = position;\n int foundPos = 21; //if returns 21, no destination up\n boolean found = false;\n while (auxPos < 21 && found == false) {\n if ((toRide[auxPos] == true) || (toStop[auxPos] == true)) {\n found = true;\n foundPos = auxPos;\n } else {\n auxPos++;\n }\n }\n return foundPos;\n }",
"private int getNextCity(int base, boolean[] used) {\n shortestdist = Long.MAX_VALUE;\n int result = -1;\n long temp;\n for (int i = 0; i < places.size(); i++) {\n if (used[i]) {\n continue;\n }\n temp = allDistances[base][i];\n if (temp < shortestdist) {\n shortestdist = temp;\n result = i;\n }\n }\n return result;\n }",
"public int getSideIndex(Tile adjacent){\r\n for(int i = 0; i < adjTiles.length; i++){\r\n if(adjTiles[i] == adjacent) return i;\r\n }\r\n return -1;\r\n }",
"public int shortestFastTrackLine() {\n\t\tint idx = 0;\n\t\tint temp;\n\t\tint min = Integer.MAX_VALUE;\n\t\tfor (int i = 0; i < tsaPreIndex; i++) {\n\t\t\ttemp = checkpoints.get(i).size();\n\t\t\tif (temp < min) {\n\t\t\t\tmin = temp;\n\t\t\t\tidx = i;\n\t\t\t}\n\t\t}\n\t\treturn idx;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the label for the data set which appears in the legend and tooltips. | @Override
public String getLabel() {
return getValue(Dataset.InternalProperty.LABEL, DEFAULT_LABEL);
} | [
"DatasetLabel getLabel();",
"String getTooltipLabel();",
"public String getLabel() {\r\n\r\n return data.getLabel();\r\n\r\n }",
"public String getLegendLabel( int index );",
"java.lang.String getLabelName();",
"java.lang.String getLabel();",
"public String getLegendLabels();",
"public String getLegendLabel(DataReference ds) {\r\n\t\tDataSetInfo dsi = getDataSetInfo(ds);\r\n\t\tif (dsi == null)\r\n\t\t\treturn null;\r\n\t\telse\r\n\t\t\treturn dsi.getLegendLabel();\r\n\t}",
"public String dataLabel() {\n return DATA_LABEL;\n }",
"public String getLabel() {\n return label == null ? StringUtils.EMPTY : label;\n }",
"public String label();",
"public Object getLabel() {\n if (this.label != null) {\n return this.label;\n }\n\n return this.getDefaultLabel();\n }",
"public String legend() {\n \n Attribute classAttribute = null;\n if (m_trainInstances == null) return \"\";\n try {classAttribute = m_trainInstances.classAttribute();} catch (Exception x){};\n if (m_numOfClasses == 1) {\n return (\"-ve = \" + classAttribute.value(0)\n\t + \", +ve = \" + classAttribute.value(1));\n } else {\n StringBuffer text = new StringBuffer();\n for (int i=0; i<m_numOfClasses; i++) {\n\tif (i>0) text.append(\", \");\n\ttext.append(classAttribute.value(i));\n }\n return text.toString();\n }\n }",
"public String getLabel()\n {\n return (String)getAttributeInternal(LABEL);\n }",
"public String getLabel() {\n return getElement().getChildren()\n .filter(child -> child.getTag().equals(\"label\")).findFirst()\n .get().getText();\n }",
"public String label() {\n\t\treturn \"LABEL_\" + (labelCount++);\n\t}",
"public String getLabel() {\n\t\treturn this.text.toString();\n\t}",
"java.lang.String getCategoryLabel();",
"@Override\n\tpublic String toString() {\n\t\treturn label;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR start "entryRuleBSQL2Java" InternalBSQL2Java.g:53:1: entryRuleBSQL2Java : ruleBSQL2Java EOF ; | public final void entryRuleBSQL2Java() throws RecognitionException {
try {
// InternalBSQL2Java.g:54:1: ( ruleBSQL2Java EOF )
// InternalBSQL2Java.g:55:1: ruleBSQL2Java EOF
{
before(grammarAccess.getBSQL2JavaRule());
pushFollow(FOLLOW_1);
ruleBSQL2Java();
state._fsp--;
after(grammarAccess.getBSQL2JavaRule());
match(input,EOF,FOLLOW_2);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return ;
} | [
"public final void ruleBSQL2Java() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBSQL2Java.g:66:2: ( ( ruleBSQLMachine ) )\n // InternalBSQL2Java.g:67:2: ( ruleBSQLMachine )\n {\n // InternalBSQL2Java.g:67:2: ( ruleBSQLMachine )\n // InternalBSQL2Java.g:68:3: ruleBSQLMachine\n {\n before(grammarAccess.getBSQL2JavaAccess().getBSQLMachineParserRuleCall()); \n pushFollow(FOLLOW_2);\n ruleBSQLMachine();\n\n state._fsp--;\n\n after(grammarAccess.getBSQL2JavaAccess().getBSQLMachineParserRuleCall()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"BSQL2Java2 createBSQL2Java2();",
"public final void entryRuleBSQLMachine() throws RecognitionException {\n try {\n // InternalBSQL2Java.g:79:1: ( ruleBSQLMachine EOF )\n // InternalBSQL2Java.g:80:1: ruleBSQLMachine EOF\n {\n before(grammarAccess.getBSQLMachineRule()); \n pushFollow(FOLLOW_1);\n ruleBSQLMachine();\n\n state._fsp--;\n\n after(grammarAccess.getBSQLMachineRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }",
"public final void entryRuleBPredicate() throws RecognitionException {\n try {\n // InternalBSQL2Java.g:279:1: ( ruleBPredicate EOF )\n // InternalBSQL2Java.g:280:1: ruleBPredicate EOF\n {\n before(grammarAccess.getBPredicateRule()); \n pushFollow(FOLLOW_1);\n ruleBPredicate();\n\n state._fsp--;\n\n after(grammarAccess.getBPredicateRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }",
"public final void entryRuleSQLCall() throws RecognitionException {\n try {\n // InternalBSQL2Java.g:304:1: ( ruleSQLCall EOF )\n // InternalBSQL2Java.g:305:1: ruleSQLCall EOF\n {\n before(grammarAccess.getSQLCallRule()); \n pushFollow(FOLLOW_1);\n ruleSQLCall();\n\n state._fsp--;\n\n after(grammarAccess.getSQLCallRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }",
"public final void entryRuleBType() throws RecognitionException {\n try {\n // InternalBSQL2Java.g:154:1: ( ruleBType EOF )\n // InternalBSQL2Java.g:155:1: ruleBType EOF\n {\n before(grammarAccess.getBTypeRule()); \n pushFollow(FOLLOW_1);\n ruleBType();\n\n state._fsp--;\n\n after(grammarAccess.getBTypeRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }",
"public final void entryRuleBTable() throws RecognitionException {\n try {\n // InternalBSQL2Java.g:104:1: ( ruleBTable EOF )\n // InternalBSQL2Java.g:105:1: ruleBTable EOF\n {\n before(grammarAccess.getBTableRule()); \n pushFollow(FOLLOW_1);\n ruleBTable();\n\n state._fsp--;\n\n after(grammarAccess.getBTableRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }",
"public final void entryRuleBSubstitution() throws RecognitionException {\n try {\n // InternalBSQL2Java.g:404:1: ( ruleBSubstitution EOF )\n // InternalBSQL2Java.g:405:1: ruleBSubstitution EOF\n {\n before(grammarAccess.getBSubstitutionRule()); \n pushFollow(FOLLOW_1);\n ruleBSubstitution();\n\n state._fsp--;\n\n after(grammarAccess.getBSubstitutionRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }",
"public final void entryRuleBValue() throws RecognitionException {\n try {\n // InternalBSQL2Java.g:179:1: ( ruleBValue EOF )\n // InternalBSQL2Java.g:180:1: ruleBValue EOF\n {\n before(grammarAccess.getBValueRule()); \n pushFollow(FOLLOW_1);\n ruleBValue();\n\n state._fsp--;\n\n after(grammarAccess.getBValueRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }",
"public final void entryRuleBSOperation() throws RecognitionException {\n try {\n // InternalBSQL2Java.g:204:1: ( ruleBSOperation EOF )\n // InternalBSQL2Java.g:205:1: ruleBSOperation EOF\n {\n before(grammarAccess.getBSOperationRule()); \n pushFollow(FOLLOW_1);\n ruleBSOperation();\n\n state._fsp--;\n\n after(grammarAccess.getBSOperationRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }",
"private void process(String sql, TinyDBOutput out) {\n String s = sql.toUpperCase();\n TinyDBParser parser = utils.createParser(s, out);\n ParseTree tree = parser.root();\n Visitor visitor = new Visitor(out, false);\n visitor.visit(tree);\n }",
"JavaStatement createJavaStatement();",
"public final void entryRuleBParameter() throws RecognitionException {\n try {\n // InternalBSQL2Java.g:379:1: ( ruleBParameter EOF )\n // InternalBSQL2Java.g:380:1: ruleBParameter EOF\n {\n before(grammarAccess.getBParameterRule()); \n pushFollow(FOLLOW_1);\n ruleBParameter();\n\n state._fsp--;\n\n after(grammarAccess.getBParameterRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }",
"public final void entryRuleJavaCode() throws RecognitionException {\n try {\n // InternalDsl.g:3480:1: ( ruleJavaCode EOF )\n // InternalDsl.g:3481:1: ruleJavaCode EOF\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getJavaCodeRule()); \n }\n pushFollow(FOLLOW_1);\n ruleJavaCode();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getJavaCodeRule()); \n }\n match(input,EOF,FOLLOW_2); if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }",
"public static void main(String[] args) throws Exception {\n\t\tConvertDB2ToOracle_v2 convert = getInstance();\n\t\tconvert.provide(\"D:\\\\others\\\\temp\\\\db2-extra-tables.txt\");\n\t\tconvert.extractSQL(\"D:\\\\others\\\\temp\\\\ddlfile.sql\");\n\t}",
"public final void entryRuleClass() throws RecognitionException {\n try {\n // ../emfviews.dsl.ui/src-gen/emfviews/dsl/ui/contentassist/antlr/internal/InternalSqlview.g:229:1: ( ruleClass EOF )\n // ../emfviews.dsl.ui/src-gen/emfviews/dsl/ui/contentassist/antlr/internal/InternalSqlview.g:230:1: ruleClass EOF\n {\n before(grammarAccess.getClassRule()); \n pushFollow(FOLLOW_ruleClass_in_entryRuleClass421);\n ruleClass();\n\n state._fsp--;\n\n after(grammarAccess.getClassRule()); \n match(input,EOF,FOLLOW_EOF_in_entryRuleClass428); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }",
"public final void entryRuleJavaApp() throws RecognitionException {\n try {\n // InternalMyDsl.g:729:1: ( ruleJavaApp EOF )\n // InternalMyDsl.g:730:1: ruleJavaApp EOF\n {\n before(grammarAccess.getJavaAppRule()); \n pushFollow(FOLLOW_1);\n ruleJavaApp();\n\n state._fsp--;\n\n after(grammarAccess.getJavaAppRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }",
"public static String javaToSqlName( String javaName )\n {\n StringBuffer sql;\n int i;\n char ch;\n boolean wasLower;\n\n // Get only the last part of the Java name (whether it's\n // class name with package, or field name with parent)\n if ( javaName.indexOf( '.' ) > 0 ) {\n javaName = javaName.substring( javaName.lastIndexOf( '.' ) + 1 );\n }\n\n sql = new StringBuffer( javaName.length() );\n wasLower = false;\n for ( i = 0 ; i < javaName.length() ; ++i ) {\n ch = javaName.charAt( i );\n // Our potential break point is an upper case letter\n // signalling the next word (thus must not be the first)\n if ( i > 0 && Character.isUpperCase( ch ) ) {\n // New word: previous letter was lower case\n if ( wasLower )\n sql.append( SQLWordSeparator );\n else\n // New word: next letter is lower case\n if ( i < javaName.length() - 1 &&\n Character.isLowerCase( javaName.charAt( i + 1 ) ) )\n sql.append( SQLWordSeparator );\n }\n wasLower = Character.isLowerCase( ch );\n sql.append( Character.toLowerCase( ch ) );\n }\n return sql.toString();\n }",
"@Test\n public void generateSQLCode() throws Exception {\n System.out.println(\"generateSQLCode\");\n\n File sourceFile = null;\n File targetJavaSourceFile = null;\n String packagename = \"\";\n String classname = \"\";\n String baseclass = \"\";\n SQLCodeGenerator instance = new SQLCodeGenerator();\n\n instance.generateSQLCode(new File(srcPath+\"SQLCode.sqlg\"), new File(outPath+\"SQLCode.java.txt\"), \"org.tamuno.sqlgen.test.results\", \"SQLCode\", null, false);\n //assertTrue(TamunoUtils.loadTextFile(new File(outPath+\"SQLCode.java.txt\"))!=null);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a 64bit long, and change the internal state. Note that all longs can be generated. | public long nextLong( )
{
return ( (long) ( next( 32 ) ) << 32 ) + next( 32 );
} | [
"private long toLong() {\n assert (intLen <= 2) : \"this MutableBigInteger exceeds the range of long\";\n if (intLen == 0)\n return 0;\n long d = value[offset] & LONG_MASK;\n return (intLen == 2) ? d << 32 | (value[offset + 1] & LONG_MASK) : d;\n }",
"public long longValue()\n {\n return this.unsignedValue & JavaConsts.INT_LMASK;\n }",
"private long to64bitStoreAddress(NodeReference node_ref) {\n long ref64bit = node_ref.getLowLong();\n return ref64bit;\n }",
"long getInt64Value();",
"public long nextLong() {\r\n\t\treturn rand.nextLong();\r\n\t}",
"long getTestInt64();",
"long longValue();",
"public long longValue() {\n\t\treturn (long) re;\n\t}",
"public static long readlong()\n\t{\n\t\treturn sc.nextLong();\n\t}",
"long getLongValue();",
"public long longValue();",
"long nextLong();",
"long getLongNext();",
"public static long randomLong() {\n return randomLong(Long.MIN_VALUE, Long.MAX_VALUE);\n }",
"long readInt64();",
"public long evaluateAsLong();",
"@Override\n public long readLong() {\n long l = Bits.getLong(positionAddr);\n\n addPosition(8);\n return l;\n }",
"@SuppressWarnings(\"unused\")\n public static long randomLong()\n {\n return secureRandom.nextLong();\n }",
"public long longValue(){\r\n\treturn toBigInteger().longValue();\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a. Open Url based on 'DbDomain' parameter value in 'config.properties' file Possible values of DbDomain: jenkins, qa, automation, production b. Initiate IronWasp session if driverName=firefoxIronWasp in 'config.properties' | public static void openURLBasedOnDbDomain() throws Exception
{
String DbDomain = FilesAndFolders.getPropValue("DbDomain");
String url;
int flag;
deleteCookies();
//IronWasp Connection logic for Security Testing
String browser = FilesAndFolders.getPropValue("driverName");
if (browser.contentEquals("firefoxIronWasp"))
{
IronWasp.workflowStart();
// try
// {
// IronWasp.workflowStart();
// }
// catch(ConnectException e)
// {
// Reporter.log("IronWasp Server has not been started...Ignore this error if you don't wish to track your test flow traffic & requests for IronWasp...",true);
// }
}
switch(DbDomain)
{
case "jenkins":
url = FilesAndFolders.getPropValue("urlJenkinsServer");
System.out.println("url: " + url);
driver.get(url);
System.out.println("URL loaded successfully:" + url);
flag=1;
break;
case "qa":
url = FilesAndFolders.getPropValue("urlQaServer");
System.out.println("url: " + url);
driver.get(url);
System.out.println("URL loaded successfully:" + url);
flag=1;
break;
case "automation":
url = FilesAndFolders.getPropValue("urlAutomationServer");
System.out.println("url: " + url);
driver.get(url);
System.out.println("URL loaded successfully:" + url);
flag=1;
break;
case "production":
url = FilesAndFolders.getPropValue("urlProductionServer");
System.out.println("url: " + url);
driver.get(url);
System.out.println("URL loaded successfully:" + url);
flag=1;
break;
default:
flag=0;
Assert.assertTrue(flag==1, "URL from config file is a mismatch with available switch cases...");
break;
}
//handling ssl certification
try{
driver.navigate().to("javascript:document.getElementById('overridelink').click()");
}
catch(Exception e){}
windowMax();
WebCommonMethods.implicitSleep();
} | [
"public static void loadDatabaseInfoFromFile(String configFilePath) throws Exception {\n //No need to check RemotingRole; no call to db.\n if (!File.Exists(configFilePath))\n {\n throw new Exception(\"Could not find \" + configFilePath + \" on the web server.\");\n }\n \n XmlDocument doc = new XmlDocument();\n try\n {\n doc.Load(configFilePath);\n }\n catch (Exception __dummyCatchVar0)\n {\n throw new Exception(\"Web server \" + configFilePath + \" could not be opened or is in an invalid format.\");\n }\n\n XPathNavigator Navigator = doc.CreateNavigator();\n //always picks the first database entry in the file:\n XPathNavigator navConn = Navigator.SelectSingleNode(\"//DatabaseConnection\");\n //[Database='\"+database+\"']\");\n if (navConn == null)\n {\n throw new Exception(configFilePath + \" does not contain a valid database entry.\");\n }\n \n //database+\" is not an allowed database.\");\n String connString = \"\", server = \"\", database = \"\", mysqlUser = \"\", mysqlPassword = \"\", mysqlUserLow = \"\", mysqlPasswordLow = \"\";\n XPathNavigator navConString = navConn.SelectSingleNode(\"ConnectionString\");\n if (navConString != null)\n {\n //If there is a connection string then use it.\n connString = navConString.Value;\n }\n else\n {\n //return navOne.SelectSingleNode(\"summary\").Value;\n //now, get the values for this connection\n server = navConn.SelectSingleNode(\"ComputerName\").Value;\n database = navConn.SelectSingleNode(\"Database\").Value;\n mysqlUser = navConn.SelectSingleNode(\"User\").Value;\n mysqlPassword = navConn.SelectSingleNode(\"Password\").Value;\n mysqlUserLow = navConn.SelectSingleNode(\"UserLow\").Value;\n mysqlPasswordLow = navConn.SelectSingleNode(\"PasswordLow\").Value;\n } \n XPathNavigator dbTypeNav = navConn.SelectSingleNode(\"DatabaseType\");\n OpenDentBusiness.DatabaseType dbtype = OpenDentBusiness.DatabaseType.MySql;\n if (dbTypeNav != null)\n {\n if (StringSupport.equals(dbTypeNav.Value, \"Oracle\"))\n {\n dbtype = OpenDentBusiness.DatabaseType.Oracle;\n }\n \n }\n \n OpenDentBusiness.DataConnection dcon = new OpenDentBusiness.DataConnection();\n if (!StringSupport.equals(connString, \"\"))\n {\n try\n {\n dcon.setDb(connString,\"\",dbtype);\n }\n catch (Exception e)\n {\n throw new Exception(e.Message + \"\\r\\n\" + \"Connection to database failed. Check the values in the config file on the web server \" + configFilePath);\n }\n \n }\n else\n {\n try\n {\n dcon.setDb(server,database,mysqlUser,mysqlPassword,mysqlUserLow,mysqlPasswordLow,dbtype);\n }\n catch (Exception e)\n {\n throw new Exception(e.Message + \"\\r\\n\" + \"Connection to database failed. Check the values in the config file on the web server \" + configFilePath);\n }\n \n } \n }",
"public static void openBrowser()\n\t{\n\t\tdriver = DriverSetup.getWebDriver(ReadPropertiesFile.getBrowser());\n\t\tdriver.get(ReadPropertiesFile.getURL());\n\t\tlog.info(\"Opening Browser\");\n\t\tlog.info(\"Practo website is launched \");\n\t}",
"private void setLocalWebdriver() {\n\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setJavascriptEnabled(true);\n capabilities.setCapability(\"handlesAlerts\", true);\n switch (getBrowserId(browser)) {\n case 0:\n capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,\n Boolean.valueOf(System.getProperty(\"IGNORE_SECURITY_DOMAINS\", \"false\")));\n driver.set(new InternetExplorerDriver(capabilities));\n break;\n case 1:\n driver.set(new FirefoxDriver(capabilities));\n break;\n case 2:\n driver.set(new SafariDriver(capabilities));\n break;\n case 3:\n driver.set(new ChromeDriver(capabilities));\n break;\n default:\n throw new WebDriverException(\"Browser not found: \" + browser);\n }\n }",
"public WebDriver getDriver(String driver){\n\n\t\ttry{\n\t\t\tif(driver.equalsIgnoreCase(\"Firefox\")){\n\t\t\t\tString geckoDriver=Settings.getInstance().getDriverEXEDir()+\"geckodriver.exe\";\n\t\t\t\tSystem.setProperty(\"webdriver.gecko.driver\", geckoDriver);\n\t\t\t\twDriver = new FirefoxDriver();\n\t\t\t\twDriver.manage().window().maximize();\n\t\t\t\treturn wDriver;\n\t\t\t}\n\n\t\t\telse if(driver.equalsIgnoreCase(\"Chrome\")) {\n\t\t\t\t//ChromeOptions option = new ChromeOptions();\n\t\t\t\t//option.addArguments(\"--dns-prefetch-disable\");\n\t\t\t\t//option.addArguments(\"--start-maximized\");\n\t\t\t\t DesiredCapabilities capabilities = DesiredCapabilities.chrome();\n\t\t\t\t //capabilities.setCapability(CapabilityType.BROWSER_NAME, BrowserType.CHROME);\n\t\t\t\t capabilities.setCapability(CapabilityType.PLATFORM, Platform.ANY);\n\t\t\t\tString chromeDriver=Settings.getInstance().getDriverEXEDir()+\"chromedriver\";\n\t\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", chromeDriver);\n\t\t\t\twDriver = new ChromeDriver(capabilities);\n\t\t\t\treturn wDriver;\n\t\t\t}\n\n\t\t\telse if(driver.equalsIgnoreCase(\"rChrome\")) {\n\t\t\t\tChromeOptions options = new ChromeOptions();\n\t\t\t\tDesiredCapabilities dc = DesiredCapabilities.chrome();\n\t\t\t\tdc.setCapability(ChromeOptions.CAPABILITY, options);\n\t\t\t\twDriver = new RemoteWebDriver(dc);\n\t\t\t\treturn wDriver;\n\t\t\t}\n\t\t\t\n\t\t\telse if(driver.equalsIgnoreCase(\"rFirefox\")) {\n\t\t\t\tFirefoxProfile fp = new FirefoxProfile();\n\t\t\t\tDesiredCapabilities dc = DesiredCapabilities.firefox();\n\t\t\t\tdc.setCapability(FirefoxDriver.PROFILE, fp);\n\t\t\t\twDriver = new RemoteWebDriver(dc);\n\t\t\t}\n\t\t\t\n\t\t\telse if(driver.equalsIgnoreCase(\"IE\")) {\n\t\t\t\tDesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();\n\t\t\t\tcapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);\n\t\t\t\t//capabilities.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);\n\t\t\t\tcapabilities.setCapability(\"ignoreZoomSetting\", true);\n\t\t\t\tcapabilities.setCapability(\"ignoreProtectedModeSettings\", true);\n\t\t\t\tcapabilities.setCapability(\"requireWindowFocus\", true);\n\t\t\t\tString ieDriver=Settings.getInstance().getDriverEXEDir()+\"IEDriverServer.exe\";\n\t\t\t\tSystem.setProperty(\"webdriver.ie.driver\", ieDriver);\n\t\t\t\twDriver = new InternetExplorerDriver(capabilities);\t\n\t\t\t\twDriver.manage().window().maximize();\n\t\t\t\treturn wDriver;\n\t\t\t}\n\n\t\t\telse if(driver.equalsIgnoreCase(\"Custom\")) {\n\n\t\t\t\tMap<String, Object> chromePrefs = new HashMap<String, Object>();\n\t\t\t\tChromeOptions options = new ChromeOptions();\n\t\t\t chromePrefs.put(\"download.default_directory\", Settings.getInstance().getDownloadFolder());\n\t\t\t\toptions.addArguments(\"--start-maximized\");\n\t\t\t\tString chromeDriver=Settings.getInstance().getDriverEXEDir()+\"chromedriver.exe\";\n\t\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", chromeDriver);\n\t\t\t\twDriver = new ChromeDriver(options);\n\t\t\t\treturn wDriver;\n\n\t\t\t}\n\n\t\t\telse if(driver.equalsIgnoreCase(\"mChrome\")) {\n\t\t\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\n\t\t\t\t\n\t\t\t\tcapabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"UiAutomator2\");\t\n\t\t\t\tcapabilities.setCapability(MobileCapabilityType.PLATFORM, \"Android\");\n\t\t\t\t//capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, \"4.4\");\n\t\t\t\t//capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"Android Emulator\");\n\t\t\t\tcapabilities.setCapability(MobileCapabilityType.BROWSER_NAME, \"Chrome\");\n\t\t\t}\n\n\t\t\telse if(driver.equalsIgnoreCase(\"Safari\")) {\n\t\t\t\t//Yet to implement\n\t\t\t}\n\n\t\t\telse if(driver.equalsIgnoreCase(\"HtmlUnitDriver\")) {\n\t\t\t\twDriver = new HtmlUnitDriver(BrowserVersion.BEST_SUPPORTED);\n\t\t\t\t((HtmlUnitDriver) wDriver).setJavascriptEnabled(true);\n\t\t\t\treturn wDriver;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tString geckoDriver1=Settings.getInstance().getDriverEXEDir()+\"geckodriver.exe\";\n\t\t\t\tSystem.setProperty(\"webdriver.gecko.driver\", geckoDriver1);\n\t\t\t\twDriver = new FirefoxDriver();\n\t\t\t\treturn wDriver;\n\t\t\t}\n\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\twDriver = new FirefoxDriver();\n\t\t\treturn wDriver;\n\t\t}\n\t\treturn wDriver;\n\t}",
"private void initializeDriver() {\n WebDriver driver = null;\n String dt = System.getProperty(\"driverType\") != null ? System.getProperty(\"driverType\") : testParams.get(\"driverType\");\n\n if (dt.equals(\"\") || dt.equals(\"local\")) {\n driver = DriverFactory.createLocalInstance(testParams.get(\"browser\"), testParams.get(\"device\"));\n }\n else if (dt.equals(\"remote\")) {\n URL server = getRemoteServerURL();\n driver = DriverFactory.createRemoteInstance(testParams.get(\"browser\"),testParams.get(\"device\"),server);\n }\n else if (dt.equals(\"gridlastic\")) {\n driver = DriverFactory.createGridlasticInstance(testParams.get(\"browser\"), testParams.get(\"video\"));\n }\n\n DriverManager.setWebDriver(driver);\n\n // Augment the remote driver so we can take screen shots\n if (dt.equals(\"remote\")) {\n wd.set(new Augmenter().augment(DriverManager.getDriver()));\n } else {\n wd.set(DriverManager.getDriver());\n }\n\n }",
"private void createNewDriverInstance() {\n String browser = props.getProperty(\"browser\");\n if (browser.equals(\"firefox\")) {\n FirefoxProfile profile = new FirefoxProfile();\n profile.setPreference(\"intl.accept_languages\", language);\n driver = new FirefoxDriver();\n } else if (browser.equals(\"chrome\")) {\n ChromeOptions options = new ChromeOptions();\n options.setBinary(new File(chromeBinary));\n options.addArguments(\"--lang=\" + language);\n driver = new ChromeDriver(options);\n } else {\n System.out.println(\"can't read browser type\");\n }\n }",
"private void initDriver(){\r\n String browserToBeUsed = (String) jsonConfig.get(\"browserToBeUsed\");\r\n switch (browserToBeUsed) {\r\n case \"FF\":\r\n System.setProperty(\"webdriver.gecko.driver\", (String) jsonConfig.get(\"fireFoxDriverPath\"));\r\n FirefoxProfile ffProfile = new FirefoxProfile();\r\n // ffProfile.setPreference(\"javascript.enabled\", false);\r\n ffProfile.setPreference(\"intl.accept_languages\", \"en-GB\");\r\n\r\n FirefoxOptions ffOptions = new FirefoxOptions();\r\n ffOptions.setProfile(ffProfile);\r\n driver = new FirefoxDriver(ffOptions);\r\n break;\r\n case \"CH\":\r\n String driverPath = (String) jsonConfig.get(\"chromeDriverPath\");\r\n System.setProperty(\"webdriver.chrome.driver\", driverPath);\r\n\r\n Map<String, Object> prefs = new HashMap<String, Object>();\r\n prefs.put(\"profile.default_content_setting_values.notifications\", 2);\r\n\r\n ChromeOptions options = new ChromeOptions();\r\n options.setExperimentalOption(\"prefs\", prefs);\r\n options.addArguments(\"--lang=en-GB\");\r\n driver = new ChromeDriver(options);\r\n break;\r\n case \"IE\":\r\n System.setProperty(\"webdriver.ie.driver\", (String) jsonConfig.get(\"ieDriverPath\"));\r\n\r\n InternetExplorerOptions ieOptions = new InternetExplorerOptions();\r\n ieOptions.disableNativeEvents();\r\n ieOptions.requireWindowFocus();\r\n ieOptions.introduceFlakinessByIgnoringSecurityDomains();\r\n driver = new InternetExplorerDriver(ieOptions);\r\n }\r\n\r\n driver.manage().window().maximize();\r\n }",
"@Test\n\tpublic void launchSite()\t{\n\t\t\n\t\tSystem.setProperty(EdgeDriverService.EDGE_DRIVER_EXE_PROPERTY, \"D:\\\\Selenium Drivers\\\\MicrosoftWebDriver.exe\");\n\t\tEdgeDriver driver = new EdgeDriver();\n\t\tdriver.get(\"http://google.com\");\n\t\t\n\t}",
"public static WebDriver getDriver(){\n if(driverPool.get()==null) {\n synchronized ((Driver.class)) {\n\n\n\n\n /*\n we read our browser type from configuration file using .getProperty method we\n creating in configuration Reader class.\n */\n String browserType = ConfigurationReader.getProperty(\"browser\");\n\n /*\n Depending on the browser type our switch statement will determine\n to open specific type of browser/driver\n */\n\n // we use this not testBase we use this test base just for practice\n switch (browserType) {\n\n case \"chrome\":\n WebDriverManager.chromedriver().setup();\n driverPool.set(new ChromeDriver());\n driverPool.get().manage().window().maximize();\n driverPool.get().manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\n break;\n\n case \"firefox\":\n WebDriverManager.firefoxdriver().setup();\n driverPool.set(new FirefoxDriver());\n driverPool.get().manage().window().maximize();\n driverPool.get().manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\n break;\n\n }\n }\n\n }\n /*\n Same driver instance will be return every time we call Driver.getDriver(); method\n */\n return driverPool.get();\n }",
"@Test \n public void executeSessionTwo(){\n System.out.println(\"open the browser: FIREFOX \");\n final String GECKO_DRIVER_DIRECTORY = System.getProperty(\"user.dir\") + \"/src/test/java/BrowserDrivers/geckodriver.exe\";\n System.setProperty(\"webdriver.gecko.driver\", GECKO_DRIVER_DIRECTORY);\n final WebDriver driver = new FirefoxDriver();\n //Goto guru99 site\n driver.get(\"http://demo.guru99.com/V4/\");\n //find user name text box and fill it\n driver.quit();\n }",
"@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\",testName=\"Test1_1_1\",description=\" Open /configuration.aspx page instead of /login.aspx\")\r\n\tpublic void Test1_1_1(HashMap<String,String> dataValues,String currentDriver,ITestContext context) throws Exception {\r\n\r\n\t\tdriver = WebDriverUtils.getDriver();\r\n\t\t\r\n\r\n\t\ttry {\r\n\r\n\t\t\t//Step-1: Launch configuration page with URL '/Configuration.aspx'\r\n\t\t\tdriver.get(configSite);\r\n\t\t\tLog.message(\"1. Launched configuration page with URL '/Configuration.aspx'.\", driver);\r\n\r\n\t\t\tif (driver.getCurrentUrl().toUpperCase().trim().contains(\"/LOGIN.ASPX?\"))\r\n\t\t\t\tLog.pass(\"Test Passed. Launching Configuration.aspx page launched login page.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Failed. Launching Configuration.aspx page does not launched login page..\", driver);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tdriver.quit();\r\n\t\t} //End finally\r\n\r\n\t}",
"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 }",
"@Test \n public void executSessionOne(){\n\t System.out.println(\"open the browser: chrome\");\n final String CHROME_DRIVER_DIRECTORY = System.getProperty(\"user.dir\") + \"/src/test/java/BrowserDrivers/chromedriver.exe\";\n System.setProperty(\"webdriver.chrome.driver\", CHROME_DRIVER_DIRECTORY);\n final WebDriver driver = new ChromeDriver();\n //Goto guru99 site\n driver.get(\"http://demo.guru99.com/V4/\");\n //find user name text box and fill it\n driver.quit();\n }",
"private void setWebDriver() {\n if (Boolean.valueOf(System.getProperty(\"LOCAL_DRIVER\"))) {\n setLocalWebdriver();\n } else if (Boolean.valueOf(System.getProperty(\"REMOTE_DRIVER\"))) {\n setRemoteWebdriver();\n } else if (Boolean.valueOf(System.getProperty(\"SAUCE_DRIVER\"))) {\n setSauceWebdriver();\n } else {\n throw new WebDriverException(\"Type of driver not specified!!!\");\n }\n this.driver.get().manage().timeouts()\n .implicitlyWait(10, TimeUnit.SECONDS);\n if (browser.equalsIgnoreCase(\"internet explorer\")|browser.equalsIgnoreCase(\"firefox\")|browser.equalsIgnoreCase(\"chrome\")|browser.equalsIgnoreCase(\"safari\")) {\n\t\t\t//we only want to maximise the browser window for desktop browser, not devices.\n \tthis.driver.get().manage().window().maximize();\n\t\t}\n }",
"@Given(\"I want to use {string} web driver\")\n public void iWantToUseDriver(String driverType) throws MalformedURLException {\n\n DriverManagerType driverManagerType = DriverManagerType.valueOf(driverType.toUpperCase());\n\n String seleniumRemoteUrl = System.getProperty(\"SELENIUM_REMOTE_URL\");\n\n System.out.println(\"------------------------------------\");\n System.out.println(\"USING SELENIUM GRID IS SET TO \" + seleniumRemoteUrl);\n System.out.println(\"------------------------------------\");\n\n if(seleniumRemoteUrl != null){\n\n URL hubUrl = new URL(seleniumRemoteUrl);\n DesiredCapabilities capabilities = new DesiredCapabilities();\n RemoteWebDriver webDriver;\n\n switch (driverManagerType){\n\n case CHROME:\n capabilities.setCapability(CapabilityType.BROWSER_NAME, BrowserType.CHROME);\n webDriver = new RemoteWebDriver(hubUrl, capabilities);\n ScenarioContext.getInstance().setWebDriver(webDriver);\n break;\n\n case FIREFOX:\n capabilities.setCapability(CapabilityType.BROWSER_NAME, BrowserType.FIREFOX);\n webDriver = new RemoteWebDriver(hubUrl, capabilities);\n ScenarioContext.getInstance().setWebDriver(webDriver);\n break;\n\n default:\n throw new UnsupportedOperationException(\"Driver type \" + driverManagerType + \" is not supported !\");\n }\n\n return;\n }\n\n String usingGrid = System.getProperty(\"usingZaleniumGrid\");\n\n System.out.println(\"------------------------------------\");\n System.out.println(\"USING ZALENIUM GRID IS SET TO \" + usingGrid);\n System.out.println(\"------------------------------------\");\n\n if(Boolean.parseBoolean(usingGrid)){\n\n URL hubUrl = new URL(\"http://localhost:4444/wd/hub\");\n DesiredCapabilities capabilities = new DesiredCapabilities();\n RemoteWebDriver webDriver;\n\n switch (driverManagerType){\n\n case CHROME:\n capabilities.setCapability(CapabilityType.BROWSER_NAME, BrowserType.CHROME);\n webDriver = new RemoteWebDriver(hubUrl, capabilities);\n ScenarioContext.getInstance().setWebDriver(webDriver);\n break;\n\n case FIREFOX:\n capabilities.setCapability(CapabilityType.BROWSER_NAME, BrowserType.FIREFOX);\n webDriver = new RemoteWebDriver(hubUrl, capabilities);\n ScenarioContext.getInstance().setWebDriver(webDriver);\n break;\n\n default:\n throw new UnsupportedOperationException(\"Driver type \" + driverManagerType + \" is not supported !\");\n }\n\n return;\n }\n\n switch (driverManagerType){\n\n case CHROME:\n WebDriverManager.chromedriver().setup();\n ChromeOptions options = new ChromeOptions();\n options.addArguments(\"--no-sandbox\");\n ScenarioContext.getInstance().setWebDriver(new ChromeDriver(options));\n break;\n\n case FIREFOX:\n WebDriverManager.firefoxdriver().setup();\n ScenarioContext.getInstance().setWebDriver(new FirefoxDriver());\n break;\n\n case OPERA:\n WebDriverManager.operadriver().setup();\n ScenarioContext.getInstance().setWebDriver(new OperaDriver());\n break;\n\n case EDGE:\n WebDriverManager.edgedriver().setup();\n ScenarioContext.getInstance().setWebDriver(new EdgeDriver());\n break;\n\n case IEXPLORER:\n WebDriverManager.iedriver().setup();\n ScenarioContext.getInstance().setWebDriver(new InternetExplorerDriver());\n break;\n\n default:\n throw new UnsupportedOperationException(\"Driver type \" + driverManagerType + \" is not supported !\");\n }\n }",
"public void openBrowser(String bType) {\n\t\tif (!FBConstants.GRID_RUN) {\n\n\t\t\tif (bType.equalsIgnoreCase(\"Mozila\")) {\n\n\t\t\t\t// System.setProperty(\"webdriver.gecko.driver\",\n\t\t\t\t// pro.getProperty(\"geckodriver_exe\"));\n\t\t\t\tSystem.setProperty(\"webdriver.gecko.driver\", FBConstants.GECKO_DRIVER_EXE);\n\n\t\t\t\tSystem.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE, FBConstants.BROWSER_LOGFILE);\n\t\t\t\t// Turn off notification\n\t\t\t\tFirefoxProfile foxProfile = new FirefoxProfile();\n\t\t\t\tfoxProfile.setPreference(\"dom.webnotifications.enabled\", false);\n\n\t\t\t\tdriver = new FirefoxDriver();\n\n\t\t\t} else if (bType.equalsIgnoreCase(\"Chrome\")) {\n\t\t\t\t// System.setProperty(\"webdriver.chrome.driver\",\n\t\t\t\t// pro.getProperty(\"chromedriver_exe\"));\n\t\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", FBConstants.CHROME_DRIVER_EXE);\n\n\t\t\t\tChromeOptions ops = new ChromeOptions();\n\t\t\t\tops.addArguments(\"--disable-notifications\");\n\t\t\t\tops.addArguments(\"disable-infobars\");\n\t\t\t\tops.addArguments(\"--start-maximized\");\n\t\t\t\tSystem.setProperty(ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY,\n\t\t\t\t\t\tFBConstants.CHROME_DRIVER_LOG_PROPERTY);\n\t\t\t\tSystem.setProperty(ChromeDriverService.CHROME_DRIVER_SILENT_OUTPUT_PROPERTY, \"true\");\n\t\t\t\tdriver = new ChromeDriver(ops);\n\t\t\t} else if (bType.equalsIgnoreCase(\"IE\")) {\n\n\t\t\t} else if (bType.equalsIgnoreCase(\"Edge\")) {\n\n\t\t\t}\n\t\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\t\t\tdriver.manage().window().maximize();\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS);\n\t\t\t// test.log(LogStatus.INFO, bType + \" browser opened successfully\");\n\t\t} else {\n\t\t\tDesiredCapabilities cap = null;\n\n\t\t\tif (bType.equalsIgnoreCase(\"Mozilla\")) {\n\t\t\t\tcap = DesiredCapabilities.firefox();\n\t\t\t\tcap.setPlatform(Platform.WINDOWS);\n\t\t\t\tString hubUrl = \"http://172.29.4.52:8090/wd/hub\";\n\t\t\t\ttry {\n\t\t\t\t\tdriver = new RemoteWebDriver(new URL(hubUrl), cap);\n\t\t\t\t\tdriver.manage().window().maximize();\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\n\t\t\t\t} catch (MalformedURLException e) {\n\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t} else if (bType.equalsIgnoreCase(\"chrome\")) {\n\n\t\t\t\t// 1. Define desire capability\n\t\t\t\t// In Grid we have to use 'ChromeOptions' and we have to merge\n\t\t\t\t// with DesiredCapabilities and we have to pass 'options' to RemoteWebDriver\n\t\t\t\t// options.merge(cap);\n\t\t\t\tcap = new DesiredCapabilities();\n\t\t\t\tcap.setBrowserName(\"chrome\");\n\t\t\t\tcap.setPlatform(Platform.WINDOWS);\n\n\t\t\t\tChromeOptions options = new ChromeOptions();\n\t\t\t\toptions.addArguments(\"--disable-notifications\");\n\t\t\t\toptions.addArguments(\"disable-infobars\");\n\t\t\t\toptions.addArguments(\"--start-maximized\");\n\t\t\t\toptions.merge(cap);\n\t\t\t\tString hubUrl = \"http://172.29.4.52:8090/wd/hub\";\n\t\t\t\ttry {\n\t\t\t\t\tdriver = new RemoteWebDriver(new URL(hubUrl), options);\n\t\t\t\t\tdriver.get(\"http://www.freecrm.com\");\n\t\t\t\t\tSystem.out.println(driver.getTitle());\n\t\t\t\t} catch (MalformedURLException e) {\n\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t}",
"public void launchBrowser() {\r\n\t\t\r\n\t\tdriver = new FirefoxDriver();\r\n\t}",
"@BeforeTest\r\n public void openUrl() {\r\n\r\n System.setProperty(\"webdriver.chrome.driver\", PATH_TO_WEBDRIVER);\r\n\r\n\r\n driver = new ChromeDriver();\r\n\r\n\r\n driver.navigate().to(\"http://automationpractice.com/index.php\");\r\n\r\n\r\n }",
"public WebDriver login() {\r\n System.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\sa841\\\\Documents\\\\chromedriver_win32\\\\chromedriver.exe\");\r\n //System.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\sa841\\\\Documents\\\\chromedriver_win32\\\\phantomjs.exe\");\r\n String URL = \"http://Admin:admin@192.168.1.63:8080/phenotips123/bin/loginsubmit/XWiki/XWikiLogin/\";\r\n ChromeOptions options = new ChromeOptions();\r\n options.addArguments(\"window-size=1024,768\");\r\n DesiredCapabilities capabilities = DesiredCapabilities.chrome();\r\n capabilities.setCapability(ChromeOptions.CAPABILITY, options);\r\n WebDriver driver = new ChromeDriver(capabilities);\r\n driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r\n //WebDriver driver = new PhantomJS();\r\n driver.get(URL);\r\n driver.findElement(By.id(\"j_username\")).sendKeys(\"Admin\");\r\n driver.findElement(By.id(\"j_password\")).sendKeys(\"admin\");\r\n driver.findElement(By.className(\"button\")).click();\r\n return driver;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "rule__Version__MinorAssignment_2" $ANTLR start "rule__Version__PatchAssignment_3_1" InternalCommunicationObject.g:3824:1: rule__Version__PatchAssignment_3_1 : ( RULE_INT ) ; | public final void rule__Version__PatchAssignment_3_1() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalCommunicationObject.g:3828:1: ( ( RULE_INT ) )
// InternalCommunicationObject.g:3829:2: ( RULE_INT )
{
// InternalCommunicationObject.g:3829:2: ( RULE_INT )
// InternalCommunicationObject.g:3830:3: RULE_INT
{
before(grammarAccess.getVersionAccess().getPatchINTTerminalRuleCall_3_1_0());
match(input,RULE_INT,FOLLOW_2);
after(grammarAccess.getVersionAccess().getPatchINTTerminalRuleCall_3_1_0());
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
restoreStackSize(stackSize);
}
return ;
} | [
"public final void rule__Version__Group_3__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCommunicationObject.g:1711:1: ( ( ( rule__Version__PatchAssignment_3_1 ) ) )\n // InternalCommunicationObject.g:1712:1: ( ( rule__Version__PatchAssignment_3_1 ) )\n {\n // InternalCommunicationObject.g:1712:1: ( ( rule__Version__PatchAssignment_3_1 ) )\n // InternalCommunicationObject.g:1713:2: ( rule__Version__PatchAssignment_3_1 )\n {\n before(grammarAccess.getVersionAccess().getPatchAssignment_3_1()); \n // InternalCommunicationObject.g:1714:2: ( rule__Version__PatchAssignment_3_1 )\n // InternalCommunicationObject.g:1714:3: rule__Version__PatchAssignment_3_1\n {\n pushFollow(FOLLOW_2);\n rule__Version__PatchAssignment_3_1();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getVersionAccess().getPatchAssignment_3_1()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Version__MinorAssignment_2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCommunicationObject.g:3813:1: ( ( RULE_INT ) )\n // InternalCommunicationObject.g:3814:2: ( RULE_INT )\n {\n // InternalCommunicationObject.g:3814:2: ( RULE_INT )\n // InternalCommunicationObject.g:3815:3: RULE_INT\n {\n before(grammarAccess.getVersionAccess().getMinorINTTerminalRuleCall_2_0()); \n match(input,RULE_INT,FOLLOW_2); \n after(grammarAccess.getVersionAccess().getMinorINTTerminalRuleCall_2_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Version__Group__2__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCommunicationObject.g:1631:1: ( ( ( rule__Version__MinorAssignment_2 ) ) )\n // InternalCommunicationObject.g:1632:1: ( ( rule__Version__MinorAssignment_2 ) )\n {\n // InternalCommunicationObject.g:1632:1: ( ( rule__Version__MinorAssignment_2 ) )\n // InternalCommunicationObject.g:1633:2: ( rule__Version__MinorAssignment_2 )\n {\n before(grammarAccess.getVersionAccess().getMinorAssignment_2()); \n // InternalCommunicationObject.g:1634:2: ( rule__Version__MinorAssignment_2 )\n // InternalCommunicationObject.g:1634:3: rule__Version__MinorAssignment_2\n {\n pushFollow(FOLLOW_2);\n rule__Version__MinorAssignment_2();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getVersionAccess().getMinorAssignment_2()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__CommObjectsRepository__VersionAssignment_3_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCommunicationObject.g:3753:1: ( ( ruleVersion ) )\n // InternalCommunicationObject.g:3754:2: ( ruleVersion )\n {\n // InternalCommunicationObject.g:3754:2: ( ruleVersion )\n // InternalCommunicationObject.g:3755:3: ruleVersion\n {\n before(grammarAccess.getCommObjectsRepositoryAccess().getVersionVersionParserRuleCall_3_1_0()); \n pushFollow(FOLLOW_2);\n ruleVersion();\n\n state._fsp--;\n\n after(grammarAccess.getCommObjectsRepositoryAccess().getVersionVersionParserRuleCall_3_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Version__MajorAssignment_0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCommunicationObject.g:3798:1: ( ( RULE_INT ) )\n // InternalCommunicationObject.g:3799:2: ( RULE_INT )\n {\n // InternalCommunicationObject.g:3799:2: ( RULE_INT )\n // InternalCommunicationObject.g:3800:3: RULE_INT\n {\n before(grammarAccess.getVersionAccess().getMajorINTTerminalRuleCall_0_0()); \n match(input,RULE_INT,FOLLOW_2); \n after(grammarAccess.getVersionAccess().getMajorINTTerminalRuleCall_0_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Module__VersionAssignment_5() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../com.mguidi.soa.ui/src-gen/com/mguidi/soa/ui/contentassist/antlr/internal/InternalSOA.g:3883:1: ( ( ruleVersion ) )\n // ../com.mguidi.soa.ui/src-gen/com/mguidi/soa/ui/contentassist/antlr/internal/InternalSOA.g:3884:1: ( ruleVersion )\n {\n // ../com.mguidi.soa.ui/src-gen/com/mguidi/soa/ui/contentassist/antlr/internal/InternalSOA.g:3884:1: ( ruleVersion )\n // ../com.mguidi.soa.ui/src-gen/com/mguidi/soa/ui/contentassist/antlr/internal/InternalSOA.g:3885:1: ruleVersion\n {\n before(grammarAccess.getModuleAccess().getVersionVersionParserRuleCall_5_0()); \n pushFollow(FOLLOW_ruleVersion_in_rule__Module__VersionAssignment_57780);\n ruleVersion();\n\n state._fsp--;\n\n after(grammarAccess.getModuleAccess().getVersionVersionParserRuleCall_5_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void ruleVersion() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCommunicationObject.g:181:2: ( ( ( rule__Version__Group__0 ) ) )\n // InternalCommunicationObject.g:182:2: ( ( rule__Version__Group__0 ) )\n {\n // InternalCommunicationObject.g:182:2: ( ( rule__Version__Group__0 ) )\n // InternalCommunicationObject.g:183:3: ( rule__Version__Group__0 )\n {\n before(grammarAccess.getVersionAccess().getGroup()); \n // InternalCommunicationObject.g:184:3: ( rule__Version__Group__0 )\n // InternalCommunicationObject.g:184:4: rule__Version__Group__0\n {\n pushFollow(FOLLOW_2);\n rule__Version__Group__0();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getVersionAccess().getGroup()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Version__Group__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCommunicationObject.g:1577:1: ( ( ( rule__Version__MajorAssignment_0 ) ) )\n // InternalCommunicationObject.g:1578:1: ( ( rule__Version__MajorAssignment_0 ) )\n {\n // InternalCommunicationObject.g:1578:1: ( ( rule__Version__MajorAssignment_0 ) )\n // InternalCommunicationObject.g:1579:2: ( rule__Version__MajorAssignment_0 )\n {\n before(grammarAccess.getVersionAccess().getMajorAssignment_0()); \n // InternalCommunicationObject.g:1580:2: ( rule__Version__MajorAssignment_0 )\n // InternalCommunicationObject.g:1580:3: rule__Version__MajorAssignment_0\n {\n pushFollow(FOLLOW_2);\n rule__Version__MajorAssignment_0();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getVersionAccess().getMajorAssignment_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__CommObjectsRepository__Group_3__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCommunicationObject.g:1468:1: ( ( ( rule__CommObjectsRepository__VersionAssignment_3_1 ) ) )\n // InternalCommunicationObject.g:1469:1: ( ( rule__CommObjectsRepository__VersionAssignment_3_1 ) )\n {\n // InternalCommunicationObject.g:1469:1: ( ( rule__CommObjectsRepository__VersionAssignment_3_1 ) )\n // InternalCommunicationObject.g:1470:2: ( rule__CommObjectsRepository__VersionAssignment_3_1 )\n {\n before(grammarAccess.getCommObjectsRepositoryAccess().getVersionAssignment_3_1()); \n // InternalCommunicationObject.g:1471:2: ( rule__CommObjectsRepository__VersionAssignment_3_1 )\n // InternalCommunicationObject.g:1471:3: rule__CommObjectsRepository__VersionAssignment_3_1\n {\n pushFollow(FOLLOW_2);\n rule__CommObjectsRepository__VersionAssignment_3_1();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getCommObjectsRepositoryAccess().getVersionAssignment_3_1()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"int getPatchVersion();",
"public final void rule__EPREFIX_ID__VersionAssignment_2_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalAADMParser.g:27056:1: ( ( RULE_VERSION ) )\n // InternalAADMParser.g:27057:2: ( RULE_VERSION )\n {\n // InternalAADMParser.g:27057:2: ( RULE_VERSION )\n // InternalAADMParser.g:27058:3: RULE_VERSION\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getEPREFIX_IDAccess().getVersionVERSIONTerminalRuleCall_2_1_0()); \n }\n match(input,RULE_VERSION,FOLLOW_2); if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getEPREFIX_IDAccess().getVersionVERSIONTerminalRuleCall_2_1_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public void setVerMinor(int value) {\n this.verMinor = value;\n }",
"public String incrementMinorVersion(String versionIdentifier);",
"public final void rule__Version__Group_3__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCommunicationObject.g:1673:1: ( rule__Version__Group_3__0__Impl rule__Version__Group_3__1 )\n // InternalCommunicationObject.g:1674:2: rule__Version__Group_3__0__Impl rule__Version__Group_3__1\n {\n pushFollow(FOLLOW_11);\n rule__Version__Group_3__0__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Version__Group_3__1();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Version__Group__3__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCommunicationObject.g:1657:1: ( ( ( rule__Version__Group_3__0 )? ) )\n // InternalCommunicationObject.g:1658:1: ( ( rule__Version__Group_3__0 )? )\n {\n // InternalCommunicationObject.g:1658:1: ( ( rule__Version__Group_3__0 )? )\n // InternalCommunicationObject.g:1659:2: ( rule__Version__Group_3__0 )?\n {\n before(grammarAccess.getVersionAccess().getGroup_3()); \n // InternalCommunicationObject.g:1660:2: ( rule__Version__Group_3__0 )?\n int alt20=2;\n int LA20_0 = input.LA(1);\n\n if ( (LA20_0==39) ) {\n alt20=1;\n }\n switch (alt20) {\n case 1 :\n // InternalCommunicationObject.g:1660:3: rule__Version__Group_3__0\n {\n pushFollow(FOLLOW_2);\n rule__Version__Group_3__0();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n after(grammarAccess.getVersionAccess().getGroup_3()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public void setMinorVersion(int value) {\n this.minorVersion = value;\n }",
"int getMinorVersion();",
"public String incrementPatchLevel(String versionIdentifier);",
"public final void rule__CommObjectsRepository__Group_3__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCommunicationObject.g:1442:1: ( ( 'version' ) )\n // InternalCommunicationObject.g:1443:1: ( 'version' )\n {\n // InternalCommunicationObject.g:1443:1: ( 'version' )\n // InternalCommunicationObject.g:1444:2: 'version'\n {\n before(grammarAccess.getCommObjectsRepositoryAccess().getVersionKeyword_3_0()); \n match(input,37,FOLLOW_2); \n after(grammarAccess.getCommObjectsRepositoryAccess().getVersionKeyword_3_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
converts a given frequency, duration, and amplitude into a playable audio note | private static double[] note(double hz, double duration, double amplitude) {
int N = (int) (StdAudio.SAMPLE_RATE * duration);
double[] a = new double[N + 1];
for (int i = 0; i <= N; i++)
a[i] = amplitude * Math.sin(2 * Math.PI * i * hz / StdAudio.SAMPLE_RATE);
return a;
} | [
"public static void playTone (int aFrequency, int aDuration)\n {\n ROM.call ((short) 0x327c, (short) 0x1773, (short) aFrequency, \n (short) aDuration);\n }",
"public void playTone(int frequency, int duration)\n {\n\n AudioHelper.playTone(frequency, 100, duration);\n }",
"public void playTone(final int frequency, final int amplitude, final int duration)\n {\n finchController.playTone(frequency, amplitude, duration);\n }",
"public void playTone(int frequency, int volume, int duration)\n {\n AudioHelper.playTone(frequency, volume, duration);\n }",
"public void playInstrumentAtFrequency(int instrument, double frequency)\n {\n // Declare score and sine wave instrument\n Score s = new Score();\n s.setTempo(tempo);\n Part p = new Part(instrument);\n\n // Create note at pitch given by user (full note)\n Note freqNote = new Note(frequency, 1);\n\n // Create phrase and add note to the score\n Phrase phrase = new Phrase(freqNote);\n p.addPhrase(phrase);\n s.addPart(p);\n\n\n // Play sound\n //Play.audio(phrase, instrument);\n\n Score sc = new Score(\"CPhrase class example\", 120);\n Part guitarPart = new Part(\"Guitar\",JAZZ_GUITAR, 0);\n Part bassPart = new Part(\"Bass\", ACOUSTIC_BASS, 1);\n Part ridePart = new Part(\"Drums\", 0, 9);\n Part snarePart = new Part(\"Drums 2\", 0, 9);\n Part saxPart = new Part(\"Sax\", SAXOPHONE, 2);\n Phrase bassPhrase = new Phrase();\n\n //Let us know things have started\n System.out.println(\"Creating chord progression . . .\");\n\n //choose rootPitch notes around the cycle of fifths\n// int rootPitch = c4; //set start pitch to C\n// for (int i=0;i<6;i++) {\n// for (int j=0;j<4;j++) { // 4 chords to a bar\n//// guitarPart.addCPhrase(JazzGuitar.triad\n//// (rootPitch));\n//// }\n//// bassPart.addPhrase(JazzBass.bassLine(rootPitch));\n//// ridePart.addPhrase(JazzDrums.swingTime());\n//// snarePart.addPhrase(JazzDrums.swingAccents());\n//// saxPart.addPhrase(JazzSax.melody(rootPitch));\n//// // choose the next root pitch\n//// rootPitch -= 7;\n//// for (int k=0;k<4;k++) {\n//// guitarPart.addCPhrase(JazzGuitar.domSeventh\n//// (rootPitch));\n//// }\n//// bassPart.addPhrase(JazzBass.bassLine2(rootPitch));\n//// ridePart.addPhrase(JazzDrums.swingTime());\n//// snarePart.addPhrase(JazzDrums.swingAccents());\n//// saxPart.addPhrase(JazzSax.melody(rootPitch));\n// rootPitch += 5;\n// }\n\n //pack the parts into a score\n// s.addPart(guitarPart);\n// s.addPart(bassPart);\n// s.addPart(ridePart);\n// s.addPart(snarePart);\n// s.addPart(saxPart);\n\n //display the music\n //View.show(s);\n\n // write the score to a MIDIfile\n long statTime = System.currentTimeMillis();\n Play.midi(s);\n long stopTime = System.currentTimeMillis();\n System.out.println(\"Time of playing: \" + (stopTime - statTime));\n\n }",
"@Override\n public void playTone(Waveform waveform, double frequency, double duration, double volume)\n {\n final String funcName = \"playTone\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API,\n \"waveform=%s,freq=%.0f,dur=%.3f,vol=%.1f\",\n waveform.toString(), frequency, duration, volume);\n }\n\n if (volume < 0.0 || volume > 1.0)\n {\n throw new IllegalArgumentException(\"Volume must be in the range 0.0 to 1.0.\");\n }\n\n if (frequency < 0.0)\n {\n throw new IllegalArgumentException(\"Frequency cannot be negative.\");\n }\n\n if (duration < 0.0)\n {\n throw new IllegalArgumentException(\"Duration cannot be negative.\");\n }\n\n byte outputMode = 0;\n switch (waveform)\n {\n case SINE_WAVE:\n outputMode = 1;\n break;\n\n case SQUARE_WAVE:\n outputMode = 2;\n break;\n\n case TRIANGLE_WAVE:\n outputMode = 3;\n break;\n }\n\n analogOut.setAnalogOutputMode(outputMode);\n analogOut.setAnalogOutputFrequency((int)frequency);\n analogOut.setAnalogOutputVoltage((int)(MAX_VOLTAGE*volume));\n expiredTime = TrcUtil.getCurrentTime() + duration;\n playing = true;\n setTaskEnabled(true);\n\n if (debugEnabled)\n {\n dbgTrace.traceInfo(funcName,\n \"mode=%d,freq=%d,dur=%.3f,vol=%.1f\", outputMode, (int)frequency, duration, volume);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API);\n }\n }",
"private void updateToneText(double frequency, double amplitude) {\n String ampString = String.format( Locale.getDefault(), \"%3d\", (int) ( amplitude * 100));\n String toneString = String.format( Locale.getDefault(), \"%7.2f\", frequency) + \" Hz\";\n String noteString = mScalarTone.toneToNoteString( frequency);\n TextView textView = (TextView) getActivity().findViewById( R.id.tread_tone_tv_tone);\n textView.setText( toneString + \" (\" + noteString + \"), \" + ampString + \"%\" );\n }",
"private static short[] gennToneSin(double freq, double amplitude, double duration) {\n\n int totSlot = (int) (duration * genTone.stdFreq);\n short actualAmplitude = (short) (amplitude * Short.MAX_VALUE / 2);\n short[] generatedWave = new short[totSlot];\n for (int i = 0; i < (generatedWave.length); ++i) {\n generatedWave[i] = (short) (actualAmplitude * Math.sin(2 * Math.PI * freq * i / genTone.stdFreq));\n }\n return generatedWave;\n }",
"public void playTone(int freq, int duration) throws IOException {\r\n sendMessage(CircuitPlaygroundMessageFactory.playTone(freq, duration));\r\n }",
"private static short[] gennToneSaw(double freq, double amplitude, double duration) {\n int totSlot = (int) (duration * genTone.stdFreq);\n int slotsPerWave = (int) (genTone.stdFreq / freq);\n short actualAmplitude = (short) (amplitude * Short.MAX_VALUE / 2);\n short ampIncreasePerSlot = (short) (2 * actualAmplitude / slotsPerWave);\n short[] generatedWave = new short[totSlot];\n for (int i = 0; i < (generatedWave.length); ++i) {\n if ((i % slotsPerWave) == 0) {\n generatedWave[i] = (short) (-actualAmplitude);\n } else {\n generatedWave[i] = (short) (ampIncreasePerSlot + generatedWave[i - 1]);\n }\n }\n return generatedWave;\n }",
"@Override\n public void noteOn(final int tag, final double frequency, final double amplitude,\n TimeStamp timeStamp) {\n getSynthesizer().scheduleCommand(timeStamp, new ScheduledCommand() {\n @Override\n public void run() {\n VoiceTracker voiceTracker = allocateTracker(tag);\n if (voiceTracker.presetIndex != mPresetIndex) {\n voiceTracker.voice.usePreset(mPresetIndex);\n voiceTracker.presetIndex = mPresetIndex;\n }\n voiceTracker.voice.noteOn(frequency, amplitude, getSynthesizer().createTimeStamp());\n }\n });\n }",
"private static short[] gennToneSquare(double freq, double amplitude, double duration) {\n int totSlot = (int) (duration * genTone.stdFreq);\n int slotsPerWave = (int) (genTone.stdFreq / freq);\n short actualAmplitude = (short) (amplitude * Short.MAX_VALUE / 2);\n short[] generatedWave = new short[totSlot];\n for (int i = 0; i < (generatedWave.length); ++i) {\n if ((i % slotsPerWave) < (slotsPerWave / (2.0))) {\n generatedWave[i] = (short) (-actualAmplitude);\n } else {\n generatedWave[i] = actualAmplitude;\n }\n }\n return generatedWave;\n }",
"void playTone(){\n t = new Thread() {\n public void run(){\n isRunning = true;\n setPriority(Thread.MAX_PRIORITY);\n\n\n\n audioTrack.play();\n\n for (int i = 0; i < message.length(); i++) {\n\n ASCIIBreaker breaker = new ASCIIBreaker((int)message.charAt(i));\n\n int frequencies[] = breaker.ASCIIToFrequency();\n\n //Generate waves for all different frequencies\n for(int fre : frequencies) {\n audioTrack.write(generateSineInTimeDomain(fre),0,sample_size);\n }\n\n audioTrack.write(generateSineInTimeDomain(7000),0,sample_size);\n }\n\n audioTrack.stop();\n audioTrack.release();\n }\n };\n t.start();\n }",
"public Note(int startTime, ChromaticTone tone, int duration, int instrument, int volume) {\n\n this.startTime = startTime;\n this.tone = tone;\n this.duration = duration;\n this.instrument = instrument;\n this.volume = volume;\n\n }",
"public static double[] harmonic(int pitch, double duration) {\n double hz = 440.0 * Math.pow(2, pitch / 12.0);\n double[] a = pitch(hz, duration);\n double[] hi = pitch(2*hz, duration);\n double[] lo = pitch(hz/2, duration);\n double[] h = MusicTools.weightedAddArray(hi, lo, 0.5, 0.5);\n\n return MusicTools.weightedAddArray(a, h, 0.5, 0.5);\n}",
"private float midiToFreq(int note) {\n return (pow(2, ((note - 69) / 12.0f))) * 440;\n }",
"public static short[] generatePureTone(double freq, double amplitude, double duration, ToneType toneType) {\n if (duration == 0) {\n short[] result = {0};\n return result;\n } else if (toneType == ToneType.SINE) {\n return gennToneSin(freq, amplitude, duration);\n } else if (toneType == ToneType.SAWTOOTH) {\n return gennToneSaw(freq, amplitude, duration);\n } else {\n return gennToneSquare(freq, amplitude, duration);\n }\n }",
"public void tone1Duration(int duration) throws JposException;",
"public static double frequencyToPitch(double frequency) {\n return CONCERT_A_PITCH + 12 * Math.log(frequency / mConcertAFrequency) / Math.log(2.0);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
do post by custom contentType and charset | public static String postWithCustomContentTypeAndCharset(String url, String params, String charset,
String contentType) {
AsyncHttpClient.BoundRequestBuilder builder = asyncHttpClient.preparePost(url);
builder.setBodyEncoding(charset);
builder.setBody(params);
builder.setHeader("Content-Type", contentType);
useCookie(builder);
Future<Response> f = builder.execute();
String body = null;
try {
body = f.get().getResponseBody(DEFAULT_CHARSET);
addCookie(f.get().getCookies());
} catch (Exception e) {
logger.error(LogUtil.builder().method("Post Request(the result is String,the param is a string with custom contentType and charset)").msg("error,url={}").build(), url, e);
}
return body;
} | [
"@Override\n public String getBodyContentType() {\n return \"application/x-www-form-urlencoded; charset=UTF-8\";\n }",
"public void testContentEncodingWithContentType() throws Exception {\n WebConversation webConversation = new WebConversation();\n PostMethodWebRequest req =\n new PostMethodWebRequest(APPLICATION_PATH + \"nocache/ag1/request-headers.jsp?name=Content-Encoding\",\n IOUtils.toInputStream(\"test\"), \"text/html; charset=utf-8\");\n String resp = webConversation.getResponse(req).getText();\n assertEquals(\"Content-Encoding request header should be empty\", \"\", resp.toLowerCase());\n }",
"public static String postBySSLAndParamsInRequestBody(String url, String params, String contentType, SSLContext sslContext) {\n AsyncHttpClient http = new AsyncHttpClient(new AsyncHttpClientConfig.Builder()\n .setConnectTimeout(SO_TIMEOUT).setSSLContext(sslContext).build());\n AsyncHttpClient.BoundRequestBuilder builder = http.preparePost(url);\n builder.setBodyEncoding(DEFAULT_CHARSET);\n builder.setBody(params);\n builder.setHeader(\"Content-Type\", contentType);\n useCookie(builder);\n Future<Response> f = builder.execute();\n String body = null;\n try {\n body = f.get().getResponseBody(DEFAULT_CHARSET);\n addCookie(f.get().getCookies());\n } catch (Exception e) {\n logger.error(LogUtil.builder().method(\"Post Request(the result is String ,the params is a String in request body with custom contentType and a sslContext )\").msg(\"error,url={}\").build(), url, e);\n }\n http.close();\n return body;\n }",
"public abstract void setContentType(WebResponse response, String encoding);",
"@Test\n public void getAcceptMimeTypeWithPostRequest() {\n when(request.getMethod()).thenReturn(\"POST\");\n when(request.getContentType()).thenReturn(\"application/xml; charset=UTF-8\");\n\n String result = instance.getAcceptMimeType(request);\n assertEquals(\"application/xml\", result);\n }",
"void post_form(String path, Map<String, String> data, boolean crumbFlag) throws IOException;",
"@Test\n\tpublic void testHttpPostUtfText() throws InterruptedException, IOException {\n\n\t\tfinal HttpSource httpSource = newHttpSource();\n\t\tfinal FileSink fileSink = newFileSink().binary(true);\n\n\t\t/** I want to go to Japan. */\n\t\tfinal String stringToPostInJapanese = \"\\u65e5\\u672c\\u306b\\u884c\\u304d\\u305f\\u3044\\u3002\";\n\n\t\tfinal String streamName = generateStreamName();\n\t\tfinal String stream = String.format(\"%s | %s\", httpSource, fileSink);\n\n\t\tlogger.info(\"Creating Stream: \" + stream);\n\t\tstream().create(streamName, stream);\n\n\t\tlogger.info(\"Posting String: \" + stringToPostInJapanese);\n\t\thttpSource.ensureReady().postData(stringToPostInJapanese);\n\n\n\t\tassertThat(fileSink, eventually(hasContentsThat(equalTo(stringToPostInJapanese))));\n\n\t}",
"private void writePostContent(HttpURLConnection connection, String postContent) throws Exception {\n connection.setRequestMethod(\"POST\");\n connection.addRequestProperty(\"Content-Type\",\n \"application/xml; charset=utf-8\");\n // set the output and input to true\n connection.setDoOutput(true);\n connection.setDoInput(true);\n connection.setAllowUserInteraction(false);\n // set the content length\n DataOutputStream dstream = null;\n try {\n connection.connect();\n dstream = new DataOutputStream(connection.getOutputStream());\n // write the post content\n dstream.writeBytes(postContent);\n dstream.flush();\n } finally {\n // flush the stream\n if (dstream != null) {\n try {\n dstream.close();\n } catch (Exception ex) {\n _log.error(\"Exception while closing the stream.\" +\n \" Exception: \" + ex,\n \"WebClient._writePostContent()\");\n }\n }\n }\n }",
"private byte[] getPostBody(LinkedHashMap<String,String> requestHeadersToSend,LinkedHashMap<String,String> requestHeaders, boolean isChunked) throws IOException\n {\n byte[] requestPostData=null;\n String defaultContentType=null;\n //application/octet-stream\n if(postDataBytes!=null)\n {\n defaultContentType=\"application/octet-stream\";\n } else\n {\n defaultContentType=\"application/x-www-form-urlencoded\";\n }\n Iterator<String> it=requestHeaders.keySet().iterator();\n String headerKey;\n String headerValue;\n String boundary=\"--XTT0000000\"+System.currentTimeMillis();\n boolean isMultipartPost=false;\n boolean foundContentType=false;\n while(it.hasNext())\n {\n headerKey=it.next();\n headerValue=requestHeaders.get(headerKey);\n if(headerKey!=null&&headerKey.toLowerCase().equals(\"content-type\"))\n {\n foundContentType=true;\n if(headerValue.toLowerCase().equals(\"multipart/form-data\"))\n {\n headerValue=\"multipart/form-data; boundary=\"+boundary;\n isMultipartPost=true;\n requestHeaders.remove(headerKey);\n requestHeadersToSend.put(\"content-type\",headerValue);\n }\n }\n }\n if(!foundContentType)\n {\n requestHeadersToSend.put(\"content-type\",defaultContentType);\n }\n\n if(postDataBytes==null)\n {\n String dataKey=null;\n String dataValue=null;\n StringBuffer postDataBuffer=new StringBuffer(\"\");\n if(!isMultipartPost)\n {\n it=postData.keySet().iterator();\n String divider=\"\";\n dataKey=null;\n while(it.hasNext())\n {\n dataKey=(String)it.next();\n try\n {\n postDataBuffer.append(divider+dataKey+\"=\"+URLEncoder.encode(postData.get(dataKey),XTTProperties.getCharSet()));\n } catch(java.io.UnsupportedEncodingException uee)\n {\n XTTProperties.printFail(\"Unsupported charset: \"+XTTProperties.getCharSet());\n if(XTTProperties.printDebug(null))\n {\n XTTProperties.printException(uee);\n }\n XTTProperties.setTestStatus(XTTProperties.FAILED);\n return null;\n }\n divider=\"&\";\n }\n } else\n {\n it=postData.keySet().iterator();\n dataKey=null;\n dataValue=null;\n while(it.hasNext())\n {\n dataKey=it.next();\n dataValue=postData.get(dataKey);\n postDataBuffer.append(\"--\"+boundary+sCRLF);\n postDataBuffer.append(\"Content-Disposition: form-data; name=\\\"\"+dataKey+\"\\\"\"+sCRLF);\n postDataBuffer.append(sCRLF);\n postDataBuffer.append(dataValue+sCRLF);\n }\n postDataBuffer.append(\"--\"+boundary+\"--\"+sCRLF);\n }\n requestPostData=ConvertLib.createBytes(postDataBuffer.toString());\n } else\n {\n requestPostData=postDataBytes;\n }\n if(isChunked)\n {\n return HTTPHelper.createChunkedBody(requestPostData,transferChunkSize);\n } else\n {\n requestHeadersToSend.put(\"content-length\",requestPostData.length+\"\");\n return requestPostData;\n }\n }",
"protected Response post() {\n RequestBuilder builder = RequestBuilder.post().setUri(url);\n return getResponseAfterDetectingType(builder);\n }",
"public void ActualizarPost(String c,String d,String e,String p){\n String urlParameters=\"cod=\"+c+\"&dis=\"+d+\"&est=\"+e+\"&pas=\"+p;\n HttpURLConnection conection=null;\n try{\n URL url=new URL(\"http://192.168.64.2/Web/actualizardatos.php\");\n conection=(HttpURLConnection)url.openConnection();\n\n //estableciendo el metodo\n conection.setRequestMethod(\"POST\");\n\n //longitud de datos que se envian\n conection.setRequestProperty(\"Content-Length\", \"\" + Integer.toString(urlParameters.getBytes().length));\n\n //comando para la salida de datos\n conection.setDoOutput(true);\n\n DataOutputStream wr=new DataOutputStream(conection.getOutputStream());\n wr.writeBytes(urlParameters);\n wr.close();\n\n InputStream is=conection.getInputStream();\n\n\n }catch (Exception ex){}\n }",
"public void setCharacterEncoding(String arg0) {\r\n\t\t if(!committed){\r\n\t\tif(header.get(\"Content-Type\".toString().toLowerCase())!=null)\r\n\t\t{\r\n\t\t\theader.put(\"Content-Type\".toString().toLowerCase(), arg0);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\theader.put(\"Content-Type\".toString().toLowerCase(), arg0);\r\n\t\t}\r\n\t\t }\r\n\r\n\t}",
"String postRequest(String url);",
"private void setPostRequestProperties(HttpURLConnection conn){\n try {\n conn.setDoInput(true);\n conn.setDoOutput(true);\n conn.setRequestProperty(\"Content-Type\", \"application/json\");\n conn.setRequestProperty(\"Accept\", \"application/json\");\n conn.setRequestMethod(\"POST\");\n } catch (ProtocolException e) {\n e.printStackTrace();\n }\n }",
"ConnectionResult postREST(String request, JSONObject body) throws MalformedURLException, IOException {\n\t\tHttpURLConnection connection = (HttpURLConnection) new URL(SERVER_URL + request).openConnection();\n\t\tconnection.setRequestMethod(\"POST\");\n\t\tconnection.setRequestProperty(\"Content-Type\", \"application/json; utf-8\");\n\n\t\tdebug(\"Post:\" + body.toString());\n\n\t\tconnection.setDoOutput(true);\n\t\tOutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream());\n\t\twr.write(body.toString());\n\t\twr.flush();\n\n\t\tint responseCode = connection.getResponseCode();\n\t\tString response = \"\";\n\n\t\tScanner input = new Scanner(connection.getInputStream());\n\t\twhile (input.hasNextLine()) {\n\t\t\tresponse += input.nextLine();\n\t\t}\n\t\tinput.close();\n\n\t\treturn new ConnectionResult(responseCode, response);\n\t}",
"String post_xml(String path, String xml_data) throws IOException;",
"@Test\n public void postRequest() {\n str = METHOD_POST + URI_SAMPLE + \" \" + HTTP_VERSION + ENDL +\n HOST_HEADER + \": www.site.ru\" + ENDL +\n \"Referer: \"+ URI_SAMPLE + ENDL +\n \"Cookie: income=1\" + ENDL +\n \"Content-Type: application/x-www-form-urlencoded\" + ENDL +\n \"Content-Length: 35\" + ENDL +\n \"login=Petya%20Vasechkin&password=qq\";\n\n request = new HttpRequest(str, IP_ADDRESS, HOST);\n assertEquals(request.getMethod(), HttpMethod.POST);\n assertEquals(request.getUrn(), \"www.site.ru/news.html\");\n assertEquals(request.getHeader(HOST_HEADER), \"www.site.ru\");\n assertEquals(request.getHeader(\"Referer\"), URI_SAMPLE);\n assertEquals(request.getHeader(\"Cookie\"), \"income=1\");\n assertEquals(request.getHeader(\"Content-Type\"), \"application/x-www-form-urlencoded\");\n assertEquals(request.getHeader(\"Content-Length\"), \"35\");\n assertEquals(request.getHeader(NONEXISTENT_VAR), \"\");\n\n assertEquals(request.getParameter(\"login\"), \"Petya Vasechkin\");\n assertEquals(request.getParameter(\"password\"), \"qq\");\n assertEquals(request.getParameter(NONEXISTENT_VAR), \"\");\n }",
"protected abstract void postRequest(TransactionRequest<?> request);",
"@Test\n public void utf8Charset() throws BonitaException, InterruptedException {\n stubFor(post(urlEqualTo(\"/\"))\n .withHeader(WM_CONTENT_TYPE, equalTo(PLAIN_TEXT + \"; \" + WM_CHARSET + \"=\" + UTF8))\n .willReturn(aResponse().withStatus(HttpStatus.SC_OK)));\n\n checkResultIsPresent(executeConnector(buildCharsetParametersSet(UTF8)));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turns off the server, aka no longer accepts connections displays out the amount of time total spent on receiving files | public void killServer(){
try {
server.close();
} catch (IOException e) {
e.printStackTrace();
}
// figuring out avg time for all files received
long temp = 0;
for (Long time : totalTimes) {
temp += time;
}
long avgTime = temp / fileCount;
// ending messages
String outMessage = "\n\nThe avg time to receive "+fileCount+" files is: "+avgTime+"MS";
System.out.println(outMessage.toUpperCase());
System.out.println("SERVER IS DONE!");
} | [
"public void stopServer() {\n this.running = false;\n }",
"public static void closeServer() {\n\t\trun = false;\n\t}",
"void resetPeakServerSocketCount();",
"public static void stopServer() {\n try {\n clientListener.stopListener();\n server.close();\n connectionList.clear();\n } catch (IOException ex) {\n System.err.println(\"Error closing server: \\\"\" + ex.getMessage() + \"\\\"\");\n }\n System.out.println(\"SERVER SHUT DOWN\");\n }",
"public void stopCommunicationServer() {\n\t\t\tthis.running = false;\n\t\t}",
"public synchronized void shutServer() {\n \tmainTemporaryStorageArea.terminated = mainTemporaryStorageArea.terminated + 1;\n }",
"public void toggleServer()\n\t{\n\t\tif(listening)\n\t\t{\n\t\t\tlistening = false;\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\tlistening = true;\n\t\t}\n\t}",
"long serverCheckTimeOut();",
"public void stopServer() {\n\t\tif (greenMail != null) {\n\t\t\tLOG.info(\"Stopping mail server\");\n\t\t\tsetEmailEnabled(false);\n\t\t\tgreenMail.stop();\n\t\t}\n\t\tgreenMail = null;\n\t}",
"private void clearW2GStopServer() { w2GStopServer_ = null;\n \n }",
"void stop_ftp() {\n Log.d(TAG, \"about to stop service\");\n stopService(new Intent(this, FtpServerService.class));\n serverRunning = false;\n }",
"public static void stopConnection() {\n\t\trunning = false;\n\t}",
"public synchronized void shutServer() {\n \tmainDepartureTerminalEntrance.terminated = mainDepartureTerminalEntrance.terminated + 1;\n }",
"public void stop() {\n server.stop();\n }",
"public void stop() {\n System.err.println(\"Server will stop\");\n server.stop(0);\n }",
"protected void serverStopped() {\r\n\t\tSystem.out.println(\"Server has stopped listening for connections.\");\r\n\t}",
"protected void serverStopped() {\n\t\tSystem.out.println(\"Server has stopped listening for connections.\");\n\t}",
"public void stopServer() {\n\t\trunning = false;\n\t\ttry {\n\t\t\tserverSocket.close();\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"Error! \" + \"Unable to close socket on port: \" + port, e);\n\t\t}\n\t}",
"public void stopSending ();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the cidade value for this LinhaInfo. | public java.lang.String getCidade() {
return cidade;
} | [
"public String getCidade() {// Retorna o nome da cidade.\r\n\t\treturn cidade;\r\n\t}",
"public java.lang.String getDsCidade() {\n return dsCidade;\n }",
"public String getCidadeNascimento()\n {\n return this.cidadeNascimento;\n }",
"public int getCaixa() {\n\t\treturn this.caixa;\n\t}",
"public int getCaixa() {\n\t\treturn caixa;\n\t}",
"public String getNumero_Caixa() \n\t{\n\t\treturn this.Numero_Caixa;\n\t}",
"public Short getCodCompartilhamentoCadastro() {\n\t\treturn codCompartilhamentoCadastro;\n\t}",
"public String getPrimeiraLinhaCabecalho() {\n return primeiraLinhaCabecalho;\n }",
"public int getCaixa() {\n\t\treturn controlador.getCaixa();\n\t}",
"public java.lang.Long getCodigoClasificacion() {\n\t\treturn _configuracionPerfilador.getCodigoClasificacion();\n\t}",
"public void setCidade(String cidade) {\n this.cidade = cidade;\n }",
"public int getIdCancha() {\n return idCancha;\n }",
"public String getCognome() {\r\n return cognome;\r\n }",
"java.lang.String getCnarid();",
"@Override\n\tpublic java.lang.String getCiudad() {\n\t\treturn _candidato.getCiudad();\n\t}",
"public String getCivico() {\r\n return this.civico;\r\n }",
"public java.lang.String getNome_cidade_localidade() {\n return nome_cidade_localidade;\n }",
"public String getNacionalidade() {\n return nacionalidade;\n }",
"public String getCNAE() {\n\t\tif (this.consultaMinimaPersonaBean != null) {\n\t\t\ttry {\n\t\t\t\tCatalogoBean catalogo = catalogoUtils.getCatalogoBean(\n\t\t\t\t\t\tCatalogoEnum.TP_CNAE_PERS,\n\t\t\t\t\t\tthis.consultaMinimaPersonaBean.getCodigoCNAE());\n\n\t\t\t\tString cnae = catalogo.getDescripcionC();\n\n\t\t\t\treturn this.consultaMinimaPersonaBean.getCodigoCNAE() + \" - \"\n\t\t\t\t\t\t+ cnae;\n\t\t\t} catch (ControlableException ex) {\n\t\t\t\tLOGGER.debug(\"No se ha encontrado el CNAE \"\n\t\t\t\t\t\t+ this.consultaMinimaPersonaBean.getCodigoCNAE()\n\t\t\t\t\t\t+ \" en el catalogo\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the last modification identifier for optimistic concurrency locking. | public void setLastModificationId(long lastModificationId) {
this.lastModificationId = lastModificationId;
} | [
"public synchronized void setModificationCounter(long modificationCounter) {\n \t\tthis.modificationCounter = modificationCounter;\n \t}",
"public long getLastModificationId() {\r\n return lastModificationId;\r\n }",
"void setLastModifiedTime( long modTime ) throws FileSystemException;",
"void updateLastAccessed(int id);",
"public void setLastModificationTime(java.util.Calendar lastModificationTime) {\r\n this.lastModificationTime = lastModificationTime;\r\n }",
"public void setLastModified(long lastModified) {\n\t\tthis.lastModified = lastModified;\n\t}",
"public void setModifyed(Long modifyed) {\n this.modifyed = modifyed;\n }",
"public void setModifiedByUser(long modifiedByUser);",
"void setModificationDate(long date);",
"public void setLastModifyTime(Date lastModifyTime) {\n this.lastModifyTime = lastModifyTime;\n }",
"public void setLastModTime(Date lastModTime) {\n this.lastModTime = lastModTime;\n }",
"public void setLastupdateby(int value) {\n this.lastupdateby = value;\n }",
"public void addDataModificationId(long value) {\n maxDataModificationId = Math.max(maxDataModificationId, value);\n }",
"public void setModifiedBy(int tmp) {\n this.modifiedBy = tmp;\n }",
"void setLastUpdatedTime();",
"Imports setLastModified(String lastModified);",
"void setLastAccess(long time);",
"public void setLastModify(Date lastModify) {\n\t\tthis.lastModify = lastModify;\n\t}",
"public void setModifyby(Long modifyby) {\n this.modifyby = modifyby;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for setStaffs(ArrayList myStaffs) which sets the staff in the music sheet instance. This method is tested by adding staffs to the music sheet and an arrayList setStaffs and the music sheet's staff is asserted to be equal | @Test
public void testSetStaffs() {
ArrayList<Staff> setstaffs = new ArrayList<Staff>();
Staff staff = new Staff(5);
Staff staff1 = new Staff(5);
Staff staff2 = new Staff(5);
Measure m = new Measure(5);
m.addLine("||*-----<5>-----------<7>----------------------------*||");
m.addLine("||-0-----------7-----------------------------0---------|");
m.addLine("*--------------------------------2---------------------*");
m.addLine("|-0--------------7--------------------------0---------||");
m.addLine("|-----0----------10-------------0-------0-------5s7----|");
staff.addToStaff(m);
staff1.addToStaff(m);
staff2.addToStaff(m);
setstaffs.add(staff1);
setstaffs.add(staff2);
setstaffs.add(staff);
test.setStaffs(setstaffs);
assertSame(test.getStaffs(), setstaffs);
} | [
"@Test\n public void testIsStaffMember() {\n System.out.println(\"isStaffMember\");\n\n StaffMember staffMember = new StaffMember();\n List<StaffMember> staffMembersList = new ArrayList<>();\n staffMembersList.add(staffMember);\n this.staffList.setStaffList(staffMembersList);\n\n assertTrue(this.staffList.isStaffMember(staffMember));\n }",
"@Test\r\n public void testSetStudentsList() {\r\n System.out.println(\"setStudentsList\");\r\n List<Students> studentsList = null;\r\n Markedworks instance = new Markedworks();\r\n instance.setStudentsList(studentsList);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }",
"@Test\n\tpublic void testEditingStaffSuccess()\n\t{\n\t\tstaffsPage.editStaff(new Staff(oldStaffName, oldBranchName), new Staff(newStaffName, newBranchName));\n\t\t// Test that old Staff is no more present\n\t\tassertTrue(!staffsPage.getStaffs().contains(new Staff(oldStaffName, oldBranchName)));\n\t\t// Test that new Staff present\n\t assertTrue(staffsPage.getStaffs().contains(new Staff(newStaffName, newBranchName)));\n\t}",
"@Test\r\n public void testSetTeachersList() {\r\n System.out.println(\"setTeachersList\");\r\n List<Teachers> teachersList = null;\r\n Markedworks instance = new Markedworks();\r\n instance.setTeachersList(teachersList);\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 testSetUsersList() {\n System.out.println(\"setUsersList\");\n Set<User> usersList = new HashSet<>();\n usersList.add(new User(\"test1\", \"test@email.com\"));\n sn10.setUsersList(usersList);\n assertEquals(usersList, sn10.getUsersList());\n }",
"@Test\r\n\tpublic void testGetSetValidStaff() {\r\n\t\tLecture lecture = new Lecture();\r\n\t\tlecture.setStaff(validStaff);\r\n\t\tassertEquals(validStaff, lecture.getStaff());\r\n\t}",
"@Test\r\n\tpublic void testSet() {\r\n\t\tArrayList<String> al = new ArrayList<String>();\r\n\t\tal.add(0, \"hi\");\r\n\t\tassertEquals(\"hi\", al.get(0));\r\n\t\tal.add(1, \"yes\");\r\n\t\tassertEquals(\"yes\", al.get(1));\r\n\t\tal.add(1, \"no\");\r\n\t\t// Set in front\r\n\t\tal.set(0, \"WHY\");\r\n\t\tassertEquals(\"WHY\", al.get(0));\r\n\t\t// Set in middle\r\n\t\tal.set(1, \"HELLO\");\r\n\t\tassertEquals(\"HELLO\", al.get(1));\r\n\t\t// Set at end\r\n\t\tal.set(2, \"THERE\");\r\n\t\tassertEquals(\"THERE\", al.get(2));\r\n\t\t// Make a new array list to test if the set method returns the right thing\r\n//\t\tArrayList<String> al2 = new ArrayList<String>();\r\n\t\tal.add(0, \"hi\");\r\n\t\tassertEquals(\"hi\", al.get(0));\r\n\t\tal.add(1, \"yes\");\r\n\t\tassertEquals(\"yes\", al.get(1));\r\n\t\tal.add(1, \"no\");\r\n\t\t//assertEquals(\"hi\", al.set(0, \"WHY\"));\r\n\t\t// Set in middle\r\n\t\t//assertEquals(\"no\", al.set(1, \"HELLO\"));\r\n\t\t// Set at end\r\n\t\t//assertEquals(\"yes\", al.set(2, \"THERE\"));\r\n\t\t\r\n\t\ttry {\r\n\t\t\tal.set(-1, \"yes\");\r\n\t\t\tfail();\r\n\t\t} catch (IndexOutOfBoundsException e) {\r\n\t\t\tassertEquals(\"hi\", al.get(0));\r\n\t\t\tassertEquals(\"no\", al.get(1));\r\n\t\t\tassertEquals(\"yes\", al.get(2));\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\tal.set(8, \"yes\");\r\n\t\t\tfail();\r\n\t\t} catch (IndexOutOfBoundsException e) {\r\n\t\t\tassertEquals(\"hi\", al.get(0));\r\n\t\t\tassertEquals(\"no\", al.get(1));\r\n\t\t\tassertEquals(\"yes\", al.get(2));\r\n\t\t}\r\n\t\tArrayList<String> al3 = new ArrayList<String>();\r\n\t\ttry {\r\n\t\t\tal3.set(0, \"hi\");\r\n\t\t\tfail();\r\n\t\t} catch (IndexOutOfBoundsException e) {\r\n\t\t\tassertEquals(0, al3.size());\r\n\t\t}\r\n\t}",
"@Test\n public void testSetMealList() {\n System.out.println(\"setMealList\");\n ArrayList mealList = null;\n RecipeBean instance = new RecipeBean();\n instance.setMealList(mealList);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Object otherObject = new StaffList();\n assertTrue(this.staffList.equals(otherObject));\n }",
"@Test\n\tpublic void testMusicSheet() {\n\t\tassertEquals(test.getStaffs().get(0).getLines().get(0).toString(), \"|s4-----------------2-----|-----4-----4-----4-----4-|\"\n\t\t\t\t+ \"---5-----5-----5-----5---|-5-----5-----5-----------|\"\n\t\t\t\t+ \"-------3-----------3-----|-------------------------|\");\n\t}",
"public void setStaffShows(ArrayList<ScheduledConcert> staffShows) {\r\n\t\t\tthis.staffShows = staffShows;\r\n\t\t}",
"@Test\n\tpublic void testGetStaffs() {\n\t\tString result = \"|s4-----------------2-----|-----4-----4-----4-----4-|---5-----5-----5-----5---|\"\n\t\t\t\t+ \"-5-----5-----5-----------|-------3-----------3-----|-------------------------|\";\n\t\t\n\t\tString result1 = \"|-----4-----4-----4-----4-|s4-----------------2-----|-------------------------|\"\n\t\t\t\t+ \"-5-----5-----5-----------|-------3-----------3-----|---5-----5-----5-----5---|\";\n\t\t\n\t\tString result2 = \"|-------------------4---7-|s4---1-------------------|-0---3--s6---------------|\"\n\t\t\t\t+ \"---------------3---0-3---|---5-------5-1-----0-----|---5-------5-0h3---0h3---|\";\n\n\t\tassertEquals(test.getStaffs().get(0).getLines().get(0).toString(), result);\n\t\tassertEquals(test.getStaffs().get(0).getLines().get(1).toString(), result1);\n\t\tassertEquals(test.getStaffs().get(0).getLines().get(2).toString(), result2);\n\t}",
"public void setStaff(Staff staff) {\r\n\t\tthis.staff = staff;\r\n\t}",
"@Test\n void setTest() {\n testAddressBook.add(testPerson);\n testAddressBook.set(0, testPerson2);\n List<Person> persons = testAddressBook.getList();\n\n Mockito.verify(testAddressBook).set(anyInt(), any(Person.class));\n Mockito.verify(persons).set(anyInt(), any(Person.class));\n Mockito.verify(testAddressBook).fireTableRowsUpdated(anyInt(), anyInt());\n }",
"public abstract void setStaff();",
"@Test\n public void testSetList() {\n System.out.println(\"setList\");\n ArrayList<String> myList = null;\n ProductTweets instance = null;\n instance.setList(myList);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public boolean assignStaff(StaffSlotDto ss) {\n boolean flag = false;\n try {\n flag = dao.assignStaff(ss);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return flag;\n }",
"@Test\r\n public void testSetClassesList() {\r\n System.out.println(\"setClassesList\");\r\n List<Classes> classesList = null;\r\n Markedworks instance = new Markedworks();\r\n instance.setClassesList(classesList);\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 void getPersonsasListTest(){\n // Create new ArrayList and add two person objects\n List<Person> personsList = new ArrayList<>();\n personsList.add(testPerson);\n personsList.add(testPerson2);\n\n // Add same two person objects to AddressBook\n testAddressBook.add(testPerson);\n testAddressBook.add(testPerson2);\n\n // Check that returned array is the same.\n assertEquals(personsList, testAddressBook.getList());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find domain based list of vm Instances with pagination. | Page<VmInstance> findAllByDomainId(Long domainId, PagingAndSorting pagingAndSorting, String searchText, Long userId) throws Exception; | [
"@Named(\"TargetInstances:aggregatedList\")\n @GET\n @Path(\"/targetInstances\")\n ListPage<TargetInstance> pageOfTargetInstances(@Nullable @QueryParam(\"pageToken\") String pageToken,\n ListOptions listOptions);",
"ExecutionResult listInstances();",
"Page<VmInstance> findAllByStatusAndDomain(PagingAndSorting pagingAndSorting, Status status, Long domainId, String searchText, Long userId) throws Exception;",
"@Override\n\tpublic List<VirtualMachineInstance> getGuestDomains()\n\t\t\tthrows MSIMonitorException {\n\t\tfinal List<VirtualMachineInstance> domains = new ArrayList<VirtualMachineInstance>();\n\t\tfinal Connect conn = (Connect) getConnection();\n\n\t\ttry {\n\t\t\tfinal int[] doms = conn.listDomains();\n\t\t\tfor (final int dom : doms) {\n\t\t\t\tif (dom > 0) {\n\t\t\t\t\tfinal VirtualMachineInstance vmi = new VirtualMachineInstance();\n\t\t\t\t\tvmi.setId(String.valueOf(dom));\n\t\t\t\t\tfinal Domain domainObj = conn.domainLookupByID(dom);\n\t\t\t\t\tvmi.setName(domainObj.getName());\n\t\t\t\t\tdomains.add(vmi);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (final LibvirtException e) {\n\t\t\tthrow new MSIMonitorException(e.getMessage(), e);\n\t\t}\n\n\t\treturn domains;\n\t}",
"public List<ServiceInstance> getAllInstances();",
"public PageDto<List<String>> getInstances(InstancesEntity instancesEntity, PageRequestDto pageRequestDto) {\n String tableName = instancesEntity.getTableName();\n log.info(\"Starting to get instances [{}] for table [{}], page request [{}]\", instancesEntity.getRelationName(),\n tableName, pageRequestDto);\n var attributes = attributeService.getsAttributesInfo(instancesEntity);\n var sqlPreparedQuery = searchQueryCreator.buildSqlQuery(instancesEntity, pageRequestDto);\n var extractor = new DataListResultSetExtractor(instancesEntity, attributes);\n extractor.setDateTimeFormatter(DateTimeFormatter.ofPattern(ecaDsConfig.getDateFormat()));\n var dataList = jdbcTemplate.query(sqlPreparedQuery.getQuery(), extractor, sqlPreparedQuery.getArgs());\n Long totalElements =\n jdbcTemplate.queryForObject(sqlPreparedQuery.getCountQuery(), Long.class, sqlPreparedQuery.getArgs());\n Assert.notNull(totalElements, String.format(\"Expected not null total elements for table [%s]\", tableName));\n log.info(\"Instances [{}] has been fetched for table [{}], page request [{}]\", instancesEntity.getRelationName(),\n tableName, pageRequestDto);\n return PageDto.of(dataList, pageRequestDto.getPage(), totalElements);\n }",
"List<VmInstance> findAllByDomain(Long domainId, Long userId, String searchText) throws Exception;",
"public PagedIterable<Instance> list(@Nullable ListOptions listOptions);",
"java.util.List<com.google.cloud.baremetalsolution.v2.InstanceConfig> getInstancesList();",
"List<VmInstance> findInstanceByGroup(Long id) throws Exception;",
"ResultPagingVO getSiteMngListPaged(HashMap<String, Object> options) throws Exception;",
"Collection<Instance> getInstances();",
"public List<VerticalServiceInstance> getAllVsInstances(String tenantId) {\n\t\tlog.debug(\"Get vs instances for tenant:\"+tenantId);\n\t\treturn vsInstanceRepository.findByTenantId(tenantId);\n\t}",
"public List<VerticalServiceInstance> getAllVsInstances() {\n\t\treturn vsInstanceRepository.findAll();\n\t}",
"public List<ComputerDTO> getAll(PageRequest pageRequest);",
"List<KVPair> findAll(Pageable page);",
"LiveData<PagedList<Response>> pagedList();",
"public List<ServiceInstance> getAllInstances(String serviceName, ServiceInstanceQuery query);",
"@Override\n @GET\n @Path(\"/vms\")\n @Produces(\"application/json\")\n public Response getVMs() throws Exception {\n log.trace(\"getVMs() started.\");\n JSONArray json = new JSONArray();\n for (Vm vm : cluster.getVmList()) {\n JSONObject o = new JSONObject();\n String uri = String.format(\"%s/vms/%d\", rootUri, vm.getVmId());\n String vmUri = String.format(\"/providers/%d/vms/%d\", provider.getProviderId(), vm.getVmId());\n o.put(\"uri\", uri);\n o.put(\"baseUri\", vmUri);\n json.put(o);\n }\n\n log.trace(\"getVMs() finished successfully.\");\n return Response.ok(json.toString()).build();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a lemon as ingredient. | public static IIngredient Lemon()
{
IIngredient oLemon = (IIngredient) new Produce();
oLemon.setName("Lemon");
oLemon.setOrganic(false);
oLemon.setPrice(new BigDecimal("2.03"));
oLemon.setUnit("");
return oLemon;
} | [
"public CraftingIngredient getIngredient();",
"public static ItemIngredient of(String input) {\n\t\treturn new OreItemIngredient(input, 1);\n\t}",
"@Override\n public String toString() {\n\n return this.ingredient.toString();\n }",
"private RecipeIngredient getBaseMalt() {\n\t\tRecipeIngredient baseMalt = null;\n\t\tfor (RecipeIngredient ri : m_ingredientList) {\n\t\t\tif (ri.getIngredient().getType() == Ingredient.Type.MALT) {\n\t\t\t\tif (baseMalt == null) { baseMalt = ri; }\n\t\t\t\telse if ( ((Malt) ri.getIngredient()).getSrm() < ((Malt) baseMalt.getIngredient()).getSrm() ){\n\t\t\t\t\tbaseMalt = ri;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn baseMalt;\n\t}",
"public static ItemIngredient of(Item input) {\n\t\treturn new ItemStackIngredient(new ItemStack(input, 1, OreDictionary.WILDCARD_VALUE));\n\t}",
"public static IIngredient Gralic()\r\n {\r\n IIngredient oGarlic = (IIngredient) new Produce();\r\n oGarlic.setName(\"Organic Garlic\");\r\n oGarlic.setOrganic(true);\r\n oGarlic.setPrice(new BigDecimal(\"0.67\"));\r\n oGarlic.setUnit(\"Clove\");\r\n \r\n return oGarlic;\r\n }",
"public static ItemIngredient of(Block input) {\n\t\treturn of(ItemBlock.getItemFromBlock(input));\n\t}",
"public Ingredient getIngredient(int i) {\r\n\t\treturn this.ingredients.get(i);\r\n\t}",
"public static ItemIngredient of(ItemStack input) {\n\t\treturn new ItemStackIngredient(input);\n\t}",
"public String ingredientsAsString() {\n\t\tString string=\"\";\n\t\tfor (int i=0;i<ingredients.size();i++){\n\t\t\tstring=string+\" toppedBy \"+ingredients.get(i).getName();\n\t\t}\n\t\treturn \"crust\"+string;\n\t}",
"public String getIngredients() {\n return ingredients;\n }",
"public org.hl7.fhir.SubstanceIngredient addNewIngredient()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.SubstanceIngredient target = null;\n target = (org.hl7.fhir.SubstanceIngredient)get_store().add_element_user(INGREDIENT$6);\n return target;\n }\n }",
"public Long getIngredientId() {\n\t\treturn ingredientId;\n\t}",
"@Override\n\tpublic Integer getInventoryForAIngredient(Ingredient ingredient){\n\t\treturn beverageInventoryMap.get(ingredient);\n\t}",
"public Ingrediente buscarIngrediente(String nombre) {\n Ingrediente ingrediente = null;\n \n for(int i = 0; i < this.ingredientes.size(); i++) {\n \n if(nombre.equals(this.ingredientes.get(i))) {\n ingrediente = this.ingredientes.get(i);\n }\n \n }\n \n return ingrediente;\n }",
"@ZenCodeType.Method\n @ZenCodeType.Getter(\"input\")\n public static ItemStackIngredient getInput(SawmillRecipe _this) {\n return _this.getInput();\n }",
"public Ingredient makeIngredient(String ingredient) {\n\t\tSystem.out.println(\"makeIng: \" + ingredient);\n\t\tIngredient tempIngredient = new Ingredient();\n\t\tString[] splitArray = ingredient.split(\",\");\n\t\tdouble amount = 0;\n\n\t\t// check to see if three values are present\n\t\tif (splitArray.length != 3) {\n\t\t\tLog.i(\"MainActivity:makeIngredient\", \"INVALID PARAM Length = \" + ingredient.length());\n\t\t}\n\n\t\tfor (int i = 0; i < splitArray.length; i++) {\n\t\t\tString tempName = splitArray[0];\n\t\t\tString tempType = splitArray[1];\n\t\t\t// get and parse double amount\n\t\t\tif (i == 2) {\n\t\t\t\ttry {\n\t\t\t\t\tamount = Double.parseDouble(splitArray[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.e(\"MainActivity:makeIngredient\", \"Could not parse double ofr ingredient\");\n\t\t\t\t}\n\t\t\t}\n\t\t\ttempIngredient.setIngredientName(tempName);\n\t\t\ttempIngredient.setIngredientType(tempType);\n\t\t\ttempIngredient.setIngredientAmount(amount);\n\t\t}\n\t\treturn tempIngredient;\n\t}",
"public void setIngredient(CraftingIngredient ingredient);",
"Ingredient findById(int id);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Specifies a California county. .opencannabis.geo.usa.ca.CaliforniaCounty california_county = 3; | public Builder setCaliforniaCounty(io.opencannabis.schema.geo.usa.California.CaliforniaCounty value) {
if (value == null) {
throw new NullPointerException();
}
countyCase_ = 3;
county_ = value.getNumber();
onChanged();
return this;
} | [
"public Builder setCaliforniaCounty(io.opencannabis.schema.geo.usa.California.CaliforniaCounty value) {\n if (value == null) {\n throw new NullPointerException();\n }\n countyCase_ = 2;\n county_ = value.getNumber();\n onChanged();\n return this;\n }",
"public void setCounty(String county) {\r\n this.county = county;\r\n }",
"io.opencannabis.schema.geo.usa.California.CaliforniaCounty getCaliforniaCounty();",
"public void setCounty(String county) {\n this.county = county;\n }",
"public void setCounty(java.lang.String county) {\n this.county = county;\n }",
"public void setAddrcounty(String addrcounty) {\n this.addrcounty = addrcounty;\n }",
"public void setCountyInternal(java.lang.String value) {\n __getInternalInterface().setFieldValueForCodegen(COUNTYINTERNAL_PROP.get(), value);\n }",
"public void setCounty_id(String county_id) {\n this.county_id = county_id;\n }",
"public void setCountyName(String countyName) {\n this.countyName = countyName;\n }",
"public void setCountyname(String countyname) {\n this.countyname = countyname;\n }",
"public String getCounty() {\n return _county;\n }",
"private void setCountyInternal(java.lang.String value) {\n __getInternalInterface().setFieldValueForCodegen(COUNTYINTERNAL_PROP.get(), value);\n }",
"public Builder setCountyName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n countyCase_ = 2;\n county_ = value;\n onChanged();\n return this;\n }",
"public String getCounty() {\n return county;\n }",
"public String getAddrcounty() {\n return addrcounty;\n }",
"public String getCounty() {\r\n return county;\r\n }",
"public String getCounty() {\n return county;\n }",
"public void setCountyid(Integer countyid) {\n this.countyid = countyid;\n }",
"public void setCountyId(Long countyId) {\n this.countyId = countyId;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if the state passed in is in the set of final states. | public boolean isFinalState(final State state) {
return finalStates.contains(state);
} | [
"public boolean isFinal(State s) {\n\t\treturn finalStates.contains(s);\n\t}",
"private boolean checkFinalStates() {\r\n Iterator<State> iterator = estados_finales.iterator();\r\n while (iterator.hasNext()){\r\n if (!estados.contains(iterator.next())){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"public boolean isFinalState() {\n return finalState[currentState.getValue()];\n }",
"private boolean accept(){\n for(String state : activeStates){\n if(this.finals.contains(state)){\n return true;\n }\n }\n return false;\n }",
"public boolean isGoalState(){\r\n int count = 0;\r\n for(Integer integer: getStateList()){\r\n if(integer != count) {\r\n return false;\r\n }\r\n count++;\r\n }\r\n return true;\r\n }",
"public boolean isInState(State<T> state) {\n System.out.println(this.currentState.getClass());\n return this.currentState.getClass() == state.getClass();\n }",
"private boolean hasUniqueState()\n {\n return (getExternalArcState() == getMiddleArcState() && getExternalArcState() == getInternalArcState() && getExternalArcState() == getCircleState());\n }",
"public boolean isFinal(){\n\t\treturn status == INITIAL_FINAL || status == FINAL;\n\t}",
"public boolean isInState(STATE_TYPE state) {\n return getStateManager().getState() == state;\n }",
"public ArrayList<State> getSetOfFinalStates() {\n ArrayList<State> setOfFinalStates = new ArrayList<>();\n for (State state : states) {\n if (state.isFinalState()) {\n setOfFinalStates.add(state);\n }\n }\n return setOfFinalStates;\n }",
"@Override\n\tpublic boolean isIsFinal() {\n\t\treturn _esfTournament.isIsFinal();\n\t}",
"@Override\n\tpublic boolean checkState(ActorState state) {\n\t\treturn myStates.contains(state);\n\t}",
"boolean hasHasState();",
"public boolean isFinal() {\n return ((respcode & FINAL) == FINAL);\n }",
"protected boolean planHasDupilicateStates(SearchNode lastVisitedNode){\n\t\t\n\t\tSet<HashableState> statesInPlan = new HashSet<HashableState>();\n\t\tSearchNode curNode = lastVisitedNode;\n\t\twhile(curNode.backPointer != null){\n\t\t\tif(statesInPlan.contains(curNode.s)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tstatesInPlan.add(curNode.s);\n\t\t\tcurNode = curNode.backPointer;\n\t\t}\n\t\treturn false;\n\t\t\n\t}",
"boolean hasConsensusState();",
"private void detectFinalStates() {\n for (Map.Entry<ObjectLifeCycle, Collection<DataObjectState>> entry\n : dataStatesPerOLC.entrySet()) {\n Collection<DataObjectState> finalStates = new HashSet<>();\n for (DataObjectState dataObjectState : entry.getValue()) {\n entry.getKey().addNode(dataObjectState);\n if (dataObjectState.getOutgoingEdges().isEmpty()) {\n finalStates.add(dataObjectState);\n }\n }\n for (DataObjectState finalState : finalStates) {\n entry.getKey().addFinalNode(finalState);\n }\n }\n }",
"public boolean is_final() {\r\n boolean is_final = true;\r\n for(int i = 0; i < this.board.length; i++) {\r\n for(int j = 0; j < this.board[i].length; j++) {\r\n if((this.board[i][j] != 0 && this.board[i][j] != i*this.board.length + j + 1)\r\n || (this.board[i][j] == 0 && (i != this.board.length-1 || j != this.board[0].length-1))) {\r\n is_final = false;\r\n break;\r\n }\r\n }\r\n if(!is_final)\r\n break;\r\n }\r\n return is_final;\r\n }",
"public abstract boolean isGoal(State state);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the baseline position. Indicates whether the bars are topalign or bottomaligned. | public BaselineAlignment getBaselinePosition() {
return baselinePosition;
} | [
"public int getBaselinePosition() {\r\n\t\treturn baseline;\r\n\t}",
"public int getBaselinePosition()\r\n {\r\n return inner.getBaselinePosition();\r\n }",
"protected double getTextBaselinePosition() {\n if (bcBean.getMsgPosition() == HumanReadablePlacement.HRP_TOP) {\n double ty = bcBean.getHumanReadableHeight();\n if (bcBean.hasFontDescender()) {\n ty -= bcBean.getHumanReadableHeight() / 13 * 3;\n }\n return ty;\n } else if (bcBean.getMsgPosition() == HumanReadablePlacement.HRP_BOTTOM) {\n double ty = bcBean.getHeight();\n if (bcBean.hasFontDescender()) {\n ty -= bcBean.getHumanReadableHeight() / 13 * 3;\n }\n return ty;\n } else {\n throw new IllegalStateException(\"not applicable\");\n }\n }",
"public double getBaseline() {\n return getLayoutBounds().getHeight();\n }",
"public double getBaseline() {\n\t\treturn this.baseline;\n\t}",
"public int getBaseline()\r\n\t{\r\n\t\t\r\n\t\tif(pagelayout.util.NamedSeparator.class.isInstance(c))\r\n\t\t{\r\n\t\t return ((pagelayout.util.NamedSeparator)c).getBaseline();\t\r\n\t\t}\r\n\t\telse if(JComponent.class.isInstance(c))\r\n\t\t{\r\n\t\t\t//Dimension d=c.getPreferredSize();\r\n\t\t\t//return ((JComponent)c).getBaseline(d.width,d.height);\r\n\t\t\treturn org.jdesktop.layout.Baseline.getBaseline(\r\n\t\t\t(JComponent)c);\r\n\t\t}\r\n\t\treturn -1;\r\n\t}",
"public double baseline()\n\t{\n\t\treturn _baseline;\n\t}",
"@Override\n public String getTextBaseline() {\n return graphicsEnvironmentImpl.getTextBaseline(canvas);\n }",
"public boolean isBaselineAligned() {\n return mBaselineAligned;\n }",
"public void setTextBaseline(TEXT_BASELINE baseline);",
"public void setBaselinePosition(BaselineAlignment baselinePosition) {\n this.baselinePosition = baselinePosition;\n }",
"public Integer getBaselineForEarnedValue()\r\n {\r\n return (m_baselineForEarnedValue);\r\n }",
"public double getBaselineValueFromThisSequence() {\n return baseline;\n }",
"public Double getBaselineValue() {\n if (parent==null) return baseline;\n else return ((NumericDataset)parent).getBaselineValue();\n }",
"int getLineBaseline(int line);",
"public String getVerticalAlign();",
"public int getLastOffsetForLine(int baseline) {\n TextFragmentBox box;\n List fragments = getFragmentsWithoutBorder();\n for (int i = fragments.size() - 1; i >= 0; i--) {\n box = (TextFragmentBox) fragments.get(i);\n if (baseline == box.getBaseline())\n return box.offset + box.length - 1;\n }\n return -1;\n }",
"public int getFirstOffsetForLine(int baseline) {\n TextFragmentBox box;\n List fragments = getFragmentsWithoutBorder();\n for (int i = 0; i < fragments.size(); i++) {\n box = (TextFragmentBox) fragments.get(i);\n if (baseline == box.getBaseline())\n return box.offset;\n }\n return -1;\n }",
"private String determineBaseline() {\r\n\t\tif (baseline == null) {\r\n\t\t\tString strm = determineStream();\r\n\t\t\tlog(\"Determining baseline from stream [\" + stream + \"]\",\r\n\t\t\t\t\tProject.MSG_VERBOSE);\r\n\t\t\tList<String> foundation = ClearCaseUtils.getFoundationBaselines(\r\n\t\t\t\t\tstrm, getProject(), getCleartoolHome());\r\n\t\t\tif (foundation.size() > 0) {\r\n\t\t\t\t// always take first baseline as a build stream should only have\r\n\t\t\t\t// one.\r\n\t\t\t\tbaseline = foundation.get(0);\r\n\t\t\t\tlog(\"Using derived baseline [\" + baseline + \"]\",\r\n\t\t\t\t\t\tProject.MSG_DEBUG);\r\n\t\t\t} else {\r\n\t\t\t\tthrow new BuildException(\r\n\t\t\t\t\t\t\"Unable to determine baseline to check against. ViewTag[\"\r\n\t\t\t\t\t\t\t\t+ getViewTag() + \"]\", getLocation());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn baseline;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verifies the store and remove outdated or lost files. | public synchronized void verifyStore(BigInteger key) throws IOException {
//@added, support for exported files.
//sh, 22.09.2011
Map<BigInteger, StoreEntry> store = trans.get(key);
//String pstore = path+File.separator+key.toString();
//File dir = new File(pstore);
File dir = pStore(key);
//cleanup empty stores
if(store == null){
cleanupInffile(key);
cleanupDirectory(key, dir, true);
cleanupExtern(key);
return;
}
//test physical files
if(dir.exists()) {
for(File file:dir.listFiles()){
//skip and ignore a directory
if(file.isDirectory())
continue;
//test file
file = wrapToResource(key, file);
try{
BigInteger id = parseLong(file.getName());
if( ! store.containsKey(id) )
killFile(file);
}catch(NumberFormatException e){ /*does nothing*/ }
}
}
//test entries
Iterator<BigInteger> iter = store.keySet().iterator();
while(iter.hasNext()){
BigInteger id = iter.next();
//StoreEntry entry = (StoreEntry)store.get(id);
//String fstore = pstore+File.separator+id.toString();
//File file = new File(fstore);
Resource file = fStore(dir, key, id);
if( ! file.exists())
iter.remove();
}
} | [
"private synchronized void verifyAllFiles() {\n if (getSha1Urn() == null)\n return;\n\n for (Iterator<RemoteFileDesc> iter = cachedRFDs.iterator(); iter.hasNext();) {\n RemoteFileDesc rfd = iter.next();\n if (rfd.getSHA1Urn() != null && !getSha1Urn().equals(rfd.getSHA1Urn()))\n iter.remove();\n }\n }",
"void resetStore() {\n File storeFile = new File(getStoreName());\n if (storeFile.exists()) {\n storeFile.delete();\n }\n }",
"protected void verifyOldVersionsCleaned() throws Exception {\n boolean retry;\n\n try {\n runVacuumSync();\n\n // Check versions.\n retry = !checkOldVersions(false);\n }\n catch (Exception e) {\n U.warn(log(), \"Failed to perform vacuum, will retry.\", e);\n\n retry = true;\n }\n\n if (retry) { // Retry on a stable topology with a newer snapshot.\n awaitPartitionMapExchange();\n\n waitMvccQueriesDone();\n\n runVacuumSync();\n\n checkOldVersions(true);\n }\n }",
"private void checkFiles() {\n File[] files = getAllSavedGames();\n\n if (files != null && files.length >= MAX_SAVED_GAMES) {\n deleteFile(olderFile(files));\n }\n }",
"@Override\n\tpublic void delete()\n\t{\n\t\tcachedContent = null;\n\t\tFile outputFile = getStoreLocation();\n\t\tif ((outputFile != null) && outputFile.exists())\n\t\t{\n\t\t\tif (Files.remove(outputFile) == false)\n\t\t\t{\n\t\t\t\tlog.error(\"failed to delete file: \" + outputFile.getAbsolutePath());\n\t\t\t}\n\t\t}\n\t}",
"void purgeSwapFiles();",
"public void uploadOutdatedFiles() {\n\n try {\n fileUploader.initialize();\n } catch (InitializeException e) {\n logger.log(Level.SEVERE, \"could not initialize file uploader\", e);\n throw new RuntimeException(\"could not initialize file uploader\", e);\n }\n\n try {\n\n Set<Resource> remoteResources = new HashSet<>(fileUploader.getRemoteHashes());\n\n Set<LocalResource> localResources =\n new HashSet<>(fileTraverser.getLocalResources());\n\n logger.log(Level.INFO, \"found \" + localResources.size() + \"resources\");\n\n Set<Resource> toBeRemovedOrChanged = new HashSet<>(remoteResources);\n\n toBeRemovedOrChanged.removeAll(localResources);\n\n Set<LocalResource> toBeUploaded = new HashSet<>(localResources);\n\n toBeUploaded.removeAll(remoteResources);\n\n Set<ResourceKey> toBeRemoved = copyResources(toBeRemovedOrChanged);\n\n Set<ResourceKey> toBeUploadedKeys = copyResources(toBeUploaded);\n\n toBeRemoved.removeAll(toBeUploadedKeys);\n\n if (logger.isLoggable(Level.INFO)) {\n logger.log(Level.INFO, toBeUploaded.size() + \" file(s) to upload and \" + toBeRemoved.size()\n + \" files(s) to delete\");\n }\n\n uploadResources(toBeUploaded);\n\n removeResources(toBeRemoved);\n } catch (IOException e) {\n logger.log(Level.SEVERE, \"can not upload files\", e);\n throw new RuntimeException(\"can not upload files\", e);\n } finally {\n fileUploader.uninitialize();\n }\n }",
"@AfterClass\n\tpublic static void restore() {\n\t\tFile [] configFiles = data.getConfigFile().listFiles();\n\t\tFile [] contactFiles = data.getContactFile().listFiles();\n\t\tfor(int i = 0; i < configFiles.length; ++i)\n\t\t\tconfigFiles[i].delete();\n\t\tfor(int i = 0; i < contactFiles.length; ++i)\n\t\t\tcontactFiles[i].delete();\n\t}",
"private void cleanupTestFilesStructure() {\r\n testLoadFile.delete();\r\n testPurgeFile.delete();\r\n testLoadDirectory.delete();\r\n File[] files = testArchiveDir.listFiles();\r\n if (files != null)\r\n for (File file : files) {\r\n file.delete();\r\n }\r\n testArchiveDir.delete();\r\n }",
"void cleanCompareManager();",
"@Override\r\n public boolean clean() {\n Set<String> names = getStoreNames();\r\n boolean hasStores = !names.isEmpty();\r\n if (hasStores) {\r\n names.stream().forEach(this::dropStore);\r\n }\r\n dropStore(STORE_TYPES_NAME);\r\n close();\r\n return hasStores;\r\n }",
"public static synchronized void deleteViewStore() {\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.deleteViewStore\");\n String viewStoreName = System.getProperty(USER_DIR)\n + File.separator\n + QVCSConstants.QVCS_ADMIN_DATA_DIRECTORY\n + File.separator\n + QVCSConstants.QVCS_VIEW_STORE_NAME + \"dat\";\n File viewStoreFile = new File(viewStoreName);\n if (viewStoreFile.exists()) {\n viewStoreFile.delete();\n }\n }",
"public synchronized static void cleanOldFiles() {\n\t\tGregorianCalendar yesterday = new GregorianCalendar();\n\t\tyesterday.roll(GregorianCalendar.HOUR_OF_DAY,-4);\n\t\tcleanOldFiles(yesterday.getTime());\n\t}",
"private static void cleanUpGlobalStateAndFileStore() {\n FileUtils.deleteDirectory(Paths.get(GLOBAL_STATE_DIR));\n }",
"private void doRemoveObsoleteFiles()\n\t{\n\t\tElement obsolete;\n\t\tFile f;\n\t\tString filename;\n\t\tNodeList obsoleteFiles = remoteXML.getObsoleteNodes();\n\t\tint filecount = obsoleteFiles.getLength();\n\t\t\n\t\tfor( int i=0; i<filecount; i++ )\n\t\t{\n\t\t\tobsolete = (Element)obsoleteFiles.item(i);\n\t\t\tfilename = obsolete.getAttribute(\"dest\");\n\t\t\tf = new File( filename );\n\t\t\tif( f.exists() )\n\t\t\t{\n\t\t\t\tpublish(\n\t \t\t\t\tproperties.getProperty(\"updater.msg.delete\")\n\t \t\t\t\t\t+ filename\n\t \t\t\t);\n\t\t\t\tf.delete();\n\t\t\t}\n\t\t}\n\t}",
"private void assertObsoleteStorageDeleted() throws Exception {\n assertThat(analyticsLoggingRepository.getEventsBatch()).isEmpty();\n // Assert no country entities are stored anymore.\n assertThat(countryRepository.getRecentlySeenCountryCodes(Instant.ofEpochMilli(0))).isEmpty();\n // Assert no revision tokens are stored anymore.\n assertThat(diagnosisRepository.getMostRecentRevisionTokenAsync().get()).isNull();\n // Assert no download server entities are stored anymore.\n assertThat(downloadServerRepository.getMostRecentSuccessfulDownload(index)).isNull();\n // Assert no exposure entities are stored anymore.\n assertThat(exposureRepository.getAllExposureEntities()).isEmpty();\n // Assert no exposure checks are stored anymore.\n assertThat(exposureCheckRepository.getAllExposureChecks()).isEmpty();\n // Assert no requests for a verification code are stored anymore.\n assertThat(verificationCodeRequestRepository.getAll()).isEmpty();\n // Assert that no worker status entities are stored anymore.\n assertThat(workerStatusRepository.getLastRunTimestamp(WorkerTask.TASK_PROVIDE_DIAGNOSIS_KEYS,\n Status.STATUS_STARTED.toString())).isEqualTo(Optional.absent());\n }",
"public void delete() {\r\n this.cachedContent = null;\r\n File outputFile = getStoreLocation();\r\n if (outputFile != null && outputFile.exists()) {\r\n outputFile.delete();\r\n }\r\n }",
"private void cleanUpPrevayler() {\n File dir = new File(\"./database/prevaylerBase\");\n\n if (dir.isDirectory()) {\n File[] files = dir.listFiles();\n\n for (int i = 0; i < files.length; i++) {\n File file = files[i];\n file.delete();\n }\n }\n }",
"public synchronized static void cleanOldFiles(Date old){\n\t\tfor(File item:context.getCacheDir().listFiles()){\n\t\t\tDate last = new Date(item.lastModified());\n\t\t\tif(last.before(old))\n\t\t\t\titem.delete();\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.